@xopcai/xopc 0.0.383 → 0.0.384

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 (492) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
  3. package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
  4. package/dist/extensions/telegram/src/inbound-processor.js +2 -2
  5. package/dist/extensions/telegram/src/outbound-sender.js +1 -1
  6. package/dist/extensions/telegram/src/plugin.js +2 -2
  7. package/dist/extensions/telegram/xopc.extension.json +1 -1
  8. package/dist/extensions/weixin/src/api/api.js +2 -2
  9. package/dist/extensions/weixin/src/auth/accounts.js +12 -12
  10. package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
  11. package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
  12. package/dist/gateway/static/root/assets/{activity-store-qv0XyrXk.js → activity-store-CB2X4Gmu.js} +1 -1
  13. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-66HwhyEK.js → agent-avatar-dicebear-BSel9yf8.js} +1 -1
  14. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DgHMyhuY.js +1 -0
  15. package/dist/gateway/static/root/assets/{agent-plugin-dialog-CebTVaRM.js → agent-plugin-dialog-BosuN4dO.js} +1 -1
  16. package/dist/gateway/static/root/assets/agents-B-pw5RKI.js +77 -0
  17. package/dist/gateway/static/root/assets/{agents-admin-api-BGy9IvSr.js → agents-admin-api-BkULgC6Q.js} +1 -1
  18. package/dist/gateway/static/root/assets/{app-management-settings-panel-BKaU6sGT.js → app-management-settings-panel-DuOqKkfH.js} +1 -1
  19. package/dist/gateway/static/root/assets/{appearance-settings-E5WFcCdZ.js → appearance-settings-8JF9rXFr.js} +1 -1
  20. package/dist/gateway/static/root/assets/{apps-page-CExfOhRj.js → apps-page-Cuclpk0A.js} +1 -1
  21. package/dist/gateway/static/root/assets/{archive-plugin-BvhxzyLJ.js → archive-plugin-De0ND0oA.js} +1 -1
  22. package/dist/gateway/static/root/assets/{automations-page-CWcNFzvK.js → automations-page-D7NwNy2I.js} +1 -1
  23. package/dist/gateway/static/root/assets/automations-workspace-CSxW4wX0.js +6 -0
  24. package/dist/gateway/static/root/assets/{binary-plugins-CD0gYKR2.js → binary-plugins-Do535ZGW.js} +1 -1
  25. package/dist/gateway/static/root/assets/{block-editor-CBVXeGAt.js → block-editor-Dnb7CH_l.js} +2 -2
  26. package/dist/gateway/static/root/assets/{browser-automation-inputs-B-Qz_411.js → browser-automation-inputs-B9M1RYTm.js} +1 -1
  27. package/dist/gateway/static/root/assets/browser-automations-page-GBgDe21o.js +3 -0
  28. package/dist/gateway/static/root/assets/browser-settings-page-B2FXaO3n.js +3 -0
  29. package/dist/gateway/static/root/assets/{capabilities-w2GUuF7V.js → capabilities-2Do3eKMM.js} +1 -1
  30. package/dist/gateway/static/root/assets/{capabilities-CaL5RDm3.js → capabilities-XFwwUNU3.js} +1 -1
  31. package/dist/gateway/static/root/assets/capabilities-page-f2-MquJn.js +2 -0
  32. package/dist/gateway/static/root/assets/{capabilities-settings-panel-CIvwbZps.js → capabilities-settings-panel-D9F0mw16.js} +6 -6
  33. package/dist/gateway/static/root/assets/{capability-header-actions-DKaZAOWW.js → capability-header-actions-DVRxJPQP.js} +1 -1
  34. package/dist/gateway/static/root/assets/{channels-D82wgP8A.js → channels-CnDm5T1t.js} +1 -1
  35. package/dist/gateway/static/root/assets/{chat-terminal-dock-DuqWzcEq.js → chat-terminal-dock-BxSCDbK7.js} +2 -2
  36. package/dist/gateway/static/root/assets/{computer-settings-page-BiM0fCvO.js → computer-settings-page-DVAB-kQw.js} +1 -1
  37. package/dist/gateway/static/root/assets/{connector-service-page-o8kuXjVt.js → connector-service-page-D2EeLXei.js} +1 -1
  38. package/dist/gateway/static/root/assets/connectors-page-DK9n4hgZ.js +1 -0
  39. package/dist/gateway/static/root/assets/{date-picker-5tzjG3n1.js → date-picker-Cl9KfFj8.js} +1 -1
  40. package/dist/gateway/static/root/assets/{dependency-picker-DLcDUyep.js → dependency-picker-Ei6aX5WM.js} +1 -1
  41. package/dist/gateway/static/root/assets/{desktop-pet-D-w8487x.js → desktop-pet-4Evl4RKX.js} +1 -1
  42. package/dist/gateway/static/root/assets/{desktop-pet-settings-D-w7uF8Q.js → desktop-pet-settings-DAD_OWcX.js} +1 -1
  43. package/dist/gateway/static/root/assets/device-pairing-wizard-BA21epMn.js +1 -0
  44. package/dist/gateway/static/root/assets/{directory-picker-path-field-B7d2s14w.js → directory-picker-path-field-B_Zb5nNR.js} +1 -1
  45. package/dist/gateway/static/root/assets/{extension-debug-page-sntm2YRN.js → extension-debug-page-DtHNy4TE.js} +1 -1
  46. package/dist/gateway/static/root/assets/{extension-page-CPbWA4Oy.js → extension-page-8gWSThWP.js} +1 -1
  47. package/dist/gateway/static/root/assets/{extension-provider-CnDGKMN6.js → extension-provider-nbgU7xBS.js} +1 -1
  48. package/dist/gateway/static/root/assets/{extension-settings-page-PAHKn-Az.js → extension-settings-page-CunUbB09.js} +1 -1
  49. package/dist/gateway/static/root/assets/{fallback-models-BJaSQNiV.js → fallback-models-BSAfzXby.js} +1 -1
  50. package/dist/gateway/static/root/assets/{gateway-config-swr-DIhXgHH-.js → gateway-config-swr-D0tBjSgj.js} +1 -1
  51. package/dist/gateway/static/root/assets/{gateway-realtime-BkgWeVUQ.js → gateway-realtime-BnHraJ3O.js} +1 -1
  52. package/dist/gateway/static/root/assets/gateway-realtime-store-BVriF6Zj.js +1 -0
  53. package/dist/gateway/static/root/assets/gateway-settings-CN-2229W.js +1 -0
  54. package/dist/gateway/static/root/assets/{gateway-startup-retry-DnXc9GNb.js → gateway-startup-retry-C1DQsIH3.js} +1 -1
  55. package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-Cw_HUlEk.js → highlighted-body-KQOG7T2V-DktBCtHF.js} +1 -1
  56. package/dist/gateway/static/root/assets/home-page-CUJcNW3H.js +2 -0
  57. package/dist/gateway/static/root/assets/{image-generation-api-4dtNAW64.js → image-generation-api-DodU6GNC.js} +1 -1
  58. package/dist/gateway/static/root/assets/{imports-page-DVvyrYUy.js → imports-page-DQm1MNNC.js} +1 -1
  59. package/dist/gateway/static/root/assets/{index-B-wZyMBY.js → index-BPNL54bv.js} +110 -110
  60. package/dist/gateway/static/root/assets/{index-BvOYtdnP.css → index-yseLAt9D.css} +1 -1
  61. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DywXmCvO.js → keyboard-shortcuts-settings-DaC5YjuJ.js} +1 -1
  62. package/dist/gateway/static/root/assets/{local-app-workbench-page-dBlBepLG.js → local-app-workbench-page-DwQyyo7a.js} +1 -1
  63. package/dist/gateway/static/root/assets/{local-apps-page-DdEXqsZw.js → local-apps-page-CpZhivpf.js} +1 -1
  64. package/dist/gateway/static/root/assets/{local-session-drafts-D-_OuGWH.js → local-session-drafts-D_tYFy7d.js} +1 -1
  65. package/dist/gateway/static/root/assets/{locale-store-BNDrBt2C.js → locale-store-uRu_DsWm.js} +1 -1
  66. package/dist/gateway/static/root/assets/{logs-page-DpSob5Id.js → logs-page-Db43nh1M.js} +2 -2
  67. package/dist/gateway/static/root/assets/{management-settings-10Vl7gLU.js → management-settings-DrKejBEZ.js} +1 -1
  68. package/dist/gateway/static/root/assets/markdown-view-Ct4sKkUf.css +1 -0
  69. package/dist/gateway/static/root/assets/{markdown-view-pEV4TIPK.js → markdown-view-DHfQAvZQ.js} +1 -1
  70. package/dist/gateway/static/root/assets/{media-plugins-DU1Ike3m.js → media-plugins-BombFqsX.js} +1 -1
  71. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-C4VzqE9z.js +1 -0
  72. package/dist/gateway/static/root/assets/messages-DTqbfje6.js +3 -0
  73. package/dist/gateway/static/root/assets/{models-hub-cache-Lp4PAH-A.js → models-hub-cache-Ct6X5zmB.js} +1 -1
  74. package/dist/gateway/static/root/assets/note-detail-panel-a8NSwmmW.js +5 -0
  75. package/dist/gateway/static/root/assets/{notes-api-B_LGV8Lh.js → notes-api-nqN2wKYc.js} +1 -1
  76. package/dist/gateway/static/root/assets/notes-page-BKRke43F.js +8 -0
  77. package/dist/gateway/static/root/assets/{page-context-capture-button-DzkU3HrQ.js → page-context-capture-button-DUaMkmxv.js} +1 -1
  78. package/dist/gateway/static/root/assets/page-tabs-HLrKIjXH.js +1 -0
  79. package/dist/gateway/static/root/assets/personal-page-BqF-HHw1.js +1 -0
  80. package/dist/gateway/static/root/assets/{product-open-page-Dbs3Xtis.js → product-open-page-GrhtTQIz.js} +1 -1
  81. package/dist/gateway/static/root/assets/{product-preview-content-x-EvUxt7.js → product-preview-content-zdP7gN0y.js} +1 -1
  82. package/dist/gateway/static/root/assets/project-detail-page-9Vd_AqDW.js +1 -0
  83. package/dist/gateway/static/root/assets/{projects-page-CSahay3I.js → projects-page-DGunhjoM.js} +1 -1
  84. package/dist/gateway/static/root/assets/{registry-api-DX5EhiBp.js → registry-api-CYqA7bfl.js} +1 -1
  85. package/dist/gateway/static/root/assets/remote-access-hub-BoRsF3Lx.js +1 -0
  86. package/dist/gateway/static/root/assets/{runtime-tools-api-DYeTxrEb.js → runtime-tools-api-zzoxjSuR.js} +1 -1
  87. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DbuAW7ky.js → runtime-tools-settings-panel-W0HDm--J.js} +1 -1
  88. package/dist/gateway/static/root/assets/{scenes-page-DVzrw6Q9.js → scenes-page-CYsFOfVJ.js} +2 -2
  89. package/dist/gateway/static/root/assets/{schema-form-Ch-wK0Os.js → schema-form-CBxEbBQq.js} +1 -1
  90. package/dist/gateway/static/root/assets/{send-session-input-BKIg9cjN.js → send-session-input-BCAF-Ikt.js} +1 -1
  91. package/dist/gateway/static/root/assets/{session-api-Cf3ACMv7.js → session-api-CzVTrG8n.js} +1 -1
  92. package/dist/gateway/static/root/assets/{session-manager-Djtcwo3n.js → session-manager-_yy4bxhT.js} +1 -1
  93. package/dist/gateway/static/root/assets/sessions-page-Dthfx_vc.js +1 -0
  94. package/dist/gateway/static/root/assets/settings-advanced-gate-O_0Lk38S.js +1 -0
  95. package/dist/gateway/static/root/assets/{settings-page-D-Uz-C5u.js → settings-page-CFs-WP_2.js} +1 -1
  96. package/dist/gateway/static/root/assets/setup-status-panel-D2-9fXYL.js +1 -0
  97. package/dist/gateway/static/root/assets/{share-link-dialog-Cke8qSIS.js → share-link-dialog-C47Xgzta.js} +1 -1
  98. package/dist/gateway/static/root/assets/{share-preview-page-CQjfWJVh.js → share-preview-page-nJ2FWAEP.js} +1 -1
  99. package/dist/gateway/static/root/assets/{shares-api-CQapohsa.js → shares-api-B0HlMAzi.js} +1 -1
  100. package/dist/gateway/static/root/assets/shares-settings-DTb88RHD.js +1 -0
  101. package/dist/gateway/static/root/assets/{skill-api-v1XR_zqL.js → skill-api-DJ8UBsxq.js} +1 -1
  102. package/dist/gateway/static/root/assets/{skill-reload-api-CPW9mIZH.js → skill-reload-api-CEJx5rPd.js} +1 -1
  103. package/dist/gateway/static/root/assets/{skills-page-Cu80KslP.js → skills-page-DjbBOikT.js} +1 -1
  104. package/dist/gateway/static/root/assets/specialists-4bkS5rZ4.js +1 -0
  105. package/dist/gateway/static/root/assets/{system-settings-panel-CbIHO53w.js → system-settings-panel-Dt5GkLhM.js} +1 -1
  106. package/dist/gateway/static/root/assets/{task-detail-page-DvRLEt8e.js → task-detail-page-88EShcbs.js} +2 -2
  107. package/dist/gateway/static/root/assets/{task-expandable-content-CQ9Y17UE.js → task-expandable-content-CF6Bj-Qa.js} +1 -1
  108. package/dist/gateway/static/root/assets/tasks-DJIeIk9C.js +1 -0
  109. package/dist/gateway/static/root/assets/{theme-store-BNDzgUPq.js → theme-store-BUfzeDvL.js} +1 -1
  110. package/dist/gateway/static/root/assets/{tracing-settings-page-DbbQg2I5.js → tracing-settings-page-C2q5B3Kp.js} +1 -1
  111. package/dist/gateway/static/root/assets/{tunnel-api-CQXrU_XI.js → tunnel-api-JHttXi63.js} +1 -1
  112. package/dist/gateway/static/root/assets/{usage-page-BdLt6u0c.js → usage-page-B3rUa0fW.js} +1 -1
  113. package/dist/gateway/static/root/assets/{use-autosave-CFn9aZYy.js → use-autosave-DgbCgsao.js} +1 -1
  114. package/dist/gateway/static/root/assets/{use-composer-attachments-DXCEME1D.js → use-composer-attachments-BFP3k6oC.js} +1 -1
  115. package/dist/gateway/static/root/assets/{use-file-preview-expanded-CEB7pfWq.js → use-file-preview-expanded-B1BiTQNS.js} +2 -2
  116. package/dist/gateway/static/root/assets/user-model-page-Cq1VSsZw.js +2 -0
  117. package/dist/gateway/static/root/assets/{voice-api-key-field-C9s0iBGA.js → voice-api-key-field-4AIkbm9R.js} +1 -1
  118. package/dist/gateway/static/root/assets/{voice-config-api-BIm_aTqX.js → voice-config-api-Kw1pYlLN.js} +1 -1
  119. package/dist/gateway/static/root/assets/{work-discovery-overlay-C3KsL1Ap.js → work-discovery-overlay-BAtG_JHv.js} +1 -1
  120. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CEx_jYPu.js → workflow-run-setup-panel-Cw12NFgx.js} +2 -2
  121. package/dist/gateway/static/root/assets/{workflows-page-BYGPnFEF.js → workflows-page-kR5ouOuM.js} +3 -3
  122. package/dist/gateway/static/root/assets/{workspace-api-uZFF1SlQ.js → workspace-api-Xr3wz8T3.js} +2 -2
  123. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-DcPFuTIk.js → xopc-cloud-account-card-BTBVKpSg.js} +1 -1
  124. package/dist/gateway/static/root/index.html +30 -29
  125. package/dist/package.js +1 -1
  126. package/dist/packages/gateway-contract/src/index.js +1 -1
  127. package/dist/packages/gateway-contract/src/task-lifecycle.js +3 -0
  128. package/dist/packages/gateway-contract/src/tasks.js +41 -10
  129. package/dist/src/agent/agent-manager.d.ts +6 -0
  130. package/dist/src/agent/agent-manager.js +18 -15
  131. package/dist/src/agent/agent-scope.js +2 -2
  132. package/dist/src/agent/background-review/prompts.js +1 -1
  133. package/dist/src/agent/background-review/run-background-review.js +10 -10
  134. package/dist/src/agent/coding/repository-instructions.js +1 -1
  135. package/dist/src/agent/context/coordinator.js +2 -2
  136. package/dist/src/agent/context/execution-context.js +4 -4
  137. package/dist/src/agent/context/execution-scope.js +1 -1
  138. package/dist/src/agent/context/project-context.js +3 -3
  139. package/dist/src/agent/data-acquisition/service.js +1 -1
  140. package/dist/src/agent/embedded/codemode-extension.js +1 -1
  141. package/dist/src/agent/embedded/index.js +1 -1
  142. package/dist/src/agent/embedded/run-for-session.js +6 -6
  143. package/dist/src/agent/embedded/run-turn.js +12 -12
  144. package/dist/src/agent/embedded/session-runner.js +3 -3
  145. package/dist/src/agent/embedded/session-tool-result-guard.js +2 -2
  146. package/dist/src/agent/embedded/tool-result-truncation.js +1 -1
  147. package/dist/src/agent/external-tools/cliProvider.js +3 -3
  148. package/dist/src/agent/external-tools/composio-provider.js +3 -3
  149. package/dist/src/agent/external-tools/endpoint-provider.js +4 -4
  150. package/dist/src/agent/external-tools/gateway-tools.js +2 -2
  151. package/dist/src/agent/external-tools/index.js +1 -1
  152. package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
  153. package/dist/src/agent/image/generation/runtime.js +1 -1
  154. package/dist/src/agent/image/index.js +1 -1
  155. package/dist/src/agent/image/load-image-media.js +1 -1
  156. package/dist/src/agent/image/tool-model-config.js +1 -1
  157. package/dist/src/agent/inbound/attachment-pipeline.js +2 -2
  158. package/dist/src/agent/inbound/inbound-loop.js +2 -2
  159. package/dist/src/agent/index.js +3 -3
  160. package/dist/src/agent/mcp/config.js +1 -1
  161. package/dist/src/agent/memory/context-budget.js +1 -1
  162. package/dist/src/agent/memory/context-recovery.js +1 -1
  163. package/dist/src/agent/memory/index.js +1 -1
  164. package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
  165. package/dist/src/agent/prompt/response-language.js +1 -1
  166. package/dist/src/agent/prompt/sections/tooling.js +1 -1
  167. package/dist/src/agent/prompt/service-prompt-builder.js +3 -3
  168. package/dist/src/agent/sandbox/exec-policy.js +1 -1
  169. package/dist/src/agent/service/direct-turn-helpers.js +5 -5
  170. package/dist/src/agent/service/process-direct-streaming.js +5 -5
  171. package/dist/src/agent/service/webchat-tts.js +2 -2
  172. package/dist/src/agent/service.d.ts +6 -0
  173. package/dist/src/agent/service.js +21 -18
  174. package/dist/src/agent/session/session-config-service.js +2 -2
  175. package/dist/src/agent/session/session-hydrator.js +1 -1
  176. package/dist/src/agent/session/session-inspector.js +1 -1
  177. package/dist/src/agent/source-context/index.js +2 -2
  178. package/dist/src/agent/starter-agents.d.ts +1 -0
  179. package/dist/src/agent/starter-agents.js +12 -0
  180. package/dist/src/agent/tasks/task-judge-service.js +5 -5
  181. package/dist/src/agent/tools/create-share-tool.js +3 -3
  182. package/dist/src/agent/tools/dataBatch.js +1 -1
  183. package/dist/src/agent/tools/delegate-tool.js +3 -3
  184. package/dist/src/agent/tools/error-pattern-matcher.js +1 -1
  185. package/dist/src/agent/tools/exec-command.js +3 -1
  186. package/dist/src/agent/tools/executor.js +1 -1
  187. package/dist/src/agent/tools/factory.d.ts +6 -0
  188. package/dist/src/agent/tools/factory.js +40 -39
  189. package/dist/src/agent/tools/fetch-text.js +1 -1
  190. package/dist/src/agent/tools/image-generate-tool.js +3 -3
  191. package/dist/src/agent/tools/index.js +6 -6
  192. package/dist/src/agent/tools/list-dir.js +1 -1
  193. package/dist/src/agent/tools/personal-attention-tool.d.ts +2 -0
  194. package/dist/src/agent/tools/personal-attention-tool.js +52 -18
  195. package/dist/src/agent/tools/personal-read-tool.js +16 -6
  196. package/dist/src/agent/tools/personal-request-tool.js +64 -12
  197. package/dist/src/agent/tools/personal-result-budget.d.ts +2 -0
  198. package/dist/src/agent/tools/personal-result-budget.js +57 -0
  199. package/dist/src/agent/tools/personal-task-tool.d.ts +13 -21
  200. package/dist/src/agent/tools/personal-task-tool.js +234 -24
  201. package/dist/src/agent/tools/publish-artifacts.js +2 -2
  202. package/dist/src/agent/tools/read.js +2 -2
  203. package/dist/src/agent/tools/review-workspace.js +1 -1
  204. package/dist/src/agent/tools/send-media.js +2 -2
  205. package/dist/src/agent/tools/skills-tools.js +1 -1
  206. package/dist/src/agent/tools/tts-tool.js +1 -1
  207. package/dist/src/agent/tools/user-context-tool.js +1 -1
  208. package/dist/src/agent/tools/write.js +2 -2
  209. package/dist/src/agent/tools/xopc-use-tool.js +24 -12
  210. package/dist/src/agent/transcript/index.js +2 -2
  211. package/dist/src/agent/transcript/transcript-hygiene.js +2 -2
  212. package/dist/src/agent/workflow/subagent-runner.js +1 -1
  213. package/dist/src/agent-config/resolver.js +2 -0
  214. package/dist/src/agent-config/schema.d.ts +8 -0
  215. package/dist/src/agent-config/schema.js +2 -0
  216. package/dist/src/agent-matching/delegation-service.js +1 -1
  217. package/dist/src/agent-matching/selection-repository.d.ts +1 -0
  218. package/dist/src/agent-matching/selection-repository.js +1 -1
  219. package/dist/src/agent-matching/service.js +2 -2
  220. package/dist/src/ai-assist/text-assist.js +1 -1
  221. package/dist/src/auth/sync-provider-auth.js +1 -1
  222. package/dist/src/automations/capabilities/write.d.ts +4 -0
  223. package/dist/src/automations/domain/index.js +2 -2
  224. package/dist/src/automations/domain/validation.d.ts +8 -0
  225. package/dist/src/automations/draft/automation-draft-service.js +1 -1
  226. package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -0
  227. package/dist/src/automations/index.js +4 -4
  228. package/dist/src/automations/service/automation-service.js +2 -2
  229. package/dist/src/backup/archive.js +1 -1
  230. package/dist/src/browser/native-messaging-host.js +1 -1
  231. package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
  232. package/dist/src/channels/index.js +2 -2
  233. package/dist/src/channels/outbound-sender.js +1 -1
  234. package/dist/src/channels/pairing/allow-from-file.js +9 -9
  235. package/dist/src/channels/pairing/pairing-store.js +6 -6
  236. package/dist/src/chat-commands/agent-edit.js +1 -1
  237. package/dist/src/chat-commands/builtins/config.js +3 -3
  238. package/dist/src/chat-commands/builtins/review.js +1 -1
  239. package/dist/src/chat-commands/builtins/session.js +1 -1
  240. package/dist/src/chat-commands/builtins/thinking.js +1 -1
  241. package/dist/src/chat-commands/builtins/tts.js +1 -1
  242. package/dist/src/chat-commands/builtins/understanding.js +1 -1
  243. package/dist/src/chat-commands/builtins/workflow.js +1 -1
  244. package/dist/src/chat-commands/context.js +4 -4
  245. package/dist/src/chat-commands/index.js +3 -3
  246. package/dist/src/cli/commands/agent.js +8 -8
  247. package/dist/src/cli/commands/channels.js +1 -1
  248. package/dist/src/cli/commands/config.js +1 -1
  249. package/dist/src/cli/commands/connectors.js +2 -2
  250. package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -1
  251. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  252. package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
  253. package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
  254. package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +1 -1
  255. package/dist/src/cli/commands/extension-agent-plugin.js +1 -1
  256. package/dist/src/cli/commands/extension-dev.js +1 -1
  257. package/dist/src/cli/commands/extension-marketplace.js +4 -4
  258. package/dist/src/cli/commands/extension.js +4 -4
  259. package/dist/src/cli/commands/gateway/token.js +1 -1
  260. package/dist/src/cli/commands/image.js +1 -1
  261. package/dist/src/cli/commands/init.js +1 -1
  262. package/dist/src/cli/commands/mcp.js +1 -1
  263. package/dist/src/cli/commands/models.js +3 -3
  264. package/dist/src/cli/commands/onboard/channels/registry.js +1 -1
  265. package/dist/src/cli/commands/onboard.js +2 -2
  266. package/dist/src/cli/commands/project.js +2 -2
  267. package/dist/src/cli/commands/runtime.js +1 -1
  268. package/dist/src/cli/commands/skills.js +2 -2
  269. package/dist/src/cli/commands/tunnel.js +4 -4
  270. package/dist/src/cli/extension-cli-register.js +6 -6
  271. package/dist/src/cli/utils/gateway-client.js +1 -1
  272. package/dist/src/cli/utils/init-workspace-core.js +1 -1
  273. package/dist/src/cli/utils/session.js +1 -1
  274. package/dist/src/computer/runtime.js +2 -2
  275. package/dist/src/config/agent-model-intents.js +1 -1
  276. package/dist/src/config/index.js +5 -5
  277. package/dist/src/config/loader.js +1 -1
  278. package/dist/src/config/schema.js +5 -5
  279. package/dist/src/connectors/cli/authorization.js +1 -1
  280. package/dist/src/connectors/cli/runtime.js +1 -1
  281. package/dist/src/connectors/composio-sessions.js +1 -1
  282. package/dist/src/connectors/composio.js +1 -1
  283. package/dist/src/connectors/connected-source-ingestion.js +4 -4
  284. package/dist/src/connectors/connected-source-understanding.js +4 -4
  285. package/dist/src/connectors/connection-recovery-service.js +6 -6
  286. package/dist/src/connectors/content-enrichment.js +1 -1
  287. package/dist/src/connectors/health.js +1 -1
  288. package/dist/src/connectors/learning-coordinator.js +2 -2
  289. package/dist/src/discussions/live-worker.js +1 -1
  290. package/dist/src/discussions/recording.js +1 -1
  291. package/dist/src/discussions/sealer.js +1 -1
  292. package/dist/src/endpoint-tools/index.js +1 -1
  293. package/dist/src/endpoint-tools/runtime.js +2 -2
  294. package/dist/src/extensions/activation-context.js +3 -3
  295. package/dist/src/extensions/agent-plugins/source-http-fetch.js +1 -1
  296. package/dist/src/extensions/api.js +4 -4
  297. package/dist/src/extensions/bundled-extension-activation.js +1 -1
  298. package/dist/src/extensions/index.js +3 -3
  299. package/dist/src/extensions/install.js +1 -1
  300. package/dist/src/extensions/loader.js +2 -2
  301. package/dist/src/extensions/sdk/index.js +1 -1
  302. package/dist/src/extensions/sdk/media.js +1 -1
  303. package/dist/src/extensions/update.js +1 -1
  304. package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
  305. package/dist/src/gateway/agents-admin.js +1 -1
  306. package/dist/src/gateway/device-routes.js +2 -2
  307. package/dist/src/gateway/file-path-classifier.js +2 -2
  308. package/dist/src/gateway/global-defaults-admin.js +1 -1
  309. package/dist/src/gateway/hono/app.js +3 -3
  310. package/dist/src/gateway/hono/lib/config-payload.js +3 -3
  311. package/dist/src/gateway/hono/routes/agents.js +1 -1
  312. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
  313. package/dist/src/gateway/hono/routes/commands-skills.js +4 -4
  314. package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
  315. package/dist/src/gateway/hono/routes/config-patch/misc.js +4 -4
  316. package/dist/src/gateway/hono/routes/connectors.js +1 -1
  317. package/dist/src/gateway/hono/routes/context-sources.js +2 -2
  318. package/dist/src/gateway/hono/routes/endpoint-tools.js +1 -1
  319. package/dist/src/gateway/hono/routes/home.js +1 -1
  320. package/dist/src/gateway/hono/routes/mcp.js +1 -1
  321. package/dist/src/gateway/hono/routes/media.js +1 -1
  322. package/dist/src/gateway/hono/routes/memory-learning.js +3 -3
  323. package/dist/src/gateway/hono/routes/models.js +5 -5
  324. package/dist/src/gateway/hono/routes/notes.js +1 -1
  325. package/dist/src/gateway/hono/routes/personal-agent.js +2 -2
  326. package/dist/src/gateway/hono/routes/projects.js +4 -4
  327. package/dist/src/gateway/hono/routes/session-command-handler.js +2 -2
  328. package/dist/src/gateway/hono/routes/session-input-handler.js +4 -4
  329. package/dist/src/gateway/hono/routes/sessions.js +2 -2
  330. package/dist/src/gateway/hono/routes/shares.js +3 -3
  331. package/dist/src/gateway/hono/routes/side-chats.js +1 -1
  332. package/dist/src/gateway/hono/routes/site-shares.js +1 -1
  333. package/dist/src/gateway/hono/routes/tasks.js +3 -2
  334. package/dist/src/gateway/hono/routes/user-model.js +7 -7
  335. package/dist/src/gateway/hono/routes/voice.js +7 -7
  336. package/dist/src/gateway/hono/routes/workflows.js +2 -2
  337. package/dist/src/gateway/image-generation-setup.js +1 -1
  338. package/dist/src/gateway/index.js +1 -1
  339. package/dist/src/gateway/lock.js +11 -11
  340. package/dist/src/gateway/media-access.js +1 -1
  341. package/dist/src/gateway/mobile-privacy.js +2 -2
  342. package/dist/src/gateway/ports.js +6 -6
  343. package/dist/src/gateway/run-loop.js +1 -1
  344. package/dist/src/gateway/scenes/mailContext.js +1 -1
  345. package/dist/src/gateway/scenes/slackThreadSource.js +1 -1
  346. package/dist/src/gateway/server.js +1 -1
  347. package/dist/src/gateway/service/agent-runner.js +2 -2
  348. package/dist/src/gateway/service/config-coordinator.js +2 -2
  349. package/dist/src/gateway/service/marketplace-service.js +1 -1
  350. package/dist/src/gateway/service/run-gateway-agent.js +3 -3
  351. package/dist/src/gateway/service/session-command-service.js +1 -1
  352. package/dist/src/gateway/service.d.ts +1 -0
  353. package/dist/src/gateway/service.js +59 -45
  354. package/dist/src/gateway/session-context-summary.js +3 -3
  355. package/dist/src/gateway/workspace-editor-path.js +2 -2
  356. package/dist/src/home-intelligence/generator.js +2 -2
  357. package/dist/src/home-intelligence/host.js +2 -2
  358. package/dist/src/imports/inventory.js +1 -1
  359. package/dist/src/infra/gateway-processes.js +2 -2
  360. package/dist/src/infra/path-env.js +3 -3
  361. package/dist/src/infra/update-global.js +10 -10
  362. package/dist/src/knowledge/connected-knowledge-pipeline.js +2 -2
  363. package/dist/src/knowledge/index.js +1 -1
  364. package/dist/src/knowledge-memory/repository.js +1 -1
  365. package/dist/src/local-apps/service.js +1 -1
  366. package/dist/src/mcp/gateway-http-client.js +1 -1
  367. package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
  368. package/dist/src/memory-learning/source-learning.js +5 -5
  369. package/dist/src/memory-learning/task-receipts.js +1 -1
  370. package/dist/src/notes/agent-context.js +4 -4
  371. package/dist/src/notes/index.js +1 -1
  372. package/dist/src/notes/store.js +1 -1
  373. package/dist/src/personal-agent/capability-service.js +4 -4
  374. package/dist/src/personal-agent/policy.js +2 -7
  375. package/dist/src/personal-agent/proactivity/repository.js +1 -1
  376. package/dist/src/personal-agent/proactivity/routes.js +1 -1
  377. package/dist/src/personal-agent/proactivity/service.js +5 -5
  378. package/dist/src/personal-agent/prompt-context.d.ts +1 -4
  379. package/dist/src/personal-agent/prompt-context.js +9 -34
  380. package/dist/src/personal-agent/prompts.js +31 -10
  381. package/dist/src/personal-agent/reply-composer.js +4 -4
  382. package/dist/src/personal-agent/request-delivery.js +1 -1
  383. package/dist/src/personal-agent/request-repository.d.ts +3 -2
  384. package/dist/src/personal-agent/request-repository.js +4 -4
  385. package/dist/src/personal-agent/request-service.d.ts +1 -1
  386. package/dist/src/personal-agent/request-service.js +100 -32
  387. package/dist/src/personal-agent/task-cancel.d.ts +7 -0
  388. package/dist/src/personal-agent/task-cancel.js +76 -0
  389. package/dist/src/providers/model-reference-auditor.js +1 -1
  390. package/dist/src/realtime/runtime.js +1 -1
  391. package/dist/src/remote-access/exposure-manager.js +1 -1
  392. package/dist/src/scenes/taskFollowUp/agentExecutor.js +4 -4
  393. package/dist/src/scenes/taskFollowUp/resources.js +1 -1
  394. package/dist/src/scenes/taskFollowUp/service.js +5 -5
  395. package/dist/src/session/client-history.js +1 -1
  396. package/dist/src/session/index.js +1 -1
  397. package/dist/src/session/store.js +5 -5
  398. package/dist/src/session/thinking-resolve.js +1 -1
  399. package/dist/src/share/share-store.js +1 -1
  400. package/dist/src/share/share-thumbnail.js +1 -1
  401. package/dist/src/share/share-zip.js +1 -1
  402. package/dist/src/share/site-proxy.js +1 -1
  403. package/dist/src/share/site-share-store.js +1 -1
  404. package/dist/src/storage/sqlite/connection.js +9 -9
  405. package/dist/src/storage/sqlite/migrations/249_task_allocations.sql +17 -0
  406. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  407. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  408. package/dist/src/storage/sqlite/schema.js +1 -1
  409. package/dist/src/tasks/capabilities/read.js +2 -2
  410. package/dist/src/tasks/capabilities/relations.d.ts +38 -2
  411. package/dist/src/tasks/capabilities/write.d.ts +40 -0
  412. package/dist/src/tasks/capabilities/write.js +7 -6
  413. package/dist/src/tasks/execution-context.js +1 -1
  414. package/dist/src/tasks/home-query-service.js +2 -2
  415. package/dist/src/tasks/index.js +5 -5
  416. package/dist/src/tasks/task-allocation-repository.d.ts +25 -0
  417. package/dist/src/tasks/task-allocation-repository.js +82 -0
  418. package/dist/src/tasks/task-allocation-service.d.ts +39 -0
  419. package/dist/src/tasks/task-allocation-service.js +310 -0
  420. package/dist/src/tasks/task-application-service.js +46 -3
  421. package/dist/src/tasks/task-collaboration-delivery.js +1 -1
  422. package/dist/src/tasks/task-context-assembler.js +2 -2
  423. package/dist/src/tasks/task-handoff-service.js +2 -2
  424. package/dist/src/tasks/task-main-update-decision-service.js +2 -2
  425. package/dist/src/tasks/task-main-update-delivery.js +2 -0
  426. package/dist/src/tasks/task-origin-repository.d.ts +2 -1
  427. package/dist/src/tasks/task-origin-repository.js +9 -5
  428. package/dist/src/tasks/task-read-model-projector.d.ts +2 -1
  429. package/dist/src/tasks/task-read-model-projector.js +21 -8
  430. package/dist/src/tasks/task-result-delivery-repository.js +1 -1
  431. package/dist/src/tasks/task-result-delivery-service.js +4 -4
  432. package/dist/src/tasks/task-run-coordinator.js +10 -2
  433. package/dist/src/tasks/task-run-dispatcher.d.ts +1 -1
  434. package/dist/src/tasks/task-run-dispatcher.js +5 -4
  435. package/dist/src/tui/backends/embedded-backend.js +11 -11
  436. package/dist/src/tui/backends/gateway-realtime-backend.js +2 -2
  437. package/dist/src/tui/extension-host/load-extensions.js +2 -2
  438. package/dist/src/tui/tui-commands.js +6 -6
  439. package/dist/src/tui/tui-picker-overlay.js +1 -1
  440. package/dist/src/tui/tui-skills-autocomplete.js +2 -2
  441. package/dist/src/tui/tui-startup-resources.js +5 -5
  442. package/dist/src/tui/tui.js +7 -7
  443. package/dist/src/tunnel/frpc-binary.js +1 -1
  444. package/dist/src/tunnel/gateway-lifecycle.js +1 -1
  445. package/dist/src/user-context/access-policy.js +1 -1
  446. package/dist/src/user-model/bootstrap.js +1 -1
  447. package/dist/src/user-model/capture/executor.js +1 -1
  448. package/dist/src/user-model/index.js +2 -2
  449. package/dist/src/voice/realtime/memory-context.js +6 -6
  450. package/dist/src/voice/realtime/runtime.js +4 -4
  451. package/dist/src/voice/stt/index.js +2 -2
  452. package/dist/src/voice/stt/preflight.js +1 -1
  453. package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
  454. package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
  455. package/dist/src/voice/stt/transcribe-core.js +1 -1
  456. package/dist/src/voice/tts/index.js +3 -3
  457. package/dist/src/voice/tts/merge-config.js +1 -1
  458. package/dist/src/voice/tts/payload.js +1 -1
  459. package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
  460. package/dist/src/voice/tts/speak-core.js +1 -1
  461. package/dist/src/work-discovery/index.js +1 -1
  462. package/dist/src/work-discovery/service.js +7 -7
  463. package/dist/src/workflows/engine/workflow-engine.js +1 -1
  464. package/dist/src/workflows/service/workflow-run-service.js +8 -8
  465. package/dist/src/workflows/service/workflow-session-bridge.js +2 -2
  466. package/package.json +3 -3
  467. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Bewx00VC.js +0 -1
  468. package/dist/gateway/static/root/assets/agents-ByJbzt3F.js +0 -77
  469. package/dist/gateway/static/root/assets/automations-workspace-DOJnSOJ7.js +0 -6
  470. package/dist/gateway/static/root/assets/browser-automations-page-DGcGOkIq.js +0 -3
  471. package/dist/gateway/static/root/assets/browser-settings-page-CHCWHtkG.js +0 -3
  472. package/dist/gateway/static/root/assets/capabilities-page-CVaH729t.js +0 -2
  473. package/dist/gateway/static/root/assets/connectors-page-BpCGV1Gg.js +0 -1
  474. package/dist/gateway/static/root/assets/device-pairing-wizard-CEfqb0dk.js +0 -1
  475. package/dist/gateway/static/root/assets/gateway-realtime-store-IK77lcix.js +0 -1
  476. package/dist/gateway/static/root/assets/gateway-settings-CnqeYLJI.js +0 -1
  477. package/dist/gateway/static/root/assets/home-page-CKUJdUkK.js +0 -2
  478. package/dist/gateway/static/root/assets/markdown-view-CZWff4bI.css +0 -1
  479. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-Bd0DNN_v.js +0 -1
  480. package/dist/gateway/static/root/assets/messages-CRy8QVkB.js +0 -3
  481. package/dist/gateway/static/root/assets/note-detail-panel-DiJ5O3Ga.js +0 -5
  482. package/dist/gateway/static/root/assets/notes-page-BEhxVwpX.js +0 -8
  483. package/dist/gateway/static/root/assets/page-tabs-BLGO2VIm.js +0 -1
  484. package/dist/gateway/static/root/assets/personal-page-Dpgj9Y5a.js +0 -1
  485. package/dist/gateway/static/root/assets/project-detail-page-CAM4Q3Kh.js +0 -1
  486. package/dist/gateway/static/root/assets/remote-access-hub-B6y0lXZc.js +0 -1
  487. package/dist/gateway/static/root/assets/sessions-page-DY0UP_lC.js +0 -1
  488. package/dist/gateway/static/root/assets/settings-advanced-gate-BLTR6Opb.js +0 -1
  489. package/dist/gateway/static/root/assets/setup-status-panel-DWAAlzV5.js +0 -1
  490. package/dist/gateway/static/root/assets/shares-settings-DPrpUIj7.js +0 -1
  491. package/dist/gateway/static/root/assets/tasks-DwKXgZ-I.js +0 -1
  492. package/dist/gateway/static/root/assets/user-model-page-BgIW4ITJ.js +0 -2
@@ -3,13 +3,13 @@ import { init_logger } from "../../utils/logger.js";
3
3
  import { chooseModelThinking } from "../../../packages/gateway-contract/src/model-selection.js";
4
4
  import { init_src } from "../../../packages/gateway-contract/src/index.js";
5
5
  import { ResponseLanguageSchema, init_response_language } from "../../i18n/response-language.js";
6
- import { isPersonalConversation } from "../../personal-agent/repository.js";
7
6
  import { resolveEffectiveAgentConfigForSession } from "../../config/agent-profile.js";
8
7
  import { normalizeWorkingDirectoryInput } from "../../session/session-workspace.js";
9
8
  import { getProjectWorkspacePathForSession } from "../../projects/workspace.js";
9
+ import { isPersonalConversation } from "../../personal-agent/repository.js";
10
+ import { getModelThinking } from "../../providers/model-thinking.js";
10
11
  import { normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel } from "../transcript/thinking-types.js";
11
12
  import "../../session/index.js";
12
- import { getModelThinking } from "../../providers/model-thinking.js";
13
13
  import { mkdir } from "node:fs/promises";
14
14
  //#region src/agent/session/session-config-service.ts
15
15
  init_src();
@@ -3,9 +3,9 @@ import { init_logger } from "../../utils/logger.js";
3
3
  import { getExecutionEnvironmentForSession } from "../../execution-environments/subject.js";
4
4
  import { effectiveWorkspacePathForSession, normalizeWorkingDirectoryInput, projectWorkspacePath } from "../../session/session-workspace.js";
5
5
  import { getProjectForSession } from "../../projects/workspace.js";
6
+ import { getModelThinking } from "../../providers/model-thinking.js";
6
7
  import { resolveEffectiveThinkingLevel } from "../../session/thinking-resolve.js";
7
8
  import "../../session/index.js";
8
- import { getModelThinking } from "../../providers/model-thinking.js";
9
9
  import { mkdir, stat } from "node:fs/promises";
10
10
  //#region src/agent/session/session-hydrator.ts
11
11
  /**
@@ -1,8 +1,8 @@
1
1
  import { createLogger } from "../../utils/logger/index.js";
2
2
  import { init_logger } from "../../utils/logger.js";
3
3
  import { init_workspace_defaults, resolveDefaultAgentWorkspaceDir } from "../../config/workspace-defaults.js";
4
- import { init_providers, resolveModel } from "../../providers/index.js";
5
4
  import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
5
+ import { init_providers, resolveModel } from "../../providers/index.js";
6
6
  import { getExecutionEnvironmentForSession } from "../../execution-environments/subject.js";
7
7
  import { effectiveWorkspacePathForSession, projectWorkspacePath } from "../../session/session-workspace.js";
8
8
  import { getProjectForSession } from "../../projects/workspace.js";
@@ -1,7 +1,7 @@
1
+ import { isSessionSourceBinding, isTurnContextRef, parseTurnContextRefs, summarizeSourceContext } from "./types.js";
2
+ import { injectSourceContextsIntoUserMessage } from "./injector.js";
1
3
  import { buildFileAgentContext } from "./file-context.js";
2
4
  import { buildSessionAgentContext } from "./session-context.js";
3
5
  import { buildBrowserTabAgentContext } from "./browser-tab.js";
4
6
  import { buildUserAssertionAgentContext } from "./user-assertion-context.js";
5
- import { isSessionSourceBinding, isTurnContextRef, parseTurnContextRefs, summarizeSourceContext } from "./types.js";
6
- import { injectSourceContextsIntoUserMessage } from "./injector.js";
7
7
  export { buildBrowserTabAgentContext, buildFileAgentContext, buildSessionAgentContext, buildUserAssertionAgentContext, injectSourceContextsIntoUserMessage, isSessionSourceBinding, isTurnContextRef, parseTurnContextRefs, summarizeSourceContext };
@@ -2,6 +2,7 @@ import type { AgentEntry } from '../agent-config/index.js';
2
2
  export declare const STARTER_AGENTS_INITIALIZED_VERSION = 1;
3
3
  type StarterAgent = {
4
4
  id: string;
5
+ purpose?: AgentEntry['purpose'];
5
6
  tools?: AgentEntry['tools'];
6
7
  toolAllowlist?: AgentEntry['toolAllowlist'];
7
8
  skills?: AgentEntry['skills'];
@@ -12,6 +12,17 @@ function denyTools(names) {
12
12
  return Object.fromEntries(names.map((name) => [name, { mode: "deny" }]));
13
13
  }
14
14
  const STARTER_AGENTS = [
15
+ {
16
+ id: "task-router",
17
+ purpose: "task_dispatcher",
18
+ toolAllowlist: [],
19
+ profile: {
20
+ name: "Task Router",
21
+ description: "Selects one suitable specialist for a delegated task.",
22
+ instructions: "Compare the task brief with candidate expertise, examples, limitations and verified execution conditions. Select only a displayed eligible candidate. Preserve requested Agents, Skills and task boundaries. Return the requested structured decision."
23
+ },
24
+ profileFiles: {}
25
+ },
15
26
  {
16
27
  id: "main",
17
28
  specialistProfile: {
@@ -269,6 +280,7 @@ function ensureStarterAgentsInitialized() {
269
280
  repository.create({
270
281
  id: starter.id,
271
282
  enabled: true,
283
+ ...starter.purpose ? { purpose: starter.purpose } : {},
272
284
  ...starter.specialistProfile ? { specialistProfile: starter.specialistProfile } : {},
273
285
  ...starter.profile ? { profile: starter.profile } : {},
274
286
  ...starter.tools ? { tools: starter.tools } : {},
@@ -2,17 +2,17 @@ import { createLogger } from "../../utils/logger/index.js";
2
2
  import { init_logger } from "../../utils/logger.js";
3
3
  import { TaskRepository, init_task_repository } from "../../tasks/task-repository.js";
4
4
  import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-run-repository.js";
5
- import { resolveTaskLocale } from "../../tasks/task-language.js";
6
- import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
7
- import { TaskApplicationService } from "../../tasks/task-application-service.js";
5
+ import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
8
6
  import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
9
7
  import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
10
- import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
11
8
  import { completeWithResolvedCredentials } from "../../providers/model-call.js";
12
- import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
9
+ import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
10
+ import { resolveTaskLocale } from "../../tasks/task-language.js";
11
+ import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
13
12
  import { readWorkspaceRevision } from "../coding/workspace-revision.js";
14
13
  import { buildResponseLanguageSection } from "../prompt/sections/response-language.js";
15
14
  import { resolveResponseLanguageForSession } from "../prompt/response-language.js";
15
+ import { TaskApplicationService } from "../../tasks/task-application-service.js";
16
16
  //#region src/agent/tasks/task-judge-service.ts
17
17
  init_schema();
18
18
  init_providers();
@@ -1,15 +1,15 @@
1
1
  import { turnOutcomeKindFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
2
2
  import { init_src } from "../../../packages/gateway-contract/src/index.js";
3
- import { resolveGatewayEffectiveHost } from "../../config/gateway-bind.js";
4
- import { resolveReverseProxyPublicUrl } from "../../gateway/public-url.js";
5
- import { resolvePathUnderWorkspace } from "./tool-paths.js";
6
3
  import { assertWorkspaceTreeReadable, checkedFilePath } from "../sandbox/fileAccess.js";
4
+ import { resolvePathUnderWorkspace } from "./tool-paths.js";
5
+ import { resolveGatewayEffectiveHost } from "../../config/gateway-bind.js";
7
6
  import { resolveShareConfig } from "../../share/share-config.js";
8
7
  import { mergeWithDefaults } from "../../share/site-share-config.js";
9
8
  import { getShareStore } from "../../share/share-store.js";
10
9
  import { getSiteShareStore } from "../../share/site-share-store.js";
11
10
  import { resolveShareUrl, resolveSiteShareUrl } from "../../share/share-url.js";
12
11
  import { publishHostedStaticSite } from "../../share/hosted-static-site-publish.js";
12
+ import { resolveReverseProxyPublicUrl } from "../../gateway/public-url.js";
13
13
  import { audienceDefaults, decideShareKind, makeDescription, makeTitle, probeShareTarget, rememberStagedSite, stageSingleHtmlAsSite } from "../../share/share-auto.js";
14
14
  import { scheduleThumbnail } from "../../share/share-thumbnail.js";
15
15
  import { resolveToolLocale, shareToolErrorLine, shareToolSuccessLines } from "../../i18n/share-tool-bundle.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 { renderDataBatch } from "../data-acquisition/render.js";
4
3
  import { DataBatchSchema } from "../data-acquisition/schema.js";
5
4
  import { acquireData } from "../data-acquisition/service.js";
5
+ import { renderDataBatch } from "../data-acquisition/render.js";
6
6
  import { AsyncLocalStorage } from "node:async_hooks";
7
7
  //#region src/agent/tools/dataBatch.ts
8
8
  init_logger();
@@ -1,12 +1,12 @@
1
- import { runGit } from "../../execution-environments/git.js";
2
- import { LocalWorktreeManager } from "../../execution-environments/local-worktree-manager.js";
3
- import { SessionEnvironmentService } from "../../execution-environments/session-environment-service.js";
4
1
  import { readWorkspaceRevision } from "../coding/workspace-revision.js";
5
2
  import { EXTERNAL_TOOL_NAMES } from "../external-tools/gateway-tools.js";
6
3
  import "../external-tools/index.js";
7
4
  import { getDelegationScope } from "../orchestration/delegation-scope.js";
8
5
  import { DELEGATION_BUDGETS } from "../orchestration/delegation-budget.js";
9
6
  import { createDelegateChildHandle } from "../child-agent-factory.js";
7
+ import { runGit } from "../../execution-environments/git.js";
8
+ import { LocalWorktreeManager } from "../../execution-environments/local-worktree-manager.js";
9
+ import { SessionEnvironmentService } from "../../execution-environments/session-environment-service.js";
10
10
  import { DELEGATION_CAPABILITIES, DELEGATION_TOOL_CAPABILITIES, protectDelegatedTool, resolveDelegationTools } from "./delegation-policy.js";
11
11
  import { Type } from "@sinclair/typebox";
12
12
  //#region src/agent/tools/delegate-tool.ts
@@ -45,7 +45,7 @@ const DEFAULT_CONFIG = {
45
45
  {
46
46
  name: "timeout",
47
47
  description: "Command execution timed out",
48
- regex: /timeout|timed out|execution time exceeded/i,
48
+ regex: /\btimeout(?:error|exception)?\b|timed out|execution time exceeded|\betimedout\b/i,
49
49
  suggestion: "Command took too long. Consider optimizing the command, breaking into smaller tasks, or increasing timeout.",
50
50
  autoRetry: true,
51
51
  maxRetries: 1,
@@ -7,7 +7,7 @@ import { Type } from "@sinclair/typebox";
7
7
  //#region src/agent/tools/exec-command.ts
8
8
  const DEFAULT_MAX_OUTPUT_CHARS = 5e4;
9
9
  const ExecCommandSchema = Type.Object({
10
- cmd: Type.String({ description: "Shell command to execute." }),
10
+ cmd: Type.String({ description: "Command for the default platform shell: /bin/sh on Unix and in Docker; cmd.exe on Windows hosts. Use portable syntax, or invoke an installed shell explicitly for shell-specific features." }),
11
11
  cwd: Type.Optional(Type.String({ description: "Working directory. Relative paths are resolved under the agent workspace." })),
12
12
  timeoutMs: Type.Optional(Type.Number({ description: "Command timeout in milliseconds. Defaults to 1800000 (30m) and is capped at 14400000 (4h)." })),
13
13
  maxOutputChars: Type.Optional(Type.Number({ description: "Maximum characters returned to the model. UI streaming still receives output deltas." })),
@@ -28,6 +28,7 @@ function commandFailureHint(details) {
28
28
  if (details.status === "success" || details.status === "running") return void 0;
29
29
  if (details.status === "cancelled") return "The command was cancelled. Inspect its partial output before deciding whether to restart.";
30
30
  if (details.status === "timed_out") return "The command timed out. Re-run a narrower command, increase timeoutMs if the long run is expected, or inspect partial output before retrying.";
31
+ if (details.exitCode !== 0 && /(?:\/bin\/sh|\bsh:).*syntax error|bad substitution/i.test(details.stderr)) return "The default shell rejected the syntax. Use portable POSIX sh commands or invoke an installed bash explicitly for Bash-only features such as process substitution. Inspect stderr, fix the command, then rerun it.";
31
32
  if (details.exitCode !== 0 && details.stderr.trim()) return "The command failed. Inspect stderr first, fix the underlying issue, then re-run the narrowest relevant verification command.";
32
33
  if (details.exitCode !== 0 && details.stdout.trim()) return "The command failed. Inspect stdout for the failure location, then re-run the narrowest relevant verification command.";
33
34
  return "The command failed without output. Verify the command, cwd, and required dependencies before retrying.";
@@ -54,6 +55,7 @@ function createExecCommandTool(workspaceCwd, options) {
54
55
  name: "exec_command",
55
56
  description: [
56
57
  "Run shell commands for code inspection, builds, tests, type checks, and verification.",
58
+ "Unix and Docker use /bin/sh, not your interactive shell. Do not use Bash process substitution <(...) or other Bash-only syntax unless invoking an installed bash explicitly. Prefer separate portable commands or a script file. Windows hosts use cmd.exe.",
57
59
  "Use apply_patch for file edits; do not edit files by shell redirection unless explicitly necessary.",
58
60
  "Relative cwd values resolve under the current agent workspace.",
59
61
  "When the command creates final user-facing files, declare all final paths in outputs so they are persisted with this command."
@@ -1,8 +1,8 @@
1
1
  import { createLogger } from "../../utils/logger/index.js";
2
2
  import { init_logger } from "../../utils/logger.js";
3
- import { withRetry } from "../../infra/retry.js";
4
3
  import { commandTimeout } from "../commands/command-registry.js";
5
4
  import { DEFAULT_TOOL_EXECUTION_TIMEOUT_MS, TimeoutError, executeWithTimeout } from "../lifecycle/timeout-wrapper.js";
5
+ import { withRetry } from "../../infra/retry.js";
6
6
  import { ToolConcurrencyController, resolveToolLockMode } from "./concurrency.js";
7
7
  //#region src/agent/tools/executor.ts
8
8
  init_logger();
@@ -112,6 +112,12 @@ export interface CreateCoreToolsOptions {
112
112
  }
113
113
  export declare class AgentToolsFactory {
114
114
  private deps;
115
+ getAgentToolAvailability(candidateId: string, name: string): {
116
+ condition: string;
117
+ state: "blocked" | "verified";
118
+ reasonCode: string;
119
+ detail: string;
120
+ };
115
121
  private browserRuntime;
116
122
  /** Cached readiness probe keyed by the active driver configuration. */
117
123
  private browserReadinessCache;
@@ -9,32 +9,22 @@ import { patchSessionMetadata } from "../../storage/sqlite/session-repository.js
9
9
  import { getSessionTaskPlan, setSessionTaskPlan } from "../../storage/sqlite/session-task-plan-repository.js";
10
10
  import { init_sqlite } from "../../storage/sqlite/index.js";
11
11
  import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
12
- import { createWorkflowCatalog } from "../workflow/catalog.js";
13
- import { BrowserRuntime } from "../../browser/runtime/browser-runtime.js";
12
+ import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
13
+ import { resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession } from "../../config/agent-profile.js";
14
+ import { LOCAL_READ_MAX_CHARS } from "./local-read-budget.js";
15
+ import { createPersonalAttentionTool } from "./personal-attention-tool.js";
16
+ import { markCodemodeCoreRead } from "./codemode-permissions.js";
17
+ import { PERSONAL_TOOL_DESCRIPTIONS } from "../../personal-agent/policy.js";
18
+ import { PERSONAL_REQUEST_TOOL_IDS, filterExecutionTools, resolveExecutionToolPolicy } from "../embedded/execution-tool-policy.js";
14
19
  import "../../../packages/browser-control-contract/src/index.js";
15
- import { createBrowserDriver } from "../../browser/drivers/create-driver.js";
16
- import { checkBrowserReadiness } from "../../browser/readiness.js";
17
- import "../../browser/index.js";
18
20
  import { getEmbeddedExecutionRunId, getEmbeddedExecutionSession } from "../embedded/execution-context.js";
19
- import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
20
- import { resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession } from "../../config/agent-profile.js";
21
- import { ComputerRuntime } from "../../computer/runtime.js";
22
- import { buildRuntimeEnvironment } from "../../runtime-tools/environment.js";
23
- import { skillEnvironmentId } from "../skills/installer.js";
24
21
  import { wrapToolsWithProtection } from "./executor.js";
25
22
  import { EXTERNAL_TOOL_NAMES } from "../external-tools/gateway-tools.js";
26
23
  import { createDefaultExternalToolGatewayTools } from "../external-tools/index.js";
27
- import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
28
- import { getPendingTranscriptUserText } from "../inbound/attachment-pipeline.js";
29
- import { createDataBatchTool } from "./dataBatch.js";
30
- import { markCodemodeCoreRead } from "./codemode-permissions.js";
31
- import { PERSONAL_TOOL_DESCRIPTIONS } from "../../personal-agent/policy.js";
32
- import { PERSONAL_REQUEST_TOOL_IDS, filterExecutionTools, resolveExecutionToolPolicy } from "../embedded/execution-tool-policy.js";
33
- import { createDelegateTool } from "./delegate-tool.js";
34
- import { createDelegationParentPolicy } from "./delegation-parent-policy.js";
35
- import { createPersonalAttentionTool } from "./personal-attention-tool.js";
36
- import { LOCAL_READ_MAX_CHARS } from "./local-read-budget.js";
37
24
  import { createReadFileTool } from "./read.js";
25
+ import { createDataBatchTool } from "./dataBatch.js";
26
+ import { buildRuntimeEnvironment } from "../../runtime-tools/environment.js";
27
+ import { skillEnvironmentId } from "../skills/installer.js";
38
28
  import { createWriteFileTool } from "./write.js";
39
29
  import { createListDirTool } from "./list-dir.js";
40
30
  import { createPublishArtifactsTool } from "./publish-artifacts.js";
@@ -57,7 +47,14 @@ import { createUpdatePlanTool } from "./update-plan-tool.js";
57
47
  import { createSessionStatusTool } from "./session-status-tool.js";
58
48
  import { createMemoryMaintenanceTool } from "./memory-maintenance-tool.js";
59
49
  import { createClarifyTool } from "./clarify-tool.js";
50
+ import { BrowserRuntime } from "../../browser/runtime/browser-runtime.js";
51
+ import { createBrowserDriver } from "../../browser/drivers/create-driver.js";
52
+ import { checkBrowserReadiness } from "../../browser/readiness.js";
53
+ import "../../browser/index.js";
54
+ import { getPendingTranscriptUserText } from "../inbound/attachment-pipeline.js";
55
+ import { createDelegateTool } from "./delegate-tool.js";
60
56
  import { createWorkflowTool } from "./workflow-tool.js";
57
+ import { createWorkflowCatalog } from "../workflow/catalog.js";
61
58
  import { createWorkflowManageTool } from "./workflow-manage-tool.js";
62
59
  import { createAutomationTool } from "./automation-tool.js";
63
60
  import { createBrowserAutomationTool } from "./browser-automation-tool.js";
@@ -78,9 +75,12 @@ import { createPersonalRequestTools } from "./personal-request-tool.js";
78
75
  import { createPersonalRequestConnectionTool, createPersonalRequestResultTool } from "./personal-request-result-tool.js";
79
76
  import { createPersonalPreferenceTool } from "./personal-preference-tool.js";
80
77
  import { createBrowserUseTool } from "./browser/tool/browser-use-tool.js";
78
+ import { ComputerRuntime } from "../../computer/runtime.js";
81
79
  import { createComputerUseTool } from "./computer-use-tool.js";
82
80
  import { createReviewWorkspaceTool } from "./review-workspace.js";
83
81
  import { createLanguageDiagnosticsTool } from "./language-diagnostics.js";
82
+ import { createDelegationParentPolicy } from "./delegation-parent-policy.js";
83
+ import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
84
84
  import { createTextToSpeechTool } from "./tts-tool.js";
85
85
  import { getAgentCapabilityToolNames } from "../capabilities/registry.js";
86
86
  import "../capabilities/index.js";
@@ -100,6 +100,24 @@ const CLARIFY_SUPPORTED_CHANNELS = new Set([
100
100
  "cli"
101
101
  ]);
102
102
  var AgentToolsFactory = class AgentToolsFactory {
103
+ getAgentToolAvailability(candidateId, name) {
104
+ const candidate = resolveEffectiveAgentConfigForAgent(candidateId).config;
105
+ const denied = new Set(Object.entries(candidate.tools).filter(([, policy]) => policy.mode === "deny").map(([tool]) => tool));
106
+ const registered = this.createAllTools({
107
+ agentId: candidateId,
108
+ workspace: candidate.workspace,
109
+ conversationId: "",
110
+ disabledTools: denied,
111
+ toolAllowlist: candidate.toolAllowlist
112
+ }).some((tool) => tool.name === name);
113
+ const activatable = this.getLazyCapabilityToolNames().includes(name);
114
+ return {
115
+ condition: `tool:${name}`,
116
+ state: registered || activatable ? "verified" : "blocked",
117
+ reasonCode: registered ? "tool_registered" : activatable ? "tool_activatable" : "tool_not_registered",
118
+ detail: candidate.tools[name]?.mode === "ask" ? "Runtime approval is still required" : "Registration checked; execution environment is checked by the tool"
119
+ };
120
+ }
103
121
  browserRuntime = null;
104
122
  /** Cached readiness probe keyed by the active driver configuration. */
105
123
  browserReadinessCache = null;
@@ -296,24 +314,7 @@ var AgentToolsFactory = class AgentToolsFactory {
296
314
  const grep = createGrepTool(workspace);
297
315
  const find = createFindTool(workspace);
298
316
  const productToolDeps = {
299
- getAgentToolAvailability: this.deps.getAgentToolAvailability ?? ((candidateId, name) => {
300
- const candidate = resolveEffectiveAgentConfigForAgent(candidateId).config;
301
- const denied = new Set(Object.entries(candidate.tools).filter(([, policy]) => policy.mode === "deny").map(([tool]) => tool));
302
- const registered = this.createAllTools({
303
- agentId: candidateId,
304
- workspace: candidate.workspace,
305
- conversationId: "",
306
- disabledTools: denied,
307
- toolAllowlist: candidate.toolAllowlist
308
- }).some((tool) => tool.name === name);
309
- const activatable = this.getLazyCapabilityToolNames().includes(name);
310
- return {
311
- condition: `tool:${name}`,
312
- state: registered || activatable ? "verified" : "blocked",
313
- reasonCode: registered ? "tool_registered" : activatable ? "tool_activatable" : "tool_not_registered",
314
- detail: candidate.tools[name]?.mode === "ask" ? "Runtime approval is still required" : "Registration checked; execution environment is checked by the tool"
315
- };
316
- }),
317
+ getAgentToolAvailability: this.deps.getAgentToolAvailability ?? ((candidateId, name) => this.getAgentToolAvailability(candidateId, name)),
317
318
  getAgentSkillAvailability: this.deps.getAgentSkillAvailability,
318
319
  getWorkspace: () => this.deps.workspace,
319
320
  getConfig: () => this.deps.getConfig?.(),
@@ -634,7 +635,7 @@ var AgentToolsFactory = class AgentToolsFactory {
634
635
  allowHostGit: () => getCommandIsolation()?.mode !== "docker"
635
636
  }));
636
637
  }
637
- const selected = filterToolsByDisabledSet(core.map(markCodemodeCoreRead), disabled).filter((tool) => (!allowed || allowed.has(tool.name)) && !(personalToolsConfigured && tool.name === "clarify")).map((tool) => personalToolsConfigured && PERSONAL_TOOL_DESCRIPTIONS[tool.name] ? {
638
+ const selected = filterToolsByDisabledSet(core.map(markCodemodeCoreRead), disabled).filter((tool) => (!allowed || allowed.has(tool.name)) && !(personalToolsConfigured && tool.name === "clarify")).map((tool) => personalToolsConfigured && !tool.name.startsWith("personal_") && PERSONAL_TOOL_DESCRIPTIONS[tool.name] ? {
638
639
  ...tool,
639
640
  description: PERSONAL_TOOL_DESCRIPTIONS[tool.name]
640
641
  } : tool);
@@ -1,6 +1,6 @@
1
1
  import { checkUrlSafety, checkWebsiteBlocklist } from "./url-safety.js";
2
- import { lookup } from "node:dns";
3
2
  import { Agent, fetch } from "undici";
3
+ import { lookup } from "node:dns";
4
4
  //#region src/agent/tools/fetch-text.ts
5
5
  /** Validate each redirect and the address actually used for the connection. */
6
6
  async function fetchPublicText(input, blocklist, signal) {
@@ -1,12 +1,12 @@
1
1
  import { getAgentDefaultImageGenerationModelConfig, init_schema } from "../../config/schema.js";
2
+ import { readWorkspaceFile, writeWorkspaceFile } from "../sandbox/fileAccess.js";
2
3
  import { imageAssetFromDataUrl, imageFileExtensionForMimeType, mimeTypeFromFileName, parseImageDataUrl, sniffImageMimeType } from "../image/generation/image-assets.js";
3
- import { getImageGenerationProvider } from "../image/generation/provider-registry.js";
4
+ import { persistToolMedia } from "./tool-media.js";
4
5
  import { buildCapabilityPlansForConfig } from "../../capabilities/readiness/from-config.js";
5
6
  import "../../capabilities/readiness/index.js";
6
7
  import { applyImageGenerationModelConfigDefaults } from "../image/image-helpers.js";
7
- import { readWorkspaceFile, writeWorkspaceFile } from "../sandbox/fileAccess.js";
8
- import { persistToolMedia } from "./tool-media.js";
9
8
  import { isFailoverError } from "../failover-error.js";
9
+ import { getImageGenerationProvider } from "../image/generation/provider-registry.js";
10
10
  import { generateImage, listImageGenerationProvidersSummary } from "../image/generation/runtime.js";
11
11
  import path from "node:path";
12
12
  import { randomBytes } from "node:crypto";
@@ -1,13 +1,8 @@
1
- import { assertBrowserUrlAllowed } from "../../browser/url-policy.js";
2
- import { BrowserRuntime } from "../../browser/runtime/browser-runtime.js";
3
- import "../../browser/index.js";
4
1
  import { DEFAULT_TOOL_METADATA, getToolMetadata } from "./metadata.js";
5
2
  import { ToolConcurrencyController, resolveToolLockMode } from "./concurrency.js";
6
- import { resolveImageModelConfigForTool } from "../image/tool-model-config.js";
7
- import { createDataBatchTool } from "./dataBatch.js";
8
- import { DEFAULT_DELEGATE_TOOLS, DELEGATE_BLOCKED_TOOLS, createDelegateTool } from "./delegate-tool.js";
9
3
  import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, GREP_MAX_LINE_LENGTH, formatSize, truncateHead, truncateLine, truncateTail } from "./truncate.js";
10
4
  import { createReadFileTool } from "./read.js";
5
+ import { createDataBatchTool } from "./dataBatch.js";
11
6
  import { createWriteFileTool, writeFileTool } from "./write.js";
12
7
  import { createListDirTool, listDirTool } from "./list-dir.js";
13
8
  import { createPublishArtifactsTool } from "./publish-artifacts.js";
@@ -31,6 +26,11 @@ import { createUpdatePlanTool } from "./update-plan-tool.js";
31
26
  import { createSessionStatusTool } from "./session-status-tool.js";
32
27
  import { createMemoryMaintenanceTool } from "./memory-maintenance-tool.js";
33
28
  import { createClarifyTool } from "./clarify-tool.js";
29
+ import { assertBrowserUrlAllowed } from "../../browser/url-policy.js";
30
+ import { BrowserRuntime } from "../../browser/runtime/browser-runtime.js";
31
+ import "../../browser/index.js";
32
+ import { resolveImageModelConfigForTool } from "../image/tool-model-config.js";
33
+ import { DEFAULT_DELEGATE_TOOLS, DELEGATE_BLOCKED_TOOLS, createDelegateTool } from "./delegate-tool.js";
34
34
  import { createWorkflowTool } from "./workflow-tool.js";
35
35
  import { createWorkflowManageTool } from "./workflow-manage-tool.js";
36
36
  import { createAutomationTool } from "./automation-tool.js";
@@ -1,5 +1,5 @@
1
- import { resolvePathUnderWorkspace } from "./tool-paths.js";
2
1
  import { checkedFilePath } from "../sandbox/fileAccess.js";
2
+ import { resolvePathUnderWorkspace } from "./tool-paths.js";
3
3
  import { readdir } from "fs/promises";
4
4
  import { Type } from "@sinclair/typebox";
5
5
  //#region src/agent/tools/list-dir.ts
@@ -2,6 +2,8 @@ import type { AgentTool } from '@earendil-works/pi-agent-core';
2
2
  import type { Config } from '../../config/schema.js';
3
3
  declare const schema: import("@sinclair/typebox").TObject<{
4
4
  command: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"list">, import("@sinclair/typebox").TLiteral<"follow">, import("@sinclair/typebox").TLiteral<"pause">, import("@sinclair/typebox").TLiteral<"end">, import("@sinclair/typebox").TLiteral<"resume">, import("@sinclair/typebox").TLiteral<"settings">, import("@sinclair/typebox").TLiteral<"interests">, import("@sinclair/typebox").TLiteral<"feedback">, import("@sinclair/typebox").TLiteral<"rollback">]>;
5
+ offset: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
6
+ limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
5
7
  id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
6
8
  subject: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
7
9
  summary: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -1,7 +1,8 @@
1
1
  import { getSqliteDatabase, init_transaction } from "../../storage/sqlite/transaction.js";
2
2
  import { init_session_instance_repository, readCurrentTranscriptId } from "../../storage/sqlite/session-instance-repository.js";
3
- import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
4
3
  import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
4
+ import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
5
+ import { boundedPersonalResult } from "./personal-result-budget.js";
5
6
  import { parseLocalCheckTime } from "../../personal-agent/proactivity/follow-up-request.js";
6
7
  import { applyThreadFeedback, getAttention, getProactivitySettings, listAttention, listInterestCandidates, patchAttention, patchProactivitySettings, rollbackStrategy, saveAttention, strategyState, userText } from "../../personal-agent/proactivity/repository.js";
7
8
  import { Type } from "@sinclair/typebox";
@@ -20,6 +21,11 @@ const schema = Type.Object({
20
21
  Type.Literal("feedback"),
21
22
  Type.Literal("rollback")
22
23
  ]),
24
+ offset: Type.Optional(Type.Integer({ minimum: 0 })),
25
+ limit: Type.Optional(Type.Integer({
26
+ minimum: 1,
27
+ maximum: 20
28
+ })),
23
29
  id: Type.Optional(Type.String()),
24
30
  subject: Type.Optional(Type.String({ maxLength: 160 })),
25
31
  summary: Type.Optional(Type.String({ maxLength: 1600 })),
@@ -39,6 +45,35 @@ const schema = Type.Object({
39
45
  ])),
40
46
  preparation: Type.Optional(Type.Union([Type.Literal("brief"), Type.Literal("thorough")])),
41
47
  versionId: Type.Optional(Type.String({ description: "Latest strategy version ID returned by list; required for rollback." }))
48
+ }, {
49
+ additionalProperties: false,
50
+ anyOf: [
51
+ { properties: { command: { enum: [
52
+ "list",
53
+ "settings",
54
+ "interests"
55
+ ] } } },
56
+ {
57
+ properties: { command: { const: "follow" } },
58
+ required: ["subject"]
59
+ },
60
+ {
61
+ properties: { command: { enum: [
62
+ "pause",
63
+ "end",
64
+ "resume"
65
+ ] } },
66
+ required: ["id"]
67
+ },
68
+ {
69
+ properties: { command: { const: "feedback" } },
70
+ required: ["id", "feedback"]
71
+ },
72
+ {
73
+ properties: { command: { const: "rollback" } },
74
+ required: ["id", "versionId"]
75
+ }
76
+ ]
42
77
  });
43
78
  function createPersonalAttentionTool(deps) {
44
79
  return {
@@ -59,30 +94,29 @@ function createPersonalAttentionTool(deps) {
59
94
  }],
60
95
  details: {}
61
96
  };
62
- if (input.command === "interests") {
63
- if (!resolveUserContextSessionAccess(config, conversationId).userModel) throw new Error("Interest access is unavailable");
97
+ if (input.command === "interests" || input.command === "list") {
98
+ if (input.command === "interests" && !resolveUserContextSessionAccess(config, conversationId).userModel) throw new Error("Interest access is unavailable");
99
+ const rows = input.command === "interests" ? listInterestCandidates(conversationId) : listAttention(conversationId).map((thread) => ({
100
+ id: thread.id,
101
+ subject: thread.subject,
102
+ status: thread.status,
103
+ nextCheckAt: thread.next_check_at,
104
+ revision: thread.revision,
105
+ strategy: strategyState(thread.id)
106
+ }));
107
+ const offset = input.offset ?? 0;
64
108
  return {
65
109
  content: [{
66
110
  type: "text",
67
- text: JSON.stringify(listInterestCandidates(conversationId))
111
+ text: JSON.stringify(boundedPersonalResult({
112
+ items: rows.slice(offset, offset + (input.limit ?? 10)),
113
+ total: rows.length,
114
+ offset
115
+ }))
68
116
  }],
69
117
  details: {}
70
118
  };
71
119
  }
72
- if (input.command === "list") return {
73
- content: [{
74
- type: "text",
75
- text: JSON.stringify(listAttention(conversationId).map((thread) => ({
76
- id: thread.id,
77
- subject: thread.subject,
78
- status: thread.status,
79
- nextCheckAt: thread.next_check_at,
80
- revision: thread.revision,
81
- strategy: strategyState(thread.id)
82
- })))
83
- }],
84
- details: {}
85
- };
86
120
  const db = getSqliteDatabase();
87
121
  const transcriptId = readCurrentTranscriptId(db, conversationId);
88
122
  const source = db.prepare("SELECT entry_id,payload_json FROM transcript_entries WHERE transcript_id = ? AND role = 'user' ORDER BY seq DESC LIMIT 1").get(transcriptId);
@@ -20,6 +20,12 @@ const schema = Type.Object({
20
20
  minimum: 1,
21
21
  maximum: 10
22
22
  }))
23
+ }, {
24
+ additionalProperties: false,
25
+ anyOf: [{ properties: { command: { const: "list" } } }, {
26
+ properties: { command: { const: "get" } },
27
+ required: ["id"]
28
+ }]
23
29
  });
24
30
  const fields = [
25
31
  "id",
@@ -52,11 +58,15 @@ function compact(value, textLimit) {
52
58
  result[key] = entry.slice(0, textLimit);
53
59
  if (entry.length > textLimit) truncatedFields.push(key);
54
60
  } else if (typeof entry === "number" || typeof entry === "boolean" || entry === null) result[key] = entry;
55
- else if (entry && typeof entry === "object" && !Array.isArray(entry)) result[key] = Object.fromEntries(Object.entries(entry).slice(0, 12).filter(([, item]) => [
56
- "string",
57
- "number",
58
- "boolean"
59
- ].includes(typeof item) || item === null).map(([field, item]) => [field, typeof item === "string" ? item.slice(0, 200) : item]));
61
+ else if (entry && typeof entry === "object" && !Array.isArray(entry)) {
62
+ const nested = Object.entries(entry);
63
+ if (nested.length > 12 || nested.some(([, item]) => typeof item === "string" && item.length > 200 || item !== null && typeof item === "object")) truncatedFields.push(key);
64
+ result[key] = Object.fromEntries(nested.slice(0, 12).filter(([, item]) => [
65
+ "string",
66
+ "number",
67
+ "boolean"
68
+ ].includes(typeof item) || item === null).map(([field, item]) => [field, typeof item === "string" ? item.slice(0, 200) : item]));
69
+ } else if (Array.isArray(entry)) truncatedFields.push(key);
60
70
  }
61
71
  if (truncatedFields.length) result.truncatedFields = truncatedFields;
62
72
  return result;
@@ -119,7 +129,7 @@ function createPersonalReadTool(deps) {
119
129
  items: selected.map((row) => compact(row, 200)),
120
130
  offset,
121
131
  total: result.total ?? rows.length,
122
- nextOffset: selected.length === limit ? offset + selected.length : void 0,
132
+ nextOffset: offset + selected.length < Number(result.total ?? rows.length) ? offset + selected.length : void 0,
123
133
  excerpts: true
124
134
  };
125
135
  }