@xopcai/xopc 0.0.320 → 0.0.323
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/dist/assets/{auth-DKo-NMUY.js → auth-DocRzRlS.js} +95 -21
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +18 -2
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BXLU0HJa.js → agent-avatar-dicebear-DFzmThVi.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CAFHadiy.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-DYFYiuig.js +1 -0
- package/dist/gateway/static/root/assets/{agents-hrbGiOHn.js → agents-BqIlB5Co.js} +1 -1
- package/dist/gateway/static/root/assets/{app-link-nL8iPwEr.js → app-link-C6gA5Nck.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-C0jEvonH.js → app-management-settings-panel-BgvMRGWe.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-ByVRv2Oe.js → appearance-settings-CliHU03A.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-Drt3Foi9.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-CMITc1PQ.js → archive-plugin-DnuPpm0u.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-B5Z1PKHm.js → attachment-load-BiwaK0ie.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BOcXqVar.js → automations-page-CJSISGQH.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-B-Eduqwz.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BkRb9adx.js → binary-plugins-KDjduQZO.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DsmDlkC2.js → block-editor-bclvgove.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-BgBH3eFk.js → browser-automation-inputs-CfQ2T9t6.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-e3KpurLo.js → browser-automations-page-Cxq38Nnp.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-Dwgir6mu.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-H5L5vynP.js +8 -0
- package/dist/gateway/static/root/assets/capabilities-uFKh3Hd0.js +1 -0
- package/dist/gateway/static/root/assets/channels-settings-RFBRYe5S.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DUdkU1C5.js → chat-terminal-dock-DKQC62nQ.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-C6WR9Syy.js → computer-settings-page-D1whpIqL.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-SVKcySx0.js → connector-service-page-BAuYTgf5.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-Px-v3Q6Q.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-DBD5yedi.js → date-picker-CfCo3lqh.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-HE41Co5W.js → dependency-picker-DOuVO2M1.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DH9EU9O3.js → desktop-pet-D9tu6Bhu.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-Br6Z1Vau.js → desktop-pet-settings-CQPXub2f.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DxkOYSut.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-CFjVNb1m.js → extension-debug-page-CtWClPz-.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BQ3ldBhh.js → extension-page-BHh9HLCz.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CaXnWbRI.js → extension-settings-page-BdT3v5Uh.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-DgFmBSH9.js → gateway-config-swr-1eqyz9vZ.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-CZas_Ekx.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-C7h3xef0.js → gateway-startup-retry-C4rsW6vJ.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-w3_aWeNt.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DJ1xaz2p.js → image-generation-api-B5DXMylk.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-CaB54QIp.js → imports-page-B1JH0G5j.js} +1 -1
- package/dist/gateway/static/root/assets/index--3c0awkr.js +121 -0
- package/dist/gateway/static/root/assets/index-CNc4N4TX.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DnvHvKQJ.js → keyboard-shortcuts-settings-DGrLJ8Yh.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BYKrJpFF.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-Bpja8nC6.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-page-DqjStqbL.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-C4RjTd0C.js → locale-store-BIkcRr3t.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-N0q5DxnI.js → logs-page-Dl4kM4Na.js} +2 -2
- package/dist/gateway/static/root/assets/management-settings-gCfH4cwH.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-DkPzc50Z.js → markdown-view-Ck_5MADq.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BzLYE9lj.js → media-plugins-DTsZqgo6.js} +1 -1
- package/dist/gateway/static/root/assets/messages-7VAhscYe.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-j6sioeL1.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-CMvvHv0f.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-DVnGa7Lu.js → page-context-capture-button-DTI_g4tz.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-q6lpN9OD.js → page-tabs-CfW_Q-K5.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Ck63fJaQ.js → preview-open-alternatives-CuPN-vAn.js} +1 -1
- package/dist/gateway/static/root/assets/product-delivery-bv3z8Xkh.js +1 -0
- package/dist/gateway/static/root/assets/product-open-page-BHjxRz1E.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-C9K_e-EV.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-Bk-es4i9.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-CRnytFLF.js → registry-api-BAAZUGnU.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CLGJNA42.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Bu3XyrDI.js → runtime-tools-settings-panel-CHJBJKL1.js} +2 -2
- package/dist/gateway/static/root/assets/{scenes-page-B_5HOUzl.js → scenes-page-ClLAD1pz.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-CbOOKW1B.js → schema-form-FQAit5HL.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-Xj8MkXN1.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DwALV8mi.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-D3UN4rb4.js → settings-form-section-BDc6bw1q.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BHztZayW.js → settings-page-DnhxBJjV.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-nskqtzZs.js → settings-page-layout-D3KNSQ5g.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BtukdJ-z.js → setup-status-panel-F0rCQ-2a.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-DbYXEqur.js → share-preview-page-DVQCRxwK.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-C7hf6Cov.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-xPrFejRE.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-CK9Jeaur.js → skills-page-RdDYu7Yj.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-B44aWbyL.js → skills-page.utils-mDwC9UJ-.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BwqpUGv_.js → system-settings-panel-Bk7GrMij.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-2A966jFY.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-BKTZzQIT.js → tunnel-api-D3Aquraj.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BB1JBOCz.js → use-autosave-C1xQ-sHn.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-CnBxPBVe.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-C-HsgED9.js → voice-api-key-field-DCNECvcp.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DvJKYYA0.js → voice-config-api-B-_niUTU.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-K3e5ONUo.js → work-discovery-overlay-BrGx_JS_.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-dXRTHBoE.js → workflow-run-setup-panel-CmmC2Pdr.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BZVpqw4T.js +6 -0
- package/dist/gateway/static/root/index.html +12 -11
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/capabilities.js +4 -110
- package/dist/packages/gateway-contract/src/chat-previews.js +73 -0
- package/dist/packages/gateway-contract/src/index.js +6 -0
- package/dist/packages/gateway-contract/src/local-apps.js +215 -0
- package/dist/packages/gateway-contract/src/product-delivery.js +62 -17
- package/dist/packages/gateway-contract/src/user-turn-document.js +60 -0
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +5 -4
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/embedded/transcript-runtime.d.ts +3 -0
- package/dist/src/agent/embedded/transcript-runtime.js +6 -0
- package/dist/src/agent/external-tools/cliProvider.js +4 -1
- package/dist/src/agent/external-tools/composio-provider.js +9 -3
- package/dist/src/agent/external-tools/gateway-tools.js +17 -10
- package/dist/src/agent/external-tools/mcp-provider.d.ts +3 -1
- package/dist/src/agent/external-tools/mcp-provider.js +91 -6
- package/dist/src/agent/external-tools/service.d.ts +2 -1
- package/dist/src/agent/external-tools/service.js +8 -3
- package/dist/src/agent/external-tools/types.d.ts +9 -0
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-config.js +37 -5
- package/dist/src/agent/mcp/bundle-mcp-gateway.d.ts +1 -0
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -0
- package/dist/src/agent/mcp/bundle-mcp-names.js +2 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +33 -1
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +4 -0
- package/dist/src/agent/mcp/index.js +1 -1
- package/dist/src/agent/mcp/mcp-stdio-transport.d.ts +1 -0
- package/dist/src/agent/mcp/mcp-stdio-transport.js +10 -0
- package/dist/src/agent/mcp/mcp-transport.js +12 -8
- package/dist/src/agent/mcp/oauth/index.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.d.ts +6 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +70 -14
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.d.ts +2 -0
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.js +12 -0
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.d.ts +3 -0
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +14 -2
- package/dist/src/agent/mcp/plugin-http-fetch.d.ts +2 -0
- package/dist/src/agent/mcp/plugin-http-fetch.js +56 -0
- package/dist/src/agent/service/process-direct-streaming.js +27 -12
- package/dist/src/agent/service.js +3 -2
- package/dist/src/agent/service.types.d.ts +2 -0
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +1 -1
- package/dist/src/agent/skills/index.js +8 -1
- package/dist/src/agent/skills/skill-manager.d.ts +2 -0
- package/dist/src/agent/skills/skill-manager.js +8 -0
- package/dist/src/agent/skills/skill-sources.js +17 -0
- package/dist/src/agent/skills/types.d.ts +3 -1
- package/dist/src/agent/source-context/injector.js +10 -5
- package/dist/src/agent/source-context/types.d.ts +3 -0
- package/dist/src/agent/source-context/types.js +8 -2
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +12 -2
- package/dist/src/agent/tools/automation-tool.js +1 -1
- package/dist/src/agent/tools/factory.d.ts +1 -0
- package/dist/src/agent/tools/factory.js +2 -1
- package/dist/src/agent/tools/search/registry.js +4 -1
- package/dist/src/agent/tools/workflow-tool.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.d.ts +4 -2
- package/dist/src/agent/tools/xopc-use-tool.js +120 -12
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-previews/index.d.ts +2 -0
- package/dist/src/chat-previews/index.js +3 -0
- package/dist/src/chat-previews/service.d.ts +27 -0
- package/dist/src/chat-previews/service.js +106 -0
- package/dist/src/chat-previews/store.d.ts +28 -0
- package/dist/src/chat-previews/store.js +77 -0
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +3 -3
- package/dist/src/cli/commands/extension-agent-plugin.d.ts +8 -0
- package/dist/src/cli/commands/extension-agent-plugin.js +82 -0
- package/dist/src/cli/commands/extension-marketplace.js +44 -4
- package/dist/src/cli/commands/extension.js +35 -3
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/computer/runtime.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +2 -2
- package/dist/src/config/schema.js +2 -2
- package/dist/src/connectors/account-selection.js +1 -1
- package/dist/src/connectors/connection-candidates.d.ts +4 -1
- package/dist/src/connectors/connection-candidates.js +8 -2
- package/dist/src/connectors/connection-capabilities.d.ts +2 -2
- package/dist/src/connectors/connection-capabilities.js +3 -1
- package/dist/src/connectors/connection-recovery-service.d.ts +6 -1
- package/dist/src/connectors/connection-recovery-service.js +138 -26
- package/dist/src/connectors/plugin-mcp-recovery.d.ts +28 -0
- package/dist/src/connectors/plugin-mcp-recovery.js +90 -0
- package/dist/src/extensions/agent-plugins/auth.d.ts +39 -0
- package/dist/src/extensions/agent-plugins/auth.js +156 -0
- package/dist/src/extensions/agent-plugins/connection.d.ts +8 -0
- package/dist/src/extensions/agent-plugins/connection.js +41 -0
- package/dist/src/extensions/agent-plugins/health.d.ts +4 -0
- package/dist/src/extensions/agent-plugins/health.js +48 -0
- package/dist/src/extensions/agent-plugins/inventory.d.ts +53 -0
- package/dist/src/extensions/agent-plugins/inventory.js +34 -0
- package/dist/src/extensions/agent-plugins/mcp-adapter.d.ts +3 -0
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +47 -0
- package/dist/src/extensions/agent-plugins/sources.d.ts +5 -0
- package/dist/src/extensions/agent-plugins/sources.js +72 -0
- package/dist/src/extensions/agent-plugins/store.d.ts +61 -0
- package/dist/src/extensions/agent-plugins/store.js +305 -0
- package/dist/src/extensions/agent-plugins/validation.d.ts +59 -0
- package/dist/src/extensions/agent-plugins/validation.js +211 -0
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +10 -3
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.d.ts +3 -0
- package/dist/src/gateway/hono/routes/agent-plugins.js +166 -0
- package/dist/src/gateway/hono/routes/agent-stream.js +14 -0
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +4 -2
- package/dist/src/gateway/hono/routes/chat-previews.d.ts +3 -0
- package/dist/src/gateway/hono/routes/chat-previews.js +41 -0
- package/dist/src/gateway/hono/routes/connection-waits.js +4 -2
- package/dist/src/gateway/hono/routes/index.js +2 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/local-apps.js +71 -39
- package/dist/src/gateway/hono/routes/mcp.js +48 -21
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +4 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +22 -0
- package/dist/src/gateway/hono/routes/side-chats.js +11 -0
- package/dist/src/gateway/service/agent-runner.js +7 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/marketplace-service.d.ts +1 -0
- package/dist/src/gateway/service/marketplace-service.js +15 -1
- package/dist/src/gateway/service/session-input-coordinator.js +3 -3
- package/dist/src/gateway/service.d.ts +5 -1
- package/dist/src/gateway/service.js +19 -5
- package/dist/src/gateway/side-chat/index.d.ts +3 -1
- package/dist/src/gateway/side-chat/index.js +2 -1
- package/dist/src/gateway/side-chat/manager.d.ts +16 -0
- package/dist/src/gateway/side-chat/manager.js +40 -6
- package/dist/src/gateway/side-chat/promotion-service.d.ts +19 -0
- package/dist/src/gateway/side-chat/promotion-service.js +111 -0
- package/dist/src/gateway/side-chat/run-service.js +1 -0
- package/dist/src/gateway/side-chat/types.d.ts +1 -1
- package/dist/src/local-apps/artifact-files.d.ts +3 -0
- package/dist/src/local-apps/artifact-files.js +45 -0
- package/dist/src/local-apps/capabilities/write.js +1 -1
- package/dist/src/local-apps/fix-guidance.d.ts +3 -0
- package/dist/src/local-apps/fix-guidance.js +75 -0
- package/dist/src/local-apps/index.d.ts +2 -1
- package/dist/src/local-apps/scaffold.d.ts +5 -0
- package/dist/src/local-apps/scaffold.js +18 -5
- package/dist/src/local-apps/service.d.ts +18 -3
- package/dist/src/local-apps/service.js +106 -64
- package/dist/src/local-apps/snapshot-store.d.ts +8 -0
- package/dist/src/local-apps/snapshot-store.js +68 -0
- package/dist/src/local-apps/types.d.ts +4 -87
- package/dist/src/notes/service.js +1 -1
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/session/client-history.d.ts +3 -1
- package/dist/src/session/client-history.js +10 -3
- package/dist/src/session/index.d.ts +1 -1
- package/dist/src/session/manager.d.ts +4 -0
- package/dist/src/session/manager.js +6 -0
- package/dist/src/session/session-context-for-llm.d.ts +12 -1
- package/dist/src/session/session-context-for-llm.js +16 -2
- package/dist/src/session/store.d.ts +14 -0
- package/dist/src/session/store.js +17 -0
- package/dist/src/session/stored-rows-to-file-entries.js +10 -1
- package/dist/src/session/transcript-outline.js +10 -3
- package/dist/src/storage/sqlite/connection-wait-repository.js +9 -3
- package/dist/src/storage/sqlite/migrations/202_chat_previews.sql +26 -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/row-mappers.js +6 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -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.js +2 -2
- package/dist/src/voice/tts/audio.js +1 -1
- package/dist/src/work-discovery/service.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BGCqlTcR.js +0 -1
- package/dist/gateway/static/root/assets/api-DEneywgz.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-vC87gAyb.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-CzYmREol.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-BxaSzUIU.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-D0S3DuAD.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CFCu-8da.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-CENp82yt.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-g_KTZWCb.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-DO7jp0ep.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-BkeSEBxk.js +0 -1
- package/dist/gateway/static/root/assets/home-page-KoQXV4hp.js +0 -1
- package/dist/gateway/static/root/assets/index-ZxnWUdPv.css +0 -1
- package/dist/gateway/static/root/assets/index-u4709aCa.js +0 -89
- package/dist/gateway/static/root/assets/local-app-workbench-page-7QX0YFa7.js +0 -2
- package/dist/gateway/static/root/assets/local-apps-page-RSAl-NhO.js +0 -1
- package/dist/gateway/static/root/assets/management-settings-C_cb0Kue.js +0 -1
- package/dist/gateway/static/root/assets/messages-M5xl1fHE.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-CVWst-Er.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BFwCgIls.js +0 -8
- package/dist/gateway/static/root/assets/product-delivery-chCjIpvu.js +0 -1
- package/dist/gateway/static/root/assets/product-open-page-BIGvTs9n.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-BFEtpkcf.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-CHr-P2z4.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-PhEyHSOb.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-CmIhlHPS.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CCOTu1jb.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-CG1sll8V.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Byq23h9c.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-D5q-wk_d.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-DE3ZeJL3.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-DGZaETmN.js +0 -6
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { AgentPluginStore } from "../../../extensions/agent-plugins/store.js";
|
|
2
|
+
import { removePluginCredentials, savePluginAuthBinding } from "../../../extensions/agent-plugins/auth.js";
|
|
3
|
+
import { disposeAllSessionMcpRuntimes } from "../../../agent/mcp/bundle-mcp-runtime.js";
|
|
4
|
+
import { withAgentPluginSource } from "../../../extensions/agent-plugins/sources.js";
|
|
5
|
+
import { agentPluginInventoryRow } from "../../../extensions/agent-plugins/inventory.js";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
//#region src/gateway/hono/routes/agent-plugins.ts
|
|
8
|
+
const sourceBody = z.strictObject({
|
|
9
|
+
source: z.string().min(1),
|
|
10
|
+
reviewHash: z.string().optional()
|
|
11
|
+
});
|
|
12
|
+
function registerAgentPluginRoutes(app, deps) {
|
|
13
|
+
const store = new AgentPluginStore();
|
|
14
|
+
const refresh = async () => {
|
|
15
|
+
await disposeAllSessionMcpRuntimes();
|
|
16
|
+
deps.service.marketplace.reloadSkills();
|
|
17
|
+
};
|
|
18
|
+
app.post("/api/extensions/inspect", deps.strictRateLimitMiddleware, async (c) => {
|
|
19
|
+
try {
|
|
20
|
+
const body = sourceBody.parse(await c.req.json());
|
|
21
|
+
return c.json({
|
|
22
|
+
ok: true,
|
|
23
|
+
payload: await withAgentPluginSource(body.source, deps.service.currentConfig, (source) => store.inspect(source))
|
|
24
|
+
});
|
|
25
|
+
} catch (error) {
|
|
26
|
+
return c.json({
|
|
27
|
+
ok: false,
|
|
28
|
+
error: error instanceof Error ? error.message : String(error)
|
|
29
|
+
}, 400);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
app.post("/api/extensions/install", deps.strictRateLimitMiddleware, async (c) => {
|
|
33
|
+
try {
|
|
34
|
+
const body = sourceBody.parse(await c.req.json());
|
|
35
|
+
const plugin = await withAgentPluginSource(body.source, deps.service.currentConfig, (source) => store.install(source, {
|
|
36
|
+
reviewHash: body.reviewHash,
|
|
37
|
+
sourceLabel: body.source
|
|
38
|
+
}));
|
|
39
|
+
await refresh();
|
|
40
|
+
return c.json({
|
|
41
|
+
ok: true,
|
|
42
|
+
payload: agentPluginInventoryRow(plugin)
|
|
43
|
+
});
|
|
44
|
+
} catch (error) {
|
|
45
|
+
return c.json({
|
|
46
|
+
ok: false,
|
|
47
|
+
error: error instanceof Error ? error.message : String(error)
|
|
48
|
+
}, 400);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
app.get("/api/extensions/agent-plugins/:id", (c) => {
|
|
52
|
+
try {
|
|
53
|
+
const plugin = store.get(c.req.param("id"));
|
|
54
|
+
return plugin ? c.json({
|
|
55
|
+
ok: true,
|
|
56
|
+
payload: agentPluginInventoryRow(plugin)
|
|
57
|
+
}) : c.json({
|
|
58
|
+
ok: false,
|
|
59
|
+
error: "Plugin not found"
|
|
60
|
+
}, 404);
|
|
61
|
+
} catch (error) {
|
|
62
|
+
return c.json({
|
|
63
|
+
ok: false,
|
|
64
|
+
error: error instanceof Error ? error.message : String(error)
|
|
65
|
+
}, 400);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
app.post("/api/extensions/agent-plugins/:id/activation", deps.strictRateLimitMiddleware, async (c) => {
|
|
69
|
+
try {
|
|
70
|
+
const body = z.strictObject({ enabled: z.boolean() }).parse(await c.req.json());
|
|
71
|
+
const plugin = store.setEnabled(c.req.param("id"), body.enabled);
|
|
72
|
+
await refresh();
|
|
73
|
+
return c.json({
|
|
74
|
+
ok: true,
|
|
75
|
+
payload: agentPluginInventoryRow(plugin)
|
|
76
|
+
});
|
|
77
|
+
} catch (error) {
|
|
78
|
+
return c.json({
|
|
79
|
+
ok: false,
|
|
80
|
+
error: error instanceof Error ? error.message : String(error)
|
|
81
|
+
}, 400);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
app.post("/api/extensions/agent-plugins/:id/update", deps.strictRateLimitMiddleware, async (c) => {
|
|
85
|
+
try {
|
|
86
|
+
const body = sourceBody.parse(await c.req.json());
|
|
87
|
+
const plugin = await withAgentPluginSource(body.source, deps.service.currentConfig, (source) => store.install(source, {
|
|
88
|
+
reviewHash: body.reviewHash,
|
|
89
|
+
replace: true,
|
|
90
|
+
expectedId: c.req.param("id"),
|
|
91
|
+
sourceLabel: body.source
|
|
92
|
+
}));
|
|
93
|
+
await refresh();
|
|
94
|
+
return c.json({
|
|
95
|
+
ok: true,
|
|
96
|
+
payload: agentPluginInventoryRow(plugin)
|
|
97
|
+
});
|
|
98
|
+
} catch (error) {
|
|
99
|
+
return c.json({
|
|
100
|
+
ok: false,
|
|
101
|
+
error: error instanceof Error ? error.message : String(error)
|
|
102
|
+
}, 400);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
app.post("/api/extensions/agent-plugins/:id/rollback", deps.strictRateLimitMiddleware, async (c) => {
|
|
106
|
+
try {
|
|
107
|
+
const plugin = store.rollback(c.req.param("id"));
|
|
108
|
+
await refresh();
|
|
109
|
+
return c.json({
|
|
110
|
+
ok: true,
|
|
111
|
+
payload: agentPluginInventoryRow(plugin)
|
|
112
|
+
});
|
|
113
|
+
} catch (error) {
|
|
114
|
+
return c.json({
|
|
115
|
+
ok: false,
|
|
116
|
+
error: error instanceof Error ? error.message : String(error)
|
|
117
|
+
}, 400);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
app.put("/api/extensions/agent-plugins/:id/mcp/:server/auth", deps.strictRateLimitMiddleware, async (c) => {
|
|
121
|
+
try {
|
|
122
|
+
const body = z.strictObject({
|
|
123
|
+
mode: z.enum([
|
|
124
|
+
"auto",
|
|
125
|
+
"oauth",
|
|
126
|
+
"api-key",
|
|
127
|
+
"none"
|
|
128
|
+
]),
|
|
129
|
+
secrets: z.array(z.strictObject({
|
|
130
|
+
target: z.enum(["headers", "env"]),
|
|
131
|
+
key: z.string(),
|
|
132
|
+
value: z.string(),
|
|
133
|
+
prefix: z.string().optional()
|
|
134
|
+
})).max(20).optional()
|
|
135
|
+
}).parse(await c.req.json());
|
|
136
|
+
await savePluginAuthBinding(store, c.req.param("id"), c.req.param("server"), body);
|
|
137
|
+
await refresh();
|
|
138
|
+
return c.json({ ok: true });
|
|
139
|
+
} catch (error) {
|
|
140
|
+
return c.json({
|
|
141
|
+
ok: false,
|
|
142
|
+
error: error instanceof Error ? error.message : String(error)
|
|
143
|
+
}, 400);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
app.delete("/api/extensions/agent-plugins/:id", deps.strictRateLimitMiddleware, async (c) => {
|
|
147
|
+
try {
|
|
148
|
+
const body = z.strictObject({
|
|
149
|
+
removeData: z.boolean().optional(),
|
|
150
|
+
removeCredentials: z.boolean().optional()
|
|
151
|
+
}).parse(await c.req.json());
|
|
152
|
+
await disposeAllSessionMcpRuntimes();
|
|
153
|
+
if (body.removeCredentials) await removePluginCredentials(store, c.req.param("id"));
|
|
154
|
+
store.remove(c.req.param("id"), body.removeData);
|
|
155
|
+
deps.service.marketplace.reloadSkills();
|
|
156
|
+
return c.json({ ok: true });
|
|
157
|
+
} catch (error) {
|
|
158
|
+
return c.json({
|
|
159
|
+
ok: false,
|
|
160
|
+
error: error instanceof Error ? error.message : String(error)
|
|
161
|
+
}, 400);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
//#endregion
|
|
166
|
+
export { registerAgentPluginRoutes };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { parseUserTurnDocument, userTurnDocumentRefIds } from "../../../../packages/gateway-contract/src/user-turn-document.js";
|
|
2
|
+
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
1
3
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
2
4
|
import { parseTurnContextRefs } from "../../../agent/source-context/types.js";
|
|
3
5
|
import { replaceLatestSessionTurn, submitSessionInput } from "./session-input-handler.js";
|
|
4
6
|
//#region src/gateway/hono/routes/agent-stream.ts
|
|
7
|
+
init_src();
|
|
5
8
|
function registerAgentStreamRoutes(authenticated, deps) {
|
|
6
9
|
const { service, chatRateLimitMiddleware } = deps;
|
|
7
10
|
authenticated.post("/api/agent/abort", chatRateLimitMiddleware, async (c) => {
|
|
@@ -60,6 +63,17 @@ function registerAgentStreamRoutes(authenticated, deps) {
|
|
|
60
63
|
message: "Invalid source context references"
|
|
61
64
|
}
|
|
62
65
|
}, 400);
|
|
66
|
+
if (typeof body.content === "string") {
|
|
67
|
+
const document = parseUserTurnDocument(body.content);
|
|
68
|
+
const refIds = new Set((contextRefs ?? []).flatMap((ref) => ref.refId ? [ref.refId] : []));
|
|
69
|
+
if (document && !userTurnDocumentRefIds(document).every((refId) => refIds.has(refId))) return c.json({
|
|
70
|
+
ok: false,
|
|
71
|
+
error: {
|
|
72
|
+
code: "BAD_REQUEST",
|
|
73
|
+
message: "Input contains an unknown context reference"
|
|
74
|
+
}
|
|
75
|
+
}, 400);
|
|
76
|
+
}
|
|
63
77
|
if (body.content !== void 0) {
|
|
64
78
|
const contentError = validateWebchatContent(body.content);
|
|
65
79
|
if (contentError) return c.json({
|
|
@@ -7,6 +7,7 @@ import { createOAuthAsyncHandler } from "../oauth-async.js";
|
|
|
7
7
|
import { createOAuthHandler } from "../oauth.js";
|
|
8
8
|
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
9
9
|
import { loadExtensionStore, saveExtensionStore } from "../lib/extension-store.js";
|
|
10
|
+
import { listAgentPluginInventory } from "../../../extensions/agent-plugins/inventory.js";
|
|
10
11
|
import { relative, resolve } from "node:path";
|
|
11
12
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
12
13
|
//#region src/gateway/hono/routes/auth-registry-extensions.ts
|
|
@@ -152,7 +153,7 @@ function registerAuthRegistryExtensionsRoutes(authenticated, deps) {
|
|
|
152
153
|
});
|
|
153
154
|
authenticated.get("/api/extensions", async (c) => {
|
|
154
155
|
const loader = service.getExtensionLoader();
|
|
155
|
-
if (!loader) return c.json({ extensions:
|
|
156
|
+
if (!loader) return c.json({ extensions: listAgentPluginInventory() });
|
|
156
157
|
const registry = loader.getRegistry();
|
|
157
158
|
const discovered = loader.discoverExtensions();
|
|
158
159
|
const activeIds = /* @__PURE__ */ new Set();
|
|
@@ -166,6 +167,7 @@ function registerAuthRegistryExtensionsRoutes(authenticated, deps) {
|
|
|
166
167
|
activationEligibleIds = /* @__PURE__ */ new Set();
|
|
167
168
|
}
|
|
168
169
|
const extensions = discovered.map((ext) => ({
|
|
170
|
+
format: "native-extension",
|
|
169
171
|
id: ext.manifest.id,
|
|
170
172
|
name: ext.manifest.name,
|
|
171
173
|
description: ext.manifest.description,
|
|
@@ -182,7 +184,7 @@ function registerAuthRegistryExtensionsRoutes(authenticated, deps) {
|
|
|
182
184
|
contributions: ext.manifest.ui.contributions
|
|
183
185
|
} : void 0
|
|
184
186
|
}));
|
|
185
|
-
return c.json({ extensions });
|
|
187
|
+
return c.json({ extensions: [...extensions, ...listAgentPluginInventory()] });
|
|
186
188
|
});
|
|
187
189
|
/**
|
|
188
190
|
* Built-in (bundled) extension enable/disable — persists `extensions.enabled` / `extensions.disabled`.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ChatPreviewFixGuidanceInputSchema, ChatPreviewSourceHashSchema } from "../../../../packages/gateway-contract/src/chat-previews.js";
|
|
2
|
+
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
|
+
import { ChatPreviewNotFoundError } from "../../../chat-previews/service.js";
|
|
4
|
+
import "../../../chat-previews/index.js";
|
|
5
|
+
//#region src/gateway/hono/routes/chat-previews.ts
|
|
6
|
+
init_src();
|
|
7
|
+
function registerChatPreviewRoutes(app, deps) {
|
|
8
|
+
app.get("/api/chat-previews/:id/revisions/:sourceHash", (c) => {
|
|
9
|
+
const sourceHash = ChatPreviewSourceHashSchema.safeParse(c.req.param("sourceHash"));
|
|
10
|
+
if (!sourceHash.success) return c.json({ error: "Invalid preview revision" }, 400);
|
|
11
|
+
try {
|
|
12
|
+
return c.json({ revision: deps.service.chatPreviews.getRevision(c.req.param("id"), sourceHash.data) }, 200, { "Cache-Control": "private, max-age=31536000, immutable" });
|
|
13
|
+
} catch (error) {
|
|
14
|
+
if (error instanceof ChatPreviewNotFoundError) return c.json({ error: error.message }, 404);
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
app.post("/api/chat-previews/:id/fix-guidance", async (c) => {
|
|
19
|
+
const parsed = ChatPreviewFixGuidanceInputSchema.safeParse(await c.req.json().catch(() => null));
|
|
20
|
+
if (!parsed.success) return c.json({ error: "Invalid fix guidance input" }, 400);
|
|
21
|
+
try {
|
|
22
|
+
return c.json({ guidance: deps.service.chatPreviews.getFixGuidance(c.req.param("id"), parsed.data.sourceHash, parsed.data.diagnostics, parsed.data.locale) });
|
|
23
|
+
} catch (error) {
|
|
24
|
+
if (error instanceof ChatPreviewNotFoundError) return c.json({ error: error.message }, 404);
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
app.post("/api/chat-previews/:id/promote", async (c) => {
|
|
29
|
+
const body = await c.req.json().catch(() => null);
|
|
30
|
+
const sourceHash = ChatPreviewSourceHashSchema.safeParse(body?.sourceHash);
|
|
31
|
+
if (!sourceHash.success) return c.json({ error: "Invalid preview revision" }, 400);
|
|
32
|
+
try {
|
|
33
|
+
return c.json({ app: deps.service.chatPreviews.promote(c.req.param("id"), sourceHash.data) }, 201);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
if (error instanceof ChatPreviewNotFoundError) return c.json({ error: error.message }, 404);
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { registerChatPreviewRoutes };
|
|
@@ -13,11 +13,13 @@ const actionSchema = z.object({
|
|
|
13
13
|
"cancel",
|
|
14
14
|
"select_account",
|
|
15
15
|
"confirm_scope",
|
|
16
|
-
"replace_source"
|
|
16
|
+
"replace_source",
|
|
17
|
+
"submit_callback"
|
|
17
18
|
]),
|
|
18
19
|
candidateRef: z.string().optional(),
|
|
19
20
|
needKey: z.string().optional(),
|
|
20
|
-
accountId: z.string().optional()
|
|
21
|
+
accountId: z.string().optional(),
|
|
22
|
+
callbackUrl: z.string().max(16384).optional()
|
|
21
23
|
}).strict();
|
|
22
24
|
function registerConnectionWaitRoutes(app, { service, strictRateLimitMiddleware }) {
|
|
23
25
|
app.get("/api/sessions/:conversationId/connection-wait", (c) => {
|
|
@@ -16,6 +16,7 @@ import { registerEndpointToolRoutes } from "./endpoint-tools.js";
|
|
|
16
16
|
import { registerRealtimeRoutes } from "./realtime.js";
|
|
17
17
|
import { registerDeviceRoutes } from "./devices.js";
|
|
18
18
|
import { registerLocalAppsRoutes } from "./local-apps.js";
|
|
19
|
+
import { registerChatPreviewRoutes } from "./chat-previews.js";
|
|
19
20
|
import { registerWorkDiscoveryRoutes } from "./work-discovery.js";
|
|
20
21
|
import { registerContextSourceRoutes } from "./context-sources.js";
|
|
21
22
|
import { registerTaskRoutes } from "./tasks.js";
|
|
@@ -34,6 +35,7 @@ function registerCoreAuthenticatedRoutes(authenticated, deps) {
|
|
|
34
35
|
registerProjectsRoutes(authenticated, deps);
|
|
35
36
|
registerProjectSkillRoutes(authenticated, deps);
|
|
36
37
|
registerLocalAppsRoutes(authenticated, deps);
|
|
38
|
+
registerChatPreviewRoutes(authenticated, deps);
|
|
37
39
|
registerWorkDiscoveryRoutes(authenticated, deps);
|
|
38
40
|
registerContextSourceRoutes(authenticated, deps);
|
|
39
41
|
registerTaskRoutes(authenticated, deps);
|
|
@@ -3,6 +3,14 @@ function startsWithAny(path, prefixes) {
|
|
|
3
3
|
return prefixes.some((prefix) => path === prefix || path.startsWith(`${prefix}/`));
|
|
4
4
|
}
|
|
5
5
|
const AUTHENTICATED_LAZY_ROUTE_BUNDLES = [
|
|
6
|
+
{
|
|
7
|
+
id: "agent-plugins",
|
|
8
|
+
match: (path) => path === "/api/extensions/inspect" || path === "/api/extensions/install" || startsWithAny(path, ["/api/extensions/agent-plugins"]),
|
|
9
|
+
load: async () => {
|
|
10
|
+
const { registerAgentPluginRoutes } = await import("./agent-plugins.js");
|
|
11
|
+
return { register: registerAgentPluginRoutes };
|
|
12
|
+
}
|
|
13
|
+
},
|
|
6
14
|
{
|
|
7
15
|
id: "local-app-capabilities",
|
|
8
16
|
match: (path) => /^\/api\/local-app-capabilities\/[^/]+(?:\/[^/]+\/invocations)?$/.test(path),
|
|
@@ -1,56 +1,71 @@
|
|
|
1
|
+
import { LocalAppSourceHashSchema } from "../../../../packages/gateway-contract/src/local-apps.js";
|
|
2
|
+
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
1
3
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
2
4
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
5
|
+
import { parseLocalAppFixGuidanceInput } from "../../../local-apps/fix-guidance.js";
|
|
3
6
|
import { readLocalAppAcceptanceConfig } from "../../../local-apps/acceptance.js";
|
|
4
7
|
import { createProductDispatcher } from "../../../capabilities/runtime/product.js";
|
|
5
8
|
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
6
9
|
import { capabilityHttpContext, capabilityHttpError } from "../../../capabilities/adapters/http.js";
|
|
7
10
|
import { LOCAL_APP_RUNTIME_BRIDGE_HASH, injectLocalAppRuntimeBridge } from "../../../local-apps/preview-runtime-bridge.js";
|
|
8
11
|
import { relative, resolve } from "node:path";
|
|
9
|
-
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
12
|
+
import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
10
13
|
import { randomUUID } from "node:crypto";
|
|
11
14
|
//#region src/gateway/hono/routes/local-apps.ts
|
|
15
|
+
init_src();
|
|
12
16
|
const LOCAL_APP_PREVIEW_CSP = `default-src 'self'; script-src 'self' 'sha256-${LOCAL_APP_RUNTIME_BRIDGE_HASH}'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; connect-src 'none'; frame-ancestors 'self'; frame-src 'none'; base-uri 'none'; object-src 'none'; form-action 'none'`;
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
function servePreviewAsset(c, preview, prefix, cacheControl) {
|
|
18
|
+
const origin = c.req.header("origin");
|
|
19
|
+
const cors = { "Access-Control-Allow-Origin": origin === "null" ? "null" : origin || "*" };
|
|
20
|
+
let assetPath = c.req.path.startsWith(prefix) ? c.req.path.slice(prefix.length) : "";
|
|
21
|
+
try {
|
|
22
|
+
assetPath = decodeURIComponent(assetPath);
|
|
23
|
+
} catch {
|
|
24
|
+
return c.json({ error: "Invalid asset path" }, 400, cors);
|
|
25
|
+
}
|
|
26
|
+
if (!assetPath || assetPath.includes("..")) return c.json({ error: "Invalid asset path" }, 400, cors);
|
|
27
|
+
if (!existsSync(preview.uiRoot)) return c.json({ error: "Not found" }, 404, cors);
|
|
28
|
+
const root = realpathSync(resolve(preview.uiRoot));
|
|
29
|
+
const unresolvedPath = resolve(root, assetPath);
|
|
30
|
+
const fullPath = existsSync(unresolvedPath) ? realpathSync(unresolvedPath) : unresolvedPath;
|
|
31
|
+
const rel = relative(root, fullPath);
|
|
32
|
+
if (rel.startsWith("..") || rel === "") return c.json({ error: "Path traversal denied" }, 403, cors);
|
|
33
|
+
if (!existsSync(fullPath) || !statSync(fullPath).isFile()) return c.json({ error: "Not found" }, 404, cors);
|
|
34
|
+
const mimeType = extensionAssetMimeType(assetPath);
|
|
35
|
+
const content = readFileSync(fullPath);
|
|
36
|
+
let textContent = null;
|
|
37
|
+
if (mimeType.startsWith("text/html")) {
|
|
38
|
+
let acceptance;
|
|
21
39
|
try {
|
|
22
|
-
|
|
40
|
+
acceptance = readLocalAppAcceptanceConfig(preview.uiRoot);
|
|
23
41
|
} catch {
|
|
24
|
-
|
|
42
|
+
acceptance = {
|
|
43
|
+
schemaVersion: 1,
|
|
44
|
+
scenarios: []
|
|
45
|
+
};
|
|
25
46
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return
|
|
48
|
-
"Content-Type": mimeType,
|
|
49
|
-
"Content-Security-Policy": LOCAL_APP_PREVIEW_CSP,
|
|
50
|
-
"Cache-Control": "no-store",
|
|
51
|
-
"X-Content-Type-Options": "nosniff",
|
|
52
|
-
...cors
|
|
53
|
-
} });
|
|
47
|
+
textContent = injectLocalAppRuntimeBridge(content.toString("utf8"), acceptance);
|
|
48
|
+
} else if (mimeType.startsWith("text/")) textContent = content.toString("utf8");
|
|
49
|
+
return new Response(textContent ?? new Uint8Array(content), { headers: {
|
|
50
|
+
"Content-Type": mimeType,
|
|
51
|
+
"Content-Security-Policy": LOCAL_APP_PREVIEW_CSP,
|
|
52
|
+
"Cache-Control": cacheControl,
|
|
53
|
+
"X-Content-Type-Options": "nosniff",
|
|
54
|
+
...cors
|
|
55
|
+
} });
|
|
56
|
+
}
|
|
57
|
+
function registerPublicLocalAppPreviewRoutes(app, service) {
|
|
58
|
+
app.get("/api/local-apps/preview/:token/draft/*", (c) => {
|
|
59
|
+
const preview = service.localApps.resolveDraftPreview(c.req.param("token"));
|
|
60
|
+
if (!preview) return c.json({ error: "Preview not found" }, 404);
|
|
61
|
+
return servePreviewAsset(c, preview, `/api/local-apps/preview/${preview.previewToken}/draft/`, "no-store");
|
|
62
|
+
});
|
|
63
|
+
app.get("/api/local-apps/preview/:token/snapshots/:sourceHash/*", (c) => {
|
|
64
|
+
const sourceHash = LocalAppSourceHashSchema.safeParse(c.req.param("sourceHash"));
|
|
65
|
+
if (!sourceHash.success) return c.json({ error: "Invalid snapshot hash" }, 400);
|
|
66
|
+
const preview = service.localApps.resolveSnapshotPreview(c.req.param("token"), sourceHash.data);
|
|
67
|
+
if (!preview) return c.json({ error: "Preview not found" }, 404);
|
|
68
|
+
return servePreviewAsset(c, preview, `/api/local-apps/preview/${preview.previewToken}/snapshots/${sourceHash.data}/`, "private, max-age=31536000, immutable");
|
|
54
69
|
});
|
|
55
70
|
}
|
|
56
71
|
function registerLocalAppsRoutes(app, deps) {
|
|
@@ -79,6 +94,12 @@ function registerLocalAppsRoutes(app, deps) {
|
|
|
79
94
|
return capabilityHttpError(c, error);
|
|
80
95
|
}
|
|
81
96
|
});
|
|
97
|
+
app.get("/api/local-apps/:id/snapshots/:sourceHash", (c) => {
|
|
98
|
+
const sourceHash = LocalAppSourceHashSchema.safeParse(c.req.param("sourceHash"));
|
|
99
|
+
if (!sourceHash.success) return c.json({ error: "Invalid snapshot hash" }, 400);
|
|
100
|
+
const snapshot = deps.service.localApps.getSnapshot(c.req.param("id"), sourceHash.data);
|
|
101
|
+
return snapshot ? c.json({ snapshot }) : c.json({ error: "Snapshot not found" }, 404);
|
|
102
|
+
});
|
|
82
103
|
app.post("/api/local-apps/:id/validate", async (c) => {
|
|
83
104
|
try {
|
|
84
105
|
return c.json(await capabilities.call("xopc.local_apps.validate", { id: c.req.param("id") }, capabilityHttpContext(c)));
|
|
@@ -86,6 +107,17 @@ function registerLocalAppsRoutes(app, deps) {
|
|
|
86
107
|
return capabilityHttpError(c, error);
|
|
87
108
|
}
|
|
88
109
|
});
|
|
110
|
+
app.post("/api/local-apps/:id/fix-guidance", async (c) => {
|
|
111
|
+
try {
|
|
112
|
+
const body = await c.req.json().catch(() => {
|
|
113
|
+
throw new CapabilityError("INVALID_INPUT", "Invalid JSON body");
|
|
114
|
+
});
|
|
115
|
+
const guidance = deps.service.localApps.getFixGuidance(c.req.param("id"), parseLocalAppFixGuidanceInput(body));
|
|
116
|
+
return c.json({ guidance });
|
|
117
|
+
} catch (error) {
|
|
118
|
+
return capabilityHttpError(c, error);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
89
121
|
app.post("/api/local-apps/:id/acceptance-runs", async (c) => {
|
|
90
122
|
try {
|
|
91
123
|
const body = await c.req.json().catch(() => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { isManagedConnectorServer } from "../../../connectors/materialize.js";
|
|
2
|
+
import { AgentPluginStore } from "../../../extensions/agent-plugins/store.js";
|
|
2
3
|
import { canonicalizeConfiguredMcpServer, normalizeConfiguredMcpServers } from "../../../config/mcp-config-normalize.js";
|
|
4
|
+
import { savePluginAuthBinding } from "../../../extensions/agent-plugins/auth.js";
|
|
3
5
|
import { loadMergedBundleMcpConfig } from "../../../agent/mcp/bundle-mcp-config.js";
|
|
4
6
|
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
5
7
|
import { getMcpOAuthManager } from "../../../agent/mcp/oauth/mcp-oauth-manager.js";
|
|
@@ -20,12 +22,12 @@ function registerMcpRoutes(authenticated, deps) {
|
|
|
20
22
|
cfg
|
|
21
23
|
});
|
|
22
24
|
const configured = normalizeConfiguredMcpServers(cfg.mcp?.servers);
|
|
23
|
-
const
|
|
24
|
-
const servers = await Promise.all(Object.entries(configured).map(async ([id, server]) => ({
|
|
25
|
+
const servers = await Promise.all(Object.entries(merged.config.mcpServers).map(async ([id, server]) => ({
|
|
25
26
|
id,
|
|
27
|
+
plugin: server.xopcPlugin,
|
|
26
28
|
managed: isManagedConnectorServer(server),
|
|
27
29
|
connectorId: isManagedConnectorServer(server) ? server.xopcConnector.connectorId : void 0,
|
|
28
|
-
oauth: await
|
|
30
|
+
oauth: await getMcpOAuthManager(server).status(id, server)
|
|
29
31
|
})));
|
|
30
32
|
return c.json({
|
|
31
33
|
ok: true,
|
|
@@ -76,9 +78,30 @@ function registerMcpRoutes(authenticated, deps) {
|
|
|
76
78
|
}, 404);
|
|
77
79
|
return c.json({
|
|
78
80
|
ok: true,
|
|
79
|
-
payload: await getMcpOAuthManager().status(id, server)
|
|
81
|
+
payload: await getMcpOAuthManager(server).status(id, server)
|
|
80
82
|
});
|
|
81
83
|
});
|
|
84
|
+
authenticated.post("/api/mcp/servers/:id/oauth/callback", deps.strictRateLimitMiddleware, async (c) => {
|
|
85
|
+
const id = c.req.param("id");
|
|
86
|
+
const server = resolveServer(id);
|
|
87
|
+
if (!server) return c.json({
|
|
88
|
+
ok: false,
|
|
89
|
+
error: "Unknown MCP server"
|
|
90
|
+
}, 404);
|
|
91
|
+
try {
|
|
92
|
+
const body = await c.req.json();
|
|
93
|
+
if (typeof body.callbackUrl !== "string" || body.callbackUrl.length > 16384) throw new Error("Expected callbackUrl");
|
|
94
|
+
return c.json({
|
|
95
|
+
ok: true,
|
|
96
|
+
payload: await getMcpOAuthManager(server).submitCallback(id, server, body.callbackUrl)
|
|
97
|
+
});
|
|
98
|
+
} catch {
|
|
99
|
+
return c.json({
|
|
100
|
+
ok: false,
|
|
101
|
+
error: "OAuth callback rejected; verify the URL and active authorization session"
|
|
102
|
+
}, 400);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
82
105
|
authenticated.post("/api/mcp/servers/:id/oauth/start", deps.strictRateLimitMiddleware, async (c) => {
|
|
83
106
|
const id = c.req.param("id");
|
|
84
107
|
const server = resolveServer(id);
|
|
@@ -87,9 +110,12 @@ function registerMcpRoutes(authenticated, deps) {
|
|
|
87
110
|
error: `Unknown MCP server: ${id}`
|
|
88
111
|
}, 404);
|
|
89
112
|
try {
|
|
90
|
-
const
|
|
113
|
+
const origin = server.xopcPlugin;
|
|
114
|
+
if (origin) await savePluginAuthBinding(new AgentPluginStore(), origin.id, origin.serverName, { mode: "oauth" });
|
|
115
|
+
const oauthServer = origin ? resolveServer(id) : server;
|
|
116
|
+
const payload = await getMcpOAuthManager(oauthServer).start({
|
|
91
117
|
serverId: id,
|
|
92
|
-
rawServer:
|
|
118
|
+
rawServer: oauthServer,
|
|
93
119
|
cfg: deps.service.currentConfig
|
|
94
120
|
});
|
|
95
121
|
return c.json({
|
|
@@ -111,7 +137,7 @@ function registerMcpRoutes(authenticated, deps) {
|
|
|
111
137
|
error: `Unknown MCP server: ${id}`
|
|
112
138
|
}, 404);
|
|
113
139
|
try {
|
|
114
|
-
const payload = await getMcpOAuthManager().disconnect(id, server);
|
|
140
|
+
const payload = await getMcpOAuthManager(server).disconnect(id, server);
|
|
115
141
|
return c.json({
|
|
116
142
|
ok: true,
|
|
117
143
|
payload
|
|
@@ -171,20 +197,25 @@ function registerMcpRoutes(authenticated, deps) {
|
|
|
171
197
|
const workspaceDir = getWorkspacePath(cfg) || "./workspace";
|
|
172
198
|
const body = await c.req.json().catch(() => ({}));
|
|
173
199
|
const inlineServer = body && typeof body === "object" && !Array.isArray(body) && body.server && typeof body.server === "object" ? body.server : void 0;
|
|
174
|
-
|
|
200
|
+
if (inlineServer && id.startsWith("plugin/")) return c.json({
|
|
201
|
+
ok: false,
|
|
202
|
+
error: "Plugin servers must use their installed configuration"
|
|
203
|
+
}, 400);
|
|
175
204
|
const mergedServers = loadMergedBundleMcpConfig({
|
|
176
205
|
workspaceDir,
|
|
177
206
|
cfg
|
|
178
207
|
}).config.mcpServers;
|
|
179
|
-
const knownServer = inlineServer ??
|
|
208
|
+
const knownServer = inlineServer ?? mergedServers[id];
|
|
180
209
|
if (!knownServer) return c.json({
|
|
181
210
|
ok: false,
|
|
182
211
|
error: `Unknown MCP server: ${id}`
|
|
183
212
|
}, 404);
|
|
184
213
|
try {
|
|
185
|
-
const oauth = await getMcpOAuthManager().status(id, knownServer);
|
|
186
|
-
if (oauth.configured && oauth.status !== "connected") return c.json({
|
|
214
|
+
const oauth = await getMcpOAuthManager(knownServer).status(id, knownServer);
|
|
215
|
+
if (oauth.configured && knownServer.xopcAutoAuth !== true && oauth.status !== "connected") return c.json({
|
|
187
216
|
ok: false,
|
|
217
|
+
code: "MCP_AUTHORIZATION_REQUIRED",
|
|
218
|
+
serverId: id,
|
|
188
219
|
error: oauth.session?.error ?? "MCP server authorization is required"
|
|
189
220
|
}, 409);
|
|
190
221
|
const capabilities = await listBundleMcpServerCapabilitiesForGateway({
|
|
@@ -198,6 +229,12 @@ function registerMcpRoutes(authenticated, deps) {
|
|
|
198
229
|
} : cfg,
|
|
199
230
|
serverId: id
|
|
200
231
|
});
|
|
232
|
+
if (capabilities.error) return c.json({
|
|
233
|
+
ok: false,
|
|
234
|
+
code: capabilities.error.code,
|
|
235
|
+
serverId: id,
|
|
236
|
+
error: capabilities.error.message
|
|
237
|
+
}, capabilities.error.code === "MCP_AUTHORIZATION_REQUIRED" ? 409 : 502);
|
|
201
238
|
return c.json({
|
|
202
239
|
ok: true,
|
|
203
240
|
payload: {
|
|
@@ -212,16 +249,6 @@ function registerMcpRoutes(authenticated, deps) {
|
|
|
212
249
|
}, 500);
|
|
213
250
|
}
|
|
214
251
|
});
|
|
215
|
-
authenticated.post("/api/mcp/approvals/respond", async (c) => {
|
|
216
|
-
const body = await c.req.json().catch(() => ({}));
|
|
217
|
-
return c.json({
|
|
218
|
-
ok: true,
|
|
219
|
-
payload: {
|
|
220
|
-
acknowledged: true,
|
|
221
|
-
body
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
252
|
}
|
|
226
253
|
//#endregion
|
|
227
254
|
export { registerMcpRoutes };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
2
1
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
2
|
+
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
3
3
|
import { computerModelProfile, init_model_policy, isDedicatedComputerModel } from "../../../computer/model-policy.js";
|
|
4
4
|
import { init_models_json, loadModelsJson, saveModelsJson, validateModelsConfig } from "../../../config/models-json.js";
|
|
5
5
|
import { getModelCatalogStore, init_model_catalog_store } from "../../../providers/model-catalog-store.js";
|
|
@@ -53,6 +53,7 @@ export declare function submitSessionInput(c: Context, deps: AuthenticatedRouteD
|
|
|
53
53
|
};
|
|
54
54
|
attachments?: import("hono/dist/types/utils/types.js").JSONValue[];
|
|
55
55
|
contextRefs?: {
|
|
56
|
+
refId?: string;
|
|
56
57
|
kind: import("../../../agent/source-context/types.js").AgentSourceContext["kind"];
|
|
57
58
|
sourceId: string;
|
|
58
59
|
version: string;
|
|
@@ -65,6 +66,7 @@ export declare function submitSessionInput(c: Context, deps: AuthenticatedRouteD
|
|
|
65
66
|
fileKind?: "file" | "directory";
|
|
66
67
|
}[];
|
|
67
68
|
contextSnapshots?: {
|
|
69
|
+
refId?: string;
|
|
68
70
|
kind: import("../../../agent/source-context/types.js").SessionSourceBinding["kind"] | "task" | "file" | "session" | "mcp_resource" | "browser_tab" | "browser_page" | "app_context";
|
|
69
71
|
sourceId: string;
|
|
70
72
|
version: string;
|
|
@@ -189,6 +191,7 @@ export declare function replaceLatestSessionTurn(c: Context, deps: Authenticated
|
|
|
189
191
|
};
|
|
190
192
|
attachments?: import("hono/dist/types/utils/types.js").JSONValue[];
|
|
191
193
|
contextRefs?: {
|
|
194
|
+
refId?: string;
|
|
192
195
|
kind: import("../../../agent/source-context/types.js").AgentSourceContext["kind"];
|
|
193
196
|
sourceId: string;
|
|
194
197
|
version: string;
|
|
@@ -201,6 +204,7 @@ export declare function replaceLatestSessionTurn(c: Context, deps: Authenticated
|
|
|
201
204
|
fileKind?: "file" | "directory";
|
|
202
205
|
}[];
|
|
203
206
|
contextSnapshots?: {
|
|
207
|
+
refId?: string;
|
|
204
208
|
kind: import("../../../agent/source-context/types.js").SessionSourceBinding["kind"] | "task" | "file" | "session" | "mcp_resource" | "browser_tab" | "browser_page" | "app_context";
|
|
205
209
|
sourceId: string;
|
|
206
210
|
version: string;
|