@xopcai/xopc 0.0.375 → 0.0.377
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/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-BeYLqqr8.js → activity-store-BVtU6S1w.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-B2Popl59.js → agent-avatar-dicebear-BD63ce58.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Ch07F4uX.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CdCVOg5e.js +1 -0
- package/dist/gateway/static/root/assets/agents-D2__mhy8.js +66 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-B4tgTbWG.js → agents-admin-api-DgQph1Pu.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DNkXIPxK.js → app-management-settings-panel-B0yP8rNC.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-p1_NpH8a.js → appearance-settings-Bnq1nzDX.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-CP2u5iEh.js → apps-page-CSIFuEnj.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-bI9OLnXj.js → archive-plugin-FBVMH4ym.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CjYiGOov.js → automations-page-qsg6pZlF.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-DqBWLl61.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-dOwLzjeH.js → binary-plugins-B0qGhVNs.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DiOou1HO.js → block-editor-CjQv4zlo.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-automation-inputs-i7h1Svpf.js → browser-automation-inputs-DSbRHrG7.js} +1 -1
- package/dist/gateway/static/root/assets/browser-automations-page-CzEWM_ie.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-CsDck88G.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-D4KFLtqM.js → capabilities-HaRLmYU1.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-CquUV0DP.js → capabilities-LpGa-olH.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-BeQ-Yj3_.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BQ-I3L-C.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-AeBubNQK.js → capability-header-actions-DuBac0EK.js} +1 -1
- package/dist/gateway/static/root/assets/channels-1wUJcCxP.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DrVlbq_P.js → chat-terminal-dock-CQc1mqZM.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-TUzZnurj.js → computer-settings-page-BIwOemaK.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BlpwjGW7.js → connector-service-page-CG9KKuXq.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-BFzjGpKE.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-CjKRpA8X.js → date-picker-DoZGE2hF.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-J9_0obij.js → dependency-picker-hrz7p1Lv.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DySwgreF.js → desktop-pet-C1bTu_dG.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-B1-oyKBG.js → desktop-pet-settings-C2xCFimg.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-C5rjPAyc.js → device-pairing-wizard-CZ5Wmq5U.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BY7MwiZd.js → directory-picker-path-field-BaHQhI4z.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CbgEonkK.js → extension-debug-page-B1uMVNGe.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-JoSFhfb6.js → extension-page-850m5tOc.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-DxlAZ2iy.js → extension-provider-B-_CkaD2.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-B7LtTNx7.js → extension-settings-page-P3FNAW0n.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-DKSWcBt_.js → fallback-models-BoJZA9Cm.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BoRkBnsw.js → gateway-config-swr-siY2J0hx.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-C3WQQY10.js → gateway-realtime-Biz18NiE.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BazlseY_.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-BG1zXG8B.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-TYSQEQcG.js → gateway-startup-retry-CeL1OFDZ.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-B8RmZbDw.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-_pKiNfSq.js → image-generation-api-CeDrok06.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DS_RFtWf.js → imports-page-C9FTl2dW.js} +1 -1
- package/dist/gateway/static/root/assets/index-CGVecvp4.css +1 -0
- package/dist/gateway/static/root/assets/index-DU5FmDQh.js +106 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BxwXR2qA.js → keyboard-shortcuts-settings-Dx-36I-c.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-BWd4RMBE.js → local-app-workbench-page-Cg4gdTwm.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BsgcA6-N.js → local-apps-page-3GKgu7at.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-Cg9RdsNN.js → local-session-drafts-DnSw14fE.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-rWFLl-p4.js → locale-store-DSsLH7JO.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-CApZnDPi.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-CZAZwCpE.js → management-settings-DcgCzPd-.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BHFFusQs.js → markdown-view-2rwSrMXW.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BVPTMWJI.js → media-plugins-CjGiKLFo.js} +1 -1
- package/dist/gateway/static/root/assets/messages-Cn25s55n.js +3 -0
- package/dist/gateway/static/root/assets/models-hub-cache-DaqiLHPe.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-CncL3xmy.js +5 -0
- package/dist/gateway/static/root/assets/{notes-api-CSLVCZBn.js → notes-api-D9fGUbkK.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-D9romxNU.js +8 -0
- package/dist/gateway/static/root/assets/number-input-DDeqHK-G.js +1 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-BZADmKcV.js → page-context-capture-button-CKqYL9AQ.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-DoG-2fru.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-CBnKsW4p.js → product-open-page-DFu_ZT2h.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-B0gGexdG.js → product-preview-content-tPBCFa7L.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-ZjQSv_NG.js → project-detail-page-C9Bt5toA.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-Bf7Sd_Ck.js → projects-page-Bu3jZa3A.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-CoMBYjHD.js → registry-api-ZhIt79wL.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C9MNGl2t.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CQZ1c-re.js → runtime-tools-settings-panel-BYQuPsWk.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-1xGRBOJO.js → scenes-page-7LjR8Aek.js} +2 -2
- package/dist/gateway/static/root/assets/schema-form-GwVc8KsT.js +1 -0
- package/dist/gateway/static/root/assets/{send-session-input-CLhR1uEp.js → send-session-input-B64q4_6R.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-u_4_kFQt.js → session-api-BUa3BaGX.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-BWLIDok4.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-CzbNB_RT.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CmNe5RJ4.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-CSqi5fmN.js → settings-page-DAvi3P8Q.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DoAn6P_k.js +1 -0
- package/dist/gateway/static/root/assets/{share-link-dialog-XhiuPKF4.js → share-link-dialog-CbkS1cj-.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Vc0TQuZ8.js → share-preview-page-DicRCB4L.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-BVSb1vh4.js → shares-api-BUGeqXCG.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Bbkz0xuD.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-CFtEHy5e.js → skill-api-DpTUuYWk.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-BsLx_FXd.js → skill-reload-api-CII18PA5.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-BuBSAOOd.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-DBMR9ks_.js → system-settings-panel-DlNaQp-l.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-CGe34vxR.js → task-detail-page-DeElbs6T.js} +2 -2
- package/dist/gateway/static/root/assets/{task-expandable-content-DxeBTJvh.js → task-expandable-content-sONbgbwR.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-KcQhCg1-.js → theme-store-Kz0VUMSb.js} +1 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-CZHhm1Nn.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-CzNIlgdJ.js → tunnel-api-sUbAaSX6.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-O3abwewp.js → usage-page-NPLApyNj.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-C-IWxbzm.js → use-autosave-CZzYhcAl.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-Dxphaxk-.js → use-composer-attachments-Bb_Hqqry.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-Du37Gofn.js → use-file-preview-expanded-D4WI5JDn.js} +2 -2
- package/dist/gateway/static/root/assets/user-model-page-DAEiJzNV.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-7BImy8Jc.js → voice-api-key-field-CIIGmtHR.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-6MINytQl.js → voice-config-api-BtWFziQc.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-D967-fVj.js → work-discovery-overlay-DxRDLQvs.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BJ945m7G.js → workflow-run-setup-panel-Be_Rey6d.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-wJk7l1_H.js +6 -0
- package/dist/gateway/static/root/assets/{workspace-api-CXiyhTwv.js → workspace-api-B5ssQs4p.js} +2 -2
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Bq9ubffP.js → xopc-cloud-account-card-D7Rtu5eI.js} +1 -1
- package/dist/gateway/static/root/index.html +27 -27
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +3 -3
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/mcp/connection-setup.d.ts +21 -0
- package/dist/src/agent/mcp/connection-setup.js +214 -0
- package/dist/src/agent/mcp/tool-catalog.d.ts +18 -0
- package/dist/src/agent/mcp/tool-catalog.js +120 -0
- package/dist/src/agent/service/process-direct-streaming.js +1 -1
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-config-service.js +2 -4
- 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/tools/factory.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent/workspace-runtime/registry.js +1 -1
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/service/action-executor.js +1 -1
- package/dist/src/bootstrap/application-state.js +2 -2
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +2 -2
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/agent-profile.js +2 -2
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.js +1 -1
- package/dist/src/connectors/health.js +35 -2
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/hono/app.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/browser-install.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/connectors.js +4 -4
- package/dist/src/gateway/hono/routes/context-sources.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +89 -0
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/service/session-command-service.js +1 -1
- package/dist/src/gateway/service.js +13 -3
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/infra/update-restart.d.ts +5 -0
- package/dist/src/infra/update-restart.js +38 -31
- package/dist/src/infra/update-runner.d.ts +1 -0
- package/dist/src/infra/update-runner.js +47 -18
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +1 -1
- package/dist/src/personal-agent/prompt-context.js +3 -3
- package/dist/src/personal-agent/reply-composer.d.ts +1 -1
- package/dist/src/personal-agent/reply-composer.js +8 -1
- package/dist/src/personal-agent/service.js +3 -13
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/prompt-cache-payload.js +18 -22
- package/dist/src/routing/resolve-route.js +1 -1
- package/dist/src/routing/resolve-tui-session-key.js +1 -1
- package/dist/src/session/config-store.js +1 -2
- package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
- package/dist/src/storage/sqlite/migrations/246_personal_session_thinking.sql +22 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +2 -2
- package/dist/src/voice/platform-streams.js +1 -1
- package/dist/src/voice/realtime/agentEngine.js +21 -5
- package/dist/src/voice/realtime/engine.d.ts +4 -0
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/runtime.d.ts +5 -0
- package/dist/src/voice/realtime/runtime.js +4 -0
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BnF3HrHY.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CwP6OrUs.js +0 -1
- package/dist/gateway/static/root/assets/agents-n3IremKl.js +0 -66
- package/dist/gateway/static/root/assets/automations-workspace-BAHiUQbe.js +0 -6
- package/dist/gateway/static/root/assets/browser-automations-page-nArl2uwX.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-Bd8tF-gg.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-Cx4cdgse.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DpWceNd0.js +0 -8
- package/dist/gateway/static/root/assets/channels-Cd1Rf0Vk.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-j8VFMD4o.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-cLCDEe4D.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CGm-lbsX.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CX3uWkyH.js +0 -2
- package/dist/gateway/static/root/assets/index-BGBkIIzM.css +0 -1
- package/dist/gateway/static/root/assets/index-CgvOIDy_.js +0 -106
- package/dist/gateway/static/root/assets/logs-page-CLP5pu2j.js +0 -2
- package/dist/gateway/static/root/assets/messages-C1SUo4gG.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-cache-Jj8dvYcv.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-BeAHgdtw.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-MP21Zf_R.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-BbaTGmE-.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Bl8aPuXU.js +0 -1
- package/dist/gateway/static/root/assets/schema-form-BYqugMox.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-B06ZCie_.js +0 -16
- package/dist/gateway/static/root/assets/sessions-page-DjMSVXU3.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BJuMTtyI.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-D5bM0TvA.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-C-V9WllF.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-B-olXUVH.js +0 -2
- package/dist/gateway/static/root/assets/tracing-settings-page-DJRAP3nb.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-Bx2JlCpj.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-DUpVeIuw.js +0 -6
- package/dist/src/personal-agent/model-config.d.ts +0 -5
- package/dist/src/personal-agent/model-config.js +0 -59
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=20260910-1" />
|
|
12
12
|
<link rel="manifest" href="/site.webmanifest?v=20260910-1" />
|
|
13
13
|
<title>XOPC — Keep what matters moving.</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-DU5FmDQh.js"></script>
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-aKtaBQYM.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-zJ_50EbN.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BOUWij0V.js">
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/download-Dk-ZjtO6.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/plus-Q2yW6OE7.js">
|
|
27
27
|
<link rel="modulepreload" crossorigin href="/assets/x-B_N4OPjy.js">
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/messages-
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/locale-store-
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/messages-Cn25s55n.js">
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/locale-store-DSsLH7JO.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/cn-JdwAhgNB.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/schemas-CObaziC7.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/local-apps-yys1VChX.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/assets/product-delivery-BAks11S4.js">
|
|
34
34
|
<link rel="modulepreload" crossorigin href="/assets/app-link-4gpFbdsr.js">
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/assets/copy-to-clipboard-HOJ79TWv.js">
|
|
36
|
-
<link rel="modulepreload" crossorigin href="/assets/markdown-view-
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/markdown-view-2rwSrMXW.js">
|
|
37
37
|
<link rel="modulepreload" crossorigin href="/assets/check-DUBLcKHA.js">
|
|
38
38
|
<link rel="modulepreload" crossorigin href="/assets/copy-Dv6d4Dvw.js">
|
|
39
39
|
<link rel="modulepreload" crossorigin href="/assets/button-CS04eWY9.js">
|
|
@@ -69,29 +69,29 @@
|
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/rotate-cw-LIg3Am9S.js">
|
|
70
70
|
<link rel="modulepreload" crossorigin href="/assets/search-DA7gz22f.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="/assets/index.module-Cd9ENXfk.js">
|
|
72
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-
|
|
73
|
-
<link rel="modulepreload" crossorigin href="/assets/session-api-
|
|
72
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-CeL1OFDZ.js">
|
|
73
|
+
<link rel="modulepreload" crossorigin href="/assets/session-api-BUa3BaGX.js">
|
|
74
74
|
<link rel="modulepreload" crossorigin href="/assets/constants-Dy8Gw0sF.js">
|
|
75
75
|
<link rel="modulepreload" crossorigin href="/assets/app-chrome-BeB4KgOf.js">
|
|
76
76
|
<link rel="modulepreload" crossorigin href="/assets/attachment-utils-core-BIOUBrpT.js">
|
|
77
77
|
<link rel="modulepreload" crossorigin href="/assets/files-Bw4SBGdM.js">
|
|
78
|
-
<link rel="modulepreload" crossorigin href="/assets/workspace-api-
|
|
78
|
+
<link rel="modulepreload" crossorigin href="/assets/workspace-api-B5ssQs4p.js">
|
|
79
79
|
<link rel="modulepreload" crossorigin href="/assets/electron-env-Dit0bHgy.js">
|
|
80
80
|
<link rel="modulepreload" crossorigin href="/assets/use-async-resource-GrnWNwMZ.js">
|
|
81
|
-
<link rel="modulepreload" crossorigin href="/assets/activity-store-
|
|
82
|
-
<link rel="modulepreload" crossorigin href="/assets/use-file-preview-expanded-
|
|
81
|
+
<link rel="modulepreload" crossorigin href="/assets/activity-store-BVtU6S1w.js">
|
|
82
|
+
<link rel="modulepreload" crossorigin href="/assets/use-file-preview-expanded-D4WI5JDn.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/mic-CuUb7zc-.js">
|
|
84
84
|
<link rel="modulepreload" crossorigin href="/assets/globe-DSSGFWFn.js">
|
|
85
|
-
<link rel="modulepreload" crossorigin href="/assets/share-link-dialog-
|
|
86
|
-
<link rel="modulepreload" crossorigin href="/assets/local-session-drafts-
|
|
85
|
+
<link rel="modulepreload" crossorigin href="/assets/share-link-dialog-CbkS1cj-.js">
|
|
86
|
+
<link rel="modulepreload" crossorigin href="/assets/local-session-drafts-DnSw14fE.js">
|
|
87
87
|
<link rel="modulepreload" crossorigin href="/assets/tasks-DwKXgZ-I.js">
|
|
88
|
-
<link rel="modulepreload" crossorigin href="/assets/capabilities-
|
|
88
|
+
<link rel="modulepreload" crossorigin href="/assets/capabilities-LpGa-olH.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="/assets/skill-wire-pattern-BPpeIcCi.js">
|
|
90
|
-
<link rel="modulepreload" crossorigin href="/assets/shares-api-
|
|
91
|
-
<link rel="modulepreload" crossorigin href="/assets/capabilities-
|
|
92
|
-
<link rel="modulepreload" crossorigin href="/assets/use-composer-attachments-
|
|
90
|
+
<link rel="modulepreload" crossorigin href="/assets/shares-api-BUGeqXCG.js">
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/assets/capabilities-HaRLmYU1.js">
|
|
92
|
+
<link rel="modulepreload" crossorigin href="/assets/use-composer-attachments-Bb_Hqqry.js">
|
|
93
93
|
<link rel="modulepreload" crossorigin href="/assets/git-branch-Dh9uxTot.js">
|
|
94
|
-
<link rel="modulepreload" crossorigin href="/assets/notes-api-
|
|
94
|
+
<link rel="modulepreload" crossorigin href="/assets/notes-api-D9fGUbkK.js">
|
|
95
95
|
<link rel="modulepreload" crossorigin href="/assets/message-square-fVE7Ghj1.js">
|
|
96
96
|
<link rel="modulepreload" crossorigin href="/assets/pause-DuPxgSxk.js">
|
|
97
97
|
<link rel="modulepreload" crossorigin href="/assets/play-kxZvpBg8.js">
|
|
@@ -99,24 +99,24 @@
|
|
|
99
99
|
<link rel="modulepreload" crossorigin href="/assets/settings-2-D-csvaET.js">
|
|
100
100
|
<link rel="modulepreload" crossorigin href="/assets/sparkles-DHlfQFAF.js">
|
|
101
101
|
<link rel="modulepreload" crossorigin href="/assets/middleware-Pd0e8Igk.js">
|
|
102
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-realtime-store-
|
|
103
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-realtime-
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-realtime-store-BazlseY_.js">
|
|
103
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-realtime-Biz18NiE.js">
|
|
104
104
|
<link rel="modulepreload" crossorigin href="/assets/tool-activity-BtJkgjFf.js">
|
|
105
|
-
<link rel="modulepreload" crossorigin href="/assets/registry-api-
|
|
106
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-config-swr-
|
|
107
|
-
<link rel="modulepreload" crossorigin href="/assets/agents-admin-api-
|
|
108
|
-
<link rel="modulepreload" crossorigin href="/assets/session-manager-
|
|
109
|
-
<link rel="modulepreload" crossorigin href="/assets/send-session-input-
|
|
110
|
-
<link rel="modulepreload" crossorigin href="/assets/theme-store-
|
|
111
|
-
<link rel="modulepreload" crossorigin href="/assets/extension-provider-
|
|
105
|
+
<link rel="modulepreload" crossorigin href="/assets/registry-api-ZhIt79wL.js">
|
|
106
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-config-swr-siY2J0hx.js">
|
|
107
|
+
<link rel="modulepreload" crossorigin href="/assets/agents-admin-api-DgQph1Pu.js">
|
|
108
|
+
<link rel="modulepreload" crossorigin href="/assets/session-manager-BWLIDok4.js">
|
|
109
|
+
<link rel="modulepreload" crossorigin href="/assets/send-session-input-B64q4_6R.js">
|
|
110
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-store-Kz0VUMSb.js">
|
|
111
|
+
<link rel="modulepreload" crossorigin href="/assets/extension-provider-B-_CkaD2.js">
|
|
112
112
|
<link rel="modulepreload" crossorigin href="/assets/loopi-Djb8XU3l.js">
|
|
113
|
-
<link rel="modulepreload" crossorigin href="/assets/models-hub-cache-
|
|
113
|
+
<link rel="modulepreload" crossorigin href="/assets/models-hub-cache-DaqiLHPe.js">
|
|
114
114
|
<link rel="modulepreload" crossorigin href="/assets/skill-api-utils-C7V4JVXM.js">
|
|
115
115
|
<link rel="modulepreload" crossorigin href="/assets/date-formatters-CUZAyDEg.js">
|
|
116
116
|
<link rel="modulepreload" crossorigin href="/assets/settings-form-draft-Dy10ldo8.js">
|
|
117
117
|
<link rel="stylesheet" crossorigin href="/assets/markdown-view-DSjfHfaW.css">
|
|
118
118
|
<link rel="stylesheet" crossorigin href="/assets/loopi-C09I2mNj.css">
|
|
119
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
119
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CGVecvp4.css">
|
|
120
120
|
</head>
|
|
121
121
|
<body>
|
|
122
122
|
<div id="root"></div>
|
package/dist/package.js
CHANGED
|
@@ -6,10 +6,11 @@ import { consumeClarificationApproval, init_clarification_wait_repository } from
|
|
|
6
6
|
import { getInteractionState } from "../storage/sqlite/interaction-state-repository.js";
|
|
7
7
|
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
8
8
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
9
|
-
import { resolveUserContextSessionAccess } from "../user-context/access-policy.js";
|
|
10
|
-
import { enqueueConversationLearning } from "../memory-learning/repository.js";
|
|
11
9
|
import { expandWorkspacePathString, init_workspace_path } from "../config/workspace-path.js";
|
|
12
10
|
import { init_agent_scope, listAgentEntries, resolveAgentProfileDir } from "./agent-scope.js";
|
|
11
|
+
import { extractTextContent } from "./context/workspace.js";
|
|
12
|
+
import { resolveUserContextSessionAccess } from "../user-context/access-policy.js";
|
|
13
|
+
import { enqueueConversationLearning } from "../memory-learning/repository.js";
|
|
13
14
|
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
14
15
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
15
16
|
import { init_paths, resolveBundledSkillsDir } from "../config/paths.js";
|
|
@@ -20,7 +21,6 @@ import { createExtensionAwareStreamFn } from "../providers/extension-stream-brid
|
|
|
20
21
|
import { traceTools } from "../observability/runtime.js";
|
|
21
22
|
import { continuesAfterTool, trackAiUsageStream } from "../usage/recorder.js";
|
|
22
23
|
import { MemoryLearningService } from "../memory-learning/service.js";
|
|
23
|
-
import { extractTextContent } from "./context/workspace.js";
|
|
24
24
|
import { runPersistentLearningJob } from "./background-review/run-background-review.js";
|
|
25
25
|
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
26
26
|
import { isPersonalConversation } from "../personal-agent/repository.js";
|
|
@@ -5,6 +5,7 @@ import { finishContextExtractionRun } from "../../storage/sqlite/context-extract
|
|
|
5
5
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
6
6
|
import { loadCompactionSourceSnapshot } from "../../storage/sqlite/transcript-repository.js";
|
|
7
7
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
8
|
+
import { extractTextContent } from "../context/workspace.js";
|
|
8
9
|
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
9
10
|
import { failLearningJob, finishLearningJob, learningPolicyHash } from "../../memory-learning/repository.js";
|
|
10
11
|
import { extractProfileAgentId } from "../../config/agent-profile.js";
|
|
@@ -21,7 +22,6 @@ import { getAssertionSlot, listUserAssertions } from "../../user-model/repositor
|
|
|
21
22
|
import { emptyUserModelCaptureResult, executeUserModelInterpretation } from "../../user-model/capture/executor.js";
|
|
22
23
|
import { parseUserModelInterpretation } from "../../user-model/capture/semantic.js";
|
|
23
24
|
import "../../user-model/capture/index.js";
|
|
24
|
-
import { extractTextContent } from "../context/workspace.js";
|
|
25
25
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
26
26
|
import { resolveAgentTurnTimeoutMs, runAgentTurnWithTimeout } from "../orchestration/run-agent-turn-with-timeout.js";
|
|
27
27
|
import { isAssistantTurnAborted, isAssistantTurnFailed } from "../orchestration/llm-turn-retry.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { init_src } from "../../../packages/computer-control-contract/src/index.js";
|
|
2
|
-
import "../../../packages/browser-control-contract/src/index.js";
|
|
3
1
|
import { ExternalEffectNotAppliedError, executeExternalOperation } from "../../capabilities/runtime/external-operations.js";
|
|
4
2
|
import { canonicalCapabilityJson } from "../../capabilities/runtime/dispatcher.js";
|
|
3
|
+
import { init_src } from "../../../packages/computer-control-contract/src/index.js";
|
|
4
|
+
import "../../../packages/browser-control-contract/src/index.js";
|
|
5
5
|
import { externalToolRef, parseExternalToolRef } from "./refs.js";
|
|
6
6
|
import { extractDocumentText } from "../../document-understanding/extract.js";
|
|
7
7
|
import { prepareImageForModel } from "../image/prepare-image-for-model.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Config } from '../../config/schema.js';
|
|
2
|
+
export type McpConnectionProbe = {
|
|
3
|
+
state: 'connected' | 'oauth_required' | 'token_required' | 'error';
|
|
4
|
+
toolCount?: number;
|
|
5
|
+
error?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function probeMcpConnection(config: Config, workspace: string, serverId: string): Promise<McpConnectionProbe>;
|
|
8
|
+
export type McpAuthorization = {
|
|
9
|
+
id: string;
|
|
10
|
+
serverId: string;
|
|
11
|
+
state: 'starting' | 'authorizing' | 'connected' | 'error' | 'cancelled';
|
|
12
|
+
authorizationUrl?: string;
|
|
13
|
+
acceptsRedirect?: boolean;
|
|
14
|
+
toolCount?: number;
|
|
15
|
+
error?: string;
|
|
16
|
+
};
|
|
17
|
+
/** A UI bridge to native pi's login command; no host-owned OAuth client or token store. */
|
|
18
|
+
export declare function startMcpAuthorization(config: Config, workspace: string, serverId: string, owner: string): McpAuthorization;
|
|
19
|
+
export declare function getMcpAuthorization(id: string, owner: string, config: Config): McpAuthorization | undefined;
|
|
20
|
+
export declare function cancelMcpAuthorization(id: string, owner: string): boolean;
|
|
21
|
+
export declare function submitMcpRedirect(id: string, owner: string, redirectUrl: string, config: Config): boolean;
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { isManagedConnectorServer } from "../../connectors/materialize.js";
|
|
2
|
+
import { prepareNativeMcpConfig } from "./native-mcp.js";
|
|
3
|
+
import { McpAuthenticationRequiredError, discoverMcpTools, signInNativeMcp } from "./tool-catalog.js";
|
|
4
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
5
|
+
//#region src/agent/mcp/connection-setup.ts
|
|
6
|
+
function httpUrl(value) {
|
|
7
|
+
const url = new URL(value);
|
|
8
|
+
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password) throw new Error("Use an HTTP or HTTPS MCP address without embedded credentials.");
|
|
9
|
+
return url;
|
|
10
|
+
}
|
|
11
|
+
async function metadata(url) {
|
|
12
|
+
try {
|
|
13
|
+
const response = await fetch(url, {
|
|
14
|
+
signal: AbortSignal.timeout(5e3),
|
|
15
|
+
redirect: "error",
|
|
16
|
+
headers: { Accept: "application/json" }
|
|
17
|
+
});
|
|
18
|
+
if (!response.ok) return;
|
|
19
|
+
const result = await response.json();
|
|
20
|
+
if (result && typeof result === "object" && !Array.isArray(result)) return result;
|
|
21
|
+
} catch {}
|
|
22
|
+
}
|
|
23
|
+
/** A 401 alone is not evidence that a service supports OAuth. */
|
|
24
|
+
async function advertisesOAuth(config, workspace, serverId) {
|
|
25
|
+
const entry = (await prepareNativeMcpConfig(config, workspace)).servers.find((server) => server.name === serverId);
|
|
26
|
+
if (!entry || !("url" in entry.config)) return false;
|
|
27
|
+
const url = httpUrl(entry.config.url);
|
|
28
|
+
if (Object.keys(entry.config.headers ?? {}).some((name) => name.toLowerCase() === "authorization")) return false;
|
|
29
|
+
const response = await fetch(url, {
|
|
30
|
+
method: "POST",
|
|
31
|
+
signal: AbortSignal.timeout(1e4),
|
|
32
|
+
redirect: "error",
|
|
33
|
+
headers: {
|
|
34
|
+
Accept: "application/json, text/event-stream",
|
|
35
|
+
"Content-Type": "application/json",
|
|
36
|
+
...entry.config.headers
|
|
37
|
+
},
|
|
38
|
+
body: JSON.stringify({
|
|
39
|
+
jsonrpc: "2.0",
|
|
40
|
+
id: 1,
|
|
41
|
+
method: "initialize",
|
|
42
|
+
params: {
|
|
43
|
+
protocolVersion: "2025-03-26",
|
|
44
|
+
capabilities: {},
|
|
45
|
+
clientInfo: {
|
|
46
|
+
name: "xopc",
|
|
47
|
+
version: "1"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
const challenge = response.headers.get("WWW-Authenticate") ?? "";
|
|
53
|
+
await response.body?.cancel();
|
|
54
|
+
const resourceMetadata = /resource_metadata\s*=\s*"([^"\s]+)"/i.exec(challenge)?.[1];
|
|
55
|
+
const candidates = [
|
|
56
|
+
...resourceMetadata ? [httpUrl(resourceMetadata)] : [],
|
|
57
|
+
new URL(`/.well-known/oauth-protected-resource${url.pathname === "/" ? "" : url.pathname}`, url),
|
|
58
|
+
new URL("/.well-known/oauth-protected-resource", url)
|
|
59
|
+
];
|
|
60
|
+
for (const candidate of candidates) {
|
|
61
|
+
const data = await metadata(candidate);
|
|
62
|
+
if (data && typeof data.resource === "string" && data.resource === url.href && Array.isArray(data.authorization_servers) && data.authorization_servers.some((value) => {
|
|
63
|
+
try {
|
|
64
|
+
return typeof value === "string" && Boolean(httpUrl(value));
|
|
65
|
+
} catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
})) return true;
|
|
69
|
+
}
|
|
70
|
+
if (!/\bBearer\b/i.test(challenge)) return false;
|
|
71
|
+
const legacy = await metadata(new URL("/.well-known/oauth-authorization-server", url));
|
|
72
|
+
return Boolean(legacy && legacy.issuer === url.origin && typeof legacy.authorization_endpoint === "string" && typeof legacy.token_endpoint === "string");
|
|
73
|
+
}
|
|
74
|
+
async function probeMcpConnection(config, workspace, serverId) {
|
|
75
|
+
try {
|
|
76
|
+
return {
|
|
77
|
+
state: "connected",
|
|
78
|
+
toolCount: (await discoverMcpTools(config, workspace, serverId)).length
|
|
79
|
+
};
|
|
80
|
+
} catch (error) {
|
|
81
|
+
if (error instanceof McpAuthenticationRequiredError) try {
|
|
82
|
+
return { state: await advertisesOAuth(config, workspace, serverId) ? "oauth_required" : "token_required" };
|
|
83
|
+
} catch (error) {
|
|
84
|
+
return {
|
|
85
|
+
state: "error",
|
|
86
|
+
error: error instanceof Error ? error.message : String(error)
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
const server = config.mcp?.servers?.[serverId];
|
|
90
|
+
if (server?.url && Object.keys(server.headers ?? {}).some((name) => name.toLowerCase() === "authorization") && /401|403|unauthorized|forbidden/i.test(String(error))) return { state: "token_required" };
|
|
91
|
+
return {
|
|
92
|
+
state: "error",
|
|
93
|
+
error: error instanceof Error ? error.message : String(error)
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const attempts = /* @__PURE__ */ new Map();
|
|
98
|
+
function fingerprint(config, serverId) {
|
|
99
|
+
const server = config.mcp?.servers?.[serverId];
|
|
100
|
+
return createHash("sha256").update(JSON.stringify(server ? {
|
|
101
|
+
...server,
|
|
102
|
+
xopcConnector: void 0
|
|
103
|
+
} : null)).digest("hex");
|
|
104
|
+
}
|
|
105
|
+
function finish(attempt) {
|
|
106
|
+
attempt.dispose?.();
|
|
107
|
+
attempt.dispose = void 0;
|
|
108
|
+
attempt.redirect?.(void 0);
|
|
109
|
+
attempt.redirect = void 0;
|
|
110
|
+
attempt.result.acceptsRedirect = false;
|
|
111
|
+
}
|
|
112
|
+
function cancel(attempt) {
|
|
113
|
+
if (attempt.result.state === "starting" || attempt.result.state === "authorizing") {
|
|
114
|
+
attempt.result.state = "cancelled";
|
|
115
|
+
attempt.controller.abort();
|
|
116
|
+
finish(attempt);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/** A UI bridge to native pi's login command; no host-owned OAuth client or token store. */
|
|
120
|
+
function startMcpAuthorization(config, workspace, serverId, owner) {
|
|
121
|
+
const server = config.mcp?.servers?.[serverId];
|
|
122
|
+
if (!server?.url || server.enabled === false || isManagedConnectorServer(server) && server.xopcConnector.enabled === false) throw new Error("An enabled HTTP MCP server is required.");
|
|
123
|
+
httpUrl(server.url);
|
|
124
|
+
if (server.auth || Object.keys(server.headers ?? {}).some((name) => name.toLowerCase() === "authorization")) throw new Error("This server uses configured credentials. Remove Authorization before using OAuth.");
|
|
125
|
+
for (const attempt of attempts.values()) if (attempt.owner === owner && attempt.result.serverId === serverId) cancel(attempt);
|
|
126
|
+
if (attempts.size >= 100) throw new Error("Too many pending sign-ins. Try again later.");
|
|
127
|
+
const attempt = {
|
|
128
|
+
owner,
|
|
129
|
+
fingerprint: fingerprint(config, serverId),
|
|
130
|
+
controller: new AbortController(),
|
|
131
|
+
result: {
|
|
132
|
+
id: randomUUID(),
|
|
133
|
+
serverId,
|
|
134
|
+
state: "starting"
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
attempts.set(attempt.result.id, attempt);
|
|
138
|
+
const expiry = setTimeout(() => cancel(attempt), 18e4);
|
|
139
|
+
expiry.unref();
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
cancel(attempt);
|
|
142
|
+
attempts.delete(attempt.result.id);
|
|
143
|
+
}, 10 * 6e4).unref();
|
|
144
|
+
signInNativeMcp(structuredClone(config), workspace, serverId, {
|
|
145
|
+
signal: attempt.controller.signal,
|
|
146
|
+
onAuthorizationUrl(url) {
|
|
147
|
+
const parsed = httpUrl(url);
|
|
148
|
+
if (attempt.controller.signal.aborted) return;
|
|
149
|
+
attempt.result.authorizationUrl = parsed.href;
|
|
150
|
+
attempt.result.state = "authorizing";
|
|
151
|
+
},
|
|
152
|
+
requestRedirectUrl(signal) {
|
|
153
|
+
if (signal?.aborted || attempt.controller.signal.aborted) return Promise.resolve(void 0);
|
|
154
|
+
attempt.result.acceptsRedirect = true;
|
|
155
|
+
return new Promise((resolve) => {
|
|
156
|
+
const stop = () => resolve(void 0);
|
|
157
|
+
signal?.addEventListener("abort", stop, { once: true });
|
|
158
|
+
attempt.redirect = resolve;
|
|
159
|
+
attempt.dispose = () => signal?.removeEventListener("abort", stop);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}).then((tools) => {
|
|
163
|
+
if (!attempt.controller.signal.aborted) {
|
|
164
|
+
attempt.result.state = "connected";
|
|
165
|
+
attempt.result.toolCount = tools.length;
|
|
166
|
+
delete attempt.result.authorizationUrl;
|
|
167
|
+
}
|
|
168
|
+
}).catch((error) => {
|
|
169
|
+
if (!attempt.controller.signal.aborted) {
|
|
170
|
+
attempt.result.state = "error";
|
|
171
|
+
attempt.result.error = error instanceof Error ? error.message : String(error);
|
|
172
|
+
delete attempt.result.authorizationUrl;
|
|
173
|
+
}
|
|
174
|
+
}).finally(() => {
|
|
175
|
+
clearTimeout(expiry);
|
|
176
|
+
finish(attempt);
|
|
177
|
+
});
|
|
178
|
+
return { ...attempt.result };
|
|
179
|
+
}
|
|
180
|
+
function getMcpAuthorization(id, owner, config) {
|
|
181
|
+
const attempt = attempts.get(id);
|
|
182
|
+
if (!attempt || attempt.owner !== owner) return;
|
|
183
|
+
if (attempt.fingerprint !== fingerprint(config, attempt.result.serverId)) {
|
|
184
|
+
cancel(attempt);
|
|
185
|
+
attempt.result = {
|
|
186
|
+
id,
|
|
187
|
+
serverId: attempt.result.serverId,
|
|
188
|
+
state: "cancelled"
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
return { ...attempt.result };
|
|
192
|
+
}
|
|
193
|
+
function cancelMcpAuthorization(id, owner) {
|
|
194
|
+
const attempt = attempts.get(id);
|
|
195
|
+
if (!attempt || attempt.owner !== owner) return false;
|
|
196
|
+
cancel(attempt);
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
function submitMcpRedirect(id, owner, redirectUrl, config) {
|
|
200
|
+
const result = getMcpAuthorization(id, owner, config);
|
|
201
|
+
const attempt = attempts.get(id);
|
|
202
|
+
if (!result || !attempt?.redirect || result.state !== "authorizing" || !result.authorizationUrl) return false;
|
|
203
|
+
const authorization = new URL(result.authorizationUrl);
|
|
204
|
+
const expected = authorization.searchParams.get("redirect_uri");
|
|
205
|
+
if (!expected) return false;
|
|
206
|
+
const target = new URL(expected);
|
|
207
|
+
const actual = httpUrl(redirectUrl);
|
|
208
|
+
if (actual.origin !== target.origin || actual.pathname !== target.pathname || actual.searchParams.get("state") !== authorization.searchParams.get("state") || !actual.searchParams.get("code")) return false;
|
|
209
|
+
attempt.redirect(actual.href);
|
|
210
|
+
attempt.redirect = void 0;
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
//#endregion
|
|
214
|
+
export { cancelMcpAuthorization, getMcpAuthorization, probeMcpConnection, startMcpAuthorization, submitMcpRedirect };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Config } from '../../config/schema.js';
|
|
2
|
+
export type McpCatalogTool = {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: unknown;
|
|
6
|
+
exposure?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class McpAuthenticationRequiredError extends Error {
|
|
9
|
+
}
|
|
10
|
+
export type McpLoginInteraction = {
|
|
11
|
+
signal: AbortSignal;
|
|
12
|
+
onAuthorizationUrl: (url: string) => void;
|
|
13
|
+
requestRedirectUrl: (signal?: AbortSignal) => Promise<string | undefined>;
|
|
14
|
+
};
|
|
15
|
+
/** A short-lived native session discovers tools without making a model request. */
|
|
16
|
+
export declare function discoverMcpTools(config: Config, workspaceDir: string, serverId: string): Promise<McpCatalogTool[]>;
|
|
17
|
+
/** Native pi owns PKCE, registration, callbacks, token storage and refresh. */
|
|
18
|
+
export declare function signInNativeMcp(config: Config, workspaceDir: string, serverId: string, interaction: McpLoginInteraction): Promise<McpCatalogTool[]>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { createEmbeddedModelRuntime } from "../embedded/model-runtime.js";
|
|
2
|
+
import { getNativePiAgentDir, prepareNativeMcpConfig } from "./native-mcp.js";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { InMemoryCredentialStore, InMemoryModelsStore } from "@earendil-works/pi-ai";
|
|
5
|
+
import { DefaultResourceLoader, ModelRuntime, SessionManager, SettingsManager, createAgentSession, createMcpExtension, createToolSearchExtension } from "@earendil-works/pi-coding-agent";
|
|
6
|
+
//#region src/agent/mcp/tool-catalog.ts
|
|
7
|
+
var McpAuthenticationRequiredError = class extends Error {};
|
|
8
|
+
/** A short-lived native session discovers tools without making a model request. */
|
|
9
|
+
async function discoverMcpTools(config, workspaceDir, serverId) {
|
|
10
|
+
return runNativeMcpSession(config, workspaceDir, serverId);
|
|
11
|
+
}
|
|
12
|
+
/** Native pi owns PKCE, registration, callbacks, token storage and refresh. */
|
|
13
|
+
async function signInNativeMcp(config, workspaceDir, serverId, interaction) {
|
|
14
|
+
return runNativeMcpSession(config, workspaceDir, serverId, interaction);
|
|
15
|
+
}
|
|
16
|
+
async function runNativeMcpSession(config, workspaceDir, serverId, interaction) {
|
|
17
|
+
const entry = (await prepareNativeMcpConfig(config, workspaceDir)).servers.find((server) => server.name === serverId);
|
|
18
|
+
if (!entry) throw new Error(`MCP server "${serverId}" is not configured or has invalid configuration.`);
|
|
19
|
+
if (entry.config.enabled === false) throw new Error(`MCP server "${serverId}" is disabled.`);
|
|
20
|
+
const agentDir = getNativePiAgentDir();
|
|
21
|
+
const settingsManager = SettingsManager.inMemory({
|
|
22
|
+
retry: { enabled: false },
|
|
23
|
+
compaction: { enabled: false }
|
|
24
|
+
});
|
|
25
|
+
const loader = new DefaultResourceLoader({
|
|
26
|
+
cwd: workspaceDir,
|
|
27
|
+
agentDir,
|
|
28
|
+
settingsManager,
|
|
29
|
+
noExtensions: true,
|
|
30
|
+
noSkills: true,
|
|
31
|
+
noPromptTemplates: true,
|
|
32
|
+
noThemes: true,
|
|
33
|
+
noContextFiles: true,
|
|
34
|
+
extensionFactories: [createToolSearchExtension(), createMcpExtension({
|
|
35
|
+
loadConfig: () => ({
|
|
36
|
+
servers: [entry],
|
|
37
|
+
errors: [],
|
|
38
|
+
autoEnableCodemode: false
|
|
39
|
+
}),
|
|
40
|
+
logPath: join(agentDir, "mcp.log"),
|
|
41
|
+
openUrl: (url) => interaction?.onAuthorizationUrl(url)
|
|
42
|
+
})]
|
|
43
|
+
});
|
|
44
|
+
await loader.reload();
|
|
45
|
+
const provider = "url" in entry.config ? entry.config.auth?.provider : void 0;
|
|
46
|
+
const { session } = await createAgentSession({
|
|
47
|
+
cwd: workspaceDir,
|
|
48
|
+
agentDir,
|
|
49
|
+
resourceLoader: loader,
|
|
50
|
+
settingsManager,
|
|
51
|
+
modelRuntime: provider ? await createEmbeddedModelRuntime(provider) : await ModelRuntime.create({
|
|
52
|
+
credentials: new InMemoryCredentialStore(),
|
|
53
|
+
modelsStore: new InMemoryModelsStore(),
|
|
54
|
+
modelsPath: null,
|
|
55
|
+
refreshOnCreate: false
|
|
56
|
+
}),
|
|
57
|
+
sessionManager: SessionManager.inMemory(),
|
|
58
|
+
noTools: "builtin"
|
|
59
|
+
});
|
|
60
|
+
let failure;
|
|
61
|
+
let signedIn = false;
|
|
62
|
+
let shutdown;
|
|
63
|
+
const close = () => shutdown ??= session.extensionRunner?.emit({
|
|
64
|
+
type: "session_shutdown",
|
|
65
|
+
reason: "quit"
|
|
66
|
+
}) ?? Promise.resolve();
|
|
67
|
+
const abort = () => {
|
|
68
|
+
close();
|
|
69
|
+
};
|
|
70
|
+
try {
|
|
71
|
+
const runner = session.extensionRunner;
|
|
72
|
+
if (!runner) throw new Error("Native MCP extension is unavailable.");
|
|
73
|
+
await session.bindExtensions({ uiContext: {
|
|
74
|
+
...runner.getUIContext(),
|
|
75
|
+
notify(message) {
|
|
76
|
+
if (message.startsWith("MCP servers need attention:") || message.startsWith("MCP failed to load:")) failure = message;
|
|
77
|
+
if (message.startsWith("Signed in to MCP server")) signedIn = true;
|
|
78
|
+
if (message.startsWith("Sign-in ") || message.startsWith("Signed in, but")) failure = message;
|
|
79
|
+
},
|
|
80
|
+
input(_title, _placeholder, options) {
|
|
81
|
+
return interaction?.requestRedirectUrl(options?.signal) ?? Promise.resolve(void 0);
|
|
82
|
+
}
|
|
83
|
+
} });
|
|
84
|
+
interaction?.signal.addEventListener("abort", abort, { once: true });
|
|
85
|
+
if (interaction?.signal.aborted) throw new Error("MCP sign-in cancelled.");
|
|
86
|
+
let timer;
|
|
87
|
+
try {
|
|
88
|
+
await Promise.race([session.prompt("/mcp"), new Promise((_resolve, reject) => {
|
|
89
|
+
timer = setTimeout(() => reject(/* @__PURE__ */ new Error("MCP tool discovery timed out.")), 6e4);
|
|
90
|
+
})]);
|
|
91
|
+
} finally {
|
|
92
|
+
clearTimeout(timer);
|
|
93
|
+
}
|
|
94
|
+
if (interaction) {
|
|
95
|
+
failure = void 0;
|
|
96
|
+
await session.prompt(`/mcp login ${serverId}`);
|
|
97
|
+
if (interaction.signal.aborted) throw new Error("MCP sign-in cancelled.");
|
|
98
|
+
if (failure || !signedIn) throw new Error(failure ?? "MCP sign-in did not complete.");
|
|
99
|
+
} else if (failure) {
|
|
100
|
+
if (/needs sign-in|needs-auth/.test(failure)) throw new McpAuthenticationRequiredError(failure);
|
|
101
|
+
throw new Error(failure);
|
|
102
|
+
}
|
|
103
|
+
const namespace = `mcp__${serverId.replace(/-/g, "_")}`;
|
|
104
|
+
return session.getAllTools().filter((tool) => tool.namespace?.name === namespace).map((tool) => ({
|
|
105
|
+
name: tool.name,
|
|
106
|
+
description: tool.description,
|
|
107
|
+
inputSchema: tool.parameters,
|
|
108
|
+
exposure: tool.exposure
|
|
109
|
+
})).sort((a, b) => a.name.localeCompare(b.name));
|
|
110
|
+
} finally {
|
|
111
|
+
try {
|
|
112
|
+
interaction?.signal.removeEventListener("abort", abort);
|
|
113
|
+
await close();
|
|
114
|
+
} finally {
|
|
115
|
+
session.dispose();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
export { McpAuthenticationRequiredError, discoverMcpTools, signInNativeMcp };
|
|
@@ -3,8 +3,8 @@ import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
|
3
3
|
import { init_session_input_repository, listTaskUpdateTriggers } from "../../storage/sqlite/session-input-repository.js";
|
|
4
4
|
import { getClarificationResumeInput, init_clarification_wait_repository } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
5
5
|
import { getConnectionResumeInput, init_connection_wait_repository } from "../../storage/sqlite/connection-wait-repository.js";
|
|
6
|
-
import { init_agent_session_key, resolveAgentMainConversationId } from "../../routing/agent-session-key.js";
|
|
7
6
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
7
|
+
import { init_agent_session_key, resolveAgentMainConversationId } from "../../routing/agent-session-key.js";
|
|
8
8
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
9
9
|
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
10
10
|
import { clearPendingTranscriptUserMessage, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { init_attachment_ref, parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
|
|
4
|
-
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
5
4
|
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
5
|
+
import { extractTextContent } from "./context/workspace.js";
|
|
6
|
+
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
6
7
|
import { extractProfileAgentId, resolveEffectiveAgentConfigForSession } from "../config/agent-profile.js";
|
|
7
8
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
8
9
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
9
10
|
import { configureTracing, flushTracing } from "../observability/runtime.js";
|
|
10
11
|
import { getUserTimezone } from "../user-model/repository.js";
|
|
11
|
-
import { extractTextContent } from "./context/workspace.js";
|
|
12
12
|
import { resolveAgentTurnTimeoutMs } from "./orchestration/run-agent-turn-with-timeout.js";
|
|
13
13
|
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
14
14
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
@@ -8,7 +8,6 @@ import { normalizeWorkingDirectoryInput } from "../../session/session-workspace.
|
|
|
8
8
|
import { getProjectWorkspacePathForSession } from "../../projects/workspace.js";
|
|
9
9
|
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
10
10
|
import { getModelThinking } from "../../providers/model-thinking.js";
|
|
11
|
-
import { savePersonalModelConfig } from "../../personal-agent/model-config.js";
|
|
12
11
|
import { normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel } from "../transcript/thinking-types.js";
|
|
13
12
|
import "../../session/index.js";
|
|
14
13
|
import { mkdir } from "node:fs/promises";
|
|
@@ -28,8 +27,7 @@ var SessionConfigService = class {
|
|
|
28
27
|
* invalid field. Model and thinking are validated together and committed in one write.
|
|
29
28
|
*/
|
|
30
29
|
async patch(conversationId, partial) {
|
|
31
|
-
const
|
|
32
|
-
const configuredThinking = personal ? void 0 : resolveEffectiveAgentConfigForSession(conversationId).config.runtime.thinkingLevel;
|
|
30
|
+
const configuredThinking = isPersonalConversation(conversationId) ? void 0 : resolveEffectiveAgentConfigForSession(conversationId).config.runtime.thinkingLevel;
|
|
33
31
|
if (configuredThinking && partial.thinkingLevel !== void 0 && partial.thinkingLevel !== configuredThinking) return {
|
|
34
32
|
ok: false,
|
|
35
33
|
code: "INVALID_THINKING",
|
|
@@ -70,7 +68,7 @@ var SessionConfigService = class {
|
|
|
70
68
|
};
|
|
71
69
|
const thinkingLevel = requested ?? chooseModelThinking(capabilities, existing?.thinkingLevel);
|
|
72
70
|
const modelRef = `${model.provider}/${model.id}`;
|
|
73
|
-
const updated =
|
|
71
|
+
const updated = await this.opts.sessionConfigStore.update(conversationId, {
|
|
74
72
|
modelOverride: modelRef,
|
|
75
73
|
thinkingLevel,
|
|
76
74
|
fixedModel: partial.fixedModel ?? existing?.fixedModel ?? false
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolveStateDir } from "../../config/paths-state.js";
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
|
-
import { init_paths } from "../../config/paths.js";
|
|
5
4
|
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
5
|
+
import { init_paths } from "../../config/paths.js";
|
|
6
6
|
import { findInstallSpec, hasBinary, installSkill } from "./installer.js";
|
|
7
7
|
import { applySkillEnvOverrides, createSkillConfigManager, getSkillEnvironment, isSkillEnabled, resolveSkillConfig, validateSkillConfig } from "./config.js";
|
|
8
8
|
import { parseSkillToolConditions } from "./skill-tool-gating.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
2
1
|
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
2
|
+
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
3
3
|
import { loadSkillsLock } from "./hub-lock.js";
|
|
4
4
|
import { dirname, join, resolve, sep } from "node:path";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
2
1
|
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
2
|
+
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
3
3
|
import { resolveWorkspaceSkillsDir } from "./workspace-skills-dir.js";
|
|
4
4
|
import { formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
5
5
|
import { fuzzyFindText, normalizeForFuzzyMatch, normalizeToLF, restoreLineEndings } from "../tools/edit-diff.js";
|
|
@@ -8,8 +8,8 @@ import { getSessionMetadata } from "../../storage/sqlite/session-read-repository
|
|
|
8
8
|
import { patchSessionMetadata } from "../../storage/sqlite/session-repository.js";
|
|
9
9
|
import { getSessionTaskPlan, setSessionTaskPlan } from "../../storage/sqlite/session-task-plan-repository.js";
|
|
10
10
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
11
|
-
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
12
11
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
12
|
+
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
13
13
|
import { resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession } from "../../config/agent-profile.js";
|
|
14
14
|
import { createPersonalAttentionTool } from "./personal-attention-tool.js";
|
|
15
15
|
import { markCodemodeCoreRead } from "./codemode-permissions.js";
|