@xopcai/xopc 0.0.303 → 0.0.307
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-wgSB2HYK.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Ch3DzUvP.js → agent-avatar-dicebear-CZeQo09T.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BPsRb9Ck.js +1 -0
- package/dist/gateway/static/root/assets/{agents-DXHD-ST3.js → agents-BlrHMbRx.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CAV9PN9i.js → api-BKHmTb0w.js} +1 -1
- package/dist/gateway/static/root/assets/api-DFOlahZv.js +1 -0
- package/dist/gateway/static/root/assets/app-management-settings-panel-Bzw4fQP8.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-8GZpUXva.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-BkQQtIxH.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BKGzaVvM.js → archive-plugin-CQ2NaoHb.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-8bARdLnp.js → attachment-load-BFi1H7yJ.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BAEenyzx.js → automations-page-CDBXcii_.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CUpiTTiY.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Cv3GS9Eo.js → binary-plugins-D07eWmOx.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-CtVnjyYU.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-BGT0xoTv.js → browser-automation-inputs-BzkJog8e.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-D1O22WIf.js → browser-automations-page-DyrSbDdG.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-CqTxLpil.js +3 -0
- package/dist/gateway/static/root/assets/button-CS04eWY9.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BZ_-pnS6.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-DAD9qE3J.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-C_icwbWj.js → channels-status-swr-B2JwuTjG.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-D-JYPVYl.js → chat-terminal-dock-B62SZdAo.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-Bcfp948A.js → computer-settings-page-ClSresNq.js} +1 -1
- package/dist/gateway/static/root/assets/connector-service-page-CPqVmNvx.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-BUQyg3CW.js +2 -0
- package/dist/gateway/static/root/assets/cron-expression-CTMi_tql.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-B71AJK50.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-UtoUm57Q.js → dependency-picker-DlyGK-kA.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Bryx7gRM.js → desktop-pet-DGkbTE8_.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-BY8r9j66.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-DzRrgd59.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-DQlFTVBx.js → extension-debug-page-L8Mm1n3A.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BSsqRDXh.js → extension-page-CFc4vSNU.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DbVZv9ve.js → extension-settings-page-B5zWyHr3.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-D5AM8cyQ.js → gateway-config-swr-B6wHa6ZI.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-B53R0CA4.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-BLDgrJ30.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-D7qmTH4R.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CSJWdnFs.js → gateway-startup-retry-DRzGnEV-.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-Cxowc29b.js → heartbeat-settings-Glsl3X5b.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-s9hDQ8Hc.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-BNh604hw.js → image-generation-api-Ck_pyDom.js} +1 -1
- package/dist/gateway/static/root/assets/imports-page-ByBX7ome.js +1 -0
- package/dist/gateway/static/root/assets/index-RBCkv8a_.js +79 -0
- package/dist/gateway/static/root/assets/index-cFU4S35z.css +1 -0
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-C45RlO8a.js +1 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-DP0x2jpR.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-CXPaPDGm.js → local-apps-page-C_AQc2bI.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DLK05Y1a.js → locale-store-msTfRK8P.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DvM8Pyok.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-D1uwSutV.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-B8maDRWh.js → markdown-view-BInabSKf.js} +2 -2
- package/dist/gateway/static/root/assets/{media-plugins-tSJ0CvcX.js → media-plugins-C4mhf13f.js} +1 -1
- package/dist/gateway/static/root/assets/messages-F74LVAiU.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-D35sErp2.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-8jCDklDn.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-CQx6H-GS.js → page-tabs-1go_BtX1.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-DmoSC0j1.js} +1 -1
- package/dist/gateway/static/root/assets/{proactive-page-D46cR3sf.js → proactive-page-xAjKTIID.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CujZXOea.js → product-open-page-gmi5LLwM.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BUMQHy_N.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DT-Mt7XR.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BMFL4vis.js → registry-api-BSWtko7U.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Clz3byir.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CR0qvq9C.js → runtime-tools-settings-panel-ClkOoxDl.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-BUD9lLEE.js → schema-form-BuEmLiaU.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-tQRwktKm.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DqWg9XS5.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BZPCUH6a.js → settings-form-section-Dor39QON.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-XoHmqIdm.js → settings-page-Xj-yvIc8.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BB_sMB7P.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-BFWZoXdm.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-oDALm4b6.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DmwelnfK.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-BE9JXz4U.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-CH-quGxZ.js → skills-page.utils-Ii8qeXhs.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CGC7eBso.js → system-settings-panel-Di6OSO-0.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-D1AWszc7.js +1 -0
- package/dist/gateway/static/root/assets/theme-store-1SZ-HFHX.js +1 -0
- package/dist/gateway/static/root/assets/tunnel-api-DDOlOYlj.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-BydB6x2K.js → use-autosave-CQ8uWNnB.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-C00i4ea0.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CPUDBcag.js → voice-api-key-field-COTzshjL.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-bZqN8-UF.js → voice-config-api-DgJML_uM.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-D_FmJbGH.js → work-discovery-overlay-_URrXbi4.js} +1 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-CALs-1nd.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-BUiBjz6m.js +6 -0
- package/dist/gateway/static/root/channel-icons/feishu.svg +6 -12
- package/dist/gateway/static/root/connector-icons/SOURCES.md +12 -0
- package/dist/gateway/static/root/connector-icons/dingtalk-mark.svg +1 -0
- package/dist/gateway/static/root/connector-icons/tencent-meeting-mark.svg +37 -0
- package/dist/gateway/static/root/connector-icons/wps-calendar.svg +14 -0
- package/dist/gateway/static/root/connector-icons/wps-docs.svg +14 -0
- package/dist/gateway/static/root/connector-icons/wps-mail.svg +7 -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/external-tools/composio-provider.js +83 -20
- package/dist/src/agent/external-tools/gateway-tools.js +2 -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/bundle-mcp-runtime.js +1 -1
- package/dist/src/agent/mcp/mcp-stdio-transport.js +5 -2
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
- 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/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 +22 -3
- package/dist/src/config/schema.js +13 -3
- package/dist/src/connectors/account-access.d.ts +4 -0
- package/dist/src/connectors/account-access.js +23 -0
- package/dist/src/connectors/approval-resume.d.ts +4 -0
- package/dist/src/connectors/approval-resume.js +23 -0
- package/dist/src/connectors/auth-provider-registry.d.ts +1 -0
- package/dist/src/connectors/auth-provider-registry.js +2 -1
- package/dist/src/connectors/authorization-attempts.d.ts +21 -0
- package/dist/src/connectors/authorization-attempts.js +33 -0
- package/dist/src/connectors/builtin-catalog.js +1 -3
- package/dist/src/connectors/catalog.js +2 -1
- package/dist/src/connectors/china-catalog.d.ts +2 -0
- package/dist/src/connectors/china-catalog.js +430 -0
- package/dist/src/connectors/composio-backends.d.ts +26 -0
- package/dist/src/connectors/composio-backends.js +65 -0
- package/dist/src/connectors/composio-catalog.js +2 -1
- package/dist/src/connectors/composio-managed-client.js +3 -1
- package/dist/src/connectors/composio-managed-events.js +5 -2
- package/dist/src/connectors/composio-session-types.d.ts +2 -0
- package/dist/src/connectors/composio-sessions.d.ts +11 -2
- package/dist/src/connectors/composio-sessions.js +137 -35
- package/dist/src/connectors/composio-triggers.js +4 -2
- package/dist/src/connectors/composio.d.ts +11 -8
- package/dist/src/connectors/composio.js +68 -84
- package/dist/src/connectors/connected-source-ingestion.js +4 -3
- package/dist/src/connectors/connection-recovery-service.js +25 -13
- package/dist/src/connectors/connector-identity.d.ts +2 -0
- package/dist/src/connectors/connector-identity.js +18 -5
- package/dist/src/connectors/content-enrichment.js +1 -1
- package/dist/src/connectors/instances.js +1 -7
- package/dist/src/connectors/learning-coordinator.js +4 -3
- package/dist/src/connectors/materialize.js +14 -1
- package/dist/src/connectors/policy.d.ts +1 -1
- package/dist/src/connectors/policy.js +1 -1
- package/dist/src/connectors/principal.js +24 -3
- package/dist/src/connectors/providers.d.ts +1 -0
- package/dist/src/connectors/providers.js +14 -2
- package/dist/src/connectors/runtime-adapter-registry.js +4 -9
- package/dist/src/connectors/secret-store.d.ts +4 -1
- package/dist/src/connectors/secret-store.js +7 -3
- package/dist/src/connectors/source-change-publisher.js +4 -2
- package/dist/src/connectors/types.d.ts +16 -11
- package/dist/src/connectors/workflow-preflight.d.ts +2 -1
- package/dist/src/connectors/workflow-preflight.js +20 -3
- 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/connectors.js +208 -17
- package/dist/src/gateway/hono/routes/context-sources.js +1 -1
- 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/home.js +4 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +0 -1
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/realtime.js +30 -8
- package/dist/src/gateway/hono/routes/user-model.js +25 -6
- package/dist/src/gateway/index.js +4 -1
- package/dist/src/gateway/lock.d.ts +2 -0
- package/dist/src/gateway/lock.js +31 -14
- package/dist/src/gateway/run-loop.js +2 -1
- 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/run-command.js +15 -50
- package/dist/src/infra/update-restart.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/proactive/follow-ups.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/connection-wait-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/connection-wait-repository.js +63 -2
- package/dist/src/storage/sqlite/connector-account-repository.d.ts +6 -0
- package/dist/src/storage/sqlite/connector-account-repository.js +35 -7
- package/dist/src/storage/sqlite/connector-repository.js +15 -10
- package/dist/src/storage/sqlite/connector-sync-policy-repository.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 +6 -4
- 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/182_connector_account_policies.sql +92 -0
- package/dist/src/storage/sqlite/migrations/183_connector_backend_consistency.sql +20 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +7 -7
- 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/tasks/home-query-service.js +3 -3
- 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 +31 -4
- 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-startup-resources.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/dist/src/workflows/domain/definition.d.ts +1 -0
- package/dist/src/workflows/domain/validation.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +14 -0
- package/dist/src/workflows/service/workflow-session-bridge.d.ts +1 -0
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -0
- package/package.json +5 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-4oGrNj3m.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/appearance-settings-izNAyDhW.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
|
@@ -15,7 +15,9 @@ import { mergeActivationContext } from "./activation-context.js";
|
|
|
15
15
|
import { checkEngineCompatibility } from "./engine-check.js";
|
|
16
16
|
import { validateSpeechProviderContracts } from "./speech-provider-contracts.js";
|
|
17
17
|
import { validateMediaUnderstandingProviderContracts } from "./media-provider-contracts.js";
|
|
18
|
-
import {
|
|
18
|
+
import { validateExtensionConfig } from "./config-validation.js";
|
|
19
|
+
import { EXTENSION_API_VERSION, EXTENSION_UI_API_VERSION, checkExtensionApiCompatibility } from "./api-version.js";
|
|
20
|
+
import { DEFAULT_SECURITY_CONFIG, checkExtensionDirSafety, checkExtensionPathSafety, isExtensionAllowed, logSecurityIssue, provenanceTracker } from "./security.js";
|
|
19
21
|
import { getSlotRegistry } from "./slots.js";
|
|
20
22
|
import { getExtensionCache, getExtensionDiagnostics } from "./diagnostics.js";
|
|
21
23
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -59,6 +61,7 @@ var ExtensionLoader = class {
|
|
|
59
61
|
registry;
|
|
60
62
|
options;
|
|
61
63
|
extensionInstances = /* @__PURE__ */ new Map();
|
|
64
|
+
startedServiceIds = /* @__PURE__ */ new Set();
|
|
62
65
|
jiti;
|
|
63
66
|
_appConfig;
|
|
64
67
|
_runtimeContext;
|
|
@@ -316,6 +319,20 @@ var ExtensionLoader = class {
|
|
|
316
319
|
}, "Extension blocked because its path is unsafe");
|
|
317
320
|
return null;
|
|
318
321
|
}
|
|
322
|
+
if (this.securityConfig.checkPermissions) {
|
|
323
|
+
const directorySafety = checkExtensionDirSafety(extensionPath, extensionPath, source);
|
|
324
|
+
if (!directorySafety.safe) {
|
|
325
|
+
const firstIssue = directorySafety.issues[0];
|
|
326
|
+
if (firstIssue) logSecurityIssue(config.id, firstIssue);
|
|
327
|
+
const detail = firstIssue?.detail ?? "Unsafe file in extension directory";
|
|
328
|
+
this.diagnostics.error(config.id, detail);
|
|
329
|
+
log.error({
|
|
330
|
+
extensionId: config.id,
|
|
331
|
+
detail
|
|
332
|
+
}, "Extension directory safety check failed");
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
319
336
|
if (source !== "bundled" && !isExtensionAllowed(config.id, this.securityConfig)) {
|
|
320
337
|
this.diagnostics.error(config.id, "Extension is not present in extensions.security.allow");
|
|
321
338
|
log.error({
|
|
@@ -377,42 +394,40 @@ var ExtensionLoader = class {
|
|
|
377
394
|
this.diagnostics.error(config.id, engineResult.reason ?? "Incompatible xopc version (engines.xopc)");
|
|
378
395
|
return null;
|
|
379
396
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
397
|
+
for (const [engineName, requiredRange, currentVersion] of [[
|
|
398
|
+
"extensionApi",
|
|
399
|
+
manifest.engines.extensionApi,
|
|
400
|
+
EXTENSION_API_VERSION
|
|
401
|
+
], [
|
|
402
|
+
"extensionUiApi",
|
|
403
|
+
manifest.engines.extensionUiApi,
|
|
404
|
+
EXTENSION_UI_API_VERSION
|
|
405
|
+
]]) {
|
|
406
|
+
const result = checkExtensionApiCompatibility(requiredRange, currentVersion, engineName);
|
|
407
|
+
if (result.parseWarning || !result.compatible) {
|
|
408
|
+
const reason = result.reason ?? `Incompatible engines.${engineName}`;
|
|
409
|
+
log.warn({
|
|
410
|
+
extensionId: config.id,
|
|
411
|
+
requiredRange,
|
|
412
|
+
currentVersion
|
|
413
|
+
}, reason);
|
|
414
|
+
this.diagnostics.error(config.id, reason);
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
if (manifest.configSchema) {
|
|
419
|
+
const result = validateExtensionConfig(manifest.configSchema, config.config ?? {});
|
|
420
|
+
if (result.valid === false) {
|
|
421
|
+
log.error({
|
|
422
|
+
extensionId: config.id,
|
|
423
|
+
validationErrors: result.errors
|
|
424
|
+
}, `Extension config validation failed: ${result.reason}`);
|
|
425
|
+
this.diagnostics.error(config.id, `Extension config validation failed: ${result.reason}`);
|
|
426
|
+
return null;
|
|
407
427
|
}
|
|
408
428
|
log.debug({ extensionId: config.id }, "Extension config validated");
|
|
409
|
-
} catch (err) {
|
|
410
|
-
log.warn({
|
|
411
|
-
err,
|
|
412
|
-
extensionId: config.id
|
|
413
|
-
}, "Config schema validation skipped");
|
|
414
429
|
}
|
|
415
|
-
const extensionDir =
|
|
430
|
+
const extensionDir = extensionPath;
|
|
416
431
|
const api = this.createExtensionApi(manifest, config, extensionDir);
|
|
417
432
|
const module = await this.loadModule(extensionPath, manifest);
|
|
418
433
|
if (!module) {
|
|
@@ -421,7 +436,14 @@ var ExtensionLoader = class {
|
|
|
421
436
|
return null;
|
|
422
437
|
}
|
|
423
438
|
if (!this.claimExtensionSlots(config.id, manifest)) log.warn({ extensionId: config.id }, "Failed to claim required slots");
|
|
424
|
-
|
|
439
|
+
try {
|
|
440
|
+
await this.initializeExtension(module, api, manifest);
|
|
441
|
+
} catch (error) {
|
|
442
|
+
api._cleanup();
|
|
443
|
+
this.registry.removeExtensionContributions(config.id);
|
|
444
|
+
this.releaseExtensionSlots(config.id);
|
|
445
|
+
throw error;
|
|
446
|
+
}
|
|
425
447
|
validateSpeechProviderContracts({
|
|
426
448
|
extensionId: config.id,
|
|
427
449
|
manifest,
|
|
@@ -490,6 +512,9 @@ var ExtensionLoader = class {
|
|
|
490
512
|
if (!claimed) this.diagnostics.warn(extensionId, `Slot "${slotKey}" already claimed by another extension`);
|
|
491
513
|
return claimed;
|
|
492
514
|
}
|
|
515
|
+
releaseExtensionSlots(extensionId) {
|
|
516
|
+
for (const [key, claim] of this.slotRegistry.getAllClaims()) if (claim.pluginId === extensionId) this.slotRegistry.release(key, extensionId);
|
|
517
|
+
}
|
|
493
518
|
loadManifest(extensionPath) {
|
|
494
519
|
const manifestPath = join(extensionPath, EXTENSION_MANIFEST_FILE);
|
|
495
520
|
if (existsSync(manifestPath)) try {
|
|
@@ -557,13 +582,16 @@ var ExtensionLoader = class {
|
|
|
557
582
|
async initializeExtension(module, api, _manifest) {
|
|
558
583
|
if (typeof module === "function") await module(api);
|
|
559
584
|
else if (typeof module === "object" && module.register) await module.register(api);
|
|
585
|
+
if (typeof module === "object" && module.activate) await module.activate(api);
|
|
560
586
|
}
|
|
561
587
|
async startServices() {
|
|
562
588
|
const services = Array.from(this.registry.services.values());
|
|
563
589
|
for (const service of services) {
|
|
590
|
+
if (this.startedServiceIds.has(service.id)) continue;
|
|
564
591
|
const serviceLog = createServiceLogger(service.id);
|
|
565
592
|
try {
|
|
566
593
|
await service.start?.();
|
|
594
|
+
this.startedServiceIds.add(service.id);
|
|
567
595
|
serviceLog.info(`Started service`);
|
|
568
596
|
} catch (error) {
|
|
569
597
|
serviceLog.error({ err: error }, `Failed to start service`);
|
|
@@ -572,27 +600,61 @@ var ExtensionLoader = class {
|
|
|
572
600
|
}
|
|
573
601
|
async stopServices() {
|
|
574
602
|
const services = Array.from(this.registry.services.values()).reverse();
|
|
575
|
-
for (const service of services)
|
|
603
|
+
for (const service of services) {
|
|
604
|
+
if (!this.startedServiceIds.has(service.id)) continue;
|
|
576
605
|
const serviceLog = createServiceLogger(service.id);
|
|
577
606
|
try {
|
|
578
|
-
|
|
579
|
-
|
|
607
|
+
if (service.stop) {
|
|
608
|
+
await service.stop();
|
|
609
|
+
serviceLog.info(`Stopped service`);
|
|
610
|
+
}
|
|
580
611
|
} catch (error) {
|
|
581
612
|
serviceLog.error({ err: error }, `Failed to stop service`);
|
|
613
|
+
} finally {
|
|
614
|
+
this.startedServiceIds.delete(service.id);
|
|
582
615
|
}
|
|
583
616
|
}
|
|
584
617
|
}
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
618
|
+
async unloadExtension(extensionId) {
|
|
619
|
+
const api = this.extensionInstances.get(extensionId);
|
|
620
|
+
const record = this.registry.getExtension(extensionId);
|
|
621
|
+
if (!api || !record) return false;
|
|
622
|
+
for (const service of this.registry.getServicesForExtension(extensionId).reverse()) {
|
|
623
|
+
if (!this.startedServiceIds.has(service.id)) continue;
|
|
624
|
+
try {
|
|
625
|
+
await service.stop?.();
|
|
626
|
+
} catch (error) {
|
|
627
|
+
log.error({
|
|
628
|
+
err: error,
|
|
629
|
+
extensionId,
|
|
630
|
+
serviceId: service.id
|
|
631
|
+
}, "Extension service stop failed");
|
|
632
|
+
} finally {
|
|
633
|
+
this.startedServiceIds.delete(service.id);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
const module = record.module;
|
|
637
|
+
try {
|
|
638
|
+
if (module && typeof module === "object" && module.deactivate) await module.deactivate(api);
|
|
639
|
+
} catch (error) {
|
|
640
|
+
log.error({
|
|
641
|
+
err: error,
|
|
642
|
+
extensionId
|
|
643
|
+
}, "Extension deactivation failed");
|
|
644
|
+
} finally {
|
|
645
|
+
api._cleanup();
|
|
646
|
+
this.registry.removeExtensionContributions(extensionId);
|
|
647
|
+
this.releaseExtensionSlots(extensionId);
|
|
648
|
+
this.extensionInstances.delete(extensionId);
|
|
649
|
+
this.cache.invalidate();
|
|
650
|
+
}
|
|
651
|
+
this.diagnostics.info(extensionId, "Unloaded extension");
|
|
594
652
|
return true;
|
|
595
653
|
}
|
|
654
|
+
async shutdown() {
|
|
655
|
+
await this.stopServices();
|
|
656
|
+
for (const extensionId of [...this.extensionInstances.keys()].reverse()) await this.unloadExtension(extensionId);
|
|
657
|
+
}
|
|
596
658
|
};
|
|
597
659
|
function resolveExtensionPath(id, _options) {
|
|
598
660
|
const c = loadConfig();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function computeExtensionDirectoryIntegrity(extensionDir: string): string | undefined;
|
|
1
2
|
export type ExtensionSource = 'npm' | 'local' | 'git' | 'store';
|
|
2
3
|
export interface ExtensionLockEntry {
|
|
3
4
|
/** Extension ID */
|
|
@@ -37,7 +38,8 @@ export interface ExtensionsLockfile {
|
|
|
37
38
|
}
|
|
38
39
|
export declare class ExtensionLockfileManager {
|
|
39
40
|
private readonly lockfilePath;
|
|
40
|
-
|
|
41
|
+
private readonly extensionsDir;
|
|
42
|
+
constructor(lockfilePath?: string, extensionsDir?: string);
|
|
41
43
|
/**
|
|
42
44
|
* Load the lockfile
|
|
43
45
|
*/
|
|
@@ -85,10 +87,6 @@ export declare class ExtensionLockfileManager {
|
|
|
85
87
|
* Freeze current state (save with validation)
|
|
86
88
|
*/
|
|
87
89
|
freeze(): Promise<ExtensionsLockfile>;
|
|
88
|
-
/**
|
|
89
|
-
* Generate integrity hash for a file
|
|
90
|
-
*/
|
|
91
|
-
static generateIntegrity(filePath: string): Promise<string>;
|
|
92
90
|
}
|
|
93
91
|
export declare function getExtensionLockfileManager(lockfilePath?: string): ExtensionLockfileManager;
|
|
94
92
|
export declare function resetExtensionLockfileManager(): void;
|
|
@@ -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[];
|