@xopcai/xopc 0.0.483 → 0.0.485
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-tm02ZZB8.js → auth-8EjgHa-n.js} +28 -6
- package/dist/browser-ext/dist/background.js +7 -3
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +4 -6
- package/dist/extensions/telegram/src/plugin.js +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/messaging/process-message.js +3 -2
- package/dist/gateway/server/chunks.bin +1029 -1008
- package/dist/gateway/server/chunks.json +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DO5uTFRI.js → apps-page-CH9wENBj.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-C5rp_vOE.js → automations-page-uY_wmZY1.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-BxN47gkP.js → automations-workspace-DyQq55Rh.js} +2 -2
- package/dist/gateway/static/root/assets/bell-BlYch9Vg.js +1 -0
- package/dist/gateway/static/root/assets/browser-notification-delivery-DjK3F0oR.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-WCl7Fdce.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-B1o8BKxy.js → capabilities-settings-panel-BOwbZn9X.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-_m_FjvAY.js → channels-DlnXbcOj.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-3fVhP77N.js +74 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BKnlzlXT.js → chat-terminal-dock-DE8j-K9d.js} +1 -1
- package/dist/gateway/static/root/assets/command-palette-api-UrqPvWR1.js +1 -0
- package/dist/gateway/static/root/assets/{connectors-page-CXNy8Y5R.js → connectors-page-BJm1jjct.js} +1 -1
- package/dist/gateway/static/root/assets/device-connections-panel-DE01vyK_.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BcjkhaY9.js → extension-debug-page-D3X7SlzG.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-RWjaucjJ.js → extension-iframe-host-CIAq7PSn.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-CzVgJn5c.js → extension-message-router-B2wbucV7.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DC58VBdj.js → extension-page-qwY7r1_p.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-BGrqW0_n.js → extension-provider-DFcRbTHI.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DYbal3Iq.js → extension-settings-page-Cpnh9lcZ.js} +1 -1
- package/dist/gateway/static/root/assets/file-preview-surface-Da1xZiG6.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-CoIFB3im.js +1 -0
- package/dist/gateway/static/root/assets/{home-page-DnjsusRG.js → home-page-BusNFHe-.js} +3 -3
- package/dist/gateway/static/root/assets/index-790PGhZb.js +11 -0
- package/dist/gateway/static/root/assets/index-B_TGvH_k.css +1 -0
- package/dist/gateway/static/root/assets/{local-app-workbench-page-DH5c5Zhv.js → local-app-workbench-page-B9uSL1Mi.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-D2olKpTB.js → logs-page-0hkRbcUR.js} +1 -1
- package/dist/gateway/static/root/assets/map-pin-BFRLhzQ9.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-Bwm_aehq.js +7 -0
- package/dist/gateway/static/root/assets/{notes-page-YQAAdasN.js → notes-page-DkZWV3Ds.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-CDSH76wA.js → page-context-capture-button-BXSBeGms.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-Bfgb5oQI.js → personal-page-cauym9hr.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-profile-settings-BvjLssF9.js → personal-profile-settings-TcI0Zfwr.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-Ffr7gcx4.js → personal-settings-panel-BJ46T7ZO.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-runtime-pNF_b2oD.js → preview-runtime-C1U57WSM.js} +1 -1
- package/dist/gateway/static/root/assets/product-automation-feedback-GA_YPLkr.js +1 -0
- package/dist/gateway/static/root/assets/{project-detail-page-DDaG-n-H.js → project-detail-page-D9WKZe3z.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-DF8LOfKW.js +2 -0
- package/dist/gateway/static/root/assets/routine-panel-Bfbiz0IN.js +2 -0
- package/dist/gateway/static/root/assets/{session-manager-CVNlrzFB.js → session-manager-DUWeBdeG.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DzISa84O.js → settings-page-Cd9WZ-Ac.js} +1 -1
- package/dist/gateway/static/root/assets/share-2-CnIB9PsV.js +1 -0
- package/dist/gateway/static/root/assets/{share-link-dialog-D31jDQN9.js → share-link-dialog-2JjvWs0q.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Co6GUYV5.js → share-preview-page-Di5_ukH8.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-C-czUl49.js → shares-settings-CirGM67m.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-gGU0LZ5e.js → skills-page-kL8E5zgi.js} +1 -1
- package/dist/gateway/static/root/assets/space-page-DlJB7GT1.js +2 -0
- package/dist/gateway/static/root/assets/system-settings-panel-0e2zfQLt.js +1 -0
- package/dist/gateway/static/root/assets/{task-detail-page-DWoXIgp2.js → task-detail-page-BFa0Px-B.js} +1 -1
- package/dist/gateway/static/root/assets/{task-header-title-DfyaQ58P.js → task-header-title-qzNctGl5.js} +1 -1
- package/dist/gateway/static/root/assets/{task-run-issue-notice-CljFUd21.js → task-run-issue-notice-CGrUMy0s.js} +1 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-DJsIzJ1c.js +2 -0
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-U5rH80Jf.js → use-file-preview-expanded-BFF2vXm5.js} +1 -1
- package/dist/gateway/static/root/assets/{use-personal-work-FI9Cgyq5.js → use-personal-work-B1DWeBnm.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-BARxeNLd.js → use-realtime-voice-9OvLwHzk.js} +1 -1
- package/dist/gateway/static/root/assets/use-share-link-WKZLlEqr.js +1 -0
- package/dist/gateway/static/root/assets/{use-workspace-tree-NEeru2fw.js → use-workspace-tree-LCIT1H-D.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-bAmN4bUq.js → voice-settings-j8o-hGTm.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-C8-p66T-.js → workspace-api-BuNWyNvA.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-file-preview-dialog-DwVWTehC.js +1 -0
- package/dist/gateway/static/root/index.html +27 -24
- package/dist/package.js +1 -1
- package/dist/packages/endpoint-tools-client/src/index.js +6 -3
- package/dist/packages/endpoint-tools-protocol/src/folders.js +5 -10
- package/dist/packages/endpoint-tools-protocol/src/index.js +50 -10
- package/dist/packages/endpoint-tools-protocol/src/location.js +1 -1
- package/dist/packages/endpoint-tools-protocol/src/personal.js +2 -2
- package/dist/src/agent/agent-manager.js +14 -14
- package/dist/src/agent/background-review/prompts.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +8 -8
- package/dist/src/agent/context/coordinator.js +1 -1
- package/dist/src/agent/context/deep-recall.js +4 -4
- package/dist/src/agent/context/execution-context.js +3 -3
- package/dist/src/agent/context/project-context.js +4 -4
- package/dist/src/agent/embedded/execution-tool-policy.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +4 -4
- package/dist/src/agent/embedded/run-turn.js +1 -1
- package/dist/src/agent/embedded/session-runner.js +3 -3
- package/dist/src/agent/external-tools/cliProvider.js +4 -4
- package/dist/src/agent/external-tools/composio-provider.js +3 -3
- package/dist/src/agent/external-tools/endpoint-provider.js +24 -14
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/mcp/connection-drafts.d.ts +3 -1
- package/dist/src/agent/mcp/connection-drafts.js +25 -12
- package/dist/src/agent/mcp/connection-setup.js +15 -12
- package/dist/src/agent/mcp/managed-discovery.js +1 -1
- package/dist/src/agent/mcp/native-mcp.js +1 -0
- package/dist/src/agent/mcp/network-policy.d.ts +6 -0
- package/dist/src/agent/mcp/network-policy.js +49 -0
- package/dist/src/agent/mcp/tool-catalog.js +1 -1
- package/dist/src/agent/mcp/transport.js +15 -8
- package/dist/src/agent/messaging/message-router.js +2 -2
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
- package/dist/src/agent/orchestration/child-run-resume.js +1 -1
- package/dist/src/agent/prompt/response-language.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +1 -1
- package/dist/src/agent/prompt/system-prompt-params.js +1 -1
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +9 -24
- package/dist/src/agent/service/process-direct-streaming.js +2 -2
- package/dist/src/agent/service.js +10 -10
- package/dist/src/agent/session/session-config-service.js +1 -1
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.js +1 -1
- package/dist/src/agent/skills/skill-sources.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +6 -6
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +2 -2
- package/dist/src/agent/tools/factory.js +10 -10
- package/dist/src/agent/tools/fetch-text.js +1 -1
- package/dist/src/agent/tools/index.js +3 -3
- package/dist/src/agent/tools/knowledge-memory-tool.js +1 -1
- package/dist/src/agent/tools/personal-attention-tool.js +1 -1
- package/dist/src/agent/tools/personal-memory-tool.js +5 -5
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/personal-request-result-tool.js +1 -1
- package/dist/src/agent/tools/personal-request-tool.js +2 -2
- package/dist/src/agent/tools/personal-task-tool.js +4 -4
- package/dist/src/agent/tools/session-search-tool.js +2 -2
- package/dist/src/agent/tools/user-context-tool.js +2 -2
- package/dist/src/agent/tools/xopc-use-tool.js +5 -5
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/api/routes.js +2 -2
- package/dist/src/automations/capabilities/write.js +3 -3
- package/dist/src/automations/configuration-conversation.js +1 -1
- package/dist/src/automations/domain/index.js +1 -1
- package/dist/src/automations/draft/automation-draft-service.js +1 -1
- package/dist/src/automations/index.js +2 -2
- package/dist/src/automations/service/action-executor.js +2 -2
- package/dist/src/automations/service/automation-service.js +2 -2
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/capabilities/capability-catalog.js +3 -3
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +2 -2
- package/dist/src/capabilities/store-connector.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/chat-commands/command-parse.d.ts +1 -0
- package/dist/src/chat-commands/command-parse.js +8 -10
- package/dist/src/chat-commands/registry.d.ts +5 -0
- package/dist/src/chat-commands/registry.js +8 -0
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +1 -1
- package/dist/src/cli/commands/tunnel.js +1 -1
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +2 -2
- package/dist/src/computer/endpoint-transport.d.ts +1 -1
- package/dist/src/computer/endpoint-transport.js +3 -2
- package/dist/src/computer/errors.js +2 -1
- package/dist/src/computer/model-adapter.js +1 -0
- package/dist/src/computer/runtime.d.ts +1 -0
- package/dist/src/computer/runtime.js +15 -3
- package/dist/src/config/config-file.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +2 -2
- package/dist/src/config/schema.d.ts +54 -4
- package/dist/src/config/schema.js +3 -1
- package/dist/src/connectors/connected-source-ingestion.js +2 -2
- package/dist/src/connectors/connected-source-understanding.js +2 -2
- package/dist/src/connectors/content-enrichment.js +1 -1
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/endpoint-tools/device-capability-grants.d.ts +13 -0
- package/dist/src/endpoint-tools/device-capability-grants.js +71 -0
- package/dist/src/endpoint-tools/folder-connections.d.ts +3 -1
- package/dist/src/endpoint-tools/folder-connections.js +12 -8
- package/dist/src/endpoint-tools/invocation-service.d.ts +3 -0
- package/dist/src/endpoint-tools/invocation-service.js +8 -1
- package/dist/src/endpoint-tools/policy.js +1 -1
- package/dist/src/endpoint-tools/target-resolver.js +12 -7
- package/dist/src/endpoint-tools/task-targets.d.ts +3 -2
- package/dist/src/endpoint-tools/task-targets.js +9 -4
- package/dist/src/extensions/agent-plugins/auth.js +1 -1
- package/dist/src/extensions/agent-plugins/cli-authorization.js +1 -1
- package/dist/src/extensions/agent-plugins/credentials.js +1 -1
- package/dist/src/extensions/agent-plugins/setup.js +1 -1
- package/dist/src/extensions/agent-plugins/skill-catalog.js +3 -3
- package/dist/src/extensions/agent-plugins/source-http-fetch.js +1 -1
- package/dist/src/extensions/agent-plugins/user-config.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +2 -2
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/gateway/agent-reactions/reaction.js +3 -3
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/app.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +2 -2
- package/dist/src/gateway/hono/middleware/auth.js +10 -0
- package/dist/src/gateway/hono/oauth-async.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +3 -3
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/device-connections.js +105 -14
- package/dist/src/gateway/hono/routes/endpoint-compatibility.js +6 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +1 -1
- package/dist/src/gateway/hono/routes/local-app-run-streams.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/media.js +18 -32
- package/dist/src/gateway/hono/routes/memory-learning.js +2 -2
- package/dist/src/gateway/hono/routes/mobile-capability-actions.js +4 -4
- package/dist/src/gateway/hono/routes/mobile-capability-panels.d.ts +67 -0
- package/dist/src/gateway/hono/routes/mobile-capability-panels.js +25 -140
- package/dist/src/gateway/hono/routes/mobile-mcp-setup.d.ts +9 -0
- package/dist/src/gateway/hono/routes/mobile-mcp-setup.js +929 -0
- package/dist/src/gateway/hono/routes/models.js +2 -2
- package/dist/src/gateway/hono/routes/music-generation.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/phone-setup.js +3 -3
- package/dist/src/gateway/hono/routes/phone.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +5 -5
- package/dist/src/gateway/hono/routes/session-command-handler.js +1 -4
- package/dist/src/gateway/hono/routes/session-input-handler.js +2 -5
- package/dist/src/gateway/hono/routes/sessions.js +1 -1
- package/dist/src/gateway/hono/routes/shares.js +96 -12
- package/dist/src/gateway/hono/routes/space.js +6 -3
- package/dist/src/gateway/hono/routes/tasks.js +2 -2
- package/dist/src/gateway/hono/routes/tui.js +1 -1
- package/dist/src/gateway/hono/routes/user-model.js +5 -5
- package/dist/src/gateway/hono/routes/video-generation.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/media-access.js +1 -1
- package/dist/src/gateway/next-turn-suggestions/generator.js +16 -2
- package/dist/src/gateway/next-turn-suggestions/service.d.ts +2 -1
- package/dist/src/gateway/next-turn-suggestions/service.js +17 -5
- package/dist/src/gateway/next-turn-suggestions/snapshot.d.ts +11 -0
- package/dist/src/gateway/next-turn-suggestions/snapshot.js +31 -2
- package/dist/src/gateway/security/gateway-scopes.d.ts +1 -0
- package/dist/src/gateway/security/gateway-scopes.js +9 -1
- package/dist/src/gateway/security/media-playback-ticket.d.ts +3 -0
- package/dist/src/gateway/security/media-playback-ticket.js +41 -0
- package/dist/src/gateway/service/agent-runner.js +2 -2
- package/dist/src/gateway/service/config-coordinator.d.ts +14 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +1 -1
- package/dist/src/gateway/service/session-command-service.js +2 -2
- package/dist/src/gateway/service/session-input-coordinator.js +1 -1
- package/dist/src/gateway/service.js +25 -25
- package/dist/src/gateway/session-context-summary.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/follow-ups.js +1 -1
- package/dist/src/home-intelligence/generator.js +2 -2
- package/dist/src/home-intelligence/observation.js +1 -1
- package/dist/src/home-intelligence/routines.js +2 -2
- package/dist/src/imports/importService.js +1 -1
- package/dist/src/imports/inventory.js +2 -2
- package/dist/src/imports/productImport.js +1 -1
- package/dist/src/knowledge-memory/repository.js +1 -1
- package/dist/src/knowledge-memory/usage-policy.js +1 -1
- package/dist/src/local-apps/automation-proposals.js +2 -2
- package/dist/src/local-apps/capabilities/automation-policy.js +1 -1
- package/dist/src/local-apps/capabilities/delegate.js +4 -4
- package/dist/src/local-apps/execution-authority.js +2 -2
- package/dist/src/local-apps/p1-services.js +3 -3
- package/dist/src/local-apps/preview-worker.js +1 -1
- package/dist/src/local-apps/service.js +2 -2
- package/dist/src/mcp/gateway-http-client.js +1 -1
- package/dist/src/media/generation-changes.d.ts +4 -0
- package/dist/src/media/generation-changes.js +37 -0
- package/dist/src/media-shared/http/file-response.d.ts +3 -0
- package/dist/src/media-shared/http/file-response.js +31 -0
- package/dist/src/memory-learning/choice-observations.js +6 -6
- package/dist/src/memory-learning/source-learning.js +4 -4
- package/dist/src/memory-learning/task-receipts.js +1 -1
- package/dist/src/memory-learning/work-capture.js +1 -1
- package/dist/src/memory-learning/work-review.js +2 -2
- package/dist/src/music-generation/artifact.d.ts +1 -1
- package/dist/src/music-generation/artifact.js +4 -18
- package/dist/src/music-generation/repository.js +12 -6
- package/dist/src/notes/service.js +1 -1
- package/dist/src/personal-agent/capability-service.js +1 -1
- package/dist/src/personal-agent/proactivity/routes.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +4 -4
- package/dist/src/personal-agent/prompt-context.js +4 -4
- package/dist/src/personal-agent/reply-composer.js +4 -4
- package/dist/src/personal-agent/request-delivery.js +1 -1
- package/dist/src/personal-agent/request-service.js +4 -4
- package/dist/src/personal-agent/result-reader.js +1 -1
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/personal-agent/task-cancel.js +1 -1
- package/dist/src/phone/cloud-adb-connection.js +1 -1
- package/dist/src/projects/capabilities/write.js +2 -2
- package/dist/src/projects/index.js +2 -2
- package/dist/src/projects/project-service.js +2 -2
- package/dist/src/projects/workspace.js +1 -1
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/realtime/compact-run-event.js +5 -1
- package/dist/src/session/compact-history.js +6 -3
- package/dist/src/session/history-recall-policy.js +2 -2
- package/dist/src/session/index.js +1 -1
- package/dist/src/session/reset-triggers.js +1 -1
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +1 -1
- package/dist/src/share/share-landing.d.ts +2 -0
- package/dist/src/share/share-landing.js +4 -0
- package/dist/src/share/share-store.js +3 -2
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/share/share-types.d.ts +4 -0
- package/dist/src/share/site-proxy.js +1 -1
- package/dist/src/space/repository.d.ts +9 -1
- package/dist/src/space/repository.js +75 -30
- package/dist/src/storage/sqlite/device-pairing-approval.js +1 -0
- package/dist/src/tasks/capabilities/read.js +4 -4
- package/dist/src/tasks/capabilities/relations.js +1 -1
- package/dist/src/tasks/capabilities/write.js +4 -4
- package/dist/src/tasks/home-query-service.js +1 -1
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/task-allocation-service.js +4 -4
- package/dist/src/tasks/task-application-service.js +2 -2
- package/dist/src/tasks/task-contract-planner.js +1 -1
- package/dist/src/tasks/task-execution-capabilities.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-handoff.js +6 -6
- package/dist/src/tasks/task-json-acceptance.js +1 -1
- package/dist/src/tasks/task-main-update-decision-service.js +2 -2
- package/dist/src/tasks/task-main-update-delivery.js +1 -1
- package/dist/src/tasks/task-model-call.js +1 -1
- package/dist/src/tasks/task-research-result.js +2 -2
- package/dist/src/tasks/task-result-delivery-service.js +1 -1
- package/dist/src/tasks/task-retry-service.js +1 -1
- package/dist/src/tasks/task-run-coordinator.js +4 -4
- package/dist/src/tasks/task-run-dispatcher.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +6 -6
- package/dist/src/tui/tui-capabilities.js +2 -2
- package/dist/src/tui/tui-commands.d.ts +2 -1
- package/dist/src/tui/tui-commands.js +5 -5
- package/dist/src/tui/tui-management.js +6 -6
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +2 -2
- package/dist/src/tui/tui-submit.d.ts +1 -1
- package/dist/src/tui/tui-submit.js +2 -4
- package/dist/src/tui/tui.js +4 -4
- package/dist/src/user-context/access-policy.js +2 -2
- package/dist/src/user-model/bootstrap.js +1 -1
- package/dist/src/user-model/capture/executor.js +2 -2
- package/dist/src/user-model/index.js +2 -2
- package/dist/src/user-model/usage-policy.js +1 -1
- package/dist/src/video-generation/artifact.d.ts +1 -1
- package/dist/src/video-generation/artifact.js +4 -28
- package/dist/src/video-generation/drafts.js +2 -0
- package/dist/src/video-generation/repository.js +13 -6
- package/dist/src/voice/realtime/conversation-context.js +1 -1
- package/dist/src/voice/realtime/memory-context.js +4 -4
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/user-context.js +1 -1
- package/dist/src/work-discovery/service.js +6 -6
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/browser-notification-delivery-DmE2FgGc.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-BFYx0xu5.js +0 -2
- package/dist/gateway/static/root/assets/chat-page-D7l_0kTV.js +0 -74
- package/dist/gateway/static/root/assets/command-palette-api-YP0zV_Ol.js +0 -1
- package/dist/gateway/static/root/assets/device-connections-panel-XtEX1NcJ.js +0 -1
- package/dist/gateway/static/root/assets/file-preview-surface-BOfJPMux.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-jIH8iEGO.js +0 -1
- package/dist/gateway/static/root/assets/index-Cl5ueYDl.css +0 -1
- package/dist/gateway/static/root/assets/index-DYRzuQl_.js +0 -11
- package/dist/gateway/static/root/assets/map-pin-DNclV497.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-lU1-3mBw.js +0 -7
- package/dist/gateway/static/root/assets/product-automation-feedback-BxA2Ype-.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-B-OXsVjy.js +0 -2
- package/dist/gateway/static/root/assets/routine-panel-BWLC11Ou.js +0 -2
- package/dist/gateway/static/root/assets/space-page-DhhqkNGh.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-Gu0rWNOv.js +0 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-Dnrs5cP1.js +0 -2
- package/dist/gateway/static/root/assets/workspace-file-preview-dialog-BlNfLhnV.js +0 -1
|
@@ -16,12 +16,12 @@ var EndpointTaskTargetService = class {
|
|
|
16
16
|
this.listeners.delete(listener);
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
select(conversationId, endpointId, now = Date.now(), actorPrincipalId,
|
|
19
|
+
select(conversationId, endpointId, now = Date.now(), actorPrincipalId, capabilityTool) {
|
|
20
20
|
const key = this.key(conversationId), endpoint = this.registry.get(endpointId);
|
|
21
21
|
if (!endpoint) throw new Error("TARGET_OFFLINE");
|
|
22
22
|
actorPrincipalId ??= this.actorPrincipalId(key);
|
|
23
23
|
const current = this.get(key);
|
|
24
|
-
if (current && current.endpointId === endpointId && current.principalId === endpoint.principalId && current.connectionId === endpoint.connectionId && current.actorPrincipalId === actorPrincipalId && current.
|
|
24
|
+
if (current && current.endpointId === endpointId && current.principalId === endpoint.principalId && current.connectionId === endpoint.connectionId && current.actorPrincipalId === actorPrincipalId && current.capabilityTool === capabilityTool && current.expiresAt > now) return current;
|
|
25
25
|
this.assertReleased(key);
|
|
26
26
|
if (!current) {
|
|
27
27
|
const stored = [...this.targets.entries()];
|
|
@@ -40,7 +40,7 @@ var EndpointTaskTargetService = class {
|
|
|
40
40
|
expiresAt: now + 30 * 6e4,
|
|
41
41
|
transcriptId: this.transcriptId(key),
|
|
42
42
|
actorPrincipalId,
|
|
43
|
-
...
|
|
43
|
+
...capabilityTool && { capabilityTool }
|
|
44
44
|
};
|
|
45
45
|
this.targets.set(key, target);
|
|
46
46
|
for (const listener of this.listeners) listener(key);
|
|
@@ -53,7 +53,12 @@ var EndpointTaskTargetService = class {
|
|
|
53
53
|
this.clear(key);
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
const { mobileTool, ...binding } = target;
|
|
57
|
+
const capabilityTool = target.capabilityTool ?? mobileTool;
|
|
58
|
+
return capabilityTool ? {
|
|
59
|
+
...binding,
|
|
60
|
+
capabilityTool
|
|
61
|
+
} : binding;
|
|
57
62
|
}
|
|
58
63
|
resolve(conversationId) {
|
|
59
64
|
const target = this.get(conversationId);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../../config/paths-state.js";
|
|
2
2
|
import { init_write_file_atomic, writeTextAtomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
3
|
+
import { pluginName } from "./validation.js";
|
|
3
4
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
4
5
|
import { isDangerousHostEnvVarName } from "../../infra/host-env-security.js";
|
|
5
|
-
import { pluginName } from "./validation.js";
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { existsSync, readFileSync } from "node:fs";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
2
1
|
import { parsePluginAuthorizationCheck, pluginAuthorizations, safeAuthorizationUrl } from "./setup-contract.js";
|
|
3
2
|
import { containedPath } from "./contained-path.js";
|
|
4
3
|
import { expandPluginVariables, resolvePluginCwd, validatePluginServer } from "./validation.js";
|
|
5
4
|
import { spawnProcess } from "../../process/run-process.js";
|
|
5
|
+
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
6
6
|
import { expandUserConfig, readPluginUserConfig } from "./user-config.js";
|
|
7
7
|
import { pluginNodeRuntime } from "./node-runtime.js";
|
|
8
8
|
import { homedir } from "node:os";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../../config/paths-state.js";
|
|
2
|
-
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
3
2
|
import { pluginName, pluginServerId } from "./validation.js";
|
|
3
|
+
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
4
4
|
import { pluginCredentialProviderPrefix } from "./auth.js";
|
|
5
5
|
import { pluginOAuthCredentialId } from "./mcp-adapter.js";
|
|
6
6
|
import { createNativeMcpCredentials } from "../../agent/mcp/credential-store.js";
|
|
@@ -7,12 +7,12 @@ import { pluginName, pluginServerId } from "./validation.js";
|
|
|
7
7
|
import { AgentPluginStore } from "./store.js";
|
|
8
8
|
import { readPluginAuthBinding, savePluginAuthBinding, savePluginOAuthReference } from "./auth.js";
|
|
9
9
|
import { pluginConfigMissing, readPluginUserConfig, savePluginUserConfig } from "./user-config.js";
|
|
10
|
+
import { cancelPluginCliAuthorizations, getPluginCliAuthorization, inspectPluginCliAuthorization, startPluginCliAuthorization } from "./cli-authorization.js";
|
|
10
11
|
import { materializePluginServers } from "./mcp-adapter.js";
|
|
11
12
|
import { connectionFingerprint, matchingReusableConnection } from "./connection-reuse.js";
|
|
12
13
|
import { createNativeMcpCredentials } from "../../agent/mcp/credential-store.js";
|
|
13
14
|
import { getNativePiAgentDir } from "../../agent/mcp/native-mcp.js";
|
|
14
15
|
import { cancelMcpAuthorization, getMcpAuthorization, probeMcpConnection, startMcpAuthorization, submitMcpRedirect } from "../../agent/mcp/connection-setup.js";
|
|
15
|
-
import { cancelPluginCliAuthorizations, getPluginCliAuthorization, inspectPluginCliAuthorization, startPluginCliAuthorization } from "./cli-authorization.js";
|
|
16
16
|
import { join } from "node:path";
|
|
17
17
|
import { existsSync, readFileSync } from "node:fs";
|
|
18
18
|
import { randomUUID } from "node:crypto";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
2
|
-
import { createSkillConfigManager } from "../../agent/skills/config.js";
|
|
3
|
-
import { parseSkillLocalizations } from "../../agent/skills/parse-skill-metadata.js";
|
|
4
1
|
import { containedPath } from "./contained-path.js";
|
|
5
2
|
import "./validation.js";
|
|
6
3
|
import { AgentPluginStore } from "./store.js";
|
|
4
|
+
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
5
|
+
import { createSkillConfigManager } from "../../agent/skills/config.js";
|
|
6
|
+
import { parseSkillLocalizations } from "../../agent/skills/parse-skill-metadata.js";
|
|
7
7
|
import { buildSkillMarkdownPreviewFromRaw } from "../../agent/skills/skill-markdown-preview-from-raw.js";
|
|
8
8
|
import { agentPluginInventoryRow } from "./inventory.js";
|
|
9
9
|
import { basename, dirname } from "node:path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockList, isIP } from "node:net";
|
|
2
|
-
import { Agent, fetch } from "undici";
|
|
3
2
|
import { lookup } from "node:dns";
|
|
3
|
+
import { Agent, fetch } from "undici";
|
|
4
4
|
//#region src/extensions/agent-plugins/source-http-fetch.ts
|
|
5
5
|
const blocked = new BlockList();
|
|
6
6
|
for (const [network, prefix] of [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
|
-
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
3
2
|
import { pluginAuthorizations } from "./setup-contract.js";
|
|
4
3
|
import { pluginName } from "./validation.js";
|
|
4
|
+
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
5
5
|
import { pluginCredentialProviderPrefix } from "./auth.js";
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { McpOAuthConfigSchema, init_schema } from "../../config/schema.js";
|
|
2
1
|
import { pluginAuthorizations, safeAuthorizationUrl } from "./setup-contract.js";
|
|
3
2
|
import { pluginCapabilityAccess } from "./capability-access.js";
|
|
4
3
|
import { normalizePluginMcpServer } from "./mcp-format.js";
|
|
4
|
+
import { McpOAuthConfigSchema, init_schema } from "../../config/schema.js";
|
|
5
5
|
import { containedPath } from "./contained-path.js";
|
|
6
6
|
import { pluginResources } from "./resources.js";
|
|
7
7
|
import { collectPluginSkillFiles, readPluginLayout } from "./formats.js";
|
|
@@ -9,8 +9,8 @@ import { dirname, join, resolve } from "node:path";
|
|
|
9
9
|
import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
11
|
import { z } from "zod";
|
|
12
|
-
import yaml from "js-yaml";
|
|
13
12
|
import { validateHeaderName, validateHeaderValue } from "node:http";
|
|
13
|
+
import yaml from "js-yaml";
|
|
14
14
|
//#region src/extensions/agent-plugins/validation.ts
|
|
15
15
|
init_schema();
|
|
16
16
|
const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
@@ -9,8 +9,8 @@ import { collectExtensionPackageDependencyIssues } from "./package-contract.js";
|
|
|
9
9
|
import { dirname, isAbsolute, join, resolve, sep } from "path";
|
|
10
10
|
import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "fs";
|
|
11
11
|
import { execFileSync } from "node:child_process";
|
|
12
|
-
import semver from "semver";
|
|
13
12
|
import AdmZip from "adm-zip";
|
|
13
|
+
import semver from "semver";
|
|
14
14
|
import { tmpdir } from "os";
|
|
15
15
|
//#region src/extensions/install.ts
|
|
16
16
|
/**
|
|
@@ -7,11 +7,11 @@ import { getActiveConnectionWait, init_connection_wait_repository } from "../../
|
|
|
7
7
|
import { getCurrentTranscriptId, init_session_repository } from "../../storage/sqlite/session-repository.js";
|
|
8
8
|
import { getActiveClarification } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
9
9
|
import { getSessionConfig } from "../../storage/sqlite/config-repository.js";
|
|
10
|
-
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
11
|
-
import { resolveMessageReactionsEnabled } from "../../personal-agent/repository.js";
|
|
12
10
|
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
13
|
-
import {
|
|
11
|
+
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
14
12
|
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
13
|
+
import { stripRuntimeContextFromUserMessage } from "../../session/user-message-display.js";
|
|
14
|
+
import { resolveMessageReactionsEnabled } from "../../personal-agent/repository.js";
|
|
15
15
|
import { flattenMessageContent } from "../../session/client-history.js";
|
|
16
16
|
import { DEFAULT_AGENT_REACTION, activeReactionEntry, commitAgentReaction, hasActiveReactionInput, reactionCoolingDown } from "../../storage/sqlite/agent-reaction-repository.js";
|
|
17
17
|
import { setImmediate, setTimeout } from "node:timers/promises";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { normalizeAgentId, validateAgentIdForNewAgent } from "../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
3
3
|
import { init_agent_scope, listAgentEntries, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath } from "../agent/agent-scope.js";
|
|
4
|
-
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
5
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
6
4
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
5
|
+
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
7
6
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
8
8
|
import { GATEWAY_BUILTIN_TOOL_IDS } from "./agent-builtin-tools.js";
|
|
9
9
|
import { resolve } from "node:path";
|
|
10
10
|
import { mkdir, readFile, realpath, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -2,8 +2,8 @@ import { init_paths_state, resolveStateDir } from "../config/paths-state.js";
|
|
|
2
2
|
import { init_agent_scope, resolveAgentProfileDir } from "../agent/agent-scope.js";
|
|
3
3
|
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
4
4
|
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
5
|
-
import { isBareProfileMarkdownFileName, resolveProfileMarkdownPathIfBareName } from "../agent/tools/tool-paths.js";
|
|
6
5
|
import { isPathUnderWorkspace } from "./workspace-editor-path.js";
|
|
6
|
+
import { isBareProfileMarkdownFileName, resolveProfileMarkdownPathIfBareName } from "../agent/tools/tool-paths.js";
|
|
7
7
|
import { homedir } from "node:os";
|
|
8
8
|
import { basename, isAbsolute, resolve } from "node:path";
|
|
9
9
|
import { stat } from "node:fs/promises";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AgentDefaultsSchema } from "../agent-config/schema.js";
|
|
2
2
|
import { init_agent_config } from "../agent-config/index.js";
|
|
3
3
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
4
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
5
4
|
import { validatePhoneModelChange } from "../phone/model-adapter.js";
|
|
5
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
6
6
|
import { validateComputerModelChange } from "../computer/model-config.js";
|
|
7
7
|
import { GATEWAY_BUILTIN_TOOLS } from "./agent-builtin-tools.js";
|
|
8
8
|
import { isDeepStrictEqual } from "node:util";
|
|
@@ -6,10 +6,10 @@ import { resolveAllowedBrowserOrigins, resolveGatewayServiceListenPort } from ".
|
|
|
6
6
|
import { listDevices } from "../../storage/sqlite/device-access-repository.js";
|
|
7
7
|
import { ENDPOINT_MAX_FILE_BYTES, init_src as init_src$1 } from "../../../packages/endpoint-tools-protocol/src/index.js";
|
|
8
8
|
import { resolveReverseProxyPublicUrl } from "../public-url.js";
|
|
9
|
-
import { BROWSER_EXTENSION_ID } from "../../browser/extension-identity.js";
|
|
10
9
|
import { resolveGatewayEffectiveHost } from "../../config/gateway-bind.js";
|
|
11
10
|
import { loadTunnelState } from "../../tunnel/tunnel-state.js";
|
|
12
11
|
import { maxSessionInputRequestBodyBytes } from "../chat-limits.js";
|
|
12
|
+
import { BROWSER_EXTENSION_ID } from "../../browser/extension-identity.js";
|
|
13
13
|
import { isLoopbackIpAddress, isTrustedProxyAddress } from "../client-ip.js";
|
|
14
14
|
import "../html-preview-shell.js";
|
|
15
15
|
import { buildGatewayConsoleCspHeader } from "../security/csp.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { normalizeAgentId } from "../../../agent-catalog/id.js";
|
|
2
2
|
import { AgentCatalogRepository, init_repository } from "../../../agent-catalog/repository.js";
|
|
3
3
|
import { init_agent_scope, listAgentEntries, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
4
|
-
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
5
4
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
5
|
+
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
6
6
|
import { init_models_json, loadModelsJson } from "../../../config/models-json.js";
|
|
7
7
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
8
8
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
9
9
|
import { getAllProviders, init_providers, isProviderConfigured } from "../../../providers/index.js";
|
|
10
10
|
import { normalizeConfiguredMcpServers } from "../../../config/mcp-config-normalize.js";
|
|
11
|
-
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus } from "../../../channels/catalog/channel-catalog-service.js";
|
|
12
11
|
import { resolveShareConfig } from "../../../share/share-config.js";
|
|
13
12
|
import { maskTunnelSecretForWeb } from "../../../tunnel/env.js";
|
|
13
|
+
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus } from "../../../channels/catalog/channel-catalog-service.js";
|
|
14
14
|
import { resolveSessionConfigForWeb, resolveUpdateConfigForWeb } from "../../../config/web-patch.js";
|
|
15
15
|
import { GENERIC_MASKED_SECRET, maskSecretLength } from "./mask-secret-length.js";
|
|
16
16
|
import { safeToolsWebForGet } from "../../config-tools-web.js";
|
|
@@ -15,6 +15,7 @@ import { authenticateBrowserSession } from "../../../storage/sqlite/browser-sess
|
|
|
15
15
|
import { isChromeExtensionOrigin } from "../../security/origin-check.js";
|
|
16
16
|
import { browserCookieRequestAllowed, readBrowserSessionCookie, writeBrowserSessionCookie } from "../../security/browser-session.js";
|
|
17
17
|
import { authorizeTrustedProxy } from "../../trusted-proxy.js";
|
|
18
|
+
import { authenticateMediaPlaybackTicket } from "../../security/media-playback-ticket.js";
|
|
18
19
|
import { setGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
19
20
|
import { createMiddleware } from "hono/factory";
|
|
20
21
|
import { getConnInfo } from "@hono/node-server/conninfo";
|
|
@@ -204,6 +205,15 @@ function auth(config) {
|
|
|
204
205
|
const origin = c.req.header("origin");
|
|
205
206
|
const rl = buildRateLimitContext(getGatewayAuth, clientIp, origin, isPublicTunnelEnabled?.());
|
|
206
207
|
const authHeader = extractTokenFromHeader(c.req.header("authorization"));
|
|
208
|
+
if (!authHeader && c.req.query("playbackTicket")) {
|
|
209
|
+
const principal = authenticateMediaPlaybackTicket(new URL(c.req.url), c.req.method);
|
|
210
|
+
if (!principal) return c.json({
|
|
211
|
+
error: "Unauthorized",
|
|
212
|
+
code: "invalid_playback_ticket"
|
|
213
|
+
}, 401);
|
|
214
|
+
setGatewayPrincipal(c, principal);
|
|
215
|
+
return next();
|
|
216
|
+
}
|
|
207
217
|
const browserCookie = readBrowserSessionCookie(c);
|
|
208
218
|
if (!authHeader && browserCookie) {
|
|
209
219
|
if (!browserCookieRequestAllowed(c)) return c.json({
|
|
@@ -3,9 +3,9 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
import { isLoopbackHost } from "../host.js";
|
|
4
4
|
import { getOAuthProviderInterfaces, init_registry } from "../../auth/oauth/registry.js";
|
|
5
5
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
6
|
-
import { resolveReverseProxyPublicUrl } from "../public-url.js";
|
|
7
6
|
import { buildCapabilityPlansForConfig } from "../../capabilities/readiness/from-config.js";
|
|
8
7
|
import "../../capabilities/readiness/index.js";
|
|
8
|
+
import { resolveReverseProxyPublicUrl } from "../public-url.js";
|
|
9
9
|
import { applyXopcCloudCapabilitySetup } from "../xopc-cloud-capability-setup.js";
|
|
10
10
|
import { Hono } from "hono";
|
|
11
11
|
//#region src/gateway/hono/oauth-async.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PluginSelectionRequired } from "../../../extensions/agent-plugins/source-catalog.js";
|
|
2
2
|
import { AgentPluginStore } from "../../../extensions/agent-plugins/store.js";
|
|
3
|
-
import { savePluginAuthBinding } from "../../../extensions/agent-plugins/auth.js";
|
|
4
3
|
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
5
4
|
import { agentPluginInventoryRow } from "../../../extensions/agent-plugins/inventory.js";
|
|
5
|
+
import { savePluginAuthBinding } from "../../../extensions/agent-plugins/auth.js";
|
|
6
6
|
import { cancelPluginCliAuthorizations } from "../../../extensions/agent-plugins/cli-authorization.js";
|
|
7
7
|
import { PluginSetupService, setupActionSchema } from "../../../extensions/agent-plugins/setup.js";
|
|
8
8
|
import { evictAllEmbeddedSessionRunners } from "../../../agent/embedded/session-runner.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getSqliteDatabase, init_transaction } from "../../../storage/sqlite/transaction.js";
|
|
2
2
|
import { ExtensionUiGrantInputSchema } from "../../../../packages/gateway-contract/src/extension-capabilities.js";
|
|
3
3
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
4
|
-
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
5
4
|
import { getAllModels, getAvailableModels, init_providers } from "../../../providers/index.js";
|
|
6
5
|
import { listAutomations } from "../../../automations/storage/automation-repository.js";
|
|
7
6
|
import "../../../automations/storage/index.js";
|
|
7
|
+
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
8
8
|
import { listAgentPluginInventory } from "../../../extensions/agent-plugins/inventory.js";
|
|
9
9
|
import { automationConfigurationDigest } from "../../../local-apps/capabilities/automation-policy.js";
|
|
10
10
|
import { assertProposalCurrent, automationProposalReview, readAutomationProposal, resolveAutomationProposal } from "../../../local-apps/automation-proposals.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { init_agent_scope, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
2
2
|
import { getSessionMetadata } from "../../../storage/sqlite/session-read-repository.js";
|
|
3
3
|
import { init_session_repository } from "../../../storage/sqlite/session-repository.js";
|
|
4
|
-
import { ProjectService } from "../../../projects/project-service.js";
|
|
5
|
-
import { isRegisteredProvider } from "../../../agent/skills/marketplace/registry.js";
|
|
6
|
-
import "../../../agent/skills/skills-marketplace.js";
|
|
7
4
|
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
8
5
|
import { effectiveWorkspacePathForSession, projectWorkspacePath } from "../../../session/session-workspace.js";
|
|
9
6
|
import { getProjectForSession } from "../../../projects/workspace.js";
|
|
7
|
+
import { ProjectService } from "../../../projects/project-service.js";
|
|
8
|
+
import { isRegisteredProvider } from "../../../agent/skills/marketplace/registry.js";
|
|
9
|
+
import "../../../agent/skills/skills-marketplace.js";
|
|
10
10
|
import "../../../projects/index.js";
|
|
11
11
|
import { isSkillInstallTarget } from "../../../agent/skills/install-target.js";
|
|
12
12
|
import { commandRegistry } from "../../../chat-commands/registry.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BindingsSchema, init_binding_schema } from "../../../../routing/binding-schema.js";
|
|
2
|
-
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
3
2
|
import { ComputerConfigSchema, init_config } from "../../../../computer/config.js";
|
|
4
3
|
import { ContextPlanningConfigSchema, HomeIntelligenceConfigSchema, KnowledgeMemoryConfigSchema, UserContextConfigSchema, UserModelConfigSchema, init_config as init_config$1 } from "../../../../user-context/config.js";
|
|
5
4
|
import { BrowserConfigSchema, McpConfigSchema, VoiceConfigSchema, init_schema } from "../../../../config/schema.js";
|
|
6
5
|
import { CredentialResolver, init_credentials } from "../../../../auth/credentials.js";
|
|
7
6
|
import { canonicalizeConfiguredMcpServer } from "../../../../config/mcp-config-normalize.js";
|
|
7
|
+
import { AgentCatalogService } from "../../../../agent-catalog/service.js";
|
|
8
8
|
import { mergeGatewaySkillsMarketplacePatch, mergeSessionConfigPatch, mergeUpdateConfigPatch } from "../../../../config/web-patch.js";
|
|
9
9
|
import { assertGatewayAuthConfigured, resolveGatewayAuth } from "../../../auth.js";
|
|
10
10
|
import { isMaskedSecretPatchValue } from "../../lib/mask-secret-length.js";
|
|
@@ -3,19 +3,22 @@ import { init_logger } from "../../../utils/logger.js";
|
|
|
3
3
|
import { init_transaction, runSqliteWriteTransaction } from "../../../storage/sqlite/transaction.js";
|
|
4
4
|
import { getDevice, listDevices } from "../../../storage/sqlite/device-access-repository.js";
|
|
5
5
|
import { deviceFolderSigningPayload, deviceFolderSnapshotSchema } from "../../../../packages/endpoint-tools-protocol/src/folders.js";
|
|
6
|
-
import { deviceConnectionChatRequestSchema, endpointTurnClaimSchema, init_src } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
6
|
+
import { desktopCapabilitySigningPayload, desktopCapabilitySnapshotSchema, deviceConnectionChatRequestSchema, endpointTurnClaimSchema, init_src, mobileDeviceCapabilityGrantSchema } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
7
7
|
import { deviceExecutionPrincipalId } from "../../../endpoint-tools/execution-actor.js";
|
|
8
8
|
import { init_agent_scope, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
9
9
|
import { getEndpointPrincipal, listEndpointPrincipals } from "../../../storage/sqlite/endpoint-principal-repository.js";
|
|
10
10
|
import { createConversation, init_conversation_repository } from "../../../storage/sqlite/conversation-repository.js";
|
|
11
|
+
import { init_src as init_src$1 } from "../../../../packages/computer-control-contract/src/index.js";
|
|
11
12
|
import { getEndpointDeviceSettings } from "../../../storage/sqlite/endpoint-device-settings-repository.js";
|
|
12
|
-
import { deviceFolderSnapshots, deviceFoldersFor, mobileFolderPlatforms, saveDeviceFolderSnapshot } from "../../../endpoint-tools/folder-connections.js";
|
|
13
|
+
import { deviceFolderSnapshots, deviceFoldersFor, mobileFolderPlatforms, pairedFolderClientId, saveDeviceFolderSnapshot } from "../../../endpoint-tools/folder-connections.js";
|
|
14
|
+
import { deviceCapabilityAllowed, deviceCapabilityTitles, isManagedDeviceCapability, saveDesktopCapabilitySnapshot, setMobileCapabilityAllowed } from "../../../endpoint-tools/device-capability-grants.js";
|
|
13
15
|
import { parseEndpointPublicKey } from "../../../endpoint-tools/auth.js";
|
|
14
16
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
15
17
|
import { verify } from "node:crypto";
|
|
16
18
|
import { z } from "zod";
|
|
17
19
|
import { bodyLimit } from "hono/body-limit";
|
|
18
20
|
//#region src/gateway/hono/routes/device-connections.ts
|
|
21
|
+
init_src$1();
|
|
19
22
|
init_src();
|
|
20
23
|
init_agent_scope();
|
|
21
24
|
init_conversation_repository();
|
|
@@ -28,20 +31,21 @@ const publicationSchema = z.strictObject({
|
|
|
28
31
|
snapshot: deviceFolderSnapshotSchema,
|
|
29
32
|
signature: z.string().regex(/^[A-Za-z0-9_-]{86}$/)
|
|
30
33
|
});
|
|
34
|
+
const desktopPublicationSchema = publicationSchema.extend({ snapshot: desktopCapabilitySnapshotSchema });
|
|
31
35
|
function registerDeviceConnectionRoutes(app, deps) {
|
|
32
36
|
const runtime = deps.service.endpointTools;
|
|
33
37
|
app.get(root, (c) => {
|
|
34
38
|
c.header("Cache-Control", "no-store");
|
|
35
39
|
const actor = getGatewayPrincipal(c);
|
|
36
40
|
const owner = actor.kind === "owner" && actor.scopes.includes("gateway.admin");
|
|
37
|
-
const
|
|
38
|
-
if (!owner &&
|
|
41
|
+
const sourceId = pairedFolderClientId(actor);
|
|
42
|
+
if (!owner && !sourceId) return c.json({
|
|
39
43
|
ok: false,
|
|
40
44
|
error: { code: "FORBIDDEN" }
|
|
41
45
|
}, 403);
|
|
42
46
|
const ids = /* @__PURE__ */ new Map();
|
|
43
47
|
for (const device of listDevices()) {
|
|
44
|
-
if (device.revokedAt !== void 0 || !owner && device.id !==
|
|
48
|
+
if (device.revokedAt !== void 0 || !owner && device.id !== sourceId) continue;
|
|
45
49
|
if (device.platform === "desktop" || mobileFolderPlatforms.has(device.platform)) ids.set(device.id, {
|
|
46
50
|
kind: device.platform === "desktop" ? "desktop" : "mobile",
|
|
47
51
|
platform: device.platform,
|
|
@@ -49,7 +53,7 @@ function registerDeviceConnectionRoutes(app, deps) {
|
|
|
49
53
|
});
|
|
50
54
|
}
|
|
51
55
|
for (const principal of listEndpointPrincipals()) {
|
|
52
|
-
if (principal.revokedAt !== void 0 || principal.kind !== "desktop" && principal.kind !== "mobile" || !owner && principal.kind !== "desktop" && principal.id !==
|
|
56
|
+
if (principal.revokedAt !== void 0 || principal.kind !== "desktop" && principal.kind !== "mobile" || !owner && principal.kind !== "desktop" && principal.id !== sourceId) continue;
|
|
53
57
|
if (getDevice(principal.id)?.revokedAt !== void 0) continue;
|
|
54
58
|
ids.set(principal.id, {
|
|
55
59
|
kind: principal.kind,
|
|
@@ -60,13 +64,26 @@ function registerDeviceConnectionRoutes(app, deps) {
|
|
|
60
64
|
const connections = runtime.registry.list().sort((a, b) => b.lastHeartbeatAt - a.lastHeartbeatAt);
|
|
61
65
|
const devices = [...ids].map(([id, metadata]) => {
|
|
62
66
|
const candidates = connections.filter((endpoint) => endpoint.principalId === id && endpoint.kind === metadata.kind);
|
|
63
|
-
const endpoint = metadata.kind === "mobile" ? candidates.find((candidate) => candidate.availability === "foreground" && candidate.tools.length > 0) ?? candidates[0] : candidates.find((candidate) => candidate.tools.some((tool) => tool.descriptor.name === "desktop.folder.search")) ?? candidates[0];
|
|
64
|
-
const folders = metadata.kind !== "desktop" ? [] : (deviceFolderSnapshots.get(id)?.folders ?? []).filter((folder) => owner || folder.mobileIds
|
|
67
|
+
const endpoint = metadata.kind === "mobile" ? candidates.find((candidate) => candidate.availability === "foreground" && candidate.tools.length > 0) ?? candidates[0] : candidates.find((candidate) => candidate.tools.some((tool) => tool.descriptor.name === "desktop.folder.search")) ?? candidates.find((candidate) => !candidate.executionAuthority) ?? candidates[0];
|
|
68
|
+
const folders = metadata.kind !== "desktop" ? [] : (deviceFolderSnapshots.get(id)?.folders ?? []).filter((folder) => owner || folder.access === "gateway" || Boolean(sourceId && folder.mobileIds?.includes(sourceId))).map(({ id, kind, label, access }) => ({
|
|
65
69
|
id,
|
|
66
70
|
kind,
|
|
67
|
-
label
|
|
71
|
+
label,
|
|
72
|
+
...access && { access }
|
|
68
73
|
}));
|
|
69
|
-
const mayExposeEndpoint = owner || id ===
|
|
74
|
+
const mayExposeEndpoint = owner || id === sourceId || folders.length > 0 && endpoint?.tools.some((tool) => tool.descriptor.name === "desktop.folder.search");
|
|
75
|
+
const capabilities = owner || id === sourceId ? endpoint?.tools.flatMap(({ descriptor: { name, requiresForeground } }) => {
|
|
76
|
+
if (!isManagedDeviceCapability(endpoint, name)) return [];
|
|
77
|
+
const [titleZh, title] = deviceCapabilityTitles[name];
|
|
78
|
+
return [{
|
|
79
|
+
name,
|
|
80
|
+
title,
|
|
81
|
+
titleZh,
|
|
82
|
+
requiresForeground,
|
|
83
|
+
allowed: deviceCapabilityAllowed(endpoint, name),
|
|
84
|
+
...name === "desktop.computer.control" && !deps.service.currentConfig.computer.enabled && { needsSetup: true }
|
|
85
|
+
}];
|
|
86
|
+
}) ?? [] : void 0;
|
|
70
87
|
return {
|
|
71
88
|
id,
|
|
72
89
|
...metadata,
|
|
@@ -74,11 +91,12 @@ function registerDeviceConnectionRoutes(app, deps) {
|
|
|
74
91
|
...mayExposeEndpoint && endpoint ? { endpointId: endpoint.endpointId } : {},
|
|
75
92
|
availability: endpoint?.availability ?? "offline",
|
|
76
93
|
tools: mayExposeEndpoint ? endpoint?.tools.map((tool) => tool.descriptor.name) ?? [] : [],
|
|
94
|
+
...capabilities && { capabilities },
|
|
77
95
|
folders
|
|
78
96
|
};
|
|
79
97
|
});
|
|
80
98
|
const payload = {
|
|
81
|
-
...
|
|
99
|
+
...sourceId ? { currentDeviceId: sourceId } : {},
|
|
82
100
|
devices
|
|
83
101
|
};
|
|
84
102
|
return c.json({
|
|
@@ -86,6 +104,33 @@ function registerDeviceConnectionRoutes(app, deps) {
|
|
|
86
104
|
payload
|
|
87
105
|
});
|
|
88
106
|
});
|
|
107
|
+
app.patch(root, bodyLimit({ maxSize: 1024 }), async (c) => {
|
|
108
|
+
c.header("Cache-Control", "no-store");
|
|
109
|
+
const deviceId = pairedFolderClientId(getGatewayPrincipal(c));
|
|
110
|
+
if (!deviceId) return c.json({
|
|
111
|
+
ok: false,
|
|
112
|
+
error: { code: "FORBIDDEN" }
|
|
113
|
+
}, 403);
|
|
114
|
+
const parsed = mobileDeviceCapabilityGrantSchema.safeParse(await c.req.json().catch(() => null));
|
|
115
|
+
if (!parsed.success) return c.json({
|
|
116
|
+
ok: false,
|
|
117
|
+
error: { code: "BAD_REQUEST" }
|
|
118
|
+
}, 400);
|
|
119
|
+
const { toolName, allowed } = parsed.data;
|
|
120
|
+
if (allowed && !runtime.registry.list().some((endpoint) => endpoint.principalId === deviceId && endpoint.kind === "mobile" && runtime.registry.getTool(endpoint.endpointId, toolName))) return c.json({
|
|
121
|
+
ok: false,
|
|
122
|
+
error: { code: "TARGET_UNAVAILABLE" }
|
|
123
|
+
}, 409);
|
|
124
|
+
setMobileCapabilityAllowed(deviceId, toolName, allowed);
|
|
125
|
+
if (!allowed) runtime.invocations.revokeDeviceCapability(deviceId, toolName);
|
|
126
|
+
return c.json({
|
|
127
|
+
ok: true,
|
|
128
|
+
payload: {
|
|
129
|
+
toolName,
|
|
130
|
+
allowed
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
});
|
|
89
134
|
app.post(`${root}/chat`, bodyLimit({ maxSize: 4096 }), async (c) => {
|
|
90
135
|
c.header("Cache-Control", "no-store");
|
|
91
136
|
const actor = getGatewayPrincipal(c);
|
|
@@ -100,7 +145,7 @@ function registerDeviceConnectionRoutes(app, deps) {
|
|
|
100
145
|
error: { code: "BAD_REQUEST" }
|
|
101
146
|
}, 400);
|
|
102
147
|
const { endpointId, toolName } = parsed.data;
|
|
103
|
-
if (
|
|
148
|
+
if (toolName && !owner) return c.json({
|
|
104
149
|
ok: false,
|
|
105
150
|
error: { code: "FORBIDDEN" }
|
|
106
151
|
}, 403);
|
|
@@ -112,14 +157,19 @@ function registerDeviceConnectionRoutes(app, deps) {
|
|
|
112
157
|
if (toolName) {
|
|
113
158
|
const principal = getEndpointPrincipal(endpoint.principalId);
|
|
114
159
|
const device = getDevice(endpoint.principalId);
|
|
115
|
-
if (endpoint
|
|
160
|
+
if (!isManagedDeviceCapability(endpoint, toolName) || principal?.kind !== endpoint.kind || principal.revokedAt !== void 0 || device?.revokedAt !== void 0) return c.json({
|
|
116
161
|
ok: false,
|
|
117
162
|
error: { code: "FORBIDDEN" }
|
|
118
163
|
}, 403);
|
|
119
|
-
|
|
164
|
+
const tool = runtime.registry.getTool(endpointId, toolName);
|
|
165
|
+
if (!tool || tool.descriptor.requiresForeground && endpoint.availability !== "foreground" || toolName === "desktop.computer.control" && !deps.service.currentConfig.computer.enabled) return c.json({
|
|
120
166
|
ok: false,
|
|
121
167
|
error: { code: "TARGET_UNAVAILABLE" }
|
|
122
168
|
}, 409);
|
|
169
|
+
if (!deviceCapabilityAllowed(endpoint, toolName)) return c.json({
|
|
170
|
+
ok: false,
|
|
171
|
+
error: { code: "CAPABILITY_AUTHORIZATION_REQUIRED" }
|
|
172
|
+
}, 403);
|
|
123
173
|
} else if (!deviceFoldersFor(endpoint, actor).length) return c.json({
|
|
124
174
|
ok: false,
|
|
125
175
|
error: { code: "FORBIDDEN" }
|
|
@@ -152,6 +202,47 @@ function registerDeviceConnectionRoutes(app, deps) {
|
|
|
152
202
|
}, 409);
|
|
153
203
|
}
|
|
154
204
|
});
|
|
205
|
+
app.post(`${root}/capabilities`, bodyLimit({ maxSize: 4096 }), async (c) => {
|
|
206
|
+
c.header("Cache-Control", "no-store");
|
|
207
|
+
const actor = getGatewayPrincipal(c);
|
|
208
|
+
if (actor.kind !== "owner" || !actor.scopes.includes("gateway.admin")) return c.json({
|
|
209
|
+
ok: false,
|
|
210
|
+
error: { code: "FORBIDDEN" }
|
|
211
|
+
}, 403);
|
|
212
|
+
const parsed = desktopPublicationSchema.safeParse(await c.req.json().catch(() => null));
|
|
213
|
+
if (!parsed.success) return c.json({
|
|
214
|
+
ok: false,
|
|
215
|
+
error: { code: "BAD_REQUEST" }
|
|
216
|
+
}, 400);
|
|
217
|
+
const { origin, snapshot, signature } = parsed.data;
|
|
218
|
+
const endpoint = runtime.registry.get(origin.endpointId);
|
|
219
|
+
if (endpoint?.kind !== "desktop" || endpoint.executionAuthority || !runtime.registry.verifyTurnClaim(origin.endpointId, origin.token)) return c.json({
|
|
220
|
+
ok: false,
|
|
221
|
+
error: { code: "SOURCE_UNAVAILABLE" }
|
|
222
|
+
}, 409);
|
|
223
|
+
const principal = getEndpointPrincipal(endpoint.principalId);
|
|
224
|
+
if (principal?.kind !== "desktop" || principal.revokedAt !== void 0 || getDevice(principal.id)?.revokedAt !== void 0 || !verify("sha256", Buffer.from(desktopCapabilitySigningPayload(origin, snapshot)), {
|
|
225
|
+
key: parseEndpointPublicKey(principal.publicKey),
|
|
226
|
+
dsaEncoding: "ieee-p1363"
|
|
227
|
+
}, Buffer.from(signature, "base64url"))) return c.json({
|
|
228
|
+
ok: false,
|
|
229
|
+
error: { code: "FORBIDDEN" }
|
|
230
|
+
}, 403);
|
|
231
|
+
if (new Set(snapshot.allowed).size !== snapshot.allowed.length || snapshot.allowed.some((name) => !runtime.registry.getTool(endpoint.endpointId, name))) return c.json({
|
|
232
|
+
ok: false,
|
|
233
|
+
error: { code: "BAD_REQUEST" }
|
|
234
|
+
}, 400);
|
|
235
|
+
const revoked = saveDesktopCapabilitySnapshot(endpoint.principalId, snapshot);
|
|
236
|
+
if (!revoked) return c.json({
|
|
237
|
+
ok: false,
|
|
238
|
+
error: { code: "CAPABILITY_REVISION_CONFLICT" }
|
|
239
|
+
}, 409);
|
|
240
|
+
for (const name of revoked) runtime.invocations.revokeDeviceCapability(endpoint.principalId, name);
|
|
241
|
+
return c.json({
|
|
242
|
+
ok: true,
|
|
243
|
+
payload: { revision: snapshot.revision }
|
|
244
|
+
});
|
|
245
|
+
});
|
|
155
246
|
app.post(`${root}/folders`, bodyLimit({ maxSize: 48e3 }), async (c) => {
|
|
156
247
|
c.header("Cache-Control", "no-store");
|
|
157
248
|
const actor = getGatewayPrincipal(c);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { init_connection, isXopcDatabaseOpen } from "../../../storage/sqlite/connection.js";
|
|
2
|
+
import { getOrCreateGatewayIdentity } from "../../../storage/sqlite/gateway-identity-repository.js";
|
|
1
3
|
import { init_src } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
2
4
|
import { COMPUTER_DESCRIPTOR, COMPUTER_FRAME_MAX_BYTES, init_src as init_src$1 } from "../../../../packages/computer-control-contract/src/index.js";
|
|
3
5
|
import { REALTIME_CAPABILITIES } from "../../../../packages/realtime-protocol/src/index.js";
|
|
@@ -5,6 +7,7 @@ import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
|
5
7
|
//#region src/gateway/hono/routes/endpoint-compatibility.ts
|
|
6
8
|
init_src$1();
|
|
7
9
|
init_src();
|
|
10
|
+
init_connection();
|
|
8
11
|
function registerEndpointCompatibilityRoutes(authenticated) {
|
|
9
12
|
authenticated.get("/api/endpoint-tools/compatibility", (c) => {
|
|
10
13
|
const principal = getGatewayPrincipal(c);
|
|
@@ -21,6 +24,7 @@ function registerEndpointCompatibilityRoutes(authenticated) {
|
|
|
21
24
|
turnDeviceContextV1: true,
|
|
22
25
|
clarificationVersions: process.env.XOPC_CLARIFY_MULTI_QUESTION === "false" ? [1] : [1, 2],
|
|
23
26
|
endpointEnvironmentV1: true,
|
|
27
|
+
...isXopcDatabaseOpen() ? { gatewayId: getOrCreateGatewayIdentity().id } : {},
|
|
24
28
|
locationSharingV1: true,
|
|
25
29
|
mobilePhoneWorkspaceV1: true,
|
|
26
30
|
phoneMediaProtocolVersion: 1,
|
|
@@ -31,6 +35,8 @@ function registerEndpointCompatibilityRoutes(authenticated) {
|
|
|
31
35
|
mobilePersonalToolsV1: true,
|
|
32
36
|
mobileExtendedPersonalToolsV1: true,
|
|
33
37
|
deviceFolderConnectionsV1: true,
|
|
38
|
+
deviceFolderGatewayAccessV1: true,
|
|
39
|
+
desktopCapabilityAccessV1: true,
|
|
34
40
|
...principal.kind === "device" ? { deviceId: principal.deviceId } : {},
|
|
35
41
|
endpointProtocolVersion: 3,
|
|
36
42
|
computerControl: COMPUTER_DESCRIPTOR,
|
|
@@ -146,7 +146,7 @@ const AUTHENTICATED_LAZY_ROUTE_BUNDLES = [
|
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
id: "device-connections",
|
|
149
|
-
match: (path) => /^\/api\/endpoint-tools\/device-connections(?:\/(?:folders|chat))?$/.test(path),
|
|
149
|
+
match: (path) => /^\/api\/endpoint-tools\/device-connections(?:\/(?:folders|chat|capabilities))?$/.test(path),
|
|
150
150
|
load: async () => {
|
|
151
151
|
const { registerDeviceConnectionRoutes } = await import("./device-connections.js");
|
|
152
152
|
return { register: registerDeviceConnectionRoutes };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { onAutomationRunChange } from "../../../automations/run-changes.js";
|
|
1
2
|
import { CapabilityError } from "../../../capabilities/runtime/errors.js";
|
|
2
3
|
import "../../../capabilities/runtime/dispatcher.js";
|
|
3
|
-
import { onAutomationRunChange } from "../../../automations/run-changes.js";
|
|
4
4
|
import { localAppResourceAllowed } from "../../../local-apps/capabilities/resource-policy.js";
|
|
5
5
|
import { localAppCapabilities } from "../../../local-apps/capabilities/runtime.js";
|
|
6
6
|
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
1
2
|
import { isManagedConnectorServer } from "../../../connectors/materialize.js";
|
|
2
3
|
import { resolveMcpSetupConfig } from "../../../agent/mcp/effective-server.js";
|
|
3
4
|
import { loadMergedMcpConfig } from "../../../agent/mcp/config.js";
|
|
4
5
|
import { discoverMcpTools } from "../../../agent/mcp/tool-catalog.js";
|
|
5
|
-
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
6
6
|
import { cancelMcpAuthorization, getMcpAuthorization, probeMcpConnection, startMcpAuthorization, submitMcpRedirect } from "../../../agent/mcp/connection-setup.js";
|
|
7
7
|
import { McpConnectionDrafts, McpDraftError, mcpConfigRevision } from "../../../agent/mcp/connection-drafts.js";
|
|
8
8
|
import { withGatewayConfigWriteLock } from "../lib/config-write-lock.js";
|