@xopcai/xopc 0.0.235 → 0.0.239
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/manifest.json +1 -1
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/feishu/src/schema/config-schema.d.ts +8 -8
- package/dist/extensions/telegram/src/config-schema.d.ts +8 -8
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/config-schema.d.ts +3 -3
- package/dist/gateway/static/root/assets/{activity-store-BzswYHcj.js → activity-store-DLfkwJzZ.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-dvh9aEm6.js → agent-avatar-dicebear-C1rtpjd7.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-oW6wFuP9.js +1 -0
- package/dist/gateway/static/root/assets/agents-V-nDPOk2.js +1 -0
- package/dist/gateway/static/root/assets/{api-7zOtMbaE.js → api-IUm57Zse.js} +1 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-CRDnRN4G.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-BCYZIKqQ.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-dcvQDCvy.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DawToDU8.js → archive-plugin-Bha1jUhj.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DmBAKvsi.js → attachment-load-Bgfh7Ag2.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BGkF6XNH.js → automations-page-BdH131M0.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BtwzQZAR.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-B-6Ski7l.js → binary-plugins-BwXg9na-.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BgeKQN1F.js → block-editor-BngtUSNv.js} +56 -56
- package/dist/gateway/static/root/assets/browser-settings-page-kfNOKQ2x.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-4ooVX-Tx.js → browser-workflow-inputs-CHHw7Ula.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-D92g81lS.js → browser-workflows-page-Ael9sxrp.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DOymgkUM.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-YscUvFub.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-BDJvMnA_.js → channels-status-swr-CwUSKmeY.js} +1 -1
- package/dist/gateway/static/root/assets/chat-terminal-dock-DI0lYVKk.js +36 -0
- package/dist/gateway/static/root/assets/connectors-page-BtzCRQGz.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-BYmr5ZuN.js → cron-expression-CLuvPZ3b.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-FKL_b_S0.js → date-picker-D4QS8Zzn.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-DZn-RhEm.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-DOXjRTqK.js → desktop-pet-C6KqTQas.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-Bov3XuPO.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BeJ1-5ID.js → extension-debug-page-DpeeYAjX.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CncDndLS.js → extension-page-Cescx_be.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BxxL0HqU.js → extension-settings-page-C_ubW61U.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-Dc6A6HyJ.js → gateway-config-api-BM79X1jC.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-R702lNJR.js → gateway-config-swr-DfMY-MLf.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-GV5KAj-l.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-2rVSUvyw.js → gateway-startup-retry-S6aB0hVI.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-CZ1KeXXU.js +1 -0
- package/dist/gateway/static/root/assets/home-page-YdVal_8I.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-B28USRCK.js → image-generation-api-DOX5uq-R.js} +1 -1
- package/dist/gateway/static/root/assets/index-7GLgmvAm.css +2 -0
- package/dist/gateway/static/root/assets/index-DKP23eMn.js +70 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Cwinks_5.js → keyboard-shortcuts-settings-Tn7xSeVT.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DCt7cbvK.js +2 -0
- package/dist/gateway/static/root/assets/local-apps-page-Co5_qKEQ.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-8k4mvYGL.js → locale-store-XDFAPNNu.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-ChfSQQSV.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-DE0o5c7Y.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-split-B6wQhwLV.js → markdown-split-CADkGbQi.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-Y68dCxuc.css +1 -0
- package/dist/gateway/static/root/assets/markdown-view-v-O3cOpk.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-BSEPuO76.js → media-plugins-mHodPaFz.js} +1 -1
- package/dist/gateway/static/root/assets/messages-B1HDp_j8.js +3 -0
- package/dist/gateway/static/root/assets/mobile-pairing-wizard-43FyMswX.js +1 -0
- package/dist/gateway/static/root/assets/models-hub-cache-Bngs8o1m.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-p2Pncp2B.js → notes-api-BMhFpRmW.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CPgbeO1u.js → notes-page-BMUyJStB.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DjHIQneE.js +4 -0
- package/dist/gateway/static/root/assets/{oauth-api-DpLONwfK.js → oauth-api-B_pcOUfT.js} +1 -1
- package/dist/gateway/static/root/assets/popover-select-DBrVS3tZ.js +1 -0
- package/dist/gateway/static/root/assets/{product-delivery-tRr-7IxY.js → product-delivery-dUJgmBQZ.js} +1 -1
- package/dist/gateway/static/root/assets/product-open-page-B8cjLdm4.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-CXD2pVgQ.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-cqKqkTwG.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-B7b0LJgI.js → registry-api-DeVvBsl4.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-UEinEd7d.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-D3TCJGy3.js → runtime-tools-settings-panel-ClCEmwPY.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DUAlwNoO.js → schema-form-0vcUqeqa.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-Cc6ve-qc.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-_J5FSEYX.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-D7nQ3Lfu.js → settings-form-section-BkdLf_sS.js} +1 -1
- package/dist/gateway/static/root/assets/settings-loading-skeleton-CAmWMaOT.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-CMAkMc3I.js → settings-page-QBTaBpBn.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-bQcSMkVr.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-D_OuXnah.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-DJfcpok3.js +1 -0
- package/dist/gateway/static/root/assets/skeleton-BwbyijEw.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-Bbqp5HaH.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-DJRr5HFw.js → skills-page-BNcnmaTg.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-DcrBe39q.js → skills-page.utils-BWWcFShl.js} +1 -1
- package/dist/gateway/static/root/assets/system-settings-panel-BsH7b3B4.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-CcAhyw2Z.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-CpcBI73Q.js → theme-store-5-XHH7F0.js} +1 -1
- package/dist/gateway/static/root/assets/tunnel-api-D5-Hggt3.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-DDEypreQ.js → use-autosave-Dp1ycDa8.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-Dd_oMNie.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BLa_vdXE.js → voice-api-key-field-DhrQXH3c.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-ynE-vY6I.js → voice-config-api-Bk_bVeGX.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DS3w1Fyq.js → work-discovery-overlay-B7zKAPrb.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-jQl_wmYC.js → workflow-run-setup-panel-Cek9K48F.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-T2q2Mx6H.js +5 -0
- package/dist/gateway/static/root/index.html +18 -17
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/device-pairing.js +39 -0
- package/dist/packages/gateway-contract/src/model-selection.js +7 -0
- package/dist/packages/gateway-contract/src/new-session.js +9 -2
- package/dist/packages/gateway-contract/src/turn-outcome.js +27 -2
- package/dist/src/agent/agent-manager.js +4 -4
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/embedded/run-turn.js +5 -0
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/models/manager.d.ts +3 -0
- package/dist/src/agent/models/manager.js +9 -0
- package/dist/src/agent/prompt/sections/tooling.js +1 -0
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-config-service.d.ts +6 -2
- package/dist/src/agent/session/session-config-service.js +78 -17
- package/dist/src/agent/session/session-hydrator.d.ts +3 -4
- package/dist/src/agent/session/session-hydrator.js +19 -8
- package/dist/src/agent/session/session-inspector.d.ts +3 -1
- package/dist/src/agent/session/session-inspector.js +8 -4
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tools/exec-command.js +1 -0
- package/dist/src/agent/tools/publish-artifacts.d.ts +1 -0
- package/dist/src/agent/tools/publish-artifacts.js +15 -4
- package/dist/src/agent/tools/xopc-use-tool.js +4 -4
- package/dist/src/agent/transcript/thinking-types.d.ts +1 -1
- package/dist/src/agent/transcript/thinking-types.js +2 -0
- package/dist/src/agent-config/schema.d.ts +16 -16
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/automations/domain/validation.d.ts +62 -62
- package/dist/src/automations/draft/automation-draft-validator.d.ts +10 -10
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +1 -0
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/connectors.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/extension-marketplace.js +2 -2
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.d.ts +137 -11
- package/dist/src/config/models-json.js +29 -2
- package/dist/src/config/schema.d.ts +15 -15
- package/dist/src/execution-environments/git.d.ts +27 -0
- package/dist/src/execution-environments/git.js +125 -0
- package/dist/src/execution-environments/index.d.ts +7 -0
- package/dist/src/execution-environments/index.js +8 -0
- package/dist/src/execution-environments/local-worktree-manager.d.ts +37 -0
- package/dist/src/execution-environments/local-worktree-manager.js +322 -0
- package/dist/src/execution-environments/paths.d.ts +2 -0
- package/dist/src/execution-environments/paths.js +18 -0
- package/dist/src/execution-environments/session-environment-service.d.ts +22 -0
- package/dist/src/execution-environments/session-environment-service.js +73 -0
- package/dist/src/execution-environments/store.d.ts +13 -0
- package/dist/src/execution-environments/store.js +183 -0
- package/dist/src/execution-environments/subject.d.ts +2 -0
- package/dist/src/execution-environments/subject.js +12 -0
- package/dist/src/execution-environments/types.d.ts +74 -0
- package/dist/src/execution-environments/types.js +54 -0
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/custom-image-providers.d.ts +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +4 -4
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/chat-model-config.d.ts +34 -0
- package/dist/src/gateway/hono/routes/chat-model-config.js +42 -0
- package/dist/src/gateway/hono/routes/device-pairing-approval.d.ts +3 -0
- package/dist/src/gateway/hono/routes/device-pairing-approval.js +100 -0
- package/dist/src/gateway/hono/routes/devices.js +15 -8
- package/dist/src/gateway/hono/routes/execution-environments.d.ts +3 -0
- package/dist/src/gateway/hono/routes/execution-environments.js +136 -0
- package/dist/src/gateway/hono/routes/index.js +4 -0
- package/dist/src/gateway/hono/routes/mobile-privacy.d.ts +3 -0
- package/dist/src/gateway/hono/routes/mobile-privacy.js +13 -0
- package/dist/src/gateway/hono/routes/models.js +10 -1
- package/dist/src/gateway/hono/routes/projects.js +43 -4
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +15 -1
- package/dist/src/gateway/hono/routes/session-input-handler.js +122 -52
- package/dist/src/gateway/hono/routes/sessions.js +105 -22
- package/dist/src/gateway/hono/routes/tasks.js +4 -12
- package/dist/src/gateway/mobile-privacy.d.ts +7 -0
- package/dist/src/gateway/mobile-privacy.js +102 -0
- package/dist/src/gateway/security/gateway-scopes.js +1 -0
- package/dist/src/gateway/service/agent-runner.d.ts +1 -1
- package/dist/src/gateway/service/config-coordinator.js +2 -2
- package/dist/src/gateway/service/session-input-coordinator.d.ts +2 -1
- package/dist/src/gateway/service/session-input-coordinator.js +14 -5
- package/dist/src/gateway/service/sessions-api.d.ts +4 -12
- package/dist/src/gateway/service/sessions-api.js +13 -0
- package/dist/src/gateway/service.d.ts +1 -1
- package/dist/src/gateway/service.js +8 -8
- package/dist/src/gateway/session-context-summary.d.ts +5 -0
- package/dist/src/gateway/session-context-summary.js +151 -0
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/i18n/response-language.d.ts +1 -1
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/projects/index.js +3 -3
- package/dist/src/projects/project-kind.d.ts +7 -0
- package/dist/src/projects/project-kind.js +6 -1
- package/dist/src/projects/project-service.js +10 -2
- package/dist/src/projects/project-store.d.ts +1 -0
- package/dist/src/projects/project-store.js +10 -7
- package/dist/src/projects/types.d.ts +4 -0
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +3 -1
- package/dist/src/providers/model-thinking.d.ts +4 -0
- package/dist/src/providers/model-thinking.js +41 -0
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/session/config-types.d.ts +1 -0
- package/dist/src/session/index.js +1 -1
- package/dist/src/session/model-config-lock.d.ts +2 -0
- package/dist/src/session/model-config-lock.js +14 -0
- package/dist/src/session/session-workspace.d.ts +2 -1
- package/dist/src/session/session-workspace.js +5 -1
- package/dist/src/session/store.js +1 -1
- package/dist/src/session/turn-outcome-projector.js +9 -9
- package/dist/src/share/hosted-session-share.js +1 -1
- package/dist/src/storage/sqlite/config-repository.js +6 -5
- package/dist/src/storage/sqlite/device-access-repository.d.ts +2 -0
- package/dist/src/storage/sqlite/device-access-repository.js +12 -2
- package/dist/src/storage/sqlite/device-pairing-approval.d.ts +19 -0
- package/dist/src/storage/sqlite/device-pairing-approval.js +154 -0
- package/dist/src/storage/sqlite/device-pairing-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/device-pairing-repository.js +11 -4
- package/dist/src/storage/sqlite/index.js +2 -2
- package/dist/src/storage/sqlite/migrations/141_device_pairing_approval.sql +17 -0
- package/dist/src/storage/sqlite/migrations/142_session_input_instance.sql +1 -0
- package/dist/src/storage/sqlite/migrations/143_fixed_session_model.sql +1 -0
- package/dist/src/storage/sqlite/migrations/144_execution_environments.sql +59 -0
- package/dist/src/storage/sqlite/migrations/145_project_execution_mode.sql +5 -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/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/row-mappers.d.ts +1 -0
- package/dist/src/storage/sqlite/row-mappers.js +3 -2
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.d.ts +5 -0
- package/dist/src/storage/sqlite/session-input-repository.js +15 -4
- package/dist/src/storage/sqlite/session-repository.js +1 -1
- package/dist/src/tasks/execution-context.d.ts +3 -1
- package/dist/src/tasks/execution-context.js +7 -2
- package/dist/src/tasks/home-query-service.js +2 -2
- package/dist/src/tui/backends/embedded-backend.js +2 -2
- package/dist/src/tui/components/thinking-selector.js +1 -0
- package/dist/src/tui/tui-settings.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/user-context/config.d.ts +9 -9
- package/dist/src/work-discovery/service.d.ts +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +2 -2
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-B9tkmkUj.js +0 -1
- package/dist/gateway/static/root/assets/agents-DTXYo-7z.js +0 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-DXFTk7x6.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-D-FD5SOq.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BT102W58.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-BRb45-_R.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-BkRWxC7D.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DfT-vWTA.js +0 -7
- package/dist/gateway/static/root/assets/channels-settings-C9oGpLR0.js +0 -1
- package/dist/gateway/static/root/assets/chat-terminal-dock-C_9LUs7G.js +0 -36
- package/dist/gateway/static/root/assets/connectors-page-SJKV6SHT.js +0 -2
- package/dist/gateway/static/root/assets/dependency-picker-BP68vqBI.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-CuG2qYoY.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-C2XcazGD.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-BjUEqkkC.js +0 -1
- package/dist/gateway/static/root/assets/home-page-DTSjwfAQ.js +0 -1
- package/dist/gateway/static/root/assets/index-BTUuTnc9.css +0 -2
- package/dist/gateway/static/root/assets/index-DFfvY8IN.js +0 -70
- package/dist/gateway/static/root/assets/local-app-workbench-page-0wntj9mK.js +0 -2
- package/dist/gateway/static/root/assets/local-apps-page-WeKm5vZ0.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-DFgJr7Zx.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-8bEvKO0R.js +0 -1
- package/dist/gateway/static/root/assets/markdown-view-B1bGSQqt.css +0 -1
- package/dist/gateway/static/root/assets/markdown-view-D02mJdoU.js +0 -201
- package/dist/gateway/static/root/assets/messages-CoovNoMn.js +0 -3
- package/dist/gateway/static/root/assets/mobile-device-api-CvjVB_TB.js +0 -1
- package/dist/gateway/static/root/assets/models-hub-cache-CYr6LzvY.js +0 -1
- package/dist/gateway/static/root/assets/notes-workbench-DIXCtwhs.js +0 -4
- package/dist/gateway/static/root/assets/popover-select-3E24E65N.js +0 -1
- package/dist/gateway/static/root/assets/product-open-page-DNHWn_26.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-6jgRJg4w.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-Bd4nXs4y.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C_5-u9U-.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BqYAR86S.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-a146I0uZ.js +0 -1
- package/dist/gateway/static/root/assets/settings-loading-skeleton-CwGM9zKH.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-rhaERxAL.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-BzkXvuH6.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-BvsM3Im5.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-u7E0gqFo.js +0 -1
- package/dist/gateway/static/root/assets/system-settings-panel-BUsykmjx.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-C9QgWfYG.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-Ch0cfQfI.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-DyTwkdzs.js +0 -5
- /package/dist/gateway/static/root/assets/{dist-DqPZM2MH2.js → dist-DqPZM2MH.js} +0 -0
|
@@ -3,8 +3,12 @@ import { resolveProjectAgentId } from "../../../projects/project-agent.js";
|
|
|
3
3
|
import "../../../projects/index.js";
|
|
4
4
|
import { evictEmbeddedSessionRunner } from "../../../agent/embedded/session-runner.js";
|
|
5
5
|
import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
6
|
+
import { SessionEnvironmentService } from "../../../execution-environments/session-environment-service.js";
|
|
6
7
|
import { deleteMediaUrisNoLongerReferenced } from "../../../media/session-references.js";
|
|
8
|
+
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
7
9
|
import { createGatewayRouteLogger, logRouteError } from "../lib/route-logger.js";
|
|
10
|
+
import { patchChatModelConfig } from "./chat-model-config.js";
|
|
11
|
+
import { getSessionContextSummary } from "../../session-context-summary.js";
|
|
8
12
|
import { respondStartupUnavailable } from "../lib/startup-unavailable.js";
|
|
9
13
|
import { randomUUID } from "node:crypto";
|
|
10
14
|
//#region src/gateway/hono/routes/sessions.ts
|
|
@@ -21,6 +25,9 @@ const DEFAULT_SIDEBAR_STALE_DAYS = 60;
|
|
|
21
25
|
function isSessionType(value) {
|
|
22
26
|
return SESSION_TYPES.has(value);
|
|
23
27
|
}
|
|
28
|
+
function parseExecutionMode(value) {
|
|
29
|
+
return value === "local_checkout" || value === "managed_worktree" ? value : void 0;
|
|
30
|
+
}
|
|
24
31
|
function ensureGatewayReadyForSessions(c, service, method) {
|
|
25
32
|
if (service.isGatewayReady()) return null;
|
|
26
33
|
return respondStartupUnavailable(c, method);
|
|
@@ -60,6 +67,14 @@ function buildDirectSessionMetadata(params) {
|
|
|
60
67
|
}
|
|
61
68
|
function registerSessionsRoutes(authenticated, deps) {
|
|
62
69
|
const { service } = deps;
|
|
70
|
+
const environments = new SessionEnvironmentService();
|
|
71
|
+
authenticated.get("/api/sessions/:key/context-summary", async (c) => {
|
|
72
|
+
const blocked = ensureGatewayReadyForSessions(c, service, "sessions.list");
|
|
73
|
+
if (blocked) return blocked;
|
|
74
|
+
c.header("Cache-Control", "no-store");
|
|
75
|
+
const summary = await getSessionContextSummary(service.currentConfig, c.req.param("key"), getGatewayPrincipal(c).scopes);
|
|
76
|
+
return summary ? c.json({ summary }) : c.json({ error: "Session not found" }, 404);
|
|
77
|
+
});
|
|
63
78
|
authenticated.get("/api/session-runs", (c) => {
|
|
64
79
|
const blocked = ensureGatewayReadyForSessions(c, service, "sessions.list");
|
|
65
80
|
if (blocked) return blocked;
|
|
@@ -132,10 +147,16 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
132
147
|
const channel = typeof body.channel === "string" && body.channel.trim() ? body.channel.trim() : "webchat";
|
|
133
148
|
const projectId = typeof body.projectId === "string" && body.projectId.trim() ? body.projectId.trim() : void 0;
|
|
134
149
|
const routingCfg = service.currentConfig;
|
|
135
|
-
|
|
150
|
+
const project = projectId ? service.projects.get(projectId) : null;
|
|
151
|
+
if (projectId && !project) return c.json({
|
|
136
152
|
ok: false,
|
|
137
153
|
error: "Project not found"
|
|
138
154
|
}, 404);
|
|
155
|
+
const requestedExecutionMode = parseExecutionMode(body.executionMode);
|
|
156
|
+
if (body.executionMode !== void 0 && !requestedExecutionMode) return c.json({
|
|
157
|
+
ok: false,
|
|
158
|
+
error: "Invalid execution mode"
|
|
159
|
+
}, 400);
|
|
139
160
|
const agentId = resolveProjectAgentId({
|
|
140
161
|
config: routingCfg,
|
|
141
162
|
projects: service.projects,
|
|
@@ -150,13 +171,34 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
150
171
|
peerKind: "direct",
|
|
151
172
|
peerId: chatId
|
|
152
173
|
});
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
174
|
+
let environment;
|
|
175
|
+
if (project && (project.workspaceRoot?.trim() || requestedExecutionMode)) try {
|
|
176
|
+
environment = await environments.attach({
|
|
177
|
+
sessionKey,
|
|
178
|
+
project,
|
|
179
|
+
mode: requestedExecutionMode,
|
|
180
|
+
baseRef: typeof body.baseRef === "string" ? body.baseRef : void 0
|
|
181
|
+
});
|
|
182
|
+
} catch (error) {
|
|
183
|
+
return c.json({
|
|
184
|
+
ok: false,
|
|
185
|
+
code: "execution_environment_unavailable",
|
|
186
|
+
error: error instanceof Error ? error.message : String(error)
|
|
187
|
+
}, 409);
|
|
188
|
+
}
|
|
189
|
+
try {
|
|
190
|
+
await service.sessionIndexInstance.saveMessages(sessionKey, [], { metadata: buildDirectSessionMetadata({
|
|
191
|
+
agentId,
|
|
192
|
+
source: channel,
|
|
193
|
+
accountId: "default",
|
|
194
|
+
peerId: chatId
|
|
195
|
+
}) });
|
|
196
|
+
if (projectId) service.projects.attachSession(sessionKey, projectId);
|
|
197
|
+
} catch (error) {
|
|
198
|
+
await service.sessions.delete(sessionKey).catch(() => void 0);
|
|
199
|
+
await environments.release(sessionKey).catch(() => void 0);
|
|
200
|
+
throw error;
|
|
201
|
+
}
|
|
160
202
|
const rawInitialConfig = body.initialAgentConfig && typeof body.initialAgentConfig === "object" ? body.initialAgentConfig : {};
|
|
161
203
|
const model = typeof rawInitialConfig.model === "string" && rawInitialConfig.model.trim() ? rawInitialConfig.model.trim() : void 0;
|
|
162
204
|
const thinkingLevel = typeof rawInitialConfig.thinkingLevel === "string" && rawInitialConfig.thinkingLevel.trim() ? rawInitialConfig.thinkingLevel.trim() : void 0;
|
|
@@ -165,15 +207,47 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
165
207
|
...thinkingLevel ? { thinkingLevel } : {},
|
|
166
208
|
...body.temporary === true ? { userContextMode: "temporary" } : {}
|
|
167
209
|
};
|
|
210
|
+
if (channel === "webchat" && model) {
|
|
211
|
+
const result = await service.sessions.initializeChatModel(sessionKey, model, thinkingLevel);
|
|
212
|
+
if (!result.ok) {
|
|
213
|
+
await service.sessions.delete(sessionKey).catch(() => void 0);
|
|
214
|
+
await environments.release(sessionKey).catch((error) => {
|
|
215
|
+
log.warn({
|
|
216
|
+
err: error,
|
|
217
|
+
sessionKey
|
|
218
|
+
}, "Invalid new session model and execution environment cleanup failed");
|
|
219
|
+
});
|
|
220
|
+
return c.json({
|
|
221
|
+
ok: false,
|
|
222
|
+
error: result.error
|
|
223
|
+
}, 400);
|
|
224
|
+
}
|
|
225
|
+
delete initialAgentConfig.model;
|
|
226
|
+
delete initialAgentConfig.thinkingLevel;
|
|
227
|
+
}
|
|
168
228
|
if (Object.keys(initialAgentConfig).length > 0) {
|
|
169
229
|
const result = await service.sessions.patchAgentConfig(sessionKey, initialAgentConfig);
|
|
170
|
-
if (!result.ok)
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
230
|
+
if (!result.ok) {
|
|
231
|
+
await service.sessions.delete(sessionKey).catch(() => void 0);
|
|
232
|
+
await environments.release(sessionKey).catch((error) => {
|
|
233
|
+
log.warn({
|
|
234
|
+
err: error,
|
|
235
|
+
sessionKey
|
|
236
|
+
}, "Invalid new session config and execution environment cleanup failed");
|
|
237
|
+
});
|
|
238
|
+
return c.json({
|
|
239
|
+
ok: false,
|
|
240
|
+
error: result.error
|
|
241
|
+
}, 400);
|
|
242
|
+
}
|
|
174
243
|
}
|
|
175
244
|
const session = await service.sessions.getSession(sessionKey);
|
|
176
|
-
|
|
245
|
+
const agentConfig = channel === "webchat" ? await service.sessions.getFixedAgentConfig(sessionKey) : void 0;
|
|
246
|
+
return c.json({
|
|
247
|
+
session,
|
|
248
|
+
agentConfig,
|
|
249
|
+
...environment ? { environment } : {}
|
|
250
|
+
}, 201);
|
|
177
251
|
});
|
|
178
252
|
authenticated.get("/api/sessions", async (c) => {
|
|
179
253
|
const blocked = ensureGatewayReadyForSessions(c, service, "sessions.list");
|
|
@@ -253,21 +327,14 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
253
327
|
});
|
|
254
328
|
authenticated.get("/api/sessions/:key/agent-config", async (c) => {
|
|
255
329
|
const key = c.req.param("key");
|
|
256
|
-
const payload = await service.sessions.
|
|
330
|
+
const payload = await service.sessions.getFixedAgentConfig(key);
|
|
257
331
|
return c.json({
|
|
258
332
|
ok: true,
|
|
259
333
|
payload
|
|
260
334
|
});
|
|
261
335
|
});
|
|
262
336
|
authenticated.patch("/api/sessions/:key/agent-config", async (c) => {
|
|
263
|
-
|
|
264
|
-
const body = await c.req.json().catch(() => ({}));
|
|
265
|
-
const result = await service.sessions.patchAgentConfig(key, body);
|
|
266
|
-
if (!result.ok) return c.json({
|
|
267
|
-
ok: false,
|
|
268
|
-
error: result.error
|
|
269
|
-
}, 400);
|
|
270
|
-
return c.json({ ok: true });
|
|
337
|
+
return patchChatModelConfig(c, service, c.req.param("key"), await c.req.json().catch(() => ({})));
|
|
271
338
|
});
|
|
272
339
|
authenticated.get("/api/sessions/:key/messages", async (c) => {
|
|
273
340
|
const blocked = ensureGatewayReadyForSessions(c, service, "sessions.messages");
|
|
@@ -574,6 +641,12 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
574
641
|
ok: false,
|
|
575
642
|
error: "Project not found"
|
|
576
643
|
}, 404);
|
|
644
|
+
const currentProjectId = (await service.sessions.getSession(key))?.projectId ?? null;
|
|
645
|
+
if (requestedProjectId !== currentProjectId && environments.get(key)) return c.json({
|
|
646
|
+
ok: false,
|
|
647
|
+
code: "execution_environment_active",
|
|
648
|
+
error: "Release the session execution environment before changing its project"
|
|
649
|
+
}, 409);
|
|
577
650
|
}
|
|
578
651
|
const result = await service.sessions.patch(key, patch);
|
|
579
652
|
if (result.ok === false) return c.json({
|
|
@@ -747,7 +820,17 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
747
820
|
});
|
|
748
821
|
authenticated.delete("/api/sessions/:key", async (c) => {
|
|
749
822
|
const key = c.req.param("key");
|
|
823
|
+
if (environments.get(key) && service.getActiveWebchatRunId(key)) return c.json({
|
|
824
|
+
ok: false,
|
|
825
|
+
error: "Stop the active session run before deleting its environment"
|
|
826
|
+
}, 409);
|
|
750
827
|
const result = await service.sessions.delete(key);
|
|
828
|
+
if (result.deleted) await environments.release(key).catch((error) => {
|
|
829
|
+
log.warn({
|
|
830
|
+
err: error,
|
|
831
|
+
sessionKey: key
|
|
832
|
+
}, "Session deleted but execution environment cleanup failed");
|
|
833
|
+
});
|
|
751
834
|
return c.json(result);
|
|
752
835
|
});
|
|
753
836
|
authenticated.post("/api/sessions/:key/archive", async (c) => {
|
|
@@ -18,6 +18,7 @@ import { TaskHandoffService } from "../../../tasks/task-handoff-service.js";
|
|
|
18
18
|
import { TaskDeletionService } from "../../../tasks/task-deletion-service.js";
|
|
19
19
|
import { TaskSignalService } from "../../../tasks/task-signal-service.js";
|
|
20
20
|
import { submitSessionInput } from "./session-input-handler.js";
|
|
21
|
+
import { patchChatModelConfig } from "./chat-model-config.js";
|
|
21
22
|
import { TaskConversationQueryService } from "../../service/task-conversation-query-service.js";
|
|
22
23
|
//#region src/gateway/hono/routes/tasks.ts
|
|
23
24
|
function registerTaskRoutes(authenticated, deps) {
|
|
@@ -219,25 +220,16 @@ function registerTaskRoutes(authenticated, deps) {
|
|
|
219
220
|
});
|
|
220
221
|
authenticated.patch("/api/tasks/:id/conversation/config", taskRateLimit, async (c) => {
|
|
221
222
|
const body = await c.req.json().catch(() => null);
|
|
222
|
-
|
|
223
|
-
if (!model) return c.json({
|
|
223
|
+
if (!body) return c.json({
|
|
224
224
|
ok: false,
|
|
225
|
-
error: "
|
|
225
|
+
error: "Invalid configuration"
|
|
226
226
|
}, 400);
|
|
227
227
|
const active = conversations.getActiveSession(c.req.param("id"));
|
|
228
228
|
if (!active?.sessionKey) return c.json({
|
|
229
229
|
ok: false,
|
|
230
230
|
error: "Task has no active conversation"
|
|
231
231
|
}, 404);
|
|
232
|
-
|
|
233
|
-
if (!result.ok) return c.json({
|
|
234
|
-
ok: false,
|
|
235
|
-
error: result.error
|
|
236
|
-
}, 400);
|
|
237
|
-
return c.json({
|
|
238
|
-
ok: true,
|
|
239
|
-
activeSessionKey: active.sessionKey
|
|
240
|
-
});
|
|
232
|
+
return patchChatModelConfig(c, deps.service, active.sessionKey, body);
|
|
241
233
|
});
|
|
242
234
|
authenticated.get("/api/tasks/:id/conversation/history", async (c) => {
|
|
243
235
|
const parsedLimit = Number.parseInt(c.req.query("limit") ?? "50", 10);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MobilePrivacyDisclosure, MobilePrivacyRecipient } from '@xopcai/gateway-contract';
|
|
2
|
+
import type { Config } from '../config/schema.js';
|
|
3
|
+
/** Only expose origins: provider URLs can contain credentials, query tokens and tenant paths. */
|
|
4
|
+
export declare function privacyRecipientOrigin(value: unknown): string | undefined;
|
|
5
|
+
export declare function buildMobilePrivacyDisclosure(recipients: MobilePrivacyRecipient[]): MobilePrivacyDisclosure;
|
|
6
|
+
/** Catalog of potential recipients, including configured fallbacks, without content or credentials. */
|
|
7
|
+
export declare function getMobilePrivacyDisclosure(config: Config): Promise<MobilePrivacyDisclosure>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { getProviderRegistry, init_plugin_registry } from "../providers/plugin-registry.js";
|
|
2
|
+
import { PROVIDER_META, getAvailableModels, init_providers } from "../providers/index.js";
|
|
3
|
+
import { resolveSpeechProviderChain } from "../voice/tts/factory.js";
|
|
4
|
+
import { mergeTtsConfigFromAppConfig } from "../voice/tts/merge-config.js";
|
|
5
|
+
import { resolveSTTProviderChain } from "../voice/stt/factory.js";
|
|
6
|
+
import { mergeSttConfigFromAppConfig } from "../voice/stt/config.js";
|
|
7
|
+
import { getVoiceProviderMetadata } from "../voice/metadata/registry.js";
|
|
8
|
+
import "../voice/metadata/index.js";
|
|
9
|
+
import { getImageGenerationCatalog } from "./image-generation-setup.js";
|
|
10
|
+
import { createHash } from "node:crypto";
|
|
11
|
+
//#region src/gateway/mobile-privacy.ts
|
|
12
|
+
init_providers();
|
|
13
|
+
init_plugin_registry();
|
|
14
|
+
/** Only expose origins: provider URLs can contain credentials, query tokens and tenant paths. */
|
|
15
|
+
function privacyRecipientOrigin(value) {
|
|
16
|
+
if (typeof value !== "string") return void 0;
|
|
17
|
+
try {
|
|
18
|
+
const url = new URL(value);
|
|
19
|
+
if (!["https:", "http:"].includes(url.protocol)) return void 0;
|
|
20
|
+
return url.origin;
|
|
21
|
+
} catch {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function buildMobilePrivacyDisclosure(recipients) {
|
|
26
|
+
const unique = /* @__PURE__ */ new Map();
|
|
27
|
+
for (const recipient of recipients) {
|
|
28
|
+
const safe = {
|
|
29
|
+
id: recipient.id,
|
|
30
|
+
name: recipient.name,
|
|
31
|
+
capability: recipient.capability,
|
|
32
|
+
...privacyRecipientOrigin(recipient.origin) ? { origin: privacyRecipientOrigin(recipient.origin) } : {}
|
|
33
|
+
};
|
|
34
|
+
unique.set(JSON.stringify(safe), safe);
|
|
35
|
+
}
|
|
36
|
+
const sorted = [...unique.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([, value]) => value);
|
|
37
|
+
return {
|
|
38
|
+
version: 1,
|
|
39
|
+
revision: createHash("sha256").update(JSON.stringify({
|
|
40
|
+
version: 1,
|
|
41
|
+
recipients: sorted
|
|
42
|
+
})).digest("hex"),
|
|
43
|
+
recipients: sorted
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** Catalog of potential recipients, including configured fallbacks, without content or credentials. */
|
|
47
|
+
async function getMobilePrivacyDisclosure(config) {
|
|
48
|
+
const recipients = [];
|
|
49
|
+
const registry = getProviderRegistry();
|
|
50
|
+
for (const model of await getAvailableModels()) recipients.push({
|
|
51
|
+
id: model.provider,
|
|
52
|
+
name: registry.get(model.provider)?.name ?? PROVIDER_META[model.provider]?.name ?? model.provider,
|
|
53
|
+
capability: "model",
|
|
54
|
+
origin: privacyRecipientOrigin(model.baseUrl)
|
|
55
|
+
});
|
|
56
|
+
const stt = mergeSttConfigFromAppConfig(config.tools?.media?.audio, config.tools?.media);
|
|
57
|
+
for (const provider of resolveSTTProviderChain(stt)) recipients.push({
|
|
58
|
+
id: provider.id,
|
|
59
|
+
name: getVoiceProviderMetadata("stt", provider.id)?.displayName ?? provider.id,
|
|
60
|
+
capability: "transcription",
|
|
61
|
+
origin: privacyRecipientOrigin(provider.baseUrl)
|
|
62
|
+
});
|
|
63
|
+
const tts = mergeTtsConfigFromAppConfig(config.messages?.tts);
|
|
64
|
+
if (tts.enabled) {
|
|
65
|
+
let speech = [];
|
|
66
|
+
try {
|
|
67
|
+
speech = resolveSpeechProviderChain(tts);
|
|
68
|
+
} catch {}
|
|
69
|
+
for (const provider of speech) recipients.push({
|
|
70
|
+
id: provider.providerId,
|
|
71
|
+
name: getVoiceProviderMetadata("tts", provider.providerId)?.displayName ?? provider.providerId,
|
|
72
|
+
capability: "speech",
|
|
73
|
+
origin: privacyRecipientOrigin(provider.providerConfig.baseUrl)
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
for (const provider of getImageGenerationCatalog(config).filter((entry) => entry.configured)) recipients.push({
|
|
77
|
+
id: provider.id,
|
|
78
|
+
name: provider.label,
|
|
79
|
+
capability: "image",
|
|
80
|
+
origin: privacyRecipientOrigin(provider.config.baseUrl)
|
|
81
|
+
});
|
|
82
|
+
for (const provider of config.tools?.web?.search?.providers ?? []) if (!provider.disabled) recipients.push({
|
|
83
|
+
id: provider.type,
|
|
84
|
+
name: provider.type,
|
|
85
|
+
capability: "search",
|
|
86
|
+
origin: privacyRecipientOrigin(provider.url)
|
|
87
|
+
});
|
|
88
|
+
recipients.push({
|
|
89
|
+
id: "bing-html",
|
|
90
|
+
name: "Microsoft Bing",
|
|
91
|
+
capability: "search",
|
|
92
|
+
origin: "https://cn.bing.com"
|
|
93
|
+
}, {
|
|
94
|
+
id: "duckduckgo-html",
|
|
95
|
+
name: "DuckDuckGo",
|
|
96
|
+
capability: "search",
|
|
97
|
+
origin: "https://html.duckduckgo.com"
|
|
98
|
+
});
|
|
99
|
+
return buildMobilePrivacyDisclosure(recipients);
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
export { buildMobilePrivacyDisclosure, getMobilePrivacyDisclosure, privacyRecipientOrigin };
|
|
@@ -43,6 +43,7 @@ function methodScope(method, read, write) {
|
|
|
43
43
|
return method === "GET" ? read : write;
|
|
44
44
|
}
|
|
45
45
|
function requiredGatewayScope(method, path) {
|
|
46
|
+
if (method === "GET" && path === "/api/mobile/privacy") return "gateway.status";
|
|
46
47
|
if (path === "/api/realtime/tickets" || path.startsWith("/api/status")) return "gateway.status";
|
|
47
48
|
if (path === "/api/device-auth/refresh" || path === "/api/devices/me") return "device.self";
|
|
48
49
|
if (path.startsWith("/api/devices/me/push")) return "notifications.self";
|
|
@@ -84,7 +84,7 @@ export declare class GatewayAgentRunner {
|
|
|
84
84
|
state: import("../../storage/sqlite/session-input-repository.js").SessionInputState;
|
|
85
85
|
} | {
|
|
86
86
|
ok: false;
|
|
87
|
-
code: "BAD_REQUEST" | "QUEUE_FULL" | "CONTEXT_UNAVAILABLE";
|
|
87
|
+
code: "BAD_REQUEST" | "QUEUE_FULL" | "CONTEXT_UNAVAILABLE" | "SESSION_CHANGED";
|
|
88
88
|
}>;
|
|
89
89
|
replaceLatestSessionTurn(input: ReplaceLatestTurnInput): Promise<{
|
|
90
90
|
ok: true;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { getModelRegistry } from "../../providers/model-registry.js";
|
|
4
3
|
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
4
|
+
import { getModelRegistry } from "../../providers/model-registry.js";
|
|
5
5
|
import { init_providers } from "../../providers/index.js";
|
|
6
6
|
import { disposeAllSessionMcpRuntimes } from "../../agent/mcp/bundle-mcp-runtime.js";
|
|
7
7
|
import { reloadImageGenerationProviders } from "../../agent/image/generation/provider-registry.js";
|
|
8
8
|
import "../../agent/mcp/bundle-mcp-tools.js";
|
|
9
9
|
import { ConfigHotReloader } from "../../config/reload.js";
|
|
10
10
|
import "../../config/index.js";
|
|
11
|
-
import { computeBundledExtensionExtensionsPatch } from "../../extensions/bundled-extension-activation.js";
|
|
12
11
|
import { sanitizeTunnelConfig } from "../../tunnel/tunnel-config.js";
|
|
12
|
+
import { computeBundledExtensionExtensionsPatch } from "../../extensions/bundled-extension-activation.js";
|
|
13
13
|
//#region src/gateway/service/config-coordinator.ts
|
|
14
14
|
init_providers();
|
|
15
15
|
init_logger();
|
|
@@ -3,6 +3,7 @@ import type { UserTurnAttachment } from '../user-turn-input.js';
|
|
|
3
3
|
import { type AgentSourceContext, type TurnContextRef } from '../../agent/source-context/types.js';
|
|
4
4
|
import { type SessionInputDelivery, type SessionInputState } from '../../storage/sqlite/index.js';
|
|
5
5
|
export type SubmitSessionInput = {
|
|
6
|
+
expectedSessionId?: string;
|
|
6
7
|
sessionKey: string;
|
|
7
8
|
clientMessageId: string;
|
|
8
9
|
delivery: SessionInputDelivery;
|
|
@@ -47,7 +48,7 @@ export declare class SessionInputCoordinator {
|
|
|
47
48
|
state: SessionInputState;
|
|
48
49
|
} | {
|
|
49
50
|
ok: false;
|
|
50
|
-
code: 'BAD_REQUEST' | 'QUEUE_FULL' | 'CONTEXT_UNAVAILABLE';
|
|
51
|
+
code: 'BAD_REQUEST' | 'QUEUE_FULL' | 'CONTEXT_UNAVAILABLE' | 'SESSION_CHANGED';
|
|
51
52
|
}>;
|
|
52
53
|
replaceLatestTurn(input: ReplaceLatestTurnInput, beforeReplace: () => Promise<void>): Promise<{
|
|
53
54
|
ok: true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { cancelQueuedSessionInput, claimNextSessionInput, findSessionInput, finishSessionInputRun, getSessionInputById, getSessionInputState, insertSessionInput, mutateQueuedSessionInput, recoverSessionInputState, setSessionInputStatus } from "../../storage/sqlite/session-input-repository.js";
|
|
3
|
+
import { SessionInstanceChangedError, cancelQueuedSessionInput, claimNextSessionInput, findSessionInput, finishSessionInputRun, getSessionInputById, getSessionInputState, insertSessionInput, mutateQueuedSessionInput, recoverSessionInputState, setSessionInputStatus } from "../../storage/sqlite/session-input-repository.js";
|
|
4
4
|
import { replaceLatestSessionTurnAndQueueInput, validateLatestSessionTurnTarget } from "../../storage/sqlite/session-turn-replace-repository.js";
|
|
5
5
|
import "../../storage/sqlite/index.js";
|
|
6
6
|
import { summarizeSourceContext } from "../../agent/source-context/types.js";
|
|
@@ -49,10 +49,18 @@ var SessionInputCoordinator = class {
|
|
|
49
49
|
}
|
|
50
50
|
async submit(input) {
|
|
51
51
|
const sessionKey = input.sessionKey.trim();
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
try {
|
|
53
|
+
return await this.runSubmissionExclusive(sessionKey, () => this.submitLocked({
|
|
54
|
+
...input,
|
|
55
|
+
sessionKey
|
|
56
|
+
}));
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (error instanceof SessionInstanceChangedError) return {
|
|
59
|
+
ok: false,
|
|
60
|
+
code: "SESSION_CHANGED"
|
|
61
|
+
};
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
56
64
|
}
|
|
57
65
|
async replaceLatestTurn(input, beforeReplace) {
|
|
58
66
|
const sessionKey = input.sessionKey.trim();
|
|
@@ -161,6 +169,7 @@ var SessionInputCoordinator = class {
|
|
|
161
169
|
const canSteer = input.origin.type !== "endpoint" && input.delivery === "steer" && runtime.activeRunId !== void 0 && !attachments?.length && !sourceContexts?.length;
|
|
162
170
|
const effectiveDelivery = canSteer ? "steer" : "next";
|
|
163
171
|
const row = insertSessionInput({
|
|
172
|
+
expectedSessionId: input.expectedSessionId,
|
|
164
173
|
id: crypto.randomUUID(),
|
|
165
174
|
sessionKey,
|
|
166
175
|
clientMessageId,
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GatewaySessionsApi — session CRUD, search, compaction, tag/pin/archive,
|
|
3
|
-
* stats, and chat-id grouping for the gateway REST surface.
|
|
4
|
-
*
|
|
5
|
-
* Twenty-four methods, previously sitting on `GatewayService` as a mix of
|
|
6
|
-
* one-line `sessionIndex.*` delegations and small composite operations (e.g.
|
|
7
|
-
* `restoreCheckpoint` also evicts the in-memory agent, `runCompaction` also
|
|
8
|
-
* appends a transcript context entry). Centralising them here lets routes
|
|
9
|
-
* depend on the narrow `GatewaySessionsApi` surface instead of the full
|
|
10
|
-
* `GatewayService`, and keeps the gateway composition root focused on
|
|
11
|
-
* lifecycle + wiring.
|
|
12
|
-
*/
|
|
13
1
|
import type { AgentService } from '../../agent/service.js';
|
|
14
2
|
import type { CompactionResult } from '../../agent/memory/compaction.js';
|
|
15
3
|
import { SessionIndex } from '../../session/index.js';
|
|
@@ -92,10 +80,14 @@ export declare class GatewaySessionsApi {
|
|
|
92
80
|
error: string;
|
|
93
81
|
}>;
|
|
94
82
|
getAgentConfig(sessionKey: string): Promise<import("../../agent/session/session-inspector.js").SessionAgentConfigView>;
|
|
83
|
+
getFixedAgentConfig(sessionKey: string): Promise<import("../../agent/session/session-inspector.js").SessionAgentConfigView>;
|
|
84
|
+
initializeChatModel(sessionKey: string, model: string, thinkingLevel?: string): Promise<import("../../agent/session/session-config-service.js").PatchSessionAgentConfigResult>;
|
|
95
85
|
/** Resolved markdown workspace for a session (after hydration / mkdir). */
|
|
96
86
|
getEffectiveWorkspacePath(sessionKey: string): Promise<string>;
|
|
97
87
|
patchAgentConfig(sessionKey: string, body: {
|
|
98
88
|
thinkingLevel?: string;
|
|
89
|
+
fixedModel?: boolean;
|
|
90
|
+
configVersion?: number;
|
|
99
91
|
model?: string | null;
|
|
100
92
|
activityDetailLevel?: string | null;
|
|
101
93
|
reasoningLevel?: string | null;
|
|
@@ -4,6 +4,7 @@ import { retireSessionMcpRuntimeForSessionKey } from "../../agent/mcp/bundle-mcp
|
|
|
4
4
|
import "../../agent/mcp/bundle-mcp-tools.js";
|
|
5
5
|
import { buildSessionTimeline } from "../../session/transcript-outline.js";
|
|
6
6
|
import { transcriptRowsToClientHistory } from "../../session/client-history.js";
|
|
7
|
+
import { withModelConfigLock } from "../../session/model-config-lock.js";
|
|
7
8
|
import { collectMediaUrisFromValues, deleteMediaUris } from "../../media/session-references.js";
|
|
8
9
|
import { getDistinctSessionChatIds } from "./session-chat-ids.js";
|
|
9
10
|
import { performSessionReset } from "../session-reset-service.js";
|
|
@@ -106,6 +107,18 @@ var GatewaySessionsApi = class {
|
|
|
106
107
|
async getAgentConfig(sessionKey) {
|
|
107
108
|
return this.opts.getAgentService().sessionInspector.agentConfig(sessionKey);
|
|
108
109
|
}
|
|
110
|
+
async getFixedAgentConfig(sessionKey) {
|
|
111
|
+
return withModelConfigLock(sessionKey, async () => {
|
|
112
|
+
const config = await this.getAgentConfig(sessionKey);
|
|
113
|
+
if (!config.fixedModel && !this.getActiveRun(sessionKey).active) {
|
|
114
|
+
if ((await this.opts.getAgentService().sessionConfig.initializeModelSelection(sessionKey, config.model, config.thinkingLevel, config.configVersion)).ok) return this.getAgentConfig(sessionKey);
|
|
115
|
+
}
|
|
116
|
+
return config;
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
initializeChatModel(sessionKey, model, thinkingLevel) {
|
|
120
|
+
return this.opts.getAgentService().sessionConfig.initializeModelSelection(sessionKey, model, thinkingLevel);
|
|
121
|
+
}
|
|
109
122
|
/** Resolved markdown workspace for a session (after hydration / mkdir). */
|
|
110
123
|
getEffectiveWorkspacePath(sessionKey) {
|
|
111
124
|
return this.opts.getAgentService().getEffectiveWorkspacePathForSession(sessionKey);
|
|
@@ -139,7 +139,7 @@ export declare class GatewayService {
|
|
|
139
139
|
state: import("../storage/sqlite/session-input-repository.js").SessionInputState;
|
|
140
140
|
} | {
|
|
141
141
|
ok: false;
|
|
142
|
-
code: "BAD_REQUEST" | "QUEUE_FULL" | "CONTEXT_UNAVAILABLE";
|
|
142
|
+
code: "BAD_REQUEST" | "QUEUE_FULL" | "CONTEXT_UNAVAILABLE" | "SESSION_CHANGED";
|
|
143
143
|
}>;
|
|
144
144
|
replaceLatestSessionTurn(...args: Parameters<GatewayAgentRunner['replaceLatestSessionTurn']>): Promise<{
|
|
145
145
|
ok: true;
|
|
@@ -9,18 +9,15 @@ import { closeXopcDatabase, openXopcDatabase } from "../storage/sqlite/connectio
|
|
|
9
9
|
import "../storage/sqlite/index.js";
|
|
10
10
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
11
11
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
12
|
+
import { buildSessionKey, init_session_key, sanitizeSegment } from "../routing/session-key.js";
|
|
13
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
12
14
|
import { init_paths, resolveAgentDir, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
|
|
13
|
-
import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
14
15
|
import { areExtensionsGloballyDisabled } from "../extensions/discover-extensions.js";
|
|
15
16
|
import { buildExtensionMetadataSnapshot } from "../extensions/extension-metadata-snapshot.js";
|
|
16
17
|
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, init_channel_catalog_service } from "../channels/catalog/channel-catalog-service.js";
|
|
17
18
|
import { loadConfig, saveConfig } from "../config/loader.js";
|
|
18
|
-
import {
|
|
19
|
-
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
19
|
+
import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
20
20
|
import { init_providers, providers_exports } from "../providers/index.js";
|
|
21
|
-
import { AutomationService } from "../automations/service/automation-service.js";
|
|
22
|
-
import { onAutomationProductEvent, publishAutomationProductEvent } from "../automations/product-events.js";
|
|
23
|
-
import "../automations/index.js";
|
|
24
21
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
25
22
|
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
26
23
|
import { disposeAllSessionMcpRuntimes } from "../agent/mcp/bundle-mcp-runtime.js";
|
|
@@ -28,6 +25,9 @@ import { ProjectService } from "../projects/project-service.js";
|
|
|
28
25
|
import { resolveProjectAgentId } from "../projects/project-agent.js";
|
|
29
26
|
import "../projects/index.js";
|
|
30
27
|
import { resolveEffectiveGatewayPort } from "./host.js";
|
|
28
|
+
import { AutomationService } from "../automations/service/automation-service.js";
|
|
29
|
+
import { onAutomationProductEvent, publishAutomationProductEvent } from "../automations/product-events.js";
|
|
30
|
+
import "../automations/index.js";
|
|
31
31
|
import { TaskApplicationService } from "../tasks/task-application-service.js";
|
|
32
32
|
import { ProactiveScenarioService } from "../proactive/scenarios/service.js";
|
|
33
33
|
import { TaskOutboxDispatcher } from "../tasks/task-outbox-dispatcher.js";
|
|
@@ -45,11 +45,11 @@ import { MessageBus, MessageBusShutdownError } from "../infra/bus/queue.js";
|
|
|
45
45
|
import "../infra/bus/index.js";
|
|
46
46
|
import { AgentService } from "../agent/service.js";
|
|
47
47
|
import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
48
|
-
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
49
|
-
import "../config/index.js";
|
|
50
48
|
import { setPairingBroadcastSink } from "../channels/pairing/pairing-events.js";
|
|
51
49
|
import { registerClarifyBridge } from "./clarify-runtime.js";
|
|
52
50
|
import { ChannelManager } from "../channels/manager.js";
|
|
51
|
+
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
52
|
+
import "../config/index.js";
|
|
53
53
|
import { ManagedComposioEventPoller } from "../connectors/composio-managed-events.js";
|
|
54
54
|
import { startConnectedKnowledgeCoordinator } from "../knowledge/coordinator.js";
|
|
55
55
|
import "../knowledge/index.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SessionContextSummary } from '@xopcai/gateway-contract';
|
|
2
|
+
import type { Config } from '../config/schema.js';
|
|
3
|
+
import { type GatewayScope } from './security/gateway-scopes.js';
|
|
4
|
+
/** A bounded metadata-only query. It never prepares Note context or starts an agent. */
|
|
5
|
+
export declare function getSessionContextSummary(config: Config, sessionKey: string, scopes: readonly GatewayScope[]): Promise<SessionContextSummary | null>;
|