@xopcai/xopc 0.0.364 → 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.
- package/dist/browser-ext/dist/sidepanel.js +16 -4
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-GvR2gZ0T.js → activity-store-SVmnh__i.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-7Ct-ZlfL.js → agent-avatar-dicebear-CS9lg5h2.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-wYj-iyqv.js → agent-defaults-settings-panel-CvUPtxS4.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-C9HYMhnJ.js → agent-plugin-dialog-1tRxDfjI.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-admin-api-BkXb7VEZ.js → agents-admin-api-CVdFV-cU.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-hPkFQ81z.js → agents-gdT0whx9.js} +3 -3
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CjfsIn9A.js → app-management-settings-panel-CaxnUxvy.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-qqHZ15GU.js → appearance-settings-6NKquG3v.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-Ba2VkQk6.js → apps-page-BoB3MbsB.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-CKe3qAaL.js → archive-plugin-BWtLZtK1.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Bt8Q58ut.js → automations-page-CNngHw2c.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-Ch0ViAJW.js → automations-workspace-BKHsdiQ8.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-J51oS7-D.js → binary-plugins-fIhH-wg6.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-ClRFbHP7.js → block-editor-BhstSZNE.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-5B3qAdmb.js → browser-automation-inputs-B6sOBxVA.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BjMub7JM.js → browser-automations-page-HZAKkVVt.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-CYrPA-Fp.js → browser-settings-page-D8IpVQI6.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-CT_ZW9fT.js → capabilities-C4grvUkw.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BKu9BqPe.js → capabilities-CAIQmCrH.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-dW6FXtOy.js → capabilities-page-DK8FJRW4.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-gZ8auLwa.js → capabilities-settings-panel-BP2roWcM.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-header-actions-L1NvoOUG.js → capability-header-actions-BA1M7RRP.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-Dx5T2G73.js → channels-EQGCxr8W.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DsCpKPBe.js → chat-terminal-dock-KS_yk1H7.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-6FWwxYLe.js → computer-settings-page-CGBR0KFw.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-mtH9mEBf.js → connector-service-page-CY_3H_l9.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-DgDLaws0.js → connectors-page-CUOL6JX0.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-BDcwEaIx.js → date-picker-CDSZ-PWV.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-B_fPQBTM.js → dependency-picker-CyNH4m20.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CJrO9Vd_.js → desktop-pet-BsZQsQ2_.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DYAfri9w.js → desktop-pet-settings-DMgkUy6g.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-CqRys2R8.js → device-pairing-wizard-JjbUN8y-.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-D7_qSxNZ.js → directory-picker-path-field-CBTI3tKh.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BGyJpRv4.js → extension-debug-page-C7nSpOKj.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-D1zBmd8F.js → extension-page-BYUjAvsZ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-F9JzOWZ3.js → extension-provider-DaLt3bC-.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CTR8AjCG.js → extension-settings-page-CRasspq0.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-Chhv4Nfv.js → fallback-models-BLJFYASE.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-CoRoOG1l.js → gateway-config-swr-DIIzvDLQ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-D0ygm6bc.js → gateway-realtime-DD70L42G.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DeUVEPPE.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-BVfz4Tla.js → gateway-settings-B9n5naCr.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-FDS6S6qa.js → gateway-startup-retry-D_EwU7-6.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-BF_9C9yW.js → home-page-BP6qAgBt.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-BPd76jW5.js → image-generation-api-BkK22JsL.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-9EnECtcl.js → imports-page-YJKcTKKr.js} +1 -1
- package/dist/gateway/static/root/assets/index-6JNNrzCq.js +106 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-MC7mG2h2.js → keyboard-shortcuts-settings-BG_kM_Rm.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CytNu0-_.js → local-app-workbench-page-lHi21M1T.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-c3HncHZ3.js → local-apps-page-jqthjcQO.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-C4et6msJ.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-DId6-v2R.js → locale-store-CvNO-hbt.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-D4aXtitd.js → logs-page-CH7W-dm5.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-CRzWi_iJ.js → management-settings-DVgI_KNm.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DQZ51j9e.js → markdown-view-DDJlD5jR.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-XLewwq2q.js → media-plugins-C25mOgs2.js} +1 -1
- package/dist/gateway/static/root/assets/messages-pGa2qMzG.js +3 -0
- package/dist/gateway/static/root/assets/models-hub-cache-DzFiL4xV.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-BgbByI-4.js → note-detail-panel-kyX-n1db.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-api-Byt65v3r.js → notes-api-CKLw9vjk.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-R2BX5XCE.js → notes-page-CLZygZlm.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-BYsCbyGZ.js → oauth-api-CC5KkSgG.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-RBp1QK0F.js → page-context-capture-button-KX9mrcJW.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-F0jTBWva.js → personal-page-DnXlcJNJ.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BtDK68qb.js → product-open-page-D7pknlCh.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-DmQEm0yH.js → project-detail-page-DhV9DPj8.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-CrLQvkHX.js → projects-page-D181xkFw.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-7F2WNEZC.js → registry-api-CiN49wvk.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-C25_hQAd.js → remote-access-hub-CQnBARQW.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-B0c120iI.js → runtime-tools-settings-panel-wZjlSBiM.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-DM64yMnx.js → scenes-page-DWt54veq.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DQpQc9tH.js → schema-form-CMB61TV1.js} +1 -1
- package/dist/gateway/static/root/assets/secret-input-D93UrW4C.js +1 -0
- package/dist/gateway/static/root/assets/{send-session-input-D1oc6BC6.js → send-session-input-jH6MQwdZ.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-N3N37MrR.js → session-api-CW2X7g_U.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-CMGUwtbN.js → session-manager-BDpdi3lF.js} +2 -2
- package/dist/gateway/static/root/assets/{sessions-page-DvDO8LtA.js → sessions-page-DPEdjUdR.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-B6WGnTLY.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-GgBEp6O7.js → settings-page-Ch71KQjb.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-10bMi6yL.js → setup-status-panel-C7sLy8Hl.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-TBBGJPfT.js → share-link-dialog-DCSmx-Rl.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-DyRLPsPv.js → share-preview-page-C93IM3QK.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-DU0fHP2G.js → shares-api-B4rLfG3l.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DJ1ME-XM.js → shares-settings-C_6idV8e.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-1Puv6wOz.js → skill-api-sKX8SSlQ.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-ClyFqHk7.js → skill-reload-api-Ro-s69NW.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-D52pEr5x.js → skills-page-TsrjLYcI.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel--yV67a8L.js → system-settings-panel-DIjaUlla.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-D-tcS2bS.js → task-detail-page-B4Lby289.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-OhcbFEUR.js → theme-store-DbRLBHVY.js} +1 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-IgY26AYH.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-COLdiP_E.js → tunnel-api-CgARwbus.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-CtM5IfrL.js → usage-page-CKju62Cm.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-veoM0dHn.js → use-autosave-C889OTsP.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-DB0bBGzZ.js → use-composer-attachments-Dlm9EFTO.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-Bope6MW6.js → use-file-preview-expanded-BOpcSApw.js} +2 -2
- package/dist/gateway/static/root/assets/{user-model-page-CSh61kZ5.js → user-model-page-CTkCLRhE.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-CwD6a3KQ.js → voice-api-key-field-evWflGY6.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-Daexehmc.js → voice-config-api-CZoV2Lt4.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-C9u7tuEc.js → work-discovery-overlay-B2-2F39_.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BMOBbf33.js → workflow-run-setup-panel-cOGM8Nug.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-BrD9vXqO.js → workflows-page-Csk8xrRk.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-Cs4sjV2A.js → workspace-api-B9M9ECTB.js} +2 -2
- package/dist/gateway/static/root/index.html +28 -28
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/session-input-command.js +1 -0
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +35 -3
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/context/execution-context.js +1 -1
- package/dist/src/agent/context/project-context.js +4 -4
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/prompt/voice-presentation.d.ts +1 -1
- package/dist/src/agent/prompt/voice-presentation.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +17 -1
- package/dist/src/agent/service.js +3 -3
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/tools/delegation-parent-policy.js +2 -0
- package/dist/src/agent/tools/delegation-policy.js +2 -0
- package/dist/src/agent/tools/factory.d.ts +2 -0
- package/dist/src/agent/tools/factory.js +26 -4
- package/dist/src/agent/tools/index.d.ts +2 -2
- package/dist/src/agent/tools/index.js +3 -3
- package/dist/src/agent/tools/knowledge-memory-tool.d.ts +2 -0
- package/dist/src/agent/tools/knowledge-memory-tool.js +60 -1
- package/dist/src/agent/tools/personal-task-tool.d.ts +12 -8
- package/dist/src/agent/tools/personal-task-tool.js +35 -41
- package/dist/src/agent/tools/user-context-tool.d.ts +2 -0
- package/dist/src/agent/tools/user-context-tool.js +61 -2
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +1 -1
- package/dist/src/agent-catalog/repository.d.ts +1 -0
- package/dist/src/agent-catalog/repository.js +4 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/chat-commands/personal-command-policy.d.ts +2 -0
- package/dist/src/chat-commands/personal-command-policy.js +9 -0
- package/dist/src/chat-commands/registry.js +6 -0
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/observability.js +8 -0
- package/dist/src/gateway/hono/routes/projects.js +3 -3
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +9 -1
- package/dist/src/gateway/hono/routes/sessions.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/service/agent-runner.d.ts +1 -0
- package/dist/src/gateway/service/agent-runner.js +12 -1
- package/dist/src/gateway/service/run-gateway-agent.d.ts +1 -0
- package/dist/src/gateway/service/run-gateway-agent.js +15 -0
- package/dist/src/gateway/service/session-command-service.js +5 -3
- package/dist/src/gateway/service/session-input-coordinator.d.ts +12 -0
- package/dist/src/gateway/service/session-input-coordinator.js +63 -5
- package/dist/src/gateway/service/sessions-api.js +1 -1
- package/dist/src/gateway/service.d.ts +2 -0
- package/dist/src/gateway/service.js +16 -10
- package/dist/src/gateway/session-context-summary.js +1 -1
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/local-apps/service.js +2 -2
- package/dist/src/personal-agent/capability-service.js +3 -2
- package/dist/src/personal-agent/communication.d.ts +3 -2
- package/dist/src/personal-agent/communication.js +4 -3
- package/dist/src/personal-agent/conversation-state.d.ts +5 -0
- package/dist/src/personal-agent/conversation-state.js +17 -0
- package/dist/src/personal-agent/persona.d.ts +6 -0
- package/dist/src/personal-agent/persona.js +16 -0
- package/dist/src/personal-agent/policy.d.ts +3 -1
- package/dist/src/personal-agent/policy.js +26 -6
- package/dist/src/personal-agent/prompt-context.d.ts +10 -0
- package/dist/src/personal-agent/prompt-context.js +119 -0
- package/dist/src/personal-agent/prompts.d.ts +7 -0
- package/dist/src/personal-agent/prompts.js +124 -0
- package/dist/src/personal-agent/reply-composer.d.ts +1 -1
- package/dist/src/personal-agent/reply-composer.js +39 -11
- package/dist/src/personal-agent/repository.d.ts +1 -1
- package/dist/src/personal-agent/repository.js +1 -1
- package/dist/src/personal-agent/request-delivery.js +1 -1
- package/dist/src/personal-agent/request-service.js +2 -2
- package/dist/src/personal-agent/service.d.ts +1 -2
- package/dist/src/personal-agent/service.js +5 -93
- package/dist/src/personal-agent/specialist-capabilities.d.ts +9 -0
- package/dist/src/personal-agent/specialist-capabilities.js +37 -0
- package/dist/src/session/init-session-turn.js +10 -0
- package/dist/src/session/store.js +1 -1
- package/dist/src/storage/sqlite/migrations/235_personal_conversation_priority.sql +3 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.d.ts +2 -0
- package/dist/src/storage/sqlite/session-input-repository.js +18 -5
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/execution-context.js +1 -1
- package/dist/src/tasks/task-main-update-decision-service.js +1 -1
- package/dist/src/tasks/task-result-delivery-service.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/voice/realtime/agentEngine.js +32 -7
- package/dist/src/voice/realtime/engine.d.ts +1 -0
- package/dist/src/voice/realtime/omniEngine.d.ts +1 -0
- package/dist/src/voice/realtime/omniEngine.js +10 -0
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/runtime.d.ts +1 -0
- package/dist/src/voice/realtime/runtime.js +5 -0
- package/dist/src/voice/realtime/runtime.types.d.ts +2 -0
- package/dist/src/work-discovery/service.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/gateway-realtime-store-DBvCRclh.js +0 -1
- package/dist/gateway/static/root/assets/index-BpXej9jJ.js +0 -106
- package/dist/gateway/static/root/assets/local-session-drafts-gbemPamv.js +0 -1
- package/dist/gateway/static/root/assets/messages-BHvpZNe9.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-cache-B9SKjidc.js +0 -1
- package/dist/gateway/static/root/assets/secret-input-DPl3VYM8.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BNhgbmcX.js +0 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-DoBJ0TYY.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BindingsSchema, init_binding_schema } from "../../../../routing/binding-schema.js";
|
|
2
|
-
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
3
2
|
import { CredentialResolver, init_credentials } from "../../../../auth/credentials.js";
|
|
4
3
|
import { ComputerConfigSchema, init_config } from "../../../../computer/config.js";
|
|
5
4
|
import { ContextPlanningConfigSchema, HomeIntelligenceConfigSchema, KnowledgeMemoryConfigSchema, UserContextConfigSchema, UserModelConfigSchema, init_config as init_config$1 } from "../../../../user-context/config.js";
|
|
6
5
|
import { BrowserConfigSchema, McpConfigSchema, VoiceConfigSchema, init_schema } from "../../../../config/schema.js";
|
|
7
6
|
import { canonicalizeConfiguredMcpServer } from "../../../../config/mcp-config-normalize.js";
|
|
7
|
+
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
8
8
|
import { mergeGatewaySkillsMarketplacePatch, mergeSessionConfigPatch, mergeUpdateConfigPatch } from "../../../../config/web-patch.js";
|
|
9
9
|
import { assertGatewayAuthConfigured, resolveGatewayAuth } from "../../../auth.js";
|
|
10
10
|
import { isMaskedSecretPatchValue } from "../../lib/mask-secret-length.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { NoteDeleteOutputSchema, NoteGetOutputSchema, ProductReadContracts } from "../../../../packages/gateway-contract/src/capabilities.js";
|
|
2
2
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
4
|
-
import "../../../capabilities/runtime/dispatcher.js";
|
|
5
3
|
import { init_session_key, resolveConversationId } from "../../../routing/session-key.js";
|
|
6
4
|
import { agentExists, getDefaultAgentId, init_resolve_route } from "../../../routing/resolve-route.js";
|
|
5
|
+
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
6
|
+
import "../../../capabilities/runtime/dispatcher.js";
|
|
7
7
|
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
8
8
|
import { getShareStore } from "../../../share/share-store.js";
|
|
9
9
|
import { resolveShareUrl } from "../../../share/share-url.js";
|
|
@@ -71,6 +71,14 @@ function registerObservabilityRoutes(authenticated, { service, strictRateLimitMi
|
|
|
71
71
|
await configureTracing(service.currentConfig.observability?.tracing);
|
|
72
72
|
return c.json({ ok: true });
|
|
73
73
|
});
|
|
74
|
+
app.post("/tracing/langfuse/credentials/:field/reveal", strictRateLimitMiddleware, async (c) => {
|
|
75
|
+
const field = z.enum(["publicKey", "secretKey"]).parse(c.req.param("field"));
|
|
76
|
+
const environmentKey = field === "publicKey" ? "LANGFUSE_PUBLIC_KEY" : "LANGFUSE_SECRET_KEY";
|
|
77
|
+
const provider = field === "publicKey" ? "langfuse-public" : "langfuse";
|
|
78
|
+
const key = process.env[environmentKey] || await new CredentialResolver().revealGatewayStoredApiKey(provider);
|
|
79
|
+
c.header("Cache-Control", "no-store");
|
|
80
|
+
return c.json({ key: key || null });
|
|
81
|
+
});
|
|
74
82
|
app.delete("/tracing/langfuse/credentials", strictRateLimitMiddleware, async (c) => {
|
|
75
83
|
const resolver = new CredentialResolver();
|
|
76
84
|
await resolver.deleteProviderCredential("langfuse");
|
|
@@ -7,12 +7,12 @@ import { loadTranscriptRowsForSession } from "../../../storage/sqlite/transcript
|
|
|
7
7
|
import { init_sqlite } from "../../../storage/sqlite/index.js";
|
|
8
8
|
import { ActivityService } from "../../../activity/service.js";
|
|
9
9
|
import "../../../activity/index.js";
|
|
10
|
-
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
11
|
-
import "../../../capabilities/runtime/dispatcher.js";
|
|
12
10
|
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
13
|
-
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
14
11
|
import { listKnowledgeItems, writeKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
15
12
|
import "../../../knowledge-memory/index.js";
|
|
13
|
+
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
14
|
+
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
15
|
+
import "../../../capabilities/runtime/dispatcher.js";
|
|
16
16
|
import { ProjectWorkspaceConflictError, ProjectWorkspaceMissingError } from "../../../projects/workspace-project.js";
|
|
17
17
|
import { inferProjectExecutionMode, inferProjectKind } from "../../../projects/project-kind.js";
|
|
18
18
|
import { ProjectDeletionBlockedError, ProjectWorkspaceInUseError } from "../../../projects/project-service.js";
|
|
@@ -42,6 +42,7 @@ export declare function submitSessionInput(c: Context, deps: AuthenticatedRouteD
|
|
|
42
42
|
conversationId: string;
|
|
43
43
|
clientMessageId: string;
|
|
44
44
|
expectedTranscriptId?: string;
|
|
45
|
+
interruptRequested?: boolean;
|
|
45
46
|
requestedDelivery: import("../../../storage/sqlite/session-input-repository.js").SessionInputDelivery;
|
|
46
47
|
effectiveDelivery: import("../../../storage/sqlite/session-input-repository.js").SessionInputDelivery;
|
|
47
48
|
status: import("../../../storage/sqlite/session-input-repository.js").SessionInputStatus;
|
|
@@ -186,6 +187,7 @@ export declare function replaceLatestSessionTurn(c: Context, deps: Authenticated
|
|
|
186
187
|
conversationId: string;
|
|
187
188
|
clientMessageId: string;
|
|
188
189
|
expectedTranscriptId?: string;
|
|
190
|
+
interruptRequested?: boolean;
|
|
189
191
|
requestedDelivery: import("../../../storage/sqlite/session-input-repository.js").SessionInputDelivery;
|
|
190
192
|
effectiveDelivery: import("../../../storage/sqlite/session-input-repository.js").SessionInputDelivery;
|
|
191
193
|
status: import("../../../storage/sqlite/session-input-repository.js").SessionInputStatus;
|
|
@@ -4,9 +4,9 @@ import { browserPageContextsInputSchema } from "../../../../packages/gateway-con
|
|
|
4
4
|
import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packages/gateway-contract/src/user-turn-document.js";
|
|
5
5
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
6
6
|
import { endpointTurnClaimSchema, init_src as init_src$1 } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
7
|
+
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
7
8
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
8
9
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
9
|
-
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
10
10
|
import { getModelThinking } from "../../../providers/model-thinking.js";
|
|
11
11
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
12
12
|
import { isTaskDestructiveCommand } from "../../../session/reset-triggers.js";
|
|
@@ -105,6 +105,13 @@ async function submitSessionInput(c, deps, conversationId, options) {
|
|
|
105
105
|
message: "Missing delivery"
|
|
106
106
|
}
|
|
107
107
|
}, 400);
|
|
108
|
+
if (body.interrupt !== void 0 && typeof body.interrupt !== "boolean") return c.json({
|
|
109
|
+
ok: false,
|
|
110
|
+
error: {
|
|
111
|
+
code: "BAD_REQUEST",
|
|
112
|
+
message: "interrupt must be a boolean"
|
|
113
|
+
}
|
|
114
|
+
}, 400);
|
|
108
115
|
const origin = endpointTurnClaimSchema.safeParse(body.origin);
|
|
109
116
|
if (!origin.success) return c.json({
|
|
110
117
|
ok: false,
|
|
@@ -202,6 +209,7 @@ async function submitSessionInput(c, deps, conversationId, options) {
|
|
|
202
209
|
conversationId,
|
|
203
210
|
clientMessageId: typeof body.clientMessageId === "string" ? body.clientMessageId : "",
|
|
204
211
|
delivery,
|
|
212
|
+
interrupt: body.interrupt,
|
|
205
213
|
content,
|
|
206
214
|
attachments,
|
|
207
215
|
contextRefs,
|
|
@@ -4,8 +4,8 @@ import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
|
4
4
|
import "../../../session/types.js";
|
|
5
5
|
import { SidebarLayoutConflictError, getSidebarLayout, init_sidebar_layout_repository, replaceSidebarLayout, sortBySidebarLayout } from "../../../storage/sqlite/sidebar-layout-repository.js";
|
|
6
6
|
import { summarizeAiUsageByConversations } from "../../../storage/sqlite/ai-usage-repository.js";
|
|
7
|
-
import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
8
7
|
import { isPersonalConversation } from "../../../personal-agent/repository.js";
|
|
8
|
+
import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
9
9
|
import { evictEmbeddedSessionRunner } from "../../../agent/embedded/session-runner.js";
|
|
10
10
|
import { SessionEnvironmentService } from "../../../execution-environments/session-environment-service.js";
|
|
11
11
|
import { deleteMediaUrisNoLongerReferenced } from "../../../media/session-references.js";
|
|
@@ -6,9 +6,9 @@ import { hasGatewayScope, init_gateway_scopes } from "../../security/gateway-sco
|
|
|
6
6
|
import { enqueueTaskChangedEvent, init_task_change_events } from "../../../tasks/task-change-events.js";
|
|
7
7
|
import { TaskRepository, init_task_repository } from "../../../tasks/task-repository.js";
|
|
8
8
|
import { TaskRunRepository, init_task_run_repository } from "../../../tasks/task-run-repository.js";
|
|
9
|
+
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
9
10
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
10
11
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
11
|
-
import { TaskConversationRepository } from "../../../tasks/task-conversation-repository.js";
|
|
12
12
|
import { TaskCriterionReviewRepository } from "../../../tasks/task-criterion-review-repository.js";
|
|
13
13
|
import { TaskContextMutationOutputSchema } from "../../../tasks/capabilities/relations.js";
|
|
14
14
|
import { TaskDeleteOutputSchema } from "../../../tasks/capabilities/management.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { voiceSelectionSchema } from "../../../../packages/realtime-protocol/src/voice-catalog.js";
|
|
2
2
|
import { createVoiceSessionRequestSchema, init_voice } from "../../../../packages/realtime-protocol/src/voice.js";
|
|
3
3
|
import { getDefaultModelSync, init_providers, resolveModel } from "../../../providers/index.js";
|
|
4
|
-
import { completeWithResolvedCredentials } from "../../../providers/model-call.js";
|
|
5
4
|
import { isPersonalConversation } from "../../../personal-agent/repository.js";
|
|
5
|
+
import { completeWithResolvedCredentials } from "../../../providers/model-call.js";
|
|
6
6
|
import { resolveSttProviderConfigSlice } from "../../../voice/stt/config-slice.js";
|
|
7
7
|
import { STTTranscriptionError, transcribe } from "../../../voice/stt/transcribe-core.js";
|
|
8
8
|
import { isSTTAvailable } from "../../../voice/stt/availability.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
3
|
import { init_agent_scope } from "../agent/agent-scope.js";
|
|
4
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
5
4
|
import { ConfigSchema, init_schema } from "../config/schema.js";
|
|
6
5
|
import { resolveEffectiveAgentConfigForAgent } from "../config/agent-profile.js";
|
|
7
6
|
import { fetchWithTimeoutGuarded } from "../media-shared/http/provider-http.js";
|
|
8
7
|
import "../media-shared/http/index.js";
|
|
8
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
9
9
|
import { getImageGenerationProvider, listImageGenerationProvidersSummary } from "../agent/image/generation/provider-registry.js";
|
|
10
10
|
//#region src/gateway/image-generation-setup.ts
|
|
11
11
|
init_repository();
|
|
@@ -56,6 +56,7 @@ export declare class GatewayAgentRunner {
|
|
|
56
56
|
unregisterExternalWebchatRun(conversationId: string, runId: string): void;
|
|
57
57
|
cancelClarificationForRun(runId: string): void;
|
|
58
58
|
runAgent(message: string, channel: string, chatId: string, origin: TurnOrigin, attachments?: UserTurnAttachment[], thinking?: string, runOptions?: {
|
|
59
|
+
inputReceivedAtMs?: number;
|
|
59
60
|
signal?: AbortSignal;
|
|
60
61
|
runId?: string;
|
|
61
62
|
taskRunId?: string;
|
|
@@ -6,6 +6,7 @@ import { TaskRepository, init_task_repository } from "../../tasks/task-repositor
|
|
|
6
6
|
import { createClarificationWait, getClarification, getClarificationSnapshot, init_clarification_wait_repository, resolveClarification, supersedeActiveClarification } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
7
7
|
import { init_connection_wait_repository, onConnectionWaitChanged } from "../../storage/sqlite/connection-wait-repository.js";
|
|
8
8
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
9
|
+
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
9
10
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
10
11
|
import { TaskCollaborationRepository } from "../../tasks/task-collaboration-repository.js";
|
|
11
12
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
@@ -57,9 +58,16 @@ var GatewayAgentRunner = class {
|
|
|
57
58
|
});
|
|
58
59
|
this.inputs = new SessionInputCoordinator({
|
|
59
60
|
beforeExecute: opts.validateConnectionResume,
|
|
61
|
+
prioritizeInput: (input) => (input.origin.type !== "system" || input.origin.source === "cli") && isPersonalConversation(input.conversationId),
|
|
62
|
+
interrupt: async (conversationId, runId) => {
|
|
63
|
+
const execution = this.activeExecutionBySession.get(conversationId);
|
|
64
|
+
if (execution && execution.kind !== "chat") return;
|
|
65
|
+
await this.abortAgentRun(runId);
|
|
66
|
+
},
|
|
60
67
|
sessionExists: async (conversationId) => Boolean(await opts.sessionIndex.getSessionMetadata(conversationId)),
|
|
61
68
|
execute: async (input) => {
|
|
62
69
|
const generator = this.runAgent(input.content, "webchat", input.conversationId, input.origin, input.attachments, input.thinking, {
|
|
70
|
+
inputReceivedAtMs: input.inputReceivedAtMs,
|
|
63
71
|
runId: input.runId,
|
|
64
72
|
taskRunId: input.taskRunId,
|
|
65
73
|
sourceContexts: input.sourceContexts,
|
|
@@ -110,7 +118,10 @@ var GatewayAgentRunner = class {
|
|
|
110
118
|
return fitSourceContextsToBudget(contexts.filter((context) => context !== null));
|
|
111
119
|
},
|
|
112
120
|
steer: (conversationId, content) => opts.getAgentService().turnDispatcher.steerWebchatSession(conversationId, content),
|
|
113
|
-
emit:
|
|
121
|
+
emit: (type, payload) => {
|
|
122
|
+
opts.emit(type, payload);
|
|
123
|
+
if (type === "session.input-interrupt") opts.publishRealtime("sessions", type, payload);
|
|
124
|
+
}
|
|
114
125
|
});
|
|
115
126
|
}
|
|
116
127
|
/** True when a webchat agent run is currently in-flight for `conversationId`. */
|
|
@@ -24,6 +24,7 @@ export type RunGatewayAgentDeps = {
|
|
|
24
24
|
* @param runOptions.signal — When set (e.g. client disconnect), aborts in-flight generation and persists partial output.
|
|
25
25
|
*/
|
|
26
26
|
export declare function runGatewayAgent(deps: RunGatewayAgentDeps, message: string, channel: string, chatId: string, origin: TurnOrigin, attachments?: UserTurnAttachment[], thinking?: string, runOptions?: {
|
|
27
|
+
inputReceivedAtMs?: number;
|
|
27
28
|
signal?: AbortSignal;
|
|
28
29
|
runId?: string;
|
|
29
30
|
taskRunId?: string;
|
|
@@ -32,6 +32,9 @@ const log = createLogger("Gateway:Service");
|
|
|
32
32
|
* @param runOptions.signal — When set (e.g. client disconnect), aborts in-flight generation and persists partial output.
|
|
33
33
|
*/
|
|
34
34
|
async function* runGatewayAgent(deps, message, channel, chatId, origin, attachments, thinking, runOptions) {
|
|
35
|
+
const runStartedAtMs = Date.now();
|
|
36
|
+
const inputReceivedAtMs = runOptions?.inputReceivedAtMs ?? runStartedAtMs;
|
|
37
|
+
let firstTextSeen = false;
|
|
35
38
|
const cappedAttachments = attachments && attachments.length > 10 ? attachments.slice(0, 10) : attachments;
|
|
36
39
|
if (attachments && cappedAttachments && attachments.length > cappedAttachments.length) log.debug({
|
|
37
40
|
dropped: attachments.length - cappedAttachments.length,
|
|
@@ -115,6 +118,18 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
115
118
|
};
|
|
116
119
|
const emitAndYield = function* (events) {
|
|
117
120
|
for (const event of events) {
|
|
121
|
+
if (!firstTextSeen && event.type === "assistant_delta" && event.payload.delta.trim()) {
|
|
122
|
+
firstTextSeen = true;
|
|
123
|
+
log.info({
|
|
124
|
+
conversationId: streamConversationId,
|
|
125
|
+
runId,
|
|
126
|
+
channel,
|
|
127
|
+
phase: "first_response_text",
|
|
128
|
+
latencyMs: Date.now() - runStartedAtMs,
|
|
129
|
+
inputToTextMs: Date.now() - inputReceivedAtMs,
|
|
130
|
+
queueMs: Math.max(0, runStartedAtMs - inputReceivedAtMs)
|
|
131
|
+
}, "Gateway first response text ready");
|
|
132
|
+
}
|
|
118
133
|
if (taskRun) captureTaskEvent(event);
|
|
119
134
|
if (channel === "webchat") publishRealtime(`run:${runId}`, event.type, event);
|
|
120
135
|
yield event;
|
|
@@ -2,9 +2,9 @@ import { getSessionMetadata } from "../../storage/sqlite/session-read-repository
|
|
|
2
2
|
import { init_session_repository } from "../../storage/sqlite/session-repository.js";
|
|
3
3
|
import { resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession } from "../../config/agent-profile.js";
|
|
4
4
|
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
5
|
+
import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
|
|
5
6
|
import { resolveProjectAgentId } from "../../projects/project-agent.js";
|
|
6
7
|
import "../../projects/index.js";
|
|
7
|
-
import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
|
|
8
8
|
import { getModelThinking } from "../../providers/model-thinking.js";
|
|
9
9
|
import { withModelConfigLock } from "../../session/model-config-lock.js";
|
|
10
10
|
import { SessionCommandError, acceptSessionCommand, getSessionPreparation, matchSessionInputReceipt, sessionCommandHash } from "../../storage/sqlite/session-creation-repository.js";
|
|
@@ -25,7 +25,7 @@ function validateCreation(service, creation) {
|
|
|
25
25
|
if (!getModelThinking(resolveModel(creation.model)).options.includes(creation.thinkingLevel)) throw new Error("Unsupported model thinking level");
|
|
26
26
|
}
|
|
27
27
|
async function receiveSessionCommand(service, conversationId, principalId, command, prepareSourceContexts = async () => []) {
|
|
28
|
-
|
|
28
|
+
const receive = () => withModelConfigLock(conversationId, async () => {
|
|
29
29
|
const personal = getPersonalAgentByConversation(conversationId);
|
|
30
30
|
if (personal && "creation" in command && command.creation.agentId !== personal.agentId) throw new SessionCommandError("BAD_REQUEST", "Personal AI identity is fixed");
|
|
31
31
|
const configuredThinking = ("creation" in command ? resolveEffectiveAgentConfigForAgent(command.creation.agentId) : resolveEffectiveAgentConfigForSession(conversationId)).config.runtime.thinkingLevel;
|
|
@@ -52,6 +52,7 @@ async function receiveSessionCommand(service, conversationId, principalId, comma
|
|
|
52
52
|
conversationId,
|
|
53
53
|
clientMessageId,
|
|
54
54
|
delivery: command.kind === "start" ? "next" : command.delivery,
|
|
55
|
+
interrupt: command.kind === "append" ? command.interrupt : void 0,
|
|
55
56
|
content: command.input.content,
|
|
56
57
|
attachments: command.input.attachments,
|
|
57
58
|
contextRefs: command.input.contextRefs,
|
|
@@ -64,9 +65,10 @@ async function receiveSessionCommand(service, conversationId, principalId, comma
|
|
|
64
65
|
}) : void 0,
|
|
65
66
|
attachProject: (id, projectId) => service.projects.attachSession(id, projectId)
|
|
66
67
|
});
|
|
67
|
-
if ("kind" in command && command.kind === "append" &&
|
|
68
|
+
if ("kind" in command && command.kind === "append" && receipt.inputId) await service.dispatchAcceptedSessionInput(conversationId, receipt.inputId);
|
|
68
69
|
return sessionCommandSnapshot(service, receipt);
|
|
69
70
|
});
|
|
71
|
+
return service.withSessionInputSubmission(conversationId, receive);
|
|
70
72
|
}
|
|
71
73
|
async function sessionCommandSnapshot(service, receipt) {
|
|
72
74
|
const { principalId: _principal, requestHash: _hash, ...identity } = receipt;
|
|
@@ -8,6 +8,8 @@ export type SubmitSessionInput = {
|
|
|
8
8
|
conversationId: string;
|
|
9
9
|
clientMessageId: string;
|
|
10
10
|
delivery: SessionInputDelivery;
|
|
11
|
+
/** False explicitly defers a Personal AI message or requests cooperative steering. */
|
|
12
|
+
interrupt?: boolean;
|
|
11
13
|
content: string;
|
|
12
14
|
attachments?: UserTurnAttachment[];
|
|
13
15
|
contextRefs?: TurnContextRef[];
|
|
@@ -20,13 +22,19 @@ export type ReplaceLatestTurnInput = SubmitSessionInput & {
|
|
|
20
22
|
};
|
|
21
23
|
export declare class SessionInputCoordinator {
|
|
22
24
|
private readonly deps;
|
|
25
|
+
private readonly pendingSubmissions;
|
|
26
|
+
private readonly resumeAfter;
|
|
23
27
|
private readonly draining;
|
|
24
28
|
private readonly submissionTails;
|
|
25
29
|
constructor(deps: {
|
|
30
|
+
prioritizeInput?: (input: SubmitSessionInput) => boolean;
|
|
31
|
+
interrupt?: (conversationId: string, runId: string) => Promise<void>;
|
|
32
|
+
coalesceWindowMs?: number;
|
|
26
33
|
onInputReceived?: (conversationId: string) => void;
|
|
27
34
|
beforeExecute?: (input: SessionInput) => Promise<boolean>;
|
|
28
35
|
sessionExists: (conversationId: string) => Promise<boolean>;
|
|
29
36
|
execute: (input: {
|
|
37
|
+
inputReceivedAtMs?: number;
|
|
30
38
|
runId: string;
|
|
31
39
|
taskRunId?: string;
|
|
32
40
|
conversationId: string;
|
|
@@ -44,6 +52,7 @@ export declare class SessionInputCoordinator {
|
|
|
44
52
|
steer: (conversationId: string, content: string) => Promise<boolean>;
|
|
45
53
|
emit: (type: string, payload: unknown) => void;
|
|
46
54
|
});
|
|
55
|
+
isAcceptingInput(conversationId: string): boolean;
|
|
47
56
|
snapshot(conversationId: string): SessionInputState;
|
|
48
57
|
prepareInput(input: SubmitSessionInput): Promise<{
|
|
49
58
|
status: "queued";
|
|
@@ -52,6 +61,7 @@ export declare class SessionInputCoordinator {
|
|
|
52
61
|
content: string;
|
|
53
62
|
attachments: UserTurnAttachment[];
|
|
54
63
|
contextRefs: import("../../agent/source-context/types.js").SourceContextRefSummary[];
|
|
64
|
+
interruptRequested: boolean;
|
|
55
65
|
contextSnapshots: AgentSourceContext[];
|
|
56
66
|
thinking: string;
|
|
57
67
|
origin: {
|
|
@@ -66,8 +76,10 @@ export declare class SessionInputCoordinator {
|
|
|
66
76
|
};
|
|
67
77
|
}>;
|
|
68
78
|
dispatchAcceptedInput(conversationId: string, inputId: string): Promise<void>;
|
|
79
|
+
private prioritizeAcceptedInput;
|
|
69
80
|
private publish;
|
|
70
81
|
private runSubmissionExclusive;
|
|
82
|
+
withSubmission<T>(conversationId: string, operation: () => Promise<T>): Promise<T>;
|
|
71
83
|
submit(input: SubmitSessionInput): Promise<{
|
|
72
84
|
ok: true;
|
|
73
85
|
effectiveDelivery: SessionInputDelivery;
|
|
@@ -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"
|
|
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
|
|
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,6 +76,12 @@ 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 { DiscussionService } from "../discussions/service.js";
|
|
80
|
+
import { DiscussionOrganizer } from "../discussions/organizer.js";
|
|
81
|
+
import { DiscussionLiveWorker } from "../discussions/live-worker.js";
|
|
82
|
+
import { DiscussionOrganizerWorker } from "../discussions/organizer-worker.js";
|
|
83
|
+
import { DiscussionSealer } from "../discussions/sealer.js";
|
|
84
|
+
import "../discussions/index.js";
|
|
79
85
|
import { ManagedComposioEventPoller } from "../connectors/composio-managed-events.js";
|
|
80
86
|
import { startConnectedKnowledgeCoordinator } from "../knowledge/coordinator.js";
|
|
81
87
|
import "../knowledge/index.js";
|
|
@@ -83,12 +89,6 @@ import { PersonalReplyComposer } from "../personal-agent/reply-composer.js";
|
|
|
83
89
|
import { ConnectionRecoveryService } from "../connectors/connection-recovery-service.js";
|
|
84
90
|
import { startConnectorLearningCoordinator } from "../connectors/learning-coordinator.js";
|
|
85
91
|
import { startConnectorSupervisor } from "../connectors/supervisor.js";
|
|
86
|
-
import { DiscussionService } from "../discussions/service.js";
|
|
87
|
-
import { DiscussionOrganizer } from "../discussions/organizer.js";
|
|
88
|
-
import { DiscussionLiveWorker } from "../discussions/live-worker.js";
|
|
89
|
-
import { DiscussionOrganizerWorker } from "../discussions/organizer-worker.js";
|
|
90
|
-
import { DiscussionSealer } from "../discussions/sealer.js";
|
|
91
|
-
import "../discussions/index.js";
|
|
92
92
|
import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
|
|
93
93
|
import "../endpoint-tools/index.js";
|
|
94
94
|
import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
|
|
@@ -261,6 +261,9 @@ var GatewayService = class {
|
|
|
261
261
|
});
|
|
262
262
|
this.emit("session.transcript_updated", { key: conversationId });
|
|
263
263
|
},
|
|
264
|
+
onConversationInput: (conversationId) => {
|
|
265
|
+
bumpSessionInputRevision(getSqliteDatabase(), conversationId);
|
|
266
|
+
},
|
|
264
267
|
getConfig: () => this.config,
|
|
265
268
|
sessionExists: async (conversationId) => Boolean(await this.sessionIndex.getSessionMetadata(conversationId)),
|
|
266
269
|
sessionBusy: (conversationId) => Boolean(this.agentRunner.getActiveRunId(conversationId)) || this.agentRunner.inputs.snapshot(conversationId).inputs.some((input) => input.status === "queued"),
|
|
@@ -844,7 +847,7 @@ var GatewayService = class {
|
|
|
844
847
|
await new TaskMainUpdateDelivery().drain({
|
|
845
848
|
isAvailable: (conversationId) => {
|
|
846
849
|
const state = this.agentRunner.inputs.snapshot(conversationId);
|
|
847
|
-
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));
|
|
848
851
|
},
|
|
849
852
|
decide: (input) => new TaskMainUpdateDecisionService({
|
|
850
853
|
getModelRef: (conversationId) => this.ensureAgentService().getModelForSession(conversationId),
|
|
@@ -896,7 +899,7 @@ var GatewayService = class {
|
|
|
896
899
|
});
|
|
897
900
|
};
|
|
898
901
|
await new TaskResultDeliveryService().drain(notify);
|
|
899
|
-
new PersonalReplyComposer().drain(notify).catch((err) => {
|
|
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) => {
|
|
900
903
|
log.error({
|
|
901
904
|
err,
|
|
902
905
|
phase: "task_result_reply"
|
|
@@ -1005,6 +1008,9 @@ var GatewayService = class {
|
|
|
1005
1008
|
submitSessionInput(...args) {
|
|
1006
1009
|
return this.agentRunner.submitSessionInput(...args);
|
|
1007
1010
|
}
|
|
1011
|
+
withSessionInputSubmission(conversationId, operation) {
|
|
1012
|
+
return this.agentRunner.inputs.withSubmission(conversationId, operation);
|
|
1013
|
+
}
|
|
1008
1014
|
prepareSessionCommandInput(input) {
|
|
1009
1015
|
return this.agentRunner.inputs.prepareInput(input);
|
|
1010
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();
|