@xopcai/xopc 0.0.303 → 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-Ch3DzUvP.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-izNAyDhW.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-BKGzaVvM.js → archive-plugin-BxOvZ-ZX.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-8bARdLnp.js → attachment-load-B0FzTMAJ.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BAEenyzx.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-Cv3GS9Eo.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-DUeb92LG.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-D1O22WIf.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-D-JYPVYl.js → chat-terminal-dock-B-yI3Mi1.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-Bcfp948A.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-UtoUm57Q.js → dependency-picker-BQTspLzC.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Bryx7gRM.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-DQlFTVBx.js → extension-debug-page-CVGiGVcR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BSsqRDXh.js → extension-page-g3JtCP_y.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DbVZv9ve.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-Cxowc29b.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-CXPaPDGm.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-tSJ0CvcX.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-CQx6H-GS.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-A3-bVtdy.js → preview-open-alternatives-Ck2uKTbf.js} +1 -1
- package/dist/gateway/static/root/assets/{proactive-page-D46cR3sf.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-CR0qvq9C.js → runtime-tools-settings-panel-CPwdgWKo.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-BUD9lLEE.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-BZPCUH6a.js → settings-form-section-D_Gsz5rl.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-XoHmqIdm.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-CH-quGxZ.js → skills-page.utils-Cuh6s2HM.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CGC7eBso.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-BydB6x2K.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-CPUDBcag.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-D_FmJbGH.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 +9 -1
- 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.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 +7 -5
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-4oGrNj3m.js +0 -1
- package/dist/gateway/static/root/assets/agents-DXHD-ST3.js +0 -1
- package/dist/gateway/static/root/assets/api-fPapljyb.js +0 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-CdXnNtTg.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BQb3RCga.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-5vTl4x0h.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CH9prS-f.js +0 -3
- package/dist/gateway/static/root/assets/button-CGlRPNzi.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DMURlZbj.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-CFBS3Yqy.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DI1c3BMz.js +0 -2
- package/dist/gateway/static/root/assets/cron-expression-BJMBFKCh.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-BFRIn5y9.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-DFsyEJUr.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-C3TQVPRy.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-DUqVsB3X.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CLkumXdN.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-DXNfRmk9.js +0 -1
- package/dist/gateway/static/root/assets/index-BLRIcVQa.css +0 -1
- package/dist/gateway/static/root/assets/index-gheM453N.js +0 -79
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-5Hcec8Xf.js +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BDg1-fcw.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-BWZc5jwO.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-COa3PhMs.js +0 -1
- package/dist/gateway/static/root/assets/messages-C9h8SImu.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-D_YGzNcR.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-D1f2oI2-.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-CRlD_Rwv.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-mmX0SavY.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Cqr3K6T5.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-CPkvbdJP.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cu0DAbeH.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-D8fQF1jZ.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-BgHqwTuT.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-Id4vRHzI.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BB2Fj_di.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BAwF4LpS.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-BVjw812D.js +0 -1
- package/dist/gateway/static/root/assets/theme-store-KfFEGMlp.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-Do98Xk05.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-Nv68a4ak.js +0 -2
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-1lZ_btki.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-DFOhccm3.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
|
@@ -3,7 +3,7 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { init_paths, resolveExtensionsDir, resolveExtensionsLockPath } from "../config/paths.js";
|
|
4
4
|
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
5
5
|
import { dirname, join } from "path";
|
|
6
|
-
import { existsSync } from "fs";
|
|
6
|
+
import { existsSync, lstatSync, readFileSync, readdirSync, readlinkSync } from "fs";
|
|
7
7
|
import { mkdir, readFile } from "fs/promises";
|
|
8
8
|
import { createHash } from "crypto";
|
|
9
9
|
//#region src/extensions/lockfile.ts
|
|
@@ -11,10 +11,35 @@ init_write_file_atomic();
|
|
|
11
11
|
init_logger();
|
|
12
12
|
init_paths();
|
|
13
13
|
const log = createLogger("ExtensionLockfile");
|
|
14
|
+
function computeExtensionDirectoryIntegrity(extensionDir) {
|
|
15
|
+
if (!existsSync(extensionDir)) return void 0;
|
|
16
|
+
const hash = createHash("sha256");
|
|
17
|
+
const walk = (dir, prefix = "") => {
|
|
18
|
+
const entries = readdirSync(dir, { withFileTypes: true }).filter((entry) => entry.name !== ".DS_Store").sort((left, right) => left.name.localeCompare(right.name));
|
|
19
|
+
for (const entry of entries) {
|
|
20
|
+
const relativePath = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
21
|
+
const fullPath = join(dir, entry.name);
|
|
22
|
+
const stat = lstatSync(fullPath);
|
|
23
|
+
if (stat.isSymbolicLink()) hash.update(`symlink\0${relativePath}\0${readlinkSync(fullPath)}\0`);
|
|
24
|
+
else if (stat.isDirectory()) {
|
|
25
|
+
hash.update(`dir\0${relativePath}\0`);
|
|
26
|
+
walk(fullPath, relativePath);
|
|
27
|
+
} else if (stat.isFile()) {
|
|
28
|
+
hash.update(`file\0${relativePath}\0${stat.mode & 511}\0${stat.size}\0`);
|
|
29
|
+
hash.update(readFileSync(fullPath));
|
|
30
|
+
hash.update("\0");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
walk(extensionDir);
|
|
35
|
+
return `dir-sha256-${hash.digest("base64")}`;
|
|
36
|
+
}
|
|
14
37
|
var ExtensionLockfileManager = class {
|
|
15
38
|
lockfilePath;
|
|
16
|
-
|
|
39
|
+
extensionsDir;
|
|
40
|
+
constructor(lockfilePath, extensionsDir = resolveExtensionsDir()) {
|
|
17
41
|
this.lockfilePath = lockfilePath || resolveExtensionsLockPath();
|
|
42
|
+
this.extensionsDir = extensionsDir;
|
|
18
43
|
}
|
|
19
44
|
/**
|
|
20
45
|
* Load the lockfile
|
|
@@ -101,14 +126,24 @@ var ExtensionLockfileManager = class {
|
|
|
101
126
|
* Verify extension integrity
|
|
102
127
|
*/
|
|
103
128
|
async verify(extensionId) {
|
|
104
|
-
|
|
129
|
+
const entry = await this.get(extensionId);
|
|
130
|
+
if (!entry) return {
|
|
105
131
|
valid: false,
|
|
106
132
|
reason: "Extension not in lockfile"
|
|
107
133
|
};
|
|
108
|
-
|
|
134
|
+
const extDir = join(this.extensionsDir, extensionId);
|
|
135
|
+
if (!existsSync(extDir)) return {
|
|
109
136
|
valid: false,
|
|
110
137
|
reason: "Extension directory not found"
|
|
111
138
|
};
|
|
139
|
+
if (!entry.installedIntegrity) return {
|
|
140
|
+
valid: false,
|
|
141
|
+
reason: "Lockfile has no installed file integrity snapshot"
|
|
142
|
+
};
|
|
143
|
+
if (computeExtensionDirectoryIntegrity(extDir) !== entry.installedIntegrity) return {
|
|
144
|
+
valid: false,
|
|
145
|
+
reason: "Installed extension files do not match the lockfile"
|
|
146
|
+
};
|
|
112
147
|
return { valid: true };
|
|
113
148
|
}
|
|
114
149
|
/**
|
|
@@ -128,20 +163,12 @@ var ExtensionLockfileManager = class {
|
|
|
128
163
|
*/
|
|
129
164
|
async freeze() {
|
|
130
165
|
const data = await this.load();
|
|
131
|
-
for (const [extensionId] of Object.entries(data.extensions)) if (!existsSync(join(
|
|
166
|
+
for (const [extensionId] of Object.entries(data.extensions)) if (!existsSync(join(this.extensionsDir, extensionId))) log.warn({ extensionId }, "Extension in lockfile but not installed");
|
|
132
167
|
data.lastUpdated = (/* @__PURE__ */ new Date()).toISOString();
|
|
133
168
|
await this.save(data);
|
|
134
169
|
log.info("Lockfile frozen");
|
|
135
170
|
return data;
|
|
136
171
|
}
|
|
137
|
-
/**
|
|
138
|
-
* Generate integrity hash for a file
|
|
139
|
-
*/
|
|
140
|
-
static async generateIntegrity(filePath) {
|
|
141
|
-
const { readFile } = await import("fs/promises");
|
|
142
|
-
const content = await readFile(filePath);
|
|
143
|
-
return "sha512-" + createHash("sha512").update(content).digest("base64");
|
|
144
|
-
}
|
|
145
172
|
};
|
|
146
173
|
let globalManager;
|
|
147
174
|
function getExtensionLockfileManager(lockfilePath) {
|
|
@@ -158,4 +185,4 @@ async function saveExtensionLockfile(data, lockfilePath) {
|
|
|
158
185
|
return getExtensionLockfileManager(lockfilePath).save(data);
|
|
159
186
|
}
|
|
160
187
|
//#endregion
|
|
161
|
-
export { ExtensionLockfileManager, getExtensionLockfileManager, loadExtensionLockfile, resetExtensionLockfileManager, saveExtensionLockfile };
|
|
188
|
+
export { ExtensionLockfileManager, computeExtensionDirectoryIntegrity, getExtensionLockfileManager, loadExtensionLockfile, resetExtensionLockfileManager, saveExtensionLockfile };
|
|
@@ -172,42 +172,18 @@ function normalizeUiManifest(raw) {
|
|
|
172
172
|
}
|
|
173
173
|
function normalizeUiContributions(raw) {
|
|
174
174
|
if (!isRecord(raw)) return void 0;
|
|
175
|
-
const sidebarPanels = normalizeSidebarPanels(raw.sidebarPanels);
|
|
176
175
|
const settingsPanels = normalizeSettingsPanels(raw.settingsPanels);
|
|
177
176
|
const chatWidgets = normalizeChatWidgets(raw.chatWidgets);
|
|
178
177
|
const pages = normalizePages(raw.pages);
|
|
179
178
|
const commands = normalizeCommands(raw.commands);
|
|
180
|
-
const statusBarItems = normalizeStatusBarItems(raw.statusBarItems);
|
|
181
179
|
const out = {
|
|
182
|
-
...sidebarPanels ? { sidebarPanels } : {},
|
|
183
180
|
...settingsPanels ? { settingsPanels } : {},
|
|
184
181
|
...chatWidgets ? { chatWidgets } : {},
|
|
185
182
|
...pages ? { pages } : {},
|
|
186
|
-
...commands ? { commands } : {}
|
|
187
|
-
...statusBarItems ? { statusBarItems } : {}
|
|
183
|
+
...commands ? { commands } : {}
|
|
188
184
|
};
|
|
189
185
|
return Object.keys(out).length ? out : void 0;
|
|
190
186
|
}
|
|
191
|
-
function normalizeSidebarPanels(raw) {
|
|
192
|
-
if (!Array.isArray(raw)) return void 0;
|
|
193
|
-
const out = [];
|
|
194
|
-
for (const item of raw) {
|
|
195
|
-
if (!isRecord(item)) continue;
|
|
196
|
-
const id = item.id;
|
|
197
|
-
const title = item.title;
|
|
198
|
-
const entrypoint = item.entrypoint;
|
|
199
|
-
if (typeof id !== "string" || typeof title !== "string" || typeof entrypoint !== "string") continue;
|
|
200
|
-
out.push({
|
|
201
|
-
id,
|
|
202
|
-
title,
|
|
203
|
-
entrypoint,
|
|
204
|
-
icon: typeof item.icon === "string" ? item.icon : void 0,
|
|
205
|
-
defaultVisible: typeof item.defaultVisible === "boolean" ? item.defaultVisible : void 0,
|
|
206
|
-
when: typeof item.when === "string" && item.when.length > 0 ? item.when : void 0
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
return out.length ? out : void 0;
|
|
210
|
-
}
|
|
211
187
|
function normalizeSettingsPanels(raw) {
|
|
212
188
|
if (!Array.isArray(raw)) return void 0;
|
|
213
189
|
const out = [];
|
|
@@ -277,8 +253,7 @@ function normalizePages(raw) {
|
|
|
277
253
|
path,
|
|
278
254
|
entrypoint,
|
|
279
255
|
showInNav: typeof item.showInNav === "boolean" ? item.showInNav : void 0,
|
|
280
|
-
navIcon: typeof item.navIcon === "string" ? item.navIcon : void 0
|
|
281
|
-
when: typeof item.when === "string" && item.when.length > 0 ? item.when : void 0
|
|
256
|
+
navIcon: typeof item.navIcon === "string" ? item.navIcon : void 0
|
|
282
257
|
});
|
|
283
258
|
}
|
|
284
259
|
return out.length ? out : void 0;
|
|
@@ -296,27 +271,7 @@ function normalizeCommands(raw) {
|
|
|
296
271
|
title,
|
|
297
272
|
shortcut: typeof item.shortcut === "string" ? item.shortcut : void 0,
|
|
298
273
|
opensPanel: typeof item.opensPanel === "string" ? item.opensPanel : void 0,
|
|
299
|
-
chatAlias: typeof item.chatAlias === "string" && item.chatAlias.length > 0 ? item.chatAlias : void 0
|
|
300
|
-
when: typeof item.when === "string" && item.when.length > 0 ? item.when : void 0
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
return out.length ? out : void 0;
|
|
304
|
-
}
|
|
305
|
-
function normalizeStatusBarItems(raw) {
|
|
306
|
-
if (!Array.isArray(raw)) return void 0;
|
|
307
|
-
const out = [];
|
|
308
|
-
for (const item of raw) {
|
|
309
|
-
if (!isRecord(item)) continue;
|
|
310
|
-
const id = item.id;
|
|
311
|
-
const entrypoint = item.entrypoint;
|
|
312
|
-
if (typeof id !== "string" || typeof entrypoint !== "string") continue;
|
|
313
|
-
const position = item.position;
|
|
314
|
-
out.push({
|
|
315
|
-
id,
|
|
316
|
-
entrypoint,
|
|
317
|
-
position: position === "left" || position === "right" ? position : void 0,
|
|
318
|
-
width: typeof item.width === "number" ? item.width : void 0,
|
|
319
|
-
when: typeof item.when === "string" && item.when.length > 0 ? item.when : void 0
|
|
274
|
+
chatAlias: typeof item.chatAlias === "string" && item.chatAlias.length > 0 ? item.chatAlias : void 0
|
|
320
275
|
});
|
|
321
276
|
}
|
|
322
277
|
return out.length ? out : void 0;
|
|
@@ -370,17 +325,12 @@ function normalizeActivation(raw) {
|
|
|
370
325
|
if (!isRecord(raw)) return void 0;
|
|
371
326
|
const onStartup = typeof raw.onStartup === "boolean" ? raw.onStartup : void 0;
|
|
372
327
|
const onProviders = Array.isArray(raw.onProviders) ? raw.onProviders.filter((x) => typeof x === "string") : void 0;
|
|
373
|
-
const onCommands = Array.isArray(raw.onCommands) ? raw.onCommands.filter((x) => typeof x === "string") : void 0;
|
|
374
328
|
const onChannels = Array.isArray(raw.onChannels) ? raw.onChannels.filter((x) => typeof x === "string") : void 0;
|
|
375
|
-
|
|
376
|
-
const onCapabilities = Array.isArray(capRaw) ? capRaw.filter((x) => x === "provider" || x === "channel" || x === "tool" || x === "hook") : void 0;
|
|
377
|
-
if (onStartup === void 0 && !onProviders?.length && !onCommands?.length && !onChannels?.length && !onCapabilities?.length) return;
|
|
329
|
+
if (onStartup === void 0 && !onProviders?.length && !onChannels?.length) return;
|
|
378
330
|
return {
|
|
379
331
|
onStartup,
|
|
380
332
|
onProviders,
|
|
381
|
-
|
|
382
|
-
onChannels,
|
|
383
|
-
onCapabilities
|
|
333
|
+
onChannels
|
|
384
334
|
};
|
|
385
335
|
}
|
|
386
336
|
function normalizeContracts(raw) {
|
|
@@ -434,15 +384,11 @@ var init_normalize_manifest = __esmMin((() => {
|
|
|
434
384
|
"agent.send",
|
|
435
385
|
"agent.subscribe",
|
|
436
386
|
"session.read",
|
|
437
|
-
"session.write",
|
|
438
387
|
"config.read",
|
|
439
388
|
"config.write",
|
|
440
389
|
"storage",
|
|
441
390
|
"notification",
|
|
442
|
-
"
|
|
443
|
-
"theme",
|
|
444
|
-
"workspace.read",
|
|
445
|
-
"workspace.write"
|
|
391
|
+
"theme"
|
|
446
392
|
]);
|
|
447
393
|
}));
|
|
448
394
|
//#endregion
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
* import type { ExtensionApi, ExtensionDefinition } from '@xopcai/xopc/extension-sdk';
|
|
9
9
|
*/
|
|
10
10
|
export type { ExtensionDefinition, ExtensionModule, ExtensionKind, ExtensionApi, ExtensionLogger, ExtensionManifest, ExtensionRecord, ExtensionRegistry, ResolvedExtensionConfig, ExtensionRuntime, ExtensionCliRegistration, } from '../types/index.js';
|
|
11
|
+
export { EXTENSION_API_VERSION, EXTENSION_UI_API_VERSION } from '../api-version.js';
|
|
11
12
|
export type { AgentTool, AgentToolResult, AgentToolUpdateCallback, ToolExecutionStartEvent, ToolExecutionUpdateEvent, ToolExecutionEndEvent, } from '../types/index.js';
|
|
12
13
|
export type { ExtensionHookEvent, ExtensionHookHandler, HookOptions, HookAgentContext, AgentMessage, ContextEvent, ContextResult, InputEvent, InputResult, TurnEvent, TurnResult, HookHandlerMap, HookExecutionMode, HookBeforeModelResolveEvent, HookBeforeModelResolveResult, HookBeforePromptBuildEvent, HookBeforePromptBuildResult, HookLlmInputEvent, HookLlmOutputEvent, HookInboundClaimEvent, HookInboundClaimResult, HookBeforeResetEvent, HookBeforeResetResult, HookBeforeMessageWriteEvent, HookBeforeMessageWriteResult, HookTurnStartEvent, HookTurnEndEvent, HookToolExecutionStartEvent, HookToolExecutionUpdateEvent, HookToolExecutionEndEvent, HookContext, BeforeAgentStartContext, BeforeAgentStartResult, AgentEndContext, WebchatTurnCompleteEvent, BeforeCompactionContext, AfterCompactionContext, MessageReceivedContext, MessageSendingContext, MessageSendingResult, MessageSentContext, BeforeToolCallContext, BeforeToolCallResult, AfterToolCallContext, SessionStartContext, SessionEndContext, GatewayStartContext, GatewayStopContext, } from '../types/index.js';
|
|
13
14
|
export type { EventMap, RequestMap, EventHandler, EventHandlerMeta, RequestHandler, RequestHandlerMeta, WildcardEventHandler, WildcardHandlerMeta, TypedEventBusOptions, RequestOptions, } from '../types/index.js';
|
|
14
15
|
export type { ProviderPlugin, ProviderModelDefinition, ProviderCapabilities, ProviderStreamParams, ProviderStreamChunk, ProviderCompleteParams, ProviderResponse, ProviderRegistry, BUILTIN_PROVIDERS, BuiltinProviderId, } from '../types/index.js';
|
|
15
|
-
export type { ProviderConfig, ModelConfig, OAuthConfig, OAuthCallbacks, OAuthCredentials,
|
|
16
|
+
export type { ProviderConfig, ModelConfig, OAuthConfig, OAuthCallbacks, OAuthCredentials, } from '../types/index.js';
|
|
16
17
|
export type { TuiExtensionHostContract, TuiExtensionRegistrar, TuiAutocompleteProvider, TuiAutocompleteSuggestion, TuiToolRenderer, TuiToolRenderContext, TuiSlashCommandHandler, TuiNotifyLevel, } from '../types/index.js';
|
|
17
18
|
export type { SafetyCheckResult, SecurityConfig, ExtensionSourceOrigin, ProvenanceInfo, } from '../security.js';
|
|
18
19
|
export type { SlotKey, SlotClaim, SlotConfig, } from '../slots.js';
|
|
@@ -23,7 +24,7 @@ export type { ExtensionCommand, ExtensionCommandHandler, ExtensionCommandContext
|
|
|
23
24
|
export type { ExtensionService, } from '../types/index.js';
|
|
24
25
|
export type { GatewayMethodHandler, } from '../types/index.js';
|
|
25
26
|
export { TypedEventBus } from '../typed-event-bus.js';
|
|
26
|
-
export { ExtensionRegistryImpl } from '../
|
|
27
|
+
export { ExtensionRegistryImpl } from '../extension-registry-impl.js';
|
|
27
28
|
export { ProviderPluginRegistry, getProviderRegistry } from '../../providers/plugin-registry.js';
|
|
28
29
|
export { SlotRegistry, getSlotRegistry, registerSlotType } from '../slots.js';
|
|
29
30
|
export { HOOK_EXECUTION_MODES } from '../types/hooks.js';
|
|
@@ -2,10 +2,10 @@ import { ProviderPluginRegistry, getProviderRegistry, init_plugin_registry } fro
|
|
|
2
2
|
import { HOOK_EXECUTION_MODES } from "../types/hooks.js";
|
|
3
3
|
import { TypedEventBus } from "../typed-event-bus.js";
|
|
4
4
|
import { ExtensionRegistryImpl } from "../extension-registry-impl.js";
|
|
5
|
+
import { EXTENSION_API_VERSION, EXTENSION_UI_API_VERSION } from "../api-version.js";
|
|
5
6
|
import { DEFAULT_SECURITY_CONFIG, checkExtensionDirSafety, checkExtensionPathSafety, isExtensionAllowed, logSecurityIssue, provenanceTracker } from "../security.js";
|
|
6
7
|
import { SlotRegistry, getSlotRegistry, registerSlotType } from "../slots.js";
|
|
7
8
|
import { ExtensionDiagnostics, ExtensionLoaderCacheImpl, getExtensionCache, getExtensionDiagnostics } from "../diagnostics.js";
|
|
8
|
-
import "../loader.js";
|
|
9
9
|
import { ExtensionHookRunner, createHookContext, isHookEvent } from "../hooks.js";
|
|
10
10
|
import { defineChannelPluginEntry } from "./channel-entry.js";
|
|
11
11
|
import { registerExtensionCliProgram } from "./channel-helpers.js";
|
|
@@ -14,4 +14,4 @@ import { createMockExtensionApi, createTestGateway } from "./testing.js";
|
|
|
14
14
|
//#region src/extensions/sdk/index.ts
|
|
15
15
|
init_plugin_registry();
|
|
16
16
|
//#endregion
|
|
17
|
-
export { DEFAULT_SECURITY_CONFIG, ExtensionDiagnostics, ExtensionHookRunner, ExtensionLoaderCacheImpl, ExtensionRegistryImpl, HOOK_EXECUTION_MODES, ProviderPluginRegistry, SlotRegistry, TypedEventBus, checkExtensionDirSafety, checkExtensionPathSafety, createHookContext, createMockExtensionApi, createTestGateway, defineChannelPluginEntry, getExtensionCache, getExtensionDiagnostics, getProviderRegistry, getSlotRegistry, isExtensionAllowed, isHookEvent, lazyFunction, lazyModule, logSecurityIssue, provenanceTracker, registerExtensionCliProgram, registerSlotType };
|
|
17
|
+
export { DEFAULT_SECURITY_CONFIG, EXTENSION_API_VERSION, EXTENSION_UI_API_VERSION, ExtensionDiagnostics, ExtensionHookRunner, ExtensionLoaderCacheImpl, ExtensionRegistryImpl, HOOK_EXECUTION_MODES, ProviderPluginRegistry, SlotRegistry, TypedEventBus, checkExtensionDirSafety, checkExtensionPathSafety, createHookContext, createMockExtensionApi, createTestGateway, defineChannelPluginEntry, getExtensionCache, getExtensionDiagnostics, getProviderRegistry, getSlotRegistry, isExtensionAllowed, isHookEvent, lazyFunction, lazyModule, logSecurityIssue, provenanceTracker, registerExtensionCliProgram, registerSlotType };
|
|
@@ -159,13 +159,9 @@ var MockExtensionApiImpl = class {
|
|
|
159
159
|
this._bus.off(event, handler);
|
|
160
160
|
}
|
|
161
161
|
registerProvider(_plugin) {}
|
|
162
|
-
registerProviderPlugin(_plugin) {}
|
|
163
162
|
registerSpeechProvider(_plugin) {}
|
|
164
163
|
registerMediaUnderstandingProvider(_plugin) {}
|
|
165
164
|
registerMarketplaceAdapter(_registration) {}
|
|
166
|
-
registerFlag(_name, _config) {}
|
|
167
|
-
getFlag(_name) {}
|
|
168
|
-
registerShortcut(_key, _config) {}
|
|
169
165
|
registerTui(_register) {}
|
|
170
166
|
setLabel(_entryId, _label) {}
|
|
171
167
|
sendUserMessage(_content, _options) {}
|
|
@@ -83,14 +83,12 @@ function checkExtensionDirSafety(extensionDir, rootDir, origin) {
|
|
|
83
83
|
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
84
84
|
for (const entry of entries) {
|
|
85
85
|
const fullPath = path$1.join(dir, entry.name);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
else if (entry.isFile()) {
|
|
91
|
-
const result = checkExtensionPathSafety(fullPath, rootDir, origin);
|
|
92
|
-
if (!result.safe) issues.push(result);
|
|
86
|
+
const result = checkExtensionPathSafety(fullPath, rootDir, origin);
|
|
87
|
+
if (!result.safe) {
|
|
88
|
+
issues.push(result);
|
|
89
|
+
continue;
|
|
93
90
|
}
|
|
91
|
+
if (entry.isDirectory()) walkDir(fullPath);
|
|
94
92
|
}
|
|
95
93
|
};
|
|
96
94
|
walkDir(extensionDir);
|
|
@@ -13,7 +13,6 @@ import type { TypedEventBus } from './events.js';
|
|
|
13
13
|
import type { ExtensionHookEvent, ExtensionHookHandler, HookOptions, HookHandlerMap } from './hooks.js';
|
|
14
14
|
import type { ChannelPlugin } from '../../channels/plugin-types.js';
|
|
15
15
|
import type { SessionMetadata } from '../../session/types.js';
|
|
16
|
-
import type { FlagConfig, FlagValue, ShortcutConfig } from './registration.js';
|
|
17
16
|
import type { ProviderPlugin } from './providers.js';
|
|
18
17
|
import type { TuiExtensionRegistrar } from './tui.js';
|
|
19
18
|
import type { Migration } from '../../migrations/types.js';
|
|
@@ -142,7 +141,6 @@ export interface ExtensionApi {
|
|
|
142
141
|
off(event: string, handler: (data: unknown) => void): void;
|
|
143
142
|
events: TypedEventBus;
|
|
144
143
|
registerProvider(plugin: ProviderPlugin): void;
|
|
145
|
-
registerProviderPlugin(plugin: ProviderPlugin): void;
|
|
146
144
|
/** Register a speech (TTS) provider plugin. */
|
|
147
145
|
registerSpeechProvider(plugin: import('../../voice/tts/speech-provider-types.js').SpeechProviderPlugin): void;
|
|
148
146
|
/** Register a media understanding (STT / image / video) provider plugin. */
|
|
@@ -155,9 +153,6 @@ export interface ExtensionApi {
|
|
|
155
153
|
adapter: import('../../agent/skills/marketplace/adapter.types.js').SkillsMarketplaceAdapter;
|
|
156
154
|
displayName?: string;
|
|
157
155
|
}): void;
|
|
158
|
-
registerFlag(name: string, config: FlagConfig, extensionId?: string): void;
|
|
159
|
-
getFlag(name: string): FlagValue;
|
|
160
|
-
registerShortcut(key: string, config: ShortcutConfig): void;
|
|
161
156
|
/**
|
|
162
157
|
* Register TUI contributions (footer/header widgets, autocomplete, tool renderers).
|
|
163
158
|
* Callback runs when `xopc tui` starts — not during gateway-only extension load.
|
|
@@ -9,6 +9,6 @@ export * from './tools.js';
|
|
|
9
9
|
export * from './hooks.js';
|
|
10
10
|
export * from './events.js';
|
|
11
11
|
export * from './loader.js';
|
|
12
|
-
export type { ProviderConfig, ProviderApiType, ModelConfig, OAuthConfig, OAuthCallbacks, OAuthCredentials
|
|
12
|
+
export type { ProviderConfig, ProviderApiType, ModelConfig, OAuthConfig, OAuthCallbacks, OAuthCredentials } from './registration.js';
|
|
13
13
|
export * from './providers.js';
|
|
14
14
|
export * from './tui.js';
|
|
@@ -131,25 +131,13 @@ export interface ExtensionUiManifest {
|
|
|
131
131
|
contributions?: ExtensionUiContributions;
|
|
132
132
|
}
|
|
133
133
|
/** Permissions an extension can request for its frontend UI. */
|
|
134
|
-
export type ExtensionUiPermission = 'agent.send' | 'agent.subscribe' | 'session.read' | '
|
|
134
|
+
export type ExtensionUiPermission = 'agent.send' | 'agent.subscribe' | 'session.read' | 'config.read' | 'config.write' | 'storage' | 'notification' | 'theme';
|
|
135
135
|
/** All UI contribution points an extension can declare. */
|
|
136
136
|
export interface ExtensionUiContributions {
|
|
137
|
-
sidebarPanels?: SidebarPanelContribution[];
|
|
138
137
|
settingsPanels?: SettingsPanelContribution[];
|
|
139
138
|
chatWidgets?: ChatWidgetContribution[];
|
|
140
139
|
pages?: PageContribution[];
|
|
141
140
|
commands?: CommandContribution[];
|
|
142
|
-
statusBarItems?: StatusBarItemContribution[];
|
|
143
|
-
}
|
|
144
|
-
/** A panel rendered in the sidebar area. */
|
|
145
|
-
export interface SidebarPanelContribution {
|
|
146
|
-
id: string;
|
|
147
|
-
title: string;
|
|
148
|
-
icon?: string;
|
|
149
|
-
entrypoint: string;
|
|
150
|
-
defaultVisible?: boolean;
|
|
151
|
-
/** When-expression for visibility (see Phase 2). */
|
|
152
|
-
when?: string;
|
|
153
141
|
}
|
|
154
142
|
/** A panel rendered inside the settings page. */
|
|
155
143
|
export interface SettingsPanelContribution {
|
|
@@ -182,7 +170,6 @@ export interface PageContribution {
|
|
|
182
170
|
showInNav?: boolean;
|
|
183
171
|
/** Lucide icon name */
|
|
184
172
|
navIcon?: string;
|
|
185
|
-
when?: string;
|
|
186
173
|
}
|
|
187
174
|
/** A command registered in the command palette. */
|
|
188
175
|
export interface CommandContribution {
|
|
@@ -192,15 +179,6 @@ export interface CommandContribution {
|
|
|
192
179
|
opensPanel?: string;
|
|
193
180
|
/** Optional chat slash name (e.g. `/hello`); bound via `api.onCommand`. */
|
|
194
181
|
chatAlias?: string;
|
|
195
|
-
when?: string;
|
|
196
|
-
}
|
|
197
|
-
/** A small widget rendered in the status bar. */
|
|
198
|
-
export interface StatusBarItemContribution {
|
|
199
|
-
id: string;
|
|
200
|
-
entrypoint: string;
|
|
201
|
-
position?: 'left' | 'right';
|
|
202
|
-
width?: number;
|
|
203
|
-
when?: string;
|
|
204
182
|
}
|
|
205
183
|
export interface ProviderAuthChoice {
|
|
206
184
|
provider: string;
|
|
@@ -223,9 +201,7 @@ export interface ActivationDeclaration {
|
|
|
223
201
|
/** When false, extension code loads after gateway ready (sidecar). Default: eager at startup. */
|
|
224
202
|
onStartup?: boolean;
|
|
225
203
|
onProviders?: string[];
|
|
226
|
-
onCommands?: string[];
|
|
227
204
|
onChannels?: string[];
|
|
228
|
-
onCapabilities?: Array<'provider' | 'channel' | 'tool' | 'hook'>;
|
|
229
205
|
}
|
|
230
206
|
export interface ContractDeclaration {
|
|
231
207
|
tools?: string[];
|
|
@@ -168,7 +168,7 @@ export interface ProviderResponse {
|
|
|
168
168
|
}
|
|
169
169
|
export interface ProviderRegistry {
|
|
170
170
|
/** Register a provider */
|
|
171
|
-
register(provider: ProviderPlugin): void;
|
|
171
|
+
register(provider: ProviderPlugin): () => void;
|
|
172
172
|
/** Get a provider by ID */
|
|
173
173
|
get(id: string): ProviderPlugin | undefined;
|
|
174
174
|
/** List all providers */
|
|
@@ -37,15 +37,3 @@ export interface OAuthCredentials {
|
|
|
37
37
|
refresh?: string;
|
|
38
38
|
expiresAt?: number;
|
|
39
39
|
}
|
|
40
|
-
export interface FlagConfig {
|
|
41
|
-
type: 'boolean' | 'string';
|
|
42
|
-
default?: FlagValue;
|
|
43
|
-
description: string;
|
|
44
|
-
aliases?: string[];
|
|
45
|
-
}
|
|
46
|
-
export type FlagValue = boolean | string | undefined;
|
|
47
|
-
export interface ShortcutConfig {
|
|
48
|
-
description: string;
|
|
49
|
-
handler: ShortcutHandler;
|
|
50
|
-
}
|
|
51
|
-
export type ShortcutHandler = (context: unknown) => void | Promise<void>;
|
|
@@ -3,11 +3,12 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { init_paths, resolveBundledExtensionsDir, resolveExtensionsDir } from "../config/paths.js";
|
|
4
4
|
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
5
|
import { downloadExtensionStoreZipBuffer, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, verifyStoreArtifactSha256 } from "../agent/skills/marketplace/adapters/store/store-api-client.js";
|
|
6
|
-
import { getExtensionLockfileManager } from "./lockfile.js";
|
|
7
|
-
import {
|
|
6
|
+
import { computeExtensionDirectoryIntegrity, getExtensionLockfileManager } from "./lockfile.js";
|
|
7
|
+
import { commitStagedExtensionInstall, finalizeStagedExtensionInstall, rollbackStagedExtensionInstall, stageExtensionNpm, stageExtensionStoreZip } from "./install-transaction.js";
|
|
8
8
|
import { findExtension } from "./marketplace.js";
|
|
9
9
|
import { join } from "node:path";
|
|
10
|
-
import { existsSync, readFileSync, readdirSync
|
|
10
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
11
|
+
import { createHash } from "node:crypto";
|
|
11
12
|
import semver from "semver";
|
|
12
13
|
//#region src/extensions/update.ts
|
|
13
14
|
/**
|
|
@@ -18,6 +19,35 @@ init_loader();
|
|
|
18
19
|
init_logger();
|
|
19
20
|
const log = createLogger("ExtensionUpdate");
|
|
20
21
|
const MANIFEST = "xopc.extension.json";
|
|
22
|
+
function readJsonObject(path) {
|
|
23
|
+
try {
|
|
24
|
+
const value = JSON.parse(readFileSync(path, "utf-8"));
|
|
25
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
26
|
+
} catch {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function installedSnapshots(targetDir, extensionId) {
|
|
31
|
+
const root = join(targetDir, extensionId);
|
|
32
|
+
return {
|
|
33
|
+
manifest: readJsonObject(join(root, MANIFEST)),
|
|
34
|
+
packageJson: readJsonObject(join(root, "package.json"))
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
async function commitStagedWithLock(transaction, lock, writeLock) {
|
|
38
|
+
const snapshot = await lock.load();
|
|
39
|
+
let lockWriteStarted = false;
|
|
40
|
+
try {
|
|
41
|
+
commitStagedExtensionInstall(transaction, true);
|
|
42
|
+
lockWriteStarted = true;
|
|
43
|
+
await writeLock();
|
|
44
|
+
} catch (error) {
|
|
45
|
+
rollbackStagedExtensionInstall(transaction);
|
|
46
|
+
if (lockWriteStarted) await lock.save(snapshot);
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
finalizeStagedExtensionInstall(transaction);
|
|
50
|
+
}
|
|
21
51
|
function readInstalledExtensionVersion(targetDir, extensionId) {
|
|
22
52
|
const manifestPath = join(targetDir, extensionId, MANIFEST);
|
|
23
53
|
if (!existsSync(manifestPath)) return;
|
|
@@ -46,7 +76,9 @@ async function upsertNpmExtensionLock(lock, targetDir, result, spec) {
|
|
|
46
76
|
name: result.extensionId,
|
|
47
77
|
version: ver,
|
|
48
78
|
resolved,
|
|
49
|
-
source: "npm"
|
|
79
|
+
source: "npm",
|
|
80
|
+
installedIntegrity: computeExtensionDirectoryIntegrity(join(targetDir, result.extensionId)),
|
|
81
|
+
...installedSnapshots(targetDir, result.extensionId)
|
|
50
82
|
});
|
|
51
83
|
}
|
|
52
84
|
async function installExtensionFromStoreWithLock(params) {
|
|
@@ -54,20 +86,27 @@ async function installExtensionFromStoreWithLock(params) {
|
|
|
54
86
|
const { downloadUrl, version, sha256 } = await resolveExtensionZipDownloadUrl(params.storeBase, params.packageName, params.version);
|
|
55
87
|
const buf = await downloadExtensionStoreZipBuffer(params.storeBase, downloadUrl);
|
|
56
88
|
verifyStoreArtifactSha256(buf, sha256);
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
89
|
+
const transaction = await stageExtensionStoreZip(buf, params.targetDir);
|
|
90
|
+
if (transaction.extensionId !== params.expectedExtensionId) {
|
|
91
|
+
rollbackStagedExtensionInstall(transaction);
|
|
92
|
+
return {
|
|
93
|
+
ok: false,
|
|
94
|
+
error: `Expected extension ${params.expectedExtensionId}, received ${transaction.extensionId}`
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
await commitStagedWithLock(transaction, params.lock, () => params.lock.upsert(transaction.extensionId, {
|
|
98
|
+
name: transaction.extensionId,
|
|
64
99
|
version,
|
|
65
100
|
resolved: params.packageName,
|
|
66
|
-
source: "store"
|
|
67
|
-
|
|
101
|
+
source: "store",
|
|
102
|
+
artifactUrl: downloadUrl,
|
|
103
|
+
integrity: `sha256-${createHash("sha256").update(buf).digest("base64")}`,
|
|
104
|
+
installedIntegrity: computeExtensionDirectoryIntegrity(transaction.targetDir),
|
|
105
|
+
...installedSnapshots(params.targetDir, transaction.extensionId)
|
|
106
|
+
}));
|
|
68
107
|
return {
|
|
69
108
|
ok: true,
|
|
70
|
-
extensionId:
|
|
109
|
+
extensionId: transaction.extensionId,
|
|
71
110
|
version
|
|
72
111
|
};
|
|
73
112
|
} catch (err) {
|
|
@@ -112,14 +151,10 @@ async function updateSingleExtension(params) {
|
|
|
112
151
|
const { extensionId, entry, targetDir, storeBase, lock, timeoutMs, logger } = params;
|
|
113
152
|
const currentVersion = readInstalledExtensionVersion(targetDir, extensionId);
|
|
114
153
|
if (entry.source === "store") {
|
|
115
|
-
const pkgName = entry.resolved?.trim() || extensionId;
|
|
116
|
-
if (existsSync(join(targetDir, extensionId))) rmSync(join(targetDir, extensionId), {
|
|
117
|
-
recursive: true,
|
|
118
|
-
force: true
|
|
119
|
-
});
|
|
120
154
|
const result = await installExtensionFromStoreWithLock({
|
|
121
155
|
storeBase,
|
|
122
|
-
packageName:
|
|
156
|
+
packageName: entry.resolved?.trim() || extensionId,
|
|
157
|
+
expectedExtensionId: extensionId,
|
|
123
158
|
targetDir,
|
|
124
159
|
lock
|
|
125
160
|
});
|
|
@@ -153,13 +188,20 @@ async function updateSingleExtension(params) {
|
|
|
153
188
|
status: "skipped",
|
|
154
189
|
message: `Skipping "${extensionId}" (could not resolve npm package).`
|
|
155
190
|
};
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
191
|
+
let transaction;
|
|
192
|
+
try {
|
|
193
|
+
transaction = await stageExtensionNpm(spec, targetDir, timeoutMs);
|
|
194
|
+
if (transaction.extensionId !== extensionId) {
|
|
195
|
+
rollbackStagedExtensionInstall(transaction);
|
|
196
|
+
throw new Error(`Expected extension ${extensionId}, received ${transaction.extensionId}`);
|
|
197
|
+
}
|
|
198
|
+
await commitStagedWithLock(transaction, lock, () => upsertNpmExtensionLock(lock, targetDir, {
|
|
199
|
+
ok: true,
|
|
200
|
+
extensionId: transaction.extensionId,
|
|
201
|
+
targetDir: transaction.targetDir
|
|
202
|
+
}, spec));
|
|
203
|
+
} catch (error) {
|
|
204
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
163
205
|
logger.error?.(`Failed to update ${extensionId}: ${message}`);
|
|
164
206
|
return {
|
|
165
207
|
extensionId,
|
|
@@ -168,9 +210,8 @@ async function updateSingleExtension(params) {
|
|
|
168
210
|
currentVersion
|
|
169
211
|
};
|
|
170
212
|
}
|
|
171
|
-
|
|
172
|
-
const
|
|
173
|
-
const resolvedId = installResult.extensionId ?? extensionId;
|
|
213
|
+
const nextVersion = readInstalledExtensionVersion(targetDir, transaction.extensionId) ?? entry.version;
|
|
214
|
+
const resolvedId = transaction.extensionId;
|
|
174
215
|
const status = currentVersion && nextVersion && currentVersion === nextVersion ? "unchanged" : "updated";
|
|
175
216
|
return {
|
|
176
217
|
extensionId: resolvedId,
|
|
@@ -4,11 +4,11 @@ import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope
|
|
|
4
4
|
import { createConversation, init_conversation_repository, resolveRoutedConversation } from "../../storage/sqlite/conversation-repository.js";
|
|
5
5
|
import { shouldSilence, stripHeartbeatToken } from "../../heartbeat/tokens.js";
|
|
6
6
|
import { proactiveChecksAllowed, proactivePreferences } from "../../proactive/policy/service.js";
|
|
7
|
-
import { beginHeartbeatCheck, completeHeartbeatCheck, deliverHeartbeatChecks, recentHeartbeatChecks, recoverHeartbeatChecks } from "./check-store.js";
|
|
8
|
-
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
9
7
|
import { isWithinActiveHours } from "../../heartbeat/active-hours.js";
|
|
10
8
|
import { isHeartbeatContentEmpty } from "../../heartbeat/content-check.js";
|
|
9
|
+
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
11
10
|
import { createHeartbeatWake } from "../../heartbeat/wake.js";
|
|
11
|
+
import { beginHeartbeatCheck, completeHeartbeatCheck, deliverHeartbeatChecks, recentHeartbeatChecks, recoverHeartbeatChecks } from "./check-store.js";
|
|
12
12
|
import { resolveHeartbeatMdPath } from "../workspace-heartbeat-path.js";
|
|
13
13
|
import { readFile } from "fs/promises";
|
|
14
14
|
//#region src/gateway/heartbeat/service.ts
|
|
@@ -245,8 +245,10 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
245
245
|
knowledgeMemory: {
|
|
246
246
|
enabled: boolean;
|
|
247
247
|
writePolicy: "allow" | "confirm" | "deny";
|
|
248
|
-
|
|
248
|
+
readScopes: ("project" | "session" | "agent" | "workspace" | "global")[];
|
|
249
|
+
contentSources: ("memory" | "connector" | "local_import")[];
|
|
249
250
|
searchStrategy: "local-first" | "external-first" | "fanout" | "local-only" | "external-only";
|
|
251
|
+
searchTimeoutMs: number;
|
|
250
252
|
writeStrategy: "local-first" | "external-first" | "local-only" | "external-only" | "write-through";
|
|
251
253
|
allowExternalWrites: boolean;
|
|
252
254
|
allowedProviderIds?: string[];
|