@xopcai/xopc 0.0.235 → 0.0.238
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-BCZ6T3y8.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-KPtQudPf.js +1 -0
- package/dist/gateway/static/root/assets/agents-DKQZKGCB.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-B_h6HVgw.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-D07Ew40N.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-_toby2SK.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-C2Ac3q6g.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BGkF6XNH.js → automations-page-Bc4Is3z0.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-DH-QeQ0O.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-B-6Ski7l.js → binary-plugins-yMQJYHIQ.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BgeKQN1F.js → block-editor-DrNzI_0p.js} +56 -56
- package/dist/gateway/static/root/assets/browser-settings-page-Bv8GclZd.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-D_EOs50E.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-gKLN0aaW.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-Bh7BqWsN.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-B7agEwma.js +36 -0
- package/dist/gateway/static/root/assets/connectors-page-DifO0WX4.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-BYmr5ZuN.js → cron-expression-bjxQQFdv.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-FKL_b_S0.js → date-picker-C7ujLHll.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-rl8E7nXp.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-DOXjRTqK.js → desktop-pet-D4GbYBcD.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-Bo34tFlD.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BeJ1-5ID.js → extension-debug-page-DuPa1bVQ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CncDndLS.js → extension-page-CB9xF3qo.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BxxL0HqU.js → extension-settings-page-CovEdmGD.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-Dc6A6HyJ.js → gateway-config-api-CAaoukkR.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-CesXGTe3.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-Bu5cIcNb.js +1 -0
- package/dist/gateway/static/root/assets/home-page-sQfx98tH.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-C73V7tJP.js +70 -0
- package/dist/gateway/static/root/assets/index-C9rUND9-.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Cwinks_5.js → keyboard-shortcuts-settings-CpZxPmd0.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DjvHSI0e.js +2 -0
- package/dist/gateway/static/root/assets/local-apps-page-5KTZwLbX.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-frYgoe2x.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-9iZjSpHe.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-split-B6wQhwLV.js → markdown-split-C4-0M8mu.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-CjMa9GMF.js} +1 -1
- package/dist/gateway/static/root/assets/messages-B1HDp_j8.js +3 -0
- package/dist/gateway/static/root/assets/mobile-pairing-wizard-DikJ7HCm.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-CC45W2KR.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-BFreGbmY.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-53z9nB5L.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DR7OvyAl.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-BkSGDDbn.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-D3TCJGy3.js → runtime-tools-settings-panel-DLv-QsQo.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DUAlwNoO.js → schema-form-DDW7aJWa.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-C-yaSuuQ.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CelrRPXt.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-D7nQ3Lfu.js → settings-form-section-5NTg906_.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-DgTYtrmh.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Dm_gdAfm.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-BX2Ev7-I.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-D2Zd9l04.js +1 -0
- package/dist/gateway/static/root/assets/skeleton-BwbyijEw.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-BvND7xsL.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-DJRr5HFw.js → skills-page-Cmqu9f_n.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-DcrBe39q.js → skills-page.utils-KOxLvm84.js} +1 -1
- package/dist/gateway/static/root/assets/system-settings-panel-CS7cDwv2.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-COpgFG6K.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-D3h311_s.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-DDEypreQ.js → use-autosave-DvATIVb_.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-PKrbPu4w.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BLa_vdXE.js → voice-api-key-field-C3BgRKG2.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-DHcQSZZD.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-jQl_wmYC.js → workflow-run-setup-panel-Nx6xmy_N.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DBkP6B4E.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 +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- 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/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/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/connectors.js +1 -1
- 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 +1 -1
- 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-restart.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
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { ExecutionEnvironmentStore } from "../../../execution-environments/store.js";
|
|
2
|
+
import { LocalWorktreeManager } from "../../../execution-environments/local-worktree-manager.js";
|
|
3
|
+
import { SessionEnvironmentService } from "../../../execution-environments/session-environment-service.js";
|
|
4
|
+
//#region src/gateway/hono/routes/execution-environments.ts
|
|
5
|
+
function executionMode(value) {
|
|
6
|
+
return value === "local_checkout" || value === "managed_worktree" ? value : void 0;
|
|
7
|
+
}
|
|
8
|
+
function errorResponse(error) {
|
|
9
|
+
return {
|
|
10
|
+
ok: false,
|
|
11
|
+
error: error instanceof Error ? error.message : String(error)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function registerExecutionEnvironmentRoutes(authenticated, deps) {
|
|
15
|
+
const store = new ExecutionEnvironmentStore();
|
|
16
|
+
const worktrees = new LocalWorktreeManager({ store });
|
|
17
|
+
const sessions = new SessionEnvironmentService({
|
|
18
|
+
store,
|
|
19
|
+
worktrees
|
|
20
|
+
});
|
|
21
|
+
authenticated.get("/api/projects/:projectId/environments", (c) => {
|
|
22
|
+
const projectId = c.req.param("projectId");
|
|
23
|
+
if (!deps.service.projects.get(projectId)) return c.json({
|
|
24
|
+
ok: false,
|
|
25
|
+
error: "Project not found"
|
|
26
|
+
}, 404);
|
|
27
|
+
return c.json({
|
|
28
|
+
ok: true,
|
|
29
|
+
environments: store.list({
|
|
30
|
+
projectId,
|
|
31
|
+
includeDeleted: c.req.query("includeDeleted") === "true"
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
authenticated.get("/api/sessions/:sessionKey/environment", (c) => {
|
|
36
|
+
const environment = sessions.get(c.req.param("sessionKey"));
|
|
37
|
+
return environment ? c.json({
|
|
38
|
+
ok: true,
|
|
39
|
+
environment
|
|
40
|
+
}) : c.json({
|
|
41
|
+
ok: false,
|
|
42
|
+
error: "Execution environment not found"
|
|
43
|
+
}, 404);
|
|
44
|
+
});
|
|
45
|
+
authenticated.post("/api/sessions/:sessionKey/environment", async (c) => {
|
|
46
|
+
const sessionKey = c.req.param("sessionKey");
|
|
47
|
+
if (deps.service.getActiveWebchatRunId(sessionKey)) return c.json({
|
|
48
|
+
ok: false,
|
|
49
|
+
error: "Stop the active session run before changing its environment"
|
|
50
|
+
}, 409);
|
|
51
|
+
const session = await deps.service.sessions.getSession(sessionKey);
|
|
52
|
+
if (!session) return c.json({
|
|
53
|
+
ok: false,
|
|
54
|
+
error: "Session not found"
|
|
55
|
+
}, 404);
|
|
56
|
+
const projectId = session.projectId?.trim();
|
|
57
|
+
const project = projectId ? deps.service.projects.get(projectId) : null;
|
|
58
|
+
if (!project) return c.json({
|
|
59
|
+
ok: false,
|
|
60
|
+
error: "Session is not attached to a project"
|
|
61
|
+
}, 409);
|
|
62
|
+
const body = await c.req.json().catch(() => ({}));
|
|
63
|
+
const mode = body.mode === void 0 ? void 0 : executionMode(body.mode);
|
|
64
|
+
if (body.mode !== void 0 && !mode) return c.json({
|
|
65
|
+
ok: false,
|
|
66
|
+
error: "Invalid execution mode"
|
|
67
|
+
}, 400);
|
|
68
|
+
try {
|
|
69
|
+
const environment = await sessions.attach({
|
|
70
|
+
sessionKey,
|
|
71
|
+
project,
|
|
72
|
+
mode,
|
|
73
|
+
baseRef: typeof body.baseRef === "string" ? body.baseRef : void 0
|
|
74
|
+
});
|
|
75
|
+
return c.json({
|
|
76
|
+
ok: true,
|
|
77
|
+
environment
|
|
78
|
+
}, 201);
|
|
79
|
+
} catch (error) {
|
|
80
|
+
return c.json(errorResponse(error), 409);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
authenticated.delete("/api/sessions/:sessionKey/environment", async (c) => {
|
|
84
|
+
const sessionKey = c.req.param("sessionKey");
|
|
85
|
+
if (deps.service.getActiveWebchatRunId(sessionKey)) return c.json({
|
|
86
|
+
ok: false,
|
|
87
|
+
error: "Stop the active session run before releasing its environment"
|
|
88
|
+
}, 409);
|
|
89
|
+
try {
|
|
90
|
+
const environment = await sessions.release(sessionKey, c.req.query("keepManaged") !== "true");
|
|
91
|
+
return c.json({
|
|
92
|
+
ok: true,
|
|
93
|
+
environment
|
|
94
|
+
});
|
|
95
|
+
} catch (error) {
|
|
96
|
+
return c.json(errorResponse(error), 409);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
authenticated.get("/api/execution-environments/:environmentId", async (c) => {
|
|
100
|
+
const environment = store.get(c.req.param("environmentId"));
|
|
101
|
+
if (!environment) return c.json({
|
|
102
|
+
ok: false,
|
|
103
|
+
error: "Execution environment not found"
|
|
104
|
+
}, 404);
|
|
105
|
+
const inspection = environment.kind === "managed_worktree" ? await worktrees.inspect(environment.id).catch(() => void 0) : void 0;
|
|
106
|
+
return c.json({
|
|
107
|
+
ok: true,
|
|
108
|
+
environment,
|
|
109
|
+
...inspection ? { inspection } : {}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
authenticated.post("/api/execution-environments/:environmentId/reconcile", async (c) => {
|
|
113
|
+
try {
|
|
114
|
+
const environment = await worktrees.reconcile(c.req.param("environmentId"));
|
|
115
|
+
return c.json({
|
|
116
|
+
ok: true,
|
|
117
|
+
environment
|
|
118
|
+
});
|
|
119
|
+
} catch (error) {
|
|
120
|
+
return c.json(errorResponse(error), 409);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
authenticated.delete("/api/execution-environments/:environmentId", async (c) => {
|
|
124
|
+
try {
|
|
125
|
+
const environment = await worktrees.remove(c.req.param("environmentId"));
|
|
126
|
+
return c.json({
|
|
127
|
+
ok: true,
|
|
128
|
+
environment
|
|
129
|
+
});
|
|
130
|
+
} catch (error) {
|
|
131
|
+
return c.json(errorResponse(error), 409);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
export { registerExecutionEnvironmentRoutes };
|
|
@@ -2,6 +2,7 @@ import { registerActivityRoutes } from "./activity.js";
|
|
|
2
2
|
import { registerAgentStreamRoutes } from "./agent-stream.js";
|
|
3
3
|
import { registerDiscussionRoutes } from "./discussions.js";
|
|
4
4
|
import { registerSessionsRoutes } from "./sessions.js";
|
|
5
|
+
import { registerExecutionEnvironmentRoutes } from "./execution-environments.js";
|
|
5
6
|
import { registerSideChatRoutes } from "./side-chats.js";
|
|
6
7
|
import { registerStatusRoutes } from "./status.js";
|
|
7
8
|
import { registerProjectsRoutes } from "./projects.js";
|
|
@@ -19,12 +20,15 @@ import { registerWorkDiscoveryRoutes } from "./work-discovery.js";
|
|
|
19
20
|
import { registerUnderstandingSourceRoutes } from "./understanding-sources.js";
|
|
20
21
|
import { registerTaskRoutes } from "./tasks.js";
|
|
21
22
|
import { registerProactiveRoutes } from "./proactive.js";
|
|
23
|
+
import { registerMobilePrivacyRoutes } from "./mobile-privacy.js";
|
|
22
24
|
import { mountAppLazyRoutePrefixes, registerAuthenticatedLazyRouteFallback } from "./lazy-fallback.js";
|
|
23
25
|
//#region src/gateway/hono/routes/index.ts
|
|
24
26
|
function registerCoreAuthenticatedRoutes(authenticated, deps) {
|
|
25
27
|
registerStatusRoutes(authenticated, deps);
|
|
28
|
+
registerMobilePrivacyRoutes(authenticated, deps);
|
|
26
29
|
registerAgentStreamRoutes(authenticated, deps);
|
|
27
30
|
registerSessionsRoutes(authenticated, deps);
|
|
31
|
+
registerExecutionEnvironmentRoutes(authenticated, deps);
|
|
28
32
|
registerSideChatRoutes(authenticated, deps);
|
|
29
33
|
registerActivityRoutes(authenticated, deps);
|
|
30
34
|
registerDiscussionRoutes(authenticated, deps);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/gateway/hono/routes/mobile-privacy.ts
|
|
2
|
+
function registerMobilePrivacyRoutes(authenticated, { service }) {
|
|
3
|
+
authenticated.get("/api/mobile/privacy", async (c) => {
|
|
4
|
+
c.header("Cache-Control", "no-store");
|
|
5
|
+
const { getMobilePrivacyDisclosure } = await import("../../mobile-privacy.js");
|
|
6
|
+
return c.json({
|
|
7
|
+
ok: true,
|
|
8
|
+
payload: await getMobilePrivacyDisclosure(service.currentConfig)
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { registerMobilePrivacyRoutes };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
2
1
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
2
|
+
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
3
3
|
import { init_models_json, loadModelsJson, saveModelsJson, validateModelsConfig } from "../../../config/models-json.js";
|
|
4
4
|
import { getModelCatalogStore, init_model_catalog_store } from "../../../providers/model-catalog-store.js";
|
|
5
5
|
import { getModelRegistry } from "../../../providers/model-registry.js";
|
|
@@ -11,6 +11,7 @@ import { buildCapabilityPlansForConfig } from "../../../capabilities/readiness/f
|
|
|
11
11
|
import "../../../capabilities/readiness/index.js";
|
|
12
12
|
import { getImageGenerationProvider, reloadImageGenerationProviders, resolveImageGenerationCredentialMode } from "../../../agent/image/generation/provider-registry.js";
|
|
13
13
|
import { SessionConfigStore } from "../../../session/config-store.js";
|
|
14
|
+
import { getModelThinking } from "../../../providers/model-thinking.js";
|
|
14
15
|
import { deleteCustomImageProvider, listCustomImageProviders, upsertCustomImageProvider } from "../../custom-image-providers.js";
|
|
15
16
|
import { getAgentImageGenerationConfig, getImageGenerationCatalog, prepareImageGenerationSetup, verifyImageGenerationCredential } from "../../image-generation-setup.js";
|
|
16
17
|
import { discoverProviderModels, isProviderApiDiscoverable } from "../../../providers/model-discovery.js";
|
|
@@ -58,6 +59,12 @@ function mapPluginModel(providerId, model, available) {
|
|
|
58
59
|
maxTokens: model.maxOutputTokens ?? 4096,
|
|
59
60
|
reasoning: false,
|
|
60
61
|
vision: model.supportsImages ?? false,
|
|
62
|
+
thinking: {
|
|
63
|
+
mode: "none",
|
|
64
|
+
options: ["off"],
|
|
65
|
+
initialValue: "off",
|
|
66
|
+
supportsAdaptive: false
|
|
67
|
+
},
|
|
61
68
|
cost: {
|
|
62
69
|
input: model.pricing?.input ?? 0,
|
|
63
70
|
output: model.pricing?.output ?? 0
|
|
@@ -289,6 +296,7 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
289
296
|
contextWindow: m.contextWindow ?? 128e3,
|
|
290
297
|
maxTokens: m.maxTokens ?? 4096,
|
|
291
298
|
reasoning: m.reasoning ?? false,
|
|
299
|
+
thinking: getModelThinking(m),
|
|
292
300
|
vision: m.input?.includes("image") ?? false,
|
|
293
301
|
recommended: isRecommendedModel(m.provider, m.id),
|
|
294
302
|
cost: {
|
|
@@ -593,6 +601,7 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
593
601
|
contextWindow: m.contextWindow ?? 128e3,
|
|
594
602
|
maxTokens: m.maxTokens ?? 4096,
|
|
595
603
|
reasoning: m.reasoning ?? false,
|
|
604
|
+
thinking: getModelThinking(m),
|
|
596
605
|
vision: m.input?.includes("image") ?? false,
|
|
597
606
|
recommended: isRecommendedModel(m.provider, m.id),
|
|
598
607
|
cost: {
|
|
@@ -8,9 +8,10 @@ import "../../../activity/index.js";
|
|
|
8
8
|
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
9
9
|
import { TaskRepository } from "../../../tasks/task-repository.js";
|
|
10
10
|
import { TaskReadModelProjector } from "../../../tasks/task-read-model-projector.js";
|
|
11
|
+
import { ExecutionEnvironmentStore } from "../../../execution-environments/store.js";
|
|
11
12
|
import { ProjectWorkspaceConflictError, ProjectWorkspaceMissingError } from "../../../projects/workspace-project.js";
|
|
13
|
+
import { inferProjectExecutionMode, inferProjectKind } from "../../../projects/project-kind.js";
|
|
12
14
|
import { isValidProjectAgentId, normalizeProjectAgentId, resolveProjectAgentId } from "../../../projects/project-agent.js";
|
|
13
|
-
import { inferProjectKind } from "../../../projects/project-kind.js";
|
|
14
15
|
import { inferSuggestedProjectDefaultAgentId } from "../../../projects/project-agent-suggestion.js";
|
|
15
16
|
import { buildProjectLoopOverview } from "../../../projects/project-loop.js";
|
|
16
17
|
import "../../../projects/index.js";
|
|
@@ -24,6 +25,9 @@ import { randomUUID } from "node:crypto";
|
|
|
24
25
|
function parseProjectStatus(raw) {
|
|
25
26
|
return raw === "planned" || raw === "active" || raw === "paused" || raw === "completed" || raw === "cancelled" || raw === "archived" ? raw : void 0;
|
|
26
27
|
}
|
|
28
|
+
function parseProjectExecutionMode(raw) {
|
|
29
|
+
return raw === "local_checkout" || raw === "managed_worktree" ? raw : void 0;
|
|
30
|
+
}
|
|
27
31
|
function parseLimit(raw, fallback = 50) {
|
|
28
32
|
if (!raw) return void 0;
|
|
29
33
|
const n = Number.parseInt(raw, 10);
|
|
@@ -144,6 +148,7 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
144
148
|
const { service } = deps;
|
|
145
149
|
const activity = new ActivityService();
|
|
146
150
|
const operatingViews = new ProjectOperatingViewService(service.projects);
|
|
151
|
+
const environments = new ExecutionEnvironmentStore();
|
|
147
152
|
authenticated.post("/api/projects", async (c) => {
|
|
148
153
|
const body = await c.req.json().catch(() => ({}));
|
|
149
154
|
const name = textField(body, "name")?.trim();
|
|
@@ -152,6 +157,11 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
152
157
|
ok: false,
|
|
153
158
|
error: "Missing name"
|
|
154
159
|
}, 400);
|
|
160
|
+
const executionMode = parseProjectExecutionMode(body.executionMode);
|
|
161
|
+
if (body.executionMode !== void 0 && !executionMode) return c.json({
|
|
162
|
+
ok: false,
|
|
163
|
+
error: "Invalid project execution mode"
|
|
164
|
+
}, 400);
|
|
155
165
|
const hasDefaultAgentPatch = Object.hasOwn(body, "defaultAgentId");
|
|
156
166
|
const explicitDefaultAgentId = normalizeProjectAgentId(textField(body, "defaultAgentId"));
|
|
157
167
|
const defaultAgentId = hasDefaultAgentPatch ? explicitDefaultAgentId : inferSuggestedProjectDefaultAgentId({
|
|
@@ -173,6 +183,7 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
173
183
|
workspaceRoot,
|
|
174
184
|
createWorkspaceRoot: body.createWorkspaceRoot === true,
|
|
175
185
|
projectKind: textField(body, "projectKind"),
|
|
186
|
+
executionMode,
|
|
176
187
|
brief: textField(body, "brief"),
|
|
177
188
|
instructions: textField(body, "instructions"),
|
|
178
189
|
outcome: textField(body, "outcome"),
|
|
@@ -251,10 +262,12 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
251
262
|
config: service.currentConfig,
|
|
252
263
|
...input
|
|
253
264
|
});
|
|
265
|
+
const executionMode = inferProjectExecutionMode(input);
|
|
254
266
|
return c.json({
|
|
255
267
|
ok: true,
|
|
256
268
|
inference,
|
|
257
|
-
defaultAgentId
|
|
269
|
+
defaultAgentId,
|
|
270
|
+
executionMode
|
|
258
271
|
});
|
|
259
272
|
});
|
|
260
273
|
authenticated.post("/api/projects/resolve-workspace", async (c) => {
|
|
@@ -600,6 +613,7 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
600
613
|
});
|
|
601
614
|
authenticated.patch("/api/projects/:id", async (c) => {
|
|
602
615
|
const body = await c.req.json().catch(() => ({}));
|
|
616
|
+
const projectId = c.req.param("id");
|
|
603
617
|
const status = parseProjectStatus(body.status);
|
|
604
618
|
const defaultAgentPatch = optionalTextField(body, "defaultAgentId");
|
|
605
619
|
const defaultAgentId = defaultAgentPatch === void 0 ? void 0 : normalizeProjectAgentId(defaultAgentPatch);
|
|
@@ -611,18 +625,34 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
611
625
|
ok: false,
|
|
612
626
|
error: "Invalid project health"
|
|
613
627
|
}, 400);
|
|
628
|
+
const executionMode = parseProjectExecutionMode(body.executionMode);
|
|
629
|
+
if (body.executionMode !== void 0 && !executionMode) return c.json({
|
|
630
|
+
ok: false,
|
|
631
|
+
error: "Invalid project execution mode"
|
|
632
|
+
}, 400);
|
|
614
633
|
if (defaultAgentId && !isValidProjectAgentId(service.currentConfig, defaultAgentId)) return c.json({
|
|
615
634
|
ok: false,
|
|
616
635
|
error: "Default agent not found"
|
|
617
636
|
}, 400);
|
|
637
|
+
const currentProject = service.projects.get(projectId);
|
|
638
|
+
const requestedWorkspaceRoot = optionalTextField(body, "workspaceRoot");
|
|
639
|
+
if (currentProject && requestedWorkspaceRoot !== void 0 && requestedWorkspaceRoot !== (currentProject.workspaceRoot ?? null) && environments.list({
|
|
640
|
+
projectId,
|
|
641
|
+
limit: 1
|
|
642
|
+
}).length > 0) return c.json({
|
|
643
|
+
ok: false,
|
|
644
|
+
code: "execution_environments_exist",
|
|
645
|
+
error: "Delete the project execution environments before changing its workspace"
|
|
646
|
+
}, 409);
|
|
618
647
|
try {
|
|
619
|
-
const project = service.projects.update(
|
|
648
|
+
const project = service.projects.update(projectId, {
|
|
620
649
|
...textField(body, "name") !== void 0 ? { name: textField(body, "name") } : {},
|
|
621
650
|
...optionalTextField(body, "description") !== void 0 ? { description: optionalTextField(body, "description") } : {},
|
|
622
651
|
...status ? { status } : {},
|
|
623
652
|
...defaultAgentPatch !== void 0 ? { defaultAgentId: defaultAgentId ?? null } : {},
|
|
624
653
|
...optionalTextField(body, "workspaceRoot") !== void 0 ? { workspaceRoot: optionalTextField(body, "workspaceRoot") } : {},
|
|
625
654
|
createWorkspaceRoot: body.createWorkspaceRoot === true,
|
|
655
|
+
...executionMode ? { executionMode } : {},
|
|
626
656
|
...optionalTextField(body, "brief") !== void 0 ? { brief: optionalTextField(body, "brief") } : {},
|
|
627
657
|
...optionalTextField(body, "instructions") !== void 0 ? { instructions: optionalTextField(body, "instructions") } : {},
|
|
628
658
|
...optionalTextField(body, "outcome") !== void 0 ? { outcome: optionalTextField(body, "outcome") } : {},
|
|
@@ -657,7 +687,16 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
657
687
|
}
|
|
658
688
|
});
|
|
659
689
|
authenticated.delete("/api/projects/:id", async (c) => {
|
|
660
|
-
|
|
690
|
+
const projectId = c.req.param("id");
|
|
691
|
+
if (environments.list({
|
|
692
|
+
projectId,
|
|
693
|
+
limit: 1
|
|
694
|
+
}).length > 0) return c.json({
|
|
695
|
+
ok: false,
|
|
696
|
+
code: "execution_environments_exist",
|
|
697
|
+
error: "Delete the project execution environments before deleting the project"
|
|
698
|
+
}, 409);
|
|
699
|
+
service.projects.delete(projectId);
|
|
661
700
|
return c.json({ ok: true });
|
|
662
701
|
});
|
|
663
702
|
authenticated.get("/api/projects/:id/sessions", async (c) => {
|
|
@@ -15,7 +15,13 @@ export declare function submitSessionInput(c: Context, deps: AuthenticatedRouteD
|
|
|
15
15
|
}, 401, "json">) | (Response & import("hono").TypedResponse<{
|
|
16
16
|
ok: false;
|
|
17
17
|
error: {
|
|
18
|
-
code:
|
|
18
|
+
code: string;
|
|
19
|
+
message: string;
|
|
20
|
+
};
|
|
21
|
+
}, 409, "json">) | (Response & import("hono").TypedResponse<{
|
|
22
|
+
ok: false;
|
|
23
|
+
error: {
|
|
24
|
+
code: "BAD_REQUEST" | "QUEUE_FULL" | "CONTEXT_UNAVAILABLE" | "SESSION_CHANGED";
|
|
19
25
|
message: string;
|
|
20
26
|
};
|
|
21
27
|
}, 400 | 409, "json">) | (Response & import("hono").TypedResponse<{
|
|
@@ -33,6 +39,7 @@ export declare function submitSessionInput(c: Context, deps: AuthenticatedRouteD
|
|
|
33
39
|
id: string;
|
|
34
40
|
sessionKey: string;
|
|
35
41
|
clientMessageId: string;
|
|
42
|
+
expectedSessionId?: string;
|
|
36
43
|
requestedDelivery: import("../../../storage/sqlite/session-input-repository.js").SessionInputDelivery;
|
|
37
44
|
effectiveDelivery: import("../../../storage/sqlite/session-input-repository.js").SessionInputDelivery;
|
|
38
45
|
status: import("../../../storage/sqlite/session-input-repository.js").SessionInputStatus;
|
|
@@ -95,6 +102,12 @@ export declare function replaceLatestSessionTurn(c: Context, deps: Authenticated
|
|
|
95
102
|
message: string;
|
|
96
103
|
};
|
|
97
104
|
}, 401, "json">) | (Response & import("hono").TypedResponse<{
|
|
105
|
+
ok: false;
|
|
106
|
+
error: {
|
|
107
|
+
code: string;
|
|
108
|
+
message: string;
|
|
109
|
+
};
|
|
110
|
+
}, 409, "json">) | (Response & import("hono").TypedResponse<{
|
|
98
111
|
ok: false;
|
|
99
112
|
error: {
|
|
100
113
|
code: "TARGET_NOT_FOUND" | "NOT_LATEST" | "SESSION_BUSY" | "BAD_REQUEST" | "CONTEXT_UNAVAILABLE";
|
|
@@ -115,6 +128,7 @@ export declare function replaceLatestSessionTurn(c: Context, deps: Authenticated
|
|
|
115
128
|
id: string;
|
|
116
129
|
sessionKey: string;
|
|
117
130
|
clientMessageId: string;
|
|
131
|
+
expectedSessionId?: string;
|
|
118
132
|
requestedDelivery: import("../../../storage/sqlite/session-input-repository.js").SessionInputDelivery;
|
|
119
133
|
effectiveDelivery: import("../../../storage/sqlite/session-input-repository.js").SessionInputDelivery;
|
|
120
134
|
status: import("../../../storage/sqlite/session-input-repository.js").SessionInputStatus;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { endpointTurnClaimSchema } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
2
|
+
import { init_providers, resolveModel } from "../../../providers/index.js";
|
|
2
3
|
import { parseTurnContextRefs } from "../../../agent/source-context/types.js";
|
|
4
|
+
import { getModelThinking } from "../../../providers/model-thinking.js";
|
|
3
5
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
6
|
+
import { withModelConfigLock } from "../../../session/model-config-lock.js";
|
|
4
7
|
//#region src/gateway/hono/routes/session-input-handler.ts
|
|
8
|
+
init_providers();
|
|
5
9
|
const MAX_TURN_CONTEXTS = 5;
|
|
6
10
|
async function submitSessionInput(c, deps, sessionKey) {
|
|
7
11
|
const body = await c.req.json().catch(() => null);
|
|
@@ -61,33 +65,70 @@ async function submitSessionInput(c, deps, sessionKey) {
|
|
|
61
65
|
message: "Endpoint connection is not active"
|
|
62
66
|
}
|
|
63
67
|
}, 401);
|
|
64
|
-
|
|
65
|
-
sessionKey,
|
|
66
|
-
clientMessageId: typeof body.clientMessageId === "string" ? body.clientMessageId : "",
|
|
67
|
-
delivery,
|
|
68
|
-
content,
|
|
69
|
-
attachments,
|
|
70
|
-
contextRefs,
|
|
71
|
-
thinking: typeof body.thinking === "string" ? body.thinking : void 0,
|
|
72
|
-
origin: {
|
|
73
|
-
type: "endpoint",
|
|
74
|
-
endpointId: origin.data.endpointId
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
if (result.ok === false) return c.json({
|
|
68
|
+
if (body.expectedSessionId !== void 0 && (typeof body.expectedSessionId !== "string" || !body.expectedSessionId || body.expectedSessionId.length > 128)) return c.json({
|
|
78
69
|
ok: false,
|
|
79
70
|
error: {
|
|
80
|
-
code:
|
|
81
|
-
message:
|
|
71
|
+
code: "BAD_REQUEST",
|
|
72
|
+
message: "Invalid session identity"
|
|
82
73
|
}
|
|
83
|
-
},
|
|
84
|
-
return
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
74
|
+
}, 400);
|
|
75
|
+
return withModelConfigLock(sessionKey, async () => {
|
|
76
|
+
const selection = body.configVersion !== void 0 ? await deps.service.sessions.getAgentConfig(sessionKey) : void 0;
|
|
77
|
+
if (selection) {
|
|
78
|
+
if (!Number.isSafeInteger(body.configVersion) || selection.configVersion !== body.configVersion || !selection.fixedModel) return c.json({
|
|
79
|
+
ok: false,
|
|
80
|
+
error: {
|
|
81
|
+
code: "CONFIG_CHANGED",
|
|
82
|
+
message: "Model configuration changed. Refresh before sending."
|
|
83
|
+
}
|
|
84
|
+
}, 409);
|
|
85
|
+
try {
|
|
86
|
+
if (!getModelThinking(resolveModel(selection.model)).options.includes(selection.thinkingLevel)) return c.json({
|
|
87
|
+
ok: false,
|
|
88
|
+
error: {
|
|
89
|
+
code: "INVALID_THINKING",
|
|
90
|
+
message: "Select a supported thinking level before sending."
|
|
91
|
+
}
|
|
92
|
+
}, 409);
|
|
93
|
+
} catch {
|
|
94
|
+
return c.json({
|
|
95
|
+
ok: false,
|
|
96
|
+
error: {
|
|
97
|
+
code: "MODEL_UNAVAILABLE",
|
|
98
|
+
message: `Model unavailable: ${selection.model}`
|
|
99
|
+
}
|
|
100
|
+
}, 409);
|
|
101
|
+
}
|
|
89
102
|
}
|
|
90
|
-
|
|
103
|
+
const result = await deps.service.submitSessionInput({
|
|
104
|
+
expectedSessionId: body.expectedSessionId,
|
|
105
|
+
sessionKey,
|
|
106
|
+
clientMessageId: typeof body.clientMessageId === "string" ? body.clientMessageId : "",
|
|
107
|
+
delivery,
|
|
108
|
+
content,
|
|
109
|
+
attachments,
|
|
110
|
+
contextRefs,
|
|
111
|
+
thinking: selection?.thinkingLevel ?? (typeof body.thinking === "string" ? body.thinking : void 0),
|
|
112
|
+
origin: {
|
|
113
|
+
type: "endpoint",
|
|
114
|
+
endpointId: origin.data.endpointId
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
if (result.ok === false) return c.json({
|
|
118
|
+
ok: false,
|
|
119
|
+
error: {
|
|
120
|
+
code: result.code,
|
|
121
|
+
message: result.code === "CONTEXT_UNAVAILABLE" ? "A referenced Note changed or is no longer available. Select it again." : "Input was not accepted"
|
|
122
|
+
}
|
|
123
|
+
}, result.code === "SESSION_CHANGED" || result.code === "QUEUE_FULL" || result.code === "CONTEXT_UNAVAILABLE" ? 409 : 400);
|
|
124
|
+
return c.json({
|
|
125
|
+
ok: true,
|
|
126
|
+
payload: {
|
|
127
|
+
...result,
|
|
128
|
+
sessionKey
|
|
129
|
+
}
|
|
130
|
+
}, 202);
|
|
131
|
+
});
|
|
91
132
|
}
|
|
92
133
|
async function replaceLatestSessionTurn(c, deps, sessionKey, targetTurnId) {
|
|
93
134
|
const body = await c.req.json().catch(() => null);
|
|
@@ -139,38 +180,67 @@ async function replaceLatestSessionTurn(c, deps, sessionKey, targetTurnId) {
|
|
|
139
180
|
message: "Endpoint connection is not active"
|
|
140
181
|
}
|
|
141
182
|
}, 401);
|
|
142
|
-
|
|
143
|
-
sessionKey
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
183
|
+
return withModelConfigLock(sessionKey, async () => {
|
|
184
|
+
const selection = body.configVersion !== void 0 ? await deps.service.sessions.getAgentConfig(sessionKey) : void 0;
|
|
185
|
+
if (selection) {
|
|
186
|
+
if (!Number.isSafeInteger(body.configVersion) || selection.configVersion !== body.configVersion || !selection.fixedModel) return c.json({
|
|
187
|
+
ok: false,
|
|
188
|
+
error: {
|
|
189
|
+
code: "CONFIG_CHANGED",
|
|
190
|
+
message: "Model configuration changed. Refresh before sending."
|
|
191
|
+
}
|
|
192
|
+
}, 409);
|
|
193
|
+
try {
|
|
194
|
+
if (!getModelThinking(resolveModel(selection.model)).options.includes(selection.thinkingLevel)) return c.json({
|
|
195
|
+
ok: false,
|
|
196
|
+
error: {
|
|
197
|
+
code: "INVALID_THINKING",
|
|
198
|
+
message: "Select a supported thinking level before sending."
|
|
199
|
+
}
|
|
200
|
+
}, 409);
|
|
201
|
+
} catch {
|
|
202
|
+
return c.json({
|
|
203
|
+
ok: false,
|
|
204
|
+
error: {
|
|
205
|
+
code: "MODEL_UNAVAILABLE",
|
|
206
|
+
message: `Model unavailable: ${selection.model}`
|
|
207
|
+
}
|
|
208
|
+
}, 409);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
const result = await deps.service.replaceLatestSessionTurn({
|
|
212
|
+
sessionKey,
|
|
213
|
+
targetTurnId,
|
|
214
|
+
clientMessageId: typeof body.clientMessageId === "string" ? body.clientMessageId : "",
|
|
215
|
+
delivery: "next",
|
|
216
|
+
content,
|
|
217
|
+
attachments,
|
|
218
|
+
contextRefs,
|
|
219
|
+
thinking: selection?.thinkingLevel ?? (typeof body.thinking === "string" ? body.thinking : void 0),
|
|
220
|
+
origin: {
|
|
221
|
+
type: "endpoint",
|
|
222
|
+
endpointId: origin.data.endpointId
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
if (result.ok === false) {
|
|
226
|
+
const status = result.code === "TARGET_NOT_FOUND" ? 404 : result.code === "BAD_REQUEST" ? 400 : 409;
|
|
227
|
+
const message = result.code === "NOT_LATEST" ? "Only the latest user turn can be replaced" : result.code === "SESSION_BUSY" ? "Session has pending input" : result.code === "TARGET_NOT_FOUND" ? "User turn was not found" : result.code === "CONTEXT_UNAVAILABLE" ? "A referenced Note changed or is no longer available. Select it again." : "Replacement input was not accepted";
|
|
228
|
+
return c.json({
|
|
229
|
+
ok: false,
|
|
230
|
+
error: {
|
|
231
|
+
code: result.code,
|
|
232
|
+
message
|
|
233
|
+
}
|
|
234
|
+
}, status);
|
|
154
235
|
}
|
|
155
|
-
});
|
|
156
|
-
if (result.ok === false) {
|
|
157
|
-
const status = result.code === "TARGET_NOT_FOUND" ? 404 : result.code === "BAD_REQUEST" ? 400 : 409;
|
|
158
|
-
const message = result.code === "NOT_LATEST" ? "Only the latest user turn can be replaced" : result.code === "SESSION_BUSY" ? "Session has pending input" : result.code === "TARGET_NOT_FOUND" ? "User turn was not found" : result.code === "CONTEXT_UNAVAILABLE" ? "A referenced Note changed or is no longer available. Select it again." : "Replacement input was not accepted";
|
|
159
236
|
return c.json({
|
|
160
|
-
ok:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
237
|
+
ok: true,
|
|
238
|
+
payload: {
|
|
239
|
+
...result,
|
|
240
|
+
sessionKey
|
|
164
241
|
}
|
|
165
|
-
},
|
|
166
|
-
}
|
|
167
|
-
return c.json({
|
|
168
|
-
ok: true,
|
|
169
|
-
payload: {
|
|
170
|
-
...result,
|
|
171
|
-
sessionKey
|
|
172
|
-
}
|
|
173
|
-
}, 202);
|
|
242
|
+
}, 202);
|
|
243
|
+
});
|
|
174
244
|
}
|
|
175
245
|
//#endregion
|
|
176
246
|
export { replaceLatestSessionTurn, submitSessionInput };
|