@xopcai/xopc 0.0.363 → 0.0.366

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 (217) hide show
  1. package/dist/browser-ext/dist/sidepanel.js +16 -4
  2. package/dist/browser-ext/manifest.json +1 -1
  3. package/dist/extensions/telegram/xopc.extension.json +1 -1
  4. package/dist/gateway/static/root/assets/{activity-store-GvR2gZ0T.js → activity-store-SVmnh__i.js} +1 -1
  5. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DkcXyPH0.js → agent-avatar-dicebear-CS9lg5h2.js} +1 -1
  6. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-B-l5AaYN.js → agent-defaults-settings-panel-CvUPtxS4.js} +1 -1
  7. package/dist/gateway/static/root/assets/{agent-plugin-dialog-BY6tPYOK.js → agent-plugin-dialog-1tRxDfjI.js} +1 -1
  8. package/dist/gateway/static/root/assets/{agents-admin-api-BkXb7VEZ.js → agents-admin-api-CVdFV-cU.js} +1 -1
  9. package/dist/gateway/static/root/assets/{agents-CdSEoeje.js → agents-gdT0whx9.js} +3 -3
  10. package/dist/gateway/static/root/assets/{app-management-settings-panel-BtD53cfe.js → app-management-settings-panel-CaxnUxvy.js} +1 -1
  11. package/dist/gateway/static/root/assets/{appearance-settings-BAweWgX_.js → appearance-settings-6NKquG3v.js} +1 -1
  12. package/dist/gateway/static/root/assets/{apps-page-CS6-hrIB.js → apps-page-BoB3MbsB.js} +1 -1
  13. package/dist/gateway/static/root/assets/{archive-plugin-CKe3qAaL.js → archive-plugin-BWtLZtK1.js} +1 -1
  14. package/dist/gateway/static/root/assets/{automations-page-CtE8r9Y2.js → automations-page-CNngHw2c.js} +1 -1
  15. package/dist/gateway/static/root/assets/{automations-workspace-pnMgR4Da.js → automations-workspace-BKHsdiQ8.js} +1 -1
  16. package/dist/gateway/static/root/assets/{binary-plugins-J51oS7-D.js → binary-plugins-fIhH-wg6.js} +1 -1
  17. package/dist/gateway/static/root/assets/{block-editor-D5hf6WcP.js → block-editor-BhstSZNE.js} +1 -1
  18. package/dist/gateway/static/root/assets/{browser-automation-inputs-5B3qAdmb.js → browser-automation-inputs-B6sOBxVA.js} +1 -1
  19. package/dist/gateway/static/root/assets/{browser-automations-page-PZDQlXH4.js → browser-automations-page-HZAKkVVt.js} +1 -1
  20. package/dist/gateway/static/root/assets/{browser-settings-page-2YDV-ZWt.js → browser-settings-page-D8IpVQI6.js} +1 -1
  21. package/dist/gateway/static/root/assets/{capabilities-CT_ZW9fT.js → capabilities-C4grvUkw.js} +1 -1
  22. package/dist/gateway/static/root/assets/{capabilities-BKu9BqPe.js → capabilities-CAIQmCrH.js} +1 -1
  23. package/dist/gateway/static/root/assets/{capabilities-page-CB-iX3Fy.js → capabilities-page-DK8FJRW4.js} +2 -2
  24. package/dist/gateway/static/root/assets/{capabilities-settings-panel-BCTuWNaW.js → capabilities-settings-panel-BP2roWcM.js} +1 -1
  25. package/dist/gateway/static/root/assets/{capability-header-actions--aC5XB9E.js → capability-header-actions-BA1M7RRP.js} +1 -1
  26. package/dist/gateway/static/root/assets/{channels-JnAQP1bt.js → channels-EQGCxr8W.js} +1 -1
  27. package/dist/gateway/static/root/assets/{chat-terminal-dock-BFZEpvzn.js → chat-terminal-dock-KS_yk1H7.js} +1 -1
  28. package/dist/gateway/static/root/assets/{computer-settings-page-Dc9ooEM-.js → computer-settings-page-CGBR0KFw.js} +1 -1
  29. package/dist/gateway/static/root/assets/{connector-service-page-1_QB5D-t.js → connector-service-page-CY_3H_l9.js} +1 -1
  30. package/dist/gateway/static/root/assets/{connectors-page-Um_Jy5zh.js → connectors-page-CUOL6JX0.js} +1 -1
  31. package/dist/gateway/static/root/assets/{date-picker-C9ZqTPui.js → date-picker-CDSZ-PWV.js} +1 -1
  32. package/dist/gateway/static/root/assets/{dependency-picker-DBz0Pmyr.js → dependency-picker-CyNH4m20.js} +1 -1
  33. package/dist/gateway/static/root/assets/{desktop-pet-BLtp2MmX.js → desktop-pet-BsZQsQ2_.js} +1 -1
  34. package/dist/gateway/static/root/assets/{desktop-pet-settings-BNGbqwec.js → desktop-pet-settings-DMgkUy6g.js} +1 -1
  35. package/dist/gateway/static/root/assets/{device-pairing-wizard-7rdo-A7d.js → device-pairing-wizard-JjbUN8y-.js} +1 -1
  36. package/dist/gateway/static/root/assets/{directory-picker-path-field-BnilGgwM.js → directory-picker-path-field-CBTI3tKh.js} +1 -1
  37. package/dist/gateway/static/root/assets/{extension-debug-page-BGyJpRv4.js → extension-debug-page-C7nSpOKj.js} +1 -1
  38. package/dist/gateway/static/root/assets/{extension-page-DsrVktRN.js → extension-page-BYUjAvsZ.js} +1 -1
  39. package/dist/gateway/static/root/assets/{extension-provider-F9JzOWZ3.js → extension-provider-DaLt3bC-.js} +1 -1
  40. package/dist/gateway/static/root/assets/{extension-settings-page-jeb0ytRK.js → extension-settings-page-CRasspq0.js} +1 -1
  41. package/dist/gateway/static/root/assets/{fallback-models-bZcxkEDz.js → fallback-models-BLJFYASE.js} +1 -1
  42. package/dist/gateway/static/root/assets/{gateway-config-swr-CoRoOG1l.js → gateway-config-swr-DIIzvDLQ.js} +1 -1
  43. package/dist/gateway/static/root/assets/{gateway-realtime-D0ygm6bc.js → gateway-realtime-DD70L42G.js} +1 -1
  44. package/dist/gateway/static/root/assets/gateway-realtime-store-DeUVEPPE.js +1 -0
  45. package/dist/gateway/static/root/assets/{gateway-settings-A9SzLsGp.js → gateway-settings-B9n5naCr.js} +1 -1
  46. package/dist/gateway/static/root/assets/{gateway-startup-retry-FDS6S6qa.js → gateway-startup-retry-D_EwU7-6.js} +1 -1
  47. package/dist/gateway/static/root/assets/{home-page-CnHzaH9K.js → home-page-BP6qAgBt.js} +1 -1
  48. package/dist/gateway/static/root/assets/{image-generation-api-BPd76jW5.js → image-generation-api-BkK22JsL.js} +1 -1
  49. package/dist/gateway/static/root/assets/{imports-page-CzpsV6Vz.js → imports-page-YJKcTKKr.js} +1 -1
  50. package/dist/gateway/static/root/assets/index-6JNNrzCq.js +106 -0
  51. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-D90Dvlwo.js → keyboard-shortcuts-settings-BG_kM_Rm.js} +1 -1
  52. package/dist/gateway/static/root/assets/{local-app-workbench-page-_9IKMkV8.js → local-app-workbench-page-lHi21M1T.js} +1 -1
  53. package/dist/gateway/static/root/assets/{local-apps-page-D6gejARs.js → local-apps-page-jqthjcQO.js} +1 -1
  54. package/dist/gateway/static/root/assets/local-session-drafts-C4et6msJ.js +1 -0
  55. package/dist/gateway/static/root/assets/{locale-store-DId6-v2R.js → locale-store-CvNO-hbt.js} +1 -1
  56. package/dist/gateway/static/root/assets/{logs-page--t8d-oLb.js → logs-page-CH7W-dm5.js} +1 -1
  57. package/dist/gateway/static/root/assets/{management-settings-DVDmXzTg.js → management-settings-DVgI_KNm.js} +1 -1
  58. package/dist/gateway/static/root/assets/{markdown-view-DQZ51j9e.js → markdown-view-DDJlD5jR.js} +1 -1
  59. package/dist/gateway/static/root/assets/{media-plugins-XLewwq2q.js → media-plugins-C25mOgs2.js} +1 -1
  60. package/dist/gateway/static/root/assets/messages-pGa2qMzG.js +3 -0
  61. package/dist/gateway/static/root/assets/models-hub-cache-DzFiL4xV.js +1 -0
  62. package/dist/gateway/static/root/assets/{note-detail-panel-DuZAEfU1.js → note-detail-panel-kyX-n1db.js} +3 -3
  63. package/dist/gateway/static/root/assets/{notes-api-Byt65v3r.js → notes-api-CKLw9vjk.js} +1 -1
  64. package/dist/gateway/static/root/assets/{notes-page-CgWNESGp.js → notes-page-CLZygZlm.js} +1 -1
  65. package/dist/gateway/static/root/assets/{oauth-api-BYsCbyGZ.js → oauth-api-CC5KkSgG.js} +1 -1
  66. package/dist/gateway/static/root/assets/{page-context-capture-button-Z72eiQZn.js → page-context-capture-button-KX9mrcJW.js} +1 -1
  67. package/dist/gateway/static/root/assets/{personal-page-BtMatL9a.js → personal-page-DnXlcJNJ.js} +1 -1
  68. package/dist/gateway/static/root/assets/{product-open-page-w5Hdf0hQ.js → product-open-page-D7pknlCh.js} +1 -1
  69. package/dist/gateway/static/root/assets/{project-detail-page-CP6I3ZCV.js → project-detail-page-DhV9DPj8.js} +1 -1
  70. package/dist/gateway/static/root/assets/{projects-page-DYs6XrrK.js → projects-page-D181xkFw.js} +1 -1
  71. package/dist/gateway/static/root/assets/{registry-api-7F2WNEZC.js → registry-api-CiN49wvk.js} +1 -1
  72. package/dist/gateway/static/root/assets/{remote-access-hub-DjYoYAEw.js → remote-access-hub-CQnBARQW.js} +1 -1
  73. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Qar_DXLv.js → runtime-tools-settings-panel-wZjlSBiM.js} +1 -1
  74. package/dist/gateway/static/root/assets/{scenes-page-BSIcDCa-.js → scenes-page-DWt54veq.js} +1 -1
  75. package/dist/gateway/static/root/assets/{schema-form-C_cJLGgF.js → schema-form-CMB61TV1.js} +1 -1
  76. package/dist/gateway/static/root/assets/secret-input-D93UrW4C.js +1 -0
  77. package/dist/gateway/static/root/assets/{send-session-input-D1oc6BC6.js → send-session-input-jH6MQwdZ.js} +1 -1
  78. package/dist/gateway/static/root/assets/{session-api-N3N37MrR.js → session-api-CW2X7g_U.js} +1 -1
  79. package/dist/gateway/static/root/assets/{session-manager-CMGUwtbN.js → session-manager-BDpdi3lF.js} +2 -2
  80. package/dist/gateway/static/root/assets/{sessions-page-BBV5Z24a.js → sessions-page-DPEdjUdR.js} +1 -1
  81. package/dist/gateway/static/root/assets/settings-advanced-gate-B6WGnTLY.js +1 -0
  82. package/dist/gateway/static/root/assets/{settings-page-F2vGXBw7.js → settings-page-Ch71KQjb.js} +1 -1
  83. package/dist/gateway/static/root/assets/{setup-status-panel-DJxbjUOg.js → setup-status-panel-C7sLy8Hl.js} +1 -1
  84. package/dist/gateway/static/root/assets/{share-link-dialog-TBBGJPfT.js → share-link-dialog-DCSmx-Rl.js} +1 -1
  85. package/dist/gateway/static/root/assets/{share-preview-page-DyRLPsPv.js → share-preview-page-C93IM3QK.js} +1 -1
  86. package/dist/gateway/static/root/assets/{shares-api-DU0fHP2G.js → shares-api-B4rLfG3l.js} +1 -1
  87. package/dist/gateway/static/root/assets/{shares-settings-CJa6FBpP.js → shares-settings-C_6idV8e.js} +1 -1
  88. package/dist/gateway/static/root/assets/{skill-api-C340XD9d.js → skill-api-sKX8SSlQ.js} +1 -1
  89. package/dist/gateway/static/root/assets/{skill-reload-api-ClyFqHk7.js → skill-reload-api-Ro-s69NW.js} +1 -1
  90. package/dist/gateway/static/root/assets/{skills-page-C4lF94m5.js → skills-page-TsrjLYcI.js} +1 -1
  91. package/dist/gateway/static/root/assets/{system-settings-panel-CmJUu3lb.js → system-settings-panel-DIjaUlla.js} +1 -1
  92. package/dist/gateway/static/root/assets/{task-detail-page-De-Rr8W6.js → task-detail-page-B4Lby289.js} +1 -1
  93. package/dist/gateway/static/root/assets/{theme-store-OhcbFEUR.js → theme-store-DbRLBHVY.js} +1 -1
  94. package/dist/gateway/static/root/assets/tracing-settings-page-IgY26AYH.js +1 -0
  95. package/dist/gateway/static/root/assets/{tunnel-api-Bl4nrCuE.js → tunnel-api-CgARwbus.js} +1 -1
  96. package/dist/gateway/static/root/assets/{usage-page-QZEAaa8n.js → usage-page-CKju62Cm.js} +1 -1
  97. package/dist/gateway/static/root/assets/{use-autosave-veoM0dHn.js → use-autosave-C889OTsP.js} +1 -1
  98. package/dist/gateway/static/root/assets/{use-composer-attachments-DB0bBGzZ.js → use-composer-attachments-Dlm9EFTO.js} +1 -1
  99. package/dist/gateway/static/root/assets/{use-file-preview-expanded-Bope6MW6.js → use-file-preview-expanded-BOpcSApw.js} +2 -2
  100. package/dist/gateway/static/root/assets/{user-model-page-Crh2oNpZ.js → user-model-page-CTkCLRhE.js} +1 -1
  101. package/dist/gateway/static/root/assets/{voice-api-key-field-CwD6a3KQ.js → voice-api-key-field-evWflGY6.js} +1 -1
  102. package/dist/gateway/static/root/assets/{voice-config-api-Daexehmc.js → voice-config-api-CZoV2Lt4.js} +1 -1
  103. package/dist/gateway/static/root/assets/{work-discovery-overlay-9jnjEAaz.js → work-discovery-overlay-B2-2F39_.js} +1 -1
  104. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BAcPxdcT.js → workflow-run-setup-panel-cOGM8Nug.js} +1 -1
  105. package/dist/gateway/static/root/assets/{workflows-page-D8Zm-ooa.js → workflows-page-Csk8xrRk.js} +1 -1
  106. package/dist/gateway/static/root/assets/{workspace-api-Cs4sjV2A.js → workspace-api-B9M9ECTB.js} +2 -2
  107. package/dist/gateway/static/root/index.html +28 -28
  108. package/dist/package.js +1 -1
  109. package/dist/packages/gateway-contract/src/session-input-command.js +1 -0
  110. package/dist/src/agent/agent-manager.d.ts +1 -0
  111. package/dist/src/agent/agent-manager.js +34 -2
  112. package/dist/src/agent/context/execution-context.js +1 -1
  113. package/dist/src/agent/context/project-context.js +4 -4
  114. package/dist/src/agent/embedded/run-for-session.js +1 -1
  115. package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
  116. package/dist/src/agent/prompt/voice-presentation.d.ts +1 -1
  117. package/dist/src/agent/prompt/voice-presentation.js +1 -1
  118. package/dist/src/agent/service/direct-turn-helpers.js +17 -1
  119. package/dist/src/agent/service.js +2 -2
  120. package/dist/src/agent/tools/delegation-parent-policy.js +2 -0
  121. package/dist/src/agent/tools/delegation-policy.js +2 -0
  122. package/dist/src/agent/tools/factory.d.ts +2 -0
  123. package/dist/src/agent/tools/factory.js +26 -4
  124. package/dist/src/agent/tools/index.d.ts +2 -2
  125. package/dist/src/agent/tools/index.js +3 -3
  126. package/dist/src/agent/tools/knowledge-memory-tool.d.ts +2 -0
  127. package/dist/src/agent/tools/knowledge-memory-tool.js +60 -1
  128. package/dist/src/agent/tools/personal-task-tool.d.ts +12 -8
  129. package/dist/src/agent/tools/personal-task-tool.js +35 -41
  130. package/dist/src/agent/tools/user-context-tool.d.ts +2 -0
  131. package/dist/src/agent/tools/user-context-tool.js +61 -2
  132. package/dist/src/agent-catalog/repository.d.ts +1 -0
  133. package/dist/src/agent-catalog/repository.js +3 -0
  134. package/dist/src/chat-commands/personal-command-policy.d.ts +2 -0
  135. package/dist/src/chat-commands/personal-command-policy.js +9 -0
  136. package/dist/src/chat-commands/registry.js +6 -0
  137. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  138. package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
  139. package/dist/src/gateway/hono/routes/observability.js +8 -0
  140. package/dist/src/gateway/hono/routes/projects.js +1 -1
  141. package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -0
  142. package/dist/src/gateway/hono/routes/session-input-handler.js +8 -0
  143. package/dist/src/gateway/hono/routes/sessions.js +1 -1
  144. package/dist/src/gateway/hono/routes/voice.js +1 -1
  145. package/dist/src/gateway/service/agent-runner.d.ts +1 -0
  146. package/dist/src/gateway/service/agent-runner.js +12 -1
  147. package/dist/src/gateway/service/run-gateway-agent.d.ts +1 -0
  148. package/dist/src/gateway/service/run-gateway-agent.js +15 -0
  149. package/dist/src/gateway/service/session-command-service.js +5 -3
  150. package/dist/src/gateway/service/session-input-coordinator.d.ts +12 -0
  151. package/dist/src/gateway/service/session-input-coordinator.js +63 -5
  152. package/dist/src/gateway/service/sessions-api.js +1 -1
  153. package/dist/src/gateway/service.d.ts +2 -0
  154. package/dist/src/gateway/service.js +28 -14
  155. package/dist/src/gateway/session-context-summary.js +1 -1
  156. package/dist/src/gateway/session-reset-service.js +1 -1
  157. package/dist/src/home-intelligence/host.js +2 -2
  158. package/dist/src/local-apps/service.js +1 -1
  159. package/dist/src/personal-agent/capability-service.js +3 -2
  160. package/dist/src/personal-agent/communication.d.ts +3 -2
  161. package/dist/src/personal-agent/communication.js +5 -4
  162. package/dist/src/personal-agent/conversation-state.d.ts +5 -0
  163. package/dist/src/personal-agent/conversation-state.js +17 -0
  164. package/dist/src/personal-agent/persona.d.ts +6 -0
  165. package/dist/src/personal-agent/persona.js +16 -0
  166. package/dist/src/personal-agent/policy.d.ts +3 -1
  167. package/dist/src/personal-agent/policy.js +26 -6
  168. package/dist/src/personal-agent/prompt-context.d.ts +10 -0
  169. package/dist/src/personal-agent/prompt-context.js +119 -0
  170. package/dist/src/personal-agent/prompts.d.ts +7 -0
  171. package/dist/src/personal-agent/prompts.js +124 -0
  172. package/dist/src/personal-agent/reply-composer.d.ts +22 -0
  173. package/dist/src/personal-agent/reply-composer.js +304 -0
  174. package/dist/src/personal-agent/reply-style.d.ts +2 -0
  175. package/dist/src/personal-agent/reply-style.js +14 -0
  176. package/dist/src/personal-agent/repository.d.ts +1 -1
  177. package/dist/src/personal-agent/repository.js +1 -1
  178. package/dist/src/personal-agent/request-delivery.d.ts +1 -1
  179. package/dist/src/personal-agent/request-delivery.js +18 -4
  180. package/dist/src/personal-agent/request-service.js +3 -3
  181. package/dist/src/personal-agent/service.d.ts +1 -2
  182. package/dist/src/personal-agent/service.js +4 -84
  183. package/dist/src/personal-agent/specialist-capabilities.d.ts +9 -0
  184. package/dist/src/personal-agent/specialist-capabilities.js +37 -0
  185. package/dist/src/session/init-session-turn.js +10 -0
  186. package/dist/src/session/store.js +1 -1
  187. package/dist/src/storage/sqlite/migrations/234_task_result_reply.sql +14 -0
  188. package/dist/src/storage/sqlite/migrations/235_personal_conversation_priority.sql +3 -0
  189. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  190. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  191. package/dist/src/storage/sqlite/schema.js +1 -1
  192. package/dist/src/storage/sqlite/session-input-repository.d.ts +2 -0
  193. package/dist/src/storage/sqlite/session-input-repository.js +18 -5
  194. package/dist/src/tasks/execution-context.js +1 -1
  195. package/dist/src/tasks/task-main-update-decision-service.js +1 -1
  196. package/dist/src/tasks/task-result-delivery-service.js +20 -4
  197. package/dist/src/voice/realtime/agentBroker.js +11 -2
  198. package/dist/src/voice/realtime/agentEngine.js +50 -17
  199. package/dist/src/voice/realtime/engine.d.ts +1 -0
  200. package/dist/src/voice/realtime/omniEngine.d.ts +1 -0
  201. package/dist/src/voice/realtime/omniEngine.js +21 -2
  202. package/dist/src/voice/realtime/playback-echo.d.ts +7 -0
  203. package/dist/src/voice/realtime/playback-echo.js +23 -1
  204. package/dist/src/voice/realtime/runtime.d.ts +1 -0
  205. package/dist/src/voice/realtime/runtime.js +5 -0
  206. package/dist/src/voice/realtime/runtime.types.d.ts +2 -0
  207. package/dist/src/work-discovery/service.js +1 -1
  208. package/dist/src/workflows/service/workflow-run-service.js +1 -1
  209. package/package.json +4 -4
  210. package/dist/gateway/static/root/assets/gateway-realtime-store-DBvCRclh.js +0 -1
  211. package/dist/gateway/static/root/assets/index-BYNmHn-z.js +0 -106
  212. package/dist/gateway/static/root/assets/local-session-drafts-gbemPamv.js +0 -1
  213. package/dist/gateway/static/root/assets/messages-BHvpZNe9.js +0 -3
  214. package/dist/gateway/static/root/assets/models-hub-cache-B9SKjidc.js +0 -1
  215. package/dist/gateway/static/root/assets/secret-input-DPl3VYM8.js +0 -1
  216. package/dist/gateway/static/root/assets/settings-advanced-gate-DRc9IDJf.js +0 -1
  217. package/dist/gateway/static/root/assets/tracing-settings-page-DoBJ0TYY.js +0 -1
@@ -34,11 +34,16 @@ function contextRefsMatchFrozenSnapshot(requested, frozen) {
34
34
  });
35
35
  }
36
36
  var SessionInputCoordinator = class {
37
+ pendingSubmissions = /* @__PURE__ */ new Map();
38
+ resumeAfter = /* @__PURE__ */ new Map();
37
39
  draining = /* @__PURE__ */ new Set();
38
40
  submissionTails = /* @__PURE__ */ new Map();
39
41
  constructor(deps) {
40
42
  this.deps = deps;
41
43
  }
44
+ isAcceptingInput(conversationId) {
45
+ return (this.pendingSubmissions.get(conversationId) ?? 0) > 0;
46
+ }
42
47
  snapshot(conversationId) {
43
48
  return getSessionInputState(conversationId);
44
49
  }
@@ -52,6 +57,7 @@ var SessionInputCoordinator = class {
52
57
  content: input.content.trim(),
53
58
  attachments,
54
59
  contextRefs: contexts.map(summarizeSourceContext),
60
+ interruptRequested: input.interrupt !== false && this.deps.prioritizeInput?.(input) === true,
55
61
  contextSnapshots: contexts,
56
62
  thinking: input.thinking,
57
63
  origin: input.origin
@@ -63,7 +69,12 @@ var SessionInputCoordinator = class {
63
69
  await this.runSubmissionExclusive(input.conversationId, async () => {
64
70
  const row = getSessionInputById(conversationId, inputId);
65
71
  const state = this.snapshot(input.conversationId);
66
- if (!row || row.status !== "queued" || row.requestedDelivery !== "steer" || !state.activeRunId || row.attachments?.length || row.contextSnapshots?.length || state.preparation && state.preparation.state !== "ready") return;
72
+ if (!row || row.status !== "queued") return;
73
+ if (row.interruptRequested) {
74
+ this.prioritizeAcceptedInput(row, state);
75
+ return;
76
+ }
77
+ if (row.requestedDelivery !== "steer" || !state.activeRunId || row.attachments?.length || row.contextSnapshots?.length || state.preparation && state.preparation.state !== "ready") return;
67
78
  setSessionInputStatus(row.id, "injecting", {
68
79
  effectiveDelivery: "steer",
69
80
  targetRunId: state.activeRunId
@@ -83,6 +94,26 @@ var SessionInputCoordinator = class {
83
94
  this.publish(row.conversationId);
84
95
  });
85
96
  }
97
+ prioritizeAcceptedInput(row, runtime) {
98
+ const conversationId = row.conversationId;
99
+ this.resumeAfter.set(conversationId, Date.now() + (this.deps.coalesceWindowMs ?? 200));
100
+ this.publish(conversationId);
101
+ if (runtime.activeRunId && this.deps.interrupt) {
102
+ this.deps.emit("session.input-interrupt", {
103
+ conversationId,
104
+ runId: runtime.activeRunId,
105
+ inputId: row.id
106
+ });
107
+ this.deps.interrupt(conversationId, runtime.activeRunId).catch((err) => {
108
+ log.warn({
109
+ err,
110
+ conversationId,
111
+ runId: runtime.activeRunId
112
+ }, "Conversation interruption failed; accepted input remains queued");
113
+ });
114
+ }
115
+ this.drain(conversationId);
116
+ }
86
117
  publish(conversationId) {
87
118
  const state = this.snapshot(conversationId);
88
119
  this.deps.emit("session.input-state", state);
@@ -104,15 +135,25 @@ var SessionInputCoordinator = class {
104
135
  if (this.submissionTails.get(conversationId) === tail) this.submissionTails.delete(conversationId);
105
136
  }
106
137
  }
138
+ async withSubmission(conversationId, operation) {
139
+ this.deps.onInputReceived?.(conversationId);
140
+ this.pendingSubmissions.set(conversationId, (this.pendingSubmissions.get(conversationId) ?? 0) + 1);
141
+ try {
142
+ return await operation();
143
+ } finally {
144
+ const remaining = (this.pendingSubmissions.get(conversationId) ?? 1) - 1;
145
+ if (remaining) this.pendingSubmissions.set(conversationId, remaining);
146
+ else this.pendingSubmissions.delete(conversationId);
147
+ }
148
+ }
107
149
  async submit(input) {
108
150
  input = structuredClone(input);
109
151
  const conversationId = input.conversationId.trim();
110
- this.deps.onInputReceived?.(conversationId);
111
152
  try {
112
- return await this.runSubmissionExclusive(conversationId, () => this.submitLocked({
153
+ return await this.withSubmission(conversationId, () => this.runSubmissionExclusive(conversationId, () => this.submitLocked({
113
154
  ...input,
114
155
  conversationId
115
- }));
156
+ })));
116
157
  } catch (error) {
117
158
  if (error instanceof SessionInstanceChangedError) return {
118
159
  ok: false,
@@ -242,7 +283,8 @@ var SessionInputCoordinator = class {
242
283
  };
243
284
  }
244
285
  const runtime = this.snapshot(conversationId);
245
- const canSteer = input.delivery === "steer" && runtime.activeRunId !== void 0 && !attachments?.length && !sourceContexts?.length;
286
+ const priority = input.interrupt !== false && this.deps.prioritizeInput?.(input) === true;
287
+ const canSteer = !priority && input.delivery === "steer" && runtime.activeRunId !== void 0 && !attachments?.length && !sourceContexts?.length;
246
288
  const effectiveDelivery = canSteer ? "steer" : "next";
247
289
  const row = insertSessionInput({
248
290
  expectedTranscriptId: input.expectedTranscriptId,
@@ -250,6 +292,7 @@ var SessionInputCoordinator = class {
250
292
  conversationId,
251
293
  clientMessageId,
252
294
  requestedDelivery: input.delivery,
295
+ interruptRequested: priority,
253
296
  effectiveDelivery,
254
297
  status: canSteer ? "injecting" : "queued",
255
298
  content,
@@ -262,6 +305,14 @@ var SessionInputCoordinator = class {
262
305
  });
263
306
  invalidateConnectionResumeIntent(conversationId);
264
307
  supersedeActiveClarification(conversationId);
308
+ if (priority) {
309
+ this.prioritizeAcceptedInput(row, runtime);
310
+ return {
311
+ ok: true,
312
+ effectiveDelivery: "next",
313
+ state: this.publish(conversationId)
314
+ };
315
+ }
265
316
  if (canSteer) {
266
317
  if (!await this.deps.steer(conversationId, content)) {
267
318
  setSessionInputStatus(row.id, "queued", {
@@ -293,6 +344,12 @@ var SessionInputCoordinator = class {
293
344
  this.draining.add(conversationId);
294
345
  try {
295
346
  while (true) {
347
+ const delay = (this.resumeAfter.get(conversationId) ?? 0) - Date.now();
348
+ if (delay > 0) {
349
+ await new Promise((resolve) => setTimeout(resolve, delay));
350
+ continue;
351
+ }
352
+ this.resumeAfter.delete(conversationId);
296
353
  const runId = crypto.randomUUID();
297
354
  const input = claimNextSessionInput(conversationId, runId);
298
355
  if (!input) return;
@@ -320,6 +377,7 @@ var SessionInputCoordinator = class {
320
377
  let result;
321
378
  try {
322
379
  result = await this.deps.execute({
380
+ inputReceivedAtMs: input.createdAtMs,
323
381
  runId,
324
382
  taskRunId: input.taskRunId,
325
383
  conversationId,
@@ -1,8 +1,8 @@
1
1
  import { init_agent_session_key, resolveAgentIdFromConversationId } from "../../routing/agent-session-key.js";
2
+ import { isPersonalConversation } from "../../personal-agent/repository.js";
2
3
  import { retireSessionMcpRuntimeForConversationId } from "../../agent/mcp/bundle-mcp-runtime.js";
3
4
  import { buildSessionTimeline } from "../../session/transcript-outline.js";
4
5
  import { transcriptRowsToClientHistory } from "../../session/client-history.js";
5
- import { isPersonalConversation } from "../../personal-agent/repository.js";
6
6
  import "../../agent/mcp/bundle-mcp-tools.js";
7
7
  import { collectMediaUrisFromValues, deleteMediaUris } from "../../media/session-references.js";
8
8
  import { withModelConfigLock } from "../../session/model-config-lock.js";
@@ -151,6 +151,7 @@ export declare class GatewayService {
151
151
  ok: false;
152
152
  code: "BAD_REQUEST" | "QUEUE_FULL" | "CONTEXT_UNAVAILABLE" | "SESSION_CHANGED";
153
153
  }>;
154
+ withSessionInputSubmission<T>(conversationId: string, operation: () => Promise<T>): Promise<T>;
154
155
  prepareSessionCommandInput(input: Parameters<GatewayAgentRunner['inputs']['prepareInput']>[0]): Promise<{
155
156
  status: "queued";
156
157
  requestedDelivery: import("../storage/sqlite/session-input-repository.js").SessionInputDelivery;
@@ -158,6 +159,7 @@ export declare class GatewayService {
158
159
  content: string;
159
160
  attachments: import("./user-turn-input.js").UserTurnAttachment[];
160
161
  contextRefs: import("../agent/source-context/types.js").SourceContextRefSummary[];
162
+ interruptRequested: boolean;
161
163
  contextSnapshots: import("../agent/source-context/types.js").AgentSourceContext[];
162
164
  thinking: string;
163
165
  origin: {
@@ -8,7 +8,7 @@ import { init_logger } from "../utils/logger.js";
8
8
  import { closeXopcDatabase } from "../storage/sqlite/connection.js";
9
9
  import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
10
10
  import { getBrowserTabBindingById, init_browser_tab_binding_repository } from "../storage/sqlite/browser-tab-binding-repository.js";
11
- import { findSessionInput, init_session_input_repository, insertSessionInput } from "../storage/sqlite/session-input-repository.js";
11
+ import { bumpSessionInputRevision, findSessionInput, init_session_input_repository, insertSessionInput } from "../storage/sqlite/session-input-repository.js";
12
12
  import { TaskRepository } from "../tasks/task-repository.js";
13
13
  import { TaskRunRepository, init_task_run_repository } from "../tasks/task-run-repository.js";
14
14
  import { init_changes, notifyUserContextChange } from "../user-context/changes.js";
@@ -29,9 +29,9 @@ import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.
29
29
  import { prewarmModelRegistry } from "../providers/model-registry.js";
30
30
  import { init_providers, providers_exports } from "../providers/index.js";
31
31
  import { AI_USAGE_RETENTION_MS, markStaleAiUsageEventsUnknown, pruneAiUsageEvents } from "../storage/sqlite/ai-usage-repository.js";
32
- import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
33
32
  import { listKnowledgeItems } from "../knowledge-memory/repository.js";
34
33
  import "../knowledge-memory/index.js";
34
+ import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
35
35
  import { getEmbeddedExecutionSession } from "../agent/embedded/execution-context.js";
36
36
  import { disposeAllSessionMcpRuntimes } from "../agent/mcp/bundle-mcp-runtime.js";
37
37
  import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
@@ -76,20 +76,25 @@ import { ChatPreviewService } from "../chat-previews/service.js";
76
76
  import "../chat-previews/index.js";
77
77
  import { getWorkspacePath } from "../config/workspace-path-helpers.js";
78
78
  import "../config/index.js";
79
- import { ManagedComposioEventPoller } from "../connectors/composio-managed-events.js";
80
- import { startConnectedKnowledgeCoordinator } from "../knowledge/coordinator.js";
81
- import "../knowledge/index.js";
82
- import { ConnectionRecoveryService } from "../connectors/connection-recovery-service.js";
83
- import { startConnectorLearningCoordinator } from "../connectors/learning-coordinator.js";
84
- import { startConnectorSupervisor } from "../connectors/supervisor.js";
85
79
  import { DiscussionService } from "../discussions/service.js";
86
80
  import { DiscussionOrganizer } from "../discussions/organizer.js";
87
81
  import { DiscussionLiveWorker } from "../discussions/live-worker.js";
88
82
  import { DiscussionOrganizerWorker } from "../discussions/organizer-worker.js";
89
83
  import { DiscussionSealer } from "../discussions/sealer.js";
90
84
  import "../discussions/index.js";
85
+ import { ManagedComposioEventPoller } from "../connectors/composio-managed-events.js";
86
+ import { startConnectedKnowledgeCoordinator } from "../knowledge/coordinator.js";
87
+ import "../knowledge/index.js";
88
+ import { PersonalReplyComposer } from "../personal-agent/reply-composer.js";
89
+ import { ConnectionRecoveryService } from "../connectors/connection-recovery-service.js";
90
+ import { startConnectorLearningCoordinator } from "../connectors/learning-coordinator.js";
91
+ import { startConnectorSupervisor } from "../connectors/supervisor.js";
91
92
  import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
92
93
  import "../endpoint-tools/index.js";
94
+ import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
95
+ import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
96
+ import { HomeIntelligenceHost } from "../home-intelligence/host.js";
97
+ import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
93
98
  import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
94
99
  import { prepareAutomationAgentSession } from "./automation-agent-session.js";
95
100
  import { stopTailscaleExposure } from "./tailscale-lifecycle.js";
@@ -152,10 +157,6 @@ import { TaskMainUpdateDecisionService } from "../tasks/task-main-update-decisio
152
157
  import { selectTaskMainUpdateAttempt, submitAndConfirmTaskMainUpdate } from "../tasks/task-main-update-input.js";
153
158
  import { checkAppContextAccess, prepareAppContext } from "./service/app-context-access.js";
154
159
  import { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults } from "../voice/language-profile.js";
155
- import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
156
- import { HomeIntelligenceHost } from "../home-intelligence/host.js";
157
- import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
158
- import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
159
160
  import crypto from "node:crypto";
160
161
  //#region src/gateway/service.ts
161
162
  init_session_repository();
@@ -260,6 +261,9 @@ var GatewayService = class {
260
261
  });
261
262
  this.emit("session.transcript_updated", { key: conversationId });
262
263
  },
264
+ onConversationInput: (conversationId) => {
265
+ bumpSessionInputRevision(getSqliteDatabase(), conversationId);
266
+ },
263
267
  getConfig: () => this.config,
264
268
  sessionExists: async (conversationId) => Boolean(await this.sessionIndex.getSessionMetadata(conversationId)),
265
269
  sessionBusy: (conversationId) => Boolean(this.agentRunner.getActiveRunId(conversationId)) || this.agentRunner.inputs.snapshot(conversationId).inputs.some((input) => input.status === "queued"),
@@ -843,7 +847,7 @@ var GatewayService = class {
843
847
  await new TaskMainUpdateDelivery().drain({
844
848
  isAvailable: (conversationId) => {
845
849
  const state = this.agentRunner.inputs.snapshot(conversationId);
846
- return !state.activeRunId && state.inputs.every((item) => item.status === "interrupted") && (!this.voiceRealtime.hasConversation(conversationId) || this.voiceRealtime.canOfferTaskUpdate(conversationId));
850
+ return !this.agentRunner.inputs.isAcceptingInput(conversationId) && !state.activeRunId && state.inputs.every((item) => item.status === "interrupted") && (!this.voiceRealtime.hasConversation(conversationId) || this.voiceRealtime.canOfferTaskUpdate(conversationId));
847
851
  },
848
852
  decide: (input) => new TaskMainUpdateDecisionService({
849
853
  getModelRef: (conversationId) => this.ensureAgentService().getModelForSession(conversationId),
@@ -884,7 +888,7 @@ var GatewayService = class {
884
888
  }, `Main Agent update dispatch failed: ${errorMessage}`);
885
889
  });
886
890
  taskResultDispatch = createBackgroundTask(async () => {
887
- await new TaskResultDeliveryService().drain((conversationId, deliveryId) => {
891
+ const notify = (conversationId, deliveryId) => {
888
892
  this.realtime.broker.publish("sessions", "session.task-result", {
889
893
  conversationId,
890
894
  deliveryId
@@ -893,6 +897,13 @@ var GatewayService = class {
893
897
  key: conversationId,
894
898
  deliveryId
895
899
  });
900
+ };
901
+ await new TaskResultDeliveryService().drain(notify);
902
+ new PersonalReplyComposer().drain(notify, (conversationId) => !this.agentRunner.hasActiveRun(conversationId) && !this.agentRunner.inputs.isAcceptingInput(conversationId) && (!this.voiceRealtime.hasConversation(conversationId) || this.voiceRealtime.canPublishReply(conversationId))).catch((err) => {
903
+ log.error({
904
+ err,
905
+ phase: "task_result_reply"
906
+ }, "Task result reply delivery failed");
896
907
  });
897
908
  }, (err) => {
898
909
  log.error({
@@ -997,6 +1008,9 @@ var GatewayService = class {
997
1008
  submitSessionInput(...args) {
998
1009
  return this.agentRunner.submitSessionInput(...args);
999
1010
  }
1011
+ withSessionInputSubmission(conversationId, operation) {
1012
+ return this.agentRunner.inputs.withSubmission(conversationId, operation);
1013
+ }
1000
1014
  prepareSessionCommandInput(input) {
1001
1015
  return this.agentRunner.inputs.prepareInput(input);
1002
1016
  }
@@ -6,10 +6,10 @@ import { TaskRepository, init_task_repository } from "../tasks/task-repository.j
6
6
  import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
7
7
  import { getCurrentTranscriptId, init_session_repository } from "../storage/sqlite/session-repository.js";
8
8
  import { getSessionConfig, init_config_repository } from "../storage/sqlite/config-repository.js";
9
- import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
10
9
  import { getExecutionEnvironmentForSession } from "../execution-environments/subject.js";
11
10
  import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
12
11
  import { ProjectStore } from "../projects/project-store.js";
12
+ import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
13
13
  import { runExec } from "../infra/exec.js";
14
14
  import { TaskCollaborationRepository } from "../tasks/task-collaboration-repository.js";
15
15
  import { TaskOriginRepository } from "../tasks/task-origin-repository.js";
@@ -1,8 +1,8 @@
1
1
  import { createLogger } from "../utils/logger/index.js";
2
2
  import { init_logger } from "../utils/logger.js";
3
+ import { isPersonalConversation } from "../personal-agent/repository.js";
3
4
  import { retireSessionMcpRuntimeForConversationId } from "../agent/mcp/bundle-mcp-runtime.js";
4
5
  import { abortEmbeddedRun } from "../agent/embedded/runs.js";
5
- import { isPersonalConversation } from "../personal-agent/repository.js";
6
6
  import "../agent/mcp/bundle-mcp-tools.js";
7
7
  //#region src/gateway/session-reset-service.ts
8
8
  init_logger();
@@ -1,10 +1,10 @@
1
1
  import { createLogger } from "../utils/logger/index.js";
2
2
  import { init_logger } from "../utils/logger.js";
3
- import { HomeAdviceBudgetExceededError } from "./generator.js";
4
3
  import { homePatternKey } from "./strategy.js";
5
- import { HomeAdvicePolicy } from "./policy.js";
6
4
  import { HomeIntelligenceRepository } from "./repository.js";
7
5
  import { HomeOpportunityApplicationService } from "./application-service.js";
6
+ import { HomeAdvicePolicy } from "./policy.js";
7
+ import { HomeAdviceBudgetExceededError } from "./generator.js";
8
8
  import { buildHomeOpportunityNotification } from "./notification.js";
9
9
  import { createHash } from "node:crypto";
10
10
  //#region src/home-intelligence/host.ts
@@ -6,8 +6,8 @@ import { afterSqliteCommit, init_transaction, runSqliteWriteTransaction } from "
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";
8
8
  import { init_paths, resolveExtensionsDir } from "../config/paths.js";
9
- import { LocalAppStore } from "./store.js";
10
9
  import { slugifyProjectName } from "../projects/project-store.js";
10
+ import { LocalAppStore } from "./store.js";
11
11
  import { CapabilityError } from "../capabilities/runtime/errors.js";
12
12
  import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
13
13
  import { validateLocalAppCapabilityContracts } from "./capabilities/contracts.js";
@@ -2,11 +2,12 @@ import { getConnectorInstallation, init_connector_repository, listConnectorConne
2
2
  import { resolveEffectiveAgentConfig } from "../agent-config/resolver.js";
3
3
  import { init_agent_config } from "../agent-config/index.js";
4
4
  import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
5
+ import { isPersonalConversation } from "./repository.js";
6
+ import { getAvailablePersonalAgentTools, personalAgentModelAvailability } from "./specialist-capabilities.js";
5
7
  import { canAccessConnectorAccount, currentAccountConnections } from "../connectors/account-access.js";
6
8
  import { connectorPrincipalForSession } from "../connectors/principal.js";
7
9
  import { connectionCandidates, resolveConnectionCandidate } from "../connectors/connection-candidates.js";
8
- import { isPersonalConversation } from "./repository.js";
9
- import { getAvailablePersonalAgentTools, personalAgentModelAvailability } from "../agent/tools/personal-task-tool.js";
10
+ import "../agent/tools/personal-task-tool.js";
10
11
  //#region src/personal-agent/capability-service.ts
11
12
  init_repository();
12
13
  init_agent_config();
@@ -1,4 +1,5 @@
1
- export declare const 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.";
1
+ export { PERSONAL_PERSONA_GUIDANCE } from './persona.js';
2
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 preference can be saved with personal_preference. Preserve unrelated preferences. 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."];
3
- export declare const PERSONAL_COMMUNICATION_RULES: readonly ["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.", "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.", "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.", "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. Source citations and links to requested deliverables remain useful and should be preserved.", "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.", "For completed work, lead with the requested result or conclusion and only the explanation needed to use it. Keep relevant evidence, sources, 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."];
3
+ export declare const 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. Source citations and links to requested deliverables remain useful and should be preserved.", "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.", "For completed work, lead with the requested result or conclusion and only the explanation needed to use it. Keep relevant evidence, sources, 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
4
  export declare const PERSONAL_WORKER_RESULT_GUIDANCE: string;
5
+ 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,5 +1,5 @@
1
+ import { PERSONAL_PERSONA_GUIDANCE } from "./persona.js";
1
2
  //#region src/personal-agent/communication.ts
2
- const 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
3
  const PERSONAL_RELIABILITY_RULES = [
4
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.",
5
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.",
@@ -9,7 +9,7 @@ const PERSONAL_RELIABILITY_RULES = [
9
9
  const PERSONAL_COMMUNICATION_RULES = [
10
10
  PERSONAL_PERSONA_GUIDANCE,
11
11
  "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.",
12
- "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.",
12
+ "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.",
13
13
  "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. Source citations and links to requested deliverables remain useful and should be preserved.",
14
14
  "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.",
15
15
  "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,8 +17,9 @@ const PERSONAL_COMMUNICATION_RULES = [
17
17
  ];
18
18
  const PERSONAL_WORKER_RESULT_GUIDANCE = [
19
19
  "## Result for the originating conversation",
20
- "Your result is delivered directly to the user in their main conversation. Match the user’s language and requested depth. Lead with the requested deliverable or conclusion, followed by only the explanation needed to use it. Preserve relevant sources, verified data cutoffs, uncertainty, and partial failures.",
20
+ "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.",
21
21
  "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."
22
22
  ].join("\n");
23
+ 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.";
23
24
  //#endregion
24
- export { PERSONAL_COMMUNICATION_RULES, PERSONAL_PERSONA_GUIDANCE, PERSONAL_RELIABILITY_RULES, PERSONAL_WORKER_RESULT_GUIDANCE };
25
+ export { PERSONAL_COMMUNICATION_RULES, PERSONAL_PERSONA_GUIDANCE, PERSONAL_PREVIOUS_DELEGATION_COMMUNICATION, PERSONAL_RELIABILITY_RULES, PERSONAL_WORKER_RESULT_GUIDANCE };
@@ -0,0 +1,5 @@
1
+ /** A conversation revision also changes when foreground work finishes, invalidating old-context drafts. */
2
+ export declare function personalConversationState(conversationId: string): {
3
+ revision: number;
4
+ idle: boolean;
5
+ };
@@ -0,0 +1,17 @@
1
+ import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
2
+ //#region src/personal-agent/conversation-state.ts
3
+ init_transaction();
4
+ /** A conversation revision also changes when foreground work finishes, invalidating old-context drafts. */
5
+ function personalConversationState(conversationId) {
6
+ const db = getSqliteDatabase();
7
+ const runtime = db.prepare("SELECT revision, active_run_id FROM session_input_runtime WHERE conversation_id = ?").get(conversationId);
8
+ const pending = db.prepare(`SELECT 1 FROM session_inputs WHERE conversation_id = ?
9
+ AND status IN ('queued','running','injecting') LIMIT 1`).get(conversationId);
10
+ const preparation = db.prepare("SELECT state FROM session_preparations WHERE conversation_id = ?").get(conversationId);
11
+ return {
12
+ revision: runtime?.revision ?? 0,
13
+ idle: !runtime?.active_run_id && !pending && (!preparation || preparation.state === "ready")
14
+ };
15
+ }
16
+ //#endregion
17
+ export { personalConversationState };
@@ -0,0 +1,6 @@
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
+ export declare const PERSONAL_PERSONA_GUIDANCE: string;
3
+ 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 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.";
@@ -0,0 +1,16 @@
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
+ const PERSONAL_PERSONA_GUIDANCE = [
4
+ "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
+ "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.",
6
+ "Express warmth, curiosity, appreciation, concern, and humor naturally when the moment supports them. Do not suppress emotional expression merely to sound professional. Acknowledge a specific difficulty or share in a milestone before moving on when that fits. Avoid formulaic empathy, exaggerated intimacy, constant praise, and forced jokes; warmth does not require an emotional opening on every reply.",
7
+ "Adapt to the user while retaining your character. Be steady when they are frustrated, serious when stakes are high, and playful when welcome. Respect explicit preferences, including requests for a reserved tone or no humor. Disagree kindly and explain your view when useful; never change facts just to comfort or please the user.",
8
+ "Build continuity through relevant shared context: remember what matters to the user and pick up ongoing work naturally when supported by available context. Do not invent memories, display unrelated personal details, or repeatedly announce that you remember. A passing mood is not a lasting identity or permission to save a preference.",
9
+ "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
+ ].join("\n");
11
+ 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 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
+ //#endregion
16
+ 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 };
@@ -1 +1,3 @@
1
- export declare const PERSONAL_MAIN_TOOL_IDS: readonly ["personal_task", "personal_capability", "personal_request", "personal_preference", "session_recall", "read_media", "read_file", "session_search", "personal_read", "user_context_search", "user_context_get", "knowledge_search", "knowledge_get", "clarify"];
1
+ export declare const PERSONAL_MAIN_TOOL_IDS: readonly ["personal_task", "personal_capability", "personal_request", "personal_preference", "session_recall", "read_media", "read_file", "session_search", "personal_read", "user_context_read", "knowledge_read"];
2
+ export declare const PERSONAL_TOOL_DESCRIPTIONS: Readonly<Record<string, string>>;
3
+ export declare const PERSONAL_READ_TOOL_ALIASES: Readonly<Record<string, string>>;
@@ -9,11 +9,31 @@ const PERSONAL_MAIN_TOOL_IDS = [
9
9
  "read_file",
10
10
  "session_search",
11
11
  "personal_read",
12
- "user_context_search",
13
- "user_context_get",
14
- "knowledge_search",
15
- "knowledge_get",
16
- "clarify"
12
+ "user_context_read",
13
+ "knowledge_read"
17
14
  ];
15
+ const PERSONAL_TOOL_DESCRIPTIONS = {
16
+ personal_task: "Choose from the injected specialist snapshot; discover only when missing or after failure. Delegate work, inspect own Tasks, send instructions or answer worker questions. Use an available Agent. Announce intent before discovery; claim success only after confirmation.",
17
+ personal_capability: "Check verified app connection and specialist availability before connected-app work.",
18
+ personal_request: "Submit, inspect or cancel connected-app requests. Submit using the connectorId and agentId returned by personal_capability.",
19
+ personal_preference: "Save only explicitly requested lasting response preferences.",
20
+ session_recall: "Find exact facts in this conversation, including compacted history. Cannot access other chats.",
21
+ session_search: "Search other chats locally for short matching excerpts. No model or network calls.",
22
+ read_media: "Read an uploaded media:// attachment. Large or binary material requires a specialist.",
23
+ read_file: "Read an explicit workspace file. Output is bounded; delegate when requiresSpecialist is true.",
24
+ personal_read: "Read local notes, projects or automation state with list/get. Bounded output; no network or model calls.",
25
+ user_context_read: "Search saved user facts with command=search; read a result with command=get. Bounded local output.",
26
+ knowledge_read: "Search scoped local facts and decisions with command=search; read a result with command=get.",
27
+ user_context_search: "Search saved user identity, preferences, routines and current state.",
28
+ user_context_get: "Read a user assertion returned by user_context_search.",
29
+ knowledge_search: "Search local project, workspace and session facts, decisions and commitments.",
30
+ knowledge_get: "Read a knowledge item returned by knowledge_search."
31
+ };
32
+ const PERSONAL_READ_TOOL_ALIASES = {
33
+ user_context_search: "user_context_read",
34
+ user_context_get: "user_context_read",
35
+ knowledge_search: "knowledge_read",
36
+ knowledge_get: "knowledge_read"
37
+ };
18
38
  //#endregion
19
- export { PERSONAL_MAIN_TOOL_IDS };
39
+ export { PERSONAL_MAIN_TOOL_IDS, PERSONAL_READ_TOOL_ALIASES, PERSONAL_TOOL_DESCRIPTIONS };
@@ -0,0 +1,10 @@
1
+ import type { Config } from '../config/schema.js';
2
+ /** Keep complete JSON records and identifiers, even when the snapshot is incomplete. */
3
+ export declare function packPersonalSnapshot(rows: unknown[], budget: number): string;
4
+ /** Local revision cache; permissions and provider availability are checked on every read. */
5
+ export declare class PersonalPromptContext {
6
+ private database?;
7
+ private revision?;
8
+ private specialists?;
9
+ build(config: Config | undefined, conversationId: string): string | undefined;
10
+ }