@xopcai/xopc 0.0.388 → 0.0.389
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/_locales/en/messages.json +6 -1
- package/dist/browser-ext/_locales/zh_CN/messages.json +6 -1
- package/dist/browser-ext/dist/assets/{page-context-BeworyNB.js → page-context-A5RCibM_.js} +1 -1
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +98 -53
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/outbound-sender.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +7 -5
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +12 -12
- package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
- package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
- package/dist/gateway/static/root/assets/{activity-store-CB2X4Gmu.js → activity-store-dvik6t7Z.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-44LqtGte.js → agent-avatar-dicebear-bWMd5TDC.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-2VA4eKPf.js → agent-defaults-settings-panel-Ds0Ue2FB.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-DRhTOw_O.js → agent-plugin-dialog-UunIxc1q.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-BemUH_Yf.js → agents-BLRM4o-U.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-BkULgC6Q.js → agents-admin-api-BlNGyXpm.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CR_cc7rj.js → app-management-settings-panel-Dmy828Pe.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CYofu-su.js → appearance-settings-CUAdx44v.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-CHjWvDjk.js → apps-page-D5zDB6gp.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-De0ND0oA.js → archive-plugin-Du6dJNcl.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BIF0skon.js → automations-page-BO8Ig5Z4.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-DOwtT4sS.js → automations-workspace-UcCneEs3.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-Do535ZGW.js → binary-plugins-D7VJjwnr.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-C_RD603p.js → block-editor-CaJlWTAn.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-B9M1RYTm.js → browser-automation-inputs-iyMBJmQX.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-B-Ezk_8l.js → browser-automations-page-BjvQnYfO.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-BSmmTBn4.js → browser-settings-page-D5ZghI28.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BX1rCiVm.js → capabilities-CEH1AnXc.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-CW389yo6.js → capabilities-MCKRMZDK.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-xZgTYYDn.js → capabilities-page-MC8qIrXo.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-oqkuOjcR.js → capabilities-settings-panel-Blz3hEzp.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-header-actions-Chuhscdb.js → capability-header-actions-BIA0Lwt5.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-Dq2C2k9M.js → channels-DSg_iCVC.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-srB_M-aQ.js → chat-terminal-dock-C97SJEwd.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-Af00Kjc0.js → computer-settings-page-DvY3zgyY.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-3W0_7-4L.js → connector-service-page-St2-Fj3y.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DXk-GAsd.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-DBgZBmik.js → date-picker-C0-D80ny.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-BDJ406kH.js → dependency-picker-CNd7mwMU.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Do1XPn6U.js → desktop-pet-C-2wDANn.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-LKeVh6OH.js → desktop-pet-settings-DyhxLrdJ.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-CvZpnSVw.js → device-pairing-wizard-BeSuq__I.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BMLHoL6g.js → directory-picker-path-field-CNivVIPT.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-B0wTBCx4.js → extension-debug-page-CGYO3JPw.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-vR2r4uUB.js → extension-page-Dc51ALAg.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-CJZ5EVpQ.js → extension-provider-BXPILdlw.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-1tbWe5xQ.js → extension-settings-page-jYu6qpY2.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-CW6a1-GK.js → fallback-models-CoyzvDo7.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-D0tBjSgj.js → gateway-config-swr-Bc2MytsF.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-BnHraJ3O.js → gateway-realtime-BFK-vlME.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-C3vH-Iup.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-vQWTUx2c.js → gateway-settings-JlT1dlSj.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-C1DQsIH3.js → gateway-startup-retry-BDPMttPx.js} +1 -1
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-BM__yiMn.js → highlighted-body-KQOG7T2V-DAlRGMge.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-hfWuVtcG.js → home-page-DOVl8s-1.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-DodU6GNC.js → image-generation-api-BZBiYDmV.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-CuR6RSUM.js → imports-page-DgdBTp_0.js} +1 -1
- package/dist/gateway/static/root/assets/{index-CNH8vwcY.js → index-CmC8JkSM.js} +108 -108
- package/dist/gateway/static/root/assets/index-Dgzc0oBu.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DpyqH2cP.js → keyboard-shortcuts-settings-BYYC9Qmw.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-B4hIoxV8.js → local-app-workbench-page-BKZfn-MS.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-S7lUpENM.js → local-apps-page-BU8pUsVM.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-Be4BGM4Z.js → local-session-drafts-kFc_MAA9.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-uRu_DsWm.js → locale-store-Dr43FCty.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-CSlZT1-L.js → logs-page-BSepiACn.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BYCL5CwV.js → management-settings-dE_ykPNY.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-CBjl-XEc.js → markdown-view-CdKlPjJM.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BombFqsX.js → media-plugins-DE9zt88i.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-65SE6j-_.js +1 -0
- package/dist/gateway/static/root/assets/messages-DlTNQI92.js +3 -0
- package/dist/gateway/static/root/assets/models-hub-cache-C7FAsEe_.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-CJ5Earr_.js → note-detail-panel-D9oqhdyk.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-api-BlGP533W.js → notes-api-BHouNL6-.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CPGk8-n1.js → notes-page-Bd4_7ph8.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-C2bSXVbz.js → page-context-capture-button-TQr8NnSc.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-BjTt5R3s.js → personal-page-BvWzq4Wp.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Cn16lm5l.js → product-open-page-BEl6syFp.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-CowgeuoG.js → product-preview-content-BxSHnbqz.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-CyKx4PyN.js → project-detail-page-D-qkIXVT.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page--_hXxUMC.js → projects-page-BQtw1Dfn.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-CYqA7bfl.js → registry-api-BD5IgDOA.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-Bq_eqQYf.js → remote-access-hub-CYFNz0Jc.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-api-zzoxjSuR.js → runtime-tools-api-CjTRoQWT.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BgCATci5.js → runtime-tools-settings-panel-Qq_NyYx_.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-DxE3jRPR.js → scenes-page-hGr-ppYk.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-I6pzJJzg.js → schema-form-ByG-R6N2.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-C293-Hbx.js → send-session-input-UAVStisp.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CzVTrG8n.js → session-api-DvgEiNRS.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-BOb1tC_Z.js +16 -0
- package/dist/gateway/static/root/assets/{sessions-page-CQkGFnJM.js → sessions-page-CpX1Rluw.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-D2s_MlxR.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-Dy5oQDbx.js → settings-page-C1e9m23j.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-CrAazq4r.js → setup-status-panel-BiHRYDHq.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-BKGI8Kr0.js → share-link-dialog-kE_6v5Dp.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BF2WaO43.js → share-preview-page-BT-_yR1h.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-B0HlMAzi.js → shares-api-Dg_SqHQE.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-BNMhs-Vd.js → shares-settings-DfcAu08T.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-RIjxQs-Y.js → skill-api-BslUYMnX.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-CEJx5rPd.js → skill-reload-api-BQ2rTOP1.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-XVOxILQn.js → skills-page-CvKc5nBN.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-C8aLy8T_.js → system-settings-panel-GpbPfWwo.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-o1O2IDVP.js → task-detail-page-5B5ZVAu0.js} +1 -1
- package/dist/gateway/static/root/assets/{task-expandable-content-C9ohICpw.js → task-expandable-content-DJrrEBB4.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BUfzeDvL.js → theme-store-BKpYnggg.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-C2q5B3Kp.js → tracing-settings-page-D71w7dwV.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-JkDu1wiC.js → tunnel-api-BV46CvS8.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-B8K6Y4ro.js → usage-page-rMuwNpJi.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DgbCgsao.js → use-autosave-CzyqRffr.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-rgW7h4sD.js → use-composer-attachments-Dviq-1f6.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-DSKIxfz9.js → use-file-preview-expanded-D5Kk7Hon.js} +2 -2
- package/dist/gateway/static/root/assets/{user-model-page-C1QX47VR.js → user-model-page-Dhqw3v_u.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-4AIkbm9R.js → voice-api-key-field-DWtbmacd.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-Kw1pYlLN.js → voice-config-api-DnIjZm_9.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BshsEDRO.js → work-discovery-overlay-ChEG71hz.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CRG3paWy.js → workflow-run-setup-panel-pdiRKLxP.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-c-AoSVzm.js → workflows-page-D9LMxINt.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-JWHOFos6.js → workspace-api-CZDvu7uA.js} +2 -2
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-PDSIicr1.js → xopc-cloud-account-card-CbUgg1SK.js} +1 -1
- package/dist/gateway/static/root/index.html +27 -27
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/clarifications.js +79 -2
- package/dist/packages/realtime-protocol/src/voice.js +13 -2
- package/dist/src/agent/agent-manager.js +25 -21
- package/dist/src/agent/agent-scope.js +2 -2
- package/dist/src/agent/background-review/prompts.js +5 -1
- package/dist/src/agent/background-review/run-background-review.js +50 -12
- package/dist/src/agent/child-agent-factory.js +1 -1
- package/dist/src/agent/coding/repository-instructions.js +1 -1
- package/dist/src/agent/context/coordinator.js +2 -2
- package/dist/src/agent/context/execution-context.js +4 -4
- package/dist/src/agent/context/execution-scope.js +1 -1
- package/dist/src/agent/context/project-context.js +3 -3
- package/dist/src/agent/data-acquisition/service.js +1 -1
- package/dist/src/agent/embedded/codemode-extension.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +5 -5
- package/dist/src/agent/embedded/run-turn.js +14 -14
- package/dist/src/agent/embedded/session-runner.d.ts +4 -3
- package/dist/src/agent/embedded/session-runner.js +9 -4
- package/dist/src/agent/embedded/session-tool-result-guard.js +2 -2
- package/dist/src/agent/embedded/tool-result-truncation.js +1 -1
- package/dist/src/agent/embedded/xopc-tools-bridge.js +1 -1
- package/dist/src/agent/external-tools/cliProvider.js +3 -3
- package/dist/src/agent/external-tools/composio-provider.js +2 -2
- package/dist/src/agent/external-tools/endpoint-provider.js +4 -4
- package/dist/src/agent/external-tools/gateway-tools.js +2 -2
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/runtime.js +1 -1
- package/dist/src/agent/image/index.js +1 -1
- package/dist/src/agent/image/load-image-media.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +3 -3
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/index.js +3 -3
- package/dist/src/agent/mcp/connection-drafts.d.ts +50 -0
- package/dist/src/agent/mcp/connection-drafts.js +278 -0
- package/dist/src/agent/mcp/connection-setup.d.ts +5 -2
- package/dist/src/agent/mcp/connection-setup.js +7 -5
- package/dist/src/agent/mcp/credential-store.d.ts +6 -0
- package/dist/src/agent/mcp/credential-store.js +24 -0
- package/dist/src/agent/mcp/native-mcp.d.ts +6 -1
- package/dist/src/agent/mcp/native-mcp.js +6 -0
- package/dist/src/agent/mcp/tool-catalog.d.ts +7 -2
- package/dist/src/agent/mcp/tool-catalog.js +25 -15
- package/dist/src/agent/memory/context-budget.js +1 -1
- package/dist/src/agent/memory/context-recovery.js +1 -1
- package/dist/src/agent/memory/index.js +1 -1
- package/dist/src/agent/orchestration/llm-turn-retry.js +1 -1
- package/dist/src/agent/prompt/response-language.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +3 -3
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +4 -4
- package/dist/src/agent/service/process-direct-streaming.js +6 -6
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.js +21 -21
- package/dist/src/agent/session/session-config-service.js +3 -3
- package/dist/src/agent/session/session-hydrator.js +1 -1
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +2 -2
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/source-context/index.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +7 -7
- package/dist/src/agent/tools/clarify-tool.d.ts +2 -3
- package/dist/src/agent/tools/clarify-tool.js +15 -9
- package/dist/src/agent/tools/cli-clarify.d.ts +0 -3
- package/dist/src/agent/tools/cli-clarify.js +18 -32
- package/dist/src/agent/tools/create-share-tool.js +3 -3
- package/dist/src/agent/tools/dataBatch.js +1 -1
- package/dist/src/agent/tools/delegate-tool.js +3 -3
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.js +19 -19
- package/dist/src/agent/tools/image-generate-tool.js +3 -3
- package/dist/src/agent/tools/index.js +6 -6
- package/dist/src/agent/tools/list-dir.js +1 -1
- package/dist/src/agent/tools/personal-attention-tool.js +2 -2
- package/dist/src/agent/tools/personal-request-result-tool.js +1 -1
- package/dist/src/agent/tools/personal-request-tool.js +4 -4
- package/dist/src/agent/tools/personal-result-tool.js +1 -1
- package/dist/src/agent/tools/personal-task-tool.d.ts +4 -4
- package/dist/src/agent/tools/personal-task-tool.js +6 -6
- package/dist/src/agent/tools/publish-artifacts.js +2 -2
- package/dist/src/agent/tools/read.js +2 -2
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/agent/tools/send-media.js +1 -1
- package/dist/src/agent/tools/skills-tools.js +1 -1
- package/dist/src/agent/tools/task-collaboration-tool.js +3 -3
- package/dist/src/agent/tools/tts-tool.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +1 -1
- package/dist/src/agent/tools/write.js +2 -2
- package/dist/src/agent/tools/xopc-use-tool.js +4 -4
- package/dist/src/agent/transcript/index.js +2 -2
- package/dist/src/agent/transcript/transcript-hygiene.js +2 -2
- package/dist/src/agent/workflow/subagent-runner.js +1 -1
- package/dist/src/agent-matching/delegation-service.js +1 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/oauth/xopc-cloud.js +2 -2
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/capabilities/write.d.ts +2 -2
- package/dist/src/automations/domain/index.js +1 -1
- package/dist/src/automations/domain/validation.d.ts +6 -6
- package/dist/src/automations/draft/automation-draft-service.js +1 -1
- package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -2
- package/dist/src/automations/index.js +2 -2
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/capabilities/store-connector.js +2 -2
- package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
- package/dist/src/channels/index.js +2 -2
- package/dist/src/channels/outbound-sender.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +9 -9
- package/dist/src/channels/pairing/pairing-store.js +6 -6
- package/dist/src/chat-commands/builtins/config.js +4 -4
- package/dist/src/chat-commands/builtins/session.js +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +1 -1
- package/dist/src/chat-commands/builtins/tts.js +1 -1
- package/dist/src/chat-commands/context.js +2 -2
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +7 -7
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -1
- package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/extension.js +2 -2
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/mcp.js +1 -1
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard/channels/registry.js +1 -1
- package/dist/src/cli/commands/onboard/model.d.ts +1 -1
- package/dist/src/cli/commands/onboard/model.js +21 -2
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +1 -1
- package/dist/src/cli/commands/skills.js +2 -2
- package/dist/src/cli/commands/tunnel.js +4 -4
- package/dist/src/cli/extension-cli-register.js +6 -6
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/cli/utils/session.js +1 -1
- package/dist/src/computer/runtime.js +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +7 -1
- package/dist/src/config/schema.js +7 -5
- package/dist/src/connectors/cli/authorization.js +1 -1
- package/dist/src/connectors/cli/runtime.js +1 -1
- package/dist/src/connectors/composio-sessions.js +1 -1
- package/dist/src/connectors/composio.js +1 -1
- package/dist/src/connectors/connected-source-ingestion.js +4 -4
- package/dist/src/connectors/connected-source-understanding.js +4 -4
- package/dist/src/connectors/connection-recovery-service.js +4 -4
- package/dist/src/connectors/content-enrichment.js +1 -1
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/connectors/learning-coordinator.js +1 -1
- package/dist/src/discussions/live-worker.js +1 -1
- package/dist/src/discussions/sealer.js +1 -1
- package/dist/src/endpoint-tools/index.js +1 -1
- package/dist/src/endpoint-tools/runtime.js +2 -2
- package/dist/src/extensions/activation-context.js +3 -3
- package/dist/src/extensions/agent-plugins/auth.js +1 -1
- package/dist/src/extensions/agent-plugins/credentials.js +1 -1
- package/dist/src/extensions/agent-plugins/source-http-fetch.js +1 -1
- package/dist/src/extensions/api.js +4 -4
- package/dist/src/extensions/bundled-extension-activation.js +1 -1
- package/dist/src/extensions/index.js +3 -3
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/loader.js +2 -2
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/extensions/sdk/media.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +2 -2
- package/dist/src/gateway/chat-stream/protocol.d.ts +2 -3
- package/dist/src/gateway/clarify-runtime.d.ts +2 -0
- package/dist/src/gateway/clarify-runtime.js +4 -1
- package/dist/src/gateway/device-routes.js +2 -2
- package/dist/src/gateway/ephemeral-clarification-waiter.d.ts +2 -1
- package/dist/src/gateway/ephemeral-clarification-waiter.js +19 -6
- package/dist/src/gateway/file-path-classifier.js +2 -2
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/app.js +3 -3
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +4 -4
- package/dist/src/gateway/hono/lib/config-write-lock.d.ts +2 -0
- package/dist/src/gateway/hono/lib/config-write-lock.js +14 -0
- package/dist/src/gateway/hono/routes/agent-stream.js +4 -9
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +4 -4
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +4 -4
- package/dist/src/gateway/hono/routes/config.js +7 -5
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/context-sources.js +2 -2
- package/dist/src/gateway/hono/routes/endpoint-tools.js +1 -1
- package/dist/src/gateway/hono/routes/home.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +74 -7
- package/dist/src/gateway/hono/routes/memory-learning.js +3 -3
- package/dist/src/gateway/hono/routes/models.js +5 -5
- package/dist/src/gateway/hono/routes/notes.js +1 -1
- package/dist/src/gateway/hono/routes/personal-agent.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +3 -3
- package/dist/src/gateway/hono/routes/runtime-tools.js +1 -1
- package/dist/src/gateway/hono/routes/session-command-handler.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +5 -5
- package/dist/src/gateway/hono/routes/sessions.js +3 -3
- package/dist/src/gateway/hono/routes/shares.js +2 -2
- package/dist/src/gateway/hono/routes/side-chats.js +5 -4
- package/dist/src/gateway/hono/routes/site-shares.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
- package/dist/src/gateway/hono/routes/user-model.js +7 -7
- package/dist/src/gateway/hono/routes/voice.js +7 -7
- package/dist/src/gateway/hono/routes/workflows.js +1 -1
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/lock.js +11 -11
- package/dist/src/gateway/media-access.js +1 -1
- package/dist/src/gateway/mobile-privacy.js +2 -2
- package/dist/src/gateway/ports.js +6 -6
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/scenes/mailContext.js +1 -1
- package/dist/src/gateway/scenes/slackThreadSource.js +1 -1
- package/dist/src/gateway/server.js +1 -1
- package/dist/src/gateway/service/agent-runner.d.ts +5 -4
- package/dist/src/gateway/service/agent-runner.js +35 -19
- package/dist/src/gateway/service/config-coordinator.d.ts +619 -1
- package/dist/src/gateway/service/config-coordinator.js +38 -26
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +4 -4
- package/dist/src/gateway/service/session-command-service.js +2 -2
- package/dist/src/gateway/service.d.ts +6 -3
- package/dist/src/gateway/service.js +45 -44
- package/dist/src/gateway/session-context-summary.js +4 -4
- package/dist/src/gateway/side-chat/run-service.d.ts +2 -1
- package/dist/src/gateway/side-chat/run-service.js +6 -3
- package/dist/src/gateway/side-chat/types.d.ts +3 -3
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +2 -2
- package/dist/src/gateway/xopc-cloud-capability-setup.js +7 -4
- package/dist/src/home-intelligence/generator.js +2 -2
- package/dist/src/imports/compatibility.js +1 -1
- package/dist/src/imports/inventory.js +3 -3
- package/dist/src/imports/productImport.js +2 -2
- package/dist/src/imports/runtime.js +1 -1
- package/dist/src/infra/gateway-processes.js +2 -2
- package/dist/src/infra/path-env.js +3 -3
- package/dist/src/infra/update-global.js +9 -9
- package/dist/src/knowledge/connected-knowledge-pipeline.js +2 -2
- package/dist/src/knowledge/index.js +1 -1
- package/dist/src/knowledge-memory/repository.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-understanding/openai-compatible-audio.js +1 -1
- package/dist/src/memory-learning/service.js +3 -2
- package/dist/src/memory-learning/source-learning.js +4 -4
- package/dist/src/memory-learning/task-receipts.js +1 -1
- package/dist/src/notes/agent-context.js +4 -4
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/service.js +3 -3
- package/dist/src/personal-agent/capability-service.js +2 -2
- package/dist/src/personal-agent/proactivity/routes.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +7 -7
- package/dist/src/personal-agent/prompt-context.js +7 -7
- package/dist/src/personal-agent/prompts.js +1 -1
- package/dist/src/personal-agent/reply-composer.js +9 -9
- package/dist/src/personal-agent/request-delivery.js +2 -2
- package/dist/src/personal-agent/request-service.js +6 -6
- 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/platform/index.js +1 -1
- package/dist/src/projects/index.js +1 -1
- package/dist/src/projects/project-agent-suggestion.js +1 -1
- package/dist/src/projects/project-service.js +1 -1
- package/dist/src/projects/project-skill-service.js +2 -2
- package/dist/src/projects/workspace.js +1 -1
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/realtime/runtime.js +1 -1
- package/dist/src/remote-access/exposure-manager.js +1 -1
- package/dist/src/routing/agent-session-key.js +1 -1
- package/dist/src/scenes/execution.d.ts +1 -1
- package/dist/src/scenes/taskFollowUp/agentExecutor.js +4 -4
- package/dist/src/scenes/taskFollowUp/contracts.d.ts +2 -2
- package/dist/src/scenes/taskFollowUp/resources.js +2 -2
- package/dist/src/scenes/taskFollowUp/service.d.ts +5 -5
- package/dist/src/scenes/taskFollowUp/service.js +6 -6
- package/dist/src/scenes/templates.d.ts +2 -2
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/init-session-turn.js +1 -1
- package/dist/src/session/resolve-session.js +1 -1
- package/dist/src/session/store.js +5 -5
- package/dist/src/session/thinking-resolve.js +1 -1
- package/dist/src/share/hosted-session-share.js +2 -2
- package/dist/src/share/session-share-service.js +1 -1
- package/dist/src/share/share-store.js +1 -1
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/clarification-wait-repository.d.ts +3 -5
- package/dist/src/storage/sqlite/clarification-wait-repository.js +48 -28
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/tasks/capabilities/management.d.ts +2 -2
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/relations.d.ts +6 -6
- package/dist/src/tasks/capabilities/write.d.ts +6 -6
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tasks/home-query-service.js +2 -2
- package/dist/src/tasks/index.js +4 -4
- package/dist/src/tasks/task-allocation-service.js +5 -5
- package/dist/src/tasks/task-application-service.js +6 -6
- package/dist/src/tasks/task-collaboration-delivery.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +2 -2
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-handoff.js +5 -5
- package/dist/src/tasks/task-main-update-decision-service.js +3 -3
- package/dist/src/tasks/task-model-call.js +1 -1
- package/dist/src/tasks/task-research-result.js +4 -4
- package/dist/src/tasks/task-result-delivery-repository.js +1 -1
- package/dist/src/tasks/task-result-delivery-service.js +2 -2
- 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 +13 -13
- package/dist/src/tui/backends/gateway-realtime-backend.js +2 -2
- package/dist/src/tui/extension-host/load-extensions.js +2 -2
- package/dist/src/tui/tui-agent-events.js +1 -1
- package/dist/src/tui/tui-commands.js +5 -5
- package/dist/src/tui/tui-picker-overlay.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +4 -4
- package/dist/src/tui/tui.js +6 -6
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/user-context/access-policy.js +2 -2
- package/dist/src/user-context/config.d.ts +2 -2
- package/dist/src/user-model/bootstrap.js +1 -1
- package/dist/src/user-model/capture/executor.js +1 -1
- package/dist/src/user-model/capture/semantic.d.ts +8 -1
- package/dist/src/user-model/capture/semantic.js +26 -5
- package/dist/src/user-model/index.js +2 -2
- package/dist/src/voice/realtime/agentEngine.js +4 -2
- package/dist/src/voice/realtime/memory-context.js +7 -7
- package/dist/src/voice/realtime/omniEngine.js +2 -2
- package/dist/src/voice/realtime/runtime.js +4 -4
- package/dist/src/voice/stt/index.js +2 -2
- package/dist/src/voice/stt/preflight.js +1 -1
- package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
- package/dist/src/voice/stt/transcribe-core.js +1 -1
- package/dist/src/voice/tts/index.js +3 -3
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/payload.js +1 -1
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
- package/dist/src/voice/tts/speak-core.js +1 -1
- package/dist/src/work-discovery/incremental-repository.js +1 -1
- package/dist/src/work-discovery/service.js +7 -7
- package/dist/src/workflows/context/workflow-context.js +1 -1
- package/dist/src/workflows/engine/workflow-engine.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +7 -7
- package/dist/src/workflows/service/workflow-session-bridge.js +2 -2
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/connectors-page-BZk-Gou5.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BVriF6Zj.js +0 -1
- package/dist/gateway/static/root/assets/index-DBRwvWzm.css +0 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-i9N5shss.js +0 -1
- package/dist/gateway/static/root/assets/messages-DTqbfje6.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-cache-Ct6X5zmB.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-COd9RECl.js +0 -16
- package/dist/gateway/static/root/assets/settings-advanced-gate-Dtlsvsci.js +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/agent/mcp/credential-store.ts
|
|
2
|
+
/** Use pi's own stores; never change PI_CODING_AGENT_DIR for an individual connection. */
|
|
3
|
+
async function createNativeMcpCredentials(memory = false) {
|
|
4
|
+
const root = import.meta.resolve("@earendil-works/pi-coding-agent");
|
|
5
|
+
const { McpOAuthCredentialStore } = await import(new URL("./extensions/mcp/oauth.js", root).href);
|
|
6
|
+
if (!memory) return new McpOAuthCredentialStore();
|
|
7
|
+
const { InMemoryAuthStorageBackend } = await import(new URL("./core/auth-storage.js", root).href);
|
|
8
|
+
return new McpOAuthCredentialStore(new InMemoryAuthStorageBackend());
|
|
9
|
+
}
|
|
10
|
+
/** Credential identity may change on commit without changing the public tool namespace. */
|
|
11
|
+
function routeNativeMcpCredentials(store, aliases) {
|
|
12
|
+
const forServer = store.forServer.bind(store), tokens = store.tokens.bind(store), remove = store.remove.bind(store);
|
|
13
|
+
store.forServer = (name, url) => forServer(aliases.get(name) ?? name, url);
|
|
14
|
+
store.tokens = (name, url) => tokens(aliases.get(name) ?? name, url);
|
|
15
|
+
store.remove = (name, url) => {
|
|
16
|
+
const alias = aliases.get(name);
|
|
17
|
+
if (!alias) return remove(name, url);
|
|
18
|
+
forServer(alias, url).save({ serverUrl: url });
|
|
19
|
+
return true;
|
|
20
|
+
};
|
|
21
|
+
return store;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { createNativeMcpCredentials, routeNativeMcpCredentials };
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { type LoadedMcpConfig } from '@earendil-works/pi-coding-agent';
|
|
2
2
|
import { type Config } from '../../config/schema.js';
|
|
3
|
+
import { type NativeMcpCredentials } from './credential-store.js';
|
|
3
4
|
/** One process-wide pi directory: sessions share native OAuth credentials, never swap roots per turn. */
|
|
4
5
|
export declare function getNativePiAgentDir(): string;
|
|
6
|
+
export type NativeMcpConfig = LoadedMcpConfig & {
|
|
7
|
+
credentials?: NativeMcpCredentials;
|
|
8
|
+
credentialAliases?: Record<string, string>;
|
|
9
|
+
};
|
|
5
10
|
/** Only projects host configuration and secret references; all MCP execution belongs to pi. */
|
|
6
|
-
export declare function prepareNativeMcpConfig(config: Config, workspaceDir: string): Promise<
|
|
11
|
+
export declare function prepareNativeMcpConfig(config: Config, workspaceDir: string): Promise<NativeMcpConfig>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../../config/paths-state.js";
|
|
2
2
|
import { McpServerSchema, init_schema } from "../../config/schema.js";
|
|
3
3
|
import { resolveConnectorSecretReferences } from "../../connectors/secret-store.js";
|
|
4
|
+
import { createNativeMcpCredentials, routeNativeMcpCredentials } from "./credential-store.js";
|
|
4
5
|
import { loadMergedMcpConfig } from "./config.js";
|
|
5
6
|
import { join } from "node:path";
|
|
6
7
|
import { mkdirSync } from "node:fs";
|
|
@@ -67,6 +68,11 @@ async function prepareNativeMcpConfig(config, workspaceDir) {
|
|
|
67
68
|
scope: "extension"
|
|
68
69
|
});
|
|
69
70
|
}
|
|
71
|
+
const aliases = new Map(Object.entries(config.mcp?.servers ?? {}).filter(([, value]) => typeof value.xopcOAuthCredentialId === "string").map(([name, value]) => [name, value.xopcOAuthCredentialId]));
|
|
72
|
+
if (aliases.size) {
|
|
73
|
+
result.credentials = routeNativeMcpCredentials(await createNativeMcpCredentials(), aliases);
|
|
74
|
+
result.credentialAliases = Object.fromEntries(aliases);
|
|
75
|
+
}
|
|
70
76
|
return result;
|
|
71
77
|
}
|
|
72
78
|
//#endregion
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Config } from '../../config/schema.js';
|
|
2
|
+
import type { NativeMcpCredentials } from './credential-store.js';
|
|
2
3
|
export type McpCatalogTool = {
|
|
3
4
|
name: string;
|
|
4
5
|
description: string;
|
|
@@ -12,7 +13,11 @@ export type McpLoginInteraction = {
|
|
|
12
13
|
onAuthorizationUrl: (url: string) => void;
|
|
13
14
|
requestRedirectUrl: (signal?: AbortSignal) => Promise<string | undefined>;
|
|
14
15
|
};
|
|
16
|
+
export type McpSessionOptions = {
|
|
17
|
+
credentials?: NativeMcpCredentials;
|
|
18
|
+
signal?: AbortSignal;
|
|
19
|
+
};
|
|
15
20
|
/** 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[]>;
|
|
21
|
+
export declare function discoverMcpTools(config: Config, workspaceDir: string, serverId: string, options?: McpSessionOptions): Promise<McpCatalogTool[]>;
|
|
17
22
|
/** 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[]>;
|
|
23
|
+
export declare function signInNativeMcp(config: Config, workspaceDir: string, serverId: string, interaction: McpLoginInteraction, options?: McpSessionOptions): Promise<McpCatalogTool[]>;
|
|
@@ -6,15 +6,19 @@ import { DefaultResourceLoader, ModelRuntime, SessionManager, SettingsManager, c
|
|
|
6
6
|
//#region src/agent/mcp/tool-catalog.ts
|
|
7
7
|
var McpAuthenticationRequiredError = class extends Error {};
|
|
8
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);
|
|
9
|
+
async function discoverMcpTools(config, workspaceDir, serverId, options) {
|
|
10
|
+
return runNativeMcpSession(config, workspaceDir, serverId, void 0, options);
|
|
11
11
|
}
|
|
12
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);
|
|
13
|
+
async function signInNativeMcp(config, workspaceDir, serverId, interaction, options) {
|
|
14
|
+
return runNativeMcpSession(config, workspaceDir, serverId, interaction, options);
|
|
15
15
|
}
|
|
16
|
-
async function runNativeMcpSession(config, workspaceDir, serverId, interaction) {
|
|
17
|
-
const
|
|
16
|
+
async function runNativeMcpSession(config, workspaceDir, serverId, interaction, options) {
|
|
17
|
+
const signal = interaction?.signal ?? options?.signal;
|
|
18
|
+
signal?.throwIfAborted();
|
|
19
|
+
const loaded = await prepareNativeMcpConfig(config, workspaceDir);
|
|
20
|
+
signal?.throwIfAborted();
|
|
21
|
+
const entry = loaded.servers.find((server) => server.name === serverId);
|
|
18
22
|
if (!entry) throw new Error(`MCP server "${serverId}" is not configured or has invalid configuration.`);
|
|
19
23
|
if (entry.config.enabled === false) throw new Error(`MCP server "${serverId}" is disabled.`);
|
|
20
24
|
const agentDir = getNativePiAgentDir();
|
|
@@ -32,6 +36,7 @@ async function runNativeMcpSession(config, workspaceDir, serverId, interaction)
|
|
|
32
36
|
noThemes: true,
|
|
33
37
|
noContextFiles: true,
|
|
34
38
|
extensionFactories: [createToolSearchExtension(), createMcpExtension({
|
|
39
|
+
credentials: options?.credentials ?? loaded.credentials,
|
|
35
40
|
loadConfig: () => ({
|
|
36
41
|
servers: [entry],
|
|
37
42
|
errors: [],
|
|
@@ -42,18 +47,21 @@ async function runNativeMcpSession(config, workspaceDir, serverId, interaction)
|
|
|
42
47
|
})]
|
|
43
48
|
});
|
|
44
49
|
await loader.reload();
|
|
50
|
+
signal?.throwIfAborted();
|
|
45
51
|
const provider = "url" in entry.config ? entry.config.auth?.provider : void 0;
|
|
52
|
+
const modelRuntime = provider ? await createEmbeddedModelRuntime(provider) : await ModelRuntime.create({
|
|
53
|
+
credentials: new InMemoryCredentialStore(),
|
|
54
|
+
modelsStore: new InMemoryModelsStore(),
|
|
55
|
+
modelsPath: null,
|
|
56
|
+
refreshOnCreate: false
|
|
57
|
+
});
|
|
58
|
+
signal?.throwIfAborted();
|
|
46
59
|
const { session } = await createAgentSession({
|
|
47
60
|
cwd: workspaceDir,
|
|
48
61
|
agentDir,
|
|
49
62
|
resourceLoader: loader,
|
|
50
63
|
settingsManager,
|
|
51
|
-
modelRuntime
|
|
52
|
-
credentials: new InMemoryCredentialStore(),
|
|
53
|
-
modelsStore: new InMemoryModelsStore(),
|
|
54
|
-
modelsPath: null,
|
|
55
|
-
refreshOnCreate: false
|
|
56
|
-
}),
|
|
64
|
+
modelRuntime,
|
|
57
65
|
sessionManager: SessionManager.inMemory(),
|
|
58
66
|
noTools: "builtin"
|
|
59
67
|
});
|
|
@@ -70,6 +78,8 @@ async function runNativeMcpSession(config, workspaceDir, serverId, interaction)
|
|
|
70
78
|
try {
|
|
71
79
|
const runner = session.extensionRunner;
|
|
72
80
|
if (!runner) throw new Error("Native MCP extension is unavailable.");
|
|
81
|
+
signal?.throwIfAborted();
|
|
82
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
73
83
|
await session.bindExtensions({ uiContext: {
|
|
74
84
|
...runner.getUIContext(),
|
|
75
85
|
notify(message) {
|
|
@@ -81,8 +91,7 @@ async function runNativeMcpSession(config, workspaceDir, serverId, interaction)
|
|
|
81
91
|
return interaction?.requestRedirectUrl(options?.signal) ?? Promise.resolve(void 0);
|
|
82
92
|
}
|
|
83
93
|
} });
|
|
84
|
-
|
|
85
|
-
if (interaction?.signal.aborted) throw new Error("MCP sign-in cancelled.");
|
|
94
|
+
if (signal?.aborted) throw new Error("MCP sign-in cancelled.");
|
|
86
95
|
let timer;
|
|
87
96
|
try {
|
|
88
97
|
await Promise.race([session.prompt("/mcp"), new Promise((_resolve, reject) => {
|
|
@@ -100,6 +109,7 @@ async function runNativeMcpSession(config, workspaceDir, serverId, interaction)
|
|
|
100
109
|
if (/needs sign-in|needs-auth/.test(failure)) throw new McpAuthenticationRequiredError(failure);
|
|
101
110
|
throw new Error(failure);
|
|
102
111
|
}
|
|
112
|
+
if (signal?.aborted) throw new Error("MCP connection check cancelled.");
|
|
103
113
|
const namespace = `mcp__${serverId.replace(/-/g, "_")}`;
|
|
104
114
|
return session.getAllTools().filter((tool) => tool.namespace?.name === namespace).map((tool) => ({
|
|
105
115
|
name: tool.name,
|
|
@@ -109,7 +119,7 @@ async function runNativeMcpSession(config, workspaceDir, serverId, interaction)
|
|
|
109
119
|
})).sort((a, b) => a.name.localeCompare(b.name));
|
|
110
120
|
} finally {
|
|
111
121
|
try {
|
|
112
|
-
|
|
122
|
+
signal?.removeEventListener("abort", abort);
|
|
113
123
|
await close();
|
|
114
124
|
} finally {
|
|
115
125
|
session.dispose();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getToolResultTextLength, truncateToolResultMessage } from "../embedded/tool-result-truncation.js";
|
|
2
1
|
import { readAgentMessageContent } from "./agent-message-access.js";
|
|
2
|
+
import { getToolResultTextLength, truncateToolResultMessage } from "../embedded/tool-result-truncation.js";
|
|
3
3
|
//#region src/agent/memory/context-budget.ts
|
|
4
4
|
const MESSAGE_OVERHEAD_TOKENS = 12;
|
|
5
5
|
const REQUEST_OVERHEAD_TOKENS = 256;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { evaluateContextBudget, projectContextForModel, stringifyMessagesForBudget } from "./context-budget.js";
|
|
4
3
|
import { stripTrailingErrorAssistantMessages } from "../orchestration/llm-turn-retry.js";
|
|
4
|
+
import { evaluateContextBudget, projectContextForModel, stringifyMessagesForBudget } from "./context-budget.js";
|
|
5
5
|
//#region src/agent/memory/context-recovery.ts
|
|
6
6
|
init_logger();
|
|
7
7
|
const log = createLogger("ContextRecovery");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { buildUserContextBlock, sanitizeUserContextFenceEscapes } from "./context-fence.js";
|
|
2
1
|
import { isMemorySubsystemEnabled } from "./memory-config.js";
|
|
3
2
|
import { extractAgentUserPlainText } from "./user-message-text.js";
|
|
3
|
+
import { buildUserContextBlock, sanitizeUserContextFenceEscapes } from "./context-fence.js";
|
|
4
4
|
import { MemoryManager } from "./manager.js";
|
|
5
5
|
import { discoverMemoryPlugins } from "./plugin-discovery.js";
|
|
6
6
|
import { createMemoryManagerFromConfig } from "./create-memory-manager.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isTransientProviderErrorMessage } from "../../providers/model-response.js";
|
|
2
|
-
import { canResumeAfterModelFailure } from "./turn-recovery.js";
|
|
3
2
|
import { isContextOverflowError } from "./context-overflow.js";
|
|
3
|
+
import { canResumeAfterModelFailure } from "./turn-recovery.js";
|
|
4
4
|
//#region src/agent/orchestration/llm-turn-retry.ts
|
|
5
5
|
function isTransientLlmErrorMessage(message) {
|
|
6
6
|
return isTransientProviderErrorMessage(message);
|
|
@@ -2,9 +2,9 @@ import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
|
|
|
2
2
|
import { TaskRepository, init_task_repository } from "../../tasks/task-repository.js";
|
|
3
3
|
import { getSessionConfig } from "../../storage/sqlite/config-repository.js";
|
|
4
4
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
5
|
+
import { init_response_language, resolveResponseLanguage } from "../../i18n/response-language.js";
|
|
5
6
|
import { resolveTaskLocale } from "../../tasks/task-language.js";
|
|
6
7
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
7
|
-
import { init_response_language, resolveResponseLanguage } from "../../i18n/response-language.js";
|
|
8
8
|
//#region src/agent/prompt/response-language.ts
|
|
9
9
|
init_response_language();
|
|
10
10
|
init_sqlite();
|
|
@@ -6,14 +6,14 @@ import { getInteractionState } from "../../storage/sqlite/interaction-state-repo
|
|
|
6
6
|
import { DEFAULT_USER_TRUST_LEVEL, init_trust_policy } from "../../user-context/trust-policy.js";
|
|
7
7
|
import { getUserTrustPolicy } from "../../storage/sqlite/user-trust-repository.js";
|
|
8
8
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
9
|
+
import { appendStablePromptSection } from "./cache-boundary.js";
|
|
9
10
|
import { getUserTimezone } from "../../user-model/repository.js";
|
|
10
11
|
import "../../user-model/index.js";
|
|
11
|
-
import { appendStablePromptSection } from "./cache-boundary.js";
|
|
12
|
-
import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
|
|
13
|
-
import { buildTtsSystemPromptHint } from "../../voice/tts/directives.js";
|
|
14
12
|
import { resolveSystemPromptBuildParams } from "./system-prompt-params.js";
|
|
15
13
|
import { buildSystemPrompt } from "./system-prompt.js";
|
|
16
14
|
import { resolveResponseLanguageForSession } from "./response-language.js";
|
|
15
|
+
import { buildTtsSystemPromptHint } from "../../voice/tts/directives.js";
|
|
16
|
+
import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
|
|
17
17
|
//#region src/agent/prompt/service-prompt-builder.ts
|
|
18
18
|
init_sqlite();
|
|
19
19
|
init_interaction_state();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { prepareSafeToolEnv } from "./sanitize-env-vars.js";
|
|
4
3
|
import { validatePath, validateWritePath } from "./path-policy.js";
|
|
4
|
+
import { prepareSafeToolEnv } from "./sanitize-env-vars.js";
|
|
5
5
|
import { auditCommand, validateCommand } from "./command-validator.js";
|
|
6
6
|
import { DEFAULT_SANDBOX_CONFIG } from "./types.js";
|
|
7
7
|
import { resolve } from "node:path";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { getClarificationResumeInput, init_clarification_wait_repository } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
2
2
|
import { getConnectionResumeInput, init_connection_wait_repository } from "../../storage/sqlite/connection-wait-repository.js";
|
|
3
3
|
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
4
|
+
import { resolveImageHandlingStrategy } from "../image/vision-detection.js";
|
|
5
|
+
import { hydrateUserTurnForLlm } from "../inbound/attachment-pipeline.js";
|
|
6
|
+
import { buildDelegatedTaskDirective, buildTaskExecutionDirective } from "../../tasks/task-context-assembler.js";
|
|
7
|
+
import { shouldSkipResetOverlapCommand } from "../../session/reset-triggers.js";
|
|
4
8
|
import { parseSlashCommand } from "../../chat-commands/command-parse.js";
|
|
5
9
|
import { personalCommandRejection } from "../../chat-commands/personal-command-policy.js";
|
|
6
10
|
import { commandRegistry } from "../../chat-commands/registry.js";
|
|
7
11
|
import "../../chat-commands/index.js";
|
|
8
|
-
import { resolveImageHandlingStrategy } from "../image/vision-detection.js";
|
|
9
|
-
import { hydrateUserTurnForLlm } from "../inbound/attachment-pipeline.js";
|
|
10
|
-
import { shouldSkipResetOverlapCommand } from "../../session/reset-triggers.js";
|
|
11
12
|
import { getTaskContinuation } from "../../tasks/task-continuation.js";
|
|
12
13
|
import { runEmbeddedTurnForSession } from "../embedded/run-for-session.js";
|
|
13
14
|
import { injectSourceContextsIntoUserMessage } from "../source-context/injector.js";
|
|
14
|
-
import { buildDelegatedTaskDirective, buildTaskExecutionDirective } from "../../tasks/task-context-assembler.js";
|
|
15
15
|
import crypto from "node:crypto";
|
|
16
16
|
//#region src/agent/service/direct-turn-helpers.ts
|
|
17
17
|
/**
|
|
@@ -5,20 +5,20 @@ import { getClarificationResumeInput, init_clarification_wait_repository } from
|
|
|
5
5
|
import { getConnectionResumeInput, init_connection_wait_repository } from "../../storage/sqlite/connection-wait-repository.js";
|
|
6
6
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
7
7
|
import { init_agent_session_key, resolveAgentMainConversationId } from "../../routing/agent-session-key.js";
|
|
8
|
-
import { isSessionSourceBinding, summarizeSourceContext } from "../source-context/types.js";
|
|
9
|
-
import { stripEnvelopeTimestampPrefix } from "../../channels/envelope-timestamp.js";
|
|
10
|
-
import { mergeSttConfigFromAppConfig } from "../../voice/stt/config.js";
|
|
11
|
-
import "../../voice/stt/index.js";
|
|
12
|
-
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
13
8
|
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
9
|
+
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
14
10
|
import { clearPendingTranscriptUserMessage, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
11
|
+
import { mergeSttConfigFromAppConfig } from "../../voice/stt/config.js";
|
|
12
|
+
import "../../voice/stt/index.js";
|
|
13
|
+
import { isSessionSourceBinding, summarizeSourceContext } from "../source-context/types.js";
|
|
14
|
+
import { formatAgentRunErrorForClient } from "../client-error-format.js";
|
|
15
15
|
import { resolveConfiguredActivityDetailDefault, resolveEffectiveReasoningLevel } from "../../session/thinking-resolve.js";
|
|
16
16
|
import { initSessionTurn } from "../../session/init-session-turn.js";
|
|
17
17
|
import "../../session/index.js";
|
|
18
18
|
import { getTaskContinuation } from "../../tasks/task-continuation.js";
|
|
19
|
+
import { stripEnvelopeTimestampPrefix } from "../../channels/envelope-timestamp.js";
|
|
19
20
|
import { isVoiceLikeAttachment, mergeVoiceTranscriptsIntoUserText, requestsOriginalVoiceInspection } from "../../channels/attachments/voice-stt-webchat.js";
|
|
20
21
|
import { applyReasoningVisibility } from "../streaming/reasoning-visibility.js";
|
|
21
|
-
import { formatAgentRunErrorForClient } from "../client-error-format.js";
|
|
22
22
|
import { injectSourceContextsIntoUserMessage } from "../source-context/injector.js";
|
|
23
23
|
import { AsyncQueue, AsyncQueueOverflowError } from "./async-queue.js";
|
|
24
24
|
import { hydratePerTurnState, runDirectAgentTurn, tryRunSlashCommand } from "./direct-turn-helpers.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { appendMediaToAssistantTranscriptEntry, findLatestAssistantTranscriptEntryId } from "../../storage/sqlite/transcript-repository.js";
|
|
2
2
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
3
3
|
import { isTTSAvailable } from "../../voice/tts/factory.js";
|
|
4
|
+
import { speak } from "../../voice/tts/speak-core.js";
|
|
4
5
|
import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
|
|
5
6
|
import { getChannelOutputFormat, shouldUseTTS } from "../../voice/tts/service.js";
|
|
6
|
-
import { speak } from "../../voice/tts/speak-core.js";
|
|
7
7
|
import { compressAudio } from "../../voice/tts/audio.js";
|
|
8
|
-
import "../../voice/tts/index.js";
|
|
9
8
|
import { persistOutboundTtsAudio } from "../../channels/attachments/outbound-tts-persist.js";
|
|
9
|
+
import "../../voice/tts/index.js";
|
|
10
10
|
import { deleteMediaUris } from "../../media/session-references.js";
|
|
11
11
|
//#region src/agent/service/webchat-tts.ts
|
|
12
12
|
init_sqlite();
|
|
@@ -3,37 +3,43 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { init_attachment_ref, parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
|
|
4
4
|
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
5
5
|
import { extractTextContent } from "./context/workspace.js";
|
|
6
|
-
import { onSessionTranscriptUpdate } from "../session/transcript-events.js";
|
|
7
|
-
import { getUserTimezone } from "../user-model/repository.js";
|
|
8
6
|
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
9
|
-
import "../user-model/index.js";
|
|
10
|
-
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "./skills/workspace-skills-dir.js";
|
|
11
|
-
import { removeSkillsLockEntry } from "./skills/hub-lock.js";
|
|
12
|
-
import { installSkillFromZip } from "./skills/managed-store.js";
|
|
13
|
-
import { pullSkillFromSource } from "./skills/hub-pull.js";
|
|
14
7
|
import { extractProfileAgentId, resolveEffectiveAgentConfigForSession } from "../config/agent-profile.js";
|
|
15
|
-
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
16
|
-
import { getProjectForSession } from "../projects/workspace.js";
|
|
17
8
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
18
9
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
19
10
|
import { configureTracing, flushTracing } from "../observability/runtime.js";
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
11
|
+
import { getUserTimezone } from "../user-model/repository.js";
|
|
12
|
+
import { resolveAgentTurnTimeoutMs } from "./orchestration/run-agent-turn-with-timeout.js";
|
|
22
13
|
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
23
|
-
import {
|
|
24
|
-
import "../
|
|
25
|
-
import
|
|
14
|
+
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
15
|
+
import { getProjectForSession } from "../projects/workspace.js";
|
|
16
|
+
import "../user-model/index.js";
|
|
17
|
+
import { onSessionTranscriptUpdate } from "../session/transcript-events.js";
|
|
18
|
+
import { runWithEmbeddedExecutionSession } from "./embedded/execution-context.js";
|
|
19
|
+
import { removeSkillsLockEntry } from "./skills/hub-lock.js";
|
|
20
|
+
import { installSkillFromZip } from "./skills/managed-store.js";
|
|
21
|
+
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "./skills/workspace-skills-dir.js";
|
|
22
|
+
import { pullSkillFromSource } from "./skills/hub-pull.js";
|
|
26
23
|
import { persistInboundAttachments } from "../channels/attachments/inbound-persist.js";
|
|
27
24
|
import { buildTranscriptUserMessage, hydrateUserTurnForLlm } from "./inbound/attachment-pipeline.js";
|
|
28
25
|
import { drainEmbeddedSessionRunnerShutdowns } from "./embedded/session-runner.js";
|
|
29
|
-
import { maybeRefineSessionTitleWithLlm, maybeSetProvisionalSessionTitle } from "../session/session-title.js";
|
|
30
26
|
import { resolveCompactionPolicy } from "./memory/compaction-policy.js";
|
|
27
|
+
import { getModelThinking } from "../providers/model-thinking.js";
|
|
28
|
+
import { runXopcEmbeddedTurn } from "./embedded/run-turn.js";
|
|
29
|
+
import { resolveResponseLanguageForSession } from "./prompt/response-language.js";
|
|
30
|
+
import { normalizeSkillInstallTarget } from "./skills/install-target.js";
|
|
31
|
+
import { AgentManager } from "./agent-manager.js";
|
|
32
|
+
import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../gateway/chat-limits.js";
|
|
33
|
+
import { maybeRefineSessionTitleWithLlm, maybeSetProvisionalSessionTitle } from "../session/session-title.js";
|
|
31
34
|
import { SessionStore } from "../session/store.js";
|
|
32
35
|
import { SessionConfigStore } from "../session/config-store.js";
|
|
33
36
|
import "../session/index.js";
|
|
37
|
+
import { ExtensionHookRunner } from "../extensions/hooks.js";
|
|
38
|
+
import "../extensions/index.js";
|
|
34
39
|
import { SessionTracker } from "./session/tracker.js";
|
|
35
40
|
import { ModelManager } from "./models/manager.js";
|
|
36
41
|
import "./models/index.js";
|
|
42
|
+
import { initializeCommands } from "../chat-commands/index.js";
|
|
37
43
|
import { HookHandler } from "./lifecycle/hook-handler.js";
|
|
38
44
|
import { ToolErrorTracker } from "./tools/error-tracker.js";
|
|
39
45
|
import { RequestLimiter } from "./models/request-limiter.js";
|
|
@@ -45,9 +51,6 @@ import { ContextMiddleware } from "./middleware/context.js";
|
|
|
45
51
|
import "./middleware/index.js";
|
|
46
52
|
import { LifecycleManager } from "./lifecycle/manager.js";
|
|
47
53
|
import "./lifecycle/index.js";
|
|
48
|
-
import { resolveAgentTurnTimeoutMs } from "./orchestration/run-agent-turn-with-timeout.js";
|
|
49
|
-
import { getModelThinking } from "../providers/model-thinking.js";
|
|
50
|
-
import { runXopcEmbeddedTurn } from "./embedded/run-turn.js";
|
|
51
54
|
import { MessageRouter } from "./messaging/message-router.js";
|
|
52
55
|
import { CommandHandler } from "./messaging/command-handler.js";
|
|
53
56
|
import { StreamManager } from "./messaging/stream-manager.js";
|
|
@@ -66,10 +69,7 @@ import { AgentOrchestrator } from "./orchestration/agent-orchestrator.js";
|
|
|
66
69
|
import { AgentEventHandler } from "./orchestration/agent-event-handler.js";
|
|
67
70
|
import "./orchestration/index.js";
|
|
68
71
|
import { getWorkflowProgressBroker } from "./workflow/progress-broker.js";
|
|
69
|
-
import { resolveResponseLanguageForSession } from "./prompt/response-language.js";
|
|
70
72
|
import "./workflow/index.js";
|
|
71
|
-
import { normalizeSkillInstallTarget } from "./skills/install-target.js";
|
|
72
|
-
import { AgentManager } from "./agent-manager.js";
|
|
73
73
|
import { TaskJudgeService } from "./tasks/task-judge-service.js";
|
|
74
74
|
import { analyzeResponseLanguage } from "../i18n/language-consistency.js";
|
|
75
75
|
import { readFile } from "node:fs/promises";
|
|
@@ -2,14 +2,14 @@ import { createLogger } from "../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { chooseModelThinking } from "../../../packages/gateway-contract/src/model-selection.js";
|
|
4
4
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ResponseLanguageSchema, init_response_language } from "../../i18n/response-language.js";
|
|
6
6
|
import { resolveEffectiveAgentConfigForSession } from "../../config/agent-profile.js";
|
|
7
7
|
import { normalizeWorkingDirectoryInput } from "../../session/session-workspace.js";
|
|
8
8
|
import { getProjectWorkspacePathForSession } from "../../projects/workspace.js";
|
|
9
|
-
import {
|
|
9
|
+
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
10
|
+
import { getModelThinking } from "../../providers/model-thinking.js";
|
|
10
11
|
import { normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel } from "../transcript/thinking-types.js";
|
|
11
12
|
import "../../session/index.js";
|
|
12
|
-
import { getModelThinking } from "../../providers/model-thinking.js";
|
|
13
13
|
import { mkdir } from "node:fs/promises";
|
|
14
14
|
//#region src/agent/session/session-config-service.ts
|
|
15
15
|
init_src();
|
|
@@ -3,9 +3,9 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
import { getExecutionEnvironmentForSession } from "../../execution-environments/subject.js";
|
|
4
4
|
import { effectiveWorkspacePathForSession, normalizeWorkingDirectoryInput, projectWorkspacePath } from "../../session/session-workspace.js";
|
|
5
5
|
import { getProjectForSession } from "../../projects/workspace.js";
|
|
6
|
+
import { getModelThinking } from "../../providers/model-thinking.js";
|
|
6
7
|
import { resolveEffectiveThinkingLevel } from "../../session/thinking-resolve.js";
|
|
7
8
|
import "../../session/index.js";
|
|
8
|
-
import { getModelThinking } from "../../providers/model-thinking.js";
|
|
9
9
|
import { mkdir, stat } from "node:fs/promises";
|
|
10
10
|
//#region src/agent/session/session-hydrator.ts
|
|
11
11
|
/**
|
|
@@ -2,10 +2,10 @@ import { createLogger } from "../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { init_workspace_defaults, resolveDefaultAgentWorkspaceDir } from "../../config/workspace-defaults.js";
|
|
4
4
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
|
+
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
5
6
|
import { getExecutionEnvironmentForSession } from "../../execution-environments/subject.js";
|
|
6
7
|
import { effectiveWorkspacePathForSession, projectWorkspacePath } from "../../session/session-workspace.js";
|
|
7
8
|
import { getProjectForSession } from "../../projects/workspace.js";
|
|
8
|
-
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
9
9
|
import { resolveCompactionPolicy } from "../memory/compaction-policy.js";
|
|
10
10
|
import { resolveVerboseLevel } from "../../session/config-store.js";
|
|
11
11
|
import { resolveConfiguredActivityDetailDefault, resolveEffectiveReasoningLevel, resolveEffectiveThinkingLevel } from "../../session/thinking-resolve.js";
|
|
@@ -2,10 +2,10 @@ 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
4
|
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
5
|
+
import { isManagedSkillTransientDirName } from "./managed-store.js";
|
|
5
6
|
import { createSkillConfigManager } from "./config.js";
|
|
6
7
|
import { resolveWorkspaceSkillsDir } from "./workspace-skills-dir.js";
|
|
7
8
|
import { resolveAgentsSkillsDir, resolveWorkspaceAgentsSkillsDir } from "./skill-sources.js";
|
|
8
|
-
import { isManagedSkillTransientDirName } from "./managed-store.js";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import chokidar from "chokidar";
|
|
11
11
|
//#region src/agent/skills/filesystem-watcher.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { parseFrontmatter } from "../../markdown/frontmatter.js";
|
|
2
|
-
import { formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
3
|
-
import { computeSkillTreeHashSync } from "./hub-hash.js";
|
|
4
2
|
import { getSkillsLockEntry, recordSkillsHubInstall } from "./hub-lock.js";
|
|
5
3
|
import { installSkillFromZip, isIgnorableZipEntry, isValidSkillId, prepareManagedSkillTempDir, promoteManagedSkillTempDir } from "./managed-store.js";
|
|
4
|
+
import { formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
5
|
+
import { computeSkillTreeHashSync } from "./hub-hash.js";
|
|
6
6
|
import { tmpdir } from "node:os";
|
|
7
7
|
import { basename, dirname, join, normalize, resolve, sep } from "node:path";
|
|
8
8
|
import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { downloadSkillZipBuffer, fetchMarketplacePackageDetail, listSkillCategories, listSkillPackages, resolveSkillZipDownloadUrl, resolveSkillsStoreBaseUrl, skillIdForMarketplaceInstall, verifyStoreArtifactSha256 } from "./store-api-client.js";
|
|
1
2
|
import { registerMarketplaceAdapter } from "../../registry.js";
|
|
2
3
|
import { buildSkillMarkdownPreviewFromRaw } from "../../../skill-markdown-preview-from-raw.js";
|
|
3
|
-
import { downloadSkillZipBuffer, fetchMarketplacePackageDetail, listSkillCategories, listSkillPackages, resolveSkillZipDownloadUrl, resolveSkillsStoreBaseUrl, skillIdForMarketplaceInstall, verifyStoreArtifactSha256 } from "./store-api-client.js";
|
|
4
4
|
//#region src/agent/skills/marketplace/adapters/store/adapter.ts
|
|
5
5
|
const storeMarketplaceAdapter = {
|
|
6
6
|
id: "store",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MAX_SKILL_ZIP_BYTES, isValidSkillId } from "../../../managed-store.js";
|
|
2
1
|
import { init_resolution, resolveConnectedPlatformEndpoint } from "../../../../../platform/resolution.js";
|
|
3
2
|
import { MAX_EXTENSION_STORE_ZIP_BYTES } from "../../../../../extensions/store-zip-limits.js";
|
|
3
|
+
import { MAX_SKILL_ZIP_BYTES, isValidSkillId } from "../../../managed-store.js";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
//#region src/agent/skills/marketplace/adapters/store/store-api-client.ts
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isSessionSourceBinding, isTurnContextRef, parseTurnContextRefs, summarizeSourceContext } from "./types.js";
|
|
2
2
|
import { buildUserAssertionAgentContext } from "./user-assertion-context.js";
|
|
3
|
+
import { injectSourceContextsIntoUserMessage } from "./injector.js";
|
|
3
4
|
import { buildFileAgentContext } from "./file-context.js";
|
|
4
5
|
import { buildSessionAgentContext } from "./session-context.js";
|
|
5
6
|
import { buildBrowserTabAgentContext } from "./browser-tab.js";
|
|
6
|
-
import { injectSourceContextsIntoUserMessage } from "./injector.js";
|
|
7
7
|
export { buildBrowserTabAgentContext, buildFileAgentContext, buildSessionAgentContext, buildUserAssertionAgentContext, injectSourceContextsIntoUserMessage, isSessionSourceBinding, isTurnContextRef, parseTurnContextRefs, summarizeSourceContext };
|
|
@@ -2,20 +2,20 @@ import { createLogger } from "../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { TaskRepository, init_task_repository } from "../../tasks/task-repository.js";
|
|
4
4
|
import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-run-repository.js";
|
|
5
|
-
import { resolveTaskLocale } from "../../tasks/task-language.js";
|
|
6
5
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
7
|
-
import { TaskCollaborationRepository } from "../../tasks/task-collaboration-repository.js";
|
|
8
|
-
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
9
|
-
import { extractAssistantText, getAssistantMessageErrorReason, isTransientProviderErrorMessage, stripCodeFences } from "../../providers/model-response.js";
|
|
10
6
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
11
7
|
import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
|
|
12
8
|
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
13
|
-
import {
|
|
14
|
-
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
15
|
-
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
9
|
+
import { extractAssistantText, getAssistantMessageErrorReason, isTransientProviderErrorMessage, stripCodeFences } from "../../providers/model-response.js";
|
|
16
10
|
import { canResumeAfterModelFailure } from "../orchestration/turn-recovery.js";
|
|
11
|
+
import { resolveTaskLocale } from "../../tasks/task-language.js";
|
|
12
|
+
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
13
|
+
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
14
|
+
import { TaskCollaborationRepository } from "../../tasks/task-collaboration-repository.js";
|
|
15
|
+
import { currentTaskResearchResult } from "../../tasks/task-research-result.js";
|
|
17
16
|
import { buildResponseLanguageSection } from "../prompt/sections/response-language.js";
|
|
18
17
|
import { resolveResponseLanguageForSession } from "../prompt/response-language.js";
|
|
18
|
+
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
19
19
|
//#region src/agent/tasks/task-judge-service.ts
|
|
20
20
|
init_schema();
|
|
21
21
|
init_providers();
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import type { ClarificationPresentation } from '@xopcai/gateway-contract';
|
|
1
2
|
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
-
export type ClarifyRequestPayload = {
|
|
3
|
+
export type ClarifyRequestPayload = ClarificationPresentation & {
|
|
3
4
|
kind?: 'approval';
|
|
4
5
|
question: string;
|
|
5
|
-
choices?: string[];
|
|
6
|
-
suggestedAnswer?: string;
|
|
7
6
|
/** Stable hash of the exact operation guarded by an approval. */
|
|
8
7
|
approvalKey?: string;
|
|
9
8
|
};
|
|
@@ -2,13 +2,18 @@ import { Type } from "@sinclair/typebox";
|
|
|
2
2
|
//#region src/agent/tools/clarify-tool.ts
|
|
3
3
|
const ClarifySchema = Type.Object({
|
|
4
4
|
question: Type.String({ description: "The question to ask the user. Be specific and concise." }),
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
interactionMode: Type.Optional(Type.Union([Type.Literal("quick"), Type.Literal("compose")], { description: "quick submits a choice immediately; compose lets the user select and add details before submitting." })),
|
|
6
|
+
choiceDetails: Type.Optional(Type.Array(Type.Object({
|
|
7
|
+
id: Type.String(),
|
|
8
|
+
label: Type.String(),
|
|
9
|
+
description: Type.Optional(Type.String())
|
|
10
|
+
}), {
|
|
7
11
|
minItems: 2,
|
|
8
|
-
maxItems: 10
|
|
12
|
+
maxItems: 10,
|
|
13
|
+
description: "Answer choices with stable unique IDs and optional descriptions."
|
|
9
14
|
})),
|
|
10
|
-
|
|
11
|
-
});
|
|
15
|
+
recommendedChoiceId: Type.Optional(Type.String())
|
|
16
|
+
}, { additionalProperties: false });
|
|
12
17
|
function waitForAbort(signal) {
|
|
13
18
|
return new Promise((_, reject) => {
|
|
14
19
|
if (!signal) return;
|
|
@@ -23,7 +28,7 @@ function createClarifyTool(deps) {
|
|
|
23
28
|
return {
|
|
24
29
|
name: "clarify",
|
|
25
30
|
label: "❓ Clarify",
|
|
26
|
-
description: "Ask the user a clarifying question and pause the objective until they respond.\n\nUse this when you need more information to proceed correctly, rather than guessing.\n\nWHEN TO USE:\n- Ambiguous instructions with multiple valid interpretations\n- Missing critical information (which file, which approach, etc.)\n- Confirming destructive or irreversible actions\n\nWHEN NOT TO USE:\n- When you can reasonably infer the answer from context\n- For trivial decisions that do not affect the task\n- When the user explicitly said \"just do it\" or \"your choice\"\n\nTIPS:\n- Provide choices when there are clear options (faster for the user)\n- Keep questions short and specific\n-
|
|
31
|
+
description: "Ask the user a clarifying question and pause the objective until they respond.\n\nUse this when you need more information to proceed correctly, rather than guessing.\n\nWHEN TO USE:\n- Ambiguous instructions with multiple valid interpretations\n- Missing critical information (which file, which approach, etc.)\n- Confirming destructive or irreversible actions\n\nWHEN NOT TO USE:\n- When you can reasonably infer the answer from context\n- For trivial decisions that do not affect the task\n- When the user explicitly said \"just do it\" or \"your choice\"\n\nTIPS:\n- Provide choices when there are clear options (faster for the user)\n- Keep questions short and specific\n- Set recommendedChoiceId when one option is clearly more likely",
|
|
27
32
|
parameters: ClarifySchema,
|
|
28
33
|
async execute(toolCallId, params, signal) {
|
|
29
34
|
const p = params;
|
|
@@ -36,9 +41,10 @@ function createClarifyTool(deps) {
|
|
|
36
41
|
details: { answer: "" }
|
|
37
42
|
};
|
|
38
43
|
const payload = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
interactionMode: p.interactionMode,
|
|
45
|
+
choiceDetails: p.choiceDetails,
|
|
46
|
+
recommendedChoiceId: p.recommendedChoiceId,
|
|
47
|
+
question: p.question
|
|
42
48
|
};
|
|
43
49
|
try {
|
|
44
50
|
const result = await Promise.race([askUser(payload), waitForAbort(signal)]);
|