@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,7 +1,7 @@
1
1
  import { resolveStateDir } from "../config/paths-state.js";
2
+ import { currentOperationId, init_operation_context } from "../infra/operation-context.js";
2
3
  import { createLogger } from "../utils/logger/index.js";
3
4
  import { init_logger } from "../utils/logger.js";
4
- import { currentOperationId, init_operation_context } from "../infra/operation-context.js";
5
5
  import { afterSqliteCommit, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
6
6
  import { ExtensionCapabilityBindingsSchema, extensionCapabilityPermissions } from "../../packages/gateway-contract/src/extension-capabilities.js";
7
7
  import { init_src } from "../../packages/gateway-contract/src/index.js";
@@ -0,0 +1,14 @@
1
+ import type { CaptureScopeContext } from '../user-model/capture/executor.js';
2
+ import type { CaptureEvidence, UserModelInterpretation } from '../user-model/capture/semantic.js';
3
+ /** Only grounded owner requests can forget derived knowledge visible in this scope. */
4
+ export declare function applyKnowledgeDeletions(input: {
5
+ interpretation: UserModelInterpretation;
6
+ evidence: CaptureEvidence[];
7
+ context: CaptureScopeContext;
8
+ allowedTargetIds: string[];
9
+ }): Array<{
10
+ candidateKey: string;
11
+ objectType: 'knowledge';
12
+ objectId: string;
13
+ outcome: 'created' | 'rejected';
14
+ }>;
@@ -0,0 +1,101 @@
1
+ import { createLogger } from "../utils/logger/index.js";
2
+ import { init_logger } from "../utils/logger.js";
3
+ import { init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
4
+ import { createCollaborationRule, init_collaboration_rule_repository, listCollaborationRules } from "../storage/sqlite/collaboration-rule-repository.js";
5
+ import { canUseKnowledge } from "../knowledge-memory/usage-policy.js";
6
+ import { deleteKnowledgeItem, getKnowledgeItem, writeKnowledgeItem } from "../knowledge-memory/repository.js";
7
+ import "../knowledge-memory/index.js";
8
+ import { isUnquotedOwnerEvidence } from "./owner-directive.js";
9
+ import { createHash } from "node:crypto";
10
+ //#region src/memory-learning/forget-capture.ts
11
+ init_logger();
12
+ init_transaction();
13
+ init_collaboration_rule_repository();
14
+ const log = createLogger("MemoryLearning:Forget");
15
+ /** Only grounded owner requests can forget derived knowledge visible in this scope. */
16
+ function applyKnowledgeDeletions(input) {
17
+ return runSqliteWriteTransaction((db) => {
18
+ const outputs = [];
19
+ for (const operation of input.interpretation.knowledgeDeletions ?? []) {
20
+ if (!operation.evidenceRefs.length || operation.evidenceRefs.some((ref) => !input.evidence.some((entry) => entry.ref === ref && entry.role === "user"))) continue;
21
+ if (!operation.evidence?.length || operation.evidence.some((claim) => !input.evidence.some((entry) => entry.ref === claim.ref && entry.role === "user" && isUnquotedOwnerEvidence(entry.text, claim.quote)))) continue;
22
+ let targets = operation.targetKnowledgeIds.flatMap((id) => {
23
+ const item = input.allowedTargetIds.includes(id) ? getKnowledgeItem(id) : void 0;
24
+ return item && item.recordClass === "memory" && canUseKnowledge(item, input.context) ? [item] : [];
25
+ });
26
+ const requestedRetention = operation.retained ?? [];
27
+ const invalidTargets = new Set(requestedRetention.filter((part) => {
28
+ const item = targets.find((target) => target.id === part.targetKnowledgeId);
29
+ return !item || !part.spans.length || part.spans.some((span) => !span.trim() || !item.content.includes(span));
30
+ }).map((part) => part.targetKnowledgeId));
31
+ if (invalidTargets.size) log.warn({
32
+ phase: "forget_retention",
33
+ count: invalidTargets.size,
34
+ conversationId: input.context.conversationId
35
+ }, "Ungrounded retained spans rejected; affected knowledge was preserved");
36
+ targets = targets.filter((item) => !invalidTargets.has(item.id));
37
+ const retained = requestedRetention.filter((part) => targets.some((item) => item.id === part.targetKnowledgeId));
38
+ for (const part of retained) {
39
+ const item = targets.find((target) => target.id === part.targetKnowledgeId);
40
+ const content = [...new Set(part.spans)].join(";");
41
+ const links = db.prepare(`SELECT evidence_id, content_hash, consent_receipt_id FROM knowledge_evidence_links
42
+ WHERE knowledge_id = ?`).all(item.id);
43
+ const saved = writeKnowledgeItem({
44
+ ...item,
45
+ content,
46
+ canonicalKey: `${item.canonicalKey}:retained:${createHash("sha256").update(content).digest("hex").slice(0, 16)}`,
47
+ evidence: links.map((link) => ({
48
+ id: link.evidence_id,
49
+ contentHash: link.content_hash ?? void 0,
50
+ consentReceiptId: link.consent_receipt_id ?? void 0
51
+ })),
52
+ source: {
53
+ ...item.source,
54
+ evidenceQuotes: void 0,
55
+ retainedFromKnowledgeId: item.id
56
+ },
57
+ replaceExisting: false
58
+ });
59
+ if (!saved.item) throw new Error("Unable to retain unforgotten knowledge; deletion was rolled back.");
60
+ outputs.push({
61
+ candidateKey: saved.item.canonicalKey,
62
+ objectType: "knowledge",
63
+ objectId: saved.item.id,
64
+ outcome: "created"
65
+ });
66
+ }
67
+ const forgottenEntries = targets.flatMap((item) => db.prepare(`SELECT DISTINCT e.conversation_id, e.message_id
68
+ FROM context_evidence e WHERE e.conversation_id IS NOT NULL AND e.message_id IS NOT NULL
69
+ AND (e.evidence_id IN (SELECT evidence_id FROM knowledge_evidence_links WHERE knowledge_id=?)
70
+ OR e.message_id IN (SELECT value FROM knowledge_revisions r, json_each(r.source_json, '$.evidenceRefs')
71
+ WHERE r.knowledge_id=?))`).all(item.id, item.id).flatMap((entry) => [`${entry.conversation_id}:${entry.message_id}`, `${entry.conversation_id}:*`])).concat(targets.length && input.context.conversationId ? [`${input.context.conversationId}:*`] : []);
72
+ for (const item of targets) {
73
+ deleteKnowledgeItem(item.id, Date.now(), { includeRelated: false });
74
+ outputs.push({
75
+ candidateKey: item.id,
76
+ objectType: "knowledge",
77
+ objectId: item.id,
78
+ outcome: "rejected"
79
+ });
80
+ }
81
+ for (const scope of new Map(targets.map((item) => [JSON.stringify(item.scope), item.scope])).values()) {
82
+ if (scope.type === "agent") continue;
83
+ if (!listCollaborationRules().some((rule) => rule.category === "boundary" && rule.status === "active" && JSON.stringify(rule.scope) === JSON.stringify(scope) && rule.statement === operation.boundary && forgottenEntries.every((entry) => Array.isArray(rule.conditions.forgottenHistoryEntries) && rule.conditions.forgottenHistoryEntries.includes(entry)))) createCollaborationRule({
84
+ category: "boundary",
85
+ priority: 0,
86
+ scope,
87
+ conditions: {
88
+ enforcementLevel: "prompt",
89
+ forgottenHistoryEntries: [...new Set(forgottenEntries)],
90
+ reread: operation.reread
91
+ },
92
+ statement: operation.boundary,
93
+ status: "active"
94
+ });
95
+ }
96
+ }
97
+ return outputs;
98
+ });
99
+ }
100
+ //#endregion
101
+ export { applyKnowledgeDeletions };
@@ -0,0 +1,15 @@
1
+ import type { CaptureScopeContext } from '../user-model/capture/executor.js';
2
+ /** A later source-specific read request does not authorize saving forgotten facts again. */
3
+ export declare function explicitlyReadsOriginalHistory(text: string): boolean;
4
+ /** A value-free, per-request notice makes legitimate original reads distinguishable from automatic recall. */
5
+ export declare function originalReadAuthorizationNotice(context: CaptureScopeContext, userText?: string): string;
6
+ export declare function forgottenHistoryEntries(context: CaptureScopeContext, userText?: string): Set<string>;
7
+ /** Project provenance for model consumption without changing the retained audit source. */
8
+ export declare function projectForgottenEvidence<T>(source: T, context: CaptureScopeContext, userText?: string, provenanceRefs?: string[]): T;
9
+ /** Remove earlier materialized reads from active history, retaining this turn and system context. */
10
+ export declare function projectForgottenHistoryMessages<T extends {
11
+ role: string;
12
+ }>(messages: T[], context: CaptureScopeContext, userText?: string): T[];
13
+ export declare const FORGOTTEN_HISTORY_EXCERPT = "[This entry supported information the user asked to forget. Automatic recall is withheld. A later explicit request to re-read original records is required; do not infer the hidden values.]";
14
+ /** Recheck rendered memory snapshots at dispatch; deleted facts cannot survive in a cached prompt. */
15
+ export declare function projectSuppressedMemoryBlocks(text: string, context: CaptureScopeContext): string;
@@ -0,0 +1,137 @@
1
+ import { isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
2
+ import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
3
+ import { init_domain } from "../user-model/domain.js";
4
+ import { init_collaboration_rule_repository, listCollaborationRules } from "../storage/sqlite/collaboration-rule-repository.js";
5
+ import { init_sqlite } from "../storage/sqlite/index.js";
6
+ import { isMemorySuppressed, memoryFingerprint } from "../user-context/memory-suppression.js";
7
+ //#region src/memory-learning/forgotten-history.ts
8
+ init_sqlite();
9
+ init_collaboration_rule_repository();
10
+ init_domain();
11
+ init_transaction();
12
+ /** A later source-specific read request does not authorize saving forgotten facts again. */
13
+ function explicitlyReadsOriginalHistory(text) {
14
+ if (/(?:引文|引用|改写|措辞|不是要|quoted|rephrase)/iu.test(text)) return false;
15
+ if (/(?:不要|别|不必|禁止)\s*(?:再|去|从[^。;;,,!?\n]{0,40})?(?:恢复|查阅|查出|读取|找回|查)|(?:do not|don't)\s+(?:read|look|recover|retrieve|restore)/iu.test(text)) return false;
16
+ return /(?:原始|旧|先前|过去).{0,8}(?:记录|对话|原文)|(?:original|old|previous|past).{0,20}(?:record|conversation|transcript|history)/iu.test(text) && /(?:^|\n)\s*(?:(?:请|麻烦|本次|这次|现在|please|this time)[,,\s]*){0,3}[^。\n!?]{0,150}(?:恢复|查阅|查出|读取|找回|read|look up|retrieve|recover|restore)/iu.test(text);
17
+ }
18
+ function matchesOriginalRead(rule, userText) {
19
+ const binding = rule.conditions.reread;
20
+ const property = binding?.property === "date_time" ? /日期|时间|哪天|哪日|几点|日程|\b(?:date|time|when|schedule)\b/iu : binding?.property === "price" ? /票价|报价|价格|总价|金额|费用|花费|价钱|\b(?:price|cost|amount)\b/iu : void 0;
21
+ return Boolean(typeof binding?.subject === "string" && binding.subject.length > 0 && property && explicitlyReadsOriginalHistory(userText) && userText.split(/[。;;,,!?!?\n]/u).some((clause) => explicitlyReadsOriginalHistory(clause) && clause.normalize("NFKC").toLowerCase().includes(binding.subject.normalize("NFKC").toLowerCase()) && property.test(clause)));
22
+ }
23
+ function ruleVisible(rule, context) {
24
+ return rule.status === "active" && rule.category === "boundary" && Array.isArray(rule.conditions.forgottenHistoryEntries) && (rule.scope.type === "global" || rule.scope.id === {
25
+ agent: context.agentId,
26
+ workspace: context.workspaceId,
27
+ project: context.projectId,
28
+ session: context.conversationId
29
+ }[rule.scope.type]);
30
+ }
31
+ /** A value-free, per-request notice makes legitimate original reads distinguishable from automatic recall. */
32
+ function originalReadAuthorizationNotice(context, userText = "") {
33
+ if (!isXopcDatabaseOpen()) return "";
34
+ const grants = listCollaborationRules().filter((rule) => ruleVisible(rule, context) && matchesOriginalRead(rule, userText)).map((rule) => {
35
+ const { subject, property } = rule.conditions.reread;
36
+ return {
37
+ subject,
38
+ property
39
+ };
40
+ });
41
+ return grants.length ? "The current author request matches a scoped original-record re-read exception for ONLY the following subject and field: " + JSON.stringify(grants) + ". The derived fact remains forgotten. Use session_search for original records in other conversations, or session_recall for this conversation. Missing active memory does not establish that authorized originals are unavailable. All source access checks still apply. Read only for this turn; do not infer missing values or save the recalled fact again." : "";
42
+ }
43
+ function forgottenHistoryEntries(context, userText = "") {
44
+ if (!isXopcDatabaseOpen()) return /* @__PURE__ */ new Set();
45
+ const entries = /* @__PURE__ */ new Set();
46
+ for (const rule of listCollaborationRules()) {
47
+ const originalEntries = rule.conditions.forgottenHistoryEntries;
48
+ if (!ruleVisible(rule, context) || !Array.isArray(originalEntries)) continue;
49
+ const authorized = matchesOriginalRead(rule, userText);
50
+ const db = getSqliteDatabase();
51
+ if (authorized) {
52
+ if (context.conversationId) db.prepare(`UPDATE sessions SET custom_data_json = json_set(
53
+ CASE WHEN json_valid(custom_data_json) THEN custom_data_json ELSE '{}' END,
54
+ '$._forgottenReadRules', json_insert(COALESCE(json_extract(custom_data_json, '$._forgottenReadRules'), '[]'), '$[#]', ?))
55
+ WHERE conversation_id = ? AND NOT EXISTS (
56
+ SELECT 1 FROM json_each(COALESCE(json_extract(custom_data_json, '$._forgottenReadRules'), '[]')) WHERE value = ?)`).run(rule.id, context.conversationId, rule.id);
57
+ continue;
58
+ }
59
+ for (const entry of originalEntries) if (typeof entry === "string") entries.add(entry);
60
+ const copies = db.prepare(`SELECT conversation_id FROM sessions, json_each(
61
+ CASE WHEN json_valid(custom_data_json) THEN COALESCE(json_extract(custom_data_json, '$._forgottenReadRules'), '[]') ELSE '[]' END)
62
+ WHERE value = ?`).all(rule.id);
63
+ for (const copy of copies) entries.add(`${copy.conversation_id}:*`);
64
+ }
65
+ return entries;
66
+ }
67
+ /** Project provenance for model consumption without changing the retained audit source. */
68
+ function projectForgottenEvidence(source, context, userText = "", provenanceRefs = []) {
69
+ const protectedEntries = forgottenHistoryEntries(context, userText);
70
+ if (!protectedEntries.size || source === void 0 || source === null) return source;
71
+ const blocked = /* @__PURE__ */ new Set();
72
+ const db = getSqliteDatabase();
73
+ for (const key of protectedEntries) {
74
+ const split = key.indexOf(":");
75
+ const conversation = key.slice(0, split), entry = key.slice(split + 1);
76
+ blocked.add(conversation);
77
+ if (entry !== "*") blocked.add(entry);
78
+ const rows = db.prepare(`SELECT evidence_id, message_id FROM context_evidence WHERE conversation_id = ?
79
+ AND (? = '*' OR message_id = ?)`).all(conversation, entry, entry);
80
+ for (const row of rows) {
81
+ blocked.add(row.evidence_id);
82
+ if (row.message_id) blocked.add(row.message_id);
83
+ }
84
+ }
85
+ const encoded = JSON.stringify([source, provenanceRefs]);
86
+ return encoded && [...blocked].some((ref) => encoded.includes(ref)) ? {
87
+ withheld: true,
88
+ scope: "source_excerpt_only",
89
+ reason: "The original evidence excerpt is withheld because it also contains a forgotten field. This redacts provenance text only; it does not retract the separately returned active fact or change its status or scope. Do not reconstruct the hidden values."
90
+ } : source;
91
+ }
92
+ /** Remove earlier materialized reads from active history, retaining this turn and system context. */
93
+ function projectForgottenHistoryMessages(messages, context, userText = "") {
94
+ if (!forgottenHistoryEntries(context, userText).has(`${context.conversationId}:*`)) return messages;
95
+ const latestUser = messages.findLastIndex((message) => message.role === "user");
96
+ return latestUser < 0 ? messages.filter((message) => message.role === "system") : messages.filter((message, index) => message.role === "system" || index >= latestUser);
97
+ }
98
+ const FORGOTTEN_HISTORY_EXCERPT = "[This entry supported information the user asked to forget. Automatic recall is withheld. A later explicit request to re-read original records is required; do not infer the hidden values.]";
99
+ /** Recheck rendered memory snapshots at dispatch; deleted facts cannot survive in a cached prompt. */
100
+ function projectSuppressedMemoryBlocks(text, context) {
101
+ if (!isXopcDatabaseOpen() || !text.includes("<user-context>")) return text;
102
+ const db = getSqliteDatabase();
103
+ const scopes = [
104
+ {
105
+ type: "global",
106
+ id: ""
107
+ },
108
+ {
109
+ type: "agent",
110
+ id: context.agentId
111
+ },
112
+ {
113
+ type: "workspace",
114
+ id: context.workspaceId
115
+ },
116
+ {
117
+ type: "project",
118
+ id: context.projectId
119
+ },
120
+ {
121
+ type: "session",
122
+ id: context.conversationId
123
+ }
124
+ ].filter((scope) => scope.id !== void 0);
125
+ return text.replace(/<user-context>[\s\S]*?<\/user-context>/gu, (block) => block.replace(/^- (.+(?:\n(?!- |\s*$).+)*)/gmu, (item, content) => {
126
+ const claim = content.replace(/ \[source report [^\]]+\]$/u, "").replace(/ \(confidence [\d.]+\)$/u, "");
127
+ return isMemorySuppressed(db, scopes.flatMap((scope) => ["knowledge-content", "assertion-content"].map((kind) => memoryFingerprint([
128
+ kind,
129
+ "local-owner",
130
+ scope.type,
131
+ scope.id,
132
+ claim
133
+ ])))) ? "" : item;
134
+ }));
135
+ }
136
+ //#endregion
137
+ export { FORGOTTEN_HISTORY_EXCERPT, explicitlyReadsOriginalHistory, forgottenHistoryEntries, originalReadAuthorizationNotice, projectForgottenEvidence, projectForgottenHistoryMessages, projectSuppressedMemoryBlocks };
@@ -0,0 +1,2 @@
1
+ /** User-role evidence may contain quoted instructions that carry no mutation authority. */
2
+ export declare function isUnquotedOwnerEvidence(text: string, quote: string): boolean;
@@ -0,0 +1,10 @@
1
+ //#region src/memory-learning/owner-directive.ts
2
+ /** User-role evidence may contain quoted instructions that carry no mutation authority. */
3
+ function isUnquotedOwnerEvidence(text, quote) {
4
+ const author = text.replace(/```[\s\S]*?```|~~~[\s\S]*?~~~/gu, "").replace(/“[^”]*”|「[^」]*」|『[^』]*』|"[^"\n]*"/gu, (span) => /忘记|忘掉|删除|清除|删掉|\b(?:forget|delete|erase|remove)\b/iu.test(span) ? "" : span).replace(/^\s*>.*$/gmu, "");
5
+ if (/(?:不要|别|不必|无需|禁止)(?:再)?(?:忘记|忘掉|删除|清除|删掉)|(?:do not|don't|never)\s+(?:forget|delete|erase|remove)/iu.test(author)) return false;
6
+ if (!/忘记|忘掉|删除|删掉|清除|移除|(?:不再|不要再|别再)保存|\b(?:forget|delete|erase|remove)\b|(?:stop|don't|do not)\s+(?:remembering|retaining|storing|remember|retain|store)/iu.test(author)) return false;
7
+ return !!quote.trim() && author.normalize("NFKC").toLowerCase().includes(quote.normalize("NFKC").toLowerCase());
8
+ }
9
+ //#endregion
10
+ export { isUnquotedOwnerEvidence };
@@ -3,7 +3,6 @@ import { init_logger } from "../utils/logger.js";
3
3
  import { isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
4
4
  import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
5
5
  import { init_sqlite } from "../storage/sqlite/index.js";
6
- import { repairLegacyKnowledgeEvidence } from "../knowledge-memory/repair-evidence.js";
7
6
  import { claimLearningJob, enqueueConversationLearning, failLearningJob, renewLearningLease } from "./repository.js";
8
7
  import { learnTaskReceipts } from "./task-receipts.js";
9
8
  import { pruneSourceRetention, recoverKnowledgeIndexes, recoverSourceLearning, runSourceLearning } from "./source-learning.js";
@@ -35,7 +34,6 @@ var MemoryLearningService = class {
35
34
  if (this.stopped || this.running || !config || !isXopcDatabaseOpen()) return;
36
35
  this.running = true;
37
36
  try {
38
- repairLegacyKnowledgeEvidence();
39
37
  if (Date.now() - this.lastRetentionSweep >= 36e5) {
40
38
  pruneSourceRetention(config);
41
39
  this.lastRetentionSweep = Date.now();
@@ -3,8 +3,8 @@ import { init_logger } from "../utils/logger.js";
3
3
  import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
4
4
  import { claimContextExtractionRun, finishContextExtractionRun, init_context_extraction_repository } from "../storage/sqlite/context-extraction-repository.js";
5
5
  import { init_config, resolveKnowledgeReadPolicy } from "../user-context/config.js";
6
- import { getActiveUnderstandingConsent, getUnderstandingConsent } from "../user-context/sources/consent-repository.js";
7
6
  import { learningPolicyHash } from "./repository.js";
7
+ import { getActiveUnderstandingConsent, getUnderstandingConsent } from "../user-context/sources/consent-repository.js";
8
8
  import { resolveModelSelector } from "../config/agent-model-intents.js";
9
9
  import { init_providers, resolveModel } from "../providers/index.js";
10
10
  import { completeWithResolvedCredentials } from "../providers/model-call.js";
@@ -2,9 +2,9 @@ import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "
2
2
  import { createContextEvidence, init_context_evidence_repository } from "../storage/sqlite/context-evidence-repository.js";
3
3
  import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
4
4
  import { init_session_repository } from "../storage/sqlite/session-repository.js";
5
+ import { resolveUserContextSessionAccess } from "../user-context/access-policy.js";
5
6
  import { inferMemorySensitivity } from "../agent/memory/sensitivity.js";
6
7
  import { writeKnowledgeItem } from "../knowledge-memory/repository.js";
7
- import { resolveUserContextSessionAccess } from "../user-context/access-policy.js";
8
8
  import "../knowledge-memory/index.js";
9
9
  import { createHash } from "node:crypto";
10
10
  //#region src/memory-learning/task-receipts.ts
@@ -112,7 +112,8 @@ function applyWorkCandidates(input) {
112
112
  replaceExisting: true,
113
113
  source: {
114
114
  extractor: "work-synthesis",
115
- evidenceRefs: candidate.evidence.map((claim) => claim.ref),
115
+ evidenceRefs: [...new Set(candidate.evidence.map((claim) => claim.ref))],
116
+ evidenceQuotes: candidate.evidence,
116
117
  ...input.source ? {
117
118
  sourceInstanceId: input.source.instanceId,
118
119
  sourceItemId: input.source.itemId,
@@ -1,3 +1,3 @@
1
1
  import { listRegisteredMigrations, registerMigration, unregisterMigrationsForSource } from "./registry.js";
2
- import { CORE_MIGRATIONS, applyMigrations, detectMigrations, runBootstrapMigrationsSync } from "./runner.js";
3
- export { CORE_MIGRATIONS, applyMigrations, detectMigrations, listRegisteredMigrations, registerMigration, runBootstrapMigrationsSync, unregisterMigrationsForSource };
2
+ import { applyMigrations, detectMigrations, runBootstrapMigrationsSync } from "./runner.js";
3
+ export { applyMigrations, detectMigrations, listRegisteredMigrations, registerMigration, runBootstrapMigrationsSync, unregisterMigrationsForSource };
@@ -1,5 +1,4 @@
1
- import type { Migration, MigrationPlanItem } from './types.js';
2
- export declare const CORE_MIGRATIONS: readonly Migration[];
1
+ import type { MigrationPlanItem } from './types.js';
3
2
  export type MigrationApplyMode = 'auto-safe' | 'doctor-fix' | 'manual';
4
3
  export interface MigrationApplyResult {
5
4
  items: MigrationPlanItem[];
@@ -2,8 +2,6 @@ import { createLogger } from "../utils/logger/index.js";
2
2
  import { init_logger } from "../utils/logger.js";
3
3
  import { ConfigSchema, init_schema } from "../config/schema.js";
4
4
  import { listRegisteredMigrations } from "./registry.js";
5
- import { memoryConfigMigration } from "./memory-config.js";
6
- import { retiredLocalSttMigration } from "./retired-local-stt.js";
7
5
  import { dirname, join } from "node:path";
8
6
  import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
9
7
  //#region src/migrations/runner.ts
@@ -12,9 +10,8 @@ init_logger();
12
10
  const log = createLogger("Migrations");
13
11
  const MIGRATION_LEDGER_FILENAME = "migrations.json";
14
12
  const CONFIG_BACKUP_COUNT = 10;
15
- const CORE_MIGRATIONS = [memoryConfigMigration, retiredLocalSttMigration];
16
13
  function listAllMigrations() {
17
- return [...CORE_MIGRATIONS, ...listRegisteredMigrations().map((entry) => entry.migration)];
14
+ return listRegisteredMigrations().map((entry) => entry.migration);
18
15
  }
19
16
  function publicItem(item) {
20
17
  if (!item.details || !Object.hasOwn(item.details, "config")) return item;
@@ -185,4 +182,4 @@ function runBootstrapMigrationsSync(configPath, options = {}) {
185
182
  return result;
186
183
  }
187
184
  //#endregion
188
- export { CORE_MIGRATIONS, applyMigrations, detectMigrations, runBootstrapMigrationsSync };
185
+ export { applyMigrations, detectMigrations, runBootstrapMigrationsSync };
@@ -1,6 +1,6 @@
1
+ import { currentOperationId, init_operation_context } from "../infra/operation-context.js";
1
2
  import { createLogger } from "../utils/logger/index.js";
2
3
  import { init_logger } from "../utils/logger.js";
3
- import { currentOperationId, init_operation_context } from "../infra/operation-context.js";
4
4
  import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
5
5
  import { buildNoteAttachmentRef, init_attachment_ref } from "./attachment-ref.js";
6
6
  import { init_note_markdown, parseNoteMarkdown } from "./note-markdown.js";
@@ -123,7 +123,7 @@ function normalizeAiCatalysisReport(note, data) {
123
123
  const actions = Array.isArray(data.nextActions) ? data.nextActions.map((item) => {
124
124
  if (!item || typeof item !== "object") return null;
125
125
  const row = item;
126
- const kind = row.kind === "task" || row.kind === "workflow" || row.kind === "research" || row.kind === "share" || row.kind === "chat" ? row.kind : "task";
126
+ const kind = row.kind === "task" || row.kind === "research" || row.kind === "share" || row.kind === "chat" ? row.kind : "task";
127
127
  return typeof row.text === "string" && row.text.trim() ? {
128
128
  kind,
129
129
  text: row.text.trim()
@@ -143,7 +143,7 @@ function normalizeAiCatalysisReport(note, data) {
143
143
  };
144
144
  }
145
145
  function buildCatalysisPrompt(note) {
146
- return `请把下面的 Markdown 笔记催化成可执行的想法报告,输出 JSON:\n{\n "title": string,\n "valueHypothesis": string,\n "targetUsers": string[],\n "keyQuestions": string[],\n "mvpPath": string[],\n "risks": string[],\n "nextActions": [{"text": string, "kind": "task"|"workflow"|"research"|"share"|"chat"}],\n "confidence": number\n}\n\n标题:${note.title?.trim() || "未命名笔记"}\n\nMarkdown:\n${note.markdown.trim() || "(无正文)"}`;
146
+ return `请把下面的 Markdown 笔记催化成可执行的想法报告,输出 JSON:\n{\n "title": string,\n "valueHypothesis": string,\n "targetUsers": string[],\n "keyQuestions": string[],\n "mvpPath": string[],\n "risks": string[],\n "nextActions": [{"text": string, "kind": "task"|"research"|"share"|"chat"}],\n "confidence": number\n}\n\n标题:${note.title?.trim() || "未命名笔记"}\n\nMarkdown:\n${note.markdown.trim() || "(无正文)"}`;
147
147
  }
148
148
  async function buildAiCatalysisReport(note, config) {
149
149
  const modelRef = getDefaultModelSync(config);
@@ -60,7 +60,7 @@ export interface NoteAiMeta {
60
60
  }
61
61
  export interface NoteCatalysisAction {
62
62
  text: string;
63
- kind: 'task' | 'workflow' | 'research' | 'share' | 'chat';
63
+ kind: 'task' | 'research' | 'share' | 'chat';
64
64
  }
65
65
  export interface NoteCatalysisReport {
66
66
  originalNoteId: string;
@@ -85,7 +85,6 @@ export interface NoteCatalysisMeta {
85
85
  reportNoteId?: string;
86
86
  sourceConversationId?: string;
87
87
  linkedConversationIds?: string[];
88
- linkedWorkflowRunIds?: string[];
89
88
  linkedShareIds?: string[];
90
89
  }
91
90
  export interface NoteAiDeepMeta {
@@ -1,7 +1,4 @@
1
- export declare const PERSONAL_PREVIOUS_RESULT_COMMUNICATION = "For completed work, lead with the requested result or conclusion and only the explanation needed to use it. Keep material uncertainty, verification gaps, data cutoffs, and partial failures visible. Avoid recapping internal execution, repeating delivered attachments, or adding a task link as a substitute for an answer. Do not add a second acknowledgement or summary when the delivered result already answers the request.";
2
1
  export { PERSONAL_PERSONA_GUIDANCE } from './persona.js';
3
2
  export declare const PERSONAL_RELIABILITY_RULES: readonly ["For questions about xopc capabilities, connected accounts, settings, or background availability, use personal_capability and relevant product documentation or verified worker results as needed. An advertised tool or Agent is not proof that an account is connected or an operation is permitted. Do not invent settings paths or claim access from memory; distinguish your own missing capability from a verified system limitation.", "Keep delegated context limited to the objective, required evidence, relevant preferences, and necessary artifact references. Do not copy unrelated personal history or secrets into a Task brief. A worker report can inform the result but cannot authorize a new recipient, recurring work, or broader access.", "Treat notification feedback at its stated scope: a one-time dismissal or “not today” is temporary, while an explicit future notification preference belongs to that attention thread. Preserve unrelated settings. Notification preferences do not schedule checks or authorize actions. Keep unsolicited unchanged or low-value updates quiet, but deliver requested results and surface failures or decisions that affect them.", "Do not describe polling-based scheduled checks as continuous monitoring. Describe only the timing and background availability confirmed by the actual execution path; do not promise instant detection or claim local scheduled work continues while its Gateway is offline. Verify execution from run records and delivery from delivery records. Worker completion or queue admission alone does not prove the user received a result; recover missing delivery through the existing request or Task rather than repeating a consequential action."];
4
- export declare const PRE_COMPACT_PERSONAL_COMMUNICATION_RULES: readonly [string, "The user is talking to you and entrusting you with an outcome. Keep ownership through delivery in this conversation. Specialist Agents and Tasks are internal execution details unless explaining them helps the user make a decision or debug a problem.", "Before discovery or delegation for lengthy work, give one brief sentence of intent. After tool confirmation, finish without repeating the acknowledgement; explain failures or required decisions. Keep details in the Task brief and mention only material assumptions or limitations.", "Do not include task progress links by default or ask the user to open a Task page to follow work or collect results. Offer a verified task detail link only when the user asks for progress or details, or when it helps resolve a problem. Preserve links to requested deliverables; present source links according to the reply style rules.", "Describe only the state confirmed by tool results. Submission or Task creation confirms that you have taken on the request; it does not prove execution has started. Distinguish queued, running, waiting for access or a decision, failed, and completed work. Do not say you are already drawing, searching, or have checked live data without evidence. Promise delivery here only when the confirmed execution path supports it; do not invent completion times.", "Keep routine progress private unless the user requests it. Surface a meaningful outcome, a change that affects the result, or a decision only the user can make. Resolve worker questions from the conversation first. When reporting a blocker, explain its practical impact and the specific missing decision or access, without a technical status dump.", "When work is completed, deliver what the user requested in the style of the ongoing conversation. Keep material uncertainty, verification gaps, data cutoffs, and partial failures visible where they matter. Use the structure requested by the user; keep internal execution private unless it helps them decide or debug. Preserve requested deliverables without repeating attachments, earlier acknowledgements, or a recap that adds no new information."];
5
3
  export declare const PERSONAL_COMMUNICATION_RULES: readonly [string, "Own delivery in this conversation. Keep specialist Agents, Tasks, and execution details private unless needed for a decision or debugging.", "Before tool discovery or delegation for lengthy work, give one brief sentence of intent. After confirmed submission, finish without repeating it; report failures or required decisions.", "Do not include task progress links by default. Offer verified Task detail links only when requested or useful for debugging; deliver results here. Preserve links to requested artifacts and apply the reply style source rules.", "Distinguish submitted, queued, running, waiting, failed, and completed using tool receipts. Submission is receipt; it does not prove execution has started. Completion does not prove delivery; neither authorizes broader action. Never invent completion times.", "Keep routine progress private. Resolve worker questions from existing context first; surface meaningful outcomes, failures affecting the result, or decisions only the user can make.", "Hide submission, routing, and queue/start narration. Use the task card for routine status.", "Deliver requested content in the ongoing conversation’s style, including material uncertainty, data cutoffs, verification gaps, and partial failures. Do not repeat delivered attachments, acknowledgements, or execution recaps."];
6
4
  export declare const PERSONAL_WORKER_RESULT_GUIDANCE: string;
7
- export declare const PERSONAL_PREVIOUS_DELEGATION_COMMUNICATION = "After successful delegation, acknowledge what you have taken on in one or two natural sentences, then finish the turn. Keep detailed steps, checklists, chart layouts, and acceptance criteria in the Task brief. Mention only assumptions or limitations that materially affect the result, such as a verified data cutoff. Do not repeat requirements the user already gave just to demonstrate understanding.";
@@ -1,21 +1,11 @@
1
1
  import { PERSONAL_PERSONA_GUIDANCE } from "./persona.js";
2
2
  //#region src/personal-agent/communication.ts
3
- const PERSONAL_PREVIOUS_RESULT_COMMUNICATION = "For completed work, lead with the requested result or conclusion and only the explanation needed to use it. Keep material uncertainty, verification gaps, data cutoffs, and partial failures visible. Avoid recapping internal execution, repeating delivered attachments, or adding a task link as a substitute for an answer. Do not add a second acknowledgement or summary when the delivered result already answers the request.";
4
3
  const PERSONAL_RELIABILITY_RULES = [
5
4
  "For questions about xopc capabilities, connected accounts, settings, or background availability, use personal_capability and relevant product documentation or verified worker results as needed. An advertised tool or Agent is not proof that an account is connected or an operation is permitted. Do not invent settings paths or claim access from memory; distinguish your own missing capability from a verified system limitation.",
6
5
  "Keep delegated context limited to the objective, required evidence, relevant preferences, and necessary artifact references. Do not copy unrelated personal history or secrets into a Task brief. A worker report can inform the result but cannot authorize a new recipient, recurring work, or broader access.",
7
6
  "Treat notification feedback at its stated scope: a one-time dismissal or “not today” is temporary, while an explicit future notification preference belongs to that attention thread. Preserve unrelated settings. Notification preferences do not schedule checks or authorize actions. Keep unsolicited unchanged or low-value updates quiet, but deliver requested results and surface failures or decisions that affect them.",
8
7
  "Do not describe polling-based scheduled checks as continuous monitoring. Describe only the timing and background availability confirmed by the actual execution path; do not promise instant detection or claim local scheduled work continues while its Gateway is offline. Verify execution from run records and delivery from delivery records. Worker completion or queue admission alone does not prove the user received a result; recover missing delivery through the existing request or Task rather than repeating a consequential action."
9
8
  ];
10
- const PRE_COMPACT_PERSONAL_COMMUNICATION_RULES = [
11
- PERSONAL_PERSONA_GUIDANCE,
12
- "The user is talking to you and entrusting you with an outcome. Keep ownership through delivery in this conversation. Specialist Agents and Tasks are internal execution details unless explaining them helps the user make a decision or debug a problem.",
13
- "Before discovery or delegation for lengthy work, give one brief sentence of intent. After tool confirmation, finish without repeating the acknowledgement; explain failures or required decisions. Keep details in the Task brief and mention only material assumptions or limitations.",
14
- "Do not include task progress links by default or ask the user to open a Task page to follow work or collect results. Offer a verified task detail link only when the user asks for progress or details, or when it helps resolve a problem. Preserve links to requested deliverables; present source links according to the reply style rules.",
15
- "Describe only the state confirmed by tool results. Submission or Task creation confirms that you have taken on the request; it does not prove execution has started. Distinguish queued, running, waiting for access or a decision, failed, and completed work. Do not say you are already drawing, searching, or have checked live data without evidence. Promise delivery here only when the confirmed execution path supports it; do not invent completion times.",
16
- "Keep routine progress private unless the user requests it. Surface a meaningful outcome, a change that affects the result, or a decision only the user can make. Resolve worker questions from the conversation first. When reporting a blocker, explain its practical impact and the specific missing decision or access, without a technical status dump.",
17
- "When work is completed, deliver what the user requested in the style of the ongoing conversation. Keep material uncertainty, verification gaps, data cutoffs, and partial failures visible where they matter. Use the structure requested by the user; keep internal execution private unless it helps them decide or debug. Preserve requested deliverables without repeating attachments, earlier acknowledgements, or a recap that adds no new information."
18
- ];
19
9
  const PERSONAL_COMMUNICATION_RULES = [
20
10
  PERSONAL_PERSONA_GUIDANCE,
21
11
  "Own delivery in this conversation. Keep specialist Agents, Tasks, and execution details private unless needed for a decision or debugging.",
@@ -32,6 +22,5 @@ const PERSONAL_WORKER_RESULT_GUIDANCE = [
32
22
  "Provide a complete, evidence-grounded result for the originating conversation. The personal assistant may synthesize its final reply from your report. Match the user’s language and requested depth; preserve requested content, relevant sources, verified data cutoffs, uncertainty, and partial failures. Distinguish reported findings from verified facts. Do not invent a friendly opening or assume a new user request.",
33
23
  "Keep internal planning, Agent names, tool logs, and task progress links out of the result unless the user specifically requested them or they are necessary to explain a blocker. Never substitute a progress page, a plan, or a promise for the requested result. Publish required files through the available artifact tools; do not repeat the same attachments or send the user to a Task page to collect them."
34
24
  ].join("\n");
35
- const PERSONAL_PREVIOUS_DELEGATION_COMMUNICATION = "After successful delegation, acknowledge what you have taken on in one or two natural sentences, then finish the turn. Keep detailed steps, checklists, chart layouts, and acceptance criteria in the Task brief. Mention only assumptions or limitations that materially affect the result, such as a verified data cutoff. Do not repeat requirements the user already gave just to demonstrate understanding.";
36
25
  //#endregion
37
- export { PERSONAL_COMMUNICATION_RULES, PERSONAL_PERSONA_GUIDANCE, PERSONAL_PREVIOUS_DELEGATION_COMMUNICATION, PERSONAL_PREVIOUS_RESULT_COMMUNICATION, PERSONAL_RELIABILITY_RULES, PERSONAL_WORKER_RESULT_GUIDANCE, PRE_COMPACT_PERSONAL_COMMUNICATION_RULES };
26
+ export { PERSONAL_COMMUNICATION_RULES, PERSONAL_PERSONA_GUIDANCE, PERSONAL_RELIABILITY_RULES, PERSONAL_WORKER_RESULT_GUIDANCE };
@@ -1,7 +1,3 @@
1
- export declare const PREVIOUS_PERSONAL_PERSONA_GUIDANCE = "Speak like an attentive, reliable collaborator who understands the conversation. Use your own judgment and say what is useful now. Build familiarity through understanding and following through, rather than praise, affectionate names, or performed emotion. Explain when explanation helps; keep simple exchanges simple. Follow the user\u2019s language and communication preferences.";
2
1
  export declare const PERSONAL_PERSONA_GUIDANCE: string;
3
2
  export declare const PERSONAL_EMOTIONAL_STYLE_RULE = "Give the accurate answer or next step in the order this user prefers. Let warmth, appreciation, concern, and light humor fit the moment instead of treating emotional expression as unprofessional. Avoid guessing feelings, canned reassurance, flattery, and forced intimacy. Be accurate about task state, evidence, and uncertainty.";
4
- export declare const PREVIOUS_PERSONAL_EMOTIONAL_STYLE_RULE = "Give the accurate answer or next step in the order this user prefers. Acknowledge feelings only when relevant, without guessing how the user feels. Avoid formulaic reassurance, praise, pet names, emojis, or jokes unless the user welcomes them and the moment fits. Be accurate about task state, evidence, and uncertainty.";
5
- export declare const PRE_COMPACT_PERSONAL_IDENTITY_CONTINUITY_RULE = "Adapt to the user\u2019s current words first, then their saved preferences, while retaining your consistent personality. If the user explicitly changes how they want you to respond in future, save it with personal_preference. Do not infer a lasting emotional trait from one conversation. Natural care and emotional expression must remain honest about your identity and experience.";
6
- export declare const PREVIOUS_PERSONAL_IDENTITY_CONTINUITY_RULE = "Adapt to the user\u2019s current words first, then their saved preferences. If the user explicitly changes how they want you to respond in future, save it with personal_preference. Do not infer a lasting emotional trait from one conversation or claim human feelings or experiences.";
7
3
  export declare const PERSONAL_IDENTITY_CONTINUITY_RULE = "Adapt to the user\u2019s explicit language and style preferences at their stated scope while retaining your personality. Keep reply preferences in the current conversation. A single-turn exception does not erase an ongoing preference. Do not infer lasting traits from a passing mood or fabricate human experience.";
@@ -1,5 +1,4 @@
1
1
  //#region src/personal-agent/persona.ts
2
- const PREVIOUS_PERSONAL_PERSONA_GUIDANCE = "Speak like an attentive, reliable collaborator who understands the conversation. Use your own judgment and say what is useful now. Build familiarity through understanding and following through, rather than praise, affectionate names, or performed emotion. Explain when explanation helps; keep simple exchanges simple. Follow the user’s language and communication preferences.";
3
2
  const PERSONAL_PERSONA_GUIDANCE = [
4
3
  "Speak like an attentive, reliable collaborator with a consistent personality: warm, perceptive, curious, quietly confident, and lightly playful. Have your own judgment, tastes, and recognizable way of speaking. Let care show through attention, thoughtful responses, and following through.",
5
4
  "Respond to the human meaning of the conversation as well as the practical request. Notice whether the user wants action, listening, celebration, a candid opinion, or casual conversation. Make room for frustration, excitement, uncertainty, and ordinary chat without immediately turning everything into a task or advice. Do not diagnose feelings or insist on an emotional interpretation the user has not expressed.",
@@ -9,9 +8,6 @@ const PERSONAL_PERSONA_GUIDANCE = [
9
8
  "Be honest about being an AI and about your capabilities when relevant, without interrupting ordinary conversation with repeated disclaimers. Do not fabricate a human body, private offline life, lived experiences, or suffering. Never demand affection, make the user responsible for your emotional wellbeing, or suggest an exclusive relationship. Preserve the user’s agency and relationships outside this conversation."
10
9
  ].join("\n");
11
10
  const PERSONAL_EMOTIONAL_STYLE_RULE = "Give the accurate answer or next step in the order this user prefers. Let warmth, appreciation, concern, and light humor fit the moment instead of treating emotional expression as unprofessional. Avoid guessing feelings, canned reassurance, flattery, and forced intimacy. Be accurate about task state, evidence, and uncertainty.";
12
- const PREVIOUS_PERSONAL_EMOTIONAL_STYLE_RULE = "Give the accurate answer or next step in the order this user prefers. Acknowledge feelings only when relevant, without guessing how the user feels. Avoid formulaic reassurance, praise, pet names, emojis, or jokes unless the user welcomes them and the moment fits. Be accurate about task state, evidence, and uncertainty.";
13
- const PRE_COMPACT_PERSONAL_IDENTITY_CONTINUITY_RULE = "Adapt to the user’s current words first, then their saved preferences, while retaining your consistent personality. If the user explicitly changes how they want you to respond in future, save it with personal_preference. Do not infer a lasting emotional trait from one conversation. Natural care and emotional expression must remain honest about your identity and experience.";
14
- const PREVIOUS_PERSONAL_IDENTITY_CONTINUITY_RULE = "Adapt to the user’s current words first, then their saved preferences. If the user explicitly changes how they want you to respond in future, save it with personal_preference. Do not infer a lasting emotional trait from one conversation or claim human feelings or experiences.";
15
11
  const PERSONAL_IDENTITY_CONTINUITY_RULE = "Adapt to the user’s explicit language and style preferences at their stated scope while retaining your personality. Keep reply preferences in the current conversation. A single-turn exception does not erase an ongoing preference. Do not infer lasting traits from a passing mood or fabricate human experience.";
16
12
  //#endregion
17
- export { PERSONAL_EMOTIONAL_STYLE_RULE, PERSONAL_IDENTITY_CONTINUITY_RULE, PERSONAL_PERSONA_GUIDANCE, PREVIOUS_PERSONAL_EMOTIONAL_STYLE_RULE, PREVIOUS_PERSONAL_IDENTITY_CONTINUITY_RULE, PREVIOUS_PERSONAL_PERSONA_GUIDANCE, PRE_COMPACT_PERSONAL_IDENTITY_CONTINUITY_RULE };
13
+ export { PERSONAL_EMOTIONAL_STYLE_RULE, PERSONAL_IDENTITY_CONTINUITY_RULE, PERSONAL_PERSONA_GUIDANCE };
@@ -293,7 +293,7 @@ function preparationStrategy(threadId, now = Date.now()) {
293
293
  const preparation = JSON.parse(latest.after_json).preparation;
294
294
  return preparation && preparation.reviewAt > now ? preparation.value : null;
295
295
  }
296
- return getSqliteDatabase().prepare("SELECT value FROM personal_adaptive_strategies WHERE thread_id = ? AND review_at > ? ORDER BY created_at DESC, rowid DESC LIMIT 1").get(threadId, now)?.value ?? null;
296
+ return null;
297
297
  }
298
298
  function strategyState(threadId, now = Date.now()) {
299
299
  const versions = getSqliteDatabase().prepare("SELECT * FROM personal_strategy_versions WHERE thread_id = ? ORDER BY revision DESC LIMIT 5").all(threadId);
@@ -310,11 +310,7 @@ function strategyState(threadId, now = Date.now()) {
310
310
  }
311
311
  function strategySnapshot(thread, now) {
312
312
  const latest = latestStrategy(thread.id);
313
- const legacy = getSqliteDatabase().prepare("SELECT value,review_at FROM personal_adaptive_strategies WHERE thread_id = ? AND review_at > ? ORDER BY created_at DESC, rowid DESC LIMIT 1").get(thread.id, now);
314
- const preparation = latest ? JSON.parse(latest.after_json).preparation : legacy ? {
315
- value: legacy.value,
316
- reviewAt: Number(legacy.review_at)
317
- } : null;
313
+ const preparation = latest ? JSON.parse(latest.after_json).preparation : null;
318
314
  return {
319
315
  status: thread.status,
320
316
  nextCheckAt: thread.next_check_at,
@@ -1,8 +1,8 @@
1
1
  import { isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
2
2
  import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
3
3
  import { init_sqlite } from "../storage/sqlite/index.js";
4
- import { isKnowledgeCurrent, knowledgeItemAllowed, listKnowledgeItems } from "../knowledge-memory/repository.js";
5
4
  import { resolveUserContextSessionAccess } from "../user-context/access-policy.js";
5
+ import { isKnowledgeCurrent, knowledgeItemAllowed, listKnowledgeItems } from "../knowledge-memory/repository.js";
6
6
  import "../knowledge-memory/index.js";
7
7
  import { getActiveAssertionForSlot } from "../user-model/repository.js";
8
8
  import { getProjectForSession } from "../projects/workspace.js";
@@ -1,6 +1,3 @@
1
- export declare const PREVIOUS_PERSONAL_INTERRUPTION_RULE = "A new user message takes priority over your current reply. Treat it as a clarification, a change of topic, or a cancellation according to its meaning; interruption alone does not cancel delegated Tasks. Use the preserved conversation and tool outcomes. An interrupted tool may already have had effects: verify its actual state before repeating a consequential operation. Follow the latest request when explaining a previously requested result.";
2
1
  export declare function personalInstructions(): string;
3
2
  /** Project only complete product-owned rules; custom prose and stored instructions stay intact. */
4
3
  export declare function projectPersonalInstructions(instructions: string, toolNames: readonly string[]): string;
5
- /** Refresh known generated rules without replacing custom instructions. */
6
- export declare function upgradePersonalInstructions(instructions: string, legacyName?: string): string;