@xopcai/xopc 0.0.333 → 0.0.335
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/dist/assets/{auth-DocRzRlS.js → auth-Cjj5SuoT.js} +49 -39
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +240 -36
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DiI2O7lC.js → agent-avatar-dicebear-DtmNsTNI.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-CVp3J969.js → agent-defaults-settings-panel-AvGo9fao.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-CacyndrS.js → agent-plugin-dialog-DZCh4_E1.js} +1 -1
- package/dist/gateway/static/root/assets/agents-Drt1vHf6.js +70 -0
- package/dist/gateway/static/root/assets/agents-admin-api-C82B1W9Z.js +2 -0
- package/dist/gateway/static/root/assets/{app-link-C6gA5Nck.js → app-link-DRL0YnPs.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BcszTlqr.js → app-management-settings-panel-IKZm5_s2.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-B1XPe8qz.js → appearance-settings-DKWGkrVW.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DY6Q7TMZ.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-MjUsJcNb.js → archive-plugin-DXGAt0G7.js} +1 -1
- package/dist/gateway/static/root/assets/attachment-load-qjPpQzYY.js +1 -0
- package/dist/gateway/static/root/assets/attachment-utils-core-BIOUBrpT.js +1 -0
- package/dist/gateway/static/root/assets/{automations-page-Dsjivdxs.js → automations-page-DzqfYcqe.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-qMpqvBz1.js +7 -0
- package/dist/gateway/static/root/assets/binary-plugins-Cy2FLsPv.js +2 -0
- package/dist/gateway/static/root/assets/{block-editor-Bx0uXbJP.js → block-editor-BqSpSNnv.js} +29 -29
- package/dist/gateway/static/root/assets/{browser-automation-inputs-1ZIPGDeq.js → browser-automation-inputs-CLOq1KtH.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CCjYipHc.js → browser-automations-page-BEeyiVEw.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-D6SygxnY.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-BfHgt4uk.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-C9Od0WN-.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-6HAVkNE4.js +8 -0
- package/dist/gateway/static/root/assets/capability-header-actions-CwcT7mjE.js +1 -0
- package/dist/gateway/static/root/assets/channels-D5HNBMLS.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Fnum_IEm.js → chat-terminal-dock-BsxTfU1T.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-DI1zfCTA.js → computer-settings-page-CH01h8yI.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-CiGDAubm.js → connector-service-page-CTi8iaOn.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-C3GhbPPg.js +2 -0
- package/dist/gateway/static/root/assets/{turn-outcome-D0SnyZ3Z.js → constants-Co2_smKQ.js} +1 -1
- package/dist/gateway/static/root/assets/date-picker-DTEOeiC4.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-DpD3xaEB.js → dependency-picker-DFA0RZ02.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CCoDxKqh.js → desktop-pet-Txr49_Zi.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-GxndKfCx.js → desktop-pet-settings-Coi0DUai.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-B71w3ptm.js → device-pairing-wizard-OPY8ujCN.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-CUzjJvjs.js → directory-picker-path-field-B1ckH4hn.js} +1 -1
- package/dist/gateway/static/root/assets/dist-CKkafhaS.js +1 -0
- package/dist/gateway/static/root/assets/dist-io9jFpN72.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BtDY8ntX.js → extension-debug-page-6e8BCEb6.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-D9_XF-XC.js → extension-page-DgaFykYf.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CjhUFAaC.js → extension-settings-page-B-TyR9GM.js} +1 -1
- package/dist/gateway/static/root/assets/{files-BK6enEvD.js → files-Bw4SBGdM.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-CgIjCxM8.js → gateway-config-swr-Hn1vj6uI.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-CGjSxzj6.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-DytaaEu8.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-CtjGyqB2.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-i-1lTrwY.js → gateway-startup-retry-CtTVgB7_.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Cs5fPXcJ.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-gilc-u7M.js → image-generation-api-DBA-bdEM.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BEtq5BRU.js → imports-page-C72wCY44.js} +1 -1
- package/dist/gateway/static/root/assets/index-BkSp_1Il.js +106 -0
- package/dist/gateway/static/root/assets/index-DbLEkdNg.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-JUYY_18v.js → keyboard-shortcuts-settings-D1nzw6zI.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DqB0hGrZ.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BlYESNqz.js → local-apps-page-D4FX0Ptx.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-Bpja8nC6.js → local-apps-yys1VChX.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-Byxxogdc.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-BY30D6tg.js → locale-store-7F4l6DRV.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-CcWD_-zy.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-c4krhYU7.js → management-settings-L9YGzLaz.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BEeXMfDw.js → markdown-view-bxpOryax.js} +1 -1
- package/dist/gateway/static/root/assets/media-plugins-DqsiYyAz.js +1 -0
- package/dist/gateway/static/root/assets/{messages-_6IXbP2u.js → messages-DsUnS7rn.js} +2 -2
- package/dist/gateway/static/root/assets/note-detail-panel-DwK9Ndw1.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-D2FvAV9x.js +8 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-CeWnFomm.js +1 -0
- package/dist/gateway/static/root/assets/{page-tabs-BhYBCqls.js → page-tabs-B90ywILw.js} +1 -1
- package/dist/gateway/static/root/assets/popover-select-0p9PIHRy.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-CP8agNlc.js → preview-open-alternatives-CwuY-FIE.js} +1 -1
- package/dist/gateway/static/root/assets/{product-delivery-bv3z8Xkh.js → product-delivery-BAks11S4.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CU7fRhfT.js → product-open-page-CUcJOCAz.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-Blo9-zcq.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-C9rh1U9Z.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BvVx0G1o.js → registry-api-DU915Prn.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Cw2Beq7s.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Czvzsuj_.js → runtime-tools-settings-panel-Cj8LnZRV.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-BZd4VZBP.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-B9Ni5O93.js → schema-form-CNbrdYAu.js} +1 -1
- package/dist/gateway/static/root/assets/{schemas-88fK3zzl.js → schemas-CObaziC7.js} +3 -3
- package/dist/gateway/static/root/assets/session-api-C7i3UFhq.js +1 -0
- package/dist/gateway/static/root/assets/session-manager-DAck_U0C.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-BKt3Cd0a.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BToasX5M.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-jquf1P7n.js → settings-form-section-u6ZXo3oJ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DPomsvba.js → settings-page-gXacaOIv.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-qKaz5drv.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-DdkQ-B5M.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-BwFn5CYE.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-Bu7-3w-L.js → skill-api-Cf3_ZQOb.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CdNp1N-Y.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-fKPvwSpa.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-BwFR0Uci.js → system-settings-panel-CO3l1jdd.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-zClWGuT5.js +1 -0
- package/dist/gateway/static/root/assets/{tasks-CDR_RVbQ.js → tasks-QQJXsiER.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-PfucxMP3.js → tunnel-api-Dw6DW1j5.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-t_zdQHcy.js → usage-page-QP_8nuHU.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DLyy2wHz.js → use-autosave-ZwnXUpG4.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-B72PRFAI.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CQDY5EBK.js → voice-api-key-field-CbIxN5SC.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-Bwy3Al3J.js → voice-config-api-LKFent6f.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CJzqJ47I.js → work-discovery-overlay-WIGHfEL3.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-sCOk-esV.js → workflow-run-setup-panel-Bk0Jhdeq.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BC385JPr.js +6 -0
- package/dist/gateway/static/root/index.html +27 -21
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/capabilities.js +14 -2
- package/dist/packages/gateway-contract/src/index.js +6 -2
- package/dist/packages/gateway-contract/src/session-command-rejection.js +19 -0
- package/dist/packages/gateway-contract/src/session-input-command.js +109 -0
- package/dist/packages/gateway-contract/src/sessions.js +11 -6
- package/dist/src/agent/agent-instance-gateway.d.ts +0 -2
- package/dist/src/agent/agent-manager.d.ts +0 -2
- package/dist/src/agent/agent-manager.js +5 -36
- package/dist/src/agent/background-review/run-background-review.d.ts +0 -7
- package/dist/src/agent/background-review/run-background-review.js +3 -23
- package/dist/src/agent/bootstrap/filter-bootstrap-files.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/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/external-tools/gateway-tools.js +2 -1
- package/dist/src/agent/image/tool-model-config.js +2 -2
- package/dist/src/agent/orchestration/agent-orchestrator.js +0 -3
- package/dist/src/agent/service/direct-turn-helpers.js +0 -3
- package/dist/src/agent/service/process-direct-streaming.js +4 -2
- package/dist/src/agent/service.js +4 -4
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tools/xopc-use-tool.js +1 -1
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/write.d.ts +11 -11
- package/dist/src/automations/domain/validation.d.ts +11 -11
- package/dist/src/automations/draft/automation-draft-validator.d.ts +1 -1
- package/dist/src/automations/events/event-dispatcher.d.ts +10 -3
- package/dist/src/automations/service/automation-service.js +0 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +2 -2
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/computer/runtime.js +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.js +1 -1
- package/dist/src/connectors/cli/authorization.d.ts +1 -1
- package/dist/src/connectors/cli/store.d.ts +1 -1
- package/dist/src/connectors/connection-candidates.js +53 -15
- package/dist/src/connectors/connection-capabilities.js +5 -1
- package/dist/src/execution-environments/local-worktree-manager.js +10 -1
- package/dist/src/execution-environments/session-environment-service.d.ts +3 -0
- package/dist/src/execution-environments/session-environment-service.js +28 -4
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/agent-stream.js +6 -2
- package/dist/src/gateway/hono/routes/browser-session.js +4 -2
- package/dist/src/gateway/hono/routes/commands-skills.js +9 -2
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/files.js +3 -0
- package/dist/src/gateway/hono/routes/models.js +17 -1
- package/dist/src/gateway/hono/routes/notes.js +2 -4
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-command-handler.d.ts +5 -0
- package/dist/src/gateway/hono/routes/session-command-handler.js +189 -0
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +14 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +2 -2
- package/dist/src/gateway/hono/routes/sessions.js +15 -169
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/tui.js +2 -1
- package/dist/src/gateway/hono/routes/voice.js +9 -0
- package/dist/src/gateway/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/resolve-webchat-session-key.d.ts +1 -1
- package/dist/src/gateway/resolve-webchat-session-key.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +1 -1
- package/dist/src/gateway/service/session-command-service.d.ts +34 -0
- package/dist/src/gateway/service/session-command-service.js +81 -0
- package/dist/src/gateway/service/session-input-coordinator.d.ts +21 -0
- package/dist/src/gateway/service/session-input-coordinator.js +41 -0
- package/dist/src/gateway/service/session-preparation-worker.d.ts +22 -0
- package/dist/src/gateway/service/session-preparation-worker.js +125 -0
- package/dist/src/gateway/service.d.ts +24 -0
- package/dist/src/gateway/service.js +29 -16
- package/dist/src/gateway/side-chat/promotion-service.js +0 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/generator.d.ts +8 -1
- package/dist/src/home-intelligence/generator.js +26 -15
- package/dist/src/home-intelligence/host.d.ts +8 -1
- package/dist/src/home-intelligence/host.js +82 -8
- package/dist/src/home-intelligence/repository.d.ts +5 -1
- package/dist/src/home-intelligence/repository.js +16 -9
- package/dist/src/home-intelligence/snapshot.js +4 -4
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/mcp/channel-bridge.js +12 -2
- package/dist/src/notes/capabilities/read.js +2 -2
- package/dist/src/notes/service.d.ts +4 -1
- package/dist/src/notes/service.js +11 -8
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/session/store.js +0 -1
- package/dist/src/storage/sqlite/ai-usage-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/ai-usage-repository.js +25 -1
- package/dist/src/storage/sqlite/migrations/223_session_creation_receipts.sql +59 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-creation-repository.d.ts +50 -0
- package/dist/src/storage/sqlite/session-creation-repository.js +166 -0
- package/dist/src/storage/sqlite/session-input-repository.d.ts +4 -2
- package/dist/src/storage/sqlite/session-input-repository.js +7 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tui/backends/embedded-backend.d.ts +5 -0
- package/dist/src/tui/backends/embedded-backend.js +266 -20
- package/dist/src/tui/backends/embedded-drafts.d.ts +22 -0
- package/dist/src/tui/backends/embedded-drafts.js +53 -0
- package/dist/src/tui/backends/gateway-realtime-backend.d.ts +10 -0
- package/dist/src/tui/backends/gateway-realtime-backend.js +214 -33
- package/dist/src/tui/tui-backend.d.ts +1 -1
- package/dist/src/tui/tui-chat-input-state.d.ts +1 -0
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-session-format.js +0 -1
- package/dist/src/tui/tui-startup-resources.d.ts +1 -0
- package/dist/src/tui/tui-startup-resources.js +2 -2
- package/dist/src/tui/tui-types.d.ts +0 -1
- package/dist/src/tui/tui.js +69 -29
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/work-discovery/service.js +3 -6
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +5 -5
- package/dist/gateway/static/root/assets/agents-DXYZSuUV.js +0 -70
- package/dist/gateway/static/root/assets/apps-page-ZqANbUZv.js +0 -1
- package/dist/gateway/static/root/assets/attachment-load-DHa-BI9a.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-B37vs5tk.js +0 -7
- package/dist/gateway/static/root/assets/binary-plugins-DQYcuBHP.js +0 -2
- package/dist/gateway/static/root/assets/browser-settings-page-CSv4rvmx.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-BnO9LV7U.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-BfvDvIY1.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CoW7-ESq.js +0 -8
- package/dist/gateway/static/root/assets/capability-header-actions-D_hbWRRF.js +0 -1
- package/dist/gateway/static/root/assets/channels-BhMaRh1x.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Ono0Pha1.js +0 -2
- package/dist/gateway/static/root/assets/conversation-identity-Cw0n9uzK.js +0 -1
- package/dist/gateway/static/root/assets/date-picker-D-JhzZyW.js +0 -1
- package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +0 -1
- package/dist/gateway/static/root/assets/dist-Che_jiQF.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-BWaCnwT1.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BTjGLngn.js +0 -1
- package/dist/gateway/static/root/assets/index-DHL16aYZ.js +0 -121
- package/dist/gateway/static/root/assets/index-N1e6PDwx.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-uI7mtoVz.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-BbLQreeN.js +0 -2
- package/dist/gateway/static/root/assets/media-plugins-DEFN1I73.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel--09xGxyE.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-DsxcVBXF.js +0 -8
- package/dist/gateway/static/root/assets/page-context-capture-button-D43aVpCj.js +0 -1
- package/dist/gateway/static/root/assets/popover-select-DcsFzD_i.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-U-EdDfAW.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DUOKZLt7.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-fVPQe5YS.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-C0-WHOY3.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-DdXvW09N.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BtF83fBY.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BvVlqpHf.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-b9DI0N1J.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-R_qwc4DN.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CNJAQ_e-.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-D7XPEQu_.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-PFjGW2g1.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-OyfPVfB9.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-DYBGjN7C.js +0 -6
- package/dist/src/tui/tui-empty-session-cleanup.d.ts +0 -9
- package/dist/src/tui/tui-empty-session-cleanup.js +0 -19
- /package/dist/gateway/static/root/assets/{dist-CI_fqRk-.js → dist-CI_fqRk-2.js} +0 -0
|
@@ -1,15 +1,23 @@
|
|
|
1
|
+
import { resolveStateDir } from "../../config/paths-state.js";
|
|
1
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
|
+
import { sessionInputCommandSchema } from "../../../packages/gateway-contract/src/session-input-command.js";
|
|
5
|
+
import { isSessionCommandRejected } from "../../../packages/gateway-contract/src/session-command-rejection.js";
|
|
6
|
+
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
7
|
+
import { init_paths } from "../../config/paths.js";
|
|
3
8
|
import { transcriptRowsToClientHistory } from "../../session/client-history.js";
|
|
4
9
|
import { parseModelRef } from "../../agent/models/selection.js";
|
|
5
|
-
import { prependEnvelopeTimestamp } from "../../channels/envelope-timestamp.js";
|
|
6
10
|
import { gatewayCredentialAuthorization } from "../../gateway/credential.js";
|
|
7
11
|
import { RealtimeClient } from "../../../packages/realtime-client/src/index.js";
|
|
8
12
|
import { buildTuiTranscriptTree, transcriptTreeEntryIdToRowNumber } from "../tui-transcript-tree.js";
|
|
9
13
|
import { computeTuiSessionStats } from "../tui-session-stats.js";
|
|
10
14
|
import { createRequire } from "node:module";
|
|
15
|
+
import { join } from "node:path";
|
|
11
16
|
import crypto from "node:crypto";
|
|
17
|
+
import { mkdir, readFile, readdir, rename, unlink, writeFile } from "node:fs/promises";
|
|
12
18
|
//#region src/tui/backends/gateway-realtime-backend.ts
|
|
19
|
+
init_paths();
|
|
20
|
+
init_src();
|
|
13
21
|
init_logger();
|
|
14
22
|
const log = createLogger("TUI:GatewayRealtime");
|
|
15
23
|
const { WebSocket } = createRequire(import.meta.url)("ws");
|
|
@@ -49,6 +57,10 @@ var GatewayRealtimeBackend = class {
|
|
|
49
57
|
activeRunId = null;
|
|
50
58
|
observedConversationId = null;
|
|
51
59
|
chatAbort = null;
|
|
60
|
+
drafts = /* @__PURE__ */ new Map();
|
|
61
|
+
pendingInputs = /* @__PURE__ */ new Map();
|
|
62
|
+
draftDirectory;
|
|
63
|
+
draftInitialization;
|
|
52
64
|
onEvent;
|
|
53
65
|
onConnected;
|
|
54
66
|
onDisconnected;
|
|
@@ -60,6 +72,52 @@ var GatewayRealtimeBackend = class {
|
|
|
60
72
|
get connectionLabel() {
|
|
61
73
|
return this.baseUrl;
|
|
62
74
|
}
|
|
75
|
+
async getComposerDraftDirectory() {
|
|
76
|
+
await this.initializeDrafts();
|
|
77
|
+
return join(this.draftDirectory, "composers");
|
|
78
|
+
}
|
|
79
|
+
initializeDrafts() {
|
|
80
|
+
return this.draftInitialization ??= (async () => {
|
|
81
|
+
const response = await gatewayFetch(this.baseUrl, "/api/browser-session", this.credential);
|
|
82
|
+
if (!response.ok) throw new Error("Gateway identity is unavailable");
|
|
83
|
+
const identity = await response.json();
|
|
84
|
+
if (!identity.conversationId) throw new Error("Gateway identity is missing");
|
|
85
|
+
const directory = join(resolveStateDir(), "client-drafts", crypto.createHash("sha256").update(identity.conversationId).digest("hex"));
|
|
86
|
+
await mkdir(directory, {
|
|
87
|
+
recursive: true,
|
|
88
|
+
mode: 448
|
|
89
|
+
});
|
|
90
|
+
for (const file of await readdir(directory)) {
|
|
91
|
+
if (!/^[0-9a-f-]{36}\.json$/.test(file)) continue;
|
|
92
|
+
const saved = JSON.parse(await readFile(join(directory, file), "utf8"));
|
|
93
|
+
const id = file.slice(0, -5);
|
|
94
|
+
if (saved.creation) this.drafts.set(id, saved.creation);
|
|
95
|
+
if (saved.command) this.pendingInputs.set(id, sessionInputCommandSchema.parse(saved.command));
|
|
96
|
+
}
|
|
97
|
+
this.draftDirectory = directory;
|
|
98
|
+
})().catch((error) => {
|
|
99
|
+
this.draftInitialization = void 0;
|
|
100
|
+
throw error;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
async persistDraft(conversationId) {
|
|
104
|
+
if (!this.draftDirectory || !/^[0-9a-f-]{36}$/.test(conversationId)) throw new Error("Local conversation storage is unavailable");
|
|
105
|
+
const path = join(this.draftDirectory, `${conversationId}.json`);
|
|
106
|
+
const creation = this.drafts.get(conversationId);
|
|
107
|
+
const command = this.pendingInputs.get(conversationId);
|
|
108
|
+
if (!creation && !command) {
|
|
109
|
+
await unlink(path).catch((error) => {
|
|
110
|
+
if (error.code !== "ENOENT") throw error;
|
|
111
|
+
});
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const temporary = `${path}.${crypto.randomUUID()}.tmp`;
|
|
115
|
+
await writeFile(temporary, JSON.stringify({
|
|
116
|
+
creation,
|
|
117
|
+
command
|
|
118
|
+
}), { mode: 384 });
|
|
119
|
+
await rename(temporary, path);
|
|
120
|
+
}
|
|
63
121
|
start() {
|
|
64
122
|
this.startRealtime();
|
|
65
123
|
}
|
|
@@ -88,27 +146,97 @@ var GatewayRealtimeBackend = class {
|
|
|
88
146
|
if (!res.ok) throw new Error(`Failed to save composer history (${res.status})`);
|
|
89
147
|
return (await res.json()).item;
|
|
90
148
|
}
|
|
149
|
+
async acceptReceipt(conversationId, command, raw) {
|
|
150
|
+
const payload = raw?.payload;
|
|
151
|
+
if (payload?.receipt?.conversationId !== conversationId || payload.receipt.clientMessageId !== command.clientMessageId || !payload.session?.transcriptId) throw new Error("Invalid input receipt; pending input retained");
|
|
152
|
+
this.drafts.delete(conversationId);
|
|
153
|
+
this.pendingInputs.delete(conversationId);
|
|
154
|
+
await this.persistDraft(conversationId);
|
|
155
|
+
}
|
|
156
|
+
async reconcileInput(conversationId) {
|
|
157
|
+
const pending = this.pendingInputs.get(conversationId);
|
|
158
|
+
if (!pending) return;
|
|
159
|
+
const response = await gatewayFetch(this.baseUrl, `/api/sessions/${encodeURIComponent(conversationId)}/input-receipts/${encodeURIComponent(pending.clientMessageId)}`, this.credential);
|
|
160
|
+
if (response.status === 404) return;
|
|
161
|
+
if (!response.ok) throw new Error(`Input confirmation failed (${response.status})`);
|
|
162
|
+
await this.acceptReceipt(conversationId, pending, await response.json());
|
|
163
|
+
}
|
|
164
|
+
async prepareInput(conversationId, clientMessageId, content, delivery, attachments) {
|
|
165
|
+
const pending = this.pendingInputs.get(conversationId);
|
|
166
|
+
if (pending) {
|
|
167
|
+
if (pending.input.content !== content || JSON.stringify(pending.input.attachments) !== JSON.stringify(attachments)) throw new Error("Previous input is awaiting confirmation; retry it before sending different content");
|
|
168
|
+
return pending;
|
|
169
|
+
}
|
|
170
|
+
const creation = this.drafts.get(conversationId);
|
|
171
|
+
const input = {
|
|
172
|
+
content,
|
|
173
|
+
...attachments?.length ? { attachments } : {}
|
|
174
|
+
};
|
|
175
|
+
const origin = {
|
|
176
|
+
type: "system",
|
|
177
|
+
source: "cli"
|
|
178
|
+
};
|
|
179
|
+
let command;
|
|
180
|
+
if (creation) {
|
|
181
|
+
if (!creation.model) {
|
|
182
|
+
const response = await gatewayFetch(this.baseUrl, `/api/models?agentId=${encodeURIComponent(creation.agentId)}`, this.credential);
|
|
183
|
+
if (!response.ok) throw new Error("Agent model configuration is unavailable");
|
|
184
|
+
const { payload } = await response.json();
|
|
185
|
+
const model = payload.models.find((item) => item.id === payload.defaultId);
|
|
186
|
+
if (!model) throw new Error("Configure a model before sending");
|
|
187
|
+
creation.model = model.id;
|
|
188
|
+
creation.thinkingLevel = model.thinking?.initialValue ?? "off";
|
|
189
|
+
}
|
|
190
|
+
command = sessionInputCommandSchema.parse({
|
|
191
|
+
kind: "start",
|
|
192
|
+
clientMessageId,
|
|
193
|
+
creation,
|
|
194
|
+
input,
|
|
195
|
+
origin
|
|
196
|
+
});
|
|
197
|
+
} else {
|
|
198
|
+
const path = `/api/sessions/${encodeURIComponent(conversationId)}`;
|
|
199
|
+
const [detailResponse, configResponse] = await Promise.all([gatewayFetch(this.baseUrl, path, this.credential), gatewayFetch(this.baseUrl, `${path}/agent-config`, this.credential)]);
|
|
200
|
+
if (!detailResponse.ok || !configResponse.ok) throw new Error("Session identity is unavailable");
|
|
201
|
+
const detail = await detailResponse.json();
|
|
202
|
+
const config = await configResponse.json();
|
|
203
|
+
command = sessionInputCommandSchema.parse({
|
|
204
|
+
kind: "append",
|
|
205
|
+
clientMessageId,
|
|
206
|
+
expectedTranscriptId: detail.session.transcriptId,
|
|
207
|
+
configVersion: config.payload.configVersion,
|
|
208
|
+
delivery,
|
|
209
|
+
input,
|
|
210
|
+
origin
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
this.pendingInputs.set(conversationId, command);
|
|
214
|
+
await this.persistDraft(conversationId);
|
|
215
|
+
return command;
|
|
216
|
+
}
|
|
91
217
|
async sendChat(opts) {
|
|
92
218
|
this.observedConversationId = opts.conversationId;
|
|
93
219
|
this.chatAbort?.abort();
|
|
94
220
|
this.chatAbort = new AbortController();
|
|
95
221
|
const signal = this.chatAbort.signal;
|
|
96
222
|
const clientMessageId = crypto.randomUUID();
|
|
223
|
+
const command = await this.prepareInput(opts.conversationId, clientMessageId, opts.message, "next", opts.attachments);
|
|
97
224
|
const res = await gatewayFetch(this.baseUrl, `/api/sessions/${encodeURIComponent(opts.conversationId)}/inputs`, this.credential, {
|
|
98
225
|
method: "POST",
|
|
99
|
-
body: JSON.stringify(
|
|
100
|
-
clientMessageId,
|
|
101
|
-
delivery: "next",
|
|
102
|
-
content: opts.message.trimStart().startsWith("/") ? opts.message : prependEnvelopeTimestamp(opts.message),
|
|
103
|
-
attachments: opts.attachments,
|
|
104
|
-
thinking: opts.thinking
|
|
105
|
-
}),
|
|
226
|
+
body: JSON.stringify(command),
|
|
106
227
|
signal
|
|
107
228
|
});
|
|
108
229
|
const json = await res.json().catch(() => null);
|
|
109
|
-
if (!res.ok)
|
|
110
|
-
|
|
111
|
-
|
|
230
|
+
if (!res.ok) {
|
|
231
|
+
if (isSessionCommandRejected(res.status, json)) {
|
|
232
|
+
this.pendingInputs.delete(opts.conversationId);
|
|
233
|
+
await this.persistDraft(opts.conversationId);
|
|
234
|
+
}
|
|
235
|
+
throw new Error(json?.error?.message ?? `Gateway error: ${res.status}`);
|
|
236
|
+
}
|
|
237
|
+
await this.acceptReceipt(opts.conversationId, command, json);
|
|
238
|
+
const state = json?.payload?.inputState;
|
|
239
|
+
const own = state?.inputs?.find((input) => input.clientMessageId === command.clientMessageId);
|
|
112
240
|
const runId = state?.activeRunId ?? crypto.randomUUID();
|
|
113
241
|
if (state?.activeRunId && own?.id === state.activeInputId) this.resumeChat({
|
|
114
242
|
conversationId: opts.conversationId,
|
|
@@ -121,7 +249,7 @@ var GatewayRealtimeBackend = class {
|
|
|
121
249
|
const params = new URLSearchParams();
|
|
122
250
|
params.set("q", query);
|
|
123
251
|
params.set("limit", String(options?.limit ?? 15));
|
|
124
|
-
const context = await gatewayFetch(this.baseUrl, `/api/files/contexts/session/${encodeURIComponent(conversationId)}`, this.credential);
|
|
252
|
+
const context = await gatewayFetch(this.baseUrl, this.drafts.has(conversationId) ? `/api/files/contexts/${this.drafts.get(conversationId).projectId ? "project" : "agent"}/${encodeURIComponent(this.drafts.get(conversationId).projectId || this.drafts.get(conversationId).agentId)}` : `/api/files/contexts/session/${encodeURIComponent(conversationId)}`, this.credential);
|
|
125
253
|
if (!context.ok) return [];
|
|
126
254
|
const contextJson = await context.json();
|
|
127
255
|
if (!contextJson.space?.id) return [];
|
|
@@ -144,7 +272,11 @@ var GatewayRealtimeBackend = class {
|
|
|
144
272
|
}
|
|
145
273
|
}
|
|
146
274
|
async getReviewContext(conversationId) {
|
|
147
|
-
const
|
|
275
|
+
const draft = this.drafts.get(conversationId);
|
|
276
|
+
const params = new URLSearchParams(draft ? {
|
|
277
|
+
agentId: draft.agentId,
|
|
278
|
+
...draft.projectId ? { projectId: draft.projectId } : {}
|
|
279
|
+
} : { conversationId });
|
|
148
280
|
const res = await gatewayFetch(this.baseUrl, `/api/review/context?${params.toString()}`, this.credential);
|
|
149
281
|
const json = await res.json().catch(() => ({}));
|
|
150
282
|
if (!res.ok || !json.ok || !json.payload) throw new Error(json.error?.message ?? `Review context failed (${res.status})`);
|
|
@@ -177,7 +309,10 @@ var GatewayRealtimeBackend = class {
|
|
|
177
309
|
async resolveStartupProject(opts) {
|
|
178
310
|
const res = await gatewayFetch(this.baseUrl, "/api/projects/resolve-workspace", this.credential, {
|
|
179
311
|
method: "POST",
|
|
180
|
-
body: JSON.stringify(
|
|
312
|
+
body: JSON.stringify({
|
|
313
|
+
...opts,
|
|
314
|
+
...this.drafts.has(opts.conversationId) ? { conversationId: void 0 } : {}
|
|
315
|
+
})
|
|
181
316
|
});
|
|
182
317
|
const json = await res.json().catch(() => ({}));
|
|
183
318
|
if (!res.ok || json.ok === false) throw new Error(json.error ?? `Project workspace resolve failed (${res.status})`);
|
|
@@ -212,26 +347,35 @@ var GatewayRealtimeBackend = class {
|
|
|
212
347
|
async submitChatInput(opts) {
|
|
213
348
|
this.observedConversationId = opts.conversationId;
|
|
214
349
|
try {
|
|
350
|
+
const command = await this.prepareInput(opts.conversationId, crypto.randomUUID(), opts.message, opts.delivery);
|
|
215
351
|
const res = await gatewayFetch(this.baseUrl, `/api/sessions/${encodeURIComponent(opts.conversationId)}/inputs`, this.credential, {
|
|
216
352
|
method: "POST",
|
|
217
|
-
body: JSON.stringify(
|
|
218
|
-
clientMessageId: crypto.randomUUID(),
|
|
219
|
-
delivery: opts.delivery,
|
|
220
|
-
content: opts.message
|
|
221
|
-
})
|
|
353
|
+
body: JSON.stringify(command)
|
|
222
354
|
});
|
|
223
|
-
if (!res.ok)
|
|
355
|
+
if (!res.ok) {
|
|
356
|
+
if (isSessionCommandRejected(res.status, await res.json().catch(() => null))) {
|
|
357
|
+
this.pendingInputs.delete(opts.conversationId);
|
|
358
|
+
await this.persistDraft(opts.conversationId);
|
|
359
|
+
}
|
|
360
|
+
return { ok: false };
|
|
361
|
+
}
|
|
224
362
|
const json = await res.json();
|
|
363
|
+
await this.acceptReceipt(opts.conversationId, command, json);
|
|
225
364
|
return {
|
|
226
365
|
ok: json.ok === true,
|
|
227
366
|
effectiveDelivery: json.payload?.effectiveDelivery,
|
|
228
|
-
state: json.payload?.
|
|
367
|
+
state: json.payload?.inputState
|
|
229
368
|
};
|
|
230
369
|
} catch {
|
|
231
370
|
return { ok: false };
|
|
232
371
|
}
|
|
233
372
|
}
|
|
234
373
|
async getChatInputState(conversationId) {
|
|
374
|
+
if (this.drafts.has(conversationId)) return {
|
|
375
|
+
conversationId,
|
|
376
|
+
revision: 0,
|
|
377
|
+
inputs: []
|
|
378
|
+
};
|
|
235
379
|
const res = await gatewayFetch(this.baseUrl, `/api/sessions/${encodeURIComponent(conversationId)}/input-state`, this.credential);
|
|
236
380
|
if (!res.ok) throw new Error(`Input state failed (${res.status})`);
|
|
237
381
|
return (await res.json()).payload;
|
|
@@ -266,7 +410,7 @@ var GatewayRealtimeBackend = class {
|
|
|
266
410
|
connectors: []
|
|
267
411
|
};
|
|
268
412
|
try {
|
|
269
|
-
const res = await gatewayFetch(this.baseUrl, `/api/tui/startup-resources?conversationId=${encodeURIComponent(conversationId)}`, this.credential);
|
|
413
|
+
const res = await gatewayFetch(this.baseUrl, `/api/tui/startup-resources?${this.drafts.has(conversationId) ? `agentId=${encodeURIComponent(this.drafts.get(conversationId).agentId)}` : `conversationId=${encodeURIComponent(conversationId)}`}`, this.credential);
|
|
270
414
|
if (!res.ok) return empty;
|
|
271
415
|
const json = await res.json();
|
|
272
416
|
return {
|
|
@@ -286,6 +430,8 @@ var GatewayRealtimeBackend = class {
|
|
|
286
430
|
}
|
|
287
431
|
}
|
|
288
432
|
async loadHistory(opts) {
|
|
433
|
+
await this.reconcileInput(opts.conversationId);
|
|
434
|
+
if (this.drafts.has(opts.conversationId)) return { messages: [] };
|
|
289
435
|
try {
|
|
290
436
|
const res = await gatewayFetch(this.baseUrl, `/api/sessions/${encodeURIComponent(opts.conversationId)}?include=transcriptRows`, this.credential);
|
|
291
437
|
if (!res.ok) return { messages: [] };
|
|
@@ -393,7 +539,6 @@ var GatewayRealtimeBackend = class {
|
|
|
393
539
|
key: s.key,
|
|
394
540
|
agentId: s.agentId,
|
|
395
541
|
sourceChannel: s.sourceChannel,
|
|
396
|
-
generatedShell: s.customData?.genericNewChatShell === true,
|
|
397
542
|
displayName: s.name,
|
|
398
543
|
updatedAt: s.updatedAt ? Date.parse(s.updatedAt) : void 0,
|
|
399
544
|
totalTokens: s.estimatedTokens ?? null,
|
|
@@ -446,18 +591,27 @@ var GatewayRealtimeBackend = class {
|
|
|
446
591
|
return { agentId: typeof saved === "string" && saved.trim() ? saved.trim().toLowerCase() : target };
|
|
447
592
|
}
|
|
448
593
|
async createConversation(agentId, conversationId) {
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
594
|
+
const id = conversationId ?? crypto.randomUUID();
|
|
595
|
+
this.drafts.set(id, {
|
|
596
|
+
agentId,
|
|
597
|
+
projectId: null,
|
|
598
|
+
execution: null,
|
|
599
|
+
temporary: false,
|
|
600
|
+
model: "",
|
|
601
|
+
thinkingLevel: "off"
|
|
456
602
|
});
|
|
457
|
-
|
|
458
|
-
return
|
|
603
|
+
await this.persistDraft(id);
|
|
604
|
+
return id;
|
|
459
605
|
}
|
|
460
606
|
async getSessionInfo(conversationId) {
|
|
607
|
+
await this.reconcileInput(conversationId);
|
|
608
|
+
const draft = this.drafts.get(conversationId);
|
|
609
|
+
if (draft) return {
|
|
610
|
+
agentId: draft.agentId,
|
|
611
|
+
model: draft.model,
|
|
612
|
+
thinkingLevel: draft.thinkingLevel,
|
|
613
|
+
projectId: draft.projectId ?? void 0
|
|
614
|
+
};
|
|
461
615
|
const out = {};
|
|
462
616
|
try {
|
|
463
617
|
const sessionPath = `/api/sessions/${encodeURIComponent(conversationId)}`;
|
|
@@ -467,7 +621,6 @@ var GatewayRealtimeBackend = class {
|
|
|
467
621
|
session = (await sessionRes.json()).session;
|
|
468
622
|
if (session) {
|
|
469
623
|
out.agentId = session.agentId;
|
|
470
|
-
out.generatedShell = session.customData?.genericNewChatShell === true;
|
|
471
624
|
if (session.name) out.displayName = session.name;
|
|
472
625
|
if (session.estimatedTokens != null) out.totalTokens = session.estimatedTokens;
|
|
473
626
|
if (session.projectId?.trim()) out.projectId = session.projectId.trim();
|
|
@@ -688,6 +841,33 @@ var GatewayRealtimeBackend = class {
|
|
|
688
841
|
return { ok: true };
|
|
689
842
|
}
|
|
690
843
|
async patchSession(conversationId, patch) {
|
|
844
|
+
const draft = this.drafts.get(conversationId);
|
|
845
|
+
if (draft) {
|
|
846
|
+
if (this.pendingInputs.has(conversationId)) throw new Error("First input is awaiting confirmation");
|
|
847
|
+
if (typeof patch.workingDirectory === "string") {
|
|
848
|
+
const resolved = await this.resolveStartupProject({
|
|
849
|
+
workspacePath: patch.workingDirectory,
|
|
850
|
+
conversationId,
|
|
851
|
+
agentId: draft.agentId,
|
|
852
|
+
autoCreate: true
|
|
853
|
+
});
|
|
854
|
+
if (!resolved.project) throw new Error("Working directory could not be bound to a project");
|
|
855
|
+
draft.projectId = resolved.project.id;
|
|
856
|
+
draft.execution = { mode: "local_checkout" };
|
|
857
|
+
}
|
|
858
|
+
if (typeof patch.model === "string") draft.model = patch.model;
|
|
859
|
+
if (typeof patch.thinkingLevel === "string") draft.thinkingLevel = patch.thinkingLevel;
|
|
860
|
+
if (typeof patch.projectId === "string") {
|
|
861
|
+
draft.projectId = patch.projectId;
|
|
862
|
+
draft.execution = { mode: "local_checkout" };
|
|
863
|
+
}
|
|
864
|
+
if (patch.projectId === null) {
|
|
865
|
+
draft.projectId = null;
|
|
866
|
+
draft.execution = null;
|
|
867
|
+
}
|
|
868
|
+
await this.persistDraft(conversationId);
|
|
869
|
+
return;
|
|
870
|
+
}
|
|
691
871
|
const res = await gatewayFetch(this.baseUrl, `/api/sessions/${encodeURIComponent(conversationId)}/agent-config`, this.credential, {
|
|
692
872
|
method: "PATCH",
|
|
693
873
|
body: JSON.stringify(patch)
|
|
@@ -745,6 +925,7 @@ var GatewayRealtimeBackend = class {
|
|
|
745
925
|
return url.toString();
|
|
746
926
|
},
|
|
747
927
|
issueTicket: async () => {
|
|
928
|
+
await this.initializeDrafts();
|
|
748
929
|
const response = await gatewayFetch(this.baseUrl, "/api/realtime/tickets", this.credential, {
|
|
749
930
|
method: "POST",
|
|
750
931
|
body: JSON.stringify({
|
|
@@ -37,7 +37,6 @@ export interface TuiComposerHistoryItem {
|
|
|
37
37
|
export interface TuiSessionItem {
|
|
38
38
|
agentId?: string;
|
|
39
39
|
sourceChannel?: string;
|
|
40
|
-
generatedShell?: boolean;
|
|
41
40
|
key: string;
|
|
42
41
|
updatedAt?: number | null;
|
|
43
42
|
model?: string | null;
|
|
@@ -193,6 +192,7 @@ export interface TuiBackend {
|
|
|
193
192
|
getActiveSignal?(): AbortSignal | undefined;
|
|
194
193
|
/** Global composer history, shared across sessions and clients. */
|
|
195
194
|
getComposerInputHistory(): Promise<TuiComposerHistoryItem[]>;
|
|
195
|
+
getComposerDraftDirectory(): Promise<string>;
|
|
196
196
|
/** Persist one submitted chat input. */
|
|
197
197
|
recordComposerInputHistory(text: string): Promise<TuiComposerHistoryItem>;
|
|
198
198
|
/** Send a chat message, returns the run id. */
|
|
@@ -3,6 +3,7 @@ export type TuiChatInputStatus = 'queued' | 'running' | 'injecting' | 'completed
|
|
|
3
3
|
export interface TuiChatInput {
|
|
4
4
|
id: string;
|
|
5
5
|
content: string;
|
|
6
|
+
attachments?: unknown[];
|
|
6
7
|
requestedDelivery: TuiChatInputDelivery;
|
|
7
8
|
effectiveDelivery: TuiChatInputDelivery;
|
|
8
9
|
status: TuiChatInputStatus;
|
|
@@ -2,8 +2,8 @@ import { closeXopcDatabase, isXopcDatabaseOpen, openXopcDatabase } from "../stor
|
|
|
2
2
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
3
3
|
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
4
4
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
5
|
-
import { init_agent_session_key, isValidAgentId, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
6
5
|
import { resolveConfigPath } from "../config/paths.js";
|
|
6
|
+
import { init_agent_session_key, isValidAgentId, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
7
7
|
import { init_providers, providerSupportsOAuth } from "../providers/index.js";
|
|
8
8
|
import { ProjectService } from "../projects/project-service.js";
|
|
9
9
|
import { isValidProjectAgentId, normalizeProjectAgentId } from "../projects/project-agent.js";
|
|
@@ -29,7 +29,6 @@ function sessionMetadataToTuiItem(meta) {
|
|
|
29
29
|
key: meta.key,
|
|
30
30
|
agentId: meta.agentId,
|
|
31
31
|
sourceChannel: meta.sourceChannel,
|
|
32
|
-
generatedShell: meta.customData?.genericNewChatShell === true,
|
|
33
32
|
displayName: meta.name,
|
|
34
33
|
updatedAt: Date.parse(meta.updatedAt),
|
|
35
34
|
totalTokens: meta.estimatedTokens ?? null,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Config } from '../config/schema.js';
|
|
2
2
|
import type { TuiStartupResources } from './tui-backend.js';
|
|
3
3
|
export declare function collectTuiStartupResources(config: Config, conversationId?: string, options?: {
|
|
4
|
+
agentId?: string;
|
|
4
5
|
isWorkspaceTrusted?: (workspaceDir: string) => boolean;
|
|
5
6
|
}): TuiStartupResources;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
|
-
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
3
2
|
import { init_paths, resolveAgentProfileDir, resolveBundledSkillsDir } from "../config/paths.js";
|
|
3
|
+
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
4
4
|
import { resolveBootstrapFilesSync } from "../agent/bootstrap/bootstrap-files.js";
|
|
5
5
|
import { listConnectorInstances } from "../connectors/instances.js";
|
|
6
6
|
import { createSkillConfigManager, isSkillEnabled } from "../agent/skills/config.js";
|
|
@@ -15,7 +15,7 @@ function uniqueSorted(values) {
|
|
|
15
15
|
return [...new Set([...values].map((value) => value.trim()).filter(Boolean))].sort((a, b) => a.localeCompare(b));
|
|
16
16
|
}
|
|
17
17
|
function collectTuiStartupResources(config, conversationId, options = {}) {
|
|
18
|
-
const profile = resolveEffectiveAgentProfileForSession(conversationId);
|
|
18
|
+
const profile = options.agentId ? resolveEffectiveAgentProfile(options.agentId) : resolveEffectiveAgentProfileForSession(conversationId);
|
|
19
19
|
const profileDir = resolveAgentProfileDir(profile.agentId);
|
|
20
20
|
const workspaceDir = profile.resolvedWorkspacePath || getWorkspacePath(config);
|
|
21
21
|
const context = uniqueSorted(resolveBootstrapFilesSync({
|