@xopcai/xopc 0.0.409 → 0.0.411

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 (703) hide show
  1. package/README.md +12 -6
  2. package/README.zh-CN.md +12 -6
  3. package/dist/browser-ext/dist/assets/{page-context-A5RCibM_.js → page-context-MuzjMBlJ.js} +1 -1
  4. package/dist/browser-ext/dist/background.js +1 -1
  5. package/dist/browser-ext/dist/sidepanel.html +1 -1
  6. package/dist/browser-ext/dist/sidepanel.js +1 -1
  7. package/dist/browser-ext/manifest.json +1 -1
  8. package/dist/extensions/feishu/src/adapters/gateway-setup.js +9 -3
  9. package/dist/extensions/feishu/src/plugin.d.ts +0 -3
  10. package/dist/extensions/feishu/src/plugin.js +1 -11
  11. package/dist/extensions/feishu/src/schema/config-schema.d.ts +0 -2
  12. package/dist/extensions/feishu/src/schema/config-schema.js +9 -21
  13. package/dist/extensions/feishu/src/state/accounts.js +3 -7
  14. package/dist/extensions/telegram/src/plugin.d.ts +0 -3
  15. package/dist/extensions/telegram/src/plugin.js +0 -9
  16. package/dist/extensions/telegram/xopc.extension.json +1 -1
  17. package/dist/extensions/weixin/src/plugin.d.ts +0 -3
  18. package/dist/extensions/weixin/src/plugin.js +1 -12
  19. package/dist/gateway/static/root/assets/agent-avatar-dicebear-sGJnq-SA.js +1 -0
  20. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BI7OTo-T.js +1 -0
  21. package/dist/gateway/static/root/assets/agents-RIXL0p7_.js +77 -0
  22. package/dist/gateway/static/root/assets/{agents-admin-api-D0UyB0Y_.js → agents-admin-api-uGDeJR1f.js} +1 -1
  23. package/dist/gateway/static/root/assets/app-management-settings-panel-BGzhSS6H.js +1 -0
  24. package/dist/gateway/static/root/assets/{appearance-settings-Dzhmj_ZO.js → appearance-settings-DtEZq4b2.js} +1 -1
  25. package/dist/gateway/static/root/assets/apps-page-DZqBof2D.js +1 -0
  26. package/dist/gateway/static/root/assets/{archive-plugin-D4r4P5uG.js → archive-plugin-CGdU_E5B.js} +1 -1
  27. package/dist/gateway/static/root/assets/{automation-display-DCkjVzA0.js → automation-display-BFN7zWBg.js} +1 -1
  28. package/dist/gateway/static/root/assets/{automations-page-BlNe3DXU.js → automations-page-BAPZY56r.js} +1 -1
  29. package/dist/gateway/static/root/assets/automations-workspace-CI-yQnSj.js +8 -0
  30. package/dist/gateway/static/root/assets/{binary-plugins-DuN5L6lm.js → binary-plugins-B0ispXo2.js} +1 -1
  31. package/dist/gateway/static/root/assets/{block-editor-DUSVn51h.js → block-editor-B9Ci-prO.js} +40 -40
  32. package/dist/gateway/static/root/assets/{browser-automation-inputs-D8bZ9iz2.js → browser-automation-inputs-D4-vQc4g.js} +1 -1
  33. package/dist/gateway/static/root/assets/browser-automations-page-Xzdif447.js +3 -0
  34. package/dist/gateway/static/root/assets/browser-settings-page-Bhu-83eC.js +3 -0
  35. package/dist/gateway/static/root/assets/capabilities-B9b5KCBb.js +1 -0
  36. package/dist/gateway/static/root/assets/capabilities-page-BIc0Zlsw.js +2 -0
  37. package/dist/gateway/static/root/assets/capabilities-settings-panel-CQEfpLdj.js +8 -0
  38. package/dist/gateway/static/root/assets/{capability-header-actions-oBPqUlbj.js → capability-header-actions-Cic05oWh.js} +1 -1
  39. package/dist/gateway/static/root/assets/channels-DQbEoo_o.js +1 -0
  40. package/dist/gateway/static/root/assets/{chat-terminal-dock-BLs3NaOP.js → chat-terminal-dock-Bm-IGeDe.js} +2 -2
  41. package/dist/gateway/static/root/assets/{chunk-KS7C4IRE-B2HK1psj.js → chunk-KS7C4IRE-BvcCCgTW.js} +2 -2
  42. package/dist/gateway/static/root/assets/computer-settings-page-C9xMfwXK.js +1 -0
  43. package/dist/gateway/static/root/assets/connector-service-page-DcdASUU9.js +1 -0
  44. package/dist/gateway/static/root/assets/connectors-page-eh-xpMPK.js +1 -0
  45. package/dist/gateway/static/root/assets/date-formatters-DukWSVwc.js +1 -0
  46. package/dist/gateway/static/root/assets/{date-picker-DVlbwrYg.js → date-picker-gVLWu9R0.js} +1 -1
  47. package/dist/gateway/static/root/assets/dependency-picker-C0LARyok.js +1 -0
  48. package/dist/gateway/static/root/assets/desktop-pet-settings-B_-j-D4W.js +1 -0
  49. package/dist/gateway/static/root/assets/desktop-pet-v_le3sCs.js +1 -0
  50. package/dist/gateway/static/root/assets/device-pairing-wizard-CxG_FcQ6.js +1 -0
  51. package/dist/gateway/static/root/assets/{directory-picker-path-field-QZ0p-uNa.js → directory-picker-path-field-CBefVUPR.js} +1 -1
  52. package/dist/gateway/static/root/assets/electron-env-Dit0bHgy.js +1 -0
  53. package/dist/gateway/static/root/assets/{extension-debug-page-DoVPUHu_.js → extension-debug-page-CTe7Molh.js} +1 -1
  54. package/dist/gateway/static/root/assets/{extension-page-BNe8n3iJ.js → extension-page-C0-oP7S_.js} +1 -1
  55. package/dist/gateway/static/root/assets/{extension-settings-page-DxNpjGJD.js → extension-settings-page-DYJmgMUg.js} +1 -1
  56. package/dist/gateway/static/root/assets/files-Bw4SBGdM.js +1 -0
  57. package/dist/gateway/static/root/assets/{gateway-config-swr-CTXr917C.js → gateway-config-swr-BVqYVaGy.js} +1 -1
  58. package/dist/gateway/static/root/assets/gateway-realtime-CY1LBGBS.js +1 -0
  59. package/dist/gateway/static/root/assets/gateway-realtime-store-Dafw95ol.js +1 -0
  60. package/dist/gateway/static/root/assets/gateway-settings-C13P4lQd.js +1 -0
  61. package/dist/gateway/static/root/assets/{gateway-startup-retry-DD2fsxdd.js → gateway-startup-retry-CPKGkr6D.js} +1 -1
  62. package/dist/gateway/static/root/assets/highlight-code-CslBKXdS.js +1 -0
  63. package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-DrZq5KTj.js → highlighted-body-KQOG7T2V-CN5PNRN3.js} +1 -1
  64. package/dist/gateway/static/root/assets/home-page-B_XrkGmA.js +2 -0
  65. package/dist/gateway/static/root/assets/image-generation-api-DRLXG9Ws.js +1 -0
  66. package/dist/gateway/static/root/assets/imports-page--cuF5vwU.js +1 -0
  67. package/dist/gateway/static/root/assets/index-6YjAt50A.js +710 -0
  68. package/dist/gateway/static/root/assets/index-caRW34rg.css +1 -0
  69. package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-5g2PxgBs.js +1 -0
  70. package/dist/gateway/static/root/assets/languages-byq_L2Ae.js +2 -0
  71. package/dist/gateway/static/root/assets/local-app-workbench-page-B6U1HQpp.js +1 -0
  72. package/dist/gateway/static/root/assets/local-apps-page-BChE6nUD.js +1 -0
  73. package/dist/gateway/static/root/assets/{local-session-drafts-TqLFKwYo.js → local-session-drafts-BCaC-1rH.js} +1 -1
  74. package/dist/gateway/static/root/assets/locale-store-DAgpZxAS.js +1 -0
  75. package/dist/gateway/static/root/assets/logs-page-B9mq03SK.js +2 -0
  76. package/dist/gateway/static/root/assets/management-settings-2W_qJsha.js +1 -0
  77. package/dist/gateway/static/root/assets/markdown-editor-phTQ0mox.js +1 -0
  78. package/dist/gateway/static/root/assets/{media-plugins-s6EqtAUQ.js → media-plugins-BmLuWkkZ.js} +1 -1
  79. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-61Il2HQR.js +1 -0
  80. package/dist/gateway/static/root/assets/messages-DMXSIJUO.js +3 -0
  81. package/dist/gateway/static/root/assets/note-detail-panel-C4gZsNBL.js +5 -0
  82. package/dist/gateway/static/root/assets/note-image-lightbox-XqJIaaRV.js +1 -0
  83. package/dist/gateway/static/root/assets/notes-page-Chdwrjni.js +8 -0
  84. package/dist/gateway/static/root/assets/page-context-capture-button-B7rDRlS7.js +1 -0
  85. package/dist/gateway/static/root/assets/personal-page-mQl9BftY.js +1 -0
  86. package/dist/gateway/static/root/assets/personal-settings-panel-BgcJLmZN.js +1 -0
  87. package/dist/gateway/static/root/assets/plugin-details-dialog-FvwSxZPB.js +1 -0
  88. package/dist/gateway/static/root/assets/preview-open-alternatives-Z4NM7_Dn.js +1 -0
  89. package/dist/gateway/static/root/assets/product-delivery-BqNm-8S5.js +1 -0
  90. package/dist/gateway/static/root/assets/{product-open-page-BPWSqtRt.js → product-open-page-C5TcIaJj.js} +1 -1
  91. package/dist/gateway/static/root/assets/product-preview-content-5xID6jIj.js +1 -0
  92. package/dist/gateway/static/root/assets/project-detail-page-CGOyx7zX.js +7 -0
  93. package/dist/gateway/static/root/assets/projects-page-Dd11tbRX.js +1 -0
  94. package/dist/gateway/static/root/assets/{registry-api-4NZOh0iz.js → registry-api-B6kqbuw8.js} +1 -1
  95. package/dist/gateway/static/root/assets/remote-access-hub-Bintk9nL.js +1 -0
  96. package/dist/gateway/static/root/assets/runtime-tools-api-CY3R7unQ.js +5 -0
  97. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CNCx2RnO.js → runtime-tools-settings-panel-CbmiiLsq.js} +1 -1
  98. package/dist/gateway/static/root/assets/{schema-form-nRDA2XfI.js → schema-form-DtPkiYwm.js} +1 -1
  99. package/dist/gateway/static/root/assets/session-api-D6-Vz8xK.js +1 -0
  100. package/dist/gateway/static/root/assets/{session-manager-D2sLfkw-.js → session-manager-DWbcMHcj.js} +3 -3
  101. package/dist/gateway/static/root/assets/sessions-page-BBlEP7y3.js +1 -0
  102. package/dist/gateway/static/root/assets/settings-advanced-gate-BCQUth4g.js +1 -0
  103. package/dist/gateway/static/root/assets/{settings-form-section-_ALUREPr.js → settings-form-section-DD3iD5t5.js} +1 -1
  104. package/dist/gateway/static/root/assets/{settings-page-29ptuMYZ.js → settings-page-iLY3LRDq.js} +1 -1
  105. package/dist/gateway/static/root/assets/setup-status-panel-v4P0IAkG.js +1 -0
  106. package/dist/gateway/static/root/assets/share-preview-page-B8h9lqDL.js +2 -0
  107. package/dist/gateway/static/root/assets/shares-settings-DMzej6z2.js +1 -0
  108. package/dist/gateway/static/root/assets/{skill-api-C-T0K7Oo.js → skill-api-C9RsrvOp.js} +1 -1
  109. package/dist/gateway/static/root/assets/skill-reload-api-B20x7EE9.js +1 -0
  110. package/dist/gateway/static/root/assets/skills-page-C_ulsnv7.js +2 -0
  111. package/dist/gateway/static/root/assets/source-workspace-editor-BIvi89Zx.js +1 -0
  112. package/dist/gateway/static/root/assets/system-settings-panel-PTRGMKkq.js +1 -0
  113. package/dist/gateway/static/root/assets/task-detail-page-DEPwo4vf.js +2 -0
  114. package/dist/gateway/static/root/assets/task-result-evidence-DjNWPpn_.js +1 -0
  115. package/dist/gateway/static/root/assets/tasks-TVRjEggr.js +1 -0
  116. package/dist/gateway/static/root/assets/tracing-settings-page-CVJt7IXC.js +1 -0
  117. package/dist/gateway/static/root/assets/{tunnel-api-DcDUSAjv.js → tunnel-api-C6XfsSWy.js} +1 -1
  118. package/dist/gateway/static/root/assets/{usage-page-Hut0SDqn.js → usage-page-DgqLD8Y5.js} +1 -1
  119. package/dist/gateway/static/root/assets/{use-autosave-C4TUlpsu.js → use-autosave-DO-Twmbm.js} +1 -1
  120. package/dist/gateway/static/root/assets/user-model-page-BwK37aob.js +2 -0
  121. package/dist/gateway/static/root/assets/{vendor-codemirror-DFxP3B9T.js → vendor-codemirror-Qdcjid65.js} +16 -16
  122. package/dist/gateway/static/root/assets/{voice-api-key-field-CMdihbPb.js → voice-api-key-field-MGe3HkS_.js} +1 -1
  123. package/dist/gateway/static/root/assets/{voice-config-api-4yGMrp7J.js → voice-config-api-CPKzUb4R.js} +1 -1
  124. package/dist/gateway/static/root/assets/work-discovery-overlay-DptHqYh5.js +1 -0
  125. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-ClQKM2RA.js → xopc-cloud-account-card-Y_UIryBH.js} +1 -1
  126. package/dist/gateway/static/root/index.html +27 -35
  127. package/dist/package.js +1 -1
  128. package/dist/packages/endpoint-tools-protocol/src/index.js +1 -1
  129. package/dist/packages/gateway-contract/src/automations.js +0 -12
  130. package/dist/packages/gateway-contract/src/home.js +3 -3
  131. package/dist/packages/gateway-contract/src/product-delivery.js +0 -4
  132. package/dist/packages/gateway-contract/src/project-operating.js +0 -6
  133. package/dist/packages/gateway-contract/src/session-identity.js +0 -1
  134. package/dist/packages/gateway-contract/src/task-runs.js +0 -1
  135. package/dist/packages/gateway-contract/src/tasks.js +0 -6
  136. package/dist/src/activity/types.d.ts +4 -4
  137. package/dist/src/agent/agent-manager.d.ts +0 -3
  138. package/dist/src/agent/agent-manager.js +0 -43
  139. package/dist/src/agent/background-review/prompts.d.ts +8 -0
  140. package/dist/src/agent/background-review/prompts.js +9 -2
  141. package/dist/src/agent/background-review/run-background-review.js +73 -11
  142. package/dist/src/agent/capabilities/definitions.d.ts +2 -18
  143. package/dist/src/agent/capabilities/definitions.js +0 -17
  144. package/dist/src/agent/child-agent-factory.d.ts +1 -1
  145. package/dist/src/agent/client-error-format.d.ts +1 -1
  146. package/dist/src/agent/client-error-format.js +1 -1
  147. package/dist/src/agent/commands/command-registry.js +1 -1
  148. package/dist/src/agent/context/execution-scope.d.ts +2 -8
  149. package/dist/src/agent/context/execution-scope.js +6 -23
  150. package/dist/src/agent/embedded/index.d.ts +0 -1
  151. package/dist/src/agent/embedded/index.js +1 -2
  152. package/dist/src/agent/embedded/run-turn.js +25 -2
  153. package/dist/src/agent/embedded/sqlite-hydrating-session-manager.js +0 -2
  154. package/dist/src/agent/external-tools/gateway-tools.js +6 -6
  155. package/dist/src/agent/inbound/attachment-pipeline.d.ts +2 -0
  156. package/dist/src/agent/inbound/attachment-pipeline.js +10 -5
  157. package/dist/src/agent/mcp/connection-setup.js +2 -2
  158. package/dist/src/agent/memory/compaction-ledger.d.ts +1 -1
  159. package/dist/src/agent/memory/compaction-ledger.js +1 -1
  160. package/dist/src/agent/memory/compaction-promotion.js +1 -1
  161. package/dist/src/agent/memory/source-origin.js +1 -5
  162. package/dist/src/agent/memory/turn-provenance.js +1 -3
  163. package/dist/src/agent/memory/types.d.ts +1 -1
  164. package/dist/src/agent/messaging/command-handler.d.ts +0 -3
  165. package/dist/src/agent/messaging/command-handler.js +1 -4
  166. package/dist/src/agent/prompt/sections/behavior.js +2 -2
  167. package/dist/src/agent/prompt/sections/tooling.js +1 -5
  168. package/dist/src/agent/prompt/voice-presentation.d.ts +1 -1
  169. package/dist/src/agent/prompt/voice-presentation.js +1 -1
  170. package/dist/src/agent/service/direct-turn-helpers.js +1 -1
  171. package/dist/src/agent/service/process-direct-streaming.js +0 -6
  172. package/dist/src/agent/service.d.ts +0 -2
  173. package/dist/src/agent/service.js +0 -11
  174. package/dist/src/agent/service.types.d.ts +0 -2
  175. package/dist/src/agent/session/session-config-service.d.ts +0 -2
  176. package/dist/src/agent/session/session-config-service.js +1 -1
  177. package/dist/src/agent/session/session-inspector.d.ts +0 -1
  178. package/dist/src/agent/session/session-inspector.js +0 -1
  179. package/dist/src/agent/skills/required-env-vars.d.ts +1 -1
  180. package/dist/src/agent/skills/required-env-vars.js +1 -1
  181. package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
  182. package/dist/src/agent/tool-manuals/xopc-use.js +2 -5
  183. package/dist/src/agent/tools/automation-tool.js +1 -1
  184. package/dist/src/agent/tools/factory.d.ts +0 -3
  185. package/dist/src/agent/tools/factory.js +21 -10
  186. package/dist/src/agent/tools/index.d.ts +0 -2
  187. package/dist/src/agent/tools/index.js +1 -3
  188. package/dist/src/agent/tools/knowledge-memory-tool.d.ts +1 -0
  189. package/dist/src/agent/tools/knowledge-memory-tool.js +13 -4
  190. package/dist/src/agent/tools/personal-task-tool.js +8 -22
  191. package/dist/src/agent/tools/search/errors.js +2 -2
  192. package/dist/src/agent/tools/session-recall-tool.d.ts +3 -0
  193. package/dist/src/agent/tools/session-recall-tool.js +7 -0
  194. package/dist/src/agent/tools/session-search-tool.d.ts +3 -0
  195. package/dist/src/agent/tools/session-search-tool.js +20 -4
  196. package/dist/src/agent/tools/user-context-tool.js +7 -1
  197. package/dist/src/agent/tools/xopc-use-tool.js +1 -1
  198. package/dist/src/agent-catalog/index.d.ts +0 -1
  199. package/dist/src/agent-catalog/index.js +1 -2
  200. package/dist/src/agent-config/index.js +2 -2
  201. package/dist/src/agent-config/resolver.js +0 -6
  202. package/dist/src/agent-config/schema.d.ts +0 -16
  203. package/dist/src/agent-config/schema.js +2 -9
  204. package/dist/src/agent-matching/selection-repository.d.ts +1 -1
  205. package/dist/src/agent-matching/selection-repository.js +1 -1
  206. package/dist/src/agent-matching/service.d.ts +1 -2
  207. package/dist/src/agent-matching/service.js +3 -7
  208. package/dist/src/ai-assist/text-assist.d.ts +1 -1
  209. package/dist/src/ai-assist/text-assist.js +0 -72
  210. package/dist/src/automations/capabilities/write.d.ts +0 -40
  211. package/dist/src/automations/domain/types.d.ts +0 -15
  212. package/dist/src/automations/domain/validation.d.ts +0 -80
  213. package/dist/src/automations/domain/validation.js +0 -17
  214. package/dist/src/automations/draft/automation-draft-prompt.js +0 -3
  215. package/dist/src/automations/draft/automation-draft-validator.d.ts +0 -20
  216. package/dist/src/automations/draft/automation-draft-validator.js +0 -1
  217. package/dist/src/automations/events/event-catalog.js +0 -6
  218. package/dist/src/automations/service/action-executor.d.ts +0 -1
  219. package/dist/src/automations/service/action-executor.js +1 -110
  220. package/dist/src/automations/service/automation-service.js +0 -2
  221. package/dist/src/automations/storage/automation-run-repository.js +6 -7
  222. package/dist/src/backup/archive.js +1 -1
  223. package/dist/src/bootstrap/application-state.d.ts +2 -10
  224. package/dist/src/bootstrap/application-state.js +5 -18
  225. package/dist/src/channels/manager.d.ts +0 -2
  226. package/dist/src/channels/manager.js +0 -4
  227. package/dist/src/channels/pairing/index.d.ts +2 -1
  228. package/dist/src/channels/pairing/pairing-service.d.ts +0 -1
  229. package/dist/src/chat-commands/context.d.ts +0 -3
  230. package/dist/src/chat-commands/context.js +0 -5
  231. package/dist/src/chat-commands/index.d.ts +0 -1
  232. package/dist/src/chat-commands/index.js +1 -3
  233. package/dist/src/chat-commands/types.d.ts +0 -5
  234. package/dist/src/cli/command-manifest.js +1 -1
  235. package/dist/src/cli/commands/config.js +2 -10
  236. package/dist/src/cli/commands/doctor/checks/database-relations.js +0 -3
  237. package/dist/src/cli/commands/doctor/checks/database-schema.js +4 -25
  238. package/dist/src/cli/commands/gateway/run-foreground.js +1 -1
  239. package/dist/src/cli/commands/setup-shared/prompts.d.ts +2 -2
  240. package/dist/src/cli/commands/setup-shared/prompts.js +2 -2
  241. package/dist/src/cli/commands/tui-runner.js +2 -2
  242. package/dist/src/cli/extension-cli-register.js +1 -1
  243. package/dist/src/cli/index.d.ts +0 -1
  244. package/dist/src/cli/index.js +2 -2
  245. package/dist/src/cli/utils/init-workspace-core.js +3 -6
  246. package/dist/src/config/index.js +2 -2
  247. package/dist/src/config/loader.d.ts +0 -1
  248. package/dist/src/config/loader.js +1 -13
  249. package/dist/src/config/paths.d.ts +1 -1
  250. package/dist/src/config/paths.js +1 -1
  251. package/dist/src/connectors/composio-catalog.js +1 -3
  252. package/dist/src/connectors/composio.js +1 -2
  253. package/dist/src/connectors/connected-source-ingestion.js +1 -1
  254. package/dist/src/connectors/connected-source-understanding.js +1 -1
  255. package/dist/src/connectors/learning-coordinator.js +1 -1
  256. package/dist/src/connectors/principal.js +1 -22
  257. package/dist/src/connectors/{workflow-preflight.d.ts → requirements-preflight.d.ts} +9 -8
  258. package/dist/src/connectors/{workflow-preflight.js → requirements-preflight.js} +2 -10
  259. package/dist/src/connectors/types.d.ts +1 -1
  260. package/dist/src/daemon/types.d.ts +0 -9
  261. package/dist/src/discussions/long-review.js +0 -11
  262. package/dist/src/endpoint-tools/policy.js +13 -14
  263. package/dist/src/extensions/agent-plugins/auth.js +1 -3
  264. package/dist/src/extensions/agent-plugins/formats.js +2 -4
  265. package/dist/src/extensions/agent-plugins/mcp-format.d.ts +1 -1
  266. package/dist/src/extensions/agent-plugins/mcp-format.js +2 -2
  267. package/dist/src/extensions/bundled-extension-activation.d.ts +0 -2
  268. package/dist/src/extensions/bundled-extension-activation.js +1 -3
  269. package/dist/src/extensions/install.js +1 -1
  270. package/dist/src/extensions/types/tui.d.ts +1 -2
  271. package/dist/src/gateway/agent-builtin-tools.d.ts +1 -7
  272. package/dist/src/gateway/agent-builtin-tools.js +0 -7
  273. package/dist/src/gateway/agents-admin.d.ts +0 -1
  274. package/dist/src/gateway/agents-admin.js +0 -1
  275. package/dist/src/gateway/global-defaults-admin.js +1 -1
  276. package/dist/src/gateway/hono/lib/config-payload.d.ts +0 -8
  277. package/dist/src/gateway/hono/lib/config-payload.js +1 -2
  278. package/dist/src/gateway/hono/lib/config-write-lock.d.ts +1 -1
  279. package/dist/src/gateway/hono/lib/config-write-lock.js +1 -1
  280. package/dist/src/gateway/hono/middleware/auth.js +2 -2
  281. package/dist/src/gateway/hono/routes/activity.js +0 -1
  282. package/dist/src/gateway/hono/routes/agents.js +2 -9
  283. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +0 -22
  284. package/dist/src/gateway/hono/routes/chat-model-config.d.ts +0 -1
  285. package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -3
  286. package/dist/src/gateway/hono/routes/config.js +2 -21
  287. package/dist/src/gateway/hono/routes/connectors.js +1 -1
  288. package/dist/src/gateway/hono/routes/context-sources.js +1 -1
  289. package/dist/src/gateway/hono/routes/devices.js +2 -2
  290. package/dist/src/gateway/hono/routes/home.js +3 -20
  291. package/dist/src/gateway/hono/routes/lazy-bundles.js +0 -8
  292. package/dist/src/gateway/hono/routes/memory-learning.js +1 -1
  293. package/dist/src/gateway/hono/routes/personal-agent.js +1 -1
  294. package/dist/src/gateway/hono/routes/projects.js +0 -16
  295. package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -2
  296. package/dist/src/gateway/hono/routes/sessions.js +0 -3
  297. package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
  298. package/dist/src/gateway/hono/routes/user-model.js +1 -1
  299. package/dist/src/gateway/index.js +1 -1
  300. package/dist/src/gateway/run-loop.js +2 -2
  301. package/dist/src/gateway/security/device-request-proof.js +1 -1
  302. package/dist/src/gateway/security/gateway-scopes.js +0 -1
  303. package/dist/src/gateway/service/active-execution.d.ts +1 -1
  304. package/dist/src/gateway/service/active-execution.js +1 -1
  305. package/dist/src/gateway/service/agent-runner.js +1 -1
  306. package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -1
  307. package/dist/src/gateway/service/sessions-api.d.ts +1 -2
  308. package/dist/src/gateway/service/sessions-api.js +1 -1
  309. package/dist/src/gateway/service/task-conversation-query-service.d.ts +0 -4
  310. package/dist/src/gateway/service/types.d.ts +2 -0
  311. package/dist/src/gateway/service.d.ts +1 -8
  312. package/dist/src/gateway/service.js +20 -67
  313. package/dist/src/history/ctx/format.js +1 -1
  314. package/dist/src/home-intelligence/capability-preflight.js +1 -1
  315. package/dist/src/infra/unhandled-rejections.js +2 -2
  316. package/dist/src/infra/update-runner.d.ts +1 -2
  317. package/dist/src/infra/update-runner.js +2 -2
  318. package/dist/src/knowledge/connected-knowledge-pipeline.js +1 -1
  319. package/dist/src/knowledge/local-folder-adapter.js +2 -5
  320. package/dist/src/knowledge-memory/repository.d.ts +3 -1
  321. package/dist/src/knowledge-memory/repository.js +10 -3
  322. package/dist/src/knowledge-memory/usage-policy.js +1 -1
  323. package/dist/src/local-apps/service.js +1 -1
  324. package/dist/src/memory-learning/forget-capture.d.ts +14 -0
  325. package/dist/src/memory-learning/forget-capture.js +101 -0
  326. package/dist/src/memory-learning/forgotten-history.d.ts +15 -0
  327. package/dist/src/memory-learning/forgotten-history.js +137 -0
  328. package/dist/src/memory-learning/owner-directive.d.ts +2 -0
  329. package/dist/src/memory-learning/owner-directive.js +10 -0
  330. package/dist/src/memory-learning/service.js +0 -2
  331. package/dist/src/memory-learning/source-learning.js +1 -1
  332. package/dist/src/memory-learning/task-receipts.js +1 -1
  333. package/dist/src/memory-learning/work-capture.js +2 -1
  334. package/dist/src/migrations/index.js +2 -2
  335. package/dist/src/migrations/runner.d.ts +1 -2
  336. package/dist/src/migrations/runner.js +2 -5
  337. package/dist/src/notes/service.js +3 -3
  338. package/dist/src/notes/types.d.ts +1 -2
  339. package/dist/src/personal-agent/communication.d.ts +0 -3
  340. package/dist/src/personal-agent/communication.js +1 -12
  341. package/dist/src/personal-agent/persona.d.ts +0 -4
  342. package/dist/src/personal-agent/persona.js +1 -5
  343. package/dist/src/personal-agent/proactivity/repository.js +2 -6
  344. package/dist/src/personal-agent/prompt-context.js +1 -1
  345. package/dist/src/personal-agent/prompts.d.ts +0 -3
  346. package/dist/src/personal-agent/prompts.js +7 -146
  347. package/dist/src/personal-agent/reply-composer.js +3 -3
  348. package/dist/src/personal-agent/reply-style.d.ts +1 -13
  349. package/dist/src/personal-agent/reply-style.js +3 -123
  350. package/dist/src/personal-agent/request-delivery.d.ts +1 -1
  351. package/dist/src/personal-agent/request-delivery.js +1 -1
  352. package/dist/src/personal-agent/request-service.js +2 -2
  353. package/dist/src/personal-agent/specialist-capabilities.js +0 -1
  354. package/dist/src/personal-agent/task-cancel.js +2 -1
  355. package/dist/src/platform/client.d.ts +0 -1
  356. package/dist/src/platform/contracts.d.ts +0 -1
  357. package/dist/src/platform/contracts.js +1 -4
  358. package/dist/src/projects/index.d.ts +0 -1
  359. package/dist/src/projects/index.js +1 -2
  360. package/dist/src/projects/project-loop.d.ts +2 -12
  361. package/dist/src/projects/project-loop.js +19 -42
  362. package/dist/src/projects/project-store.d.ts +0 -1
  363. package/dist/src/projects/project-store.js +0 -11
  364. package/dist/src/projects/types.d.ts +0 -6
  365. package/dist/src/providers/model-usage.js +0 -5
  366. package/dist/src/realtime/runtime.js +0 -1
  367. package/dist/src/routing/agent-session-key.js +1 -1
  368. package/dist/src/session/manager.js +1 -1
  369. package/dist/src/session/store.d.ts +1 -0
  370. package/dist/src/session/types.d.ts +2 -6
  371. package/dist/src/storage/sqlite/connection-wait-repository.js +0 -33
  372. package/dist/src/storage/sqlite/connection.js +2 -2
  373. package/dist/src/storage/sqlite/device-access-repository.d.ts +2 -2
  374. package/dist/src/storage/sqlite/device-access-repository.js +4 -8
  375. package/dist/src/storage/sqlite/fts.d.ts +4 -0
  376. package/dist/src/storage/sqlite/fts.js +13 -4
  377. package/dist/src/storage/sqlite/home-attention-repository.d.ts +1 -1
  378. package/dist/src/storage/sqlite/index.d.ts +1 -3
  379. package/dist/src/storage/sqlite/index.js +4 -8
  380. package/dist/src/storage/sqlite/{migrations/conversation-backup.d.ts → offline-access.d.ts} +1 -4
  381. package/dist/src/storage/sqlite/{migrations/conversation-backup.js → offline-access.js} +6 -25
  382. package/dist/src/storage/sqlite/row-mappers.d.ts +0 -8
  383. package/dist/src/storage/sqlite/row-mappers.js +0 -8
  384. package/dist/src/storage/sqlite/{migrations/errors.d.ts → schema-errors.d.ts} +0 -6
  385. package/dist/src/storage/sqlite/schema-errors.js +28 -0
  386. package/dist/src/storage/sqlite/schema.d.ts +4 -5
  387. package/dist/src/storage/sqlite/schema.js +23 -19
  388. package/dist/src/storage/sqlite/schema.sql +1099 -427
  389. package/dist/src/storage/sqlite/session-identity-sql.js +1 -2
  390. package/dist/src/storage/sqlite/session-read-repository.d.ts +1 -1
  391. package/dist/src/storage/sqlite/session-read-repository.js +1 -2
  392. package/dist/src/storage/sqlite/session-repository.js +10 -36
  393. package/dist/src/storage/sqlite/transcript-repository.d.ts +1 -0
  394. package/dist/src/storage/sqlite/transcript-repository.js +14 -12
  395. package/dist/src/storage/sqlite/{migrations/conversation-windows-owners.js → windows-database-owners.js} +3 -3
  396. package/dist/src/tasks/attention-governor.d.ts +1 -0
  397. package/dist/src/tasks/attention-governor.js +2 -2
  398. package/dist/src/tasks/capabilities/management.d.ts +0 -1
  399. package/dist/src/tasks/capabilities/relations.d.ts +2 -2
  400. package/dist/src/tasks/execution-context.d.ts +1 -1
  401. package/dist/src/tasks/execution-context.js +0 -2
  402. package/dist/src/tasks/home-query-service.d.ts +2 -16
  403. package/dist/src/tasks/home-query-service.js +37 -67
  404. package/dist/src/tasks/index.d.ts +0 -1
  405. package/dist/src/tasks/index.js +1 -2
  406. package/dist/src/tasks/project-operating-view-service.js +0 -1
  407. package/dist/src/tasks/task-application-service.js +0 -5
  408. package/dist/src/tasks/task-repository.d.ts +1 -1
  409. package/dist/src/tasks/task-run-coordinator.js +4 -2
  410. package/dist/src/tui/backends/embedded-backend.d.ts +1 -4
  411. package/dist/src/tui/backends/embedded-backend.js +3 -59
  412. package/dist/src/tui/backends/gateway-realtime-backend.d.ts +1 -2
  413. package/dist/src/tui/backends/gateway-realtime-backend.js +1 -27
  414. package/dist/src/tui/components/chat-log.d.ts +0 -2
  415. package/dist/src/tui/components/chat-log.js +0 -18
  416. package/dist/src/tui/extension-host/runtime-context.js +0 -1
  417. package/dist/src/tui/tui-backend.d.ts +0 -15
  418. package/dist/src/tui/tui-command-formatters.d.ts +0 -3
  419. package/dist/src/tui/tui-command-formatters.js +1 -28
  420. package/dist/src/tui/tui-commands.d.ts +1 -14
  421. package/dist/src/tui/tui-commands.js +4 -89
  422. package/dist/src/tui/tui-startup-resources.js +0 -2
  423. package/dist/src/tui/tui-startup-text.js +2 -3
  424. package/dist/src/tui/tui.js +1 -49
  425. package/dist/src/user-context/trust-policy.js +1 -1
  426. package/dist/src/user-model/capture/semantic.d.ts +18 -1
  427. package/dist/src/user-model/capture/semantic.js +26 -1
  428. package/dist/src/user-model/usage-policy.js +1 -1
  429. package/dist/src/utils/index.js +1 -1
  430. package/dist/src/utils/logger/index.js +1 -1
  431. package/dist/src/utils/logger.js +1 -1
  432. package/dist/src/voice/realtime/agentBroker.js +2 -3
  433. package/dist/src/voice/realtime/memory-context.js +2 -2
  434. package/dist/src/work-discovery/incremental-repository.js +1 -1
  435. package/dist/src/work-discovery/service.js +2 -2
  436. package/package.json +5 -6
  437. package/dist/extensions/feishu/src/workflow-progress.d.ts +0 -27
  438. package/dist/extensions/feishu/src/workflow-progress.js +0 -98
  439. package/dist/extensions/telegram/src/workflow-progress.d.ts +0 -24
  440. package/dist/extensions/telegram/src/workflow-progress.js +0 -72
  441. package/dist/extensions/weixin/src/workflow-progress.d.ts +0 -26
  442. package/dist/extensions/weixin/src/workflow-progress.js +0 -98
  443. package/dist/gateway/static/root/assets/agent-avatar-dicebear-lMrejpsz.js +0 -1
  444. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-lXwR3Rff.js +0 -1
  445. package/dist/gateway/static/root/assets/agents-DFwBf95X.js +0 -77
  446. package/dist/gateway/static/root/assets/app-link-BV_eGr7l.js +0 -1
  447. package/dist/gateway/static/root/assets/app-management-settings-panel-Cja3eV7H.js +0 -1
  448. package/dist/gateway/static/root/assets/apps-page-C3xbCdYa.js +0 -1
  449. package/dist/gateway/static/root/assets/automations-workspace-CWvHbJBK.js +0 -6
  450. package/dist/gateway/static/root/assets/browser-automations-page-BtvOURHQ.js +0 -3
  451. package/dist/gateway/static/root/assets/browser-settings-page-C_OeE79S.js +0 -3
  452. package/dist/gateway/static/root/assets/capabilities-CD6PzNK7.js +0 -1
  453. package/dist/gateway/static/root/assets/capabilities-page-BKF6q_tC.js +0 -2
  454. package/dist/gateway/static/root/assets/capabilities-settings-panel-B7qOaUZs.js +0 -8
  455. package/dist/gateway/static/root/assets/channels-3M9-anCN.js +0 -1
  456. package/dist/gateway/static/root/assets/code-editor-CXIH8jQw.js +0 -1
  457. package/dist/gateway/static/root/assets/computer-settings-page-LaekhDG6.js +0 -1
  458. package/dist/gateway/static/root/assets/connector-service-page-DJP1n1_n.js +0 -1
  459. package/dist/gateway/static/root/assets/connectors-page-DmQqMy6l.js +0 -1
  460. package/dist/gateway/static/root/assets/dependency-picker-BhElpD_6.js +0 -1
  461. package/dist/gateway/static/root/assets/desktop-pet-ByvV-cDD.js +0 -1
  462. package/dist/gateway/static/root/assets/desktop-pet-settings-BBruQu-_.js +0 -1
  463. package/dist/gateway/static/root/assets/device-pairing-wizard-C3zOy8PO.js +0 -1
  464. package/dist/gateway/static/root/assets/dist-BGTk37IG.js +0 -1
  465. package/dist/gateway/static/root/assets/file-archive-DanfQJNe.js +0 -1
  466. package/dist/gateway/static/root/assets/file-braces-BoAMI_k9.js +0 -1
  467. package/dist/gateway/static/root/assets/gateway-realtime-CP6L2jIR.js +0 -1
  468. package/dist/gateway/static/root/assets/gateway-realtime-store-yXB4a40_.js +0 -1
  469. package/dist/gateway/static/root/assets/gateway-settings-CzrFZ0lB.js +0 -1
  470. package/dist/gateway/static/root/assets/highlight-code-BH65IIbJ.js +0 -1
  471. package/dist/gateway/static/root/assets/home-page-cXmd8x0S.js +0 -2
  472. package/dist/gateway/static/root/assets/image-generation-api-C6su4n9B.js +0 -1
  473. package/dist/gateway/static/root/assets/imports-page-CsXYryWS.js +0 -1
  474. package/dist/gateway/static/root/assets/index-BZlryZm8.css +0 -1
  475. package/dist/gateway/static/root/assets/index-uAJlrGvo.js +0 -267
  476. package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-GYKLt0oF.js +0 -1
  477. package/dist/gateway/static/root/assets/languages-BFe8nIOO.js +0 -2
  478. package/dist/gateway/static/root/assets/local-app-workbench-page-Dw-i6VkX.js +0 -1
  479. package/dist/gateway/static/root/assets/local-apps-page-DslilwNE.js +0 -1
  480. package/dist/gateway/static/root/assets/locale-store-D_migb9R.js +0 -1
  481. package/dist/gateway/static/root/assets/logs-page-4N8bGPIE.js +0 -2
  482. package/dist/gateway/static/root/assets/management-settings-CPmxI1k0.js +0 -1
  483. package/dist/gateway/static/root/assets/markdown-editor-BhBJANcx.js +0 -1
  484. package/dist/gateway/static/root/assets/markdown-view-Ljt0bhfF.js +0 -324
  485. package/dist/gateway/static/root/assets/markdown-view-ixUWAmoy.css +0 -1
  486. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-Ba-WQCki.js +0 -1
  487. package/dist/gateway/static/root/assets/mermaid-render-604gISVe.js +0 -134
  488. package/dist/gateway/static/root/assets/messages-D__oW2yE.js +0 -3
  489. package/dist/gateway/static/root/assets/note-detail-panel-CjTm5gxS.js +0 -5
  490. package/dist/gateway/static/root/assets/note-image-lightbox-hbSbEEfN.js +0 -1
  491. package/dist/gateway/static/root/assets/notes-page-DkESStKc.js +0 -8
  492. package/dist/gateway/static/root/assets/page-context-capture-button-eyzTNrCe.js +0 -1
  493. package/dist/gateway/static/root/assets/personal-page-DZxbFQvF.js +0 -1
  494. package/dist/gateway/static/root/assets/personal-settings-panel-DzubCRqj.js +0 -1
  495. package/dist/gateway/static/root/assets/plugin-details-dialog-BjVLbxZM.js +0 -1
  496. package/dist/gateway/static/root/assets/plus-Q2yW6OE7.js +0 -1
  497. package/dist/gateway/static/root/assets/preview-open-alternatives-7pUtUL4O.js +0 -1
  498. package/dist/gateway/static/root/assets/product-delivery-DwmnNJvk.js +0 -1
  499. package/dist/gateway/static/root/assets/product-preview-content-COo4zwp9.js +0 -1
  500. package/dist/gateway/static/root/assets/project-detail-page-CrIH6nEy.js +0 -1
  501. package/dist/gateway/static/root/assets/projects-page-D4swvBmH.js +0 -1
  502. package/dist/gateway/static/root/assets/remote-access-hub-DltfIMtv.js +0 -1
  503. package/dist/gateway/static/root/assets/runtime-tools-api-CmEWVrOg.js +0 -5
  504. package/dist/gateway/static/root/assets/session-api-aQLptIs9.js +0 -1
  505. package/dist/gateway/static/root/assets/sessions-page-CfYU53aw.js +0 -1
  506. package/dist/gateway/static/root/assets/settings-advanced-gate-BJBoWYbO.js +0 -1
  507. package/dist/gateway/static/root/assets/setup-status-panel-DZgVMRXr.js +0 -1
  508. package/dist/gateway/static/root/assets/share-preview-page-C2LHd_Nl.js +0 -2
  509. package/dist/gateway/static/root/assets/shares-settings-C5MTc6t-.js +0 -1
  510. package/dist/gateway/static/root/assets/skill-reload-api-BcdA9ezU.js +0 -1
  511. package/dist/gateway/static/root/assets/skills-page-BMw8XbKL.js +0 -2
  512. package/dist/gateway/static/root/assets/source-workspace-editor-DunRD1gY.js +0 -1
  513. package/dist/gateway/static/root/assets/style-DR0-RKaL.js +0 -7
  514. package/dist/gateway/static/root/assets/system-settings-panel-2Kr9Y-FJ.js +0 -1
  515. package/dist/gateway/static/root/assets/tab-completion-input.utils-BP3NH_du.js +0 -1
  516. package/dist/gateway/static/root/assets/task-detail-page-7kPco8Ys.js +0 -2
  517. package/dist/gateway/static/root/assets/task-expandable-content-4s_FTl-9.js +0 -1
  518. package/dist/gateway/static/root/assets/tasks-B4bZpO6O.js +0 -1
  519. package/dist/gateway/static/root/assets/tracing-settings-page-D53wxq60.js +0 -1
  520. package/dist/gateway/static/root/assets/user-model-page-KRy50OBd.js +0 -2
  521. package/dist/gateway/static/root/assets/work-discovery-overlay-Bd9HLsds.js +0 -1
  522. package/dist/gateway/static/root/assets/workflow-run-setup-panel-C9mAiHBd.js +0 -3
  523. package/dist/gateway/static/root/assets/workflows-page-CGg4GWwt.js +0 -6
  524. package/dist/gateway/static/root/assets/x-B_N4OPjy.js +0 -1
  525. package/dist/gateway/static/root/assets/xml-_d7dTN2Q.js +0 -3
  526. package/dist/src/agent/embedded/session-manager-init.d.ts +0 -4
  527. package/dist/src/agent/embedded/session-manager-init.js +0 -48
  528. package/dist/src/agent/tools/workflow-manage-tool.d.ts +0 -2
  529. package/dist/src/agent/tools/workflow-manage-tool.js +0 -225
  530. package/dist/src/agent/tools/workflow-tool.d.ts +0 -20
  531. package/dist/src/agent/tools/workflow-tool.js +0 -155
  532. package/dist/src/agent/workflow/agent-progress.d.ts +0 -5
  533. package/dist/src/agent/workflow/agent-progress.js +0 -65
  534. package/dist/src/agent/workflow/builtins/index.d.ts +0 -2
  535. package/dist/src/agent/workflow/builtins/index.js +0 -374
  536. package/dist/src/agent/workflow/catalog.d.ts +0 -52
  537. package/dist/src/agent/workflow/catalog.js +0 -150
  538. package/dist/src/agent/workflow/channel-capability.d.ts +0 -76
  539. package/dist/src/agent/workflow/channel-capability.js +0 -1
  540. package/dist/src/agent/workflow/index.d.ts +0 -10
  541. package/dist/src/agent/workflow/index.js +0 -9
  542. package/dist/src/agent/workflow/progress-broker.d.ts +0 -80
  543. package/dist/src/agent/workflow/progress-broker.js +0 -261
  544. package/dist/src/agent/workflow/snapshot-empty.d.ts +0 -2
  545. package/dist/src/agent/workflow/snapshot-empty.js +0 -17
  546. package/dist/src/agent/workflow/snapshot.d.ts +0 -28
  547. package/dist/src/agent/workflow/snapshot.js +0 -267
  548. package/dist/src/agent/workflow/step-labels.d.ts +0 -8
  549. package/dist/src/agent/workflow/step-labels.js +0 -50
  550. package/dist/src/agent/workflow/structured-output-tool.d.ts +0 -33
  551. package/dist/src/agent/workflow/structured-output-tool.js +0 -56
  552. package/dist/src/agent/workflow/subagent-runner.d.ts +0 -46
  553. package/dist/src/agent/workflow/subagent-runner.js +0 -221
  554. package/dist/src/agent/workflow/types.d.ts +0 -252
  555. package/dist/src/agent/workflow/types.js +0 -1
  556. package/dist/src/agent/workflow/workflow-child-tools.d.ts +0 -4
  557. package/dist/src/agent/workflow/workflow-child-tools.js +0 -38
  558. package/dist/src/agent-catalog/migrations/identity-markdown-cutover.d.ts +0 -5
  559. package/dist/src/agent-catalog/migrations/identity-markdown-cutover.js +0 -94
  560. package/dist/src/agent-catalog/migrations/legacy-config-cutover.d.ts +0 -11
  561. package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +0 -194
  562. package/dist/src/chat-commands/builtins/workflow.d.ts +0 -18
  563. package/dist/src/chat-commands/builtins/workflow.js +0 -249
  564. package/dist/src/gateway/gateway-workflow-host.types.d.ts +0 -23
  565. package/dist/src/gateway/gateway-workflow-host.types.js +0 -1
  566. package/dist/src/gateway/hono/routes/workflows.d.ts +0 -3
  567. package/dist/src/gateway/hono/routes/workflows.js +0 -572
  568. package/dist/src/knowledge-memory/repair-evidence.d.ts +0 -2
  569. package/dist/src/knowledge-memory/repair-evidence.js +0 -57
  570. package/dist/src/migrations/cloud-public-models.d.ts +0 -7
  571. package/dist/src/migrations/cloud-public-models.js +0 -157
  572. package/dist/src/migrations/memory-config.d.ts +0 -2
  573. package/dist/src/migrations/memory-config.js +0 -76
  574. package/dist/src/migrations/retired-local-stt.d.ts +0 -2
  575. package/dist/src/migrations/retired-local-stt.js +0 -52
  576. package/dist/src/projects/workflow-bind.d.ts +0 -1
  577. package/dist/src/projects/workflow-bind.js +0 -15
  578. package/dist/src/storage/sqlite/migrations/218_core_relation_indexes.sql +0 -26
  579. package/dist/src/storage/sqlite/migrations/219_json_contracts.sql +0 -123
  580. package/dist/src/storage/sqlite/migrations/220_normalize_timestamps.sql +0 -339
  581. package/dist/src/storage/sqlite/migrations/221_ai_usage_retention_index.sql +0 -2
  582. package/dist/src/storage/sqlite/migrations/222_session_config_authority.sql +0 -13
  583. package/dist/src/storage/sqlite/migrations/223_session_creation_receipts.sql +0 -59
  584. package/dist/src/storage/sqlite/migrations/224_task_origin_links.sql +0 -8
  585. package/dist/src/storage/sqlite/migrations/225_task_collaboration.sql +0 -32
  586. package/dist/src/storage/sqlite/migrations/226_task_main_updates.sql +0 -9
  587. package/dist/src/storage/sqlite/migrations/227_task_main_update_decisions.sql +0 -8
  588. package/dist/src/storage/sqlite/migrations/228_task_main_agent_links.sql +0 -14
  589. package/dist/src/storage/sqlite/migrations/229_task_criterion_reviews.sql +0 -12
  590. package/dist/src/storage/sqlite/migrations/230_personal_agent_onboarding.sql +0 -8
  591. package/dist/src/storage/sqlite/migrations/231_task_result_deliveries.sql +0 -32
  592. package/dist/src/storage/sqlite/migrations/232_personal_requests.sql +0 -28
  593. package/dist/src/storage/sqlite/migrations/233_observability_usage_links.sql +0 -3
  594. package/dist/src/storage/sqlite/migrations/234_task_result_reply.sql +0 -14
  595. package/dist/src/storage/sqlite/migrations/235_personal_conversation_priority.sql +0 -3
  596. package/dist/src/storage/sqlite/migrations/236_personal_proactivity.sql +0 -53
  597. package/dist/src/storage/sqlite/migrations/237_personal_strategy_versions.sql +0 -18
  598. package/dist/src/storage/sqlite/migrations/238_browser_record_replay.sql +0 -45
  599. package/dist/src/storage/sqlite/migrations/239_clarification_notifications.sql +0 -26
  600. package/dist/src/storage/sqlite/migrations/240_device_settings.sql +0 -5
  601. package/dist/src/storage/sqlite/migrations/241_device_grant_audit.sql +0 -13
  602. package/dist/src/storage/sqlite/migrations/242_cloud_usage_receipts.sql +0 -5
  603. package/dist/src/storage/sqlite/migrations/243_voice_opening_greetings.sql +0 -12
  604. package/dist/src/storage/sqlite/migrations/244_device_request_proofs.sql +0 -8
  605. package/dist/src/storage/sqlite/migrations/245_memory_learning.sql +0 -125
  606. package/dist/src/storage/sqlite/migrations/246_personal_session_thinking.sql +0 -22
  607. package/dist/src/storage/sqlite/migrations/247_agent_selection_records.sql +0 -32
  608. package/dist/src/storage/sqlite/migrations/248_next_turn_suggestions.sql +0 -20
  609. package/dist/src/storage/sqlite/migrations/249_task_allocations.sql +0 -17
  610. package/dist/src/storage/sqlite/migrations/250_research_checkpoints.sql +0 -15
  611. package/dist/src/storage/sqlite/migrations/251_personal_result_reads.sql +0 -40
  612. package/dist/src/storage/sqlite/migrations/252_task_work_revisions.sql +0 -15
  613. package/dist/src/storage/sqlite/migrations/253_discussion_processing_recovery.sql +0 -20
  614. package/dist/src/storage/sqlite/migrations/254_discussion_annotations.sql +0 -17
  615. package/dist/src/storage/sqlite/migrations/255_discussion_chapter_progress.sql +0 -10
  616. package/dist/src/storage/sqlite/migrations/256_task_main_update_retries.sql +0 -21
  617. package/dist/src/storage/sqlite/migrations/257_session_composer_history.sql +0 -11
  618. package/dist/src/storage/sqlite/migrations/258_task_phase_changes.sql +0 -20
  619. package/dist/src/storage/sqlite/migrations/259_personal_default_style.sql +0 -10
  620. package/dist/src/storage/sqlite/migrations/discover.d.ts +0 -4
  621. package/dist/src/storage/sqlite/migrations/discover.js +0 -40
  622. package/dist/src/storage/sqlite/migrations/errors.js +0 -40
  623. package/dist/src/storage/sqlite/migrations/runner.d.ts +0 -22
  624. package/dist/src/storage/sqlite/migrations/runner.js +0 -112
  625. package/dist/src/storage/sqlite/migrations/types.d.ts +0 -12
  626. package/dist/src/storage/sqlite/migrations/types.js +0 -1
  627. package/dist/src/tasks/task-workflow-coordinator.d.ts +0 -5
  628. package/dist/src/tasks/task-workflow-coordinator.js +0 -55
  629. package/dist/src/tui/tui-workflow-slash.d.ts +0 -29
  630. package/dist/src/tui/tui-workflow-slash.js +0 -58
  631. package/dist/src/workflows/authoring/index.d.ts +0 -2
  632. package/dist/src/workflows/authoring/index.js +0 -3
  633. package/dist/src/workflows/authoring/workflow-draft-defaults.d.ts +0 -3
  634. package/dist/src/workflows/authoring/workflow-draft-defaults.js +0 -63
  635. package/dist/src/workflows/authoring/workflow-draft-store.d.ts +0 -29
  636. package/dist/src/workflows/authoring/workflow-draft-store.js +0 -52
  637. package/dist/src/workflows/context/workflow-context-snapshot-repository.d.ts +0 -21
  638. package/dist/src/workflows/context/workflow-context-snapshot-repository.js +0 -41
  639. package/dist/src/workflows/context/workflow-context.d.ts +0 -18
  640. package/dist/src/workflows/context/workflow-context.js +0 -164
  641. package/dist/src/workflows/domain/command.d.ts +0 -19
  642. package/dist/src/workflows/domain/command.js +0 -1
  643. package/dist/src/workflows/domain/definition-utils.d.ts +0 -18
  644. package/dist/src/workflows/domain/definition-utils.js +0 -90
  645. package/dist/src/workflows/domain/definition.d.ts +0 -164
  646. package/dist/src/workflows/domain/definition.js +0 -1
  647. package/dist/src/workflows/domain/event.d.ts +0 -88
  648. package/dist/src/workflows/domain/event.js +0 -1
  649. package/dist/src/workflows/domain/index.d.ts +0 -8
  650. package/dist/src/workflows/domain/index.js +0 -5
  651. package/dist/src/workflows/domain/result.d.ts +0 -68
  652. package/dist/src/workflows/domain/result.js +0 -1
  653. package/dist/src/workflows/domain/run.d.ts +0 -257
  654. package/dist/src/workflows/domain/run.js +0 -12
  655. package/dist/src/workflows/domain/schema-validation.d.ts +0 -8
  656. package/dist/src/workflows/domain/schema-validation.js +0 -26
  657. package/dist/src/workflows/domain/validation.d.ts +0 -22
  658. package/dist/src/workflows/domain/validation.js +0 -318
  659. package/dist/src/workflows/engine/index.d.ts +0 -2
  660. package/dist/src/workflows/engine/index.js +0 -3
  661. package/dist/src/workflows/engine/projector.d.ts +0 -3
  662. package/dist/src/workflows/engine/projector.js +0 -276
  663. package/dist/src/workflows/engine/workflow-engine.d.ts +0 -88
  664. package/dist/src/workflows/engine/workflow-engine.js +0 -719
  665. package/dist/src/workflows/index.d.ts +0 -11
  666. package/dist/src/workflows/index.js +0 -19
  667. package/dist/src/workflows/project-presets/project-workflow-preset-repository.d.ts +0 -20
  668. package/dist/src/workflows/project-presets/project-workflow-preset-repository.js +0 -39
  669. package/dist/src/workflows/registry/catalog-workflow-definition-registry.d.ts +0 -9
  670. package/dist/src/workflows/registry/catalog-workflow-definition-registry.js +0 -30
  671. package/dist/src/workflows/registry/index.d.ts +0 -2
  672. package/dist/src/workflows/registry/index.js +0 -2
  673. package/dist/src/workflows/registry/workflow-definition-registry.d.ts +0 -15
  674. package/dist/src/workflows/registry/workflow-definition-registry.js +0 -1
  675. package/dist/src/workflows/runtime/graph-workflow-runtime.d.ts +0 -10
  676. package/dist/src/workflows/runtime/graph-workflow-runtime.js +0 -289
  677. package/dist/src/workflows/runtime/index.d.ts +0 -2
  678. package/dist/src/workflows/runtime/index.js +0 -2
  679. package/dist/src/workflows/runtime/workflow-runtime-port.d.ts +0 -13
  680. package/dist/src/workflows/runtime/workflow-runtime-port.js +0 -1
  681. package/dist/src/workflows/service/run-view-to-snapshot.d.ts +0 -4
  682. package/dist/src/workflows/service/run-view-to-snapshot.js +0 -64
  683. package/dist/src/workflows/service/workflow-run-service.d.ts +0 -63
  684. package/dist/src/workflows/service/workflow-run-service.js +0 -892
  685. package/dist/src/workflows/service/workflow-run-service.types.d.ts +0 -62
  686. package/dist/src/workflows/service/workflow-run-service.types.js +0 -1
  687. package/dist/src/workflows/service/workflow-session-bridge.d.ts +0 -33
  688. package/dist/src/workflows/service/workflow-session-bridge.js +0 -244
  689. package/dist/src/workflows/service/workflow-session-key.d.ts +0 -3
  690. package/dist/src/workflows/service/workflow-session-key.js +0 -19
  691. package/dist/src/workflows/service/workflow-writeback-service.d.ts +0 -9
  692. package/dist/src/workflows/service/workflow-writeback-service.js +0 -107
  693. package/dist/src/workflows/store/event-store.d.ts +0 -16
  694. package/dist/src/workflows/store/event-store.js +0 -38
  695. package/dist/src/workflows/store/paths.d.ts +0 -5
  696. package/dist/src/workflows/store/paths.js +0 -18
  697. package/dist/src/workflows/store/run-index-store.d.ts +0 -9
  698. package/dist/src/workflows/store/run-index-store.js +0 -64
  699. package/dist/src/workflows/store/run-store.d.ts +0 -16
  700. package/dist/src/workflows/store/run-store.js +0 -40
  701. package/skills/engineering/workflow-authoring/SKILL.md +0 -32
  702. /package/dist/gateway/static/root/assets/{style-DLioOiRN.css → project-detail-page-DLioOiRN.css} +0 -0
  703. /package/dist/src/storage/sqlite/{migrations/conversation-windows-owners.d.ts → windows-database-owners.d.ts} +0 -0
@@ -1,4 +1,3 @@
1
- import { getSqliteDatabase } from "../../../storage/sqlite/transaction.js";
2
1
  import { ProductReadContracts, ProjectDeleteOutputSchema, ProjectMilestoneDeleteOutputSchema, ProjectMilestoneOutputSchema, ProjectMutationOutputSchema, ProjectResolveWorkspaceOutputSchema, ProjectUpdateOutputSchema } from "../../../../packages/gateway-contract/src/capabilities.js";
3
2
  import { init_src } from "../../../../packages/gateway-contract/src/index.js";
4
3
  import { TaskRepository } from "../../../tasks/task-repository.js";
@@ -102,19 +101,6 @@ function buildSessionSummaryKnowledgeContent(conversationId, explicitSummary) {
102
101
  }).filter(Boolean);
103
102
  return lines.length > 0 ? [`Session summary for ${conversationId}:`, ...lines].join("\n") : `Session summary for ${conversationId}: no transcript content available.`;
104
103
  }
105
- function listFailedProjectWorkflowRuns(projectId, limit = 5) {
106
- return getSqliteDatabase().prepare(`SELECT run_id, definition_id, status, created_at_ms, error_message
107
- FROM workflow_runs
108
- WHERE project_id = ? AND status IN ('failed', 'timeout', 'cancelled')
109
- ORDER BY created_at_ms DESC
110
- LIMIT ?`).all(projectId, Math.max(1, Math.min(20, Math.floor(limit)))).map((row) => ({
111
- runId: row.run_id,
112
- definitionId: row.definition_id,
113
- status: row.status,
114
- createdAt: row.created_at_ms,
115
- errorMessage: row.error_message ?? void 0
116
- }));
117
- }
118
104
  function buildProjectDigestKnowledgeContent(input) {
119
105
  const lines = [
120
106
  `Project digest: ${input.projectName}`,
@@ -286,8 +272,6 @@ function registerProjectsRoutes(authenticated, deps) {
286
272
  updatedAt: task.updatedAt
287
273
  };
288
274
  }),
289
- recentWorkflowRuns: project.recentWorkflowRuns,
290
- failedWorkflowRuns: listFailedProjectWorkflowRuns(project.id),
291
275
  knowledgeItems: listKnowledgeItems({
292
276
  statuses: ["active"],
293
277
  limit: 500
@@ -136,7 +136,7 @@ export declare function submitSessionInput(c: Context, deps: AuthenticatedRouteD
136
136
  channel: string;
137
137
  } | {
138
138
  type: "system";
139
- source: "automation" | "cli" | "workflow" | "heartbeat" | "internal" | "task_update";
139
+ source: "automation" | "cli" | "task" | "heartbeat" | "internal" | "task_update";
140
140
  };
141
141
  position: number;
142
142
  targetRunId?: string;
@@ -295,7 +295,7 @@ export declare function replaceLatestSessionTurn(c: Context, deps: Authenticated
295
295
  channel: string;
296
296
  } | {
297
297
  type: "system";
298
- source: "automation" | "cli" | "workflow" | "heartbeat" | "internal" | "task_update";
298
+ source: "automation" | "cli" | "task" | "heartbeat" | "internal" | "task_update";
299
299
  };
300
300
  position: number;
301
301
  targetRunId?: string;
@@ -23,8 +23,6 @@ init_sidebar_layout_repository();
23
23
  const log = createGatewayRouteLogger("Sessions");
24
24
  const SESSION_TYPES = new Set([
25
25
  "chat",
26
- "workflow-run",
27
- "workflow-subagent",
28
26
  "cron",
29
27
  "heartbeat"
30
28
  ]);
@@ -970,7 +968,6 @@ function registerSessionsRoutes(authenticated, deps) {
970
968
  });
971
969
  authenticated.get("/api/subagents/:key", async (c) => {
972
970
  const key = c.req.param("key");
973
- if ((await service.sessions.getSession(key))?.sessionType !== "workflow-subagent") return c.json({ error: "Not a subagent session" }, 400);
974
971
  const includeRaw = c.req.query("include") ?? "";
975
972
  const includeSet = new Set(includeRaw.split(",").map((s) => s.trim()).filter(Boolean));
976
973
  const session = await service.sessions.getSession(key, {
@@ -1,8 +1,8 @@
1
1
  import { listConnectorLearningJobs } from "../../../storage/sqlite/connector-learning-repository.js";
2
2
  import { getConnectorAccount } from "../../../storage/sqlite/connector-account-repository.js";
3
3
  import { init_sqlite } from "../../../storage/sqlite/index.js";
4
- import { getConnectorUnderstandingSourceRun } from "../../../user-context/sources/repository.js";
5
4
  import { getWorkDiscoveryRun } from "../../../work-discovery/repository.js";
5
+ import { getConnectorUnderstandingSourceRun } from "../../../user-context/sources/repository.js";
6
6
  import { isLocalUnderstandingSourceId } from "../../../user-context/sources/local-source-contract.js";
7
7
  import { normalizeUnderstandingSourceItems } from "../../../work-discovery/service.js";
8
8
  import { UnderstandingRefreshService } from "../../../user-context/sources/refresh-service.js";
@@ -1,7 +1,6 @@
1
1
  import { init_transaction, runSqliteWriteTransaction } from "../../../storage/sqlite/transaction.js";
2
2
  import { createCollaborationRule, getCollaborationRule, init_collaboration_rule_repository, listCollaborationRules, setCollaborationRuleStatus } from "../../../storage/sqlite/collaboration-rule-repository.js";
3
3
  import { getActiveUnderstandingConsent } from "../../../user-context/sources/consent-repository.js";
4
- import { listUnderstandingSourceGrants } from "../../../user-context/sources/repository.js";
5
4
  import { KnowledgeReviewConflictError, deleteKnowledgeItem, getKnowledgeItem, listKnowledgeItems, reviewKnowledgeItem, searchKnowledgeItems } from "../../../knowledge-memory/repository.js";
6
5
  import "../../../knowledge-memory/index.js";
7
6
  import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus, updatePriorityWindow, updateUserGoal } from "../../../user-model/goals.js";
@@ -15,6 +14,7 @@ import "../../../user-model/index.js";
15
14
  import { listMemoryMaintenanceRuns } from "../../../memory-maintenance/service.js";
16
15
  import "../../../memory-maintenance/index.js";
17
16
  import { getExecutionContextAudit, recordExecutionContextFeedback } from "../../../agent/context/audit.js";
17
+ import { listUnderstandingSourceGrants } from "../../../user-context/sources/repository.js";
18
18
  import { registerMemoryLearningRoutes } from "./memory-learning.js";
19
19
  import { userInfo } from "node:os";
20
20
  //#region src/gateway/hono/routes/user-model.ts
@@ -3,7 +3,6 @@ import { buildDefaultCorsOrigins, init_host, isAllInterfacesHost, isLoopbackHost
3
3
  import { isGatewayStrictSecurityEnabled } from "./rate-limit/env-flags.js";
4
4
  import { init_rate_limit } from "./rate-limit/index.js";
5
5
  import { defaultGatewayBindMode, isContainerEnvironment, resolveGatewayBindHost, resolveGatewayBindHostSync, resolveGatewayBindMode, resolveGatewayEffectiveHost } from "../config/gateway-bind.js";
6
- import { GatewayLockError, acquireGatewayLock } from "./lock.js";
7
6
  import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
8
7
  import { resolveGatewayListenHost, resolveGatewayListenPlan } from "./listen.js";
9
8
  import { assertGatewayRuntimeConfig } from "./runtime-config.js";
@@ -11,6 +10,7 @@ import { restartGatewayProcessWithFreshPid } from "./respawn.js";
11
10
  import { GatewayService } from "./service.js";
12
11
  import { createHonoApp } from "./hono/app.js";
13
12
  import { GatewayServer } from "./server.js";
13
+ import { GatewayLockError, acquireGatewayLock } from "./lock.js";
14
14
  import { runGatewayLoop } from "./run-loop.js";
15
15
  import { checkPortAvailable, forceFreePortAndWait, listPortListeners, parseLsofOutput } from "./ports.js";
16
16
  import { apiError, apiOk } from "./protocol.js";
@@ -1,9 +1,9 @@
1
- import { acquireGatewayLock } from "./lock.js";
2
1
  import { loadConfig } from "../config/loader.js";
3
- import { runBootstrapMigrationsSync } from "../migrations/runner.js";
4
2
  import "../config/index.js";
5
3
  import { isRestartEnabled } from "../config/commands.flags.js";
6
4
  import { restartGatewayProcessWithFreshPid } from "./respawn.js";
5
+ import { acquireGatewayLock } from "./lock.js";
6
+ import { runBootstrapMigrationsSync } from "../migrations/runner.js";
7
7
  import { consumeGatewayRestartIntentSync, consumeGatewaySigusr1RestartAuthorization, isGatewaySigusr1RestartExternallyAllowed, resetGatewayRestartStateForInProcessRestart, scheduleGatewaySigusr1Restart, setGatewaySigusr1RestartPolicy } from "../infra/restart.js";
8
8
  //#region src/gateway/run-loop.ts
9
9
  /**
@@ -105,7 +105,7 @@ function verifyDeviceConnectionProof(principalId, ticket, path, header) {
105
105
  }
106
106
  if (!device) return !header;
107
107
  if (device.revokedAt !== void 0) return false;
108
- if (!device.requestProofVersion && !header) return true;
108
+ if (device.requestProofVersion !== 1) return false;
109
109
  const proof = parseRequestProof(header);
110
110
  if (!proof || Math.abs(Date.now() - proof.timestamp) > 12e4 || proof.digest !== proofDigest("")) return false;
111
111
  const message = requestProofMessage({
@@ -36,7 +36,6 @@ function requiredGatewayScope(method, path) {
36
36
  if (method === "POST" && path === "/api/automations/simulate") return "automations.read";
37
37
  if (method === "POST" && /^\/api\/notes\/[^/]+\/ai\/edit$/.test(path)) return "workspace.read";
38
38
  if (path.startsWith("/api/automations") || path.startsWith("/api/automation-runs")) return methodScope(method, "automations.read", "automations.write");
39
- if (path.startsWith("/api/workflows")) return methodScope(method, "automations.read", "automations.write");
40
39
  if (path === "/api/voice/selection" || path === "/api/voice/catalog/refresh") return "voice.configure";
41
40
  if (path.startsWith("/api/voice") || path.startsWith("/api/media") || path.startsWith("/api/clarifications")) return "sessions.write";
42
41
  if (path.startsWith("/api/commands") || path.startsWith("/api/skills")) return methodScope(method, "agents.read", "gateway.admin");
@@ -1,5 +1,5 @@
1
1
  import type { TurnOrigin } from '@xopcai/endpoint-tools-protocol';
2
- export type ActiveExecutionKind = 'chat' | 'side-chat' | 'task' | 'workflow' | 'automation';
2
+ export type ActiveExecutionKind = 'chat' | 'side-chat' | 'task' | 'automation';
3
3
  export type ActiveExecutionInitiator = 'user' | 'background';
4
4
  export type ActiveExecution = {
5
5
  conversationId: string;
@@ -2,7 +2,7 @@
2
2
  function describeActiveExecution(input) {
3
3
  const { origin } = input;
4
4
  const background = origin.type === "system" && (origin.source === "automation" || origin.source === "heartbeat" || origin.source === "internal" || origin.source === "task_update");
5
- const kind = input.kind ?? (origin.type === "system" && origin.source === "automation" ? "automation" : origin.type === "system" && origin.source === "workflow" ? "workflow" : input.taskRunId ? "task" : "chat");
5
+ const kind = input.kind ?? (origin.type === "system" && origin.source === "automation" ? "automation" : origin.type === "system" && origin.source === "task" ? "task" : input.taskRunId ? "task" : "chat");
6
6
  return {
7
7
  conversationId: input.conversationId,
8
8
  runId: input.runId,
@@ -345,7 +345,7 @@ var GatewayAgentRunner = class {
345
345
  attachments: userTurn.attachments,
346
346
  origin: {
347
347
  type: "system",
348
- source: "workflow"
348
+ source: "task"
349
349
  }
350
350
  });
351
351
  if (accepted.ok === false) throw new Error(`Scheduled session input was rejected: ${accepted.code}`);
@@ -78,7 +78,7 @@ export declare class SessionInputCoordinator {
78
78
  channel: string;
79
79
  } | {
80
80
  type: "system";
81
- source: "automation" | "cli" | "workflow" | "heartbeat" | "internal" | "task_update";
81
+ source: "automation" | "cli" | "task" | "heartbeat" | "internal" | "task_update";
82
82
  };
83
83
  }>;
84
84
  dispatchAcceptedInput(conversationId: string, inputId: string): Promise<void>;
@@ -23,7 +23,7 @@ export declare class GatewaySessionsApi {
23
23
  private readonly opts;
24
24
  constructor(opts: GatewaySessionsApiOptions);
25
25
  listSessions(query?: SessionListQuery): Promise<import("../../session/types.js").PaginatedResult<import("../../session/types.js").SessionMetadata>>;
26
- /** List conversations whose stored type is workflow-subagent. */
26
+ /** List active executions. */
27
27
  listSubagents(query?: SessionListQuery): Promise<import("../../session/types.js").PaginatedResult<import("../../session/types.js").SessionMetadata>>;
28
28
  getSession(key: string, options?: {
29
29
  includeTranscriptSummary?: boolean;
@@ -104,7 +104,6 @@ export declare class GatewaySessionsApi {
104
104
  configVersion?: number;
105
105
  model?: string | null;
106
106
  activityDetailLevel?: string | null;
107
- reasoningLevel?: string | null;
108
107
  verboseLevel?: string;
109
108
  workingDirectory?: string;
110
109
  responseLanguage?: string | null;
@@ -35,7 +35,7 @@ var GatewaySessionsApi = class {
35
35
  listSessions(query) {
36
36
  return this.opts.sessionIndex.listSessions(query);
37
37
  }
38
- /** List conversations whose stored type is workflow-subagent. */
38
+ /** List active executions. */
39
39
  listSubagents(query) {
40
40
  return this.opts.sessionIndex.listSubagents(query);
41
41
  }
@@ -38,10 +38,6 @@ export declare class TaskConversationQueryService {
38
38
  sessionType: import("../../session/types.js").SessionType;
39
39
  hiddenFromSessionList?: boolean;
40
40
  parentConversationId?: string;
41
- workflowRunId?: string;
42
- workflowDefinitionId?: string;
43
- workflowAgentId?: string;
44
- workflowAgentLabel?: string;
45
41
  transcriptId?: string;
46
42
  cwd?: string;
47
43
  sessionStartedAt?: string;
@@ -25,6 +25,8 @@ export interface GatewayChannelStartupPhase2Metrics {
25
25
  onHttpListeningTotalMs: number;
26
26
  }
27
27
  export interface GatewayServiceConfig {
28
+ /** Embed a foreground-only Gateway without starting durable task dispatch. */
29
+ taskDispatchEnabled?: boolean;
28
30
  configPath?: string;
29
31
  /** CLI `--bind` override for startup security guards. */
30
32
  listenBind?: GatewayBindMode;
@@ -6,7 +6,6 @@ import { MessageBus } from '../infra/bus/index.js';
6
6
  import { AutomationService, type AutomationEvent } from '../automations/index.js';
7
7
  import { DiscussionLiveWorker, DiscussionOrganizerWorker, DiscussionSealer, DiscussionService } from '../discussions/index.js';
8
8
  import { NotesService } from '../notes/index.js';
9
- import { WorkflowRunService } from '../workflows/service/workflow-run-service.js';
10
9
  import { ExtensionLoader } from '../extensions/index.js';
11
10
  import { SessionIndex } from '../session/index.js';
12
11
  import { EphemeralSideChatManager, SideChatPromotionService, SideChatRunService } from './side-chat/index.js';
@@ -69,8 +68,6 @@ export declare class GatewayService {
69
68
  private lastChannelConnectDeferSource;
70
69
  private readonly readiness;
71
70
  private startupTrace;
72
- private workflowSessionBridge;
73
- private workflowRunServiceInstance;
74
71
  private taskAllocationDispatcher;
75
72
  private taskRunDispatcher;
76
73
  private taskRunDispatchTimer;
@@ -171,7 +168,7 @@ export declare class GatewayService {
171
168
  channel: string;
172
169
  } | {
173
170
  type: "system";
174
- source: "automation" | "cli" | "workflow" | "heartbeat" | "internal" | "task_update";
171
+ source: "automation" | "cli" | "task" | "heartbeat" | "internal" | "task_update";
175
172
  };
176
173
  }>;
177
174
  drainSessionInputs(conversationId: string): Promise<void>;
@@ -353,10 +350,6 @@ export declare class GatewayService {
353
350
  private executeSystemAutomationAction;
354
351
  get notesServiceInstance(): NotesService;
355
352
  get sessionIndexInstance(): SessionIndex;
356
- /** Shared workflow run orchestrator + session bridge (one instance per gateway). */
357
- createWorkflowRunService(): WorkflowRunService;
358
- private reconcileInterruptedWorkflowRuns;
359
- private collectWorkflowAgentIds;
360
353
  /** Process a message directly through the agent (for CLI mode). */
361
354
  processDirect(content: string, conversationId?: string): Promise<string>;
362
355
  emit(type: string, payload: unknown): void;
@@ -20,14 +20,13 @@ import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js
20
20
  import { init_session_repository, listSessionMetadata, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
21
21
  import { getSessionConfig, init_config_repository } from "../storage/sqlite/config-repository.js";
22
22
  import { init_sqlite } from "../storage/sqlite/index.js";
23
- import { normalizeAgentId } from "../agent-catalog/id.js";
24
23
  import { init_agent_scope, listAgentEntries, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
25
24
  import { init_paths, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
26
25
  import { init_config, resolveKnowledgeReadPolicy } from "../user-context/config.js";
27
26
  import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
28
- import { listKnowledgeItems } from "../knowledge-memory/repository.js";
29
27
  import { init_agent_session_key, resolveAgentMainConversationId } from "../routing/agent-session-key.js";
30
28
  import { init_session_key, resolveConversationId, sanitizeSegment } from "../routing/session-key.js";
29
+ import { listKnowledgeItems } from "../knowledge-memory/repository.js";
31
30
  import "../knowledge-memory/index.js";
32
31
  import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
33
32
  import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
@@ -88,6 +87,13 @@ import { ChatPreviewService } from "../chat-previews/service.js";
88
87
  import "../chat-previews/index.js";
89
88
  import { configureGatewayHttpProxy } from "../infra/http-proxy-env.js";
90
89
  import "../config/index.js";
90
+ import { ManagedComposioEventPoller } from "../connectors/composio-managed-events.js";
91
+ import { startConnectedKnowledgeCoordinator } from "../knowledge/coordinator.js";
92
+ import "../knowledge/index.js";
93
+ import { PersonalReplyComposer } from "../personal-agent/reply-composer.js";
94
+ import { ConnectionRecoveryService } from "../connectors/connection-recovery-service.js";
95
+ import { startConnectorLearningCoordinator } from "../connectors/learning-coordinator.js";
96
+ import { startConnectorSupervisor } from "../connectors/supervisor.js";
91
97
  import { DiscussionService } from "../discussions/service.js";
92
98
  import { DiscussionOrganizer } from "../discussions/organizer.js";
93
99
  import { DiscussionLiveWorker } from "../discussions/live-worker.js";
@@ -96,13 +102,6 @@ import { DiscussionSealer } from "../discussions/sealer.js";
96
102
  import "../discussions/index.js";
97
103
  import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
98
104
  import "../endpoint-tools/index.js";
99
- import { ManagedComposioEventPoller } from "../connectors/composio-managed-events.js";
100
- import { startConnectedKnowledgeCoordinator } from "../knowledge/coordinator.js";
101
- import "../knowledge/index.js";
102
- import { PersonalReplyComposer } from "../personal-agent/reply-composer.js";
103
- import { ConnectionRecoveryService } from "../connectors/connection-recovery-service.js";
104
- import { startConnectorLearningCoordinator } from "../connectors/learning-coordinator.js";
105
- import { startConnectorSupervisor } from "../connectors/supervisor.js";
106
105
  import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
107
106
  import { prepareAutomationAgentSession } from "./automation-agent-session.js";
108
107
  import { stopTailscaleExposure } from "./tailscale-lifecycle.js";
@@ -119,9 +118,6 @@ import { buildVoiceMemoryContext } from "../voice/realtime/memory-context.js";
119
118
  import { buildVoicePersonaContext } from "../voice/realtime/persona-context.js";
120
119
  import { voiceMemoryBudget, voicePersonaBudget } from "../voice/realtime/conversation-context.js";
121
120
  import "../notes/index.js";
122
- import { buildWorkflowChildTools } from "../agent/workflow/workflow-child-tools.js";
123
- import { WorkflowRunService } from "../workflows/service/workflow-run-service.js";
124
- import { WorkflowSessionBridge } from "../workflows/service/workflow-session-bridge.js";
125
121
  import { EphemeralSideChatManager } from "./side-chat/manager.js";
126
122
  import { SideChatRunService } from "./side-chat/run-service.js";
127
123
  import { SideChatPromotionService } from "./side-chat/promotion-service.js";
@@ -322,8 +318,6 @@ var GatewayService = class {
322
318
  lastChannelConnectDeferSource = "off";
323
319
  readiness = new GatewayReadiness();
324
320
  startupTrace = null;
325
- workflowSessionBridge = null;
326
- workflowRunServiceInstance = null;
327
321
  taskAllocationDispatcher = null;
328
322
  taskRunDispatcher = null;
329
323
  taskRunDispatchTimer = null;
@@ -380,7 +374,7 @@ var GatewayService = class {
380
374
  this.serviceConfig = serviceConfig;
381
375
  this.bus = new MessageBus();
382
376
  this.configPath = serviceConfig.configPath || resolveConfigPath();
383
- bootstrapApplicationStateSync(this.configPath);
377
+ bootstrapApplicationStateSync();
384
378
  const now = Date.now();
385
379
  markStaleAiUsageEventsUnknown(now - 360 * 60 * 1e3, now);
386
380
  pruneAiUsageEvents(now - AI_USAGE_RETENTION_MS);
@@ -695,7 +689,6 @@ var GatewayService = class {
695
689
  dispatchTaskEvents: () => this.dispatchTaskEvents(),
696
690
  dispatchTaskRuns: () => this.dispatchTaskRuns(),
697
691
  onAgentCatalogMutate: () => this.refreshAgentCatalog(),
698
- getWorkflowRunService: () => this.createWorkflowRunService(),
699
692
  sourceContextResolver: async (binding) => {
700
693
  if (binding.kind === "note") {
701
694
  const note = await this.notesService.getNote(binding.sourceId);
@@ -730,7 +723,6 @@ var GatewayService = class {
730
723
  agentService: this._agentService,
731
724
  getDefaultAgentId: () => getDefaultAgentId(),
732
725
  prepareAgentSession: (input) => prepareAutomationAgentSession(this.sessionIndex.getStore(), this.projects, input),
733
- workflowRunService: this.createWorkflowRunService(),
734
726
  browserAutomationService: this.browserAutomations,
735
727
  executeTaskCommand: ({ taskId, idempotencyKey, command, triggerEvent }) => {
736
728
  const task = new TaskRepository().get(taskId);
@@ -800,7 +792,7 @@ var GatewayService = class {
800
792
  content: message,
801
793
  origin: {
802
794
  type: "system",
803
- source: "workflow"
795
+ source: "task"
804
796
  },
805
797
  taskRunId: runId
806
798
  });
@@ -832,13 +824,12 @@ var GatewayService = class {
832
824
  content: input.content,
833
825
  origin: {
834
826
  type: "system",
835
- source: "workflow"
827
+ source: "task"
836
828
  }
837
829
  })).ok;
838
830
  });
839
831
  if (this.stopping) return;
840
832
  this.createTaskRunDispatcher().dispatch();
841
- await this.createWorkflowRunService().dispatchTaskRuns();
842
833
  }, (err) => {
843
834
  const errorMessage = err instanceof Error ? err.message : String(err);
844
835
  log.error({
@@ -950,7 +941,7 @@ var GatewayService = class {
950
941
  }, "Task result dispatch failed");
951
942
  });
952
943
  dispatchTaskRuns() {
953
- if (this.stopping) return;
944
+ if (this.stopping || this.serviceConfig.taskDispatchEnabled === false) return;
954
945
  this.taskAllocationDispatcher ??= new TaskAllocationDispatcher({
955
946
  context: (conversationId) => ({
956
947
  ownAgentId: getSessionMetadata(conversationId)?.agentId ?? "",
@@ -1286,9 +1277,13 @@ var GatewayService = class {
1286
1277
  this.createNotificationService().start();
1287
1278
  this.startTime = Date.now();
1288
1279
  this.running = true;
1289
- this.stopTaskResultQueued = onTaskResultQueued(() => this.taskResultDispatch());
1290
- this.taskRunDispatchTimer = setInterval(() => this.dispatchTaskRuns(), 1e3);
1291
- this.taskRunDispatchTimer.unref?.();
1280
+ this.stopTaskResultQueued = onTaskResultQueued(() => {
1281
+ if (this.serviceConfig.taskDispatchEnabled !== false) this.taskResultDispatch();
1282
+ });
1283
+ if (this.serviceConfig.taskDispatchEnabled !== false) {
1284
+ this.taskRunDispatchTimer = setInterval(() => this.dispatchTaskRuns(), 1e3);
1285
+ this.taskRunDispatchTimer.unref?.();
1286
+ }
1292
1287
  this.startupTrace = createGatewayStartupTrace();
1293
1288
  this.readiness.markStarting(this.startTime);
1294
1289
  const trace = this.startupTrace;
@@ -1388,7 +1383,6 @@ var GatewayService = class {
1388
1383
  agentService: this.agentService,
1389
1384
  getDefaultAgentId: () => getDefaultAgentId(),
1390
1385
  prepareAgentSession: (input) => prepareAutomationAgentSession(this.sessionIndex.getStore(), this.projects, input),
1391
- workflowRunService: this.createWorkflowRunService(),
1392
1386
  browserAutomationService: this.browserAutomations,
1393
1387
  executeTaskCommand: ({ taskId, idempotencyKey, command, triggerEvent }) => {
1394
1388
  const task = new TaskRepository().get(taskId);
@@ -1423,7 +1417,6 @@ var GatewayService = class {
1423
1417
  onReliabilityAttention: (input) => this.emit("automation.attention.required", input)
1424
1418
  });
1425
1419
  this.startSessionTranscriptEventIngestion();
1426
- await trace.measure("workflows.reconcile", () => this.reconcileInterruptedWorkflowRuns());
1427
1420
  this.sessionIndex.on("sessionUpdated", (data) => {
1428
1421
  this.emit("session.updated", {
1429
1422
  key: data.key,
@@ -1816,7 +1809,7 @@ var GatewayService = class {
1816
1809
  */
1817
1810
  getHealth() {
1818
1811
  const runningChannels = this.channelManager.getRunningChannels();
1819
- const allChannels = this.channelManager.getAllChannels();
1812
+ const allChannels = this.channelManager.getAllPlugins();
1820
1813
  const logStats = getRuntimeLogStats();
1821
1814
  const readiness = this.readiness.getSnapshot();
1822
1815
  return {
@@ -1920,46 +1913,6 @@ var GatewayService = class {
1920
1913
  get sessionIndexInstance() {
1921
1914
  return this.sessionIndex;
1922
1915
  }
1923
- /** Shared workflow run orchestrator + session bridge (one instance per gateway). */
1924
- createWorkflowRunService() {
1925
- if (!this.workflowRunServiceInstance) {
1926
- this.workflowSessionBridge = new WorkflowSessionBridge(this);
1927
- this.workflowRunServiceInstance = new WorkflowRunService({
1928
- service: this,
1929
- sessionBridge: this.workflowSessionBridge,
1930
- buildChildTools: buildWorkflowChildTools
1931
- });
1932
- }
1933
- return this.workflowRunServiceInstance;
1934
- }
1935
- async reconcileInterruptedWorkflowRuns() {
1936
- const workflowService = this.createWorkflowRunService();
1937
- const agentIds = this.collectWorkflowAgentIds();
1938
- let total = 0;
1939
- for (const agentId of agentIds) try {
1940
- total += await workflowService.reconcileInterruptedRuns(agentId);
1941
- } catch (err) {
1942
- const msg = err instanceof Error ? err.message : String(err);
1943
- log.warn({
1944
- err,
1945
- agentId,
1946
- errorMessage: msg
1947
- }, `Workflow run reconcile failed for agent ${agentId}: ${msg}`);
1948
- }
1949
- if (total > 0) log.info({
1950
- count: total,
1951
- agentIds
1952
- }, "Reconciled interrupted workflow runs");
1953
- }
1954
- collectWorkflowAgentIds() {
1955
- const ids = /* @__PURE__ */ new Set();
1956
- ids.add(resolveDefaultAgentId());
1957
- for (const entry of listAgentEntries()) {
1958
- if (entry.enabled === false) continue;
1959
- ids.add(normalizeAgentId(entry.id));
1960
- }
1961
- return [...ids];
1962
- }
1963
1916
  /** Process a message directly through the agent (for CLI mode). */
1964
1917
  async processDirect(content, conversationId = resolveAgentMainConversationId({ agentId: getDefaultAgentId() })) {
1965
1918
  return this.agentService.turnDispatcher.processDirect(content, conversationId, {
@@ -191,7 +191,7 @@ function sessionRecord(session) {
191
191
  cwd: session.cwd,
192
192
  ...session.archivedAt === null ? {} : { ended_at: timestamp(session.archivedAt, `session end timestamp for ${session.transcriptId}`) },
193
193
  status: active ? "active" : "completed",
194
- agent_scope: session.sessionType === "workflow-subagent" ? "subagent" : "primary"
194
+ agent_scope: session.sessionType === "subagent" ? "subagent" : "primary"
195
195
  };
196
196
  }
197
197
  function entryRecords(session, entry) {
@@ -1,5 +1,5 @@
1
1
  import { listConnectorInstances } from "../connectors/instances.js";
2
- import { preflightConnectorRequirements } from "../connectors/workflow-preflight.js";
2
+ import { preflightConnectorRequirements } from "../connectors/requirements-preflight.js";
3
3
  //#region src/home-intelligence/capability-preflight.ts
4
4
  const SKILL_CODE = {
5
5
  "agent-denied": "agent_not_allowed",
@@ -1,8 +1,8 @@
1
1
  import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
2
- import { createLogger } from "../utils/logger/index.js";
3
- import { init_logger } from "../utils/logger.js";
4
2
  import { init_global_singleton, resolveGlobalSingleton } from "../utils/global-singleton.js";
5
3
  import { init_process_diagnostics, recordProcessDiagnostic } from "./process-diagnostics.js";
4
+ import { createLogger } from "../utils/logger/index.js";
5
+ import { init_logger } from "../utils/logger.js";
6
6
  import { init_sqlite_errors, isTransientSqliteError } from "./sqlite-errors.js";
7
7
  //#region src/infra/unhandled-rejections.ts
8
8
  function installSqliteTransientRejectionHandler() {
@@ -1,4 +1,3 @@
1
- import { createDefaultCommandRunner } from './run-command.js';
2
1
  import { type UpdateChannel } from './update-channels.js';
3
2
  import { type ExtensionPostUpdateResult } from '../extensions/update.js';
4
3
  import { type GlobalInstallManager } from './update-global.js';
@@ -105,4 +104,4 @@ export declare function runAutoUpdateCommandWithProgress(params: {
105
104
  triggerInProcessRestart?: InProcessRestartTrigger;
106
105
  onProgress?: (line: string, source: 'stdout' | 'stderr') => void | Promise<void>;
107
106
  }): Promise<AutoUpdateResult>;
108
- export { createDefaultCommandRunner };
107
+ export {};
@@ -3,7 +3,7 @@ import { runPostUpdateExtensionSync } from "../extensions/update.js";
3
3
  import "./update-channels.js";
4
4
  import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
5
5
  import { readPackageName, readPackageVersion } from "./package-json.js";
6
- import { createDefaultCommandRunner, runCommandWithTimeout } from "./run-command.js";
6
+ import { runCommandWithTimeout } from "./run-command.js";
7
7
  import { XOPC_PACKAGE_NAME, cleanupGlobalRenameDirs, createGlobalInstallEnv, detectGlobalInstallManagerForRoot, resolveGlobalInstallSpec, resolveGlobalInstallTarget } from "./update-global.js";
8
8
  import { runGlobalPackageUpdateSteps } from "./package-update-steps.js";
9
9
  import { resolveStableNodePath } from "./stable-node-path.js";
@@ -648,4 +648,4 @@ async function runAutoUpdateCommandWithProgress(params) {
648
648
  };
649
649
  }
650
650
  //#endregion
651
- export { createDefaultCommandRunner, formatUpdateApiResult, resolveUpdateInstallSurface, runAutoUpdateCommand, runAutoUpdateCommandWithProgress, runGatewayUpdate, runGatewayUpdateWithPostSteps };
651
+ export { formatUpdateApiResult, resolveUpdateInstallSurface, runAutoUpdateCommand, runAutoUpdateCommandWithProgress, runGatewayUpdate, runGatewayUpdateWithPostSteps };
@@ -5,8 +5,8 @@ import { createContextEvidence, init_context_evidence_repository } from "../stor
5
5
  import { init_chunks, replaceKnowledgeChunks } from "./chunks.js";
6
6
  import { claimKnowledgeSourceItems, completeKnowledgeSourceItemSynthesis, pruneBoundedKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository.js";
7
7
  import { init_sqlite } from "../storage/sqlite/index.js";
8
- import { getActiveUnderstandingConsent } from "../user-context/sources/consent-repository.js";
9
8
  import { clearMemoryAudit } from "../user-context/memory-suppression.js";
9
+ import { getActiveUnderstandingConsent } from "../user-context/sources/consent-repository.js";
10
10
  import { listKnowledgeItems, transitionKnowledgeStatus, writeKnowledgeItem } from "../knowledge-memory/repository.js";
11
11
  import "../knowledge-memory/index.js";
12
12
  import { consentFilteredText } from "../user-context/sources/consent-fields.js";
@@ -46,10 +46,7 @@ var LocalFolderKnowledgeSourceAdapter = class {
46
46
  };
47
47
  await walk(root);
48
48
  paths.sort((left, right) => left.localeCompare(right));
49
- let after;
50
- try {
51
- after = JSON.parse(input.cursor ?? "{}").after;
52
- } catch {}
49
+ const after = JSON.parse(input.cursor ?? "{}").after;
53
50
  const remaining = after ? paths.filter((path) => relative(root, path).localeCompare(after) > 0) : paths;
54
51
  const page = remaining.slice(0, this.pageSize);
55
52
  const hasMore = remaining.length > page.length;
@@ -85,7 +82,7 @@ var LocalFolderKnowledgeSourceAdapter = class {
85
82
  }
86
83
  return {
87
84
  items,
88
- nextCursor: hasMore ? JSON.stringify({ after: relative(root, page.at(-1)).split(sep).join("/") }) : scanStartedAt,
85
+ nextCursor: hasMore ? JSON.stringify({ after: relative(root, page.at(-1)).split(sep).join("/") }) : JSON.stringify({ capturedAt: scanStartedAt }),
89
86
  hasMore,
90
87
  warnings,
91
88
  snapshotExternalIds: warnings.length ? void 0 : paths.map((path) => relative(root, path).split(sep).join("/"))
@@ -83,5 +83,7 @@ export declare function searchKnowledgeItems(input: {
83
83
  }): KnowledgeItem[];
84
84
  export declare function classifyKnowledgeContentSource(item: KnowledgeItem): KnowledgeContentSource;
85
85
  export declare function knowledgeItemAllowed(item: KnowledgeItem, policy: KnowledgeReadPolicy): boolean;
86
- export declare function deleteKnowledgeItem(id: string, now?: number): boolean;
86
+ export declare function deleteKnowledgeItem(id: string, now?: number, options?: {
87
+ includeRelated?: boolean;
88
+ }): boolean;
87
89
  export declare function isKnowledgeCurrent(item: KnowledgeItem, asOf?: number): boolean;
@@ -350,7 +350,7 @@ function knowledgeFingerprints(input) {
350
350
  input.content
351
351
  ])];
352
352
  }
353
- function deleteKnowledgeItem(id, now = Date.now()) {
353
+ function deleteKnowledgeItem(id, now = Date.now(), options = {}) {
354
354
  return runSqliteWriteTransaction((db) => {
355
355
  const rows = db.prepare(`WITH RECURSIVE deleted(id) AS (
356
356
  SELECT knowledge_id FROM knowledge_items WHERE knowledge_id = ?
@@ -358,7 +358,8 @@ function deleteKnowledgeItem(id, now = Date.now()) {
358
358
  ON json_extract(k.source_json, '$.episodeKnowledgeId') = d.id
359
359
  OR k.knowledge_id = (SELECT json_extract(source_json, '$.episodeKnowledgeId')
360
360
  FROM knowledge_items WHERE knowledge_id = d.id)
361
- ) SELECT * FROM knowledge_items WHERE knowledge_id IN (SELECT id FROM deleted)`).all(id);
361
+ WHERE ?
362
+ ) SELECT * FROM knowledge_items WHERE knowledge_id IN (SELECT id FROM deleted)`).all(id, options.includeRelated === false ? 0 : 1);
362
363
  for (const row of rows) {
363
364
  const item = fromRow(row);
364
365
  suppressMemory(db, knowledgeFingerprints(item), now);
@@ -375,7 +376,13 @@ function isKnowledgeCurrent(item, asOf = Date.now()) {
375
376
  function writeEvidence(db, id, input) {
376
377
  db.prepare("UPDATE knowledge_items SET claim_mode = ?, verification = ?, sensitivity = ? WHERE knowledge_id = ?").run(input.claimMode ?? (input.originClass === "owner" ? "explicit" : input.originClass === "untrusted" ? "reported" : "observed"), input.verification ?? (input.originClass === "untrusted" && (input.recordClass ?? "memory") === "memory" ? "tentative" : "supported"), input.sensitivity ?? inferMemorySensitivity(input.content), id);
377
378
  db.prepare("DELETE FROM knowledge_evidence_links WHERE knowledge_id = ?").run(id);
378
- for (const evidence of input.evidence ?? []) db.prepare("INSERT INTO knowledge_evidence_links(knowledge_id, evidence_id, content_hash, consent_receipt_id) VALUES (?, ?, ?, ?)").run(id, evidence.id, evidence.contentHash ?? null, evidence.consentReceiptId ?? null);
379
+ const links = /* @__PURE__ */ new Map();
380
+ for (const evidence of input.evidence ?? []) {
381
+ const existing = links.get(evidence.id);
382
+ if (existing && (existing.contentHash !== evidence.contentHash || existing.consentReceiptId !== evidence.consentReceiptId)) throw new Error("Conflicting provenance for the same knowledge evidence.");
383
+ links.set(evidence.id, evidence);
384
+ }
385
+ for (const evidence of links.values()) db.prepare("INSERT INTO knowledge_evidence_links(knowledge_id, evidence_id, content_hash, consent_receipt_id) VALUES (?, ?, ?, ?)").run(id, evidence.id, evidence.contentHash ?? null, evidence.consentReceiptId ?? null);
379
386
  }
380
387
  //#endregion
381
388
  export { KnowledgeReviewConflictError, classifyKnowledgeContentSource, deleteKnowledgeItem, getKnowledgeItem, isKnowledgeCurrent, knowledgeItemAllowed, listKnowledgeItems, listKnowledgeStatusEvents, reviewKnowledgeItem, searchKnowledgeItems, transitionKnowledgeStatus, writeKnowledgeItem };
@@ -1,8 +1,8 @@
1
1
  import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
2
2
  import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
3
3
  import { init_session_repository } from "../storage/sqlite/session-repository.js";
4
- import { getUnderstandingConsent } from "../user-context/sources/consent-repository.js";
5
4
  import { isOwnerIdentity } from "../user-context/identity-bindings.js";
5
+ import { getUnderstandingConsent } from "../user-context/sources/consent-repository.js";
6
6
  //#region src/knowledge-memory/usage-policy.ts
7
7
  init_transaction();
8
8
  init_session_repository();