@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
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { createEmbeddedModelRuntime, resolveEmbeddedProviderApiKeySync } from "./model-runtime.js";
|
|
4
|
-
import { getNativePiAgentDir } from "../mcp/native-mcp.js";
|
|
5
|
-
import { createAutomationMcpSourceGuard } from "../../automations/mcp-source.js";
|
|
6
3
|
import { transformUserMessageForPersistence } from "../inbound/attachment-pipeline.js";
|
|
7
4
|
import { abortEmbeddedRun } from "./runs.js";
|
|
8
5
|
import { filterExecutionTools, resolveExecutionToolPolicy } from "./execution-tool-policy.js";
|
|
9
6
|
import { deferredToolContract, getXopcToolMetadata } from "./tool-metadata.js";
|
|
10
7
|
import { isCodemodeCoreRead } from "../tools/codemode-permissions.js";
|
|
8
|
+
import { getNativePiAgentDir } from "../mcp/native-mcp.js";
|
|
9
|
+
import { createEmbeddedModelRuntime, resolveEmbeddedProviderApiKeySync } from "./model-runtime.js";
|
|
11
10
|
import { getExternalToolRegistry } from "../external-tools/tool-registry.js";
|
|
11
|
+
import { createAutomationMcpSourceGuard } from "../../automations/mcp-source.js";
|
|
12
12
|
import { guardSessionManager } from "./session-tool-result-guard.js";
|
|
13
13
|
import { wrapStreamFnForXopcExtensions } from "./xopc-stream-bridge.js";
|
|
14
14
|
import { xopcToolsToDefinitions } from "./xopc-tools-bridge.js";
|
|
@@ -5,13 +5,13 @@ import { getConnectorAccount, init_connector_account_repository } from "../../st
|
|
|
5
5
|
import { appendConnectorExecutionAudit, consumeConnectorApproval, createConnectorApproval, getConnectorApproval, getConnectorConnection, getConnectorInstallation, init_connector_repository } from "../../storage/sqlite/connector-repository.js";
|
|
6
6
|
import { connectorObjectiveScope, init_connection_wait_repository, publishConnectionWait, requireSessionConnection } from "../../storage/sqlite/connection-wait-repository.js";
|
|
7
7
|
import "../../storage/sqlite/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import { ExternalEffectNotAppliedError, executeExternalOperation } from "../../capabilities/runtime/external-operations.js";
|
|
10
|
-
import "../../capabilities/runtime/dispatcher.js";
|
|
8
|
+
import { connectorArgumentsHash, connectorArgumentsPreview } from "../../connectors/approval.js";
|
|
11
9
|
import { getCliAdapter } from "../../connectors/cli/adapterRegistry.js";
|
|
12
10
|
import { evaluateConnectorExecutionPolicy } from "../../connectors/policy.js";
|
|
13
11
|
import { connectorPrincipalForSession } from "../../connectors/principal.js";
|
|
14
|
-
import {
|
|
12
|
+
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
13
|
+
import { ExternalEffectNotAppliedError, executeExternalOperation } from "../../capabilities/runtime/external-operations.js";
|
|
14
|
+
import "../../capabilities/runtime/dispatcher.js";
|
|
15
15
|
import { selectConnectorAccount } from "../../connectors/account-selection.js";
|
|
16
16
|
import { cliContextPath } from "../../connectors/cli/process.js";
|
|
17
17
|
import { listConnectorInstances } from "../../connectors/instances.js";
|
|
@@ -5,8 +5,7 @@ import { getConnectorAccount } from "../../storage/sqlite/connector-account-repo
|
|
|
5
5
|
import { consumeConnectorApproval, createConnectorApproval, getConnectorApproval, getConnectorConnection, getConnectorInstallation, listConnectorActionMetadata, listConnectorConnections, listConnectorInstallations, upsertConnectorActionMetadata, upsertConnectorInstallation } from "../../storage/sqlite/connector-repository.js";
|
|
6
6
|
import { bindObjectiveAccount, connectionBinding, connectionBindings, connectorObjectiveScope, init_connection_wait_repository, publishConnectionWait, requireSessionConnection } from "../../storage/sqlite/connection-wait-repository.js";
|
|
7
7
|
import "../../storage/sqlite/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import { ExternalEffectNotAppliedError, executeExternalOperation } from "../../capabilities/runtime/external-operations.js";
|
|
8
|
+
import { connectorArgumentsHash, connectorArgumentsPreview } from "../../connectors/approval.js";
|
|
10
9
|
import { canAccessConnectorAccount, currentAccountConnections } from "../../connectors/account-access.js";
|
|
11
10
|
import { connectorIdentitySummary } from "../../connectors/connector-identity.js";
|
|
12
11
|
import { evaluateConnectorExecutionPolicy } from "../../connectors/policy.js";
|
|
@@ -14,7 +13,8 @@ import { ComposioSessionsAdapter } from "../../connectors/composio-sessions.js";
|
|
|
14
13
|
import { getComposioToolkitScope, getConfiguredComposioAuthConfigs, isComposioActionAllowedByCatalog, scopeForComposioAction } from "../../connectors/composio.js";
|
|
15
14
|
import { getConnectorDefinition } from "../../connectors/catalog.js";
|
|
16
15
|
import { connectorPrincipalForSession } from "../../connectors/principal.js";
|
|
17
|
-
import {
|
|
16
|
+
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
17
|
+
import { ExternalEffectNotAppliedError, executeExternalOperation } from "../../capabilities/runtime/external-operations.js";
|
|
18
18
|
import { listConnectorInstances } from "../../connectors/instances.js";
|
|
19
19
|
import { externalToolRef, parseExternalToolRef } from "./refs.js";
|
|
20
20
|
import { isToolInputSchema } from "../../connectors/connection-capabilities.js";
|
|
@@ -5,14 +5,13 @@ import { currentDeviceExecutionActor } from "../../endpoint-tools/execution-acto
|
|
|
5
5
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
6
6
|
import { init_session_repository } from "../../storage/sqlite/session-repository.js";
|
|
7
7
|
import { getDeviceInteractionForRun } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
8
|
-
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
9
|
-
import { ExternalEffectNotAppliedError, executeExternalOperation } from "../../capabilities/runtime/external-operations.js";
|
|
10
|
-
import { canonicalCapabilityJson } from "../../capabilities/runtime/dispatcher.js";
|
|
11
8
|
import { init_src as init_src$1 } from "../../../packages/computer-control-contract/src/index.js";
|
|
12
|
-
import { deviceDelegationAllowsArguments, resolveDeviceDelegation } from "../../endpoint-tools/delegation.js";
|
|
13
|
-
import "../../../packages/browser-control-contract/src/index.js";
|
|
14
9
|
import { prepareImageForModel } from "../image/prepare-image-for-model.js";
|
|
15
10
|
import { getEmbeddedExecutionRunId } from "../embedded/execution-context.js";
|
|
11
|
+
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
12
|
+
import "../../../packages/browser-control-contract/src/index.js";
|
|
13
|
+
import { ExternalEffectNotAppliedError, executeExternalOperation } from "../../capabilities/runtime/external-operations.js";
|
|
14
|
+
import { canonicalCapabilityJson } from "../../capabilities/runtime/dispatcher.js";
|
|
16
15
|
import { externalToolRef, parseExternalToolRef } from "./refs.js";
|
|
17
16
|
import "../../../packages/browser-control-contract/src/remote.js";
|
|
18
17
|
import { extractDocumentText } from "../../document-understanding/extract.js";
|
|
@@ -20,7 +19,9 @@ import { processLocationTask } from "../../endpoint-tools/location-task.js";
|
|
|
20
19
|
import { projectDeviceReading } from "../../endpoint-tools/result-projector.js";
|
|
21
20
|
import { getEndpointDeviceSettings } from "../../storage/sqlite/endpoint-device-settings-repository.js";
|
|
22
21
|
import { deviceFoldersFor, permitsFolderInvocation } from "../../endpoint-tools/folder-connections.js";
|
|
22
|
+
import { deviceCapabilityAllowed, isManagedDeviceCapability } from "../../endpoint-tools/device-capability-grants.js";
|
|
23
23
|
import { DeviceTargetResolver } from "../../endpoint-tools/target-resolver.js";
|
|
24
|
+
import { deviceDelegationAllowsArguments, resolveDeviceDelegation } from "../../endpoint-tools/delegation.js";
|
|
24
25
|
import { EndpointToolExecutionError } from "../../endpoint-tools/invocation-service.js";
|
|
25
26
|
import { createHash } from "node:crypto";
|
|
26
27
|
//#region src/agent/external-tools/endpoint-provider.ts
|
|
@@ -58,7 +59,7 @@ var EndpointToolProvider = class {
|
|
|
58
59
|
}
|
|
59
60
|
const resolver = this.targetResolver(true);
|
|
60
61
|
const checkpoint = getDeviceInteractionForRun(context.conversationId, getEmbeddedExecutionRunId());
|
|
61
|
-
const
|
|
62
|
+
const selectedCapability = this.deps.runtime.targets.get(context.conversationId)?.capabilityTool;
|
|
62
63
|
return resolver.candidates(context.conversationId, context.origin).flatMap((endpoint) => endpoint.tools.filter(({ descriptor, provider }) => ![
|
|
63
64
|
"browser.control",
|
|
64
65
|
"desktop.browser.control",
|
|
@@ -69,7 +70,7 @@ var EndpointToolProvider = class {
|
|
|
69
70
|
source: this.source,
|
|
70
71
|
namespace: endpoint.endpointId,
|
|
71
72
|
title: descriptor.title,
|
|
72
|
-
summary: `${
|
|
73
|
+
summary: `${selectedCapability ? descriptor.title : descriptor.description} (${getEndpointDeviceSettings(endpoint.principalId)?.nickname ?? endpoint.displayName})`
|
|
73
74
|
})));
|
|
74
75
|
}
|
|
75
76
|
async describe(toolRef) {
|
|
@@ -102,7 +103,7 @@ var EndpointToolProvider = class {
|
|
|
102
103
|
kind,
|
|
103
104
|
label
|
|
104
105
|
}));
|
|
105
|
-
const toolDescription = resolved.
|
|
106
|
+
const toolDescription = resolved.selectedCapability?.startsWith("mobile.") ? resolved.tool.descriptor.description.replace(/Uses the (?:foreground )?device that sent this message\b/u, "Runs on the phone selected for this chat") : resolved.tool.descriptor.description;
|
|
106
107
|
return {
|
|
107
108
|
toolRef,
|
|
108
109
|
source: this.source,
|
|
@@ -159,7 +160,8 @@ var EndpointToolProvider = class {
|
|
|
159
160
|
let grantLease;
|
|
160
161
|
const invoke = (operationId) => {
|
|
161
162
|
if (context.signal?.aborted) throw new ExternalEffectNotAppliedError("Device invocation cancelled before dispatch");
|
|
162
|
-
|
|
163
|
+
const active = this.resolve(toolRef);
|
|
164
|
+
if (!active || active.contractRevision !== revision) throw new ExternalEffectNotAppliedError("Endpoint connection, binding or tool contract changed");
|
|
163
165
|
assertFolderAccess();
|
|
164
166
|
const turn = this.deps.getCurrentContext();
|
|
165
167
|
const actor = currentDeviceExecutionActor(turn.conversationId, getEmbeddedExecutionRunId());
|
|
@@ -169,7 +171,7 @@ var EndpointToolProvider = class {
|
|
|
169
171
|
transcriptId,
|
|
170
172
|
actorPrincipalId: actor.principalId
|
|
171
173
|
} : void 0;
|
|
172
|
-
const grant =
|
|
174
|
+
const grant = active.singleCallGrant;
|
|
173
175
|
const recoveryRunId = invocationScope && !grant && actor?.kind === "owner" && actor.scopes.includes("gateway.admin") && resolved.tool.provider?.gatewayFormInput ? getEmbeddedExecutionRunId() ?? getSessionInputState(turn.conversationId).activeRunId : void 0;
|
|
174
176
|
if (grant) grantLease = this.deps.runtime.grants.reserve(grant.id, args);
|
|
175
177
|
const signal = grantLease ? AbortSignal.any([grantLease.signal, context.signal ?? new AbortController().signal]) : context.signal;
|
|
@@ -179,6 +181,7 @@ var EndpointToolProvider = class {
|
|
|
179
181
|
toolName: resolved.tool.descriptor.name,
|
|
180
182
|
arguments: args,
|
|
181
183
|
descriptorRevision: resolved.tool.revision,
|
|
184
|
+
...active.gatewayCapability && { gatewayCapability: true },
|
|
182
185
|
...invocationScope ? { invocationScope } : {},
|
|
183
186
|
...invocationScope && recoveryRunId ? { interactionOrigin: {
|
|
184
187
|
...invocationScope,
|
|
@@ -369,6 +372,7 @@ var EndpointToolProvider = class {
|
|
|
369
372
|
return new DeviceTargetResolver(this.deps.runtime.registry, this.deps.runtime.targets, this.deps.runtime.grants, conversationId ? currentDeviceExecutionActor(conversationId, getEmbeddedExecutionRunId()) : void 0, snapshot);
|
|
370
373
|
}
|
|
371
374
|
delegation(conversationId) {
|
|
375
|
+
if (this.deps.runtime.targets.get(conversationId)?.capabilityTool) return void 0;
|
|
372
376
|
return resolveDeviceDelegation(conversationId, getEmbeddedExecutionRunId(), this.deps.runtime.registry);
|
|
373
377
|
}
|
|
374
378
|
resolve(toolRef, resolver = this.targetResolver(), checkpointSnapshot) {
|
|
@@ -376,11 +380,16 @@ var EndpointToolProvider = class {
|
|
|
376
380
|
if (!parsed) return void 0;
|
|
377
381
|
const context = this.deps.getCurrentContext();
|
|
378
382
|
if (!context) return void 0;
|
|
383
|
+
const target = this.deps.runtime.targets.get(context.conversationId);
|
|
379
384
|
const delegated = this.delegation(context.conversationId);
|
|
380
385
|
if (delegated && (isDeviceFolderTool(parsed.toolName) || delegated.grant?.toolName !== parsed.toolName || delegated.endpoint?.endpointId !== parsed.namespace)) return void 0;
|
|
381
386
|
const endpoint = delegated ? delegated.endpoint : resolver.resolve(context.conversationId, context.origin, parsed.namespace, parsed.toolName);
|
|
382
387
|
if (!endpoint || endpoint.endpointId !== parsed.namespace) return void 0;
|
|
383
388
|
const tool = this.deps.runtime.registry.getTool(endpoint.endpointId, parsed.toolName);
|
|
389
|
+
const singleCallGrant = target?.capabilityTool ? void 0 : this.deps.runtime.grants?.find(context.conversationId, context.origin, endpoint.endpointId, parsed.toolName);
|
|
390
|
+
const source = context.origin.type === "endpoint" ? this.deps.runtime.registry.get(context.origin.endpointId) : void 0;
|
|
391
|
+
const gatewayCapability = isManagedDeviceCapability(endpoint, parsed.toolName) && (Boolean(target?.capabilityTool) || source?.principalId !== endpoint.principalId) && !(endpoint.kind === "mobile" && (singleCallGrant || delegated?.grant));
|
|
392
|
+
if (gatewayCapability && !deviceCapabilityAllowed(endpoint, parsed.toolName)) return void 0;
|
|
384
393
|
if (tool?.provider && !this.deps.runtime.providers.isReady(tool.provider)) return void 0;
|
|
385
394
|
const checkpoint = checkpointSnapshot === void 0 ? getDeviceInteractionForRun(context.conversationId, getEmbeddedExecutionRunId()) : checkpointSnapshot;
|
|
386
395
|
if (checkpoint && (parsed.toolName !== checkpoint.toolName || endpoint.endpointId !== checkpoint.endpointId || !this.deps.runtime.canResumeDeviceInteraction(context.conversationId, checkpoint))) return void 0;
|
|
@@ -392,12 +401,13 @@ var EndpointToolProvider = class {
|
|
|
392
401
|
].includes(tool.descriptor.name)) return void 0;
|
|
393
402
|
const folders = isDeviceFolderTool(parsed.toolName) ? deviceFoldersFor(endpoint, currentDeviceExecutionActor(context.conversationId, getEmbeddedExecutionRunId()), context.origin, this.deps.runtime.registry) : void 0;
|
|
394
403
|
if (folders && !folders.length) return void 0;
|
|
395
|
-
const target = this.deps.runtime.targets.get(context.conversationId);
|
|
396
404
|
return tool ? {
|
|
397
405
|
folders,
|
|
398
|
-
|
|
406
|
+
selectedCapability: target?.capabilityTool,
|
|
407
|
+
gatewayCapability,
|
|
399
408
|
delegation: delegated?.grant,
|
|
400
|
-
|
|
409
|
+
singleCallGrant,
|
|
410
|
+
approvedArguments: singleCallGrant?.arguments,
|
|
401
411
|
connectionId: endpoint.connectionId,
|
|
402
412
|
endpointId: endpoint.endpointId,
|
|
403
413
|
principalId: endpoint.principalId,
|
|
@@ -410,7 +420,7 @@ var EndpointToolProvider = class {
|
|
|
410
420
|
tool.provider?.digest ?? null,
|
|
411
421
|
folders?.map((folder) => folder.id) ?? null,
|
|
412
422
|
target?.selectedAt ?? null,
|
|
413
|
-
delegated?.grant?.id ??
|
|
423
|
+
delegated?.grant?.id ?? singleCallGrant?.id ?? null
|
|
414
424
|
])).digest("hex")
|
|
415
425
|
} : void 0;
|
|
416
426
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
2
2
|
import { getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "../../config/schema.js";
|
|
3
|
-
import { getDefaultModelSync, getModelsByProvider, init_providers, isProviderConfiguredSync, resolveModel } from "../../providers/index.js";
|
|
4
3
|
import { resolveEffectiveAgentConfigForAgent } from "../../config/agent-profile.js";
|
|
4
|
+
import { getDefaultModelSync, getModelsByProvider, init_providers, isProviderConfiguredSync, resolveModel } from "../../providers/index.js";
|
|
5
5
|
import { resolveAgentModelFallbackValues, resolveAgentModelPrimaryValue } from "../../config/model-input.js";
|
|
6
6
|
import { buildCapabilityPlansForConfig } from "../../capabilities/readiness/from-config.js";
|
|
7
7
|
import "../../capabilities/readiness/index.js";
|
|
@@ -3,9 +3,9 @@ import { SPACE_WORKBOOK_SELECTION_MAX_BYTES, SPACE_WORKBOOK_SELECTION_MIME } fro
|
|
|
3
3
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
4
4
|
import { mimeTypeFromMediaPath } from "../../media/store.js";
|
|
5
5
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
6
|
+
import { extractProfileAgentId } from "../../config/agent-profile.js";
|
|
6
7
|
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
7
8
|
import { readMediaReference } from "../../media/media-reference.js";
|
|
8
|
-
import { extractProfileAgentId } from "../../config/agent-profile.js";
|
|
9
9
|
import { isImageInboundAttachment } from "../../channels/attachments/attachment-classifiers.js";
|
|
10
10
|
import "../../channels/attachments/inbound-persist.js";
|
|
11
11
|
import { expandAtFileMentionsInPlainText } from "../context/expand-at-file-mentions.js";
|
|
@@ -26,7 +26,9 @@ export declare class McpConnectionDrafts {
|
|
|
26
26
|
conflict?: boolean;
|
|
27
27
|
}>;
|
|
28
28
|
});
|
|
29
|
-
create(owner: string, input: McpDraftInput,
|
|
29
|
+
create(owner: string, input: McpDraftInput, options?: {
|
|
30
|
+
protectCredentials?: boolean;
|
|
31
|
+
}): Promise<{
|
|
30
32
|
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
31
33
|
serverId: string;
|
|
32
34
|
expiresAt: number;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { McpServerSchema, init_schema } from "../../config/schema.js";
|
|
2
2
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
3
|
+
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
3
4
|
import { createConnectorSecretReference } from "../../connectors/secret-store.js";
|
|
4
5
|
import { isManagedConnectorServer } from "../../connectors/materialize.js";
|
|
5
6
|
import { createNativeMcpCredentials } from "./credential-store.js";
|
|
6
7
|
import { loadMergedMcpConfig } from "./config.js";
|
|
7
8
|
import { discoverMcpTools } from "./tool-catalog.js";
|
|
8
|
-
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
9
9
|
import { cancelMcpAuthorization, getMcpAuthorization, probeMcpConnection, startMcpAuthorization, submitMcpRedirect } from "./connection-setup.js";
|
|
10
10
|
import { createHash, randomUUID } from "node:crypto";
|
|
11
11
|
//#region src/agent/mcp/connection-drafts.ts
|
|
@@ -33,7 +33,7 @@ var McpConnectionDrafts = class {
|
|
|
33
33
|
constructor(options) {
|
|
34
34
|
this.options = options;
|
|
35
35
|
}
|
|
36
|
-
async create(owner, input,
|
|
36
|
+
async create(owner, input, options) {
|
|
37
37
|
const current = this.options.readConfig();
|
|
38
38
|
if (!/^[a-zA-Z0-9_-]+$/.test(input.serverId) || input.sourceServerId && input.sourceServerId !== input.serverId) throw new McpDraftError(400, "Invalid or changed MCP server ID.");
|
|
39
39
|
const source = Object.hasOwn(current.mcp?.servers ?? {}, input.serverId) ? current.mcp?.servers?.[input.serverId] : void 0;
|
|
@@ -54,8 +54,7 @@ var McpConnectionDrafts = class {
|
|
|
54
54
|
const config = structuredClone(current);
|
|
55
55
|
config.mcp = { servers: { [input.serverId]: {
|
|
56
56
|
...server,
|
|
57
|
-
enabled: true
|
|
58
|
-
...bearerToken ? { headers: { Authorization: `Bearer ${bearerToken}` } } : {}
|
|
57
|
+
enabled: true
|
|
59
58
|
} } };
|
|
60
59
|
const credentials = await createNativeMcpCredentials(true);
|
|
61
60
|
if (this.drafts.size >= 100 || [...this.drafts.values()].filter((draft) => draft.owner === owner).length >= 8) throw new McpDraftError(429, "Too many unsaved MCP connection tests.");
|
|
@@ -75,7 +74,7 @@ var McpConnectionDrafts = class {
|
|
|
75
74
|
server,
|
|
76
75
|
config,
|
|
77
76
|
credentials,
|
|
78
|
-
|
|
77
|
+
protectCredentials: options?.protectCredentials === true,
|
|
79
78
|
controller: new AbortController(),
|
|
80
79
|
timer,
|
|
81
80
|
expiresAt: Date.now() + TTL_MS,
|
|
@@ -189,16 +188,30 @@ var McpConnectionDrafts = class {
|
|
|
189
188
|
draft.committing = true;
|
|
190
189
|
let alias;
|
|
191
190
|
let durable;
|
|
192
|
-
|
|
191
|
+
const protectedProviders = [];
|
|
192
|
+
const resolver = draft.protectCredentials ? new CredentialResolver() : void 0;
|
|
193
193
|
let published = false;
|
|
194
194
|
try {
|
|
195
195
|
const server = structuredClone(draft.server);
|
|
196
196
|
if (enable) server.enabled = true;
|
|
197
|
-
if (
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
197
|
+
if (resolver) {
|
|
198
|
+
const protect = async (field, value, prefix) => {
|
|
199
|
+
const reference = createConnectorSecretReference(`mcp-draft-${id}`, field, { prefix });
|
|
200
|
+
const provider = reference.xopcSecretRef.provider;
|
|
201
|
+
protectedProviders.push(provider);
|
|
202
|
+
await resolver.saveApiKey(provider, value.slice(prefix?.length ?? 0));
|
|
203
|
+
return reference;
|
|
204
|
+
};
|
|
205
|
+
for (const [index, [name, value]] of Object.entries(server.headers ?? {}).entries()) {
|
|
206
|
+
if (typeof value !== "string") continue;
|
|
207
|
+
const prefix = name.toLowerCase() === "authorization" ? /^Bearer /i.exec(value)?.[0] : void 0;
|
|
208
|
+
server.headers[name] = await protect(`header-${index}`, value, prefix);
|
|
209
|
+
}
|
|
210
|
+
for (const [index, [name, value]] of Object.entries(server.env ?? {}).entries()) {
|
|
211
|
+
if (typeof value !== "string" || value === "") continue;
|
|
212
|
+
server.env[name] = await protect(`env-${index}`, value);
|
|
213
|
+
}
|
|
214
|
+
if (typeof server.oauth?.clientSecret === "string") server.oauth.clientSecret = await protect("oauth-client-secret", server.oauth.clientSecret);
|
|
202
215
|
}
|
|
203
216
|
if (typeof server.url === "string") {
|
|
204
217
|
const state = await draft.credentials.forServer(draft.serverId, server.url).load();
|
|
@@ -252,7 +265,7 @@ var McpConnectionDrafts = class {
|
|
|
252
265
|
draft.committing = false;
|
|
253
266
|
if (alias && this.options.readConfig().mcp?.servers?.[draft.serverId]?.xopcOAuthCredentialId === alias) published = true;
|
|
254
267
|
if (!published && alias && durable && typeof draft.server.url === "string") durable.remove(alias, draft.server.url);
|
|
255
|
-
if (!published &&
|
|
268
|
+
if (!published && resolver) await Promise.allSettled(protectedProviders.map((provider) => resolver.deleteProfile(`${provider}:default`)));
|
|
256
269
|
if (this.drafts.has(id) && draft.expiresAt <= Date.now()) this.dispose(draft);
|
|
257
270
|
}
|
|
258
271
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { checkUrlSafety } from "../tools/url-safety.js";
|
|
4
3
|
import { isManagedConnectorServer } from "../../connectors/materialize.js";
|
|
5
4
|
import { resolveMcpSetupConfig } from "./effective-server.js";
|
|
5
|
+
import { classifyMcpConnectionError } from "./connection-errors.js";
|
|
6
6
|
import { prepareNativeMcpConfig } from "./native-mcp.js";
|
|
7
7
|
import { McpAuthenticationRequiredError, discoverMcpTools, signInNativeMcp } from "./tool-catalog.js";
|
|
8
|
-
import {
|
|
8
|
+
import { isPrivateMcpIp, isPrivateMcpTarget, isPublicMcpIp, isPublicMcpTarget } from "./network-policy.js";
|
|
9
9
|
import { createHash, randomUUID } from "node:crypto";
|
|
10
|
-
import { Agent } from "undici";
|
|
11
10
|
import { lookup } from "node:dns";
|
|
11
|
+
import { Agent } from "undici";
|
|
12
12
|
//#region src/agent/mcp/connection-setup.ts
|
|
13
13
|
init_logger();
|
|
14
14
|
const log = createLogger("McpConnectionSetup");
|
|
@@ -17,9 +17,10 @@ function httpUrl(value) {
|
|
|
17
17
|
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password) throw new Error("Use an HTTP or HTTPS MCP address without embedded credentials.");
|
|
18
18
|
return url;
|
|
19
19
|
}
|
|
20
|
-
async function metadata(url, endpoint, signal, publicOnly = false) {
|
|
21
|
-
const
|
|
22
|
-
|
|
20
|
+
async function metadata(url, endpoint, signal, publicOnly = false, privateNetwork = false) {
|
|
21
|
+
const local = endpoint.origin === url.origin && !publicOnly;
|
|
22
|
+
const privateOrigin = local && privateNetwork;
|
|
23
|
+
if (privateOrigin ? !isPrivateMcpTarget(url) : !local && !isPublicMcpTarget(url)) return { state: "invalid" };
|
|
23
24
|
const { retryAfter } = await import("./transport.js");
|
|
24
25
|
signal?.throwIfAborted();
|
|
25
26
|
const dispatcher = new Agent({ connect: { lookup(host, options, callback) {
|
|
@@ -28,8 +29,9 @@ async function metadata(url, endpoint, signal, publicOnly = false) {
|
|
|
28
29
|
callback(error, "", 4);
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
const allowed = privateOrigin ? isPrivateMcpIp : isPublicMcpIp;
|
|
33
|
+
if ((!local || privateOrigin) && addresses.some((address) => !allowed(address.address))) {
|
|
34
|
+
callback(/* @__PURE__ */ new Error("Authorization metadata resolved outside its approved network"), "", 4);
|
|
33
35
|
return;
|
|
34
36
|
}
|
|
35
37
|
if (options.all) callback(null, addresses);
|
|
@@ -90,15 +92,16 @@ async function authentication(config, workspace, serverId, failure, options) {
|
|
|
90
92
|
options?.signal?.throwIfAborted();
|
|
91
93
|
const url = httpUrl(entry.config.url);
|
|
92
94
|
const publicOnly = config.mcp?.servers?.[serverId]?.xopcPublicOnly === true;
|
|
95
|
+
const privateNetwork = config.mcp?.servers?.[serverId]?.xopcPrivateNetwork === true;
|
|
93
96
|
const allowedIssuer = (value) => {
|
|
94
97
|
try {
|
|
95
98
|
if (typeof value !== "string") return false;
|
|
96
99
|
const issuer = httpUrl(value);
|
|
97
|
-
return !issuer.hash && (issuer.protocol === "https:" &&
|
|
100
|
+
return !issuer.hash && (issuer.protocol === "https:" && isPublicMcpTarget(issuer) || !publicOnly && issuer.origin === url.origin && (privateNetwork ? issuer.protocol === "https:" && isPrivateMcpTarget(issuer) : [
|
|
98
101
|
"localhost",
|
|
99
102
|
"127.0.0.1",
|
|
100
103
|
"[::1]"
|
|
101
|
-
].includes(issuer.hostname));
|
|
104
|
+
].includes(issuer.hostname)));
|
|
102
105
|
} catch {
|
|
103
106
|
return false;
|
|
104
107
|
}
|
|
@@ -119,11 +122,11 @@ async function authentication(config, workspace, serverId, failure, options) {
|
|
|
119
122
|
method: "GET",
|
|
120
123
|
stage: "authorization_metadata"
|
|
121
124
|
});
|
|
122
|
-
return metadata(target, url, options?.signal, publicOnly);
|
|
125
|
+
return metadata(target, url, options?.signal, publicOnly, privateNetwork);
|
|
123
126
|
};
|
|
124
127
|
let issuer;
|
|
125
128
|
for (const candidate of new Map(candidates.map((c) => [c.href, c])).values()) {
|
|
126
|
-
if (!allowedIssuer(candidate.href)) {
|
|
129
|
+
if (!(privateNetwork && candidate.origin === url.origin && !candidate.username && !candidate.password && !candidate.hash && isPrivateMcpTarget(candidate)) && !allowedIssuer(candidate.href)) {
|
|
127
130
|
state = "invalid";
|
|
128
131
|
continue;
|
|
129
132
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { AgentPluginStore } from "../../extensions/agent-plugins/store.js";
|
|
1
2
|
import { isExcludedStoreConnector, preferredStorePlugin } from "../../connectors/excluded-connectors.js";
|
|
2
3
|
import { getConnectorDefinition, listConnectorCatalog } from "../../connectors/catalog.js";
|
|
3
4
|
import { connectionCandidates } from "../../connectors/connection-candidates.js";
|
|
4
|
-
import { AgentPluginStore } from "../../extensions/agent-plugins/store.js";
|
|
5
5
|
import { listIntegrationPackages, resolveExtensionsStoreBaseUrl, resolveSkillsStoreBaseUrl } from "../skills/marketplace/adapters/store/store-api-client.js";
|
|
6
6
|
import { listConnectorInstances } from "../../connectors/instances.js";
|
|
7
7
|
import { storeConnectorCandidateRef } from "../../capabilities/store-connector.js";
|
|
@@ -69,6 +69,7 @@ async function prepareNativeMcpConfig(config, workspaceDir, agentId) {
|
|
|
69
69
|
"toolExposure",
|
|
70
70
|
"description",
|
|
71
71
|
"xopcPublicOnly",
|
|
72
|
+
"xopcPrivateNetwork",
|
|
72
73
|
"xopcManagedStdio"
|
|
73
74
|
].filter((key) => value[key] !== void 0).map((key) => [key, value[key]]));
|
|
74
75
|
if (typeof value.displayName === "string" && value.displayName.trim()) projected.description = `Service: ${value.displayName.trim()}. ${typeof value.description === "string" ? value.description : ""}`.trim();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function mcpHostname(hostname: string): string;
|
|
2
|
+
export declare function isPrivateMcpIp(value: string): boolean;
|
|
3
|
+
export declare function suggestsPrivateMcpHostname(value: string): boolean;
|
|
4
|
+
export declare function isPrivateMcpTarget(url: URL): boolean;
|
|
5
|
+
export declare function isPublicMcpTarget(url: URL): boolean;
|
|
6
|
+
export declare function isPublicMcpIp(address: string): boolean;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { checkUrlSafety } from "../tools/url-safety.js";
|
|
2
|
+
import { BlockList, isIP } from "node:net";
|
|
3
|
+
//#region src/agent/mcp/network-policy.ts
|
|
4
|
+
const privateIps = new BlockList();
|
|
5
|
+
for (const [prefix, bits] of [
|
|
6
|
+
["10.0.0.0", 8],
|
|
7
|
+
["127.0.0.0", 8],
|
|
8
|
+
["172.16.0.0", 12],
|
|
9
|
+
["192.168.0.0", 16],
|
|
10
|
+
["100.64.0.0", 10]
|
|
11
|
+
]) privateIps.addSubnet(prefix, bits);
|
|
12
|
+
privateIps.addAddress("::1", "ipv6");
|
|
13
|
+
privateIps.addSubnet("fc00::", 7, "ipv6");
|
|
14
|
+
const blockedIpv6 = new BlockList();
|
|
15
|
+
blockedIpv6.addSubnet("::ffff:0:0", 96, "ipv6");
|
|
16
|
+
blockedIpv6.addAddress("::", "ipv6");
|
|
17
|
+
blockedIpv6.addSubnet("fe80::", 10, "ipv6");
|
|
18
|
+
blockedIpv6.addSubnet("ff00::", 8, "ipv6");
|
|
19
|
+
function mcpHostname(hostname) {
|
|
20
|
+
return hostname.toLowerCase().replace(/^\[|\]$/g, "").replace(/\.$/, "");
|
|
21
|
+
}
|
|
22
|
+
function isPrivateMcpIp(value) {
|
|
23
|
+
const host = mcpHostname(value);
|
|
24
|
+
const family = isIP(host);
|
|
25
|
+
const type = family === 6 ? "ipv6" : "ipv4";
|
|
26
|
+
return family !== 0 && host !== "100.100.100.200" && (family !== 6 || !blockedIpv6.check(host, "ipv6")) && privateIps.check(host, type);
|
|
27
|
+
}
|
|
28
|
+
function suggestsPrivateMcpHostname(value) {
|
|
29
|
+
const host = mcpHostname(value);
|
|
30
|
+
return isPrivateMcpIp(host) || isIP(host) === 0 && (!host.includes(".") || /\.(?:localhost|local|lan|internal|home\.arpa)$/.test(host));
|
|
31
|
+
}
|
|
32
|
+
function isPrivateMcpTarget(url) {
|
|
33
|
+
const host = mcpHostname(url.hostname);
|
|
34
|
+
if (host === "metadata.google.internal" || host === "metadata.goog") return false;
|
|
35
|
+
return isIP(host) ? isPrivateMcpIp(host) : Boolean(host);
|
|
36
|
+
}
|
|
37
|
+
function isPublicMcpTarget(url) {
|
|
38
|
+
const host = mcpHostname(url.hostname);
|
|
39
|
+
const family = isIP(host);
|
|
40
|
+
if (suggestsPrivateMcpHostname(host) || family === 6 && blockedIpv6.check(host, "ipv6")) return false;
|
|
41
|
+
const normalized = new URL(url);
|
|
42
|
+
if (host !== url.hostname && isIP(host) !== 6) normalized.hostname = host;
|
|
43
|
+
return checkUrlSafety(normalized.href).safe;
|
|
44
|
+
}
|
|
45
|
+
function isPublicMcpIp(address) {
|
|
46
|
+
return isPublicMcpTarget(new URL(`http://${isIP(address) === 6 ? `[${address}]` : address}`));
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { isPrivateMcpIp, isPrivateMcpTarget, isPublicMcpIp, isPublicMcpTarget, mcpHostname, suggestsPrivateMcpHostname };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveMcpSetupConfig } from "./effective-server.js";
|
|
2
|
-
import { createEmbeddedModelRuntime } from "../embedded/model-runtime.js";
|
|
3
2
|
import { getNativePiAgentDir, prepareNativeMcpConfig } from "./native-mcp.js";
|
|
3
|
+
import { createEmbeddedModelRuntime } from "../embedded/model-runtime.js";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { InMemoryCredentialStore, InMemoryModelsStore } from "@earendil-works/pi-ai";
|
|
6
6
|
//#region src/agent/mcp/tool-catalog.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isPrivateMcpIp, isPrivateMcpTarget, isPublicMcpIp, isPublicMcpTarget, mcpHostname } from "./network-policy.js";
|
|
2
2
|
import { mcpStdioSupervisor } from "../../process/mcp-stdio-supervisor.js";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
|
-
import { Agent, fetch } from "undici";
|
|
5
4
|
import { lookup } from "node:dns";
|
|
5
|
+
import { Agent, fetch } from "undici";
|
|
6
6
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
7
7
|
import { StdioTransport, StreamableHttpTransport } from "@earendil-works/pi-mcp";
|
|
8
8
|
//#region src/agent/mcp/transport.ts
|
|
@@ -73,14 +73,18 @@ function createXopcMcpTransport(diagnostics = {}, assertPluginCallAccess) {
|
|
|
73
73
|
}
|
|
74
74
|
const url = new URL(String(config.url));
|
|
75
75
|
const headers = config.headers;
|
|
76
|
-
const
|
|
76
|
+
const privateNetwork = config.xopcPrivateNetwork === true;
|
|
77
|
+
const publicOnly = config.xopcPublicOnly === true;
|
|
78
|
+
const makeDispatcher = (policy) => new Agent({ connect: { lookup(host, options, callback) {
|
|
77
79
|
lookup(host, { all: true }, (error, addresses) => {
|
|
78
80
|
if (error) {
|
|
79
81
|
callback(error, "", 4);
|
|
80
82
|
return;
|
|
81
83
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
const local = policy === "legacy" && mcpHostname(host) === mcpHostname(url.hostname);
|
|
85
|
+
const allowed = policy === "private" ? isPrivateMcpIp : isPublicMcpIp;
|
|
86
|
+
if (!local && addresses.some((address) => !allowed(address.address))) {
|
|
87
|
+
callback(/* @__PURE__ */ new Error("MCP destination resolved outside its approved network"), "", 4);
|
|
84
88
|
return;
|
|
85
89
|
}
|
|
86
90
|
if (options.all) callback(null, addresses);
|
|
@@ -88,6 +92,8 @@ function createXopcMcpTransport(diagnostics = {}, assertPluginCallAccess) {
|
|
|
88
92
|
else callback(/* @__PURE__ */ new Error("MCP destination has no address"), "", 4);
|
|
89
93
|
});
|
|
90
94
|
} } });
|
|
95
|
+
const dispatcher = makeDispatcher(privateNetwork ? "private" : publicOnly ? "public" : "legacy");
|
|
96
|
+
const externalDispatcher = privateNetwork ? makeDispatcher("public") : void 0;
|
|
91
97
|
const fetcher = async (input, init) => {
|
|
92
98
|
const method = init?.method ?? "GET";
|
|
93
99
|
let stage = method === "GET" ? "stream" : "request";
|
|
@@ -99,11 +105,12 @@ function createXopcMcpTransport(diagnostics = {}, assertPluginCallAccess) {
|
|
|
99
105
|
stage
|
|
100
106
|
});
|
|
101
107
|
const target = new URL(input);
|
|
102
|
-
|
|
108
|
+
const sameOrigin = target.origin === url.origin;
|
|
109
|
+
if (!(privateNetwork && sameOrigin ? isPrivateMcpTarget(target) : !sameOrigin || publicOnly ? isPublicMcpTarget(target) && (!privateNetwork || target.protocol === "https:") : true)) throw new Error("MCP network policy refused this destination");
|
|
103
110
|
const response = await fetch(input, {
|
|
104
111
|
...init,
|
|
105
112
|
redirect: "error",
|
|
106
|
-
dispatcher
|
|
113
|
+
dispatcher: sameOrigin ? dispatcher : externalDispatcher ?? dispatcher
|
|
107
114
|
});
|
|
108
115
|
const media = (response.headers.get("content-type") ?? "").split(";")[0].toLowerCase();
|
|
109
116
|
diagnostics.observe?.({
|
|
@@ -135,7 +142,7 @@ function createXopcMcpTransport(diagnostics = {}, assertPluginCallAccess) {
|
|
|
135
142
|
try {
|
|
136
143
|
await close();
|
|
137
144
|
} finally {
|
|
138
|
-
await dispatcher.close();
|
|
145
|
+
await Promise.all([dispatcher.close(), externalDispatcher?.close()]);
|
|
139
146
|
}
|
|
140
147
|
};
|
|
141
148
|
return guard(transport);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { commandRegistry } from "../../chat-commands/registry.js";
|
|
2
2
|
//#region src/agent/messaging/message-router.ts
|
|
3
3
|
var MessageRouter = class {
|
|
4
4
|
/**
|
|
@@ -13,7 +13,7 @@ var MessageRouter = class {
|
|
|
13
13
|
senderId: msg.metadata?.senderId || msg.sender_id,
|
|
14
14
|
isGroup: msg.metadata?.isGroup || false
|
|
15
15
|
};
|
|
16
|
-
const commandInfo =
|
|
16
|
+
const commandInfo = commandRegistry.parseRegisteredSlashCommand(msg.content);
|
|
17
17
|
return {
|
|
18
18
|
context,
|
|
19
19
|
isCommand: commandInfo !== null,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { init_model_usage, modelUsageOriginFromTurn, withModelUsageOrigin } from "../../providers/model-usage.js";
|
|
4
|
-
import { withDeviceDelegation } from "../../endpoint-tools/delegation.js";
|
|
5
4
|
import { persistInboundAttachments } from "../../channels/attachments/inbound-persist.js";
|
|
6
5
|
import { buildTranscriptUserMessage, clearPendingTranscriptUserMessage, hydrateUserTurnForLlm, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
7
6
|
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
7
|
+
import { withDeviceDelegation } from "../../endpoint-tools/delegation.js";
|
|
8
8
|
import { resolveEffectiveThinkingLevel } from "../../session/thinking-resolve.js";
|
|
9
9
|
import { runEmbeddedTurnForSession } from "../embedded/run-for-session.js";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
2
1
|
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
2
|
+
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
3
3
|
import { getSessionInteractionPolicy } from "../session/interaction-policy-state.js";
|
|
4
4
|
import { getChildRun, getChildRunMessages, monitorChildRun } from "./child-run-monitor.js";
|
|
5
5
|
import "../session/interaction-policy.js";
|
|
@@ -3,9 +3,9 @@ import { TaskRepository, init_task_repository } from "../../tasks/task-repositor
|
|
|
3
3
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
4
4
|
import { getSessionConfig } from "../../storage/sqlite/config-repository.js";
|
|
5
5
|
import "../../storage/sqlite/index.js";
|
|
6
|
+
import { init_response_language, resolveResponseLanguage } from "../../i18n/response-language.js";
|
|
6
7
|
import { getUserProfileSnapshot } from "../../user-model/profile.js";
|
|
7
8
|
import { resolveTaskLocale } from "../../tasks/task-language.js";
|
|
8
|
-
import { init_response_language, resolveResponseLanguage } from "../../i18n/response-language.js";
|
|
9
9
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
10
10
|
//#region src/agent/prompt/response-language.ts
|
|
11
11
|
init_response_language();
|
|
@@ -7,9 +7,9 @@ import { getInteractionState } from "../../storage/sqlite/interaction-state-repo
|
|
|
7
7
|
import { DEFAULT_USER_TRUST_LEVEL } from "../../user-context/trust-policy.js";
|
|
8
8
|
import { getUserTrustPolicy } from "../../storage/sqlite/user-trust-repository.js";
|
|
9
9
|
import "../../storage/sqlite/index.js";
|
|
10
|
+
import { appendStablePromptSection } from "./cache-boundary.js";
|
|
10
11
|
import { getUserTimezone } from "../../user-model/repository.js";
|
|
11
12
|
import "../../user-model/index.js";
|
|
12
|
-
import { appendStablePromptSection } from "./cache-boundary.js";
|
|
13
13
|
import { resolveResponseLanguageForSession } from "./response-language.js";
|
|
14
14
|
import { buildTtsSystemPromptHint } from "../../voice/tts/directives.js";
|
|
15
15
|
import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
|
|
@@ -2,8 +2,8 @@ import { PACKAGE_VERSION, init_package_version } from "../../package-version.js"
|
|
|
2
2
|
import { getConversationRouting } from "../../storage/sqlite/conversation-repository.js";
|
|
3
3
|
import { isCronConversationId, isSubagentConversationId } from "../../routing/agent-session-key.js";
|
|
4
4
|
import { init_session_key } from "../../routing/session-key.js";
|
|
5
|
-
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
6
5
|
import { normalizePromptSection } from "./cache-boundary.js";
|
|
6
|
+
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
7
7
|
import { listChannelPlugins } from "../../channels/plugins/registry.js";
|
|
8
8
|
//#region src/agent/prompt/system-prompt-params.ts
|
|
9
9
|
init_package_version();
|