@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,6 +1,80 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region packages/gateway-contract/src/device-pairing.ts
|
|
4
|
+
function encodeBase64Url(bytes) {
|
|
5
|
+
let result = "";
|
|
6
|
+
for (let index = 0; index < bytes.length; index += 3) {
|
|
7
|
+
const a = bytes[index] ?? 0;
|
|
8
|
+
const b = bytes[index + 1] ?? 0;
|
|
9
|
+
const c = bytes[index + 2] ?? 0;
|
|
10
|
+
result += BASE64URL_ALPHABET[a >> 2];
|
|
11
|
+
result += BASE64URL_ALPHABET[(a & 3) << 4 | b >> 4];
|
|
12
|
+
if (index + 1 < bytes.length) result += BASE64URL_ALPHABET[(b & 15) << 2 | c >> 6];
|
|
13
|
+
if (index + 2 < bytes.length) result += BASE64URL_ALPHABET[c & 63];
|
|
14
|
+
}
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
function decodeBase64Url(value) {
|
|
18
|
+
if (!/^[A-Za-z0-9_-]*$/.test(value) || value.length % 4 === 1) throw new Error("Mobile pairing invitation is malformed");
|
|
19
|
+
const output = [];
|
|
20
|
+
let accumulator = 0;
|
|
21
|
+
let bits = 0;
|
|
22
|
+
for (const character of value) {
|
|
23
|
+
accumulator = accumulator << 6 | BASE64URL_ALPHABET.indexOf(character);
|
|
24
|
+
bits += 6;
|
|
25
|
+
if (bits >= 8) {
|
|
26
|
+
bits -= 8;
|
|
27
|
+
output.push(accumulator >> bits & 255);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const bytes = Uint8Array.from(output);
|
|
31
|
+
if (encodeBase64Url(bytes) !== value) throw new Error("Mobile pairing invitation is malformed");
|
|
32
|
+
return bytes;
|
|
33
|
+
}
|
|
34
|
+
function uuidToBytes(uuid) {
|
|
35
|
+
const hex = uuid.replaceAll("-", "");
|
|
36
|
+
if (!/^[0-9a-f]{32}$/i.test(hex)) throw new Error("Mobile pairing UUID is malformed");
|
|
37
|
+
return Uint8Array.from({ length: 16 }, (_, index) => Number.parseInt(hex.slice(index * 2, index * 2 + 2), 16));
|
|
38
|
+
}
|
|
39
|
+
function asciiBytes(value) {
|
|
40
|
+
const bytes = Uint8Array.from(value, (character) => character.charCodeAt(0));
|
|
41
|
+
if (bytes.some((byte) => byte < 33 || byte > 126) || bytes.length !== value.length) throw new Error("Mobile pairing origin must be ASCII");
|
|
42
|
+
return bytes;
|
|
43
|
+
}
|
|
44
|
+
function formatMobilePairingInvitation(input) {
|
|
45
|
+
const invitation = mobilePairingInvitationSchema.parse(input);
|
|
46
|
+
const token = MOBILE_PAIRING_TOKEN.exec(invitation.pairingToken);
|
|
47
|
+
if (!token) throw new Error("Mobile pairing token is malformed");
|
|
48
|
+
const secret = decodeBase64Url(token[2]);
|
|
49
|
+
const publicKey = decodeBase64Url(invitation.gatewayPublicKey);
|
|
50
|
+
if (secret.length !== 32 || publicKey.length !== 32) throw new Error("Mobile pairing key is malformed");
|
|
51
|
+
const expiresAtSeconds = Math.floor(invitation.expiresAt / 1e3);
|
|
52
|
+
if (expiresAtSeconds > 4294967295) throw new Error("Mobile pairing expiry is out of range");
|
|
53
|
+
const origins = invitation.origins.map(asciiBytes);
|
|
54
|
+
if (origins.some((origin) => origin.length > 65535)) throw new Error("Mobile pairing origin is too long");
|
|
55
|
+
const bytes = new Uint8Array(MOBILE_INVITATION_FIXED_BYTES + origins.reduce((sum, origin) => sum + 2 + origin.length, 0));
|
|
56
|
+
const view = new DataView(bytes.buffer);
|
|
57
|
+
let offset = 0;
|
|
58
|
+
bytes[offset++] = 4;
|
|
59
|
+
bytes.set(uuidToBytes(token[1]), offset);
|
|
60
|
+
offset += 16;
|
|
61
|
+
bytes.set(secret, offset);
|
|
62
|
+
offset += 32;
|
|
63
|
+
bytes.set(uuidToBytes(invitation.gatewayId), offset);
|
|
64
|
+
offset += 16;
|
|
65
|
+
bytes.set(publicKey, offset);
|
|
66
|
+
offset += 32;
|
|
67
|
+
view.setUint32(offset, expiresAtSeconds);
|
|
68
|
+
offset += 4;
|
|
69
|
+
bytes[offset++] = origins.length;
|
|
70
|
+
for (const origin of origins) {
|
|
71
|
+
view.setUint16(offset, origin.length);
|
|
72
|
+
offset += 2;
|
|
73
|
+
bytes.set(origin, offset);
|
|
74
|
+
offset += origin.length;
|
|
75
|
+
}
|
|
76
|
+
return `${MOBILE_PAIRING_INVITATION_PREFIX}${encodeBase64Url(bytes)}`;
|
|
77
|
+
}
|
|
4
78
|
/** Browser invitations are opaque clipboard values, not navigable web links. */
|
|
5
79
|
function formatBrowserPairingInvitation(encodedPayload) {
|
|
6
80
|
if (!/^[A-Za-z0-9_-]+$/.test(encodedPayload)) throw new Error("Browser pairing payload is invalid");
|
|
@@ -16,8 +90,9 @@ function buildDevicePairingProof(action, body) {
|
|
|
16
90
|
const { signature: _signature, ...payload } = body;
|
|
17
91
|
return `xopc-device-pairing-v3\nPOST\n${action}\n${canonical(payload)}`;
|
|
18
92
|
}
|
|
19
|
-
var BROWSER_PAIRING_INVITATION_PREFIX, devicePairingTargetKindSchema, devicePlatformSchema, devicePairingRouteSchema,
|
|
93
|
+
var MOBILE_PAIRING_INVITATION_PREFIX, BROWSER_PAIRING_INVITATION_PREFIX, devicePairingTargetKindSchema, devicePlatformSchema, devicePairingRouteSchema, browserPairingInvitationPayloadSchema, secureMobileOriginSchema, mobilePairingInvitationSchema, BASE64URL_ALPHABET, MOBILE_PAIRING_TOKEN, MOBILE_INVITATION_FIXED_BYTES, devicePairingKeySchema, devicePairingDeviceSchema, initialDeviceRefreshTokenSchema, devicePairingProofSchema, devicePairingRequestSchema, devicePairingCompleteSchema;
|
|
20
94
|
var init_device_pairing = __esmMin((() => {
|
|
95
|
+
MOBILE_PAIRING_INVITATION_PREFIX = "https://link.xopc.ai/c#";
|
|
21
96
|
BROWSER_PAIRING_INVITATION_PREFIX = `XOPC-BROWSER-INVITE-V1:`;
|
|
22
97
|
devicePairingTargetKindSchema = z.enum(["mobile", "browser"]);
|
|
23
98
|
devicePlatformSchema = z.enum([
|
|
@@ -44,22 +119,40 @@ var init_device_pairing = __esmMin((() => {
|
|
|
44
119
|
message: "Pairing route must be a secure origin"
|
|
45
120
|
});
|
|
46
121
|
});
|
|
47
|
-
|
|
122
|
+
browserPairingInvitationPayloadSchema = z.strictObject({
|
|
48
123
|
version: z.literal(3),
|
|
49
|
-
targetKind:
|
|
124
|
+
targetKind: z.literal("browser"),
|
|
50
125
|
pairingToken: z.string().regex(/^xopc_pair_[0-9a-f-]{36}_[A-Za-z0-9_-]{43}$/i),
|
|
51
126
|
gatewayId: z.string().uuid(),
|
|
52
127
|
gatewayName: z.string().trim().min(1).max(120),
|
|
53
128
|
gatewayPublicKey: z.string().regex(/^[A-Za-z0-9_-]{43}$/),
|
|
54
129
|
routes: z.array(devicePairingRouteSchema).min(1).max(8),
|
|
55
130
|
expiresAt: z.number().int().positive()
|
|
131
|
+
});
|
|
132
|
+
secureMobileOriginSchema = z.string().url().superRefine((origin, context) => {
|
|
133
|
+
const url = new URL(origin);
|
|
134
|
+
if (url.protocol !== "https:" || url.username || url.password || origin !== url.origin) context.addIssue({
|
|
135
|
+
code: "custom",
|
|
136
|
+
message: "Mobile pairing origins must be canonical HTTPS origins"
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
mobilePairingInvitationSchema = z.strictObject({
|
|
140
|
+
version: z.literal(4),
|
|
141
|
+
pairingToken: z.string().regex(/^xopc_pair_[0-9a-f-]{36}_[A-Za-z0-9_-]{43}$/i),
|
|
142
|
+
gatewayId: z.string().uuid(),
|
|
143
|
+
gatewayPublicKey: z.string().regex(/^[A-Za-z0-9_-]{43}$/),
|
|
144
|
+
origins: z.array(secureMobileOriginSchema).min(1).max(8),
|
|
145
|
+
expiresAt: z.number().int().positive()
|
|
56
146
|
}).superRefine((payload, context) => {
|
|
57
|
-
if (payload.
|
|
147
|
+
if (new Set(payload.origins).size !== payload.origins.length) context.addIssue({
|
|
58
148
|
code: "custom",
|
|
59
|
-
path: ["
|
|
60
|
-
message: "Mobile
|
|
149
|
+
path: ["origins"],
|
|
150
|
+
message: "Mobile pairing origins must be unique"
|
|
61
151
|
});
|
|
62
152
|
});
|
|
153
|
+
BASE64URL_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
154
|
+
MOBILE_PAIRING_TOKEN = /^xopc_pair_([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})_([A-Za-z0-9_-]{43})$/i;
|
|
155
|
+
MOBILE_INVITATION_FIXED_BYTES = 102;
|
|
63
156
|
devicePairingKeySchema = z.strictObject({
|
|
64
157
|
kty: z.literal("EC"),
|
|
65
158
|
crv: z.literal("P-256"),
|
|
@@ -100,4 +193,4 @@ var init_device_pairing = __esmMin((() => {
|
|
|
100
193
|
}));
|
|
101
194
|
//#endregion
|
|
102
195
|
init_device_pairing();
|
|
103
|
-
export { BROWSER_PAIRING_INVITATION_PREFIX, buildDevicePairingProof, devicePairingCompleteSchema, devicePairingDeviceSchema,
|
|
196
|
+
export { BROWSER_PAIRING_INVITATION_PREFIX, MOBILE_PAIRING_INVITATION_PREFIX, browserPairingInvitationPayloadSchema, buildDevicePairingProof, devicePairingCompleteSchema, devicePairingDeviceSchema, devicePairingKeySchema, devicePairingProofSchema, devicePairingRequestSchema, devicePairingRouteSchema, devicePairingTargetKindSchema, devicePlatformSchema, formatBrowserPairingInvitation, formatMobilePairingInvitation, init_device_pairing, initialDeviceRefreshTokenSchema, mobilePairingInvitationSchema };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region packages/gateway-contract/src/gateway-scopes.ts
|
|
3
|
+
function isGatewayScope(value) {
|
|
4
|
+
return typeof value === "string" && KNOWN_GATEWAY_SCOPES.has(value);
|
|
5
|
+
}
|
|
6
|
+
var GATEWAY_SCOPES, KNOWN_GATEWAY_SCOPES, DEFAULT_MOBILE_SCOPES, DEFAULT_BROWSER_EXTENSION_SCOPES;
|
|
7
|
+
var init_gateway_scopes = __esmMin((() => {
|
|
8
|
+
GATEWAY_SCOPES = [
|
|
9
|
+
"voice.configure",
|
|
10
|
+
"gateway.status",
|
|
11
|
+
"agents.read",
|
|
12
|
+
"agents.run",
|
|
13
|
+
"sessions.read",
|
|
14
|
+
"sessions.write",
|
|
15
|
+
"workspace.read",
|
|
16
|
+
"workspace.write",
|
|
17
|
+
"tasks.read",
|
|
18
|
+
"tasks.write",
|
|
19
|
+
"automations.read",
|
|
20
|
+
"automations.write",
|
|
21
|
+
"notifications.self",
|
|
22
|
+
"device.self",
|
|
23
|
+
"gateway.admin"
|
|
24
|
+
];
|
|
25
|
+
KNOWN_GATEWAY_SCOPES = new Set(GATEWAY_SCOPES);
|
|
26
|
+
DEFAULT_MOBILE_SCOPES = [
|
|
27
|
+
"voice.configure",
|
|
28
|
+
"gateway.status",
|
|
29
|
+
"agents.read",
|
|
30
|
+
"agents.run",
|
|
31
|
+
"sessions.read",
|
|
32
|
+
"sessions.write",
|
|
33
|
+
"workspace.read",
|
|
34
|
+
"workspace.write",
|
|
35
|
+
"tasks.read",
|
|
36
|
+
"tasks.write",
|
|
37
|
+
"automations.read",
|
|
38
|
+
"automations.write",
|
|
39
|
+
"notifications.self",
|
|
40
|
+
"device.self"
|
|
41
|
+
];
|
|
42
|
+
DEFAULT_BROWSER_EXTENSION_SCOPES = [
|
|
43
|
+
"gateway.status",
|
|
44
|
+
"agents.read",
|
|
45
|
+
"agents.run",
|
|
46
|
+
"sessions.read",
|
|
47
|
+
"sessions.write",
|
|
48
|
+
"device.self"
|
|
49
|
+
];
|
|
50
|
+
}));
|
|
51
|
+
//#endregion
|
|
52
|
+
init_gateway_scopes();
|
|
53
|
+
export { DEFAULT_BROWSER_EXTENSION_SCOPES, DEFAULT_MOBILE_SCOPES, GATEWAY_SCOPES, init_gateway_scopes, isGatewayScope };
|
|
@@ -21,6 +21,7 @@ import { init_notifications } from "./notifications.js";
|
|
|
21
21
|
import { init_files } from "./files.js";
|
|
22
22
|
import { init_mobile_privacy } from "./mobile-privacy.js";
|
|
23
23
|
import { init_device_pairing } from "./device-pairing.js";
|
|
24
|
+
import { init_gateway_scopes } from "./gateway-scopes.js";
|
|
24
25
|
import { init_browser_page_context } from "./browser-page-context.js";
|
|
25
26
|
import { init_browser_tab_binding } from "./browser-tab-binding.js";
|
|
26
27
|
import { init_model_selection } from "./model-selection.js";
|
|
@@ -52,6 +53,7 @@ var init_src = __esmMin((() => {
|
|
|
52
53
|
init_files();
|
|
53
54
|
init_mobile_privacy();
|
|
54
55
|
init_device_pairing();
|
|
56
|
+
init_gateway_scopes();
|
|
55
57
|
init_browser_page_context();
|
|
56
58
|
init_browser_tab_binding();
|
|
57
59
|
init_model_selection();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseServerRealtimeMessage } from "../../realtime-protocol/src/index.js";
|
|
1
|
+
import { REALTIME_CAPABILITIES, parseServerRealtimeMessage } from "../../realtime-protocol/src/index.js";
|
|
2
2
|
//#region packages/realtime-client/src/index.ts
|
|
3
3
|
var RealtimeConnectionError = class extends Error {
|
|
4
4
|
constructor(message, retryable) {
|
|
@@ -34,6 +34,7 @@ var RealtimeClient = class {
|
|
|
34
34
|
lastServerMessageAt = 0;
|
|
35
35
|
endpointBinding;
|
|
36
36
|
reconnectWhenSocketOpens = false;
|
|
37
|
+
offeredCapabilities = /* @__PURE__ */ new Set();
|
|
37
38
|
constructor(options) {
|
|
38
39
|
this.options = options;
|
|
39
40
|
}
|
|
@@ -48,6 +49,7 @@ var RealtimeClient = class {
|
|
|
48
49
|
this.generation += 1;
|
|
49
50
|
this.clearTimers();
|
|
50
51
|
this.ready = false;
|
|
52
|
+
this.offeredCapabilities.clear();
|
|
51
53
|
this.endpointBinding?.onDisconnected?.();
|
|
52
54
|
this.socket?.close(1e3, "Client disconnected");
|
|
53
55
|
this.socket = void 0;
|
|
@@ -116,6 +118,7 @@ var RealtimeClient = class {
|
|
|
116
118
|
ticketAbort.abort();
|
|
117
119
|
if (this.ticketAbort === ticketAbort) this.ticketAbort = void 0;
|
|
118
120
|
this.ready = false;
|
|
121
|
+
this.offeredCapabilities.clear();
|
|
119
122
|
this.endpointBinding?.onDisconnected?.();
|
|
120
123
|
this.clearHeartbeat();
|
|
121
124
|
if (this.socket === socket) this.socket = void 0;
|
|
@@ -135,8 +138,13 @@ var RealtimeClient = class {
|
|
|
135
138
|
this.connectionTimer = setTimeout(() => failAttempt("Realtime connection timed out"), timeoutMs);
|
|
136
139
|
this.options.onStateChange?.(reconnecting ? "reconnecting" : "connecting");
|
|
137
140
|
try {
|
|
138
|
-
const [
|
|
141
|
+
const [issuedTicket, endpoint] = await Promise.all([this.options.issueTicket(ticketAbort.signal), this.endpointBinding?.createHello()]);
|
|
142
|
+
const ticket = issuedTicket.ticket;
|
|
143
|
+
if (2 < issuedTicket.realtime.minVersion) throw new RealtimeConnectionError("CLIENT_UPDATE_REQUIRED", false);
|
|
144
|
+
if (2 > issuedTicket.realtime.maxVersion) throw new RealtimeConnectionError("GATEWAY_UPDATE_REQUIRED", false);
|
|
145
|
+
const capabilities = REALTIME_CAPABILITIES.filter((capability) => issuedTicket.realtime.capabilities.includes(capability));
|
|
139
146
|
if (closed || !this.shouldReconnect || generation !== this.generation) return;
|
|
147
|
+
this.offeredCapabilities = new Set(capabilities ?? []);
|
|
140
148
|
socket = this.options.createWebSocket(this.options.getWebSocketUrl());
|
|
141
149
|
this.socket = socket;
|
|
142
150
|
socket.onopen = () => {
|
|
@@ -154,6 +162,7 @@ var RealtimeClient = class {
|
|
|
154
162
|
clientId: this.options.clientId,
|
|
155
163
|
clientKind: this.options.clientKind,
|
|
156
164
|
subscriptions,
|
|
165
|
+
...capabilities?.length ? { capabilities } : {},
|
|
157
166
|
...endpoint ? { endpoint } : {}
|
|
158
167
|
}));
|
|
159
168
|
};
|
|
@@ -195,11 +204,14 @@ var RealtimeClient = class {
|
|
|
195
204
|
const message = parseServerRealtimeMessage(JSON.parse(text));
|
|
196
205
|
this.lastServerMessageAt = Date.now();
|
|
197
206
|
if (message.kind === "realtime.ready") {
|
|
207
|
+
const negotiated = message.payload.negotiatedCapabilities ?? [];
|
|
208
|
+
if (negotiated.some((capability) => !this.offeredCapabilities.has(capability))) throw new Error("Realtime server negotiated a capability the client did not offer");
|
|
198
209
|
this.ready = true;
|
|
199
210
|
this.reconnectAttempts = 0;
|
|
200
211
|
this.clearConnectionTimer();
|
|
201
212
|
this.ticketAbort = void 0;
|
|
202
213
|
this.options.onStateChange?.("connected");
|
|
214
|
+
this.options.onCapabilities?.(negotiated);
|
|
203
215
|
if (message.payload.endpoint) this.endpointBinding?.onReady(message.payload.endpoint);
|
|
204
216
|
this.clearHeartbeat();
|
|
205
217
|
this.heartbeatTimer = setInterval(() => {
|
|
@@ -6,6 +6,7 @@ const REALTIME_MAX_CLIENT_FRAME_BYTES = 256 * 1024;
|
|
|
6
6
|
const REALTIME_HELLO_TIMEOUT_MS = 5e3;
|
|
7
7
|
const REALTIME_HEARTBEAT_INTERVAL_MS = 15e3;
|
|
8
8
|
const REALTIME_HEARTBEAT_TIMEOUT_MS = 45e3;
|
|
9
|
+
const REALTIME_CAPABILITIES = ["realtime.capability-negotiation.v1"];
|
|
9
10
|
const realtimeClientKindSchema = z.enum([
|
|
10
11
|
"web",
|
|
11
12
|
"desktop",
|
|
@@ -19,59 +20,62 @@ const realtimeEventNameSchema = z.string().regex(/^[a-z][a-z0-9_.-]*$/).max(160)
|
|
|
19
20
|
const messageIdSchema = z.uuid();
|
|
20
21
|
const timestampSchema = z.number().int().nonnegative();
|
|
21
22
|
const sequenceSchema = z.number().int().positive();
|
|
22
|
-
const
|
|
23
|
+
const capabilitySchema = z.string().min(1).max(160);
|
|
24
|
+
const envelope = (kind, payload) => z.object({
|
|
23
25
|
protocolVersion: z.literal(2),
|
|
24
26
|
messageId: messageIdSchema,
|
|
25
27
|
kind: z.literal(kind),
|
|
26
28
|
sentAt: timestampSchema,
|
|
27
29
|
payload
|
|
28
30
|
});
|
|
29
|
-
const realtimeSubscriptionSchema = z.
|
|
31
|
+
const realtimeSubscriptionSchema = z.object({
|
|
30
32
|
topic: realtimeTopicSchema,
|
|
31
33
|
afterSeq: z.number().int().nonnegative().optional()
|
|
32
34
|
});
|
|
33
35
|
const clientRealtimeMessageSchema = z.discriminatedUnion("kind", [
|
|
34
|
-
envelope("realtime.hello", z.
|
|
36
|
+
envelope("realtime.hello", z.object({
|
|
35
37
|
ticket: z.string().min(32).max(512),
|
|
36
38
|
clientId: z.string().min(1).max(160),
|
|
37
39
|
clientKind: realtimeClientKindSchema,
|
|
38
40
|
subscriptions: z.array(realtimeSubscriptionSchema).max(100).default([]),
|
|
41
|
+
capabilities: z.array(capabilitySchema).max(64).optional(),
|
|
39
42
|
endpoint: endpointHelloPayloadSchema.optional()
|
|
40
43
|
})),
|
|
41
|
-
envelope("realtime.subscribe", z.
|
|
42
|
-
envelope("realtime.unsubscribe", z.
|
|
43
|
-
envelope("realtime.ping", z.
|
|
44
|
+
envelope("realtime.subscribe", z.object({ subscriptions: z.array(realtimeSubscriptionSchema).min(1).max(100) })),
|
|
45
|
+
envelope("realtime.unsubscribe", z.object({ topics: z.array(realtimeTopicSchema).min(1).max(100) })),
|
|
46
|
+
envelope("realtime.ping", z.object({})),
|
|
44
47
|
envelope("endpoint.message", clientEndpointMessageSchema)
|
|
45
48
|
]);
|
|
46
|
-
const realtimeEventPayloadSchema = z.
|
|
49
|
+
const realtimeEventPayloadSchema = z.object({
|
|
47
50
|
topic: realtimeTopicSchema,
|
|
48
51
|
seq: sequenceSchema,
|
|
49
52
|
event: realtimeEventNameSchema,
|
|
50
53
|
data: z.unknown()
|
|
51
54
|
});
|
|
52
55
|
const serverRealtimeMessageSchema = z.discriminatedUnion("kind", [
|
|
53
|
-
envelope("realtime.ready", z.
|
|
56
|
+
envelope("realtime.ready", z.object({
|
|
54
57
|
connectionId: z.uuid(),
|
|
55
58
|
heartbeatIntervalMs: z.literal(REALTIME_HEARTBEAT_INTERVAL_MS),
|
|
56
59
|
heartbeatTimeoutMs: z.literal(REALTIME_HEARTBEAT_TIMEOUT_MS),
|
|
57
|
-
|
|
60
|
+
negotiatedCapabilities: z.array(capabilitySchema).max(64).optional(),
|
|
61
|
+
endpoint: z.object({
|
|
58
62
|
endpointId: z.string().min(1).max(160),
|
|
59
63
|
turnToken: z.string().min(32).max(160)
|
|
60
64
|
}).optional()
|
|
61
65
|
})),
|
|
62
66
|
envelope("realtime.event", realtimeEventPayloadSchema),
|
|
63
|
-
envelope("realtime.subscribed", z.
|
|
67
|
+
envelope("realtime.subscribed", z.object({
|
|
64
68
|
topic: realtimeTopicSchema,
|
|
65
69
|
cursor: z.number().int().nonnegative()
|
|
66
70
|
})),
|
|
67
|
-
envelope("realtime.gap", z.
|
|
71
|
+
envelope("realtime.gap", z.object({
|
|
68
72
|
topic: realtimeTopicSchema,
|
|
69
73
|
requestedSeq: z.number().int().nonnegative(),
|
|
70
74
|
earliestSeq: sequenceSchema,
|
|
71
75
|
recoverable: z.boolean()
|
|
72
76
|
})),
|
|
73
|
-
envelope("realtime.pong", z.
|
|
74
|
-
envelope("realtime.error", z.
|
|
77
|
+
envelope("realtime.pong", z.object({})),
|
|
78
|
+
envelope("realtime.error", z.object({
|
|
75
79
|
code: z.string().min(1).max(80),
|
|
76
80
|
message: z.string().min(1).max(500)
|
|
77
81
|
})),
|
|
@@ -88,4 +92,4 @@ function parseClientRealtimeJsonFrame(text) {
|
|
|
88
92
|
return JSON.parse(text);
|
|
89
93
|
}
|
|
90
94
|
//#endregion
|
|
91
|
-
export { REALTIME_HEARTBEAT_INTERVAL_MS, REALTIME_HEARTBEAT_TIMEOUT_MS, REALTIME_HELLO_TIMEOUT_MS, REALTIME_MAX_CLIENT_FRAME_BYTES, parseClientRealtimeJsonFrame, parseClientRealtimeMessage, parseServerRealtimeMessage, realtimeClientKindSchema, realtimeEventNameSchema, realtimeTopicSchema };
|
|
95
|
+
export { REALTIME_CAPABILITIES, REALTIME_HEARTBEAT_INTERVAL_MS, REALTIME_HEARTBEAT_TIMEOUT_MS, REALTIME_HELLO_TIMEOUT_MS, REALTIME_MAX_CLIENT_FRAME_BYTES, parseClientRealtimeJsonFrame, parseClientRealtimeMessage, parseServerRealtimeMessage, realtimeClientKindSchema, realtimeEventNameSchema, realtimeTopicSchema };
|
|
@@ -37,6 +37,8 @@ export interface AgentInstanceGateway {
|
|
|
37
37
|
getAgent(conversationId: string): Agent | undefined;
|
|
38
38
|
/** Returns true when an agent instance existed for `conversationId` and was removed. */
|
|
39
39
|
removeAgent(conversationId: string): boolean;
|
|
40
|
+
/** Finish loading and initialize memory providers before agent construction or recall. */
|
|
41
|
+
ensureMemoryReadyForSession?(conversationId: string): Promise<void>;
|
|
40
42
|
/** Create isolated policy state for one user-visible agent run. */
|
|
41
43
|
createAgentTurnPolicy(conversationId: string): AgentTurnPolicy;
|
|
42
44
|
/** Publish events from the actual embedded runtime to session observers. */
|
|
@@ -164,6 +164,7 @@ export declare class AgentManager implements AgentInstanceGateway {
|
|
|
164
164
|
private skillsUpdatedTimer;
|
|
165
165
|
private pendingSkillsUpdatedReason;
|
|
166
166
|
private projectTrustStore;
|
|
167
|
+
private memoryPromptReady;
|
|
167
168
|
constructor(config: AgentManagerConfig);
|
|
168
169
|
private isUserContextEnabledForSession;
|
|
169
170
|
private computeBaseWorkspacePath;
|
|
@@ -199,6 +200,7 @@ export declare class AgentManager implements AgentInstanceGateway {
|
|
|
199
200
|
private buildToolsFactoryDeps;
|
|
200
201
|
getMemoryManager(): MemoryManager;
|
|
201
202
|
getMemoryManagerForSession(conversationId: string): MemoryManager;
|
|
203
|
+
ensureMemoryReadyForSession(conversationId: string): Promise<void>;
|
|
202
204
|
/** Build the bounded, policy-filtered context used for this model turn. */
|
|
203
205
|
prepareUserTurnContext(userMessage: AgentMessage, conversationId: string, turnId: string): Promise<ExecutionContextPlan>;
|
|
204
206
|
/** Capture durable structured user context after a completed turn. */
|
|
@@ -121,6 +121,7 @@ var AgentManager = class {
|
|
|
121
121
|
skillsUpdatedTimer;
|
|
122
122
|
pendingSkillsUpdatedReason;
|
|
123
123
|
projectTrustStore = new ProjectTrustStore();
|
|
124
|
+
memoryPromptReady = /* @__PURE__ */ new WeakMap();
|
|
124
125
|
constructor(config) {
|
|
125
126
|
this.config = config;
|
|
126
127
|
this.baseWorkspacePath = this.computeBaseWorkspacePath();
|
|
@@ -141,7 +142,19 @@ var AgentManager = class {
|
|
|
141
142
|
getConfig: () => this.config.config,
|
|
142
143
|
getAccessForSession: (conversationId) => resolveUserContextSessionAccess(this.config.config, conversationId),
|
|
143
144
|
getWorkspaceIdForSession: (sk) => this.getResolvedWorkspaceForSession(sk),
|
|
144
|
-
getProjectIdForSession: (sk) => getSessionMetadata(sk)?.projectId
|
|
145
|
+
getProjectIdForSession: (sk) => getSessionMetadata(sk)?.projectId,
|
|
146
|
+
ensureMemoryReady: (conversationId) => this.ensureMemoryReadyForSession(conversationId),
|
|
147
|
+
searchExternalMemory: async (input) => this.getMemoryManagerForSession(input.conversationId).searchExternal({
|
|
148
|
+
query: input.query,
|
|
149
|
+
scope: {
|
|
150
|
+
userId: "local-owner",
|
|
151
|
+
workspaceId: input.workspaceId,
|
|
152
|
+
conversationId: input.conversationId,
|
|
153
|
+
...input.projectId ? { projectId: input.projectId } : {}
|
|
154
|
+
},
|
|
155
|
+
trustedOnly: true,
|
|
156
|
+
maxResults: input.maxResults
|
|
157
|
+
})
|
|
145
158
|
});
|
|
146
159
|
this.backgroundReview = new BackgroundReviewCoordinator({ getConfig: () => this.mergedConfig() });
|
|
147
160
|
this.toolsFactory = new AgentToolsFactory(this.buildToolsFactoryDeps());
|
|
@@ -292,8 +305,30 @@ var AgentManager = class {
|
|
|
292
305
|
getMemoryManagerForSession(conversationId) {
|
|
293
306
|
return this.getWorkspaceRuntimeForSession(conversationId).memoryManager;
|
|
294
307
|
}
|
|
308
|
+
async ensureMemoryReadyForSession(conversationId) {
|
|
309
|
+
const cfg = this.config.config;
|
|
310
|
+
if (!cfg || !isMemorySubsystemEnabled(cfg)) return;
|
|
311
|
+
const resolvedPath = this.getResolvedWorkspaceForSession(conversationId);
|
|
312
|
+
const profile = resolveEffectiveAgentProfileForSession(cfg, conversationId);
|
|
313
|
+
const runtime = this.workspaceRuntimes.getOrCreate(resolvedPath, profile.agentId);
|
|
314
|
+
await runtime.memoryManager.initializeAll(conversationId, {
|
|
315
|
+
workspace: resolvedPath,
|
|
316
|
+
agentWorkspace: resolveAgentProfileDir(cfg, profile.agentId),
|
|
317
|
+
agentId: profile.agentId,
|
|
318
|
+
sessionId: conversationId
|
|
319
|
+
});
|
|
320
|
+
let readySessions = this.memoryPromptReady.get(runtime.memoryManager);
|
|
321
|
+
if (!readySessions) {
|
|
322
|
+
readySessions = /* @__PURE__ */ new Set();
|
|
323
|
+
this.memoryPromptReady.set(runtime.memoryManager, readySessions);
|
|
324
|
+
}
|
|
325
|
+
if (readySessions.has(conversationId)) return;
|
|
326
|
+
readySessions.add(conversationId);
|
|
327
|
+
const existing = this.agents.get(conversationId);
|
|
328
|
+
if (existing) this.refreshDynamicContextIfChanged(existing, true);
|
|
329
|
+
}
|
|
295
330
|
/** Build the bounded, policy-filtered context used for this model turn. */
|
|
296
|
-
prepareUserTurnContext(userMessage, conversationId, turnId) {
|
|
331
|
+
async prepareUserTurnContext(userMessage, conversationId, turnId) {
|
|
297
332
|
return this.executionContext.prepare(userMessage, conversationId, turnId);
|
|
298
333
|
}
|
|
299
334
|
/** Capture durable structured user context after a completed turn. */
|
|
@@ -722,13 +757,6 @@ var AgentManager = class {
|
|
|
722
757
|
const resolvedPath = targetPath;
|
|
723
758
|
const rt = this.workspaceRuntimes.getOrCreate(resolvedPath, profile.agentId);
|
|
724
759
|
profile = this.materializeSkillAllowlist(profile, rt);
|
|
725
|
-
if (isMemorySubsystemEnabled(cfg)) rt.memoryManager.initializeAll(conversationId, {
|
|
726
|
-
workspace: resolvedPath,
|
|
727
|
-
agentId: profile.agentId
|
|
728
|
-
}).catch((err) => log.warn({
|
|
729
|
-
err,
|
|
730
|
-
conversationId
|
|
731
|
-
}, "memory initializeAll failed"));
|
|
732
760
|
const activeProjectContext = this.buildExecutionScopeContext(conversationId);
|
|
733
761
|
const profileModelRef = profile.primaryModelRef?.trim() || this.defaultModel;
|
|
734
762
|
const modelManager = this.config.getModelManager?.();
|
|
@@ -912,7 +940,7 @@ var AgentManager = class {
|
|
|
912
940
|
const access = resolveUserContextSessionAccess(this.config.config, conversationId);
|
|
913
941
|
return buildExecutionScopeContextForPrompt(conversationId, {
|
|
914
942
|
includeKnowledge: access.knowledge,
|
|
915
|
-
|
|
943
|
+
knowledgePolicy: access.knowledgePolicy
|
|
916
944
|
});
|
|
917
945
|
}
|
|
918
946
|
getInteractionStateVersion(conversationId) {
|
|
@@ -1094,11 +1122,11 @@ var AgentManager = class {
|
|
|
1094
1122
|
}));
|
|
1095
1123
|
return result.status === "answered" && result.answer === "Allow once";
|
|
1096
1124
|
}
|
|
1097
|
-
refreshDynamicContextIfChanged(instance) {
|
|
1125
|
+
refreshDynamicContextIfChanged(instance, force = false) {
|
|
1098
1126
|
const nextProjectContext = this.buildExecutionScopeContext(instance.conversationId);
|
|
1099
1127
|
const interactionStateVersion = this.getInteractionStateVersion(instance.conversationId);
|
|
1100
1128
|
const userContextAccessVersion = this.getUserContextAccessVersion(instance.conversationId);
|
|
1101
|
-
if (nextProjectContext === instance.activeProjectContext && interactionStateVersion === instance.interactionStateVersion && userContextAccessVersion === instance.userContextAccessVersion) return;
|
|
1129
|
+
if (!force && nextProjectContext === instance.activeProjectContext && interactionStateVersion === instance.interactionStateVersion && userContextAccessVersion === instance.userContextAccessVersion) return;
|
|
1102
1130
|
const cfg = this.config.config;
|
|
1103
1131
|
const resolvedWorkspacePath = this.getResolvedWorkspaceForSession(instance.conversationId);
|
|
1104
1132
|
const rt = this.workspaceRuntimes.getOrCreate(resolvedWorkspacePath, instance.effectiveProfile.agentId);
|
|
@@ -7,10 +7,13 @@ export declare const DEFAULT_AGENT_ID = "main";
|
|
|
7
7
|
export declare const STRICT_AGENT_ID_RE: RegExp;
|
|
8
8
|
/** Path-safe agent id. */
|
|
9
9
|
export declare function normalizeAgentId(value: string | undefined | null): string;
|
|
10
|
+
/** Derive a folder-safe id, including for display names with no ASCII characters. */
|
|
11
|
+
export declare function deriveAgentIdFromDisplayName(displayName: string): string;
|
|
10
12
|
/**
|
|
11
13
|
* Validate agent id for new agents (folder-safe path segment).
|
|
12
14
|
* When `explicitId` is set, it must already match {@link STRICT_AGENT_ID_RE} (case-insensitive input, stored lowercase).
|
|
13
|
-
* When omitted, id is derived from `displayNameForDerivation
|
|
15
|
+
* When omitted, id is derived from `displayNameForDerivation`, with a stable hashed fallback
|
|
16
|
+
* for names that contain no ASCII id characters.
|
|
14
17
|
*/
|
|
15
18
|
export declare function validateAgentIdForNewAgent(explicitId: string | undefined | null, displayNameForDerivation: string): {
|
|
16
19
|
ok: true;
|
|
@@ -19,10 +19,26 @@ function normalizeAgentId(value) {
|
|
|
19
19
|
if (VALID_ID_RE.test(trimmed)) return normalized;
|
|
20
20
|
return normalized.replace(INVALID_CHARS_RE, "-").replace(LEADING_DASH_RE, "").replace(TRAILING_DASH_RE, "").slice(0, 64) || "main";
|
|
21
21
|
}
|
|
22
|
+
function hashAgentDisplayName(value) {
|
|
23
|
+
let hash = 2166136261;
|
|
24
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
25
|
+
hash ^= value.charCodeAt(index);
|
|
26
|
+
hash = Math.imul(hash, 16777619);
|
|
27
|
+
}
|
|
28
|
+
return (hash >>> 0).toString(36).padStart(7, "0");
|
|
29
|
+
}
|
|
30
|
+
/** Derive a folder-safe id, including for display names with no ASCII characters. */
|
|
31
|
+
function deriveAgentIdFromDisplayName(displayName) {
|
|
32
|
+
const normalizedName = displayName.trim().normalize("NFKC").toLowerCase();
|
|
33
|
+
const asciiId = normalizeAgentId(normalizedName);
|
|
34
|
+
if (asciiId !== "main" || normalizedName === "main") return asciiId;
|
|
35
|
+
return normalizedName ? `agent-${hashAgentDisplayName(normalizedName)}` : DEFAULT_AGENT_ID;
|
|
36
|
+
}
|
|
22
37
|
/**
|
|
23
38
|
* Validate agent id for new agents (folder-safe path segment).
|
|
24
39
|
* When `explicitId` is set, it must already match {@link STRICT_AGENT_ID_RE} (case-insensitive input, stored lowercase).
|
|
25
|
-
* When omitted, id is derived from `displayNameForDerivation
|
|
40
|
+
* When omitted, id is derived from `displayNameForDerivation`, with a stable hashed fallback
|
|
41
|
+
* for names that contain no ASCII id characters.
|
|
26
42
|
*/
|
|
27
43
|
function validateAgentIdForNewAgent(explicitId, displayNameForDerivation) {
|
|
28
44
|
const explicit = explicitId?.trim();
|
|
@@ -45,7 +61,7 @@ function validateAgentIdForNewAgent(explicitId, displayNameForDerivation) {
|
|
|
45
61
|
agentId: id
|
|
46
62
|
};
|
|
47
63
|
}
|
|
48
|
-
const agentId =
|
|
64
|
+
const agentId = deriveAgentIdFromDisplayName(displayNameForDerivation);
|
|
49
65
|
if (agentId === "main") return {
|
|
50
66
|
ok: false,
|
|
51
67
|
error: "Display name cannot produce a valid agent folder id. Set an explicit Agent id (letters, digits, underscores, hyphens only)."
|
|
@@ -212,4 +228,4 @@ var init_agent_scope = __esmMin((() => {
|
|
|
212
228
|
}));
|
|
213
229
|
//#endregion
|
|
214
230
|
init_agent_scope();
|
|
215
|
-
export { DEFAULT_AGENT_ID, STRICT_AGENT_ID_RE, getDefaultWorkspacePath, init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentHomeDir, resolveAgentIdByWorkspacePath, resolveAgentIdForWorkspacePath, resolveAgentIdsByWorkspacePath, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent };
|
|
231
|
+
export { DEFAULT_AGENT_ID, STRICT_AGENT_ID_RE, deriveAgentIdFromDisplayName, getDefaultWorkspacePath, init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentHomeDir, resolveAgentIdByWorkspacePath, resolveAgentIdForWorkspacePath, resolveAgentIdsByWorkspacePath, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { runProcess } from "../../process/run-process.js";
|
|
1
2
|
import { validatePath } from "../sandbox/path-policy.js";
|
|
2
3
|
import { credentialMounts } from "./commandMounts.js";
|
|
3
4
|
import { isAbsolute, relative, sep } from "node:path";
|
|
4
|
-
import { execFile } from "node:child_process";
|
|
5
|
-
import { promisify } from "node:util";
|
|
6
5
|
import { realpath } from "node:fs/promises";
|
|
7
6
|
//#region src/agent/commands/command-isolation.ts
|
|
8
|
-
const exec = promisify(execFile);
|
|
9
7
|
/** Docker is opt-in and never falls back to host execution or pulls an image implicitly. */
|
|
10
8
|
async function isolatedCommand(input) {
|
|
11
9
|
if (!input.isolation || input.isolation.mode === "host") return {
|
|
@@ -75,13 +73,17 @@ async function isolatedCommand(input) {
|
|
|
75
73
|
}
|
|
76
74
|
async function removeCommandContainer(name) {
|
|
77
75
|
if (!/^xopc-command-[a-f0-9-]{36}$/.test(name)) throw new Error("Invalid command container name");
|
|
78
|
-
await
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
const result = await runProcess({
|
|
77
|
+
program: "docker",
|
|
78
|
+
args: [
|
|
79
|
+
"rm",
|
|
80
|
+
"--force",
|
|
81
|
+
name
|
|
82
|
+
],
|
|
83
|
+
timeoutMs: 1e4,
|
|
84
|
+
terminationPolicy: "tree"
|
|
84
85
|
});
|
|
86
|
+
if (result.exitCode !== 0 && !result.stderr.includes("No such container")) throw new Error(result.stderr || `docker rm exited with code ${String(result.exitCode)}`);
|
|
85
87
|
}
|
|
86
88
|
//#endregion
|
|
87
89
|
export { isolatedCommand, removeCommandContainer };
|