@xopcai/xopc 0.0.387 → 0.0.389
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/_locales/en/messages.json +6 -1
- package/dist/browser-ext/_locales/zh_CN/messages.json +6 -1
- package/dist/browser-ext/dist/assets/{page-context-BeworyNB.js → page-context-A5RCibM_.js} +1 -1
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +98 -53
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/src/plugin.js +5 -3
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-CB2X4Gmu.js → activity-store-dvik6t7Z.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Bv8M5ygD.js → agent-avatar-dicebear-bWMd5TDC.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-UBy01-65.js → agent-defaults-settings-panel-Ds0Ue2FB.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-Q9guA8kU.js → agent-plugin-dialog-UunIxc1q.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-yfJFubD0.js → agents-BLRM4o-U.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-BkULgC6Q.js → agents-admin-api-BlNGyXpm.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-Cdyad8c1.js → app-management-settings-panel-Dmy828Pe.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DPPvnKH_.js → appearance-settings-CUAdx44v.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-Bn_jwaeA.js → apps-page-D5zDB6gp.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-De0ND0oA.js → archive-plugin-Du6dJNcl.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CAB2sLJ5.js → automations-page-BO8Ig5Z4.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-CYRUhhH4.js → automations-workspace-UcCneEs3.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-Do535ZGW.js → binary-plugins-D7VJjwnr.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-B9DmMEa8.js → block-editor-CaJlWTAn.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-B9M1RYTm.js → browser-automation-inputs-iyMBJmQX.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BHAWpZE2.js → browser-automations-page-BjvQnYfO.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-BG_17NcQ.js → browser-settings-page-D5ZghI28.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BX1rCiVm.js → capabilities-CEH1AnXc.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-CW389yo6.js → capabilities-MCKRMZDK.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-BAnBYWlY.js → capabilities-page-MC8qIrXo.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-Ca-d6lXk.js → capabilities-settings-panel-Blz3hEzp.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-header-actions-B3TL8TcF.js → capability-header-actions-BIA0Lwt5.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-BadpS-nq.js → channels-DSg_iCVC.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-C_vntFpP.js → chat-terminal-dock-C97SJEwd.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-B-5kxk70.js → computer-settings-page-DvY3zgyY.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-DTnfpLHL.js → connector-service-page-St2-Fj3y.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DXk-GAsd.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-D5zYeC8q.js → date-picker-C0-D80ny.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-D72vT-tb.js → dependency-picker-CNd7mwMU.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DvoeVPf_.js → desktop-pet-C-2wDANn.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-Dfb392hs.js → desktop-pet-settings-DyhxLrdJ.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-B06Sqn5D.js → device-pairing-wizard-BeSuq__I.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-CA3H3bc-.js → directory-picker-path-field-CNivVIPT.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-B0wTBCx4.js → extension-debug-page-CGYO3JPw.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BeHiXhB1.js → extension-page-Dc51ALAg.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-CJZ5EVpQ.js → extension-provider-BXPILdlw.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Q88-LFCJ.js → extension-settings-page-jYu6qpY2.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-BXoPCvzq.js → fallback-models-CoyzvDo7.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-D0tBjSgj.js → gateway-config-swr-Bc2MytsF.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-BnHraJ3O.js → gateway-realtime-BFK-vlME.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-C3vH-Iup.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-IICLMGDI.js → gateway-settings-JlT1dlSj.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-C1DQsIH3.js → gateway-startup-retry-BDPMttPx.js} +1 -1
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-D336so8z.js → highlighted-body-KQOG7T2V-DAlRGMge.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page--MvqsFhQ.js → home-page-DOVl8s-1.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-DodU6GNC.js → image-generation-api-BZBiYDmV.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-muV1SduS.js → imports-page-DgdBTp_0.js} +1 -1
- package/dist/gateway/static/root/assets/{index-D0qMv3jf.js → index-CmC8JkSM.js} +108 -108
- package/dist/gateway/static/root/assets/index-Dgzc0oBu.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-i1sDWcwl.js → keyboard-shortcuts-settings-BYYC9Qmw.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-DY9tXEO6.js → local-app-workbench-page-BKZfn-MS.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BHD73STy.js → local-apps-page-BU8pUsVM.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-Be4BGM4Z.js → local-session-drafts-kFc_MAA9.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-uRu_DsWm.js → locale-store-Dr43FCty.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DsPpe8Ws.js → logs-page-BSepiACn.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-Buwi2wQE.js → management-settings-dE_ykPNY.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-CBjl-XEc.js → markdown-view-CdKlPjJM.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BombFqsX.js → media-plugins-DE9zt88i.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-65SE6j-_.js +1 -0
- package/dist/gateway/static/root/assets/messages-DlTNQI92.js +3 -0
- package/dist/gateway/static/root/assets/models-hub-cache-C7FAsEe_.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-D8n80Gbr.js → note-detail-panel-D9oqhdyk.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-api-BlGP533W.js → notes-api-BHouNL6-.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-Btf-jSS_.js → notes-page-Bd4_7ph8.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-97RL8Gc7.js → page-context-capture-button-TQr8NnSc.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-B04L8Oz5.js → personal-page-BvWzq4Wp.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-9zEDvZa7.js → product-open-page-BEl6syFp.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-DynBrIXq.js → product-preview-content-BxSHnbqz.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-BM7MsoVA.js → project-detail-page-D-qkIXVT.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-pcyeEJnz.js → projects-page-BQtw1Dfn.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-CYqA7bfl.js → registry-api-BD5IgDOA.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-CphyTu22.js → remote-access-hub-CYFNz0Jc.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-api-zzoxjSuR.js → runtime-tools-api-CjTRoQWT.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DPafoO0G.js → runtime-tools-settings-panel-Qq_NyYx_.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-j97FrDRW.js → scenes-page-hGr-ppYk.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-CuJNwKHO.js → schema-form-ByG-R6N2.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-C293-Hbx.js → send-session-input-UAVStisp.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CzVTrG8n.js → session-api-DvgEiNRS.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-BOb1tC_Z.js +16 -0
- package/dist/gateway/static/root/assets/{sessions-page-D8t_8fMl.js → sessions-page-CpX1Rluw.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-D2s_MlxR.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-DS9DMYUe.js → settings-page-C1e9m23j.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-DRDvm9yZ.js → setup-status-panel-BiHRYDHq.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-BKGI8Kr0.js → share-link-dialog-kE_6v5Dp.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BF2WaO43.js → share-preview-page-BT-_yR1h.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-B0HlMAzi.js → shares-api-Dg_SqHQE.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DQTQZu6V.js → shares-settings-DfcAu08T.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-DzVa7G-O.js → skill-api-BslUYMnX.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-CEJx5rPd.js → skill-reload-api-BQ2rTOP1.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-CfJIjRdS.js → skills-page-CvKc5nBN.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Bzhqed-a.js → system-settings-panel-GpbPfWwo.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-BYQFC0-U.js → task-detail-page-5B5ZVAu0.js} +1 -1
- package/dist/gateway/static/root/assets/{task-expandable-content-C9ohICpw.js → task-expandable-content-DJrrEBB4.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BUfzeDvL.js → theme-store-BKpYnggg.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-C2q5B3Kp.js → tracing-settings-page-D71w7dwV.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-DrgpZ81I.js → tunnel-api-BV46CvS8.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-Drk8FWnj.js → usage-page-rMuwNpJi.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DgbCgsao.js → use-autosave-CzyqRffr.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-rgW7h4sD.js → use-composer-attachments-Dviq-1f6.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-DSKIxfz9.js → use-file-preview-expanded-D5Kk7Hon.js} +2 -2
- package/dist/gateway/static/root/assets/{user-model-page-07t2-nFE.js → user-model-page-Dhqw3v_u.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-4AIkbm9R.js → voice-api-key-field-DWtbmacd.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-Kw1pYlLN.js → voice-config-api-DnIjZm_9.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-TQ5bjVot.js → work-discovery-overlay-ChEG71hz.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-C9HP2uGG.js → workflow-run-setup-panel-pdiRKLxP.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-DK01JRI1.js → workflows-page-D9LMxINt.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-JWHOFos6.js → workspace-api-CZDvu7uA.js} +2 -2
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-B-BhQdAf.js → xopc-cloud-account-card-CbUgg1SK.js} +1 -1
- package/dist/gateway/static/root/index.html +27 -27
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/clarifications.js +79 -2
- package/dist/packages/realtime-protocol/src/voice.js +13 -2
- package/dist/src/agent/agent-manager.js +12 -8
- package/dist/src/agent/background-review/prompts.js +4 -0
- package/dist/src/agent/background-review/run-background-review.js +43 -5
- package/dist/src/agent/embedded/run-turn.js +1 -1
- package/dist/src/agent/embedded/session-runner.d.ts +4 -3
- package/dist/src/agent/embedded/session-runner.js +6 -1
- package/dist/src/agent/external-tools/cliProvider.js +1 -1
- package/dist/src/agent/external-tools/composio-provider.js +2 -2
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/mcp/connection-drafts.d.ts +50 -0
- package/dist/src/agent/mcp/connection-drafts.js +278 -0
- package/dist/src/agent/mcp/connection-setup.d.ts +5 -2
- package/dist/src/agent/mcp/connection-setup.js +7 -5
- package/dist/src/agent/mcp/credential-store.d.ts +6 -0
- package/dist/src/agent/mcp/credential-store.js +24 -0
- package/dist/src/agent/mcp/native-mcp.d.ts +6 -1
- package/dist/src/agent/mcp/native-mcp.js +6 -0
- package/dist/src/agent/mcp/tool-catalog.d.ts +7 -2
- package/dist/src/agent/mcp/tool-catalog.js +25 -15
- package/dist/src/agent/service/process-direct-streaming.js +1 -1
- package/dist/src/agent/service.js +2 -2
- 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/clarify-tool.d.ts +2 -3
- package/dist/src/agent/tools/clarify-tool.js +15 -9
- package/dist/src/agent/tools/cli-clarify.d.ts +0 -3
- package/dist/src/agent/tools/cli-clarify.js +18 -32
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/personal-task-tool.d.ts +4 -4
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent/workspace-runtime/registry.js +1 -1
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/write.d.ts +2 -2
- package/dist/src/automations/domain/validation.d.ts +6 -6
- package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -2
- package/dist/src/automations/service/action-executor.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/agent-edit.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.d.ts +1 -1
- package/dist/src/cli/commands/onboard/model.js +22 -3
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/agent-profile.js +2 -2
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +7 -1
- package/dist/src/config/schema.js +3 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/chat-stream/mapper.js +2 -2
- package/dist/src/gateway/chat-stream/protocol.d.ts +2 -3
- package/dist/src/gateway/clarify-runtime.d.ts +2 -0
- package/dist/src/gateway/clarify-runtime.js +4 -1
- package/dist/src/gateway/ephemeral-clarification-waiter.d.ts +2 -1
- package/dist/src/gateway/ephemeral-clarification-waiter.js +19 -6
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/lib/config-write-lock.d.ts +2 -0
- package/dist/src/gateway/hono/lib/config-write-lock.js +14 -0
- package/dist/src/gateway/hono/routes/agent-stream.js +4 -9
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/config.js +7 -5
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/context-sources.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +73 -6
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/side-chats.js +4 -3
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/service/agent-runner.d.ts +5 -4
- package/dist/src/gateway/service/agent-runner.js +32 -16
- package/dist/src/gateway/service/config-coordinator.d.ts +619 -1
- package/dist/src/gateway/service/config-coordinator.js +36 -24
- package/dist/src/gateway/service.d.ts +6 -3
- package/dist/src/gateway/service.js +5 -4
- package/dist/src/gateway/side-chat/run-service.d.ts +2 -1
- package/dist/src/gateway/side-chat/run-service.js +6 -3
- package/dist/src/gateway/side-chat/types.d.ts +3 -3
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +2 -2
- package/dist/src/gateway/xopc-cloud-capability-setup.js +8 -5
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/memory-learning/service.js +3 -2
- package/dist/src/personal-agent/proactivity/service.js +1 -1
- package/dist/src/personal-agent/service.js +2 -2
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/routing/resolve-route.js +1 -1
- package/dist/src/routing/resolve-tui-session-key.js +1 -1
- package/dist/src/scenes/execution.d.ts +1 -1
- package/dist/src/scenes/taskFollowUp/contracts.d.ts +2 -2
- package/dist/src/scenes/taskFollowUp/service.d.ts +5 -5
- package/dist/src/scenes/templates.d.ts +2 -2
- package/dist/src/storage/sqlite/clarification-wait-repository.d.ts +3 -5
- package/dist/src/storage/sqlite/clarification-wait-repository.js +48 -28
- package/dist/src/tasks/capabilities/management.d.ts +2 -2
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/relations.d.ts +6 -6
- package/dist/src/tasks/capabilities/write.d.ts +6 -6
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +2 -2
- package/dist/src/tui/tui-agent-events.js +1 -1
- package/dist/src/user-context/config.d.ts +2 -2
- package/dist/src/user-model/capture/semantic.d.ts +8 -1
- package/dist/src/user-model/capture/semantic.js +26 -5
- package/dist/src/voice/realtime/agentEngine.js +4 -2
- package/dist/src/voice/realtime/omniEngine.js +2 -2
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/connectors-page-CmJV7gqj.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BVriF6Zj.js +0 -1
- package/dist/gateway/static/root/assets/index-DBRwvWzm.css +0 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-D2mip-f9.js +0 -1
- package/dist/gateway/static/root/assets/messages-DTqbfje6.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-cache-Ct6X5zmB.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-COd9RECl.js +0 -16
- package/dist/gateway/static/root/assets/settings-advanced-gate-CDkitNHA.js +0 -1
|
@@ -10,6 +10,7 @@ import { ConfigHotReloader } from "../../config/reload.js";
|
|
|
10
10
|
import "../../config/index.js";
|
|
11
11
|
import { computeExtensionActivationPatch } from "../../extensions/bundled-extension-activation.js";
|
|
12
12
|
import { sanitizeTunnelConfig } from "../../tunnel/tunnel-config.js";
|
|
13
|
+
import { isDeepStrictEqual } from "node:util";
|
|
13
14
|
//#region src/gateway/service/config-coordinator.ts
|
|
14
15
|
/**
|
|
15
16
|
* GatewayConfigCoordinator — owns config persistence, hot-reload, and the
|
|
@@ -44,6 +45,7 @@ var GatewayConfigCoordinator = class {
|
|
|
44
45
|
configReloader = null;
|
|
45
46
|
channelReloadFlushPromise = null;
|
|
46
47
|
channelReloadPending = false;
|
|
48
|
+
configWrite = Promise.resolve();
|
|
47
49
|
constructor(opts) {
|
|
48
50
|
this.opts = opts;
|
|
49
51
|
}
|
|
@@ -97,9 +99,28 @@ var GatewayConfigCoordinator = class {
|
|
|
97
99
|
error: result.error
|
|
98
100
|
};
|
|
99
101
|
}
|
|
100
|
-
async saveConfig(config) {
|
|
102
|
+
async saveConfig(config, expectedConfig = this.opts.getConfig()) {
|
|
103
|
+
const candidate = structuredClone(config), expected = structuredClone(expectedConfig);
|
|
104
|
+
return this.queueConfigWrite(async () => {
|
|
105
|
+
if (!isDeepStrictEqual(this.opts.getConfig(), expected)) return {
|
|
106
|
+
saved: false,
|
|
107
|
+
conflict: true,
|
|
108
|
+
error: "Configuration changed before saving. Please retry."
|
|
109
|
+
};
|
|
110
|
+
return this.persistConfig(candidate);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
async queueConfigWrite(operation) {
|
|
114
|
+
const next = this.configWrite.catch(() => {}).then(operation);
|
|
115
|
+
this.configWrite = next;
|
|
116
|
+
return next;
|
|
117
|
+
}
|
|
118
|
+
async persistConfig(config) {
|
|
119
|
+
let persisted = false;
|
|
101
120
|
try {
|
|
102
|
-
await this.writeConfigAndReloadFromDisk(config)
|
|
121
|
+
await this.writeConfigAndReloadFromDisk(config, () => {
|
|
122
|
+
persisted = true;
|
|
123
|
+
});
|
|
103
124
|
this.scheduleChannelPluginsAfterPersist();
|
|
104
125
|
return { saved: true };
|
|
105
126
|
} catch (err) {
|
|
@@ -111,35 +132,24 @@ var GatewayConfigCoordinator = class {
|
|
|
111
132
|
}, `Failed to save config: ${em}`);
|
|
112
133
|
return {
|
|
113
134
|
saved: false,
|
|
114
|
-
error: em
|
|
135
|
+
error: em,
|
|
136
|
+
persisted
|
|
115
137
|
};
|
|
116
138
|
}
|
|
117
139
|
}
|
|
118
140
|
/** Merge partial updates into `currentConfig` and persist. */
|
|
119
141
|
async updateConfig(updates) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const
|
|
142
|
+
const patch = structuredClone(updates);
|
|
143
|
+
return this.queueConfigWrite(async () => {
|
|
144
|
+
const result = await this.persistConfig({
|
|
123
145
|
...this.opts.getConfig(),
|
|
124
|
-
...
|
|
125
|
-
};
|
|
126
|
-
this.opts.setConfig(merged);
|
|
127
|
-
await this.writeConfigAndReloadFromDisk(merged);
|
|
128
|
-
this.scheduleChannelPluginsAfterPersist();
|
|
129
|
-
log.debug("Configuration updated successfully");
|
|
130
|
-
return { updated: true };
|
|
131
|
-
} catch (err) {
|
|
132
|
-
const em = err instanceof Error ? err.message : String(err);
|
|
133
|
-
log.error({
|
|
134
|
-
err,
|
|
135
|
-
errorMessage: em,
|
|
136
|
-
phase: "infra.config"
|
|
137
|
-
}, `Failed to update config: ${em}`);
|
|
146
|
+
...patch
|
|
147
|
+
});
|
|
138
148
|
return {
|
|
139
|
-
updated:
|
|
140
|
-
error:
|
|
149
|
+
updated: result.saved,
|
|
150
|
+
...result.error ? { error: result.error } : {}
|
|
141
151
|
};
|
|
142
|
-
}
|
|
152
|
+
});
|
|
143
153
|
}
|
|
144
154
|
/**
|
|
145
155
|
* Persist `extensions.enabled` / `extensions.disabled` for a discovered extension.
|
|
@@ -339,8 +349,10 @@ var GatewayConfigCoordinator = class {
|
|
|
339
349
|
* runtime matches disk (PATCH merge objects can drift from Zod-normalized
|
|
340
350
|
* output).
|
|
341
351
|
*/
|
|
342
|
-
async writeConfigAndReloadFromDisk(configToWrite) {
|
|
352
|
+
async writeConfigAndReloadFromDisk(configToWrite, onPersisted) {
|
|
343
353
|
await saveConfig(configToWrite, this.opts.configPath);
|
|
354
|
+
onPersisted?.();
|
|
355
|
+
this.opts.setConfig(structuredClone(configToWrite));
|
|
344
356
|
const reloaded = loadConfig(this.opts.configPath);
|
|
345
357
|
this.opts.setConfig(reloaded);
|
|
346
358
|
await configureTracing(reloaded.observability?.tracing);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClarificationSubmission } from '@xopcai/gateway-contract';
|
|
1
2
|
import { WorkDiscoveryService } from '../work-discovery/service.js';
|
|
2
3
|
import { ConnectionRecoveryService } from '../connectors/connection-recovery-service.js';
|
|
3
4
|
import { AgentService } from '../agent/service.js';
|
|
@@ -203,8 +204,8 @@ export declare class GatewayService {
|
|
|
203
204
|
idle: boolean;
|
|
204
205
|
}>;
|
|
205
206
|
getActiveWebchatRunId(conversationId: string): string | undefined;
|
|
206
|
-
answerEphemeralClarification(requestId: string, answer:
|
|
207
|
-
getClarificationState(conversationId: string): import("@xopcai/gateway-contract
|
|
207
|
+
answerEphemeralClarification(requestId: string, answer: ClarificationSubmission): boolean;
|
|
208
|
+
getClarificationState(conversationId: string): import("@xopcai/gateway-contract").ClarificationWaitSnapshot;
|
|
208
209
|
resolveClarificationResponse(input: Parameters<GatewayAgentRunner['resolveClarificationResponse']>[0]): import("../storage/sqlite/clarification-wait-repository.js").ResolveClarificationResult;
|
|
209
210
|
private initializeExtensionLoader;
|
|
210
211
|
private registerExtensionChannelPlugins;
|
|
@@ -243,9 +244,11 @@ export declare class GatewayService {
|
|
|
243
244
|
}>;
|
|
244
245
|
afterWeixinCredentialsPersisted(): Promise<void>;
|
|
245
246
|
afterFeishuCredentialsPersisted(): Promise<void>;
|
|
246
|
-
saveConfig(config: Config): Promise<{
|
|
247
|
+
saveConfig(config: Config, expectedConfig?: Config): Promise<{
|
|
247
248
|
saved: boolean;
|
|
248
249
|
error?: string;
|
|
250
|
+
persisted?: boolean;
|
|
251
|
+
conflict?: boolean;
|
|
249
252
|
}>;
|
|
250
253
|
syncVoiceLanguage(language: ProductLanguage): Promise<{
|
|
251
254
|
applied: boolean;
|
|
@@ -20,13 +20,13 @@ import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js
|
|
|
20
20
|
import { init_session_repository, listSessionMetadata, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
21
21
|
import { getSessionConfig, init_config_repository } from "../storage/sqlite/config-repository.js";
|
|
22
22
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
23
|
+
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
24
|
+
import { init_agent_scope, listAgentEntries, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
23
25
|
import { listKnowledgeItems } from "../knowledge-memory/repository.js";
|
|
24
26
|
import { init_config, resolveKnowledgeReadPolicy } from "../user-context/config.js";
|
|
25
27
|
import { init_agent_session_key, resolveAgentMainConversationId } from "../routing/agent-session-key.js";
|
|
26
28
|
import { init_session_key, resolveConversationId, sanitizeSegment } from "../routing/session-key.js";
|
|
27
29
|
import "../knowledge-memory/index.js";
|
|
28
|
-
import { normalizeAgentId } from "../agent-catalog/id.js";
|
|
29
|
-
import { init_agent_scope, listAgentEntries, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
30
30
|
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
31
31
|
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
32
32
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
@@ -1336,6 +1336,7 @@ var GatewayService = class {
|
|
|
1336
1336
|
}
|
|
1337
1337
|
registerClarificationChannelRuntime({
|
|
1338
1338
|
answerChoice: (requestId, choiceIndex, idempotencyKey) => this.agentRunner.answerClarificationChoice(requestId, choiceIndex, idempotencyKey),
|
|
1339
|
+
answerDecision: (requestId, decision, idempotencyKey) => this.agentRunner.answerClarificationDecision(requestId, decision, idempotencyKey),
|
|
1339
1340
|
answerText: (conversationId, text, idempotencyKey) => this.agentRunner.answerClarificationText(conversationId, text, idempotencyKey)
|
|
1340
1341
|
});
|
|
1341
1342
|
this.ensureAgentService();
|
|
@@ -1695,8 +1696,8 @@ var GatewayService = class {
|
|
|
1695
1696
|
afterFeishuCredentialsPersisted() {
|
|
1696
1697
|
return this.configCoordinator.afterFeishuCredentialsPersisted();
|
|
1697
1698
|
}
|
|
1698
|
-
saveConfig(config) {
|
|
1699
|
-
return this.configCoordinator.saveConfig(config);
|
|
1699
|
+
saveConfig(config, expectedConfig) {
|
|
1700
|
+
return this.configCoordinator.saveConfig(config, expectedConfig);
|
|
1700
1701
|
}
|
|
1701
1702
|
async syncVoiceLanguage(language) {
|
|
1702
1703
|
const mode = this.config.voice?.languageMode ?? "auto";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClarificationSubmission } from '@xopcai/gateway-contract';
|
|
1
2
|
import type { AgentService } from '../../agent/service.js';
|
|
2
3
|
import type { GatewayAgentRunner } from '../service/agent-runner.js';
|
|
3
4
|
import { type EphemeralSideChatManager } from './manager.js';
|
|
@@ -23,6 +24,6 @@ export declare class SideChatRunService {
|
|
|
23
24
|
/** Disposal has already removed the transcript from the public manager. */
|
|
24
25
|
cancelRun(sideChatId: string, clientInstanceId: string, runId?: string): Promise<boolean>;
|
|
25
26
|
dispose(sideChatId: string, clientInstanceId: string): Promise<boolean>;
|
|
26
|
-
submitClarification(sideChatId: string, clientInstanceId: string, requestId: string, answer:
|
|
27
|
+
submitClarification(sideChatId: string, clientInstanceId: string, requestId: string, answer: ClarificationSubmission): boolean;
|
|
27
28
|
private execute;
|
|
28
29
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { readClarificationPresentation } from "../../../packages/gateway-contract/src/clarifications.js";
|
|
4
|
+
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
5
|
import { abortEmbeddedRun } from "../../agent/embedded/runs.js";
|
|
4
6
|
import { SideChatError } from "./manager.js";
|
|
5
7
|
import { ChatStreamMapper } from "../chat-stream/mapper.js";
|
|
6
8
|
import { randomUUID } from "node:crypto";
|
|
7
9
|
//#region src/gateway/side-chat/run-service.ts
|
|
10
|
+
init_src();
|
|
8
11
|
init_logger();
|
|
9
12
|
const log = createLogger("Gateway:SideChatRun");
|
|
10
13
|
var SideChatRunService = class {
|
|
@@ -76,11 +79,11 @@ var SideChatRunService = class {
|
|
|
76
79
|
const publishMapped = (event) => {
|
|
77
80
|
if (run.abortController.signal.aborted) return;
|
|
78
81
|
if (event.type === "clarify_request") this.options.manager.waitForInput(run.sideChatId, run.clientInstanceId, {
|
|
82
|
+
...readClarificationPresentation(event),
|
|
83
|
+
expiresAt: typeof event.expiresAt === "number" ? event.expiresAt : void 0,
|
|
79
84
|
requestId: String(event.requestId),
|
|
80
85
|
kind: event.kind === "approval" ? "approval" : "input",
|
|
81
|
-
question: String(event.question)
|
|
82
|
-
choices: Array.isArray(event.choices) ? event.choices.filter((choice) => typeof choice === "string") : void 0,
|
|
83
|
-
suggestedAnswer: typeof event.suggestedAnswer === "string" ? event.suggestedAnswer : void 0
|
|
86
|
+
question: String(event.question)
|
|
84
87
|
}, event.kind === "approval" ? "waiting-approval" : "waiting-input");
|
|
85
88
|
for (const mapped of mapper.map(event)) publish(mapped);
|
|
86
89
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClarificationPresentation } from '@xopcai/gateway-contract';
|
|
1
2
|
import type { ThinkingLevel } from '@earendil-works/pi-agent-core';
|
|
2
3
|
export type SideChatStatus = 'idle' | 'running' | 'waiting-approval' | 'waiting-input' | 'promoting' | 'closing';
|
|
3
4
|
export type SideChatSelection = {
|
|
@@ -52,12 +53,11 @@ export interface SideChatView {
|
|
|
52
53
|
expiresAt: string | null;
|
|
53
54
|
serverNow?: string;
|
|
54
55
|
runId?: string;
|
|
55
|
-
clarification?: {
|
|
56
|
+
clarification?: ClarificationPresentation & {
|
|
56
57
|
requestId: string;
|
|
57
58
|
kind: 'input' | 'approval';
|
|
58
59
|
question: string;
|
|
59
|
-
|
|
60
|
-
suggestedAnswer?: string;
|
|
60
|
+
expiresAt?: number;
|
|
61
61
|
};
|
|
62
62
|
messageCount: number;
|
|
63
63
|
context: SideChatContextSnapshot;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
1
|
+
import { type Config } from '../config/schema.js';
|
|
2
|
+
import { type AgentDefaults } from '../agent-config/index.js';
|
|
3
3
|
import type { CatalogSource } from '../providers/model-catalog-store.js';
|
|
4
4
|
type CloudCapability = 'chat' | 'vision' | 'image-generation' | 'stt' | 'tts';
|
|
5
5
|
export interface XopcCloudCapabilitySelection {
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import "../agent-config/schema.js";
|
|
2
|
+
import { init_agent_config } from "../agent-config/index.js";
|
|
1
3
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
4
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
5
|
+
import { ConfigSchema, init_schema } from "../config/schema.js";
|
|
2
6
|
import { getModelCatalogStore, init_model_catalog_store } from "../providers/model-catalog-store.js";
|
|
3
|
-
import { getAvailableModels, init_providers } from "../providers/index.js";
|
|
4
7
|
import { compareCatalogModels } from "../providers/model-catalog-ranking.js";
|
|
5
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
6
8
|
import { prepareUpdateGlobalDefaults } from "./global-defaults-admin.js";
|
|
7
9
|
//#region src/gateway/xopc-cloud-capability-setup.ts
|
|
10
|
+
init_schema();
|
|
11
|
+
init_agent_config();
|
|
8
12
|
init_repository();
|
|
9
13
|
init_model_catalog_store();
|
|
10
|
-
init_providers();
|
|
11
14
|
function supportsCapability(model, capability) {
|
|
12
15
|
if (model.availability !== "available") return false;
|
|
13
16
|
if (capability === "chat") return model.kind === "language" && (model.operations.includes("chat.completions") || model.operations.includes("responses"));
|
|
@@ -181,7 +184,6 @@ async function applyXopcCloudCapabilitySetup(service) {
|
|
|
181
184
|
};
|
|
182
185
|
const selection = selectXopcCloudCapabilities(source);
|
|
183
186
|
const currentDefaults = new AgentCatalogRepository().getSettings().defaults;
|
|
184
|
-
const availableModels = new Set((await getAvailableModels()).map((model) => `${model.provider}/${model.id}`));
|
|
185
187
|
const nextDefaults = structuredClone(currentDefaults);
|
|
186
188
|
const nextConfig = structuredClone(service.currentConfig);
|
|
187
189
|
const chat = recommendedModel(source, "chat");
|
|
@@ -192,7 +194,7 @@ async function applyXopcCloudCapabilitySetup(service) {
|
|
|
192
194
|
const realtimeStt = recommendedVoiceModel(source, "transcription.stream");
|
|
193
195
|
const realtimeTts = recommendedVoiceModel(source, "speech.stream");
|
|
194
196
|
const realtimeOmni = recommendedVoiceModel(source, "conversation");
|
|
195
|
-
if (chat &&
|
|
197
|
+
if (chat && currentDefaults.models.chat.primary === "xopc-cloud/auto" && currentDefaults.models.chat.fallbacks.length === 0) nextDefaults.models.chat = {
|
|
196
198
|
primary: `xopc-cloud/${chat.id}`,
|
|
197
199
|
fallbacks: []
|
|
198
200
|
};
|
|
@@ -232,6 +234,7 @@ async function applyXopcCloudCapabilitySetup(service) {
|
|
|
232
234
|
} }
|
|
233
235
|
};
|
|
234
236
|
}
|
|
237
|
+
if (!nextConfig.voice && (realtimeStt || realtimeTts || realtimeOmni)) nextConfig.voice = ConfigSchema.parse({ voice: { realtime: { enabled: true } } }).voice;
|
|
235
238
|
const realtime = nextConfig.voice?.realtime;
|
|
236
239
|
if (realtime?.enabled) {
|
|
237
240
|
if (realtimeStt && !realtime.stt) realtime.stt = {
|
|
@@ -5,10 +5,10 @@ import { currentOperationId, init_operation_context } from "../infra/operation-c
|
|
|
5
5
|
import { afterSqliteCommit, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
6
6
|
import { ExtensionCapabilityBindingsSchema, extensionCapabilityPermissions } from "../../packages/gateway-contract/src/extension-capabilities.js";
|
|
7
7
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
8
|
+
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
8
9
|
import { init_paths, resolveExtensionsDir } from "../config/paths.js";
|
|
9
10
|
import { slugifyProjectName } from "../projects/project-store.js";
|
|
10
11
|
import { LocalAppStore } from "./store.js";
|
|
11
|
-
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
12
12
|
import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
|
|
13
13
|
import { validateLocalAppCapabilityContracts } from "./capabilities/contracts.js";
|
|
14
14
|
import { buildLocalAppFixGuidance } from "./fix-guidance.js";
|
|
@@ -85,8 +85,9 @@ var MemoryLearningService = class {
|
|
|
85
85
|
err,
|
|
86
86
|
jobId: job.job_id,
|
|
87
87
|
conversationId: job.conversation_id,
|
|
88
|
-
phase: "extract"
|
|
89
|
-
|
|
88
|
+
phase: "extract",
|
|
89
|
+
attempts: job.attempts
|
|
90
|
+
}, job.attempts >= 3 ? "Memory learning failed; retry limit reached" : "Memory learning failed; retry queued");
|
|
90
91
|
} finally {
|
|
91
92
|
clearInterval(renew);
|
|
92
93
|
}
|
|
@@ -5,8 +5,8 @@ import { PersonalProactiveMessageSchema } from "../../../packages/gateway-contra
|
|
|
5
5
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
6
6
|
import { init_session_instance_repository, readCurrentTranscriptId } from "../../storage/sqlite/session-instance-repository.js";
|
|
7
7
|
import { appendTranscriptEntry, init_transcript_repository } from "../../storage/sqlite/transcript-repository.js";
|
|
8
|
-
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
9
8
|
import { AgentCatalogRepository, init_repository } from "../../agent-catalog/repository.js";
|
|
9
|
+
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
10
10
|
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
11
11
|
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
12
12
|
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
2
2
|
import { init_session_repository, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
3
3
|
import { init_config_repository, setSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
4
|
-
import { createConversation, init_conversation_repository } from "../storage/sqlite/conversation-repository.js";
|
|
5
4
|
import { ResponsePreferencesSchema } from "../agent-config/schema.js";
|
|
6
5
|
import { init_agent_config } from "../agent-config/index.js";
|
|
7
6
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
7
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
8
|
+
import { createConversation, init_conversation_repository } from "../storage/sqlite/conversation-repository.js";
|
|
8
9
|
import { getAvailableModels, init_providers } from "../providers/index.js";
|
|
9
10
|
import { DEFAULT_PERSONAL_PREFERENCES, getPersonalAgent, personalAgentId } from "./repository.js";
|
|
10
11
|
import { PERSONAL_MAIN_TOOL_IDS, PERSONAL_READ_TOOL_ALIASES } from "./policy.js";
|
|
11
12
|
import { getModelThinking } from "../providers/model-thinking.js";
|
|
12
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
13
13
|
import { personalInstructions, upgradePersonalInstructions } from "./prompts.js";
|
|
14
14
|
import { completePersonalOnboarding } from "./onboarding.js";
|
|
15
15
|
import { z } from "zod";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { init_paths_state, resolveXopcCloudCatalogCachePath } from "../config/paths-state.js";
|
|
3
|
-
import { ComputerProfileSchema, init_src } from "../../packages/computer-control-contract/src/index.js";
|
|
4
3
|
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
4
|
+
import { ComputerProfileSchema, init_src } from "../../packages/computer-control-contract/src/index.js";
|
|
5
5
|
import { ImageGenerationCapabilitiesSchema, init_models_json } from "../config/models-json.js";
|
|
6
6
|
import { voiceManifestSchema } from "../../packages/realtime-protocol/src/voice-catalog.js";
|
|
7
7
|
import { init_voice } from "../../packages/realtime-protocol/src/voice.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { init_account_id, normalizeAccountId } from "./account-id.js";
|
|
3
|
+
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
4
|
import { getConversationRouting } from "../storage/sqlite/conversation-repository.js";
|
|
4
5
|
import { init_agent_session_key, resolveAgentPeerConversationId } from "./agent-session-key.js";
|
|
5
6
|
import { init_session_key, resolveConversationId } from "./session-key.js";
|
|
6
|
-
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
7
7
|
import { init_bindings, parseBindingRules, resolveRoute as resolveRoute$1 } from "./bindings.js";
|
|
8
8
|
//#region src/routing/resolve-route.ts
|
|
9
9
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { validateConversationId } from "../../packages/gateway-contract/src/conversation-identity.js";
|
|
2
2
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { init_agent_session_key, normalizeAgentId } from "./agent-session-key.js";
|
|
4
3
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
5
4
|
import { init_agent_scope, listAgentEntries, resolveAgentIdByWorkspacePath, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
5
|
+
import { init_agent_session_key, normalizeAgentId } from "./agent-session-key.js";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
//#region src/routing/resolve-tui-session-key.ts
|
|
8
8
|
init_src();
|
|
@@ -5,8 +5,8 @@ import { SceneRepository } from './repository.js';
|
|
|
5
5
|
import { SceneCapabilityRegistry } from './registry.js';
|
|
6
6
|
export declare const readOnlyResultSchema: z.ZodObject<{
|
|
7
7
|
kind: z.ZodEnum<{
|
|
8
|
-
artifact: "artifact";
|
|
9
8
|
decision: "decision";
|
|
9
|
+
artifact: "artifact";
|
|
10
10
|
observation: "observation";
|
|
11
11
|
no_change: "no_change";
|
|
12
12
|
}>;
|
|
@@ -30,7 +30,7 @@ export declare const taskFollowUpTemplate: {
|
|
|
30
30
|
maxOutputTokens: number;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
-
allowedOutcomeKinds: ("
|
|
33
|
+
allowedOutcomeKinds: ("decision" | "artifact" | "receipt" | "observation" | "no_change" | "state_change" | "effect_proposal")[];
|
|
34
34
|
allowedEffectHandlers: string[];
|
|
35
35
|
};
|
|
36
36
|
export declare const decisionLogTemplate: {
|
|
@@ -62,7 +62,7 @@ export declare const decisionLogTemplate: {
|
|
|
62
62
|
maxOutputTokens: number;
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
-
allowedOutcomeKinds: ("
|
|
65
|
+
allowedOutcomeKinds: ("decision" | "artifact" | "receipt" | "observation" | "no_change" | "state_change" | "effect_proposal")[];
|
|
66
66
|
allowedEffectHandlers: string[];
|
|
67
67
|
};
|
|
68
68
|
export declare const sourceReferenceSchema: z.ZodObject<{
|
|
@@ -114,7 +114,7 @@ export declare class SceneTaskExecutionService implements SceneActivationAdapter
|
|
|
114
114
|
taskId: string;
|
|
115
115
|
rootRunId: string;
|
|
116
116
|
attempt: number;
|
|
117
|
-
status: "failed" | "succeeded" | "
|
|
117
|
+
status: "failed" | "succeeded" | "queued" | "cancelled" | "waiting" | "running" | "verifying";
|
|
118
118
|
executorKind: "agent" | "workflow" | "human" | "external";
|
|
119
119
|
executorRef: Record<string, unknown>;
|
|
120
120
|
trigger: Record<string, unknown>;
|
|
@@ -267,7 +267,7 @@ export declare class SceneTaskExecutionService implements SceneActivationAdapter
|
|
|
267
267
|
taskId: string;
|
|
268
268
|
rootRunId: string;
|
|
269
269
|
attempt: number;
|
|
270
|
-
status: "failed" | "succeeded" | "
|
|
270
|
+
status: "failed" | "succeeded" | "queued" | "cancelled" | "waiting" | "running" | "verifying";
|
|
271
271
|
executorKind: "agent" | "workflow" | "human" | "external";
|
|
272
272
|
executorRef: Record<string, unknown>;
|
|
273
273
|
trigger: Record<string, unknown>;
|
|
@@ -419,7 +419,7 @@ export declare class SceneTaskExecutionService implements SceneActivationAdapter
|
|
|
419
419
|
taskId: string;
|
|
420
420
|
rootRunId: string;
|
|
421
421
|
attempt: number;
|
|
422
|
-
status: "failed" | "succeeded" | "
|
|
422
|
+
status: "failed" | "succeeded" | "queued" | "cancelled" | "waiting" | "running" | "verifying";
|
|
423
423
|
executorKind: "agent" | "workflow" | "human" | "external";
|
|
424
424
|
executorRef: Record<string, unknown>;
|
|
425
425
|
trigger: Record<string, unknown>;
|
|
@@ -597,7 +597,7 @@ export declare class SceneTaskExecutionService implements SceneActivationAdapter
|
|
|
597
597
|
taskId: string;
|
|
598
598
|
rootRunId: string;
|
|
599
599
|
attempt: number;
|
|
600
|
-
status: "failed" | "succeeded" | "
|
|
600
|
+
status: "failed" | "succeeded" | "queued" | "cancelled" | "waiting" | "running" | "verifying";
|
|
601
601
|
executorKind: "agent" | "workflow" | "human" | "external";
|
|
602
602
|
executorRef: Record<string, unknown>;
|
|
603
603
|
trigger: Record<string, unknown>;
|
|
@@ -749,7 +749,7 @@ export declare class SceneTaskExecutionService implements SceneActivationAdapter
|
|
|
749
749
|
taskId: string;
|
|
750
750
|
rootRunId: string;
|
|
751
751
|
attempt: number;
|
|
752
|
-
status: "failed" | "succeeded" | "
|
|
752
|
+
status: "failed" | "succeeded" | "queued" | "cancelled" | "waiting" | "running" | "verifying";
|
|
753
753
|
executorKind: "agent" | "workflow" | "human" | "external";
|
|
754
754
|
executorRef: Record<string, unknown>;
|
|
755
755
|
trigger: Record<string, unknown>;
|
|
@@ -27,7 +27,7 @@ export declare const mailFollowUpTemplate: {
|
|
|
27
27
|
maxOutputTokens: number;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
allowedOutcomeKinds: ("
|
|
30
|
+
allowedOutcomeKinds: ("decision" | "artifact" | "receipt" | "observation" | "no_change" | "state_change" | "effect_proposal")[];
|
|
31
31
|
allowedEffectHandlers: string[];
|
|
32
32
|
};
|
|
33
33
|
export declare const familyPlanTemplate: {
|
|
@@ -59,6 +59,6 @@ export declare const familyPlanTemplate: {
|
|
|
59
59
|
maxOutputTokens: number;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
-
allowedOutcomeKinds: ("
|
|
62
|
+
allowedOutcomeKinds: ("decision" | "artifact" | "receipt" | "observation" | "no_change" | "state_change" | "effect_proposal")[];
|
|
63
63
|
allowedEffectHandlers: string[];
|
|
64
64
|
};
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
+
import { type ClarificationPresentation, type ClarificationSubmission } from '@xopcai/gateway-contract';
|
|
1
2
|
import type { ClarificationKind, ClarificationResponseAction, ClarificationWait, ClarificationWaitSnapshot } from '@xopcai/gateway-contract';
|
|
2
3
|
import { type SessionInput } from './session-input-repository.js';
|
|
3
|
-
export type CreateClarificationInput = {
|
|
4
|
+
export type CreateClarificationInput = ClarificationPresentation & {
|
|
4
5
|
conversationId: string;
|
|
5
6
|
runId: string;
|
|
6
7
|
toolCallId: string;
|
|
7
8
|
kind: ClarificationKind;
|
|
8
9
|
question: string;
|
|
9
|
-
choices?: string[];
|
|
10
|
-
suggestedAnswer?: string;
|
|
11
10
|
approvalKey?: string;
|
|
12
11
|
now?: number;
|
|
13
12
|
};
|
|
14
|
-
export type ResolveClarificationInput = {
|
|
13
|
+
export type ResolveClarificationInput = ClarificationSubmission & {
|
|
15
14
|
id: string;
|
|
16
15
|
expectedVersion: number;
|
|
17
16
|
idempotencyKey: string;
|
|
18
17
|
action: ClarificationResponseAction;
|
|
19
|
-
answer?: string;
|
|
20
18
|
now?: number;
|
|
21
19
|
};
|
|
22
20
|
export type ResolveClarificationResult = {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { init_connection, isXopcDatabaseOpen } from "./connection.js";
|
|
3
3
|
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "./transaction.js";
|
|
4
|
+
import { normalizeClarificationQuestion, normalizeClarificationSubmission } from "../../../packages/gateway-contract/src/clarifications.js";
|
|
5
|
+
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
4
6
|
import { init_session_instance_repository, readCurrentTranscriptId } from "./session-instance-repository.js";
|
|
5
7
|
import { bumpSessionInputRevision, getSessionInputById, getSessionInputState, init_session_input_repository, insertSessionInput } from "./session-input-repository.js";
|
|
6
8
|
import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-run-repository.js";
|
|
@@ -129,6 +131,7 @@ function getClarificationSnapshot(conversationId) {
|
|
|
129
131
|
};
|
|
130
132
|
}
|
|
131
133
|
function createClarificationWait(input) {
|
|
134
|
+
input = normalizeClarificationQuestion(input);
|
|
132
135
|
return runSqliteWriteTransaction((db) => {
|
|
133
136
|
const transcriptId = readCurrentTranscriptId(db, input.conversationId);
|
|
134
137
|
if (!transcriptId) throw new Error("Clarification requires a persisted session.");
|
|
@@ -166,8 +169,10 @@ function createClarificationWait(input) {
|
|
|
166
169
|
kind: input.kind,
|
|
167
170
|
status: "open",
|
|
168
171
|
question: input.question.trim(),
|
|
169
|
-
|
|
170
|
-
|
|
172
|
+
interactionMode: input.interactionMode,
|
|
173
|
+
choiceDetails: input.choiceDetails,
|
|
174
|
+
recommendedChoiceId: input.recommendedChoiceId,
|
|
175
|
+
approval: input.approval,
|
|
171
176
|
checkpoint: {
|
|
172
177
|
transcriptEntryId: lastEntry?.entry_id,
|
|
173
178
|
objectiveSummary: origin?.content ?? input.question.trim(),
|
|
@@ -217,38 +222,50 @@ function resolveClarification(input) {
|
|
|
217
222
|
code: "NOT_FOUND"
|
|
218
223
|
};
|
|
219
224
|
const now = input.now ?? Date.now();
|
|
220
|
-
|
|
225
|
+
let normalized;
|
|
226
|
+
try {
|
|
227
|
+
if (input.action === "answer") normalized = normalizeClarificationSubmission(wait, {
|
|
228
|
+
response: input.response,
|
|
229
|
+
decision: input.decision
|
|
230
|
+
});
|
|
231
|
+
else if (input.response !== void 0 || input.decision !== void 0) return {
|
|
232
|
+
ok: false,
|
|
233
|
+
code: "INVALID"
|
|
234
|
+
};
|
|
235
|
+
} catch {
|
|
236
|
+
return {
|
|
237
|
+
ok: false,
|
|
238
|
+
code: "INVALID"
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
if (input.action === "agent_decide" && wait.kind === "approval") return {
|
|
242
|
+
ok: false,
|
|
243
|
+
code: "INVALID"
|
|
244
|
+
};
|
|
245
|
+
const resolution = input.action === "answer" ? "answered" : input.action === "agent_decide" ? "agent_decide" : "cancelled";
|
|
246
|
+
if (wait.responseIdempotencyKey === input.idempotencyKey) {
|
|
247
|
+
if (wait.resolution !== resolution || normalized && wait.answer !== normalized.answer) return {
|
|
248
|
+
ok: false,
|
|
249
|
+
code: "CONFLICT",
|
|
250
|
+
clarification: wait
|
|
251
|
+
};
|
|
252
|
+
return {
|
|
253
|
+
ok: true,
|
|
254
|
+
clarification: wait,
|
|
255
|
+
idempotent: true,
|
|
256
|
+
queued: wait.status === "queued"
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
if (wait.kind === "approval" && wait.expiresAt !== void 0 && wait.expiresAt <= now && (wait.status === "open" || wait.status === "queued")) return {
|
|
221
260
|
ok: false,
|
|
222
261
|
code: "EXPIRED",
|
|
223
262
|
clarification: expireApproval(wait, now)
|
|
224
263
|
};
|
|
225
|
-
if (db.prepare("SELECT id FROM session_inputs WHERE conversation_id = ? AND client_message_id = ?").get(wait.conversationId, input.idempotencyKey)) return {
|
|
226
|
-
ok: true,
|
|
227
|
-
clarification: wait,
|
|
228
|
-
idempotent: true,
|
|
229
|
-
queued: wait.status === "queued"
|
|
230
|
-
};
|
|
231
|
-
if (wait.responseIdempotencyKey === input.idempotencyKey) return {
|
|
232
|
-
ok: true,
|
|
233
|
-
clarification: wait,
|
|
234
|
-
idempotent: true,
|
|
235
|
-
queued: wait.status === "queued"
|
|
236
|
-
};
|
|
237
|
-
if (wait.version !== input.expectedVersion || wait.status !== "open") return {
|
|
264
|
+
if (db.prepare("SELECT id FROM session_inputs WHERE conversation_id = ? AND client_message_id = ?").get(wait.conversationId, input.idempotencyKey) || wait.version !== input.expectedVersion || wait.status !== "open") return {
|
|
238
265
|
ok: false,
|
|
239
266
|
code: "CONFLICT",
|
|
240
267
|
clarification: wait
|
|
241
268
|
};
|
|
242
|
-
const trimmed = input.answer?.trim() ?? "";
|
|
243
|
-
if (input.action === "answer" && !trimmed) return {
|
|
244
|
-
ok: false,
|
|
245
|
-
code: "INVALID"
|
|
246
|
-
};
|
|
247
|
-
if (input.action === "agent_decide" && wait.kind === "approval") return {
|
|
248
|
-
ok: false,
|
|
249
|
-
code: "INVALID"
|
|
250
|
-
};
|
|
251
|
-
const resolution = input.action === "answer" ? "answered" : input.action === "agent_decide" ? "agent_decide" : "cancelled";
|
|
252
269
|
if (input.action === "cancel") {
|
|
253
270
|
const cancelled = writeWait({
|
|
254
271
|
...wait,
|
|
@@ -273,10 +290,12 @@ function resolveClarification(input) {
|
|
|
273
290
|
queued: false
|
|
274
291
|
};
|
|
275
292
|
}
|
|
276
|
-
const answer = input.action === "agent_decide" ? "Use your best judgment and continue without additional user input." :
|
|
293
|
+
const answer = input.action === "agent_decide" ? "Use your best judgment and continue without additional user input." : normalized.answer;
|
|
277
294
|
const queued = writeWait({
|
|
278
295
|
...wait,
|
|
279
296
|
status: "queued",
|
|
297
|
+
response: normalized?.response,
|
|
298
|
+
decision: normalized?.decision,
|
|
280
299
|
answer,
|
|
281
300
|
resolution,
|
|
282
301
|
responseIdempotencyKey: input.idempotencyKey,
|
|
@@ -380,7 +399,7 @@ function consumeClarificationApproval(conversationId, approvalKey) {
|
|
|
380
399
|
if (input?.kind !== "clarification_resume" || !input.payload) return void 0;
|
|
381
400
|
const wait = getClarification(input.payload.waitId);
|
|
382
401
|
if (!wait || wait.kind !== "approval" || wait.approvalKey !== approvalKey || wait.approvalConsumedAt) return;
|
|
383
|
-
const approved = wait.
|
|
402
|
+
const approved = (wait.expiresAt === void 0 || wait.expiresAt > Date.now()) && wait.decision === "approve";
|
|
384
403
|
writeWait({
|
|
385
404
|
...wait,
|
|
386
405
|
approvalConsumedAt: Date.now(),
|
|
@@ -416,6 +435,7 @@ function supersedeActiveClarification(conversationId, now = Date.now()) {
|
|
|
416
435
|
}
|
|
417
436
|
var APPROVAL_TTL_MS, STALE_CONTEXT_MS;
|
|
418
437
|
var init_clarification_wait_repository = __esmMin((() => {
|
|
438
|
+
init_src();
|
|
419
439
|
init_task_run_repository();
|
|
420
440
|
init_connection();
|
|
421
441
|
init_session_instance_repository();
|