@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
|
@@ -39,10 +39,13 @@ function createAgentVoiceEngine(options) {
|
|
|
39
39
|
const echoCandidates = new PlaybackEchoCandidates();
|
|
40
40
|
const finalizedUtterances = /* @__PURE__ */ new Set();
|
|
41
41
|
let pendingTurn;
|
|
42
|
+
let turnReceivedAtMs;
|
|
42
43
|
let taskUpdateQueued = false;
|
|
43
44
|
let lastUserSpeechAt = 0;
|
|
44
45
|
const turn = new TurnCoordinator(claim.silenceDurationMs, (text, decision, turnId) => {
|
|
45
46
|
if (closed || muted) return;
|
|
47
|
+
const receivedAtMs = turnReceivedAtMs ?? Date.now();
|
|
48
|
+
turnReceivedAtMs = void 0;
|
|
46
49
|
log.info({
|
|
47
50
|
sessionId: claim.sessionId,
|
|
48
51
|
turnId,
|
|
@@ -77,12 +80,14 @@ function createAgentVoiceEngine(options) {
|
|
|
77
80
|
const pending = {
|
|
78
81
|
turnId,
|
|
79
82
|
text,
|
|
80
|
-
cancelled: false
|
|
83
|
+
cancelled: false,
|
|
84
|
+
receivedAtMs,
|
|
85
|
+
committedAtMs: Date.now()
|
|
81
86
|
};
|
|
82
87
|
pendingTurn = pending;
|
|
83
88
|
conversationTail = conversationTail.then(() => {
|
|
84
89
|
if (pendingTurn === pending) pendingTurn = void 0;
|
|
85
|
-
if (generation === inputGeneration && !pending.cancelled) return runAssistantTurn(text, turnId).then(() => {});
|
|
90
|
+
if (generation === inputGeneration && !pending.cancelled) return runAssistantTurn(text, turnId, void 0, pending.receivedAtMs, pending.committedAtMs).then(() => {});
|
|
86
91
|
}).finally(() => {
|
|
87
92
|
if (generation === inputGeneration) queuedTurns -= 1;
|
|
88
93
|
});
|
|
@@ -156,7 +161,11 @@ function createAgentVoiceEngine(options) {
|
|
|
156
161
|
log.info({
|
|
157
162
|
sessionId: claim.sessionId,
|
|
158
163
|
responseId: response.id,
|
|
159
|
-
|
|
164
|
+
conversationId: claim.request.conversationId,
|
|
165
|
+
phase: "first_response_audio",
|
|
166
|
+
latencyMs: Date.now() - response.startedAt,
|
|
167
|
+
inputToAudioMs: Date.now() - response.inputReceivedAtMs,
|
|
168
|
+
textToAudioMs: response.firstTextAtMs === void 0 ? void 0 : Date.now() - response.firstTextAtMs
|
|
160
169
|
}, "Realtime voice first audio ready");
|
|
161
170
|
send("response.audio.started", {
|
|
162
171
|
responseId: response.id,
|
|
@@ -241,7 +250,7 @@ function createAgentVoiceEngine(options) {
|
|
|
241
250
|
if (response.speechWorker) prefetchNextSpeech(response);
|
|
242
251
|
else startSpeechWorker(response);
|
|
243
252
|
}
|
|
244
|
-
async function runAssistantTurn(text, turnId, updateClientMessageId) {
|
|
253
|
+
async function runAssistantTurn(text, turnId, updateClientMessageId, receivedAtMs = Date.now(), committedAtMs = receivedAtMs) {
|
|
245
254
|
if (!claim.tts || !claim.request.conversationId || !text.trim() || closed) return false;
|
|
246
255
|
cancelActiveResponse("barge_in");
|
|
247
256
|
const response = {
|
|
@@ -255,6 +264,8 @@ function createAgentVoiceEngine(options) {
|
|
|
255
264
|
speechQueue: [],
|
|
256
265
|
queuedSpeechCharacters: 0,
|
|
257
266
|
startedAt: Date.now(),
|
|
267
|
+
inputReceivedAtMs: receivedAtMs,
|
|
268
|
+
turnCommittedAtMs: committedAtMs,
|
|
258
269
|
firstTextSeen: false,
|
|
259
270
|
awaitingClarification: false,
|
|
260
271
|
taskDone: false,
|
|
@@ -289,12 +300,18 @@ function createAgentVoiceEngine(options) {
|
|
|
289
300
|
if (event.type === "assistant_delta" || event.type === "tool_end" && event.payload?.toolName !== "clarify") response.awaitingClarification = false;
|
|
290
301
|
if (event.type === "assistant_delta" && typeof event.payload?.delta === "string") {
|
|
291
302
|
if (response.text.length + event.payload.delta.length > 32e3) throw new Error("Voice response text limit reached");
|
|
292
|
-
if (!response.firstTextSeen) {
|
|
303
|
+
if (!response.firstTextSeen && event.payload.delta.trim()) {
|
|
293
304
|
response.firstTextSeen = true;
|
|
305
|
+
response.firstTextAtMs = Date.now();
|
|
294
306
|
log.info({
|
|
295
307
|
sessionId: claim.sessionId,
|
|
296
308
|
responseId: response.id,
|
|
297
|
-
|
|
309
|
+
conversationId: claim.request.conversationId,
|
|
310
|
+
phase: "first_response_text",
|
|
311
|
+
latencyMs: Date.now() - response.startedAt,
|
|
312
|
+
inputToTextMs: Date.now() - response.inputReceivedAtMs,
|
|
313
|
+
turnDecisionMs: Math.max(0, response.turnCommittedAtMs - response.inputReceivedAtMs),
|
|
314
|
+
queueMs: Math.max(0, response.startedAt - response.turnCommittedAtMs)
|
|
298
315
|
}, "Realtime voice first response text ready");
|
|
299
316
|
}
|
|
300
317
|
response.text += event.payload.delta;
|
|
@@ -422,6 +439,7 @@ function createAgentVoiceEngine(options) {
|
|
|
422
439
|
});
|
|
423
440
|
}
|
|
424
441
|
function bufferFinal(utteranceId, text) {
|
|
442
|
+
if (text && (turnReceivedAtMs === void 0 || turn.isIdle())) turnReceivedAtMs = Date.now();
|
|
425
443
|
try {
|
|
426
444
|
turn.final(utteranceId, text);
|
|
427
445
|
} catch (error) {
|
|
@@ -464,6 +482,7 @@ function createAgentVoiceEngine(options) {
|
|
|
464
482
|
if (pendingTurn) {
|
|
465
483
|
pendingTurn.cancelled = true;
|
|
466
484
|
turn.restore(pendingTurn.turnId, pendingTurn.text);
|
|
485
|
+
turnReceivedAtMs = pendingTurn.receivedAtMs;
|
|
467
486
|
pendingTurn = void 0;
|
|
468
487
|
}
|
|
469
488
|
turn.start(event.utteranceId);
|
|
@@ -512,6 +531,7 @@ function createAgentVoiceEngine(options) {
|
|
|
512
531
|
...event.language === "zh" || event.language === "en" ? { language: event.language } : {}
|
|
513
532
|
});
|
|
514
533
|
if (claim.request.purpose === "conversation") {
|
|
534
|
+
if (claim.request.conversationId) options.runtime.onConversationInput?.(claim.request.conversationId);
|
|
515
535
|
if (activeResponse?.awaitingClarification) {
|
|
516
536
|
turn.reset();
|
|
517
537
|
return;
|
|
@@ -525,6 +545,7 @@ function createAgentVoiceEngine(options) {
|
|
|
525
545
|
turn.reset();
|
|
526
546
|
echoCandidates.clear();
|
|
527
547
|
pendingTurn = void 0;
|
|
548
|
+
turnReceivedAtMs = void 0;
|
|
528
549
|
inputGeneration += 1;
|
|
529
550
|
queuedTurns = 0;
|
|
530
551
|
bufferedAudio = [];
|
|
@@ -548,10 +569,14 @@ function createAgentVoiceEngine(options) {
|
|
|
548
569
|
});
|
|
549
570
|
return inputReset;
|
|
550
571
|
}
|
|
572
|
+
function isConversationIdle() {
|
|
573
|
+
return claim.request.purpose === "conversation" && !closed && Boolean(sttSession) && !committing && !activeResponse && !pendingTurn && queuedTurns === 0 && turn.isIdle() && Date.now() - lastUserSpeechAt >= TASK_UPDATE_QUIET_MS;
|
|
574
|
+
}
|
|
551
575
|
function canOfferTaskUpdateInput() {
|
|
552
|
-
return
|
|
576
|
+
return Boolean(claim.tts) && isConversationIdle();
|
|
553
577
|
}
|
|
554
578
|
return {
|
|
579
|
+
isConversationIdle,
|
|
555
580
|
canOfferTaskUpdate() {
|
|
556
581
|
return !taskUpdateQueued && canOfferTaskUpdateInput();
|
|
557
582
|
},
|
|
@@ -10,6 +10,7 @@ export interface VoiceEngine {
|
|
|
10
10
|
cancel(responseId: string, reason: 'client_cancelled' | 'barge_in'): boolean;
|
|
11
11
|
cancelTask(taskId: string): Promise<boolean>;
|
|
12
12
|
acknowledge(responseId: string, playedDurationMs: number): void;
|
|
13
|
+
isConversationIdle?(): boolean;
|
|
13
14
|
canOfferTaskUpdate?(): boolean;
|
|
14
15
|
offerTaskUpdate?(input: {
|
|
15
16
|
clientMessageId: string;
|
|
@@ -13,6 +13,7 @@ export declare function createOmniVoiceEngine(options: {
|
|
|
13
13
|
bargeIn: boolean;
|
|
14
14
|
send: VoiceEventSink;
|
|
15
15
|
sendAudio: (responseId: string, bytes: Uint8Array) => void;
|
|
16
|
+
onUserInput?: () => void;
|
|
16
17
|
record: (entry: OmniTranscript) => Promise<void>;
|
|
17
18
|
onClose: (reason: string, notify: boolean) => Promise<void>;
|
|
18
19
|
}): VoiceEngine;
|
|
@@ -44,6 +44,7 @@ function createOmniVoiceEngine(options) {
|
|
|
44
44
|
const pendingInputs = /* @__PURE__ */ new Set();
|
|
45
45
|
let failed = false;
|
|
46
46
|
let platformRequestId;
|
|
47
|
+
let lastInputAt = 0;
|
|
47
48
|
let active;
|
|
48
49
|
const echoCandidates = new PlaybackEchoCandidates();
|
|
49
50
|
let recentPlayback;
|
|
@@ -360,6 +361,7 @@ function createOmniVoiceEngine(options) {
|
|
|
360
361
|
clearingInput = false;
|
|
361
362
|
clearTimeout(clearTimer);
|
|
362
363
|
} else if (event.type === "input_audio_buffer.speech_started") {
|
|
364
|
+
lastInputAt = Date.now();
|
|
363
365
|
if (muted || clearingInput) {
|
|
364
366
|
discardedInputs.add(String(event.item_id));
|
|
365
367
|
return;
|
|
@@ -375,6 +377,7 @@ function createOmniVoiceEngine(options) {
|
|
|
375
377
|
if (active && !active.published) cancel("barge_in");
|
|
376
378
|
options.send("input.speech_started", { utteranceId: String(event.item_id) });
|
|
377
379
|
} else if (event.type === "input_audio_buffer.speech_stopped") {
|
|
380
|
+
lastInputAt = Date.now();
|
|
378
381
|
if (muted || inputBlocked || discardedInputs.has(String(event.item_id)) || recorded.has(String(event.item_id))) return;
|
|
379
382
|
speaking.delete(String(event.item_id));
|
|
380
383
|
turn.stop(String(event.item_id));
|
|
@@ -408,6 +411,10 @@ function createOmniVoiceEngine(options) {
|
|
|
408
411
|
cancel("barge_in");
|
|
409
412
|
}
|
|
410
413
|
turn.final(event.item_id, text);
|
|
414
|
+
if (text) {
|
|
415
|
+
lastInputAt = Date.now();
|
|
416
|
+
options.onUserInput?.();
|
|
417
|
+
}
|
|
411
418
|
save({
|
|
412
419
|
itemId: event.item_id,
|
|
413
420
|
role: "user",
|
|
@@ -567,6 +574,9 @@ function createOmniVoiceEngine(options) {
|
|
|
567
574
|
}
|
|
568
575
|
pumpInput();
|
|
569
576
|
},
|
|
577
|
+
isConversationIdle() {
|
|
578
|
+
return ready && !closed && !failed && !active && !speaking.size && !pendingInputs.size && !responseCreateQueued && !waitingForCancellation && !clearingInput && !inputBlocked && Date.now() - lastInputAt >= 750;
|
|
579
|
+
},
|
|
570
580
|
async commit() {
|
|
571
581
|
throw new Error("Natural conversation uses automatic turn detection");
|
|
572
582
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_agent_scope, resolveAgentProfileDir } from "../../agent/agent-scope.js";
|
|
2
|
-
import { DEFAULT_SOUL_FILENAME } from "../../agent/context/workspace.js";
|
|
3
2
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
3
|
+
import { DEFAULT_SOUL_FILENAME } from "../../agent/context/workspace.js";
|
|
4
4
|
import { loadProfileBootstrapFiles } from "../../agent/bootstrap/load-bootstrap-files.js";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { statSync } from "node:fs";
|
|
@@ -27,6 +27,7 @@ export declare class VoiceRealtimeRuntime {
|
|
|
27
27
|
createSession(request: CreateVoiceSessionRequest, principalId: string, now?: number): Promise<CreateVoiceSessionResponse>;
|
|
28
28
|
handleUpgrade(req: IncomingMessage, socket: Socket, head: Buffer): boolean;
|
|
29
29
|
hasConversation(conversationId: string): boolean;
|
|
30
|
+
canPublishReply(conversationId: string): boolean;
|
|
30
31
|
canOfferTaskUpdate(conversationId: string): boolean;
|
|
31
32
|
offerTaskUpdate(input: {
|
|
32
33
|
conversationId: string;
|
|
@@ -313,6 +313,10 @@ var VoiceRealtimeRuntime = class {
|
|
|
313
313
|
this.pruneTickets(Date.now());
|
|
314
314
|
return this.conversationReservations.has(conversationId);
|
|
315
315
|
}
|
|
316
|
+
canPublishReply(conversationId) {
|
|
317
|
+
const sessionId = this.conversationReservations.get(conversationId);
|
|
318
|
+
return (sessionId ? this.activeSessions.get(sessionId) : void 0)?.engine?.isConversationIdle?.() === true;
|
|
319
|
+
}
|
|
316
320
|
canOfferTaskUpdate(conversationId) {
|
|
317
321
|
const sessionId = this.conversationReservations.get(conversationId);
|
|
318
322
|
return (sessionId ? this.activeSessions.get(sessionId) : void 0)?.engine?.canOfferTaskUpdate?.() === true;
|
|
@@ -539,6 +543,7 @@ var VoiceRealtimeRuntime = class {
|
|
|
539
543
|
bargeIn: consumed.config.voice?.realtime?.bargeIn ?? true,
|
|
540
544
|
send,
|
|
541
545
|
sendAudio,
|
|
546
|
+
onUserInput: () => this.options.onConversationInput?.(consumed.request.conversationId),
|
|
542
547
|
record: (entry) => this.options.recordOmniTranscript(consumed.request.conversationId, consumed.sessionId, entry, consumed.conversationSessionId),
|
|
543
548
|
onClose: shutdown
|
|
544
549
|
}) : createAgentVoiceEngine({
|
|
@@ -41,6 +41,8 @@ export interface ResolvedStreamingTts {
|
|
|
41
41
|
route: VoiceProviderRoute;
|
|
42
42
|
}
|
|
43
43
|
export interface VoiceRealtimeRuntimeOptions {
|
|
44
|
+
/** Confirmed non-echo speech invalidates background reply drafts before turn commit. */
|
|
45
|
+
onConversationInput?: (conversationId: string) => void;
|
|
44
46
|
isPrincipalActive?: (principalId: string) => boolean;
|
|
45
47
|
recordOmniTranscript?: (conversationId: string, callId: string, entry: OmniTranscript, expectedTranscriptId: string) => Promise<void>;
|
|
46
48
|
getConversationContext?: (conversationId: string, expectedTranscriptId: string) => Promise<VoiceConversationContext>;
|
|
@@ -12,10 +12,10 @@ import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
|
12
12
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
13
13
|
import { writeKnowledgeItem } from "../knowledge-memory/repository.js";
|
|
14
14
|
import "../knowledge-memory/index.js";
|
|
15
|
-
import { createWorkDiscoveryRun, getProjectUnderstandingRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, listPendingProjectUnderstandingRuns, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, updateWorkDiscoveryRun } from "./repository.js";
|
|
16
15
|
import { linkAssertionEvidence, reconcileAssertion } from "../user-model/repository.js";
|
|
17
16
|
import { createPriorityWindow, createUserGoal } from "../user-model/goals.js";
|
|
18
17
|
import "../user-model/index.js";
|
|
18
|
+
import { createWorkDiscoveryRun, getProjectUnderstandingRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, listPendingProjectUnderstandingRuns, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, updateWorkDiscoveryRun } from "./repository.js";
|
|
19
19
|
import { isLocalModelBaseUrl } from "../providers/model-call.js";
|
|
20
20
|
import { createUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "../user-context/sources/repository.js";
|
|
21
21
|
import { allowsRemoteSourceProcessing } from "../user-context/sources/processing-policy.js";
|
|
@@ -4,8 +4,8 @@ import { init_conversation_repository, resolveRoutedConversation } from "../../s
|
|
|
4
4
|
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
5
5
|
import { extractProfileAgentId, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
6
6
|
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
7
|
-
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
8
7
|
import { getProjectWorkspacePathForSession } from "../../projects/workspace.js";
|
|
8
|
+
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
9
9
|
import { automationEventPublisher, getAutomationEventForRun } from "../../automations/events/event-repository.js";
|
|
10
10
|
import { isTerminalWorkflowRunStatus } from "../domain/run.js";
|
|
11
11
|
import { validateWorkflowJsonSchema } from "../domain/schema-validation.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.366",
|
|
4
4
|
"description": "Local-first personal AI for the one-person company, with durable context, tasks, workflows, automations, and local or cloud models.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -162,11 +162,11 @@
|
|
|
162
162
|
"vitest": "4.1.5",
|
|
163
163
|
"vue": "^3.5.35",
|
|
164
164
|
"@xopcai/browser-control-contract": "0.1.0",
|
|
165
|
-
"@xopcai/endpoint-tools-client": "0.0.0",
|
|
166
165
|
"@xopcai/endpoint-tools-protocol": "0.0.0",
|
|
166
|
+
"@xopcai/endpoint-tools-client": "0.0.0",
|
|
167
|
+
"@xopcai/gateway-contract": "0.0.0",
|
|
167
168
|
"@xopcai/computer-control-contract": "0.1.0",
|
|
168
169
|
"@xopcai/realtime-client": "0.0.0",
|
|
169
|
-
"@xopcai/gateway-contract": "0.0.0",
|
|
170
170
|
"@xopcai/realtime-protocol": "0.0.0"
|
|
171
171
|
},
|
|
172
172
|
"scripts": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e}from"./locale-store-DId6-v2R.js";var t=e(()=>({connectionState:`idle`,error:null}));function n(e){t.setState(e)}export{t as n,n as t};
|