@romiluz/clawmongo 2026.3.31 → 2026.3.33
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/CHANGELOG.md +1 -0
- package/README.md +21 -1
- package/dist/.buildstamp +1 -1
- package/dist/{abort.runtime-CBZWFKHx.js → abort.runtime-BODXWFfB.js} +19 -19
- package/dist/{accounts-256Lpw3_.js → accounts-dqDVvpq9.js} +19 -19
- package/dist/{action-runtime-By1tjY4j.js → action-runtime-C5U1W3NV.js} +3 -3
- package/dist/{action-runtime-BCwNxCYz.js → action-runtime-Ofj_Pwoi.js} +1 -1
- package/dist/{actions.runtime-GIuEnX5c.js → actions.runtime-D-PFCdDQ.js} +19 -19
- package/dist/{actions.runtime-BxXCTdgf.js → actions.runtime-D6T0Q1In.js} +22 -22
- package/dist/{agent-runner.runtime-D9LcBP7a.js → agent-runner.runtime-B_117lau.js} +20 -20
- package/dist/{agent-tools-login-D9QlyPBk.js → agent-tools-login-CIEGcx5C.js} +1 -1
- package/dist/agents/auth-profiles.runtime.js +2 -2
- package/dist/agents/pi-model-discovery-runtime.js +2 -2
- package/dist/{agents-CVZPbAax.js → agents-BGEZrH6E.js} +79 -79
- package/dist/{agents-Tnjt3Tfi.js → agents-DGb9FxeN.js} +4 -4
- package/dist/{api-kAoyZLGE.js → api-BHHbe6ya.js} +19 -19
- package/dist/{apply-CSgSTV31.js → apply-D5KZtgEs.js} +3 -3
- package/dist/{apply.runtime-BDFdeq7V.js → apply.runtime-C2coDVDp.js} +21 -21
- package/dist/{audit-kLLus1gm.js → audit-BTQT-OZ7.js} +1 -1
- package/dist/{audit-DI8FYBF-.js → audit-C1i5hvgH.js} +1 -1
- package/dist/{audit-dQxBQt16.js → audit-CSQcL00K.js} +1 -1
- package/dist/{audit-channel.collect.runtime-CCR8jR42.js → audit-channel.collect.runtime-CLO8pKCH.js} +1 -1
- package/dist/{audit-membership-runtime-DpPWzuTj.js → audit-membership-runtime-BaLdjBE1.js} +19 -19
- package/dist/{audit.runtime-D_EJ3boD.js → audit.runtime-Df1m5JVh.js} +1 -1
- package/dist/{auth-choice-CLy97hbI.js → auth-choice-CLVts4pn.js} +25 -25
- package/dist/{auth-choice-C5McfL86.js → auth-choice-D32orvb3.js} +4 -4
- package/dist/{auth-choice-CNgSjNra.js → auth-choice-DC9SHojq.js} +25 -25
- package/dist/{auth-choice-options-BSdoCxVO.js → auth-choice-options-DaRIYac6.js} +1 -1
- package/dist/{auth-choice-prompt-CSTIBRxx.js → auth-choice-prompt-BIxKeFyU.js} +22 -22
- package/dist/{auth-choice-prompt-ClPBv5Hb.js → auth-choice-prompt-bvPCPOfL.js} +1 -1
- package/dist/{auth-choice.plugin-providers.runtime-BvBk5zj8.js → auth-choice.plugin-providers.runtime-C0Gr_wBp.js} +20 -20
- package/dist/{auth-health-YaKxC3_1.js → auth-health-Grs1Tm7I.js} +1 -1
- package/dist/{auth-profiles-v2ZAir2o.js → auth-profiles-C3_OccUL.js} +1 -1
- package/dist/{bluebubbles-C9A57ciK.js → bluebubbles-p5n3iDOr.js} +2 -2
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +19 -19
- package/dist/bundled/session-memory/handler.js +20 -20
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-E-KD0cHt.js → channel-BH3R_0z4.js} +1 -1
- package/dist/{channel-k__povtY.js → channel-BNsYAkzk.js} +2 -2
- package/dist/{channel-CAA94kAx.js → channel-BPJidiH0.js} +1 -1
- package/dist/{channel-fOhV_J6a.js → channel-B_kqKNYN.js} +8 -8
- package/dist/{channel-Bm6vQ7Vk.js → channel-C7ZLRJK3.js} +3 -3
- package/dist/{channel-BcHlUn1x.js → channel-CMTnTZvP.js} +2 -2
- package/dist/{channel-Cbyd5iYB.js → channel-CNiLspA4.js} +2 -2
- package/dist/{channel-DMllR7sN.js → channel-D7wbYYfq.js} +2 -2
- package/dist/{channel-wpeZAdJl.js → channel-DXN0it_k.js} +5 -5
- package/dist/{channel-Cfx75uDY2.js → channel-TVpnR3_92.js} +1 -1
- package/dist/{channel-account-context-Bj5Ap7Uy.js → channel-account-context-D0u_DsE9.js} +1 -1
- package/dist/{channel-plugin-resolution-FPqk6upJ.js → channel-plugin-resolution-BWF7cMnp.js} +1 -1
- package/dist/{channel-DiWzi-Z9.js → channel-s-DEd3xe.js} +6 -6
- package/dist/{channel-shared-BDFGo_d6.js → channel-shared-BkFrM4rg.js} +1 -1
- package/dist/{channel-summary-ZBxYr-BD.js → channel-summary-C2ehIc9T.js} +1 -1
- package/dist/{channel-summary-BaB6JLjL.js → channel-summary-C7G79FoU.js} +2 -2
- package/dist/{channel-DLsGlHed.js → channel-tI13LeFy.js} +3 -3
- package/dist/{channel.runtime-DL2L4PBZ.js → channel.runtime-BW1CY17-.js} +20 -20
- package/dist/{channel.runtime-BQ4BzagZ.js → channel.runtime-BZoo7HMI.js} +22 -22
- package/dist/{channel.runtime-zyLXuzKv.js → channel.runtime-C5J1_m0z.js} +19 -19
- package/dist/{channel.runtime-B6xeMwMc.js → channel.runtime-Ct_bKj0l.js} +21 -21
- package/dist/{channel.runtime-bS2ATGEr.js → channel.runtime-CySK5bcO.js} +21 -21
- package/dist/{channel.runtime-BEJ4hBtm.js → channel.runtime-DoX7dBG7.js} +19 -19
- package/dist/{channel.runtime-fJE2Uv7C.js → channel.runtime-F83uGGg1.js} +20 -20
- package/dist/{channel.runtime-Cs1nBp_b.js → channel.runtime-MYP-i9w_.js} +4 -4
- package/dist/{channel.runtime-DVnUJJdT.js → channel.runtime-NAgMynid.js} +21 -21
- package/dist/{channel.runtime-3haExTH6.js → channel.runtime-OOpSO68N.js} +20 -20
- package/dist/{channel.runtime-D0KC-jG7.js → channel.runtime-bDBx8teP.js} +24 -24
- package/dist/{channel.runtime-DNqjL-Ln.js → channel.runtime-yJfsTOE1.js} +21 -21
- package/dist/{channels-DQBlQQrk.js → channels-DBgKkMpO.js} +1 -1
- package/dist/{channels-BfTj2PAc.js → channels-DV6kTofy.js} +75 -75
- package/dist/{channels-cli-COIjLRrE.js → channels-cli-DFl3cqMv.js} +28 -28
- package/dist/{clawbot-cli-UsX8B-JC.js → clawbot-cli-D2rd_pSe.js} +20 -20
- package/dist/cli/memory-cli.js +1 -1
- package/dist/{cli-BsveDkwV.js → cli-RV7cVB9I.js} +19 -19
- package/dist/cli-startup-metadata.json +1 -1
- package/dist/{command-registry-qQjN8Ype.js → command-registry-B3J7A6FS.js} +9 -9
- package/dist/{command-registry-zjq2WVu_.js → command-registry-Bj0LnTVT.js} +2 -2
- package/dist/{command-secret-gateway-C1EpZaYu.js → command-secret-gateway-CW9sDqgS.js} +19 -19
- package/dist/{commands-core-Dsj3CaMs.js → commands-core-D6dqx9zi.js} +4 -4
- package/dist/{commands-core.runtime-DYTk8kt6.js → commands-core.runtime-BRCfd-33.js} +21 -21
- package/dist/{commands-handlers.runtime-JbCSciWA.js → commands-handlers.runtime-CR0HGQzR.js} +37 -37
- package/dist/{commands-status.runtime-4le0QhLr.js → commands-status.runtime-DjQOH6g-.js} +19 -19
- package/dist/{commands.runtime-BfqO2kHQ.js → commands.runtime-hsb9KcEQ.js} +21 -21
- package/dist/{compact.runtime-CSWiKfxL.js → compact.runtime-C2XAKSLI.js} +19 -19
- package/dist/{completion-cli-DEuK1m4B.js → completion-cli-COY2jqyd.js} +3 -3
- package/dist/{completion-cli-CrnAbjgi.js → completion-cli-C_WAEEE3.js} +2 -2
- package/dist/{config-cli-Cq7Y1WGO.js → config-cli-D_W95p5D.js} +21 -21
- package/dist/{config-guard-BI_MUR9S.js → config-guard-DPjo5ueL.js} +1 -1
- package/dist/{config-validation-BmBOmlo6.js → config-validation-CObsiwtW.js} +1 -1
- package/dist/{configure-CDhjeL6x.js → configure-BoT1Mn9Y.js} +10 -10
- package/dist/{configure-D3Iva24K.js → configure-CiOOIY9X.js} +80 -80
- package/dist/{credentials-Do95FF_5.js → credentials-BP_REzGo.js} +22 -22
- package/dist/{credentials-read-CZ9hc1hW.js → credentials-read-Ctw8fUHL.js} +1 -1
- package/dist/{credentials-write.runtime-BNZpXVG3.js → credentials-write.runtime-C-esgXXQ.js} +2 -2
- package/dist/{daemon-install-GPm24bM4.js → daemon-install-D5g6l5YG.js} +2 -2
- package/dist/{deliver-DOIj_10v.js → deliver-BmBKH0vq.js} +19 -19
- package/dist/{deliver-runtime-rhGItjx0.js → deliver-runtime-CM7bZfks.js} +19 -19
- package/dist/{directive-handling.fast-lane-CP7g4eqP.js → directive-handling.fast-lane-B6I-x6TA.js} +22 -22
- package/dist/{directive-handling.impl-C5fXbYoU.js → directive-handling.impl-BlbYq7u0.js} +5 -5
- package/dist/{directive-handling.impl-Du7GIJCI.js → directive-handling.impl-BmUx8KZn.js} +22 -22
- package/dist/{directive-handling.persist.runtime-DHYSMC3t.js → directive-handling.persist.runtime-BShZSJBB.js} +4 -4
- package/dist/{directive-handling.shared-D9Qp4qBu.js → directive-handling.shared-CqEG8VVf.js} +1 -1
- package/dist/{directory-cli-MGZpBHMI.js → directory-cli-D7G5ix1A.js} +21 -21
- package/dist/{discord-CkL1CbLZ.js → discord-DXsmxXiz.js} +29 -29
- package/dist/{discord-DVjQ-DvJ.js → discord-qTmPDm9r.js} +8 -8
- package/dist/{dispatch-acp.runtime-DmwlgoFE.js → dispatch-acp.runtime-D75jx8-p.js} +21 -21
- package/dist/{doctor-completion-BI17hUZP.js → doctor-completion-DL3ak6p_.js} +1 -1
- package/dist/{doctor-config-preflight-DJ2CpABg.js → doctor-config-preflight-BJ5wj6AI.js} +1 -1
- package/dist/{doctor-config-preflight-BrDhJTRg.js → doctor-config-preflight-D1A0fJZk.js} +1 -1
- package/dist/{doctor-state-migrations-DOA54fyw.js → doctor-state-migrations-Cw9TTCJ1.js} +20 -20
- package/dist/{doctor-state-migrations-DGjrIHzs.js → doctor-state-migrations-CyD4ajcS.js} +1 -1
- package/dist/{encryption-guidance-BPRK7Uku.js → encryption-guidance-C0063Qkl.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/extensionAPI.js +19 -19
- package/dist/extensions/amazon-bedrock/index.js +19 -19
- package/dist/extensions/anthropic/index.js +20 -20
- package/dist/extensions/anthropic/media-understanding-provider.js +2 -2
- package/dist/extensions/bluebubbles/api.js +23 -23
- package/dist/extensions/bluebubbles/index.js +24 -24
- package/dist/extensions/bluebubbles/runtime-api.js +19 -19
- package/dist/extensions/bluebubbles/setup-entry.js +21 -21
- package/dist/extensions/byteplus/index.js +19 -19
- package/dist/extensions/chutes/index.js +20 -20
- package/dist/extensions/cloudflare-ai-gateway/index.js +19 -19
- package/dist/extensions/deepgram/audio.js +1 -1
- package/dist/extensions/deepgram/index.js +1 -1
- package/dist/extensions/deepgram/media-understanding-provider.js +1 -1
- package/dist/extensions/device-pair/api.js +19 -19
- package/dist/extensions/device-pair/index.js +19 -19
- package/dist/extensions/device-pair/notify.js +19 -19
- package/dist/extensions/device-pair/qr-image.js +19 -19
- package/dist/extensions/discord/api.js +19 -19
- package/dist/extensions/discord/index.js +27 -27
- package/dist/extensions/discord/runtime-api.js +29 -29
- package/dist/extensions/discord/setup-entry.js +22 -22
- package/dist/extensions/elevenlabs/index.js +19 -19
- package/dist/extensions/elevenlabs/speech-provider.js +19 -19
- package/dist/extensions/fal/image-generation-provider.js +20 -20
- package/dist/extensions/fal/index.js +20 -20
- package/dist/extensions/feishu/api.js +19 -19
- package/dist/extensions/feishu/index.js +22 -22
- package/dist/extensions/feishu/runtime-api.js +19 -19
- package/dist/extensions/feishu/setup-api.js +19 -19
- package/dist/extensions/feishu/setup-entry.js +20 -20
- package/dist/extensions/firecrawl/index.js +19 -19
- package/dist/extensions/github-copilot/index.js +20 -20
- package/dist/extensions/github-copilot/login.js +19 -19
- package/dist/extensions/google/gemini-cli-provider.js +19 -19
- package/dist/extensions/google/image-generation-provider.js +19 -19
- package/dist/extensions/google/index.js +19 -19
- package/dist/extensions/google/media-understanding-provider.js +2 -2
- package/dist/extensions/google/oauth.flow.js +19 -19
- package/dist/extensions/google/oauth.http.js +19 -19
- package/dist/extensions/google/oauth.js +19 -19
- package/dist/extensions/google/oauth.project.js +19 -19
- package/dist/extensions/google/oauth.runtime.js +19 -19
- package/dist/extensions/google/oauth.token.js +19 -19
- package/dist/extensions/googlechat/api.js +19 -19
- package/dist/extensions/googlechat/index.js +20 -20
- package/dist/extensions/googlechat/runtime-api.js +19 -19
- package/dist/extensions/googlechat/setup-entry.js +20 -20
- package/dist/extensions/groq/index.js +1 -1
- package/dist/extensions/groq/media-understanding-provider.js +1 -1
- package/dist/extensions/huggingface/index.js +19 -19
- package/dist/extensions/imessage/api.js +19 -19
- package/dist/extensions/imessage/index.js +23 -23
- package/dist/extensions/imessage/runtime-api.js +20 -20
- package/dist/extensions/imessage/setup-entry.js +23 -23
- package/dist/extensions/irc/api.js +19 -19
- package/dist/extensions/irc/index.js +21 -21
- package/dist/extensions/irc/setup-entry.js +20 -20
- package/dist/extensions/kilocode/index.js +19 -19
- package/dist/extensions/kimi-coding/index.js +19 -19
- package/dist/extensions/line/api.js +19 -19
- package/dist/extensions/line/index.js +21 -21
- package/dist/extensions/line/runtime-api.js +19 -19
- package/dist/extensions/line/setup-api.js +19 -19
- package/dist/extensions/line/setup-entry.js +21 -21
- package/dist/extensions/lobster/index.js +19 -19
- package/dist/extensions/lobster/runtime-api.js +19 -19
- package/dist/extensions/matrix/api.js +28 -28
- package/dist/extensions/matrix/helper-api.js +20 -20
- package/dist/extensions/matrix/index.js +32 -32
- package/dist/extensions/matrix/runtime-api.js +20 -20
- package/dist/extensions/matrix/setup-entry.js +27 -27
- package/dist/extensions/mattermost/api.js +20 -20
- package/dist/extensions/mattermost/index.js +21 -21
- package/dist/extensions/mattermost/runtime-api.js +19 -19
- package/dist/extensions/mattermost/setup-entry.js +20 -20
- package/dist/extensions/microsoft/index.js +19 -19
- package/dist/extensions/microsoft/speech-provider.js +19 -19
- package/dist/extensions/microsoft-foundry/auth.js +19 -19
- package/dist/extensions/microsoft-foundry/cli.js +19 -19
- package/dist/extensions/microsoft-foundry/index.js +19 -19
- package/dist/extensions/microsoft-foundry/onboard.js +19 -19
- package/dist/extensions/microsoft-foundry/provider.js +19 -19
- package/dist/extensions/microsoft-foundry/runtime.js +19 -19
- package/dist/extensions/microsoft-foundry/shared-runtime.js +19 -19
- package/dist/extensions/microsoft-foundry/shared.js +19 -19
- package/dist/extensions/minimax/image-generation-provider.js +20 -20
- package/dist/extensions/minimax/index.js +21 -21
- package/dist/extensions/minimax/media-understanding-provider.js +2 -2
- package/dist/extensions/minimax/oauth.js +20 -20
- package/dist/extensions/minimax/oauth.runtime.js +20 -20
- package/dist/extensions/mistral/index.js +2 -2
- package/dist/extensions/mistral/media-understanding-provider.js +2 -2
- package/dist/extensions/moonshot/index.js +19 -19
- package/dist/extensions/moonshot/media-understanding-provider.js +2 -2
- package/dist/extensions/msteams/api.js +21 -21
- package/dist/extensions/msteams/index.js +22 -22
- package/dist/extensions/msteams/runtime-api.js +19 -19
- package/dist/extensions/msteams/setup-entry.js +22 -22
- package/dist/extensions/nextcloud-talk/api.js +20 -20
- package/dist/extensions/nextcloud-talk/index.js +21 -21
- package/dist/extensions/nextcloud-talk/runtime-api.js +19 -19
- package/dist/extensions/nextcloud-talk/setup-entry.js +20 -20
- package/dist/extensions/nostr/api.js +19 -19
- package/dist/extensions/nostr/index.js +21 -21
- package/dist/extensions/nostr/runtime-api.js +19 -19
- package/dist/extensions/nostr/setup-api.js +20 -20
- package/dist/extensions/nostr/setup-entry.js +21 -21
- package/dist/extensions/openai/image-generation-provider.js +20 -20
- package/dist/extensions/openai/index.js +24 -24
- package/dist/extensions/openai/media-understanding-provider.js +2 -2
- package/dist/extensions/openai/openai-codex-provider.js +21 -21
- package/dist/extensions/openai/openai-codex-provider.runtime.js +19 -19
- package/dist/extensions/openai/openai-provider.js +20 -20
- package/dist/extensions/openai/speech-provider.js +19 -19
- package/dist/extensions/opencode/index.js +19 -19
- package/dist/extensions/opencode-go/index.js +19 -19
- package/dist/extensions/openrouter/index.js +19 -19
- package/dist/extensions/sglang/index.js +19 -19
- package/dist/extensions/signal/api.js +19 -19
- package/dist/extensions/signal/index.js +22 -22
- package/dist/extensions/signal/runtime-api.js +19 -19
- package/dist/extensions/signal/setup-entry.js +22 -22
- package/dist/extensions/slack/api.js +19 -19
- package/dist/extensions/slack/index.js +23 -23
- package/dist/extensions/slack/node_modules/.package-lock.json +11 -8
- package/dist/extensions/slack/node_modules/axios/README.md +26 -1
- package/dist/extensions/slack/node_modules/axios/dist/axios.js +91 -100
- package/dist/extensions/slack/node_modules/axios/dist/axios.js.map +1 -1
- package/dist/extensions/slack/node_modules/axios/dist/axios.min.js +2 -2
- package/dist/extensions/slack/node_modules/axios/dist/axios.min.js.map +1 -1
- package/dist/extensions/slack/node_modules/axios/dist/browser/axios.cjs +70 -84
- package/dist/extensions/slack/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/dist/extensions/slack/node_modules/axios/dist/esm/axios.js +99 -116
- package/dist/extensions/slack/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/dist/extensions/slack/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/dist/extensions/slack/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/dist/extensions/slack/node_modules/axios/dist/node/axios.cjs +1421 -2367
- package/dist/extensions/slack/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/dist/extensions/slack/node_modules/axios/lib/adapters/fetch.js +5 -1
- package/dist/extensions/slack/node_modules/axios/lib/adapters/http.js +5 -2
- package/dist/extensions/slack/node_modules/axios/lib/core/Axios.js +0 -2
- package/dist/extensions/slack/node_modules/axios/lib/core/AxiosHeaders.js +3 -1
- package/dist/extensions/slack/node_modules/axios/lib/env/data.js +1 -1
- package/dist/extensions/slack/node_modules/axios/lib/helpers/buildURL.js +2 -2
- package/dist/extensions/slack/node_modules/axios/package.json +93 -132
- package/dist/extensions/slack/node_modules/proxy-from-env/README.md +43 -11
- package/dist/extensions/slack/node_modules/proxy-from-env/index.cjs +105 -0
- package/dist/extensions/slack/node_modules/proxy-from-env/index.js +14 -19
- package/dist/extensions/slack/node_modules/proxy-from-env/package.json +20 -11
- package/dist/extensions/slack/runtime-api.js +23 -23
- package/dist/extensions/slack/setup-entry.js +22 -22
- package/dist/extensions/synology-chat/index.js +21 -21
- package/dist/extensions/synology-chat/setup-api.js +19 -19
- package/dist/extensions/synology-chat/setup-entry.js +20 -20
- package/dist/extensions/tavily/index.js +19 -19
- package/dist/extensions/telegram/api.js +19 -19
- package/dist/extensions/telegram/index.js +21 -21
- package/dist/extensions/telegram/runtime-api.js +19 -19
- package/dist/extensions/telegram/setup-entry.js +21 -21
- package/dist/extensions/tlon/index.js +20 -20
- package/dist/extensions/tlon/setup-api.js +19 -19
- package/dist/extensions/tlon/setup-entry.js +20 -20
- package/dist/extensions/twitch/index.js +19 -19
- package/dist/extensions/vllm/index.js +19 -19
- package/dist/extensions/voice-call/api.js +19 -19
- package/dist/extensions/voice-call/index.js +19 -19
- package/dist/extensions/voice-call/runtime-api.js +19 -19
- package/dist/extensions/volcengine/index.js +19 -19
- package/dist/extensions/whatsapp/action-runtime-api.js +23 -23
- package/dist/extensions/whatsapp/action-runtime.runtime.js +23 -23
- package/dist/extensions/whatsapp/api.js +22 -22
- package/dist/extensions/whatsapp/auth-presence.js +19 -19
- package/dist/extensions/whatsapp/index.js +25 -25
- package/dist/extensions/whatsapp/light-runtime-api.js +22 -22
- package/dist/extensions/whatsapp/login-qr-api.js +21 -21
- package/dist/extensions/whatsapp/runtime-api.js +25 -25
- package/dist/extensions/whatsapp/setup-entry.js +23 -23
- package/dist/extensions/xai/index.js +19 -19
- package/dist/extensions/zai/index.js +20 -20
- package/dist/extensions/zai/media-understanding-provider.js +2 -2
- package/dist/extensions/zalo/api.js +19 -19
- package/dist/extensions/zalo/index.js +21 -21
- package/dist/extensions/zalo/runtime-api.js +19 -19
- package/dist/extensions/zalo/setup-entry.js +20 -20
- package/dist/extensions/zalouser/api.js +19 -19
- package/dist/extensions/zalouser/index.js +21 -21
- package/dist/extensions/zalouser/runtime-api.js +19 -19
- package/dist/extensions/zalouser/setup-entry.js +20 -20
- package/dist/{feishu-032avHo-.js → feishu-C8db2nD4.js} +2 -2
- package/dist/{gateway-cli-B6RmL7DU.js → gateway-cli-BhZJxUIQ.js} +52 -52
- package/dist/{get-reply-from-config.runtime-CNXikh4t.js → get-reply-from-config.runtime-DFU6Um_0.js} +19 -19
- package/dist/{health-jAeEfKcx.js → health-BRYBj_5M.js} +2 -2
- package/dist/{health-Cr2RHats.js → health-CHQfsRmf.js} +1 -1
- package/dist/{helper-api-D4pFdc-A.js → helper-api-BAFfB8Eq.js} +1 -1
- package/dist/{hooks-cli-OhIK-Jwz.js → hooks-cli-D680qRUg.js} +27 -27
- package/dist/{image-MtAkUhKP.js → image-F5pDB1aX.js} +19 -19
- package/dist/{image-generation-provider-CpNAFwzF.js → image-generation-provider-B6SkqaSK.js} +1 -1
- package/dist/{image-generation-provider-D8YsS1rn.js → image-generation-provider-D_5H6_l5.js} +1 -1
- package/dist/{image-generation-provider-UYEVOEd0.js → image-generation-provider-GwhE-YOJ.js} +1 -1
- package/dist/{imessage-D0fRSnp0.js → imessage-3enMK0oL.js} +5 -5
- package/dist/{imessage-B9WX3VyA.js → imessage-CqmmhRly.js} +20 -20
- package/dist/{imessage-DA6FgvBt.js → imessage-qV2vB2Yv.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{input-files-1btaqY7P.js → input-files-Bwd7Rs-c.js} +1 -1
- package/dist/{irc-YBAB_ERE.js → irc-DrWWRnSY.js} +2 -2
- package/dist/{kb-cli-DgdR904k.js → kb-cli-Ck-nSjXd.js} +6 -6
- package/dist/{level-overrides-DuwDsvf4.js → level-overrides-X6UNF009.js} +3 -3
- package/dist/{library-8bTT9vzg.js → library-DmIlb86_.js} +19 -19
- package/dist/{line-Bzir-OER.js → line-BgImerRg.js} +2 -2
- package/dist/{llm-slug-generator-CyV5su8d.js → llm-slug-generator-DQijKyaC.js} +1 -1
- package/dist/llm-slug-generator.js +20 -20
- package/dist/{login-qr-C787VIZB.js → login-qr-D0IAlBAC.js} +2 -2
- package/dist/{login-qr-DIGtSUSe.js → login-qr-DniSe8iC.js} +21 -21
- package/dist/{manager.runtime-BiGaBsRN.js → manager.runtime-xm4xKgte.js} +19 -19
- package/dist/{matrix-B8InU2XN.js → matrix-BNIQQoE_.js} +1 -1
- package/dist/{matrix-migration-snapshot-BV2mwHhy.js → matrix-migration-snapshot-BipzOsHf.js} +1 -1
- package/dist/{mattermost-CFQiUJCu.js → mattermost-D6Fy4qN7.js} +2 -2
- package/dist/{media-understanding-BXkVRtCI.js → media-understanding-DJxYqJn2.js} +1 -1
- package/dist/{media-understanding-provider-CI5MQviC.js → media-understanding-provider-4eF385V2.js} +1 -1
- package/dist/{media-understanding-provider-BgyEbqug.js → media-understanding-provider-CgHUcWaB.js} +1 -1
- package/dist/{media-understanding-provider-8FcgSAxz.js → media-understanding-provider-CpzJJwj-.js} +1 -1
- package/dist/{media-understanding-provider-DIdBJ9Xp.js → media-understanding-provider-D1B39cXD.js} +1 -1
- package/dist/{media-understanding-provider-BcCjF67F.js → media-understanding-provider-DmNcx7tm.js} +1 -1
- package/dist/{media-understanding-provider-CsJmTq35.js → media-understanding-provider-_7CqM13n.js} +1 -1
- package/dist/{media-understanding-provider-CBOmy0_0.js → media-understanding-provider-lhiwHTQe.js} +1 -1
- package/dist/{media-understanding.runtime-DVVJmGSv.js → media-understanding.runtime-CovHOYvs.js} +19 -19
- package/dist/{memory-cli-CmlCSSU8.js → memory-cli-f2A63Z3i.js} +1 -1
- package/dist/{memory-cli.runtime-Z_TFVK44.js → memory-cli.runtime-CrZ3hOR4.js} +20 -20
- package/dist/{memory-tool.runtime-CbpALwGz.js → memory-tool.runtime-tPWYHa4h.js} +8 -8
- package/dist/{message-handler-DJCUJDuA.js → message-handler-CPqHBuUA.js} +5 -5
- package/dist/{model-catalog.runtime-2xR9DL3-.js → model-catalog.runtime-J03LOP_0.js} +19 -19
- package/dist/{model-picker-6CJrma4y.js → model-picker-B1dYBlNq.js} +20 -20
- package/dist/{model-picker-Dru3xiO2.js → model-picker-BLbQLW-8.js} +2 -2
- package/dist/{model-picker.runtime-BXOTybjR.js → model-picker.runtime-DqkKpuuM.js} +21 -21
- package/dist/{model-suppression.runtime-Ch3LqX5E.js → model-suppression.runtime-DZ5rCs4V.js} +19 -19
- package/dist/{models-DQKHO2UC.js → models-DZagEqNI.js} +23 -23
- package/dist/{models-CaJUrFJw.js → models-FROY9JT8.js} +5 -5
- package/dist/{models-cli-DkSoyfO3.js → models-cli-C7WtN2US.js} +23 -23
- package/dist/{models-config-DZWh3wCS.js → models-config-BxPPQ_Xn.js} +19 -19
- package/dist/{models-config.runtime-Csw9D9Eh.js → models-config.runtime-CX16Xh37.js} +19 -19
- package/dist/{mongodb-analytics-DrEyw-zF.js → mongodb-analytics-Csq_gZGe.js} +1 -1
- package/dist/{mongodb-analytics-CrA0mSGw.js → mongodb-analytics-D5c4_54u.js} +2 -2
- package/dist/{mongodb-kb-DUUWKxNi.js → mongodb-kb-DLMbN3EX.js} +1 -1
- package/dist/{mongodb-kb-search-BGTpjjGf.js → mongodb-kb-search-41d-jF5h.js} +3 -3
- package/dist/{mongodb-kb-search-Cgkz-lmv.js → mongodb-kb-search-p3yHZihO.js} +1 -1
- package/dist/{mongodb-manager-BV_j5Yce.js → mongodb-manager-CZKPOn9-.js} +835 -99
- package/dist/{mongodb-manager-Biv93U0H.js → mongodb-manager-DB_QPKNS.js} +7 -7
- package/dist/{mongodb-procedures-Cw_cRVPq.js → mongodb-procedures-BxD5_Od0.js} +3 -3
- package/dist/{mongodb-procedures-DnwLD-cO.js → mongodb-procedures-FqFUZ4EE.js} +2 -2
- package/dist/{mongodb-schema-BVL5w9BA.js → mongodb-schema-CQaRrvZd.js} +1 -1
- package/dist/{mongodb-schema-GMwMn5aY.js → mongodb-schema-xrNHiVhH.js} +128 -31
- package/dist/{mongodb-search-DLeKW4uS.js → mongodb-search-C7HfqDY2.js} +1 -1
- package/dist/{mongodb-structured-memory-0q2ekhJA.js → mongodb-structured-memory-D1yQLG0x.js} +3 -3
- package/dist/{mongodb-structured-memory-B-kVmcth.js → mongodb-structured-memory-Yccp2p-h.js} +2 -2
- package/dist/{monitor-C69ir4uG.js → monitor-BME1o7pu.js} +19 -19
- package/dist/{monitor-CDt0S8xC.js → monitor-Chh7Miml.js} +27 -27
- package/dist/{monitor-SuEcqRu3.js → monitor-D6IJ9tTv.js} +3 -3
- package/dist/{monitor-Xo3VU-wW.js → monitor-DEpKYWtl.js} +19 -19
- package/dist/{monitor-DRB_fLkJ.js → monitor-DKkPvN7m.js} +20 -20
- package/dist/{monitor-BIyUFMVX.js → monitor-DOu3Ia0T.js} +1 -1
- package/dist/{nextcloud-talk-agsgfFjz.js → nextcloud-talk-D0WWjkP4.js} +2 -2
- package/dist/{node-cli-DofJfBBE.js → node-cli-Dg4euaAB.js} +19 -19
- package/dist/{nodes-cli-SNw1MX_K.js → nodes-cli-CR7K7GJ0.js} +19 -19
- package/dist/{oauth-DBzhQTd_.js → oauth-B4LMwV_0.js} +1 -1
- package/dist/{onboard-CvTseD2x.js → onboard-CZDDU8yf.js} +4 -4
- package/dist/{onboard-channels-GUcSQbZH.js → onboard-channels-BcBffi7N.js} +68 -68
- package/dist/{onboard-channels-Bo5d3rof.js → onboard-channels-CCjGYLNZ.js} +21 -21
- package/dist/{onboard-custom-jzmYeBPE.js → onboard-custom-BZ-vv1WO.js} +1 -1
- package/dist/{onboard-custom-DwgQ4K34.js → onboard-custom-CkTSj0YZ.js} +21 -21
- package/dist/{onboard-search-BFP8baYg.js → onboard-search-DoLw7J22.js} +19 -19
- package/dist/{onboarding-memory-K_kjXDqY.js → onboarding-memory-DAIRJoqn.js} +2 -2
- package/dist/{openai-codex-provider-BRyHUGXD.js → openai-codex-provider-CpEAQYdU.js} +2 -2
- package/dist/{openai-provider-BhmM1Cq4.js → openai-provider-DmPBYNJG.js} +1 -1
- package/dist/{openclaw-tools.runtime-BiR0y2tq.js → openclaw-tools.runtime-Bk0T5vfp.js} +19 -19
- package/dist/{pi-embedded-Co091_an.js → pi-embedded-gwZ5hg-9.js} +39 -39
- package/dist/{pi-embedded.runtime-aBYwZl1k.js → pi-embedded.runtime-DbyjNojX.js} +19 -19
- package/dist/{plugin-entry.runtime-CBQYDDSg.js → plugin-entry.runtime-BBozbg33.js} +25 -25
- package/dist/{plugin-install-Bq-UaXp5.js → plugin-install-BJxeypaA.js} +20 -20
- package/dist/{plugin-install-DYdfHNHF.js → plugin-install-CD7iRmTH.js} +1 -1
- package/dist/{plugin-install-config-policy-CAUakocL.js → plugin-install-config-policy-DAx-ilyj.js} +1 -1
- package/dist/{plugin-registry-DkTJiea7.js → plugin-registry-B0XRdoj7.js} +1 -1
- package/dist/{plugin-registry-E-375dF2.js → plugin-registry-CRe2cv80.js} +20 -20
- package/dist/plugin-sdk/account-resolution.js +19 -19
- package/dist/plugin-sdk/agent-runtime.js +19 -19
- package/dist/plugin-sdk/allow-from.js +19 -19
- package/dist/plugin-sdk/bluebubbles.js +19 -19
- package/dist/plugin-sdk/channel-config-helpers.js +19 -19
- package/dist/plugin-sdk/channel-inbound.js +19 -19
- package/dist/plugin-sdk/channel-policy.js +19 -19
- package/dist/plugin-sdk/channel-runtime.js +19 -19
- package/dist/plugin-sdk/command-auth.js +19 -19
- package/dist/plugin-sdk/compat.js +19 -19
- package/dist/plugin-sdk/core.js +19 -19
- package/dist/plugin-sdk/directory-runtime.js +1 -1
- package/dist/plugin-sdk/discord.js +29 -29
- package/dist/plugin-sdk/feishu.js +19 -19
- package/dist/plugin-sdk/googlechat.js +19 -19
- package/dist/plugin-sdk/image-generation-core.js +19 -19
- package/dist/plugin-sdk/image-generation.js +21 -21
- package/dist/plugin-sdk/imessage-core.js +19 -19
- package/dist/plugin-sdk/imessage.js +20 -20
- package/dist/plugin-sdk/index.js +21 -21
- package/dist/plugin-sdk/infra-runtime.js +19 -19
- package/dist/plugin-sdk/irc.js +19 -19
- package/dist/plugin-sdk/line-core.js +19 -19
- package/dist/plugin-sdk/line-runtime.js +19 -19
- package/dist/plugin-sdk/line.js +19 -19
- package/dist/plugin-sdk/matrix-runtime-heavy.js +21 -21
- package/dist/plugin-sdk/matrix.js +20 -20
- package/dist/plugin-sdk/mattermost.js +19 -19
- package/dist/plugin-sdk/media-runtime.js +19 -19
- package/dist/plugin-sdk/media-understanding-runtime.js +19 -19
- package/dist/plugin-sdk/media-understanding.js +1 -1
- package/dist/plugin-sdk/msteams.js +19 -19
- package/dist/plugin-sdk/nextcloud-talk.js +19 -19
- package/dist/plugin-sdk/nostr.js +19 -19
- package/dist/plugin-sdk/plugin-runtime.js +19 -19
- package/dist/plugin-sdk/provider-auth-api-key.js +2 -2
- package/dist/plugin-sdk/provider-auth-login.js +1 -1
- package/dist/plugin-sdk/provider-auth.js +19 -19
- package/dist/plugin-sdk/provider-stream.js +19 -19
- package/dist/plugin-sdk/reply-runtime.js +19 -19
- package/dist/plugin-sdk/signal.js +19 -19
- package/dist/plugin-sdk/slack.js +23 -23
- package/dist/plugin-sdk/speech-core.js +19 -19
- package/dist/plugin-sdk/speech-runtime.js +19 -19
- package/dist/plugin-sdk/speech.js +19 -19
- package/dist/plugin-sdk/src/memory/index.d.ts +1 -1
- package/dist/plugin-sdk/src/memory/mongodb-manager.d.ts +21 -1
- package/dist/plugin-sdk/src/memory/mongodb-query-cache.d.ts +3 -0
- package/dist/plugin-sdk/src/memory/mongodb-retrieval-planner.d.ts +7 -0
- package/dist/plugin-sdk/src/memory/mongodb-search-executor.d.ts +106 -0
- package/dist/plugin-sdk/src/memory/search-utils.d.ts +8 -0
- package/dist/plugin-sdk/src/memory/types.d.ts +89 -0
- package/dist/plugin-sdk/telegram.js +19 -19
- package/dist/plugin-sdk/voice-call.js +19 -19
- package/dist/plugin-sdk/whatsapp-core.js +22 -22
- package/dist/plugin-sdk/whatsapp-shared.js +19 -19
- package/dist/plugin-sdk/zalo.js +19 -19
- package/dist/plugin-sdk/zalouser.js +19 -19
- package/dist/plugins/build-smoke-entry.js +19 -19
- package/dist/plugins/provider-runtime.runtime.js +1 -1
- package/dist/plugins/runtime/index.js +32 -32
- package/dist/{plugins-cli-DfF6zVw5.js → plugins-cli-qs-em8oU.js} +27 -27
- package/dist/{plugins-command-helpers-CwQ6OC2v.js → plugins-command-helpers-C0nk-qrd.js} +1 -1
- package/dist/{plugins-install-persist-1OHlLaq2.js → plugins-install-persist-DnOXl6E3.js} +1 -1
- package/dist/{plugins-update-command-BXC9BF3H.js → plugins-update-command-CtwLANvC.js} +4 -4
- package/dist/{poll-summary-DhAosjGw.js → poll-summary-mPV4LjSe.js} +1 -1
- package/dist/{preflight-audio.runtime-C85FHgtP.js → preflight-audio.runtime-Dj61qIC0.js} +19 -19
- package/dist/{probe-DjQoKbwz.js → probe-By9GWU38.js} +1 -1
- package/dist/{profile-update-DYmh_XMw.js → profile-update-D2aXkjSd.js} +3 -3
- package/dist/{program-DbqKjPvP.js → program-DPZ1_a3q.js} +26 -26
- package/dist/{prompt-select-styled-CI9PmwhK.js → prompt-select-styled-B1HZzUEM.js} +102 -20
- package/dist/{provider-BK7pHDG6.js → provider-BaahuVFX.js} +10 -10
- package/dist/{provider-auth-choice-oRq4HV9r.js → provider-auth-choice-CSoUYmew.js} +1 -1
- package/dist/{provider-auth-choice-preference-yjBut-C5.js → provider-auth-choice-preference-CrxAo3BY.js} +2 -2
- package/dist/{provider-auth-choice.runtime-eOUq3Tf2.js → provider-auth-choice.runtime-DUgq2ClG.js} +21 -21
- package/dist/{provider-auth-choice.runtime-B-qUcAA_.js → provider-auth-choice.runtime-w2nVW5WK.js} +2 -2
- package/dist/{provider-auth-guidance-DvSjjID0.js → provider-auth-guidance-MYPwodls.js} +1 -1
- package/dist/{provider-auth-login-CH373M_7.js → provider-auth-login-CLO7UQyn.js} +1 -1
- package/dist/{provider-auth-login.runtime-DVRRk8I2.js → provider-auth-login.runtime-CgfVXGFU.js} +19 -19
- package/dist/{provider-runtime-Bbtb5Zog.js → provider-runtime-BDMlGGzb.js} +19 -19
- package/dist/{provider-runtime.runtime-B-d-D5Kz.js → provider-runtime.runtime-BDdRJh54.js} +1 -1
- package/dist/{provider-session.runtime-wDrkFHvn.js → provider-session.runtime-CAqHLehG.js} +23 -23
- package/dist/{provider-usage-gzNKR4mS.js → provider-usage-CGCChzhD.js} +19 -19
- package/dist/{provider-wizard-hN_fAXfG.js → provider-wizard-CHAa6htg.js} +1 -1
- package/dist/{provider.runtime-DwN-v881.js → provider.runtime-B6_VOu8j.js} +25 -25
- package/dist/{push-apns-C5Uk-nC3.js → push-apns-BegW0CyP.js} +1 -1
- package/dist/{qr-cli-BbuWpIuy.js → qr-cli-B-2zezlv.js} +1 -1
- package/dist/{qr-cli-DOYdibf2.js → qr-cli-BWAgHWa5.js} +20 -20
- package/dist/{read-only-account-inspect-w1amnKer.js → read-only-account-inspect-1yQMBx2j.js} +3 -3
- package/dist/{read-only-account-inspect.discord.runtime-D2cC-4_X.js → read-only-account-inspect.discord.runtime-BP_lN82K.js} +19 -19
- package/dist/{read-only-account-inspect.slack.runtime-ZP9jhJcE.js → read-only-account-inspect.slack.runtime-BlozBKFg.js} +19 -19
- package/dist/{read-only-account-inspect.telegram.runtime-BpZ-3hxu.js → read-only-account-inspect.telegram.runtime-C_tpGKq8.js} +19 -19
- package/dist/{register.agent-DiQgJ89K.js → register.agent-C4LmgQ-8.js} +79 -79
- package/dist/{register.configure-CtFlREe1.js → register.configure-l8gksRmW.js} +80 -80
- package/dist/{register.maintenance-BhnKvBAb.js → register.maintenance-CpeKzgwN.js} +35 -35
- package/dist/{register.message-CUkFT4PI.js → register.message-DiznSCij.js} +20 -20
- package/dist/{register.onboard-BQxwgj-_.js → register.onboard-Cb6BnJfK.js} +24 -24
- package/dist/{register.setup-CLjB8Dtk.js → register.setup-DwqjH9AK.js} +22 -22
- package/dist/{register.status-health-sessions-DdHFD-kt.js → register.status-health-sessions-BrxQ6KEn.js} +25 -25
- package/dist/{register.subclis-B4zf3Nuq.js → register.subclis-B4XVc_4x.js} +18 -18
- package/dist/{register.subclis-CVzODp-F.js → register.subclis-B70v2Dok.js} +1 -1
- package/dist/{replies-D3IVK5Zm.js → replies-ClRihEvG.js} +1 -1
- package/dist/{reply-payloads-dedupe.runtime-BbYht9yH.js → reply-payloads-dedupe.runtime-BZYaCeIo.js} +19 -19
- package/dist/{resolve-allowlist-BgUySVP0.js → resolve-allowlist-CgW3bkqX.js} +1 -1
- package/dist/{resolve-channels-ChqMQdlk.js → resolve-channels-Q1GpSjyL.js} +2 -2
- package/dist/{resolve-targets-CkaDv15d.js → resolve-targets-D995HebZ.js} +1 -1
- package/dist/{resolve-users-CWreAWn8.js → resolve-users-BtO5FIEX.js} +1 -1
- package/dist/{resolve-users-KHapSSfM.js → resolve-users-DpT4k4Cr.js} +1 -1
- package/dist/{route-reply.runtime-CnaIn-qC.js → route-reply.runtime-BhbLZOmm.js} +19 -19
- package/dist/{route-resolution-C_EcVPhm.js → route-resolution-BIJbRie_.js} +1 -1
- package/dist/{run-main-BsVSrcN_.js → run-main-7-vbPft2.js} +17 -17
- package/dist/{runtime-5FvGEKxh.js → runtime-C9XRxMGJ.js} +182 -27
- package/dist/{runtime-api-Dgo4Q55T.js → runtime-api-BCnvHBxV.js} +1 -1
- package/dist/{runtime-api-CVKb2LXQ.js → runtime-api-BUMpVHJ6.js} +1 -1
- package/dist/{runtime-api-BErp2YEb.js → runtime-api-C4Y64RLo.js} +7 -7
- package/dist/{runtime-discord-ops.runtime-Chk1BYXI.js → runtime-discord-ops.runtime-BosFi3Mj.js} +29 -29
- package/dist/{runtime-embedded-pi.runtime-BZQ5kX8u.js → runtime-embedded-pi.runtime-wwT1tEAw.js} +19 -19
- package/dist/{runtime-media-understanding.runtime-D2FcTJOu.js → runtime-media-understanding.runtime-DdbTCMUB.js} +19 -19
- package/dist/{runtime-model-auth.runtime-Z-OqYqyi.js → runtime-model-auth.runtime-CNummRuy.js} +19 -19
- package/dist/{runtime-schema-Cqjdf8in.js → runtime-schema-BktzaAdG.js} +2 -2
- package/dist/{runtime-slack-ops.runtime-AL97qKPw.js → runtime-slack-ops.runtime--d6by7cL.js} +23 -23
- package/dist/{runtime-telegram-ops.runtime-DxfCchkI.js → runtime-telegram-ops.runtime-BUfCKAVq.js} +19 -19
- package/dist/{runtime-tts.runtime-BlmtrtjE.js → runtime-tts.runtime-DA096WA3.js} +19 -19
- package/dist/{search-manager-CGO-3dKu.js → search-manager-BlT2Zb4i.js} +1 -1
- package/dist/{search-manager-CS9u92oP.js → search-manager-DQd2otzd.js} +1 -1
- package/dist/{secrets-cli-DUZNkEFh.js → secrets-cli-CTouKWW9.js} +19 -19
- package/dist/{security-cli-rV3d5xoZ.js → security-cli-CiXKrtth.js} +20 -20
- package/dist/{send-B0xLU00X.js → send-BSca4GIA.js} +5 -5
- package/dist/{server-node-events-B5MIqHgC.js → server-node-events-fU7K5ls1.js} +20 -20
- package/dist/{server-startup-matrix-migration-CpXrqvXI.js → server-startup-matrix-migration-CVmhTfDY.js} +2 -2
- package/dist/{session-wGltxAdM.js → session-D3jpdP6d.js} +1 -1
- package/dist/{session-cost-usage-DTYqtcLN.js → session-cost-usage-7-YeoAlD.js} +20 -20
- package/dist/{session-cost-usage-CwCnoOHW.js → session-cost-usage-BjLshLU6.js} +1 -1
- package/dist/{session-system-events-Bp6nE5En.js → session-system-events-AQo6KIlo.js} +1 -1
- package/dist/{session-updates.runtime-OfmZ7igB.js → session-updates.runtime-BPOrfQZT.js} +3 -3
- package/dist/{sessions-DhCUH5Gr.js → sessions-48iXwZnl.js} +20 -20
- package/dist/{sessions-BU2oWFP1.js → sessions-CJTqXLS8.js} +2 -2
- package/dist/{setup-O9acDtfi.js → setup-DPELG2Vp.js} +9 -9
- package/dist/{setup-core-BeCRtZtb.js → setup-core-BCeD5CV6.js} +1 -1
- package/dist/{setup-core-CJ1YGhvT.js → setup-core-BMWAhyRq.js} +2 -2
- package/dist/{setup-core-D4kXAbMv.js → setup-core-Bf9ZwvjX.js} +1 -1
- package/dist/{setup-core-DCJBGsVz.js → setup-core-DYP0wxtc.js} +1 -1
- package/dist/{setup-entry-ThbCklDH.js → setup-entry-B-Oy31eD.js} +3 -3
- package/dist/{setup-entry-Cw06Kmxh.js → setup-entry-B29P2khw.js} +2 -2
- package/dist/{setup-entry-DVwdntnF.js → setup-entry-BOEd0Ane.js} +2 -2
- package/dist/{setup-entry-C9TrfYIV.js → setup-entry-C4TPJwTw.js} +3 -3
- package/dist/{setup-entry-rsEnOaFI.js → setup-entry-Cpojh89d.js} +3 -3
- package/dist/{setup-entry-B292hKEh.js → setup-entry-Hfrt8kt9.js} +2 -2
- package/dist/{setup-surface-C0649DZF.js → setup-surface-BhRNCMPg.js} +1 -1
- package/dist/{setup-surface-Ddhe1d6X.js → setup-surface-Bq3MzRTO.js} +2 -2
- package/dist/{setup-surface-LQP0zEJw.js → setup-surface-CoFPZdQS.js} +22 -22
- package/dist/{setup-surface-i3fRyh0E.js → setup-surface-E4hLJsq5.js} +2 -2
- package/dist/{setup-surface-CeNYw1hO.js → setup-surface-W2VLxXDM.js} +1 -1
- package/dist/{setup.finalize-BFW127lu.js → setup.finalize-84Gf0ObS.js} +27 -27
- package/dist/{shared-DxWAkuUd.js → shared-BJMhOB2G.js} +3 -3
- package/dist/{shared-BvXSIdhL.js → shared-D0XeAdo9.js} +3 -3
- package/dist/{shared-CduAoq6D.js → shared-RHV7JyZc.js} +2 -2
- package/dist/{shared-B_m8rpzz.js → shared-cjPYmDse.js} +1 -1
- package/dist/{shared-Bv7D0cvs.js → shared-nNepSWGa.js} +3 -3
- package/dist/{shared-DjTqchJL.js → shared-uMMtJTMV.js} +1 -1
- package/dist/{signal-BOqRoG7_.js → signal-CME5sJ0w.js} +3 -3
- package/dist/{signal-B3JE51EF.js → signal-D4Lbf988.js} +19 -19
- package/dist/{slack-DQMZKIuW.js → slack-CODJLiIt.js} +23 -23
- package/dist/{slack-ECt4h0Hu.js → slack-gymwMRHI.js} +4 -4
- package/dist/{slash-commands.runtime-DWt0QyST.js → slash-commands.runtime-BU-vIH8R.js} +19 -19
- package/dist/{slash-dispatch.runtime-BeTERhvj.js → slash-dispatch.runtime-Dhfe7IYa.js} +20 -20
- package/dist/{slash-skill-commands.runtime-Cid-sSa3.js → slash-skill-commands.runtime-mw13ajQT.js} +19 -19
- package/dist/{src-XVdNPr4B.js → src-BlkqMEit.js} +21 -21
- package/dist/{status-CWaWMoOB.js → status-1rpgeSGa.js} +1 -1
- package/dist/{status-CXOVuCND.js → status-BZsBg9xV.js} +24 -24
- package/dist/{status-B8LdUsqp.js → status-CC-ehab5.js} +9 -9
- package/dist/{status-rqxi-BQ-.js → status-Dw5aNMUi.js} +1 -1
- package/dist/{status-json-DA8vURuP.js → status-json-DQ99lhAL.js} +5 -5
- package/dist/{status.link-channel-i1B0BhMt.js → status.link-channel-DuNmDjGh.js} +2 -2
- package/dist/{status.scan.deps.runtime--ESlvC-h.js → status.scan.deps.runtime-DWQ5IOU6.js} +8 -8
- package/dist/{status.scan.json-core-B5fWzAXX.js → status.scan.json-core-B0T4DsPj.js} +4 -4
- package/dist/{status.scan.runtime-CbZR0ayi.js → status.scan.runtime-DkJC6Vgv.js} +2 -2
- package/dist/{subagent-orphan-recovery-CwzQuKXV.js → subagent-orphan-recovery-DSxLQZvE.js} +19 -19
- package/dist/{subagent-registry-runtime-BASPOpkx.js → subagent-registry-runtime-CV_OzD0q.js} +19 -19
- package/dist/{synology-chat-O8fctw-z.js → synology-chat-BaUHBtMN.js} +2 -2
- package/dist/{targets-CIpEQq5a.js → targets-CjzBweAX.js} +1 -1
- package/dist/telegram/audit.js +1 -1
- package/dist/telegram/token.js +19 -19
- package/dist/{telegram-BQLx1Cmm.js → telegram-CkAzNmH7.js} +19 -19
- package/dist/{telegram-CdyPvNcV.js → telegram-EebZvTzh.js} +5 -5
- package/dist/{thread-bindings-CPuNENBW.js → thread-bindings-IDx8jZ0O.js} +2 -2
- package/dist/{thread-bindings-DUZj5oTC.js → thread-bindings-sapdPwgA.js} +1 -1
- package/dist/{thread-bindings.messages-wvAd3TUZ.js → thread-bindings.messages-r4Dz6nBF.js} +1 -1
- package/dist/{tool-actions.runtime-B9ha--Vj.js → tool-actions.runtime-D69_bV8W.js} +27 -27
- package/dist/{tts.runtime-GeJEVmoE.js → tts.runtime-Bj0GrgrY.js} +19 -19
- package/dist/{tui-D8O3rgl9.js → tui-CoAq-5WQ.js} +1 -1
- package/dist/{tui-cli-D8kw-oSV.js → tui-cli-CYjvD-kF.js} +20 -20
- package/dist/{ui-CVFJs1wJ.js → ui-BijfqGyW.js} +1 -1
- package/dist/{update-cli-TTPqi6r3.js → update-cli-BxmI8tEh.js} +35 -35
- package/dist/{update-offset-store-e6CGb6BA.js → update-offset-store-CWYWIMKg.js} +19 -19
- package/dist/{verification-CIgqa4HW.js → verification-DRHMZMyz.js} +3 -3
- package/dist/{webhook-shared-CljrL-0X.js → webhook-shared-CYZN-G1z.js} +1 -1
- package/dist/{whatsapp-core-CaAr8WsA.js → whatsapp-core-C_MCKbIX.js} +1 -1
- package/dist/{zalo-D1hFuacG.js → zalo-gLJk_7Mo.js} +2 -2
- package/docs/concepts/memory.md +7 -0
- package/docs/reference/memory-config.md +10 -0
- package/docs/research/2026-03-28-agentic-search-review-github.md +308 -0
- package/docs/research/2026-03-28-agentic-search-review-web.md +331 -0
- package/docs/research/2026-03-28-brainstorm-validation-github.md +192 -0
- package/docs/research/2026-03-28-brainstorm-validation-synthesis.md +190 -0
- package/docs/research/2026-03-28-brainstorm-validation-web.md +395 -0
- package/package.json +2 -1
- package/dist/extensions/slack/node_modules/proxy-from-env/.eslintrc +0 -29
- package/dist/extensions/slack/node_modules/proxy-from-env/.travis.yml +0 -10
- package/dist/extensions/slack/node_modules/proxy-from-env/test.js +0 -483
|
@@ -2,13 +2,13 @@ import { n as redactSensitiveText } from "./redact-BDinS1q9.js";
|
|
|
2
2
|
import { o as createSubsystemLogger, yi as resolveAgentWorkspaceDir } from "./env-DSps_l9i.js";
|
|
3
3
|
import { c as resolveSessionTranscriptsDirForAgent } from "./paths-Cl8Vw1Jj.js";
|
|
4
4
|
import { a as listMemoryFiles, n as chunkMarkdown, o as normalizeExtraMemoryPaths, r as hashText, t as buildFileEntry } from "./internal-CQyd3YZq.js";
|
|
5
|
-
import { C as relationsCollection, D as structuredMemCollection, E as relevanceRunsCollection, S as queryCacheCollection, _ as metaCollection, a as ensureCollections, b as proceduresCollection, c as ensureStandardIndexes, d as episodesCollection, f as eventsCollection, g as kbCollection, h as kbChunksCollection, k as telemetryCollection, l as entitiesCollection, m as ingestRunsCollection, n as chunksCollection, p as filesCollection, r as detectCapabilities, s as ensureSearchIndexes, u as entityLinksCollection, x as projectionRunsCollection } from "./mongodb-schema-
|
|
5
|
+
import { A as sortObject, C as relationsCollection, D as structuredMemCollection, E as relevanceRunsCollection, S as queryCacheCollection, _ as metaCollection, a as ensureCollections, b as proceduresCollection, c as ensureStandardIndexes, d as episodesCollection, f as eventsCollection, g as kbCollection, h as kbChunksCollection, k as telemetryCollection, l as entitiesCollection, m as ingestRunsCollection, n as chunksCollection, p as filesCollection, r as detectCapabilities, s as ensureSearchIndexes, u as entityLinksCollection, x as projectionRunsCollection } from "./mongodb-schema-xrNHiVhH.js";
|
|
6
6
|
import { t as resolveScopeRef } from "./mongodb-scope-BgB-USEx.js";
|
|
7
|
-
import { n as writeStructuredMemory, t as searchStructuredMemory } from "./mongodb-structured-memory-
|
|
8
|
-
import { a as normalizeSearchResults, n as buildVectorSearchStage, o as rrfScore, r as mongoSearch, s as MongoDBRelevanceRuntime } from "./mongodb-search-
|
|
9
|
-
import { n as writeProcedure, t as searchProcedures } from "./mongodb-procedures-
|
|
10
|
-
import { t as getMemoryStats } from "./mongodb-analytics-
|
|
11
|
-
import { t as searchKB } from "./mongodb-kb-search-
|
|
7
|
+
import { n as writeStructuredMemory, t as searchStructuredMemory } from "./mongodb-structured-memory-Yccp2p-h.js";
|
|
8
|
+
import { a as normalizeSearchResults, n as buildVectorSearchStage, o as rrfScore, r as mongoSearch, s as MongoDBRelevanceRuntime } from "./mongodb-search-C7HfqDY2.js";
|
|
9
|
+
import { n as writeProcedure, t as searchProcedures } from "./mongodb-procedures-FqFUZ4EE.js";
|
|
10
|
+
import { t as getMemoryStats } from "./mongodb-analytics-Csq_gZGe.js";
|
|
11
|
+
import { t as searchKB } from "./mongodb-kb-search-p3yHZihO.js";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import { createHash, randomUUID } from "node:crypto";
|
|
14
14
|
import fs from "node:fs/promises";
|
|
@@ -167,6 +167,16 @@ async function getEventsByTimeRange(params) {
|
|
|
167
167
|
_id: 1
|
|
168
168
|
}).limit(limit ?? 1e3).toArray();
|
|
169
169
|
}
|
|
170
|
+
async function getEventsBySession(params) {
|
|
171
|
+
const { db, prefix, agentId, sessionId, limit } = params;
|
|
172
|
+
return await eventsCollection(db, prefix).find({
|
|
173
|
+
agentId,
|
|
174
|
+
sessionId
|
|
175
|
+
}).sort({
|
|
176
|
+
timestamp: 1,
|
|
177
|
+
_id: 1
|
|
178
|
+
}).limit(limit ?? 1e3).toArray();
|
|
179
|
+
}
|
|
170
180
|
async function markEventsProjected(params) {
|
|
171
181
|
const { db, prefix, eventIds } = params;
|
|
172
182
|
if (eventIds.length === 0) return 0;
|
|
@@ -1275,6 +1285,16 @@ async function checkAutoEpisodeTriggers(params) {
|
|
|
1275
1285
|
//#endregion
|
|
1276
1286
|
//#region src/memory/mongodb-retrieval-planner.ts
|
|
1277
1287
|
const log$10 = createSubsystemLogger("memory:mongodb:planner");
|
|
1288
|
+
function classifyRetrievalQuery(params) {
|
|
1289
|
+
const query = params.query.trim().toLowerCase();
|
|
1290
|
+
if (!query) return "direct";
|
|
1291
|
+
if (params.hasTimeRange || TIME_REGEXES.some((re) => re.test(query))) return "temporal";
|
|
1292
|
+
if (params.hasScopes) return "scoped";
|
|
1293
|
+
if (/\b(compare|comparison|difference|different|vs|versus|better than)\b/i.test(query)) return "comparison";
|
|
1294
|
+
if (/\b(family|alternatives?|similar|related tools|ecosystem|what else|options|which tools|all the tools|all tools)\b/i.test(query) || /כל המשפחה|עוד כלים|חלופות|מה עוד/u.test(query)) return "family";
|
|
1295
|
+
if (/\b(because|why did|how did|lead to|after that|before that|then what)\b/i.test(query)) return "multi-hop";
|
|
1296
|
+
return "direct";
|
|
1297
|
+
}
|
|
1278
1298
|
function buildKeywordRegexes(keywords) {
|
|
1279
1299
|
return keywords.map((kw) => new RegExp(`\\b${kw.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\b`, "i"));
|
|
1280
1300
|
}
|
|
@@ -1359,6 +1379,31 @@ const PROCEDURAL_REGEXES = buildKeywordRegexes([
|
|
|
1359
1379
|
"steps",
|
|
1360
1380
|
"checklist"
|
|
1361
1381
|
]);
|
|
1382
|
+
const FAMILY_REGEXES = buildKeywordRegexes([
|
|
1383
|
+
"family",
|
|
1384
|
+
"alternatives",
|
|
1385
|
+
"alternative",
|
|
1386
|
+
"similar",
|
|
1387
|
+
"related",
|
|
1388
|
+
"what else",
|
|
1389
|
+
"ecosystem",
|
|
1390
|
+
"other tools"
|
|
1391
|
+
]);
|
|
1392
|
+
const COMPARISON_REGEXES = buildKeywordRegexes([
|
|
1393
|
+
"compare",
|
|
1394
|
+
"comparison",
|
|
1395
|
+
"difference",
|
|
1396
|
+
"versus",
|
|
1397
|
+
"vs"
|
|
1398
|
+
]);
|
|
1399
|
+
const MULTI_HOP_REGEXES = buildKeywordRegexes([
|
|
1400
|
+
"and then",
|
|
1401
|
+
"after that",
|
|
1402
|
+
"followed by",
|
|
1403
|
+
"step by step",
|
|
1404
|
+
"how did",
|
|
1405
|
+
"why did"
|
|
1406
|
+
]);
|
|
1362
1407
|
const PATH_PRIORITY = {
|
|
1363
1408
|
"active-critical": 0,
|
|
1364
1409
|
procedural: 1,
|
|
@@ -1594,6 +1639,7 @@ function planRetrieval(query, context) {
|
|
|
1594
1639
|
try {
|
|
1595
1640
|
if (!query.trim()) return {
|
|
1596
1641
|
paths: context.availablePaths.has("hybrid") ? ["hybrid"] : [],
|
|
1642
|
+
classification: "direct",
|
|
1597
1643
|
confidence: "low",
|
|
1598
1644
|
reasoning: "empty query"
|
|
1599
1645
|
};
|
|
@@ -1656,9 +1702,18 @@ function planRetrieval(query, context) {
|
|
|
1656
1702
|
}
|
|
1657
1703
|
scores.hybrid += 1;
|
|
1658
1704
|
const finalPaths = Object.entries(scores).filter(([path]) => context.availablePaths.has(path)).toSorted((a, b) => b[1] - a[1] || PATH_PRIORITY[a[0]] - PATH_PRIORITY[b[0]]).map(([path]) => path);
|
|
1705
|
+
const classification = (() => {
|
|
1706
|
+
if (COMPARISON_REGEXES.some((re) => re.test(query))) return "comparison";
|
|
1707
|
+
if (FAMILY_REGEXES.some((re) => re.test(query))) return "family";
|
|
1708
|
+
if (timeConstraint) return "temporal";
|
|
1709
|
+
if (structuredConstraint?.hard === true || kbConstraint?.hard === true || !!entityConstraint) return "scoped";
|
|
1710
|
+
if (MULTI_HOP_REGEXES.some((re) => re.test(query)) || /\b(and|then)\b/i.test(query) || (query.match(/\?/g)?.length ?? 0) > 1) return "multi-hop";
|
|
1711
|
+
return "direct";
|
|
1712
|
+
})();
|
|
1659
1713
|
const topScore = scores[finalPaths[0]] ?? 0;
|
|
1660
1714
|
return {
|
|
1661
1715
|
paths: finalPaths,
|
|
1716
|
+
classification,
|
|
1662
1717
|
confidence: topScore >= 3 ? "high" : topScore >= 2 ? "medium" : "low",
|
|
1663
1718
|
reasoning: reasons.length > 0 ? reasons.join("; ") : "no strong signals, defaulting to hybrid",
|
|
1664
1719
|
...Object.keys(constraints).length > 0 ? { constraints } : {}
|
|
@@ -2609,10 +2664,12 @@ async function checkCache(params) {
|
|
|
2609
2664
|
const cacheStart = Date.now();
|
|
2610
2665
|
const col = queryCacheCollection(db, prefix);
|
|
2611
2666
|
const qHash = hashQuery(normalized);
|
|
2667
|
+
const requestSignature = params.requestSignature ?? "default";
|
|
2612
2668
|
const now = /* @__PURE__ */ new Date();
|
|
2613
2669
|
try {
|
|
2614
2670
|
const exact = await col.findOne({
|
|
2615
2671
|
queryHash: qHash,
|
|
2672
|
+
requestSignature,
|
|
2616
2673
|
agentId,
|
|
2617
2674
|
scope,
|
|
2618
2675
|
scopeRef,
|
|
@@ -2670,7 +2727,8 @@ async function checkCache(params) {
|
|
|
2670
2727
|
filter: {
|
|
2671
2728
|
agentId,
|
|
2672
2729
|
scope,
|
|
2673
|
-
scopeRef
|
|
2730
|
+
scopeRef,
|
|
2731
|
+
requestSignature
|
|
2674
2732
|
},
|
|
2675
2733
|
textFieldPath: "queryNorm"
|
|
2676
2734
|
});
|
|
@@ -2698,6 +2756,7 @@ async function checkCache(params) {
|
|
|
2698
2756
|
results: 1,
|
|
2699
2757
|
pathUsed: 1,
|
|
2700
2758
|
sourceScope: 1,
|
|
2759
|
+
requestSignature: 1,
|
|
2701
2760
|
expiresAt: 1,
|
|
2702
2761
|
score: { $meta: "vectorSearchScore" }
|
|
2703
2762
|
} }
|
|
@@ -2757,14 +2816,17 @@ function writeCache(params) {
|
|
|
2757
2816
|
const now = /* @__PURE__ */ new Date();
|
|
2758
2817
|
const expiresAt = new Date(now.getTime() + ttlSec * 1e3);
|
|
2759
2818
|
const qHash = hashQuery(normalized);
|
|
2819
|
+
const requestSignature = params.requestSignature ?? "default";
|
|
2760
2820
|
queryCacheCollection(db, prefix).updateOne({
|
|
2761
2821
|
queryHash: qHash,
|
|
2822
|
+
requestSignature,
|
|
2762
2823
|
agentId,
|
|
2763
2824
|
scope,
|
|
2764
2825
|
scopeRef
|
|
2765
2826
|
}, {
|
|
2766
2827
|
$setOnInsert: {
|
|
2767
2828
|
queryNorm: normalized,
|
|
2829
|
+
requestSignature,
|
|
2768
2830
|
createdAt: now,
|
|
2769
2831
|
hitCount: 0
|
|
2770
2832
|
},
|
|
@@ -3064,6 +3126,543 @@ async function crossEncoderRerank(params) {
|
|
|
3064
3126
|
}
|
|
3065
3127
|
}
|
|
3066
3128
|
//#endregion
|
|
3129
|
+
//#region src/memory/mongodb-search-executor.ts
|
|
3130
|
+
function sourcePreferencePaths(source) {
|
|
3131
|
+
switch (source) {
|
|
3132
|
+
case "conversation": return ["hybrid", "raw-window"];
|
|
3133
|
+
case "reference": return ["kb"];
|
|
3134
|
+
case "structured": return ["active-critical", "structured"];
|
|
3135
|
+
case "procedural": return ["procedural"];
|
|
3136
|
+
case "episodic": return ["episodic"];
|
|
3137
|
+
case "graph": return ["graph"];
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
function selectPassPaths(params) {
|
|
3141
|
+
const allowed = new Set(params.availablePaths);
|
|
3142
|
+
if (params.timeRange) {
|
|
3143
|
+
for (const path of allowed) if (![
|
|
3144
|
+
"raw-window",
|
|
3145
|
+
"hybrid",
|
|
3146
|
+
"episodic"
|
|
3147
|
+
].includes(path)) allowed.delete(path);
|
|
3148
|
+
}
|
|
3149
|
+
if (params.sourcePreference.length === 0) return allowed;
|
|
3150
|
+
const preferredAllowed = new Set(params.sourcePreference.flatMap((source) => sourcePreferencePaths(source)));
|
|
3151
|
+
const scopedAllowed = new Set(Array.from(allowed).filter((path) => preferredAllowed.has(path)));
|
|
3152
|
+
const preferredSource = params.sourcePreference[Math.min(params.pass - 1, params.sourcePreference.length - 1)];
|
|
3153
|
+
const preferredPaths = sourcePreferencePaths(preferredSource).filter((path) => scopedAllowed.has(path));
|
|
3154
|
+
if (preferredPaths.length === 0 || params.pass > params.sourcePreference.length) return scopedAllowed;
|
|
3155
|
+
return new Set(preferredPaths);
|
|
3156
|
+
}
|
|
3157
|
+
function buildMemorySearchRequestSignature(request) {
|
|
3158
|
+
return JSON.stringify(sortObject({
|
|
3159
|
+
query: request.query,
|
|
3160
|
+
maxResults: request.maxResults,
|
|
3161
|
+
minScore: request.minScore,
|
|
3162
|
+
searchMode: request.searchMode,
|
|
3163
|
+
sourcePreference: request.sourcePreference,
|
|
3164
|
+
timeRange: request.timeRange,
|
|
3165
|
+
needExactEvidence: request.needExactEvidence,
|
|
3166
|
+
maxPasses: request.maxPasses,
|
|
3167
|
+
conversationScope: request.conversationScope,
|
|
3168
|
+
structuredScope: request.structuredScope,
|
|
3169
|
+
referenceScope: request.referenceScope,
|
|
3170
|
+
proceduralScope: request.proceduralScope
|
|
3171
|
+
}));
|
|
3172
|
+
}
|
|
3173
|
+
function normalizeMemorySearchRequest(request) {
|
|
3174
|
+
const requestedMode = request.searchMode ?? "auto";
|
|
3175
|
+
const maxPasses = Math.max(1, Math.min(3, Math.trunc(request.maxPasses ?? {
|
|
3176
|
+
direct: 1,
|
|
3177
|
+
auto: 2,
|
|
3178
|
+
agentic: 3
|
|
3179
|
+
}[requestedMode])));
|
|
3180
|
+
return {
|
|
3181
|
+
...request,
|
|
3182
|
+
searchMode: requestedMode,
|
|
3183
|
+
maxPasses,
|
|
3184
|
+
sourcePreference: request.sourcePreference ?? [
|
|
3185
|
+
"conversation",
|
|
3186
|
+
"structured",
|
|
3187
|
+
"procedural",
|
|
3188
|
+
"reference",
|
|
3189
|
+
"episodic",
|
|
3190
|
+
"graph"
|
|
3191
|
+
]
|
|
3192
|
+
};
|
|
3193
|
+
}
|
|
3194
|
+
function resolveExecutorTimeRange(request) {
|
|
3195
|
+
const raw = request.timeRange;
|
|
3196
|
+
if (!raw) return;
|
|
3197
|
+
if (raw.preset) return resolveTimeRangePreset(raw.preset);
|
|
3198
|
+
const start = raw.start ? new Date(raw.start) : void 0;
|
|
3199
|
+
const end = raw.end ? new Date(raw.end) : void 0;
|
|
3200
|
+
if (start && Number.isNaN(start.getTime()) || end && Number.isNaN(end.getTime()) || !start || !end) return;
|
|
3201
|
+
return {
|
|
3202
|
+
start,
|
|
3203
|
+
end
|
|
3204
|
+
};
|
|
3205
|
+
}
|
|
3206
|
+
function classifyExecutorSearch(request) {
|
|
3207
|
+
return classifyRetrievalQuery({
|
|
3208
|
+
query: request.query,
|
|
3209
|
+
hasTimeRange: Boolean(request.timeRange),
|
|
3210
|
+
hasScopes: Boolean(request.conversationScope || request.structuredScope || request.referenceScope || request.proceduralScope)
|
|
3211
|
+
});
|
|
3212
|
+
}
|
|
3213
|
+
function uniqueQueries(values) {
|
|
3214
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3215
|
+
const ordered = [];
|
|
3216
|
+
for (const value of values) {
|
|
3217
|
+
const trimmed = value.trim();
|
|
3218
|
+
if (!trimmed) continue;
|
|
3219
|
+
const normalized = trimmed.toLowerCase();
|
|
3220
|
+
if (seen.has(normalized)) continue;
|
|
3221
|
+
seen.add(normalized);
|
|
3222
|
+
ordered.push(trimmed);
|
|
3223
|
+
}
|
|
3224
|
+
return ordered;
|
|
3225
|
+
}
|
|
3226
|
+
function buildExecutorPasses(request, classification) {
|
|
3227
|
+
const passes = [{
|
|
3228
|
+
pass: 1,
|
|
3229
|
+
query: request.query,
|
|
3230
|
+
reason: "original query",
|
|
3231
|
+
variant: "original"
|
|
3232
|
+
}];
|
|
3233
|
+
if (!(request.searchMode === "agentic" || request.searchMode === "auto" && classification !== "direct") || request.maxPasses <= 1) return passes;
|
|
3234
|
+
const expansionQueries = [];
|
|
3235
|
+
switch (classification) {
|
|
3236
|
+
case "family":
|
|
3237
|
+
expansionQueries.push(`${request.query} alternatives`);
|
|
3238
|
+
expansionQueries.push(`${request.query} related tools`);
|
|
3239
|
+
break;
|
|
3240
|
+
case "comparison":
|
|
3241
|
+
expansionQueries.push(`${request.query} differences`);
|
|
3242
|
+
expansionQueries.push(`${request.query} tradeoffs`);
|
|
3243
|
+
break;
|
|
3244
|
+
case "temporal":
|
|
3245
|
+
expansionQueries.push(`${request.query} exact evidence`);
|
|
3246
|
+
break;
|
|
3247
|
+
case "scoped":
|
|
3248
|
+
expansionQueries.push(`${request.query} exact match`);
|
|
3249
|
+
break;
|
|
3250
|
+
case "multi-hop":
|
|
3251
|
+
expansionQueries.push(`${request.query} cause`);
|
|
3252
|
+
expansionQueries.push(`${request.query} consequence`);
|
|
3253
|
+
break;
|
|
3254
|
+
case "direct":
|
|
3255
|
+
if (request.needExactEvidence) expansionQueries.push(`${request.query} exact evidence`);
|
|
3256
|
+
break;
|
|
3257
|
+
}
|
|
3258
|
+
const deduped = uniqueQueries(expansionQueries);
|
|
3259
|
+
for (const query of deduped.slice(0, Math.max(0, request.maxPasses - 1))) passes.push({
|
|
3260
|
+
pass: passes.length + 1,
|
|
3261
|
+
query,
|
|
3262
|
+
reason: classification === "family" ? "family expansion" : "agentic follow-up",
|
|
3263
|
+
variant: classification === "multi-hop" ? "decomposition" : "family-expansion"
|
|
3264
|
+
});
|
|
3265
|
+
return passes;
|
|
3266
|
+
}
|
|
3267
|
+
function resultHasExactEvidence(result) {
|
|
3268
|
+
if (result.canonicalId?.trim()) return true;
|
|
3269
|
+
if (result.path.trim()) return true;
|
|
3270
|
+
return false;
|
|
3271
|
+
}
|
|
3272
|
+
function searchResultIdentity(result) {
|
|
3273
|
+
return result.canonicalId ?? `${result.path}:${result.startLine}:${result.endLine}`;
|
|
3274
|
+
}
|
|
3275
|
+
function computeEvidenceCoverage(results) {
|
|
3276
|
+
if (results.length === 0) return "none";
|
|
3277
|
+
const exactCount = results.filter(resultHasExactEvidence).length;
|
|
3278
|
+
if (exactCount === results.length) return "direct";
|
|
3279
|
+
if (exactCount > 0) return "partial";
|
|
3280
|
+
return "indirect";
|
|
3281
|
+
}
|
|
3282
|
+
function applyHardConstraintRejections(params) {
|
|
3283
|
+
const accepted = [];
|
|
3284
|
+
const rejected = [];
|
|
3285
|
+
for (const result of params.results) {
|
|
3286
|
+
if (params.timeRange) {
|
|
3287
|
+
if (!(result.timestamp instanceof Date)) {
|
|
3288
|
+
rejected.push({
|
|
3289
|
+
canonicalId: result.canonicalId,
|
|
3290
|
+
path: result.path,
|
|
3291
|
+
source: result.source,
|
|
3292
|
+
reason: "missing timestamp for requested time range"
|
|
3293
|
+
});
|
|
3294
|
+
continue;
|
|
3295
|
+
}
|
|
3296
|
+
const ts = result.timestamp.getTime();
|
|
3297
|
+
if (ts < params.timeRange.start.getTime() || ts > params.timeRange.end.getTime()) {
|
|
3298
|
+
rejected.push({
|
|
3299
|
+
canonicalId: result.canonicalId,
|
|
3300
|
+
path: result.path,
|
|
3301
|
+
source: result.source,
|
|
3302
|
+
reason: "outside requested time range"
|
|
3303
|
+
});
|
|
3304
|
+
continue;
|
|
3305
|
+
}
|
|
3306
|
+
}
|
|
3307
|
+
if (params.request.needExactEvidence && !resultHasExactEvidence(result)) {
|
|
3308
|
+
rejected.push({
|
|
3309
|
+
canonicalId: result.canonicalId,
|
|
3310
|
+
path: result.path,
|
|
3311
|
+
source: result.source,
|
|
3312
|
+
reason: "missing exact evidence locator"
|
|
3313
|
+
});
|
|
3314
|
+
continue;
|
|
3315
|
+
}
|
|
3316
|
+
accepted.push(result);
|
|
3317
|
+
}
|
|
3318
|
+
return {
|
|
3319
|
+
accepted,
|
|
3320
|
+
rejected
|
|
3321
|
+
};
|
|
3322
|
+
}
|
|
3323
|
+
function canUseLegacyFallback(request) {
|
|
3324
|
+
return !(request.needExactEvidence || request.timeRange || request.conversationScope || request.structuredScope || request.referenceScope || request.proceduralScope);
|
|
3325
|
+
}
|
|
3326
|
+
function requestHasHardConstraints(request) {
|
|
3327
|
+
return !canUseLegacyFallback(request);
|
|
3328
|
+
}
|
|
3329
|
+
function buildConstraintSummaries(request) {
|
|
3330
|
+
const applied = [];
|
|
3331
|
+
if (request.timeRange) {
|
|
3332
|
+
if (request.timeRange.preset) applied.push(`timeRange:${request.timeRange.preset}`);
|
|
3333
|
+
else if (request.timeRange.start && request.timeRange.end) applied.push(`timeRange:${request.timeRange.start}..${request.timeRange.end}`);
|
|
3334
|
+
}
|
|
3335
|
+
if (request.needExactEvidence) applied.push("needExactEvidence");
|
|
3336
|
+
if (request.conversationScope?.sessionKey) applied.push(`conversationScope.sessionKey:${request.conversationScope.sessionKey}`);
|
|
3337
|
+
if (request.structuredScope?.type) applied.push(`structuredScope.type:${request.structuredScope.type}`);
|
|
3338
|
+
if (request.referenceScope?.category) applied.push(`referenceScope.category:${request.referenceScope.category}`);
|
|
3339
|
+
if (request.referenceScope?.source) applied.push(`referenceScope.source:${request.referenceScope.source}`);
|
|
3340
|
+
if (request.proceduralScope?.state) applied.push(`proceduralScope.state:${request.proceduralScope.state}`);
|
|
3341
|
+
return applied;
|
|
3342
|
+
}
|
|
3343
|
+
function mergeMetadata(params) {
|
|
3344
|
+
const pathsExecuted = Array.from(new Set(params.passes.flatMap((pass) => pass.metadata.pathsExecuted)));
|
|
3345
|
+
const resultsByPath = params.passes.reduce((acc, pass) => {
|
|
3346
|
+
for (const [path, count] of Object.entries(pass.metadata.resultsByPath)) acc[path] = (acc[path] ?? 0) + count;
|
|
3347
|
+
return acc;
|
|
3348
|
+
}, {});
|
|
3349
|
+
return {
|
|
3350
|
+
mode: params.request.searchMode,
|
|
3351
|
+
classification: params.classification,
|
|
3352
|
+
sourceOrder: params.request.sourcePreference,
|
|
3353
|
+
passes: params.passes.map(({ metadata: _metadata, ...pass }) => pass),
|
|
3354
|
+
queriesTried: params.passes.map((pass) => pass.query),
|
|
3355
|
+
constraintsApplied: buildConstraintSummaries(params.request),
|
|
3356
|
+
resultsRejected: params.resultsRejected,
|
|
3357
|
+
evidenceCoverage: computeEvidenceCoverage(params.results),
|
|
3358
|
+
pathsExecuted,
|
|
3359
|
+
resultsByPath,
|
|
3360
|
+
queryRewritten: params.passes.some((pass) => pass.metadata.queryRewritten),
|
|
3361
|
+
reranked: params.passes.some((pass) => pass.metadata.reranked),
|
|
3362
|
+
...params.noDirectEvidenceReason ? { noDirectEvidenceReason: params.noDirectEvidenceReason } : {},
|
|
3363
|
+
...params.constraintRelaxations?.length ? { constraintRelaxations: params.constraintRelaxations } : {},
|
|
3364
|
+
...params.mmrApplied != null ? { mmrApplied: params.mmrApplied } : {},
|
|
3365
|
+
...params.mmrLambda != null ? { mmrLambda: params.mmrLambda } : {},
|
|
3366
|
+
...params.request.returnPlan && params.passes[0]?.metadata.plan ? { plan: params.passes[0].metadata.plan } : {}
|
|
3367
|
+
};
|
|
3368
|
+
}
|
|
3369
|
+
function buildNoDirectEvidenceResponse(params) {
|
|
3370
|
+
return {
|
|
3371
|
+
results: [],
|
|
3372
|
+
metadata: mergeMetadata({
|
|
3373
|
+
request: params.request,
|
|
3374
|
+
classification: params.classification,
|
|
3375
|
+
passes: params.passes,
|
|
3376
|
+
resultsRejected: params.resultsRejected,
|
|
3377
|
+
results: [],
|
|
3378
|
+
noDirectEvidenceReason: params.reason
|
|
3379
|
+
})
|
|
3380
|
+
};
|
|
3381
|
+
}
|
|
3382
|
+
function analyzeCorrectionNeeded(params) {
|
|
3383
|
+
if (params.passCount >= params.maxPasses) return { needed: false };
|
|
3384
|
+
if (params.evidenceCoverage !== "none" && params.evidenceCoverage !== "indirect") return { needed: false };
|
|
3385
|
+
if (params.rejected.length === 0) return { needed: false };
|
|
3386
|
+
const reasonCounts = /* @__PURE__ */ new Map();
|
|
3387
|
+
for (const r of params.rejected) reasonCounts.set(r.reason, (reasonCounts.get(r.reason) ?? 0) + 1);
|
|
3388
|
+
let dominantReason = "";
|
|
3389
|
+
let maxCount = 0;
|
|
3390
|
+
for (const [reason, count] of reasonCounts) if (count > maxCount) {
|
|
3391
|
+
dominantReason = reason;
|
|
3392
|
+
maxCount = count;
|
|
3393
|
+
}
|
|
3394
|
+
if (dominantReason === "outside requested time range") return {
|
|
3395
|
+
needed: true,
|
|
3396
|
+
correction: "time-range-widened-2x",
|
|
3397
|
+
reason: dominantReason
|
|
3398
|
+
};
|
|
3399
|
+
if (dominantReason === "missing exact evidence locator") return {
|
|
3400
|
+
needed: true,
|
|
3401
|
+
correction: "hybrid-evidence-relaxed",
|
|
3402
|
+
reason: dominantReason
|
|
3403
|
+
};
|
|
3404
|
+
if (dominantReason === "missing timestamp for requested time range") return {
|
|
3405
|
+
needed: true,
|
|
3406
|
+
correction: "time-range-widened-2x",
|
|
3407
|
+
reason: dominantReason
|
|
3408
|
+
};
|
|
3409
|
+
return { needed: false };
|
|
3410
|
+
}
|
|
3411
|
+
function identifyRelaxableConstraint(rejected) {
|
|
3412
|
+
if (rejected.length === 0) return null;
|
|
3413
|
+
const reasonCounts = /* @__PURE__ */ new Map();
|
|
3414
|
+
for (const r of rejected) reasonCounts.set(r.reason, (reasonCounts.get(r.reason) ?? 0) + 1);
|
|
3415
|
+
let dominantReason = "";
|
|
3416
|
+
let maxCount = 0;
|
|
3417
|
+
for (const [reason, count] of reasonCounts) if (count > maxCount) {
|
|
3418
|
+
dominantReason = reason;
|
|
3419
|
+
maxCount = count;
|
|
3420
|
+
}
|
|
3421
|
+
if (dominantReason === "outside requested time range" || dominantReason === "missing timestamp for requested time range") return {
|
|
3422
|
+
constraint: "timeRange",
|
|
3423
|
+
action: "removed-time-range"
|
|
3424
|
+
};
|
|
3425
|
+
if (dominantReason === "missing exact evidence locator") return {
|
|
3426
|
+
constraint: "needExactEvidence",
|
|
3427
|
+
action: "disabled-exact-evidence"
|
|
3428
|
+
};
|
|
3429
|
+
return null;
|
|
3430
|
+
}
|
|
3431
|
+
function tokenize(text) {
|
|
3432
|
+
return new Set(text.toLowerCase().split(/\s+/).filter(Boolean));
|
|
3433
|
+
}
|
|
3434
|
+
function jaccardSimilarity(a, b) {
|
|
3435
|
+
let intersection = 0;
|
|
3436
|
+
for (const word of a) if (b.has(word)) intersection++;
|
|
3437
|
+
const union = a.size + b.size - intersection;
|
|
3438
|
+
return union === 0 ? 0 : intersection / union;
|
|
3439
|
+
}
|
|
3440
|
+
function applyMMRReranking(params) {
|
|
3441
|
+
const lambda = {
|
|
3442
|
+
family: .3,
|
|
3443
|
+
comparison: .4,
|
|
3444
|
+
direct: .7,
|
|
3445
|
+
temporal: .7,
|
|
3446
|
+
scoped: .7,
|
|
3447
|
+
"multi-hop": .7
|
|
3448
|
+
}[params.classification] ?? .5;
|
|
3449
|
+
if (params.results.length < 3) return {
|
|
3450
|
+
results: params.results,
|
|
3451
|
+
mmrApplied: false,
|
|
3452
|
+
mmrLambda: lambda
|
|
3453
|
+
};
|
|
3454
|
+
const scores = params.results.map((r) => r.score);
|
|
3455
|
+
const minScore = Math.min(...scores);
|
|
3456
|
+
const scoreRange = Math.max(...scores) - minScore || 1;
|
|
3457
|
+
const tokenSets = params.results.map((r) => tokenize(r.snippet));
|
|
3458
|
+
const selected = [params.results[0]];
|
|
3459
|
+
const selectedTokens = [tokenSets[0]];
|
|
3460
|
+
const remaining = new Set(params.results.slice(1).map((_, i) => i + 1));
|
|
3461
|
+
while (remaining.size > 0) {
|
|
3462
|
+
let bestIdx = -1;
|
|
3463
|
+
let bestScore = -Infinity;
|
|
3464
|
+
for (const idx of remaining) {
|
|
3465
|
+
const normalizedRelevance = (params.results[idx].score - minScore) / scoreRange;
|
|
3466
|
+
let maxSimilarity = 0;
|
|
3467
|
+
for (const selTokens of selectedTokens) {
|
|
3468
|
+
const sim = jaccardSimilarity(tokenSets[idx], selTokens);
|
|
3469
|
+
if (sim > maxSimilarity) maxSimilarity = sim;
|
|
3470
|
+
}
|
|
3471
|
+
const mmrScore = lambda * normalizedRelevance - (1 - lambda) * maxSimilarity;
|
|
3472
|
+
if (mmrScore > bestScore) {
|
|
3473
|
+
bestScore = mmrScore;
|
|
3474
|
+
bestIdx = idx;
|
|
3475
|
+
}
|
|
3476
|
+
}
|
|
3477
|
+
if (bestIdx >= 0) {
|
|
3478
|
+
selected.push(params.results[bestIdx]);
|
|
3479
|
+
selectedTokens.push(tokenSets[bestIdx]);
|
|
3480
|
+
remaining.delete(bestIdx);
|
|
3481
|
+
} else break;
|
|
3482
|
+
}
|
|
3483
|
+
return {
|
|
3484
|
+
results: selected,
|
|
3485
|
+
mmrApplied: true,
|
|
3486
|
+
mmrLambda: lambda
|
|
3487
|
+
};
|
|
3488
|
+
}
|
|
3489
|
+
async function executeMongoSearchPlan(params) {
|
|
3490
|
+
const normalized = normalizeMemorySearchRequest(params.request);
|
|
3491
|
+
const classification = classifyExecutorSearch(normalized);
|
|
3492
|
+
const timeRange = resolveExecutorTimeRange(normalized);
|
|
3493
|
+
const passPlans = buildExecutorPasses(normalized, classification);
|
|
3494
|
+
const passes = [];
|
|
3495
|
+
const allRejected = [];
|
|
3496
|
+
const acceptedById = /* @__PURE__ */ new Map();
|
|
3497
|
+
for (const passPlan of passPlans) {
|
|
3498
|
+
const passPaths = selectPassPaths({
|
|
3499
|
+
availablePaths: params.availablePaths,
|
|
3500
|
+
sourcePreference: normalized.sourcePreference,
|
|
3501
|
+
pass: passPlan.pass,
|
|
3502
|
+
...timeRange ? { timeRange } : {}
|
|
3503
|
+
});
|
|
3504
|
+
const executed = await params.executePass({
|
|
3505
|
+
pass: passPlan.pass,
|
|
3506
|
+
query: passPlan.query,
|
|
3507
|
+
availablePaths: passPaths,
|
|
3508
|
+
...timeRange ? { timeRange } : {}
|
|
3509
|
+
});
|
|
3510
|
+
const filtered = applyHardConstraintRejections({
|
|
3511
|
+
results: executed.results,
|
|
3512
|
+
request: normalized,
|
|
3513
|
+
...timeRange ? { timeRange } : {}
|
|
3514
|
+
});
|
|
3515
|
+
allRejected.push(...filtered.rejected);
|
|
3516
|
+
for (const result of filtered.accepted) acceptedById.set(searchResultIdentity(result), result);
|
|
3517
|
+
passes.push({
|
|
3518
|
+
pass: passPlan.pass,
|
|
3519
|
+
query: passPlan.query,
|
|
3520
|
+
reason: passPlan.reason,
|
|
3521
|
+
pathsExecuted: executed.metadata.pathsExecuted,
|
|
3522
|
+
resultCount: filtered.accepted.length,
|
|
3523
|
+
queryRewritten: executed.metadata.queryRewritten === true,
|
|
3524
|
+
reranked: executed.metadata.reranked === true,
|
|
3525
|
+
metadata: {
|
|
3526
|
+
pathsExecuted: executed.metadata.pathsExecuted,
|
|
3527
|
+
resultsByPath: executed.metadata.resultsByPath,
|
|
3528
|
+
queryRewritten: executed.metadata.queryRewritten === true,
|
|
3529
|
+
reranked: executed.metadata.reranked === true,
|
|
3530
|
+
plan: {
|
|
3531
|
+
paths: executed.metadata.plan.paths,
|
|
3532
|
+
confidence: executed.metadata.plan.confidence,
|
|
3533
|
+
reasoning: executed.metadata.plan.reasoning,
|
|
3534
|
+
...executed.metadata.plan.constraints ? { constraints: executed.metadata.plan.constraints } : {}
|
|
3535
|
+
}
|
|
3536
|
+
}
|
|
3537
|
+
});
|
|
3538
|
+
const acceptedResults = Array.from(acceptedById.values());
|
|
3539
|
+
const evidenceCoverage = computeEvidenceCoverage(acceptedResults);
|
|
3540
|
+
if (acceptedResults.length > 0 && (classification === "direct" ? !normalized.needExactEvidence || evidenceCoverage === "direct" || evidenceCoverage === "partial" : classification === "family" || classification === "comparison" ? acceptedResults.length >= Math.min(normalized.maxResults ?? 10, 3) : !normalized.needExactEvidence || evidenceCoverage === "direct" || evidenceCoverage === "partial")) break;
|
|
3541
|
+
}
|
|
3542
|
+
let acceptedResults = Array.from(acceptedById.values());
|
|
3543
|
+
const correction = analyzeCorrectionNeeded({
|
|
3544
|
+
evidenceCoverage: computeEvidenceCoverage(acceptedResults),
|
|
3545
|
+
rejected: allRejected,
|
|
3546
|
+
passCount: passes.length,
|
|
3547
|
+
maxPasses: normalized.maxPasses
|
|
3548
|
+
});
|
|
3549
|
+
if (correction.needed && correction.correction) {
|
|
3550
|
+
let correctiveTimeRange = timeRange;
|
|
3551
|
+
let correctiveRequest = normalized;
|
|
3552
|
+
if (correction.correction === "time-range-widened-2x" && timeRange) {
|
|
3553
|
+
const duration = timeRange.end.getTime() - timeRange.start.getTime();
|
|
3554
|
+
correctiveTimeRange = {
|
|
3555
|
+
start: new Date(timeRange.start.getTime() - duration),
|
|
3556
|
+
end: new Date(timeRange.end.getTime() + duration)
|
|
3557
|
+
};
|
|
3558
|
+
}
|
|
3559
|
+
if (correction.correction === "hybrid-evidence-relaxed") correctiveRequest = {
|
|
3560
|
+
...normalized,
|
|
3561
|
+
needExactEvidence: false
|
|
3562
|
+
};
|
|
3563
|
+
const correctivePaths = correction.correction === "hybrid-evidence-relaxed" ? new Set(["hybrid", ...params.availablePaths]) : params.availablePaths;
|
|
3564
|
+
const corrExec = await params.executePass({
|
|
3565
|
+
pass: passes.length + 1,
|
|
3566
|
+
query: normalized.query,
|
|
3567
|
+
availablePaths: correctivePaths,
|
|
3568
|
+
...correctiveTimeRange ? { timeRange: correctiveTimeRange } : {}
|
|
3569
|
+
});
|
|
3570
|
+
const corrFiltered = applyHardConstraintRejections({
|
|
3571
|
+
results: corrExec.results,
|
|
3572
|
+
request: correctiveRequest,
|
|
3573
|
+
...correctiveTimeRange ? { timeRange: correctiveTimeRange } : {}
|
|
3574
|
+
});
|
|
3575
|
+
allRejected.push(...corrFiltered.rejected);
|
|
3576
|
+
for (const result of corrFiltered.accepted) acceptedById.set(searchResultIdentity(result), result);
|
|
3577
|
+
passes.push({
|
|
3578
|
+
pass: passes.length + 1,
|
|
3579
|
+
query: normalized.query,
|
|
3580
|
+
reason: `corrective: ${correction.correction}`,
|
|
3581
|
+
pathsExecuted: corrExec.metadata.pathsExecuted,
|
|
3582
|
+
resultCount: corrFiltered.accepted.length,
|
|
3583
|
+
queryRewritten: corrExec.metadata.queryRewritten === true,
|
|
3584
|
+
reranked: corrExec.metadata.reranked === true,
|
|
3585
|
+
correctionApplied: correction.correction,
|
|
3586
|
+
metadata: {
|
|
3587
|
+
pathsExecuted: corrExec.metadata.pathsExecuted,
|
|
3588
|
+
resultsByPath: corrExec.metadata.resultsByPath,
|
|
3589
|
+
queryRewritten: corrExec.metadata.queryRewritten === true,
|
|
3590
|
+
reranked: corrExec.metadata.reranked === true,
|
|
3591
|
+
plan: corrExec.metadata.plan
|
|
3592
|
+
}
|
|
3593
|
+
});
|
|
3594
|
+
acceptedResults = Array.from(acceptedById.values());
|
|
3595
|
+
}
|
|
3596
|
+
let constraintRelaxations;
|
|
3597
|
+
if (acceptedResults.length === 0 && allRejected.length > 0) {
|
|
3598
|
+
const relaxation = identifyRelaxableConstraint(allRejected);
|
|
3599
|
+
if (relaxation) {
|
|
3600
|
+
let relaxedRequest = normalized;
|
|
3601
|
+
let relaxedTimeRange = timeRange;
|
|
3602
|
+
if (relaxation.action === "removed-time-range") relaxedTimeRange = void 0;
|
|
3603
|
+
if (relaxation.action === "disabled-exact-evidence") relaxedRequest = {
|
|
3604
|
+
...normalized,
|
|
3605
|
+
needExactEvidence: false
|
|
3606
|
+
};
|
|
3607
|
+
const relaxExec = await params.executePass({
|
|
3608
|
+
pass: passes.length + 1,
|
|
3609
|
+
query: normalized.query,
|
|
3610
|
+
availablePaths: params.availablePaths,
|
|
3611
|
+
...relaxedTimeRange ? { timeRange: relaxedTimeRange } : {}
|
|
3612
|
+
});
|
|
3613
|
+
const relaxFiltered = applyHardConstraintRejections({
|
|
3614
|
+
results: relaxExec.results,
|
|
3615
|
+
request: relaxedRequest,
|
|
3616
|
+
...relaxedTimeRange ? { timeRange: relaxedTimeRange } : {}
|
|
3617
|
+
});
|
|
3618
|
+
for (const result of relaxFiltered.accepted) acceptedById.set(searchResultIdentity(result), result);
|
|
3619
|
+
passes.push({
|
|
3620
|
+
pass: passes.length + 1,
|
|
3621
|
+
query: normalized.query,
|
|
3622
|
+
reason: `relaxation: ${relaxation.action}`,
|
|
3623
|
+
pathsExecuted: relaxExec.metadata.pathsExecuted,
|
|
3624
|
+
resultCount: relaxFiltered.accepted.length,
|
|
3625
|
+
queryRewritten: relaxExec.metadata.queryRewritten === true,
|
|
3626
|
+
reranked: relaxExec.metadata.reranked === true,
|
|
3627
|
+
correctionApplied: `relaxation:${relaxation.action}`,
|
|
3628
|
+
metadata: {
|
|
3629
|
+
pathsExecuted: relaxExec.metadata.pathsExecuted,
|
|
3630
|
+
resultsByPath: relaxExec.metadata.resultsByPath,
|
|
3631
|
+
queryRewritten: relaxExec.metadata.queryRewritten === true,
|
|
3632
|
+
reranked: relaxExec.metadata.reranked === true,
|
|
3633
|
+
plan: relaxExec.metadata.plan
|
|
3634
|
+
}
|
|
3635
|
+
});
|
|
3636
|
+
constraintRelaxations = [relaxation];
|
|
3637
|
+
acceptedResults = Array.from(acceptedById.values());
|
|
3638
|
+
}
|
|
3639
|
+
}
|
|
3640
|
+
if (normalized.needExactEvidence && acceptedResults.length === 0) return buildNoDirectEvidenceResponse({
|
|
3641
|
+
request: normalized,
|
|
3642
|
+
classification,
|
|
3643
|
+
passes,
|
|
3644
|
+
resultsRejected: allRejected,
|
|
3645
|
+
reason: "No exact-evidence results survived the active constraints."
|
|
3646
|
+
});
|
|
3647
|
+
const mmr = applyMMRReranking({
|
|
3648
|
+
results: acceptedResults,
|
|
3649
|
+
classification
|
|
3650
|
+
});
|
|
3651
|
+
return {
|
|
3652
|
+
results: mmr.results,
|
|
3653
|
+
metadata: mergeMetadata({
|
|
3654
|
+
request: normalized,
|
|
3655
|
+
classification,
|
|
3656
|
+
passes,
|
|
3657
|
+
resultsRejected: allRejected,
|
|
3658
|
+
results: mmr.results,
|
|
3659
|
+
constraintRelaxations,
|
|
3660
|
+
mmrApplied: mmr.mmrApplied,
|
|
3661
|
+
mmrLambda: mmr.mmrLambda
|
|
3662
|
+
})
|
|
3663
|
+
};
|
|
3664
|
+
}
|
|
3665
|
+
//#endregion
|
|
3067
3666
|
//#region src/memory/session-files.ts
|
|
3068
3667
|
const log$2 = createSubsystemLogger("memory");
|
|
3069
3668
|
async function listSessionFilesForAgent(agentId) {
|
|
@@ -3627,6 +4226,39 @@ function classifyQueryCacheSourceScope(results) {
|
|
|
3627
4226
|
function resolveQueryCacheTtlSec(results, config) {
|
|
3628
4227
|
return collectSearchResultSources(results).has("reference") ? config.kbTtlSec : config.conversationTtlSec;
|
|
3629
4228
|
}
|
|
4229
|
+
function normalizeSearchRequest(request) {
|
|
4230
|
+
const query = request.query.trim();
|
|
4231
|
+
return {
|
|
4232
|
+
...request,
|
|
4233
|
+
query,
|
|
4234
|
+
searchMode: request.searchMode ?? "auto",
|
|
4235
|
+
maxResults: request.maxResults ?? 10,
|
|
4236
|
+
minScore: request.minScore ?? .1,
|
|
4237
|
+
needExactEvidence: request.needExactEvidence === true,
|
|
4238
|
+
returnPlan: request.returnPlan === true,
|
|
4239
|
+
...request.maxPasses != null ? { maxPasses: Math.max(1, Math.min(3, request.maxPasses)) } : {}
|
|
4240
|
+
};
|
|
4241
|
+
}
|
|
4242
|
+
function emptySearchMetadata(request) {
|
|
4243
|
+
return {
|
|
4244
|
+
mode: request.searchMode ?? "auto",
|
|
4245
|
+
classification: "direct",
|
|
4246
|
+
sourceOrder: request.sourcePreference ?? [
|
|
4247
|
+
"conversation",
|
|
4248
|
+
"structured",
|
|
4249
|
+
"reference"
|
|
4250
|
+
],
|
|
4251
|
+
passes: [],
|
|
4252
|
+
queriesTried: [],
|
|
4253
|
+
constraintsApplied: [],
|
|
4254
|
+
resultsRejected: [],
|
|
4255
|
+
evidenceCoverage: "none",
|
|
4256
|
+
pathsExecuted: [],
|
|
4257
|
+
resultsByPath: {},
|
|
4258
|
+
queryRewritten: false,
|
|
4259
|
+
reranked: false
|
|
4260
|
+
};
|
|
4261
|
+
}
|
|
3630
4262
|
/**
|
|
3631
4263
|
* Heuristic reranker for v2 search results.
|
|
3632
4264
|
* - Source diversity penalty: no more than 2 results from the same source at the top
|
|
@@ -3839,21 +4471,32 @@ var MongoDBMemoryManager = class MongoDBMemoryManager {
|
|
|
3839
4471
|
log.info(`ready: profile=${mongoCfg.deploymentProfile} embedding=${mongoCfg.embeddingMode} fusion=${mongoCfg.fusionMethod} caps=${JSON.stringify(capabilities)}`);
|
|
3840
4472
|
return manager;
|
|
3841
4473
|
}
|
|
3842
|
-
buildConversationChunkFilter() {
|
|
3843
|
-
|
|
4474
|
+
buildConversationChunkFilter(params) {
|
|
4475
|
+
const filter = {
|
|
3844
4476
|
source: { $in: ["conversation", "sessions"] },
|
|
3845
4477
|
agentId: this.agentId,
|
|
3846
4478
|
status: { $ne: "deleted" }
|
|
3847
4479
|
};
|
|
4480
|
+
if (params?.sessionKey) filter.sessionId = params.sessionKey;
|
|
4481
|
+
if (params?.timeRange) filter.timestamp = {
|
|
4482
|
+
$gte: params.timeRange.start,
|
|
4483
|
+
$lte: params.timeRange.end
|
|
4484
|
+
};
|
|
4485
|
+
return filter;
|
|
3848
4486
|
}
|
|
3849
|
-
buildBridgeChunkFilter() {
|
|
3850
|
-
|
|
4487
|
+
buildBridgeChunkFilter(params) {
|
|
4488
|
+
const filter = {
|
|
3851
4489
|
source: { $in: ["conversation", "memory"] },
|
|
3852
4490
|
agentId: this.agentId,
|
|
3853
4491
|
scope: "workspace",
|
|
3854
4492
|
scopeRef: this.workspaceScopeRef,
|
|
3855
4493
|
status: { $ne: "deleted" }
|
|
3856
4494
|
};
|
|
4495
|
+
if (params?.timeRange) filter.updatedAt = {
|
|
4496
|
+
$gte: params.timeRange.start,
|
|
4497
|
+
$lte: params.timeRange.end
|
|
4498
|
+
};
|
|
4499
|
+
return filter;
|
|
3857
4500
|
}
|
|
3858
4501
|
getBridgeChunkBudget(maxResults) {
|
|
3859
4502
|
return Math.max(2, Math.ceil(maxResults / 3));
|
|
@@ -4017,21 +4660,33 @@ var MongoDBMemoryManager = class MongoDBMemoryManager {
|
|
|
4017
4660
|
return finalResults;
|
|
4018
4661
|
}
|
|
4019
4662
|
async search(query, opts) {
|
|
4020
|
-
|
|
4021
|
-
|
|
4663
|
+
return (await this.searchDetailed({
|
|
4664
|
+
query,
|
|
4665
|
+
maxResults: opts?.maxResults,
|
|
4666
|
+
minScore: opts?.minScore,
|
|
4667
|
+
...opts?.sessionKey ? { conversationScope: { sessionKey: opts.sessionKey } } : {}
|
|
4668
|
+
})).results;
|
|
4669
|
+
}
|
|
4670
|
+
async searchDetailed(request) {
|
|
4671
|
+
const normalized = normalizeSearchRequest(request);
|
|
4672
|
+
if (!normalized.query) {
|
|
4022
4673
|
this.setLastSearchMode("v2:empty-query");
|
|
4023
|
-
return
|
|
4674
|
+
return {
|
|
4675
|
+
results: [],
|
|
4676
|
+
metadata: emptySearchMetadata(normalized)
|
|
4677
|
+
};
|
|
4024
4678
|
}
|
|
4025
4679
|
const mongoCfg = this.config.mongodb;
|
|
4026
|
-
const maxResults = opts?.maxResults ?? 10;
|
|
4027
|
-
const minScore = opts?.minScore ?? .1;
|
|
4028
4680
|
const activeSources = getActiveSources(mongoCfg.sources, mongoCfg.kb.enabled);
|
|
4029
4681
|
const availablePaths = this.buildV2AvailablePaths(activeSources);
|
|
4682
|
+
const cacheQuery = normalized.query;
|
|
4683
|
+
const requestSignature = buildMemorySearchRequestSignature(normalized);
|
|
4030
4684
|
if (mongoCfg.cache.enabled) {
|
|
4031
4685
|
const cacheResult = await checkCache({
|
|
4032
4686
|
db: this.db,
|
|
4033
4687
|
prefix: this.prefix,
|
|
4034
|
-
query:
|
|
4688
|
+
query: cacheQuery,
|
|
4689
|
+
requestSignature,
|
|
4035
4690
|
agentId: this.agentId,
|
|
4036
4691
|
scope: "agent",
|
|
4037
4692
|
scopeRef: this.agentScopeRef,
|
|
@@ -4042,89 +4697,129 @@ var MongoDBMemoryManager = class MongoDBMemoryManager {
|
|
|
4042
4697
|
pathUsed: cacheResult.pathUsed,
|
|
4043
4698
|
sourceScope: cacheResult.sourceScope
|
|
4044
4699
|
});
|
|
4045
|
-
|
|
4700
|
+
const executorRequest = normalizeMemorySearchRequest(normalized);
|
|
4701
|
+
const classification = classifyExecutorSearch(executorRequest);
|
|
4702
|
+
const cachedPaths = cacheResult.pathUsed ? cacheResult.pathUsed.split(",").filter(Boolean) : [];
|
|
4703
|
+
const plannedPasses = buildExecutorPasses(executorRequest, classification).map((pass, index) => ({
|
|
4704
|
+
pass: pass.pass,
|
|
4705
|
+
query: pass.query,
|
|
4706
|
+
reason: index === 0 ? `${pass.reason} (cache hit)` : pass.reason,
|
|
4707
|
+
pathsExecuted: index === 0 ? cachedPaths : [],
|
|
4708
|
+
resultCount: index === 0 ? cacheResult.results.length : 0,
|
|
4709
|
+
queryRewritten: false,
|
|
4710
|
+
reranked: false
|
|
4711
|
+
}));
|
|
4712
|
+
return {
|
|
4713
|
+
results: cacheResult.results,
|
|
4714
|
+
metadata: {
|
|
4715
|
+
...emptySearchMetadata(normalized),
|
|
4716
|
+
classification,
|
|
4717
|
+
passes: plannedPasses,
|
|
4718
|
+
queriesTried: plannedPasses.map((pass) => pass.query),
|
|
4719
|
+
constraintsApplied: [...buildConstraintSummaries(executorRequest), ...requestHasHardConstraints(normalized) ? ["cache-hit-constrained"] : []],
|
|
4720
|
+
evidenceCoverage: computeEvidenceCoverage(cacheResult.results),
|
|
4721
|
+
pathsExecuted: cachedPaths
|
|
4722
|
+
}
|
|
4723
|
+
};
|
|
4046
4724
|
}
|
|
4047
4725
|
}
|
|
4048
4726
|
const searchStart = Date.now();
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4727
|
+
const response = await executeMongoSearchPlan({
|
|
4728
|
+
request: normalized,
|
|
4729
|
+
availablePaths,
|
|
4730
|
+
executePass: async ({ query: passQuery, availablePaths: passPaths, timeRange }) => searchV2(this.db, this.prefix, passQuery, this.agentId, {
|
|
4731
|
+
availablePaths: passPaths,
|
|
4052
4732
|
hasEpisodes: mongoCfg.episodes.enabled,
|
|
4053
4733
|
hasGraphData: mongoCfg.graph.enabled,
|
|
4054
|
-
maxResults,
|
|
4734
|
+
maxResults: normalized.maxResults,
|
|
4055
4735
|
searchOptions: {
|
|
4056
|
-
minScore,
|
|
4057
|
-
sessionKey:
|
|
4736
|
+
minScore: normalized.minScore,
|
|
4737
|
+
sessionKey: normalized.conversationScope?.sessionKey,
|
|
4058
4738
|
numCandidates: mongoCfg.numCandidates,
|
|
4059
4739
|
capabilities: this.capabilities,
|
|
4060
4740
|
fusionMethod: mongoCfg.fusionMethod,
|
|
4061
4741
|
embeddingMode: mongoCfg.embeddingMode,
|
|
4062
|
-
conversationFilter: this.buildConversationChunkFilter(
|
|
4063
|
-
|
|
4064
|
-
|
|
4742
|
+
conversationFilter: this.buildConversationChunkFilter({
|
|
4743
|
+
sessionKey: normalized.conversationScope?.sessionKey,
|
|
4744
|
+
...timeRange ? { timeRange } : {}
|
|
4745
|
+
}),
|
|
4746
|
+
bridgeFilter: activeSources.conversation ? this.buildBridgeChunkFilter(timeRange ? { timeRange } : void 0) : void 0,
|
|
4747
|
+
bridgeMaxResults: this.getBridgeChunkBudget(normalized.maxResults ?? 10),
|
|
4065
4748
|
scope: "agent",
|
|
4066
4749
|
scopeRef: this.agentScopeRef,
|
|
4067
4750
|
rerankConfig: mongoCfg.reranking,
|
|
4068
4751
|
queryRewriteConfig: mongoCfg.queryRewriting,
|
|
4069
4752
|
enableContiguousMerge: mongoCfg.enableContiguousMerge,
|
|
4070
|
-
enableContextExpansion: mongoCfg.enableContextExpansion
|
|
4753
|
+
enableContextExpansion: mongoCfg.enableContextExpansion,
|
|
4754
|
+
...normalized.sourcePreference ? { sourcePreference: normalized.sourcePreference } : {},
|
|
4755
|
+
...timeRange ? { explicitTimeRange: timeRange } : {},
|
|
4756
|
+
...normalized.structuredScope ? { structuredScope: normalized.structuredScope } : {},
|
|
4757
|
+
...normalized.referenceScope ? { referenceScope: normalized.referenceScope } : {},
|
|
4758
|
+
...normalized.proceduralScope ? { proceduralScope: normalized.proceduralScope } : {}
|
|
4071
4759
|
}
|
|
4072
|
-
})
|
|
4073
|
-
|
|
4074
|
-
|
|
4760
|
+
})
|
|
4761
|
+
});
|
|
4762
|
+
emitTelemetry(this.db, this.prefix, {
|
|
4763
|
+
meta: {
|
|
4764
|
+
agentId: this.agentId,
|
|
4765
|
+
operation: "search"
|
|
4766
|
+
},
|
|
4767
|
+
durationMs: Date.now() - searchStart,
|
|
4768
|
+
ok: response.results.length > 0,
|
|
4769
|
+
pathUsed: response.metadata.pathsExecuted.join(","),
|
|
4770
|
+
resultCount: response.results.length,
|
|
4771
|
+
topScore: response.results[0]?.score ?? 0,
|
|
4772
|
+
fusionMethod: mongoCfg.fusionMethod
|
|
4773
|
+
});
|
|
4774
|
+
const v2Details = {
|
|
4775
|
+
classification: response.metadata.classification,
|
|
4776
|
+
sourceOrder: response.metadata.sourceOrder,
|
|
4777
|
+
constraintsApplied: response.metadata.constraintsApplied,
|
|
4778
|
+
pathsExecuted: response.metadata.pathsExecuted,
|
|
4779
|
+
resultsByPath: response.metadata.resultsByPath,
|
|
4780
|
+
evidenceCoverage: response.metadata.evidenceCoverage
|
|
4781
|
+
};
|
|
4782
|
+
if (response.results.length > 0) {
|
|
4783
|
+
this.setLastSearchMode("v2", v2Details);
|
|
4784
|
+
if (mongoCfg.cache.enabled) {
|
|
4785
|
+
const sourceScope = classifyQueryCacheSourceScope(response.results);
|
|
4786
|
+
const ttlSec = resolveQueryCacheTtlSec(response.results, mongoCfg.cache);
|
|
4787
|
+
writeCache({
|
|
4788
|
+
db: this.db,
|
|
4789
|
+
prefix: this.prefix,
|
|
4790
|
+
query: cacheQuery,
|
|
4791
|
+
requestSignature,
|
|
4075
4792
|
agentId: this.agentId,
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
fusionMethod: mongoCfg.fusionMethod
|
|
4084
|
-
});
|
|
4085
|
-
const v2Details = {
|
|
4086
|
-
plan: v2.metadata.plan.paths,
|
|
4087
|
-
confidence: v2.metadata.plan.confidence,
|
|
4088
|
-
constraints: v2.metadata.plan.constraints,
|
|
4089
|
-
pathsExecuted: v2.metadata.pathsExecuted,
|
|
4090
|
-
resultsByPath: v2.metadata.resultsByPath
|
|
4091
|
-
};
|
|
4092
|
-
if (v2.results.length > 0) {
|
|
4093
|
-
this.setLastSearchMode("v2", v2Details);
|
|
4094
|
-
if (mongoCfg.cache.enabled) {
|
|
4095
|
-
const sourceScope = classifyQueryCacheSourceScope(v2.results);
|
|
4096
|
-
const ttlSec = resolveQueryCacheTtlSec(v2.results, mongoCfg.cache);
|
|
4097
|
-
writeCache({
|
|
4098
|
-
db: this.db,
|
|
4099
|
-
prefix: this.prefix,
|
|
4100
|
-
query: cleaned,
|
|
4101
|
-
agentId: this.agentId,
|
|
4102
|
-
scope: "agent",
|
|
4103
|
-
scopeRef: this.agentScopeRef,
|
|
4104
|
-
results: v2.results,
|
|
4105
|
-
pathUsed: v2.metadata.pathsExecuted.join(","),
|
|
4106
|
-
sourceScope,
|
|
4107
|
-
ttlSec
|
|
4108
|
-
});
|
|
4109
|
-
}
|
|
4110
|
-
return v2.results;
|
|
4793
|
+
scope: "agent",
|
|
4794
|
+
scopeRef: this.agentScopeRef,
|
|
4795
|
+
results: response.results,
|
|
4796
|
+
pathUsed: response.metadata.pathsExecuted.join(","),
|
|
4797
|
+
sourceScope,
|
|
4798
|
+
ttlSec
|
|
4799
|
+
});
|
|
4111
4800
|
}
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
return fallbackResults;
|
|
4118
|
-
} catch (err) {
|
|
4119
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
4120
|
-
log.warn(`planner search failed, falling back to legacy search: ${message}`);
|
|
4121
|
-
const fallbackResults = await this.legacySearch(cleaned, opts);
|
|
4122
|
-
this.setLastSearchMode("v2->legacy-error", {
|
|
4123
|
-
error: message,
|
|
4124
|
-
fallbackResults: fallbackResults.length
|
|
4125
|
-
});
|
|
4126
|
-
return fallbackResults;
|
|
4801
|
+
return response;
|
|
4802
|
+
}
|
|
4803
|
+
if (requestHasHardConstraints(normalized)) {
|
|
4804
|
+
this.setLastSearchMode("v2:constrained-empty", v2Details);
|
|
4805
|
+
return response;
|
|
4127
4806
|
}
|
|
4807
|
+
const fallbackResults = await this.legacySearch(normalized.query, {
|
|
4808
|
+
maxResults: normalized.maxResults,
|
|
4809
|
+
minScore: normalized.minScore,
|
|
4810
|
+
sessionKey: normalized.conversationScope?.sessionKey
|
|
4811
|
+
});
|
|
4812
|
+
this.setLastSearchMode("v2->legacy-empty", {
|
|
4813
|
+
...v2Details,
|
|
4814
|
+
fallbackResults: fallbackResults.length
|
|
4815
|
+
});
|
|
4816
|
+
return {
|
|
4817
|
+
results: fallbackResults,
|
|
4818
|
+
metadata: {
|
|
4819
|
+
...response.metadata,
|
|
4820
|
+
pathsExecuted: response.metadata.pathsExecuted.length ? response.metadata.pathsExecuted : ["legacy"]
|
|
4821
|
+
}
|
|
4822
|
+
};
|
|
4128
4823
|
}
|
|
4129
4824
|
async relevanceExplain(params) {
|
|
4130
4825
|
if (!this.relevance) throw new Error("relevance runtime is unavailable");
|
|
@@ -4904,7 +5599,7 @@ var MongoDBMemoryManager = class MongoDBMemoryManager {
|
|
|
4904
5599
|
if (hoursSinceRefresh < autoRefreshHours) return;
|
|
4905
5600
|
log.info(`KB auto-refresh: ${hoursSinceRefresh.toFixed(1)}h since last import, refreshing ${paths.length} paths`);
|
|
4906
5601
|
try {
|
|
4907
|
-
const { ingestFilesToKB } = await import("./mongodb-kb-
|
|
5602
|
+
const { ingestFilesToKB } = await import("./mongodb-kb-DLMbN3EX.js");
|
|
4908
5603
|
const result = await ingestFilesToKB({
|
|
4909
5604
|
db: this.db,
|
|
4910
5605
|
prefix: this.prefix,
|
|
@@ -4979,7 +5674,7 @@ var MongoDBMemoryManager = class MongoDBMemoryManager {
|
|
|
4979
5674
|
}
|
|
4980
5675
|
async writeStructuredMemory(entry) {
|
|
4981
5676
|
const mongoCfg = this.config.mongodb;
|
|
4982
|
-
const { writeStructuredMemory: writeFn } = await import("./mongodb-structured-memory-
|
|
5677
|
+
const { writeStructuredMemory: writeFn } = await import("./mongodb-structured-memory-D1yQLG0x.js");
|
|
4983
5678
|
return writeFn({
|
|
4984
5679
|
db: this.db,
|
|
4985
5680
|
prefix: this.prefix,
|
|
@@ -4993,7 +5688,7 @@ var MongoDBMemoryManager = class MongoDBMemoryManager {
|
|
|
4993
5688
|
}
|
|
4994
5689
|
async writeProcedure(entry) {
|
|
4995
5690
|
const mongoCfg = this.config.mongodb;
|
|
4996
|
-
const { writeProcedure: writeFn } = await import("./mongodb-procedures-
|
|
5691
|
+
const { writeProcedure: writeFn } = await import("./mongodb-procedures-BxD5_Od0.js");
|
|
4997
5692
|
return writeFn({
|
|
4998
5693
|
db: this.db,
|
|
4999
5694
|
prefix: this.prefix,
|
|
@@ -5189,6 +5884,25 @@ var MongoDBMemoryManager = class MongoDBMemoryManager {
|
|
|
5189
5884
|
}
|
|
5190
5885
|
}
|
|
5191
5886
|
};
|
|
5887
|
+
function pathMatchesSourcePreference(path, source) {
|
|
5888
|
+
switch (source) {
|
|
5889
|
+
case "conversation": return path === "hybrid" || path === "raw-window";
|
|
5890
|
+
case "reference": return path === "kb";
|
|
5891
|
+
case "structured": return path === "structured" || path === "active-critical";
|
|
5892
|
+
case "procedural": return path === "procedural";
|
|
5893
|
+
case "episodic": return path === "episodic";
|
|
5894
|
+
case "graph": return path === "graph";
|
|
5895
|
+
default: return false;
|
|
5896
|
+
}
|
|
5897
|
+
}
|
|
5898
|
+
function reorderPathsBySourcePreference(paths, sourcePreference) {
|
|
5899
|
+
if (!sourcePreference || sourcePreference.length === 0) return paths;
|
|
5900
|
+
return [...paths].toSorted((left, right) => {
|
|
5901
|
+
const leftRank = sourcePreference.findIndex((source) => pathMatchesSourcePreference(left, source));
|
|
5902
|
+
const rightRank = sourcePreference.findIndex((source) => pathMatchesSourcePreference(right, source));
|
|
5903
|
+
return (leftRank === -1 ? sourcePreference.length : leftRank) - (rightRank === -1 ? sourcePreference.length : rightRank);
|
|
5904
|
+
});
|
|
5905
|
+
}
|
|
5192
5906
|
function graphRelationPriority(type) {
|
|
5193
5907
|
switch (type) {
|
|
5194
5908
|
case "works_on":
|
|
@@ -5260,22 +5974,21 @@ async function searchV2(db, prefix, query, agentId, context) {
|
|
|
5260
5974
|
const maxResults = context.maxResults ?? 20;
|
|
5261
5975
|
const minScore = context.searchOptions?.minScore ?? .1;
|
|
5262
5976
|
const numCandidates = context.searchOptions?.numCandidates ?? 200;
|
|
5263
|
-
const capabilities = context.searchOptions?.capabilities ?? {
|
|
5264
|
-
vectorSearch: true,
|
|
5265
|
-
textSearch: true,
|
|
5266
|
-
scoreFusion: true,
|
|
5267
|
-
rankFusion: false
|
|
5268
|
-
};
|
|
5977
|
+
const capabilities = context.searchOptions?.capabilities ?? await detectCapabilities(db, `${prefix}chunks`);
|
|
5269
5978
|
const fusionMethod = context.searchOptions?.fusionMethod ?? "scoreFusion";
|
|
5270
5979
|
const embeddingMode = context.searchOptions?.embeddingMode ?? "automated";
|
|
5271
5980
|
const bridgeMaxResults = context.searchOptions?.bridgeMaxResults ?? Math.max(2, Math.ceil(maxResults / 3));
|
|
5272
5981
|
const allowHybridBackstop = context.searchOptions?.allowHybridBackstop ?? true;
|
|
5273
|
-
const
|
|
5982
|
+
const rawPlan = planRetrieval(query, {
|
|
5274
5983
|
availablePaths: context.availablePaths,
|
|
5275
5984
|
knownEntityNames: graphQueryCandidates,
|
|
5276
5985
|
hasEpisodes: context.hasEpisodes,
|
|
5277
5986
|
hasGraphData: context.hasGraphData
|
|
5278
5987
|
});
|
|
5988
|
+
const plan = {
|
|
5989
|
+
...rawPlan,
|
|
5990
|
+
paths: reorderPathsBySourcePreference(rawPlan.paths, context.searchOptions?.sourcePreference)
|
|
5991
|
+
};
|
|
5279
5992
|
const qrConfig = context.searchOptions?.queryRewriteConfig;
|
|
5280
5993
|
let searchQuery = query;
|
|
5281
5994
|
let wasQueryRewritten = false;
|
|
@@ -5293,22 +6006,37 @@ async function searchV2(db, prefix, query, agentId, context) {
|
|
|
5293
6006
|
}
|
|
5294
6007
|
}
|
|
5295
6008
|
const constrainedGraphCandidates = plan.constraints?.entities?.names && plan.constraints.entities.names.length > 0 ? plan.constraints.entities.names : graphQueryCandidates;
|
|
5296
|
-
const timeRange = plan.constraints?.timeRange ? resolveTimeRangePreset(plan.constraints.timeRange.preset) : void 0;
|
|
6009
|
+
const timeRange = context.searchOptions?.explicitTimeRange ?? (plan.constraints?.timeRange ? resolveTimeRangePreset(plan.constraints.timeRange.preset) : void 0);
|
|
5297
6010
|
const structuredFilter = {
|
|
5298
6011
|
agentId,
|
|
5299
|
-
|
|
6012
|
+
scope,
|
|
6013
|
+
scopeRef: agentScopeRef,
|
|
6014
|
+
...plan.constraints?.structured?.type ? { type: plan.constraints.structured.type } : {},
|
|
6015
|
+
...context.searchOptions?.structuredScope?.type ? { type: context.searchOptions.structuredScope.type } : {},
|
|
6016
|
+
...context.searchOptions?.structuredScope?.state ? { state: Array.isArray(context.searchOptions.structuredScope.state) ? context.searchOptions.structuredScope.state : context.searchOptions.structuredScope.state } : {},
|
|
6017
|
+
...context.searchOptions?.structuredScope?.salience?.length ? { salience: context.searchOptions.structuredScope.salience } : {}
|
|
5300
6018
|
};
|
|
5301
6019
|
const activeCriticalFilter = {
|
|
5302
6020
|
agentId,
|
|
6021
|
+
scope,
|
|
6022
|
+
scopeRef: agentScopeRef,
|
|
5303
6023
|
state: "active",
|
|
5304
6024
|
salience: plan.constraints?.activeCritical?.salience ?? ["critical", "high"],
|
|
5305
6025
|
currentOnly: true
|
|
5306
6026
|
};
|
|
5307
6027
|
const proceduralFilter = {
|
|
5308
6028
|
agentId,
|
|
5309
|
-
|
|
6029
|
+
scope,
|
|
6030
|
+
scopeRef: agentScopeRef,
|
|
6031
|
+
state: context.searchOptions?.proceduralScope?.state ?? "active",
|
|
6032
|
+
...context.searchOptions?.proceduralScope?.intentTags?.length ? { intentTags: context.searchOptions.proceduralScope.intentTags } : {}
|
|
6033
|
+
};
|
|
6034
|
+
const kbFilter = {
|
|
6035
|
+
...plan.constraints?.kb?.source ? { source: plan.constraints.kb.source } : {},
|
|
6036
|
+
...context.searchOptions?.referenceScope?.source ? { source: context.searchOptions.referenceScope.source } : {},
|
|
6037
|
+
...context.searchOptions?.referenceScope?.category ? { category: context.searchOptions.referenceScope.category } : {},
|
|
6038
|
+
...context.searchOptions?.referenceScope?.tags?.length ? { tags: context.searchOptions.referenceScope.tags } : {}
|
|
5310
6039
|
};
|
|
5311
|
-
const kbFilter = plan.constraints?.kb ? plan.constraints.kb.source ? { source: plan.constraints.kb.source } : {} : void 0;
|
|
5312
6040
|
const results = [];
|
|
5313
6041
|
const pathsExecuted = [];
|
|
5314
6042
|
const resultsByPath = {};
|
|
@@ -5345,8 +6073,15 @@ async function searchV2(db, prefix, query, agentId, context) {
|
|
|
5345
6073
|
return [];
|
|
5346
6074
|
});
|
|
5347
6075
|
break;
|
|
5348
|
-
case "raw-window":
|
|
5349
|
-
|
|
6076
|
+
case "raw-window": {
|
|
6077
|
+
const rawWindowLimit = 50;
|
|
6078
|
+
pathResults = [...context.searchOptions?.sessionKey ? await getEventsBySession({
|
|
6079
|
+
db,
|
|
6080
|
+
prefix,
|
|
6081
|
+
agentId,
|
|
6082
|
+
sessionId: context.searchOptions.sessionKey,
|
|
6083
|
+
limit: rawWindowLimit
|
|
6084
|
+
}) : await getEventsByTimeRange({
|
|
5350
6085
|
db,
|
|
5351
6086
|
prefix,
|
|
5352
6087
|
agentId,
|
|
@@ -5354,7 +6089,7 @@ async function searchV2(db, prefix, query, agentId, context) {
|
|
|
5354
6089
|
end: timeRange?.end ?? /* @__PURE__ */ new Date(),
|
|
5355
6090
|
scope,
|
|
5356
6091
|
scopeRef: agentScopeRef,
|
|
5357
|
-
limit:
|
|
6092
|
+
limit: rawWindowLimit
|
|
5358
6093
|
})].toSorted((a, b) => b.timestamp.getTime() - a.timestamp.getTime()).map((e, i) => ({
|
|
5359
6094
|
canonicalId: e.eventId,
|
|
5360
6095
|
path: `events/${e.eventId}`,
|
|
@@ -5369,6 +6104,7 @@ async function searchV2(db, prefix, query, agentId, context) {
|
|
|
5369
6104
|
timestamp: e.timestamp
|
|
5370
6105
|
}));
|
|
5371
6106
|
break;
|
|
6107
|
+
}
|
|
5372
6108
|
case "graph":
|
|
5373
6109
|
if (constrainedGraphCandidates.length > 0) {
|
|
5374
6110
|
const entity = pickBestEntityMatch((await Promise.all(constrainedGraphCandidates.slice(0, 4).map((name) => findEntitiesByName({
|
|
@@ -5479,7 +6215,7 @@ async function searchV2(db, prefix, query, agentId, context) {
|
|
|
5479
6215
|
pathResults = await searchKB(kbChunksCollection(db, prefix), searchQuery, null, {
|
|
5480
6216
|
maxResults: Math.max(3, Math.floor((context.maxResults ?? 10) / 3)),
|
|
5481
6217
|
minScore,
|
|
5482
|
-
...kbFilter ? { filter: kbFilter } : {},
|
|
6218
|
+
...Object.keys(kbFilter).length > 0 ? { filter: kbFilter } : {},
|
|
5483
6219
|
numCandidates,
|
|
5484
6220
|
vectorIndexName: `${prefix}kb_chunks_vector`,
|
|
5485
6221
|
textIndexName: `${prefix}kb_chunks_text`,
|