@xopcai/xopc 0.0.352 → 0.0.353
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/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 +2 -2
- 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/{agent-avatar-dicebear-ChlaFmiD.js → agent-avatar-dicebear-BVIuZcCP.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-CgNagNMG.js → agent-defaults-settings-panel-CcTnphqy.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-CDhtsMpV.js → agent-plugin-dialog-CdCzMPhC.js} +1 -1
- package/dist/gateway/static/root/assets/agents-BiNKpndr.js +66 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-C_3ucZGI.js → agents-admin-api-Ck2x78jq.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DqC-oj5_.js → app-management-settings-panel-BvGDN5J6.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Cfhepf6U.js → appearance-settings-BhQYkuQj.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-C6n5r8AP.js → apps-page-BQZJuM-C.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-D4EiLLyl.js → archive-plugin-BZXXJvpX.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CMxBpT5v.js → automations-page-C7VKkDb5.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-DJ_-_kGh.js → automations-workspace-y4qcvlg8.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-DQc_BlYP.js → binary-plugins-DoT3g5SP.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-C3S6gqnS.js → block-editor-sqqrCafh.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-D2SwaQ2F.js → browser-automation-inputs-CZOKsAaa.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CGG1740U.js → browser-automations-page-TEeTmkGP.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-COTo7btH.js → browser-settings-page--N4P7V0l.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-D4qdO980.js → capabilities-BOrLei_L.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-BsC346Ym.js → capabilities-page-F7OAv-iz.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-CRL4gfk5.js → capabilities-settings-panel-CaiIo1S1.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-header-actions-B_60-buR.js → capability-header-actions-CR_O9_Vr.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-DNxr72oD.js → channels-Bb-8c4wl.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DfTUgrey.js → chat-terminal-dock-Q99iKyiO.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-Bk84TKyF.js → computer-settings-page-QuXZBfky.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-B2pC--2X.js → connector-service-page-BIqzVqCO.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-Bu15_14O.js → connectors-page-CZ24DSBJ.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-CCN30yiy.js → date-picker-Ck-FmYEL.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CV2ybJJd.js → dependency-picker-BjH8XrKb.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DipFHe4X.js → desktop-pet-DyGxNAVW.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-Dg3RM_vY.js → desktop-pet-settings-C1rKgB-S.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-DUy1HymM.js → device-pairing-wizard-UrPcOU6Q.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BTuFpGIK.js → directory-picker-path-field-BYxUgMZb.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-xM8vfbRZ.js → extension-debug-page-CGL0jpQA.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Cl8zlion.js → extension-page-DPWf-tYg.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DODk0nOi.js → extension-settings-page-DZWBY39d.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-DZWFlfJr.js → gateway-config-swr-B31I6Gbq.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-HO9tL9xo.js → gateway-realtime-D6ffOiPe.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DQuFWNjA.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-BL3C7Q9w.js → gateway-settings-D5w5aYXK.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-Cg1nbxJR.js → gateway-startup-retry-DVol958v.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-CjJVq_Ff.js → home-page-DPQwxBGy.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-DSnPfr_U.js → image-generation-api-TVgJfz9r.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-By9oc8sD.js → imports-page-CnRWDtGz.js} +1 -1
- package/dist/gateway/static/root/assets/{index-S4z-eKe-.js → index-DU5Eb1V8.js} +20 -20
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-ixQ8_6ad.js → keyboard-shortcuts-settings-CoYdyBRh.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-Bnz5YOks.js → local-app-workbench-page-hjFeYlIq.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BV3NFUJQ.js → local-apps-page-CeBhXeoX.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-CuyTzbfW.js → local-session-drafts-wiq_12oN.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-qcYD05PF.js → locale-store-Y1aBayM_.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DVqwybaT.js → logs-page-CzpZDjkA.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-CUoDWFg7.js → management-settings-Beu_R_Rc.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BhFHoVtG.js → markdown-view-BlzX7Ze5.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-cpalRgVI.js → media-plugins-C9ya5rUH.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DPw2X06D.js +3 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-CxbZWvj1.js → note-detail-panel-D8bpTGwP.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-page-DkEOEza6.js → notes-page-OmgXowUG.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-CjCYNkVb.js → page-context-capture-button-BjjjuLkz.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-Dnzie6QW.js → page-tabs-_DiuzxyD.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-D1H4_Nfl.js → preview-open-alternatives-BKvUadws.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BJwEshPw.js → product-open-page-DUPsiVP9.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-BWC89e7l.js → project-detail-page-CWlCg2x5.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BYmHC91B.js → projects-page-NbVNo0tP.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-C0j3sKT4.js → registry-api-DqDOrPQ0.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DuVzpZ9R.js → remote-access-hub-CD8HrqGC.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-SbIgL9Ya.js → runtime-tools-settings-panel-C25xEYTK.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-BBl_4U1U.js → scenes-page-DbWaemwR.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-Rj-wi9sm.js → schema-form-_3LQ4hyB.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-iR1SFNHe.js → session-api-CTN4qwiN.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-3YOU74jt.js → session-manager-DsH1DZI_.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-BnipzwJ6.js → sessions-page-B7ZUdXlb.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CpKzZMft.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-6gOr-ype.js → settings-form-section-DS80hVSY.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-DqCJHcdG.js +1 -0
- package/dist/gateway/static/root/assets/{setup-status-panel-CR0VBBw3.js → setup-status-panel-De-kC3yJ.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CK0Bg_-o.js → share-preview-page-T-0g_rwr.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-B3Ghvh3c.js → shares-settings-Dz33T3du.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-CoIsCPbI.js → skill-api-Cx6GGpSY.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DyJ-Duem.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-CDkm7yig.js → skills-page-B2iyN-kP.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Cfv-jDmY.js → system-settings-panel-By3SZQR_.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-eYs6qgcW.js → task-detail-page-4yHUTs4_.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-CpOQaCFN.js → tunnel-api-BoH0LBkw.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-Cye-2eKA.js → usage-page-dKU5X9zT.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-o6YLrkpO.js → use-autosave-YKCwQvqT.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-Bg-jeU7W.js → user-model-page-Uht32LPP.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-FMNwQIho.js → voice-api-key-field-DiqHIA8l.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-CylVelIb.js → voice-config-api-BM75K3mR.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-9bULjfGk.js → work-discovery-overlay-BnfD6w0k.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-VYQHBiz3.js → workflow-run-setup-panel-DSy57rBr.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-KnoMMEDN.js → workflows-page-Cq3vRUbc.js} +1 -1
- package/dist/gateway/static/root/index.html +14 -14
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +22 -17
- package/dist/src/agent/agent-scope.js +2 -2
- package/dist/src/agent/background-review/prompts.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +3 -3
- package/dist/src/agent/bootstrap/bootstrap-files.d.ts +0 -4
- package/dist/src/agent/bootstrap/bootstrap-files.js +3 -9
- package/dist/src/agent/bootstrap/load-bootstrap-files.js +2 -4
- 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 +2 -2
- package/dist/src/agent/context/project-context.js +3 -3
- package/dist/src/agent/context/workspace-seed.d.ts +1 -7
- package/dist/src/agent/context/workspace-seed.js +4 -13
- package/dist/src/agent/context/workspace-templates/AGENTS.md +1 -1
- package/dist/src/agent/context/workspace.d.ts +1 -3
- package/dist/src/agent/context/workspace.js +3 -7
- package/dist/src/agent/data-acquisition/service.js +1 -1
- package/dist/src/agent/embedded/index.js +2 -2
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +4 -4
- package/dist/src/agent/embedded/run-turn.js +4 -4
- package/dist/src/agent/embedded/session-tool-result-guard.js +3 -3
- package/dist/src/agent/embedded/tool-result-truncation.js +1 -1
- package/dist/src/agent/external-tools/cliProvider.js +3 -3
- package/dist/src/agent/external-tools/composio-provider.js +3 -3
- package/dist/src/agent/external-tools/gateway-tools.js +1 -1
- package/dist/src/agent/external-tools/mcp-provider.js +3 -3
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/providers/dashscope.js +1 -1
- package/dist/src/agent/image/generation/providers/fal.js +1 -1
- package/dist/src/agent/image/generation/providers/google.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/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/index.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-config.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +2 -2
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/agent/mcp/mcp-stdio-transport.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/mcp/plugin-http-fetch.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/messaging/no-reply.d.ts +1 -0
- package/dist/src/agent/messaging/no-reply.js +4 -0
- package/dist/src/agent/messaging/outbound-coordinator.d.ts +0 -4
- package/dist/src/agent/messaging/outbound-coordinator.js +2 -4
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
- package/dist/src/agent/prompt/sections/agent-identity.d.ts +3 -0
- package/dist/src/agent/prompt/sections/agent-identity.js +13 -0
- package/dist/src/agent/prompt/sections/messaging-runtime.d.ts +0 -5
- package/dist/src/agent/prompt/sections/messaging-runtime.js +2 -16
- package/dist/src/agent/prompt/sections/project-context.d.ts +0 -3
- package/dist/src/agent/prompt/sections/project-context.js +2 -9
- package/dist/src/agent/prompt/sections/tooling.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.d.ts +2 -0
- package/dist/src/agent/prompt/service-prompt-builder.js +5 -10
- package/dist/src/agent/prompt/subagent-context.js +1 -1
- package/dist/src/agent/prompt/system-prompt-params.d.ts +0 -4
- package/dist/src/agent/prompt/system-prompt-params.js +0 -2
- package/dist/src/agent/prompt/system-prompt.d.ts +2 -2
- package/dist/src/agent/prompt/system-prompt.js +8 -9
- 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-one-shot.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +5 -5
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.js +19 -20
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/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/source-context/index.js +2 -2
- package/dist/src/agent/starter-agents.d.ts +0 -4
- package/dist/src/agent/starter-agents.js +57 -98
- package/dist/src/agent/tasks/task-judge-service.js +4 -4
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +7 -4
- 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/delegation-parent-policy.js +1 -1
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.d.ts +1 -1
- package/dist/src/agent/tools/factory.js +16 -16
- package/dist/src/agent/tools/fetch-text.js +1 -1
- 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/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 +2 -2
- package/dist/src/agent/tools/skills-tools.js +1 -1
- 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 +3 -3
- package/dist/src/agent/workflow/subagent-runner.js +1 -1
- package/dist/src/agent-catalog/migrations/identity-markdown-cutover.d.ts +5 -0
- package/dist/src/agent-catalog/migrations/identity-markdown-cutover.js +94 -0
- package/dist/src/agent-catalog/repository.js +7 -1
- package/dist/src/agent-catalog/service.js +2 -2
- package/dist/src/agent-config/schema.d.ts +19 -0
- package/dist/src/agent-config/schema.js +7 -4
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/domain/index.js +2 -2
- package/dist/src/automations/index.js +4 -4
- package/dist/src/automations/service/automation-service.js +2 -2
- package/dist/src/backup/archive.js +1 -1
- package/dist/src/bootstrap/application-state.js +2 -0
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- 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/agent-edit.js +4 -7
- package/dist/src/chat-commands/builtins/config.js +4 -4
- package/dist/src/chat-commands/builtins/review.js +1 -1
- 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/builtins/understanding.js +1 -1
- package/dist/src/chat-commands/builtins/workflow.js +2 -2
- package/dist/src/chat-commands/context.js +3 -3
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +6 -6
- package/dist/src/cli/commands/auth.js +1 -1
- 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/doctor/checks/provider-auth.js +2 -2
- package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +1 -1
- package/dist/src/cli/commands/doctor/checks/workspace-status.js +0 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +2 -2
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +2 -2
- package/dist/src/cli/commands/extension.js +4 -4
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/gateway/token.js +1 -1
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +1 -34
- package/dist/src/cli/commands/onboard/channels/registry.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +2 -2
- package/dist/src/cli/commands/providers.js +1 -1
- package/dist/src/cli/commands/runtime.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 +5 -5
- package/dist/src/cli/templates.d.ts +1 -1
- package/dist/src/cli/templates.js +1 -23
- 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 +2 -2
- package/dist/src/config/index.js +7 -7
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/paths.d.ts +0 -2
- package/dist/src/config/paths.js +1 -3
- package/dist/src/config/reload.d.ts +0 -1
- package/dist/src/config/reload.js +0 -4
- package/dist/src/config/rules.js +0 -5
- package/dist/src/config/schema.d.ts +0 -45
- package/dist/src/config/schema.js +2 -23
- 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-understanding.js +3 -3
- package/dist/src/connectors/connection-recovery-service.js +5 -5
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/connectors/plugin-mcp-recovery.js +1 -1
- package/dist/src/discussions/live-worker.js +1 -1
- package/dist/src/discussions/recording.js +1 -1
- package/dist/src/discussions/sealer.js +1 -1
- package/dist/src/extensions/activation-context.js +3 -3
- 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/lockfile.js +1 -1
- 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.d.ts +1 -9
- package/dist/src/gateway/agents-admin.js +8 -33
- package/dist/src/gateway/device-routes.js +2 -2
- 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.js +4 -4
- 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/browser.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/home.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +2 -2
- package/dist/src/gateway/hono/routes/media.js +1 -1
- 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/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-command-handler.js +1 -1
- package/dist/src/gateway/hono/routes/session-input-handler.js +2 -2
- package/dist/src/gateway/hono/routes/sessions.js +1 -1
- package/dist/src/gateway/hono/routes/shares.js +3 -3
- 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 +5 -5
- package/dist/src/gateway/hono/routes/voice.js +6 -6
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/image-generation-setup.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/config-coordinator.js +3 -3
- package/dist/src/gateway/service/run-gateway-agent.js +3 -3
- package/dist/src/gateway/service/sessions-api.js +1 -1
- package/dist/src/gateway/service.js +46 -46
- package/dist/src/gateway/session-context-summary.js +2 -2
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/home-intelligence/generator.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- 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 +10 -10
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/mcp/gateway-http-client.js +1 -1
- package/dist/src/media-understanding/openai-compatible-audio.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 +1 -1
- package/dist/src/notes/store.js +1 -1
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/remote-access/exposure-manager.js +1 -1
- package/dist/src/scenes/taskFollowUp/agentExecutor.js +4 -4
- package/dist/src/scenes/taskFollowUp/resources.js +1 -1
- package/dist/src/scenes/taskFollowUp/service.js +4 -4
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +4 -4
- package/dist/src/session/thinking-resolve.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/share-zip.js +1 -1
- package/dist/src/share/site-proxy.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tasks/execution-context.js +1 -1
- package/dist/src/tasks/home-query-service.js +3 -3
- package/dist/src/tasks/index.js +4 -4
- package/dist/src/tasks/task-application-service.js +2 -2
- package/dist/src/tasks/task-collaboration-delivery.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-main-update-decision-service.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +10 -10
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-command-formatters.js +1 -1
- package/dist/src/tui/tui-commands.js +6 -6
- 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 +7 -7
- package/dist/src/tunnel/frpc-binary.js +1 -1
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/voice/realtime/memory-context.js +3 -3
- package/dist/src/voice/realtime/persona-context.d.ts +2 -2
- package/dist/src/voice/realtime/persona-context.js +19 -33
- package/dist/src/voice/realtime/runtime.js +3 -3
- 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/index.js +1 -1
- package/dist/src/work-discovery/service.js +5 -5
- package/dist/src/workflows/engine/workflow-engine.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +8 -8
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/agents-BLP0zRru.js +0 -70
- package/dist/gateway/static/root/assets/gateway-realtime-store-B01fiKrV.js +0 -1
- package/dist/gateway/static/root/assets/messages-vL3EpIrL.js +0 -3
- package/dist/gateway/static/root/assets/settings-advanced-gate-C7oNKVxC.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-D1tVcmlR.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DMIwfISw.js +0 -1
- package/dist/src/agent/bootstrap/filter-bootstrap-files.d.ts +0 -3
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +0 -18
- package/dist/src/agent/context/workspace-templates/HEARTBEAT.md +0 -26
- package/dist/src/agent/context/workspace-templates/IDENTITY.md +0 -30
- package/dist/src/agent/service/parse-outbound-session-key.d.ts +0 -8
- package/dist/src/agent/service/parse-outbound-session-key.js +0 -44
- package/dist/src/heartbeat/active-hours.d.ts +0 -11
- package/dist/src/heartbeat/active-hours.js +0 -40
- package/dist/src/heartbeat/content-check.d.ts +0 -4
- package/dist/src/heartbeat/content-check.js +0 -17
- package/dist/src/heartbeat/event-prompt.d.ts +0 -4
- package/dist/src/heartbeat/event-prompt.js +0 -11
- package/dist/src/heartbeat/index.d.ts +0 -5
- package/dist/src/heartbeat/index.js +0 -6
- package/dist/src/heartbeat/tokens.d.ts +0 -15
- package/dist/src/heartbeat/tokens.js +0 -25
- package/dist/src/heartbeat/wake.d.ts +0 -13
- package/dist/src/heartbeat/wake.js +0 -46
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { stripRuntimeUserMessageEnvelope } from "../../../packages/gateway-contract/src/user-message-display.js";
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
3
|
import { extractProfileAgentId } from "../../config/agent-profile.js";
|
|
4
|
-
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
5
4
|
import { mimeTypeFromMediaPath } from "../../media/store.js";
|
|
5
|
+
import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
6
6
|
import { readMediaReference } from "../../media/media-reference.js";
|
|
7
7
|
import { isImageInboundAttachment } from "../../channels/attachments/attachment-classifiers.js";
|
|
8
8
|
import "../../channels/attachments/inbound-persist.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { runWithLogContext, updateAsyncLogContext } from "../../utils/logger/context.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { MessageBusShutdownError } from "../../infra/bus/queue.js";
|
|
4
|
-
import "../../infra/bus/index.js";
|
|
5
3
|
import { shouldSkipResetOverlapCommand } from "../../session/reset-triggers.js";
|
|
6
4
|
import { initSessionTurn } from "../../session/init-session-turn.js";
|
|
5
|
+
import { MessageBusShutdownError } from "../../infra/bus/queue.js";
|
|
6
|
+
import "../../infra/bus/index.js";
|
|
7
7
|
import { runEmbeddedTurnForSession } from "../embedded/run-for-session.js";
|
|
8
8
|
import { inboundMessageLogRequestId } from "../service-inbound-utils.js";
|
|
9
9
|
//#region src/agent/inbound/inbound-loop.ts
|
package/dist/src/agent/index.js
CHANGED
|
@@ -3,12 +3,12 @@ import { dropThinkingBlocks } from "./transcript/thinking.js";
|
|
|
3
3
|
import { extractToolCallsFromAssistant, extractToolResultId, sanitizeToolCallId, sanitizeToolCallIdsForCloudCodeAssist } from "./transcript/tool-call-id.js";
|
|
4
4
|
import { makeMissingToolResult, repairToolUseResultPairing, sanitizeToolCallInputs, sanitizeToolUseResultPairing, stripToolResultDetails } from "./transcript/session-transcript-repair.js";
|
|
5
5
|
import { applySessionTranscriptHygiene, applySessionTranscriptHygieneForPersistence, applySessionTranscriptHygieneWithPolicy, resolvePolicyForModel, tryApplySessionTranscriptHygiene, tryApplySessionTranscriptHygieneForPersistence } from "./transcript/transcript-hygiene.js";
|
|
6
|
-
import { AgentService } from "./service.js";
|
|
7
6
|
import { createResponseMessage, createSignalMessage, createTaskMessage, isValidIPCMessage } from "./ipc/types.js";
|
|
8
7
|
import { AgentInbox } from "./ipc/inbox.js";
|
|
9
8
|
import { AgentBus } from "./ipc/bus.js";
|
|
10
9
|
import { AgentSocketClient, AgentSocketServer, isSocketAvailable } from "./ipc/socket.js";
|
|
11
10
|
import "./ipc/index.js";
|
|
11
|
+
import { AgentService } from "./service.js";
|
|
12
12
|
import { stripToolMessages } from "./transcript/strip-tool-messages.js";
|
|
13
13
|
import "./transcript/index.js";
|
|
14
14
|
export { AgentBus, AgentInbox, AgentService, AgentSocketClient, AgentSocketServer, applySessionTranscriptHygiene, applySessionTranscriptHygieneForPersistence, applySessionTranscriptHygieneWithPolicy, createResponseMessage, createSignalMessage, createTaskMessage, dropThinkingBlocks, extractToolCallsFromAssistant, extractToolResultId, isSocketAvailable, isValidIPCMessage, makeMissingToolResult, repairToolUseResultPairing, resolvePolicyForModel, resolveTranscriptPolicy, sanitizeToolCallId, sanitizeToolCallIdsForCloudCodeAssist, sanitizeToolCallInputs, sanitizeToolUseResultPairing, stripToolMessages, stripToolResultDetails, tryApplySessionTranscriptHygiene, tryApplySessionTranscriptHygieneForPersistence };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { AgentPluginStore } from "../../extensions/agent-plugins/store.js";
|
|
1
2
|
import { normalizeConfiguredMcpServers } from "../../config/mcp-config-normalize.js";
|
|
2
3
|
import { inspectExtensionConnectorDependencies } from "../../extensions/connector-dependencies.js";
|
|
3
|
-
import { AgentPluginStore } from "../../extensions/agent-plugins/store.js";
|
|
4
4
|
import { materializePluginServers } from "../../extensions/agent-plugins/mcp-adapter.js";
|
|
5
5
|
//#region src/agent/mcp/bundle-mcp-config.ts
|
|
6
6
|
function listConfiguredMcpServers(params) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createSessionMcpRuntime } from "./bundle-mcp-runtime.js";
|
|
2
1
|
import { mcpToolPolicyId } from "./bundle-mcp-policy.js";
|
|
2
|
+
import { createSessionMcpRuntime } from "./bundle-mcp-runtime.js";
|
|
3
3
|
import { decodeMcpResourceId, encodeMcpResourceId } from "./mcp-resource-id.js";
|
|
4
4
|
import crypto from "node:crypto";
|
|
5
5
|
//#region src/agent/mcp/bundle-mcp-gateway.ts
|
|
@@ -3,16 +3,16 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
import { init_global_singleton, resolveGlobalSingleton } from "../../utils/global-singleton.js";
|
|
4
4
|
import { init_string_coerce, normalizeOptionalString } from "../../utils/string-coerce.js";
|
|
5
5
|
import { resolveConnectorSecretReferences } from "../../connectors/secret-store.js";
|
|
6
|
-
import { redactSensitiveUrlLikeString } from "../../utils/redact-sensitive-url.js";
|
|
7
6
|
import { recordPluginMcpHealth } from "../../extensions/agent-plugins/health.js";
|
|
7
|
+
import { redactSensitiveUrlLikeString } from "../../utils/redact-sensitive-url.js";
|
|
8
8
|
import { loadEmbeddedMcpConfig } from "./embedded-mcp.js";
|
|
9
9
|
import { isMcpConfigRecord } from "./mcp-config-shared.js";
|
|
10
10
|
import { isMcpAuthorizationError } from "./oauth/mcp-oauth-errors.js";
|
|
11
11
|
import { resolveMcpTransport } from "./mcp-transport.js";
|
|
12
12
|
import { sanitizeServerName } from "./bundle-mcp-names.js";
|
|
13
13
|
import crypto from "node:crypto";
|
|
14
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
15
14
|
import Ajv2020 from "ajv/dist/2020.js";
|
|
15
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
16
16
|
import { AjvJsonSchemaValidator } from "@modelcontextprotocol/sdk/validation/ajv-provider.js";
|
|
17
17
|
//#region src/agent/mcp/bundle-mcp-runtime.ts
|
|
18
18
|
init_logger();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { mcpToolPolicyId } from "./bundle-mcp-policy.js";
|
|
1
2
|
import { loadMergedBundleMcpConfig } from "./bundle-mcp-config.js";
|
|
2
3
|
import { loadEmbeddedMcpConfig } from "./embedded-mcp.js";
|
|
3
4
|
import { McpAuthorizationRequiredError, isMcpAuthorizationError } from "./oauth/mcp-oauth-errors.js";
|
|
4
5
|
import { McpOAuthStore, canonicalMcpServerUrl, mcpOAuthServerKey } from "./oauth/mcp-oauth-store.js";
|
|
5
6
|
import { XopcMcpOAuthClientProvider } from "./oauth/mcp-oauth-provider.js";
|
|
6
7
|
import { __testing, createSessionMcpRuntime, disposeAllSessionMcpRuntimes, disposeSessionMcpRuntime, getOrCreateSessionMcpRuntime, getSessionMcpRuntimeManager, retireSessionMcpRuntime, retireSessionMcpRuntimeForConversationId } from "./bundle-mcp-runtime.js";
|
|
8
|
+
import "./bundle-mcp-tools.js";
|
|
7
9
|
import { McpOAuthSession } from "./oauth/mcp-oauth-session.js";
|
|
8
10
|
import { McpOAuthManager, getMcpOAuthManager } from "./oauth/mcp-oauth-manager.js";
|
|
9
|
-
import { mcpToolPolicyId } from "./bundle-mcp-policy.js";
|
|
10
|
-
import "./bundle-mcp-tools.js";
|
|
11
11
|
import "./oauth/index.js";
|
|
12
12
|
export { McpAuthorizationRequiredError, McpOAuthManager, McpOAuthSession, McpOAuthStore, XopcMcpOAuthClientProvider, __testing, canonicalMcpServerUrl, createSessionMcpRuntime, disposeAllSessionMcpRuntimes, disposeSessionMcpRuntime, getMcpOAuthManager, getOrCreateSessionMcpRuntime, getSessionMcpRuntimeManager, isMcpAuthorizationError, loadEmbeddedMcpConfig, loadMergedBundleMcpConfig, mcpOAuthServerKey, mcpToolPolicyId, retireSessionMcpRuntime, retireSessionMcpRuntimeForConversationId };
|
|
@@ -2,9 +2,9 @@ import { terminateProcess } from "../../process/kill-tree.js";
|
|
|
2
2
|
import { containedPath } from "../../extensions/agent-plugins/validation.js";
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
4
|
import { mkdir } from "node:fs/promises";
|
|
5
|
-
import { PassThrough } from "node:stream";
|
|
6
5
|
import { getDefaultEnvironment } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
7
6
|
import process from "node:process";
|
|
7
|
+
import { PassThrough } from "node:stream";
|
|
8
8
|
import { ReadBuffer, serializeMessage } from "@modelcontextprotocol/sdk/shared/stdio.js";
|
|
9
9
|
//#region src/agent/mcp/mcp-stdio-transport.ts
|
|
10
10
|
const CLOSE_TIMEOUT_MS = 2e3;
|
|
@@ -9,10 +9,10 @@ import { McpOAuthStore } from "./oauth/mcp-oauth-store.js";
|
|
|
9
9
|
import { XopcMcpOAuthClientProvider } from "./oauth/mcp-oauth-provider.js";
|
|
10
10
|
import { createPluginHttpFetch } from "./plugin-http-fetch.js";
|
|
11
11
|
import { pluginOAuthScope } from "../../extensions/agent-plugins/plugin-oauth-scope.js";
|
|
12
|
-
import { fetch } from "undici";
|
|
13
12
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
14
13
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
15
14
|
import { getDefaultEnvironment } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
15
|
+
import { fetch } from "undici";
|
|
16
16
|
//#region src/agent/mcp/mcp-transport.ts
|
|
17
17
|
init_paths_state();
|
|
18
18
|
init_logger();
|
|
@@ -2,8 +2,8 @@ import { createLogger } from "../../../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../../../utils/logger.js";
|
|
3
3
|
import { init_global_singleton, resolveGlobalSingleton } from "../../../utils/global-singleton.js";
|
|
4
4
|
import { resolveConnectorSecretReferences } from "../../../connectors/secret-store.js";
|
|
5
|
-
import { redactSensitiveUrlLikeString } from "../../../utils/redact-sensitive-url.js";
|
|
6
5
|
import { recordPluginMcpHealth } from "../../../extensions/agent-plugins/health.js";
|
|
6
|
+
import { redactSensitiveUrlLikeString } from "../../../utils/redact-sensitive-url.js";
|
|
7
7
|
import { resolveMcpTransportConfig } from "../mcp-transport-config.js";
|
|
8
8
|
import { isMcpAuthorizationError } from "./mcp-oauth-errors.js";
|
|
9
9
|
import { McpOAuthStore, canonicalMcpServerUrl } from "./mcp-oauth-store.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_paths, resolveMcpOAuthPath } from "../../../config/paths.js";
|
|
2
1
|
import { init_write_file_atomic, writeTextAtomic } from "../../../infra/write-file-atomic.js";
|
|
2
|
+
import { init_paths, resolveMcpOAuthPath } from "../../../config/paths.js";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
import { readFile, rm } from "node:fs/promises";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockList, isIP } from "node:net";
|
|
2
|
-
import { lookup } from "node:dns";
|
|
3
2
|
import { Agent, fetch } from "undici";
|
|
3
|
+
import { lookup } from "node:dns";
|
|
4
4
|
//#region src/agent/mcp/plugin-http-fetch.ts
|
|
5
5
|
const blocked = new BlockList();
|
|
6
6
|
for (const [network, prefix] of [
|
|
@@ -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";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NO_REPLY = "NO_REPLY";
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* unit-testable and lets the parent `AgentService` shrink to a coordinator.
|
|
14
14
|
*/
|
|
15
15
|
import type { MessageBus, InboundMessage } from '../../infra/bus/index.js';
|
|
16
|
-
import type { Config } from '../../config/schema.js';
|
|
17
16
|
import type { HookHandler } from '../lifecycle/hook-handler.js';
|
|
18
17
|
import type { SessionContext } from '../session/index.js';
|
|
19
18
|
import { type TypingController } from '../lifecycle/typing.js';
|
|
@@ -22,8 +21,6 @@ export interface OutboundCoordinatorConfig {
|
|
|
22
21
|
bus: MessageBus;
|
|
23
22
|
hookHandler: HookHandler;
|
|
24
23
|
streamManager: StreamManager;
|
|
25
|
-
/** Reads the effective config snapshot (honours runtime overrides). */
|
|
26
|
-
getConfig: () => Config | undefined;
|
|
27
24
|
/** Resolves the last visible assistant text for a session (in-memory + agent fallback). */
|
|
28
25
|
getLastAssistantPlainText: (conversationId: string) => string;
|
|
29
26
|
reviewTaskTurn: (payload: SessionTurnCompletePayload) => Promise<void>;
|
|
@@ -43,7 +40,6 @@ export declare class OutboundCoordinator {
|
|
|
43
40
|
private readonly bus;
|
|
44
41
|
private readonly hookHandler;
|
|
45
42
|
private readonly streamManager;
|
|
46
|
-
private readonly getConfig;
|
|
47
43
|
private readonly getLastAssistantPlainText;
|
|
48
44
|
private readonly reviewTaskTurn;
|
|
49
45
|
constructor(config: OutboundCoordinatorConfig);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import "./no-reply.js";
|
|
3
4
|
import { createTypingController } from "../lifecycle/typing.js";
|
|
4
|
-
import { shouldSilence } from "../../heartbeat/tokens.js";
|
|
5
5
|
//#region src/agent/messaging/outbound-coordinator.ts
|
|
6
6
|
init_logger();
|
|
7
7
|
const log = createLogger("OutboundCoordinator");
|
|
@@ -9,14 +9,12 @@ var OutboundCoordinator = class {
|
|
|
9
9
|
bus;
|
|
10
10
|
hookHandler;
|
|
11
11
|
streamManager;
|
|
12
|
-
getConfig;
|
|
13
12
|
getLastAssistantPlainText;
|
|
14
13
|
reviewTaskTurn;
|
|
15
14
|
constructor(config) {
|
|
16
15
|
this.bus = config.bus;
|
|
17
16
|
this.hookHandler = config.hookHandler;
|
|
18
17
|
this.streamManager = config.streamManager;
|
|
19
|
-
this.getConfig = config.getConfig;
|
|
20
18
|
this.getLastAssistantPlainText = config.getLastAssistantPlainText;
|
|
21
19
|
this.reviewTaskTurn = config.reviewTaskTurn;
|
|
22
20
|
}
|
|
@@ -70,7 +68,7 @@ var OutboundCoordinator = class {
|
|
|
70
68
|
if (this.streamManager.consumeSkipFinalOutbound()) return;
|
|
71
69
|
const finalContent = this.getLastAssistantPlainText(sessionContext.conversationId);
|
|
72
70
|
if (!finalContent?.trim()) return;
|
|
73
|
-
if (
|
|
71
|
+
if (finalContent.trim() === "NO_REPLY") {
|
|
74
72
|
log.debug({ conversationId: sessionContext.conversationId }, "Silent reply — skipping outbound");
|
|
75
73
|
return;
|
|
76
74
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { resolveEffectiveThinkingLevel } from "../../session/thinking-resolve.js";
|
|
4
3
|
import { abortEmbeddedRun } from "../embedded/runs.js";
|
|
5
4
|
import { persistInboundAttachments } from "../../channels/attachments/inbound-persist.js";
|
|
6
5
|
import { buildTranscriptUserMessage, clearPendingTranscriptUserMessage, hydrateUserTurnForLlm, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
6
|
+
import { resolveEffectiveThinkingLevel } from "../../session/thinking-resolve.js";
|
|
7
7
|
import { runEmbeddedTurnForSession } from "../embedded/run-for-session.js";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
//#region src/agent/orchestration/agent-orchestrator.ts
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/agent/prompt/sections/agent-identity.ts
|
|
2
|
+
/** Identity comes from the Agent catalog, never from workspace Markdown. */
|
|
3
|
+
function buildAgentIdentitySection(profile) {
|
|
4
|
+
if (!profile) return;
|
|
5
|
+
const lines = [`Name: ${profile.name}`];
|
|
6
|
+
if (profile.description) lines.push(`Description: ${profile.description}`);
|
|
7
|
+
if (profile.creature) lines.push(`Type: ${profile.creature}`);
|
|
8
|
+
if (profile.style) lines.push(`Style: ${profile.style}`);
|
|
9
|
+
if (profile.language) lines.push(`Primary language: ${profile.language}`);
|
|
10
|
+
return `## Agent identity\n\n${lines.join("\n")}`;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { buildAgentIdentitySection };
|
|
@@ -9,8 +9,3 @@ export declare function buildSilentRepliesSection(params: {
|
|
|
9
9
|
}): string;
|
|
10
10
|
export declare function buildOutputDirectivesSection(isMinimal: boolean): string;
|
|
11
11
|
export declare function buildTimeSection(timezone?: string): string;
|
|
12
|
-
export declare function buildHeartbeatBehaviorSection(params: {
|
|
13
|
-
enabled: boolean;
|
|
14
|
-
customPrompt?: string;
|
|
15
|
-
userTimezone?: string;
|
|
16
|
-
}): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NO_REPLY } from "
|
|
1
|
+
import { NO_REPLY } from "../../messaging/no-reply.js";
|
|
2
2
|
//#region src/agent/prompt/sections/messaging-runtime.ts
|
|
3
3
|
function buildMessagingSection(params) {
|
|
4
4
|
if (params.isMinimal || params.channels.length === 0) return "";
|
|
@@ -49,19 +49,5 @@ function buildTimeSection(timezone) {
|
|
|
49
49
|
"If you need the current date/time/day-of-week, use the `session_status` tool or the inbound message timestamp envelope (when present)."
|
|
50
50
|
].join("\n");
|
|
51
51
|
}
|
|
52
|
-
function buildHeartbeatBehaviorSection(params) {
|
|
53
|
-
if (!params.enabled) return "";
|
|
54
|
-
if (params.customPrompt?.trim()) return `## Heartbeats\n\n${params.customPrompt.trim()}`;
|
|
55
|
-
let quietHoursNote = "";
|
|
56
|
-
if (params.userTimezone) quietHoursNote = `\n\n> Quiet hours: The user is in **${params.userTimezone}**. Avoid proactive checks during late night (23:00-08:00) unless urgent.`;
|
|
57
|
-
return [
|
|
58
|
-
"## Heartbeats",
|
|
59
|
-
"",
|
|
60
|
-
"If the current user message is a heartbeat poll and nothing needs attention, reply exactly: HEARTBEAT_OK",
|
|
61
|
-
"",
|
|
62
|
-
"If something needs attention, do NOT include \"HEARTBEAT_OK\"; reply with the alert text instead.",
|
|
63
|
-
quietHoursNote.trim()
|
|
64
|
-
].filter(Boolean).join("\n");
|
|
65
|
-
}
|
|
66
52
|
//#endregion
|
|
67
|
-
export {
|
|
53
|
+
export { buildMessagingSection, buildOutputDirectivesSection, buildSilentRepliesSection, buildTimeSection };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { EmbeddedContextFile } from '../../bootstrap/types.js';
|
|
2
2
|
export declare const CONTEXT_FILE_ORDER: Map<string, number>;
|
|
3
|
-
export declare const DEFAULT_HEARTBEAT_PROMPT_CONTEXT_BLOCK = "Default heartbeat prompt:\n`Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.`";
|
|
4
3
|
export declare function normalizeContextFilePath(pathValue: string): string;
|
|
5
4
|
export declare function getContextFileBasename(pathValue: string): string;
|
|
6
5
|
export declare function sanitizeContextFileContentForPrompt(content: string): string;
|
|
@@ -9,5 +8,3 @@ export declare function buildProjectContextSection(params: {
|
|
|
9
8
|
files: EmbeddedContextFile[];
|
|
10
9
|
heading: string;
|
|
11
10
|
}): string[];
|
|
12
|
-
/** Heartbeat content belongs to the heartbeat user turn, never the system prompt. */
|
|
13
|
-
export declare function isHeartbeatContextFile(pathValue: string): boolean;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { DEFAULT_HEARTBEAT_FILENAME } from "../../context/workspace.js";
|
|
2
1
|
//#region src/agent/prompt/sections/project-context.ts
|
|
3
2
|
const CONTEXT_FILE_ORDER = new Map([
|
|
4
3
|
["agents.md", 10],
|
|
5
4
|
["soul.md", 20],
|
|
6
|
-
["identity.md", 30],
|
|
7
5
|
["user.md", 40],
|
|
8
6
|
["tools.md", 50],
|
|
9
7
|
["bootstrap.md", 60],
|
|
10
8
|
["memory.md", 70]
|
|
11
9
|
]);
|
|
12
|
-
const DEFAULT_HEARTBEAT_PROMPT_CONTEXT_BLOCK = "Default heartbeat prompt:\n`Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.`";
|
|
13
10
|
function normalizeContextFilePath(pathValue) {
|
|
14
11
|
return pathValue.trim().replace(/\\/g, "/");
|
|
15
12
|
}
|
|
@@ -18,7 +15,7 @@ function getContextFileBasename(pathValue) {
|
|
|
18
15
|
return (normalizedPath.split("/").pop() ?? normalizedPath).toLowerCase();
|
|
19
16
|
}
|
|
20
17
|
function sanitizeContextFileContentForPrompt(content) {
|
|
21
|
-
return content.
|
|
18
|
+
return content.replace(/\n{3,}/g, "\n\n");
|
|
22
19
|
}
|
|
23
20
|
function sortContextFilesForPrompt(contextFiles) {
|
|
24
21
|
return [...contextFiles].sort((a, b) => {
|
|
@@ -41,9 +38,5 @@ function buildProjectContextSection(params) {
|
|
|
41
38
|
for (const file of params.files) lines.push(`## ${file.path}`, "", sanitizeContextFileContentForPrompt(file.content), "");
|
|
42
39
|
return lines;
|
|
43
40
|
}
|
|
44
|
-
/** Heartbeat content belongs to the heartbeat user turn, never the system prompt. */
|
|
45
|
-
function isHeartbeatContextFile(pathValue) {
|
|
46
|
-
return getContextFileBasename(pathValue) === DEFAULT_HEARTBEAT_FILENAME.toLowerCase();
|
|
47
|
-
}
|
|
48
41
|
//#endregion
|
|
49
|
-
export { CONTEXT_FILE_ORDER,
|
|
42
|
+
export { CONTEXT_FILE_ORDER, buildProjectContextSection, getContextFileBasename, normalizeContextFilePath, sanitizeContextFileContentForPrompt, sortContextFilesForPrompt };
|
|
@@ -142,7 +142,7 @@ function buildToolingSection(params) {
|
|
|
142
142
|
hasRead ? `Use \`${readToolName}\` for targeted file inspection before editing; do not rely on filenames alone.` : "",
|
|
143
143
|
hasPatch ? `Use \`${patchToolName}\` for source changes; keep patches focused and inspect failures carefully.` : "",
|
|
144
144
|
hasWrite ? `Use \`${writeToolName}\` only for new files or intentional complete rewrites.` : "",
|
|
145
|
-
hasXopcUse && hasRead && hasWrite ? `When the user explicitly asks to change or customize the current agent's name, identity, personality, instructions, working style, tools,
|
|
145
|
+
hasXopcUse && hasRead && hasWrite ? `When the user explicitly asks to change or customize the current agent's name, identity, personality, instructions, working style, tools, or workspace, persist the change instead of only drafting advice. Inspect the current state first; use \`${readToolName}\` and \`${writeToolName}\` for the current agent's profile Markdown, and use \`xopc_use\` mode \`agent\` for structured settings. Target only the current runtime agent unless the user names another one, verify the saved result, and ask before consequential capability or scope expansion when intent is ambiguous.` : "",
|
|
146
146
|
hasXopcUse ? "When the user explicitly asks to create an Agent, use `xopc_use` mode `agent`: list first, create the Agent without a Project or custom workspace unless the user requests one, verify the result, and clearly identify the created Agent so the user can open its own conversation for further customization." : "",
|
|
147
147
|
hasGrep || hasFind ? `Use ${[hasGrep ? `\`${grepToolName}\`` : "", hasFind ? `\`${findToolName}\`` : ""].filter(Boolean).join(" and ")} for text/file discovery; use code graph or symbol tools when available for definitions and call relationships.` : "",
|
|
148
148
|
hasExec ? `Use \`${execToolName}\` for verification and safe inspection, not routine file editing.` : "",
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Combines base system prompt with skill prompts and bootstrap Project Context.
|
|
5
5
|
*/
|
|
6
6
|
import type { Config } from '../../config/schema.js';
|
|
7
|
+
import type { AgentProfile } from '../../agent-config/index.js';
|
|
7
8
|
import type { EmbeddedContextFile } from '../bootstrap/types.js';
|
|
8
9
|
import type { SkillManager } from '../skills/skill-manager.js';
|
|
9
10
|
import type { PromptMode, SilentReplyPromptMode } from './types.js';
|
|
@@ -13,6 +14,7 @@ export interface SystemPromptBuildOptions {
|
|
|
13
14
|
workspaceOverride?: string;
|
|
14
15
|
profileMarkdownPathRoot?: string;
|
|
15
16
|
customInstructions?: string;
|
|
17
|
+
agentProfile?: AgentProfile;
|
|
16
18
|
skillPromptText?: string;
|
|
17
19
|
skillAllowlist?: string[];
|
|
18
20
|
registeredToolNames?: string[];
|
|
@@ -7,13 +7,13 @@ import { DEFAULT_USER_TRUST_LEVEL, init_trust_policy } from "../../user-context/
|
|
|
7
7
|
import { getUserTrustPolicy } from "../../storage/sqlite/user-trust-repository.js";
|
|
8
8
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
9
9
|
import { appendStablePromptSection } from "./cache-boundary.js";
|
|
10
|
-
import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
|
|
11
|
-
import { buildTtsSystemPromptHint } from "../../voice/tts/directives.js";
|
|
12
10
|
import { getUserTimezone } from "../../user-model/repository.js";
|
|
13
11
|
import "../../user-model/index.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();
|
|
@@ -34,7 +34,6 @@ var SystemPromptBuilder = class {
|
|
|
34
34
|
const actionTrustLevel = isXopcDatabaseOpen() ? getUserTrustPolicy().defaultActionLevel : DEFAULT_USER_TRUST_LEVEL;
|
|
35
35
|
const interactionState = isXopcDatabaseOpen() && options.conversationId ? getInteractionState(options.conversationId) : void 0;
|
|
36
36
|
const interactionPrompt = interactionState ? buildInteractionStatePrompt(interactionState) : "";
|
|
37
|
-
const heartbeatEnabled = this.config.gateway?.heartbeat?.includeSystemPromptSection ?? false;
|
|
38
37
|
const userTimezone = isXopcDatabaseOpen() ? getUserTimezone() : void 0;
|
|
39
38
|
const ttsMerged = mergeTtsConfigFromAppConfig(this.config.messages?.tts);
|
|
40
39
|
const reg = options.registeredToolNames ?? [];
|
|
@@ -53,7 +52,6 @@ var SystemPromptBuilder = class {
|
|
|
53
52
|
toolSummaries: options.toolSummaries,
|
|
54
53
|
userTimezone,
|
|
55
54
|
externalMemoryInstructions: options.externalMemoryInstructions,
|
|
56
|
-
heartbeatEnabled,
|
|
57
55
|
ttsSystemHint,
|
|
58
56
|
extraSystemPrompt: [options.extraSystemPrompt, interactionPrompt].filter(Boolean).join("\n\n"),
|
|
59
57
|
activeProjectContext: options.activeProjectContext,
|
|
@@ -67,8 +65,6 @@ var SystemPromptBuilder = class {
|
|
|
67
65
|
const basePrompt = buildSystemPrompt(ws, {
|
|
68
66
|
contextFiles,
|
|
69
67
|
promptMode: resolved.promptMode,
|
|
70
|
-
heartbeatEnabled: resolved.heartbeatEnabled,
|
|
71
|
-
heartbeatPrompt: resolved.heartbeatPrompt,
|
|
72
68
|
toolNames: resolved.toolNames,
|
|
73
69
|
toolSummaries: resolved.toolSummaries,
|
|
74
70
|
memoryCitationsMode: resolved.memoryCitationsMode,
|
|
@@ -87,7 +83,8 @@ var SystemPromptBuilder = class {
|
|
|
87
83
|
includeToneSection: resolved.includeToneSection,
|
|
88
84
|
actionTrustLevel,
|
|
89
85
|
responseLanguage,
|
|
90
|
-
customInstructions: options.customInstructions
|
|
86
|
+
customInstructions: options.customInstructions,
|
|
87
|
+
agentProfile: options.agentProfile
|
|
91
88
|
});
|
|
92
89
|
const skillPrompt = options.skillPromptText !== void 0 ? options.skillPromptText : this.skillManager.getPromptForSkillAllowlist(options.skillAllowlist, options.registeredToolNames);
|
|
93
90
|
const fullPrompt = skillPrompt ? appendStablePromptSection(basePrompt, skillPrompt) : basePrompt;
|
|
@@ -115,13 +112,11 @@ var SystemPromptBuilder = class {
|
|
|
115
112
|
conversationId: options?.conversationId,
|
|
116
113
|
toolNames: options?.registeredToolNames,
|
|
117
114
|
userTimezone: isXopcDatabaseOpen() ? getUserTimezone() : void 0,
|
|
118
|
-
externalMemoryInstructions: options?.externalMemoryInstructions
|
|
119
|
-
heartbeatEnabled: this.config.gateway?.heartbeat?.includeSystemPromptSection ?? false
|
|
115
|
+
externalMemoryInstructions: options?.externalMemoryInstructions
|
|
120
116
|
});
|
|
121
117
|
return buildSystemPrompt(ws, {
|
|
122
118
|
contextFiles,
|
|
123
119
|
promptMode: resolved.promptMode,
|
|
124
|
-
heartbeatEnabled: resolved.heartbeatEnabled,
|
|
125
120
|
toolNames: resolved.toolNames,
|
|
126
121
|
userTimezone: resolved.userTimezone,
|
|
127
122
|
runtime: resolved.runtimeInfo,
|
|
@@ -21,8 +21,6 @@ export interface SystemPromptBuildParams {
|
|
|
21
21
|
channels?: string[];
|
|
22
22
|
memoryCitationsMode?: MemoryCitationsMode;
|
|
23
23
|
includeMemorySection?: boolean;
|
|
24
|
-
heartbeatEnabled?: boolean;
|
|
25
|
-
heartbeatPrompt?: string;
|
|
26
24
|
externalMemoryInstructions?: string;
|
|
27
25
|
ttsSystemHint?: string;
|
|
28
26
|
extraSystemPrompt?: string;
|
|
@@ -39,8 +37,6 @@ export declare function resolveSystemPromptBuildParams(config: Config, params: {
|
|
|
39
37
|
toolSummaries?: Record<string, string>;
|
|
40
38
|
userTimezone?: string;
|
|
41
39
|
externalMemoryInstructions?: string;
|
|
42
|
-
heartbeatEnabled?: boolean;
|
|
43
|
-
heartbeatPrompt?: string;
|
|
44
40
|
ttsSystemHint?: string;
|
|
45
41
|
extraSystemPrompt?: string;
|
|
46
42
|
activeProjectContext?: string;
|
|
@@ -58,8 +58,6 @@ function resolveSystemPromptBuildParams(config, params) {
|
|
|
58
58
|
channels: resolveDeliverableChannels(config),
|
|
59
59
|
memoryCitationsMode: params.memoryCitationsMode,
|
|
60
60
|
includeMemorySection: params.includeMemorySection,
|
|
61
|
-
heartbeatEnabled: params.heartbeatEnabled,
|
|
62
|
-
heartbeatPrompt: params.heartbeatPrompt,
|
|
63
61
|
externalMemoryInstructions: params.externalMemoryInstructions,
|
|
64
62
|
ttsSystemHint: params.ttsSystemHint,
|
|
65
63
|
extraSystemPrompt: params.extraSystemPrompt,
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* not to manually reread startup files.
|
|
7
7
|
*/
|
|
8
8
|
import type { EmbeddedContextFile } from '../bootstrap/types.js';
|
|
9
|
+
import type { AgentProfile } from '../../agent-config/index.js';
|
|
9
10
|
import type { ResponseLanguage } from '../../i18n/response-language.js';
|
|
10
11
|
import { type UserTrustLevel } from '../../user-context/trust-policy.js';
|
|
11
12
|
import type { ProviderSystemPromptContribution } from './contribution.js';
|
|
@@ -16,8 +17,6 @@ export { getContextFileBasename, sortContextFilesForPrompt, } from './sections/p
|
|
|
16
17
|
export interface SystemPromptOptions {
|
|
17
18
|
contextFiles?: EmbeddedContextFile[];
|
|
18
19
|
promptMode?: PromptMode;
|
|
19
|
-
heartbeatEnabled?: boolean;
|
|
20
|
-
heartbeatPrompt?: string;
|
|
21
20
|
/** Registered tool names for Tooling section and memory/skills gating. */
|
|
22
21
|
toolNames?: string[];
|
|
23
22
|
toolSummaries?: Record<string, string>;
|
|
@@ -38,6 +37,7 @@ export interface SystemPromptOptions {
|
|
|
38
37
|
actionTrustLevel?: UserTrustLevel;
|
|
39
38
|
responseLanguage?: ResponseLanguage;
|
|
40
39
|
customInstructions?: string;
|
|
40
|
+
agentProfile?: AgentProfile;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Build system prompt with bootstrap Project Context integration.
|
|
@@ -2,11 +2,12 @@ import { buildActionTrustPrompt, init_trust_policy } from "../../user-context/tr
|
|
|
2
2
|
import { PROMPT_CACHE_BOUNDARY, splitPromptCacheBoundary } from "./cache-boundary.js";
|
|
3
3
|
import { buildAestheticSection, buildExecutionBiasSection, buildHumanCollaborationSection, buildProblemSolvingSection, buildSafetySection, buildToolCallStyleSection, buildWorkContinuitySection } from "./sections/behavior.js";
|
|
4
4
|
import { buildExternalMemorySection, buildMemorySection, buildSkillsSection } from "./sections/memory-skills.js";
|
|
5
|
-
import {
|
|
6
|
-
import { buildProjectContextSection, getContextFileBasename,
|
|
5
|
+
import { buildMessagingSection, buildOutputDirectivesSection, buildSilentRepliesSection, buildTimeSection } from "./sections/messaging-runtime.js";
|
|
6
|
+
import { buildProjectContextSection, getContextFileBasename, sortContextFilesForPrompt } from "./sections/project-context.js";
|
|
7
7
|
import { buildToolingSection, hasSkillsTools } from "./sections/tooling.js";
|
|
8
8
|
import { buildRuntimeSection, buildWorkspaceFilesIntroSection, buildWorkspaceSection } from "./sections/workspace-runtime.js";
|
|
9
9
|
import { buildResponseLanguageSection } from "./sections/response-language.js";
|
|
10
|
+
import { buildAgentIdentitySection } from "./sections/agent-identity.js";
|
|
10
11
|
import { buildOverridablePromptSection } from "./system-prompt-params.js";
|
|
11
12
|
//#region src/agent/prompt/system-prompt.ts
|
|
12
13
|
init_trust_policy();
|
|
@@ -17,9 +18,10 @@ function joinSections(sections) {
|
|
|
17
18
|
* Build system prompt with bootstrap Project Context integration.
|
|
18
19
|
*/
|
|
19
20
|
function buildSystemPrompt(workspaceDir, options = {}) {
|
|
20
|
-
const { contextFiles = [], promptMode = "full",
|
|
21
|
+
const { contextFiles = [], promptMode = "full", toolNames = [], toolSummaries, memoryCitationsMode = "on", includeMemorySection, userTimezone, runtime, agentId, channels = [], externalMemoryInstructions, ttsSystemHint, extraSystemPrompt, activeProjectContext, silentReplyPromptMode = "generic", promptContribution, includeProblemSolving = true, includeToneSection = true, actionTrustLevel, responseLanguage = "auto", customInstructions, agentProfile } = options;
|
|
21
22
|
if (promptMode === "none") return joinSections([
|
|
22
23
|
"You are a personal AI assistant running inside xopc.",
|
|
24
|
+
buildAgentIdentitySection(agentProfile),
|
|
23
25
|
customInstructions?.trim() ? `<custom_instructions>\n${customInstructions.trim()}\n</custom_instructions>` : void 0,
|
|
24
26
|
buildResponseLanguageSection(responseLanguage),
|
|
25
27
|
activeProjectContext
|
|
@@ -28,10 +30,11 @@ function buildSystemPrompt(workspaceDir, options = {}) {
|
|
|
28
30
|
const normalizedTools = new Set(toolNames.map((tool) => tool.toLowerCase()));
|
|
29
31
|
const effectiveAgentId = agentId ?? runtime?.agentId;
|
|
30
32
|
const sectionOverrides = promptContribution?.sectionOverrides ?? {};
|
|
31
|
-
const orderedContextFiles = sortContextFilesForPrompt(contextFiles.filter((file) => file.path.trim().length > 0
|
|
33
|
+
const orderedContextFiles = sortContextFilesForPrompt(contextFiles.filter((file) => file.path.trim().length > 0));
|
|
32
34
|
const hasProfileMemory = orderedContextFiles.some((file) => getContextFileBasename(file.path) === "memory.md");
|
|
33
35
|
const stableSections = [
|
|
34
36
|
"You are a personal AI assistant running inside xopc.",
|
|
37
|
+
buildAgentIdentitySection(agentProfile) ?? "",
|
|
35
38
|
...customInstructions?.trim() ? [`<custom_instructions>\n${customInstructions.trim()}\n</custom_instructions>`] : [],
|
|
36
39
|
buildResponseLanguageSection(responseLanguage),
|
|
37
40
|
buildToolingSection({
|
|
@@ -95,11 +98,7 @@ function buildSystemPrompt(workspaceDir, options = {}) {
|
|
|
95
98
|
fallback: ""
|
|
96
99
|
});
|
|
97
100
|
if (providerDynamicSuffix) dynamicSections.push(providerDynamicSuffix);
|
|
98
|
-
dynamicSections.push(
|
|
99
|
-
enabled: heartbeatEnabled,
|
|
100
|
-
customPrompt: heartbeatPrompt,
|
|
101
|
-
userTimezone
|
|
102
|
-
}), buildRuntimeSection(runtime));
|
|
101
|
+
dynamicSections.push(buildRuntimeSection(runtime));
|
|
103
102
|
const stablePrefix = joinSections(stableSections);
|
|
104
103
|
const dynamicSuffix = joinSections(dynamicSections);
|
|
105
104
|
if (!dynamicSuffix.trim()) return `${stablePrefix}\n\n${PROMPT_CACHE_BOUNDARY}`.trim();
|
|
@@ -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,14 +1,14 @@
|
|
|
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
|
+
import { resolveImageHandlingStrategy } from "../image/vision-detection.js";
|
|
4
|
+
import { hydrateUserTurnForLlm } from "../inbound/attachment-pipeline.js";
|
|
5
|
+
import { buildDelegatedTaskDirective, buildTaskExecutionDirective } from "../../tasks/task-context-assembler.js";
|
|
6
|
+
import { shouldSkipResetOverlapCommand } from "../../session/reset-triggers.js";
|
|
3
7
|
import { parseSlashCommand } from "../../chat-commands/command-parse.js";
|
|
4
8
|
import { commandRegistry } from "../../chat-commands/registry.js";
|
|
5
9
|
import "../../chat-commands/index.js";
|
|
6
|
-
import { shouldSkipResetOverlapCommand } from "../../session/reset-triggers.js";
|
|
7
|
-
import { resolveImageHandlingStrategy } from "../image/vision-detection.js";
|
|
8
|
-
import { hydrateUserTurnForLlm } from "../inbound/attachment-pipeline.js";
|
|
9
10
|
import { runEmbeddedTurnForSession } from "../embedded/run-for-session.js";
|
|
10
11
|
import { injectSourceContextsIntoUserMessage } from "../source-context/injector.js";
|
|
11
|
-
import { buildDelegatedTaskDirective, buildTaskExecutionDirective } from "../../tasks/task-context-assembler.js";
|
|
12
12
|
import { prependAgentContext } from "../context/prepend.js";
|
|
13
13
|
import crypto from "node:crypto";
|
|
14
14
|
//#region src/agent/service/direct-turn-helpers.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { clearPendingTranscriptUserMessage, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
1
2
|
import { initSessionTurn } from "../../session/init-session-turn.js";
|
|
2
3
|
import "../../session/index.js";
|
|
3
|
-
import { clearPendingTranscriptUserMessage, setPendingTranscriptUserMessage } from "../inbound/attachment-pipeline.js";
|
|
4
4
|
import { buildDirectUserMessageContent } from "./build-direct-message-content.js";
|
|
5
5
|
import { hydratePerTurnState, runDirectAgentTurn, tryRunSlashCommand } from "./direct-turn-helpers.js";
|
|
6
6
|
//#region src/agent/service/process-direct-one-shot.ts
|