@xopcai/xopc 0.0.111 → 0.0.112

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 (428) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
  3. package/dist/extensions/feishu/src/workflow-progress.js +1 -1
  4. package/dist/extensions/telegram/src/adapters/streaming-adapter.js +1 -1
  5. package/dist/extensions/telegram/src/inbound-processor.js +1 -1
  6. package/dist/extensions/telegram/src/plugin.js +1 -1
  7. package/dist/extensions/telegram/src/routing-integration.js +2 -2
  8. package/dist/extensions/telegram/src/update-offset-store.js +1 -1
  9. package/dist/extensions/telegram/src/workflow-progress.js +1 -1
  10. package/dist/extensions/telegram/xopc.extension.json +1 -1
  11. package/dist/extensions/weixin/src/api/api.js +2 -2
  12. package/dist/extensions/weixin/src/auth/accounts.js +1 -1
  13. package/dist/extensions/weixin/src/cdn/upload.js +1 -1
  14. package/dist/extensions/weixin/src/media/data-url.js +1 -1
  15. package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
  16. package/dist/extensions/weixin/src/messaging/inbound.js +1 -1
  17. package/dist/extensions/weixin/src/messaging/process-message.js +1 -1
  18. package/dist/extensions/weixin/src/plugin.js +1 -1
  19. package/dist/extensions/weixin/src/storage/sync-buf.js +1 -1
  20. package/dist/extensions/weixin/src/workflow-progress.js +1 -1
  21. package/dist/gateway/static/root/apple-touch-icon.png +0 -0
  22. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-zlx9l5Yp.js → agent-avatar-dicebear-EhRp-ZMa.js} +1 -1
  23. package/dist/gateway/static/root/assets/agent-browser-settings-page-H4foVCiS.js +6 -0
  24. package/dist/gateway/static/root/assets/{agent-defaults-tabbed-page-Bz7JWjRM.js → agent-defaults-tabbed-page-DDNw2oNU.js} +1 -1
  25. package/dist/gateway/static/root/assets/agents-E_X2kzS1.js +71 -0
  26. package/dist/gateway/static/root/assets/{app-management-settings-panel-DaQwdeCq.js → app-management-settings-panel-BIy7KEsM.js} +1 -1
  27. package/dist/gateway/static/root/assets/{appearance-settings-D2zv6r3P.js → appearance-settings-DGQG8NwA.js} +1 -1
  28. package/dist/gateway/static/root/assets/{apps-page-BIppe_jj.js → apps-page-BZLvInLr.js} +1 -1
  29. package/dist/gateway/static/root/assets/{archive-plugin-DEmu8eH7.js → archive-plugin-uuQPupqx.js} +1 -1
  30. package/dist/gateway/static/root/assets/{attachment-load-B98lJoN5.js → attachment-load-DBkv0cAv.js} +1 -1
  31. package/dist/gateway/static/root/assets/{binary-plugins-CL9QKmyo.js → binary-plugins-DxxN_VAR.js} +1 -1
  32. package/dist/gateway/static/root/assets/{block-editor-BOAhMAhT.js → block-editor-CwnUlRmO.js} +1 -1
  33. package/dist/gateway/static/root/assets/{channels-settings-Br8iRnXp.js → channels-settings-BHvUKlzw.js} +1 -1
  34. package/dist/gateway/static/root/assets/{config-api-0o1WYdz2.js → config-api-BD-NcD5d.js} +1 -1
  35. package/dist/gateway/static/root/assets/config-reload-event-Bjh2zoKp.js +1 -0
  36. package/dist/gateway/static/root/assets/connectors-settings-VBzXcEXL.js +2 -0
  37. package/dist/gateway/static/root/assets/cron-api-C5DoipZA.js +1 -0
  38. package/dist/gateway/static/root/assets/cron-page-BLTpdm34.js +3 -0
  39. package/dist/gateway/static/root/assets/dreaming-settings-DSVhXTPq.js +1 -0
  40. package/dist/gateway/static/root/assets/{extension-debug-page-Cjx6pZVz.js → extension-debug-page-BDHA9o_e.js} +1 -1
  41. package/dist/gateway/static/root/assets/{extension-page-BSPNL90V.js → extension-page-DmDLVSPE.js} +1 -1
  42. package/dist/gateway/static/root/assets/extension-settings-page-1124aHw_.js +1 -0
  43. package/dist/gateway/static/root/assets/{fetch-Bs7in_4F.js → fetch-DOe56Wmy.js} +1 -1
  44. package/dist/gateway/static/root/assets/format-cron-label-BsotZDO5.js +2 -0
  45. package/dist/gateway/static/root/assets/{format-interval-label-CftJ5uXu.js → format-interval-label-tsMSvBSR.js} +1 -1
  46. package/dist/gateway/static/root/assets/{gateway-config-api-Clfck-hW.js → gateway-config-api-CsD4FC9D.js} +1 -1
  47. package/dist/gateway/static/root/assets/gateway-settings-HQ8FBhY2.js +1 -0
  48. package/dist/gateway/static/root/assets/{gateway-startup-retry-BkjVJc38.js → gateway-startup-retry-C1zg7pH3.js} +1 -1
  49. package/dist/gateway/static/root/assets/{goal-detail-page-kqJue0sE.js → goal-detail-page-BG3Onph0.js} +1 -1
  50. package/dist/gateway/static/root/assets/goals-page-DgeKn8zL.js +2 -0
  51. package/dist/gateway/static/root/assets/{goals-settings-CJnzNSDo.js → goals-settings-B5nI6lgz.js} +1 -1
  52. package/dist/gateway/static/root/assets/{heartbeat-config-api-Cp7CPuIn.js → heartbeat-config-api-CIv42nJD.js} +1 -1
  53. package/dist/gateway/static/root/assets/{heartbeat-settings-ifSI1Wbh.js → heartbeat-settings-DFcVuJ3M.js} +1 -1
  54. package/dist/gateway/static/root/assets/index-5A_ZaABy.css +1 -0
  55. package/dist/gateway/static/root/assets/index-BTmbp2AU.js +121 -0
  56. package/dist/gateway/static/root/assets/interval-presets-DGP3S7OB.js +1 -0
  57. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings--MI1rYl7.js → keyboard-shortcuts-settings-fETaDYQP.js} +1 -1
  58. package/dist/gateway/static/root/assets/{logs-page-BwrVNlyW.js → logs-page-B1-b27lK.js} +1 -1
  59. package/dist/gateway/static/root/assets/{markdown-split-B_oc9lJe.js → markdown-split-CgeBJMOD.js} +1 -1
  60. package/dist/gateway/static/root/assets/{media-plugins-DLPvB5H3.js → media-plugins-C30GzlV2.js} +1 -1
  61. package/dist/gateway/static/root/assets/messages-BUUfPaZ9.js +3 -0
  62. package/dist/gateway/static/root/assets/models-hub-panel-DPcTS1-u.js +2 -0
  63. package/dist/gateway/static/root/assets/note-detail-page-xeGb4owe.js +2 -0
  64. package/dist/gateway/static/root/assets/{note-image-lightbox-rSqAgOi9.js → note-image-lightbox-t1g0qZYh.js} +1 -1
  65. package/dist/gateway/static/root/assets/{notes-page-C9ACGEty.js → notes-page-C_TdnKBe.js} +1 -1
  66. package/dist/gateway/static/root/assets/{preview-open-alternatives-Bw_N2oZi.js → preview-open-alternatives-DeWp9x5g.js} +1 -1
  67. package/dist/gateway/static/root/assets/{remote-access-hub-BhcWIKuM.js → remote-access-hub-BtkPmJIN.js} +1 -1
  68. package/dist/gateway/static/root/assets/{save-bar-controls-CNP2jmw0.js → save-bar-controls-BOaAOJI3.js} +1 -1
  69. package/dist/gateway/static/root/assets/schedule-field-BLWLKqgw.js +1 -0
  70. package/dist/gateway/static/root/assets/{schema-form-CDPzua9q.js → schema-form-plqRFYT8.js} +1 -1
  71. package/dist/gateway/static/root/assets/{sessions-page-DzkpSDZr.js → sessions-page-DOUjxzJm.js} +1 -1
  72. package/dist/gateway/static/root/assets/settings-advanced-gate-qK_bnTrw.js +1 -0
  73. package/dist/gateway/static/root/assets/{settings-collapsible-section-C9bff85B.js → settings-collapsible-section-BP5zRrDI.js} +1 -1
  74. package/dist/gateway/static/root/assets/settings-form-section-Bv8MZplG.js +1 -0
  75. package/dist/gateway/static/root/assets/{settings-page-DWK4Zo7s.js → settings-page-DmDfE1ww.js} +1 -1
  76. package/dist/gateway/static/root/assets/setup-status-panel-BEFwNcIZ.js +1 -0
  77. package/dist/gateway/static/root/assets/{share-preview-page-DnutoY_S.js → share-preview-page-4OX1YCgp.js} +1 -1
  78. package/dist/gateway/static/root/assets/{shares-settings-6oRgJMpn.js → shares-settings-CbKmJZot.js} +1 -1
  79. package/dist/gateway/static/root/assets/skill-reload-api-YdtnUHtK.js +1 -0
  80. package/dist/gateway/static/root/assets/skills-page-DwW1IzQ0.js +2 -0
  81. package/dist/gateway/static/root/assets/{system-settings-panel-qP1JDtDd.js → system-settings-panel-CGy4f_s2.js} +1 -1
  82. package/dist/gateway/static/root/assets/use-agent-defaults-form-BMuMvzl_.js +1 -0
  83. package/dist/gateway/static/root/assets/{use-channel-catalog-C4mg1hjD.js → use-channel-catalog-CjGHnDvN.js} +1 -1
  84. package/dist/gateway/static/root/assets/{use-settings-tab-guard-F6C0mpJt.js → use-settings-tab-guard-BMMFa0oA.js} +1 -1
  85. package/dist/gateway/static/root/assets/{voice-api-key-field-BnDDb6qO.js → voice-api-key-field-DnRbhMNq.js} +1 -1
  86. package/dist/gateway/static/root/assets/{voice-player-store-B2EwIhtY.js → voice-player-store-D5vzWwls.js} +1 -1
  87. package/dist/gateway/static/root/assets/{workflow-page.utils-CRB7WX9l.js → workflow-page.utils-tjGpRVnw.js} +1 -1
  88. package/dist/gateway/static/root/assets/{workflows-page-2Fptr0je.js → workflows-page-DqqHKGj2.js} +1 -1
  89. package/dist/gateway/static/root/favicon-16x16.png +0 -0
  90. package/dist/gateway/static/root/favicon-32x32.png +0 -0
  91. package/dist/gateway/static/root/favicon.ico +0 -0
  92. package/dist/gateway/static/root/favicon.svg +14 -12
  93. package/dist/gateway/static/root/index.html +11 -10
  94. package/dist/package.js +1 -1
  95. package/dist/src/agent/agent-manager.d.ts +28 -2
  96. package/dist/src/agent/agent-manager.js +82 -11
  97. package/dist/src/agent/agent-manager.js.map +1 -1
  98. package/dist/src/agent/agent-scope.js +1 -1
  99. package/dist/src/agent/bootstrap/load-bootstrap-files.js +1 -1
  100. package/dist/src/agent/context/workspace-seed.js +2 -2
  101. package/dist/src/agent/context/workspace-state.js +1 -1
  102. package/dist/src/agent/context/workspace.js +1 -1
  103. package/dist/src/agent/goals/goal-locale.js +2 -2
  104. package/dist/src/agent/goals/persistent-goal-service.js +1 -1
  105. package/dist/src/agent/goals/post-turn.js +3 -3
  106. package/dist/src/agent/image/load-image-media.js +2 -2
  107. package/dist/src/agent/ipc/inbox.js +3 -3
  108. package/dist/src/agent/ipc/socket.js +1 -1
  109. package/dist/src/agent/mcp/bundle-mcp-materialize.js +1 -1
  110. package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
  111. package/dist/src/agent/mcp/mcp-transport-config.js +1 -1
  112. package/dist/src/agent/mcp/mcp-transport.js +1 -1
  113. package/dist/src/agent/memory/builtin-memory-store.js +1 -1
  114. package/dist/src/agent/memory/dreaming/deep-promotion.js +1 -1
  115. package/dist/src/agent/memory/dreaming/events.js +1 -1
  116. package/dist/src/agent/memory/dreaming/last-run.js +1 -1
  117. package/dist/src/agent/memory/dreaming/light-sweep.js +1 -1
  118. package/dist/src/agent/memory/dreaming/preview.js +1 -1
  119. package/dist/src/agent/memory/dreaming/rem-patterns.js +1 -1
  120. package/dist/src/agent/memory/dreaming/short-term-store.js +1 -1
  121. package/dist/src/agent/memory/dreaming/utils.js +1 -1
  122. package/dist/src/agent/memory/memory-flush.js +1 -1
  123. package/dist/src/agent/memory/plugin-discovery.js +1 -1
  124. package/dist/src/agent/messaging/command-handler.d.ts +3 -0
  125. package/dist/src/agent/messaging/command-handler.js +5 -0
  126. package/dist/src/agent/messaging/command-handler.js.map +1 -1
  127. package/dist/src/agent/models/manager.js +1 -1
  128. package/dist/src/agent/prompt/memory/index.js +1 -1
  129. package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
  130. package/dist/src/agent/reply/post-compaction-context.js +1 -1
  131. package/dist/src/agent/reply/workspace-boundary-read.js +1 -1
  132. package/dist/src/agent/sandbox/path-policy.js +2 -2
  133. package/dist/src/agent/service/reconcile-dreaming-cron.js +8 -5
  134. package/dist/src/agent/service/reconcile-dreaming-cron.js.map +1 -1
  135. package/dist/src/agent/service.d.ts +2 -1
  136. package/dist/src/agent/service.js +10 -5
  137. package/dist/src/agent/service.js.map +1 -1
  138. package/dist/src/agent/service.types.d.ts +4 -0
  139. package/dist/src/agent/session/session-config-service.d.ts +8 -0
  140. package/dist/src/agent/session/session-config-service.js +20 -0
  141. package/dist/src/agent/session/session-config-service.js.map +1 -1
  142. package/dist/src/agent/session/session-inspector.js +1 -1
  143. package/dist/src/agent/skills/config.js +2 -2
  144. package/dist/src/agent/skills/filesystem-watcher.d.ts +19 -0
  145. package/dist/src/agent/skills/filesystem-watcher.js +182 -0
  146. package/dist/src/agent/skills/filesystem-watcher.js.map +1 -0
  147. package/dist/src/agent/skills/hub-hash.js +2 -2
  148. package/dist/src/agent/skills/hub-lock.js +1 -1
  149. package/dist/src/agent/skills/hub-pull.js +30 -36
  150. package/dist/src/agent/skills/hub-pull.js.map +1 -1
  151. package/dist/src/agent/skills/index.js +82 -38
  152. package/dist/src/agent/skills/index.js.map +1 -1
  153. package/dist/src/agent/skills/installer.js +2 -2
  154. package/dist/src/agent/skills/managed-store.d.ts +19 -0
  155. package/dist/src/agent/skills/managed-store.js +97 -38
  156. package/dist/src/agent/skills/managed-store.js.map +1 -1
  157. package/dist/src/agent/skills/skill-manage-ops.js +1 -1
  158. package/dist/src/agent/skills/skill-manager.d.ts +16 -6
  159. package/dist/src/agent/skills/skill-manager.js +79 -24
  160. package/dist/src/agent/skills/skill-manager.js.map +1 -1
  161. package/dist/src/agent/skills/skill-view-path.js +1 -1
  162. package/dist/src/agent/skills/test-framework.js +1 -1
  163. package/dist/src/agent/skills/types.d.ts +11 -0
  164. package/dist/src/agent/skills/watcher.js +1 -1
  165. package/dist/src/agent/starter-agents.js +1 -1
  166. package/dist/src/agent/tools/cronjob-tool.d.ts +6 -3
  167. package/dist/src/agent/tools/cronjob-tool.js +58 -23
  168. package/dist/src/agent/tools/cronjob-tool.js.map +1 -1
  169. package/dist/src/agent/tools/dreaming-tool.js +1 -1
  170. package/dist/src/agent/tools/factory.js +1 -1
  171. package/dist/src/agent/tools/find.js +1 -1
  172. package/dist/src/agent/tools/grep.js +1 -1
  173. package/dist/src/agent/tools/image-generate-tool.js +1 -1
  174. package/dist/src/agent/tools/skill-manage-tool.js +1 -1
  175. package/dist/src/agent/tools/workflow-tool.js +1 -1
  176. package/dist/src/agent/workflow/catalog.js +1 -1
  177. package/dist/src/agent/workspace-runtime/registry.d.ts +5 -0
  178. package/dist/src/agent/workspace-runtime/registry.js +7 -0
  179. package/dist/src/agent/workspace-runtime/registry.js.map +1 -1
  180. package/dist/src/ai-assist/text-assist.d.ts +39 -0
  181. package/dist/src/ai-assist/text-assist.js +234 -0
  182. package/dist/src/ai-assist/text-assist.js.map +1 -0
  183. package/dist/src/auth/credentials.js +2 -2
  184. package/dist/src/auth/profiles/store.js +2 -2
  185. package/dist/src/auth/sync-provider-auth.js +1 -1
  186. package/dist/src/browser/cache-dir-policy.js +1 -1
  187. package/dist/src/browser/cdp-local-launcher.js +2 -2
  188. package/dist/src/browser/providers/browser-ext-install.js +4 -4
  189. package/dist/src/browser/providers/cloakbrowser.js +5 -5
  190. package/dist/src/browser/providers/playwright-doctor.js +1 -1
  191. package/dist/src/browser/stealth.js +1 -1
  192. package/dist/src/channels/outbound/persist-store.js +1 -1
  193. package/dist/src/channels/pairing/allow-from-file.js +1 -1
  194. package/dist/src/channels/pairing/pairing-store.js +2 -2
  195. package/dist/src/chat-commands/agent-edit.js +2 -2
  196. package/dist/src/chat-commands/builtins/config.js +3 -3
  197. package/dist/src/chat-commands/builtins/system.js +11 -4
  198. package/dist/src/chat-commands/builtins/system.js.map +1 -1
  199. package/dist/src/chat-commands/context.d.ts +3 -0
  200. package/dist/src/chat-commands/context.js +7 -0
  201. package/dist/src/chat-commands/context.js.map +1 -1
  202. package/dist/src/chat-commands/types.d.ts +2 -0
  203. package/dist/src/cli/commands/config.js +1 -1
  204. package/dist/src/cli/commands/cron.js +55 -16
  205. package/dist/src/cli/commands/cron.js.map +1 -1
  206. package/dist/src/cli/commands/doctor/checks/config-health.js +1 -1
  207. package/dist/src/cli/commands/doctor/checks/cron-health.js +2 -83
  208. package/dist/src/cli/commands/doctor/checks/cron-health.js.map +1 -1
  209. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  210. package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
  211. package/dist/src/cli/commands/doctor/checks/state-integrity.js +1 -1
  212. package/dist/src/cli/commands/doctor/checks/workspace-status.js +1 -1
  213. package/dist/src/cli/commands/extension-create.js +1 -1
  214. package/dist/src/cli/commands/extension-dev.js +2 -2
  215. package/dist/src/cli/commands/extension-marketplace.js +2 -2
  216. package/dist/src/cli/commands/extension-pack.js +2 -2
  217. package/dist/src/cli/commands/extension.js +3 -3
  218. package/dist/src/cli/commands/gateway/logs.js +1 -1
  219. package/dist/src/cli/commands/image.js +1 -1
  220. package/dist/src/cli/commands/init.js +2 -2
  221. package/dist/src/cli/commands/models.js +1 -1
  222. package/dist/src/cli/commands/skills-test.js +1 -1
  223. package/dist/src/cli/templates.js +1 -1
  224. package/dist/src/cli/utils/gateway-client.js +1 -1
  225. package/dist/src/cli/utils/init-workspace-core.js +2 -2
  226. package/dist/src/config/agent-profile.js +1 -1
  227. package/dist/src/config/agent-typed-models.js +1 -1
  228. package/dist/src/config/gateway-bind.js +1 -1
  229. package/dist/src/config/index.js +7 -7
  230. package/dist/src/config/loader.js +4 -4
  231. package/dist/src/config/models-json.js +2 -2
  232. package/dist/src/config/paths-state.js +1 -1
  233. package/dist/src/config/paths.js +1 -1
  234. package/dist/src/config/profile.js +1 -1
  235. package/dist/src/config/reload.js +1 -1
  236. package/dist/src/config/schema.d.ts +0 -2
  237. package/dist/src/config/schema.js +0 -3
  238. package/dist/src/config/schema.js.map +1 -1
  239. package/dist/src/config/web-patch.d.ts +0 -1
  240. package/dist/src/config/web-patch.js +0 -2
  241. package/dist/src/config/web-patch.js.map +1 -1
  242. package/dist/src/config/workspace-path.js +1 -1
  243. package/dist/src/cron/executor.js +102 -71
  244. package/dist/src/cron/executor.js.map +1 -1
  245. package/dist/src/cron/index.d.ts +1 -1
  246. package/dist/src/cron/index.js +3 -3
  247. package/dist/src/cron/run-log-store.d.ts +1 -0
  248. package/dist/src/cron/run-log-store.js +4 -2
  249. package/dist/src/cron/run-log-store.js.map +1 -1
  250. package/dist/src/cron/schedule.d.ts +10 -0
  251. package/dist/src/cron/schedule.js +85 -0
  252. package/dist/src/cron/schedule.js.map +1 -0
  253. package/dist/src/cron/service.d.ts +34 -77
  254. package/dist/src/cron/service.js +327 -264
  255. package/dist/src/cron/service.js.map +1 -1
  256. package/dist/src/cron/types.d.ts +78 -48
  257. package/dist/src/cron/validation.d.ts +358 -90
  258. package/dist/src/cron/validation.js +152 -132
  259. package/dist/src/cron/validation.js.map +1 -1
  260. package/dist/src/cron/workflow-run-completion.js +1 -1
  261. package/dist/src/daemon/constants.js +1 -1
  262. package/dist/src/daemon/install-plan.js +2 -2
  263. package/dist/src/daemon/launchd.js +2 -2
  264. package/dist/src/daemon/schtasks.js +2 -2
  265. package/dist/src/daemon/systemd.js +2 -2
  266. package/dist/src/extensions/bundle-mcp.js +1 -1
  267. package/dist/src/extensions/discover-extensions.js +2 -2
  268. package/dist/src/extensions/health.js +1 -1
  269. package/dist/src/extensions/install.js +2 -2
  270. package/dist/src/extensions/loader.js +2 -2
  271. package/dist/src/extensions/lockfile.js +3 -3
  272. package/dist/src/extensions/security.js +1 -1
  273. package/dist/src/extensions/update.js +2 -2
  274. package/dist/src/gateway/agents-admin.js +2 -2
  275. package/dist/src/gateway/chat-stream/mapper.d.ts +1 -0
  276. package/dist/src/gateway/chat-stream/mapper.js +6 -2
  277. package/dist/src/gateway/chat-stream/mapper.js.map +1 -1
  278. package/dist/src/gateway/chat-stream/protocol.d.ts +2 -0
  279. package/dist/src/gateway/file-path-classifier.js +2 -2
  280. package/dist/src/gateway/hono/lib/config-payload.d.ts +0 -1
  281. package/dist/src/gateway/hono/lib/config-payload.js +1 -1
  282. package/dist/src/gateway/hono/lib/extension-store.js +2 -2
  283. package/dist/src/gateway/hono/lib/static-ui.js +2 -2
  284. package/dist/src/gateway/hono/oauth-async.js +1 -1
  285. package/dist/src/gateway/hono/routes/agents.js +1 -1
  286. package/dist/src/gateway/hono/routes/ai-assist.d.ts +3 -0
  287. package/dist/src/gateway/hono/routes/ai-assist.js +66 -0
  288. package/dist/src/gateway/hono/routes/ai-assist.js.map +1 -0
  289. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
  290. package/dist/src/gateway/hono/routes/commands-skills.js +7 -0
  291. package/dist/src/gateway/hono/routes/commands-skills.js.map +1 -1
  292. package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
  293. package/dist/src/gateway/hono/routes/cron.js +24 -5
  294. package/dist/src/gateway/hono/routes/cron.js.map +1 -1
  295. package/dist/src/gateway/hono/routes/dreaming.js +1 -1
  296. package/dist/src/gateway/hono/routes/home.js +5 -3
  297. package/dist/src/gateway/hono/routes/home.js.map +1 -1
  298. package/dist/src/gateway/hono/routes/host-fs.js +2 -2
  299. package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
  300. package/dist/src/gateway/hono/routes/lazy-bundles.js.map +1 -1
  301. package/dist/src/gateway/hono/routes/models.js +1 -1
  302. package/dist/src/gateway/hono/routes/shares.js +1 -1
  303. package/dist/src/gateway/hono/routes/workflows.js +2 -2
  304. package/dist/src/gateway/hono/routes/workspace.js +2 -2
  305. package/dist/src/gateway/lock.js +3 -3
  306. package/dist/src/gateway/ports.js +1 -1
  307. package/dist/src/gateway/service/agent-runner.js +2 -2
  308. package/dist/src/gateway/service/config-coordinator.js +1 -1
  309. package/dist/src/gateway/service/marketplace-service.d.ts +22 -10
  310. package/dist/src/gateway/service/marketplace-service.js +46 -5
  311. package/dist/src/gateway/service/marketplace-service.js.map +1 -1
  312. package/dist/src/gateway/service.js +11 -5
  313. package/dist/src/gateway/service.js.map +1 -1
  314. package/dist/src/gateway/workspace-fs-file-list.js +1 -1
  315. package/dist/src/goals/goal-notifications.js +1 -1
  316. package/dist/src/goals/goal-workflow-judge.js +3 -3
  317. package/dist/src/i18n/goals-bundle.js +1 -1
  318. package/dist/src/i18n/index.js +1 -1
  319. package/dist/src/i18n/share-tool-bundle.js +2 -2
  320. package/dist/src/infra/brew.js +1 -1
  321. package/dist/src/infra/package-json.js +1 -1
  322. package/dist/src/infra/package-update-steps.js +1 -1
  323. package/dist/src/infra/path-env.js +2 -2
  324. package/dist/src/infra/restart.js +1 -1
  325. package/dist/src/infra/stable-node-path.js +1 -1
  326. package/dist/src/infra/update-check.js +1 -1
  327. package/dist/src/infra/update-global.js +1 -1
  328. package/dist/src/infra/update-lock.js +2 -2
  329. package/dist/src/infra/update-restart.js +1 -1
  330. package/dist/src/infra/update-runner.js +1 -1
  331. package/dist/src/infra/update-startup.js +1 -1
  332. package/dist/src/infra/write-file-atomic.js +2 -2
  333. package/dist/src/media/store.js +1 -1
  334. package/dist/src/notes/agent-context.js +1 -1
  335. package/dist/src/notes/service.js +1 -1
  336. package/dist/src/notes/store.js +2 -2
  337. package/dist/src/project-trust/trust-store.js +2 -2
  338. package/dist/src/providers/auth-runtime/auth-profile-store.js +1 -1
  339. package/dist/src/providers/index.js +1 -1
  340. package/dist/src/providers/model-registry.js +4 -4
  341. package/dist/src/session/init-session-turn.js +2 -2
  342. package/dist/src/session/resolve-session.js +3 -3
  343. package/dist/src/session/session-title.js +2 -2
  344. package/dist/src/session/store.js +1 -1
  345. package/dist/src/share/share-auto.js +2 -2
  346. package/dist/src/share/share-store.js +3 -3
  347. package/dist/src/share/share-thumbnail.js +2 -2
  348. package/dist/src/share/share-zip.js +1 -1
  349. package/dist/src/share/site-share-store.js +3 -3
  350. package/dist/src/share/site-static-serve.js +1 -1
  351. package/dist/src/storage/sqlite/connection.js +1 -1
  352. package/dist/src/storage/sqlite/cron-job-repository.d.ts +6 -0
  353. package/dist/src/storage/sqlite/cron-job-repository.js +70 -0
  354. package/dist/src/storage/sqlite/cron-job-repository.js.map +1 -0
  355. package/dist/src/storage/sqlite/cron-run-repository.js +0 -1
  356. package/dist/src/storage/sqlite/cron-run-repository.js.map +1 -1
  357. package/dist/src/storage/sqlite/index.d.ts +1 -0
  358. package/dist/src/storage/sqlite/index.js +2 -1
  359. package/dist/src/storage/sqlite/memory-index-repository.js +2 -2
  360. package/dist/src/storage/sqlite/migrations/009_cron_jobs.sql +24 -0
  361. package/dist/src/storage/sqlite/migrations/discover.js +1 -1
  362. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  363. package/dist/src/storage/sqlite/migrations/runner.js +4 -4
  364. package/dist/src/storage/sqlite/migrations/runner.js.map +1 -1
  365. package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
  366. package/dist/src/storage/sqlite/schema.js +2 -2
  367. package/dist/src/storage/sqlite/schema.sql +25 -0
  368. package/dist/src/tui/clipboard-image.js +3 -3
  369. package/dist/src/tui/extension-host/load-extensions.js +1 -1
  370. package/dist/src/tui/theme-manager.js +1 -1
  371. package/dist/src/tui/tui-command-formatters.js +4 -4
  372. package/dist/src/tui/tui-commands.js +2 -2
  373. package/dist/src/tui/tui-keybindings-file.js +1 -1
  374. package/dist/src/tui/tui-scoped-models.js +2 -2
  375. package/dist/src/tui/tui-settings.js +1 -1
  376. package/dist/src/tui/tui-startup-resources.js +1 -1
  377. package/dist/src/tui/tui.js +6 -6
  378. package/dist/src/tunnel/frpc-binary.js +4 -4
  379. package/dist/src/tunnel/frpc-config.js +1 -1
  380. package/dist/src/tunnel/frpc-extract.js +1 -1
  381. package/dist/src/tunnel/tunnel-state.js +1 -1
  382. package/dist/src/utils/logger/audit.js +1 -1
  383. package/dist/src/utils/logger/log-store.js +1 -1
  384. package/dist/src/utils/logger/rotation.js +1 -1
  385. package/dist/src/utils/logger/streams.js +1 -1
  386. package/dist/src/voice/tts/audio.js +1 -1
  387. package/dist/src/voice/tts/providers/edge-speech.js +2 -2
  388. package/dist/src/workflows/draft/workflow-draft-service.js +1 -1
  389. package/dist/src/workflows/engine/projector.js +23 -14
  390. package/dist/src/workflows/engine/projector.js.map +1 -1
  391. package/dist/src/workflows/engine/workflow-engine.d.ts +1 -0
  392. package/dist/src/workflows/engine/workflow-engine.js +36 -0
  393. package/dist/src/workflows/engine/workflow-engine.js.map +1 -1
  394. package/dist/src/workflows/index.js +1 -1
  395. package/dist/src/workflows/service/workflow-run-service.js +2 -2
  396. package/dist/src/workflows/service/workflow-session-bridge.js +2 -2
  397. package/dist/src/workflows/store/event-store.js +1 -1
  398. package/dist/src/workflows/store/run-store.js +1 -1
  399. package/package.json +2 -3
  400. package/dist/gateway/static/root/assets/agent-browser-settings-page-B-0zGjt8.js +0 -6
  401. package/dist/gateway/static/root/assets/agents-DwDnJlXT.js +0 -71
  402. package/dist/gateway/static/root/assets/connectors-settings-DDvHo9in.js +0 -2
  403. package/dist/gateway/static/root/assets/cron-api-Dj_UZKST.js +0 -1
  404. package/dist/gateway/static/root/assets/cron-page-Dv7GII9G.js +0 -1
  405. package/dist/gateway/static/root/assets/cron-schedule-picker-DH10KgD6.js +0 -1
  406. package/dist/gateway/static/root/assets/dreaming-settings-L2rgZDQl.js +0 -1
  407. package/dist/gateway/static/root/assets/extension-settings-page-m_UQYkVc.js +0 -1
  408. package/dist/gateway/static/root/assets/gateway-settings-CS177xni.js +0 -1
  409. package/dist/gateway/static/root/assets/goals-page-C0FujUB5.js +0 -2
  410. package/dist/gateway/static/root/assets/index-COkF54xv.js +0 -121
  411. package/dist/gateway/static/root/assets/index-DIaSNGEO.css +0 -1
  412. package/dist/gateway/static/root/assets/interval-presets-B29Ss_2y.js +0 -2
  413. package/dist/gateway/static/root/assets/messages-Csef1aW7.js +0 -3
  414. package/dist/gateway/static/root/assets/models-hub-panel-DHGiTIvf.js +0 -2
  415. package/dist/gateway/static/root/assets/note-detail-page-BM7zlDiT.js +0 -2
  416. package/dist/gateway/static/root/assets/schedule-field-BPAWui3P.js +0 -1
  417. package/dist/gateway/static/root/assets/schedule-summary-B-hdSRdR.js +0 -1
  418. package/dist/gateway/static/root/assets/settings-advanced-gate-BYS-rpzn.js +0 -1
  419. package/dist/gateway/static/root/assets/settings-form-section-BsrK7TBF.js +0 -1
  420. package/dist/gateway/static/root/assets/setup-status-panel-DJiksNu4.js +0 -1
  421. package/dist/gateway/static/root/assets/skill-reload-api-CU9i0nJV.js +0 -1
  422. package/dist/gateway/static/root/assets/skills-page-ERbdWENm.js +0 -2
  423. package/dist/gateway/static/root/assets/use-agent-defaults-form-D3FGVLZb.js +0 -1
  424. package/dist/gateway/static/root/favicon-16.png +0 -0
  425. package/dist/gateway/static/root/favicon-32.png +0 -0
  426. package/dist/src/cron/persistence.d.ts +0 -62
  427. package/dist/src/cron/persistence.js +0 -188
  428. package/dist/src/cron/persistence.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { createLogger } from "../../utils/logger/index.js";
2
2
  import { init_logger } from "../../utils/logger.js";
3
3
  import { parseFrontmatter } from "../../markdown/frontmatter.js";
4
- import { join, resolve } from "path";
5
4
  import { existsSync, readFileSync } from "fs";
5
+ import { join, resolve } from "path";
6
6
  //#region src/agent/context/workspace.ts
7
7
  /**
8
8
  * Agent profile Markdown (filenames, load order, system prompt assembly) and
@@ -1,7 +1,7 @@
1
- import { formatI18n } from "../../i18n/format.js";
2
- import { SERVER_LOCALES, isServerLocale, normalizeServerLocale, serverLocaleOrFallback } from "../../i18n/locale.js";
3
1
  import { checklistCounts } from "./checklist-types.js";
4
2
  import { renderChecklistPlain } from "./state.js";
3
+ import { formatI18n } from "../../i18n/format.js";
4
+ import { SERVER_LOCALES, isServerLocale, normalizeServerLocale, serverLocaleOrFallback } from "../../i18n/locale.js";
5
5
  import { JUDGE_REASON_EN, goalsChecklistProgressSuffix, goalsContinuationChecklistTemplate, goalsContinuationPlainTemplate, goalsEvaluateCopy, goalsJudgeReason, goalsJudgeResponseLanguageNote } from "../../i18n/goals-bundle.js";
6
6
  //#region src/agent/goals/goal-locale.ts
7
7
  const GOAL_UI_LOCALES = SERVER_LOCALES;
@@ -1,6 +1,6 @@
1
- import { init_session_key, parseSessionKey } from "../../routing/session-key.js";
2
1
  import { createLogger } from "../../utils/logger/index.js";
3
2
  import { init_logger } from "../../utils/logger.js";
3
+ import { init_session_key, parseSessionKey } from "../../routing/session-key.js";
4
4
  import { handlePersistentGoalPostTurn } from "./post-turn.js";
5
5
  //#region src/agent/goals/persistent-goal-service.ts
6
6
  init_session_key();
@@ -1,9 +1,9 @@
1
- import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
2
- import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
3
1
  import { createLogger } from "../../utils/logger/index.js";
4
2
  import { init_logger } from "../../utils/logger.js";
5
- import { GoalService } from "../../goals/goal-service.js";
3
+ import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
6
4
  import { resolveGoalUiLocale } from "./goal-locale.js";
5
+ import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
6
+ import { GoalService } from "../../goals/goal-service.js";
7
7
  import { evaluateAfterTurnHermesLike } from "./evaluate-turn.js";
8
8
  import "../../goals/index.js";
9
9
  //#region src/agent/goals/post-turn.ts
@@ -1,8 +1,8 @@
1
1
  import { checkFileSafety } from "../prompt/safety.js";
2
2
  import { decodeDataUrl } from "./image-helpers.js";
3
- import { homedir } from "node:os";
4
- import path from "node:path";
5
3
  import { promises } from "node:fs";
4
+ import path from "node:path";
5
+ import { homedir } from "node:os";
6
6
  //#region src/agent/image/load-image-media.ts
7
7
  function expandUser(p) {
8
8
  if (p.startsWith("~/") || p === "~") return path.join(homedir(), p.slice(1));
@@ -1,9 +1,9 @@
1
+ import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
2
+ import { init_paths, resolveAgentDir } from "../../config/paths.js";
1
3
  import { createLogger } from "../../utils/logger/index.js";
2
4
  import { init_logger } from "../../utils/logger.js";
3
- import { init_paths, resolveAgentDir } from "../../config/paths.js";
4
- import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
5
- import { join } from "path";
6
5
  import { existsSync, watch } from "fs";
6
+ import { join } from "path";
7
7
  import { mkdir, readFile, readdir, rename } from "fs/promises";
8
8
  //#region src/agent/ipc/inbox.ts
9
9
  init_write_file_atomic();
@@ -1,6 +1,6 @@
1
+ import { init_paths, resolveSocketPath } from "../../config/paths.js";
1
2
  import { createLogger } from "../../utils/logger/index.js";
2
3
  import { init_logger } from "../../utils/logger.js";
3
- import { init_paths, resolveSocketPath } from "../../config/paths.js";
4
4
  import { isValidIPCMessage } from "./types.js";
5
5
  import { dirname } from "path";
6
6
  import { mkdir } from "fs/promises";
@@ -1,6 +1,6 @@
1
- import { init_string_coerce, normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "../../utils/string-coerce.js";
2
1
  import { createLogger } from "../../utils/logger/index.js";
3
2
  import { init_logger } from "../../utils/logger.js";
3
+ import { init_string_coerce, normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "../../utils/string-coerce.js";
4
4
  import { buildSafeToolName, normalizeReservedToolNames } from "./bundle-mcp-names.js";
5
5
  import { setPluginToolMeta } from "./mcp-tool-meta.js";
6
6
  import crypto from "node:crypto";
@@ -1,6 +1,6 @@
1
- import { init_string_coerce, normalizeOptionalString } from "../../utils/string-coerce.js";
2
1
  import { createLogger } from "../../utils/logger/index.js";
3
2
  import { init_logger } from "../../utils/logger.js";
3
+ import { init_string_coerce, normalizeOptionalString } from "../../utils/string-coerce.js";
4
4
  import { resolveGlobalSingleton } from "../../utils/global-singleton.js";
5
5
  import { sanitizeServerName } from "./bundle-mcp-names.js";
6
6
  import { redactSensitiveUrlLikeString } from "../../utils/redact-sensitive-url.js";
@@ -1,6 +1,6 @@
1
- import { init_string_coerce, normalizeLowercaseStringOrEmpty } from "../../utils/string-coerce.js";
2
1
  import { createLogger } from "../../utils/logger/index.js";
3
2
  import { init_logger } from "../../utils/logger.js";
3
+ import { init_string_coerce, normalizeLowercaseStringOrEmpty } from "../../utils/string-coerce.js";
4
4
  import { resolveXopcMcpTransportAlias } from "../../config/mcp-config-normalize.js";
5
5
  import { sanitizeForLog } from "../../utils/sanitize-log.js";
6
6
  import { describeHttpMcpServerLaunchConfig, resolveHttpMcpServerLaunchConfig } from "./mcp-http.js";
@@ -1,6 +1,6 @@
1
- import { init_string_coerce, normalizeOptionalString } from "../../utils/string-coerce.js";
2
1
  import { createLogger } from "../../utils/logger/index.js";
3
2
  import { init_logger } from "../../utils/logger.js";
3
+ import { init_string_coerce, normalizeOptionalString } from "../../utils/string-coerce.js";
4
4
  import { XopcStdioClientTransport } from "./mcp-stdio-transport.js";
5
5
  import { resolveMcpTransportConfig } from "./mcp-transport-config.js";
6
6
  import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
@@ -1,6 +1,6 @@
1
- import { join } from "node:path";
2
1
  import { existsSync, mkdirSync, readFileSync } from "node:fs";
3
2
  import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
3
+ import { join } from "node:path";
4
4
  import lockfile from "proper-lockfile";
5
5
  //#region src/agent/memory/builtin-memory-store.ts
6
6
  /**
@@ -4,8 +4,8 @@ import { MEMORY_MD_FILENAME } from "./constants.js";
4
4
  import { clamp01, compareCandidatesByScore, computeCandidateScore, extractPromotionMarkers, isContaminatedSnippet, isExpiredEntry, isoDay, readFileLines, resolveDeepDefaults, sliceRange, snippetHash } from "./utils.js";
5
5
  import { loadDreamingStore, saveDreamingStore, withDreamingPromotionLock } from "./short-term-store.js";
6
6
  import { emptyDeepPhaseSkipped, writeDreamingDeepLastRun } from "./last-run.js";
7
- import path from "node:path";
8
7
  import fs from "node:fs/promises";
8
+ import path from "node:path";
9
9
  //#region src/agent/memory/dreaming/deep-promotion.ts
10
10
  init_logger();
11
11
  const log = createLogger("Dreaming:Deep");
@@ -1,6 +1,6 @@
1
1
  import { DREAMING_DIR_RELATIVE, DREAMING_EVENTS_LOG_RELATIVE } from "./constants.js";
2
- import path from "node:path";
3
2
  import fs from "node:fs/promises";
3
+ import path from "node:path";
4
4
  //#region src/agent/memory/dreaming/events.ts
5
5
  /**
6
6
  * Append a single event line to `memory/.dreams/events.jsonl`.
@@ -1,6 +1,6 @@
1
1
  import { DREAMING_LAST_RUN_RELATIVE } from "./constants.js";
2
- import path from "node:path";
3
2
  import fs from "node:fs/promises";
3
+ import path from "node:path";
4
4
  //#region src/agent/memory/dreaming/last-run.ts
5
5
  const DREAMING_LAST_RUN_FORMAT_VERSION = 2;
6
6
  function isRecord(v) {
@@ -4,8 +4,8 @@ import { DREAMING_DIR_RELATIVE } from "./constants.js";
4
4
  import { buildEntryKey, isoDay, normalizeMemoryPath, normalizeSnippetForHash, snippetHash } from "./utils.js";
5
5
  import { bumpEntryPhaseSignal, loadDreamingStore, saveDreamingStore } from "./short-term-store.js";
6
6
  import "./last-run.js";
7
- import path from "node:path";
8
7
  import fs from "node:fs/promises";
8
+ import path from "node:path";
9
9
  //#region src/agent/memory/dreaming/light-sweep.ts
10
10
  init_logger();
11
11
  const log = createLogger("Dreaming:Light");
@@ -1,8 +1,8 @@
1
1
  import { MEMORY_MD_FILENAME } from "./constants.js";
2
2
  import { clamp01, compareCandidatesByScore, computeCandidateScore, extractPromotionMarkers, isContaminatedSnippet, isExpiredEntry, readFileLines, resolveDeepDefaults, sliceRange, snippetHash } from "./utils.js";
3
3
  import { loadDreamingStore } from "./short-term-store.js";
4
- import path from "node:path";
5
4
  import fs from "node:fs/promises";
5
+ import path from "node:path";
6
6
  //#region src/agent/memory/dreaming/preview.ts
7
7
  async function previewDreamingDeepPromotion(params) {
8
8
  const cfg = resolveDeepDefaults(params.config);
@@ -4,8 +4,8 @@ import { DREAMING_DIR_RELATIVE, DREAMS_MD_FILENAME, MS_PER_DAY } from "./constan
4
4
  import { isoDay } from "./utils.js";
5
5
  import { bumpEntryPhaseSignal, loadDreamingStore, saveDreamingStore } from "./short-term-store.js";
6
6
  import "./last-run.js";
7
- import path from "node:path";
8
7
  import fs from "node:fs/promises";
8
+ import path from "node:path";
9
9
  //#region src/agent/memory/dreaming/rem-patterns.ts
10
10
  init_logger();
11
11
  const log = createLogger("Dreaming:REM");
@@ -2,9 +2,9 @@ import { createLogger } from "../../../utils/logger/index.js";
2
2
  import { init_logger } from "../../../utils/logger.js";
3
3
  import { SHORT_TERM_PROMOTION_LOCK_RELATIVE, SHORT_TERM_RECALL_STORE_RELATIVE } from "./constants.js";
4
4
  import { buildEntryKey, clamp01, isoDay, normalizeMemoryPath } from "./utils.js";
5
- import path from "node:path";
6
5
  import { createHash, randomUUID } from "node:crypto";
7
6
  import fs from "node:fs/promises";
7
+ import path from "node:path";
8
8
  //#region src/agent/memory/dreaming/short-term-store.ts
9
9
  init_logger();
10
10
  const log = createLogger("Dreaming:Store");
@@ -1,7 +1,7 @@
1
1
  import { DEFAULT_DEEP_CRON, DIVERSITY_WEIGHT, MS_PER_DAY, REINFORCEMENT_WEIGHT } from "./constants.js";
2
- import path from "node:path";
3
2
  import { createHash } from "node:crypto";
4
3
  import fs from "node:fs/promises";
4
+ import path from "node:path";
5
5
  //#region src/agent/memory/dreaming/utils.ts
6
6
  /** Normalize a workspace-relative memory path: forward slashes, no odd ../ escapes at start. */
7
7
  function normalizeMemoryPath(rel) {
@@ -1,8 +1,8 @@
1
1
  import { createLogger } from "../../utils/logger/index.js";
2
2
  import { init_logger } from "../../utils/logger.js";
3
- import { join } from "node:path";
4
3
  import { existsSync } from "node:fs";
5
4
  import { appendFile, mkdir, readFile, writeFile } from "node:fs/promises";
5
+ import { join } from "node:path";
6
6
  //#region src/agent/memory/memory-flush.ts
7
7
  init_logger();
8
8
  const log = createLogger("MemoryFlush");
@@ -1,5 +1,5 @@
1
- import { dirname, join } from "node:path";
2
1
  import { readdir, stat } from "node:fs/promises";
2
+ import { dirname, join } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  //#region src/agent/memory/plugin-discovery.ts
5
5
  async function discoverMemoryPlugins() {
@@ -37,6 +37,8 @@ export interface CommandHandlerConfig {
37
37
  } | null>;
38
38
  /** Cancel streaming preview + in-flight LLM work for this session (e.g. /abort) */
39
39
  abortSessionTurn?: (sessionKey: string) => Promise<void>;
40
+ /** Reload skills from disk and refresh active agent prompts. */
41
+ reloadSkills?: () => void | Promise<void>;
40
42
  compactSession?: (sessionKey: string, options?: {
41
43
  instructions?: string;
42
44
  force?: boolean;
@@ -64,6 +66,7 @@ export declare class CommandHandler {
64
66
  private switchModelForSession;
65
67
  private invalidateAgentSession?;
66
68
  private abortSessionTurn?;
69
+ private reloadSkills?;
67
70
  private compactSession?;
68
71
  private btwQuery?;
69
72
  private getSessionContextReport?;
@@ -22,6 +22,7 @@ var CommandHandler = class {
22
22
  switchModelForSession;
23
23
  invalidateAgentSession;
24
24
  abortSessionTurn;
25
+ reloadSkills;
25
26
  compactSession;
26
27
  btwQuery;
27
28
  getSessionContextReport;
@@ -38,6 +39,7 @@ var CommandHandler = class {
38
39
  this.switchModelForSession = handlerConfig.switchModelForSession;
39
40
  this.invalidateAgentSession = handlerConfig.invalidateAgentSession;
40
41
  this.abortSessionTurn = handlerConfig.abortSessionTurn;
42
+ this.reloadSkills = handlerConfig.reloadSkills;
41
43
  this.compactSession = handlerConfig.compactSession;
42
44
  this.btwQuery = handlerConfig.btwQuery;
43
45
  this.getSessionContextReport = handlerConfig.getSessionContextReport;
@@ -126,6 +128,9 @@ var CommandHandler = class {
126
128
  abortCurrentTurn: this.abortSessionTurn ? async () => {
127
129
  await this.abortSessionTurn(context.sessionKey);
128
130
  } : void 0,
131
+ reloadSkills: this.reloadSkills ? async () => {
132
+ await this.reloadSkills();
133
+ } : void 0,
129
134
  compactSession: this.compactSession,
130
135
  btwQuery: this.btwQuery,
131
136
  getSessionContextReport: this.getSessionContextReport,
@@ -1 +1 @@
1
- {"version":3,"file":"command-handler.js","names":[],"sources":["../../../../src/agent/messaging/command-handler.ts"],"sourcesContent":["/**\n * Command Handler - Parses and executes commands\n *\n * Handles command execution using the unified command system.\n */\n\nimport type { MessageBus } from '../../infra/bus/index.js';\nimport type { Config } from '../../config/schema.js';\nimport { isProviderConfiguredSync } from '../../providers/index.js';\nimport type { SessionConfigStore, SessionStore } from '../../session/index.js';\nimport type { ThinkLevel } from '../transcript/thinking-types.js';\nimport type { CompactionResult } from '../memory/compaction.js';\nimport { createLogger } from '../../utils/logger.js';\nimport {\n commandRegistry,\n createCommandContext,\n type CommandContext as UnifiedCommandContext,\n} from '../../chat-commands/index.js';\nimport { getAllProviders, getModelsByProvider, getProviderDisplayName } from '../../providers/index.js';\nimport type { PersistentGoalApis } from '../goals/persistent-goal-apis.js';\nimport type { WorkflowRunServiceLike } from '../../workflows/service/workflow-run-service.types.js';\n\nconst log = createLogger('CommandHandler');\n\n/** Gateway console direct stream uses SSE tokens; there is no ChannelPlugin outbound for `webchat`. */\nfunction shouldSkipBusOutboundForChannel(channel: string): boolean {\n return channel === 'webchat';\n}\n\nexport interface CommandContext {\n sessionKey: string;\n channel: string;\n chatId: string;\n senderId: string;\n isGroup: boolean;\n /** From inbound message metadata (thread/account, etc.) for `/goal` continuation routing. */\n inboundMetadata?: Record<string, unknown>;\n}\n\nexport interface CommandHandlerConfig {\n config: Config;\n bus: MessageBus;\n sessionStore: SessionStore;\n sessionConfigStore?: SessionConfigStore;\n /** After /think persists, sync pi-agent */\n applySessionThinkingLevel?: (sessionKey: string, level: ThinkLevel) => void;\n getCurrentModel: () => string;\n switchModelForSession: (sessionKey: string, modelId: string) => Promise<boolean>;\n /** Drop in-memory agent after session file is cleared (e.g. /new) */\n invalidateAgentSession?: (sessionKey: string) => void;\n /** Reset session in place (archive transcript, new session id; preserve overrides) */\n resetSession?: (sessionKey: string) => Promise<{ sessionId: string; previousSessionId: string } | null>;\n /** Cancel streaming preview + in-flight LLM work for this session (e.g. /abort) */\n abortSessionTurn?: (sessionKey: string) => Promise<void>;\n\n compactSession?: (\n sessionKey: string,\n options?: { instructions?: string; force?: boolean },\n ) => Promise<CompactionResult>;\n\n btwQuery?: (sessionKey: string, question: string) => Promise<{ text: string; error?: string }>;\n\n getSessionContextReport?: (\n sessionKey: string,\n mode: 'list' | 'detail' | 'json',\n ) => Promise<string>;\n\n getPersistentGoalApisForCommand: (routing: {\n sessionKey: string;\n channel: string;\n chatId: string;\n inboundMetadata?: Record<string, unknown>;\n }) => PersistentGoalApis;\n getWorkflowRunService?: () => WorkflowRunServiceLike | undefined;\n}\n\nexport class CommandHandler {\n private config: Config;\n private bus: MessageBus;\n private sessionStore: SessionStore;\n private sessionConfigStore?: SessionConfigStore;\n private applySessionThinkingLevel?: (sessionKey: string, level: ThinkLevel) => void;\n private getCurrentModel: () => string;\n private switchModelForSession: (sessionKey: string, modelId: string) => Promise<boolean>;\n private invalidateAgentSession?: (sessionKey: string) => void;\n private abortSessionTurn?: (sessionKey: string) => Promise<void>;\n private compactSession?: CommandHandlerConfig['compactSession'];\n private btwQuery?: CommandHandlerConfig['btwQuery'];\n private getSessionContextReport?: CommandHandlerConfig['getSessionContextReport'];\n private getPersistentGoalApisForCommand: CommandHandlerConfig['getPersistentGoalApisForCommand'];\n private resetSession?: CommandHandlerConfig['resetSession'];\n private getWorkflowRunService?: CommandHandlerConfig['getWorkflowRunService'];\n\n constructor(handlerConfig: CommandHandlerConfig) {\n this.config = handlerConfig.config;\n this.bus = handlerConfig.bus;\n this.sessionStore = handlerConfig.sessionStore;\n this.sessionConfigStore = handlerConfig.sessionConfigStore;\n this.applySessionThinkingLevel = handlerConfig.applySessionThinkingLevel;\n this.getCurrentModel = handlerConfig.getCurrentModel;\n this.switchModelForSession = handlerConfig.switchModelForSession;\n this.invalidateAgentSession = handlerConfig.invalidateAgentSession;\n this.abortSessionTurn = handlerConfig.abortSessionTurn;\n this.compactSession = handlerConfig.compactSession;\n this.btwQuery = handlerConfig.btwQuery;\n this.getSessionContextReport = handlerConfig.getSessionContextReport;\n this.getPersistentGoalApisForCommand = handlerConfig.getPersistentGoalApisForCommand;\n this.resetSession = handlerConfig.resetSession;\n this.getWorkflowRunService = handlerConfig.getWorkflowRunService;\n }\n\n /** Replace config reference after hot reload or gateway PATCH so commands see current defaults. */\n updateAgentConfig(config: Config): void {\n this.config = config;\n }\n\n /**\n * Build the unified command context shared by all execute paths.\n * When `recorder` is set, every reply text is also captured (for SSE / CLI aggregation).\n */\n private buildCommandContext(\n context: CommandContext,\n recorder?: (text: string) => void,\n ): UnifiedCommandContext {\n const skipBusOutbound = shouldSkipBusOutboundForChannel(context.channel);\n\n return createCommandContext({\n sessionKey: context.sessionKey,\n source: context.channel as 'telegram' | 'webui' | 'cli' | 'api' | 'system' | 'gateway',\n channelId: context.channel,\n chatId: context.chatId,\n senderId: context.senderId,\n isGroup: context.isGroup,\n config: this.config,\n bus: this.bus,\n sessionStore: this.sessionStore,\n sessionConfigStore: this.sessionConfigStore,\n applySessionThinkingLevel: this.applySessionThinkingLevel,\n\n replyHandler: async (text: string, _options?) => {\n recorder?.(text);\n if (skipBusOutbound) return;\n await this.bus.publishOutbound({\n channel: context.channel,\n chat_id: context.chatId,\n content: text,\n type: 'message',\n });\n },\n\n typingHandler: async (typing: boolean) => {\n if (skipBusOutbound) return;\n await this.bus.publishOutbound({\n channel: context.channel,\n chat_id: context.chatId,\n type: typing ? 'typing_on' : 'typing_off',\n });\n },\n\n supportedFeatures: ['markdown', 'typing'],\n\n getCurrentModel: this.getCurrentModel,\n\n switchModel: async (modelId: string) => {\n return this.switchModelForSession(context.sessionKey, modelId);\n },\n\n listModels: async () => {\n const providers = getAllProviders();\n const models: Array<{ id: string; name: string; provider: string }> = [];\n\n for (const providerId of providers) {\n if (isProviderConfiguredSync(providerId)) {\n const providerModels = getModelsByProvider(providerId);\n for (const m of providerModels) {\n models.push({\n id: `${m.provider}/${m.id}`,\n name: m.name || m.id,\n provider: getProviderDisplayName(providerId),\n });\n }\n }\n }\n\n return models;\n },\n\n getUsage: async () => {\n const messages = await this.sessionStore.load(context.sessionKey);\n let promptTokens = 0;\n let completionTokens = 0;\n\n for (const msg of messages) {\n if ('usage' in msg && msg.usage) {\n const usage = msg.usage as { input?: number; output?: number };\n promptTokens += usage.input || 0;\n completionTokens += usage.output || 0;\n }\n }\n\n return {\n promptTokens,\n completionTokens,\n totalTokens: promptTokens + completionTokens,\n messageCount: messages.length,\n };\n },\n\n invalidateAgentSession: this.invalidateAgentSession,\n\n resetSession: this.resetSession\n ? async (sk) => {\n await this.resetSession!(sk);\n }\n : undefined,\n\n abortCurrentTurn: this.abortSessionTurn\n ? async () => {\n await this.abortSessionTurn!(context.sessionKey);\n }\n : undefined,\n\n compactSession: this.compactSession,\n btwQuery: this.btwQuery,\n getSessionContextReport: this.getSessionContextReport,\n persistentGoalApis: this.getPersistentGoalApisForCommand({\n sessionKey: context.sessionKey,\n channel: context.channel,\n chatId: context.chatId,\n inboundMetadata: context.inboundMetadata,\n }),\n workflowRunService: this.getWorkflowRunService?.(),\n });\n }\n\n /**\n * Execute a command using the unified command system\n */\n async executeCommand(\n commandName: string,\n args: string,\n context: CommandContext,\n ): Promise<boolean> {\n if (!commandRegistry.has(commandName)) {\n return false;\n }\n\n log.info({ command: commandName, sessionKey: context.sessionKey }, 'Executing command via new system');\n\n const cmdCtx = this.buildCommandContext(context);\n const result = await commandRegistry.execute(commandName, cmdCtx, args);\n\n if (result.content && !shouldSkipBusOutboundForChannel(context.channel)) {\n await this.bus.publishOutbound({\n channel: context.channel,\n chat_id: context.chatId,\n content: result.content,\n type: 'message',\n });\n }\n\n return true;\n }\n\n /**\n * Run command and return all user-visible text (ctx.reply + result.content) for SSE/CLI.\n * Same bus side effects as {@link executeCommand}.\n */\n async executeCommandAndAggregateReply(\n commandName: string,\n args: string,\n context: CommandContext,\n ): Promise<{ handled: boolean; aggregatedText: string; metadata?: Record<string, unknown> }> {\n if (!commandRegistry.has(commandName)) {\n return { handled: false, aggregatedText: '' };\n }\n\n log.info({ command: commandName, sessionKey: context.sessionKey }, 'Executing command (aggregate reply)');\n\n const segments: string[] = [];\n const wrapped = this.buildCommandContext(context, (text) => segments.push(text));\n const result = await commandRegistry.execute(commandName, wrapped, args);\n\n if (result.content) {\n segments.push(result.content);\n if (!shouldSkipBusOutboundForChannel(context.channel)) {\n await this.bus.publishOutbound({\n channel: context.channel,\n chat_id: context.chatId,\n content: result.content,\n type: 'message',\n });\n }\n }\n\n const aggregatedText = segments.filter((s) => s && s.trim()).join('\\n\\n');\n return { handled: true, aggregatedText, metadata: result.metadata };\n }\n}\n"],"mappings":";;;;;;;gBAQoE;aAIf;AAUrD,MAAM,MAAM,aAAa,iBAAiB;;AAG1C,SAAS,gCAAgC,SAA0B;AACjE,QA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gB,IAAI,YAAY,CACnC,QAAO;AAGT,MAAI,KAAK;GAAE,SAAS;GAAa,YAAY,QAAQ;GAAY,EAAE,mCAAmC;EAEtG,MAAM,SAAS,KAAK,oBAAoB,QAAQ;EAChD,MAAM,SAAS,MAAM,gBAAgB,QAAQ,aAAa,QAAQ,KAAK;AAEvE,MAAI,OAAO,WAAW,CAAC,gCAAgC,QAAQ,QAAQ,CACrE,OAAM,KAAK,IAAI,gBAAgB;GAC7B,SAAS,QAAQ;GACjB,SAAS,QAAQ;GACjB,SAAS,OAAO;GAChB,MAAM;GACP,CAAC;AAGJ,SAAO;;;;;;CAOT,MAAM,gCACJ,aACA,MACA,SAC2F;AAC3F,MAAI,CAAC,gBAAgB,IAAI,YAAY,CACnC,QAAO;GAAE,SAAS;GAAO,gBAAgB;GAAI;AAG/C,MAAI,KAAK;GAAE,SAAS;GAAa,YAAY,QAAQ;GAAY,EAAE,sCAAsC;EAEzG,MAAM,WAAqB,EAAE;EAC7B,MAAM,UAAU,KAAK,oBAAoB,UAAU,SAAS,SAAS,KAAK,KAAK,CAAC;EAChF,MAAM,SAAS,MAAM,gBAAgB,QAAQ,aAAa,SAAS,KAAK;AAExE,MAAI,OAAO,SAAS;AAClB,YAAS,KAAK,OAAO,QAAQ;AAC7B,OAAI,CAAC,gCAAgC,QAAQ,QAAQ,CACnD,OAAM,KAAK,IAAI,gBAAgB;IAC7B,SAAS,QAAQ;IACjB,SAAS,QAAQ;IACjB,SAAS,OAAO;IAChB,MAAM;IACP,CAAC;;AAKN,SAAO;GAAE,SAAS;GAAM,gBADD,SAAS,QAAQ,MAAM,KAAK,EAAE,MAAM,CAAC,CAAC,KAAK,OAC5B;GAAE,UAAU,OAAO;GAAU"}
1
+ {"version":3,"file":"command-handler.js","names":[],"sources":["../../../../src/agent/messaging/command-handler.ts"],"sourcesContent":["/**\n * Command Handler - Parses and executes commands\n *\n * Handles command execution using the unified command system.\n */\n\nimport type { MessageBus } from '../../infra/bus/index.js';\nimport type { Config } from '../../config/schema.js';\nimport { isProviderConfiguredSync } from '../../providers/index.js';\nimport type { SessionConfigStore, SessionStore } from '../../session/index.js';\nimport type { ThinkLevel } from '../transcript/thinking-types.js';\nimport type { CompactionResult } from '../memory/compaction.js';\nimport { createLogger } from '../../utils/logger.js';\nimport {\n commandRegistry,\n createCommandContext,\n type CommandContext as UnifiedCommandContext,\n} from '../../chat-commands/index.js';\nimport { getAllProviders, getModelsByProvider, getProviderDisplayName } from '../../providers/index.js';\nimport type { PersistentGoalApis } from '../goals/persistent-goal-apis.js';\nimport type { WorkflowRunServiceLike } from '../../workflows/service/workflow-run-service.types.js';\n\nconst log = createLogger('CommandHandler');\n\n/** Gateway console direct stream uses SSE tokens; there is no ChannelPlugin outbound for `webchat`. */\nfunction shouldSkipBusOutboundForChannel(channel: string): boolean {\n return channel === 'webchat';\n}\n\nexport interface CommandContext {\n sessionKey: string;\n channel: string;\n chatId: string;\n senderId: string;\n isGroup: boolean;\n /** From inbound message metadata (thread/account, etc.) for `/goal` continuation routing. */\n inboundMetadata?: Record<string, unknown>;\n}\n\nexport interface CommandHandlerConfig {\n config: Config;\n bus: MessageBus;\n sessionStore: SessionStore;\n sessionConfigStore?: SessionConfigStore;\n /** After /think persists, sync pi-agent */\n applySessionThinkingLevel?: (sessionKey: string, level: ThinkLevel) => void;\n getCurrentModel: () => string;\n switchModelForSession: (sessionKey: string, modelId: string) => Promise<boolean>;\n /** Drop in-memory agent after session file is cleared (e.g. /new) */\n invalidateAgentSession?: (sessionKey: string) => void;\n /** Reset session in place (archive transcript, new session id; preserve overrides) */\n resetSession?: (sessionKey: string) => Promise<{ sessionId: string; previousSessionId: string } | null>;\n /** Cancel streaming preview + in-flight LLM work for this session (e.g. /abort) */\n abortSessionTurn?: (sessionKey: string) => Promise<void>;\n /** Reload skills from disk and refresh active agent prompts. */\n reloadSkills?: () => void | Promise<void>;\n\n compactSession?: (\n sessionKey: string,\n options?: { instructions?: string; force?: boolean },\n ) => Promise<CompactionResult>;\n\n btwQuery?: (sessionKey: string, question: string) => Promise<{ text: string; error?: string }>;\n\n getSessionContextReport?: (\n sessionKey: string,\n mode: 'list' | 'detail' | 'json',\n ) => Promise<string>;\n\n getPersistentGoalApisForCommand: (routing: {\n sessionKey: string;\n channel: string;\n chatId: string;\n inboundMetadata?: Record<string, unknown>;\n }) => PersistentGoalApis;\n getWorkflowRunService?: () => WorkflowRunServiceLike | undefined;\n}\n\nexport class CommandHandler {\n private config: Config;\n private bus: MessageBus;\n private sessionStore: SessionStore;\n private sessionConfigStore?: SessionConfigStore;\n private applySessionThinkingLevel?: (sessionKey: string, level: ThinkLevel) => void;\n private getCurrentModel: () => string;\n private switchModelForSession: (sessionKey: string, modelId: string) => Promise<boolean>;\n private invalidateAgentSession?: (sessionKey: string) => void;\n private abortSessionTurn?: (sessionKey: string) => Promise<void>;\n private reloadSkills?: CommandHandlerConfig['reloadSkills'];\n private compactSession?: CommandHandlerConfig['compactSession'];\n private btwQuery?: CommandHandlerConfig['btwQuery'];\n private getSessionContextReport?: CommandHandlerConfig['getSessionContextReport'];\n private getPersistentGoalApisForCommand: CommandHandlerConfig['getPersistentGoalApisForCommand'];\n private resetSession?: CommandHandlerConfig['resetSession'];\n private getWorkflowRunService?: CommandHandlerConfig['getWorkflowRunService'];\n\n constructor(handlerConfig: CommandHandlerConfig) {\n this.config = handlerConfig.config;\n this.bus = handlerConfig.bus;\n this.sessionStore = handlerConfig.sessionStore;\n this.sessionConfigStore = handlerConfig.sessionConfigStore;\n this.applySessionThinkingLevel = handlerConfig.applySessionThinkingLevel;\n this.getCurrentModel = handlerConfig.getCurrentModel;\n this.switchModelForSession = handlerConfig.switchModelForSession;\n this.invalidateAgentSession = handlerConfig.invalidateAgentSession;\n this.abortSessionTurn = handlerConfig.abortSessionTurn;\n this.reloadSkills = handlerConfig.reloadSkills;\n this.compactSession = handlerConfig.compactSession;\n this.btwQuery = handlerConfig.btwQuery;\n this.getSessionContextReport = handlerConfig.getSessionContextReport;\n this.getPersistentGoalApisForCommand = handlerConfig.getPersistentGoalApisForCommand;\n this.resetSession = handlerConfig.resetSession;\n this.getWorkflowRunService = handlerConfig.getWorkflowRunService;\n }\n\n /** Replace config reference after hot reload or gateway PATCH so commands see current defaults. */\n updateAgentConfig(config: Config): void {\n this.config = config;\n }\n\n /**\n * Build the unified command context shared by all execute paths.\n * When `recorder` is set, every reply text is also captured (for SSE / CLI aggregation).\n */\n private buildCommandContext(\n context: CommandContext,\n recorder?: (text: string) => void,\n ): UnifiedCommandContext {\n const skipBusOutbound = shouldSkipBusOutboundForChannel(context.channel);\n\n return createCommandContext({\n sessionKey: context.sessionKey,\n source: context.channel as 'telegram' | 'webui' | 'cli' | 'api' | 'system' | 'gateway',\n channelId: context.channel,\n chatId: context.chatId,\n senderId: context.senderId,\n isGroup: context.isGroup,\n config: this.config,\n bus: this.bus,\n sessionStore: this.sessionStore,\n sessionConfigStore: this.sessionConfigStore,\n applySessionThinkingLevel: this.applySessionThinkingLevel,\n\n replyHandler: async (text: string, _options?) => {\n recorder?.(text);\n if (skipBusOutbound) return;\n await this.bus.publishOutbound({\n channel: context.channel,\n chat_id: context.chatId,\n content: text,\n type: 'message',\n });\n },\n\n typingHandler: async (typing: boolean) => {\n if (skipBusOutbound) return;\n await this.bus.publishOutbound({\n channel: context.channel,\n chat_id: context.chatId,\n type: typing ? 'typing_on' : 'typing_off',\n });\n },\n\n supportedFeatures: ['markdown', 'typing'],\n\n getCurrentModel: this.getCurrentModel,\n\n switchModel: async (modelId: string) => {\n return this.switchModelForSession(context.sessionKey, modelId);\n },\n\n listModels: async () => {\n const providers = getAllProviders();\n const models: Array<{ id: string; name: string; provider: string }> = [];\n\n for (const providerId of providers) {\n if (isProviderConfiguredSync(providerId)) {\n const providerModels = getModelsByProvider(providerId);\n for (const m of providerModels) {\n models.push({\n id: `${m.provider}/${m.id}`,\n name: m.name || m.id,\n provider: getProviderDisplayName(providerId),\n });\n }\n }\n }\n\n return models;\n },\n\n getUsage: async () => {\n const messages = await this.sessionStore.load(context.sessionKey);\n let promptTokens = 0;\n let completionTokens = 0;\n\n for (const msg of messages) {\n if ('usage' in msg && msg.usage) {\n const usage = msg.usage as { input?: number; output?: number };\n promptTokens += usage.input || 0;\n completionTokens += usage.output || 0;\n }\n }\n\n return {\n promptTokens,\n completionTokens,\n totalTokens: promptTokens + completionTokens,\n messageCount: messages.length,\n };\n },\n\n invalidateAgentSession: this.invalidateAgentSession,\n\n resetSession: this.resetSession\n ? async (sk) => {\n await this.resetSession!(sk);\n }\n : undefined,\n\n abortCurrentTurn: this.abortSessionTurn\n ? async () => {\n await this.abortSessionTurn!(context.sessionKey);\n }\n : undefined,\n reloadSkills: this.reloadSkills\n ? async () => {\n await this.reloadSkills!();\n }\n : undefined,\n\n compactSession: this.compactSession,\n btwQuery: this.btwQuery,\n getSessionContextReport: this.getSessionContextReport,\n persistentGoalApis: this.getPersistentGoalApisForCommand({\n sessionKey: context.sessionKey,\n channel: context.channel,\n chatId: context.chatId,\n inboundMetadata: context.inboundMetadata,\n }),\n workflowRunService: this.getWorkflowRunService?.(),\n });\n }\n\n /**\n * Execute a command using the unified command system\n */\n async executeCommand(\n commandName: string,\n args: string,\n context: CommandContext,\n ): Promise<boolean> {\n if (!commandRegistry.has(commandName)) {\n return false;\n }\n\n log.info({ command: commandName, sessionKey: context.sessionKey }, 'Executing command via new system');\n\n const cmdCtx = this.buildCommandContext(context);\n const result = await commandRegistry.execute(commandName, cmdCtx, args);\n\n if (result.content && !shouldSkipBusOutboundForChannel(context.channel)) {\n await this.bus.publishOutbound({\n channel: context.channel,\n chat_id: context.chatId,\n content: result.content,\n type: 'message',\n });\n }\n\n return true;\n }\n\n /**\n * Run command and return all user-visible text (ctx.reply + result.content) for SSE/CLI.\n * Same bus side effects as {@link executeCommand}.\n */\n async executeCommandAndAggregateReply(\n commandName: string,\n args: string,\n context: CommandContext,\n ): Promise<{ handled: boolean; aggregatedText: string; metadata?: Record<string, unknown> }> {\n if (!commandRegistry.has(commandName)) {\n return { handled: false, aggregatedText: '' };\n }\n\n log.info({ command: commandName, sessionKey: context.sessionKey }, 'Executing command (aggregate reply)');\n\n const segments: string[] = [];\n const wrapped = this.buildCommandContext(context, (text) => segments.push(text));\n const result = await commandRegistry.execute(commandName, wrapped, args);\n\n if (result.content) {\n segments.push(result.content);\n if (!shouldSkipBusOutboundForChannel(context.channel)) {\n await this.bus.publishOutbound({\n channel: context.channel,\n chat_id: context.chatId,\n content: result.content,\n type: 'message',\n });\n }\n }\n\n const aggregatedText = segments.filter((s) => s && s.trim()).join('\\n\\n');\n return { handled: true, aggregatedText, metadata: result.metadata };\n }\n}\n"],"mappings":";;;;;;;gBAQoE;aAIf;AAUrD,MAAM,MAAM,aAAa,iBAAiB;;AAG1C,SAAS,gCAAgC,SAA0B;AACjE,QAAO,YAAY;;AAoDrB,IAAa,iBAAb,MAA4B;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,eAAqC;AAC/C,OAAK,SAAS,cAAc;AAC5B,OAAK,MAAM,cAAc;AACzB,OAAK,eAAe,cAAc;AAClC,OAAK,qBAAqB,cAAc;AACxC,OAAK,4BAA4B,cAAc;AAC/C,OAAK,kBAAkB,cAAc;AACrC,OAAK,wBAAwB,cAAc;AAC3C,OAAK,yBAAyB,cAAc;AAC5C,OAAK,mBAAmB,cAAc;AACtC,OAAK,eAAe,cAAc;AAClC,OAAK,iBAAiB,cAAc;AACpC,OAAK,WAAW,cAAc;AAC9B,OAAK,0BAA0B,cAAc;AAC7C,OAAK,kCAAkC,cAAc;AACrD,OAAK,eAAe,cAAc;AAClC,OAAK,wBAAwB,cAAc;;;CAI7C,kBAAkB,QAAsB;AACtC,OAAK,SAAS;;;;;;CAOhB,oBACE,SACA,UACuB;EACvB,MAAM,kBAAkB,gCAAgC,QAAQ,QAAQ;AAExE,SAAO,qBAAqB;GAC1B,YAAY,QAAQ;GACpB,QAAQ,QAAQ;G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SAAS,SAAS,KAAK,KAAK,CAAC;EAChF,MAAM,SAAS,MAAM,gBAAgB,QAAQ,aAAa,SAAS,KAAK;AAExE,MAAI,OAAO,SAAS;AAClB,YAAS,KAAK,OAAO,QAAQ;AAC7B,OAAI,CAAC,gCAAgC,QAAQ,QAAQ,CACnD,OAAM,KAAK,IAAI,gBAAgB;IAC7B,SAAS,QAAQ;IACjB,SAAS,QAAQ;IACjB,SAAS,OAAO;IAChB,MAAM;IACP,CAAC;;AAKN,SAAO;GAAE,SAAS;GAAM,gBADD,SAAS,QAAQ,MAAM,KAAK,EAAE,MAAM,CAAC,CAAC,KAAK,OAC5B;GAAE,UAAU,OAAO;GAAU"}
@@ -1,6 +1,6 @@
1
- import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
2
1
  import { createLogger } from "../../utils/logger/index.js";
3
2
  import { init_logger } from "../../utils/logger.js";
3
+ import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
4
4
  import { getAllModels, getDefaultModelSync, init_providers, resolveModel } from "../../providers/index.js";
5
5
  import { resolveAgentTurnTimeoutMs, runAgentTurnWithTimeout } from "../orchestration/run-agent-turn-with-timeout.js";
6
6
  import { isAssistantTurnAborted, isAssistantTurnFailed, maybeRetryTurnAfterTransientLlmFailure } from "../orchestration/llm-turn-retry.js";
@@ -3,8 +3,8 @@ import { init_logger } from "../../../utils/logger.js";
3
3
  import { requireXopcDatabase } from "../../../storage/sqlite/connection.js";
4
4
  import { resolveAgentIdFromMemoriesDir, searchMemoryIndex, syncMemoryIndex } from "../../../storage/sqlite/memory-index-repository.js";
5
5
  import "../../../storage/sqlite/index.js";
6
- import { join, relative } from "path";
7
6
  import { existsSync, readFileSync } from "fs";
7
+ import { join, relative } from "path";
8
8
  //#region src/agent/prompt/memory/index.ts
9
9
  init_logger();
10
10
  const log = createLogger("MemorySearch");
@@ -1,7 +1,7 @@
1
1
  import { resolveStateDir } from "../../config/paths-state.js";
2
+ import { init_paths } from "../../config/paths.js";
2
3
  import { createLogger } from "../../utils/logger/index.js";
3
4
  import { init_logger } from "../../utils/logger.js";
4
- import { init_paths } from "../../config/paths.js";
5
5
  import { DEFAULT_USER_FILENAME } from "../context/workspace.js";
6
6
  import { resolveSystemPromptBuildParams } from "./system-prompt-params.js";
7
7
  import { buildSystemPrompt } from "./system-prompt.js";
@@ -9,8 +9,8 @@ import { createSkillConfigManager } from "../skills/config.js";
9
9
  import { buildTtsSystemPromptHint } from "../../voice/tts/directives.js";
10
10
  import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
11
11
  import { selectSkillsVisibleInPrompt } from "../skills/format-skills-prompt.js";
12
- import { join } from "node:path";
13
12
  import { existsSync, readFileSync } from "node:fs";
13
+ import { join } from "node:path";
14
14
  //#region src/agent/prompt/service-prompt-builder.ts
15
15
  /**
16
16
  * System Prompt Builder - Builds the complete system prompt
@@ -1,7 +1,7 @@
1
1
  import { init_agent_scope, resolveAgentProfileDir } from "../agent-scope.js";
2
2
  import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
3
- import { join, resolve } from "node:path";
4
3
  import { readFileSync } from "node:fs";
4
+ import { join, resolve } from "node:path";
5
5
  //#region src/agent/reply/post-compaction-context.ts
6
6
  init_agent_scope();
7
7
  const MAX_CONTEXT_CHARS = 1800;
@@ -1,5 +1,5 @@
1
- import { resolve } from "node:path";
2
1
  import { readFileSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
3
  //#region src/agent/reply/workspace-boundary-read.ts
4
4
  /**
5
5
  * Read a file relative to workspace root with path traversal guard and byte cap.
@@ -1,6 +1,6 @@
1
- import { homedir } from "node:os";
2
- import { isAbsolute, normalize, resolve, sep } from "node:path";
3
1
  import { realpathSync } from "node:fs";
2
+ import { isAbsolute, normalize, resolve, sep } from "node:path";
3
+ import { homedir } from "node:os";
4
4
  //#region src/agent/sandbox/path-policy.ts
5
5
  /**
6
6
  * Path safety validation for sandbox isolation.
@@ -52,10 +52,14 @@ async function reconcileManagedDreamingCronJobs(cron, effectiveConfig) {
52
52
  kind: "agentTurn",
53
53
  message: spec.token
54
54
  };
55
+ const desiredSchedule = {
56
+ kind: "cron",
57
+ expr: spec.schedule,
58
+ ...dreaming.timezone ? { tz: dreaming.timezone } : {}
59
+ };
55
60
  if (phaseJobs.length === 0) {
56
- await cron.addJob(spec.schedule, {
61
+ await cron.addJob(desiredSchedule, {
57
62
  name: spec.cronName,
58
- timezone: dreaming.timezone,
59
63
  sessionTarget: "isolated",
60
64
  payload: desiredPayload,
61
65
  enabled: true
@@ -65,9 +69,8 @@ async function reconcileManagedDreamingCronJobs(cron, effectiveConfig) {
65
69
  const primary = phaseJobs[0];
66
70
  for (const dup of phaseJobs.slice(1)) await cron.removeJob(dup.id).catch(() => {});
67
71
  const payloadMessage = primary.payload?.kind === "agentTurn" ? primary.payload.message : primary.payload?.text;
68
- if (primary.schedule !== spec.schedule || (dreaming.timezone ?? null) !== (primary.timezone ?? null) || primary.sessionTarget !== "isolated" || payloadMessage !== spec.token || primary.enabled !== true || primary.name !== spec.cronName) await cron.updateJob(primary.id, {
69
- schedule: spec.schedule,
70
- timezone: dreaming.timezone ?? void 0,
72
+ if (JSON.stringify(primary.schedule) !== JSON.stringify(desiredSchedule) || primary.sessionTarget !== "isolated" || payloadMessage !== spec.token || primary.enabled !== true || primary.name !== spec.cronName) await cron.updateJob(primary.id, {
73
+ schedule: desiredSchedule,
71
74
  sessionTarget: "isolated",
72
75
  name: spec.cronName,
73
76
  payload: desiredPayload,
@@ -1 +1 @@
1
- {"version":3,"file":"reconcile-dreaming-cron.js","names":[],"sources":["../../../../src/agent/service/reconcile-dreaming-cron.ts"],"sourcesContent":["import type { Config } from '../../config/schema.js';\nimport type { CronService } from '../../cron/index.js';\nimport type { JobWithNextRun } from '../../cron/types.js';\nimport {\n DREAMING_SWEEP_TOKEN,\n DREAMING_LIGHT_CRON_NAME,\n DREAMING_LIGHT_SWEEP_TOKEN,\n DREAMING_CRON_NAME,\n DREAMING_REM_CRON_NAME,\n DREAMING_REM_SWEEP_TOKEN,\n} from '../memory/dreaming/constants.js';\nimport { resolveDreamingConfig } from '../memory/dreaming/config.js';\n\nconst DREAMING_SWEEP_TOKENS = new Set<string>([\n DREAMING_LIGHT_SWEEP_TOKEN,\n DREAMING_SWEEP_TOKEN,\n DREAMING_REM_SWEEP_TOKEN,\n]);\n\nfunction dreamingSweepTokenFromJob(job: JobWithNextRun): string | undefined {\n if (job.payload?.kind !== 'agentTurn') {\n return undefined;\n }\n const msg = job.payload.message;\n return typeof msg === 'string' && DREAMING_SWEEP_TOKENS.has(msg) ? msg : undefined;\n}\n\n/**\n * Reconcile managed Dreaming cron jobs against the current effective config.\n */\nexport async function reconcileManagedDreamingCronJobs(\n cron: CronService,\n effectiveConfig: Config | undefined,\n): Promise<void> {\n const dreaming = resolveDreamingConfig(effectiveConfig);\n const jobs = await cron.listJobs();\n /** Match by sweep token — job names omit `[managed-by=…]`, so name-only matching never saw these jobs and re-added them every reconcile. */\n const managed = jobs.filter((job) => dreamingSweepTokenFromJob(job) !== undefined);\n\n const phaseSpecs: Array<{\n cronName: string;\n token: string;\n schedule: string;\n phaseEnabled: boolean;\n }> = [\n {\n cronName: DREAMING_LIGHT_CRON_NAME,\n token: DREAMING_LIGHT_SWEEP_TOKEN,\n schedule: dreaming.phases.light.cron,\n phaseEnabled: dreaming.phases.light.enabled,\n },\n {\n cronName: DREAMING_CRON_NAME,\n token: DREAMING_SWEEP_TOKEN,\n schedule: dreaming.phases.deep.cron,\n phaseEnabled: dreaming.phases.deep.enabled,\n },\n {\n cronName: DREAMING_REM_CRON_NAME,\n token: DREAMING_REM_SWEEP_TOKEN,\n schedule: dreaming.phases.rem.cron,\n phaseEnabled: dreaming.phases.rem.enabled,\n },\n ];\n\n if (!dreaming.enabled) {\n for (const job of managed) {\n await cron.removeJob(job.id).catch(() => {});\n }\n return;\n }\n\n for (const spec of phaseSpecs) {\n const phaseJobs = managed.filter((job) => dreamingSweepTokenFromJob(job) === spec.token);\n\n if (!spec.phaseEnabled) {\n for (const job of phaseJobs) {\n await cron.removeJob(job.id).catch(() => {});\n }\n continue;\n }\n\n const desiredPayload = { kind: 'agentTurn' as const, message: spec.token };\n\n if (phaseJobs.length === 0) {\n await cron.addJob(spec.schedule, {\n name: spec.cronName,\n timezone: dreaming.timezone,\n sessionTarget: 'isolated' as const,\n payload: desiredPayload,\n enabled: true,\n } as any);\n continue;\n }\n\n const primary = phaseJobs[0]!;\n for (const dup of phaseJobs.slice(1)) {\n await cron.removeJob(dup.id).catch(() => {});\n }\n\n const payloadMessage =\n primary.payload?.kind === 'agentTurn'\n ? primary.payload.message\n : (primary.payload as any)?.text;\n const needsUpdate =\n primary.schedule !== spec.schedule ||\n (dreaming.timezone ?? null) !== (primary.timezone ?? null) ||\n primary.sessionTarget !== 'isolated' ||\n payloadMessage !== spec.token ||\n primary.enabled !== true ||\n primary.name !== spec.cronName;\n\n if (needsUpdate) {\n await cron.updateJob(primary.id, {\n schedule: spec.schedule,\n timezone: dreaming.timezone ?? undefined,\n sessionTarget: 'isolated',\n name: spec.cronName,\n payload: desiredPayload,\n enabled: true,\n } as any);\n }\n }\n}\n"],"mappings":";;;AAaA,MAAM,wBAAwB,IAAI,IAAY;CAC5C;CACA;CACA;CACD,CAAC;AAEF,SAAS,0BAA0B,KAAyC;AAC1E,KAAI,IAAI,SAAS,SAAS,YACxB;CAEF,MAAM,MAAM,IAAI,QAAQ;AACxB,QAAO,OAAO,QAAQ,YAAY,sBAAsB,IAAI,IAAI,GAAG,MAAM,KAAA;;;;;AAM3E,eAAsB,iCACpB,MACA,iBACe;CACf,MAAM,WAAW,sBAAsB,gBAAgB;;CAGvD,MAAM,WAAU,MAFG,KAAK,UAAU,EAEb,QAAQ,QAAQ,0BAA0B,IAAI,KAAK,KAAA,EAAU;CAElF,MAAM,aAKD;EACH;GACE,UAAU;GACV,OAAO;GACP,UAAU,SAAS,OAAO,MAAM;GAChC,cAAc,SAAS,OAAO,MAAM;GACrC;EACD;GACE,UA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AQ"}
1
+ {"version":3,"file":"reconcile-dreaming-cron.js","names":[],"sources":["../../../../src/agent/service/reconcile-dreaming-cron.ts"],"sourcesContent":["import type { Config } from '../../config/schema.js';\nimport type { CronService } from '../../cron/index.js';\nimport type { JobData } from '../../cron/types.js';\nimport {\n DREAMING_SWEEP_TOKEN,\n DREAMING_LIGHT_CRON_NAME,\n DREAMING_LIGHT_SWEEP_TOKEN,\n DREAMING_CRON_NAME,\n DREAMING_REM_CRON_NAME,\n DREAMING_REM_SWEEP_TOKEN,\n} from '../memory/dreaming/constants.js';\nimport { resolveDreamingConfig } from '../memory/dreaming/config.js';\n\nconst DREAMING_SWEEP_TOKENS = new Set<string>([\n DREAMING_LIGHT_SWEEP_TOKEN,\n DREAMING_SWEEP_TOKEN,\n DREAMING_REM_SWEEP_TOKEN,\n]);\n\nfunction dreamingSweepTokenFromJob(job: JobData): string | undefined {\n if (job.payload?.kind !== 'agentTurn') {\n return undefined;\n }\n const msg = job.payload.message;\n return typeof msg === 'string' && DREAMING_SWEEP_TOKENS.has(msg) ? msg : undefined;\n}\n\n/**\n * Reconcile managed Dreaming cron jobs against the current effective config.\n */\nexport async function reconcileManagedDreamingCronJobs(\n cron: CronService,\n effectiveConfig: Config | undefined,\n): Promise<void> {\n const dreaming = resolveDreamingConfig(effectiveConfig);\n const jobs = await cron.listJobs();\n /** Match by sweep token — job names omit `[managed-by=…]`, so name-only matching never saw these jobs and re-added them every reconcile. */\n const managed = jobs.filter((job) => dreamingSweepTokenFromJob(job) !== undefined);\n\n const phaseSpecs: Array<{\n cronName: string;\n token: string;\n schedule: string;\n phaseEnabled: boolean;\n }> = [\n {\n cronName: DREAMING_LIGHT_CRON_NAME,\n token: DREAMING_LIGHT_SWEEP_TOKEN,\n schedule: dreaming.phases.light.cron,\n phaseEnabled: dreaming.phases.light.enabled,\n },\n {\n cronName: DREAMING_CRON_NAME,\n token: DREAMING_SWEEP_TOKEN,\n schedule: dreaming.phases.deep.cron,\n phaseEnabled: dreaming.phases.deep.enabled,\n },\n {\n cronName: DREAMING_REM_CRON_NAME,\n token: DREAMING_REM_SWEEP_TOKEN,\n schedule: dreaming.phases.rem.cron,\n phaseEnabled: dreaming.phases.rem.enabled,\n },\n ];\n\n if (!dreaming.enabled) {\n for (const job of managed) {\n await cron.removeJob(job.id).catch(() => {});\n }\n return;\n }\n\n for (const spec of phaseSpecs) {\n const phaseJobs = managed.filter((job) => dreamingSweepTokenFromJob(job) === spec.token);\n\n if (!spec.phaseEnabled) {\n for (const job of phaseJobs) {\n await cron.removeJob(job.id).catch(() => {});\n }\n continue;\n }\n\n const desiredPayload = { kind: 'agentTurn' as const, message: spec.token };\n const desiredSchedule = {\n kind: 'cron' as const,\n expr: spec.schedule,\n ...(dreaming.timezone ? { tz: dreaming.timezone } : {}),\n };\n\n if (phaseJobs.length === 0) {\n await cron.addJob(desiredSchedule, {\n name: spec.cronName,\n sessionTarget: 'isolated' as const,\n payload: desiredPayload,\n enabled: true,\n } as any);\n continue;\n }\n\n const primary = phaseJobs[0]!;\n for (const dup of phaseJobs.slice(1)) {\n await cron.removeJob(dup.id).catch(() => {});\n }\n\n const payloadMessage =\n primary.payload?.kind === 'agentTurn'\n ? primary.payload.message\n : (primary.payload as any)?.text;\n const needsUpdate =\n JSON.stringify(primary.schedule) !== JSON.stringify(desiredSchedule) ||\n primary.sessionTarget !== 'isolated' ||\n payloadMessage !== spec.token ||\n primary.enabled !== true ||\n primary.name !== spec.cronName;\n\n if (needsUpdate) {\n await cron.updateJob(primary.id, {\n schedule: desiredSchedule,\n sessionTarget: 'isolated',\n name: spec.cronName,\n payload: desiredPayload,\n enabled: true,\n } as any);\n }\n }\n}\n"],"mappings":";;;AAaA,MAAM,wBAAwB,IAAI,IAAY;CAC5C;CACA;CACA;CACD,CAAC;AAEF,SAAS,0BAA0B,KAAkC;AACnE,KAAI,IAAI,SAAS,SAAS,YACxB;CAEF,MAAM,MAAM,IAAI,QAAQ;AACxB,QAAO,OAAO,QAAQ,YAAY,s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IAAI,GAAG,CAAC,YAAY,GAAG;EAG9C,MAAM,iBACJ,QAAQ,SAAS,SAAS,cACtB,QAAQ,QAAQ,UACf,QAAQ,SAAiB;AAQhC,MANE,KAAK,UAAU,QAAQ,SAAS,KAAK,KAAK,UAAU,gBAAgB,IACpE,QAAQ,kBAAkB,cAC1B,mBAAmB,KAAK,SACxB,QAAQ,YAAY,QACpB,QAAQ,SAAS,KAAK,SAGtB,OAAM,KAAK,UAAU,QAAQ,IAAI;GAC/B,UAAU;GACV,eAAe;GACf,MAAM,KAAK;GACX,SAAS;GACT,SAAS;GACV,CAAQ"}
@@ -5,7 +5,7 @@ import { SessionStore } from '../session/index.js';
5
5
  import { OutboundCoordinator } from './messaging/index.js';
6
6
  import { TurnDispatcher } from './inbound/turn-dispatcher.js';
7
7
  import { SessionConfigService, SessionHydrator, SessionInspector } from './session/index.js';
8
- import { type AgentSkillAvailabilityPayload, type SkillCatalogEntry } from './agent-manager.js';
8
+ import { type AgentSkillAvailabilityPayload, type SkillCatalogEntry, type SkillCatalogSnapshot } from './agent-manager.js';
9
9
  import type { SkillMarkdownPreviewPayload } from './skills/types.js';
10
10
  import type { AgentServiceConfig, StreamHandle } from './service.types.js';
11
11
  import { PersistentGoalService } from './goals/persistent-goal-service.js';
@@ -109,6 +109,7 @@ export declare class AgentService {
109
109
  */
110
110
  applyAgentDefaultsFromConfig(config: Config): void;
111
111
  getSkillCatalog(): SkillCatalogEntry[];
112
+ getSkillCatalogSnapshot(): SkillCatalogSnapshot;
112
113
  getAgentSkillAvailability(agentId: string): AgentSkillAvailabilityPayload;
113
114
  getSkillMarkdownSource(skillName: string): SkillMarkdownPreviewPayload | null;
114
115
  refreshSkillsAfterDiskChange(): void;
@@ -1,9 +1,9 @@
1
- import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
2
- import { applyConfigOverrides } from "../config/runtime-overrides.js";
3
1
  import { init_agent_scope, resolveAgentHomeDir, resolveAgentProfileDir, resolveDefaultAgentId } from "./agent-scope.js";
4
- import { extractProfileAgentId, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
5
2
  import { createLogger } from "../utils/logger/index.js";
6
3
  import { init_logger } from "../utils/logger.js";
4
+ import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
5
+ import { applyConfigOverrides } from "../config/runtime-overrides.js";
6
+ import { extractProfileAgentId, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
7
7
  import { extractTextContent } from "./context/workspace.js";
8
8
  import { parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
9
9
  import { getWorkflowProgressBroker } from "./workflow/progress-broker.js";
@@ -61,9 +61,9 @@ import { parseOutboundSessionKey } from "./service/parse-outbound-session-key.js
61
61
  import { cleanTrailingErrors } from "./memory/message-sanitizer.js";
62
62
  import { MemoryFlushService } from "./memory/memory-flush.js";
63
63
  import { tryApplySessionTranscriptHygiene } from "./transcript/transcript-hygiene.js";
64
- import { join } from "node:path";
65
64
  import { existsSync, readFileSync } from "node:fs";
66
65
  import { readFile } from "node:fs/promises";
66
+ import { join } from "node:path";
67
67
  //#region src/agent/service.ts
68
68
  init_schema();
69
69
  init_logger();
@@ -231,7 +231,8 @@ var AgentService = class {
231
231
  verboseLevel: config.verboseLevel,
232
232
  gatewayClarify: config.gatewayClarify,
233
233
  getCronService: config.getCronService,
234
- getWorkflowRunService: config.getWorkflowRunService
234
+ getWorkflowRunService: config.getWorkflowRunService,
235
+ onSkillsUpdated: config.onSkillsUpdated
235
236
  });
236
237
  this.agentEventHandler = new AgentEventHandler({
237
238
  progressManager: this.progressManager,
@@ -300,6 +301,7 @@ var AgentService = class {
300
301
  await this.streamManager.abort();
301
302
  this.agentOrchestrator.abort(sessionKey);
302
303
  },
304
+ reloadSkills: () => this.refreshSkillsAfterDiskChange(),
303
305
  compactSession: (sessionKey, options) => this.sessionInspector.compact(sessionKey, options),
304
306
  btwQuery: (sessionKey, question) => this.sessionInspector.btwQuery(sessionKey, question),
305
307
  getSessionContextReport: (sessionKey, mode) => this.sessionInspector.report(sessionKey, mode)
@@ -512,6 +514,9 @@ var AgentService = class {
512
514
  getSkillCatalog() {
513
515
  return this.agentManager.getSkillCatalog();
514
516
  }
517
+ getSkillCatalogSnapshot() {
518
+ return this.agentManager.getSkillCatalogSnapshot();
519
+ }
515
520
  getAgentSkillAvailability(agentId) {
516
521
  return this.agentManager.getAgentSkillAvailability(agentId);
517
522
  }