@xopcai/xopc 0.0.302 → 0.0.306
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/README.md +4 -4
- package/README.zh-CN.md +4 -4
- package/dist/browser-ext/dist/assets/{auth-B_9ZuGDx.js → auth-C3yV1y_l.js} +67 -22
- package/dist/browser-ext/dist/background.js +4 -4
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +3 -3
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/xopc.extension.json +0 -3
- package/dist/extensions/telegram/xopc.extension.json +1 -4
- package/dist/extensions/weixin/xopc.extension.json +0 -3
- package/dist/gateway/static/root/assets/{activity-store-DCi5rh4e.js → activity-store-DLtim-_I.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-C0zP6W2B.js → agent-avatar-dicebear-iQXtiilH.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CxOv4ivK.js +1 -0
- package/dist/gateway/static/root/assets/agents-DzKx7z3k.js +1 -0
- package/dist/gateway/static/root/assets/{api-CAV9PN9i.js → api-DfSU0-lD.js} +1 -1
- package/dist/gateway/static/root/assets/api-gpHh07OL.js +1 -0
- package/dist/gateway/static/root/assets/app-management-settings-panel-BpYFKz7B.js +1 -0
- package/dist/gateway/static/root/assets/{appearance-settings-ZFjV_opr.js → appearance-settings-BQfR5vrq.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BceB7JHZ.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-MaKWrpgC.js → archive-plugin-BxOvZ-ZX.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-IfqbP2BN.js → attachment-load-B0FzTMAJ.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CeI2NGSO.js → automations-page-BpXuPaPg.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-Cn_p8zY_.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-jvQ6FaBZ.js → binary-plugins-BP7wfpqy.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-D4ZIVQbk.css → block-editor-BdOTO0Yo.css} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-B7U3qlB3.js → block-editor-oMLvdnOQ.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-BGT0xoTv.js → browser-automation-inputs-DTxSZ00u.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-DvLAwoiQ.js → browser-automations-page-IbJnwEY4.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-CCUO3G23.js +3 -0
- package/dist/gateway/static/root/assets/button-CS04eWY9.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BjMb5H2_.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-P22-_i13.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-C_icwbWj.js → channels-status-swr-D2AmAoty.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BtL71IOs.js → chat-terminal-dock-B-yI3Mi1.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-Bu6ZJtmS.js → computer-settings-page-CWx_jnng.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-BLgPORmH.js +2 -0
- package/dist/gateway/static/root/assets/cron-expression-DMRRL4Zg.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-BSwL0e6E.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-BNugauiZ.js → dependency-picker-BQTspLzC.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DTy_3-OY.js → desktop-pet-C3lFxDF6.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-Y8pjpXFE.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-DM4_GMzo.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-C3F7RiGW.js → extension-debug-page-CVGiGVcR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C0jhcCT_.js → extension-page-g3JtCP_y.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CNvJQkrr.js → extension-settings-page-CjpoKV1f.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-D5AM8cyQ.js → gateway-config-swr-BSvXXpKM.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-BDCpS7U1.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-BGmP1obI.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-CYG9WCZn.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CSJWdnFs.js → gateway-startup-retry-Caf8g3sC.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-Cd1VJsHe.js → heartbeat-settings-Cl834-SS.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-CB_XVtIM.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-BNh604hw.js → image-generation-api-BwEWBUVC.js} +1 -1
- package/dist/gateway/static/root/assets/imports-page-CoMlgSIA.js +1 -0
- package/dist/gateway/static/root/assets/index-CI37dTAn.css +1 -0
- package/dist/gateway/static/root/assets/index-Do9MltC4.js +79 -0
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-CNq5D4pe.js +1 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-BxQlEje6.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DyrFxW3G.js → local-apps-page-DQnRA598.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DLK05Y1a.js → locale-store-D16nmbaN.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-CT5GrcMs.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-DKcO5fQ-.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-B8maDRWh.js → markdown-view-DCp4BlZP.js} +2 -2
- package/dist/gateway/static/root/assets/{media-plugins-5DakFba_.js → media-plugins-Cy64sn_C.js} +1 -1
- package/dist/gateway/static/root/assets/messages-C-9oo69N.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-5dc3LKTL.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-AbwxgXuG.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-DzJpglJJ.js → page-tabs-CgEoHSVT.js} +1 -1
- package/dist/gateway/static/root/assets/{popover-select-DldSX8GX.js → popover-select-9i-ZtHXL.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Dj6LJsuQ.js → preview-open-alternatives-Ck2uKTbf.js} +1 -1
- package/dist/gateway/static/root/assets/{proactive-page-CwudBdrQ.js → proactive-page-Dr1mCJhZ.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CujZXOea.js → product-open-page-DbZvJ5GE.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DnE1zI1c.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-BD0nLYxk.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BMFL4vis.js → registry-api-DcQdwpPu.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-TYuE6A3S.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DV554qyN.js → runtime-tools-settings-panel-CPwdgWKo.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-Bh2Er67B.js → schema-form-8psK4cFO.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BcWDQQFX.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DzGQX6Hq.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BsdM7P1d.js → settings-form-section-D_Gsz5rl.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-3yEAqoME.js → settings-page-C_Tj_mkZ.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CE2X89qN.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-B_M_oPsT.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-BL4H9Iym.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-WMKIgUOp.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DYgwzl5B.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-dHBD7YqU.js → skills-page.utils-Cuh6s2HM.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-lItR5Kah.js → system-settings-panel-aassGyNb.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-BjeRslap.js +1 -0
- package/dist/gateway/static/root/assets/theme-store-RUBQBsFP.js +1 -0
- package/dist/gateway/static/root/assets/tunnel-api-DJYcPWIV.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-DO50_g_S.js → use-autosave-QGYG7oMZ.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-PrRsd4go.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-k7tWLXzM.js → voice-api-key-field-D1s0gIRW.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-bZqN8-UF.js → voice-config-api-D2goEn5e.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BHI6gO_u.js → work-discovery-overlay-DkFW9aJ6.js} +1 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-BYToUPUY.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-Z8iZe9YP.js +6 -0
- package/dist/gateway/static/root/index.html +14 -12
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/device-pairing.js +100 -7
- package/dist/packages/gateway-contract/src/gateway-scopes.js +53 -0
- package/dist/packages/gateway-contract/src/index.js +2 -0
- package/dist/packages/realtime-client/src/index.js +14 -2
- package/dist/packages/realtime-protocol/src/index.js +18 -14
- package/dist/src/agent/agent-instance-gateway.d.ts +2 -0
- package/dist/src/agent/agent-manager.d.ts +2 -0
- package/dist/src/agent/agent-manager.js +40 -12
- package/dist/src/agent/agent-scope.d.ts +4 -1
- package/dist/src/agent/agent-scope.js +19 -3
- package/dist/src/agent/commands/command-isolation.js +11 -9
- package/dist/src/agent/commands/command-registry.js +18 -33
- package/dist/src/agent/context/audit.js +12 -2
- package/dist/src/agent/context/coordinator.d.ts +13 -3
- package/dist/src/agent/context/coordinator.js +27 -11
- package/dist/src/agent/context/execution-context.js +42 -22
- package/dist/src/agent/context/execution-context.types.d.ts +4 -2
- package/dist/src/agent/context/execution-scope.d.ts +2 -2
- package/dist/src/agent/context/execution-scope.js +1 -1
- package/dist/src/agent/context/project-context.d.ts +2 -2
- package/dist/src/agent/context/project-context.js +3 -3
- package/dist/src/agent/embedded/run-for-session.d.ts +1 -0
- package/dist/src/agent/embedded/run-for-session.js +7 -1
- package/dist/src/agent/inbound/attachment-pipeline.d.ts +2 -0
- package/dist/src/agent/inbound/attachment-pipeline.js +3 -3
- package/dist/src/agent/inbound/inbound-loop.js +1 -0
- package/dist/src/agent/inbound/turn-dispatcher.js +3 -3
- package/dist/src/agent/mcp/mcp-stdio-transport.js +5 -2
- package/dist/src/agent/memory/compaction-promotion.js +7 -2
- package/dist/src/agent/memory/create-memory-manager.js +1 -0
- package/dist/src/agent/memory/manager.d.ts +6 -0
- package/dist/src/agent/memory/manager.js +74 -39
- package/dist/src/agent/memory/runtime.d.ts +3 -3
- package/dist/src/agent/memory/runtime.js +11 -4
- package/dist/src/agent/orchestration/agent-orchestrator.js +4 -1
- package/dist/src/agent/prompt/cache-boundary.d.ts +2 -0
- package/dist/src/agent/prompt/cache-boundary.js +10 -1
- package/dist/src/agent/service/build-direct-message-content.d.ts +1 -0
- package/dist/src/agent/service/build-direct-message-content.js +2 -1
- package/dist/src/agent/service/direct-turn-helpers.js +3 -2
- package/dist/src/agent/service/process-direct-streaming.d.ts +3 -1
- package/dist/src/agent/service/process-direct-streaming.js +3 -2
- package/dist/src/agent/service/webchat-tts.d.ts +0 -4
- package/dist/src/agent/service/webchat-tts.js +20 -19
- package/dist/src/agent/tools/factory.js +3 -3
- package/dist/src/agent/tools/knowledge-memory-tool.d.ts +2 -2
- package/dist/src/agent/tools/knowledge-memory-tool.js +7 -7
- package/dist/src/browser/native-messaging-host.js +2 -2
- package/dist/src/channels/attachments/voice-stt-webchat.d.ts +3 -0
- package/dist/src/channels/attachments/voice-stt-webchat.js +22 -9
- package/dist/src/cli/commands/agent.js +2 -0
- package/dist/src/cli/commands/config.js +8 -9
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +69 -44
- package/dist/src/cli/commands/extension-pack.js +0 -2
- package/dist/src/cli/commands/extension.js +4 -25
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/onboard/gateway.js +2 -1
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +5 -2
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/loader.d.ts +1 -0
- package/dist/src/config/loader.js +14 -1
- package/dist/src/config/schema.d.ts +10 -3
- package/dist/src/config/schema.js +10 -2
- package/dist/src/execution-environments/local-worktree-manager.js +17 -15
- package/dist/src/execution-environments/store.js +4 -2
- package/dist/src/execution-environments/types.d.ts +3 -0
- package/dist/src/execution-environments/types.js +2 -1
- package/dist/src/execution-environments/worktree-safety.d.ts +8 -0
- package/dist/src/execution-environments/worktree-safety.js +43 -0
- package/dist/src/extensions/activation-planner.d.ts +1 -1
- package/dist/src/extensions/activation-planner.js +1 -1
- package/dist/src/extensions/api-version.d.ts +4 -0
- package/dist/src/extensions/api-version.js +15 -0
- package/dist/src/extensions/api.d.ts +3 -9
- package/dist/src/extensions/api.js +26 -32
- package/dist/src/extensions/config-validation.d.ts +8 -0
- package/dist/src/extensions/config-validation.js +25 -0
- package/dist/src/extensions/extension-registry-impl.d.ts +20 -9
- package/dist/src/extensions/extension-registry-impl.js +79 -11
- package/dist/src/extensions/hooks.d.ts +1 -1
- package/dist/src/extensions/index.d.ts +2 -1
- package/dist/src/extensions/install-transaction.d.ts +2 -0
- package/dist/src/extensions/install-transaction.js +32 -21
- package/dist/src/extensions/install.js +18 -1
- package/dist/src/extensions/loader.d.ts +5 -5
- package/dist/src/extensions/loader.js +109 -47
- package/dist/src/extensions/lockfile.d.ts +3 -5
- package/dist/src/extensions/lockfile.js +41 -14
- package/dist/src/extensions/normalize-manifest.js +6 -60
- package/dist/src/extensions/sdk/index.d.ts +3 -2
- package/dist/src/extensions/sdk/index.js +2 -2
- package/dist/src/extensions/sdk/testing.js +0 -4
- package/dist/src/extensions/security.js +5 -7
- package/dist/src/extensions/types/core.d.ts +0 -5
- package/dist/src/extensions/types/index.d.ts +1 -1
- package/dist/src/extensions/types/manifest.d.ts +1 -25
- package/dist/src/extensions/types/providers.d.ts +1 -1
- package/dist/src/extensions/types/registration.d.ts +0 -12
- package/dist/src/extensions/update.js +71 -30
- package/dist/src/gateway/heartbeat/service.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +3 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +47 -10
- package/dist/src/gateway/hono/routes/devices.js +10 -7
- package/dist/src/gateway/hono/routes/endpoint-compatibility.js +6 -0
- package/dist/src/gateway/hono/routes/extension-gateway.js +0 -33
- package/dist/src/gateway/hono/routes/imports.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +0 -1
- package/dist/src/gateway/hono/routes/local-apps.js +1 -1
- package/dist/src/gateway/hono/routes/realtime.js +30 -8
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/hono/routes/user-model.js +25 -6
- package/dist/src/gateway/index.js +5 -2
- package/dist/src/gateway/lock.d.ts +2 -0
- package/dist/src/gateway/lock.js +31 -14
- package/dist/src/gateway/run-loop.js +3 -2
- package/dist/src/gateway/security/gateway-scopes.d.ts +2 -5
- package/dist/src/gateway/security/gateway-scopes.js +3 -45
- package/dist/src/gateway/security/index.js +2 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service.js +11 -7
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/imports/importService.d.ts +1 -1
- package/dist/src/imports/inventory.js +16 -2
- package/dist/src/imports/productImport.js +5 -5
- package/dist/src/imports/types.d.ts +3 -3
- package/dist/src/infra/exec.d.ts +2 -2
- package/dist/src/infra/exec.js +32 -27
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/run-command.js +15 -50
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/knowledge/connected-knowledge-pipeline.js +13 -3
- package/dist/src/knowledge-memory/domain.d.ts +17 -1
- package/dist/src/knowledge-memory/index.js +2 -2
- package/dist/src/knowledge-memory/repository.d.ts +26 -4
- package/dist/src/knowledge-memory/repository.js +171 -36
- package/dist/src/mcp/channel-bridge.js +7 -3
- package/dist/src/media-understanding/registry.js +6 -1
- package/dist/src/migrations/knowledge-memory-read-policy-config.d.ts +2 -0
- package/dist/src/migrations/knowledge-memory-read-policy-config.js +48 -0
- package/dist/src/migrations/runner.js +2 -1
- package/dist/src/process/bounded-output.d.ts +10 -0
- package/dist/src/process/bounded-output.js +41 -0
- package/dist/src/process/kill-tree.d.ts +6 -17
- package/dist/src/process/kill-tree.js +43 -75
- package/dist/src/process/process-spec.d.ts +39 -0
- package/dist/src/process/process-spec.js +13 -0
- package/dist/src/process/run-process.d.ts +4 -0
- package/dist/src/process/run-process.js +97 -0
- package/dist/src/providers/plugin-registry.d.ts +1 -1
- package/dist/src/providers/plugin-registry.js +6 -0
- package/dist/src/realtime/runtime.js +3 -1
- package/dist/src/session/store.js +1 -1
- package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
- package/dist/src/storage/sqlite/index.d.ts +1 -1
- package/dist/src/storage/sqlite/index.js +2 -2
- package/dist/src/storage/sqlite/migrations/180_execution_environment_ownership.sql +7 -0
- package/dist/src/storage/sqlite/migrations/181_knowledge_item_status_events.sql +12 -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/schema.sql +13 -0
- package/dist/src/storage/sqlite/transcript-repository.d.ts +4 -0
- package/dist/src/storage/sqlite/transcript-repository.js +36 -1
- package/dist/src/tui/backends/embedded-backend.d.ts +24 -8
- package/dist/src/tui/backends/embedded-backend.js +114 -10
- package/dist/src/tui/backends/gateway-realtime-backend.d.ts +18 -0
- package/dist/src/tui/backends/gateway-realtime-backend.js +32 -5
- package/dist/src/tui/components/assistant-message.d.ts +4 -1
- package/dist/src/tui/components/assistant-message.js +10 -2
- package/dist/src/tui/components/cell-render-mode.d.ts +4 -0
- package/dist/src/tui/components/cell-render-mode.js +1 -0
- package/dist/src/tui/components/chat-log.d.ts +17 -4
- package/dist/src/tui/components/chat-log.js +68 -50
- package/dist/src/tui/components/custom-editor.d.ts +2 -2
- package/dist/src/tui/components/custom-editor.js +5 -1
- package/dist/src/tui/components/pending-input-preview.d.ts +9 -0
- package/dist/src/tui/components/pending-input-preview.js +33 -0
- package/dist/src/tui/components/semantic-cell.d.ts +17 -0
- package/dist/src/tui/components/semantic-cell.js +29 -0
- package/dist/src/tui/components/tool-execution.d.ts +5 -1
- package/dist/src/tui/components/tool-execution.js +33 -10
- package/dist/src/tui/components/transcript-overlay.d.ts +29 -0
- package/dist/src/tui/components/transcript-overlay.js +114 -0
- package/dist/src/tui/components/tui-bottom-bar.js +3 -1
- package/dist/src/tui/components/user-message.d.ts +5 -1
- package/dist/src/tui/components/user-message.js +12 -1
- package/dist/src/tui/extension-host/load-extensions.d.ts +1 -1
- package/dist/src/tui/extension-host/runtime-context.js +2 -1
- package/dist/src/tui/extension-host/runtime.d.ts +1 -1
- package/dist/src/tui/format-tui-hotkeys.js +8 -1
- package/dist/src/tui/tui-agent-events.js +31 -0
- package/dist/src/tui/tui-backend.d.ts +23 -11
- package/dist/src/tui/tui-backend.js +1 -9
- package/dist/src/tui/tui-chat-input-state.d.ts +25 -0
- package/dist/src/tui/tui-chat-input-state.js +36 -0
- package/dist/src/tui/tui-command-formatters.js +2 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-types.d.ts +2 -1
- package/dist/src/tui/tui-types.js +2 -1
- package/dist/src/tui/tui.js +122 -30
- package/dist/src/tui/xopc-tui-keybindings.d.ts +23 -3
- package/dist/src/tui/xopc-tui-keybindings.js +22 -2
- package/dist/src/user-context/access-policy.d.ts +2 -2
- package/dist/src/user-context/access-policy.js +10 -2
- package/dist/src/user-context/config.d.ts +23 -6
- package/dist/src/user-context/config.js +54 -7
- package/dist/src/voice/platform-streams.js +11 -1
- package/dist/src/voice/realtime/omniEngine.js +13 -1
- package/dist/src/voice/realtime/runtime.js +2 -1
- package/dist/src/voice/tts/audio.js +1 -1
- package/dist/src/voice/tts/speech-registry.js +6 -1
- package/package.json +9 -7
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D0ITeUFb.js +0 -1
- package/dist/gateway/static/root/assets/agents-DcfWhk2S.js +0 -1
- package/dist/gateway/static/root/assets/api-fPapljyb.js +0 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-U3yDRzKF.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-FgMHY1Pr.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-DxaiBwrD.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CHrfg3BX.js +0 -3
- package/dist/gateway/static/root/assets/button-CGlRPNzi.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DpYDPk_o.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-DMq-NBUQ.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-LsEiI9L5.js +0 -2
- package/dist/gateway/static/root/assets/cron-expression-B25FHn4w.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-CzVHO7z9.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-CXfnejTb.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-CxKwfncn.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CQTcIvlZ.js +0 -1
- package/dist/gateway/static/root/assets/home-page-B_uyfCGq.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-DXNfRmk9.js +0 -1
- package/dist/gateway/static/root/assets/index-BAqVpc1H.css +0 -1
- package/dist/gateway/static/root/assets/index-hlU8MUEz.js +0 -79
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-CgW5_XVP.js +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-C4h3qDRL.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-Goy_QHfL.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-DgQyGEpR.js +0 -1
- package/dist/gateway/static/root/assets/messages-C9h8SImu.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-lcZby9NY.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CDGPPI-W.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-CyAf_sK-.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BW5m_HhZ.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-B4JgwB0s.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-D5SmvlQ1.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DDALROy_.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BOHNZ-S3.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-wV056nz2.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-io4NzfJL.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CERFaxLj.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CtwUqvsE.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-CCKc67a-.js +0 -1
- package/dist/gateway/static/root/assets/theme-store-KfFEGMlp.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-DPyLgmWw.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-CcnGgH1n.js +0 -2
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-jEMtNIG8.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-CX4bcAD-.js +0 -6
- package/dist/src/extensions/when-context.d.ts +0 -6
- package/dist/src/extensions/when-context.js +0 -26
- package/dist/src/extensions/when-expression.d.ts +0 -11
- package/dist/src/extensions/when-expression.js +0 -213
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getAllModels, getAvailableModels, init_providers } from "../../../providers/index.js";
|
|
2
2
|
import { ActivationPlanner } from "../../../extensions/activation-planner.js";
|
|
3
3
|
import { mergeActivationContext } from "../../../extensions/activation-context.js";
|
|
4
|
+
import { validateExtensionConfig } from "../../../extensions/config-validation.js";
|
|
4
5
|
import { fetchRegistry, listExtensions, searchExtensions } from "../../../extensions/marketplace.js";
|
|
5
|
-
import { buildWhenContextSnapshot } from "../../../extensions/when-context.js";
|
|
6
6
|
import { createOAuthAsyncHandler } from "../oauth-async.js";
|
|
7
7
|
import { createOAuthHandler } from "../oauth.js";
|
|
8
8
|
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
@@ -265,22 +265,59 @@ function registerAuthRegistryExtensionsRoutes(authenticated, deps) {
|
|
|
265
265
|
});
|
|
266
266
|
authenticated.get("/api/extensions/:id/config", async (c) => {
|
|
267
267
|
const extensionId = c.req.param("id");
|
|
268
|
-
|
|
268
|
+
const configured = service.currentConfig.extensions?.[extensionId];
|
|
269
|
+
const config = configured && typeof configured === "object" && !Array.isArray(configured) ? configured : {};
|
|
270
|
+
return c.json(config);
|
|
269
271
|
});
|
|
270
272
|
authenticated.patch("/api/extensions/:id/config", async (c) => {
|
|
271
273
|
const extensionId = c.req.param("id");
|
|
272
274
|
const patch = await c.req.json().catch(() => null);
|
|
273
275
|
if (!patch || typeof patch !== "object" || Array.isArray(patch)) return c.json({ error: "Request body must be a JSON object" }, 400);
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
const loader = service.getExtensionLoader();
|
|
277
|
+
if (!loader) return c.json({ error: "Extensions unavailable" }, 503);
|
|
278
|
+
const extension = loader.discoverExtensions().find((entry) => entry.id === extensionId);
|
|
279
|
+
if (!extension) return c.json({ error: "Extension not found" }, 404);
|
|
280
|
+
const current = service.currentConfig.extensions?.[extensionId];
|
|
281
|
+
const config = {
|
|
282
|
+
...current && typeof current === "object" && !Array.isArray(current) ? current : {},
|
|
283
|
+
...patch
|
|
284
|
+
};
|
|
285
|
+
const validation = validateExtensionConfig(extension.manifest.configSchema, config);
|
|
286
|
+
if (validation.valid === false) return c.json({ error: `Invalid extension config: ${validation.reason}` }, 400);
|
|
287
|
+
const extensions = {
|
|
288
|
+
...service.currentConfig.extensions ?? {},
|
|
289
|
+
[extensionId]: config
|
|
290
|
+
};
|
|
291
|
+
const result = await service.updateConfig({ extensions });
|
|
292
|
+
if (!result.updated) return c.json({ error: result.error ?? "Failed to update config" }, 500);
|
|
278
293
|
return c.json({ ok: true });
|
|
279
294
|
});
|
|
280
|
-
authenticated.
|
|
281
|
-
const
|
|
282
|
-
const
|
|
283
|
-
|
|
295
|
+
authenticated.all("/api/extensions/:id/runtime/*", async (c) => {
|
|
296
|
+
const extensionId = c.req.param("id");
|
|
297
|
+
const prefix = `/api/extensions/${extensionId}/runtime`;
|
|
298
|
+
const path = c.req.path.slice(prefix.length) || "/";
|
|
299
|
+
const handler = service.getExtensionRegistry()?.getHttpRoute(extensionId, path);
|
|
300
|
+
if (!handler) return c.json({ error: "Extension route not found" }, 404);
|
|
301
|
+
const contentType = c.req.header("content-type") ?? "";
|
|
302
|
+
let body;
|
|
303
|
+
if (c.req.method !== "GET" && c.req.method !== "HEAD") body = contentType.includes("application/json") ? await c.req.json().catch(() => void 0) : await c.req.text().catch(() => void 0);
|
|
304
|
+
const response = await handler({
|
|
305
|
+
method: c.req.method,
|
|
306
|
+
url: c.req.url,
|
|
307
|
+
headers: c.req.header(),
|
|
308
|
+
body
|
|
309
|
+
});
|
|
310
|
+
const headers = new Headers(response.headers);
|
|
311
|
+
let responseBody = null;
|
|
312
|
+
if (response.body !== void 0) if (typeof response.body === "string" || response.body instanceof Uint8Array) responseBody = response.body;
|
|
313
|
+
else {
|
|
314
|
+
headers.set("Content-Type", headers.get("Content-Type") ?? "application/json; charset=utf-8");
|
|
315
|
+
responseBody = JSON.stringify(response.body);
|
|
316
|
+
}
|
|
317
|
+
return new Response(responseBody, {
|
|
318
|
+
status: response.status,
|
|
319
|
+
headers
|
|
320
|
+
});
|
|
284
321
|
});
|
|
285
322
|
authenticated.get("/api/marketplace", async (c) => {
|
|
286
323
|
const q = c.req.query("q");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { browserPairingInvitationPayloadSchema, devicePairingTargetKindSchema, formatBrowserPairingInvitation, formatMobilePairingInvitation } from "../../../../packages/gateway-contract/src/device-pairing.js";
|
|
2
2
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
3
|
import { listDevices, revokeDevice, rotateDeviceRefreshToken } from "../../../storage/sqlite/device-access-repository.js";
|
|
4
4
|
import { getGatewayIdentityPublicKeyRaw, getOrCreateGatewayIdentity, signGatewayPayload } from "../../../storage/sqlite/gateway-identity-repository.js";
|
|
@@ -23,9 +23,6 @@ const refreshRequestSchema = z.strictObject({
|
|
|
23
23
|
});
|
|
24
24
|
const pairingProbeSchema = z.strictObject({ pairingId: z.string().uuid() });
|
|
25
25
|
const pairingSetupSchema = z.strictObject({ targetKind: devicePairingTargetKindSchema });
|
|
26
|
-
function pairingPayload(input) {
|
|
27
|
-
return Buffer.from(JSON.stringify(devicePairingInvitationPayloadSchema.parse(input))).toString("base64url");
|
|
28
|
-
}
|
|
29
26
|
function registerDeviceAuthPublicRoutes(app, options) {
|
|
30
27
|
app.post("/api/gateway-identity/challenge", bodyLimit({ maxSize: 512 }), async (c) => {
|
|
31
28
|
const budget = buckets.identityChallenge().consume("gateway");
|
|
@@ -154,7 +151,14 @@ function registerDeviceRoutes(authenticated, deps) {
|
|
|
154
151
|
}, 409);
|
|
155
152
|
const setup = createDevicePairingSetup(routes, Date.now(), { targetKind: parsed.data.targetKind });
|
|
156
153
|
const identity = getOrCreateGatewayIdentity();
|
|
157
|
-
const
|
|
154
|
+
const invitation = setup.targetKind === "mobile" ? { universalLink: formatMobilePairingInvitation({
|
|
155
|
+
version: 4,
|
|
156
|
+
pairingToken: setup.token,
|
|
157
|
+
gatewayId: identity.id,
|
|
158
|
+
gatewayPublicKey: getGatewayIdentityPublicKeyRaw(identity),
|
|
159
|
+
origins: routes.map((route) => route.url),
|
|
160
|
+
expiresAt: setup.expiresAt
|
|
161
|
+
}) } : { browserInvitation: formatBrowserPairingInvitation(Buffer.from(JSON.stringify(browserPairingInvitationPayloadSchema.parse({
|
|
158
162
|
version: 3,
|
|
159
163
|
pairingToken: setup.token,
|
|
160
164
|
gatewayId: identity.id,
|
|
@@ -163,8 +167,7 @@ function registerDeviceRoutes(authenticated, deps) {
|
|
|
163
167
|
routes,
|
|
164
168
|
targetKind: setup.targetKind,
|
|
165
169
|
expiresAt: setup.expiresAt
|
|
166
|
-
});
|
|
167
|
-
const invitation = setup.targetKind === "mobile" ? { universalLink: `https://link.xopc.ai/connect#p=${encoded}` } : { browserInvitation: formatBrowserPairingInvitation(encoded) };
|
|
170
|
+
}))).toString("base64url")) };
|
|
168
171
|
return c.json({
|
|
169
172
|
ok: true,
|
|
170
173
|
setup: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { init_src } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
2
2
|
import { COMPUTER_DESCRIPTOR, COMPUTER_FRAME_MAX_BYTES, init_src as init_src$1 } from "../../../../packages/computer-control-contract/src/index.js";
|
|
3
|
+
import { REALTIME_CAPABILITIES } from "../../../../packages/realtime-protocol/src/index.js";
|
|
3
4
|
//#region src/gateway/hono/routes/endpoint-compatibility.ts
|
|
4
5
|
init_src$1();
|
|
5
6
|
init_src();
|
|
@@ -10,6 +11,11 @@ function registerEndpointCompatibilityRoutes(authenticated) {
|
|
|
10
11
|
ok: true,
|
|
11
12
|
payload: {
|
|
12
13
|
realtimeProtocolVersion: 2,
|
|
14
|
+
realtime: {
|
|
15
|
+
minVersion: 2,
|
|
16
|
+
maxVersion: 2,
|
|
17
|
+
capabilities: REALTIME_CAPABILITIES
|
|
18
|
+
},
|
|
13
19
|
endpointProtocolVersion: 2,
|
|
14
20
|
computerControl: COMPUTER_DESCRIPTOR,
|
|
15
21
|
computerFrameUploadMaxBytes: COMPUTER_FRAME_MAX_BYTES
|
|
@@ -1,39 +1,6 @@
|
|
|
1
1
|
//#region src/gateway/hono/routes/extension-gateway.ts
|
|
2
2
|
function registerExtensionGatewayRoutes(authenticated, deps) {
|
|
3
3
|
const { service } = deps;
|
|
4
|
-
const extensionRegistry = service.getExtensionRegistry?.();
|
|
5
|
-
if (extensionRegistry) {
|
|
6
|
-
const httpRoutes = extensionRegistry.httpRoutes;
|
|
7
|
-
for (const [path, handler] of httpRoutes) {
|
|
8
|
-
authenticated.post(path, async (c) => {
|
|
9
|
-
const response = await handler({
|
|
10
|
-
method: c.req.method,
|
|
11
|
-
url: c.req.url,
|
|
12
|
-
headers: c.req.header(),
|
|
13
|
-
body: await c.req.json().catch(() => ({}))
|
|
14
|
-
});
|
|
15
|
-
if (response) {
|
|
16
|
-
if (response.status) c.status(response.status);
|
|
17
|
-
if (response.headers) for (const [key, value] of Object.entries(response.headers)) c.header(key, String(value));
|
|
18
|
-
if (response.body !== void 0) return c.json(response.body);
|
|
19
|
-
}
|
|
20
|
-
return c.text("");
|
|
21
|
-
});
|
|
22
|
-
authenticated.get(path, async (c) => {
|
|
23
|
-
const response = await handler({
|
|
24
|
-
method: c.req.method,
|
|
25
|
-
url: c.req.url,
|
|
26
|
-
headers: c.req.header()
|
|
27
|
-
});
|
|
28
|
-
if (response) {
|
|
29
|
-
if (response.status) c.status(response.status);
|
|
30
|
-
if (response.headers) for (const [key, value] of Object.entries(response.headers)) c.header(key, String(value));
|
|
31
|
-
if (response.body !== void 0) return c.json(response.body);
|
|
32
|
-
}
|
|
33
|
-
return c.text("");
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
4
|
authenticated.post("/api/gateway/:method", async (c) => {
|
|
38
5
|
const method = c.req.param("method");
|
|
39
6
|
const params = await c.req.json().catch(() => ({}));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
2
1
|
import { ImportError } from "../../../imports/types.js";
|
|
3
2
|
import { isImportSource } from "../../../imports/sources.js";
|
|
4
3
|
import { ImportSelectionRepository } from "../../../storage/sqlite/import-selection-repository.js";
|
|
5
4
|
import { getLiveInventory, previewInventoryItem, publicInventory, scanProduct } from "../../../imports/inventory.js";
|
|
6
5
|
import { importSelection, listImportSources } from "../../../imports/productImport.js";
|
|
7
6
|
import { createRuntimeImportService } from "../../../imports/runtime.js";
|
|
7
|
+
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
//#region src/gateway/hono/routes/imports.ts
|
|
10
10
|
const selectionSchema = z.object({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readLocalAppAcceptanceConfig } from "../../../local-apps/acceptance.js";
|
|
2
|
-
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
3
2
|
import { LOCAL_APP_RUNTIME_BRIDGE_HASH, injectLocalAppRuntimeBridge } from "../../../local-apps/preview-runtime-bridge.js";
|
|
3
|
+
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
4
4
|
import { relative, resolve } from "node:path";
|
|
5
5
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
6
6
|
//#region src/gateway/hono/routes/local-apps.ts
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { realtimeClientKindSchema } from "../../../../packages/realtime-protocol/src/index.js";
|
|
1
|
+
import { REALTIME_CAPABILITIES, realtimeClientKindSchema } from "../../../../packages/realtime-protocol/src/index.js";
|
|
2
2
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/gateway/hono/routes/realtime.ts
|
|
5
5
|
const ticketRequestSchema = z.strictObject({
|
|
6
6
|
clientId: z.string().min(1).max(160),
|
|
7
|
-
clientKind: realtimeClientKindSchema
|
|
7
|
+
clientKind: realtimeClientKindSchema,
|
|
8
|
+
protocolVersion: z.number().int().positive()
|
|
8
9
|
});
|
|
9
10
|
function registerRealtimeRoutes(authenticated, deps) {
|
|
10
11
|
authenticated.post("/api/realtime/tickets", async (c) => {
|
|
@@ -16,16 +17,37 @@ function registerRealtimeRoutes(authenticated, deps) {
|
|
|
16
17
|
message: "Invalid realtime ticket request"
|
|
17
18
|
}
|
|
18
19
|
}, 400);
|
|
20
|
+
if (parsed.data.protocolVersion !== 2) {
|
|
21
|
+
const clientIsOlder = parsed.data.protocolVersion < 2;
|
|
22
|
+
return c.json({
|
|
23
|
+
ok: false,
|
|
24
|
+
error: {
|
|
25
|
+
code: clientIsOlder ? "CLIENT_UPDATE_REQUIRED" : "GATEWAY_UPDATE_REQUIRED",
|
|
26
|
+
message: clientIsOlder ? "Update the client to connect to this Gateway." : "Update the Gateway to connect this client.",
|
|
27
|
+
retryable: false,
|
|
28
|
+
clientProtocolVersion: parsed.data.protocolVersion,
|
|
29
|
+
gatewayProtocolVersion: 2
|
|
30
|
+
}
|
|
31
|
+
}, 426);
|
|
32
|
+
}
|
|
19
33
|
try {
|
|
20
34
|
const principal = getGatewayPrincipal(c);
|
|
35
|
+
const ticket = deps.service.realtime.tickets.issue(parsed.data.clientId, parsed.data.clientKind, {
|
|
36
|
+
principalId: principal.principalId,
|
|
37
|
+
...principal.deviceId ? { deviceId: principal.deviceId } : {},
|
|
38
|
+
...principal.accessSessionId ? { accessSessionId: principal.accessSessionId } : {},
|
|
39
|
+
scopes: principal.scopes
|
|
40
|
+
});
|
|
21
41
|
return c.json({
|
|
22
42
|
ok: true,
|
|
23
|
-
payload:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
43
|
+
payload: {
|
|
44
|
+
...ticket,
|
|
45
|
+
realtime: {
|
|
46
|
+
minVersion: 2,
|
|
47
|
+
maxVersion: 2,
|
|
48
|
+
capabilities: REALTIME_CAPABILITIES
|
|
49
|
+
}
|
|
50
|
+
}
|
|
29
51
|
});
|
|
30
52
|
} catch (error) {
|
|
31
53
|
return c.json({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, init_package_version } from "../../../package-version.js";
|
|
2
2
|
import { loadConfig } from "../../../config/loader.js";
|
|
3
3
|
import "../../../config/index.js";
|
|
4
|
-
import { acquireUpdateLock } from "../../../infra/update-lock.js";
|
|
5
4
|
import { normalizeUpdateChannel } from "../../../infra/update-channels.js";
|
|
5
|
+
import { acquireUpdateLock } from "../../../infra/update-lock.js";
|
|
6
|
+
import { formatUpdateApiResult, runGatewayUpdateWithPostSteps } from "../../../infra/update-runner.js";
|
|
6
7
|
import { getUpdateAvailable, runGatewayUpdateCheck } from "../../../infra/update-startup.js";
|
|
7
8
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
8
|
-
import { formatUpdateApiResult, runGatewayUpdateWithPostSteps } from "../../../infra/update-runner.js";
|
|
9
9
|
import { streamSSE } from "hono/streaming";
|
|
10
10
|
//#region src/gateway/hono/routes/update.ts
|
|
11
11
|
init_package_version();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createCollaborationRule, getCollaborationRule, listCollaborationRules, setCollaborationRuleStatus } from "../../../storage/sqlite/collaboration-rule-repository.js";
|
|
2
|
-
import { getKnowledgeItem, listKnowledgeItems,
|
|
2
|
+
import { KnowledgeReviewConflictError, getKnowledgeItem, listKnowledgeItems, reviewKnowledgeItem, searchKnowledgeItems } from "../../../knowledge-memory/repository.js";
|
|
3
3
|
import "../../../knowledge-memory/index.js";
|
|
4
4
|
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus } from "../../../user-model/goals.js";
|
|
5
5
|
import { getAssertionSlot, getUserAssertion, listUserAssertionSources, listUserAssertions, reconcileAssertion, setAssertionStatus } from "../../../user-model/repository.js";
|
|
@@ -83,6 +83,12 @@ const GOAL_STATUSES = new Set([
|
|
|
83
83
|
"achieved",
|
|
84
84
|
"abandoned"
|
|
85
85
|
]);
|
|
86
|
+
const KNOWLEDGE_REVIEW_ACTIONS = new Set([
|
|
87
|
+
"approve",
|
|
88
|
+
"edit_and_approve",
|
|
89
|
+
"reject",
|
|
90
|
+
"archive"
|
|
91
|
+
]);
|
|
86
92
|
const KNOWLEDGE_STATUSES = new Set([
|
|
87
93
|
"candidate",
|
|
88
94
|
"active",
|
|
@@ -399,12 +405,25 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
399
405
|
const item = getKnowledgeItem(c.req.param("id"));
|
|
400
406
|
return item ? c.json({ item }) : c.json({ error: "Knowledge item not found" }, 404);
|
|
401
407
|
});
|
|
402
|
-
authenticated.
|
|
408
|
+
authenticated.post("/api/knowledge-memory/:id/review", write, async (c) => {
|
|
403
409
|
const input = await body(c);
|
|
404
|
-
const
|
|
405
|
-
if (!
|
|
406
|
-
|
|
407
|
-
|
|
410
|
+
const action = String(input?.action ?? "");
|
|
411
|
+
if (!KNOWLEDGE_REVIEW_ACTIONS.has(action)) return c.json({ error: "Invalid knowledge review action" }, 400);
|
|
412
|
+
if (input?.expectedStatus !== void 0 && !KNOWLEDGE_STATUSES.has(String(input.expectedStatus))) return c.json({ error: "Invalid expected knowledge status" }, 400);
|
|
413
|
+
if (input?.content !== void 0 && action !== "edit_and_approve") return c.json({ error: "Content can only be changed while editing and approving knowledge" }, 400);
|
|
414
|
+
try {
|
|
415
|
+
const item = reviewKnowledgeItem({
|
|
416
|
+
id: c.req.param("id"),
|
|
417
|
+
action,
|
|
418
|
+
actor: "user",
|
|
419
|
+
reason: typeof input?.reason === "string" && input.reason.trim() ? input.reason : `Knowledge ${action} by user.`,
|
|
420
|
+
...typeof input?.expectedStatus === "string" ? { expectedStatus: input.expectedStatus } : {},
|
|
421
|
+
...typeof input?.content === "string" ? { content: input.content } : {}
|
|
422
|
+
});
|
|
423
|
+
return item ? c.json({ item }) : c.json({ error: "Knowledge item not found" }, 404);
|
|
424
|
+
} catch (error) {
|
|
425
|
+
return c.json({ error: errorMessage(error) }, error instanceof KnowledgeReviewConflictError ? 409 : 400);
|
|
426
|
+
}
|
|
408
427
|
});
|
|
409
428
|
authenticated.get("/api/memory-maintenance/runs", (c) => c.json({ runs: listMemoryMaintenanceRuns(Math.max(1, Math.min(100, Number(c.req.query("limit") ?? 20)))) }));
|
|
410
429
|
authenticated.get("/api/turns/:turnId/execution-context", (c) => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { GatewayLockError, acquireGatewayLock, init_lock } from "./lock.js";
|
|
1
2
|
import { buildDefaultCorsOrigins, isAllInterfacesHost, isLoopbackHost, resolveEffectiveGatewayPort, resolveGatewayServiceListenPort } from "./host.js";
|
|
2
3
|
import { defaultGatewayBindMode, isContainerEnvironment, resolveGatewayBindHost, resolveGatewayBindHostSync, resolveGatewayBindMode, resolveGatewayEffectiveHost } from "../config/gateway-bind.js";
|
|
4
|
+
import { checkPortAvailable, forceFreePortAndWait, listPortListeners, parseLsofOutput } from "./ports.js";
|
|
3
5
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
4
6
|
import { resolveGatewayListenHost, resolveGatewayListenPlan } from "./listen.js";
|
|
5
7
|
import { buckets } from "./rate-limit/buckets.js";
|
|
@@ -10,10 +12,11 @@ import { restartGatewayProcessWithFreshPid } from "./respawn.js";
|
|
|
10
12
|
import { GatewayService } from "./service.js";
|
|
11
13
|
import { createHonoApp } from "./hono/app.js";
|
|
12
14
|
import { GatewayServer } from "./server.js";
|
|
13
|
-
import { GatewayLockError, acquireGatewayLock } from "./lock.js";
|
|
14
15
|
import { runGatewayLoop } from "./run-loop.js";
|
|
15
|
-
import { checkPortAvailable, forceFreePortAndWait, listPortListeners, parseLsofOutput } from "./ports.js";
|
|
16
16
|
import { apiError, apiOk } from "./protocol.js";
|
|
17
17
|
import "./hono/index.js";
|
|
18
18
|
import { assertSecureGatewayHttpUrl, assertSecureWebSocketUrl, isInsecurePrivateWsAllowed, isSecureWebSocketUrl } from "./ws-security.js";
|
|
19
|
+
//#region src/gateway/index.ts
|
|
20
|
+
init_lock();
|
|
21
|
+
//#endregion
|
|
19
22
|
export { GatewayLockError, GatewayServer, GatewayService, acquireGatewayLock, apiError, apiOk, assertGatewayAuthConfigured, assertGatewayRuntimeConfig, assertSecureGatewayHttpUrl, assertSecureWebSocketUrl, buckets, buildDefaultCorsOrigins, checkPortAvailable, createHonoApp, defaultGatewayBindMode, extractToken, forceFreePortAndWait, isAllInterfacesHost, isContainerEnvironment, isGatewayStrictSecurityEnabled, isInsecurePrivateWsAllowed, isLoopbackHost, isSecureWebSocketUrl, listPortListeners, parseLsofOutput, resolveEffectiveGatewayPort, resolveGatewayAuth, resolveGatewayBindHost, resolveGatewayBindHostSync, resolveGatewayBindMode, resolveGatewayEffectiveHost, resolveGatewayListenHost, resolveGatewayListenPlan, resolveGatewayServiceListenPort, restartGatewayProcessWithFreshPid, runGatewayLoop, validateToken };
|
|
@@ -16,4 +16,6 @@ export declare class GatewayLockError extends Error {
|
|
|
16
16
|
readonly cause?: unknown;
|
|
17
17
|
constructor(message: string, cause?: unknown);
|
|
18
18
|
}
|
|
19
|
+
export declare function resolveGatewayLockPath(configPath: string): string;
|
|
20
|
+
export declare function isGatewayConfigLockedByAnotherProcessSync(configPath: string, currentPid?: number): boolean;
|
|
19
21
|
export declare function acquireGatewayLock(configPath: string, opts?: GatewayLockOptions): Promise<GatewayLockHandle>;
|
package/dist/src/gateway/lock.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
1
2
|
import path from "node:path";
|
|
2
3
|
import fs from "node:fs";
|
|
3
4
|
import { createHash } from "node:crypto";
|
|
@@ -8,24 +9,25 @@ import { homedir } from "os";
|
|
|
8
9
|
/**
|
|
9
10
|
* Gateway Lock - Prevents multiple gateway instances from running simultaneously
|
|
10
11
|
*/
|
|
11
|
-
const DEFAULT_TIMEOUT_MS = 5e3;
|
|
12
|
-
const DEFAULT_POLL_INTERVAL_MS = 100;
|
|
13
|
-
const DEFAULT_STALE_MS = 3e4;
|
|
14
|
-
const DEFAULT_PORT_PROBE_TIMEOUT_MS = 1e3;
|
|
15
|
-
var GatewayLockError = class extends Error {
|
|
16
|
-
constructor(message, cause) {
|
|
17
|
-
super(message);
|
|
18
|
-
this.cause = cause;
|
|
19
|
-
this.name = "GatewayLockError";
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
12
|
function resolveLockDir() {
|
|
23
13
|
return path.join(homedir(), ".xopc", "locks");
|
|
24
14
|
}
|
|
25
|
-
function
|
|
15
|
+
function resolveGatewayLockPath(configPath) {
|
|
26
16
|
const hash = createHash("sha256").update(configPath).digest("hex").slice(0, 8);
|
|
27
17
|
return path.join(resolveLockDir(), `gateway.${hash}.lock`);
|
|
28
18
|
}
|
|
19
|
+
function isGatewayConfigLockedByAnotherProcessSync(configPath, currentPid = process.pid) {
|
|
20
|
+
const lockPath = resolveGatewayLockPath(configPath);
|
|
21
|
+
try {
|
|
22
|
+
const parsed = JSON.parse(fs.readFileSync(lockPath, "utf8"));
|
|
23
|
+
if (typeof parsed.pid !== "number" || parsed.pid === currentPid || parsed.configPath !== configPath) return false;
|
|
24
|
+
if (!isPidAlive(parsed.pid)) return false;
|
|
25
|
+
if (process.platform !== "linux" || !Number.isFinite(parsed.startTime)) return true;
|
|
26
|
+
return readLinuxStartTime(parsed.pid) === parsed.startTime;
|
|
27
|
+
} catch {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
29
31
|
async function checkPortFree(port, host = "127.0.0.1") {
|
|
30
32
|
return new Promise((resolve) => {
|
|
31
33
|
const socket = net.createConnection({
|
|
@@ -104,7 +106,7 @@ async function acquireGatewayLock(configPath, opts = {}) {
|
|
|
104
106
|
const pollIntervalMs = opts.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;
|
|
105
107
|
const staleMs = opts.staleMs ?? DEFAULT_STALE_MS;
|
|
106
108
|
const port = opts.port;
|
|
107
|
-
const lockPath =
|
|
109
|
+
const lockPath = resolveGatewayLockPath(configPath);
|
|
108
110
|
await fs$1.mkdir(path.dirname(lockPath), { recursive: true });
|
|
109
111
|
const startedAt = Date.now();
|
|
110
112
|
let lastPayload = null;
|
|
@@ -160,5 +162,20 @@ async function acquireGatewayLock(configPath, opts = {}) {
|
|
|
160
162
|
}
|
|
161
163
|
throw new GatewayLockError(`Gateway already running${lastPayload?.pid ? ` (pid ${lastPayload.pid})` : ""}; lock timeout after ${timeoutMs}ms`);
|
|
162
164
|
}
|
|
165
|
+
var DEFAULT_TIMEOUT_MS, DEFAULT_POLL_INTERVAL_MS, DEFAULT_STALE_MS, DEFAULT_PORT_PROBE_TIMEOUT_MS, GatewayLockError;
|
|
166
|
+
var init_lock = __esmMin((() => {
|
|
167
|
+
DEFAULT_TIMEOUT_MS = 5e3;
|
|
168
|
+
DEFAULT_POLL_INTERVAL_MS = 100;
|
|
169
|
+
DEFAULT_STALE_MS = 3e4;
|
|
170
|
+
DEFAULT_PORT_PROBE_TIMEOUT_MS = 1e3;
|
|
171
|
+
GatewayLockError = class extends Error {
|
|
172
|
+
constructor(message, cause) {
|
|
173
|
+
super(message);
|
|
174
|
+
this.cause = cause;
|
|
175
|
+
this.name = "GatewayLockError";
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
}));
|
|
163
179
|
//#endregion
|
|
164
|
-
|
|
180
|
+
init_lock();
|
|
181
|
+
export { GatewayLockError, acquireGatewayLock, init_lock, isGatewayConfigLockedByAnotherProcessSync, resolveGatewayLockPath };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { acquireGatewayLock, init_lock } from "./lock.js";
|
|
1
2
|
import { loadConfig } from "../config/loader.js";
|
|
2
3
|
import "../config/index.js";
|
|
3
4
|
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
5
|
+
import { consumeGatewayRestartIntentSync, consumeGatewaySigusr1RestartAuthorization, isGatewaySigusr1RestartExternallyAllowed, resetGatewayRestartStateForInProcessRestart, scheduleGatewaySigusr1Restart, setGatewaySigusr1RestartPolicy } from "../infra/restart.js";
|
|
4
6
|
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
5
7
|
import { restartGatewayProcessWithFreshPid } from "./respawn.js";
|
|
6
|
-
import { acquireGatewayLock } from "./lock.js";
|
|
7
|
-
import { consumeGatewayRestartIntentSync, consumeGatewaySigusr1RestartAuthorization, isGatewaySigusr1RestartExternallyAllowed, resetGatewayRestartStateForInProcessRestart, scheduleGatewaySigusr1Restart, setGatewaySigusr1RestartPolicy } from "../infra/restart.js";
|
|
8
8
|
//#region src/gateway/run-loop.ts
|
|
9
9
|
/**
|
|
10
10
|
* Gateway Run Loop - Core run loop for gateway process management
|
|
11
11
|
*/
|
|
12
|
+
init_lock();
|
|
12
13
|
async function runGatewayLoop(opts) {
|
|
13
14
|
runBootstrapMigrationsSync(opts.configPath);
|
|
14
15
|
setGatewaySigusr1RestartPolicy({ allowExternal: isRestartEnabled(loadConfig(opts.configPath)) });
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export type GatewayScope
|
|
3
|
-
export declare const DEFAULT_MOBILE_SCOPES: readonly GatewayScope[];
|
|
4
|
-
export declare const DEFAULT_BROWSER_EXTENSION_SCOPES: readonly GatewayScope[];
|
|
5
|
-
export declare function isGatewayScope(value: unknown): value is GatewayScope;
|
|
1
|
+
import { DEFAULT_BROWSER_EXTENSION_SCOPES, DEFAULT_MOBILE_SCOPES, GATEWAY_SCOPES, isGatewayScope, type GatewayScope } from '@xopcai/gateway-contract';
|
|
2
|
+
export { DEFAULT_BROWSER_EXTENSION_SCOPES, DEFAULT_MOBILE_SCOPES, GATEWAY_SCOPES, isGatewayScope, type GatewayScope, };
|
|
6
3
|
export declare function parseGatewayScopes(value: string): GatewayScope[];
|
|
7
4
|
export declare function requiredGatewayScope(method: string, path: string): GatewayScope;
|
|
8
5
|
export declare function hasGatewayScope(granted: readonly GatewayScope[], required: GatewayScope): boolean;
|
|
@@ -1,49 +1,7 @@
|
|
|
1
|
+
import { DEFAULT_BROWSER_EXTENSION_SCOPES, DEFAULT_MOBILE_SCOPES, GATEWAY_SCOPES, isGatewayScope } from "../../../packages/gateway-contract/src/gateway-scopes.js";
|
|
2
|
+
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
1
3
|
//#region src/gateway/security/gateway-scopes.ts
|
|
2
|
-
|
|
3
|
-
"voice.configure",
|
|
4
|
-
"gateway.status",
|
|
5
|
-
"agents.read",
|
|
6
|
-
"agents.run",
|
|
7
|
-
"sessions.read",
|
|
8
|
-
"sessions.write",
|
|
9
|
-
"workspace.read",
|
|
10
|
-
"workspace.write",
|
|
11
|
-
"tasks.read",
|
|
12
|
-
"tasks.write",
|
|
13
|
-
"automations.read",
|
|
14
|
-
"automations.write",
|
|
15
|
-
"notifications.self",
|
|
16
|
-
"device.self",
|
|
17
|
-
"gateway.admin"
|
|
18
|
-
];
|
|
19
|
-
const KNOWN_GATEWAY_SCOPES = new Set(GATEWAY_SCOPES);
|
|
20
|
-
const DEFAULT_MOBILE_SCOPES = [
|
|
21
|
-
"voice.configure",
|
|
22
|
-
"gateway.status",
|
|
23
|
-
"agents.read",
|
|
24
|
-
"agents.run",
|
|
25
|
-
"sessions.read",
|
|
26
|
-
"sessions.write",
|
|
27
|
-
"workspace.read",
|
|
28
|
-
"workspace.write",
|
|
29
|
-
"tasks.read",
|
|
30
|
-
"tasks.write",
|
|
31
|
-
"automations.read",
|
|
32
|
-
"automations.write",
|
|
33
|
-
"notifications.self",
|
|
34
|
-
"device.self"
|
|
35
|
-
];
|
|
36
|
-
const DEFAULT_BROWSER_EXTENSION_SCOPES = [
|
|
37
|
-
"gateway.status",
|
|
38
|
-
"agents.read",
|
|
39
|
-
"agents.run",
|
|
40
|
-
"sessions.read",
|
|
41
|
-
"sessions.write",
|
|
42
|
-
"device.self"
|
|
43
|
-
];
|
|
44
|
-
function isGatewayScope(value) {
|
|
45
|
-
return typeof value === "string" && KNOWN_GATEWAY_SCOPES.has(value);
|
|
46
|
-
}
|
|
4
|
+
init_src();
|
|
47
5
|
function parseGatewayScopes(value) {
|
|
48
6
|
const parsed = JSON.parse(value);
|
|
49
7
|
if (!Array.isArray(parsed) || !parsed.every(isGatewayScope)) throw new Error("Stored device scopes are invalid");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DEFAULT_MOBILE_SCOPES, GATEWAY_SCOPES,
|
|
1
|
+
import { DEFAULT_MOBILE_SCOPES, GATEWAY_SCOPES, isGatewayScope } from "../../../packages/gateway-contract/src/gateway-scopes.js";
|
|
2
|
+
import { hasGatewayScope, parseGatewayScopes, requiredGatewayScope } from "./gateway-scopes.js";
|
|
2
3
|
import { safeEqualSecret } from "./secret-equal.js";
|
|
3
4
|
import { KNOWN_WEAK_GATEWAY_TOKEN_PLACEHOLDERS, assertGatewayAuthNotKnownWeak } from "./known-weak-secrets.js";
|
|
4
5
|
import { auditGatewayConfig, collectGatewayConfigFindings, collectGatewaySecurityFindings, collectGatewayStartupGuardFindings } from "./audit.js";
|
|
@@ -6,9 +6,9 @@ import { init_providers } from "../../providers/index.js";
|
|
|
6
6
|
import { disposeAllSessionMcpRuntimes } from "../../agent/mcp/bundle-mcp-runtime.js";
|
|
7
7
|
import { reloadImageGenerationProviders } from "../../agent/image/generation/provider-registry.js";
|
|
8
8
|
import "../../agent/mcp/bundle-mcp-tools.js";
|
|
9
|
-
import { validateComputerModelChanges } from "../../computer/model-config.js";
|
|
10
9
|
import { ConfigHotReloader } from "../../config/reload.js";
|
|
11
10
|
import "../../config/index.js";
|
|
11
|
+
import { validateComputerModelChanges } from "../../computer/model-config.js";
|
|
12
12
|
import { computeBundledExtensionExtensionsPatch } from "../../extensions/bundled-extension-activation.js";
|
|
13
13
|
import { sanitizeTunnelConfig } from "../../tunnel/tunnel-config.js";
|
|
14
14
|
//#region src/gateway/service/config-coordinator.ts
|
|
@@ -51,6 +51,7 @@ import { ExtensionLoader } from "../extensions/loader.js";
|
|
|
51
51
|
import "../extensions/index.js";
|
|
52
52
|
import { MessageBus, MessageBusShutdownError } from "../infra/bus/queue.js";
|
|
53
53
|
import "../infra/bus/index.js";
|
|
54
|
+
import { collectMediaUrisFromMessages, deleteMediaUris } from "../media/session-references.js";
|
|
54
55
|
import { AgentService } from "../agent/service.js";
|
|
55
56
|
import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
56
57
|
import { setPairingBroadcastSink } from "../channels/pairing/pairing-events.js";
|
|
@@ -65,18 +66,21 @@ import { ConnectionRecoveryService } from "../connectors/connection-recovery-ser
|
|
|
65
66
|
import { startConnectorLearningCoordinator } from "../connectors/learning-coordinator.js";
|
|
66
67
|
import { ConnectedSourceChangePublisher } from "../connectors/source-change-publisher.js";
|
|
67
68
|
import { startConnectorSupervisor } from "../connectors/supervisor.js";
|
|
69
|
+
import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
|
|
70
|
+
import "../endpoint-tools/index.js";
|
|
68
71
|
import { DiscussionService } from "../discussions/service.js";
|
|
69
72
|
import { DiscussionOrganizer } from "../discussions/organizer.js";
|
|
70
73
|
import { DiscussionLiveWorker } from "../discussions/live-worker.js";
|
|
71
74
|
import { DiscussionOrganizerWorker } from "../discussions/organizer-worker.js";
|
|
72
75
|
import { DiscussionSealer } from "../discussions/sealer.js";
|
|
73
76
|
import "../discussions/index.js";
|
|
74
|
-
import {
|
|
75
|
-
import "../
|
|
77
|
+
import { createBackgroundTask } from "../infra/background-task.js";
|
|
78
|
+
import { scheduleGatewayUpdateCheck } from "../infra/update-startup.js";
|
|
79
|
+
import { LocalAppService } from "../local-apps/service.js";
|
|
80
|
+
import "../local-apps/index.js";
|
|
76
81
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
77
82
|
import { prepareAutomationAgentSession } from "./automation-agent-session.js";
|
|
78
83
|
import { stopTailscaleExposure } from "./tailscale-lifecycle.js";
|
|
79
|
-
import { createBackgroundTask } from "../infra/background-task.js";
|
|
80
84
|
import { buildTaskAgentContext } from "../agent/source-context/task-context.js";
|
|
81
85
|
import { deliverProactiveCard } from "../proactive/inbox/delivery.js";
|
|
82
86
|
import { WorkDiscoveryService } from "../work-discovery/service.js";
|
|
@@ -106,11 +110,8 @@ import { assertGatewayRuntimeConfig } from "./runtime-config.js";
|
|
|
106
110
|
import { auditGatewayConfig } from "./security/audit.js";
|
|
107
111
|
import { getXopcCloudCatalogCoordinator } from "../providers/xopc-cloud-catalog-coordinator.js";
|
|
108
112
|
import { ModelCatalogSyncService } from "../providers/model-catalog-sync-service.js";
|
|
109
|
-
import { collectMediaUrisFromMessages, deleteMediaUris } from "../media/session-references.js";
|
|
110
113
|
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
111
114
|
import { NotificationService } from "../notifications/service.js";
|
|
112
|
-
import { LocalAppService } from "../local-apps/service.js";
|
|
113
|
-
import "../local-apps/index.js";
|
|
114
115
|
import { createRuntimeBrowserAutomationService } from "../browser/automations/runtime-service.js";
|
|
115
116
|
import "../browser/automations/index.js";
|
|
116
117
|
import { mapProductEventToProactive } from "../proactive/events/product-event-bridge.js";
|
|
@@ -120,7 +121,6 @@ import { ProactiveWorker } from "../proactive/execution/worker.js";
|
|
|
120
121
|
import { ProactiveTemporalWorker } from "../proactive/temporal/worker.js";
|
|
121
122
|
import { ProactiveInboxWorker } from "../proactive/inbox/worker.js";
|
|
122
123
|
import "../proactive/index.js";
|
|
123
|
-
import { scheduleGatewayUpdateCheck } from "../infra/update-startup.js";
|
|
124
124
|
import { resolveChannelConnectDeferSet } from "./resolve-channel-connect-defer.js";
|
|
125
125
|
import { restartGatewayProcessWithFreshPid } from "./respawn.js";
|
|
126
126
|
import { GatewaySessionsApi } from "./service/sessions-api.js";
|
|
@@ -882,6 +882,7 @@ var GatewayService = class {
|
|
|
882
882
|
if (!this.extensionLoader) return;
|
|
883
883
|
try {
|
|
884
884
|
await this.extensionLoader.loadByActivationPlan({ phase: "startup" });
|
|
885
|
+
await this.extensionLoader.startServices();
|
|
885
886
|
this.registerExtensionChannelPlugins();
|
|
886
887
|
const reg = this.extensionLoader.getRegistry();
|
|
887
888
|
log.debug({
|
|
@@ -915,6 +916,7 @@ var GatewayService = class {
|
|
|
915
916
|
config: {}
|
|
916
917
|
};
|
|
917
918
|
await this.extensionLoader.loadExtension(extensionConfig);
|
|
919
|
+
await this.extensionLoader.startServices();
|
|
918
920
|
this.registerExtensionChannelPlugins();
|
|
919
921
|
if (!this.channelManager.getPlugin(channelId)) return;
|
|
920
922
|
await this.channelManager.initializeChannel(channelId);
|
|
@@ -924,6 +926,7 @@ var GatewayService = class {
|
|
|
924
926
|
if (!this.extensionLoader) return;
|
|
925
927
|
try {
|
|
926
928
|
await this.extensionLoader.loadByActivationPlan({ phase: "deferred" });
|
|
929
|
+
await this.extensionLoader.startServices();
|
|
927
930
|
this.registerExtensionChannelPlugins();
|
|
928
931
|
log.debug("Deferred-phase extensions loaded");
|
|
929
932
|
} catch (err) {
|
|
@@ -1311,6 +1314,7 @@ var GatewayService = class {
|
|
|
1311
1314
|
this.lastChannelConnectDeferMode = "auto";
|
|
1312
1315
|
this.lastChannelConnectDeferSource = "off";
|
|
1313
1316
|
await this.channelManager.stop();
|
|
1317
|
+
await this.extensionLoader?.shutdown();
|
|
1314
1318
|
await this.automationService.stop();
|
|
1315
1319
|
this.stopAutomationProductEventBridge?.();
|
|
1316
1320
|
this.stopAutomationProductEventBridge = null;
|