silentlake 3.0.0
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/LICENSE +21 -0
- package/README.md +205 -0
- package/dist/APEv2Parser-BZv_dP9t.js +269 -0
- package/dist/APEv2Parser-CPzxFNBB.js +5 -0
- package/dist/AbstractID3Parser-mvDFcjYV.js +47 -0
- package/dist/AiffParser-BXQ9SRZk.js +145 -0
- package/dist/AsfParser-CmBDUlZE.js +631 -0
- package/dist/BasicParser-DhmXREDo.js +853 -0
- package/dist/DsdiffParser-CTKKGyZg.js +150 -0
- package/dist/DsfParser-Ds-YQe4Z.js +101 -0
- package/dist/FlacParser-B1XVPgXF.js +5 -0
- package/dist/FlacParser-DMPyL1y4.js +367 -0
- package/dist/ID3v1Parser-BICWWVDG.js +289 -0
- package/dist/ID3v2Parser-BmZHSUqs.js +650 -0
- package/dist/ID3v2Token-DeJf4tYQ.js +145 -0
- package/dist/MP4Parser-Cjf-Zs8T.js +1061 -0
- package/dist/MatroskaParser-DgBzBe8t.js +909 -0
- package/dist/MpegParser-D5swTpA1.js +744 -0
- package/dist/MusepackParser-D8EQXnpK.js +285 -0
- package/dist/OggParser-BcIYPHwP.js +390 -0
- package/dist/Util-D_zGsr97.js +170 -0
- package/dist/WavPackParser-hosU8gfo.js +166 -0
- package/dist/WaveParser-CA00FZrC.js +273 -0
- package/dist/abort-cutoff-CERmtgZI.js +56 -0
- package/dist/abort-cutoff.runtime-BuaoE5Si.js +61 -0
- package/dist/abort-signal-CsrBEr94.js +13 -0
- package/dist/account-helpers-D3c_eI7c.js +37 -0
- package/dist/account-helpers-ru3jdZSV.js +12 -0
- package/dist/account-id-DZnNZg8x.js +1 -0
- package/dist/account-id-ZCrgXl7Z.js +44 -0
- package/dist/account-lookup-nkoa-foB.js +10 -0
- package/dist/account-snapshot-fields-Cvq7803C.js +116 -0
- package/dist/account-summary-B5Xzvntm.js +36 -0
- package/dist/accounts-CYgFhv2o.js +105 -0
- package/dist/accounts-ChlyF7cx.js +112 -0
- package/dist/accounts-Fyrhtztr.js +212 -0
- package/dist/ack-reactions-CNVwfOBj.js +43 -0
- package/dist/acp-cli-BIcgXTaP.js +2033 -0
- package/dist/acp-runtime-BdLdT-QY.js +1 -0
- package/dist/actions.runtime-BBPvLwDK.js +236 -0
- package/dist/actions.runtime-MrkZQbUZ.js +217 -0
- package/dist/agent-CBOdzEvR.js +1 -0
- package/dist/agent-scope-BLhzf-o0.js +17 -0
- package/dist/agent-scope-DPP4Z_UU.js +193 -0
- package/dist/agents-DGJIvby1.js +323 -0
- package/dist/agents-DbUUarGq.js +855 -0
- package/dist/agents.config-C_lrnc9J.js +18 -0
- package/dist/agents.config-D1VqC78r.js +121 -0
- package/dist/allow-from-BPSBITdd.js +9 -0
- package/dist/allow-from-BwTLpvhp.js +20 -0
- package/dist/allow-from-C4iBpqFI.js +62 -0
- package/dist/allowlist-config-edit-CKbnMmwS.js +279 -0
- package/dist/allowlist-match-CYmPgg1K.js +63 -0
- package/dist/ansi-BEJF8NKS.js +54 -0
- package/dist/anthropic-vertex-provider-Dd5agCN9.js +60 -0
- package/dist/apply.runtime-BO_W7UsB.js +211 -0
- package/dist/apply.runtime-BeYLuuGy.js +370 -0
- package/dist/archive-Tr0wIUO-.js +532 -0
- package/dist/arg-split-Dtda0YDl.js +38 -0
- package/dist/artifacts-C_4LekPC.js +39 -0
- package/dist/audit-COaaGhfd.js +788 -0
- package/dist/audit-OWBlbPvC.js +54 -0
- package/dist/audit-channel.allow-from.runtime-B7BHNblL.js +17 -0
- package/dist/audit-channel.collect.runtime-BjAagjy5.js +521 -0
- package/dist/audit-channel.discord.runtime-BBY6S9lg.js +5 -0
- package/dist/audit-channel.telegram.runtime-SJnxOJH2.js +8 -0
- package/dist/audit-channel.zalouser.runtime-SGRWvHxT.js +5 -0
- package/dist/audit-extra.async-Brlm785b.js +817 -0
- package/dist/audit-fs-oDMUa5N_.js +375 -0
- package/dist/audit-membership-runtime-BV4yo8s2.js +261 -0
- package/dist/audit.deep.runtime-C4qycPyC.js +31 -0
- package/dist/audit.nondeep.runtime-BKadRetL.js +842 -0
- package/dist/audit.runtime-n3hTkevZ.js +74 -0
- package/dist/auth-O6LQFLHJ.js +416 -0
- package/dist/auth-choice-D-8Ti3vA.js +219 -0
- package/dist/auth-choice-DN87_4lW.js +610 -0
- package/dist/auth-choice-in4GYJhH.js +64 -0
- package/dist/auth-choice-legacy-Clyw2lVc.js +17 -0
- package/dist/auth-choice-options-Bu05kzZL.js +127 -0
- package/dist/auth-choice-prompt-BCN6pEXi.js +215 -0
- package/dist/auth-choice-prompt-CtrY5wqR.js +36 -0
- package/dist/auth-choice.apply-helpers-BibBSEl9.js +66 -0
- package/dist/auth-choice.plugin-providers.runtime-T3IBLR0k.js +219 -0
- package/dist/auth-health-BKOrx-5O.js +166 -0
- package/dist/auth-mode-policy-DywddkT-.js +18 -0
- package/dist/auth-profiles-CDiIWpd-.js +1047 -0
- package/dist/auth-profiles.runtime-SDKdG_z_.js +48 -0
- package/dist/avatar-policy-Ds9e6uHI.js +67 -0
- package/dist/backup-create-CwfGrmvZ.js +461 -0
- package/dist/banner-TF-M94dP.js +351 -0
- package/dist/base-session-key-Cf2rkwag.js +14 -0
- package/dist/bindings-BV4AtNSY.js +21 -0
- package/dist/bindings-kjwuC11Q.js +69 -0
- package/dist/bluebubbles-C1M3Geg0.js +87 -0
- package/dist/bluebubbles-CahJ717x.js +603 -0
- package/dist/bluebubbles-dEl4QpYz.js +37 -0
- package/dist/bonjour-discovery-C2oY96BG.js +376 -0
- package/dist/boolean-DKtCJu_W.js +29 -0
- package/dist/boolean-param-xAGXUSSN.js +13 -0
- package/dist/boundary-file-read-BP6VMpqH.js +106 -0
- package/dist/boundary-path-B3FFLYNx.js +557 -0
- package/dist/brave--q9r6diS.js +405 -0
- package/dist/brew-DSwWqzLd.js +44 -0
- package/dist/browser-cli-BLE-cZxz.js +1502 -0
- package/dist/build-info.json +5 -0
- package/dist/bundled/boot-md/HOOK.md +20 -0
- package/dist/bundled/boot-md/handler.js +381 -0
- package/dist/bundled/bootstrap-extra-files/HOOK.md +53 -0
- package/dist/bundled/bootstrap-extra-files/handler.js +56 -0
- package/dist/bundled/command-logger/HOOK.md +122 -0
- package/dist/bundled/command-logger/handler.js +62 -0
- package/dist/bundled/session-memory/HOOK.md +109 -0
- package/dist/bundled/session-memory/handler.js +401 -0
- package/dist/call-6gyz3vtP.js +44 -0
- package/dist/call-I0SGvyU7.js +639 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -0
- package/dist/canvas-host/a2ui/a2ui.bundle.js +1 -0
- package/dist/canvas-host/a2ui/index.html +307 -0
- package/dist/catalog-BwAYUfL7.js +240 -0
- package/dist/channel-5NZHO7iU.js +4945 -0
- package/dist/channel-BJK4S8ZH.js +1006 -0
- package/dist/channel-CNodzoey.js +321 -0
- package/dist/channel-UyhyMj09.js +1077 -0
- package/dist/channel-account-context-DXI4NQFD.js +104 -0
- package/dist/channel-actions-DU2CR3xW.js +37 -0
- package/dist/channel-activity-B8aReQoE.js +35 -0
- package/dist/channel-config-3Uv6ve2_.js +115 -0
- package/dist/channel-config-helpers-ChUYvBB0.js +377 -0
- package/dist/channel-config-schema-DEVsCZpj.js +1 -0
- package/dist/channel-feedback-G6zh8efr.js +245 -0
- package/dist/channel-inbound-3L_8TOZ0.js +395 -0
- package/dist/channel-lifecycle-CpU1dRbh.js +354 -0
- package/dist/channel-options-DJaIP4Dv.js +38 -0
- package/dist/channel-pairing-rNA4qQPY.js +66 -0
- package/dist/channel-pb3INhpi.js +1284 -0
- package/dist/channel-plugin-common-BhTxCE5t.js +1 -0
- package/dist/channel-plugin-ids-CFeS3qir.js +26 -0
- package/dist/channel-plugin-resolution-BSK2VmVJ.js +112 -0
- package/dist/channel-policy-C4GKHvhz.js +1 -0
- package/dist/channel-reply-pipeline-CPTuaW8n.js +15 -0
- package/dist/channel-send-result-By8EpCPw.js +40 -0
- package/dist/channel-setup-BiFBGGLd.js +49 -0
- package/dist/channel-shared-B7nVL6s_.js +308 -0
- package/dist/channel-summary-BDcfGPTZ.js +137 -0
- package/dist/channel-summary-rf4JbM-W.js +41 -0
- package/dist/channel-targets-DfnKGXez.js +87 -0
- package/dist/channel-xTzNVpmF.js +1602 -0
- package/dist/channel.runtime-BgaUUB7d.js +268 -0
- package/dist/channel.runtime-C3f_klCw.js +324 -0
- package/dist/channel.runtime-CdJxCNlJ.js +512 -0
- package/dist/channel.runtime-CzzQWPgu.js +35 -0
- package/dist/channel.runtime-PVCKVe5x.js +288 -0
- package/dist/channel.runtime-jBXnZL1S.js +230 -0
- package/dist/channels-CRtKc7T_.js +1393 -0
- package/dist/channels-XmRcwHO_.js +408 -0
- package/dist/channels-cli-BgTInHdf.js +412 -0
- package/dist/channels-status-issues-C_U44M8Y.js +16 -0
- package/dist/chat-type-C-n03mQY.js +10 -0
- package/dist/clack-prompter-DuzDnaLi.js +112 -0
- package/dist/clawbot-cli-lS6Ntjly.js +218 -0
- package/dist/cli/daemon-cli.js +9 -0
- package/dist/cli-DBYk4h7a.js +254 -0
- package/dist/cli-name-Daok7A7-.js +25 -0
- package/dist/cli-runtime-aAVwbEYy.js +7 -0
- package/dist/cli-startup-metadata.json +26 -0
- package/dist/cli-utils-Np4NAAtt.js +39 -0
- package/dist/command-format-CjE6bLiz.js +21 -0
- package/dist/command-format-D7pz5AcU.js +2 -0
- package/dist/command-gating-BQXGSqc9.js +40 -0
- package/dist/command-options-5coRiipK.js +25 -0
- package/dist/command-poll-backoff-CpkSns-6.js +56 -0
- package/dist/command-poll-backoff.runtime-YT6EGcLN.js +7 -0
- package/dist/command-registry-BYuNrgu_.js +14 -0
- package/dist/command-registry-Dkr1-w1Q.js +242 -0
- package/dist/command-secret-gateway-u-EjduIr.js +211 -0
- package/dist/command-secret-targets-COcwhn-D.js +88 -0
- package/dist/command-secret-targets-CQJT3viO.js +3 -0
- package/dist/commands-Bb9xUwz9.js +42 -0
- package/dist/commands-core-CD6RD8UX.js +4923 -0
- package/dist/commands-core.runtime-DhRG5rok.js +232 -0
- package/dist/commands-registry-ChCep1KJ.js +295 -0
- package/dist/commands-registry.data-XyUTELK9.js +904 -0
- package/dist/commands-registry.runtime-m5WTxFtv.js +25 -0
- package/dist/commands-status.runtime-DZwdZgLZ.js +211 -0
- package/dist/commands.runtime-BbpkbBbI.js +232 -0
- package/dist/common-CUBlLRXB.js +457 -0
- package/dist/compact.runtime-DwG4Ix3B.js +216 -0
- package/dist/completion-cli-CYjSNenV.js +17 -0
- package/dist/completion-cli-CuQ2VNX5.js +445 -0
- package/dist/config-6sZwvXJD.js +88 -0
- package/dist/config-C-Ef7QhH.js +23 -0
- package/dist/config-DdDLrP_v.js +273 -0
- package/dist/config-Dgkla4O3.js +38 -0
- package/dist/config-cli-BV16bUmI.js +945 -0
- package/dist/config-guard-BcYEe-kl.js +126 -0
- package/dist/config-helpers-3u5wfLBu.js +117 -0
- package/dist/config-presence-BmUF_5K9.js +79 -0
- package/dist/config-regex-CvZFnWkO.js +39 -0
- package/dist/config-runtime-CstET7fq.js +142 -0
- package/dist/config-schema-5YkIW1xw.js +270 -0
- package/dist/config-schema-B1UGMwZ8.js +31 -0
- package/dist/config-schema-DzlnsY3D.js +33 -0
- package/dist/config-state-CE0CGjey.js +288 -0
- package/dist/config-validation-BEVsnUBu.js +272 -0
- package/dist/config-value-DgJrpclm.js +25 -0
- package/dist/configure-CRx5OThC.js +1126 -0
- package/dist/configure-D4Lh7bhs.js +344 -0
- package/dist/connection-auth-CB_IINnP.js +30 -0
- package/dist/constants-C_Scc680.js +71 -0
- package/dist/control-ui/apple-touch-icon.png +0 -0
- package/dist/control-ui/assets/index-BS0un8Wb.js +18 -0
- package/dist/control-ui/assets/index-DkMftoEy.css +1 -0
- package/dist/control-ui/favicon-32.png +0 -0
- package/dist/control-ui/favicon.ico +0 -0
- package/dist/control-ui/favicon.svg +22 -0
- package/dist/control-ui/index.html +17 -0
- package/dist/control-ui-assets-DjqeIg6A.js +232 -0
- package/dist/control-ui-shared-DP000Pxd.js +29 -0
- package/dist/conversation-runtime-zmG5YBsE.js +1458 -0
- package/dist/core-BV7ewUK4.js +187 -0
- package/dist/core-command-descriptors-CuKGKQIe.js +96 -0
- package/dist/credentials-BPwBlm1X.js +265 -0
- package/dist/cron-cli-CQlFbxlu.js +579 -0
- package/dist/daemon-cli-COhDevTB.js +354 -0
- package/dist/daemon-install-Ma4HdDtf.js +134 -0
- package/dist/daemon-install-plan.shared-cFfBUeV2.js +222 -0
- package/dist/daemon-runtime-CbClrCwc.js +12 -0
- package/dist/dangerous-config-flags-BJtLWIk7.js +15 -0
- package/dist/dangerous-name-matching-DZa_t0RM.js +44 -0
- package/dist/dangerous-tools-yGPDFTHh.js +27 -0
- package/dist/date-time-DCAyaBop.js +118 -0
- package/dist/dedupe-Cgnk5BbX.js +55 -0
- package/dist/defaults-CEdZhIIb.js +6 -0
- package/dist/delegate-DTiRmxH5.js +43 -0
- package/dist/deliver-BUIGBDbK.js +212 -0
- package/dist/deliver-runtime-BY7Zrac7.js +211 -0
- package/dist/delivery-queue-B19wDCjT.js +3 -0
- package/dist/delivery-queue-DrrqB4Hi.js +299 -0
- package/dist/device-auth-GEXe9vqR.js +15 -0
- package/dist/device-bootstrap-CwwokLEY.js +96 -0
- package/dist/device-bootstrap-Dbhe6oe8.js +1 -0
- package/dist/device-metadata-normalization-BDSQ_eA7.js +21 -0
- package/dist/device-pairing-CeI55dBv.js +560 -0
- package/dist/devices-cli-BXm0dkB2.js +366 -0
- package/dist/diagnostic-DBAi0Q5B.js +310 -0
- package/dist/diagnostic-events-ktCoG8Br.js +48 -0
- package/dist/diagnostics-QM3vI6rj.js +14 -0
- package/dist/diagnostics-XVyUA90d.js +33 -0
- package/dist/directive-handling.fast-lane-C7se5K_I.js +273 -0
- package/dist/directive-handling.impl-DMqj3m0-.js +638 -0
- package/dist/directive-handling.impl-aong_bNF.js +214 -0
- package/dist/directive-handling.levels-8vnMeuGX.js +2 -0
- package/dist/directive-handling.levels-CoruY1AA.js +13 -0
- package/dist/directive-handling.persist.runtime-ZWDdE5tG.js +170 -0
- package/dist/directive-handling.shared-B0RjHp7h.js +147 -0
- package/dist/directory-cli-I6eodbBS.js +437 -0
- package/dist/directory-config-helpers-CURJ8mj7.js +129 -0
- package/dist/directory-runtime-DhC8QkMq.js +19 -0
- package/dist/directory.static-B4VBitVO.js +44 -0
- package/dist/discord-Cu5CoXrA.js +214 -0
- package/dist/discord-core-5tkl-BzP.js +1 -0
- package/dist/discord-dOQ4uo2e.js +635 -0
- package/dist/dm-policy-shared-6bCJzHOS.js +188 -0
- package/dist/dns-cli-Dr0_Afcp.js +223 -0
- package/dist/docker-COe8Snwj.js +1254 -0
- package/dist/docs-cli-BkY5rqBi.js +176 -0
- package/dist/doctor-completion-CU7jR9vY.js +90 -0
- package/dist/doctor-config-preflight-Bj70HRt3.js +150 -0
- package/dist/doctor-config-preflight-C5h-tgtM.js +40 -0
- package/dist/doctor-state-migrations-CW1v5V4y.js +212 -0
- package/dist/doctor-state-migrations-ElD0NFmv.js +732 -0
- package/dist/entry-status-B2OWAf0s.js +172 -0
- package/dist/entry.js +219 -0
- package/dist/env-BP70DGuy.js +30 -0
- package/dist/env-overrides-JneV60sd.js +434 -0
- package/dist/env-overrides.runtime-DLrwions.js +18 -0
- package/dist/env-substitution-D6t_sLS_.js +136 -0
- package/dist/errors-BxyFnvP3.js +58 -0
- package/dist/exec-Dmex2w_d.js +310 -0
- package/dist/exec-approvals-BJhuySBz.js +386 -0
- package/dist/exec-approvals-allowlist-BboWC4n9.js +384 -0
- package/dist/exec-approvals-cli-rer7oVfh.js +427 -0
- package/dist/exec-safe-bin-runtime-policy-BL5_Z-KU.js +89 -0
- package/dist/exec-safety-CaaBy-Zw.js +24 -0
- package/dist/export-html/template.css +1060 -0
- package/dist/export-html/template.html +88 -0
- package/dist/export-html/template.js +1875 -0
- package/dist/extension-shared-5txN7IXK.js +74 -0
- package/dist/extensionAPI.js +218 -0
- package/dist/extensions/acpx/openclaw.plugin.json +120 -0
- package/dist/extensions/acpx/package.json +14 -0
- package/dist/extensions/acpx/skills/acp-router/SKILL.md +219 -0
- package/dist/extensions/amazon-bedrock/index.js +231 -0
- package/dist/extensions/amazon-bedrock/openclaw.plugin.json +11 -0
- package/dist/extensions/amazon-bedrock/package.json +12 -0
- package/dist/extensions/anthropic/index.js +330 -0
- package/dist/extensions/anthropic/openclaw.plugin.json +42 -0
- package/dist/extensions/anthropic/package.json +12 -0
- package/dist/extensions/bluebubbles/index.js +224 -0
- package/dist/extensions/bluebubbles/openclaw.plugin.json +11 -0
- package/dist/extensions/bluebubbles/package.json +51 -0
- package/dist/extensions/bluebubbles/setup-entry.js +289 -0
- package/dist/extensions/brave/index.js +23 -0
- package/dist/extensions/brave/openclaw.plugin.json +45 -0
- package/dist/extensions/brave/package.json +12 -0
- package/dist/extensions/byteplus/index.js +112 -0
- package/dist/extensions/byteplus/openclaw.plugin.json +32 -0
- package/dist/extensions/byteplus/package.json +12 -0
- package/dist/extensions/chutes/index.js +221 -0
- package/dist/extensions/chutes/openclaw.plugin.json +44 -0
- package/dist/extensions/chutes/package.json +12 -0
- package/dist/extensions/cloudflare-ai-gateway/index.js +218 -0
- package/dist/extensions/cloudflare-ai-gateway/openclaw.plugin.json +32 -0
- package/dist/extensions/cloudflare-ai-gateway/package.json +12 -0
- package/dist/extensions/copilot-proxy/index.js +125 -0
- package/dist/extensions/copilot-proxy/openclaw.plugin.json +23 -0
- package/dist/extensions/copilot-proxy/package.json +12 -0
- package/dist/extensions/device-pair/index.js +1040 -0
- package/dist/extensions/device-pair/openclaw.plugin.json +20 -0
- package/dist/extensions/diagnostics-otel/openclaw.plugin.json +8 -0
- package/dist/extensions/diagnostics-otel/package.json +27 -0
- package/dist/extensions/diffs/openclaw.plugin.json +216 -0
- package/dist/extensions/diffs/package.json +20 -0
- package/dist/extensions/diffs/skills/diffs/SKILL.md +22 -0
- package/dist/extensions/discord/index.js +215 -0
- package/dist/extensions/discord/openclaw.plugin.json +11 -0
- package/dist/extensions/discord/package.json +40 -0
- package/dist/extensions/discord/setup-entry.js +215 -0
- package/dist/extensions/elevenlabs/index.js +223 -0
- package/dist/extensions/elevenlabs/openclaw.plugin.json +8 -0
- package/dist/extensions/elevenlabs/package.json +12 -0
- package/dist/extensions/fal/index.js +112 -0
- package/dist/extensions/fal/openclaw.plugin.json +34 -0
- package/dist/extensions/fal/package.json +12 -0
- package/dist/extensions/feishu/index.js +227 -0
- package/dist/extensions/feishu/openclaw.plugin.json +14 -0
- package/dist/extensions/feishu/package.json +42 -0
- package/dist/extensions/feishu/setup-entry.js +112 -0
- package/dist/extensions/feishu/skills/feishu-doc/SKILL.md +211 -0
- package/dist/extensions/feishu/skills/feishu-doc/references/block-types.md +103 -0
- package/dist/extensions/feishu/skills/feishu-drive/SKILL.md +97 -0
- package/dist/extensions/feishu/skills/feishu-perm/SKILL.md +119 -0
- package/dist/extensions/feishu/skills/feishu-wiki/SKILL.md +111 -0
- package/dist/extensions/firecrawl/index.js +211 -0
- package/dist/extensions/firecrawl/openclaw.plugin.json +41 -0
- package/dist/extensions/firecrawl/package.json +12 -0
- package/dist/extensions/github-copilot/index.js +490 -0
- package/dist/extensions/github-copilot/openclaw.plugin.json +30 -0
- package/dist/extensions/github-copilot/package.json +12 -0
- package/dist/extensions/google/index.js +211 -0
- package/dist/extensions/google/openclaw.plugin.json +71 -0
- package/dist/extensions/google/package.json +12 -0
- package/dist/extensions/googlechat/openclaw.plugin.json +11 -0
- package/dist/extensions/googlechat/package.json +46 -0
- package/dist/extensions/huggingface/index.js +108 -0
- package/dist/extensions/huggingface/openclaw.plugin.json +33 -0
- package/dist/extensions/huggingface/package.json +12 -0
- package/dist/extensions/imessage/index.js +223 -0
- package/dist/extensions/imessage/openclaw.plugin.json +11 -0
- package/dist/extensions/imessage/package.json +26 -0
- package/dist/extensions/imessage/setup-entry.js +220 -0
- package/dist/extensions/irc/index.js +220 -0
- package/dist/extensions/irc/openclaw.plugin.json +11 -0
- package/dist/extensions/irc/package.json +25 -0
- package/dist/extensions/irc/setup-entry.js +222 -0
- package/dist/extensions/kilocode/index.js +282 -0
- package/dist/extensions/kilocode/openclaw.plugin.json +32 -0
- package/dist/extensions/kilocode/package.json +12 -0
- package/dist/extensions/kimi-coding/index.js +148 -0
- package/dist/extensions/kimi-coding/openclaw.plugin.json +37 -0
- package/dist/extensions/kimi-coding/package.json +12 -0
- package/dist/extensions/line/index.js +57 -0
- package/dist/extensions/line/openclaw.plugin.json +11 -0
- package/dist/extensions/line/package.json +39 -0
- package/dist/extensions/line/setup-entry.js +49 -0
- package/dist/extensions/llm-task/index.js +157 -0
- package/dist/extensions/llm-task/openclaw.plugin.json +33 -0
- package/dist/extensions/llm-task/package.json +16 -0
- package/dist/extensions/lobster/index.js +261 -0
- package/dist/extensions/lobster/openclaw.plugin.json +10 -0
- package/dist/extensions/lobster/package.json +17 -0
- package/dist/extensions/matrix/openclaw.plugin.json +11 -0
- package/dist/extensions/matrix/package.json +53 -0
- package/dist/extensions/mattermost/index.js +220 -0
- package/dist/extensions/mattermost/openclaw.plugin.json +11 -0
- package/dist/extensions/mattermost/package.json +41 -0
- package/dist/extensions/mattermost/setup-entry.js +222 -0
- package/dist/extensions/memory-core/index.js +36 -0
- package/dist/extensions/memory-core/openclaw.plugin.json +9 -0
- package/dist/extensions/memory-core/package.json +20 -0
- package/dist/extensions/memory-lancedb/openclaw.plugin.json +92 -0
- package/dist/extensions/memory-lancedb/package.json +24 -0
- package/dist/extensions/microsoft/index.js +223 -0
- package/dist/extensions/microsoft/openclaw.plugin.json +8 -0
- package/dist/extensions/microsoft/package.json +12 -0
- package/dist/extensions/minimax/index.js +437 -0
- package/dist/extensions/minimax/openclaw.plugin.json +71 -0
- package/dist/extensions/minimax/package.json +12 -0
- package/dist/extensions/mistral/index.js +149 -0
- package/dist/extensions/mistral/openclaw.plugin.json +31 -0
- package/dist/extensions/mistral/package.json +12 -0
- package/dist/extensions/modelstudio/index.js +144 -0
- package/dist/extensions/modelstudio/openclaw.plugin.json +46 -0
- package/dist/extensions/modelstudio/package.json +12 -0
- package/dist/extensions/moonshot/index.js +211 -0
- package/dist/extensions/moonshot/openclaw.plugin.json +78 -0
- package/dist/extensions/moonshot/package.json +12 -0
- package/dist/extensions/msteams/openclaw.plugin.json +11 -0
- package/dist/extensions/msteams/package.json +48 -0
- package/dist/extensions/nextcloud-talk/index.js +221 -0
- package/dist/extensions/nextcloud-talk/openclaw.plugin.json +11 -0
- package/dist/extensions/nextcloud-talk/package.json +48 -0
- package/dist/extensions/nextcloud-talk/setup-entry.js +223 -0
- package/dist/extensions/nostr/openclaw.plugin.json +11 -0
- package/dist/extensions/nostr/package.json +45 -0
- package/dist/extensions/nvidia/index.js +29 -0
- package/dist/extensions/nvidia/openclaw.plugin.json +16 -0
- package/dist/extensions/nvidia/package.json +12 -0
- package/dist/extensions/ollama/index.js +118 -0
- package/dist/extensions/ollama/openclaw.plugin.json +28 -0
- package/dist/extensions/ollama/package.json +12 -0
- package/dist/extensions/open-prose/index.js +10 -0
- package/dist/extensions/open-prose/openclaw.plugin.json +13 -0
- package/dist/extensions/open-prose/package.json +12 -0
- package/dist/extensions/open-prose/skills/prose/LICENSE +21 -0
- package/dist/extensions/open-prose/skills/prose/SKILL.md +323 -0
- package/dist/extensions/open-prose/skills/prose/alt-borges.md +141 -0
- package/dist/extensions/open-prose/skills/prose/alts/arabian-nights.md +229 -0
- package/dist/extensions/open-prose/skills/prose/alts/borges.md +360 -0
- package/dist/extensions/open-prose/skills/prose/alts/folk.md +322 -0
- package/dist/extensions/open-prose/skills/prose/alts/homer.md +217 -0
- package/dist/extensions/open-prose/skills/prose/alts/kafka.md +373 -0
- package/dist/extensions/open-prose/skills/prose/alts/shared-appendix.md +35 -0
- package/dist/extensions/open-prose/skills/prose/compiler.md +2971 -0
- package/dist/extensions/open-prose/skills/prose/examples/01-hello-world.prose +4 -0
- package/dist/extensions/open-prose/skills/prose/examples/02-research-and-summarize.prose +6 -0
- package/dist/extensions/open-prose/skills/prose/examples/03-code-review.prose +17 -0
- package/dist/extensions/open-prose/skills/prose/examples/04-write-and-refine.prose +14 -0
- package/dist/extensions/open-prose/skills/prose/examples/05-debug-issue.prose +20 -0
- package/dist/extensions/open-prose/skills/prose/examples/06-explain-codebase.prose +17 -0
- package/dist/extensions/open-prose/skills/prose/examples/07-refactor.prose +20 -0
- package/dist/extensions/open-prose/skills/prose/examples/08-blog-post.prose +20 -0
- package/dist/extensions/open-prose/skills/prose/examples/09-research-with-agents.prose +25 -0
- package/dist/extensions/open-prose/skills/prose/examples/10-code-review-agents.prose +32 -0
- package/dist/extensions/open-prose/skills/prose/examples/11-skills-and-imports.prose +27 -0
- package/dist/extensions/open-prose/skills/prose/examples/12-secure-agent-permissions.prose +43 -0
- package/dist/extensions/open-prose/skills/prose/examples/13-variables-and-context.prose +51 -0
- package/dist/extensions/open-prose/skills/prose/examples/14-composition-blocks.prose +48 -0
- package/dist/extensions/open-prose/skills/prose/examples/15-inline-sequences.prose +23 -0
- package/dist/extensions/open-prose/skills/prose/examples/16-parallel-reviews.prose +19 -0
- package/dist/extensions/open-prose/skills/prose/examples/17-parallel-research.prose +19 -0
- package/dist/extensions/open-prose/skills/prose/examples/18-mixed-parallel-sequential.prose +36 -0
- package/dist/extensions/open-prose/skills/prose/examples/19-advanced-parallel.prose +71 -0
- package/dist/extensions/open-prose/skills/prose/examples/20-fixed-loops.prose +20 -0
- package/dist/extensions/open-prose/skills/prose/examples/21-pipeline-operations.prose +35 -0
- package/dist/extensions/open-prose/skills/prose/examples/22-error-handling.prose +51 -0
- package/dist/extensions/open-prose/skills/prose/examples/23-retry-with-backoff.prose +63 -0
- package/dist/extensions/open-prose/skills/prose/examples/24-choice-blocks.prose +86 -0
- package/dist/extensions/open-prose/skills/prose/examples/25-conditionals.prose +114 -0
- package/dist/extensions/open-prose/skills/prose/examples/26-parameterized-blocks.prose +100 -0
- package/dist/extensions/open-prose/skills/prose/examples/27-string-interpolation.prose +105 -0
- package/dist/extensions/open-prose/skills/prose/examples/28-automated-pr-review.prose +37 -0
- package/dist/extensions/open-prose/skills/prose/examples/28-gas-town.prose +1572 -0
- package/dist/extensions/open-prose/skills/prose/examples/29-captains-chair.prose +218 -0
- package/dist/extensions/open-prose/skills/prose/examples/30-captains-chair-simple.prose +42 -0
- package/dist/extensions/open-prose/skills/prose/examples/31-captains-chair-with-memory.prose +145 -0
- package/dist/extensions/open-prose/skills/prose/examples/33-pr-review-autofix.prose +168 -0
- package/dist/extensions/open-prose/skills/prose/examples/34-content-pipeline.prose +204 -0
- package/dist/extensions/open-prose/skills/prose/examples/35-feature-factory.prose +296 -0
- package/dist/extensions/open-prose/skills/prose/examples/36-bug-hunter.prose +237 -0
- package/dist/extensions/open-prose/skills/prose/examples/37-the-forge.prose +1474 -0
- package/dist/extensions/open-prose/skills/prose/examples/38-skill-scan.prose +455 -0
- package/dist/extensions/open-prose/skills/prose/examples/39-architect-by-simulation.prose +277 -0
- package/dist/extensions/open-prose/skills/prose/examples/40-rlm-self-refine.prose +32 -0
- package/dist/extensions/open-prose/skills/prose/examples/41-rlm-divide-conquer.prose +38 -0
- package/dist/extensions/open-prose/skills/prose/examples/42-rlm-filter-recurse.prose +46 -0
- package/dist/extensions/open-prose/skills/prose/examples/43-rlm-pairwise.prose +50 -0
- package/dist/extensions/open-prose/skills/prose/examples/44-run-endpoint-ux-test.prose +261 -0
- package/dist/extensions/open-prose/skills/prose/examples/45-plugin-release.prose +159 -0
- package/dist/extensions/open-prose/skills/prose/examples/45-run-endpoint-ux-test-with-remediation.prose +637 -0
- package/dist/extensions/open-prose/skills/prose/examples/46-run-endpoint-ux-test-fast.prose +148 -0
- package/dist/extensions/open-prose/skills/prose/examples/46-workflow-crystallizer.prose +225 -0
- package/dist/extensions/open-prose/skills/prose/examples/47-language-self-improvement.prose +356 -0
- package/dist/extensions/open-prose/skills/prose/examples/48-habit-miner.prose +445 -0
- package/dist/extensions/open-prose/skills/prose/examples/49-prose-run-retrospective.prose +210 -0
- package/dist/extensions/open-prose/skills/prose/examples/README.md +391 -0
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/README.md +22 -0
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/iterative-refinement.prose +20 -0
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/parallel-review.prose +18 -0
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/simple-pipeline.prose +17 -0
- package/dist/extensions/open-prose/skills/prose/examples/roadmap/syntax/open-prose-syntax.prose +223 -0
- package/dist/extensions/open-prose/skills/prose/guidance/antipatterns.md +951 -0
- package/dist/extensions/open-prose/skills/prose/guidance/patterns.md +700 -0
- package/dist/extensions/open-prose/skills/prose/guidance/system-prompt.md +180 -0
- package/dist/extensions/open-prose/skills/prose/help.md +144 -0
- package/dist/extensions/open-prose/skills/prose/lib/README.md +108 -0
- package/dist/extensions/open-prose/skills/prose/lib/calibrator.prose +215 -0
- package/dist/extensions/open-prose/skills/prose/lib/cost-analyzer.prose +174 -0
- package/dist/extensions/open-prose/skills/prose/lib/error-forensics.prose +250 -0
- package/dist/extensions/open-prose/skills/prose/lib/inspector.prose +196 -0
- package/dist/extensions/open-prose/skills/prose/lib/profiler.prose +460 -0
- package/dist/extensions/open-prose/skills/prose/lib/program-improver.prose +275 -0
- package/dist/extensions/open-prose/skills/prose/lib/project-memory.prose +118 -0
- package/dist/extensions/open-prose/skills/prose/lib/user-memory.prose +93 -0
- package/dist/extensions/open-prose/skills/prose/lib/vm-improver.prose +243 -0
- package/dist/extensions/open-prose/skills/prose/primitives/session.md +593 -0
- package/dist/extensions/open-prose/skills/prose/prose.md +1237 -0
- package/dist/extensions/open-prose/skills/prose/state/filesystem.md +498 -0
- package/dist/extensions/open-prose/skills/prose/state/in-context.md +384 -0
- package/dist/extensions/open-prose/skills/prose/state/postgres.md +880 -0
- package/dist/extensions/open-prose/skills/prose/state/sqlite.md +531 -0
- package/dist/extensions/openai/index.js +677 -0
- package/dist/extensions/openai/openclaw.plugin.json +42 -0
- package/dist/extensions/openai/package.json +12 -0
- package/dist/extensions/opencode/index.js +116 -0
- package/dist/extensions/opencode/openclaw.plugin.json +32 -0
- package/dist/extensions/opencode/package.json +12 -0
- package/dist/extensions/opencode-go/index.js +114 -0
- package/dist/extensions/opencode-go/openclaw.plugin.json +32 -0
- package/dist/extensions/opencode-go/package.json +12 -0
- package/dist/extensions/openrouter/index.js +398 -0
- package/dist/extensions/openrouter/openclaw.plugin.json +31 -0
- package/dist/extensions/openrouter/package.json +12 -0
- package/dist/extensions/openshell/index.js +923 -0
- package/dist/extensions/openshell/openclaw.plugin.json +99 -0
- package/dist/extensions/openshell/package.json +12 -0
- package/dist/extensions/perplexity/index.js +23 -0
- package/dist/extensions/perplexity/openclaw.plugin.json +49 -0
- package/dist/extensions/perplexity/package.json +12 -0
- package/dist/extensions/phone-control/index.js +276 -0
- package/dist/extensions/phone-control/openclaw.plugin.json +10 -0
- package/dist/extensions/qianfan/index.js +114 -0
- package/dist/extensions/qianfan/openclaw.plugin.json +31 -0
- package/dist/extensions/qianfan/package.json +12 -0
- package/dist/extensions/qwen-portal-auth/index.js +350 -0
- package/dist/extensions/qwen-portal-auth/openclaw.plugin.json +29 -0
- package/dist/extensions/sglang/index.js +285 -0
- package/dist/extensions/sglang/openclaw.plugin.json +28 -0
- package/dist/extensions/sglang/package.json +12 -0
- package/dist/extensions/signal/index.js +218 -0
- package/dist/extensions/signal/openclaw.plugin.json +11 -0
- package/dist/extensions/signal/package.json +23 -0
- package/dist/extensions/signal/setup-entry.js +218 -0
- package/dist/extensions/slack/index.js +222 -0
- package/dist/extensions/slack/openclaw.plugin.json +11 -0
- package/dist/extensions/slack/package.json +30 -0
- package/dist/extensions/slack/setup-entry.js +220 -0
- package/dist/extensions/synology-chat/index.js +56 -0
- package/dist/extensions/synology-chat/openclaw.plugin.json +11 -0
- package/dist/extensions/synology-chat/package.json +29 -0
- package/dist/extensions/synology-chat/setup-entry.js +58 -0
- package/dist/extensions/synthetic/index.js +112 -0
- package/dist/extensions/synthetic/openclaw.plugin.json +31 -0
- package/dist/extensions/synthetic/package.json +12 -0
- package/dist/extensions/talk-voice/index.js +197 -0
- package/dist/extensions/talk-voice/openclaw.plugin.json +10 -0
- package/dist/extensions/tavily/index.js +211 -0
- package/dist/extensions/tavily/openclaw.plugin.json +44 -0
- package/dist/extensions/tavily/package.json +12 -0
- package/dist/extensions/tavily/skills/tavily/SKILL.md +94 -0
- package/dist/extensions/telegram/index.js +221 -0
- package/dist/extensions/telegram/openclaw.plugin.json +11 -0
- package/dist/extensions/telegram/package.json +31 -0
- package/dist/extensions/telegram/setup-entry.js +221 -0
- package/dist/extensions/thread-ownership/index.js +70 -0
- package/dist/extensions/thread-ownership/openclaw.plugin.json +30 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/README.md +143 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/SKILL.md +375 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/bin/tlon.js +96 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/package.json +40 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/references/hooks-examples/auto-react.hoon +24 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/references/hooks-examples/delete-old-posts.hoon +18 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/references/hooks-examples/word-filter.hoon +52 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/references/hooks.md +366 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/references/urbit-api.md +113 -0
- package/dist/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/scripts/postinstall.js +74 -0
- package/dist/extensions/tlon/openclaw.plugin.json +14 -0
- package/dist/extensions/tlon/package.json +45 -0
- package/dist/extensions/together/index.js +113 -0
- package/dist/extensions/together/openclaw.plugin.json +31 -0
- package/dist/extensions/together/package.json +12 -0
- package/dist/extensions/twitch/openclaw.plugin.json +11 -0
- package/dist/extensions/twitch/package.json +27 -0
- package/dist/extensions/venice/index.js +132 -0
- package/dist/extensions/venice/openclaw.plugin.json +31 -0
- package/dist/extensions/venice/package.json +12 -0
- package/dist/extensions/vercel-ai-gateway/index.js +86 -0
- package/dist/extensions/vercel-ai-gateway/openclaw.plugin.json +31 -0
- package/dist/extensions/vercel-ai-gateway/package.json +12 -0
- package/dist/extensions/vllm/index.js +285 -0
- package/dist/extensions/vllm/openclaw.plugin.json +28 -0
- package/dist/extensions/vllm/package.json +12 -0
- package/dist/extensions/voice-call/index.js +5715 -0
- package/dist/extensions/voice-call/openclaw.plugin.json +648 -0
- package/dist/extensions/voice-call/package.json +31 -0
- package/dist/extensions/volcengine/index.js +112 -0
- package/dist/extensions/volcengine/openclaw.plugin.json +32 -0
- package/dist/extensions/volcengine/package.json +12 -0
- package/dist/extensions/whatsapp/openclaw.plugin.json +11 -0
- package/dist/extensions/whatsapp/package.json +44 -0
- package/dist/extensions/xai/index.js +211 -0
- package/dist/extensions/xai/openclaw.plugin.json +65 -0
- package/dist/extensions/xai/package.json +12 -0
- package/dist/extensions/xiaomi/index.js +115 -0
- package/dist/extensions/xiaomi/openclaw.plugin.json +31 -0
- package/dist/extensions/xiaomi/package.json +12 -0
- package/dist/extensions/zai/index.js +559 -0
- package/dist/extensions/zai/openclaw.plugin.json +88 -0
- package/dist/extensions/zai/package.json +12 -0
- package/dist/extensions/zalo/index.js +225 -0
- package/dist/extensions/zalo/openclaw.plugin.json +11 -0
- package/dist/extensions/zalo/package.json +48 -0
- package/dist/extensions/zalo/setup-entry.js +226 -0
- package/dist/extensions/zalouser/openclaw.plugin.json +11 -0
- package/dist/extensions/zalouser/package.json +49 -0
- package/dist/external-content-BUdUOqkv.js +238 -0
- package/dist/feishu-CiuVx86p.js +62821 -0
- package/dist/feishu-DKboNv0e.js +2664 -0
- package/dist/fetch-guard-DIyN1HW5.js +165 -0
- package/dist/fetch-timeout-C5xpMuGd.js +36 -0
- package/dist/file-identity-Cw0fQxYY.js +11 -0
- package/dist/file-lock-WbEmczmY.js +107 -0
- package/dist/filter-oMGaNOM1.js +20 -0
- package/dist/follow-redirects-BPQ_NgUo.js +9143 -0
- package/dist/format-DH8ysi7s.js +19 -0
- package/dist/format-datetime-BGS6tLDE.js +73 -0
- package/dist/format-duration-CO0BGWB0.js +57 -0
- package/dist/format-relative-C3nDxnXz.js +54 -0
- package/dist/frontmatter-S5vS-I4a.js +309 -0
- package/dist/fs-safe-D3qzH-ab.js +731 -0
- package/dist/gateway-cli-CPLQ73W9.js +28403 -0
- package/dist/gateway-install-token-CKAQVM8-.js +164 -0
- package/dist/gateway-rpc-BsgPg6MU.js +26 -0
- package/dist/gateway-runtime-B5HHmFvN.js +42 -0
- package/dist/gaxios-fetch-compat-KX6bsqFm.js +165 -0
- package/dist/gemini-auth-B5ljg7jr.js +29 -0
- package/dist/git-commit-BIdLubm5.js +2 -0
- package/dist/git-commit-OvUvjri2.js +177 -0
- package/dist/github-copilot-auth-BBn03354.js +104 -0
- package/dist/global-singleton-4KwY5RvX.js +13 -0
- package/dist/globals-41sdSaKv.js +38 -0
- package/dist/gmail-setup-utils-BX68dZla.js +419 -0
- package/dist/group-access-DJZrYPx1.js +113 -0
- package/dist/group-keys-BD_IYSMs.js +44 -0
- package/dist/group-policy-CWFxv3iB.js +201 -0
- package/dist/group-policy-warnings-Ddu6lBkh.js +175 -0
- package/dist/health-BW_d3hKj.js +573 -0
- package/dist/health-format-B5XfOTuJ.js +26 -0
- package/dist/health-o6N--_xj.js +59 -0
- package/dist/heartbeat-7aHh0m3d.js +169 -0
- package/dist/heartbeat-summary-Das49TYq.js +57 -0
- package/dist/help-Cr5cdpTF.js +81 -0
- package/dist/help-format-Dv45FpYu.js +15 -0
- package/dist/helpers-CLNycoI8.js +32 -0
- package/dist/helpers-DJ-5HEbE.js +24 -0
- package/dist/history-CHjo8B5W.js +102 -0
- package/dist/hook-runtime-BnNBi_q4.js +1 -0
- package/dist/hooks-cli-Bj8_UM2C.js +1102 -0
- package/dist/hooks-policy-BL6HDLUn.js +20 -0
- package/dist/hooks-status-gzNmo3li.js +78 -0
- package/dist/host-env-security-BogNN146.js +223 -0
- package/dist/http-body-CCiSfloA.js +237 -0
- package/dist/http-registry-WFFbLYRd.js +153 -0
- package/dist/identity-DovQV4zD.js +112 -0
- package/dist/identity-cyBYcoXS.js +84 -0
- package/dist/identity-file-EndG1nfc.js +60 -0
- package/dist/image-DWkjd9ze.js +211 -0
- package/dist/image-generation-CsblUROw.js +441 -0
- package/dist/image-ops-j01UkxEv.js +371 -0
- package/dist/imessage-Bb83msoJ.js +219 -0
- package/dist/imessage-CsiCgRcg.js +190 -0
- package/dist/imessage-CytlwbMq.js +1451 -0
- package/dist/imessage-core-CsYJuaRZ.js +1 -0
- package/dist/inbound-envelope-4P3IIJc3.js +61 -0
- package/dist/inbound-reply-dispatch-B6JDKPpf.js +72 -0
- package/dist/includes-7XyL3p1c.js +188 -0
- package/dist/includes-scan-y-rS6tTw.js +55 -0
- package/dist/index.js +57 -0
- package/dist/infra/warning-filter.js +2 -0
- package/dist/inspect-TkOiUCgp.js +279 -0
- package/dist/install-safe-path-Rwbw1XCZ.js +62 -0
- package/dist/installs-CShDWoiR.js +532 -0
- package/dist/interactive-F7iY0yED.js +8 -0
- package/dist/interactive-runtime-OweOj_Vv.js +90 -0
- package/dist/internal-hooks-0uipqzRY.js +156 -0
- package/dist/io-BYmuc7ha.js +35 -0
- package/dist/io-BjKpaXU3.js +7161 -0
- package/dist/ip-C8vmzVu0.js +203 -0
- package/dist/ipv4-CJCNv_K7.js +82 -0
- package/dist/irc-BSHd6-tL.js +12 -0
- package/dist/irc-CO-H7Npu.js +660 -0
- package/dist/is-main-YViS6wOn.js +27 -0
- package/dist/issue-format-CBEXVico.js +31 -0
- package/dist/issue-format-D3HehoKZ.js +4 -0
- package/dist/json-file-C2zjA0Gv.js +23 -0
- package/dist/json-files-WW-H_psG.js +60 -0
- package/dist/json-pointer-f9dEnBoR.js +43 -0
- package/dist/json-store-O1LwpnBH.js +37 -0
- package/dist/kb-cli-DMZs6PCu.js +65 -0
- package/dist/keyed-async-queue-CPUWV5Pm.js +32 -0
- package/dist/kill-tree-CbjXBw3z.js +149 -0
- package/dist/kilocode-shared-DS7_0IMs.js +29 -0
- package/dist/launchd-DowEtzjr.js +491 -0
- package/dist/lazy-runtime-BcXbyAaC.js +1 -0
- package/dist/lazy-runtime-bWkd2cs3.js +29 -0
- package/dist/legacy-names-CUNZ4vHN.js +7 -0
- package/dist/legacy-web-search-BgZjNG2h.js +222 -0
- package/dist/lib-CERS7N4b.js +503 -0
- package/dist/lib-PPICrHv1.js +1938 -0
- package/dist/library-DJriL3ed.js +211 -0
- package/dist/lifecycle-core-D08nRlzW.js +382 -0
- package/dist/line/accounts.js +10 -0
- package/dist/line/send.js +39 -0
- package/dist/line/template-messages.js +2 -0
- package/dist/line-BX_d0Jwk.js +688 -0
- package/dist/line-CJSvwApm.js +1 -0
- package/dist/line-core-BOIxkjgu.js +1 -0
- package/dist/links-CKahSp5K.js +13 -0
- package/dist/llm-slug-generator-X_rlkFDe.js +68 -0
- package/dist/llm-slug-generator.js +212 -0
- package/dist/llm-task-Dx8ymRFr.js +1 -0
- package/dist/local-roots-DAzCjWbC.js +34 -0
- package/dist/location-DefAH9WS.js +42 -0
- package/dist/logger-CoEtkjhn.js +550 -0
- package/dist/logger-Cqy7-Maj.js +70 -0
- package/dist/logging-Bz1qZDPg.js +16 -0
- package/dist/logging-CS185p8Q.js +13 -0
- package/dist/logging-CbTTfADU.js +1 -0
- package/dist/logging-CrGwCjML.js +36 -0
- package/dist/logs-cli-C3x0gsGh.js +261 -0
- package/dist/magic-string.es-DJPWMt-n.js +1011 -0
- package/dist/main-session-DKr0lBVk.js +36 -0
- package/dist/manager-BF-xRVUt.js +2005 -0
- package/dist/manager-DjPRm0yC.js +4226 -0
- package/dist/manager-runtime-DoKa4efG.js +59 -0
- package/dist/manager.runtime-CdPdh296.js +827 -0
- package/dist/manifest-registry-B90TyTWl.js +1350 -0
- package/dist/map-size-CMTQVKUV.js +15 -0
- package/dist/markdown-to-line-BWwaRx5F.js +640 -0
- package/dist/mask-api-key-CprzEe7l.js +10 -0
- package/dist/matrix-CMi2y980.js +228 -0
- package/dist/matrix-migration-snapshot-NMxdum7C.js +702 -0
- package/dist/mattermost-Cduscjlj.js +15 -0
- package/dist/mattermost-DO0BCfF3.js +1 -0
- package/dist/mcp-cli-D0PqoKGl.js +94 -0
- package/dist/mcp-config-BcFTambR.js +108 -0
- package/dist/media-limits-Cuvmmhop.js +14 -0
- package/dist/media-understanding-DptzemF7.js +48 -0
- package/dist/media-understanding.runtime-w4DWJMEQ.js +216 -0
- package/dist/memory-DBjQ0TPd.js +1 -0
- package/dist/memory-cli-D2AtVbYN.js +215 -0
- package/dist/memory-cli-DNq4q-b4.js +541 -0
- package/dist/memory-search-Das1tiuB.js +204 -0
- package/dist/memory-search-DxmSTjHq.js +18 -0
- package/dist/mention-gating-B_q-EHFx.js +25 -0
- package/dist/mentions-Bxys_va0.js +154 -0
- package/dist/message-channel-Cy-gN4K2.js +106 -0
- package/dist/message-hook-mappers-BBTV3JRQ.js +249 -0
- package/dist/method-scopes-ChbR5hu0.js +2650 -0
- package/dist/mime-C4vVTBso.js +150 -0
- package/dist/minimal-C5yUxtHy.js +2120 -0
- package/dist/model-auth-Blh0xL9g.js +309 -0
- package/dist/model-auth-env-CF9ts7Th.js +111 -0
- package/dist/model-catalog.runtime-Bq_DOgMs.js +211 -0
- package/dist/model-id-normalization-Y-MIsyK_.js +16 -0
- package/dist/model-input-BB2wSAHb.js +20 -0
- package/dist/model-overrides-sIzKU2wo.js +84 -0
- package/dist/model-param-b-DIFEhICm.js +15 -0
- package/dist/model-picker-CCcVTPVs.js +400 -0
- package/dist/model-picker-DbqaKTMq.js +215 -0
- package/dist/model-picker.runtime-CkLp1x9k.js +224 -0
- package/dist/model-selection-BTpJnslv.js +437 -0
- package/dist/model-selection-slZyRw2d.js +765 -0
- package/dist/model-suppression.runtime-DaobH5cQ.js +216 -0
- package/dist/models-BN_CtDV3.js +2536 -0
- package/dist/models-Dp5Lga_a.js +226 -0
- package/dist/models-cli-Cd_3pVLS.js +418 -0
- package/dist/models-config-jp2ZYjgH.js +211 -0
- package/dist/models-config.providers.discovery-BaIk1NKL.js +141 -0
- package/dist/models-config.runtime-CYpoeHa4.js +211 -0
- package/dist/monitor-Bbfus89A.js +3145 -0
- package/dist/monitor-D63iuNTd.js +3272 -0
- package/dist/monitor-DAPxJ4Fy.js +878 -0
- package/dist/monitor-DlFPue4X.js +223 -0
- package/dist/multimodal-DC43jYNv.js +75 -0
- package/dist/mutable-allowlist-detectors-C6EAzWYE.js +62 -0
- package/dist/net-DlJFp95v.js +270 -0
- package/dist/network-mode-DOgvmom4.js +17 -0
- package/dist/nextcloud-talk-4niIjhpY.js +12 -0
- package/dist/nextcloud-talk-CwnkUy8E.js +1 -0
- package/dist/node-cli-BQ0uYRRJ.js +2484 -0
- package/dist/node-command-policy-Bg2g6Xjp.js +192 -0
- package/dist/node-commands-B6W6Eo0b.js +11 -0
- package/dist/node-require-BgDD9bTi.js +14 -0
- package/dist/node-resolve-BunMro3f.js +69 -0
- package/dist/node-service-DEZvLQRW.js +65 -0
- package/dist/node-startup-env-Gz8ZQniA.js +50 -0
- package/dist/nodes-cli-Dvhiks4b.js +1330 -0
- package/dist/nodes-screen-DkGtEg3m.js +401 -0
- package/dist/normalize-secret-input-_PgpexOG.js +32 -0
- package/dist/note-dfjacCV8.js +109 -0
- package/dist/npm-pack-install-DFT7_ufP.js +574 -0
- package/dist/npm-resolution-O8ezGXjk.js +60 -0
- package/dist/oauth.runtime-Dn3J7wCH.js +318 -0
- package/dist/oauth.runtime-qCkidk8J.js +180 -0
- package/dist/oauth.runtime-y9sB_ut5.js +687 -0
- package/dist/ollama-defaults-asNuGW4_.js +4 -0
- package/dist/onboard-D9IU-7uw.js +48 -0
- package/dist/onboard-DQaHGPRm.js +25 -0
- package/dist/onboard-DXqBeqiM.js +589 -0
- package/dist/onboard-channels-CfZTqyJW.js +300 -0
- package/dist/onboard-channels-Cl8Z603m.js +1257 -0
- package/dist/onboard-config-DFKb-0sE.js +29 -0
- package/dist/onboard-config-DYykzJhx.js +2 -0
- package/dist/onboard-custom-BH3efE8p.js +216 -0
- package/dist/onboard-custom-z5zb42R-.js +644 -0
- package/dist/onboard-helpers-BN19CLP5.js +335 -0
- package/dist/onboard-helpers-Ddb9wkxO.js +54 -0
- package/dist/onboard-hooks-Hiw3_8VL.js +73 -0
- package/dist/onboard-remote-Bdqyy2tX.js +59 -0
- package/dist/onboard-remote-DZ1c3za2.js +182 -0
- package/dist/onboard-search-8Xnnh8SX.js +446 -0
- package/dist/onboard-skills-BTVz6kVV.js +69 -0
- package/dist/onboard-skills-BskXWJGU.js +133 -0
- package/dist/openai-codex-provider.runtime-BFsopDHI.js +2 -0
- package/dist/openai-defaults-B7FUywsh.js +10 -0
- package/dist/openclaw-exec-env-AcZ9we1N.js +14 -0
- package/dist/openclaw-root-TUHYdr9B.js +88 -0
- package/dist/openclaw-tools.runtime-BI4ZZ6Ie.js +211 -0
- package/dist/outbound-media-69yrWRDt.js +11 -0
- package/dist/outbound-runtime-ic_7ulJJ.js +1 -0
- package/dist/pairing-challenge-pdOQqb2j.js +48 -0
- package/dist/pairing-cli-DXxrNtvB.js +150 -0
- package/dist/pairing-labels-CNKCSmBK.js +7 -0
- package/dist/pairing-message-CBv2njJT.js +4 -0
- package/dist/pairing-store-C4lsd4pO.js +590 -0
- package/dist/pairing-token-gKj4SNFJ.js +55 -0
- package/dist/parse-duration-BBGYkY0S.js +41 -0
- package/dist/parse-finite-number-CP4MQF_w.js +30 -0
- package/dist/parse-log-line-CVh9zu3Q.js +43 -0
- package/dist/parse-port-COyt3COn.js +8 -0
- package/dist/path-alias-guards-ZTKqurNH.js +40 -0
- package/dist/path-env-CPkz6U0Y.js +87 -0
- package/dist/paths-CTjJI9l0.js +179 -0
- package/dist/paths-GHJ97ebE.js +268 -0
- package/dist/paths-nCHyK08H.js +56 -0
- package/dist/perplexity-kYSLNo8o.js +422 -0
- package/dist/persistent-dedupe-bjKjVI5u.js +116 -0
- package/dist/pi-embedded-CDH9LrEg.js +172586 -0
- package/dist/pi-model-discovery-CuX5CDyZ.js +125 -0
- package/dist/pi-model-discovery-runtime-DUWeqjUv.js +44 -0
- package/dist/pi-tools.before-tool-call.runtime-D9NV63QP.js +387 -0
- package/dist/platform-launcher-CqGy6UhP.js +83 -0
- package/dist/plugin-entry-CwuwM1jC.js +17 -0
- package/dist/plugin-install-CpMYi2tB.js +184 -0
- package/dist/plugin-install-aDvFMLBT.js +216 -0
- package/dist/plugin-install-plan-B_2cLkDP.js +49 -0
- package/dist/plugin-registry-C7Z7CkLP.js +213 -0
- package/dist/plugin-registry-C8bgJflP.js +51 -0
- package/dist/plugin-sdk/account-helpers.d.ts +1 -0
- package/dist/plugin-sdk/account-helpers.js +3 -0
- package/dist/plugin-sdk/account-id.d.ts +1 -0
- package/dist/plugin-sdk/account-id.js +2 -0
- package/dist/plugin-sdk/account-resolution.d.ts +1 -0
- package/dist/plugin-sdk/account-resolution.js +216 -0
- package/dist/plugin-sdk/acp-runtime.d.ts +1 -0
- package/dist/plugin-sdk/acp-runtime.js +46 -0
- package/dist/plugin-sdk/agent-runtime.d.ts +1 -0
- package/dist/plugin-sdk/agent-runtime.js +215 -0
- package/dist/plugin-sdk/allow-from.d.ts +1 -0
- package/dist/plugin-sdk/allow-from.js +17 -0
- package/dist/plugin-sdk/allowlist-config-edit.d.ts +1 -0
- package/dist/plugin-sdk/allowlist-config-edit.js +2 -0
- package/dist/plugin-sdk/bluebubbles.d.ts +1 -0
- package/dist/plugin-sdk/bluebubbles.js +232 -0
- package/dist/plugin-sdk/boolean-param.d.ts +1 -0
- package/dist/plugin-sdk/boolean-param.js +2 -0
- package/dist/plugin-sdk/channel-actions.d.ts +1 -0
- package/dist/plugin-sdk/channel-actions.js +16 -0
- package/dist/plugin-sdk/channel-config-helpers.d.ts +1 -0
- package/dist/plugin-sdk/channel-config-helpers.js +15 -0
- package/dist/plugin-sdk/channel-config-schema.d.ts +1 -0
- package/dist/plugin-sdk/channel-config-schema.js +5 -0
- package/dist/plugin-sdk/channel-contract.d.ts +1 -0
- package/dist/plugin-sdk/channel-contract.js +1 -0
- package/dist/plugin-sdk/channel-feedback.d.ts +1 -0
- package/dist/plugin-sdk/channel-feedback.js +4 -0
- package/dist/plugin-sdk/channel-inbound.d.ts +1 -0
- package/dist/plugin-sdk/channel-inbound.js +53 -0
- package/dist/plugin-sdk/channel-lifecycle.d.ts +1 -0
- package/dist/plugin-sdk/channel-lifecycle.js +2 -0
- package/dist/plugin-sdk/channel-pairing.d.ts +1 -0
- package/dist/plugin-sdk/channel-pairing.js +2 -0
- package/dist/plugin-sdk/channel-policy.d.ts +1 -0
- package/dist/plugin-sdk/channel-policy.js +19 -0
- package/dist/plugin-sdk/channel-reply-pipeline.d.ts +1 -0
- package/dist/plugin-sdk/channel-reply-pipeline.js +23 -0
- package/dist/plugin-sdk/channel-runtime.d.ts +1 -0
- package/dist/plugin-sdk/channel-runtime.js +33 -0
- package/dist/plugin-sdk/channel-send-result.d.ts +1 -0
- package/dist/plugin-sdk/channel-send-result.js +2 -0
- package/dist/plugin-sdk/channel-setup.d.ts +1 -0
- package/dist/plugin-sdk/channel-setup.js +24 -0
- package/dist/plugin-sdk/channel-targets.d.ts +1 -0
- package/dist/plugin-sdk/channel-targets.js +3 -0
- package/dist/plugin-sdk/cli-runtime.d.ts +1 -0
- package/dist/plugin-sdk/cli-runtime.js +5 -0
- package/dist/plugin-sdk/command-auth.d.ts +1 -0
- package/dist/plugin-sdk/command-auth.js +212 -0
- package/dist/plugin-sdk/compat.js +59 -0
- package/dist/plugin-sdk/config-runtime.d.ts +1 -0
- package/dist/plugin-sdk/config-runtime.js +51 -0
- package/dist/plugin-sdk/conversation-runtime.d.ts +1 -0
- package/dist/plugin-sdk/conversation-runtime.js +55 -0
- package/dist/plugin-sdk/core.d.ts +1 -0
- package/dist/plugin-sdk/core.js +40 -0
- package/dist/plugin-sdk/device-bootstrap.d.ts +1 -0
- package/dist/plugin-sdk/device-bootstrap.js +6 -0
- package/dist/plugin-sdk/diagnostics-otel.d.ts +1 -0
- package/dist/plugin-sdk/diagnostics-otel.js +7 -0
- package/dist/plugin-sdk/diffs.d.ts +1 -0
- package/dist/plugin-sdk/diffs.js +3 -0
- package/dist/plugin-sdk/directory-runtime.d.ts +1 -0
- package/dist/plugin-sdk/directory-runtime.js +5 -0
- package/dist/plugin-sdk/discord-core.d.ts +1 -0
- package/dist/plugin-sdk/discord-core.js +26 -0
- package/dist/plugin-sdk/discord.d.ts +1 -0
- package/dist/plugin-sdk/discord.js +219 -0
- package/dist/plugin-sdk/extension-shared.d.ts +1 -0
- package/dist/plugin-sdk/extension-shared.js +15 -0
- package/dist/plugin-sdk/extensions/anthropic-vertex/provider-catalog.d.ts +5 -0
- package/dist/plugin-sdk/extensions/bluebubbles/runtime-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/bluebubbles/src/group-policy.d.ts +14 -0
- package/dist/plugin-sdk/extensions/brave/index.d.ts +8 -0
- package/dist/plugin-sdk/extensions/brave/src/brave-web-search-provider.d.ts +42 -0
- package/dist/plugin-sdk/extensions/discord/api.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/runtime-api.d.ts +17 -0
- package/dist/plugin-sdk/extensions/discord/session-key-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/discord/src/account-inspect.d.ts +17 -0
- package/dist/plugin-sdk/extensions/discord/src/accounts.d.ts +27 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/handle-action.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/handle-action.guild-admin.d.ts +9 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.d.ts +5 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.guild.d.ts +24 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.messaging.d.ts +32 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.moderation-shared.d.ts +13 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.moderation.d.ts +10 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.presence.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.shared.d.ts +1 -0
- package/dist/plugin-sdk/extensions/discord/src/api.d.ts +11 -0
- package/dist/plugin-sdk/extensions/discord/src/audit.d.ts +29 -0
- package/dist/plugin-sdk/extensions/discord/src/channel-actions.d.ts +2 -0
- package/dist/plugin-sdk/extensions/discord/src/chunk.d.ts +20 -0
- package/dist/plugin-sdk/extensions/discord/src/client.d.ts +24 -0
- package/dist/plugin-sdk/extensions/discord/src/components-registry.d.ts +16 -0
- package/dist/plugin-sdk/extensions/discord/src/components.d.ts +204 -0
- package/dist/plugin-sdk/extensions/discord/src/directory-cache.d.ts +10 -0
- package/dist/plugin-sdk/extensions/discord/src/directory-config.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/directory-live.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/draft-chunking.d.ts +6 -0
- package/dist/plugin-sdk/extensions/discord/src/draft-stream.d.ts +21 -0
- package/dist/plugin-sdk/extensions/discord/src/gateway-logging.d.ts +8 -0
- package/dist/plugin-sdk/extensions/discord/src/group-policy.d.ts +4 -0
- package/dist/plugin-sdk/extensions/discord/src/guilds.d.ts +6 -0
- package/dist/plugin-sdk/extensions/discord/src/mentions.d.ts +8 -0
- package/dist/plugin-sdk/extensions/discord/src/message-tool-schema.d.ts +96 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/agent-components-helpers.d.ts +155 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/agent-components.d.ts +28 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/allow-list.d.ts +189 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/auto-presence.d.ts +59 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/commands.d.ts +2 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/dm-command-auth.d.ts +24 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/dm-command-decision.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/exec-approvals.d.ts +55 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/format.d.ts +13 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/gateway-error-guard.d.ts +6 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/gateway-plugin.d.ts +8 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/gateway-registry.d.ts +9 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/inbound-context.d.ts +22 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/inbound-job.d.ts +13 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/inbound-worker.d.ts +15 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/listeners.d.ts +67 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-handler.d.ts +13 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-handler.preflight.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-handler.preflight.types.d.ts +88 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-handler.process.d.ts +2 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-utils.d.ts +45 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/model-picker-preferences.d.ts +18 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/model-picker.d.ts +117 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/native-command-context.d.ts +68 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/native-command-ui.d.ts +97 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/native-command.d.ts +19 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/preflight-audio.d.ts +21 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/preflight-audio.runtime.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/presence-cache.d.ts +9 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/presence.d.ts +5 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/provider.allowlist.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/provider.d.ts +26 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/provider.lifecycle.d.ts +27 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/reply-context.d.ts +17 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/reply-delivery.d.ts +40 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/rest-fetch.d.ts +2 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/route-resolution.d.ts +40 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/sender-identity.d.ts +31 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/startup-status.d.ts +4 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/status.d.ts +17 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/system-events.d.ts +2 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.config.d.ts +11 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.d.ts +8 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.discord-api.d.ts +41 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.lifecycle.d.ts +60 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.manager.d.ts +21 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.messages.d.ts +1 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.persona.d.ts +6 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.state.d.ts +79 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.types.d.ts +79 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-session-close.d.ts +15 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/threading.d.ts +98 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/timeouts.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor/typing.d.ts +5 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor.d.ts +10 -0
- package/dist/plugin-sdk/extensions/discord/src/monitor.gateway.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/src/normalize.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/src/outbound-adapter.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/pluralkit.d.ts +26 -0
- package/dist/plugin-sdk/extensions/discord/src/probe.d.ts +37 -0
- package/dist/plugin-sdk/extensions/discord/src/resolve-allowlist-common.d.ts +11 -0
- package/dist/plugin-sdk/extensions/discord/src/resolve-channels.d.ts +15 -0
- package/dist/plugin-sdk/extensions/discord/src/resolve-users.d.ts +14 -0
- package/dist/plugin-sdk/extensions/discord/src/retry.d.ts +12 -0
- package/dist/plugin-sdk/extensions/discord/src/runtime-api.d.ts +11 -0
- package/dist/plugin-sdk/extensions/discord/src/send.channels.d.ts +17 -0
- package/dist/plugin-sdk/extensions/discord/src/send.components.d.ts +24 -0
- package/dist/plugin-sdk/extensions/discord/src/send.d.ts +11 -0
- package/dist/plugin-sdk/extensions/discord/src/send.emojis-stickers.d.ts +4 -0
- package/dist/plugin-sdk/extensions/discord/src/send.guild.d.ts +24 -0
- package/dist/plugin-sdk/extensions/discord/src/send.messages.d.ts +20 -0
- package/dist/plugin-sdk/extensions/discord/src/send.outbound.d.ts +61 -0
- package/dist/plugin-sdk/extensions/discord/src/send.permissions.d.ts +20 -0
- package/dist/plugin-sdk/extensions/discord/src/send.reactions.d.ts +15 -0
- package/dist/plugin-sdk/extensions/discord/src/send.shared.d.ts +86 -0
- package/dist/plugin-sdk/extensions/discord/src/send.types.d.ts +148 -0
- package/dist/plugin-sdk/extensions/discord/src/send.typing.d.ts +5 -0
- package/dist/plugin-sdk/extensions/discord/src/session-key-normalization.d.ts +7 -0
- package/dist/plugin-sdk/extensions/discord/src/shared-interactive.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/status-issues.d.ts +2 -0
- package/dist/plugin-sdk/extensions/discord/src/targets.d.ts +18 -0
- package/dist/plugin-sdk/extensions/discord/src/token.d.ts +11 -0
- package/dist/plugin-sdk/extensions/discord/src/ui.d.ts +19 -0
- package/dist/plugin-sdk/extensions/discord/src/voice/command.d.ts +15 -0
- package/dist/plugin-sdk/extensions/discord/src/voice/manager.d.ts +60 -0
- package/dist/plugin-sdk/extensions/discord/src/voice/manager.runtime.d.ts +5 -0
- package/dist/plugin-sdk/extensions/discord/src/voice/sdk-runtime.d.ts +3 -0
- package/dist/plugin-sdk/extensions/discord/src/voice-message.d.ts +50 -0
- package/dist/plugin-sdk/extensions/discord/timeouts.d.ts +1 -0
- package/dist/plugin-sdk/extensions/feishu/api.d.ts +4 -0
- package/dist/plugin-sdk/extensions/feishu/runtime-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/feishu/setup-api.d.ts +2 -0
- package/dist/plugin-sdk/extensions/feishu/src/accounts.d.ts +48 -0
- package/dist/plugin-sdk/extensions/feishu/src/async.d.ts +12 -0
- package/dist/plugin-sdk/extensions/feishu/src/bot-content.d.ts +82 -0
- package/dist/plugin-sdk/extensions/feishu/src/bot-sender-name.d.ts +16 -0
- package/dist/plugin-sdk/extensions/feishu/src/bot.d.ts +70 -0
- package/dist/plugin-sdk/extensions/feishu/src/client.d.ts +47 -0
- package/dist/plugin-sdk/extensions/feishu/src/config-schema.d.ts +550 -0
- package/dist/plugin-sdk/extensions/feishu/src/conversation-id.d.ts +17 -0
- package/dist/plugin-sdk/extensions/feishu/src/dedup.d.ts +19 -0
- package/dist/plugin-sdk/extensions/feishu/src/dynamic-agent.d.ts +18 -0
- package/dist/plugin-sdk/extensions/feishu/src/external-keys.d.ts +1 -0
- package/dist/plugin-sdk/extensions/feishu/src/media.d.ts +118 -0
- package/dist/plugin-sdk/extensions/feishu/src/mention.d.ts +52 -0
- package/dist/plugin-sdk/extensions/feishu/src/policy.d.ts +28 -0
- package/dist/plugin-sdk/extensions/feishu/src/post.d.ts +11 -0
- package/dist/plugin-sdk/extensions/feishu/src/probe.d.ts +10 -0
- package/dist/plugin-sdk/extensions/feishu/src/reply-dispatcher.d.ts +35 -0
- package/dist/plugin-sdk/extensions/feishu/src/runtime.d.ts +3 -0
- package/dist/plugin-sdk/extensions/feishu/src/secret-input.d.ts +1 -0
- package/dist/plugin-sdk/extensions/feishu/src/send-result.d.ts +12 -0
- package/dist/plugin-sdk/extensions/feishu/src/send-target.d.ts +10 -0
- package/dist/plugin-sdk/extensions/feishu/src/send.d.ts +131 -0
- package/dist/plugin-sdk/extensions/feishu/src/setup-core.d.ts +3 -0
- package/dist/plugin-sdk/extensions/feishu/src/setup-surface.d.ts +3 -0
- package/dist/plugin-sdk/extensions/feishu/src/streaming-card.d.ts +55 -0
- package/dist/plugin-sdk/extensions/feishu/src/targets.d.ts +6 -0
- package/dist/plugin-sdk/extensions/feishu/src/thread-bindings.d.ts +42 -0
- package/dist/plugin-sdk/extensions/feishu/src/types.d.ts +84 -0
- package/dist/plugin-sdk/extensions/feishu/src/typing.d.ts +57 -0
- package/dist/plugin-sdk/extensions/firecrawl/index.d.ts +8 -0
- package/dist/plugin-sdk/extensions/firecrawl/src/config.d.ts +25 -0
- package/dist/plugin-sdk/extensions/firecrawl/src/firecrawl-client.d.ts +43 -0
- package/dist/plugin-sdk/extensions/firecrawl/src/firecrawl-scrape-tool.d.ts +17 -0
- package/dist/plugin-sdk/extensions/firecrawl/src/firecrawl-search-provider.d.ts +2 -0
- package/dist/plugin-sdk/extensions/firecrawl/src/firecrawl-search-tool.d.ts +15 -0
- package/dist/plugin-sdk/extensions/google/gemini-cli-provider.d.ts +2 -0
- package/dist/plugin-sdk/extensions/google/index.d.ts +8 -0
- package/dist/plugin-sdk/extensions/google/media-understanding-provider.d.ts +6 -0
- package/dist/plugin-sdk/extensions/google/oauth.credentials.d.ts +21 -0
- package/dist/plugin-sdk/extensions/google/oauth.d.ts +5 -0
- package/dist/plugin-sdk/extensions/google/oauth.flow.d.ts +20 -0
- package/dist/plugin-sdk/extensions/google/oauth.http.d.ts +1 -0
- package/dist/plugin-sdk/extensions/google/oauth.project.d.ts +4 -0
- package/dist/plugin-sdk/extensions/google/oauth.runtime.d.ts +1 -0
- package/dist/plugin-sdk/extensions/google/oauth.shared.d.ts +33 -0
- package/dist/plugin-sdk/extensions/google/oauth.token.d.ts +2 -0
- package/dist/plugin-sdk/extensions/google/provider-models.d.ts +6 -0
- package/dist/plugin-sdk/extensions/google/runtime-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/google/src/gemini-web-search-provider.d.ts +13 -0
- package/dist/plugin-sdk/extensions/huggingface/provider-catalog.d.ts +2 -0
- package/dist/plugin-sdk/extensions/imessage/api.d.ts +4 -0
- package/dist/plugin-sdk/extensions/imessage/runtime-api.d.ts +6 -0
- package/dist/plugin-sdk/extensions/imessage/src/accounts.d.ts +16 -0
- package/dist/plugin-sdk/extensions/imessage/src/client.d.ts +46 -0
- package/dist/plugin-sdk/extensions/imessage/src/constants.d.ts +2 -0
- package/dist/plugin-sdk/extensions/imessage/src/group-policy.d.ts +14 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/abort-handler.d.ts +9 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/deliver.d.ts +14 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/echo-cache.d.ts +9 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/inbound-processing.d.ts +98 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/loop-rate-limiter.d.ts +14 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/monitor-provider.d.ts +7 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/parse-notification.d.ts +2 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/reflection-guard.d.ts +14 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/runtime.d.ts +4 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/sanitize-outbound.d.ts +6 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/self-chat-cache.d.ts +16 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor/types.d.ts +37 -0
- package/dist/plugin-sdk/extensions/imessage/src/monitor.d.ts +2 -0
- package/dist/plugin-sdk/extensions/imessage/src/probe.d.ts +17 -0
- package/dist/plugin-sdk/extensions/imessage/src/send.d.ts +34 -0
- package/dist/plugin-sdk/extensions/imessage/src/target-parsing-helpers.d.ts +85 -0
- package/dist/plugin-sdk/extensions/imessage/src/targets.d.ts +27 -0
- package/dist/plugin-sdk/extensions/irc/api.d.ts +2 -0
- package/dist/plugin-sdk/extensions/irc/src/accounts.d.ts +23 -0
- package/dist/plugin-sdk/extensions/irc/src/control-chars.d.ts +3 -0
- package/dist/plugin-sdk/extensions/irc/src/normalize.d.ts +18 -0
- package/dist/plugin-sdk/extensions/irc/src/runtime-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/irc/src/setup-core.d.ts +10 -0
- package/dist/plugin-sdk/extensions/irc/src/setup-surface.d.ts +4 -0
- package/dist/plugin-sdk/extensions/irc/src/types.d.ts +83 -0
- package/dist/plugin-sdk/extensions/kilocode/provider-catalog.d.ts +3 -0
- package/dist/plugin-sdk/extensions/kimi-coding/provider-catalog.d.ts +10 -0
- package/dist/plugin-sdk/extensions/matrix/helper-api.d.ts +3 -0
- package/dist/plugin-sdk/extensions/matrix/runtime-api.d.ts +7 -0
- package/dist/plugin-sdk/extensions/matrix/src/account-selection.d.ts +6 -0
- package/dist/plugin-sdk/extensions/matrix/src/auth-precedence.d.ts +11 -0
- package/dist/plugin-sdk/extensions/matrix/src/env-vars.d.ts +10 -0
- package/dist/plugin-sdk/extensions/matrix/src/matrix/thread-bindings-shared.d.ts +77 -0
- package/dist/plugin-sdk/extensions/matrix/src/storage-paths.d.ts +26 -0
- package/dist/plugin-sdk/extensions/matrix/thread-bindings-runtime.d.ts +1 -0
- package/dist/plugin-sdk/extensions/modelstudio/provider-catalog.d.ts +4 -0
- package/dist/plugin-sdk/extensions/moonshot/index.d.ts +8 -0
- package/dist/plugin-sdk/extensions/moonshot/media-understanding-provider.d.ts +4 -0
- package/dist/plugin-sdk/extensions/moonshot/onboard.d.ts +7 -0
- package/dist/plugin-sdk/extensions/moonshot/provider-catalog.d.ts +4 -0
- package/dist/plugin-sdk/extensions/moonshot/src/kimi-web-search-provider.d.ts +43 -0
- package/dist/plugin-sdk/extensions/nvidia/provider-catalog.d.ts +2 -0
- package/dist/plugin-sdk/extensions/perplexity/index.d.ts +8 -0
- package/dist/plugin-sdk/extensions/perplexity/src/perplexity-web-search-provider.d.ts +37 -0
- package/dist/plugin-sdk/extensions/qianfan/provider-catalog.d.ts +4 -0
- package/dist/plugin-sdk/extensions/signal/api.d.ts +8 -0
- package/dist/plugin-sdk/extensions/signal/src/accounts.d.ts +17 -0
- package/dist/plugin-sdk/extensions/signal/src/client.d.ts +32 -0
- package/dist/plugin-sdk/extensions/signal/src/daemon.d.ts +26 -0
- package/dist/plugin-sdk/extensions/signal/src/format.d.ts +17 -0
- package/dist/plugin-sdk/extensions/signal/src/identity.d.ts +25 -0
- package/dist/plugin-sdk/extensions/signal/src/message-actions.d.ts +2 -0
- package/dist/plugin-sdk/extensions/signal/src/monitor/access-policy.d.ts +40 -0
- package/dist/plugin-sdk/extensions/signal/src/monitor/event-handler.d.ts +5 -0
- package/dist/plugin-sdk/extensions/signal/src/monitor/event-handler.types.d.ts +126 -0
- package/dist/plugin-sdk/extensions/signal/src/monitor/mentions.d.ts +2 -0
- package/dist/plugin-sdk/extensions/signal/src/monitor.d.ts +27 -0
- package/dist/plugin-sdk/extensions/signal/src/probe.d.ts +7 -0
- package/dist/plugin-sdk/extensions/signal/src/reaction-level.d.ts +17 -0
- package/dist/plugin-sdk/extensions/signal/src/rpc-context.d.ts +9 -0
- package/dist/plugin-sdk/extensions/signal/src/runtime-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/signal/src/send-reactions.d.ts +34 -0
- package/dist/plugin-sdk/extensions/signal/src/send.d.ts +27 -0
- package/dist/plugin-sdk/extensions/signal/src/sse-reconnect.d.ts +13 -0
- package/dist/plugin-sdk/extensions/slack/api.d.ts +15 -0
- package/dist/plugin-sdk/extensions/slack/runtime-api.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/account-inspect.d.ts +32 -0
- package/dist/plugin-sdk/extensions/slack/src/account-surface-fields.d.ts +14 -0
- package/dist/plugin-sdk/extensions/slack/src/accounts.d.ts +25 -0
- package/dist/plugin-sdk/extensions/slack/src/action-runtime.d.ts +38 -0
- package/dist/plugin-sdk/extensions/slack/src/actions.d.ts +74 -0
- package/dist/plugin-sdk/extensions/slack/src/blocks-fallback.d.ts +2 -0
- package/dist/plugin-sdk/extensions/slack/src/blocks-input.d.ts +3 -0
- package/dist/plugin-sdk/extensions/slack/src/blocks-render.d.ts +6 -0
- package/dist/plugin-sdk/extensions/slack/src/channel-migration.d.ts +20 -0
- package/dist/plugin-sdk/extensions/slack/src/client.d.ts +4 -0
- package/dist/plugin-sdk/extensions/slack/src/directory-config.d.ts +3 -0
- package/dist/plugin-sdk/extensions/slack/src/directory-live.d.ts +3 -0
- package/dist/plugin-sdk/extensions/slack/src/draft-stream.d.ts +25 -0
- package/dist/plugin-sdk/extensions/slack/src/format.d.ts +8 -0
- package/dist/plugin-sdk/extensions/slack/src/group-policy.d.ts +4 -0
- package/dist/plugin-sdk/extensions/slack/src/http/index.d.ts +1 -0
- package/dist/plugin-sdk/extensions/slack/src/http/registry.d.ts +12 -0
- package/dist/plugin-sdk/extensions/slack/src/index.d.ts +7 -0
- package/dist/plugin-sdk/extensions/slack/src/interactive-replies.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/message-actions.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/modal-metadata.d.ts +8 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/allow-list.d.ts +24 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/auth.d.ts +29 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/channel-config.d.ts +45 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/channel-type.d.ts +3 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/commands.d.ts +9 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/context.d.ts +107 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/dm-auth.d.ts +17 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/channels.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/interactions.block-actions.d.ts +49 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/interactions.d.ts +4 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/interactions.modal.d.ts +68 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/members.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/message-subtype-handlers.d.ts +13 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/messages.d.ts +6 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/pins.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/reactions.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/system-event-context.d.ts +12 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/events.d.ts +10 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/external-arg-menu-store.d.ts +18 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/media.d.ts +66 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/dispatch.d.ts +12 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/prepare-content.d.ts +14 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/prepare-thread-context.d.ts +24 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/prepare.d.ts +13 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/types.d.ts +23 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler.d.ts +22 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/mrkdwn.d.ts +1 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/policy.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/provider.d.ts +26 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/reconnect-policy.d.ts +25 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/replies.d.ts +56 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/room-context.d.ts +14 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/slash-commands.runtime.d.ts +11 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/slash-dispatch.runtime.d.ts +17 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/slash-skill-commands.runtime.d.ts +3 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/slash.d.ts +6 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/thread-resolution.d.ts +12 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor/types.d.ts +113 -0
- package/dist/plugin-sdk/extensions/slack/src/monitor.d.ts +5 -0
- package/dist/plugin-sdk/extensions/slack/src/probe.d.ts +14 -0
- package/dist/plugin-sdk/extensions/slack/src/resolve-allowlist-common.d.ts +29 -0
- package/dist/plugin-sdk/extensions/slack/src/resolve-channels.d.ts +19 -0
- package/dist/plugin-sdk/extensions/slack/src/resolve-users.d.ts +26 -0
- package/dist/plugin-sdk/extensions/slack/src/runtime-api.d.ts +4 -0
- package/dist/plugin-sdk/extensions/slack/src/send.d.ts +24 -0
- package/dist/plugin-sdk/extensions/slack/src/sent-thread-cache.d.ts +3 -0
- package/dist/plugin-sdk/extensions/slack/src/stream-mode.d.ts +23 -0
- package/dist/plugin-sdk/extensions/slack/src/streaming.d.ts +72 -0
- package/dist/plugin-sdk/extensions/slack/src/targets.d.ts +7 -0
- package/dist/plugin-sdk/extensions/slack/src/threading-tool-context.d.ts +10 -0
- package/dist/plugin-sdk/extensions/slack/src/threading.d.ts +29 -0
- package/dist/plugin-sdk/extensions/slack/src/token.d.ts +4 -0
- package/dist/plugin-sdk/extensions/slack/src/truncate.d.ts +1 -0
- package/dist/plugin-sdk/extensions/slack/src/types.d.ts +58 -0
- package/dist/plugin-sdk/extensions/tavily/index.d.ts +8 -0
- package/dist/plugin-sdk/extensions/tavily/src/config.d.ts +14 -0
- package/dist/plugin-sdk/extensions/tavily/src/tavily-client.d.ts +29 -0
- package/dist/plugin-sdk/extensions/tavily/src/tavily-extract-tool.d.ts +14 -0
- package/dist/plugin-sdk/extensions/tavily/src/tavily-search-provider.d.ts +2 -0
- package/dist/plugin-sdk/extensions/tavily/src/tavily-search-tool.d.ts +17 -0
- package/dist/plugin-sdk/extensions/telegram/allow-from.d.ts +1 -0
- package/dist/plugin-sdk/extensions/telegram/api.d.ts +20 -0
- package/dist/plugin-sdk/extensions/telegram/runtime-api.d.ts +14 -0
- package/dist/plugin-sdk/extensions/telegram/src/account-inspect.d.ts +18 -0
- package/dist/plugin-sdk/extensions/telegram/src/accounts.d.ts +31 -0
- package/dist/plugin-sdk/extensions/telegram/src/action-runtime.d.ts +21 -0
- package/dist/plugin-sdk/extensions/telegram/src/allow-from.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/allowed-updates.d.ts +4 -0
- package/dist/plugin-sdk/extensions/telegram/src/api-fetch.d.ts +20 -0
- package/dist/plugin-sdk/extensions/telegram/src/api-logging.d.ts +11 -0
- package/dist/plugin-sdk/extensions/telegram/src/approval-buttons.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/audit-membership-runtime.d.ts +4 -0
- package/dist/plugin-sdk/extensions/telegram/src/audit.d.ts +33 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot/delivery.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot/delivery.replies.d.ts +50 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot/delivery.resolve-media.d.ts +8 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot/delivery.send.d.ts +27 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot/helpers.d.ts +147 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot/reply-threading.d.ts +30 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot/types.d.ts +28 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-access.d.ts +25 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-deps.d.ts +19 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-handlers.d.ts +1 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-handlers.media.d.ts +7 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-handlers.runtime.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-message-context.body.d.ts +39 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-message-context.d.ts +34 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-message-context.session.d.ts +41 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-message-context.types.d.ts +56 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-message-dispatch.d.ts +31 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-message.d.ts +20 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-native-command-menu.d.ts +37 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-native-commands.d.ts +60 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot-updates.d.ts +31 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot.d.ts +39 -0
- package/dist/plugin-sdk/extensions/telegram/src/bot.runtime.d.ts +4 -0
- package/dist/plugin-sdk/extensions/telegram/src/button-types.d.ts +13 -0
- package/dist/plugin-sdk/extensions/telegram/src/caption.d.ts +5 -0
- package/dist/plugin-sdk/extensions/telegram/src/channel-actions.d.ts +6 -0
- package/dist/plugin-sdk/extensions/telegram/src/conversation-route.d.ts +24 -0
- package/dist/plugin-sdk/extensions/telegram/src/directory-config.d.ts +3 -0
- package/dist/plugin-sdk/extensions/telegram/src/dm-access.d.ts +20 -0
- package/dist/plugin-sdk/extensions/telegram/src/draft-stream.d.ts +48 -0
- package/dist/plugin-sdk/extensions/telegram/src/exec-approvals-handler.d.ts +34 -0
- package/dist/plugin-sdk/extensions/telegram/src/exec-approvals.d.ts +39 -0
- package/dist/plugin-sdk/extensions/telegram/src/fetch.d.ts +23 -0
- package/dist/plugin-sdk/extensions/telegram/src/format.d.ts +19 -0
- package/dist/plugin-sdk/extensions/telegram/src/forum-service-message.d.ts +9 -0
- package/dist/plugin-sdk/extensions/telegram/src/group-access.d.ts +54 -0
- package/dist/plugin-sdk/extensions/telegram/src/group-config-helpers.d.ts +8 -0
- package/dist/plugin-sdk/extensions/telegram/src/group-migration.d.ts +20 -0
- package/dist/plugin-sdk/extensions/telegram/src/group-policy.d.ts +4 -0
- package/dist/plugin-sdk/extensions/telegram/src/inline-buttons.d.ts +11 -0
- package/dist/plugin-sdk/extensions/telegram/src/lane-delivery-state.d.ts +12 -0
- package/dist/plugin-sdk/extensions/telegram/src/lane-delivery-text-deliverer.d.ts +55 -0
- package/dist/plugin-sdk/extensions/telegram/src/lane-delivery.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/media-understanding.runtime.d.ts +5 -0
- package/dist/plugin-sdk/extensions/telegram/src/message-tool-schema.d.ts +5 -0
- package/dist/plugin-sdk/extensions/telegram/src/model-buttons.d.ts +84 -0
- package/dist/plugin-sdk/extensions/telegram/src/monitor.d.ts +20 -0
- package/dist/plugin-sdk/extensions/telegram/src/network-config.d.ts +33 -0
- package/dist/plugin-sdk/extensions/telegram/src/network-errors.d.ts +25 -0
- package/dist/plugin-sdk/extensions/telegram/src/normalize.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/outbound-adapter.d.ts +14 -0
- package/dist/plugin-sdk/extensions/telegram/src/outbound-params.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/polling-session.d.ts +27 -0
- package/dist/plugin-sdk/extensions/telegram/src/probe.d.ts +25 -0
- package/dist/plugin-sdk/extensions/telegram/src/proxy.d.ts +1 -0
- package/dist/plugin-sdk/extensions/telegram/src/reaction-level.d.ts +11 -0
- package/dist/plugin-sdk/extensions/telegram/src/reasoning-lane-coordinator.d.ts +18 -0
- package/dist/plugin-sdk/extensions/telegram/src/send.d.ts +217 -0
- package/dist/plugin-sdk/extensions/telegram/src/sendchataction-401-backoff.d.ts +28 -0
- package/dist/plugin-sdk/extensions/telegram/src/sent-message-cache.d.ts +12 -0
- package/dist/plugin-sdk/extensions/telegram/src/sequential-key.d.ts +25 -0
- package/dist/plugin-sdk/extensions/telegram/src/status-issues.d.ts +2 -0
- package/dist/plugin-sdk/extensions/telegram/src/status-reaction-variants.d.ts +21 -0
- package/dist/plugin-sdk/extensions/telegram/src/sticker-cache.d.ts +46 -0
- package/dist/plugin-sdk/extensions/telegram/src/target-writeback.d.ts +7 -0
- package/dist/plugin-sdk/extensions/telegram/src/targets.d.ts +11 -0
- package/dist/plugin-sdk/extensions/telegram/src/thread-bindings.d.ts +58 -0
- package/dist/plugin-sdk/extensions/telegram/src/token.d.ts +13 -0
- package/dist/plugin-sdk/extensions/telegram/src/update-offset-store.d.ts +15 -0
- package/dist/plugin-sdk/extensions/telegram/src/voice.d.ts +16 -0
- package/dist/plugin-sdk/extensions/telegram/src/webhook.d.ts +21 -0
- package/dist/plugin-sdk/extensions/venice/provider-catalog.d.ts +2 -0
- package/dist/plugin-sdk/extensions/vercel-ai-gateway/provider-catalog.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/api.d.ts +7 -0
- package/dist/plugin-sdk/extensions/whatsapp/auth-presence.d.ts +1 -0
- package/dist/plugin-sdk/extensions/whatsapp/light-runtime-api.d.ts +4 -0
- package/dist/plugin-sdk/extensions/whatsapp/login-qr-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/whatsapp/runtime-api.d.ts +11 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/accounts.d.ts +42 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/action-runtime-target-auth.d.ts +10 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/action-runtime.d.ts +9 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/active-listener.d.ts +25 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/agent-tools-login.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auth-store.d.ts +26 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/constants.d.ts +1 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/deliver-reply.d.ts +19 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/heartbeat-runner.d.ts +20 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/loggers.d.ts +4 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/mentions.d.ts +19 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/ack-reaction.d.ts +13 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/broadcast.d.ts +16 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/commands.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/echo.d.ts +17 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/group-activation.d.ts +9 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/group-gating.d.ts +33 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/group-members.d.ts +6 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/last-route.d.ts +15 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/message-line.d.ts +11 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/on-message.d.ts +24 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/peer.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/process-message.d.ts +40 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor.d.ts +5 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/session-snapshot.d.ts +17 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/types.d.ts +30 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/util.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply.d.ts +1 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply.impl.d.ts +6 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/channel.runtime.d.ts +23 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/directory-config.d.ts +3 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/group-policy.d.ts +14 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/access-control.d.ts +36 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/dedupe.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/extract.d.ts +13 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/media.d.ts +7 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/monitor.d.ts +30 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/send-api.d.ts +22 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/types.d.ts +42 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound.d.ts +4 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/login-qr.d.ts +19 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/login.d.ts +3 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/media.d.ts +43 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/normalize.d.ts +1 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/qr-image.d.ts +4 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/reconnect.d.ts +12 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/runtime-api.d.ts +3 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/send.d.ts +27 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/session-errors.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/session.d.ts +17 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/setup-core.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/setup-surface.d.ts +2 -0
- package/dist/plugin-sdk/extensions/whatsapp/src/vcard.d.ts +6 -0
- package/dist/plugin-sdk/extensions/xai/index.d.ts +8 -0
- package/dist/plugin-sdk/extensions/xai/model-definitions.d.ts +17 -0
- package/dist/plugin-sdk/extensions/xai/onboard.d.ts +5 -0
- package/dist/plugin-sdk/extensions/xai/provider-catalog.d.ts +2 -0
- package/dist/plugin-sdk/extensions/xai/provider-models.d.ts +6 -0
- package/dist/plugin-sdk/extensions/xai/src/web-search-shared.d.ts +69 -0
- package/dist/plugin-sdk/extensions/xai/stream.d.ts +3 -0
- package/dist/plugin-sdk/extensions/xai/web-search.d.ts +10 -0
- package/dist/plugin-sdk/extensions/xiaomi/provider-catalog.d.ts +3 -0
- package/dist/plugin-sdk/extensions/zalo/api.d.ts +2 -0
- package/dist/plugin-sdk/extensions/zalo/runtime-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/zalo/src/accounts.d.ts +11 -0
- package/dist/plugin-sdk/extensions/zalo/src/runtime-api.d.ts +1 -0
- package/dist/plugin-sdk/extensions/zalo/src/secret-input.d.ts +1 -0
- package/dist/plugin-sdk/extensions/zalo/src/setup-core.d.ts +1 -0
- package/dist/plugin-sdk/extensions/zalo/src/setup-surface.d.ts +3 -0
- package/dist/plugin-sdk/extensions/zalo/src/token.d.ts +8 -0
- package/dist/plugin-sdk/extensions/zalo/src/types.d.ts +46 -0
- package/dist/plugin-sdk/feishu.d.ts +1 -0
- package/dist/plugin-sdk/feishu.js +101 -0
- package/dist/plugin-sdk/gateway-runtime.d.ts +1 -0
- package/dist/plugin-sdk/gateway-runtime.js +46 -0
- package/dist/plugin-sdk/googlechat.d.ts +1 -0
- package/dist/plugin-sdk/googlechat.js +93 -0
- package/dist/plugin-sdk/group-access.d.ts +1 -0
- package/dist/plugin-sdk/group-access.js +2 -0
- package/dist/plugin-sdk/hook-runtime.d.ts +1 -0
- package/dist/plugin-sdk/hook-runtime.js +12 -0
- package/dist/plugin-sdk/image-generation.d.ts +1 -0
- package/dist/plugin-sdk/image-generation.js +51 -0
- package/dist/plugin-sdk/imessage-core.d.ts +1 -0
- package/dist/plugin-sdk/imessage-core.js +214 -0
- package/dist/plugin-sdk/imessage.d.ts +1 -0
- package/dist/plugin-sdk/imessage.js +223 -0
- package/dist/plugin-sdk/index.d.ts +1 -0
- package/dist/plugin-sdk/index.js +55 -0
- package/dist/plugin-sdk/infra-runtime.d.ts +1 -0
- package/dist/plugin-sdk/infra-runtime.js +223 -0
- package/dist/plugin-sdk/interactive-runtime.d.ts +1 -0
- package/dist/plugin-sdk/interactive-runtime.js +3 -0
- package/dist/plugin-sdk/irc.d.ts +1 -0
- package/dist/plugin-sdk/irc.js +232 -0
- package/dist/plugin-sdk/json-store.d.ts +1 -0
- package/dist/plugin-sdk/json-store.js +9 -0
- package/dist/plugin-sdk/keyed-async-queue.d.ts +1 -0
- package/dist/plugin-sdk/keyed-async-queue.js +2 -0
- package/dist/plugin-sdk/lazy-runtime.d.ts +1 -0
- package/dist/plugin-sdk/lazy-runtime.js +2 -0
- package/dist/plugin-sdk/line-core.d.ts +1 -0
- package/dist/plugin-sdk/line-core.js +29 -0
- package/dist/plugin-sdk/line.d.ts +1 -0
- package/dist/plugin-sdk/line.js +22 -0
- package/dist/plugin-sdk/llm-task.d.ts +1 -0
- package/dist/plugin-sdk/llm-task.js +7 -0
- package/dist/plugin-sdk/matrix-runtime-heavy.d.ts +1 -0
- package/dist/plugin-sdk/matrix-runtime-heavy.js +223 -0
- package/dist/plugin-sdk/matrix-runtime-shared.d.ts +1 -0
- package/dist/plugin-sdk/matrix-runtime-shared.js +2 -0
- package/dist/plugin-sdk/matrix.d.ts +1 -0
- package/dist/plugin-sdk/matrix.js +84 -0
- package/dist/plugin-sdk/mattermost.d.ts +1 -0
- package/dist/plugin-sdk/mattermost.js +233 -0
- package/dist/plugin-sdk/media-runtime.d.ts +1 -0
- package/dist/plugin-sdk/media-runtime.js +212 -0
- package/dist/plugin-sdk/media-understanding-runtime.d.ts +1 -0
- package/dist/plugin-sdk/media-understanding-runtime.js +211 -0
- package/dist/plugin-sdk/media-understanding.d.ts +1 -0
- package/dist/plugin-sdk/media-understanding.js +15 -0
- package/dist/plugin-sdk/memory-core.d.ts +1 -0
- package/dist/plugin-sdk/memory-core.js +2 -0
- package/dist/plugin-sdk/memory-lancedb.d.ts +1 -0
- package/dist/plugin-sdk/memory-lancedb.js +2 -0
- package/dist/plugin-sdk/msteams.d.ts +1 -0
- package/dist/plugin-sdk/msteams.js +244 -0
- package/dist/plugin-sdk/nextcloud-talk.d.ts +1 -0
- package/dist/plugin-sdk/nextcloud-talk.js +231 -0
- package/dist/plugin-sdk/nostr.d.ts +1 -0
- package/dist/plugin-sdk/nostr.js +50 -0
- package/dist/plugin-sdk/ollama-setup.d.ts +1 -0
- package/dist/plugin-sdk/ollama-setup.js +33 -0
- package/dist/plugin-sdk/outbound-runtime.d.ts +1 -0
- package/dist/plugin-sdk/outbound-runtime.js +23 -0
- package/dist/plugin-sdk/plugin-entry.d.ts +1 -0
- package/dist/plugin-sdk/plugin-entry.js +3 -0
- package/dist/plugin-sdk/plugin-runtime.d.ts +1 -0
- package/dist/plugin-sdk/plugin-runtime.js +211 -0
- package/dist/plugin-sdk/process-runtime.d.ts +1 -0
- package/dist/plugin-sdk/process-runtime.js +12 -0
- package/dist/plugin-sdk/provider-auth-api-key.d.ts +1 -0
- package/dist/plugin-sdk/provider-auth-api-key.js +53 -0
- package/dist/plugin-sdk/provider-auth-login.d.ts +1 -0
- package/dist/plugin-sdk/provider-auth-login.js +2 -0
- package/dist/plugin-sdk/provider-auth.d.ts +1 -0
- package/dist/plugin-sdk/provider-auth.js +37 -0
- package/dist/plugin-sdk/provider-catalog.d.ts +1 -0
- package/dist/plugin-sdk/provider-catalog.js +2 -0
- package/dist/plugin-sdk/provider-env-vars.d.ts +1 -0
- package/dist/plugin-sdk/provider-env-vars.js +2 -0
- package/dist/plugin-sdk/provider-google.d.ts +1 -0
- package/dist/plugin-sdk/provider-google.js +3 -0
- package/dist/plugin-sdk/provider-models.d.ts +1 -0
- package/dist/plugin-sdk/provider-models.js +27 -0
- package/dist/plugin-sdk/provider-onboard.d.ts +1 -0
- package/dist/plugin-sdk/provider-onboard.js +20 -0
- package/dist/plugin-sdk/provider-setup.d.ts +1 -0
- package/dist/plugin-sdk/provider-setup.js +58 -0
- package/dist/plugin-sdk/provider-stream.d.ts +1 -0
- package/dist/plugin-sdk/provider-stream.js +211 -0
- package/dist/plugin-sdk/provider-usage.d.ts +1 -0
- package/dist/plugin-sdk/provider-usage.js +18 -0
- package/dist/plugin-sdk/provider-web-search.d.ts +1 -0
- package/dist/plugin-sdk/provider-web-search.js +23 -0
- package/dist/plugin-sdk/provider-zai-endpoint.d.ts +1 -0
- package/dist/plugin-sdk/provider-zai-endpoint.js +3 -0
- package/dist/plugin-sdk/reply-history.d.ts +1 -0
- package/dist/plugin-sdk/reply-history.js +23 -0
- package/dist/plugin-sdk/reply-payload.d.ts +1 -0
- package/dist/plugin-sdk/reply-payload.js +2 -0
- package/dist/plugin-sdk/reply-runtime.d.ts +1 -0
- package/dist/plugin-sdk/reply-runtime.js +211 -0
- package/dist/plugin-sdk/request-url.d.ts +1 -0
- package/dist/plugin-sdk/request-url.js +2 -0
- package/dist/plugin-sdk/root-alias.cjs +272 -0
- package/dist/plugin-sdk/routing.d.ts +1 -0
- package/dist/plugin-sdk/routing.js +25 -0
- package/dist/plugin-sdk/runtime-env.d.ts +1 -0
- package/dist/plugin-sdk/runtime-env.js +15 -0
- package/dist/plugin-sdk/runtime-store.d.ts +1 -0
- package/dist/plugin-sdk/runtime-store.js +2 -0
- package/dist/plugin-sdk/runtime.d.ts +1 -0
- package/dist/plugin-sdk/runtime.js +15 -0
- package/dist/plugin-sdk/sandbox.d.ts +1 -0
- package/dist/plugin-sdk/sandbox.js +66 -0
- package/dist/plugin-sdk/secret-input.d.ts +1 -0
- package/dist/plugin-sdk/secret-input.js +3 -0
- package/dist/plugin-sdk/security-runtime.d.ts +1 -0
- package/dist/plugin-sdk/security-runtime.js +18 -0
- package/dist/plugin-sdk/self-hosted-provider-setup.d.ts +1 -0
- package/dist/plugin-sdk/self-hosted-provider-setup.js +33 -0
- package/dist/plugin-sdk/setup-adapter-runtime.d.ts +1 -0
- package/dist/plugin-sdk/setup-adapter-runtime.js +2 -0
- package/dist/plugin-sdk/setup-runtime.d.ts +1 -0
- package/dist/plugin-sdk/setup-runtime.js +17 -0
- package/dist/plugin-sdk/setup-tools.d.ts +1 -0
- package/dist/plugin-sdk/setup-tools.js +21 -0
- package/dist/plugin-sdk/setup.d.ts +1 -0
- package/dist/plugin-sdk/setup.js +26 -0
- package/dist/plugin-sdk/signal.d.ts +1 -0
- package/dist/plugin-sdk/signal.js +220 -0
- package/dist/plugin-sdk/slack-core.d.ts +1 -0
- package/dist/plugin-sdk/slack-core.js +22 -0
- package/dist/plugin-sdk/slack.d.ts +1 -0
- package/dist/plugin-sdk/slack.js +223 -0
- package/dist/plugin-sdk/speech-runtime.d.ts +1 -0
- package/dist/plugin-sdk/speech-runtime.js +213 -0
- package/dist/plugin-sdk/speech.d.ts +1 -0
- package/dist/plugin-sdk/speech.js +212 -0
- package/dist/plugin-sdk/src/acp/control-plane/manager.core.d.ts +86 -0
- package/dist/plugin-sdk/src/acp/control-plane/manager.d.ts +7 -0
- package/dist/plugin-sdk/src/acp/control-plane/manager.identity-reconcile.d.ts +23 -0
- package/dist/plugin-sdk/src/acp/control-plane/manager.runtime-controls.d.ts +14 -0
- package/dist/plugin-sdk/src/acp/control-plane/manager.types.d.ts +109 -0
- package/dist/plugin-sdk/src/acp/control-plane/manager.utils.d.ts +21 -0
- package/dist/plugin-sdk/src/acp/control-plane/runtime-cache.d.ts +38 -0
- package/dist/plugin-sdk/src/acp/control-plane/runtime-options.d.ts +23 -0
- package/dist/plugin-sdk/src/acp/control-plane/session-actor-queue.d.ts +8 -0
- package/dist/plugin-sdk/src/acp/control-plane/spawn.d.ts +25 -0
- package/dist/plugin-sdk/src/acp/conversation-id.d.ts +15 -0
- package/dist/plugin-sdk/src/acp/persistent-bindings.lifecycle.d.ts +33 -0
- package/dist/plugin-sdk/src/acp/persistent-bindings.resolve.d.ts +18 -0
- package/dist/plugin-sdk/src/acp/persistent-bindings.types.d.ts +39 -0
- package/dist/plugin-sdk/src/acp/policy.d.ts +10 -0
- package/dist/plugin-sdk/src/acp/runtime/error-text.d.ts +7 -0
- package/dist/plugin-sdk/src/acp/runtime/errors.d.ts +20 -0
- package/dist/plugin-sdk/src/acp/runtime/registry.d.ts +18 -0
- package/dist/plugin-sdk/src/acp/runtime/session-identifiers.d.ts +17 -0
- package/dist/plugin-sdk/src/acp/runtime/session-identity.d.ts +24 -0
- package/dist/plugin-sdk/src/acp/runtime/session-meta.d.ts +31 -0
- package/dist/plugin-sdk/src/acp/runtime/types.d.ts +118 -0
- package/dist/plugin-sdk/src/agents/acp-spawn-parent-stream.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/acp-spawn.d.ts +44 -0
- package/dist/plugin-sdk/src/agents/agent-command.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/agent-paths.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/agent-scope.d.ts +66 -0
- package/dist/plugin-sdk/src/agents/announce-idempotency.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/anthropic-payload-log.d.ts +20 -0
- package/dist/plugin-sdk/src/agents/anthropic-vertex-provider.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/anthropic-vertex-stream.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/api-key-rotation.d.ts +22 -0
- package/dist/plugin-sdk/src/agents/apply-patch-update.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/apply-patch.d.ts +35 -0
- package/dist/plugin-sdk/src/agents/auth-health.d.ts +40 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/constants.d.ts +20 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/credential-state.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/display.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/doctor.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/external-cli-sync.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/oauth.d.ts +14 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/order.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/paths.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/profiles.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/repair.d.ts +14 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/session-override.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/state-observation.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/store.d.ts +22 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/types.d.ts +63 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/upsert-with-lock.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/auth-profiles/usage.d.ts +87 -0
- package/dist/plugin-sdk/src/agents/auth-profiles.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/auth-profiles.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/bash-process-registry.d.ts +70 -0
- package/dist/plugin-sdk/src/agents/bash-tools.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec-approval-followup.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec-approval-request.d.ts +70 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec-host-gateway.d.ts +35 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec-host-node.d.ts +26 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec-host-shared.d.ts +143 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec-runtime.d.ts +81 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec-types.d.ts +68 -0
- package/dist/plugin-sdk/src/agents/bash-tools.exec.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/bash-tools.process.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/bash-tools.shared.d.ts +56 -0
- package/dist/plugin-sdk/src/agents/bedrock-discovery.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/bootstrap-budget.d.ts +87 -0
- package/dist/plugin-sdk/src/agents/bootstrap-cache.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/bootstrap-files.d.ts +32 -0
- package/dist/plugin-sdk/src/agents/bootstrap-hooks.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/btw.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/byteplus-models.d.ts +79 -0
- package/dist/plugin-sdk/src/agents/cache-trace.d.ts +49 -0
- package/dist/plugin-sdk/src/agents/channel-tools.d.ts +43 -0
- package/dist/plugin-sdk/src/agents/chutes-models.d.ts +25 -0
- package/dist/plugin-sdk/src/agents/chutes-oauth.d.ts +46 -0
- package/dist/plugin-sdk/src/agents/cli-backends.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/cli-credentials.d.ts +83 -0
- package/dist/plugin-sdk/src/agents/cli-runner/bundle-mcp.d.ts +14 -0
- package/dist/plugin-sdk/src/agents/cli-runner/helpers.d.ts +70 -0
- package/dist/plugin-sdk/src/agents/cli-runner/reliability.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/cli-runner.d.ts +44 -0
- package/dist/plugin-sdk/src/agents/cli-session.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/cli-watchdog-defaults.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/cloudflare-ai-gateway.d.ts +22 -0
- package/dist/plugin-sdk/src/agents/command/delivery.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/command/run-context.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/command/session-store.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/command/session.d.ts +33 -0
- package/dist/plugin-sdk/src/agents/command/types.d.ts +95 -0
- package/dist/plugin-sdk/src/agents/command-poll-backoff.d.ts +28 -0
- package/dist/plugin-sdk/src/agents/command-poll-backoff.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/compaction-real-conversation.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/compaction.d.ts +70 -0
- package/dist/plugin-sdk/src/agents/console-sanitize.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/content-blocks.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/context-cache.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/context-window-guard.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/context.d.ts +37 -0
- package/dist/plugin-sdk/src/agents/current-time.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/custom-api-registry.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/date-time.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/defaults.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/docs-path.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/doubao-models.d.ts +100 -0
- package/dist/plugin-sdk/src/agents/embedded-pi-lsp.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/embedded-pi-mcp.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/failover-error.d.ts +33 -0
- package/dist/plugin-sdk/src/agents/fast-mode.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/glob-pattern.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/huggingface-models.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/identity-avatar.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/identity-file.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/identity.d.ts +28 -0
- package/dist/plugin-sdk/src/agents/image-sanitization.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/internal-events.d.ts +16 -0
- package/dist/plugin-sdk/src/agents/kilocode-models.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/lanes.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/live-auth-keys.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/mcp-stdio.d.ts +16 -0
- package/dist/plugin-sdk/src/agents/memory-search.d.ts +79 -0
- package/dist/plugin-sdk/src/agents/minimax-vlm.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/model-alias-lines.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/model-auth-env-vars.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/model-auth-env.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/model-auth-label.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/model-auth-markers.d.ts +20 -0
- package/dist/plugin-sdk/src/agents/model-auth.d.ts +51 -0
- package/dist/plugin-sdk/src/agents/model-catalog.d.ts +30 -0
- package/dist/plugin-sdk/src/agents/model-catalog.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/model-compat.d.ts +20 -0
- package/dist/plugin-sdk/src/agents/model-fallback-observation.d.ts +22 -0
- package/dist/plugin-sdk/src/agents/model-fallback.d.ts +53 -0
- package/dist/plugin-sdk/src/agents/model-fallback.types.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/model-id-normalization.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/model-ref-profile.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/model-selection.d.ts +125 -0
- package/dist/plugin-sdk/src/agents/model-suppression.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/model-suppression.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/model-tool-support.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/models-config.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/models-config.merge.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/models-config.plan.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/models-config.providers.d.ts +50 -0
- package/dist/plugin-sdk/src/agents/models-config.providers.discovery.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/models-config.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/ollama-defaults.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/ollama-models.d.ts +48 -0
- package/dist/plugin-sdk/src/agents/ollama-stream.d.ts +58 -0
- package/dist/plugin-sdk/src/agents/openai-ws-connection.d.ts +323 -0
- package/dist/plugin-sdk/src/agents/openai-ws-stream.d.ts +70 -0
- package/dist/plugin-sdk/src/agents/openclaw-tools.d.ts +63 -0
- package/dist/plugin-sdk/src/agents/openclaw-tools.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/opencode-zen-models.d.ts +46 -0
- package/dist/plugin-sdk/src/agents/owner-display.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/path-policy.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/payload-redaction.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/pi-auth-credentials.d.ts +16 -0
- package/dist/plugin-sdk/src/agents/pi-bundle-lsp-runtime.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/pi-bundle-mcp-tools.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-block-chunker.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-error-observation.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/bootstrap.d.ts +33 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/errors.d.ts +45 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/failover-matches.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/google.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/images.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/messaging-dedupe.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/openai.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/thinking.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/turns.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/types.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-messaging.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-payloads.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/abort.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/anthropic-stream-wrappers.d.ts +16 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/cache-ttl.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/compact.d.ts +75 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/compact.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/compaction-runtime-context.d.ts +50 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/compaction-safety-timeout.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/context-engine-maintenance.d.ts +25 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/extensions.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/extra-params.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/google-stream-wrappers.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/google.d.ts +43 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/history.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/lanes.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/logger.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/message-action-discovery-input.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/model.d.ts +37 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/model.provider-normalization.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/moonshot-stream-wrappers.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/openai-stream-wrappers.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/openrouter-model-capabilities.d.ts +53 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/proxy-stream-wrappers.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/attempt.d.ts +69 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/compaction-retry-aggregate-timeout.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/compaction-timeout.d.ts +29 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/failover-observation.d.ts +20 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/history-image-prune.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/images.d.ts +83 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/params.d.ts +138 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/payloads.d.ts +43 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/types.d.ts +70 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/runs.d.ts +51 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/sandbox-info.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/session-manager-cache.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/session-manager-init.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/session-truncation.d.ts +38 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/skills-runtime.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/stream-payload-utils.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/system-prompt.d.ts +55 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/thinking.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/tool-name-allowlist.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/tool-result-char-estimator.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/tool-result-context-guard.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/tool-result-truncation.d.ts +84 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/tool-split.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/transcript-rewrite.d.ts +22 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/types.d.ts +89 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/utils.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/wait-for-idle-before-flush.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/zai-stream-wrappers.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-runner.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.d.ts +34 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.compaction.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.lifecycle.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.messages.d.ts +35 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.tools.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.types.d.ts +154 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.raw-stream.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.tools.d.ts +26 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.types.d.ts +47 -0
- package/dist/plugin-sdk/src/agents/pi-embedded-utils.d.ts +41 -0
- package/dist/plugin-sdk/src/agents/pi-embedded.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/compaction-instructions.d.ts +25 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/compaction-safeguard-runtime.d.ts +20 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/compaction-safeguard.d.ts +75 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/extension.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/pruner.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/runtime.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/settings.d.ts +44 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/tools.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/pi-extensions/session-manager-runtime-registry.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/pi-model-discovery-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/pi-model-discovery.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/pi-project-settings.d.ts +31 -0
- package/dist/plugin-sdk/src/agents/pi-settings.d.ts +45 -0
- package/dist/plugin-sdk/src/agents/pi-tool-definition-adapter.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/pi-tools.abort.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/pi-tools.before-tool-call.d.ts +39 -0
- package/dist/plugin-sdk/src/agents/pi-tools.before-tool-call.runtime.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/pi-tools.d.ts +106 -0
- package/dist/plugin-sdk/src/agents/pi-tools.host-edit.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/pi-tools.params.d.ts +34 -0
- package/dist/plugin-sdk/src/agents/pi-tools.policy.d.ts +38 -0
- package/dist/plugin-sdk/src/agents/pi-tools.read.d.ts +43 -0
- package/dist/plugin-sdk/src/agents/pi-tools.schema.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/pi-tools.types.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/provider-attribution.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/provider-capabilities.d.ts +42 -0
- package/dist/plugin-sdk/src/agents/provider-id.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/pty-dsr.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/pty-keys.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/queued-file-writer.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/runtime-plugins.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/sandbox/backend.d.ts +84 -0
- package/dist/plugin-sdk/src/agents/sandbox/bind-spec.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/sandbox/browser-bridges.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/sandbox/browser.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/sandbox/config-hash.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/sandbox/config.d.ts +33 -0
- package/dist/plugin-sdk/src/agents/sandbox/constants.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/sandbox/context.d.ts +20 -0
- package/dist/plugin-sdk/src/agents/sandbox/docker-backend.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/sandbox/docker.d.ts +59 -0
- package/dist/plugin-sdk/src/agents/sandbox/fs-bridge-mutation-helper.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/sandbox/fs-bridge-path-safety.d.ts +60 -0
- package/dist/plugin-sdk/src/agents/sandbox/fs-bridge-shell-command-plans.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/sandbox/fs-bridge.d.ts +56 -0
- package/dist/plugin-sdk/src/agents/sandbox/fs-paths.d.ts +28 -0
- package/dist/plugin-sdk/src/agents/sandbox/hash.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/sandbox/host-paths.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/sandbox/manage.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/sandbox/network-mode.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/sandbox/novnc-auth.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/sandbox/path-utils.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/sandbox/prune.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/sandbox/registry.d.ts +34 -0
- package/dist/plugin-sdk/src/agents/sandbox/remote-fs-bridge.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/sandbox/runtime-status.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/sandbox/sanitize-env-vars.d.ts +14 -0
- package/dist/plugin-sdk/src/agents/sandbox/shared.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/sandbox/ssh-backend.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/sandbox/ssh.d.ts +52 -0
- package/dist/plugin-sdk/src/agents/sandbox/tool-policy.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/sandbox/types.d.ts +98 -0
- package/dist/plugin-sdk/src/agents/sandbox/types.docker.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/sandbox/validate-sandbox-security.d.ts +68 -0
- package/dist/plugin-sdk/src/agents/sandbox/workspace-mounts.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/sandbox/workspace.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/sandbox-media-paths.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/sandbox-paths.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/sandbox-tool-policy.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/sandbox.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/sanitize-for-prompt.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/schema/clean-for-gemini.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/schema/clean-for-xai.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/schema/typebox.d.ts +14 -0
- package/dist/plugin-sdk/src/agents/self-hosted-provider-defaults.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/session-dirs.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/session-file-repair.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/session-slug.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/session-tool-result-guard-wrapper.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/session-tool-result-guard.d.ts +44 -0
- package/dist/plugin-sdk/src/agents/session-tool-result-state.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/session-transcript-repair.d.ts +33 -0
- package/dist/plugin-sdk/src/agents/session-write-lock.d.ts +53 -0
- package/dist/plugin-sdk/src/agents/sglang-defaults.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/shell-utils.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/simple-completion-transport.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/skills/bundled-dir.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/skills/config.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/skills/env-overrides.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/skills/filter.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/skills/frontmatter.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/skills/plugin-skills.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/skills/refresh.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/skills/serialize.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/skills/types.d.ts +87 -0
- package/dist/plugin-sdk/src/agents/skills/workspace.d.ts +51 -0
- package/dist/plugin-sdk/src/agents/skills.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/spawned-context.d.ts +30 -0
- package/dist/plugin-sdk/src/agents/stable-stringify.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/stream-message-shared.d.ts +35 -0
- package/dist/plugin-sdk/src/agents/subagent-announce-dispatch.d.ts +22 -0
- package/dist/plugin-sdk/src/agents/subagent-announce-queue.d.ts +29 -0
- package/dist/plugin-sdk/src/agents/subagent-announce.d.ts +48 -0
- package/dist/plugin-sdk/src/agents/subagent-attachments.d.ts +39 -0
- package/dist/plugin-sdk/src/agents/subagent-capabilities.d.ts +37 -0
- package/dist/plugin-sdk/src/agents/subagent-control.d.ts +176 -0
- package/dist/plugin-sdk/src/agents/subagent-depth.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/subagent-lifecycle-events.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/subagent-orphan-recovery.d.ts +41 -0
- package/dist/plugin-sdk/src/agents/subagent-registry-cleanup.d.ts +25 -0
- package/dist/plugin-sdk/src/agents/subagent-registry-completion.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/subagent-registry-queries.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/subagent-registry-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/agents/subagent-registry-state.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/subagent-registry.d.ts +62 -0
- package/dist/plugin-sdk/src/agents/subagent-registry.store.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/subagent-registry.types.d.ts +62 -0
- package/dist/plugin-sdk/src/agents/subagent-spawn.d.ts +71 -0
- package/dist/plugin-sdk/src/agents/synthetic-models.d.ts +160 -0
- package/dist/plugin-sdk/src/agents/system-prompt-params.d.ts +30 -0
- package/dist/plugin-sdk/src/agents/system-prompt-report.d.ts +22 -0
- package/dist/plugin-sdk/src/agents/system-prompt.d.ts +72 -0
- package/dist/plugin-sdk/src/agents/timeout.d.ts +8 -0
- package/dist/plugin-sdk/src/agents/together-models.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/tool-call-id.d.ts +27 -0
- package/dist/plugin-sdk/src/agents/tool-catalog.d.ts +35 -0
- package/dist/plugin-sdk/src/agents/tool-display-common.d.ts +69 -0
- package/dist/plugin-sdk/src/agents/tool-display.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/tool-fs-policy.d.ts +17 -0
- package/dist/plugin-sdk/src/agents/tool-images.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/tool-loop-detection.d.ts +55 -0
- package/dist/plugin-sdk/src/agents/tool-mutation.d.ts +14 -0
- package/dist/plugin-sdk/src/agents/tool-policy-match.d.ts +3 -0
- package/dist/plugin-sdk/src/agents/tool-policy-pipeline.d.ts +27 -0
- package/dist/plugin-sdk/src/agents/tool-policy-shared.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/tool-policy.d.ts +33 -0
- package/dist/plugin-sdk/src/agents/tool-summaries.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/tools/agent-step.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/tools/agents-list-tool.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/tools/browser-tool.actions.d.ts +34 -0
- package/dist/plugin-sdk/src/agents/tools/browser-tool.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/tools/browser-tool.schema.d.ts +75 -0
- package/dist/plugin-sdk/src/agents/tools/canvas-tool.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/tools/common.d.ts +81 -0
- package/dist/plugin-sdk/src/agents/tools/cron-tool.d.ts +11 -0
- package/dist/plugin-sdk/src/agents/tools/gateway-tool.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/tools/gateway.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/tools/image-generate-tool.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/tools/image-tool.d.ts +35 -0
- package/dist/plugin-sdk/src/agents/tools/image-tool.helpers.d.ts +19 -0
- package/dist/plugin-sdk/src/agents/tools/media-tool-shared.d.ts +47 -0
- package/dist/plugin-sdk/src/agents/tools/memory-tool.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/tools/message-tool.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/tools/model-config.helpers.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/tools/nodes-tool.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/tools/nodes-utils.d.ts +14 -0
- package/dist/plugin-sdk/src/agents/tools/pdf-native-providers.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/tools/pdf-tool.d.ts +23 -0
- package/dist/plugin-sdk/src/agents/tools/pdf-tool.helpers.d.ts +27 -0
- package/dist/plugin-sdk/src/agents/tools/session-status-tool.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-access.d.ts +42 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-announce-target.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-helpers.d.ts +73 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-history-tool.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-list-tool.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-resolution.d.ts +79 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-send-helpers.d.ts +34 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-send-tool.a2a.d.ts +12 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-send-tool.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-spawn-tool.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/tools/sessions-yield-tool.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/tools/subagents-tool.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/tools/tool-runtime.helpers.d.ts +9 -0
- package/dist/plugin-sdk/src/agents/tools/tts-tool.d.ts +7 -0
- package/dist/plugin-sdk/src/agents/tools/web-fetch-utils.d.ts +25 -0
- package/dist/plugin-sdk/src/agents/tools/web-fetch-visibility.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/tools/web-fetch.d.ts +39 -0
- package/dist/plugin-sdk/src/agents/tools/web-guarded-fetch.d.ts +16 -0
- package/dist/plugin-sdk/src/agents/tools/web-search-citation-redirect.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/tools/web-search-provider-common.d.ts +41 -0
- package/dist/plugin-sdk/src/agents/tools/web-search-provider-config.d.ts +21 -0
- package/dist/plugin-sdk/src/agents/tools/web-search-provider-credentials.d.ts +5 -0
- package/dist/plugin-sdk/src/agents/tools/web-search.d.ts +13 -0
- package/dist/plugin-sdk/src/agents/tools/web-shared.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/tools/web-tools.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/trace-base.d.ts +10 -0
- package/dist/plugin-sdk/src/agents/transcript-policy.d.ts +24 -0
- package/dist/plugin-sdk/src/agents/usage.d.ts +65 -0
- package/dist/plugin-sdk/src/agents/venice-models.d.ts +369 -0
- package/dist/plugin-sdk/src/agents/vercel-ai-gateway.d.ts +15 -0
- package/dist/plugin-sdk/src/agents/vllm-defaults.d.ts +4 -0
- package/dist/plugin-sdk/src/agents/volc-models.shared.d.ts +62 -0
- package/dist/plugin-sdk/src/agents/workspace-dir.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/workspace-dirs.d.ts +2 -0
- package/dist/plugin-sdk/src/agents/workspace-run.d.ts +18 -0
- package/dist/plugin-sdk/src/agents/workspace-templates.d.ts +6 -0
- package/dist/plugin-sdk/src/agents/workspace.d.ts +45 -0
- package/dist/plugin-sdk/src/auto-reply/chunk.d.ts +45 -0
- package/dist/plugin-sdk/src/auto-reply/command-auth.d.ts +17 -0
- package/dist/plugin-sdk/src/auto-reply/command-detection.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/commands-args.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/commands-registry.d.ts +54 -0
- package/dist/plugin-sdk/src/auto-reply/commands-registry.data.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/commands-registry.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/commands-registry.types.d.ts +67 -0
- package/dist/plugin-sdk/src/auto-reply/commands-text-routing.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/dispatch.d.ts +32 -0
- package/dist/plugin-sdk/src/auto-reply/envelope.d.ts +60 -0
- package/dist/plugin-sdk/src/auto-reply/fallback-state.d.ts +55 -0
- package/dist/plugin-sdk/src/auto-reply/group-activation.d.ts +6 -0
- package/dist/plugin-sdk/src/auto-reply/heartbeat-reply-payload.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/heartbeat.d.ts +26 -0
- package/dist/plugin-sdk/src/auto-reply/inbound-debounce.d.ts +18 -0
- package/dist/plugin-sdk/src/auto-reply/media-note.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/model-runtime.d.ts +17 -0
- package/dist/plugin-sdk/src/auto-reply/model.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/reply/abort-cutoff.d.ts +22 -0
- package/dist/plugin-sdk/src/auto-reply/reply/abort-cutoff.runtime.d.ts +7 -0
- package/dist/plugin-sdk/src/auto-reply/reply/abort-primitives.d.ts +7 -0
- package/dist/plugin-sdk/src/auto-reply/reply/abort.d.ts +26 -0
- package/dist/plugin-sdk/src/auto-reply/reply/acp-projector.d.ts +21 -0
- package/dist/plugin-sdk/src/auto-reply/reply/acp-reset-target.d.ts +12 -0
- package/dist/plugin-sdk/src/auto-reply/reply/acp-stream-settings.d.ts +24 -0
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-execution.d.ts +59 -0
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-helpers.d.ts +15 -0
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-memory.d.ts +30 -0
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-payloads.d.ts +28 -0
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-reminder-guard.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-utils.d.ts +214 -0
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner.d.ts +38 -0
- package/dist/plugin-sdk/src/auto-reply/reply/auto-topic-label-config.d.ts +14 -0
- package/dist/plugin-sdk/src/auto-reply/reply/auto-topic-label.d.ts +26 -0
- package/dist/plugin-sdk/src/auto-reply/reply/bash-command.d.ts +19 -0
- package/dist/plugin-sdk/src/auto-reply/reply/block-reply-coalescer.d.ts +15 -0
- package/dist/plugin-sdk/src/auto-reply/reply/block-reply-pipeline.d.ts +32 -0
- package/dist/plugin-sdk/src/auto-reply/reply/block-streaming.d.ts +38 -0
- package/dist/plugin-sdk/src/auto-reply/reply/body.d.ts +10 -0
- package/dist/plugin-sdk/src/auto-reply/reply/btw-command.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/channel-context.d.ts +23 -0
- package/dist/plugin-sdk/src/auto-reply/reply/command-gates.d.ts +24 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/context.d.ts +14 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/diagnostics.d.ts +4 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/install-hints.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/lifecycle.d.ts +5 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/runtime-options.d.ts +9 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/shared.d.ts +95 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/targets.d.ts +12 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-allowlist.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-approve.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-bash.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-btw.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-compact.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-config.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-context-report.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-context.d.ts +12 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-core.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-core.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-export-session.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-info.d.ts +11 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-mcp.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-models.d.ts +34 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-plugin.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-plugins.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-session-abort.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-session-store.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-session.d.ts +9 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-setunset-standard.d.ts +10 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-setunset.d.ts +34 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-slash-parse.d.ts +24 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-status.d.ts +27 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-status.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-agents.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-focus.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-help.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-info.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-kill.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-list.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-log.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-send.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-spawn.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-unfocus.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/shared.d.ts +87 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents.d.ts +4 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-system-prompt.d.ts +14 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-tts.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands-types.d.ts +70 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands.d.ts +4 -0
- package/dist/plugin-sdk/src/auto-reply/reply/commands.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply/config-commands.d.ts +15 -0
- package/dist/plugin-sdk/src/auto-reply/reply/config-value.d.ts +4 -0
- package/dist/plugin-sdk/src/auto-reply/reply/config-write-authorization.d.ts +11 -0
- package/dist/plugin-sdk/src/auto-reply/reply/debug-commands.d.ts +16 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.auth-profile.d.ts +10 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.auth.d.ts +11 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.d.ts +7 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.defaults.d.ts +10 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.fast-lane.d.ts +7 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.impl.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.levels.d.ts +26 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.model-picker.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.model-selection.d.ts +23 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.model.d.ts +44 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.params.d.ts +52 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.parse.d.ts +65 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.persist.d.ts +29 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.persist.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.queue-validation.d.ts +10 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.shared.d.ts +28 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directive-parsing.d.ts +5 -0
- package/dist/plugin-sdk/src/auto-reply/reply/directives.d.ts +44 -0
- package/dist/plugin-sdk/src/auto-reply/reply/discord-parent-channel.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply/dispatch-acp-delivery.d.ts +29 -0
- package/dist/plugin-sdk/src/auto-reply/reply/dispatch-acp.d.ts +32 -0
- package/dist/plugin-sdk/src/auto-reply/reply/dispatch-from-config.d.ts +16 -0
- package/dist/plugin-sdk/src/auto-reply/reply/dispatcher-registry.d.ts +24 -0
- package/dist/plugin-sdk/src/auto-reply/reply/elevated-allowlist-matcher.d.ts +20 -0
- package/dist/plugin-sdk/src/auto-reply/reply/elevated-unavailable.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/reply/exec/directive.d.ts +20 -0
- package/dist/plugin-sdk/src/auto-reply/reply/exec.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply/followup-runner.d.ts +16 -0
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-directives-apply.d.ts +67 -0
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-directives-utils.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-directives.d.ts +93 -0
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-inline-actions.d.ts +62 -0
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-run.d.ts +69 -0
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply.d.ts +7 -0
- package/dist/plugin-sdk/src/auto-reply/reply/groups.d.ts +26 -0
- package/dist/plugin-sdk/src/auto-reply/reply/history.d.ts +72 -0
- package/dist/plugin-sdk/src/auto-reply/reply/inbound-context.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/reply/inbound-dedupe.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/reply/inbound-meta.d.ts +4 -0
- package/dist/plugin-sdk/src/auto-reply/reply/inbound-text.d.ts +5 -0
- package/dist/plugin-sdk/src/auto-reply/reply/line-directives.d.ts +22 -0
- package/dist/plugin-sdk/src/auto-reply/reply/matrix-context.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/mcp-commands.d.ts +15 -0
- package/dist/plugin-sdk/src/auto-reply/reply/memory-flush.d.ts +63 -0
- package/dist/plugin-sdk/src/auto-reply/reply/mentions.d.ts +19 -0
- package/dist/plugin-sdk/src/auto-reply/reply/message-preprocess-hooks.d.ts +7 -0
- package/dist/plugin-sdk/src/auto-reply/reply/model-selection.d.ts +67 -0
- package/dist/plugin-sdk/src/auto-reply/reply/normalize-reply.d.ts +14 -0
- package/dist/plugin-sdk/src/auto-reply/reply/origin-routing.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/plugins-commands.d.ts +16 -0
- package/dist/plugin-sdk/src/auto-reply/reply/post-compaction-context.d.ts +15 -0
- package/dist/plugin-sdk/src/auto-reply/reply/provider-dispatcher.d.ts +19 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/cleanup.d.ts +6 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/directive.d.ts +15 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/drain.d.ts +5 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/enqueue.d.ts +4 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/normalize.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/settings.d.ts +2 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/state.d.ts +20 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue/types.d.ts +87 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue-policy.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/reply/queue.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-delivery.d.ts +28 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-directives.d.ts +14 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-dispatcher.d.ts +57 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-elevated.d.ts +16 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-inline-whitespace.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-inline.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-media-paths.d.ts +7 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-payloads.d.ts +28 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-reference.d.ts +20 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-tags.d.ts +6 -0
- package/dist/plugin-sdk/src/auto-reply/reply/reply-threading.d.ts +9 -0
- package/dist/plugin-sdk/src/auto-reply/reply/response-prefix-template.d.ts +51 -0
- package/dist/plugin-sdk/src/auto-reply/reply/route-reply.d.ts +60 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-delivery.d.ts +30 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-fork.d.ts +11 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-fork.runtime.d.ts +9 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-hooks.d.ts +32 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-reset-model.d.ts +25 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-reset-prompt.d.ts +9 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-run-accounting.d.ts +12 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-updates.d.ts +35 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session-usage.d.ts +23 -0
- package/dist/plugin-sdk/src/auto-reply/reply/session.d.ts +26 -0
- package/dist/plugin-sdk/src/auto-reply/reply/slack-directives.d.ts +3 -0
- package/dist/plugin-sdk/src/auto-reply/reply/stage-sandbox-media.d.ts +9 -0
- package/dist/plugin-sdk/src/auto-reply/reply/streaming-directives.d.ts +10 -0
- package/dist/plugin-sdk/src/auto-reply/reply/strip-inbound-meta.d.ts +31 -0
- package/dist/plugin-sdk/src/auto-reply/reply/subagents-utils.d.ts +27 -0
- package/dist/plugin-sdk/src/auto-reply/reply/telegram-context.d.ts +12 -0
- package/dist/plugin-sdk/src/auto-reply/reply/typing-mode.d.ts +30 -0
- package/dist/plugin-sdk/src/auto-reply/reply/typing-policy.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/reply/typing.d.ts +18 -0
- package/dist/plugin-sdk/src/auto-reply/reply/untrusted-context.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/reply.d.ts +6 -0
- package/dist/plugin-sdk/src/auto-reply/send-policy.d.ts +6 -0
- package/dist/plugin-sdk/src/auto-reply/skill-commands-base.d.ts +9 -0
- package/dist/plugin-sdk/src/auto-reply/skill-commands.d.ts +16 -0
- package/dist/plugin-sdk/src/auto-reply/skill-commands.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/auto-reply/status.d.ts +61 -0
- package/dist/plugin-sdk/src/auto-reply/templating.d.ts +190 -0
- package/dist/plugin-sdk/src/auto-reply/thinking.d.ts +13 -0
- package/dist/plugin-sdk/src/auto-reply/thinking.shared.d.ts +33 -0
- package/dist/plugin-sdk/src/auto-reply/tokens.d.ts +10 -0
- package/dist/plugin-sdk/src/auto-reply/tool-meta.d.ts +8 -0
- package/dist/plugin-sdk/src/auto-reply/types.d.ts +95 -0
- package/dist/plugin-sdk/src/bindings/records.d.ts +10 -0
- package/dist/plugin-sdk/src/browser/bridge-auth-registry.d.ts +8 -0
- package/dist/plugin-sdk/src/browser/bridge-server.d.ts +24 -0
- package/dist/plugin-sdk/src/browser/cdp-proxy-bypass.d.ts +31 -0
- package/dist/plugin-sdk/src/browser/cdp-timeouts.d.ts +26 -0
- package/dist/plugin-sdk/src/browser/cdp.d.ts +125 -0
- package/dist/plugin-sdk/src/browser/cdp.helpers.d.ts +29 -0
- package/dist/plugin-sdk/src/browser/chrome-mcp.d.ts +127 -0
- package/dist/plugin-sdk/src/browser/chrome-mcp.snapshot.d.ts +26 -0
- package/dist/plugin-sdk/src/browser/chrome.d.ts +21 -0
- package/dist/plugin-sdk/src/browser/chrome.executables.d.ts +15 -0
- package/dist/plugin-sdk/src/browser/chrome.profile-decoration.d.ts +10 -0
- package/dist/plugin-sdk/src/browser/client-actions-core.d.ts +159 -0
- package/dist/plugin-sdk/src/browser/client-actions-observe.d.ts +68 -0
- package/dist/plugin-sdk/src/browser/client-actions-state.d.ts +93 -0
- package/dist/plugin-sdk/src/browser/client-actions-types.d.ts +18 -0
- package/dist/plugin-sdk/src/browser/client-actions-url.d.ts +2 -0
- package/dist/plugin-sdk/src/browser/client-actions.d.ts +4 -0
- package/dist/plugin-sdk/src/browser/client-fetch.d.ts +21 -0
- package/dist/plugin-sdk/src/browser/client.d.ts +157 -0
- package/dist/plugin-sdk/src/browser/config.d.ts +46 -0
- package/dist/plugin-sdk/src/browser/constants.d.ts +8 -0
- package/dist/plugin-sdk/src/browser/control-auth.d.ts +13 -0
- package/dist/plugin-sdk/src/browser/control-service.d.ts +5 -0
- package/dist/plugin-sdk/src/browser/csrf.d.ts +8 -0
- package/dist/plugin-sdk/src/browser/errors.d.ts +35 -0
- package/dist/plugin-sdk/src/browser/form-fields.d.ts +8 -0
- package/dist/plugin-sdk/src/browser/http-auth.d.ts +5 -0
- package/dist/plugin-sdk/src/browser/navigation-guard.d.ts +30 -0
- package/dist/plugin-sdk/src/browser/output-atomic.d.ts +5 -0
- package/dist/plugin-sdk/src/browser/paths.d.ts +61 -0
- package/dist/plugin-sdk/src/browser/profile-capabilities.d.ts +30 -0
- package/dist/plugin-sdk/src/browser/profiles-service.d.ts +28 -0
- package/dist/plugin-sdk/src/browser/profiles.d.ts +30 -0
- package/dist/plugin-sdk/src/browser/proxy-files.d.ts +7 -0
- package/dist/plugin-sdk/src/browser/pw-ai-module.d.ts +6 -0
- package/dist/plugin-sdk/src/browser/pw-ai-state.d.ts +2 -0
- package/dist/plugin-sdk/src/browser/pw-ai.d.ts +2 -0
- package/dist/plugin-sdk/src/browser/pw-role-snapshot.d.ts +35 -0
- package/dist/plugin-sdk/src/browser/pw-session.d.ts +164 -0
- package/dist/plugin-sdk/src/browser/pw-session.page-cdp.d.ts +9 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.activity.d.ts +21 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.d.ts +8 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.downloads.d.ts +34 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.interactions.d.ts +135 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.responses.d.ts +13 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.shared.d.ts +10 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.snapshot.d.ts +66 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.state.d.ts +46 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.storage.d.ts +47 -0
- package/dist/plugin-sdk/src/browser/pw-tools-core.trace.d.ts +12 -0
- package/dist/plugin-sdk/src/browser/resolved-config-refresh.d.ts +12 -0
- package/dist/plugin-sdk/src/browser/routes/agent.act.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/agent.act.download.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/agent.act.hooks.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/agent.act.shared.d.ts +10 -0
- package/dist/plugin-sdk/src/browser/routes/agent.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/agent.debug.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/agent.shared.d.ts +37 -0
- package/dist/plugin-sdk/src/browser/routes/agent.snapshot.d.ts +12 -0
- package/dist/plugin-sdk/src/browser/routes/agent.snapshot.plan.d.ts +22 -0
- package/dist/plugin-sdk/src/browser/routes/agent.storage.d.ts +14 -0
- package/dist/plugin-sdk/src/browser/routes/basic.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/dispatcher.d.ts +16 -0
- package/dist/plugin-sdk/src/browser/routes/index.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/output-paths.d.ts +10 -0
- package/dist/plugin-sdk/src/browser/routes/path-output.d.ts +1 -0
- package/dist/plugin-sdk/src/browser/routes/tabs.d.ts +3 -0
- package/dist/plugin-sdk/src/browser/routes/types.d.ts +20 -0
- package/dist/plugin-sdk/src/browser/routes/utils.d.ts +15 -0
- package/dist/plugin-sdk/src/browser/runtime-lifecycle.d.ts +15 -0
- package/dist/plugin-sdk/src/browser/safe-filename.d.ts +1 -0
- package/dist/plugin-sdk/src/browser/screenshot.d.ts +9 -0
- package/dist/plugin-sdk/src/browser/server-context.availability.d.ts +19 -0
- package/dist/plugin-sdk/src/browser/server-context.constants.d.ts +7 -0
- package/dist/plugin-sdk/src/browser/server-context.d.ts +4 -0
- package/dist/plugin-sdk/src/browser/server-context.reset.d.ts +20 -0
- package/dist/plugin-sdk/src/browser/server-context.selection.d.ts +16 -0
- package/dist/plugin-sdk/src/browser/server-context.tab-ops.d.ts +13 -0
- package/dist/plugin-sdk/src/browser/server-context.types.d.ts +74 -0
- package/dist/plugin-sdk/src/browser/server-lifecycle.d.ts +10 -0
- package/dist/plugin-sdk/src/browser/server-middleware.d.ts +6 -0
- package/dist/plugin-sdk/src/browser/session-tab-registry.d.ts +30 -0
- package/dist/plugin-sdk/src/browser/snapshot-roles.d.ts +11 -0
- package/dist/plugin-sdk/src/browser/target-id.d.ts +11 -0
- package/dist/plugin-sdk/src/browser/trash.d.ts +1 -0
- package/dist/plugin-sdk/src/browser/url-pattern.d.ts +1 -0
- package/dist/plugin-sdk/src/bundled-web-search-registry.d.ts +10 -0
- package/dist/plugin-sdk/src/channel-web.d.ts +5 -0
- package/dist/plugin-sdk/src/channels/account-snapshot-fields.d.ts +10 -0
- package/dist/plugin-sdk/src/channels/account-summary.d.ts +28 -0
- package/dist/plugin-sdk/src/channels/ack-reactions.d.ts +29 -0
- package/dist/plugin-sdk/src/channels/allow-from.d.ts +16 -0
- package/dist/plugin-sdk/src/channels/allowlist-match.d.ts +42 -0
- package/dist/plugin-sdk/src/channels/allowlists/resolve-utils.d.ts +34 -0
- package/dist/plugin-sdk/src/channels/channel-config.d.ts +39 -0
- package/dist/plugin-sdk/src/channels/chat-type.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/command-gating.d.ts +32 -0
- package/dist/plugin-sdk/src/channels/config-presence.d.ts +4 -0
- package/dist/plugin-sdk/src/channels/conversation-label.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/draft-stream-controls.d.ts +54 -0
- package/dist/plugin-sdk/src/channels/draft-stream-loop.d.ts +13 -0
- package/dist/plugin-sdk/src/channels/ids.d.ts +3 -0
- package/dist/plugin-sdk/src/channels/inbound-debounce-policy.d.ts +18 -0
- package/dist/plugin-sdk/src/channels/location.d.ts +21 -0
- package/dist/plugin-sdk/src/channels/logging.d.ts +20 -0
- package/dist/plugin-sdk/src/channels/mention-gating.d.ts +27 -0
- package/dist/plugin-sdk/src/channels/model-overrides.d.ts +18 -0
- package/dist/plugin-sdk/src/channels/native-command-session-targets.d.ts +12 -0
- package/dist/plugin-sdk/src/channels/plugins/account-action-gate.d.ts +5 -0
- package/dist/plugin-sdk/src/channels/plugins/account-helpers.d.ts +8 -0
- package/dist/plugin-sdk/src/channels/plugins/acp-configured-binding-consumer.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/acp-stateful-target-driver.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/actions/reaction-message-id.d.ts +8 -0
- package/dist/plugin-sdk/src/channels/plugins/actions/shared.d.ts +7 -0
- package/dist/plugin-sdk/src/channels/plugins/allowlist-match.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/binding-provider.d.ts +5 -0
- package/dist/plugin-sdk/src/channels/plugins/binding-registry.d.ts +6 -0
- package/dist/plugin-sdk/src/channels/plugins/binding-routing.d.ts +32 -0
- package/dist/plugin-sdk/src/channels/plugins/binding-targets.d.ts +33 -0
- package/dist/plugin-sdk/src/channels/plugins/binding-types.d.ts +40 -0
- package/dist/plugin-sdk/src/channels/plugins/bluebubbles-actions.d.ts +48 -0
- package/dist/plugin-sdk/src/channels/plugins/channel-config.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/config-helpers.d.ts +25 -0
- package/dist/plugin-sdk/src/channels/plugins/config-schema.d.ts +20 -0
- package/dist/plugin-sdk/src/channels/plugins/config-writes.d.ts +56 -0
- package/dist/plugin-sdk/src/channels/plugins/configured-binding-builtins.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/configured-binding-compiler.d.ts +11 -0
- package/dist/plugin-sdk/src/channels/plugins/configured-binding-consumers.d.ts +32 -0
- package/dist/plugin-sdk/src/channels/plugins/configured-binding-match.d.ts +23 -0
- package/dist/plugin-sdk/src/channels/plugins/configured-binding-registry.d.ts +28 -0
- package/dist/plugin-sdk/src/channels/plugins/configured-binding-session-lookup.d.ts +6 -0
- package/dist/plugin-sdk/src/channels/plugins/directory-adapters.d.ts +9 -0
- package/dist/plugin-sdk/src/channels/plugins/directory-config-helpers.d.ts +69 -0
- package/dist/plugin-sdk/src/channels/plugins/directory-types.d.ts +7 -0
- package/dist/plugin-sdk/src/channels/plugins/exec-approval-local.d.ts +8 -0
- package/dist/plugin-sdk/src/channels/plugins/group-policy-warnings.d.ts +126 -0
- package/dist/plugin-sdk/src/channels/plugins/helpers.d.ts +24 -0
- package/dist/plugin-sdk/src/channels/plugins/index.d.ts +4 -0
- package/dist/plugin-sdk/src/channels/plugins/media-limits.d.ts +9 -0
- package/dist/plugin-sdk/src/channels/plugins/media-payload.d.ts +15 -0
- package/dist/plugin-sdk/src/channels/plugins/message-action-discovery.d.ts +77 -0
- package/dist/plugin-sdk/src/channels/plugins/message-action-dispatch.d.ts +3 -0
- package/dist/plugin-sdk/src/channels/plugins/message-action-names.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/message-capabilities.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/normalize/imessage.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/normalize/shared.d.ts +6 -0
- package/dist/plugin-sdk/src/channels/plugins/normalize/signal.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/normalize/slack.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/normalize/whatsapp.d.ts +3 -0
- package/dist/plugin-sdk/src/channels/plugins/outbound/direct-text-media.d.ts +39 -0
- package/dist/plugin-sdk/src/channels/plugins/outbound/interactive.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/outbound/load.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/pairing-adapters.d.ts +13 -0
- package/dist/plugin-sdk/src/channels/plugins/pairing-message.d.ts +1 -0
- package/dist/plugin-sdk/src/channels/plugins/pairing.d.ts +16 -0
- package/dist/plugin-sdk/src/channels/plugins/registry-loader.d.ts +5 -0
- package/dist/plugin-sdk/src/channels/plugins/registry.d.ts +4 -0
- package/dist/plugin-sdk/src/channels/plugins/runtime-forwarders.d.ts +26 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-group-access-configure.d.ts +22 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-group-access.d.ts +32 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-helpers.d.ts +81 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-wizard-binary.d.ts +34 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-wizard-helpers.d.ts +441 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-wizard-proxy.d.ts +48 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-wizard-types.d.ts +107 -0
- package/dist/plugin-sdk/src/channels/plugins/setup-wizard.d.ts +267 -0
- package/dist/plugin-sdk/src/channels/plugins/stateful-target-builtins.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/stateful-target-drivers.d.ts +54 -0
- package/dist/plugin-sdk/src/channels/plugins/status-issues/bluebubbles.d.ts +2 -0
- package/dist/plugin-sdk/src/channels/plugins/status-issues/shared.d.ts +29 -0
- package/dist/plugin-sdk/src/channels/plugins/target-parsing.d.ts +7 -0
- package/dist/plugin-sdk/src/channels/plugins/target-resolvers.d.ts +12 -0
- package/dist/plugin-sdk/src/channels/plugins/threading-helpers.d.ts +12 -0
- package/dist/plugin-sdk/src/channels/plugins/types.adapters.d.ts +557 -0
- package/dist/plugin-sdk/src/channels/plugins/types.core.d.ts +522 -0
- package/dist/plugin-sdk/src/channels/plugins/types.d.ts +8 -0
- package/dist/plugin-sdk/src/channels/plugins/types.plugin.d.ts +58 -0
- package/dist/plugin-sdk/src/channels/plugins/whatsapp-heartbeat.d.ts +11 -0
- package/dist/plugin-sdk/src/channels/plugins/whatsapp-shared.d.ts +21 -0
- package/dist/plugin-sdk/src/channels/read-only-account-inspect.d.ts +12 -0
- package/dist/plugin-sdk/src/channels/read-only-account-inspect.discord.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/channels/read-only-account-inspect.slack.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/channels/read-only-account-inspect.telegram.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/channels/registry.d.ts +15 -0
- package/dist/plugin-sdk/src/channels/reply-prefix.d.ts +25 -0
- package/dist/plugin-sdk/src/channels/run-state-machine.d.ts +19 -0
- package/dist/plugin-sdk/src/channels/sender-label.d.ts +9 -0
- package/dist/plugin-sdk/src/channels/session-envelope.d.ts +10 -0
- package/dist/plugin-sdk/src/channels/session-meta.d.ts +9 -0
- package/dist/plugin-sdk/src/channels/session.d.ts +26 -0
- package/dist/plugin-sdk/src/channels/status-reactions.d.ts +66 -0
- package/dist/plugin-sdk/src/channels/targets.d.ts +57 -0
- package/dist/plugin-sdk/src/channels/thread-binding-id.d.ts +4 -0
- package/dist/plugin-sdk/src/channels/thread-bindings-messages.d.ts +19 -0
- package/dist/plugin-sdk/src/channels/thread-bindings-policy.d.ts +68 -0
- package/dist/plugin-sdk/src/channels/transport/stall-watchdog.d.ts +20 -0
- package/dist/plugin-sdk/src/channels/typing-lifecycle.d.ts +12 -0
- package/dist/plugin-sdk/src/channels/typing-start-guard.d.ts +13 -0
- package/dist/plugin-sdk/src/channels/typing.d.ts +18 -0
- package/dist/plugin-sdk/src/cli/argv.d.ts +27 -0
- package/dist/plugin-sdk/src/cli/cli-name.d.ts +3 -0
- package/dist/plugin-sdk/src/cli/cli-utils.d.ts +19 -0
- package/dist/plugin-sdk/src/cli/command-format.d.ts +1 -0
- package/dist/plugin-sdk/src/cli/command-secret-gateway.d.ts +19 -0
- package/dist/plugin-sdk/src/cli/command-secret-targets.d.ts +16 -0
- package/dist/plugin-sdk/src/cli/deps.d.ts +11 -0
- package/dist/plugin-sdk/src/cli/help-format.d.ts +5 -0
- package/dist/plugin-sdk/src/cli/memory-cli.d.ts +12 -0
- package/dist/plugin-sdk/src/cli/message-secret-scope.d.ts +11 -0
- package/dist/plugin-sdk/src/cli/nodes-camera.d.ts +51 -0
- package/dist/plugin-sdk/src/cli/nodes-canvas.d.ts +10 -0
- package/dist/plugin-sdk/src/cli/nodes-media-utils.d.ts +13 -0
- package/dist/plugin-sdk/src/cli/nodes-run.d.ts +3 -0
- package/dist/plugin-sdk/src/cli/nodes-screen.d.ts +18 -0
- package/dist/plugin-sdk/src/cli/outbound-send-deps.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/outbound-send-mapping.d.ts +13 -0
- package/dist/plugin-sdk/src/cli/parse-bytes.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/parse-duration.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/parse-timeout.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/profile-utils.d.ts +2 -0
- package/dist/plugin-sdk/src/cli/progress.d.ts +24 -0
- package/dist/plugin-sdk/src/cli/prompt.d.ts +1 -0
- package/dist/plugin-sdk/src/cli/send-runtime/discord.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/send-runtime/imessage.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/send-runtime/signal.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/send-runtime/slack.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/send-runtime/telegram.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/send-runtime/whatsapp.d.ts +4 -0
- package/dist/plugin-sdk/src/cli/wait.d.ts +1 -0
- package/dist/plugin-sdk/src/commands/backup-shared.d.ts +32 -0
- package/dist/plugin-sdk/src/commands/chutes-oauth.d.ts +21 -0
- package/dist/plugin-sdk/src/commands/cleanup-utils.d.ts +36 -0
- package/dist/plugin-sdk/src/commands/daemon-runtime.d.ts +8 -0
- package/dist/plugin-sdk/src/commands/health.d.ts +63 -0
- package/dist/plugin-sdk/src/commands/models/shared.d.ts +58 -0
- package/dist/plugin-sdk/src/commands/onboard-types.d.ts +92 -0
- package/dist/plugin-sdk/src/compat/legacy-names.d.ts +8 -0
- package/dist/plugin-sdk/src/config/agent-dirs.d.ts +14 -0
- package/dist/plugin-sdk/src/config/agent-limits.d.ts +6 -0
- package/dist/plugin-sdk/src/config/allowed-values.d.ts +7 -0
- package/dist/plugin-sdk/src/config/backup-rotation.d.ts +32 -0
- package/dist/plugin-sdk/src/config/bindings.d.ts +8 -0
- package/dist/plugin-sdk/src/config/byte-size.d.ts +6 -0
- package/dist/plugin-sdk/src/config/cache-utils.d.ts +10 -0
- package/dist/plugin-sdk/src/config/channel-capabilities.d.ts +6 -0
- package/dist/plugin-sdk/src/config/channel-configured.d.ts +2 -0
- package/dist/plugin-sdk/src/config/commands.d.ts +25 -0
- package/dist/plugin-sdk/src/config/config-paths.d.ts +10 -0
- package/dist/plugin-sdk/src/config/config.d.ts +6 -0
- package/dist/plugin-sdk/src/config/dangerous-name-matching.d.ts +12 -0
- package/dist/plugin-sdk/src/config/defaults.d.ts +18 -0
- package/dist/plugin-sdk/src/config/discord-preview-streaming.d.ts +27 -0
- package/dist/plugin-sdk/src/config/env-preserve.d.ts +10 -0
- package/dist/plugin-sdk/src/config/env-substitution.d.ts +45 -0
- package/dist/plugin-sdk/src/config/env-vars.d.ts +7 -0
- package/dist/plugin-sdk/src/config/gateway-control-ui-origins.d.ts +21 -0
- package/dist/plugin-sdk/src/config/group-policy.d.ts +49 -0
- package/dist/plugin-sdk/src/config/includes.d.ts +43 -0
- package/dist/plugin-sdk/src/config/io.d.ts +79 -0
- package/dist/plugin-sdk/src/config/issue-format.d.ts +14 -0
- package/dist/plugin-sdk/src/config/legacy-migrate.d.ts +5 -0
- package/dist/plugin-sdk/src/config/legacy-web-search.d.ts +8 -0
- package/dist/plugin-sdk/src/config/legacy.d.ts +6 -0
- package/dist/plugin-sdk/src/config/legacy.migrations.d.ts +1 -0
- package/dist/plugin-sdk/src/config/legacy.migrations.part-1.d.ts +2 -0
- package/dist/plugin-sdk/src/config/legacy.migrations.part-2.d.ts +2 -0
- package/dist/plugin-sdk/src/config/legacy.migrations.part-3.d.ts +2 -0
- package/dist/plugin-sdk/src/config/legacy.rules.d.ts +2 -0
- package/dist/plugin-sdk/src/config/legacy.shared.d.ts +20 -0
- package/dist/plugin-sdk/src/config/logging.d.ts +8 -0
- package/dist/plugin-sdk/src/config/markdown-tables.d.ts +8 -0
- package/dist/plugin-sdk/src/config/mcp-config.d.ts +33 -0
- package/dist/plugin-sdk/src/config/merge-patch.d.ts +5 -0
- package/dist/plugin-sdk/src/config/model-input.d.ts +9 -0
- package/dist/plugin-sdk/src/config/normalize-exec-safe-bin.d.ts +2 -0
- package/dist/plugin-sdk/src/config/normalize-paths.d.ts +8 -0
- package/dist/plugin-sdk/src/config/paths.d.ts +57 -0
- package/dist/plugin-sdk/src/config/plugin-auto-enable.d.ts +14 -0
- package/dist/plugin-sdk/src/config/plugins-allowlist.d.ts +2 -0
- package/dist/plugin-sdk/src/config/port-defaults.d.ts +13 -0
- package/dist/plugin-sdk/src/config/prototype-keys.d.ts +1 -0
- package/dist/plugin-sdk/src/config/runtime-group-policy.d.ts +56 -0
- package/dist/plugin-sdk/src/config/runtime-overrides.d.ts +15 -0
- package/dist/plugin-sdk/src/config/sessions/artifacts.d.ts +5 -0
- package/dist/plugin-sdk/src/config/sessions/delivery-info.d.ts +16 -0
- package/dist/plugin-sdk/src/config/sessions/disk-budget.d.ts +28 -0
- package/dist/plugin-sdk/src/config/sessions/explicit-session-key-normalization.d.ts +2 -0
- package/dist/plugin-sdk/src/config/sessions/group.d.ts +11 -0
- package/dist/plugin-sdk/src/config/sessions/main-session.d.ts +42 -0
- package/dist/plugin-sdk/src/config/sessions/main-session.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/config/sessions/metadata.d.ts +16 -0
- package/dist/plugin-sdk/src/config/sessions/paths.d.ts +23 -0
- package/dist/plugin-sdk/src/config/sessions/reset.d.ts +43 -0
- package/dist/plugin-sdk/src/config/sessions/session-file.d.ts +15 -0
- package/dist/plugin-sdk/src/config/sessions/session-key.d.ts +8 -0
- package/dist/plugin-sdk/src/config/sessions/store-cache.d.ts +19 -0
- package/dist/plugin-sdk/src/config/sessions/store-maintenance.d.ts +62 -0
- package/dist/plugin-sdk/src/config/sessions/store-migrations.d.ts +2 -0
- package/dist/plugin-sdk/src/config/sessions/store-summary.d.ts +6 -0
- package/dist/plugin-sdk/src/config/sessions/store.d.ts +91 -0
- package/dist/plugin-sdk/src/config/sessions/store.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/config/sessions/targets.d.ts +19 -0
- package/dist/plugin-sdk/src/config/sessions/transcript.d.ts +33 -0
- package/dist/plugin-sdk/src/config/sessions/types.d.ts +259 -0
- package/dist/plugin-sdk/src/config/sessions.d.ts +15 -0
- package/dist/plugin-sdk/src/config/talk.d.ts +18 -0
- package/dist/plugin-sdk/src/config/telegram-custom-commands.d.ts +24 -0
- package/dist/plugin-sdk/src/config/types.acp.d.ts +44 -0
- package/dist/plugin-sdk/src/config/types.agent-defaults.d.ts +354 -0
- package/dist/plugin-sdk/src/config/types.agents-shared.d.ts +33 -0
- package/dist/plugin-sdk/src/config/types.agents.d.ts +94 -0
- package/dist/plugin-sdk/src/config/types.approvals.d.ts +26 -0
- package/dist/plugin-sdk/src/config/types.auth.d.ts +28 -0
- package/dist/plugin-sdk/src/config/types.base.d.ts +216 -0
- package/dist/plugin-sdk/src/config/types.browser.d.ts +71 -0
- package/dist/plugin-sdk/src/config/types.channel-messaging-common.d.ts +46 -0
- package/dist/plugin-sdk/src/config/types.channels.d.ts +63 -0
- package/dist/plugin-sdk/src/config/types.cli.d.ts +12 -0
- package/dist/plugin-sdk/src/config/types.cron.d.ts +55 -0
- package/dist/plugin-sdk/src/config/types.d.ts +34 -0
- package/dist/plugin-sdk/src/config/types.discord.d.ts +345 -0
- package/dist/plugin-sdk/src/config/types.gateway.d.ts +416 -0
- package/dist/plugin-sdk/src/config/types.googlechat.d.ts +115 -0
- package/dist/plugin-sdk/src/config/types.hooks.d.ts +123 -0
- package/dist/plugin-sdk/src/config/types.imessage.d.ts +81 -0
- package/dist/plugin-sdk/src/config/types.installs.d.ts +14 -0
- package/dist/plugin-sdk/src/config/types.irc.d.ts +56 -0
- package/dist/plugin-sdk/src/config/types.mcp.d.ts +13 -0
- package/dist/plugin-sdk/src/config/types.memory.d.ts +59 -0
- package/dist/plugin-sdk/src/config/types.messages.d.ts +163 -0
- package/dist/plugin-sdk/src/config/types.models.d.ts +57 -0
- package/dist/plugin-sdk/src/config/types.msteams.d.ts +111 -0
- package/dist/plugin-sdk/src/config/types.node-host.d.ts +10 -0
- package/dist/plugin-sdk/src/config/types.openclaw.d.ts +141 -0
- package/dist/plugin-sdk/src/config/types.plugins.d.ts +46 -0
- package/dist/plugin-sdk/src/config/types.queue.d.ts +14 -0
- package/dist/plugin-sdk/src/config/types.sandbox.d.ts +122 -0
- package/dist/plugin-sdk/src/config/types.secrets.d.ts +90 -0
- package/dist/plugin-sdk/src/config/types.signal.d.ts +58 -0
- package/dist/plugin-sdk/src/config/types.skills.d.ts +42 -0
- package/dist/plugin-sdk/src/config/types.slack.d.ts +190 -0
- package/dist/plugin-sdk/src/config/types.telegram.d.ts +271 -0
- package/dist/plugin-sdk/src/config/types.tools.d.ts +567 -0
- package/dist/plugin-sdk/src/config/types.tts.d.ts +97 -0
- package/dist/plugin-sdk/src/config/types.whatsapp.d.ts +105 -0
- package/dist/plugin-sdk/src/config/validation.d.ts +35 -0
- package/dist/plugin-sdk/src/config/version.d.ts +8 -0
- package/dist/plugin-sdk/src/config/zod-schema.agent-defaults.d.ts +387 -0
- package/dist/plugin-sdk/src/config/zod-schema.agent-model.d.ts +5 -0
- package/dist/plugin-sdk/src/config/zod-schema.agent-runtime.d.ts +1571 -0
- package/dist/plugin-sdk/src/config/zod-schema.agents.d.ts +803 -0
- package/dist/plugin-sdk/src/config/zod-schema.allowdeny.d.ts +13 -0
- package/dist/plugin-sdk/src/config/zod-schema.approvals.d.ts +15 -0
- package/dist/plugin-sdk/src/config/zod-schema.channels.d.ts +9 -0
- package/dist/plugin-sdk/src/config/zod-schema.core.d.ts +979 -0
- package/dist/plugin-sdk/src/config/zod-schema.d.ts +5313 -0
- package/dist/plugin-sdk/src/config/zod-schema.hooks.d.ts +85 -0
- package/dist/plugin-sdk/src/config/zod-schema.installs.d.ts +34 -0
- package/dist/plugin-sdk/src/config/zod-schema.providers-core.d.ts +4992 -0
- package/dist/plugin-sdk/src/config/zod-schema.providers-whatsapp.d.ts +245 -0
- package/dist/plugin-sdk/src/config/zod-schema.providers.d.ts +2923 -0
- package/dist/plugin-sdk/src/config/zod-schema.secret-input-validation.d.ts +24 -0
- package/dist/plugin-sdk/src/config/zod-schema.sensitive.d.ts +2 -0
- package/dist/plugin-sdk/src/config/zod-schema.session.d.ts +277 -0
- package/dist/plugin-sdk/src/context-engine/delegate.d.ts +15 -0
- package/dist/plugin-sdk/src/context-engine/index.d.ts +6 -0
- package/dist/plugin-sdk/src/context-engine/init.d.ts +1 -0
- package/dist/plugin-sdk/src/context-engine/legacy.d.ts +50 -0
- package/dist/plugin-sdk/src/context-engine/registry.d.ts +47 -0
- package/dist/plugin-sdk/src/context-engine/types.d.ts +206 -0
- package/dist/plugin-sdk/src/cron/delivery.d.ts +32 -0
- package/dist/plugin-sdk/src/cron/isolated-agent/delivery-target.d.ts +26 -0
- package/dist/plugin-sdk/src/cron/legacy-delivery.d.ts +15 -0
- package/dist/plugin-sdk/src/cron/normalize.d.ts +13 -0
- package/dist/plugin-sdk/src/cron/parse.d.ts +1 -0
- package/dist/plugin-sdk/src/cron/payload-migration.d.ts +3 -0
- package/dist/plugin-sdk/src/cron/schedule.d.ts +6 -0
- package/dist/plugin-sdk/src/cron/service/initial-delivery.d.ts +3 -0
- package/dist/plugin-sdk/src/cron/service/jobs.d.ts +32 -0
- package/dist/plugin-sdk/src/cron/service/locked.d.ts +2 -0
- package/dist/plugin-sdk/src/cron/service/normalize.d.ts +18 -0
- package/dist/plugin-sdk/src/cron/service/ops.d.ts +84 -0
- package/dist/plugin-sdk/src/cron/service/state.d.ts +158 -0
- package/dist/plugin-sdk/src/cron/service/store.d.ts +11 -0
- package/dist/plugin-sdk/src/cron/service/timeout-policy.d.ts +13 -0
- package/dist/plugin-sdk/src/cron/service/timer.d.ts +45 -0
- package/dist/plugin-sdk/src/cron/service.d.ts +69 -0
- package/dist/plugin-sdk/src/cron/session-reaper.d.ts +35 -0
- package/dist/plugin-sdk/src/cron/stagger.d.ts +8 -0
- package/dist/plugin-sdk/src/cron/store-migration.d.ts +9 -0
- package/dist/plugin-sdk/src/cron/store.d.ts +10 -0
- package/dist/plugin-sdk/src/cron/types-shared.d.ts +17 -0
- package/dist/plugin-sdk/src/cron/types.d.ts +142 -0
- package/dist/plugin-sdk/src/cron/webhook-url.d.ts +1 -0
- package/dist/plugin-sdk/src/daemon/arg-split.d.ts +4 -0
- package/dist/plugin-sdk/src/daemon/cmd-argv.d.ts +3 -0
- package/dist/plugin-sdk/src/daemon/cmd-set.d.ts +7 -0
- package/dist/plugin-sdk/src/daemon/constants.d.ts +35 -0
- package/dist/plugin-sdk/src/daemon/runtime-binary.d.ts +2 -0
- package/dist/plugin-sdk/src/gateway/auth-mode-policy.d.ts +4 -0
- package/dist/plugin-sdk/src/gateway/auth-rate-limit.d.ts +67 -0
- package/dist/plugin-sdk/src/gateway/auth.d.ts +62 -0
- package/dist/plugin-sdk/src/gateway/call.d.ts +88 -0
- package/dist/plugin-sdk/src/gateway/channel-status-patches.d.ts +6 -0
- package/dist/plugin-sdk/src/gateway/chat-abort.d.ts +46 -0
- package/dist/plugin-sdk/src/gateway/chat-sanitize.d.ts +4 -0
- package/dist/plugin-sdk/src/gateway/client.d.ts +83 -0
- package/dist/plugin-sdk/src/gateway/connection-auth.d.ts +28 -0
- package/dist/plugin-sdk/src/gateway/credential-planner.d.ts +53 -0
- package/dist/plugin-sdk/src/gateway/credentials.d.ts +52 -0
- package/dist/plugin-sdk/src/gateway/device-auth.d.ts +18 -0
- package/dist/plugin-sdk/src/gateway/device-metadata-normalization.d.ts +2 -0
- package/dist/plugin-sdk/src/gateway/exec-approval-manager.d.ts +47 -0
- package/dist/plugin-sdk/src/gateway/method-scopes.d.ts +22 -0
- package/dist/plugin-sdk/src/gateway/model-pricing-cache.d.ts +32 -0
- package/dist/plugin-sdk/src/gateway/net.d.ts +88 -0
- package/dist/plugin-sdk/src/gateway/node-registry.d.ts +60 -0
- package/dist/plugin-sdk/src/gateway/operator-approvals-client.d.ts +6 -0
- package/dist/plugin-sdk/src/gateway/protocol/client-info.d.ts +58 -0
- package/dist/plugin-sdk/src/gateway/protocol/connect-error-details.d.ts +38 -0
- package/dist/plugin-sdk/src/gateway/protocol/index.d.ts +874 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/agent.d.ts +119 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/agents-models-skills.d.ts +206 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/channels.d.ts +229 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/config.d.ts +110 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/cron.d.ts +455 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/devices.d.ts +42 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/error-codes.d.ts +14 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/exec-approvals.d.ts +184 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/frames.d.ts +169 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/logs-chat.d.ts +53 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/nodes.d.ts +111 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/primitives.d.ts +40 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/protocol-schemas.d.ts +1601 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/push.d.ts +16 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/secrets.d.ts +23 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/sessions.d.ts +112 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/snapshot.d.ts +69 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/types.d.ts +137 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema/wizard.d.ts +86 -0
- package/dist/plugin-sdk/src/gateway/protocol/schema.d.ts +18 -0
- package/dist/plugin-sdk/src/gateway/resolve-configured-secret-input-string.d.ts +33 -0
- package/dist/plugin-sdk/src/gateway/security-path.d.ts +20 -0
- package/dist/plugin-sdk/src/gateway/server/ws-types.d.ts +12 -0
- package/dist/plugin-sdk/src/gateway/server-broadcast.d.ts +17 -0
- package/dist/plugin-sdk/src/gateway/server-channels.d.ts +66 -0
- package/dist/plugin-sdk/src/gateway/server-constants.d.ts +11 -0
- package/dist/plugin-sdk/src/gateway/server-methods/types.d.ts +102 -0
- package/dist/plugin-sdk/src/gateway/server-shared.d.ts +7 -0
- package/dist/plugin-sdk/src/gateway/session-archive.fs.d.ts +20 -0
- package/dist/plugin-sdk/src/gateway/session-utils.d.ts +108 -0
- package/dist/plugin-sdk/src/gateway/session-utils.fs.d.ts +33 -0
- package/dist/plugin-sdk/src/gateway/session-utils.types.d.ts +76 -0
- package/dist/plugin-sdk/src/gateway/startup-auth.d.ts +20 -0
- package/dist/plugin-sdk/src/gateway/ws-log.d.ts +5 -0
- package/dist/plugin-sdk/src/gateway/ws-logging.d.ts +4 -0
- package/dist/plugin-sdk/src/globals.d.ts +11 -0
- package/dist/plugin-sdk/src/hooks/fire-and-forget.d.ts +1 -0
- package/dist/plugin-sdk/src/hooks/internal-hooks.d.ts +216 -0
- package/dist/plugin-sdk/src/hooks/message-hook-mappers.d.ts +76 -0
- package/dist/plugin-sdk/src/hooks/types.d.ts +62 -0
- package/dist/plugin-sdk/src/image-generation/provider-registry.d.ts +4 -0
- package/dist/plugin-sdk/src/image-generation/providers/fal.d.ts +2 -0
- package/dist/plugin-sdk/src/image-generation/providers/google.d.ts +2 -0
- package/dist/plugin-sdk/src/image-generation/providers/openai.d.ts +2 -0
- package/dist/plugin-sdk/src/image-generation/runtime.d.ts +27 -0
- package/dist/plugin-sdk/src/image-generation/types.d.ts +64 -0
- package/dist/plugin-sdk/src/infra/abort-signal.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/agent-events.d.ts +24 -0
- package/dist/plugin-sdk/src/infra/archive-path.d.ts +12 -0
- package/dist/plugin-sdk/src/infra/archive-staging.d.ts +24 -0
- package/dist/plugin-sdk/src/infra/archive.d.ts +53 -0
- package/dist/plugin-sdk/src/infra/backoff.d.ts +8 -0
- package/dist/plugin-sdk/src/infra/backup-create.d.ts +29 -0
- package/dist/plugin-sdk/src/infra/binaries.d.ts +3 -0
- package/dist/plugin-sdk/src/infra/boundary-file-read.d.ts +34 -0
- package/dist/plugin-sdk/src/infra/boundary-path.d.ts +38 -0
- package/dist/plugin-sdk/src/infra/brew.d.ts +8 -0
- package/dist/plugin-sdk/src/infra/channel-activity.d.ts +18 -0
- package/dist/plugin-sdk/src/infra/channel-summary.d.ts +7 -0
- package/dist/plugin-sdk/src/infra/cli-root-options.d.ts +3 -0
- package/dist/plugin-sdk/src/infra/dedupe.d.ts +13 -0
- package/dist/plugin-sdk/src/infra/device-auth-store.d.ts +18 -0
- package/dist/plugin-sdk/src/infra/device-bootstrap.d.ts +41 -0
- package/dist/plugin-sdk/src/infra/device-identity.d.ts +11 -0
- package/dist/plugin-sdk/src/infra/device-pairing.d.ts +126 -0
- package/dist/plugin-sdk/src/infra/diagnostic-events.d.ts +140 -0
- package/dist/plugin-sdk/src/infra/diagnostic-flags.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/dotenv.d.ts +3 -0
- package/dist/plugin-sdk/src/infra/env.d.ts +11 -0
- package/dist/plugin-sdk/src/infra/errors.d.ts +13 -0
- package/dist/plugin-sdk/src/infra/exec-allowlist-pattern.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/exec-approval-command-display.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/exec-approval-reply.d.ts +31 -0
- package/dist/plugin-sdk/src/infra/exec-approval-session-target.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/exec-approval-surface.d.ts +20 -0
- package/dist/plugin-sdk/src/infra/exec-approvals-allowlist.d.ts +64 -0
- package/dist/plugin-sdk/src/infra/exec-approvals-analysis.d.ts +79 -0
- package/dist/plugin-sdk/src/infra/exec-approvals.d.ts +147 -0
- package/dist/plugin-sdk/src/infra/exec-command-resolution.d.ts +46 -0
- package/dist/plugin-sdk/src/infra/exec-obfuscation-detect.d.ts +12 -0
- package/dist/plugin-sdk/src/infra/exec-safe-bin-policy-profiles.d.ts +24 -0
- package/dist/plugin-sdk/src/infra/exec-safe-bin-policy-validator.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/exec-safe-bin-policy.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/exec-safe-bin-runtime-policy.d.ts +25 -0
- package/dist/plugin-sdk/src/infra/exec-safe-bin-trust.d.ts +23 -0
- package/dist/plugin-sdk/src/infra/exec-safety.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/exec-wrapper-resolution.d.ts +48 -0
- package/dist/plugin-sdk/src/infra/executable-path.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/fetch.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/file-identity.d.ts +5 -0
- package/dist/plugin-sdk/src/infra/file-lock.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/format-time/format-datetime.d.ts +35 -0
- package/dist/plugin-sdk/src/infra/format-time/format-duration.d.ts +23 -0
- package/dist/plugin-sdk/src/infra/format-time/format-relative.d.ts +39 -0
- package/dist/plugin-sdk/src/infra/fs-pinned-write-helper.d.ts +18 -0
- package/dist/plugin-sdk/src/infra/fs-safe.d.ts +87 -0
- package/dist/plugin-sdk/src/infra/gemini-auth.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/git-commit.d.ts +14 -0
- package/dist/plugin-sdk/src/infra/git-root.d.ts +7 -0
- package/dist/plugin-sdk/src/infra/hardlink-guards.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/heartbeat-events.d.ts +22 -0
- package/dist/plugin-sdk/src/infra/heartbeat-reason.d.ts +5 -0
- package/dist/plugin-sdk/src/infra/heartbeat-summary.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/heartbeat-visibility.d.ts +17 -0
- package/dist/plugin-sdk/src/infra/heartbeat-wake.d.ts +33 -0
- package/dist/plugin-sdk/src/infra/home-dir.d.ts +17 -0
- package/dist/plugin-sdk/src/infra/host-env-security.d.ts +40 -0
- package/dist/plugin-sdk/src/infra/http-body.d.ts +46 -0
- package/dist/plugin-sdk/src/infra/json-file.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/json-files.d.ts +12 -0
- package/dist/plugin-sdk/src/infra/json-utf8-bytes.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/jsonl-socket.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/machine-name.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/map-size.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/matrix-legacy-crypto.d.ts +41 -0
- package/dist/plugin-sdk/src/infra/matrix-legacy-state.d.ts +30 -0
- package/dist/plugin-sdk/src/infra/matrix-migration-config.d.ts +48 -0
- package/dist/plugin-sdk/src/infra/matrix-migration-snapshot.d.ts +25 -0
- package/dist/plugin-sdk/src/infra/matrix-plugin-helper.d.ts +29 -0
- package/dist/plugin-sdk/src/infra/net/fetch-guard.d.ts +37 -0
- package/dist/plugin-sdk/src/infra/net/hostname.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/net/proxy-env.d.ts +10 -0
- package/dist/plugin-sdk/src/infra/net/proxy-fetch.d.ts +15 -0
- package/dist/plugin-sdk/src/infra/net/ssrf.d.ts +55 -0
- package/dist/plugin-sdk/src/infra/net/undici-global-dispatcher.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/node-pairing.d.ts +53 -0
- package/dist/plugin-sdk/src/infra/node-shell.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/npm-registry-spec.d.ts +19 -0
- package/dist/plugin-sdk/src/infra/openclaw-exec-env.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/openclaw-root.d.ts +10 -0
- package/dist/plugin-sdk/src/infra/outbound/abort.d.ts +8 -0
- package/dist/plugin-sdk/src/infra/outbound/agent-delivery.d.ts +46 -0
- package/dist/plugin-sdk/src/infra/outbound/base-session-key.d.ts +9 -0
- package/dist/plugin-sdk/src/infra/outbound/bound-delivery-router.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/outbound/channel-adapters.d.ts +14 -0
- package/dist/plugin-sdk/src/infra/outbound/channel-resolution.d.ts +8 -0
- package/dist/plugin-sdk/src/infra/outbound/channel-selection.d.ts +17 -0
- package/dist/plugin-sdk/src/infra/outbound/channel-target.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/outbound/conversation-id.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/outbound/deliver-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/outbound/deliver.d.ts +49 -0
- package/dist/plugin-sdk/src/infra/outbound/delivery-queue.d.ts +89 -0
- package/dist/plugin-sdk/src/infra/outbound/directory-cache.d.ts +24 -0
- package/dist/plugin-sdk/src/infra/outbound/envelope.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/outbound/format.d.ts +39 -0
- package/dist/plugin-sdk/src/infra/outbound/identity.d.ts +9 -0
- package/dist/plugin-sdk/src/infra/outbound/message-action-normalization.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/outbound/message-action-params.d.ts +36 -0
- package/dist/plugin-sdk/src/infra/outbound/message-action-runner.d.ts +76 -0
- package/dist/plugin-sdk/src/infra/outbound/message-action-spec.d.ts +7 -0
- package/dist/plugin-sdk/src/infra/outbound/message.d.ts +84 -0
- package/dist/plugin-sdk/src/infra/outbound/mirror.d.ts +13 -0
- package/dist/plugin-sdk/src/infra/outbound/outbound-policy.d.ts +32 -0
- package/dist/plugin-sdk/src/infra/outbound/outbound-send-service.d.ts +65 -0
- package/dist/plugin-sdk/src/infra/outbound/outbound-session.d.ts +31 -0
- package/dist/plugin-sdk/src/infra/outbound/payloads.d.ts +23 -0
- package/dist/plugin-sdk/src/infra/outbound/sanitize-text.d.ts +23 -0
- package/dist/plugin-sdk/src/infra/outbound/send-deps.d.ts +30 -0
- package/dist/plugin-sdk/src/infra/outbound/session-binding-service.d.ts +90 -0
- package/dist/plugin-sdk/src/infra/outbound/session-context.d.ts +12 -0
- package/dist/plugin-sdk/src/infra/outbound/target-errors.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/outbound/target-normalization.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/outbound/target-resolver.d.ts +60 -0
- package/dist/plugin-sdk/src/infra/outbound/targets.d.ts +87 -0
- package/dist/plugin-sdk/src/infra/outbound/thread-id.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/outbound/tool-payload.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/pairing-files.d.ts +23 -0
- package/dist/plugin-sdk/src/infra/pairing-pending.d.ts +13 -0
- package/dist/plugin-sdk/src/infra/pairing-token.d.ts +3 -0
- package/dist/plugin-sdk/src/infra/parse-finite-number.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/path-alias-guards.d.ts +18 -0
- package/dist/plugin-sdk/src/infra/path-guards.d.ts +6 -0
- package/dist/plugin-sdk/src/infra/path-prepend.d.ts +11 -0
- package/dist/plugin-sdk/src/infra/path-safety.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/plain-object.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/ports-format.d.ts +5 -0
- package/dist/plugin-sdk/src/infra/ports-inspect.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/ports-lsof.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/ports-probe.d.ts +5 -0
- package/dist/plugin-sdk/src/infra/ports-types.d.ts +18 -0
- package/dist/plugin-sdk/src/infra/ports.d.ts +14 -0
- package/dist/plugin-sdk/src/infra/prototype-keys.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/provider-usage.auth.d.ts +14 -0
- package/dist/plugin-sdk/src/infra/provider-usage.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.claude.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.codex.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.d.ts +5 -0
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.gemini.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.minimax.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.shared.d.ts +12 -0
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.zai.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/provider-usage.format.d.ts +13 -0
- package/dist/plugin-sdk/src/infra/provider-usage.load.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/provider-usage.shared.d.ts +9 -0
- package/dist/plugin-sdk/src/infra/provider-usage.types.d.ts +17 -0
- package/dist/plugin-sdk/src/infra/restart-sentinel.d.ts +50 -0
- package/dist/plugin-sdk/src/infra/restart-stale-pids.d.ts +22 -0
- package/dist/plugin-sdk/src/infra/restart.d.ts +72 -0
- package/dist/plugin-sdk/src/infra/retry-policy.d.ts +30 -0
- package/dist/plugin-sdk/src/infra/retry.d.ts +21 -0
- package/dist/plugin-sdk/src/infra/safe-open-sync.d.ts +25 -0
- package/dist/plugin-sdk/src/infra/scp-host.d.ts +4 -0
- package/dist/plugin-sdk/src/infra/secret-file.d.ts +18 -0
- package/dist/plugin-sdk/src/infra/secure-random.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/session-cost-usage.d.ts +45 -0
- package/dist/plugin-sdk/src/infra/session-cost-usage.types.d.ts +141 -0
- package/dist/plugin-sdk/src/infra/session-maintenance-warning.d.ts +11 -0
- package/dist/plugin-sdk/src/infra/shell-env.d.ts +34 -0
- package/dist/plugin-sdk/src/infra/shell-inline-command.d.ts +8 -0
- package/dist/plugin-sdk/src/infra/skills-remote.d.ts +25 -0
- package/dist/plugin-sdk/src/infra/ssh-tunnel.d.ts +21 -0
- package/dist/plugin-sdk/src/infra/system-events.d.ts +18 -0
- package/dist/plugin-sdk/src/infra/system-message.d.ts +3 -0
- package/dist/plugin-sdk/src/infra/system-run-approval-binding.d.ts +49 -0
- package/dist/plugin-sdk/src/infra/system-run-approval-context.d.ts +45 -0
- package/dist/plugin-sdk/src/infra/system-run-command.d.ts +36 -0
- package/dist/plugin-sdk/src/infra/system-run-normalize.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/tailnet.d.ts +8 -0
- package/dist/plugin-sdk/src/infra/tailscale.d.ts +34 -0
- package/dist/plugin-sdk/src/infra/tls/fingerprint.d.ts +1 -0
- package/dist/plugin-sdk/src/infra/tls/gateway.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/tmp-openclaw-dir.d.ts +20 -0
- package/dist/plugin-sdk/src/infra/transport-ready.d.ts +16 -0
- package/dist/plugin-sdk/src/infra/unhandled-rejections.d.ts +15 -0
- package/dist/plugin-sdk/src/infra/warning-filter.d.ts +7 -0
- package/dist/plugin-sdk/src/infra/windows-task-restart.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/ws.d.ts +2 -0
- package/dist/plugin-sdk/src/infra/wsl.d.ts +12 -0
- package/dist/plugin-sdk/src/interactive/payload.d.ts +53 -0
- package/dist/plugin-sdk/src/line/accounts.d.ts +10 -0
- package/dist/plugin-sdk/src/line/actions.d.ts +22 -0
- package/dist/plugin-sdk/src/line/auto-reply-delivery.d.ts +38 -0
- package/dist/plugin-sdk/src/line/bot-access.d.ts +17 -0
- package/dist/plugin-sdk/src/line/bot-handlers.d.ts +23 -0
- package/dist/plugin-sdk/src/line/bot-message-context.d.ts +129 -0
- package/dist/plugin-sdk/src/line/bot.d.ts +24 -0
- package/dist/plugin-sdk/src/line/channel-access-token.d.ts +4 -0
- package/dist/plugin-sdk/src/line/config-schema.d.ts +65 -0
- package/dist/plugin-sdk/src/line/download.d.ts +7 -0
- package/dist/plugin-sdk/src/line/flex-templates/basic-cards.d.ts +46 -0
- package/dist/plugin-sdk/src/line/flex-templates/common.d.ts +2 -0
- package/dist/plugin-sdk/src/line/flex-templates/media-control-cards.d.ts +73 -0
- package/dist/plugin-sdk/src/line/flex-templates/message.d.ts +6 -0
- package/dist/plugin-sdk/src/line/flex-templates/schedule-cards.d.ts +55 -0
- package/dist/plugin-sdk/src/line/flex-templates/types.d.ts +19 -0
- package/dist/plugin-sdk/src/line/flex-templates.d.ts +5 -0
- package/dist/plugin-sdk/src/line/group-keys.d.ts +17 -0
- package/dist/plugin-sdk/src/line/markdown-to-line.d.ts +72 -0
- package/dist/plugin-sdk/src/line/monitor.d.ts +28 -0
- package/dist/plugin-sdk/src/line/probe.d.ts +2 -0
- package/dist/plugin-sdk/src/line/reply-chunks.d.ts +24 -0
- package/dist/plugin-sdk/src/line/send.d.ts +93 -0
- package/dist/plugin-sdk/src/line/signature.d.ts +1 -0
- package/dist/plugin-sdk/src/line/template-messages.d.ts +100 -0
- package/dist/plugin-sdk/src/line/types.d.ts +115 -0
- package/dist/plugin-sdk/src/line/webhook-node.d.ts +15 -0
- package/dist/plugin-sdk/src/line/webhook-utils.d.ts +2 -0
- package/dist/plugin-sdk/src/line/webhook.d.ts +19 -0
- package/dist/plugin-sdk/src/link-understanding/apply.d.ts +10 -0
- package/dist/plugin-sdk/src/link-understanding/apply.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/link-understanding/defaults.d.ts +2 -0
- package/dist/plugin-sdk/src/link-understanding/detect.d.ts +3 -0
- package/dist/plugin-sdk/src/link-understanding/format.d.ts +4 -0
- package/dist/plugin-sdk/src/link-understanding/runner.d.ts +11 -0
- package/dist/plugin-sdk/src/logger.d.ts +6 -0
- package/dist/plugin-sdk/src/logging/config.d.ts +4 -0
- package/dist/plugin-sdk/src/logging/console.d.ts +23 -0
- package/dist/plugin-sdk/src/logging/diagnostic-session-state.d.ts +30 -0
- package/dist/plugin-sdk/src/logging/diagnostic.d.ts +67 -0
- package/dist/plugin-sdk/src/logging/env-log-level.d.ts +2 -0
- package/dist/plugin-sdk/src/logging/levels.d.ts +5 -0
- package/dist/plugin-sdk/src/logging/logger.d.ts +48 -0
- package/dist/plugin-sdk/src/logging/node-require.d.ts +1 -0
- package/dist/plugin-sdk/src/logging/redact-bounded.d.ts +8 -0
- package/dist/plugin-sdk/src/logging/redact-identifier.d.ts +4 -0
- package/dist/plugin-sdk/src/logging/redact.d.ts +9 -0
- package/dist/plugin-sdk/src/logging/state.d.ts +19 -0
- package/dist/plugin-sdk/src/logging/subsystem.d.ts +18 -0
- package/dist/plugin-sdk/src/logging/timestamps.d.ts +2 -0
- package/dist/plugin-sdk/src/logging.d.ts +10 -0
- package/dist/plugin-sdk/src/markdown/code-spans.d.ts +10 -0
- package/dist/plugin-sdk/src/markdown/fences.d.ts +10 -0
- package/dist/plugin-sdk/src/markdown/frontmatter.d.ts +2 -0
- package/dist/plugin-sdk/src/markdown/ir.d.ts +32 -0
- package/dist/plugin-sdk/src/markdown/render.d.ts +18 -0
- package/dist/plugin-sdk/src/markdown/tables.d.ts +2 -0
- package/dist/plugin-sdk/src/markdown/whatsapp.d.ts +14 -0
- package/dist/plugin-sdk/src/media/audio-tags.d.ts +10 -0
- package/dist/plugin-sdk/src/media/audio.d.ts +19 -0
- package/dist/plugin-sdk/src/media/base64.d.ts +6 -0
- package/dist/plugin-sdk/src/media/constants.d.ts +7 -0
- package/dist/plugin-sdk/src/media/fetch.d.ts +34 -0
- package/dist/plugin-sdk/src/media/ffmpeg-exec.d.ts +11 -0
- package/dist/plugin-sdk/src/media/ffmpeg-limits.d.ts +4 -0
- package/dist/plugin-sdk/src/media/file-context.d.ts +7 -0
- package/dist/plugin-sdk/src/media/image-ops.d.ts +41 -0
- package/dist/plugin-sdk/src/media/inbound-path-policy.d.ts +18 -0
- package/dist/plugin-sdk/src/media/input-files.d.ts +99 -0
- package/dist/plugin-sdk/src/media/load-options.d.ts +12 -0
- package/dist/plugin-sdk/src/media/local-roots.d.ts +3 -0
- package/dist/plugin-sdk/src/media/mime.d.ts +16 -0
- package/dist/plugin-sdk/src/media/outbound-attachment.d.ts +6 -0
- package/dist/plugin-sdk/src/media/parse.d.ts +8 -0
- package/dist/plugin-sdk/src/media/pdf-extract.d.ts +17 -0
- package/dist/plugin-sdk/src/media/png-encode.d.ts +8 -0
- package/dist/plugin-sdk/src/media/read-response-with-limit.d.ts +8 -0
- package/dist/plugin-sdk/src/media/sniff-mime-from-base64.d.ts +1 -0
- package/dist/plugin-sdk/src/media/store.d.ts +37 -0
- package/dist/plugin-sdk/src/media/temp-files.d.ts +1 -0
- package/dist/plugin-sdk/src/media/web-media.d.ts +43 -0
- package/dist/plugin-sdk/src/media-understanding/apply.d.ts +19 -0
- package/dist/plugin-sdk/src/media-understanding/apply.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/media-understanding/attachments.cache.d.ts +37 -0
- package/dist/plugin-sdk/src/media-understanding/attachments.d.ts +3 -0
- package/dist/plugin-sdk/src/media-understanding/attachments.normalize.d.ts +8 -0
- package/dist/plugin-sdk/src/media-understanding/attachments.select.d.ts +7 -0
- package/dist/plugin-sdk/src/media-understanding/audio-preflight.d.ts +16 -0
- package/dist/plugin-sdk/src/media-understanding/audio-transcription-runner.d.ts +16 -0
- package/dist/plugin-sdk/src/media-understanding/concurrency.d.ts +1 -0
- package/dist/plugin-sdk/src/media-understanding/defaults.d.ts +20 -0
- package/dist/plugin-sdk/src/media-understanding/echo-transcript.d.ts +13 -0
- package/dist/plugin-sdk/src/media-understanding/errors.d.ts +6 -0
- package/dist/plugin-sdk/src/media-understanding/format.d.ts +7 -0
- package/dist/plugin-sdk/src/media-understanding/fs.d.ts +1 -0
- package/dist/plugin-sdk/src/media-understanding/output-extract.d.ts +2 -0
- package/dist/plugin-sdk/src/media-understanding/providers/deepgram/audio.d.ts +4 -0
- package/dist/plugin-sdk/src/media-understanding/providers/deepgram/index.d.ts +2 -0
- package/dist/plugin-sdk/src/media-understanding/providers/groq/index.d.ts +2 -0
- package/dist/plugin-sdk/src/media-understanding/providers/image-runtime.d.ts +2 -0
- package/dist/plugin-sdk/src/media-understanding/providers/image.d.ts +3 -0
- package/dist/plugin-sdk/src/media-understanding/providers/index.d.ts +5 -0
- package/dist/plugin-sdk/src/media-understanding/providers/openai-compatible-audio.d.ts +7 -0
- package/dist/plugin-sdk/src/media-understanding/providers/shared.d.ts +28 -0
- package/dist/plugin-sdk/src/media-understanding/resolve.d.ts +44 -0
- package/dist/plugin-sdk/src/media-understanding/runner.d.ts +39 -0
- package/dist/plugin-sdk/src/media-understanding/runner.entries.d.ts +33 -0
- package/dist/plugin-sdk/src/media-understanding/runtime.d.ts +52 -0
- package/dist/plugin-sdk/src/media-understanding/scope.d.ts +9 -0
- package/dist/plugin-sdk/src/media-understanding/transcribe-audio.d.ts +1 -0
- package/dist/plugin-sdk/src/media-understanding/types.d.ts +115 -0
- package/dist/plugin-sdk/src/media-understanding/video.d.ts +2 -0
- package/dist/plugin-sdk/src/memory/backend-config.d.ts +55 -0
- package/dist/plugin-sdk/src/memory/batch-embedding-common.d.ts +9 -0
- package/dist/plugin-sdk/src/memory/batch-error-utils.d.ts +15 -0
- package/dist/plugin-sdk/src/memory/batch-gemini.d.ts +46 -0
- package/dist/plugin-sdk/src/memory/batch-http.d.ts +8 -0
- package/dist/plugin-sdk/src/memory/batch-openai.d.ts +19 -0
- package/dist/plugin-sdk/src/memory/batch-output.d.ts +23 -0
- package/dist/plugin-sdk/src/memory/batch-provider-common.d.ts +9 -0
- package/dist/plugin-sdk/src/memory/batch-runner.d.ts +38 -0
- package/dist/plugin-sdk/src/memory/batch-status.d.ts +27 -0
- package/dist/plugin-sdk/src/memory/batch-upload.d.ts +6 -0
- package/dist/plugin-sdk/src/memory/batch-utils.d.ts +11 -0
- package/dist/plugin-sdk/src/memory/batch-voyage.d.ts +20 -0
- package/dist/plugin-sdk/src/memory/embedding-chunk-limits.d.ts +3 -0
- package/dist/plugin-sdk/src/memory/embedding-input-limits.d.ts +4 -0
- package/dist/plugin-sdk/src/memory/embedding-inputs.d.ts +17 -0
- package/dist/plugin-sdk/src/memory/embedding-model-limits.d.ts +2 -0
- package/dist/plugin-sdk/src/memory/embedding-vectors.d.ts +1 -0
- package/dist/plugin-sdk/src/memory/embeddings-debug.d.ts +1 -0
- package/dist/plugin-sdk/src/memory/embeddings-gemini.d.ts +63 -0
- package/dist/plugin-sdk/src/memory/embeddings-mistral.d.ts +15 -0
- package/dist/plugin-sdk/src/memory/embeddings-model-normalize.d.ts +5 -0
- package/dist/plugin-sdk/src/memory/embeddings-ollama.d.ts +14 -0
- package/dist/plugin-sdk/src/memory/embeddings-openai.d.ts +15 -0
- package/dist/plugin-sdk/src/memory/embeddings-remote-client.d.ts +12 -0
- package/dist/plugin-sdk/src/memory/embeddings-remote-fetch.d.ts +8 -0
- package/dist/plugin-sdk/src/memory/embeddings-remote-provider.d.ts +21 -0
- package/dist/plugin-sdk/src/memory/embeddings-voyage.d.ts +15 -0
- package/dist/plugin-sdk/src/memory/embeddings.d.ts +58 -0
- package/dist/plugin-sdk/src/memory/fs-utils.d.ts +11 -0
- package/dist/plugin-sdk/src/memory/hybrid.d.ts +45 -0
- package/dist/plugin-sdk/src/memory/index.d.ts +3 -0
- package/dist/plugin-sdk/src/memory/internal.d.ts +51 -0
- package/dist/plugin-sdk/src/memory/manager-embedding-ops.d.ts +49 -0
- package/dist/plugin-sdk/src/memory/manager-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/memory/manager-search.d.ts +60 -0
- package/dist/plugin-sdk/src/memory/manager-sync-ops.d.ts +147 -0
- package/dist/plugin-sdk/src/memory/manager.d.ts +122 -0
- package/dist/plugin-sdk/src/memory/memory-schema.d.ts +11 -0
- package/dist/plugin-sdk/src/memory/mmr.d.ts +62 -0
- package/dist/plugin-sdk/src/memory/multimodal.d.ts +36 -0
- package/dist/plugin-sdk/src/memory/node-llama.d.ts +8 -0
- package/dist/plugin-sdk/src/memory/post-json.d.ts +10 -0
- package/dist/plugin-sdk/src/memory/prompt-section.d.ts +22 -0
- package/dist/plugin-sdk/src/memory/qmd-manager.d.ts +149 -0
- package/dist/plugin-sdk/src/memory/qmd-process.d.ts +24 -0
- package/dist/plugin-sdk/src/memory/qmd-query-parser.d.ts +9 -0
- package/dist/plugin-sdk/src/memory/qmd-scope.d.ts +4 -0
- package/dist/plugin-sdk/src/memory/query-expansion.d.ts +41 -0
- package/dist/plugin-sdk/src/memory/read-file.d.ts +21 -0
- package/dist/plugin-sdk/src/memory/remote-http.d.ts +9 -0
- package/dist/plugin-sdk/src/memory/search-manager.d.ts +12 -0
- package/dist/plugin-sdk/src/memory/secret-input.d.ts +5 -0
- package/dist/plugin-sdk/src/memory/session-files.d.ts +14 -0
- package/dist/plugin-sdk/src/memory/sqlite-vec.d.ts +9 -0
- package/dist/plugin-sdk/src/memory/sqlite.d.ts +1 -0
- package/dist/plugin-sdk/src/memory/temporal-decay.d.ts +25 -0
- package/dist/plugin-sdk/src/memory/types.d.ts +95 -0
- package/dist/plugin-sdk/src/node-host/with-timeout.d.ts +1 -0
- package/dist/plugin-sdk/src/pairing/pairing-challenge.d.ts +32 -0
- package/dist/plugin-sdk/src/pairing/pairing-labels.d.ts +2 -0
- package/dist/plugin-sdk/src/pairing/pairing-messages.d.ts +6 -0
- package/dist/plugin-sdk/src/pairing/pairing-store.d.ts +52 -0
- package/dist/plugin-sdk/src/param-key.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/account-helpers.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/account-id.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/account-resolution.d.ts +24 -0
- package/dist/plugin-sdk/src/plugin-sdk/acp-runtime.d.ts +7 -0
- package/dist/plugin-sdk/src/plugin-sdk/acpx.d.ts +8 -0
- package/dist/plugin-sdk/src/plugin-sdk/agent-media-payload.d.ts +13 -0
- package/dist/plugin-sdk/src/plugin-sdk/agent-runtime.d.ts +25 -0
- package/dist/plugin-sdk/src/plugin-sdk/allow-from.d.ts +58 -0
- package/dist/plugin-sdk/src/plugin-sdk/allowlist-config-edit.d.ts +99 -0
- package/dist/plugin-sdk/src/plugin-sdk/bluebubbles.d.ts +43 -0
- package/dist/plugin-sdk/src/plugin-sdk/boolean-param.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-actions.d.ts +5 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-config-helpers.d.ts +147 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-config-schema.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-contract.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-feedback.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-inbound.d.ts +11 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-lifecycle.d.ts +41 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-pairing.d.ts +21 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-plugin-common.d.ts +12 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-policy.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-reply-pipeline.d.ts +16 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-runtime.d.ts +11 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-send-result.d.ts +39 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-setup.d.ts +18 -0
- package/dist/plugin-sdk/src/plugin-sdk/channel-targets.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/cli-runtime.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/command-auth.d.ts +62 -0
- package/dist/plugin-sdk/src/plugin-sdk/compat.d.ts +17 -0
- package/dist/plugin-sdk/src/plugin-sdk/config-paths.d.ts +7 -0
- package/dist/plugin-sdk/src/plugin-sdk/config-runtime.d.ts +18 -0
- package/dist/plugin-sdk/src/plugin-sdk/conversation-runtime.d.ts +18 -0
- package/dist/plugin-sdk/src/plugin-sdk/copilot-proxy.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/core.d.ts +142 -0
- package/dist/plugin-sdk/src/plugin-sdk/device-bootstrap.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/diagnostics-otel.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/diffs.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/directory-runtime.d.ts +8 -0
- package/dist/plugin-sdk/src/plugin-sdk/discord-core.d.ts +10 -0
- package/dist/plugin-sdk/src/plugin-sdk/discord-send.d.ts +31 -0
- package/dist/plugin-sdk/src/plugin-sdk/discord.d.ts +33 -0
- package/dist/plugin-sdk/src/plugin-sdk/entrypoints.d.ts +17 -0
- package/dist/plugin-sdk/src/plugin-sdk/extension-shared.d.ts +67 -0
- package/dist/plugin-sdk/src/plugin-sdk/feishu.d.ts +42 -0
- package/dist/plugin-sdk/src/plugin-sdk/fetch-auth.d.ts +14 -0
- package/dist/plugin-sdk/src/plugin-sdk/file-lock.d.ts +18 -0
- package/dist/plugin-sdk/src/plugin-sdk/gateway-runtime.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/google.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/googlechat.d.ts +45 -0
- package/dist/plugin-sdk/src/plugin-sdk/group-access.d.ts +57 -0
- package/dist/plugin-sdk/src/plugin-sdk/hook-runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/image-generation-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/image-generation.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/imessage-core.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/imessage-targets.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/imessage.d.ts +14 -0
- package/dist/plugin-sdk/src/plugin-sdk/inbound-envelope.d.ts +97 -0
- package/dist/plugin-sdk/src/plugin-sdk/inbound-reply-dispatch.d.ts +73 -0
- package/dist/plugin-sdk/src/plugin-sdk/index.d.ts +25 -0
- package/dist/plugin-sdk/src/plugin-sdk/infra-runtime.d.ts +40 -0
- package/dist/plugin-sdk/src/plugin-sdk/interactive-runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/irc.d.ts +37 -0
- package/dist/plugin-sdk/src/plugin-sdk/json-store.d.ts +12 -0
- package/dist/plugin-sdk/src/plugin-sdk/keyed-async-queue.d.ts +16 -0
- package/dist/plugin-sdk/src/plugin-sdk/lazy-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/line-core.d.ts +11 -0
- package/dist/plugin-sdk/src/plugin-sdk/line.d.ts +15 -0
- package/dist/plugin-sdk/src/plugin-sdk/llm-task.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/lobster.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/matrix-runtime-heavy.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/matrix-runtime-shared.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/matrix.d.ts +65 -0
- package/dist/plugin-sdk/src/plugin-sdk/mattermost.d.ts +49 -0
- package/dist/plugin-sdk/src/plugin-sdk/media-runtime.d.ts +22 -0
- package/dist/plugin-sdk/src/plugin-sdk/media-understanding-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/media-understanding.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/memory-core.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/memory-lancedb.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/msteams.d.ts +57 -0
- package/dist/plugin-sdk/src/plugin-sdk/nextcloud-talk.d.ts +41 -0
- package/dist/plugin-sdk/src/plugin-sdk/nostr.d.ts +17 -0
- package/dist/plugin-sdk/src/plugin-sdk/oauth-utils.d.ts +7 -0
- package/dist/plugin-sdk/src/plugin-sdk/ollama-setup.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/open-prose.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/optional-channel-setup.d.ts +11 -0
- package/dist/plugin-sdk/src/plugin-sdk/outbound-media.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/outbound-runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/pairing-access.d.ts +19 -0
- package/dist/plugin-sdk/src/plugin-sdk/persistent-dedupe.d.ts +22 -0
- package/dist/plugin-sdk/src/plugin-sdk/phone-control.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/plugin-entry.d.ts +20 -0
- package/dist/plugin-sdk/src/plugin-sdk/plugin-runtime.d.ts +7 -0
- package/dist/plugin-sdk/src/plugin-sdk/process-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-auth-api-key.d.ts +7 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-auth-login.d.ts +27 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-auth-login.runtime.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-auth-result.d.ts +15 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-auth.d.ts +22 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-catalog.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-env-vars.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-google.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-models.d.ts +31 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-onboard.d.ts +5 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-setup.d.ts +5 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-stream.d.ts +7 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-tools.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-usage.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-web-search.d.ts +18 -0
- package/dist/plugin-sdk/src/plugin-sdk/provider-zai-endpoint.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/reply-history.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/reply-payload.d.ts +164 -0
- package/dist/plugin-sdk/src/plugin-sdk/reply-runtime.d.ts +20 -0
- package/dist/plugin-sdk/src/plugin-sdk/request-url.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/resolution-notes.d.ts +5 -0
- package/dist/plugin-sdk/src/plugin-sdk/routing.d.ts +8 -0
- package/dist/plugin-sdk/src/plugin-sdk/run-command.d.ts +13 -0
- package/dist/plugin-sdk/src/plugin-sdk/runtime-env.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/runtime-store.d.ts +8 -0
- package/dist/plugin-sdk/src/plugin-sdk/runtime.d.ts +28 -0
- package/dist/plugin-sdk/src/plugin-sdk/sandbox.d.ts +5 -0
- package/dist/plugin-sdk/src/plugin-sdk/secret-input-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/secret-input-schema.d.ts +15 -0
- package/dist/plugin-sdk/src/plugin-sdk/secret-input.d.ts +31 -0
- package/dist/plugin-sdk/src/plugin-sdk/security-runtime.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/self-hosted-provider-setup.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/setup-adapter-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/setup-runtime.d.ts +9 -0
- package/dist/plugin-sdk/src/plugin-sdk/setup-tools.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/setup.d.ts +21 -0
- package/dist/plugin-sdk/src/plugin-sdk/signal-core.d.ts +8 -0
- package/dist/plugin-sdk/src/plugin-sdk/signal.d.ts +23 -0
- package/dist/plugin-sdk/src/plugin-sdk/slack-core.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/slack-targets.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/slack.d.ts +26 -0
- package/dist/plugin-sdk/src/plugin-sdk/speech-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/speech.d.ts +5 -0
- package/dist/plugin-sdk/src/plugin-sdk/ssrf-policy.d.ts +20 -0
- package/dist/plugin-sdk/src/plugin-sdk/ssrf-runtime.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/state-paths.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/status-helpers.d.ts +145 -0
- package/dist/plugin-sdk/src/plugin-sdk/talk-voice.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/telegram-core.d.ts +8 -0
- package/dist/plugin-sdk/src/plugin-sdk/telegram.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/temp-path.d.ts +14 -0
- package/dist/plugin-sdk/src/plugin-sdk/test-utils.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/testing.d.ts +26 -0
- package/dist/plugin-sdk/src/plugin-sdk/text-chunking.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/text-runtime.d.ts +22 -0
- package/dist/plugin-sdk/src/plugin-sdk/thread-bindings-runtime.d.ts +2 -0
- package/dist/plugin-sdk/src/plugin-sdk/thread-ownership.d.ts +3 -0
- package/dist/plugin-sdk/src/plugin-sdk/tlon.d.ts +21 -0
- package/dist/plugin-sdk/src/plugin-sdk/tool-send.d.ts +7 -0
- package/dist/plugin-sdk/src/plugin-sdk/twitch.d.ts +18 -0
- package/dist/plugin-sdk/src/plugin-sdk/voice-call.d.ts +9 -0
- package/dist/plugin-sdk/src/plugin-sdk/web-media.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/webhook-ingress.d.ts +4 -0
- package/dist/plugin-sdk/src/plugin-sdk/webhook-memory-guards.d.ts +52 -0
- package/dist/plugin-sdk/src/plugin-sdk/webhook-path.d.ts +8 -0
- package/dist/plugin-sdk/src/plugin-sdk/webhook-request-guards.d.ts +89 -0
- package/dist/plugin-sdk/src/plugin-sdk/webhook-targets.d.ts +97 -0
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp-action-runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp-core.d.ts +10 -0
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp-login-qr.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp-shared.d.ts +6 -0
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp.d.ts +31 -0
- package/dist/plugin-sdk/src/plugin-sdk/windows-spawn.d.ts +44 -0
- package/dist/plugin-sdk/src/plugin-sdk/zai.d.ts +1 -0
- package/dist/plugin-sdk/src/plugin-sdk/zalo.d.ts +46 -0
- package/dist/plugin-sdk/src/plugin-sdk/zalouser.d.ts +39 -0
- package/dist/plugin-sdk/src/plugins/bundle-commands.d.ts +12 -0
- package/dist/plugin-sdk/src/plugins/bundle-lsp.d.ts +27 -0
- package/dist/plugin-sdk/src/plugins/bundle-manifest.d.ts +32 -0
- package/dist/plugin-sdk/src/plugins/bundle-mcp.d.ts +30 -0
- package/dist/plugin-sdk/src/plugins/bundled-compat.d.ts +9 -0
- package/dist/plugin-sdk/src/plugins/bundled-dir.d.ts +1 -0
- package/dist/plugin-sdk/src/plugins/bundled-provider-auth-env-vars.d.ts +1 -0
- package/dist/plugin-sdk/src/plugins/bundled-provider-auth-env-vars.generated.d.ts +40 -0
- package/dist/plugin-sdk/src/plugins/bundled-web-search-ids.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/bundled-web-search.d.ts +10 -0
- package/dist/plugin-sdk/src/plugins/captured-registration.d.ts +14 -0
- package/dist/plugin-sdk/src/plugins/commands.d.ts +111 -0
- package/dist/plugin-sdk/src/plugins/config-schema.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/config-state.d.ts +53 -0
- package/dist/plugin-sdk/src/plugins/conversation-binding.d.ts +89 -0
- package/dist/plugin-sdk/src/plugins/discovery.d.ts +30 -0
- package/dist/plugin-sdk/src/plugins/enable.d.ts +7 -0
- package/dist/plugin-sdk/src/plugins/hook-runner-global.d.ts +37 -0
- package/dist/plugin-sdk/src/plugins/hooks.d.ts +70 -0
- package/dist/plugin-sdk/src/plugins/http-path.d.ts +1 -0
- package/dist/plugin-sdk/src/plugins/http-registry.d.ts +16 -0
- package/dist/plugin-sdk/src/plugins/http-route-overlap.d.ts +11 -0
- package/dist/plugin-sdk/src/plugins/interactive-dispatch-adapters.d.ts +44 -0
- package/dist/plugin-sdk/src/plugins/interactive.d.ts +60 -0
- package/dist/plugin-sdk/src/plugins/loader.d.ts +47 -0
- package/dist/plugin-sdk/src/plugins/logger.d.ts +9 -0
- package/dist/plugin-sdk/src/plugins/manifest-registry.d.ts +49 -0
- package/dist/plugin-sdk/src/plugins/manifest.d.ts +119 -0
- package/dist/plugin-sdk/src/plugins/path-safety.d.ts +5 -0
- package/dist/plugin-sdk/src/plugins/provider-api-key-auth.d.ts +24 -0
- package/dist/plugin-sdk/src/plugins/provider-api-key-auth.runtime.d.ts +11 -0
- package/dist/plugin-sdk/src/plugins/provider-auth-helpers.d.ts +25 -0
- package/dist/plugin-sdk/src/plugins/provider-auth-input.d.ts +49 -0
- package/dist/plugin-sdk/src/plugins/provider-auth-mode.d.ts +14 -0
- package/dist/plugin-sdk/src/plugins/provider-auth-ref.d.ts +32 -0
- package/dist/plugin-sdk/src/plugins/provider-auth-token.d.ts +9 -0
- package/dist/plugin-sdk/src/plugins/provider-auth-types.d.ts +1 -0
- package/dist/plugin-sdk/src/plugins/provider-catalog-metadata.d.ts +6 -0
- package/dist/plugin-sdk/src/plugins/provider-catalog.d.ts +24 -0
- package/dist/plugin-sdk/src/plugins/provider-discovery.d.ts +37 -0
- package/dist/plugin-sdk/src/plugins/provider-model-allowlist.d.ts +6 -0
- package/dist/plugin-sdk/src/plugins/provider-model-defaults.d.ts +19 -0
- package/dist/plugin-sdk/src/plugins/provider-model-definitions.d.ts +107 -0
- package/dist/plugin-sdk/src/plugins/provider-model-helpers.d.ts +8 -0
- package/dist/plugin-sdk/src/plugins/provider-model-primary.d.ts +12 -0
- package/dist/plugin-sdk/src/plugins/provider-oauth-flow.d.ts +20 -0
- package/dist/plugin-sdk/src/plugins/provider-ollama-setup.d.ts +32 -0
- package/dist/plugin-sdk/src/plugins/provider-onboarding-config.d.ts +62 -0
- package/dist/plugin-sdk/src/plugins/provider-openai-codex-oauth-tls.d.ts +22 -0
- package/dist/plugin-sdk/src/plugins/provider-openai-codex-oauth.d.ts +10 -0
- package/dist/plugin-sdk/src/plugins/provider-runtime.d.ts +154 -0
- package/dist/plugin-sdk/src/plugins/provider-runtime.runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/plugins/provider-self-hosted-setup.d.ts +51 -0
- package/dist/plugin-sdk/src/plugins/provider-thinking.d.ts +9 -0
- package/dist/plugin-sdk/src/plugins/provider-validation.d.ts +7 -0
- package/dist/plugin-sdk/src/plugins/provider-vllm-setup.d.ts +21 -0
- package/dist/plugin-sdk/src/plugins/provider-zai-endpoint.d.ts +16 -0
- package/dist/plugin-sdk/src/plugins/providers.d.ts +40 -0
- package/dist/plugin-sdk/src/plugins/registry-empty.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/registry.d.ts +191 -0
- package/dist/plugin-sdk/src/plugins/roots.d.ts +18 -0
- package/dist/plugin-sdk/src/plugins/runtime/gateway-request-scope.d.ts +19 -0
- package/dist/plugin-sdk/src/plugins/runtime/index.d.ts +19 -0
- package/dist/plugin-sdk/src/plugins/runtime/native-deps.d.ts +8 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-agent.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-channel.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-config.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-discord-ops.runtime.d.ts +25 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-discord-typing.d.ts +15 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-discord.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-events.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-imessage.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-logging.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-matrix-boundary.d.ts +4 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-matrix.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-media.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-signal.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-slack-ops.runtime.d.ts +11 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-slack.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-system.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-telegram-contract.d.ts +41 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-telegram-ops.runtime.d.ts +20 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-telegram-typing.d.ts +18 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-telegram.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-tools.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-whatsapp-boundary.d.ts +35 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-whatsapp-login-tool.d.ts +1 -0
- package/dist/plugin-sdk/src/plugins/runtime/runtime-whatsapp.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/runtime/types-channel.d.ts +242 -0
- package/dist/plugin-sdk/src/plugins/runtime/types-core.d.ts +100 -0
- package/dist/plugin-sdk/src/plugins/runtime/types.d.ts +50 -0
- package/dist/plugin-sdk/src/plugins/runtime.d.ts +12 -0
- package/dist/plugin-sdk/src/plugins/schema-validator.d.ts +17 -0
- package/dist/plugin-sdk/src/plugins/sdk-alias.d.ts +47 -0
- package/dist/plugin-sdk/src/plugins/setup-binary.d.ts +1 -0
- package/dist/plugin-sdk/src/plugins/setup-browser.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/signal-cli-install.d.ts +30 -0
- package/dist/plugin-sdk/src/plugins/slots.d.ts +24 -0
- package/dist/plugin-sdk/src/plugins/status.d.ts +97 -0
- package/dist/plugin-sdk/src/plugins/toggle-config.d.ts +2 -0
- package/dist/plugin-sdk/src/plugins/tools.d.ts +16 -0
- package/dist/plugin-sdk/src/plugins/types.d.ts +1566 -0
- package/dist/plugin-sdk/src/plugins/web-search-providers.d.ts +9 -0
- package/dist/plugin-sdk/src/plugins/web-search-providers.runtime.d.ts +16 -0
- package/dist/plugin-sdk/src/plugins/web-search-providers.shared.d.ts +13 -0
- package/dist/plugin-sdk/src/poll-params.d.ts +42 -0
- package/dist/plugin-sdk/src/polls.d.ts +32 -0
- package/dist/plugin-sdk/src/process/command-queue.d.ts +63 -0
- package/dist/plugin-sdk/src/process/exec.d.ts +36 -0
- package/dist/plugin-sdk/src/process/kill-tree.d.ts +12 -0
- package/dist/plugin-sdk/src/process/lanes.d.ts +6 -0
- package/dist/plugin-sdk/src/process/spawn-utils.d.ts +26 -0
- package/dist/plugin-sdk/src/process/supervisor/adapters/child.d.ts +10 -0
- package/dist/plugin-sdk/src/process/supervisor/adapters/env.d.ts +1 -0
- package/dist/plugin-sdk/src/process/supervisor/adapters/pty.d.ts +11 -0
- package/dist/plugin-sdk/src/process/supervisor/index.d.ts +4 -0
- package/dist/plugin-sdk/src/process/supervisor/registry.d.ts +21 -0
- package/dist/plugin-sdk/src/process/supervisor/supervisor.d.ts +2 -0
- package/dist/plugin-sdk/src/process/supervisor/types.d.ts +92 -0
- package/dist/plugin-sdk/src/process/windows-command.d.ts +5 -0
- package/dist/plugin-sdk/src/providers/github-copilot-auth.d.ts +5 -0
- package/dist/plugin-sdk/src/providers/kilocode-shared.d.ts +27 -0
- package/dist/plugin-sdk/src/providers/openai-defaults.d.ts +7 -0
- package/dist/plugin-sdk/src/routing/account-id.d.ts +3 -0
- package/dist/plugin-sdk/src/routing/account-lookup.d.ts +1 -0
- package/dist/plugin-sdk/src/routing/bindings.d.ts +11 -0
- package/dist/plugin-sdk/src/routing/default-account-warnings.d.ts +6 -0
- package/dist/plugin-sdk/src/routing/resolve-route.d.ts +53 -0
- package/dist/plugin-sdk/src/routing/session-key.d.ts +52 -0
- package/dist/plugin-sdk/src/runtime.d.ts +7 -0
- package/dist/plugin-sdk/src/secrets/command-config.d.ts +35 -0
- package/dist/plugin-sdk/src/secrets/json-pointer.d.ts +6 -0
- package/dist/plugin-sdk/src/secrets/path-utils.d.ts +5 -0
- package/dist/plugin-sdk/src/secrets/provider-env-vars.d.ts +21 -0
- package/dist/plugin-sdk/src/secrets/ref-contract.d.ts +33 -0
- package/dist/plugin-sdk/src/secrets/resolve-secret-input-string.d.ts +12 -0
- package/dist/plugin-sdk/src/secrets/resolve.d.ts +40 -0
- package/dist/plugin-sdk/src/secrets/runtime-auth-collectors.d.ts +7 -0
- package/dist/plugin-sdk/src/secrets/runtime-config-collectors-channels.d.ts +7 -0
- package/dist/plugin-sdk/src/secrets/runtime-config-collectors-core.d.ts +7 -0
- package/dist/plugin-sdk/src/secrets/runtime-config-collectors-tts.d.ts +9 -0
- package/dist/plugin-sdk/src/secrets/runtime-config-collectors.d.ts +6 -0
- package/dist/plugin-sdk/src/secrets/runtime-gateway-auth-surfaces.d.ts +16 -0
- package/dist/plugin-sdk/src/secrets/runtime-shared.d.ts +52 -0
- package/dist/plugin-sdk/src/secrets/runtime-web-tools.d.ts +9 -0
- package/dist/plugin-sdk/src/secrets/runtime-web-tools.types.d.ts +26 -0
- package/dist/plugin-sdk/src/secrets/runtime.d.ts +34 -0
- package/dist/plugin-sdk/src/secrets/secret-value.d.ts +8 -0
- package/dist/plugin-sdk/src/secrets/shared.d.ts +11 -0
- package/dist/plugin-sdk/src/secrets/target-registry-data.d.ts +3 -0
- package/dist/plugin-sdk/src/secrets/target-registry-pattern.d.ts +28 -0
- package/dist/plugin-sdk/src/secrets/target-registry-query.d.ts +18 -0
- package/dist/plugin-sdk/src/secrets/target-registry-types.d.ts +39 -0
- package/dist/plugin-sdk/src/secrets/target-registry.d.ts +1 -0
- package/dist/plugin-sdk/src/security/audit-fs.d.ts +44 -0
- package/dist/plugin-sdk/src/security/channel-metadata.d.ts +6 -0
- package/dist/plugin-sdk/src/security/config-regex.d.ts +22 -0
- package/dist/plugin-sdk/src/security/dm-policy-shared.d.ts +92 -0
- package/dist/plugin-sdk/src/security/external-content.d.ts +58 -0
- package/dist/plugin-sdk/src/security/safe-regex.d.ts +16 -0
- package/dist/plugin-sdk/src/security/scan-paths.d.ts +5 -0
- package/dist/plugin-sdk/src/security/secret-equal.d.ts +1 -0
- package/dist/plugin-sdk/src/security/windows-acl.d.ts +37 -0
- package/dist/plugin-sdk/src/sessions/input-provenance.d.ts +17 -0
- package/dist/plugin-sdk/src/sessions/level-overrides.d.ts +10 -0
- package/dist/plugin-sdk/src/sessions/model-overrides.d.ts +14 -0
- package/dist/plugin-sdk/src/sessions/send-policy.d.ts +11 -0
- package/dist/plugin-sdk/src/sessions/session-id-resolution.d.ts +2 -0
- package/dist/plugin-sdk/src/sessions/session-id.d.ts +2 -0
- package/dist/plugin-sdk/src/sessions/session-key-utils.d.ts +20 -0
- package/dist/plugin-sdk/src/sessions/session-label.d.ts +9 -0
- package/dist/plugin-sdk/src/sessions/session-lifecycle-events.d.ts +11 -0
- package/dist/plugin-sdk/src/sessions/transcript-events.d.ts +10 -0
- package/dist/plugin-sdk/src/shared/assistant-error-format.d.ts +16 -0
- package/dist/plugin-sdk/src/shared/avatar-policy.d.ts +16 -0
- package/dist/plugin-sdk/src/shared/chat-content.d.ts +5 -0
- package/dist/plugin-sdk/src/shared/chat-envelope.d.ts +2 -0
- package/dist/plugin-sdk/src/shared/config-eval.d.ts +26 -0
- package/dist/plugin-sdk/src/shared/device-auth-store.d.ts +23 -0
- package/dist/plugin-sdk/src/shared/device-auth.d.ts +13 -0
- package/dist/plugin-sdk/src/shared/frontmatter.d.ts +29 -0
- package/dist/plugin-sdk/src/shared/gateway-bind-url.d.ts +14 -0
- package/dist/plugin-sdk/src/shared/global-singleton.d.ts +2 -0
- package/dist/plugin-sdk/src/shared/lazy-runtime.d.ts +7 -0
- package/dist/plugin-sdk/src/shared/net/ip.d.ts +20 -0
- package/dist/plugin-sdk/src/shared/net/url-userinfo.d.ts +1 -0
- package/dist/plugin-sdk/src/shared/node-list-parse.d.ts +3 -0
- package/dist/plugin-sdk/src/shared/node-list-types.d.ts +48 -0
- package/dist/plugin-sdk/src/shared/node-match.d.ts +9 -0
- package/dist/plugin-sdk/src/shared/node-resolve.d.ts +8 -0
- package/dist/plugin-sdk/src/shared/operator-scope-compat.d.ts +10 -0
- package/dist/plugin-sdk/src/shared/pid-alive.d.ts +10 -0
- package/dist/plugin-sdk/src/shared/process-scoped-map.d.ts +1 -0
- package/dist/plugin-sdk/src/shared/session-types.d.ts +25 -0
- package/dist/plugin-sdk/src/shared/session-usage-timeseries-types.d.ts +15 -0
- package/dist/plugin-sdk/src/shared/string-normalization.d.ts +4 -0
- package/dist/plugin-sdk/src/shared/string-sample.d.ts +5 -0
- package/dist/plugin-sdk/src/shared/subagents-format.d.ts +15 -0
- package/dist/plugin-sdk/src/shared/tailscale-status.d.ts +8 -0
- package/dist/plugin-sdk/src/shared/text/assistant-visible-text.d.ts +1 -0
- package/dist/plugin-sdk/src/shared/text/auto-linked-file-ref.d.ts +2 -0
- package/dist/plugin-sdk/src/shared/text/code-regions.d.ts +6 -0
- package/dist/plugin-sdk/src/shared/text/join-segments.d.ts +9 -0
- package/dist/plugin-sdk/src/shared/text/reasoning-tags.d.ts +6 -0
- package/dist/plugin-sdk/src/shared/text-chunking.d.ts +1 -0
- package/dist/plugin-sdk/src/terminal/ansi.d.ts +9 -0
- package/dist/plugin-sdk/src/terminal/health-style.d.ts +1 -0
- package/dist/plugin-sdk/src/terminal/links.d.ts +6 -0
- package/dist/plugin-sdk/src/terminal/note.d.ts +5 -0
- package/dist/plugin-sdk/src/terminal/palette.d.ts +10 -0
- package/dist/plugin-sdk/src/terminal/progress-line.d.ts +3 -0
- package/dist/plugin-sdk/src/terminal/prompt-style.d.ts +3 -0
- package/dist/plugin-sdk/src/terminal/restore.d.ts +17 -0
- package/dist/plugin-sdk/src/terminal/safe-text.d.ts +4 -0
- package/dist/plugin-sdk/src/terminal/theme.d.ts +15 -0
- package/dist/plugin-sdk/src/test-utils/vitest-mock-fn.d.ts +1 -0
- package/dist/plugin-sdk/src/tts/provider-registry.d.ts +6 -0
- package/dist/plugin-sdk/src/tts/provider-types.d.ts +46 -0
- package/dist/plugin-sdk/src/tts/providers/elevenlabs.d.ts +7 -0
- package/dist/plugin-sdk/src/tts/providers/microsoft.d.ts +4 -0
- package/dist/plugin-sdk/src/tts/providers/openai.d.ts +2 -0
- package/dist/plugin-sdk/src/tts/runtime.d.ts +1 -0
- package/dist/plugin-sdk/src/tts/tts-core.d.ts +57 -0
- package/dist/plugin-sdk/src/tts/tts.d.ts +216 -0
- package/dist/plugin-sdk/src/utils/account-id.d.ts +1 -0
- package/dist/plugin-sdk/src/utils/boolean.d.ts +5 -0
- package/dist/plugin-sdk/src/utils/chunk-items.d.ts +1 -0
- package/dist/plugin-sdk/src/utils/delivery-context.d.ts +42 -0
- package/dist/plugin-sdk/src/utils/directive-tags.d.ts +29 -0
- package/dist/plugin-sdk/src/utils/fetch-timeout.d.ts +13 -0
- package/dist/plugin-sdk/src/utils/mask-api-key.d.ts +1 -0
- package/dist/plugin-sdk/src/utils/message-channel.d.ts +27 -0
- package/dist/plugin-sdk/src/utils/normalize-secret-input.d.ts +17 -0
- package/dist/plugin-sdk/src/utils/parse-json-compat.d.ts +1 -0
- package/dist/plugin-sdk/src/utils/provider-utils.d.ts +9 -0
- package/dist/plugin-sdk/src/utils/queue-helpers.d.ts +80 -0
- package/dist/plugin-sdk/src/utils/reaction-level.d.ts +15 -0
- package/dist/plugin-sdk/src/utils/run-with-concurrency.d.ts +11 -0
- package/dist/plugin-sdk/src/utils/safe-json.d.ts +1 -0
- package/dist/plugin-sdk/src/utils/shell-argv.d.ts +1 -0
- package/dist/plugin-sdk/src/utils/transcript-tools.d.ts +8 -0
- package/dist/plugin-sdk/src/utils/usage-format.d.ts +27 -0
- package/dist/plugin-sdk/src/utils/with-timeout.d.ts +1 -0
- package/dist/plugin-sdk/src/utils.d.ts +61 -0
- package/dist/plugin-sdk/src/version.d.ts +16 -0
- package/dist/plugin-sdk/src/web-search/runtime.d.ts +46 -0
- package/dist/plugin-sdk/src/whatsapp/normalize.d.ts +6 -0
- package/dist/plugin-sdk/src/whatsapp/resolve-outbound-target.d.ts +12 -0
- package/dist/plugin-sdk/src/wizard/prompts.d.ts +43 -0
- package/dist/plugin-sdk/src/wizard/session.d.ts +42 -0
- package/dist/plugin-sdk/ssrf-runtime.d.ts +1 -0
- package/dist/plugin-sdk/ssrf-runtime.js +5 -0
- package/dist/plugin-sdk/state-paths.d.ts +1 -0
- package/dist/plugin-sdk/state-paths.js +3 -0
- package/dist/plugin-sdk/status-helpers.d.ts +1 -0
- package/dist/plugin-sdk/status-helpers.js +9 -0
- package/dist/plugin-sdk/telegram-core.d.ts +1 -0
- package/dist/plugin-sdk/telegram-core.js +23 -0
- package/dist/plugin-sdk/telegram.d.ts +1 -0
- package/dist/plugin-sdk/telegram.js +224 -0
- package/dist/plugin-sdk/testing.d.ts +1 -0
- package/dist/plugin-sdk/testing.js +13174 -0
- package/dist/plugin-sdk/text-runtime.d.ts +1 -0
- package/dist/plugin-sdk/text-runtime.js +45 -0
- package/dist/plugin-sdk/thread-bindings-runtime.d.ts +1 -0
- package/dist/plugin-sdk/thread-bindings-runtime.js +2 -0
- package/dist/plugin-sdk/thread-ownership.d.ts +1 -0
- package/dist/plugin-sdk/thread-ownership.js +2 -0
- package/dist/plugin-sdk/tlon.d.ts +1 -0
- package/dist/plugin-sdk/tlon.js +57 -0
- package/dist/plugin-sdk/tool-send.d.ts +1 -0
- package/dist/plugin-sdk/tool-send.js +2 -0
- package/dist/plugin-sdk/twitch.d.ts +1 -0
- package/dist/plugin-sdk/twitch.js +46 -0
- package/dist/plugin-sdk/voice-call.d.ts +1 -0
- package/dist/plugin-sdk/voice-call.js +213 -0
- package/dist/plugin-sdk/web-media.d.ts +1 -0
- package/dist/plugin-sdk/web-media.js +28 -0
- package/dist/plugin-sdk/webhook-ingress.d.ts +1 -0
- package/dist/plugin-sdk/webhook-ingress.js +7 -0
- package/dist/plugin-sdk/webhook-path.d.ts +1 -0
- package/dist/plugin-sdk/webhook-path.js +29 -0
- package/dist/plugin-sdk/whatsapp-core.d.ts +1 -0
- package/dist/plugin-sdk/whatsapp-core.js +219 -0
- package/dist/plugin-sdk/whatsapp-shared.d.ts +1 -0
- package/dist/plugin-sdk/whatsapp-shared.js +18 -0
- package/dist/plugin-sdk/windows-spawn.d.ts +1 -0
- package/dist/plugin-sdk/windows-spawn.js +2 -0
- package/dist/plugin-sdk/zalo.d.ts +1 -0
- package/dist/plugin-sdk/zalo.js +239 -0
- package/dist/plugin-sdk/zalouser.d.ts +1 -0
- package/dist/plugin-sdk/zalouser.js +240 -0
- package/dist/plugins/build-smoke-entry.js +211 -0
- package/dist/plugins/runtime/index.js +229 -0
- package/dist/plugins-1Z50ecJ6.js +1 -0
- package/dist/plugins-C6fKmNuA.js +7 -0
- package/dist/plugins-cli-C9F7LFai.js +1192 -0
- package/dist/policy-CpkbSAfm.js +60 -0
- package/dist/polls-B2VH7SN9.js +35 -0
- package/dist/ports-BjWuIIQw.js +262 -0
- package/dist/ports-bjxjgHBT.js +385 -0
- package/dist/ports-lsof-DtJqhFOr.js +25 -0
- package/dist/ports-probe-BQqp8l8E.js +14 -0
- package/dist/preflight-audio.runtime-CHKtYFCD.js +216 -0
- package/dist/probe-B4addlGb.js +20 -0
- package/dist/probe-DEHTy47Q.js +134 -0
- package/dist/probe-auth-f8H5asG2.js +45 -0
- package/dist/probe-auth-w1LTAARt.js +48 -0
- package/dist/process-runtime-C7el-Ri4.js +1 -0
- package/dist/process-scoped-map-C4gOa-gv.js +61 -0
- package/dist/profile-utils-BcMYGFPT.js +15 -0
- package/dist/profiles-D17eMKQZ.js +683 -0
- package/dist/program-7yuBUzsM.js +155 -0
- package/dist/program-context-BMWNUfqL.js +10 -0
- package/dist/program-context-CD_RvRYh.js +2 -0
- package/dist/progress-D1r9bZU1.js +132 -0
- package/dist/prompt-select-styled-nNVADeGF.js +4879 -0
- package/dist/prompt-style-BvciNCqy.js +7 -0
- package/dist/prompts-NtuylUyl.js +9 -0
- package/dist/prototype-keys-Cm_8mWvq.js +11 -0
- package/dist/provider-api-key-auth-BE0taXiB.js +108 -0
- package/dist/provider-api-key-auth.runtime-jDZZUAMX.js +34 -0
- package/dist/provider-auth-Bw8x1a3o.js +58 -0
- package/dist/provider-auth-api-key-BrQYvdxi.js +1 -0
- package/dist/provider-auth-choice-CHLyhQwI.js +128 -0
- package/dist/provider-auth-choice-helpers-Bj1GkOSn.js +48 -0
- package/dist/provider-auth-choice-preference-DlolknHt.js +192 -0
- package/dist/provider-auth-choice.runtime-unOg_4AL.js +223 -0
- package/dist/provider-auth-choices-QSilukI1.js +58 -0
- package/dist/provider-auth-guidance-7WCTw6mb.js +34 -0
- package/dist/provider-auth-helpers-B0dS-1WK.js +86 -0
- package/dist/provider-auth-input-BftBdgvW.js +112 -0
- package/dist/provider-auth-login-MdVTo3EF.js +8 -0
- package/dist/provider-auth-login.runtime-CmHgk5FU.js +243 -0
- package/dist/provider-auth-mode-sTdccIKL.js +20 -0
- package/dist/provider-auth-ref-BS3gwrNr.js +168 -0
- package/dist/provider-auth-ref-BmEcEN7K.js +3 -0
- package/dist/provider-catalog--18-pW5t.js +11 -0
- package/dist/provider-catalog-2P2hel74.js +48 -0
- package/dist/provider-catalog-B0FqWSwe.js +48 -0
- package/dist/provider-catalog-BvORKzzD.js +91 -0
- package/dist/provider-catalog-C34j1_or.js +26 -0
- package/dist/provider-catalog-C5vmXjmb.js +11 -0
- package/dist/provider-catalog-CBufm2Dr.js +36 -0
- package/dist/provider-catalog-D7QvsUXS.js +12 -0
- package/dist/provider-catalog-DKy_dzQZ.js +41 -0
- package/dist/provider-env-vars-CsQlY7bF.js +110 -0
- package/dist/provider-id-BpXo5t6v.js +31 -0
- package/dist/provider-model-allowlist-4HSOnlX-.js +24 -0
- package/dist/provider-model-primary-NJ-xlhec.js +53 -0
- package/dist/provider-models-C2EjYMwW.js +2416 -0
- package/dist/provider-oauth-flow-BQN6F6EC.js +33 -0
- package/dist/provider-ollama-setup-DhQvDwAj.js +309 -0
- package/dist/provider-onboard-CjOfyeQG.js +1 -0
- package/dist/provider-onboarding-config-DOZ3pFA6.js +165 -0
- package/dist/provider-openai-codex-oauth-tls-CciH-ElI.js +101 -0
- package/dist/provider-runtime.runtime-CqLlOpNN.js +211 -0
- package/dist/provider-self-hosted-setup-CUrmsugW.js +182 -0
- package/dist/provider-usage-ClDVmkhl.js +633 -0
- package/dist/provider-usage-Da21nLuJ.js +211 -0
- package/dist/provider-web-search-D2JPMqCP.js +507 -0
- package/dist/provider-wizard-DLQlOsRE.js +236 -0
- package/dist/provider-zai-endpoint-DeDABzT4.js +106 -0
- package/dist/proxy-H5O2p6AP.js +121 -0
- package/dist/proxy-env-DG2u55RW.js +40 -0
- package/dist/push-apns-DthmTY-D.js +1050 -0
- package/dist/pw-ai-S7kXHa5n.js +1876 -0
- package/dist/qmd-manager-BpygGMW9.js +1571 -0
- package/dist/qr-cli-BujxPQbh.js +370 -0
- package/dist/qr-cli-DVmW5mdc.js +213 -0
- package/dist/query-expansion-Do45hILP.js +1114 -0
- package/dist/reactions-BlWPBR0l.js +281 -0
- package/dist/read-only-account-inspect-CuuTbX8x.js +42 -0
- package/dist/read-only-account-inspect.discord.runtime-BNqMWV41.js +216 -0
- package/dist/read-only-account-inspect.slack.runtime-CNRAytxm.js +216 -0
- package/dist/read-only-account-inspect.telegram.runtime-byPPLnsZ.js +216 -0
- package/dist/redact-BDinS1q9.js +102 -0
- package/dist/redact-identifier-FUiWQxv5.js +13 -0
- package/dist/redact-snapshot-DBPmeYy2.js +2654 -0
- package/dist/ref-contract-CCBBbf1r.js +53 -0
- package/dist/register-CppP7Ddc.js +43 -0
- package/dist/register.agent-Cy1pvUnS.js +546 -0
- package/dist/register.backup-Dxsn-Yi4.js +269 -0
- package/dist/register.configure-BOONWPZN.js +354 -0
- package/dist/register.maintenance-C_E5F3xW.js +694 -0
- package/dist/register.message-BwmuEJ7n.js +812 -0
- package/dist/register.onboard-D4Fu6BPi.js +298 -0
- package/dist/register.setup-DJYgl_5E.js +318 -0
- package/dist/register.status-health-sessions-B0KtOOEc.js +604 -0
- package/dist/register.subclis-CKJ5Qvch.js +315 -0
- package/dist/register.subclis-CcdM_H8W.js +13 -0
- package/dist/registry-C3q59Qj0.js +55 -0
- package/dist/registry-CPsHw6xU.js +219 -0
- package/dist/registry-CxgtJ09C.js +28 -0
- package/dist/registry-rgYi7KoO.js +160 -0
- package/dist/repair-qXnOAvDy.js +105 -0
- package/dist/replies-MyUi4VUF.js +122 -0
- package/dist/reply-history-CVCD5oE9.js +1 -0
- package/dist/reply-payload-DBGc074f.js +232 -0
- package/dist/report-cli-DB1jQx32.js +42 -0
- package/dist/request-url-BKfWAQx8.js +10 -0
- package/dist/resolve-Ckjd8TAk.js +14 -0
- package/dist/resolve-T2q_0ARF.js +619 -0
- package/dist/resolve-route-vEY3ONZ2.js +466 -0
- package/dist/resolve-utils-CF8cU9WO.js +102 -0
- package/dist/response-generator-VdoCcQ3y.js +153 -0
- package/dist/restart-stale-pids-CLGiqU2E.js +187 -0
- package/dist/retry-D15TD1S3.js +168 -0
- package/dist/root-help-2Fvs2dP7.js +32 -0
- package/dist/routes-LnFKW9Eh.js +7084 -0
- package/dist/routing-Y3m0o-kB.js +26 -0
- package/dist/rpc-lnQaxoYH.js +67 -0
- package/dist/run-command-DRKv5Lj6.js +32 -0
- package/dist/run-main-XmwwulYd.js +425 -0
- package/dist/run-with-concurrency-BrSjWzpg.js +41 -0
- package/dist/runtime-B66W9flm.js +43 -0
- package/dist/runtime-CT2LIJZu.js +91 -0
- package/dist/runtime-Cl6sSlDG.js +143 -0
- package/dist/runtime-CuvWMN7E.js +89 -0
- package/dist/runtime-D4_OpzA1.js +5 -0
- package/dist/runtime-DP-4DZja.js +5 -0
- package/dist/runtime-Dl17x_cV.js +1 -0
- package/dist/runtime-Dwejo3y0.js +2338 -0
- package/dist/runtime-Z35JoYPC.js +30 -0
- package/dist/runtime-api-AQf4CGN0.js +39 -0
- package/dist/runtime-api-D79M0lQN.js +1 -0
- package/dist/runtime-discord-ops.runtime-CvmUbfVm.js +234 -0
- package/dist/runtime-env-a_iwdJIv.js +1 -0
- package/dist/runtime-forwarders-DtMc8rBP.js +44 -0
- package/dist/runtime-group-policy-B7irU4eu.js +59 -0
- package/dist/runtime-guard-y62lPDGY.js +58 -0
- package/dist/runtime-parse-CeqXmZHJ.js +84 -0
- package/dist/runtime-paths-2jrzlMjr.js +334 -0
- package/dist/runtime-slack-ops.runtime-D7IhY8CD.js +226 -0
- package/dist/runtime-status-CgL02wYX.js +15 -0
- package/dist/runtime-store-Bt3Sdbrn.js +22 -0
- package/dist/runtime-telegram-ops.runtime-DMM0_L8z.js +233 -0
- package/dist/runtime-whatsapp-boundary-BE-h0Dkz.js +371 -0
- package/dist/safe-open-sync-Bt9R1Mnf.js +83 -0
- package/dist/safe-regex-tLlDZYfM.js +244 -0
- package/dist/safe-text-B_CQuica.js +16 -0
- package/dist/sandbox-Ceruxpo4.js +2795 -0
- package/dist/sandbox-cli-Bj_FeUbQ.js +499 -0
- package/dist/sandbox-paths-fqp_TZdO.js +144 -0
- package/dist/sandbox-qSs4h3sk.js +1 -0
- package/dist/sanitize-env-vars-vNSNqm0y.js +74 -0
- package/dist/scan-paths-BJmvUZ1E.js +28 -0
- package/dist/search-manager-5CMnrJiG.js +392 -0
- package/dist/search-manager-mbopau6D.js +17 -0
- package/dist/secret-equal-ObQfyZGa.js +9 -0
- package/dist/secret-file-Ch0yuOXR.js +11 -0
- package/dist/secret-file-DYJtH6kf.js +92 -0
- package/dist/secret-input-4REZ4sHo.js +35 -0
- package/dist/secrets-cli-CDAAxiLx.js +2304 -0
- package/dist/secure-random-Cs8tw_HQ.js +10 -0
- package/dist/security-cli-73x8ZrPY.js +676 -0
- package/dist/security-runtime-BuEhpJVE.js +23 -0
- package/dist/send-3tabvle6.js +100 -0
- package/dist/send-CK2mTZ2A.js +1026 -0
- package/dist/send-CoghdDtC.js +250 -0
- package/dist/send-deps-CrFMNvqO.js +19 -0
- package/dist/server-DsQSJw3K.js +116 -0
- package/dist/server-middleware-CCqKhKUb.js +106 -0
- package/dist/server-node-events-ByKRzTEW.js +611 -0
- package/dist/server-startup-matrix-migration-DXgvClaj.js +1595 -0
- package/dist/service-CCEFa-Yp.js +21 -0
- package/dist/service-DsLjWzXO.js +774 -0
- package/dist/session-cost-usage-Bcu2puh5.js +615 -0
- package/dist/session-cost-usage-CqAjBtg1.js +212 -0
- package/dist/session-fork.runtime-BZfcC1Nc.js +51 -0
- package/dist/session-key-gFFk3uv9.js +216 -0
- package/dist/session-write-lock-DNKvpjKf.js +324 -0
- package/dist/sessions-BjptmD-t.js +669 -0
- package/dist/sessions-CcXbjCp-.js +212 -0
- package/dist/sessions-DzQPJoHb.js +222 -0
- package/dist/setup-CN-teRpz.js +8 -0
- package/dist/setup-adapter-runtime-Bjv2adwG.js +1 -0
- package/dist/setup-binary-BOJA7zdN.js +30 -0
- package/dist/setup-browser-BhNPCUtK.js +71 -0
- package/dist/setup-core-7tpbsHoe.js +510 -0
- package/dist/setup-core-DsGvW4Oh.js +149 -0
- package/dist/setup-core-m6QfoAWl.js +162 -0
- package/dist/setup-entry-BgrHdl35.js +13 -0
- package/dist/setup-entry-DKV-8VNp.js +13 -0
- package/dist/setup-entry-Df-K2RuZ.js +12 -0
- package/dist/setup-entry-DxtbuNKQ.js +12 -0
- package/dist/setup-entry-Dzn7A8q7.js +10 -0
- package/dist/setup-entry-bSF8R2r8.js +14 -0
- package/dist/setup-group-access-BtPApRvE.js +70 -0
- package/dist/setup-helpers-B62Ecg9r.js +362 -0
- package/dist/setup-saJ2s_47.js +397 -0
- package/dist/setup-surface-BGYo0Juy.js +452 -0
- package/dist/setup-surface-Cx1YVfWw.js +298 -0
- package/dist/setup-surface-DF1wiFx2.js +380 -0
- package/dist/setup-tools-BPiMjAN7.js +1 -0
- package/dist/setup-wizard-helpers-COZ1UAdX.js +770 -0
- package/dist/setup-wizard-proxy-Slwi-1gX.js +116 -0
- package/dist/setup.finalize-BEoLI29h.js +633 -0
- package/dist/setup.gateway-config-6ACjCQcc.js +288 -0
- package/dist/setup.secret-input-BL-bqJpt.js +25 -0
- package/dist/shared-AygSbeCK.js +50 -0
- package/dist/shared-BEtSbYbS.js +70 -0
- package/dist/shared-BU0QgVMZ.js +36 -0
- package/dist/shared-B_i-s5Yg.js +127 -0
- package/dist/shared-CsOwQtm1.js +82 -0
- package/dist/shared-DA95aWfS.js +196 -0
- package/dist/shared-DsbqCNFQ.js +64 -0
- package/dist/shared-LeP8iUTz.js +54 -0
- package/dist/shared-N35AUgZI.js +351 -0
- package/dist/shared-qmfOl6pa.js +87 -0
- package/dist/shell-argv-DWV43Vya.js +72 -0
- package/dist/shell-env-cD92jEyV.js +181 -0
- package/dist/signal-8EYn_jCw.js +214 -0
- package/dist/signal-Ca7y47bM.js +46 -0
- package/dist/signal-CdndhLSx.js +315 -0
- package/dist/signal-cli-install-DxoL8CgF.js +188 -0
- package/dist/skill-commands-CiSwTFBQ.js +652 -0
- package/dist/skill-commands.runtime-CEwlWT4j.js +34 -0
- package/dist/skill-scanner-DG7MT7pu.js +354 -0
- package/dist/skills-BC8GJ9Rp.js +22 -0
- package/dist/skills-CCgKs_NJ.js +863 -0
- package/dist/skills-cli-Xqm4TQ_x.js +339 -0
- package/dist/skills-install-DiriUXJd.js +763 -0
- package/dist/skills-status-BmQTn4jL.js +23 -0
- package/dist/skills-status-a9b899Y3.js +169 -0
- package/dist/slack-C3ZawHgc.js +217 -0
- package/dist/slack-DnTAFEmr.js +730 -0
- package/dist/slack-UD0yJzLR.js +24536 -0
- package/dist/slack-core-DcsbATUs.js +1 -0
- package/dist/slash-commands.runtime-sOpKLp0F.js +228 -0
- package/dist/slash-dispatch.runtime-CbC_hoS7.js +238 -0
- package/dist/slash-skill-commands.runtime-CXNUQJQR.js +216 -0
- package/dist/speech-bSreRuDH.js +1 -0
- package/dist/speech-runtime-y1FcnGVA.js +1 -0
- package/dist/src-CmXHIz5f.js +846 -0
- package/dist/ssh-config-ChqR6ijV.js +77 -0
- package/dist/ssh-tunnel-BWqSNkJo.js +159 -0
- package/dist/ssh-tunnel-DXVCvSif.js +16 -0
- package/dist/ssrf-Dk9XaoKN.js +220 -0
- package/dist/ssrf-policy-Dk6oMa20.js +69 -0
- package/dist/ssrf-runtime-C-mAQLVA.js +1 -0
- package/dist/stagger-DU7FjHYo.js +54 -0
- package/dist/state-paths-DJIGEFq_.js +1 -0
- package/dist/status-1dN68Nry.js +212 -0
- package/dist/status-B5jKN_AU.js +606 -0
- package/dist/status-BQWWxkTB.js +235 -0
- package/dist/status-By03N6J2.js +44 -0
- package/dist/status-COGoXc70.js +202 -0
- package/dist/status-ClMSSlfZ.js +1665 -0
- package/dist/status-Dl_kHCzm.js +75 -0
- package/dist/status-helpers-Cda-rGLX.js +101 -0
- package/dist/status-json-DXiuJMkM.js +322 -0
- package/dist/status.link-channel-DVXC4ITW.js +40 -0
- package/dist/status.scan.deps.runtime-BklcI9d4.js +77 -0
- package/dist/status.scan.runtime-Bz0f5qUW.js +14 -0
- package/dist/status.summary-D8-ms-9P.js +600 -0
- package/dist/status.summary.runtime-Cng6MzRU.js +151 -0
- package/dist/status.update-CjoH4lVV.js +79 -0
- package/dist/store-AMSZUI0p.js +1446 -0
- package/dist/store.runtime-B0dFf2pa.js +43 -0
- package/dist/string-normalization-CvzuCAZv.js +19 -0
- package/dist/string-sample-BOLqzr4Y.js +11 -0
- package/dist/subagent-orphan-recovery-CDTomicF.js +407 -0
- package/dist/subagent-registry-runtime-kD87ylaJ.js +211 -0
- package/dist/subcli-descriptors-CteQXLPG.js +151 -0
- package/dist/subsystem-CUp-6QQf.js +421 -0
- package/dist/synology-chat-CFiJEDRu.js +12 -0
- package/dist/system-cli-D2pMYxTX.js +99 -0
- package/dist/system-events-mAu6Ap6K.js +75 -0
- package/dist/system-message-DA9eUYzB.js +16 -0
- package/dist/system-run-command-BV7UnYxn.js +258 -0
- package/dist/systemd-CrxZBFae.js +557 -0
- package/dist/systemd-hints-BLAoAquw.js +315 -0
- package/dist/systemd-linger-BdklDcLg.js +16 -0
- package/dist/systemd-linger-DLrbG9_d.js +68 -0
- package/dist/table-DFMOhmNZ.js +305 -0
- package/dist/tailnet-ofqBrXzu.js +38 -0
- package/dist/tailscale-Cbsx-2HB.js +254 -0
- package/dist/target-errors-ksphhzJg.js +26 -0
- package/dist/target-registry-krAVlXi_.js +1321 -0
- package/dist/telegram/audit.js +2 -0
- package/dist/telegram/token.js +211 -0
- package/dist/telegram--sUKZkSQ.js +218 -0
- package/dist/telegram-T7TInjDG.js +575 -0
- package/dist/telegram-core-B4Jo-uko.js +1 -0
- package/dist/telegram-gE5VPMy9.js +10910 -0
- package/dist/template-messages-kh7VfgOb.js +214 -0
- package/dist/text-chunking-CUf5WgqG.js +19 -0
- package/dist/text-format-sFXlJfHH.js +8 -0
- package/dist/text-runtime-C_Roi_Je.js +1418 -0
- package/dist/theme-B5HDbQfl.js +2 -0
- package/dist/theme-CdOoMzRk.js +34 -0
- package/dist/thinking-BBD_0HSp.js +68 -0
- package/dist/thinking.shared-CncvRHts.js +246 -0
- package/dist/thread-bindings-messages-Cdo8jSa9.js +229 -0
- package/dist/thread-bindings-policy-DMjOaNyR.js +119 -0
- package/dist/thread-bindings-runtime-Ckwk3Uuz.js +1 -0
- package/dist/threading-helpers-Cq55SUtb.js +14 -0
- package/dist/timeouts-BwR1sGom.js +72 -0
- package/dist/tmp-openclaw-dir-idKIOMmb.js +102 -0
- package/dist/token-Bgv8XEsC.js +50 -0
- package/dist/tool-catalog-BV6FcEWS.js +337 -0
- package/dist/tool-policy-match-hui3aCeL.js +46 -0
- package/dist/tool-send-9LXKcrda.js +16 -0
- package/dist/topology-cli-BhUXVViF.js +43 -0
- package/dist/transcript-events-B1V6z5ct.js +29 -0
- package/dist/tui-DPFSXSKf.js +3838 -0
- package/dist/tui-cli-ARm2kBar.js +237 -0
- package/dist/typebox-D0SHDJST.js +175 -0
- package/dist/types-BCKGVVld.js +83 -0
- package/dist/types-CtpUGsDP.js +30 -0
- package/dist/types.secrets-BWSeXrF4.js +80 -0
- package/dist/types.tools-BBO8HCi6.js +22 -0
- package/dist/typing-DG_YqWJ7.js +224 -0
- package/dist/unhandled-rejections-CDJ8dOVP.js +170 -0
- package/dist/unhandled-rejections-O6cVOz2D.js +4 -0
- package/dist/update-check-C3TeQaWg.js +464 -0
- package/dist/update-cli-d9OEgooM.js +1625 -0
- package/dist/update-offset-store-DxnWyB1g.js +211 -0
- package/dist/update-yEO8OZ1B.js +1039 -0
- package/dist/upsert-with-lock-Bb96JHpb.js +34 -0
- package/dist/url-userinfo-Db63ng4y.js +14 -0
- package/dist/utils-Bxk6BLTg.js +236 -0
- package/dist/utils-vDeUf98G.js +7 -0
- package/dist/version-BQotbaVq.js +65 -0
- package/dist/version-riajrkRq.js +2 -0
- package/dist/voice-call-D4fgwZNO.js +1 -0
- package/dist/warning-filter-CgvLQB4Y.js +56 -0
- package/dist/web-media-BfBb8i48.js +1 -0
- package/dist/web-media-CtU6jM5V.js +498 -0
- package/dist/webhook-ingress-CupqYpKM.js +338 -0
- package/dist/webhook-memory-guards-BHrFZ4yq.js +129 -0
- package/dist/webhook-path-BGFZ55ML.js +22 -0
- package/dist/webhook-shared-DPtckp_I.js +349 -0
- package/dist/webhooks-cli-DXesU9a9.js +357 -0
- package/dist/whatsapp-Ba6KkyUx.js +58 -0
- package/dist/whatsapp-DXbWlm3A.js +82 -0
- package/dist/whatsapp-core-Ca4IJFs0.js +89490 -0
- package/dist/whatsapp-heartbeat-CSWnPQ7q.js +84 -0
- package/dist/whatsapp-shared-BmHKqTtR.js +95 -0
- package/dist/widearea-dns-CXimgJzu.js +125 -0
- package/dist/windows-argv-IXrdWrJj.js +145 -0
- package/dist/windows-spawn-vMJGZo89.js +154 -0
- package/dist/with-timeout-2AKTISee.js +58 -0
- package/dist/workspace-BH7CXmrr.js +479 -0
- package/dist/workspace-dirs-_O4V3xCR.js +13 -0
- package/dist/workspace-v5XppK5M.js +302 -0
- package/dist/ws-By-QcLjg.js +11 -0
- package/dist/wsl-BV3Cb66X.js +57 -0
- package/dist/zalo-Ca9sr4FS.js +301 -0
- package/dist/zalo-x6b0tYi0.js +13 -0
- package/dist/zod-schema.agent-runtime-T_EC_6fg.js +600 -0
- package/dist/zod-schema.core-BdgRr-F1.js +545 -0
- package/dist/zod-schema.providers-core-Dgq7MTqU.js +1613 -0
- package/dist-runtime/extensions/acpx/openclaw.plugin.json +120 -0
- package/dist-runtime/extensions/acpx/package.json +14 -0
- package/dist-runtime/extensions/amazon-bedrock/index.js +3 -0
- package/dist-runtime/extensions/amazon-bedrock/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/amazon-bedrock/package.json +12 -0
- package/dist-runtime/extensions/anthropic/index.js +3 -0
- package/dist-runtime/extensions/anthropic/openclaw.plugin.json +42 -0
- package/dist-runtime/extensions/anthropic/package.json +12 -0
- package/dist-runtime/extensions/bluebubbles/index.js +3 -0
- package/dist-runtime/extensions/bluebubbles/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/bluebubbles/package.json +51 -0
- package/dist-runtime/extensions/bluebubbles/setup-entry.js +3 -0
- package/dist-runtime/extensions/brave/index.js +3 -0
- package/dist-runtime/extensions/brave/openclaw.plugin.json +45 -0
- package/dist-runtime/extensions/brave/package.json +12 -0
- package/dist-runtime/extensions/byteplus/index.js +3 -0
- package/dist-runtime/extensions/byteplus/openclaw.plugin.json +32 -0
- package/dist-runtime/extensions/byteplus/package.json +12 -0
- package/dist-runtime/extensions/chutes/index.js +3 -0
- package/dist-runtime/extensions/chutes/openclaw.plugin.json +44 -0
- package/dist-runtime/extensions/chutes/package.json +12 -0
- package/dist-runtime/extensions/cloudflare-ai-gateway/index.js +3 -0
- package/dist-runtime/extensions/cloudflare-ai-gateway/openclaw.plugin.json +32 -0
- package/dist-runtime/extensions/cloudflare-ai-gateway/package.json +12 -0
- package/dist-runtime/extensions/copilot-proxy/index.js +3 -0
- package/dist-runtime/extensions/copilot-proxy/openclaw.plugin.json +23 -0
- package/dist-runtime/extensions/copilot-proxy/package.json +12 -0
- package/dist-runtime/extensions/device-pair/index.js +3 -0
- package/dist-runtime/extensions/device-pair/openclaw.plugin.json +20 -0
- package/dist-runtime/extensions/diagnostics-otel/openclaw.plugin.json +8 -0
- package/dist-runtime/extensions/diagnostics-otel/package.json +27 -0
- package/dist-runtime/extensions/diffs/openclaw.plugin.json +216 -0
- package/dist-runtime/extensions/diffs/package.json +20 -0
- package/dist-runtime/extensions/discord/index.js +3 -0
- package/dist-runtime/extensions/discord/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/discord/package.json +40 -0
- package/dist-runtime/extensions/discord/setup-entry.js +3 -0
- package/dist-runtime/extensions/elevenlabs/index.js +3 -0
- package/dist-runtime/extensions/elevenlabs/openclaw.plugin.json +8 -0
- package/dist-runtime/extensions/elevenlabs/package.json +12 -0
- package/dist-runtime/extensions/fal/index.js +3 -0
- package/dist-runtime/extensions/fal/openclaw.plugin.json +34 -0
- package/dist-runtime/extensions/fal/package.json +12 -0
- package/dist-runtime/extensions/feishu/index.js +3 -0
- package/dist-runtime/extensions/feishu/openclaw.plugin.json +14 -0
- package/dist-runtime/extensions/feishu/package.json +42 -0
- package/dist-runtime/extensions/feishu/setup-entry.js +3 -0
- package/dist-runtime/extensions/firecrawl/index.js +3 -0
- package/dist-runtime/extensions/firecrawl/openclaw.plugin.json +41 -0
- package/dist-runtime/extensions/firecrawl/package.json +12 -0
- package/dist-runtime/extensions/github-copilot/index.js +3 -0
- package/dist-runtime/extensions/github-copilot/openclaw.plugin.json +30 -0
- package/dist-runtime/extensions/github-copilot/package.json +12 -0
- package/dist-runtime/extensions/google/index.js +3 -0
- package/dist-runtime/extensions/google/openclaw.plugin.json +71 -0
- package/dist-runtime/extensions/google/package.json +12 -0
- package/dist-runtime/extensions/googlechat/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/googlechat/package.json +46 -0
- package/dist-runtime/extensions/huggingface/index.js +3 -0
- package/dist-runtime/extensions/huggingface/openclaw.plugin.json +33 -0
- package/dist-runtime/extensions/huggingface/package.json +12 -0
- package/dist-runtime/extensions/imessage/index.js +3 -0
- package/dist-runtime/extensions/imessage/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/imessage/package.json +26 -0
- package/dist-runtime/extensions/imessage/setup-entry.js +3 -0
- package/dist-runtime/extensions/irc/index.js +3 -0
- package/dist-runtime/extensions/irc/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/irc/package.json +25 -0
- package/dist-runtime/extensions/irc/setup-entry.js +3 -0
- package/dist-runtime/extensions/kilocode/index.js +3 -0
- package/dist-runtime/extensions/kilocode/openclaw.plugin.json +32 -0
- package/dist-runtime/extensions/kilocode/package.json +12 -0
- package/dist-runtime/extensions/kimi-coding/index.js +3 -0
- package/dist-runtime/extensions/kimi-coding/openclaw.plugin.json +37 -0
- package/dist-runtime/extensions/kimi-coding/package.json +12 -0
- package/dist-runtime/extensions/line/index.js +3 -0
- package/dist-runtime/extensions/line/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/line/package.json +39 -0
- package/dist-runtime/extensions/line/setup-entry.js +3 -0
- package/dist-runtime/extensions/llm-task/index.js +3 -0
- package/dist-runtime/extensions/llm-task/openclaw.plugin.json +33 -0
- package/dist-runtime/extensions/llm-task/package.json +16 -0
- package/dist-runtime/extensions/lobster/index.js +3 -0
- package/dist-runtime/extensions/lobster/openclaw.plugin.json +10 -0
- package/dist-runtime/extensions/lobster/package.json +17 -0
- package/dist-runtime/extensions/matrix/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/matrix/package.json +53 -0
- package/dist-runtime/extensions/mattermost/index.js +3 -0
- package/dist-runtime/extensions/mattermost/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/mattermost/package.json +41 -0
- package/dist-runtime/extensions/mattermost/setup-entry.js +3 -0
- package/dist-runtime/extensions/memory-core/index.js +3 -0
- package/dist-runtime/extensions/memory-core/openclaw.plugin.json +9 -0
- package/dist-runtime/extensions/memory-core/package.json +20 -0
- package/dist-runtime/extensions/memory-lancedb/openclaw.plugin.json +92 -0
- package/dist-runtime/extensions/memory-lancedb/package.json +24 -0
- package/dist-runtime/extensions/microsoft/index.js +3 -0
- package/dist-runtime/extensions/microsoft/openclaw.plugin.json +8 -0
- package/dist-runtime/extensions/microsoft/package.json +12 -0
- package/dist-runtime/extensions/minimax/index.js +3 -0
- package/dist-runtime/extensions/minimax/openclaw.plugin.json +71 -0
- package/dist-runtime/extensions/minimax/package.json +12 -0
- package/dist-runtime/extensions/mistral/index.js +3 -0
- package/dist-runtime/extensions/mistral/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/mistral/package.json +12 -0
- package/dist-runtime/extensions/modelstudio/index.js +3 -0
- package/dist-runtime/extensions/modelstudio/openclaw.plugin.json +46 -0
- package/dist-runtime/extensions/modelstudio/package.json +12 -0
- package/dist-runtime/extensions/moonshot/index.js +3 -0
- package/dist-runtime/extensions/moonshot/openclaw.plugin.json +78 -0
- package/dist-runtime/extensions/moonshot/package.json +12 -0
- package/dist-runtime/extensions/msteams/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/msteams/package.json +48 -0
- package/dist-runtime/extensions/nextcloud-talk/index.js +3 -0
- package/dist-runtime/extensions/nextcloud-talk/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/nextcloud-talk/package.json +48 -0
- package/dist-runtime/extensions/nextcloud-talk/setup-entry.js +3 -0
- package/dist-runtime/extensions/nostr/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/nostr/package.json +45 -0
- package/dist-runtime/extensions/nvidia/index.js +3 -0
- package/dist-runtime/extensions/nvidia/openclaw.plugin.json +16 -0
- package/dist-runtime/extensions/nvidia/package.json +12 -0
- package/dist-runtime/extensions/ollama/index.js +3 -0
- package/dist-runtime/extensions/ollama/openclaw.plugin.json +28 -0
- package/dist-runtime/extensions/ollama/package.json +12 -0
- package/dist-runtime/extensions/open-prose/index.js +3 -0
- package/dist-runtime/extensions/open-prose/openclaw.plugin.json +13 -0
- package/dist-runtime/extensions/open-prose/package.json +12 -0
- package/dist-runtime/extensions/openai/index.js +3 -0
- package/dist-runtime/extensions/openai/openclaw.plugin.json +42 -0
- package/dist-runtime/extensions/openai/package.json +12 -0
- package/dist-runtime/extensions/opencode/index.js +3 -0
- package/dist-runtime/extensions/opencode/openclaw.plugin.json +32 -0
- package/dist-runtime/extensions/opencode/package.json +12 -0
- package/dist-runtime/extensions/opencode-go/index.js +3 -0
- package/dist-runtime/extensions/opencode-go/openclaw.plugin.json +32 -0
- package/dist-runtime/extensions/opencode-go/package.json +12 -0
- package/dist-runtime/extensions/openrouter/index.js +3 -0
- package/dist-runtime/extensions/openrouter/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/openrouter/package.json +12 -0
- package/dist-runtime/extensions/openshell/index.js +3 -0
- package/dist-runtime/extensions/openshell/openclaw.plugin.json +99 -0
- package/dist-runtime/extensions/openshell/package.json +12 -0
- package/dist-runtime/extensions/perplexity/index.js +3 -0
- package/dist-runtime/extensions/perplexity/openclaw.plugin.json +49 -0
- package/dist-runtime/extensions/perplexity/package.json +12 -0
- package/dist-runtime/extensions/phone-control/index.js +3 -0
- package/dist-runtime/extensions/phone-control/openclaw.plugin.json +10 -0
- package/dist-runtime/extensions/qianfan/index.js +3 -0
- package/dist-runtime/extensions/qianfan/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/qianfan/package.json +12 -0
- package/dist-runtime/extensions/qwen-portal-auth/index.js +3 -0
- package/dist-runtime/extensions/qwen-portal-auth/openclaw.plugin.json +29 -0
- package/dist-runtime/extensions/sglang/index.js +3 -0
- package/dist-runtime/extensions/sglang/openclaw.plugin.json +28 -0
- package/dist-runtime/extensions/sglang/package.json +12 -0
- package/dist-runtime/extensions/signal/index.js +3 -0
- package/dist-runtime/extensions/signal/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/signal/package.json +23 -0
- package/dist-runtime/extensions/signal/setup-entry.js +3 -0
- package/dist-runtime/extensions/slack/index.js +3 -0
- package/dist-runtime/extensions/slack/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/slack/package.json +30 -0
- package/dist-runtime/extensions/slack/setup-entry.js +3 -0
- package/dist-runtime/extensions/synology-chat/index.js +3 -0
- package/dist-runtime/extensions/synology-chat/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/synology-chat/package.json +29 -0
- package/dist-runtime/extensions/synology-chat/setup-entry.js +3 -0
- package/dist-runtime/extensions/synthetic/index.js +3 -0
- package/dist-runtime/extensions/synthetic/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/synthetic/package.json +12 -0
- package/dist-runtime/extensions/talk-voice/index.js +3 -0
- package/dist-runtime/extensions/talk-voice/openclaw.plugin.json +10 -0
- package/dist-runtime/extensions/tavily/index.js +3 -0
- package/dist-runtime/extensions/tavily/openclaw.plugin.json +44 -0
- package/dist-runtime/extensions/tavily/package.json +12 -0
- package/dist-runtime/extensions/telegram/index.js +3 -0
- package/dist-runtime/extensions/telegram/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/telegram/package.json +31 -0
- package/dist-runtime/extensions/telegram/setup-entry.js +3 -0
- package/dist-runtime/extensions/thread-ownership/index.js +3 -0
- package/dist-runtime/extensions/thread-ownership/openclaw.plugin.json +30 -0
- package/dist-runtime/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/bin/tlon.js +3 -0
- package/dist-runtime/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/package.json +40 -0
- package/dist-runtime/extensions/tlon/bundled-skills/@tloncorp/tlon-skill/scripts/postinstall.js +3 -0
- package/dist-runtime/extensions/tlon/openclaw.plugin.json +14 -0
- package/dist-runtime/extensions/tlon/package.json +45 -0
- package/dist-runtime/extensions/together/index.js +3 -0
- package/dist-runtime/extensions/together/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/together/package.json +12 -0
- package/dist-runtime/extensions/twitch/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/twitch/package.json +27 -0
- package/dist-runtime/extensions/venice/index.js +3 -0
- package/dist-runtime/extensions/venice/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/venice/package.json +12 -0
- package/dist-runtime/extensions/vercel-ai-gateway/index.js +3 -0
- package/dist-runtime/extensions/vercel-ai-gateway/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/vercel-ai-gateway/package.json +12 -0
- package/dist-runtime/extensions/vllm/index.js +3 -0
- package/dist-runtime/extensions/vllm/openclaw.plugin.json +28 -0
- package/dist-runtime/extensions/vllm/package.json +12 -0
- package/dist-runtime/extensions/voice-call/index.js +3 -0
- package/dist-runtime/extensions/voice-call/openclaw.plugin.json +648 -0
- package/dist-runtime/extensions/voice-call/package.json +31 -0
- package/dist-runtime/extensions/volcengine/index.js +3 -0
- package/dist-runtime/extensions/volcengine/openclaw.plugin.json +32 -0
- package/dist-runtime/extensions/volcengine/package.json +12 -0
- package/dist-runtime/extensions/whatsapp/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/whatsapp/package.json +44 -0
- package/dist-runtime/extensions/xai/index.js +3 -0
- package/dist-runtime/extensions/xai/openclaw.plugin.json +65 -0
- package/dist-runtime/extensions/xai/package.json +12 -0
- package/dist-runtime/extensions/xiaomi/index.js +3 -0
- package/dist-runtime/extensions/xiaomi/openclaw.plugin.json +31 -0
- package/dist-runtime/extensions/xiaomi/package.json +12 -0
- package/dist-runtime/extensions/zai/index.js +3 -0
- package/dist-runtime/extensions/zai/openclaw.plugin.json +88 -0
- package/dist-runtime/extensions/zai/package.json +12 -0
- package/dist-runtime/extensions/zalo/index.js +3 -0
- package/dist-runtime/extensions/zalo/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/zalo/package.json +48 -0
- package/dist-runtime/extensions/zalo/setup-entry.js +3 -0
- package/dist-runtime/extensions/zalouser/openclaw.plugin.json +11 -0
- package/dist-runtime/extensions/zalouser/package.json +49 -0
- package/openclaw.mjs +135 -0
- package/package.json +673 -0
- package/skills/1password/SKILL.md +70 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/apple-notes/SKILL.md +77 -0
- package/skills/apple-reminders/SKILL.md +118 -0
- package/skills/bear-notes/SKILL.md +107 -0
- package/skills/blogwatcher/SKILL.md +69 -0
- package/skills/blucli/SKILL.md +47 -0
- package/skills/bluebubbles/SKILL.md +131 -0
- package/skills/camsnap/SKILL.md +45 -0
- package/skills/canvas/SKILL.md +198 -0
- package/skills/clawhub/SKILL.md +77 -0
- package/skills/coding-agent/SKILL.md +295 -0
- package/skills/discord/SKILL.md +197 -0
- package/skills/doubao-code/SKILL.md +43 -0
- package/skills/eightctl/SKILL.md +50 -0
- package/skills/gemini/SKILL.md +43 -0
- package/skills/gh-issues/SKILL.md +865 -0
- package/skills/gifgrep/SKILL.md +79 -0
- package/skills/github/SKILL.md +163 -0
- package/skills/gog/SKILL.md +116 -0
- package/skills/goplaces/SKILL.md +52 -0
- package/skills/healthcheck/SKILL.md +245 -0
- package/skills/himalaya/SKILL.md +257 -0
- package/skills/himalaya/references/configuration.md +184 -0
- package/skills/himalaya/references/message-composition.md +199 -0
- package/skills/imsg/SKILL.md +122 -0
- package/skills/kimi-code/SKILL.md +42 -0
- package/skills/mcporter/SKILL.md +61 -0
- package/skills/model-usage/SKILL.md +69 -0
- package/skills/model-usage/references/codexbar-cli.md +33 -0
- package/skills/model-usage/scripts/model_usage.py +320 -0
- package/skills/model-usage/scripts/test_model_usage.py +40 -0
- package/skills/nano-pdf/SKILL.md +38 -0
- package/skills/node-connect/SKILL.md +142 -0
- package/skills/notion/SKILL.md +174 -0
- package/skills/obsidian/SKILL.md +81 -0
- package/skills/openai-image-gen/SKILL.md +92 -0
- package/skills/openai-image-gen/scripts/gen.py +328 -0
- package/skills/openai-image-gen/scripts/test_gen.py +140 -0
- package/skills/openai-whisper/SKILL.md +38 -0
- package/skills/openai-whisper-api/SKILL.md +52 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
- package/skills/openhue/SKILL.md +112 -0
- package/skills/oracle/SKILL.md +125 -0
- package/skills/ordercli/SKILL.md +78 -0
- package/skills/peekaboo/SKILL.md +190 -0
- package/skills/sag/SKILL.md +87 -0
- package/skills/session-logs/SKILL.md +115 -0
- package/skills/sherpa-onnx-tts/SKILL.md +103 -0
- package/skills/skill-creator/SKILL.md +372 -0
- package/skills/skill-creator/license.txt +202 -0
- package/skills/skill-creator/scripts/init_skill.py +378 -0
- package/skills/skill-creator/scripts/package_skill.py +139 -0
- package/skills/skill-creator/scripts/quick_validate.py +159 -0
- package/skills/skill-creator/scripts/test_package_skill.py +160 -0
- package/skills/skill-creator/scripts/test_quick_validate.py +72 -0
- package/skills/slack/SKILL.md +144 -0
- package/skills/songsee/SKILL.md +49 -0
- package/skills/sonoscli/SKILL.md +65 -0
- package/skills/spotify-player/SKILL.md +64 -0
- package/skills/summarize/SKILL.md +87 -0
- package/skills/things-mac/SKILL.md +86 -0
- package/skills/tmux/SKILL.md +153 -0
- package/skills/tmux/scripts/find-sessions.sh +112 -0
- package/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/skills/trello/SKILL.md +95 -0
- package/skills/video-frames/SKILL.md +46 -0
- package/skills/video-frames/scripts/frame.sh +81 -0
- package/skills/voice-call/SKILL.md +45 -0
- package/skills/wacli/SKILL.md +72 -0
- package/skills/weather/SKILL.md +112 -0
- package/skills/xurl/SKILL.md +461 -0
|
@@ -0,0 +1,4226 @@
|
|
|
1
|
+
import { r as formatErrorMessage } from "./errors-BxyFnvP3.js";
|
|
2
|
+
import { t as createSubsystemLogger } from "./subsystem-CUp-6QQf.js";
|
|
3
|
+
import { t as isTruthyEnvValue } from "./env-BP70DGuy.js";
|
|
4
|
+
import { E as truncateUtf16Safe, y as resolveUserPath } from "./utils-Bxk6BLTg.js";
|
|
5
|
+
import { a as resolveAgentDir, p as resolveAgentWorkspaceDir } from "./agent-scope-DPP4Z_UU.js";
|
|
6
|
+
import { r as normalizeProviderId } from "./provider-id-BpXo5t6v.js";
|
|
7
|
+
import { a as hasConfiguredSecretInput, c as normalizeResolvedSecretInputString } from "./types.secrets-BWSeXrF4.js";
|
|
8
|
+
import { t as normalizeOptionalSecretInput } from "./normalize-secret-input-_PgpexOG.js";
|
|
9
|
+
import { c as resolveSessionTranscriptsDirForAgent } from "./paths-CTjJI9l0.js";
|
|
10
|
+
import { n as onSessionTranscriptUpdate } from "./transcript-events-B1V6z5ct.js";
|
|
11
|
+
import { t as resolveEnvApiKey } from "./model-auth-env-CF9ts7Th.js";
|
|
12
|
+
import { o as requireApiKey, s as resolveApiKeyForProvider } from "./model-auth-Blh0xL9g.js";
|
|
13
|
+
import { r as OPENAI_DEFAULT_EMBEDDING_MODEL } from "./openai-defaults-B7FUywsh.js";
|
|
14
|
+
import { n as retryAsync, u as resolveOllamaApiBase } from "./retry-D15TD1S3.js";
|
|
15
|
+
import { n as fetchWithSsrFGuard } from "./fetch-guard-DIyN1HW5.js";
|
|
16
|
+
import { t as parseGeminiAuth } from "./gemini-auth-B5ljg7jr.js";
|
|
17
|
+
import { i as getMemoryMultimodalExtensions, r as classifyMemoryMultimodalPath, t as buildCaseInsensitiveExtensionGlob } from "./multimodal-DC43jYNv.js";
|
|
18
|
+
import { t as resolveMemorySearchConfig } from "./memory-search-Das1tiuB.js";
|
|
19
|
+
import { C as estimateUtf8Bytes, S as estimateStructuredEmbeddingInputBytes, _ as remapChunkLines, a as listSessionFilesForAgent, b as statRegularFile, c as buildMultimodalChunkForIndexing, d as ensureDir, f as hashText, g as parseEmbedding, h as normalizeExtraMemoryPaths, i as buildSessionEntry, l as chunkMarkdown, m as listMemoryFiles, o as sessionPathForFile, p as isMemoryPath, r as requireNodeSqlite, s as buildFileEntry, t as extractKeywords, u as cosineSimilarity, v as runWithConcurrency, w as splitTextToUtf8ByteLimit, x as hasNonTextEmbeddingParts, y as isFileMissingError } from "./query-expansion-Do45hILP.js";
|
|
20
|
+
import fs from "node:fs";
|
|
21
|
+
import path from "node:path";
|
|
22
|
+
import fs$1 from "node:fs/promises";
|
|
23
|
+
import { randomUUID } from "node:crypto";
|
|
24
|
+
import { Readable } from "node:stream";
|
|
25
|
+
import chokidar from "chokidar";
|
|
26
|
+
import { createInterface } from "node:readline";
|
|
27
|
+
//#region src/agents/live-auth-keys.ts
|
|
28
|
+
const KEY_SPLIT_RE = /[\s,;]+/g;
|
|
29
|
+
const GOOGLE_LIVE_SINGLE_KEY = "OPENCLAW_LIVE_GEMINI_KEY";
|
|
30
|
+
const PROVIDER_PREFIX_OVERRIDES = {
|
|
31
|
+
google: "GEMINI",
|
|
32
|
+
"google-vertex": "GEMINI"
|
|
33
|
+
};
|
|
34
|
+
const PROVIDER_API_KEY_CONFIG = {
|
|
35
|
+
anthropic: {
|
|
36
|
+
liveSingle: "OPENCLAW_LIVE_ANTHROPIC_KEY",
|
|
37
|
+
listVar: "OPENCLAW_LIVE_ANTHROPIC_KEYS",
|
|
38
|
+
primaryVar: "ANTHROPIC_API_KEY",
|
|
39
|
+
prefixedVar: "ANTHROPIC_API_KEY_"
|
|
40
|
+
},
|
|
41
|
+
google: {
|
|
42
|
+
liveSingle: GOOGLE_LIVE_SINGLE_KEY,
|
|
43
|
+
listVar: "GEMINI_API_KEYS",
|
|
44
|
+
primaryVar: "GEMINI_API_KEY",
|
|
45
|
+
prefixedVar: "GEMINI_API_KEY_"
|
|
46
|
+
},
|
|
47
|
+
"google-vertex": {
|
|
48
|
+
liveSingle: GOOGLE_LIVE_SINGLE_KEY,
|
|
49
|
+
listVar: "GEMINI_API_KEYS",
|
|
50
|
+
primaryVar: "GEMINI_API_KEY",
|
|
51
|
+
prefixedVar: "GEMINI_API_KEY_"
|
|
52
|
+
},
|
|
53
|
+
openai: {
|
|
54
|
+
liveSingle: "OPENCLAW_LIVE_OPENAI_KEY",
|
|
55
|
+
listVar: "OPENAI_API_KEYS",
|
|
56
|
+
primaryVar: "OPENAI_API_KEY",
|
|
57
|
+
prefixedVar: "OPENAI_API_KEY_"
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
function parseKeyList(raw) {
|
|
61
|
+
if (!raw) return [];
|
|
62
|
+
return raw.split(KEY_SPLIT_RE).map((value) => value.trim()).filter(Boolean);
|
|
63
|
+
}
|
|
64
|
+
function collectEnvPrefixedKeys(prefix) {
|
|
65
|
+
const keys = [];
|
|
66
|
+
for (const [name, value] of Object.entries(process.env)) {
|
|
67
|
+
if (!name.startsWith(prefix)) continue;
|
|
68
|
+
const trimmed = value?.trim();
|
|
69
|
+
if (!trimmed) continue;
|
|
70
|
+
keys.push(trimmed);
|
|
71
|
+
}
|
|
72
|
+
return keys;
|
|
73
|
+
}
|
|
74
|
+
function resolveProviderApiKeyConfig(provider) {
|
|
75
|
+
const normalized = normalizeProviderId(provider);
|
|
76
|
+
const custom = PROVIDER_API_KEY_CONFIG[normalized];
|
|
77
|
+
const base = PROVIDER_PREFIX_OVERRIDES[normalized] ?? normalized.toUpperCase().replace(/-/g, "_");
|
|
78
|
+
const liveSingle = custom?.liveSingle ?? `OPENCLAW_LIVE_${base}_KEY`;
|
|
79
|
+
const listVar = custom?.listVar ?? `${base}_API_KEYS`;
|
|
80
|
+
const primaryVar = custom?.primaryVar ?? `${base}_API_KEY`;
|
|
81
|
+
const prefixedVar = custom?.prefixedVar ?? `${base}_API_KEY_`;
|
|
82
|
+
if (normalized === "google" || normalized === "google-vertex") return {
|
|
83
|
+
liveSingle,
|
|
84
|
+
listVar,
|
|
85
|
+
primaryVar,
|
|
86
|
+
prefixedVar,
|
|
87
|
+
fallbackVars: ["GOOGLE_API_KEY"]
|
|
88
|
+
};
|
|
89
|
+
return {
|
|
90
|
+
liveSingle,
|
|
91
|
+
listVar,
|
|
92
|
+
primaryVar,
|
|
93
|
+
prefixedVar,
|
|
94
|
+
fallbackVars: []
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function collectProviderApiKeys(provider) {
|
|
98
|
+
const config = resolveProviderApiKeyConfig(provider);
|
|
99
|
+
const forcedSingle = config.liveSingle ? process.env[config.liveSingle]?.trim() : void 0;
|
|
100
|
+
if (forcedSingle) return [forcedSingle];
|
|
101
|
+
const fromList = parseKeyList(config.listVar ? process.env[config.listVar] : void 0);
|
|
102
|
+
const primary = config.primaryVar ? process.env[config.primaryVar]?.trim() : void 0;
|
|
103
|
+
const fromPrefixed = config.prefixedVar ? collectEnvPrefixedKeys(config.prefixedVar) : [];
|
|
104
|
+
const fallback = config.fallbackVars.map((envVar) => process.env[envVar]?.trim()).filter(Boolean);
|
|
105
|
+
const seen = /* @__PURE__ */ new Set();
|
|
106
|
+
const add = (value) => {
|
|
107
|
+
if (!value) return;
|
|
108
|
+
if (seen.has(value)) return;
|
|
109
|
+
seen.add(value);
|
|
110
|
+
};
|
|
111
|
+
for (const value of fromList) add(value);
|
|
112
|
+
add(primary);
|
|
113
|
+
for (const value of fromPrefixed) add(value);
|
|
114
|
+
for (const value of fallback) add(value);
|
|
115
|
+
return Array.from(seen);
|
|
116
|
+
}
|
|
117
|
+
function isApiKeyRateLimitError(message) {
|
|
118
|
+
const lower = message.toLowerCase();
|
|
119
|
+
if (lower.includes("rate_limit")) return true;
|
|
120
|
+
if (lower.includes("rate limit")) return true;
|
|
121
|
+
if (lower.includes("429")) return true;
|
|
122
|
+
if (lower.includes("quota exceeded") || lower.includes("quota_exceeded")) return true;
|
|
123
|
+
if (lower.includes("resource exhausted") || lower.includes("resource_exhausted")) return true;
|
|
124
|
+
if (lower.includes("too many requests")) return true;
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/agents/api-key-rotation.ts
|
|
129
|
+
function dedupeApiKeys(raw) {
|
|
130
|
+
const seen = /* @__PURE__ */ new Set();
|
|
131
|
+
const keys = [];
|
|
132
|
+
for (const value of raw) {
|
|
133
|
+
const apiKey = value.trim();
|
|
134
|
+
if (!apiKey || seen.has(apiKey)) continue;
|
|
135
|
+
seen.add(apiKey);
|
|
136
|
+
keys.push(apiKey);
|
|
137
|
+
}
|
|
138
|
+
return keys;
|
|
139
|
+
}
|
|
140
|
+
function collectProviderApiKeysForExecution(params) {
|
|
141
|
+
const { primaryApiKey, provider } = params;
|
|
142
|
+
return dedupeApiKeys([primaryApiKey?.trim() ?? "", ...collectProviderApiKeys(provider)]);
|
|
143
|
+
}
|
|
144
|
+
async function executeWithApiKeyRotation(params) {
|
|
145
|
+
const keys = dedupeApiKeys(params.apiKeys);
|
|
146
|
+
if (keys.length === 0) throw new Error(`No API keys configured for provider "${params.provider}".`);
|
|
147
|
+
let lastError;
|
|
148
|
+
for (let attempt = 0; attempt < keys.length; attempt += 1) {
|
|
149
|
+
const apiKey = keys[attempt];
|
|
150
|
+
try {
|
|
151
|
+
return await params.execute(apiKey);
|
|
152
|
+
} catch (error) {
|
|
153
|
+
lastError = error;
|
|
154
|
+
const message = formatErrorMessage(error);
|
|
155
|
+
if (!(params.shouldRetry ? params.shouldRetry({
|
|
156
|
+
apiKey,
|
|
157
|
+
error,
|
|
158
|
+
attempt,
|
|
159
|
+
message
|
|
160
|
+
}) : isApiKeyRateLimitError(message)) || attempt + 1 >= keys.length) break;
|
|
161
|
+
params.onRetry?.({
|
|
162
|
+
apiKey,
|
|
163
|
+
error,
|
|
164
|
+
attempt,
|
|
165
|
+
message
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (lastError === void 0) throw new Error(`Failed to run API request for ${params.provider}.`);
|
|
170
|
+
throw lastError;
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/memory/embedding-vectors.ts
|
|
174
|
+
function sanitizeAndNormalizeEmbedding(vec) {
|
|
175
|
+
const sanitized = vec.map((value) => Number.isFinite(value) ? value : 0);
|
|
176
|
+
const magnitude = Math.sqrt(sanitized.reduce((sum, value) => sum + value * value, 0));
|
|
177
|
+
if (magnitude < 1e-10) return sanitized;
|
|
178
|
+
return sanitized.map((value) => value / magnitude);
|
|
179
|
+
}
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region src/memory/embeddings-debug.ts
|
|
182
|
+
const debugEmbeddings = isTruthyEnvValue(process.env.OPENCLAW_DEBUG_MEMORY_EMBEDDINGS);
|
|
183
|
+
const log$3 = createSubsystemLogger("memory/embeddings");
|
|
184
|
+
function debugEmbeddingsLog(message, meta) {
|
|
185
|
+
if (!debugEmbeddings) return;
|
|
186
|
+
const suffix = meta ? ` ${JSON.stringify(meta)}` : "";
|
|
187
|
+
log$3.raw(`${message}${suffix}`);
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/memory/remote-http.ts
|
|
191
|
+
function buildRemoteBaseUrlPolicy(baseUrl) {
|
|
192
|
+
const trimmed = baseUrl.trim();
|
|
193
|
+
if (!trimmed) return;
|
|
194
|
+
try {
|
|
195
|
+
const parsed = new URL(trimmed);
|
|
196
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return;
|
|
197
|
+
return { allowedHostnames: [parsed.hostname] };
|
|
198
|
+
} catch {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
async function withRemoteHttpResponse(params) {
|
|
203
|
+
const { response, release } = await fetchWithSsrFGuard({
|
|
204
|
+
url: params.url,
|
|
205
|
+
init: params.init,
|
|
206
|
+
policy: params.ssrfPolicy,
|
|
207
|
+
auditContext: params.auditContext ?? "memory-remote"
|
|
208
|
+
});
|
|
209
|
+
try {
|
|
210
|
+
return await params.onResponse(response);
|
|
211
|
+
} finally {
|
|
212
|
+
await release();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/memory/secret-input.ts
|
|
217
|
+
function hasConfiguredMemorySecretInput(value) {
|
|
218
|
+
return hasConfiguredSecretInput(value);
|
|
219
|
+
}
|
|
220
|
+
function resolveMemorySecretInputString(params) {
|
|
221
|
+
return normalizeResolvedSecretInputString({
|
|
222
|
+
value: params.value,
|
|
223
|
+
path: params.path
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/memory/embeddings-gemini.ts
|
|
228
|
+
const DEFAULT_GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
229
|
+
const DEFAULT_GEMINI_EMBEDDING_MODEL = "gemini-embedding-001";
|
|
230
|
+
const GEMINI_MAX_INPUT_TOKENS = { "text-embedding-004": 2048 };
|
|
231
|
+
const GEMINI_EMBEDDING_2_MODELS = new Set(["gemini-embedding-2-preview"]);
|
|
232
|
+
const GEMINI_EMBEDDING_2_DEFAULT_DIMENSIONS = 3072;
|
|
233
|
+
const GEMINI_EMBEDDING_2_VALID_DIMENSIONS = [
|
|
234
|
+
768,
|
|
235
|
+
1536,
|
|
236
|
+
3072
|
|
237
|
+
];
|
|
238
|
+
/** Builds the text-only Gemini embedding request shape used across direct and batch APIs. */
|
|
239
|
+
function buildGeminiTextEmbeddingRequest(params) {
|
|
240
|
+
return buildGeminiEmbeddingRequest({
|
|
241
|
+
input: { text: params.text },
|
|
242
|
+
taskType: params.taskType,
|
|
243
|
+
outputDimensionality: params.outputDimensionality,
|
|
244
|
+
modelPath: params.modelPath
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
function buildGeminiEmbeddingRequest(params) {
|
|
248
|
+
const request = {
|
|
249
|
+
content: { parts: params.input.parts?.map((part) => part.type === "text" ? { text: part.text } : { inlineData: {
|
|
250
|
+
mimeType: part.mimeType,
|
|
251
|
+
data: part.data
|
|
252
|
+
} }) ?? [{ text: params.input.text }] },
|
|
253
|
+
taskType: params.taskType
|
|
254
|
+
};
|
|
255
|
+
if (params.modelPath) request.model = params.modelPath;
|
|
256
|
+
if (params.outputDimensionality != null) request.outputDimensionality = params.outputDimensionality;
|
|
257
|
+
return request;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Returns true if the given model name is a gemini-embedding-2 variant that
|
|
261
|
+
* supports `outputDimensionality` and extended task types.
|
|
262
|
+
*/
|
|
263
|
+
function isGeminiEmbedding2Model(model) {
|
|
264
|
+
return GEMINI_EMBEDDING_2_MODELS.has(model);
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Validate and return the `outputDimensionality` for gemini-embedding-2 models.
|
|
268
|
+
* Returns `undefined` for older models (they don't support the param).
|
|
269
|
+
*/
|
|
270
|
+
function resolveGeminiOutputDimensionality(model, requested) {
|
|
271
|
+
if (!isGeminiEmbedding2Model(model)) return;
|
|
272
|
+
if (requested == null) return GEMINI_EMBEDDING_2_DEFAULT_DIMENSIONS;
|
|
273
|
+
const valid = GEMINI_EMBEDDING_2_VALID_DIMENSIONS;
|
|
274
|
+
if (!valid.includes(requested)) throw new Error(`Invalid outputDimensionality ${requested} for ${model}. Valid values: ${valid.join(", ")}`);
|
|
275
|
+
return requested;
|
|
276
|
+
}
|
|
277
|
+
function resolveRemoteApiKey(remoteApiKey) {
|
|
278
|
+
const trimmed = resolveMemorySecretInputString({
|
|
279
|
+
value: remoteApiKey,
|
|
280
|
+
path: "agents.*.memorySearch.remote.apiKey"
|
|
281
|
+
});
|
|
282
|
+
if (!trimmed) return;
|
|
283
|
+
if (trimmed === "GOOGLE_API_KEY" || trimmed === "GEMINI_API_KEY") return process.env[trimmed]?.trim();
|
|
284
|
+
return trimmed;
|
|
285
|
+
}
|
|
286
|
+
function normalizeGeminiModel(model) {
|
|
287
|
+
const trimmed = model.trim();
|
|
288
|
+
if (!trimmed) return DEFAULT_GEMINI_EMBEDDING_MODEL;
|
|
289
|
+
const withoutPrefix = trimmed.replace(/^models\//, "");
|
|
290
|
+
if (withoutPrefix.startsWith("gemini/")) return withoutPrefix.slice(7);
|
|
291
|
+
if (withoutPrefix.startsWith("google/")) return withoutPrefix.slice(7);
|
|
292
|
+
return withoutPrefix;
|
|
293
|
+
}
|
|
294
|
+
async function fetchGeminiEmbeddingPayload(params) {
|
|
295
|
+
return await executeWithApiKeyRotation({
|
|
296
|
+
provider: "google",
|
|
297
|
+
apiKeys: params.client.apiKeys,
|
|
298
|
+
execute: async (apiKey) => {
|
|
299
|
+
const headers = {
|
|
300
|
+
...parseGeminiAuth(apiKey).headers,
|
|
301
|
+
...params.client.headers
|
|
302
|
+
};
|
|
303
|
+
return await withRemoteHttpResponse({
|
|
304
|
+
url: params.endpoint,
|
|
305
|
+
ssrfPolicy: params.client.ssrfPolicy,
|
|
306
|
+
init: {
|
|
307
|
+
method: "POST",
|
|
308
|
+
headers,
|
|
309
|
+
body: JSON.stringify(params.body)
|
|
310
|
+
},
|
|
311
|
+
onResponse: async (res) => {
|
|
312
|
+
if (!res.ok) {
|
|
313
|
+
const text = await res.text();
|
|
314
|
+
throw new Error(`gemini embeddings failed: ${res.status} ${text}`);
|
|
315
|
+
}
|
|
316
|
+
return await res.json();
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
function normalizeGeminiBaseUrl(raw) {
|
|
323
|
+
const trimmed = raw.replace(/\/+$/, "");
|
|
324
|
+
const openAiIndex = trimmed.indexOf("/openai");
|
|
325
|
+
if (openAiIndex > -1) return trimmed.slice(0, openAiIndex);
|
|
326
|
+
return trimmed;
|
|
327
|
+
}
|
|
328
|
+
function buildGeminiModelPath(model) {
|
|
329
|
+
return model.startsWith("models/") ? model : `models/${model}`;
|
|
330
|
+
}
|
|
331
|
+
async function createGeminiEmbeddingProvider(options) {
|
|
332
|
+
const client = await resolveGeminiEmbeddingClient(options);
|
|
333
|
+
const baseUrl = client.baseUrl.replace(/\/$/, "");
|
|
334
|
+
const embedUrl = `${baseUrl}/${client.modelPath}:embedContent`;
|
|
335
|
+
const batchUrl = `${baseUrl}/${client.modelPath}:batchEmbedContents`;
|
|
336
|
+
const isV2 = isGeminiEmbedding2Model(client.model);
|
|
337
|
+
const outputDimensionality = client.outputDimensionality;
|
|
338
|
+
const embedQuery = async (text) => {
|
|
339
|
+
if (!text.trim()) return [];
|
|
340
|
+
return sanitizeAndNormalizeEmbedding((await fetchGeminiEmbeddingPayload({
|
|
341
|
+
client,
|
|
342
|
+
endpoint: embedUrl,
|
|
343
|
+
body: buildGeminiTextEmbeddingRequest({
|
|
344
|
+
text,
|
|
345
|
+
taskType: options.taskType ?? "RETRIEVAL_QUERY",
|
|
346
|
+
outputDimensionality: isV2 ? outputDimensionality : void 0
|
|
347
|
+
})
|
|
348
|
+
})).embedding?.values ?? []);
|
|
349
|
+
};
|
|
350
|
+
const embedBatchInputs = async (inputs) => {
|
|
351
|
+
if (inputs.length === 0) return [];
|
|
352
|
+
const payload = await fetchGeminiEmbeddingPayload({
|
|
353
|
+
client,
|
|
354
|
+
endpoint: batchUrl,
|
|
355
|
+
body: { requests: inputs.map((input) => buildGeminiEmbeddingRequest({
|
|
356
|
+
input,
|
|
357
|
+
modelPath: client.modelPath,
|
|
358
|
+
taskType: options.taskType ?? "RETRIEVAL_DOCUMENT",
|
|
359
|
+
outputDimensionality: isV2 ? outputDimensionality : void 0
|
|
360
|
+
})) }
|
|
361
|
+
});
|
|
362
|
+
const embeddings = Array.isArray(payload.embeddings) ? payload.embeddings : [];
|
|
363
|
+
return inputs.map((_, index) => sanitizeAndNormalizeEmbedding(embeddings[index]?.values ?? []));
|
|
364
|
+
};
|
|
365
|
+
const embedBatch = async (texts) => {
|
|
366
|
+
return await embedBatchInputs(texts.map((text) => ({ text })));
|
|
367
|
+
};
|
|
368
|
+
return {
|
|
369
|
+
provider: {
|
|
370
|
+
id: "gemini",
|
|
371
|
+
model: client.model,
|
|
372
|
+
maxInputTokens: GEMINI_MAX_INPUT_TOKENS[client.model],
|
|
373
|
+
embedQuery,
|
|
374
|
+
embedBatch,
|
|
375
|
+
embedBatchInputs
|
|
376
|
+
},
|
|
377
|
+
client
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
async function resolveGeminiEmbeddingClient(options) {
|
|
381
|
+
const remote = options.remote;
|
|
382
|
+
const remoteApiKey = resolveRemoteApiKey(remote?.apiKey);
|
|
383
|
+
const remoteBaseUrl = remote?.baseUrl?.trim();
|
|
384
|
+
const apiKey = remoteApiKey ? remoteApiKey : requireApiKey(await resolveApiKeyForProvider({
|
|
385
|
+
provider: "google",
|
|
386
|
+
cfg: options.config,
|
|
387
|
+
agentDir: options.agentDir
|
|
388
|
+
}), "google");
|
|
389
|
+
const providerConfig = options.config.models?.providers?.google;
|
|
390
|
+
const rawBaseUrl = remoteBaseUrl || providerConfig?.baseUrl?.trim() || DEFAULT_GEMINI_BASE_URL;
|
|
391
|
+
const baseUrl = normalizeGeminiBaseUrl(rawBaseUrl);
|
|
392
|
+
const ssrfPolicy = buildRemoteBaseUrlPolicy(baseUrl);
|
|
393
|
+
const headers = { ...Object.assign({}, providerConfig?.headers, remote?.headers) };
|
|
394
|
+
const apiKeys = collectProviderApiKeysForExecution({
|
|
395
|
+
provider: "google",
|
|
396
|
+
primaryApiKey: apiKey
|
|
397
|
+
});
|
|
398
|
+
const model = normalizeGeminiModel(options.model);
|
|
399
|
+
const modelPath = buildGeminiModelPath(model);
|
|
400
|
+
const outputDimensionality = resolveGeminiOutputDimensionality(model, options.outputDimensionality);
|
|
401
|
+
debugEmbeddingsLog("memory embeddings: gemini client", {
|
|
402
|
+
rawBaseUrl,
|
|
403
|
+
baseUrl,
|
|
404
|
+
model,
|
|
405
|
+
modelPath,
|
|
406
|
+
outputDimensionality,
|
|
407
|
+
embedEndpoint: `${baseUrl}/${modelPath}:embedContent`,
|
|
408
|
+
batchEndpoint: `${baseUrl}/${modelPath}:batchEmbedContents`
|
|
409
|
+
});
|
|
410
|
+
return {
|
|
411
|
+
baseUrl,
|
|
412
|
+
headers,
|
|
413
|
+
ssrfPolicy,
|
|
414
|
+
model,
|
|
415
|
+
modelPath,
|
|
416
|
+
apiKeys,
|
|
417
|
+
outputDimensionality
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
//#endregion
|
|
421
|
+
//#region src/memory/embeddings-model-normalize.ts
|
|
422
|
+
function normalizeEmbeddingModelWithPrefixes(params) {
|
|
423
|
+
const trimmed = params.model.trim();
|
|
424
|
+
if (!trimmed) return params.defaultModel;
|
|
425
|
+
for (const prefix of params.prefixes) if (trimmed.startsWith(prefix)) return trimmed.slice(prefix.length);
|
|
426
|
+
return trimmed;
|
|
427
|
+
}
|
|
428
|
+
//#endregion
|
|
429
|
+
//#region src/memory/embeddings-remote-client.ts
|
|
430
|
+
async function resolveRemoteEmbeddingBearerClient(params) {
|
|
431
|
+
const remote = params.options.remote;
|
|
432
|
+
const remoteApiKey = resolveMemorySecretInputString({
|
|
433
|
+
value: remote?.apiKey,
|
|
434
|
+
path: "agents.*.memorySearch.remote.apiKey"
|
|
435
|
+
});
|
|
436
|
+
const remoteBaseUrl = remote?.baseUrl?.trim();
|
|
437
|
+
const providerConfig = params.options.config.models?.providers?.[params.provider];
|
|
438
|
+
const apiKey = remoteApiKey ? remoteApiKey : requireApiKey(await resolveApiKeyForProvider({
|
|
439
|
+
provider: params.provider,
|
|
440
|
+
cfg: params.options.config,
|
|
441
|
+
agentDir: params.options.agentDir
|
|
442
|
+
}), params.provider);
|
|
443
|
+
const baseUrl = remoteBaseUrl || providerConfig?.baseUrl?.trim() || params.defaultBaseUrl;
|
|
444
|
+
const headerOverrides = Object.assign({}, providerConfig?.headers, remote?.headers);
|
|
445
|
+
return {
|
|
446
|
+
baseUrl,
|
|
447
|
+
headers: {
|
|
448
|
+
"Content-Type": "application/json",
|
|
449
|
+
Authorization: `Bearer ${apiKey}`,
|
|
450
|
+
...headerOverrides
|
|
451
|
+
},
|
|
452
|
+
ssrfPolicy: buildRemoteBaseUrlPolicy(baseUrl)
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region src/memory/post-json.ts
|
|
457
|
+
async function postJson(params) {
|
|
458
|
+
return await withRemoteHttpResponse({
|
|
459
|
+
url: params.url,
|
|
460
|
+
ssrfPolicy: params.ssrfPolicy,
|
|
461
|
+
init: {
|
|
462
|
+
method: "POST",
|
|
463
|
+
headers: params.headers,
|
|
464
|
+
body: JSON.stringify(params.body)
|
|
465
|
+
},
|
|
466
|
+
onResponse: async (res) => {
|
|
467
|
+
if (!res.ok) {
|
|
468
|
+
const text = await res.text();
|
|
469
|
+
const err = /* @__PURE__ */ new Error(`${params.errorPrefix}: ${res.status} ${text}`);
|
|
470
|
+
if (params.attachStatus) err.status = res.status;
|
|
471
|
+
throw err;
|
|
472
|
+
}
|
|
473
|
+
return await params.parse(await res.json());
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region src/memory/embeddings-remote-fetch.ts
|
|
479
|
+
async function fetchRemoteEmbeddingVectors(params) {
|
|
480
|
+
return await postJson({
|
|
481
|
+
url: params.url,
|
|
482
|
+
headers: params.headers,
|
|
483
|
+
ssrfPolicy: params.ssrfPolicy,
|
|
484
|
+
body: params.body,
|
|
485
|
+
errorPrefix: params.errorPrefix,
|
|
486
|
+
parse: (payload) => {
|
|
487
|
+
return (payload.data ?? []).map((entry) => entry.embedding ?? []);
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
//#endregion
|
|
492
|
+
//#region src/memory/embeddings-remote-provider.ts
|
|
493
|
+
function createRemoteEmbeddingProvider(params) {
|
|
494
|
+
const { client } = params;
|
|
495
|
+
const url = `${client.baseUrl.replace(/\/$/, "")}/embeddings`;
|
|
496
|
+
const embed = async (input) => {
|
|
497
|
+
if (input.length === 0) return [];
|
|
498
|
+
return await fetchRemoteEmbeddingVectors({
|
|
499
|
+
url,
|
|
500
|
+
headers: client.headers,
|
|
501
|
+
ssrfPolicy: client.ssrfPolicy,
|
|
502
|
+
body: {
|
|
503
|
+
model: client.model,
|
|
504
|
+
input
|
|
505
|
+
},
|
|
506
|
+
errorPrefix: params.errorPrefix
|
|
507
|
+
});
|
|
508
|
+
};
|
|
509
|
+
return {
|
|
510
|
+
id: params.id,
|
|
511
|
+
model: client.model,
|
|
512
|
+
...typeof params.maxInputTokens === "number" ? { maxInputTokens: params.maxInputTokens } : {},
|
|
513
|
+
embedQuery: async (text) => {
|
|
514
|
+
const [vec] = await embed([text]);
|
|
515
|
+
return vec ?? [];
|
|
516
|
+
},
|
|
517
|
+
embedBatch: embed
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
async function resolveRemoteEmbeddingClient(params) {
|
|
521
|
+
const { baseUrl, headers, ssrfPolicy } = await resolveRemoteEmbeddingBearerClient({
|
|
522
|
+
provider: params.provider,
|
|
523
|
+
options: params.options,
|
|
524
|
+
defaultBaseUrl: params.defaultBaseUrl
|
|
525
|
+
});
|
|
526
|
+
return {
|
|
527
|
+
baseUrl,
|
|
528
|
+
headers,
|
|
529
|
+
ssrfPolicy,
|
|
530
|
+
model: params.normalizeModel(params.options.model)
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
//#endregion
|
|
534
|
+
//#region src/memory/embeddings-mistral.ts
|
|
535
|
+
const DEFAULT_MISTRAL_EMBEDDING_MODEL = "mistral-embed";
|
|
536
|
+
const DEFAULT_MISTRAL_BASE_URL = "https://api.mistral.ai/v1";
|
|
537
|
+
function normalizeMistralModel(model) {
|
|
538
|
+
return normalizeEmbeddingModelWithPrefixes({
|
|
539
|
+
model,
|
|
540
|
+
defaultModel: DEFAULT_MISTRAL_EMBEDDING_MODEL,
|
|
541
|
+
prefixes: ["mistral/"]
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
async function createMistralEmbeddingProvider(options) {
|
|
545
|
+
const client = await resolveMistralEmbeddingClient(options);
|
|
546
|
+
return {
|
|
547
|
+
provider: createRemoteEmbeddingProvider({
|
|
548
|
+
id: "mistral",
|
|
549
|
+
client,
|
|
550
|
+
errorPrefix: "mistral embeddings failed"
|
|
551
|
+
}),
|
|
552
|
+
client
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
async function resolveMistralEmbeddingClient(options) {
|
|
556
|
+
return await resolveRemoteEmbeddingClient({
|
|
557
|
+
provider: "mistral",
|
|
558
|
+
options,
|
|
559
|
+
defaultBaseUrl: DEFAULT_MISTRAL_BASE_URL,
|
|
560
|
+
normalizeModel: normalizeMistralModel
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
//#endregion
|
|
564
|
+
//#region src/memory/embeddings-ollama.ts
|
|
565
|
+
const DEFAULT_OLLAMA_EMBEDDING_MODEL = "nomic-embed-text";
|
|
566
|
+
function normalizeOllamaModel(model) {
|
|
567
|
+
return normalizeEmbeddingModelWithPrefixes({
|
|
568
|
+
model,
|
|
569
|
+
defaultModel: DEFAULT_OLLAMA_EMBEDDING_MODEL,
|
|
570
|
+
prefixes: ["ollama/"]
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
function resolveOllamaApiKey(options) {
|
|
574
|
+
const remoteApiKey = resolveMemorySecretInputString({
|
|
575
|
+
value: options.remote?.apiKey,
|
|
576
|
+
path: "agents.*.memorySearch.remote.apiKey"
|
|
577
|
+
});
|
|
578
|
+
if (remoteApiKey) return remoteApiKey;
|
|
579
|
+
const providerApiKey = normalizeOptionalSecretInput(options.config.models?.providers?.ollama?.apiKey);
|
|
580
|
+
if (providerApiKey) return providerApiKey;
|
|
581
|
+
return resolveEnvApiKey("ollama")?.apiKey;
|
|
582
|
+
}
|
|
583
|
+
function resolveOllamaEmbeddingClient(options) {
|
|
584
|
+
const providerConfig = options.config.models?.providers?.ollama;
|
|
585
|
+
const baseUrl = resolveOllamaApiBase(options.remote?.baseUrl?.trim() || providerConfig?.baseUrl?.trim());
|
|
586
|
+
const model = normalizeOllamaModel(options.model);
|
|
587
|
+
const headerOverrides = Object.assign({}, providerConfig?.headers, options.remote?.headers);
|
|
588
|
+
const headers = {
|
|
589
|
+
"Content-Type": "application/json",
|
|
590
|
+
...headerOverrides
|
|
591
|
+
};
|
|
592
|
+
const apiKey = resolveOllamaApiKey(options);
|
|
593
|
+
if (apiKey) headers.Authorization = `Bearer ${apiKey}`;
|
|
594
|
+
return {
|
|
595
|
+
baseUrl,
|
|
596
|
+
headers,
|
|
597
|
+
ssrfPolicy: buildRemoteBaseUrlPolicy(baseUrl),
|
|
598
|
+
model
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
async function createOllamaEmbeddingProvider(options) {
|
|
602
|
+
const client = resolveOllamaEmbeddingClient(options);
|
|
603
|
+
const embedUrl = `${client.baseUrl.replace(/\/$/, "")}/api/embeddings`;
|
|
604
|
+
const embedOne = async (text) => {
|
|
605
|
+
const json = await withRemoteHttpResponse({
|
|
606
|
+
url: embedUrl,
|
|
607
|
+
ssrfPolicy: client.ssrfPolicy,
|
|
608
|
+
init: {
|
|
609
|
+
method: "POST",
|
|
610
|
+
headers: client.headers,
|
|
611
|
+
body: JSON.stringify({
|
|
612
|
+
model: client.model,
|
|
613
|
+
prompt: text
|
|
614
|
+
})
|
|
615
|
+
},
|
|
616
|
+
onResponse: async (res) => {
|
|
617
|
+
if (!res.ok) throw new Error(`Ollama embeddings HTTP ${res.status}: ${await res.text()}`);
|
|
618
|
+
return await res.json();
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
if (!Array.isArray(json.embedding)) throw new Error(`Ollama embeddings response missing embedding[]`);
|
|
622
|
+
return sanitizeAndNormalizeEmbedding(json.embedding);
|
|
623
|
+
};
|
|
624
|
+
const provider = {
|
|
625
|
+
id: "ollama",
|
|
626
|
+
model: client.model,
|
|
627
|
+
embedQuery: embedOne,
|
|
628
|
+
embedBatch: async (texts) => {
|
|
629
|
+
return await Promise.all(texts.map(embedOne));
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
return {
|
|
633
|
+
provider,
|
|
634
|
+
client: {
|
|
635
|
+
...client,
|
|
636
|
+
embedBatch: async (texts) => {
|
|
637
|
+
try {
|
|
638
|
+
return await provider.embedBatch(texts);
|
|
639
|
+
} catch (err) {
|
|
640
|
+
throw new Error(formatErrorMessage(err), { cause: err });
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
//#endregion
|
|
647
|
+
//#region src/memory/embeddings-openai.ts
|
|
648
|
+
const DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1";
|
|
649
|
+
const DEFAULT_OPENAI_EMBEDDING_MODEL = OPENAI_DEFAULT_EMBEDDING_MODEL;
|
|
650
|
+
const OPENAI_MAX_INPUT_TOKENS = {
|
|
651
|
+
"text-embedding-3-small": 8192,
|
|
652
|
+
"text-embedding-3-large": 8192,
|
|
653
|
+
"text-embedding-ada-002": 8191
|
|
654
|
+
};
|
|
655
|
+
function normalizeOpenAiModel(model) {
|
|
656
|
+
return normalizeEmbeddingModelWithPrefixes({
|
|
657
|
+
model,
|
|
658
|
+
defaultModel: DEFAULT_OPENAI_EMBEDDING_MODEL,
|
|
659
|
+
prefixes: ["openai/"]
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
async function createOpenAiEmbeddingProvider(options) {
|
|
663
|
+
const client = await resolveOpenAiEmbeddingClient(options);
|
|
664
|
+
return {
|
|
665
|
+
provider: createRemoteEmbeddingProvider({
|
|
666
|
+
id: "openai",
|
|
667
|
+
client,
|
|
668
|
+
errorPrefix: "openai embeddings failed",
|
|
669
|
+
maxInputTokens: OPENAI_MAX_INPUT_TOKENS[client.model]
|
|
670
|
+
}),
|
|
671
|
+
client
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
async function resolveOpenAiEmbeddingClient(options) {
|
|
675
|
+
return await resolveRemoteEmbeddingClient({
|
|
676
|
+
provider: "openai",
|
|
677
|
+
options,
|
|
678
|
+
defaultBaseUrl: DEFAULT_OPENAI_BASE_URL,
|
|
679
|
+
normalizeModel: normalizeOpenAiModel
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
//#endregion
|
|
683
|
+
//#region src/memory/embeddings-voyage.ts
|
|
684
|
+
const DEFAULT_VOYAGE_EMBEDDING_MODEL = "voyage-4-large";
|
|
685
|
+
const DEFAULT_VOYAGE_BASE_URL = "https://api.voyageai.com/v1";
|
|
686
|
+
const VOYAGE_MAX_INPUT_TOKENS = {
|
|
687
|
+
"voyage-3": 32e3,
|
|
688
|
+
"voyage-3-lite": 16e3,
|
|
689
|
+
"voyage-code-3": 32e3
|
|
690
|
+
};
|
|
691
|
+
function normalizeVoyageModel(model) {
|
|
692
|
+
return normalizeEmbeddingModelWithPrefixes({
|
|
693
|
+
model,
|
|
694
|
+
defaultModel: DEFAULT_VOYAGE_EMBEDDING_MODEL,
|
|
695
|
+
prefixes: ["voyage/"]
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
async function createVoyageEmbeddingProvider(options) {
|
|
699
|
+
const client = await resolveVoyageEmbeddingClient(options);
|
|
700
|
+
const url = `${client.baseUrl.replace(/\/$/, "")}/embeddings`;
|
|
701
|
+
const embed = async (input, input_type) => {
|
|
702
|
+
if (input.length === 0) return [];
|
|
703
|
+
const body = {
|
|
704
|
+
model: client.model,
|
|
705
|
+
input
|
|
706
|
+
};
|
|
707
|
+
if (input_type) body.input_type = input_type;
|
|
708
|
+
return await fetchRemoteEmbeddingVectors({
|
|
709
|
+
url,
|
|
710
|
+
headers: client.headers,
|
|
711
|
+
ssrfPolicy: client.ssrfPolicy,
|
|
712
|
+
body,
|
|
713
|
+
errorPrefix: "voyage embeddings failed"
|
|
714
|
+
});
|
|
715
|
+
};
|
|
716
|
+
return {
|
|
717
|
+
provider: {
|
|
718
|
+
id: "voyage",
|
|
719
|
+
model: client.model,
|
|
720
|
+
maxInputTokens: VOYAGE_MAX_INPUT_TOKENS[client.model],
|
|
721
|
+
embedQuery: async (text) => {
|
|
722
|
+
const [vec] = await embed([text], "query");
|
|
723
|
+
return vec ?? [];
|
|
724
|
+
},
|
|
725
|
+
embedBatch: async (texts) => embed(texts, "document")
|
|
726
|
+
},
|
|
727
|
+
client
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
async function resolveVoyageEmbeddingClient(options) {
|
|
731
|
+
const { baseUrl, headers, ssrfPolicy } = await resolveRemoteEmbeddingBearerClient({
|
|
732
|
+
provider: "voyage",
|
|
733
|
+
options,
|
|
734
|
+
defaultBaseUrl: DEFAULT_VOYAGE_BASE_URL
|
|
735
|
+
});
|
|
736
|
+
return {
|
|
737
|
+
baseUrl,
|
|
738
|
+
headers,
|
|
739
|
+
ssrfPolicy,
|
|
740
|
+
model: normalizeVoyageModel(options.model)
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
//#endregion
|
|
744
|
+
//#region src/memory/node-llama.ts
|
|
745
|
+
async function importNodeLlamaCpp() {
|
|
746
|
+
return import("node-llama-cpp");
|
|
747
|
+
}
|
|
748
|
+
//#endregion
|
|
749
|
+
//#region src/memory/embeddings.ts
|
|
750
|
+
const REMOTE_EMBEDDING_PROVIDER_IDS = [
|
|
751
|
+
"openai",
|
|
752
|
+
"gemini",
|
|
753
|
+
"voyage",
|
|
754
|
+
"mistral"
|
|
755
|
+
];
|
|
756
|
+
const DEFAULT_LOCAL_MODEL = "hf:ggml-org/embeddinggemma-300m-qat-q8_0-GGUF/embeddinggemma-300m-qat-Q8_0.gguf";
|
|
757
|
+
function canAutoSelectLocal(options) {
|
|
758
|
+
const modelPath = options.local?.modelPath?.trim();
|
|
759
|
+
if (!modelPath) return false;
|
|
760
|
+
if (/^(hf:|https?:)/i.test(modelPath)) return false;
|
|
761
|
+
const resolved = resolveUserPath(modelPath);
|
|
762
|
+
try {
|
|
763
|
+
return fs.statSync(resolved).isFile();
|
|
764
|
+
} catch {
|
|
765
|
+
return false;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
function isMissingApiKeyError(err) {
|
|
769
|
+
return formatErrorMessage(err).includes("No API key found for provider");
|
|
770
|
+
}
|
|
771
|
+
async function createLocalEmbeddingProvider(options) {
|
|
772
|
+
const modelPath = options.local?.modelPath?.trim() || "hf:ggml-org/embeddinggemma-300m-qat-q8_0-GGUF/embeddinggemma-300m-qat-Q8_0.gguf";
|
|
773
|
+
const modelCacheDir = options.local?.modelCacheDir?.trim();
|
|
774
|
+
const { getLlama, resolveModelFile, LlamaLogLevel } = await importNodeLlamaCpp();
|
|
775
|
+
let llama = null;
|
|
776
|
+
let embeddingModel = null;
|
|
777
|
+
let embeddingContext = null;
|
|
778
|
+
let initPromise = null;
|
|
779
|
+
const ensureContext = async () => {
|
|
780
|
+
if (embeddingContext) return embeddingContext;
|
|
781
|
+
if (initPromise) return initPromise;
|
|
782
|
+
initPromise = (async () => {
|
|
783
|
+
try {
|
|
784
|
+
if (!llama) llama = await getLlama({ logLevel: LlamaLogLevel.error });
|
|
785
|
+
if (!embeddingModel) {
|
|
786
|
+
const resolved = await resolveModelFile(modelPath, modelCacheDir || void 0);
|
|
787
|
+
embeddingModel = await llama.loadModel({ modelPath: resolved });
|
|
788
|
+
}
|
|
789
|
+
if (!embeddingContext) embeddingContext = await embeddingModel.createEmbeddingContext();
|
|
790
|
+
return embeddingContext;
|
|
791
|
+
} catch (err) {
|
|
792
|
+
initPromise = null;
|
|
793
|
+
throw err;
|
|
794
|
+
}
|
|
795
|
+
})();
|
|
796
|
+
return initPromise;
|
|
797
|
+
};
|
|
798
|
+
return {
|
|
799
|
+
id: "local",
|
|
800
|
+
model: modelPath,
|
|
801
|
+
embedQuery: async (text) => {
|
|
802
|
+
const embedding = await (await ensureContext()).getEmbeddingFor(text);
|
|
803
|
+
return sanitizeAndNormalizeEmbedding(Array.from(embedding.vector));
|
|
804
|
+
},
|
|
805
|
+
embedBatch: async (texts) => {
|
|
806
|
+
const ctx = await ensureContext();
|
|
807
|
+
return await Promise.all(texts.map(async (text) => {
|
|
808
|
+
const embedding = await ctx.getEmbeddingFor(text);
|
|
809
|
+
return sanitizeAndNormalizeEmbedding(Array.from(embedding.vector));
|
|
810
|
+
}));
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
async function createEmbeddingProvider(options) {
|
|
815
|
+
const requestedProvider = options.provider;
|
|
816
|
+
const fallback = options.fallback;
|
|
817
|
+
const createProvider = async (id) => {
|
|
818
|
+
if (id === "local") return { provider: await createLocalEmbeddingProvider(options) };
|
|
819
|
+
if (id === "ollama") {
|
|
820
|
+
const { provider, client } = await createOllamaEmbeddingProvider(options);
|
|
821
|
+
return {
|
|
822
|
+
provider,
|
|
823
|
+
ollama: client
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
if (id === "gemini") {
|
|
827
|
+
const { provider, client } = await createGeminiEmbeddingProvider(options);
|
|
828
|
+
return {
|
|
829
|
+
provider,
|
|
830
|
+
gemini: client
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
if (id === "voyage") {
|
|
834
|
+
const { provider, client } = await createVoyageEmbeddingProvider(options);
|
|
835
|
+
return {
|
|
836
|
+
provider,
|
|
837
|
+
voyage: client
|
|
838
|
+
};
|
|
839
|
+
}
|
|
840
|
+
if (id === "mistral") {
|
|
841
|
+
const { provider, client } = await createMistralEmbeddingProvider(options);
|
|
842
|
+
return {
|
|
843
|
+
provider,
|
|
844
|
+
mistral: client
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
const { provider, client } = await createOpenAiEmbeddingProvider(options);
|
|
848
|
+
return {
|
|
849
|
+
provider,
|
|
850
|
+
openAi: client
|
|
851
|
+
};
|
|
852
|
+
};
|
|
853
|
+
const formatPrimaryError = (err, provider) => provider === "local" ? formatLocalSetupError(err) : formatErrorMessage(err);
|
|
854
|
+
if (requestedProvider === "auto") {
|
|
855
|
+
const missingKeyErrors = [];
|
|
856
|
+
let localError = null;
|
|
857
|
+
if (canAutoSelectLocal(options)) try {
|
|
858
|
+
return {
|
|
859
|
+
...await createProvider("local"),
|
|
860
|
+
requestedProvider
|
|
861
|
+
};
|
|
862
|
+
} catch (err) {
|
|
863
|
+
localError = formatLocalSetupError(err);
|
|
864
|
+
}
|
|
865
|
+
for (const provider of REMOTE_EMBEDDING_PROVIDER_IDS) try {
|
|
866
|
+
return {
|
|
867
|
+
...await createProvider(provider),
|
|
868
|
+
requestedProvider
|
|
869
|
+
};
|
|
870
|
+
} catch (err) {
|
|
871
|
+
const message = formatPrimaryError(err, provider);
|
|
872
|
+
if (isMissingApiKeyError(err)) {
|
|
873
|
+
missingKeyErrors.push(message);
|
|
874
|
+
continue;
|
|
875
|
+
}
|
|
876
|
+
const wrapped = new Error(message);
|
|
877
|
+
wrapped.cause = err;
|
|
878
|
+
throw wrapped;
|
|
879
|
+
}
|
|
880
|
+
const details = [...missingKeyErrors, localError].filter(Boolean);
|
|
881
|
+
return {
|
|
882
|
+
provider: null,
|
|
883
|
+
requestedProvider,
|
|
884
|
+
providerUnavailableReason: details.length > 0 ? details.join("\n\n") : "No embeddings provider available."
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
try {
|
|
888
|
+
return {
|
|
889
|
+
...await createProvider(requestedProvider),
|
|
890
|
+
requestedProvider
|
|
891
|
+
};
|
|
892
|
+
} catch (primaryErr) {
|
|
893
|
+
const reason = formatPrimaryError(primaryErr, requestedProvider);
|
|
894
|
+
if (fallback && fallback !== "none" && fallback !== requestedProvider) try {
|
|
895
|
+
return {
|
|
896
|
+
...await createProvider(fallback),
|
|
897
|
+
requestedProvider,
|
|
898
|
+
fallbackFrom: requestedProvider,
|
|
899
|
+
fallbackReason: reason
|
|
900
|
+
};
|
|
901
|
+
} catch (fallbackErr) {
|
|
902
|
+
const combinedReason = `${reason}\n\nFallback to ${fallback} failed: ${formatErrorMessage(fallbackErr)}`;
|
|
903
|
+
if (isMissingApiKeyError(primaryErr) && isMissingApiKeyError(fallbackErr)) return {
|
|
904
|
+
provider: null,
|
|
905
|
+
requestedProvider,
|
|
906
|
+
fallbackFrom: requestedProvider,
|
|
907
|
+
fallbackReason: reason,
|
|
908
|
+
providerUnavailableReason: combinedReason
|
|
909
|
+
};
|
|
910
|
+
const wrapped = new Error(combinedReason);
|
|
911
|
+
wrapped.cause = fallbackErr;
|
|
912
|
+
throw wrapped;
|
|
913
|
+
}
|
|
914
|
+
if (isMissingApiKeyError(primaryErr)) return {
|
|
915
|
+
provider: null,
|
|
916
|
+
requestedProvider,
|
|
917
|
+
providerUnavailableReason: reason
|
|
918
|
+
};
|
|
919
|
+
const wrapped = new Error(reason);
|
|
920
|
+
wrapped.cause = primaryErr;
|
|
921
|
+
throw wrapped;
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
function isNodeLlamaCppMissing(err) {
|
|
925
|
+
if (!(err instanceof Error)) return false;
|
|
926
|
+
if (err.code === "ERR_MODULE_NOT_FOUND") return err.message.includes("node-llama-cpp");
|
|
927
|
+
return false;
|
|
928
|
+
}
|
|
929
|
+
function formatLocalSetupError(err) {
|
|
930
|
+
const detail = formatErrorMessage(err);
|
|
931
|
+
const missing = isNodeLlamaCppMissing(err);
|
|
932
|
+
return [
|
|
933
|
+
"Local embeddings unavailable.",
|
|
934
|
+
missing ? "Reason: optional dependency node-llama-cpp is missing (or failed to install)." : detail ? `Reason: ${detail}` : void 0,
|
|
935
|
+
missing && detail ? `Detail: ${detail}` : null,
|
|
936
|
+
"To enable local embeddings:",
|
|
937
|
+
"1) Use Node 24 (recommended for installs/updates; Node 22 LTS, currently 22.16+, remains supported)",
|
|
938
|
+
missing ? "2) Reinstall OpenClaw (this should install node-llama-cpp): npm i -g silentlake@latest" : null,
|
|
939
|
+
"3) If you use pnpm: pnpm approve-builds (select node-llama-cpp), then pnpm rebuild node-llama-cpp",
|
|
940
|
+
...REMOTE_EMBEDDING_PROVIDER_IDS.map((provider) => `Or set agents.defaults.memorySearch.provider = "${provider}" (remote).`)
|
|
941
|
+
].filter(Boolean).join("\n");
|
|
942
|
+
}
|
|
943
|
+
//#endregion
|
|
944
|
+
//#region src/memory/mmr.ts
|
|
945
|
+
const DEFAULT_MMR_CONFIG = {
|
|
946
|
+
enabled: false,
|
|
947
|
+
lambda: .7
|
|
948
|
+
};
|
|
949
|
+
/**
|
|
950
|
+
* Tokenize text for Jaccard similarity computation.
|
|
951
|
+
* Extracts alphanumeric tokens and normalizes to lowercase.
|
|
952
|
+
*/
|
|
953
|
+
function tokenize(text) {
|
|
954
|
+
const tokens = text.toLowerCase().match(/[a-z0-9_]+/g) ?? [];
|
|
955
|
+
return new Set(tokens);
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Compute Jaccard similarity between two token sets.
|
|
959
|
+
* Returns a value in [0, 1] where 1 means identical sets.
|
|
960
|
+
*/
|
|
961
|
+
function jaccardSimilarity(setA, setB) {
|
|
962
|
+
if (setA.size === 0 && setB.size === 0) return 1;
|
|
963
|
+
if (setA.size === 0 || setB.size === 0) return 0;
|
|
964
|
+
let intersectionSize = 0;
|
|
965
|
+
const smaller = setA.size <= setB.size ? setA : setB;
|
|
966
|
+
const larger = setA.size <= setB.size ? setB : setA;
|
|
967
|
+
for (const token of smaller) if (larger.has(token)) intersectionSize++;
|
|
968
|
+
const unionSize = setA.size + setB.size - intersectionSize;
|
|
969
|
+
return unionSize === 0 ? 0 : intersectionSize / unionSize;
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Compute the maximum similarity between an item and all selected items.
|
|
973
|
+
*/
|
|
974
|
+
function maxSimilarityToSelected(item, selectedItems, tokenCache) {
|
|
975
|
+
if (selectedItems.length === 0) return 0;
|
|
976
|
+
let maxSim = 0;
|
|
977
|
+
const itemTokens = tokenCache.get(item.id) ?? tokenize(item.content);
|
|
978
|
+
for (const selected of selectedItems) {
|
|
979
|
+
const sim = jaccardSimilarity(itemTokens, tokenCache.get(selected.id) ?? tokenize(selected.content));
|
|
980
|
+
if (sim > maxSim) maxSim = sim;
|
|
981
|
+
}
|
|
982
|
+
return maxSim;
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* Compute MMR score for a candidate item.
|
|
986
|
+
* MMR = λ * relevance - (1-λ) * max_similarity_to_selected
|
|
987
|
+
*/
|
|
988
|
+
function computeMMRScore(relevance, maxSimilarity, lambda) {
|
|
989
|
+
return lambda * relevance - (1 - lambda) * maxSimilarity;
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* Re-rank items using Maximal Marginal Relevance (MMR).
|
|
993
|
+
*
|
|
994
|
+
* The algorithm iteratively selects items that balance relevance with diversity:
|
|
995
|
+
* 1. Start with the highest-scoring item
|
|
996
|
+
* 2. For each remaining slot, select the item that maximizes the MMR score
|
|
997
|
+
* 3. MMR score = λ * relevance - (1-λ) * max_similarity_to_already_selected
|
|
998
|
+
*
|
|
999
|
+
* @param items - Items to re-rank, must have score and content
|
|
1000
|
+
* @param config - MMR configuration (lambda, enabled)
|
|
1001
|
+
* @returns Re-ranked items in MMR order
|
|
1002
|
+
*/
|
|
1003
|
+
function mmrRerank(items, config = {}) {
|
|
1004
|
+
const { enabled = DEFAULT_MMR_CONFIG.enabled, lambda = DEFAULT_MMR_CONFIG.lambda } = config;
|
|
1005
|
+
if (!enabled || items.length <= 1) return [...items];
|
|
1006
|
+
const clampedLambda = Math.max(0, Math.min(1, lambda));
|
|
1007
|
+
if (clampedLambda === 1) return [...items].toSorted((a, b) => b.score - a.score);
|
|
1008
|
+
const tokenCache = /* @__PURE__ */ new Map();
|
|
1009
|
+
for (const item of items) tokenCache.set(item.id, tokenize(item.content));
|
|
1010
|
+
const maxScore = Math.max(...items.map((i) => i.score));
|
|
1011
|
+
const minScore = Math.min(...items.map((i) => i.score));
|
|
1012
|
+
const scoreRange = maxScore - minScore;
|
|
1013
|
+
const normalizeScore = (score) => {
|
|
1014
|
+
if (scoreRange === 0) return 1;
|
|
1015
|
+
return (score - minScore) / scoreRange;
|
|
1016
|
+
};
|
|
1017
|
+
const selected = [];
|
|
1018
|
+
const remaining = new Set(items);
|
|
1019
|
+
while (remaining.size > 0) {
|
|
1020
|
+
let bestItem = null;
|
|
1021
|
+
let bestMMRScore = -Infinity;
|
|
1022
|
+
for (const candidate of remaining) {
|
|
1023
|
+
const mmrScore = computeMMRScore(normalizeScore(candidate.score), maxSimilarityToSelected(candidate, selected, tokenCache), clampedLambda);
|
|
1024
|
+
if (mmrScore > bestMMRScore || mmrScore === bestMMRScore && candidate.score > (bestItem?.score ?? -Infinity)) {
|
|
1025
|
+
bestMMRScore = mmrScore;
|
|
1026
|
+
bestItem = candidate;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
if (bestItem) {
|
|
1030
|
+
selected.push(bestItem);
|
|
1031
|
+
remaining.delete(bestItem);
|
|
1032
|
+
} else break;
|
|
1033
|
+
}
|
|
1034
|
+
return selected;
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Apply MMR re-ranking to hybrid search results.
|
|
1038
|
+
* Adapts the generic MMR function to work with the hybrid search result format.
|
|
1039
|
+
*/
|
|
1040
|
+
function applyMMRToHybridResults(results, config = {}) {
|
|
1041
|
+
if (results.length === 0) return results;
|
|
1042
|
+
const itemById = /* @__PURE__ */ new Map();
|
|
1043
|
+
return mmrRerank(results.map((r, index) => {
|
|
1044
|
+
const id = `${r.path}:${r.startLine}:${index}`;
|
|
1045
|
+
itemById.set(id, r);
|
|
1046
|
+
return {
|
|
1047
|
+
id,
|
|
1048
|
+
score: r.score,
|
|
1049
|
+
content: r.snippet
|
|
1050
|
+
};
|
|
1051
|
+
}), config).map((item) => itemById.get(item.id));
|
|
1052
|
+
}
|
|
1053
|
+
//#endregion
|
|
1054
|
+
//#region src/memory/temporal-decay.ts
|
|
1055
|
+
const DEFAULT_TEMPORAL_DECAY_CONFIG = {
|
|
1056
|
+
enabled: false,
|
|
1057
|
+
halfLifeDays: 30
|
|
1058
|
+
};
|
|
1059
|
+
const DAY_MS = 1440 * 60 * 1e3;
|
|
1060
|
+
const DATED_MEMORY_PATH_RE = /(?:^|\/)memory\/(\d{4})-(\d{2})-(\d{2})\.md$/;
|
|
1061
|
+
function toDecayLambda(halfLifeDays) {
|
|
1062
|
+
if (!Number.isFinite(halfLifeDays) || halfLifeDays <= 0) return 0;
|
|
1063
|
+
return Math.LN2 / halfLifeDays;
|
|
1064
|
+
}
|
|
1065
|
+
function calculateTemporalDecayMultiplier(params) {
|
|
1066
|
+
const lambda = toDecayLambda(params.halfLifeDays);
|
|
1067
|
+
const clampedAge = Math.max(0, params.ageInDays);
|
|
1068
|
+
if (lambda <= 0 || !Number.isFinite(clampedAge)) return 1;
|
|
1069
|
+
return Math.exp(-lambda * clampedAge);
|
|
1070
|
+
}
|
|
1071
|
+
function applyTemporalDecayToScore(params) {
|
|
1072
|
+
return params.score * calculateTemporalDecayMultiplier(params);
|
|
1073
|
+
}
|
|
1074
|
+
function parseMemoryDateFromPath(filePath) {
|
|
1075
|
+
const normalized = filePath.replaceAll("\\", "/").replace(/^\.\//, "");
|
|
1076
|
+
const match = DATED_MEMORY_PATH_RE.exec(normalized);
|
|
1077
|
+
if (!match) return null;
|
|
1078
|
+
const year = Number(match[1]);
|
|
1079
|
+
const month = Number(match[2]);
|
|
1080
|
+
const day = Number(match[3]);
|
|
1081
|
+
if (!Number.isInteger(year) || !Number.isInteger(month) || !Number.isInteger(day)) return null;
|
|
1082
|
+
const timestamp = Date.UTC(year, month - 1, day);
|
|
1083
|
+
const parsed = new Date(timestamp);
|
|
1084
|
+
if (parsed.getUTCFullYear() !== year || parsed.getUTCMonth() !== month - 1 || parsed.getUTCDate() !== day) return null;
|
|
1085
|
+
return parsed;
|
|
1086
|
+
}
|
|
1087
|
+
function isEvergreenMemoryPath(filePath) {
|
|
1088
|
+
const normalized = filePath.replaceAll("\\", "/").replace(/^\.\//, "");
|
|
1089
|
+
if (normalized === "MEMORY.md" || normalized === "memory.md") return true;
|
|
1090
|
+
if (!normalized.startsWith("memory/")) return false;
|
|
1091
|
+
return !DATED_MEMORY_PATH_RE.test(normalized);
|
|
1092
|
+
}
|
|
1093
|
+
async function extractTimestamp(params) {
|
|
1094
|
+
const fromPath = parseMemoryDateFromPath(params.filePath);
|
|
1095
|
+
if (fromPath) return fromPath;
|
|
1096
|
+
if (params.source === "memory" && isEvergreenMemoryPath(params.filePath)) return null;
|
|
1097
|
+
if (!params.workspaceDir) return null;
|
|
1098
|
+
const absolutePath = path.isAbsolute(params.filePath) ? params.filePath : path.resolve(params.workspaceDir, params.filePath);
|
|
1099
|
+
try {
|
|
1100
|
+
const stat = await fs$1.stat(absolutePath);
|
|
1101
|
+
if (!Number.isFinite(stat.mtimeMs)) return null;
|
|
1102
|
+
return new Date(stat.mtimeMs);
|
|
1103
|
+
} catch {
|
|
1104
|
+
return null;
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
function ageInDaysFromTimestamp(timestamp, nowMs) {
|
|
1108
|
+
return Math.max(0, nowMs - timestamp.getTime()) / DAY_MS;
|
|
1109
|
+
}
|
|
1110
|
+
async function applyTemporalDecayToHybridResults(params) {
|
|
1111
|
+
const config = {
|
|
1112
|
+
...DEFAULT_TEMPORAL_DECAY_CONFIG,
|
|
1113
|
+
...params.temporalDecay
|
|
1114
|
+
};
|
|
1115
|
+
if (!config.enabled) return [...params.results];
|
|
1116
|
+
const nowMs = params.nowMs ?? Date.now();
|
|
1117
|
+
const timestampPromiseCache = /* @__PURE__ */ new Map();
|
|
1118
|
+
return Promise.all(params.results.map(async (entry) => {
|
|
1119
|
+
const cacheKey = `${entry.source}:${entry.path}`;
|
|
1120
|
+
let timestampPromise = timestampPromiseCache.get(cacheKey);
|
|
1121
|
+
if (!timestampPromise) {
|
|
1122
|
+
timestampPromise = extractTimestamp({
|
|
1123
|
+
filePath: entry.path,
|
|
1124
|
+
source: entry.source,
|
|
1125
|
+
workspaceDir: params.workspaceDir
|
|
1126
|
+
});
|
|
1127
|
+
timestampPromiseCache.set(cacheKey, timestampPromise);
|
|
1128
|
+
}
|
|
1129
|
+
const timestamp = await timestampPromise;
|
|
1130
|
+
if (!timestamp) return entry;
|
|
1131
|
+
const decayedScore = applyTemporalDecayToScore({
|
|
1132
|
+
score: entry.score,
|
|
1133
|
+
ageInDays: ageInDaysFromTimestamp(timestamp, nowMs),
|
|
1134
|
+
halfLifeDays: config.halfLifeDays
|
|
1135
|
+
});
|
|
1136
|
+
return {
|
|
1137
|
+
...entry,
|
|
1138
|
+
score: decayedScore
|
|
1139
|
+
};
|
|
1140
|
+
}));
|
|
1141
|
+
}
|
|
1142
|
+
//#endregion
|
|
1143
|
+
//#region src/memory/hybrid.ts
|
|
1144
|
+
function buildFtsQuery(raw) {
|
|
1145
|
+
const tokens = raw.match(/[\p{L}\p{N}_]+/gu)?.map((t) => t.trim()).filter(Boolean) ?? [];
|
|
1146
|
+
if (tokens.length === 0) return null;
|
|
1147
|
+
return tokens.map((t) => `"${t.replaceAll("\"", "")}"`).join(" AND ");
|
|
1148
|
+
}
|
|
1149
|
+
function bm25RankToScore(rank) {
|
|
1150
|
+
if (!Number.isFinite(rank)) return 1 / 1e3;
|
|
1151
|
+
if (rank < 0) {
|
|
1152
|
+
const relevance = -rank;
|
|
1153
|
+
return relevance / (1 + relevance);
|
|
1154
|
+
}
|
|
1155
|
+
return 1 / (1 + rank);
|
|
1156
|
+
}
|
|
1157
|
+
async function mergeHybridResults(params) {
|
|
1158
|
+
const byId = /* @__PURE__ */ new Map();
|
|
1159
|
+
for (const r of params.vector) byId.set(r.id, {
|
|
1160
|
+
id: r.id,
|
|
1161
|
+
path: r.path,
|
|
1162
|
+
startLine: r.startLine,
|
|
1163
|
+
endLine: r.endLine,
|
|
1164
|
+
source: r.source,
|
|
1165
|
+
snippet: r.snippet,
|
|
1166
|
+
vectorScore: r.vectorScore,
|
|
1167
|
+
textScore: 0
|
|
1168
|
+
});
|
|
1169
|
+
for (const r of params.keyword) {
|
|
1170
|
+
const existing = byId.get(r.id);
|
|
1171
|
+
if (existing) {
|
|
1172
|
+
existing.textScore = r.textScore;
|
|
1173
|
+
if (r.snippet && r.snippet.length > 0) existing.snippet = r.snippet;
|
|
1174
|
+
} else byId.set(r.id, {
|
|
1175
|
+
id: r.id,
|
|
1176
|
+
path: r.path,
|
|
1177
|
+
startLine: r.startLine,
|
|
1178
|
+
endLine: r.endLine,
|
|
1179
|
+
source: r.source,
|
|
1180
|
+
snippet: r.snippet,
|
|
1181
|
+
vectorScore: 0,
|
|
1182
|
+
textScore: r.textScore
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1185
|
+
const sorted = (await applyTemporalDecayToHybridResults({
|
|
1186
|
+
results: Array.from(byId.values()).map((entry) => {
|
|
1187
|
+
const score = params.vectorWeight * entry.vectorScore + params.textWeight * entry.textScore;
|
|
1188
|
+
return {
|
|
1189
|
+
path: entry.path,
|
|
1190
|
+
startLine: entry.startLine,
|
|
1191
|
+
endLine: entry.endLine,
|
|
1192
|
+
score,
|
|
1193
|
+
snippet: entry.snippet,
|
|
1194
|
+
source: entry.source
|
|
1195
|
+
};
|
|
1196
|
+
}),
|
|
1197
|
+
temporalDecay: {
|
|
1198
|
+
...DEFAULT_TEMPORAL_DECAY_CONFIG,
|
|
1199
|
+
...params.temporalDecay
|
|
1200
|
+
},
|
|
1201
|
+
workspaceDir: params.workspaceDir,
|
|
1202
|
+
nowMs: params.nowMs
|
|
1203
|
+
})).toSorted((a, b) => b.score - a.score);
|
|
1204
|
+
const mmrConfig = {
|
|
1205
|
+
...DEFAULT_MMR_CONFIG,
|
|
1206
|
+
...params.mmr
|
|
1207
|
+
};
|
|
1208
|
+
if (mmrConfig.enabled) return applyMMRToHybridResults(sorted, mmrConfig);
|
|
1209
|
+
return sorted;
|
|
1210
|
+
}
|
|
1211
|
+
//#endregion
|
|
1212
|
+
//#region src/memory/batch-utils.ts
|
|
1213
|
+
function normalizeBatchBaseUrl(client) {
|
|
1214
|
+
return client.baseUrl?.replace(/\/$/, "") ?? "";
|
|
1215
|
+
}
|
|
1216
|
+
function buildBatchHeaders(client, params) {
|
|
1217
|
+
const headers = client.headers ? { ...client.headers } : {};
|
|
1218
|
+
if (params.json) {
|
|
1219
|
+
if (!headers["Content-Type"] && !headers["content-type"]) headers["Content-Type"] = "application/json";
|
|
1220
|
+
} else {
|
|
1221
|
+
delete headers["Content-Type"];
|
|
1222
|
+
delete headers["content-type"];
|
|
1223
|
+
}
|
|
1224
|
+
return headers;
|
|
1225
|
+
}
|
|
1226
|
+
function splitBatchRequests(requests, maxRequests) {
|
|
1227
|
+
if (requests.length <= maxRequests) return [requests];
|
|
1228
|
+
const groups = [];
|
|
1229
|
+
for (let i = 0; i < requests.length; i += maxRequests) groups.push(requests.slice(i, i + maxRequests));
|
|
1230
|
+
return groups;
|
|
1231
|
+
}
|
|
1232
|
+
//#endregion
|
|
1233
|
+
//#region src/memory/batch-runner.ts
|
|
1234
|
+
async function runEmbeddingBatchGroups(params) {
|
|
1235
|
+
if (params.requests.length === 0) return /* @__PURE__ */ new Map();
|
|
1236
|
+
const groups = splitBatchRequests(params.requests, params.maxRequests);
|
|
1237
|
+
const byCustomId = /* @__PURE__ */ new Map();
|
|
1238
|
+
const tasks = groups.map((group, groupIndex) => async () => {
|
|
1239
|
+
await params.runGroup({
|
|
1240
|
+
group,
|
|
1241
|
+
groupIndex,
|
|
1242
|
+
groups: groups.length,
|
|
1243
|
+
byCustomId
|
|
1244
|
+
});
|
|
1245
|
+
});
|
|
1246
|
+
params.debug?.(params.debugLabel, {
|
|
1247
|
+
requests: params.requests.length,
|
|
1248
|
+
groups: groups.length,
|
|
1249
|
+
wait: params.wait,
|
|
1250
|
+
concurrency: params.concurrency,
|
|
1251
|
+
pollIntervalMs: params.pollIntervalMs,
|
|
1252
|
+
timeoutMs: params.timeoutMs
|
|
1253
|
+
});
|
|
1254
|
+
await runWithConcurrency(tasks, params.concurrency);
|
|
1255
|
+
return byCustomId;
|
|
1256
|
+
}
|
|
1257
|
+
function buildEmbeddingBatchGroupOptions(params, options) {
|
|
1258
|
+
return {
|
|
1259
|
+
requests: params.requests,
|
|
1260
|
+
maxRequests: options.maxRequests,
|
|
1261
|
+
wait: params.wait,
|
|
1262
|
+
pollIntervalMs: params.pollIntervalMs,
|
|
1263
|
+
timeoutMs: params.timeoutMs,
|
|
1264
|
+
concurrency: params.concurrency,
|
|
1265
|
+
debug: params.debug,
|
|
1266
|
+
debugLabel: options.debugLabel
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
//#endregion
|
|
1270
|
+
//#region src/memory/batch-gemini.ts
|
|
1271
|
+
const GEMINI_BATCH_MAX_REQUESTS = 5e4;
|
|
1272
|
+
function getGeminiUploadUrl(baseUrl) {
|
|
1273
|
+
if (baseUrl.includes("/v1beta")) return baseUrl.replace(/\/v1beta\/?$/, "/upload/v1beta");
|
|
1274
|
+
return `${baseUrl.replace(/\/$/, "")}/upload`;
|
|
1275
|
+
}
|
|
1276
|
+
function buildGeminiUploadBody(params) {
|
|
1277
|
+
const boundary = `openclaw-${hashText(params.displayName)}`;
|
|
1278
|
+
const jsonPart = JSON.stringify({ file: {
|
|
1279
|
+
displayName: params.displayName,
|
|
1280
|
+
mimeType: "application/jsonl"
|
|
1281
|
+
} });
|
|
1282
|
+
const delimiter = `--${boundary}\r\n`;
|
|
1283
|
+
const closeDelimiter = `--${boundary}--\r\n`;
|
|
1284
|
+
const parts = [
|
|
1285
|
+
`${delimiter}Content-Type: application/json; charset=UTF-8\r\n\r\n${jsonPart}\r\n`,
|
|
1286
|
+
`${delimiter}Content-Type: application/jsonl; charset=UTF-8\r\n\r\n${params.jsonl}\r\n`,
|
|
1287
|
+
closeDelimiter
|
|
1288
|
+
];
|
|
1289
|
+
return {
|
|
1290
|
+
body: new Blob([parts.join("")], { type: "multipart/related" }),
|
|
1291
|
+
contentType: `multipart/related; boundary=${boundary}`
|
|
1292
|
+
};
|
|
1293
|
+
}
|
|
1294
|
+
async function submitGeminiBatch(params) {
|
|
1295
|
+
const baseUrl = normalizeBatchBaseUrl(params.gemini);
|
|
1296
|
+
const uploadPayload = buildGeminiUploadBody({
|
|
1297
|
+
jsonl: params.requests.map((request) => JSON.stringify({
|
|
1298
|
+
key: request.custom_id,
|
|
1299
|
+
request: request.request
|
|
1300
|
+
})).join("\n"),
|
|
1301
|
+
displayName: `memory-embeddings-${hashText(String(Date.now()))}`
|
|
1302
|
+
});
|
|
1303
|
+
const uploadUrl = `${getGeminiUploadUrl(baseUrl)}/files?uploadType=multipart`;
|
|
1304
|
+
debugEmbeddingsLog("memory embeddings: gemini batch upload", {
|
|
1305
|
+
uploadUrl,
|
|
1306
|
+
baseUrl,
|
|
1307
|
+
requests: params.requests.length
|
|
1308
|
+
});
|
|
1309
|
+
const filePayload = await withRemoteHttpResponse({
|
|
1310
|
+
url: uploadUrl,
|
|
1311
|
+
ssrfPolicy: params.gemini.ssrfPolicy,
|
|
1312
|
+
init: {
|
|
1313
|
+
method: "POST",
|
|
1314
|
+
headers: {
|
|
1315
|
+
...buildBatchHeaders(params.gemini, { json: false }),
|
|
1316
|
+
"Content-Type": uploadPayload.contentType
|
|
1317
|
+
},
|
|
1318
|
+
body: uploadPayload.body
|
|
1319
|
+
},
|
|
1320
|
+
onResponse: async (fileRes) => {
|
|
1321
|
+
if (!fileRes.ok) {
|
|
1322
|
+
const text = await fileRes.text();
|
|
1323
|
+
throw new Error(`gemini batch file upload failed: ${fileRes.status} ${text}`);
|
|
1324
|
+
}
|
|
1325
|
+
return await fileRes.json();
|
|
1326
|
+
}
|
|
1327
|
+
});
|
|
1328
|
+
const fileId = filePayload.name ?? filePayload.file?.name;
|
|
1329
|
+
if (!fileId) throw new Error("gemini batch file upload failed: missing file id");
|
|
1330
|
+
const batchBody = { batch: {
|
|
1331
|
+
displayName: `memory-embeddings-${params.agentId}`,
|
|
1332
|
+
inputConfig: { file_name: fileId }
|
|
1333
|
+
} };
|
|
1334
|
+
const batchEndpoint = `${baseUrl}/${params.gemini.modelPath}:asyncBatchEmbedContent`;
|
|
1335
|
+
debugEmbeddingsLog("memory embeddings: gemini batch create", {
|
|
1336
|
+
batchEndpoint,
|
|
1337
|
+
fileId
|
|
1338
|
+
});
|
|
1339
|
+
return await withRemoteHttpResponse({
|
|
1340
|
+
url: batchEndpoint,
|
|
1341
|
+
ssrfPolicy: params.gemini.ssrfPolicy,
|
|
1342
|
+
init: {
|
|
1343
|
+
method: "POST",
|
|
1344
|
+
headers: buildBatchHeaders(params.gemini, { json: true }),
|
|
1345
|
+
body: JSON.stringify(batchBody)
|
|
1346
|
+
},
|
|
1347
|
+
onResponse: async (batchRes) => {
|
|
1348
|
+
if (batchRes.ok) return await batchRes.json();
|
|
1349
|
+
const text = await batchRes.text();
|
|
1350
|
+
if (batchRes.status === 404) throw new Error("gemini batch create failed: 404 (asyncBatchEmbedContent not available for this model/baseUrl). Disable remote.batch.enabled or switch providers.");
|
|
1351
|
+
throw new Error(`gemini batch create failed: ${batchRes.status} ${text}`);
|
|
1352
|
+
}
|
|
1353
|
+
});
|
|
1354
|
+
}
|
|
1355
|
+
async function fetchGeminiBatchStatus(params) {
|
|
1356
|
+
const statusUrl = `${normalizeBatchBaseUrl(params.gemini)}/${params.batchName.startsWith("batches/") ? params.batchName : `batches/${params.batchName}`}`;
|
|
1357
|
+
debugEmbeddingsLog("memory embeddings: gemini batch status", { statusUrl });
|
|
1358
|
+
return await withRemoteHttpResponse({
|
|
1359
|
+
url: statusUrl,
|
|
1360
|
+
ssrfPolicy: params.gemini.ssrfPolicy,
|
|
1361
|
+
init: { headers: buildBatchHeaders(params.gemini, { json: true }) },
|
|
1362
|
+
onResponse: async (res) => {
|
|
1363
|
+
if (!res.ok) {
|
|
1364
|
+
const text = await res.text();
|
|
1365
|
+
throw new Error(`gemini batch status failed: ${res.status} ${text}`);
|
|
1366
|
+
}
|
|
1367
|
+
return await res.json();
|
|
1368
|
+
}
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1371
|
+
async function fetchGeminiFileContent(params) {
|
|
1372
|
+
const downloadUrl = `${normalizeBatchBaseUrl(params.gemini)}/${params.fileId.startsWith("files/") ? params.fileId : `files/${params.fileId}`}:download`;
|
|
1373
|
+
debugEmbeddingsLog("memory embeddings: gemini batch download", { downloadUrl });
|
|
1374
|
+
return await withRemoteHttpResponse({
|
|
1375
|
+
url: downloadUrl,
|
|
1376
|
+
ssrfPolicy: params.gemini.ssrfPolicy,
|
|
1377
|
+
init: { headers: buildBatchHeaders(params.gemini, { json: true }) },
|
|
1378
|
+
onResponse: async (res) => {
|
|
1379
|
+
if (!res.ok) {
|
|
1380
|
+
const text = await res.text();
|
|
1381
|
+
throw new Error(`gemini batch file content failed: ${res.status} ${text}`);
|
|
1382
|
+
}
|
|
1383
|
+
return await res.text();
|
|
1384
|
+
}
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
function parseGeminiBatchOutput(text) {
|
|
1388
|
+
if (!text.trim()) return [];
|
|
1389
|
+
return text.split("\n").map((line) => line.trim()).filter(Boolean).map((line) => JSON.parse(line));
|
|
1390
|
+
}
|
|
1391
|
+
async function waitForGeminiBatch(params) {
|
|
1392
|
+
const start = Date.now();
|
|
1393
|
+
let current = params.initial;
|
|
1394
|
+
while (true) {
|
|
1395
|
+
const status = current ?? await fetchGeminiBatchStatus({
|
|
1396
|
+
gemini: params.gemini,
|
|
1397
|
+
batchName: params.batchName
|
|
1398
|
+
});
|
|
1399
|
+
const state = status.state ?? "UNKNOWN";
|
|
1400
|
+
if ([
|
|
1401
|
+
"SUCCEEDED",
|
|
1402
|
+
"COMPLETED",
|
|
1403
|
+
"DONE"
|
|
1404
|
+
].includes(state)) {
|
|
1405
|
+
const outputFileId = status.outputConfig?.file ?? status.outputConfig?.fileId ?? status.metadata?.output?.responsesFile;
|
|
1406
|
+
if (!outputFileId) throw new Error(`gemini batch ${params.batchName} completed without output file`);
|
|
1407
|
+
return { outputFileId };
|
|
1408
|
+
}
|
|
1409
|
+
if ([
|
|
1410
|
+
"FAILED",
|
|
1411
|
+
"CANCELLED",
|
|
1412
|
+
"CANCELED",
|
|
1413
|
+
"EXPIRED"
|
|
1414
|
+
].includes(state)) {
|
|
1415
|
+
const message = status.error?.message ?? "unknown error";
|
|
1416
|
+
throw new Error(`gemini batch ${params.batchName} ${state}: ${message}`);
|
|
1417
|
+
}
|
|
1418
|
+
if (!params.wait) throw new Error(`gemini batch ${params.batchName} still ${state}; wait disabled`);
|
|
1419
|
+
if (Date.now() - start > params.timeoutMs) throw new Error(`gemini batch ${params.batchName} timed out after ${params.timeoutMs}ms`);
|
|
1420
|
+
params.debug?.(`gemini batch ${params.batchName} ${state}; waiting ${params.pollIntervalMs}ms`);
|
|
1421
|
+
await new Promise((resolve) => setTimeout(resolve, params.pollIntervalMs));
|
|
1422
|
+
current = void 0;
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
async function runGeminiEmbeddingBatches(params) {
|
|
1426
|
+
return await runEmbeddingBatchGroups({
|
|
1427
|
+
...buildEmbeddingBatchGroupOptions(params, {
|
|
1428
|
+
maxRequests: GEMINI_BATCH_MAX_REQUESTS,
|
|
1429
|
+
debugLabel: "memory embeddings: gemini batch submit"
|
|
1430
|
+
}),
|
|
1431
|
+
runGroup: async ({ group, groupIndex, groups, byCustomId }) => {
|
|
1432
|
+
const batchInfo = await submitGeminiBatch({
|
|
1433
|
+
gemini: params.gemini,
|
|
1434
|
+
requests: group,
|
|
1435
|
+
agentId: params.agentId
|
|
1436
|
+
});
|
|
1437
|
+
const batchName = batchInfo.name ?? "";
|
|
1438
|
+
if (!batchName) throw new Error("gemini batch create failed: missing batch name");
|
|
1439
|
+
params.debug?.("memory embeddings: gemini batch created", {
|
|
1440
|
+
batchName,
|
|
1441
|
+
state: batchInfo.state,
|
|
1442
|
+
group: groupIndex + 1,
|
|
1443
|
+
groups,
|
|
1444
|
+
requests: group.length
|
|
1445
|
+
});
|
|
1446
|
+
if (!params.wait && batchInfo.state && ![
|
|
1447
|
+
"SUCCEEDED",
|
|
1448
|
+
"COMPLETED",
|
|
1449
|
+
"DONE"
|
|
1450
|
+
].includes(batchInfo.state)) throw new Error(`gemini batch ${batchName} submitted; enable remote.batch.wait to await completion`);
|
|
1451
|
+
const completed = batchInfo.state && [
|
|
1452
|
+
"SUCCEEDED",
|
|
1453
|
+
"COMPLETED",
|
|
1454
|
+
"DONE"
|
|
1455
|
+
].includes(batchInfo.state) ? { outputFileId: batchInfo.outputConfig?.file ?? batchInfo.outputConfig?.fileId ?? batchInfo.metadata?.output?.responsesFile ?? "" } : await waitForGeminiBatch({
|
|
1456
|
+
gemini: params.gemini,
|
|
1457
|
+
batchName,
|
|
1458
|
+
wait: params.wait,
|
|
1459
|
+
pollIntervalMs: params.pollIntervalMs,
|
|
1460
|
+
timeoutMs: params.timeoutMs,
|
|
1461
|
+
debug: params.debug,
|
|
1462
|
+
initial: batchInfo
|
|
1463
|
+
});
|
|
1464
|
+
if (!completed.outputFileId) throw new Error(`gemini batch ${batchName} completed without output file`);
|
|
1465
|
+
const outputLines = parseGeminiBatchOutput(await fetchGeminiFileContent({
|
|
1466
|
+
gemini: params.gemini,
|
|
1467
|
+
fileId: completed.outputFileId
|
|
1468
|
+
}));
|
|
1469
|
+
const errors = [];
|
|
1470
|
+
const remaining = new Set(group.map((request) => request.custom_id));
|
|
1471
|
+
for (const line of outputLines) {
|
|
1472
|
+
const customId = line.key ?? line.custom_id ?? line.request_id;
|
|
1473
|
+
if (!customId) continue;
|
|
1474
|
+
remaining.delete(customId);
|
|
1475
|
+
if (line.error?.message) {
|
|
1476
|
+
errors.push(`${customId}: ${line.error.message}`);
|
|
1477
|
+
continue;
|
|
1478
|
+
}
|
|
1479
|
+
if (line.response?.error?.message) {
|
|
1480
|
+
errors.push(`${customId}: ${line.response.error.message}`);
|
|
1481
|
+
continue;
|
|
1482
|
+
}
|
|
1483
|
+
const embedding = sanitizeAndNormalizeEmbedding(line.embedding?.values ?? line.response?.embedding?.values ?? []);
|
|
1484
|
+
if (embedding.length === 0) {
|
|
1485
|
+
errors.push(`${customId}: empty embedding`);
|
|
1486
|
+
continue;
|
|
1487
|
+
}
|
|
1488
|
+
byCustomId.set(customId, embedding);
|
|
1489
|
+
}
|
|
1490
|
+
if (errors.length > 0) throw new Error(`gemini batch ${batchName} failed: ${errors.join("; ")}`);
|
|
1491
|
+
if (remaining.size > 0) throw new Error(`gemini batch ${batchName} missing ${remaining.size} embedding responses`);
|
|
1492
|
+
}
|
|
1493
|
+
});
|
|
1494
|
+
}
|
|
1495
|
+
//#endregion
|
|
1496
|
+
//#region src/memory/batch-error-utils.ts
|
|
1497
|
+
function getResponseErrorMessage(line) {
|
|
1498
|
+
const body = line?.response?.body;
|
|
1499
|
+
if (typeof body === "string") return body || void 0;
|
|
1500
|
+
if (!body || typeof body !== "object") return;
|
|
1501
|
+
return typeof body.error?.message === "string" ? body.error.message : void 0;
|
|
1502
|
+
}
|
|
1503
|
+
function extractBatchErrorMessage(lines) {
|
|
1504
|
+
const first = lines.find((line) => line.error?.message || getResponseErrorMessage(line));
|
|
1505
|
+
return first?.error?.message ?? getResponseErrorMessage(first);
|
|
1506
|
+
}
|
|
1507
|
+
function formatUnavailableBatchError(err) {
|
|
1508
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1509
|
+
return message ? `error file unavailable: ${message}` : void 0;
|
|
1510
|
+
}
|
|
1511
|
+
//#endregion
|
|
1512
|
+
//#region src/memory/batch-http.ts
|
|
1513
|
+
async function postJsonWithRetry(params) {
|
|
1514
|
+
return await retryAsync(async () => {
|
|
1515
|
+
return await postJson({
|
|
1516
|
+
url: params.url,
|
|
1517
|
+
headers: params.headers,
|
|
1518
|
+
ssrfPolicy: params.ssrfPolicy,
|
|
1519
|
+
body: params.body,
|
|
1520
|
+
errorPrefix: params.errorPrefix,
|
|
1521
|
+
attachStatus: true,
|
|
1522
|
+
parse: async (payload) => payload
|
|
1523
|
+
});
|
|
1524
|
+
}, {
|
|
1525
|
+
attempts: 3,
|
|
1526
|
+
minDelayMs: 300,
|
|
1527
|
+
maxDelayMs: 2e3,
|
|
1528
|
+
jitter: .2,
|
|
1529
|
+
shouldRetry: (err) => {
|
|
1530
|
+
const status = err.status;
|
|
1531
|
+
return status === 429 || typeof status === "number" && status >= 500;
|
|
1532
|
+
}
|
|
1533
|
+
});
|
|
1534
|
+
}
|
|
1535
|
+
//#endregion
|
|
1536
|
+
//#region src/memory/batch-output.ts
|
|
1537
|
+
function applyEmbeddingBatchOutputLine(params) {
|
|
1538
|
+
const customId = params.line.custom_id;
|
|
1539
|
+
if (!customId) return;
|
|
1540
|
+
params.remaining.delete(customId);
|
|
1541
|
+
const errorMessage = params.line.error?.message;
|
|
1542
|
+
if (errorMessage) {
|
|
1543
|
+
params.errors.push(`${customId}: ${errorMessage}`);
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1546
|
+
const response = params.line.response;
|
|
1547
|
+
if ((response?.status_code ?? 0) >= 400) {
|
|
1548
|
+
const messageFromObject = response?.body && typeof response.body === "object" ? response.body.error?.message : void 0;
|
|
1549
|
+
const messageFromString = typeof response?.body === "string" ? response.body : void 0;
|
|
1550
|
+
params.errors.push(`${customId}: ${messageFromObject ?? messageFromString ?? "unknown error"}`);
|
|
1551
|
+
return;
|
|
1552
|
+
}
|
|
1553
|
+
const embedding = (response?.body && typeof response.body === "object" ? response.body.data ?? [] : [])[0]?.embedding ?? [];
|
|
1554
|
+
if (embedding.length === 0) {
|
|
1555
|
+
params.errors.push(`${customId}: empty embedding`);
|
|
1556
|
+
return;
|
|
1557
|
+
}
|
|
1558
|
+
params.byCustomId.set(customId, embedding);
|
|
1559
|
+
}
|
|
1560
|
+
//#endregion
|
|
1561
|
+
//#region src/memory/batch-status.ts
|
|
1562
|
+
const TERMINAL_FAILURE_STATES = new Set([
|
|
1563
|
+
"failed",
|
|
1564
|
+
"expired",
|
|
1565
|
+
"cancelled",
|
|
1566
|
+
"canceled"
|
|
1567
|
+
]);
|
|
1568
|
+
function resolveBatchCompletionFromStatus(params) {
|
|
1569
|
+
if (!params.status.output_file_id) throw new Error(`${params.provider} batch ${params.batchId} completed without output file`);
|
|
1570
|
+
return {
|
|
1571
|
+
outputFileId: params.status.output_file_id,
|
|
1572
|
+
errorFileId: params.status.error_file_id ?? void 0
|
|
1573
|
+
};
|
|
1574
|
+
}
|
|
1575
|
+
async function throwIfBatchTerminalFailure(params) {
|
|
1576
|
+
const state = params.status.status ?? "unknown";
|
|
1577
|
+
if (!TERMINAL_FAILURE_STATES.has(state)) return;
|
|
1578
|
+
const detail = params.status.error_file_id ? await params.readError(params.status.error_file_id) : void 0;
|
|
1579
|
+
const suffix = detail ? `: ${detail}` : "";
|
|
1580
|
+
throw new Error(`${params.provider} batch ${params.status.id ?? "<unknown>"} ${state}${suffix}`);
|
|
1581
|
+
}
|
|
1582
|
+
async function resolveCompletedBatchResult(params) {
|
|
1583
|
+
const batchId = params.status.id ?? "<unknown>";
|
|
1584
|
+
if (!params.wait && params.status.status !== "completed") throw new Error(`${params.provider} batch ${batchId} submitted; enable remote.batch.wait to await completion`);
|
|
1585
|
+
const completed = params.status.status === "completed" ? resolveBatchCompletionFromStatus({
|
|
1586
|
+
provider: params.provider,
|
|
1587
|
+
batchId,
|
|
1588
|
+
status: params.status
|
|
1589
|
+
}) : await params.waitForBatch();
|
|
1590
|
+
if (!completed.outputFileId) throw new Error(`${params.provider} batch ${batchId} completed without output file`);
|
|
1591
|
+
return completed;
|
|
1592
|
+
}
|
|
1593
|
+
//#endregion
|
|
1594
|
+
//#region src/memory/batch-provider-common.ts
|
|
1595
|
+
const EMBEDDING_BATCH_ENDPOINT = "/v1/embeddings";
|
|
1596
|
+
//#endregion
|
|
1597
|
+
//#region src/memory/batch-upload.ts
|
|
1598
|
+
async function uploadBatchJsonlFile(params) {
|
|
1599
|
+
const baseUrl = normalizeBatchBaseUrl(params.client);
|
|
1600
|
+
const jsonl = params.requests.map((request) => JSON.stringify(request)).join("\n");
|
|
1601
|
+
const form = new FormData();
|
|
1602
|
+
form.append("purpose", "batch");
|
|
1603
|
+
form.append("file", new Blob([jsonl], { type: "application/jsonl" }), `memory-embeddings.${hashText(String(Date.now()))}.jsonl`);
|
|
1604
|
+
const filePayload = await withRemoteHttpResponse({
|
|
1605
|
+
url: `${baseUrl}/files`,
|
|
1606
|
+
ssrfPolicy: params.client.ssrfPolicy,
|
|
1607
|
+
init: {
|
|
1608
|
+
method: "POST",
|
|
1609
|
+
headers: buildBatchHeaders(params.client, { json: false }),
|
|
1610
|
+
body: form
|
|
1611
|
+
},
|
|
1612
|
+
onResponse: async (fileRes) => {
|
|
1613
|
+
if (!fileRes.ok) {
|
|
1614
|
+
const text = await fileRes.text();
|
|
1615
|
+
throw new Error(`${params.errorPrefix}: ${fileRes.status} ${text}`);
|
|
1616
|
+
}
|
|
1617
|
+
return await fileRes.json();
|
|
1618
|
+
}
|
|
1619
|
+
});
|
|
1620
|
+
if (!filePayload.id) throw new Error(`${params.errorPrefix}: missing file id`);
|
|
1621
|
+
return filePayload.id;
|
|
1622
|
+
}
|
|
1623
|
+
//#endregion
|
|
1624
|
+
//#region src/memory/batch-openai.ts
|
|
1625
|
+
const OPENAI_BATCH_ENDPOINT = EMBEDDING_BATCH_ENDPOINT;
|
|
1626
|
+
const OPENAI_BATCH_COMPLETION_WINDOW = "24h";
|
|
1627
|
+
const OPENAI_BATCH_MAX_REQUESTS = 5e4;
|
|
1628
|
+
async function submitOpenAiBatch(params) {
|
|
1629
|
+
const baseUrl = normalizeBatchBaseUrl(params.openAi);
|
|
1630
|
+
const inputFileId = await uploadBatchJsonlFile({
|
|
1631
|
+
client: params.openAi,
|
|
1632
|
+
requests: params.requests,
|
|
1633
|
+
errorPrefix: "openai batch file upload failed"
|
|
1634
|
+
});
|
|
1635
|
+
return await postJsonWithRetry({
|
|
1636
|
+
url: `${baseUrl}/batches`,
|
|
1637
|
+
headers: buildBatchHeaders(params.openAi, { json: true }),
|
|
1638
|
+
ssrfPolicy: params.openAi.ssrfPolicy,
|
|
1639
|
+
body: {
|
|
1640
|
+
input_file_id: inputFileId,
|
|
1641
|
+
endpoint: OPENAI_BATCH_ENDPOINT,
|
|
1642
|
+
completion_window: OPENAI_BATCH_COMPLETION_WINDOW,
|
|
1643
|
+
metadata: {
|
|
1644
|
+
source: "openclaw-memory",
|
|
1645
|
+
agent: params.agentId
|
|
1646
|
+
}
|
|
1647
|
+
},
|
|
1648
|
+
errorPrefix: "openai batch create failed"
|
|
1649
|
+
});
|
|
1650
|
+
}
|
|
1651
|
+
async function fetchOpenAiBatchStatus(params) {
|
|
1652
|
+
return await fetchOpenAiBatchResource({
|
|
1653
|
+
openAi: params.openAi,
|
|
1654
|
+
path: `/batches/${params.batchId}`,
|
|
1655
|
+
errorPrefix: "openai batch status",
|
|
1656
|
+
parse: async (res) => await res.json()
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
async function fetchOpenAiFileContent(params) {
|
|
1660
|
+
return await fetchOpenAiBatchResource({
|
|
1661
|
+
openAi: params.openAi,
|
|
1662
|
+
path: `/files/${params.fileId}/content`,
|
|
1663
|
+
errorPrefix: "openai batch file content",
|
|
1664
|
+
parse: async (res) => await res.text()
|
|
1665
|
+
});
|
|
1666
|
+
}
|
|
1667
|
+
async function fetchOpenAiBatchResource(params) {
|
|
1668
|
+
return await withRemoteHttpResponse({
|
|
1669
|
+
url: `${normalizeBatchBaseUrl(params.openAi)}${params.path}`,
|
|
1670
|
+
ssrfPolicy: params.openAi.ssrfPolicy,
|
|
1671
|
+
init: { headers: buildBatchHeaders(params.openAi, { json: true }) },
|
|
1672
|
+
onResponse: async (res) => {
|
|
1673
|
+
if (!res.ok) {
|
|
1674
|
+
const text = await res.text();
|
|
1675
|
+
throw new Error(`${params.errorPrefix} failed: ${res.status} ${text}`);
|
|
1676
|
+
}
|
|
1677
|
+
return await params.parse(res);
|
|
1678
|
+
}
|
|
1679
|
+
});
|
|
1680
|
+
}
|
|
1681
|
+
function parseOpenAiBatchOutput(text) {
|
|
1682
|
+
if (!text.trim()) return [];
|
|
1683
|
+
return text.split("\n").map((line) => line.trim()).filter(Boolean).map((line) => JSON.parse(line));
|
|
1684
|
+
}
|
|
1685
|
+
async function readOpenAiBatchError(params) {
|
|
1686
|
+
try {
|
|
1687
|
+
return extractBatchErrorMessage(parseOpenAiBatchOutput(await fetchOpenAiFileContent({
|
|
1688
|
+
openAi: params.openAi,
|
|
1689
|
+
fileId: params.errorFileId
|
|
1690
|
+
})));
|
|
1691
|
+
} catch (err) {
|
|
1692
|
+
return formatUnavailableBatchError(err);
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
async function waitForOpenAiBatch(params) {
|
|
1696
|
+
const start = Date.now();
|
|
1697
|
+
let current = params.initial;
|
|
1698
|
+
while (true) {
|
|
1699
|
+
const status = current ?? await fetchOpenAiBatchStatus({
|
|
1700
|
+
openAi: params.openAi,
|
|
1701
|
+
batchId: params.batchId
|
|
1702
|
+
});
|
|
1703
|
+
const state = status.status ?? "unknown";
|
|
1704
|
+
if (state === "completed") return resolveBatchCompletionFromStatus({
|
|
1705
|
+
provider: "openai",
|
|
1706
|
+
batchId: params.batchId,
|
|
1707
|
+
status
|
|
1708
|
+
});
|
|
1709
|
+
await throwIfBatchTerminalFailure({
|
|
1710
|
+
provider: "openai",
|
|
1711
|
+
status: {
|
|
1712
|
+
...status,
|
|
1713
|
+
id: params.batchId
|
|
1714
|
+
},
|
|
1715
|
+
readError: async (errorFileId) => await readOpenAiBatchError({
|
|
1716
|
+
openAi: params.openAi,
|
|
1717
|
+
errorFileId
|
|
1718
|
+
})
|
|
1719
|
+
});
|
|
1720
|
+
if (!params.wait) throw new Error(`openai batch ${params.batchId} still ${state}; wait disabled`);
|
|
1721
|
+
if (Date.now() - start > params.timeoutMs) throw new Error(`openai batch ${params.batchId} timed out after ${params.timeoutMs}ms`);
|
|
1722
|
+
params.debug?.(`openai batch ${params.batchId} ${state}; waiting ${params.pollIntervalMs}ms`);
|
|
1723
|
+
await new Promise((resolve) => setTimeout(resolve, params.pollIntervalMs));
|
|
1724
|
+
current = void 0;
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
async function runOpenAiEmbeddingBatches(params) {
|
|
1728
|
+
return await runEmbeddingBatchGroups({
|
|
1729
|
+
...buildEmbeddingBatchGroupOptions(params, {
|
|
1730
|
+
maxRequests: OPENAI_BATCH_MAX_REQUESTS,
|
|
1731
|
+
debugLabel: "memory embeddings: openai batch submit"
|
|
1732
|
+
}),
|
|
1733
|
+
runGroup: async ({ group, groupIndex, groups, byCustomId }) => {
|
|
1734
|
+
const batchInfo = await submitOpenAiBatch({
|
|
1735
|
+
openAi: params.openAi,
|
|
1736
|
+
requests: group,
|
|
1737
|
+
agentId: params.agentId
|
|
1738
|
+
});
|
|
1739
|
+
if (!batchInfo.id) throw new Error("openai batch create failed: missing batch id");
|
|
1740
|
+
const batchId = batchInfo.id;
|
|
1741
|
+
params.debug?.("memory embeddings: openai batch created", {
|
|
1742
|
+
batchId: batchInfo.id,
|
|
1743
|
+
status: batchInfo.status,
|
|
1744
|
+
group: groupIndex + 1,
|
|
1745
|
+
groups,
|
|
1746
|
+
requests: group.length
|
|
1747
|
+
});
|
|
1748
|
+
const completed = await resolveCompletedBatchResult({
|
|
1749
|
+
provider: "openai",
|
|
1750
|
+
status: batchInfo,
|
|
1751
|
+
wait: params.wait,
|
|
1752
|
+
waitForBatch: async () => await waitForOpenAiBatch({
|
|
1753
|
+
openAi: params.openAi,
|
|
1754
|
+
batchId,
|
|
1755
|
+
wait: params.wait,
|
|
1756
|
+
pollIntervalMs: params.pollIntervalMs,
|
|
1757
|
+
timeoutMs: params.timeoutMs,
|
|
1758
|
+
debug: params.debug,
|
|
1759
|
+
initial: batchInfo
|
|
1760
|
+
})
|
|
1761
|
+
});
|
|
1762
|
+
const outputLines = parseOpenAiBatchOutput(await fetchOpenAiFileContent({
|
|
1763
|
+
openAi: params.openAi,
|
|
1764
|
+
fileId: completed.outputFileId
|
|
1765
|
+
}));
|
|
1766
|
+
const errors = [];
|
|
1767
|
+
const remaining = new Set(group.map((request) => request.custom_id));
|
|
1768
|
+
for (const line of outputLines) applyEmbeddingBatchOutputLine({
|
|
1769
|
+
line,
|
|
1770
|
+
remaining,
|
|
1771
|
+
errors,
|
|
1772
|
+
byCustomId
|
|
1773
|
+
});
|
|
1774
|
+
if (errors.length > 0) throw new Error(`openai batch ${batchInfo.id} failed: ${errors.join("; ")}`);
|
|
1775
|
+
if (remaining.size > 0) throw new Error(`openai batch ${batchInfo.id} missing ${remaining.size} embedding responses`);
|
|
1776
|
+
}
|
|
1777
|
+
});
|
|
1778
|
+
}
|
|
1779
|
+
//#endregion
|
|
1780
|
+
//#region src/memory/batch-voyage.ts
|
|
1781
|
+
const VOYAGE_BATCH_ENDPOINT = EMBEDDING_BATCH_ENDPOINT;
|
|
1782
|
+
const VOYAGE_BATCH_COMPLETION_WINDOW = "12h";
|
|
1783
|
+
const VOYAGE_BATCH_MAX_REQUESTS = 5e4;
|
|
1784
|
+
async function assertVoyageResponseOk(res, context) {
|
|
1785
|
+
if (!res.ok) {
|
|
1786
|
+
const text = await res.text();
|
|
1787
|
+
throw new Error(`${context}: ${res.status} ${text}`);
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
function buildVoyageBatchRequest(params) {
|
|
1791
|
+
return {
|
|
1792
|
+
url: `${normalizeBatchBaseUrl(params.client)}/${params.path}`,
|
|
1793
|
+
ssrfPolicy: params.client.ssrfPolicy,
|
|
1794
|
+
init: { headers: buildBatchHeaders(params.client, { json: true }) },
|
|
1795
|
+
onResponse: params.onResponse
|
|
1796
|
+
};
|
|
1797
|
+
}
|
|
1798
|
+
async function submitVoyageBatch(params) {
|
|
1799
|
+
const baseUrl = normalizeBatchBaseUrl(params.client);
|
|
1800
|
+
const inputFileId = await uploadBatchJsonlFile({
|
|
1801
|
+
client: params.client,
|
|
1802
|
+
requests: params.requests,
|
|
1803
|
+
errorPrefix: "voyage batch file upload failed"
|
|
1804
|
+
});
|
|
1805
|
+
return await postJsonWithRetry({
|
|
1806
|
+
url: `${baseUrl}/batches`,
|
|
1807
|
+
headers: buildBatchHeaders(params.client, { json: true }),
|
|
1808
|
+
ssrfPolicy: params.client.ssrfPolicy,
|
|
1809
|
+
body: {
|
|
1810
|
+
input_file_id: inputFileId,
|
|
1811
|
+
endpoint: VOYAGE_BATCH_ENDPOINT,
|
|
1812
|
+
completion_window: VOYAGE_BATCH_COMPLETION_WINDOW,
|
|
1813
|
+
request_params: {
|
|
1814
|
+
model: params.client.model,
|
|
1815
|
+
input_type: "document"
|
|
1816
|
+
},
|
|
1817
|
+
metadata: {
|
|
1818
|
+
source: "clawdbot-memory",
|
|
1819
|
+
agent: params.agentId
|
|
1820
|
+
}
|
|
1821
|
+
},
|
|
1822
|
+
errorPrefix: "voyage batch create failed"
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
async function fetchVoyageBatchStatus(params) {
|
|
1826
|
+
return await withRemoteHttpResponse(buildVoyageBatchRequest({
|
|
1827
|
+
client: params.client,
|
|
1828
|
+
path: `batches/${params.batchId}`,
|
|
1829
|
+
onResponse: async (res) => {
|
|
1830
|
+
await assertVoyageResponseOk(res, "voyage batch status failed");
|
|
1831
|
+
return await res.json();
|
|
1832
|
+
}
|
|
1833
|
+
}));
|
|
1834
|
+
}
|
|
1835
|
+
async function readVoyageBatchError(params) {
|
|
1836
|
+
try {
|
|
1837
|
+
return await withRemoteHttpResponse(buildVoyageBatchRequest({
|
|
1838
|
+
client: params.client,
|
|
1839
|
+
path: `files/${params.errorFileId}/content`,
|
|
1840
|
+
onResponse: async (res) => {
|
|
1841
|
+
await assertVoyageResponseOk(res, "voyage batch error file content failed");
|
|
1842
|
+
const text = await res.text();
|
|
1843
|
+
if (!text.trim()) return;
|
|
1844
|
+
return extractBatchErrorMessage(text.split("\n").map((line) => line.trim()).filter(Boolean).map((line) => JSON.parse(line)));
|
|
1845
|
+
}
|
|
1846
|
+
}));
|
|
1847
|
+
} catch (err) {
|
|
1848
|
+
return formatUnavailableBatchError(err);
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
async function waitForVoyageBatch(params) {
|
|
1852
|
+
const start = Date.now();
|
|
1853
|
+
let current = params.initial;
|
|
1854
|
+
while (true) {
|
|
1855
|
+
const status = current ?? await fetchVoyageBatchStatus({
|
|
1856
|
+
client: params.client,
|
|
1857
|
+
batchId: params.batchId
|
|
1858
|
+
});
|
|
1859
|
+
const state = status.status ?? "unknown";
|
|
1860
|
+
if (state === "completed") return resolveBatchCompletionFromStatus({
|
|
1861
|
+
provider: "voyage",
|
|
1862
|
+
batchId: params.batchId,
|
|
1863
|
+
status
|
|
1864
|
+
});
|
|
1865
|
+
await throwIfBatchTerminalFailure({
|
|
1866
|
+
provider: "voyage",
|
|
1867
|
+
status: {
|
|
1868
|
+
...status,
|
|
1869
|
+
id: params.batchId
|
|
1870
|
+
},
|
|
1871
|
+
readError: async (errorFileId) => await readVoyageBatchError({
|
|
1872
|
+
client: params.client,
|
|
1873
|
+
errorFileId
|
|
1874
|
+
})
|
|
1875
|
+
});
|
|
1876
|
+
if (!params.wait) throw new Error(`voyage batch ${params.batchId} still ${state}; wait disabled`);
|
|
1877
|
+
if (Date.now() - start > params.timeoutMs) throw new Error(`voyage batch ${params.batchId} timed out after ${params.timeoutMs}ms`);
|
|
1878
|
+
params.debug?.(`voyage batch ${params.batchId} ${state}; waiting ${params.pollIntervalMs}ms`);
|
|
1879
|
+
await new Promise((resolve) => setTimeout(resolve, params.pollIntervalMs));
|
|
1880
|
+
current = void 0;
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
async function runVoyageEmbeddingBatches(params) {
|
|
1884
|
+
return await runEmbeddingBatchGroups({
|
|
1885
|
+
...buildEmbeddingBatchGroupOptions(params, {
|
|
1886
|
+
maxRequests: VOYAGE_BATCH_MAX_REQUESTS,
|
|
1887
|
+
debugLabel: "memory embeddings: voyage batch submit"
|
|
1888
|
+
}),
|
|
1889
|
+
runGroup: async ({ group, groupIndex, groups, byCustomId }) => {
|
|
1890
|
+
const batchInfo = await submitVoyageBatch({
|
|
1891
|
+
client: params.client,
|
|
1892
|
+
requests: group,
|
|
1893
|
+
agentId: params.agentId
|
|
1894
|
+
});
|
|
1895
|
+
if (!batchInfo.id) throw new Error("voyage batch create failed: missing batch id");
|
|
1896
|
+
const batchId = batchInfo.id;
|
|
1897
|
+
params.debug?.("memory embeddings: voyage batch created", {
|
|
1898
|
+
batchId: batchInfo.id,
|
|
1899
|
+
status: batchInfo.status,
|
|
1900
|
+
group: groupIndex + 1,
|
|
1901
|
+
groups,
|
|
1902
|
+
requests: group.length
|
|
1903
|
+
});
|
|
1904
|
+
const completed = await resolveCompletedBatchResult({
|
|
1905
|
+
provider: "voyage",
|
|
1906
|
+
status: batchInfo,
|
|
1907
|
+
wait: params.wait,
|
|
1908
|
+
waitForBatch: async () => await waitForVoyageBatch({
|
|
1909
|
+
client: params.client,
|
|
1910
|
+
batchId,
|
|
1911
|
+
wait: params.wait,
|
|
1912
|
+
pollIntervalMs: params.pollIntervalMs,
|
|
1913
|
+
timeoutMs: params.timeoutMs,
|
|
1914
|
+
debug: params.debug,
|
|
1915
|
+
initial: batchInfo
|
|
1916
|
+
})
|
|
1917
|
+
});
|
|
1918
|
+
const baseUrl = normalizeBatchBaseUrl(params.client);
|
|
1919
|
+
const errors = [];
|
|
1920
|
+
const remaining = new Set(group.map((request) => request.custom_id));
|
|
1921
|
+
await withRemoteHttpResponse({
|
|
1922
|
+
url: `${baseUrl}/files/${completed.outputFileId}/content`,
|
|
1923
|
+
ssrfPolicy: params.client.ssrfPolicy,
|
|
1924
|
+
init: { headers: buildBatchHeaders(params.client, { json: true }) },
|
|
1925
|
+
onResponse: async (contentRes) => {
|
|
1926
|
+
if (!contentRes.ok) {
|
|
1927
|
+
const text = await contentRes.text();
|
|
1928
|
+
throw new Error(`voyage batch file content failed: ${contentRes.status} ${text}`);
|
|
1929
|
+
}
|
|
1930
|
+
if (!contentRes.body) return;
|
|
1931
|
+
const reader = createInterface({
|
|
1932
|
+
input: Readable.fromWeb(contentRes.body),
|
|
1933
|
+
terminal: false
|
|
1934
|
+
});
|
|
1935
|
+
for await (const rawLine of reader) {
|
|
1936
|
+
if (!rawLine.trim()) continue;
|
|
1937
|
+
applyEmbeddingBatchOutputLine({
|
|
1938
|
+
line: JSON.parse(rawLine),
|
|
1939
|
+
remaining,
|
|
1940
|
+
errors,
|
|
1941
|
+
byCustomId
|
|
1942
|
+
});
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
});
|
|
1946
|
+
if (errors.length > 0) throw new Error(`voyage batch ${batchInfo.id} failed: ${errors.join("; ")}`);
|
|
1947
|
+
if (remaining.size > 0) throw new Error(`voyage batch ${batchInfo.id} missing ${remaining.size} embedding responses`);
|
|
1948
|
+
}
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1951
|
+
//#endregion
|
|
1952
|
+
//#region src/memory/embedding-model-limits.ts
|
|
1953
|
+
const DEFAULT_EMBEDDING_MAX_INPUT_TOKENS = 8192;
|
|
1954
|
+
const DEFAULT_LOCAL_EMBEDDING_MAX_INPUT_TOKENS = 2048;
|
|
1955
|
+
const KNOWN_EMBEDDING_MAX_INPUT_TOKENS = {
|
|
1956
|
+
"openai:text-embedding-3-small": 8192,
|
|
1957
|
+
"openai:text-embedding-3-large": 8192,
|
|
1958
|
+
"openai:text-embedding-ada-002": 8191,
|
|
1959
|
+
"gemini:text-embedding-004": 2048,
|
|
1960
|
+
"gemini:gemini-embedding-001": 2048,
|
|
1961
|
+
"gemini:gemini-embedding-2-preview": 8192,
|
|
1962
|
+
"voyage:voyage-3": 32e3,
|
|
1963
|
+
"voyage:voyage-3-lite": 16e3,
|
|
1964
|
+
"voyage:voyage-code-3": 32e3
|
|
1965
|
+
};
|
|
1966
|
+
function resolveEmbeddingMaxInputTokens(provider) {
|
|
1967
|
+
if (typeof provider.maxInputTokens === "number") return provider.maxInputTokens;
|
|
1968
|
+
const known = KNOWN_EMBEDDING_MAX_INPUT_TOKENS[`${provider.id}:${provider.model}`.toLowerCase()];
|
|
1969
|
+
if (typeof known === "number") return known;
|
|
1970
|
+
if (provider.id.toLowerCase() === "gemini") return 2048;
|
|
1971
|
+
if (provider.id.toLowerCase() === "local") return DEFAULT_LOCAL_EMBEDDING_MAX_INPUT_TOKENS;
|
|
1972
|
+
return DEFAULT_EMBEDDING_MAX_INPUT_TOKENS;
|
|
1973
|
+
}
|
|
1974
|
+
//#endregion
|
|
1975
|
+
//#region src/memory/embedding-chunk-limits.ts
|
|
1976
|
+
function enforceEmbeddingMaxInputTokens(provider, chunks, hardMaxInputTokens) {
|
|
1977
|
+
const providerMaxInputTokens = resolveEmbeddingMaxInputTokens(provider);
|
|
1978
|
+
const maxInputTokens = typeof hardMaxInputTokens === "number" && hardMaxInputTokens > 0 ? Math.min(providerMaxInputTokens, hardMaxInputTokens) : providerMaxInputTokens;
|
|
1979
|
+
const out = [];
|
|
1980
|
+
for (const chunk of chunks) {
|
|
1981
|
+
if (hasNonTextEmbeddingParts(chunk.embeddingInput)) {
|
|
1982
|
+
out.push(chunk);
|
|
1983
|
+
continue;
|
|
1984
|
+
}
|
|
1985
|
+
if (estimateUtf8Bytes(chunk.text) <= maxInputTokens) {
|
|
1986
|
+
out.push(chunk);
|
|
1987
|
+
continue;
|
|
1988
|
+
}
|
|
1989
|
+
for (const text of splitTextToUtf8ByteLimit(chunk.text, maxInputTokens)) out.push({
|
|
1990
|
+
startLine: chunk.startLine,
|
|
1991
|
+
endLine: chunk.endLine,
|
|
1992
|
+
text,
|
|
1993
|
+
hash: hashText(text),
|
|
1994
|
+
embeddingInput: { text }
|
|
1995
|
+
});
|
|
1996
|
+
}
|
|
1997
|
+
return out;
|
|
1998
|
+
}
|
|
1999
|
+
//#endregion
|
|
2000
|
+
//#region src/memory/memory-schema.ts
|
|
2001
|
+
function ensureMemoryIndexSchema(params) {
|
|
2002
|
+
params.db.exec(`
|
|
2003
|
+
CREATE TABLE IF NOT EXISTS meta (
|
|
2004
|
+
key TEXT PRIMARY KEY,
|
|
2005
|
+
value TEXT NOT NULL
|
|
2006
|
+
);
|
|
2007
|
+
`);
|
|
2008
|
+
params.db.exec(`
|
|
2009
|
+
CREATE TABLE IF NOT EXISTS files (
|
|
2010
|
+
path TEXT PRIMARY KEY,
|
|
2011
|
+
source TEXT NOT NULL DEFAULT 'memory',
|
|
2012
|
+
hash TEXT NOT NULL,
|
|
2013
|
+
mtime INTEGER NOT NULL,
|
|
2014
|
+
size INTEGER NOT NULL
|
|
2015
|
+
);
|
|
2016
|
+
`);
|
|
2017
|
+
params.db.exec(`
|
|
2018
|
+
CREATE TABLE IF NOT EXISTS chunks (
|
|
2019
|
+
id TEXT PRIMARY KEY,
|
|
2020
|
+
path TEXT NOT NULL,
|
|
2021
|
+
source TEXT NOT NULL DEFAULT 'memory',
|
|
2022
|
+
start_line INTEGER NOT NULL,
|
|
2023
|
+
end_line INTEGER NOT NULL,
|
|
2024
|
+
hash TEXT NOT NULL,
|
|
2025
|
+
model TEXT NOT NULL,
|
|
2026
|
+
text TEXT NOT NULL,
|
|
2027
|
+
embedding TEXT NOT NULL,
|
|
2028
|
+
updated_at INTEGER NOT NULL
|
|
2029
|
+
);
|
|
2030
|
+
`);
|
|
2031
|
+
if (params.cacheEnabled) {
|
|
2032
|
+
params.db.exec(`
|
|
2033
|
+
CREATE TABLE IF NOT EXISTS ${params.embeddingCacheTable} (
|
|
2034
|
+
provider TEXT NOT NULL,
|
|
2035
|
+
model TEXT NOT NULL,
|
|
2036
|
+
provider_key TEXT NOT NULL,
|
|
2037
|
+
hash TEXT NOT NULL,
|
|
2038
|
+
embedding TEXT NOT NULL,
|
|
2039
|
+
dims INTEGER,
|
|
2040
|
+
updated_at INTEGER NOT NULL,
|
|
2041
|
+
PRIMARY KEY (provider, model, provider_key, hash)
|
|
2042
|
+
);
|
|
2043
|
+
`);
|
|
2044
|
+
params.db.exec(`CREATE INDEX IF NOT EXISTS idx_embedding_cache_updated_at ON ${params.embeddingCacheTable}(updated_at);`);
|
|
2045
|
+
}
|
|
2046
|
+
let ftsAvailable = false;
|
|
2047
|
+
let ftsError;
|
|
2048
|
+
if (params.ftsEnabled) try {
|
|
2049
|
+
params.db.exec(`CREATE VIRTUAL TABLE IF NOT EXISTS ${params.ftsTable} USING fts5(\n text,\n id UNINDEXED,\n path UNINDEXED,\n source UNINDEXED,\n model UNINDEXED,\n start_line UNINDEXED,\n end_line UNINDEXED\n);`);
|
|
2050
|
+
ftsAvailable = true;
|
|
2051
|
+
} catch (err) {
|
|
2052
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2053
|
+
ftsAvailable = false;
|
|
2054
|
+
ftsError = message;
|
|
2055
|
+
}
|
|
2056
|
+
ensureColumn(params.db, "files", "source", "TEXT NOT NULL DEFAULT 'memory'");
|
|
2057
|
+
ensureColumn(params.db, "chunks", "source", "TEXT NOT NULL DEFAULT 'memory'");
|
|
2058
|
+
params.db.exec(`CREATE INDEX IF NOT EXISTS idx_chunks_path ON chunks(path);`);
|
|
2059
|
+
params.db.exec(`CREATE INDEX IF NOT EXISTS idx_chunks_source ON chunks(source);`);
|
|
2060
|
+
return {
|
|
2061
|
+
ftsAvailable,
|
|
2062
|
+
...ftsError ? { ftsError } : {}
|
|
2063
|
+
};
|
|
2064
|
+
}
|
|
2065
|
+
function ensureColumn(db, table, column, definition) {
|
|
2066
|
+
if (db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column)) return;
|
|
2067
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
2068
|
+
}
|
|
2069
|
+
//#endregion
|
|
2070
|
+
//#region src/memory/sqlite-vec.ts
|
|
2071
|
+
async function loadSqliteVecExtension(params) {
|
|
2072
|
+
try {
|
|
2073
|
+
const sqliteVec = await import("sqlite-vec");
|
|
2074
|
+
const resolvedPath = params.extensionPath?.trim() ? params.extensionPath.trim() : void 0;
|
|
2075
|
+
const extensionPath = resolvedPath ?? sqliteVec.getLoadablePath();
|
|
2076
|
+
params.db.enableLoadExtension(true);
|
|
2077
|
+
if (resolvedPath) params.db.loadExtension(extensionPath);
|
|
2078
|
+
else sqliteVec.load(params.db);
|
|
2079
|
+
return {
|
|
2080
|
+
ok: true,
|
|
2081
|
+
extensionPath
|
|
2082
|
+
};
|
|
2083
|
+
} catch (err) {
|
|
2084
|
+
return {
|
|
2085
|
+
ok: false,
|
|
2086
|
+
error: err instanceof Error ? err.message : String(err)
|
|
2087
|
+
};
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
//#endregion
|
|
2091
|
+
//#region src/memory/manager-sync-ops.ts
|
|
2092
|
+
const META_KEY = "memory_index_meta_v1";
|
|
2093
|
+
const VECTOR_TABLE$2 = "chunks_vec";
|
|
2094
|
+
const FTS_TABLE$2 = "chunks_fts";
|
|
2095
|
+
const EMBEDDING_CACHE_TABLE$2 = "embedding_cache";
|
|
2096
|
+
const SESSION_DIRTY_DEBOUNCE_MS = 5e3;
|
|
2097
|
+
const SESSION_DELTA_READ_CHUNK_BYTES = 64 * 1024;
|
|
2098
|
+
const VECTOR_LOAD_TIMEOUT_MS = 3e4;
|
|
2099
|
+
const IGNORED_MEMORY_WATCH_DIR_NAMES = new Set([
|
|
2100
|
+
".git",
|
|
2101
|
+
"node_modules",
|
|
2102
|
+
".pnpm-store",
|
|
2103
|
+
".venv",
|
|
2104
|
+
"venv",
|
|
2105
|
+
".tox",
|
|
2106
|
+
"__pycache__"
|
|
2107
|
+
]);
|
|
2108
|
+
const log$2 = createSubsystemLogger("memory");
|
|
2109
|
+
function shouldIgnoreMemoryWatchPath(watchPath) {
|
|
2110
|
+
return path.normalize(watchPath).split(path.sep).map((segment) => segment.trim().toLowerCase()).some((segment) => IGNORED_MEMORY_WATCH_DIR_NAMES.has(segment));
|
|
2111
|
+
}
|
|
2112
|
+
function runDetachedMemorySync(sync, reason) {
|
|
2113
|
+
sync().catch((err) => {
|
|
2114
|
+
log$2.warn(`memory sync failed (${reason}): ${String(err)}`);
|
|
2115
|
+
});
|
|
2116
|
+
}
|
|
2117
|
+
var MemoryManagerSyncOps = class {
|
|
2118
|
+
constructor() {
|
|
2119
|
+
this.provider = null;
|
|
2120
|
+
this.sources = /* @__PURE__ */ new Set();
|
|
2121
|
+
this.providerKey = null;
|
|
2122
|
+
this.fts = {
|
|
2123
|
+
enabled: false,
|
|
2124
|
+
available: false
|
|
2125
|
+
};
|
|
2126
|
+
this.vectorReady = null;
|
|
2127
|
+
this.watcher = null;
|
|
2128
|
+
this.watchTimer = null;
|
|
2129
|
+
this.sessionWatchTimer = null;
|
|
2130
|
+
this.sessionUnsubscribe = null;
|
|
2131
|
+
this.intervalTimer = null;
|
|
2132
|
+
this.closed = false;
|
|
2133
|
+
this.dirty = false;
|
|
2134
|
+
this.sessionsDirty = false;
|
|
2135
|
+
this.sessionsDirtyFiles = /* @__PURE__ */ new Set();
|
|
2136
|
+
this.sessionPendingFiles = /* @__PURE__ */ new Set();
|
|
2137
|
+
this.sessionDeltas = /* @__PURE__ */ new Map();
|
|
2138
|
+
this.lastMetaSerialized = null;
|
|
2139
|
+
}
|
|
2140
|
+
async ensureVectorReady(dimensions) {
|
|
2141
|
+
if (!this.vector.enabled) return false;
|
|
2142
|
+
if (!this.vectorReady) this.vectorReady = this.withTimeout(this.loadVectorExtension(), VECTOR_LOAD_TIMEOUT_MS, `sqlite-vec load timed out after ${Math.round(VECTOR_LOAD_TIMEOUT_MS / 1e3)}s`);
|
|
2143
|
+
let ready = false;
|
|
2144
|
+
try {
|
|
2145
|
+
ready = await this.vectorReady || false;
|
|
2146
|
+
} catch (err) {
|
|
2147
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2148
|
+
this.vector.available = false;
|
|
2149
|
+
this.vector.loadError = message;
|
|
2150
|
+
this.vectorReady = null;
|
|
2151
|
+
log$2.warn(`sqlite-vec unavailable: ${message}`);
|
|
2152
|
+
return false;
|
|
2153
|
+
}
|
|
2154
|
+
if (ready && typeof dimensions === "number" && dimensions > 0) this.ensureVectorTable(dimensions);
|
|
2155
|
+
return ready;
|
|
2156
|
+
}
|
|
2157
|
+
async loadVectorExtension() {
|
|
2158
|
+
if (this.vector.available !== null) return this.vector.available;
|
|
2159
|
+
if (!this.vector.enabled) {
|
|
2160
|
+
this.vector.available = false;
|
|
2161
|
+
return false;
|
|
2162
|
+
}
|
|
2163
|
+
try {
|
|
2164
|
+
const resolvedPath = this.vector.extensionPath?.trim() ? resolveUserPath(this.vector.extensionPath) : void 0;
|
|
2165
|
+
const loaded = await loadSqliteVecExtension({
|
|
2166
|
+
db: this.db,
|
|
2167
|
+
extensionPath: resolvedPath
|
|
2168
|
+
});
|
|
2169
|
+
if (!loaded.ok) throw new Error(loaded.error ?? "unknown sqlite-vec load error");
|
|
2170
|
+
this.vector.extensionPath = loaded.extensionPath;
|
|
2171
|
+
this.vector.available = true;
|
|
2172
|
+
return true;
|
|
2173
|
+
} catch (err) {
|
|
2174
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2175
|
+
this.vector.available = false;
|
|
2176
|
+
this.vector.loadError = message;
|
|
2177
|
+
log$2.warn(`sqlite-vec unavailable: ${message}`);
|
|
2178
|
+
return false;
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
ensureVectorTable(dimensions) {
|
|
2182
|
+
if (this.vector.dims === dimensions) return;
|
|
2183
|
+
if (this.vector.dims && this.vector.dims !== dimensions) this.dropVectorTable();
|
|
2184
|
+
this.db.exec(`CREATE VIRTUAL TABLE IF NOT EXISTS ${VECTOR_TABLE$2} USING vec0(\n id TEXT PRIMARY KEY,\n embedding FLOAT[${dimensions}]\n)`);
|
|
2185
|
+
this.vector.dims = dimensions;
|
|
2186
|
+
}
|
|
2187
|
+
dropVectorTable() {
|
|
2188
|
+
try {
|
|
2189
|
+
this.db.exec(`DROP TABLE IF EXISTS ${VECTOR_TABLE$2}`);
|
|
2190
|
+
} catch (err) {
|
|
2191
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2192
|
+
log$2.debug(`Failed to drop ${VECTOR_TABLE$2}: ${message}`);
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
buildSourceFilter(alias) {
|
|
2196
|
+
const sources = Array.from(this.sources);
|
|
2197
|
+
if (sources.length === 0) return {
|
|
2198
|
+
sql: "",
|
|
2199
|
+
params: []
|
|
2200
|
+
};
|
|
2201
|
+
return {
|
|
2202
|
+
sql: ` AND ${alias ? `${alias}.source` : "source"} IN (${sources.map(() => "?").join(", ")})`,
|
|
2203
|
+
params: sources
|
|
2204
|
+
};
|
|
2205
|
+
}
|
|
2206
|
+
openDatabase() {
|
|
2207
|
+
const dbPath = resolveUserPath(this.settings.store.path);
|
|
2208
|
+
return this.openDatabaseAtPath(dbPath);
|
|
2209
|
+
}
|
|
2210
|
+
openDatabaseAtPath(dbPath) {
|
|
2211
|
+
ensureDir(path.dirname(dbPath));
|
|
2212
|
+
const { DatabaseSync } = requireNodeSqlite();
|
|
2213
|
+
const db = new DatabaseSync(dbPath, { allowExtension: this.settings.store.vector.enabled });
|
|
2214
|
+
db.exec("PRAGMA busy_timeout = 5000");
|
|
2215
|
+
return db;
|
|
2216
|
+
}
|
|
2217
|
+
seedEmbeddingCache(sourceDb) {
|
|
2218
|
+
if (!this.cache.enabled) return;
|
|
2219
|
+
try {
|
|
2220
|
+
const rows = sourceDb.prepare(`SELECT provider, model, provider_key, hash, embedding, dims, updated_at FROM ${EMBEDDING_CACHE_TABLE$2}`).all();
|
|
2221
|
+
if (!rows.length) return;
|
|
2222
|
+
const insert = this.db.prepare(`INSERT INTO ${EMBEDDING_CACHE_TABLE$2} (provider, model, provider_key, hash, embedding, dims, updated_at)
|
|
2223
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
2224
|
+
ON CONFLICT(provider, model, provider_key, hash) DO UPDATE SET
|
|
2225
|
+
embedding=excluded.embedding,
|
|
2226
|
+
dims=excluded.dims,
|
|
2227
|
+
updated_at=excluded.updated_at`);
|
|
2228
|
+
this.db.exec("BEGIN");
|
|
2229
|
+
for (const row of rows) insert.run(row.provider, row.model, row.provider_key, row.hash, row.embedding, row.dims, row.updated_at);
|
|
2230
|
+
this.db.exec("COMMIT");
|
|
2231
|
+
} catch (err) {
|
|
2232
|
+
try {
|
|
2233
|
+
this.db.exec("ROLLBACK");
|
|
2234
|
+
} catch {}
|
|
2235
|
+
throw err;
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
async swapIndexFiles(targetPath, tempPath) {
|
|
2239
|
+
const backupPath = `${targetPath}.backup-${randomUUID()}`;
|
|
2240
|
+
await this.moveIndexFiles(targetPath, backupPath);
|
|
2241
|
+
try {
|
|
2242
|
+
await this.moveIndexFiles(tempPath, targetPath);
|
|
2243
|
+
} catch (err) {
|
|
2244
|
+
await this.moveIndexFiles(backupPath, targetPath);
|
|
2245
|
+
throw err;
|
|
2246
|
+
}
|
|
2247
|
+
await this.removeIndexFiles(backupPath);
|
|
2248
|
+
}
|
|
2249
|
+
async moveIndexFiles(sourceBase, targetBase) {
|
|
2250
|
+
for (const suffix of [
|
|
2251
|
+
"",
|
|
2252
|
+
"-wal",
|
|
2253
|
+
"-shm"
|
|
2254
|
+
]) {
|
|
2255
|
+
const source = `${sourceBase}${suffix}`;
|
|
2256
|
+
const target = `${targetBase}${suffix}`;
|
|
2257
|
+
try {
|
|
2258
|
+
await fs$1.rename(source, target);
|
|
2259
|
+
} catch (err) {
|
|
2260
|
+
if (err.code !== "ENOENT") throw err;
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
async removeIndexFiles(basePath) {
|
|
2265
|
+
await Promise.all([
|
|
2266
|
+
"",
|
|
2267
|
+
"-wal",
|
|
2268
|
+
"-shm"
|
|
2269
|
+
].map((suffix) => fs$1.rm(`${basePath}${suffix}`, { force: true })));
|
|
2270
|
+
}
|
|
2271
|
+
ensureSchema() {
|
|
2272
|
+
const result = ensureMemoryIndexSchema({
|
|
2273
|
+
db: this.db,
|
|
2274
|
+
embeddingCacheTable: EMBEDDING_CACHE_TABLE$2,
|
|
2275
|
+
cacheEnabled: this.cache.enabled,
|
|
2276
|
+
ftsTable: FTS_TABLE$2,
|
|
2277
|
+
ftsEnabled: this.fts.enabled
|
|
2278
|
+
});
|
|
2279
|
+
this.fts.available = result.ftsAvailable;
|
|
2280
|
+
if (result.ftsError) {
|
|
2281
|
+
this.fts.loadError = result.ftsError;
|
|
2282
|
+
if (this.fts.enabled) log$2.warn(`fts unavailable: ${result.ftsError}`);
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
ensureWatcher() {
|
|
2286
|
+
if (!this.sources.has("memory") || !this.settings.sync.watch || this.watcher) return;
|
|
2287
|
+
const watchPaths = new Set([
|
|
2288
|
+
path.join(this.workspaceDir, "MEMORY.md"),
|
|
2289
|
+
path.join(this.workspaceDir, "memory.md"),
|
|
2290
|
+
path.join(this.workspaceDir, "memory", "**", "*.md")
|
|
2291
|
+
]);
|
|
2292
|
+
const additionalPaths = normalizeExtraMemoryPaths(this.workspaceDir, this.settings.extraPaths);
|
|
2293
|
+
for (const entry of additionalPaths) try {
|
|
2294
|
+
const stat = fs.lstatSync(entry);
|
|
2295
|
+
if (stat.isSymbolicLink()) continue;
|
|
2296
|
+
if (stat.isDirectory()) {
|
|
2297
|
+
watchPaths.add(path.join(entry, "**", "*.md"));
|
|
2298
|
+
if (this.settings.multimodal.enabled) for (const modality of this.settings.multimodal.modalities) for (const extension of getMemoryMultimodalExtensions(modality)) watchPaths.add(path.join(entry, "**", buildCaseInsensitiveExtensionGlob(extension)));
|
|
2299
|
+
continue;
|
|
2300
|
+
}
|
|
2301
|
+
if (stat.isFile() && (entry.toLowerCase().endsWith(".md") || classifyMemoryMultimodalPath(entry, this.settings.multimodal) !== null)) watchPaths.add(entry);
|
|
2302
|
+
} catch {}
|
|
2303
|
+
this.watcher = chokidar.watch(Array.from(watchPaths), {
|
|
2304
|
+
ignoreInitial: true,
|
|
2305
|
+
ignored: (watchPath) => shouldIgnoreMemoryWatchPath(String(watchPath)),
|
|
2306
|
+
awaitWriteFinish: {
|
|
2307
|
+
stabilityThreshold: this.settings.sync.watchDebounceMs,
|
|
2308
|
+
pollInterval: 100
|
|
2309
|
+
}
|
|
2310
|
+
});
|
|
2311
|
+
const markDirty = () => {
|
|
2312
|
+
this.dirty = true;
|
|
2313
|
+
this.scheduleWatchSync();
|
|
2314
|
+
};
|
|
2315
|
+
this.watcher.on("add", markDirty);
|
|
2316
|
+
this.watcher.on("change", markDirty);
|
|
2317
|
+
this.watcher.on("unlink", markDirty);
|
|
2318
|
+
}
|
|
2319
|
+
ensureSessionListener() {
|
|
2320
|
+
if (!this.sources.has("sessions") || this.sessionUnsubscribe) return;
|
|
2321
|
+
this.sessionUnsubscribe = onSessionTranscriptUpdate((update) => {
|
|
2322
|
+
if (this.closed) return;
|
|
2323
|
+
const sessionFile = update.sessionFile;
|
|
2324
|
+
if (!this.isSessionFileForAgent(sessionFile)) return;
|
|
2325
|
+
this.scheduleSessionDirty(sessionFile);
|
|
2326
|
+
});
|
|
2327
|
+
}
|
|
2328
|
+
scheduleSessionDirty(sessionFile) {
|
|
2329
|
+
this.sessionPendingFiles.add(sessionFile);
|
|
2330
|
+
if (this.sessionWatchTimer) return;
|
|
2331
|
+
this.sessionWatchTimer = setTimeout(() => {
|
|
2332
|
+
this.sessionWatchTimer = null;
|
|
2333
|
+
this.processSessionDeltaBatch().catch((err) => {
|
|
2334
|
+
log$2.warn(`memory session delta failed: ${String(err)}`);
|
|
2335
|
+
});
|
|
2336
|
+
}, SESSION_DIRTY_DEBOUNCE_MS);
|
|
2337
|
+
}
|
|
2338
|
+
async processSessionDeltaBatch() {
|
|
2339
|
+
if (this.sessionPendingFiles.size === 0) return;
|
|
2340
|
+
const pending = Array.from(this.sessionPendingFiles);
|
|
2341
|
+
this.sessionPendingFiles.clear();
|
|
2342
|
+
let shouldSync = false;
|
|
2343
|
+
for (const sessionFile of pending) {
|
|
2344
|
+
const delta = await this.updateSessionDelta(sessionFile);
|
|
2345
|
+
if (!delta) continue;
|
|
2346
|
+
const bytesThreshold = delta.deltaBytes;
|
|
2347
|
+
const messagesThreshold = delta.deltaMessages;
|
|
2348
|
+
const bytesHit = bytesThreshold <= 0 ? delta.pendingBytes > 0 : delta.pendingBytes >= bytesThreshold;
|
|
2349
|
+
const messagesHit = messagesThreshold <= 0 ? delta.pendingMessages > 0 : delta.pendingMessages >= messagesThreshold;
|
|
2350
|
+
if (!bytesHit && !messagesHit) continue;
|
|
2351
|
+
this.sessionsDirtyFiles.add(sessionFile);
|
|
2352
|
+
this.sessionsDirty = true;
|
|
2353
|
+
delta.pendingBytes = bytesThreshold > 0 ? Math.max(0, delta.pendingBytes - bytesThreshold) : 0;
|
|
2354
|
+
delta.pendingMessages = messagesThreshold > 0 ? Math.max(0, delta.pendingMessages - messagesThreshold) : 0;
|
|
2355
|
+
shouldSync = true;
|
|
2356
|
+
}
|
|
2357
|
+
if (shouldSync) this.sync({ reason: "session-delta" }).catch((err) => {
|
|
2358
|
+
log$2.warn(`memory sync failed (session-delta): ${String(err)}`);
|
|
2359
|
+
});
|
|
2360
|
+
}
|
|
2361
|
+
async updateSessionDelta(sessionFile) {
|
|
2362
|
+
const thresholds = this.settings.sync.sessions;
|
|
2363
|
+
if (!thresholds) return null;
|
|
2364
|
+
let stat;
|
|
2365
|
+
try {
|
|
2366
|
+
stat = await fs$1.stat(sessionFile);
|
|
2367
|
+
} catch {
|
|
2368
|
+
return null;
|
|
2369
|
+
}
|
|
2370
|
+
const size = stat.size;
|
|
2371
|
+
let state = this.sessionDeltas.get(sessionFile);
|
|
2372
|
+
if (!state) {
|
|
2373
|
+
state = {
|
|
2374
|
+
lastSize: 0,
|
|
2375
|
+
pendingBytes: 0,
|
|
2376
|
+
pendingMessages: 0
|
|
2377
|
+
};
|
|
2378
|
+
this.sessionDeltas.set(sessionFile, state);
|
|
2379
|
+
}
|
|
2380
|
+
const deltaBytes = Math.max(0, size - state.lastSize);
|
|
2381
|
+
if (deltaBytes === 0 && size === state.lastSize) return {
|
|
2382
|
+
deltaBytes: thresholds.deltaBytes,
|
|
2383
|
+
deltaMessages: thresholds.deltaMessages,
|
|
2384
|
+
pendingBytes: state.pendingBytes,
|
|
2385
|
+
pendingMessages: state.pendingMessages
|
|
2386
|
+
};
|
|
2387
|
+
if (size < state.lastSize) {
|
|
2388
|
+
state.lastSize = size;
|
|
2389
|
+
state.pendingBytes += size;
|
|
2390
|
+
if (thresholds.deltaMessages > 0 && (thresholds.deltaBytes <= 0 || state.pendingBytes < thresholds.deltaBytes)) state.pendingMessages += await this.countNewlines(sessionFile, 0, size);
|
|
2391
|
+
} else {
|
|
2392
|
+
state.pendingBytes += deltaBytes;
|
|
2393
|
+
if (thresholds.deltaMessages > 0 && (thresholds.deltaBytes <= 0 || state.pendingBytes < thresholds.deltaBytes)) state.pendingMessages += await this.countNewlines(sessionFile, state.lastSize, size);
|
|
2394
|
+
state.lastSize = size;
|
|
2395
|
+
}
|
|
2396
|
+
this.sessionDeltas.set(sessionFile, state);
|
|
2397
|
+
return {
|
|
2398
|
+
deltaBytes: thresholds.deltaBytes,
|
|
2399
|
+
deltaMessages: thresholds.deltaMessages,
|
|
2400
|
+
pendingBytes: state.pendingBytes,
|
|
2401
|
+
pendingMessages: state.pendingMessages
|
|
2402
|
+
};
|
|
2403
|
+
}
|
|
2404
|
+
async countNewlines(absPath, start, end) {
|
|
2405
|
+
if (end <= start) return 0;
|
|
2406
|
+
let handle;
|
|
2407
|
+
try {
|
|
2408
|
+
handle = await fs$1.open(absPath, "r");
|
|
2409
|
+
} catch (err) {
|
|
2410
|
+
if (isFileMissingError(err)) return 0;
|
|
2411
|
+
throw err;
|
|
2412
|
+
}
|
|
2413
|
+
try {
|
|
2414
|
+
let offset = start;
|
|
2415
|
+
let count = 0;
|
|
2416
|
+
const buffer = Buffer.alloc(SESSION_DELTA_READ_CHUNK_BYTES);
|
|
2417
|
+
while (offset < end) {
|
|
2418
|
+
const toRead = Math.min(buffer.length, end - offset);
|
|
2419
|
+
const { bytesRead } = await handle.read(buffer, 0, toRead, offset);
|
|
2420
|
+
if (bytesRead <= 0) break;
|
|
2421
|
+
for (let i = 0; i < bytesRead; i += 1) if (buffer[i] === 10) count += 1;
|
|
2422
|
+
offset += bytesRead;
|
|
2423
|
+
}
|
|
2424
|
+
return count;
|
|
2425
|
+
} finally {
|
|
2426
|
+
await handle.close();
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
resetSessionDelta(absPath, size) {
|
|
2430
|
+
const state = this.sessionDeltas.get(absPath);
|
|
2431
|
+
if (!state) return;
|
|
2432
|
+
state.lastSize = size;
|
|
2433
|
+
state.pendingBytes = 0;
|
|
2434
|
+
state.pendingMessages = 0;
|
|
2435
|
+
}
|
|
2436
|
+
isSessionFileForAgent(sessionFile) {
|
|
2437
|
+
if (!sessionFile) return false;
|
|
2438
|
+
const sessionsDir = resolveSessionTranscriptsDirForAgent(this.agentId);
|
|
2439
|
+
const resolvedFile = path.resolve(sessionFile);
|
|
2440
|
+
const resolvedDir = path.resolve(sessionsDir);
|
|
2441
|
+
return resolvedFile.startsWith(`${resolvedDir}${path.sep}`);
|
|
2442
|
+
}
|
|
2443
|
+
normalizeTargetSessionFiles(sessionFiles) {
|
|
2444
|
+
if (!sessionFiles || sessionFiles.length === 0) return null;
|
|
2445
|
+
const normalized = /* @__PURE__ */ new Set();
|
|
2446
|
+
for (const sessionFile of sessionFiles) {
|
|
2447
|
+
const trimmed = sessionFile.trim();
|
|
2448
|
+
if (!trimmed) continue;
|
|
2449
|
+
const resolved = path.resolve(trimmed);
|
|
2450
|
+
if (this.isSessionFileForAgent(resolved)) normalized.add(resolved);
|
|
2451
|
+
}
|
|
2452
|
+
return normalized.size > 0 ? normalized : null;
|
|
2453
|
+
}
|
|
2454
|
+
clearSyncedSessionFiles(targetSessionFiles) {
|
|
2455
|
+
if (!targetSessionFiles) this.sessionsDirtyFiles.clear();
|
|
2456
|
+
else for (const targetSessionFile of targetSessionFiles) this.sessionsDirtyFiles.delete(targetSessionFile);
|
|
2457
|
+
this.sessionsDirty = this.sessionsDirtyFiles.size > 0;
|
|
2458
|
+
}
|
|
2459
|
+
ensureIntervalSync() {
|
|
2460
|
+
const minutes = this.settings.sync.intervalMinutes;
|
|
2461
|
+
if (!minutes || minutes <= 0 || this.intervalTimer) return;
|
|
2462
|
+
const ms = minutes * 60 * 1e3;
|
|
2463
|
+
this.intervalTimer = setInterval(() => {
|
|
2464
|
+
runDetachedMemorySync(() => this.sync({ reason: "interval" }), "interval");
|
|
2465
|
+
}, ms);
|
|
2466
|
+
}
|
|
2467
|
+
scheduleWatchSync() {
|
|
2468
|
+
if (!this.sources.has("memory") || !this.settings.sync.watch) return;
|
|
2469
|
+
if (this.watchTimer) clearTimeout(this.watchTimer);
|
|
2470
|
+
this.watchTimer = setTimeout(() => {
|
|
2471
|
+
this.watchTimer = null;
|
|
2472
|
+
runDetachedMemorySync(() => this.sync({ reason: "watch" }), "watch");
|
|
2473
|
+
}, this.settings.sync.watchDebounceMs);
|
|
2474
|
+
}
|
|
2475
|
+
shouldSyncSessions(params, needsFullReindex = false) {
|
|
2476
|
+
if (!this.sources.has("sessions")) return false;
|
|
2477
|
+
if (params?.sessionFiles?.some((sessionFile) => sessionFile.trim().length > 0)) return true;
|
|
2478
|
+
if (params?.force) return true;
|
|
2479
|
+
const reason = params?.reason;
|
|
2480
|
+
if (reason === "session-start" || reason === "watch") return false;
|
|
2481
|
+
if (needsFullReindex) return true;
|
|
2482
|
+
return this.sessionsDirty && this.sessionsDirtyFiles.size > 0;
|
|
2483
|
+
}
|
|
2484
|
+
async syncMemoryFiles(params) {
|
|
2485
|
+
if (!this.provider) {
|
|
2486
|
+
log$2.debug("Skipping memory file sync in FTS-only mode (no embedding provider)");
|
|
2487
|
+
return;
|
|
2488
|
+
}
|
|
2489
|
+
const fileEntries = (await runWithConcurrency((await listMemoryFiles(this.workspaceDir, this.settings.extraPaths, this.settings.multimodal)).map((file) => async () => await buildFileEntry(file, this.workspaceDir, this.settings.multimodal)), this.getIndexConcurrency())).filter((entry) => entry !== null);
|
|
2490
|
+
log$2.debug("memory sync: indexing memory files", {
|
|
2491
|
+
files: fileEntries.length,
|
|
2492
|
+
needsFullReindex: params.needsFullReindex,
|
|
2493
|
+
batch: this.batch.enabled,
|
|
2494
|
+
concurrency: this.getIndexConcurrency()
|
|
2495
|
+
});
|
|
2496
|
+
const activePaths = new Set(fileEntries.map((entry) => entry.path));
|
|
2497
|
+
if (params.progress) {
|
|
2498
|
+
params.progress.total += fileEntries.length;
|
|
2499
|
+
params.progress.report({
|
|
2500
|
+
completed: params.progress.completed,
|
|
2501
|
+
total: params.progress.total,
|
|
2502
|
+
label: this.batch.enabled ? "Indexing memory files (batch)..." : "Indexing memory files…"
|
|
2503
|
+
});
|
|
2504
|
+
}
|
|
2505
|
+
await runWithConcurrency(fileEntries.map((entry) => async () => {
|
|
2506
|
+
const record = this.db.prepare(`SELECT hash FROM files WHERE path = ? AND source = ?`).get(entry.path, "memory");
|
|
2507
|
+
if (!params.needsFullReindex && record?.hash === entry.hash) {
|
|
2508
|
+
if (params.progress) {
|
|
2509
|
+
params.progress.completed += 1;
|
|
2510
|
+
params.progress.report({
|
|
2511
|
+
completed: params.progress.completed,
|
|
2512
|
+
total: params.progress.total
|
|
2513
|
+
});
|
|
2514
|
+
}
|
|
2515
|
+
return;
|
|
2516
|
+
}
|
|
2517
|
+
await this.indexFile(entry, { source: "memory" });
|
|
2518
|
+
if (params.progress) {
|
|
2519
|
+
params.progress.completed += 1;
|
|
2520
|
+
params.progress.report({
|
|
2521
|
+
completed: params.progress.completed,
|
|
2522
|
+
total: params.progress.total
|
|
2523
|
+
});
|
|
2524
|
+
}
|
|
2525
|
+
}), this.getIndexConcurrency());
|
|
2526
|
+
const staleRows = this.db.prepare(`SELECT path FROM files WHERE source = ?`).all("memory");
|
|
2527
|
+
for (const stale of staleRows) {
|
|
2528
|
+
if (activePaths.has(stale.path)) continue;
|
|
2529
|
+
this.db.prepare(`DELETE FROM files WHERE path = ? AND source = ?`).run(stale.path, "memory");
|
|
2530
|
+
try {
|
|
2531
|
+
this.db.prepare(`DELETE FROM ${VECTOR_TABLE$2} WHERE id IN (SELECT id FROM chunks WHERE path = ? AND source = ?)`).run(stale.path, "memory");
|
|
2532
|
+
} catch {}
|
|
2533
|
+
this.db.prepare(`DELETE FROM chunks WHERE path = ? AND source = ?`).run(stale.path, "memory");
|
|
2534
|
+
if (this.fts.enabled && this.fts.available) try {
|
|
2535
|
+
this.db.prepare(`DELETE FROM ${FTS_TABLE$2} WHERE path = ? AND source = ? AND model = ?`).run(stale.path, "memory", this.provider.model);
|
|
2536
|
+
} catch {}
|
|
2537
|
+
}
|
|
2538
|
+
}
|
|
2539
|
+
async syncSessionFiles(params) {
|
|
2540
|
+
if (!this.provider) {
|
|
2541
|
+
log$2.debug("Skipping session file sync in FTS-only mode (no embedding provider)");
|
|
2542
|
+
return;
|
|
2543
|
+
}
|
|
2544
|
+
const targetSessionFiles = params.needsFullReindex ? null : this.normalizeTargetSessionFiles(params.targetSessionFiles);
|
|
2545
|
+
const files = targetSessionFiles ? Array.from(targetSessionFiles) : await listSessionFilesForAgent(this.agentId);
|
|
2546
|
+
const activePaths = targetSessionFiles ? null : new Set(files.map((file) => sessionPathForFile(file)));
|
|
2547
|
+
const indexAll = params.needsFullReindex || Boolean(targetSessionFiles) || this.sessionsDirtyFiles.size === 0;
|
|
2548
|
+
log$2.debug("memory sync: indexing session files", {
|
|
2549
|
+
files: files.length,
|
|
2550
|
+
indexAll,
|
|
2551
|
+
dirtyFiles: this.sessionsDirtyFiles.size,
|
|
2552
|
+
targetedFiles: targetSessionFiles?.size ?? 0,
|
|
2553
|
+
batch: this.batch.enabled,
|
|
2554
|
+
concurrency: this.getIndexConcurrency()
|
|
2555
|
+
});
|
|
2556
|
+
if (params.progress) {
|
|
2557
|
+
params.progress.total += files.length;
|
|
2558
|
+
params.progress.report({
|
|
2559
|
+
completed: params.progress.completed,
|
|
2560
|
+
total: params.progress.total,
|
|
2561
|
+
label: this.batch.enabled ? "Indexing session files (batch)..." : "Indexing session files…"
|
|
2562
|
+
});
|
|
2563
|
+
}
|
|
2564
|
+
await runWithConcurrency(files.map((absPath) => async () => {
|
|
2565
|
+
if (!indexAll && !this.sessionsDirtyFiles.has(absPath)) {
|
|
2566
|
+
if (params.progress) {
|
|
2567
|
+
params.progress.completed += 1;
|
|
2568
|
+
params.progress.report({
|
|
2569
|
+
completed: params.progress.completed,
|
|
2570
|
+
total: params.progress.total
|
|
2571
|
+
});
|
|
2572
|
+
}
|
|
2573
|
+
return;
|
|
2574
|
+
}
|
|
2575
|
+
const entry = await buildSessionEntry(absPath);
|
|
2576
|
+
if (!entry) {
|
|
2577
|
+
if (params.progress) {
|
|
2578
|
+
params.progress.completed += 1;
|
|
2579
|
+
params.progress.report({
|
|
2580
|
+
completed: params.progress.completed,
|
|
2581
|
+
total: params.progress.total
|
|
2582
|
+
});
|
|
2583
|
+
}
|
|
2584
|
+
return;
|
|
2585
|
+
}
|
|
2586
|
+
const record = this.db.prepare(`SELECT hash FROM files WHERE path = ? AND source = ?`).get(entry.path, "sessions");
|
|
2587
|
+
if (!params.needsFullReindex && record?.hash === entry.hash) {
|
|
2588
|
+
if (params.progress) {
|
|
2589
|
+
params.progress.completed += 1;
|
|
2590
|
+
params.progress.report({
|
|
2591
|
+
completed: params.progress.completed,
|
|
2592
|
+
total: params.progress.total
|
|
2593
|
+
});
|
|
2594
|
+
}
|
|
2595
|
+
this.resetSessionDelta(absPath, entry.size);
|
|
2596
|
+
return;
|
|
2597
|
+
}
|
|
2598
|
+
await this.indexFile(entry, {
|
|
2599
|
+
source: "sessions",
|
|
2600
|
+
content: entry.content
|
|
2601
|
+
});
|
|
2602
|
+
this.resetSessionDelta(absPath, entry.size);
|
|
2603
|
+
if (params.progress) {
|
|
2604
|
+
params.progress.completed += 1;
|
|
2605
|
+
params.progress.report({
|
|
2606
|
+
completed: params.progress.completed,
|
|
2607
|
+
total: params.progress.total
|
|
2608
|
+
});
|
|
2609
|
+
}
|
|
2610
|
+
}), this.getIndexConcurrency());
|
|
2611
|
+
if (activePaths === null) return;
|
|
2612
|
+
const staleRows = this.db.prepare(`SELECT path FROM files WHERE source = ?`).all("sessions");
|
|
2613
|
+
for (const stale of staleRows) {
|
|
2614
|
+
if (activePaths.has(stale.path)) continue;
|
|
2615
|
+
this.db.prepare(`DELETE FROM files WHERE path = ? AND source = ?`).run(stale.path, "sessions");
|
|
2616
|
+
try {
|
|
2617
|
+
this.db.prepare(`DELETE FROM ${VECTOR_TABLE$2} WHERE id IN (SELECT id FROM chunks WHERE path = ? AND source = ?)`).run(stale.path, "sessions");
|
|
2618
|
+
} catch {}
|
|
2619
|
+
this.db.prepare(`DELETE FROM chunks WHERE path = ? AND source = ?`).run(stale.path, "sessions");
|
|
2620
|
+
if (this.fts.enabled && this.fts.available) try {
|
|
2621
|
+
this.db.prepare(`DELETE FROM ${FTS_TABLE$2} WHERE path = ? AND source = ? AND model = ?`).run(stale.path, "sessions", this.provider.model);
|
|
2622
|
+
} catch {}
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
createSyncProgress(onProgress) {
|
|
2626
|
+
const state = {
|
|
2627
|
+
completed: 0,
|
|
2628
|
+
total: 0,
|
|
2629
|
+
label: void 0,
|
|
2630
|
+
report: (update) => {
|
|
2631
|
+
if (update.label) state.label = update.label;
|
|
2632
|
+
const label = update.total > 0 && state.label ? `${state.label} ${update.completed}/${update.total}` : state.label;
|
|
2633
|
+
onProgress({
|
|
2634
|
+
completed: update.completed,
|
|
2635
|
+
total: update.total,
|
|
2636
|
+
label
|
|
2637
|
+
});
|
|
2638
|
+
}
|
|
2639
|
+
};
|
|
2640
|
+
return state;
|
|
2641
|
+
}
|
|
2642
|
+
async runSync(params) {
|
|
2643
|
+
const progress = params?.progress ? this.createSyncProgress(params.progress) : void 0;
|
|
2644
|
+
if (progress) progress.report({
|
|
2645
|
+
completed: progress.completed,
|
|
2646
|
+
total: progress.total,
|
|
2647
|
+
label: "Loading vector extension…"
|
|
2648
|
+
});
|
|
2649
|
+
const vectorReady = await this.ensureVectorReady();
|
|
2650
|
+
const meta = this.readMeta();
|
|
2651
|
+
const configuredSources = this.resolveConfiguredSourcesForMeta();
|
|
2652
|
+
const configuredScopeHash = this.resolveConfiguredScopeHash();
|
|
2653
|
+
const targetSessionFiles = this.normalizeTargetSessionFiles(params?.sessionFiles);
|
|
2654
|
+
const hasTargetSessionFiles = targetSessionFiles !== null;
|
|
2655
|
+
if (hasTargetSessionFiles && targetSessionFiles && this.sources.has("sessions")) {
|
|
2656
|
+
try {
|
|
2657
|
+
await this.syncSessionFiles({
|
|
2658
|
+
needsFullReindex: false,
|
|
2659
|
+
targetSessionFiles: Array.from(targetSessionFiles),
|
|
2660
|
+
progress: progress ?? void 0
|
|
2661
|
+
});
|
|
2662
|
+
this.clearSyncedSessionFiles(targetSessionFiles);
|
|
2663
|
+
} catch (err) {
|
|
2664
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
2665
|
+
if (this.shouldFallbackOnError(reason) && await this.activateFallbackProvider(reason)) {
|
|
2666
|
+
if (process.env.OPENCLAW_TEST_FAST === "1" && process.env.OPENCLAW_TEST_MEMORY_UNSAFE_REINDEX === "1") await this.runUnsafeReindex({
|
|
2667
|
+
reason: params?.reason,
|
|
2668
|
+
force: true,
|
|
2669
|
+
progress: progress ?? void 0
|
|
2670
|
+
});
|
|
2671
|
+
else await this.runSafeReindex({
|
|
2672
|
+
reason: params?.reason,
|
|
2673
|
+
force: true,
|
|
2674
|
+
progress: progress ?? void 0
|
|
2675
|
+
});
|
|
2676
|
+
return;
|
|
2677
|
+
}
|
|
2678
|
+
throw err;
|
|
2679
|
+
}
|
|
2680
|
+
return;
|
|
2681
|
+
}
|
|
2682
|
+
const needsFullReindex = params?.force && !hasTargetSessionFiles || !meta || this.provider && meta.model !== this.provider.model || this.provider && meta.provider !== this.provider.id || meta.providerKey !== this.providerKey || this.metaSourcesDiffer(meta, configuredSources) || meta.scopeHash !== configuredScopeHash || meta.chunkTokens !== this.settings.chunking.tokens || meta.chunkOverlap !== this.settings.chunking.overlap || vectorReady && !meta?.vectorDims;
|
|
2683
|
+
try {
|
|
2684
|
+
if (needsFullReindex) {
|
|
2685
|
+
if (process.env.OPENCLAW_TEST_FAST === "1" && process.env.OPENCLAW_TEST_MEMORY_UNSAFE_REINDEX === "1") await this.runUnsafeReindex({
|
|
2686
|
+
reason: params?.reason,
|
|
2687
|
+
force: params?.force,
|
|
2688
|
+
progress: progress ?? void 0
|
|
2689
|
+
});
|
|
2690
|
+
else await this.runSafeReindex({
|
|
2691
|
+
reason: params?.reason,
|
|
2692
|
+
force: params?.force,
|
|
2693
|
+
progress: progress ?? void 0
|
|
2694
|
+
});
|
|
2695
|
+
return;
|
|
2696
|
+
}
|
|
2697
|
+
const shouldSyncMemory = this.sources.has("memory") && (!hasTargetSessionFiles && params?.force || needsFullReindex || this.dirty);
|
|
2698
|
+
const shouldSyncSessions = this.shouldSyncSessions(params, needsFullReindex);
|
|
2699
|
+
if (shouldSyncMemory) {
|
|
2700
|
+
await this.syncMemoryFiles({
|
|
2701
|
+
needsFullReindex,
|
|
2702
|
+
progress: progress ?? void 0
|
|
2703
|
+
});
|
|
2704
|
+
this.dirty = false;
|
|
2705
|
+
}
|
|
2706
|
+
if (shouldSyncSessions) {
|
|
2707
|
+
await this.syncSessionFiles({
|
|
2708
|
+
needsFullReindex,
|
|
2709
|
+
targetSessionFiles: targetSessionFiles ? Array.from(targetSessionFiles) : void 0,
|
|
2710
|
+
progress: progress ?? void 0
|
|
2711
|
+
});
|
|
2712
|
+
this.sessionsDirty = false;
|
|
2713
|
+
this.sessionsDirtyFiles.clear();
|
|
2714
|
+
} else if (this.sessionsDirtyFiles.size > 0) this.sessionsDirty = true;
|
|
2715
|
+
else this.sessionsDirty = false;
|
|
2716
|
+
} catch (err) {
|
|
2717
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
2718
|
+
if (this.shouldFallbackOnError(reason) && await this.activateFallbackProvider(reason)) {
|
|
2719
|
+
await this.runSafeReindex({
|
|
2720
|
+
reason: params?.reason ?? "fallback",
|
|
2721
|
+
force: true,
|
|
2722
|
+
progress: progress ?? void 0
|
|
2723
|
+
});
|
|
2724
|
+
return;
|
|
2725
|
+
}
|
|
2726
|
+
throw err;
|
|
2727
|
+
}
|
|
2728
|
+
}
|
|
2729
|
+
shouldFallbackOnError(message) {
|
|
2730
|
+
return /embedding|embeddings|batch/i.test(message);
|
|
2731
|
+
}
|
|
2732
|
+
resolveBatchConfig() {
|
|
2733
|
+
const batch = this.settings.remote?.batch;
|
|
2734
|
+
return {
|
|
2735
|
+
enabled: Boolean(batch?.enabled && this.provider && (this.openAi && this.provider.id === "openai" || this.gemini && this.provider.id === "gemini" || this.voyage && this.provider.id === "voyage")),
|
|
2736
|
+
wait: batch?.wait ?? true,
|
|
2737
|
+
concurrency: Math.max(1, batch?.concurrency ?? 2),
|
|
2738
|
+
pollIntervalMs: batch?.pollIntervalMs ?? 2e3,
|
|
2739
|
+
timeoutMs: (batch?.timeoutMinutes ?? 60) * 60 * 1e3
|
|
2740
|
+
};
|
|
2741
|
+
}
|
|
2742
|
+
async activateFallbackProvider(reason) {
|
|
2743
|
+
const fallback = this.settings.fallback;
|
|
2744
|
+
if (!fallback || fallback === "none" || !this.provider || fallback === this.provider.id) return false;
|
|
2745
|
+
if (this.fallbackFrom) return false;
|
|
2746
|
+
const fallbackFrom = this.provider.id;
|
|
2747
|
+
const fallbackModel = fallback === "gemini" ? DEFAULT_GEMINI_EMBEDDING_MODEL : fallback === "openai" ? DEFAULT_OPENAI_EMBEDDING_MODEL : fallback === "voyage" ? DEFAULT_VOYAGE_EMBEDDING_MODEL : fallback === "mistral" ? DEFAULT_MISTRAL_EMBEDDING_MODEL : fallback === "ollama" ? DEFAULT_OLLAMA_EMBEDDING_MODEL : this.settings.model;
|
|
2748
|
+
const fallbackResult = await createEmbeddingProvider({
|
|
2749
|
+
config: this.cfg,
|
|
2750
|
+
agentDir: resolveAgentDir(this.cfg, this.agentId),
|
|
2751
|
+
provider: fallback,
|
|
2752
|
+
remote: this.settings.remote,
|
|
2753
|
+
model: fallbackModel,
|
|
2754
|
+
outputDimensionality: this.settings.outputDimensionality,
|
|
2755
|
+
fallback: "none",
|
|
2756
|
+
local: this.settings.local
|
|
2757
|
+
});
|
|
2758
|
+
this.fallbackFrom = fallbackFrom;
|
|
2759
|
+
this.fallbackReason = reason;
|
|
2760
|
+
this.provider = fallbackResult.provider;
|
|
2761
|
+
this.openAi = fallbackResult.openAi;
|
|
2762
|
+
this.gemini = fallbackResult.gemini;
|
|
2763
|
+
this.voyage = fallbackResult.voyage;
|
|
2764
|
+
this.mistral = fallbackResult.mistral;
|
|
2765
|
+
this.ollama = fallbackResult.ollama;
|
|
2766
|
+
this.providerKey = this.computeProviderKey();
|
|
2767
|
+
this.batch = this.resolveBatchConfig();
|
|
2768
|
+
log$2.warn(`memory embeddings: switched to fallback provider (${fallback})`, { reason });
|
|
2769
|
+
return true;
|
|
2770
|
+
}
|
|
2771
|
+
async runSafeReindex(params) {
|
|
2772
|
+
const dbPath = resolveUserPath(this.settings.store.path);
|
|
2773
|
+
const tempDbPath = `${dbPath}.tmp-${randomUUID()}`;
|
|
2774
|
+
const tempDb = this.openDatabaseAtPath(tempDbPath);
|
|
2775
|
+
const originalDb = this.db;
|
|
2776
|
+
let originalDbClosed = false;
|
|
2777
|
+
const originalState = {
|
|
2778
|
+
ftsAvailable: this.fts.available,
|
|
2779
|
+
ftsError: this.fts.loadError,
|
|
2780
|
+
vectorAvailable: this.vector.available,
|
|
2781
|
+
vectorLoadError: this.vector.loadError,
|
|
2782
|
+
vectorDims: this.vector.dims,
|
|
2783
|
+
vectorReady: this.vectorReady
|
|
2784
|
+
};
|
|
2785
|
+
const restoreOriginalState = () => {
|
|
2786
|
+
if (originalDbClosed) this.db = this.openDatabaseAtPath(dbPath);
|
|
2787
|
+
else this.db = originalDb;
|
|
2788
|
+
this.fts.available = originalState.ftsAvailable;
|
|
2789
|
+
this.fts.loadError = originalState.ftsError;
|
|
2790
|
+
this.vector.available = originalDbClosed ? null : originalState.vectorAvailable;
|
|
2791
|
+
this.vector.loadError = originalState.vectorLoadError;
|
|
2792
|
+
this.vector.dims = originalState.vectorDims;
|
|
2793
|
+
this.vectorReady = originalDbClosed ? null : originalState.vectorReady;
|
|
2794
|
+
};
|
|
2795
|
+
this.db = tempDb;
|
|
2796
|
+
this.vectorReady = null;
|
|
2797
|
+
this.vector.available = null;
|
|
2798
|
+
this.vector.loadError = void 0;
|
|
2799
|
+
this.vector.dims = void 0;
|
|
2800
|
+
this.fts.available = false;
|
|
2801
|
+
this.fts.loadError = void 0;
|
|
2802
|
+
this.ensureSchema();
|
|
2803
|
+
let nextMeta = null;
|
|
2804
|
+
try {
|
|
2805
|
+
this.seedEmbeddingCache(originalDb);
|
|
2806
|
+
const shouldSyncMemory = this.sources.has("memory");
|
|
2807
|
+
const shouldSyncSessions = this.shouldSyncSessions({
|
|
2808
|
+
reason: params.reason,
|
|
2809
|
+
force: params.force
|
|
2810
|
+
}, true);
|
|
2811
|
+
if (shouldSyncMemory) {
|
|
2812
|
+
await this.syncMemoryFiles({
|
|
2813
|
+
needsFullReindex: true,
|
|
2814
|
+
progress: params.progress
|
|
2815
|
+
});
|
|
2816
|
+
this.dirty = false;
|
|
2817
|
+
}
|
|
2818
|
+
if (shouldSyncSessions) {
|
|
2819
|
+
await this.syncSessionFiles({
|
|
2820
|
+
needsFullReindex: true,
|
|
2821
|
+
progress: params.progress
|
|
2822
|
+
});
|
|
2823
|
+
this.sessionsDirty = false;
|
|
2824
|
+
this.sessionsDirtyFiles.clear();
|
|
2825
|
+
} else if (this.sessionsDirtyFiles.size > 0) this.sessionsDirty = true;
|
|
2826
|
+
else this.sessionsDirty = false;
|
|
2827
|
+
nextMeta = {
|
|
2828
|
+
model: this.provider?.model ?? "fts-only",
|
|
2829
|
+
provider: this.provider?.id ?? "none",
|
|
2830
|
+
providerKey: this.providerKey,
|
|
2831
|
+
sources: this.resolveConfiguredSourcesForMeta(),
|
|
2832
|
+
scopeHash: this.resolveConfiguredScopeHash(),
|
|
2833
|
+
chunkTokens: this.settings.chunking.tokens,
|
|
2834
|
+
chunkOverlap: this.settings.chunking.overlap
|
|
2835
|
+
};
|
|
2836
|
+
if (!nextMeta) throw new Error("Failed to compute memory index metadata for reindexing.");
|
|
2837
|
+
if (this.vector.available && this.vector.dims) nextMeta.vectorDims = this.vector.dims;
|
|
2838
|
+
this.writeMeta(nextMeta);
|
|
2839
|
+
this.pruneEmbeddingCacheIfNeeded?.();
|
|
2840
|
+
this.db.close();
|
|
2841
|
+
originalDb.close();
|
|
2842
|
+
originalDbClosed = true;
|
|
2843
|
+
await this.swapIndexFiles(dbPath, tempDbPath);
|
|
2844
|
+
this.db = this.openDatabaseAtPath(dbPath);
|
|
2845
|
+
this.vectorReady = null;
|
|
2846
|
+
this.vector.available = null;
|
|
2847
|
+
this.vector.loadError = void 0;
|
|
2848
|
+
this.ensureSchema();
|
|
2849
|
+
this.vector.dims = nextMeta?.vectorDims;
|
|
2850
|
+
} catch (err) {
|
|
2851
|
+
try {
|
|
2852
|
+
this.db.close();
|
|
2853
|
+
} catch {}
|
|
2854
|
+
await this.removeIndexFiles(tempDbPath);
|
|
2855
|
+
restoreOriginalState();
|
|
2856
|
+
throw err;
|
|
2857
|
+
}
|
|
2858
|
+
}
|
|
2859
|
+
async runUnsafeReindex(params) {
|
|
2860
|
+
this.resetIndex();
|
|
2861
|
+
const shouldSyncMemory = this.sources.has("memory");
|
|
2862
|
+
const shouldSyncSessions = this.shouldSyncSessions({
|
|
2863
|
+
reason: params.reason,
|
|
2864
|
+
force: params.force
|
|
2865
|
+
}, true);
|
|
2866
|
+
if (shouldSyncMemory) {
|
|
2867
|
+
await this.syncMemoryFiles({
|
|
2868
|
+
needsFullReindex: true,
|
|
2869
|
+
progress: params.progress
|
|
2870
|
+
});
|
|
2871
|
+
this.dirty = false;
|
|
2872
|
+
}
|
|
2873
|
+
if (shouldSyncSessions) {
|
|
2874
|
+
await this.syncSessionFiles({
|
|
2875
|
+
needsFullReindex: true,
|
|
2876
|
+
progress: params.progress
|
|
2877
|
+
});
|
|
2878
|
+
this.sessionsDirty = false;
|
|
2879
|
+
this.sessionsDirtyFiles.clear();
|
|
2880
|
+
} else if (this.sessionsDirtyFiles.size > 0) this.sessionsDirty = true;
|
|
2881
|
+
else this.sessionsDirty = false;
|
|
2882
|
+
const nextMeta = {
|
|
2883
|
+
model: this.provider?.model ?? "fts-only",
|
|
2884
|
+
provider: this.provider?.id ?? "none",
|
|
2885
|
+
providerKey: this.providerKey,
|
|
2886
|
+
sources: this.resolveConfiguredSourcesForMeta(),
|
|
2887
|
+
scopeHash: this.resolveConfiguredScopeHash(),
|
|
2888
|
+
chunkTokens: this.settings.chunking.tokens,
|
|
2889
|
+
chunkOverlap: this.settings.chunking.overlap
|
|
2890
|
+
};
|
|
2891
|
+
if (this.vector.available && this.vector.dims) nextMeta.vectorDims = this.vector.dims;
|
|
2892
|
+
this.writeMeta(nextMeta);
|
|
2893
|
+
this.pruneEmbeddingCacheIfNeeded?.();
|
|
2894
|
+
}
|
|
2895
|
+
resetIndex() {
|
|
2896
|
+
this.db.exec(`DELETE FROM files`);
|
|
2897
|
+
this.db.exec(`DELETE FROM chunks`);
|
|
2898
|
+
if (this.fts.enabled && this.fts.available) try {
|
|
2899
|
+
this.db.exec(`DELETE FROM ${FTS_TABLE$2}`);
|
|
2900
|
+
} catch {}
|
|
2901
|
+
this.dropVectorTable();
|
|
2902
|
+
this.vector.dims = void 0;
|
|
2903
|
+
this.sessionsDirtyFiles.clear();
|
|
2904
|
+
}
|
|
2905
|
+
readMeta() {
|
|
2906
|
+
const row = this.db.prepare(`SELECT value FROM meta WHERE key = ?`).get(META_KEY);
|
|
2907
|
+
if (!row?.value) {
|
|
2908
|
+
this.lastMetaSerialized = null;
|
|
2909
|
+
return null;
|
|
2910
|
+
}
|
|
2911
|
+
try {
|
|
2912
|
+
const parsed = JSON.parse(row.value);
|
|
2913
|
+
this.lastMetaSerialized = row.value;
|
|
2914
|
+
return parsed;
|
|
2915
|
+
} catch {
|
|
2916
|
+
this.lastMetaSerialized = null;
|
|
2917
|
+
return null;
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
writeMeta(meta) {
|
|
2921
|
+
const value = JSON.stringify(meta);
|
|
2922
|
+
if (this.lastMetaSerialized === value) return;
|
|
2923
|
+
this.db.prepare(`INSERT INTO meta (key, value) VALUES (?, ?) ON CONFLICT(key) DO UPDATE SET value=excluded.value`).run(META_KEY, value);
|
|
2924
|
+
this.lastMetaSerialized = value;
|
|
2925
|
+
}
|
|
2926
|
+
resolveConfiguredSourcesForMeta() {
|
|
2927
|
+
const normalized = Array.from(this.sources).filter((source) => source === "memory" || source === "sessions").toSorted();
|
|
2928
|
+
return normalized.length > 0 ? normalized : ["memory"];
|
|
2929
|
+
}
|
|
2930
|
+
normalizeMetaSources(meta) {
|
|
2931
|
+
if (!Array.isArray(meta.sources)) return ["memory"];
|
|
2932
|
+
const normalized = Array.from(new Set(meta.sources.filter((source) => source === "memory" || source === "sessions"))).toSorted();
|
|
2933
|
+
return normalized.length > 0 ? normalized : ["memory"];
|
|
2934
|
+
}
|
|
2935
|
+
resolveConfiguredScopeHash() {
|
|
2936
|
+
const extraPaths = normalizeExtraMemoryPaths(this.workspaceDir, this.settings.extraPaths).map((value) => value.replace(/\\/g, "/")).toSorted();
|
|
2937
|
+
return hashText(JSON.stringify({
|
|
2938
|
+
extraPaths,
|
|
2939
|
+
multimodal: {
|
|
2940
|
+
enabled: this.settings.multimodal.enabled,
|
|
2941
|
+
modalities: [...this.settings.multimodal.modalities].toSorted(),
|
|
2942
|
+
maxFileBytes: this.settings.multimodal.maxFileBytes
|
|
2943
|
+
}
|
|
2944
|
+
}));
|
|
2945
|
+
}
|
|
2946
|
+
metaSourcesDiffer(meta, configuredSources) {
|
|
2947
|
+
const metaSources = this.normalizeMetaSources(meta);
|
|
2948
|
+
if (metaSources.length !== configuredSources.length) return true;
|
|
2949
|
+
return metaSources.some((source, index) => source !== configuredSources[index]);
|
|
2950
|
+
}
|
|
2951
|
+
};
|
|
2952
|
+
//#endregion
|
|
2953
|
+
//#region src/memory/manager-embedding-ops.ts
|
|
2954
|
+
const VECTOR_TABLE$1 = "chunks_vec";
|
|
2955
|
+
const FTS_TABLE$1 = "chunks_fts";
|
|
2956
|
+
const EMBEDDING_CACHE_TABLE$1 = "embedding_cache";
|
|
2957
|
+
const EMBEDDING_BATCH_MAX_TOKENS = 8e3;
|
|
2958
|
+
const EMBEDDING_INDEX_CONCURRENCY = 4;
|
|
2959
|
+
const EMBEDDING_RETRY_MAX_ATTEMPTS = 3;
|
|
2960
|
+
const EMBEDDING_RETRY_BASE_DELAY_MS = 500;
|
|
2961
|
+
const EMBEDDING_RETRY_MAX_DELAY_MS = 8e3;
|
|
2962
|
+
const BATCH_FAILURE_LIMIT$1 = 2;
|
|
2963
|
+
const EMBEDDING_QUERY_TIMEOUT_REMOTE_MS = 6e4;
|
|
2964
|
+
const EMBEDDING_QUERY_TIMEOUT_LOCAL_MS = 5 * 6e4;
|
|
2965
|
+
const EMBEDDING_BATCH_TIMEOUT_REMOTE_MS = 2 * 6e4;
|
|
2966
|
+
const EMBEDDING_BATCH_TIMEOUT_LOCAL_MS = 10 * 6e4;
|
|
2967
|
+
const vectorToBlob$1 = (embedding) => Buffer.from(new Float32Array(embedding).buffer);
|
|
2968
|
+
const log$1 = createSubsystemLogger("memory");
|
|
2969
|
+
var MemoryManagerEmbeddingOps = class extends MemoryManagerSyncOps {
|
|
2970
|
+
buildEmbeddingBatches(chunks) {
|
|
2971
|
+
const batches = [];
|
|
2972
|
+
let current = [];
|
|
2973
|
+
let currentTokens = 0;
|
|
2974
|
+
for (const chunk of chunks) {
|
|
2975
|
+
const estimate = chunk.embeddingInput ? estimateStructuredEmbeddingInputBytes(chunk.embeddingInput) : estimateUtf8Bytes(chunk.text);
|
|
2976
|
+
if (current.length > 0 && currentTokens + estimate > EMBEDDING_BATCH_MAX_TOKENS) {
|
|
2977
|
+
batches.push(current);
|
|
2978
|
+
current = [];
|
|
2979
|
+
currentTokens = 0;
|
|
2980
|
+
}
|
|
2981
|
+
if (current.length === 0 && estimate > EMBEDDING_BATCH_MAX_TOKENS) {
|
|
2982
|
+
batches.push([chunk]);
|
|
2983
|
+
continue;
|
|
2984
|
+
}
|
|
2985
|
+
current.push(chunk);
|
|
2986
|
+
currentTokens += estimate;
|
|
2987
|
+
}
|
|
2988
|
+
if (current.length > 0) batches.push(current);
|
|
2989
|
+
return batches;
|
|
2990
|
+
}
|
|
2991
|
+
loadEmbeddingCache(hashes) {
|
|
2992
|
+
if (!this.cache.enabled || !this.provider) return /* @__PURE__ */ new Map();
|
|
2993
|
+
if (hashes.length === 0) return /* @__PURE__ */ new Map();
|
|
2994
|
+
const unique = [];
|
|
2995
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2996
|
+
for (const hash of hashes) {
|
|
2997
|
+
if (!hash) continue;
|
|
2998
|
+
if (seen.has(hash)) continue;
|
|
2999
|
+
seen.add(hash);
|
|
3000
|
+
unique.push(hash);
|
|
3001
|
+
}
|
|
3002
|
+
if (unique.length === 0) return /* @__PURE__ */ new Map();
|
|
3003
|
+
const out = /* @__PURE__ */ new Map();
|
|
3004
|
+
const baseParams = [
|
|
3005
|
+
this.provider.id,
|
|
3006
|
+
this.provider.model,
|
|
3007
|
+
this.providerKey
|
|
3008
|
+
];
|
|
3009
|
+
const batchSize = 400;
|
|
3010
|
+
for (let start = 0; start < unique.length; start += batchSize) {
|
|
3011
|
+
const batch = unique.slice(start, start + batchSize);
|
|
3012
|
+
const placeholders = batch.map(() => "?").join(", ");
|
|
3013
|
+
const rows = this.db.prepare(`SELECT hash, embedding FROM ${EMBEDDING_CACHE_TABLE$1}\n WHERE provider = ? AND model = ? AND provider_key = ? AND hash IN (${placeholders})`).all(...baseParams, ...batch);
|
|
3014
|
+
for (const row of rows) out.set(row.hash, parseEmbedding(row.embedding));
|
|
3015
|
+
}
|
|
3016
|
+
return out;
|
|
3017
|
+
}
|
|
3018
|
+
upsertEmbeddingCache(entries) {
|
|
3019
|
+
if (!this.cache.enabled || !this.provider) return;
|
|
3020
|
+
if (entries.length === 0) return;
|
|
3021
|
+
const now = Date.now();
|
|
3022
|
+
const stmt = this.db.prepare(`INSERT INTO ${EMBEDDING_CACHE_TABLE$1} (provider, model, provider_key, hash, embedding, dims, updated_at)\n VALUES (?, ?, ?, ?, ?, ?, ?)\n ON CONFLICT(provider, model, provider_key, hash) DO UPDATE SET\n embedding=excluded.embedding,\n dims=excluded.dims,\n updated_at=excluded.updated_at`);
|
|
3023
|
+
for (const entry of entries) {
|
|
3024
|
+
const embedding = entry.embedding ?? [];
|
|
3025
|
+
stmt.run(this.provider.id, this.provider.model, this.providerKey, entry.hash, JSON.stringify(embedding), embedding.length, now);
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
pruneEmbeddingCacheIfNeeded() {
|
|
3029
|
+
if (!this.cache.enabled) return;
|
|
3030
|
+
const max = this.cache.maxEntries;
|
|
3031
|
+
if (!max || max <= 0) return;
|
|
3032
|
+
const count = this.db.prepare(`SELECT COUNT(*) as c FROM ${EMBEDDING_CACHE_TABLE$1}`).get()?.c ?? 0;
|
|
3033
|
+
if (count <= max) return;
|
|
3034
|
+
const excess = count - max;
|
|
3035
|
+
this.db.prepare(`DELETE FROM ${EMBEDDING_CACHE_TABLE$1}\n WHERE rowid IN (\n SELECT rowid FROM ${EMBEDDING_CACHE_TABLE$1}\n ORDER BY updated_at ASC\n LIMIT ?\n )`).run(excess);
|
|
3036
|
+
}
|
|
3037
|
+
async embedChunksInBatches(chunks) {
|
|
3038
|
+
if (chunks.length === 0) return [];
|
|
3039
|
+
const { embeddings, missing } = this.collectCachedEmbeddings(chunks);
|
|
3040
|
+
if (missing.length === 0) return embeddings;
|
|
3041
|
+
const missingChunks = missing.map((m) => m.chunk);
|
|
3042
|
+
const batches = this.buildEmbeddingBatches(missingChunks);
|
|
3043
|
+
const toCache = [];
|
|
3044
|
+
const provider = this.provider;
|
|
3045
|
+
if (!provider) throw new Error("Cannot embed batch in FTS-only mode (no embedding provider)");
|
|
3046
|
+
let cursor = 0;
|
|
3047
|
+
for (const batch of batches) {
|
|
3048
|
+
const inputs = batch.map((chunk) => chunk.embeddingInput ?? { text: chunk.text });
|
|
3049
|
+
const hasStructuredInputs = inputs.some((input) => hasNonTextEmbeddingParts(input));
|
|
3050
|
+
if (hasStructuredInputs && !provider.embedBatchInputs) throw new Error(`Embedding provider "${provider.id}" does not support multimodal memory inputs.`);
|
|
3051
|
+
const batchEmbeddings = hasStructuredInputs ? await this.embedBatchInputsWithRetry(inputs) : await this.embedBatchWithRetry(batch.map((chunk) => chunk.text));
|
|
3052
|
+
for (let i = 0; i < batch.length; i += 1) {
|
|
3053
|
+
const item = missing[cursor + i];
|
|
3054
|
+
const embedding = batchEmbeddings[i] ?? [];
|
|
3055
|
+
if (item) {
|
|
3056
|
+
embeddings[item.index] = embedding;
|
|
3057
|
+
toCache.push({
|
|
3058
|
+
hash: item.chunk.hash,
|
|
3059
|
+
embedding
|
|
3060
|
+
});
|
|
3061
|
+
}
|
|
3062
|
+
}
|
|
3063
|
+
cursor += batch.length;
|
|
3064
|
+
}
|
|
3065
|
+
this.upsertEmbeddingCache(toCache);
|
|
3066
|
+
return embeddings;
|
|
3067
|
+
}
|
|
3068
|
+
computeProviderKey() {
|
|
3069
|
+
if (!this.provider) return hashText(JSON.stringify({
|
|
3070
|
+
provider: "none",
|
|
3071
|
+
model: "fts-only"
|
|
3072
|
+
}));
|
|
3073
|
+
if (this.provider.id === "openai" && this.openAi) {
|
|
3074
|
+
const entries = Object.entries(this.openAi.headers).filter(([key]) => key.toLowerCase() !== "authorization").toSorted(([a], [b]) => a.localeCompare(b)).map(([key, value]) => [key, value]);
|
|
3075
|
+
return hashText(JSON.stringify({
|
|
3076
|
+
provider: "openai",
|
|
3077
|
+
baseUrl: this.openAi.baseUrl,
|
|
3078
|
+
model: this.openAi.model,
|
|
3079
|
+
headers: entries
|
|
3080
|
+
}));
|
|
3081
|
+
}
|
|
3082
|
+
if (this.provider.id === "gemini" && this.gemini) {
|
|
3083
|
+
const entries = Object.entries(this.gemini.headers).filter(([key]) => {
|
|
3084
|
+
const lower = key.toLowerCase();
|
|
3085
|
+
return lower !== "authorization" && lower !== "x-goog-api-key";
|
|
3086
|
+
}).toSorted(([a], [b]) => a.localeCompare(b)).map(([key, value]) => [key, value]);
|
|
3087
|
+
return hashText(JSON.stringify({
|
|
3088
|
+
provider: "gemini",
|
|
3089
|
+
baseUrl: this.gemini.baseUrl,
|
|
3090
|
+
model: this.gemini.model,
|
|
3091
|
+
outputDimensionality: this.gemini.outputDimensionality,
|
|
3092
|
+
headers: entries
|
|
3093
|
+
}));
|
|
3094
|
+
}
|
|
3095
|
+
return hashText(JSON.stringify({
|
|
3096
|
+
provider: this.provider.id,
|
|
3097
|
+
model: this.provider.model
|
|
3098
|
+
}));
|
|
3099
|
+
}
|
|
3100
|
+
async embedChunksWithBatch(chunks, entry, source) {
|
|
3101
|
+
if (!this.provider) return this.embedChunksInBatches(chunks);
|
|
3102
|
+
if (this.provider.id === "openai" && this.openAi) return this.embedChunksWithOpenAiBatch(chunks, entry, source);
|
|
3103
|
+
if (this.provider.id === "gemini" && this.gemini) return this.embedChunksWithGeminiBatch(chunks, entry, source);
|
|
3104
|
+
if (this.provider.id === "voyage" && this.voyage) return this.embedChunksWithVoyageBatch(chunks, entry, source);
|
|
3105
|
+
return this.embedChunksInBatches(chunks);
|
|
3106
|
+
}
|
|
3107
|
+
collectCachedEmbeddings(chunks) {
|
|
3108
|
+
const cached = this.loadEmbeddingCache(chunks.map((chunk) => chunk.hash));
|
|
3109
|
+
const embeddings = Array.from({ length: chunks.length }, () => []);
|
|
3110
|
+
const missing = [];
|
|
3111
|
+
for (let i = 0; i < chunks.length; i += 1) {
|
|
3112
|
+
const chunk = chunks[i];
|
|
3113
|
+
const hit = chunk?.hash ? cached.get(chunk.hash) : void 0;
|
|
3114
|
+
if (hit && hit.length > 0) embeddings[i] = hit;
|
|
3115
|
+
else if (chunk) missing.push({
|
|
3116
|
+
index: i,
|
|
3117
|
+
chunk
|
|
3118
|
+
});
|
|
3119
|
+
}
|
|
3120
|
+
return {
|
|
3121
|
+
embeddings,
|
|
3122
|
+
missing
|
|
3123
|
+
};
|
|
3124
|
+
}
|
|
3125
|
+
buildBatchCustomId(params) {
|
|
3126
|
+
return hashText(`${params.source}:${params.entry.path}:${params.chunk.startLine}:${params.chunk.endLine}:${params.chunk.hash}:${params.index}`);
|
|
3127
|
+
}
|
|
3128
|
+
buildBatchRequests(params) {
|
|
3129
|
+
const requests = [];
|
|
3130
|
+
const mapping = /* @__PURE__ */ new Map();
|
|
3131
|
+
for (const item of params.missing) {
|
|
3132
|
+
const chunk = item.chunk;
|
|
3133
|
+
const customId = this.buildBatchCustomId({
|
|
3134
|
+
source: params.source,
|
|
3135
|
+
entry: params.entry,
|
|
3136
|
+
chunk,
|
|
3137
|
+
index: item.index
|
|
3138
|
+
});
|
|
3139
|
+
mapping.set(customId, {
|
|
3140
|
+
index: item.index,
|
|
3141
|
+
hash: chunk.hash
|
|
3142
|
+
});
|
|
3143
|
+
const built = params.build(chunk);
|
|
3144
|
+
requests.push({
|
|
3145
|
+
custom_id: customId,
|
|
3146
|
+
...built
|
|
3147
|
+
});
|
|
3148
|
+
}
|
|
3149
|
+
return {
|
|
3150
|
+
requests,
|
|
3151
|
+
mapping
|
|
3152
|
+
};
|
|
3153
|
+
}
|
|
3154
|
+
applyBatchEmbeddings(params) {
|
|
3155
|
+
const toCache = [];
|
|
3156
|
+
for (const [customId, embedding] of params.byCustomId.entries()) {
|
|
3157
|
+
const mapped = params.mapping.get(customId);
|
|
3158
|
+
if (!mapped) continue;
|
|
3159
|
+
params.embeddings[mapped.index] = embedding;
|
|
3160
|
+
toCache.push({
|
|
3161
|
+
hash: mapped.hash,
|
|
3162
|
+
embedding
|
|
3163
|
+
});
|
|
3164
|
+
}
|
|
3165
|
+
this.upsertEmbeddingCache(toCache);
|
|
3166
|
+
}
|
|
3167
|
+
buildEmbeddingBatchRunnerOptions(params) {
|
|
3168
|
+
const { requests, chunks, source } = params;
|
|
3169
|
+
return {
|
|
3170
|
+
agentId: this.agentId,
|
|
3171
|
+
requests,
|
|
3172
|
+
wait: this.batch.wait,
|
|
3173
|
+
concurrency: this.batch.concurrency,
|
|
3174
|
+
pollIntervalMs: this.batch.pollIntervalMs,
|
|
3175
|
+
timeoutMs: this.batch.timeoutMs,
|
|
3176
|
+
debug: (message, data) => log$1.debug(message, data ? {
|
|
3177
|
+
...data,
|
|
3178
|
+
source,
|
|
3179
|
+
chunks: chunks.length
|
|
3180
|
+
} : {
|
|
3181
|
+
source,
|
|
3182
|
+
chunks: chunks.length
|
|
3183
|
+
})
|
|
3184
|
+
};
|
|
3185
|
+
}
|
|
3186
|
+
async embedChunksWithProviderBatch(params) {
|
|
3187
|
+
if (!params.enabled) return this.embedChunksInBatches(params.chunks);
|
|
3188
|
+
if (params.chunks.length === 0) return [];
|
|
3189
|
+
const { embeddings, missing } = this.collectCachedEmbeddings(params.chunks);
|
|
3190
|
+
if (missing.length === 0) return embeddings;
|
|
3191
|
+
const { requests, mapping } = this.buildBatchRequests({
|
|
3192
|
+
missing,
|
|
3193
|
+
entry: params.entry,
|
|
3194
|
+
source: params.source,
|
|
3195
|
+
build: params.buildRequest
|
|
3196
|
+
});
|
|
3197
|
+
const runnerOptions = this.buildEmbeddingBatchRunnerOptions({
|
|
3198
|
+
requests,
|
|
3199
|
+
chunks: params.chunks,
|
|
3200
|
+
source: params.source
|
|
3201
|
+
});
|
|
3202
|
+
const batchResult = await this.runBatchWithFallback({
|
|
3203
|
+
provider: params.provider,
|
|
3204
|
+
run: async () => await params.runBatch(runnerOptions),
|
|
3205
|
+
fallback: async () => await this.embedChunksInBatches(params.chunks)
|
|
3206
|
+
});
|
|
3207
|
+
if (Array.isArray(batchResult)) return batchResult;
|
|
3208
|
+
this.applyBatchEmbeddings({
|
|
3209
|
+
byCustomId: batchResult,
|
|
3210
|
+
mapping,
|
|
3211
|
+
embeddings
|
|
3212
|
+
});
|
|
3213
|
+
return embeddings;
|
|
3214
|
+
}
|
|
3215
|
+
async embedChunksWithVoyageBatch(chunks, entry, source) {
|
|
3216
|
+
const voyage = this.voyage;
|
|
3217
|
+
return await this.embedChunksWithProviderBatch({
|
|
3218
|
+
chunks,
|
|
3219
|
+
entry,
|
|
3220
|
+
source,
|
|
3221
|
+
provider: "voyage",
|
|
3222
|
+
enabled: Boolean(voyage),
|
|
3223
|
+
buildRequest: (chunk) => ({ body: { input: chunk.text } }),
|
|
3224
|
+
runBatch: async (runnerOptions) => await runVoyageEmbeddingBatches({
|
|
3225
|
+
client: voyage,
|
|
3226
|
+
...runnerOptions
|
|
3227
|
+
})
|
|
3228
|
+
});
|
|
3229
|
+
}
|
|
3230
|
+
async embedChunksWithOpenAiBatch(chunks, entry, source) {
|
|
3231
|
+
const openAi = this.openAi;
|
|
3232
|
+
return await this.embedChunksWithProviderBatch({
|
|
3233
|
+
chunks,
|
|
3234
|
+
entry,
|
|
3235
|
+
source,
|
|
3236
|
+
provider: "openai",
|
|
3237
|
+
enabled: Boolean(openAi),
|
|
3238
|
+
buildRequest: (chunk) => ({
|
|
3239
|
+
method: "POST",
|
|
3240
|
+
url: OPENAI_BATCH_ENDPOINT,
|
|
3241
|
+
body: {
|
|
3242
|
+
model: openAi?.model ?? this.provider?.model ?? "text-embedding-3-small",
|
|
3243
|
+
input: chunk.text
|
|
3244
|
+
}
|
|
3245
|
+
}),
|
|
3246
|
+
runBatch: async (runnerOptions) => await runOpenAiEmbeddingBatches({
|
|
3247
|
+
openAi,
|
|
3248
|
+
...runnerOptions
|
|
3249
|
+
})
|
|
3250
|
+
});
|
|
3251
|
+
}
|
|
3252
|
+
async embedChunksWithGeminiBatch(chunks, entry, source) {
|
|
3253
|
+
const gemini = this.gemini;
|
|
3254
|
+
if (chunks.some((chunk) => hasNonTextEmbeddingParts(chunk.embeddingInput))) return await this.embedChunksInBatches(chunks);
|
|
3255
|
+
return await this.embedChunksWithProviderBatch({
|
|
3256
|
+
chunks,
|
|
3257
|
+
entry,
|
|
3258
|
+
source,
|
|
3259
|
+
provider: "gemini",
|
|
3260
|
+
enabled: Boolean(gemini),
|
|
3261
|
+
buildRequest: (chunk) => ({ request: buildGeminiEmbeddingRequest({
|
|
3262
|
+
input: chunk.embeddingInput ?? { text: chunk.text },
|
|
3263
|
+
taskType: "RETRIEVAL_DOCUMENT",
|
|
3264
|
+
modelPath: this.gemini?.modelPath,
|
|
3265
|
+
outputDimensionality: this.gemini?.outputDimensionality
|
|
3266
|
+
}) }),
|
|
3267
|
+
runBatch: async (runnerOptions) => await runGeminiEmbeddingBatches({
|
|
3268
|
+
gemini,
|
|
3269
|
+
...runnerOptions
|
|
3270
|
+
})
|
|
3271
|
+
});
|
|
3272
|
+
}
|
|
3273
|
+
async embedBatchWithRetry(texts) {
|
|
3274
|
+
if (texts.length === 0) return [];
|
|
3275
|
+
if (!this.provider) throw new Error("Cannot embed batch in FTS-only mode (no embedding provider)");
|
|
3276
|
+
let attempt = 0;
|
|
3277
|
+
let delayMs = EMBEDDING_RETRY_BASE_DELAY_MS;
|
|
3278
|
+
while (true) try {
|
|
3279
|
+
const timeoutMs = this.resolveEmbeddingTimeout("batch");
|
|
3280
|
+
log$1.debug("memory embeddings: batch start", {
|
|
3281
|
+
provider: this.provider.id,
|
|
3282
|
+
items: texts.length,
|
|
3283
|
+
timeoutMs
|
|
3284
|
+
});
|
|
3285
|
+
return await this.withTimeout(this.provider.embedBatch(texts), timeoutMs, `memory embeddings batch timed out after ${Math.round(timeoutMs / 1e3)}s`);
|
|
3286
|
+
} catch (err) {
|
|
3287
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
3288
|
+
if (!this.isRetryableEmbeddingError(message) || attempt >= EMBEDDING_RETRY_MAX_ATTEMPTS) throw err;
|
|
3289
|
+
await this.waitForEmbeddingRetry(delayMs, "retrying");
|
|
3290
|
+
delayMs *= 2;
|
|
3291
|
+
attempt += 1;
|
|
3292
|
+
}
|
|
3293
|
+
}
|
|
3294
|
+
async embedBatchInputsWithRetry(inputs) {
|
|
3295
|
+
if (inputs.length === 0) return [];
|
|
3296
|
+
if (!this.provider?.embedBatchInputs) return await this.embedBatchWithRetry(inputs.map((input) => input.text));
|
|
3297
|
+
let attempt = 0;
|
|
3298
|
+
let delayMs = EMBEDDING_RETRY_BASE_DELAY_MS;
|
|
3299
|
+
while (true) try {
|
|
3300
|
+
const timeoutMs = this.resolveEmbeddingTimeout("batch");
|
|
3301
|
+
log$1.debug("memory embeddings: structured batch start", {
|
|
3302
|
+
provider: this.provider.id,
|
|
3303
|
+
items: inputs.length,
|
|
3304
|
+
timeoutMs
|
|
3305
|
+
});
|
|
3306
|
+
return await this.withTimeout(this.provider.embedBatchInputs(inputs), timeoutMs, `memory embeddings batch timed out after ${Math.round(timeoutMs / 1e3)}s`);
|
|
3307
|
+
} catch (err) {
|
|
3308
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
3309
|
+
if (!this.isRetryableEmbeddingError(message) || attempt >= EMBEDDING_RETRY_MAX_ATTEMPTS) throw err;
|
|
3310
|
+
await this.waitForEmbeddingRetry(delayMs, "retrying structured batch");
|
|
3311
|
+
delayMs *= 2;
|
|
3312
|
+
attempt += 1;
|
|
3313
|
+
}
|
|
3314
|
+
}
|
|
3315
|
+
async waitForEmbeddingRetry(delayMs, action) {
|
|
3316
|
+
const waitMs = Math.min(EMBEDDING_RETRY_MAX_DELAY_MS, Math.round(delayMs * (1 + Math.random() * .2)));
|
|
3317
|
+
log$1.warn(`memory embeddings rate limited; ${action} in ${waitMs}ms`);
|
|
3318
|
+
await new Promise((resolve) => setTimeout(resolve, waitMs));
|
|
3319
|
+
}
|
|
3320
|
+
isRetryableEmbeddingError(message) {
|
|
3321
|
+
return /(rate[_ ]limit|too many requests|429|resource has been exhausted|5\d\d|cloudflare|tokens per day)/i.test(message);
|
|
3322
|
+
}
|
|
3323
|
+
resolveEmbeddingTimeout(kind) {
|
|
3324
|
+
const isLocal = this.provider?.id === "local";
|
|
3325
|
+
if (kind === "query") return isLocal ? EMBEDDING_QUERY_TIMEOUT_LOCAL_MS : EMBEDDING_QUERY_TIMEOUT_REMOTE_MS;
|
|
3326
|
+
return isLocal ? EMBEDDING_BATCH_TIMEOUT_LOCAL_MS : EMBEDDING_BATCH_TIMEOUT_REMOTE_MS;
|
|
3327
|
+
}
|
|
3328
|
+
async embedQueryWithTimeout(text) {
|
|
3329
|
+
if (!this.provider) throw new Error("Cannot embed query in FTS-only mode (no embedding provider)");
|
|
3330
|
+
const timeoutMs = this.resolveEmbeddingTimeout("query");
|
|
3331
|
+
log$1.debug("memory embeddings: query start", {
|
|
3332
|
+
provider: this.provider.id,
|
|
3333
|
+
timeoutMs
|
|
3334
|
+
});
|
|
3335
|
+
return await this.withTimeout(this.provider.embedQuery(text), timeoutMs, `memory embeddings query timed out after ${Math.round(timeoutMs / 1e3)}s`);
|
|
3336
|
+
}
|
|
3337
|
+
async withTimeout(promise, timeoutMs, message) {
|
|
3338
|
+
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) return await promise;
|
|
3339
|
+
let timer = null;
|
|
3340
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
3341
|
+
timer = setTimeout(() => reject(new Error(message)), timeoutMs);
|
|
3342
|
+
});
|
|
3343
|
+
try {
|
|
3344
|
+
return await Promise.race([promise, timeoutPromise]);
|
|
3345
|
+
} finally {
|
|
3346
|
+
if (timer) clearTimeout(timer);
|
|
3347
|
+
}
|
|
3348
|
+
}
|
|
3349
|
+
async withBatchFailureLock(fn) {
|
|
3350
|
+
let release;
|
|
3351
|
+
const wait = this.batchFailureLock;
|
|
3352
|
+
this.batchFailureLock = new Promise((resolve) => {
|
|
3353
|
+
release = resolve;
|
|
3354
|
+
});
|
|
3355
|
+
await wait;
|
|
3356
|
+
try {
|
|
3357
|
+
return await fn();
|
|
3358
|
+
} finally {
|
|
3359
|
+
release();
|
|
3360
|
+
}
|
|
3361
|
+
}
|
|
3362
|
+
async resetBatchFailureCount() {
|
|
3363
|
+
await this.withBatchFailureLock(async () => {
|
|
3364
|
+
if (this.batchFailureCount > 0) log$1.debug("memory embeddings: batch recovered; resetting failure count");
|
|
3365
|
+
this.batchFailureCount = 0;
|
|
3366
|
+
this.batchFailureLastError = void 0;
|
|
3367
|
+
this.batchFailureLastProvider = void 0;
|
|
3368
|
+
});
|
|
3369
|
+
}
|
|
3370
|
+
async recordBatchFailure(params) {
|
|
3371
|
+
return await this.withBatchFailureLock(async () => {
|
|
3372
|
+
if (!this.batch.enabled) return {
|
|
3373
|
+
disabled: true,
|
|
3374
|
+
count: this.batchFailureCount
|
|
3375
|
+
};
|
|
3376
|
+
const increment = params.forceDisable ? BATCH_FAILURE_LIMIT$1 : Math.max(1, params.attempts ?? 1);
|
|
3377
|
+
this.batchFailureCount += increment;
|
|
3378
|
+
this.batchFailureLastError = params.message;
|
|
3379
|
+
this.batchFailureLastProvider = params.provider;
|
|
3380
|
+
const disabled = params.forceDisable || this.batchFailureCount >= BATCH_FAILURE_LIMIT$1;
|
|
3381
|
+
if (disabled) this.batch.enabled = false;
|
|
3382
|
+
return {
|
|
3383
|
+
disabled,
|
|
3384
|
+
count: this.batchFailureCount
|
|
3385
|
+
};
|
|
3386
|
+
});
|
|
3387
|
+
}
|
|
3388
|
+
isBatchTimeoutError(message) {
|
|
3389
|
+
return /timed out|timeout/i.test(message);
|
|
3390
|
+
}
|
|
3391
|
+
async runBatchWithTimeoutRetry(params) {
|
|
3392
|
+
try {
|
|
3393
|
+
return await params.run();
|
|
3394
|
+
} catch (err) {
|
|
3395
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
3396
|
+
if (this.isBatchTimeoutError(message)) {
|
|
3397
|
+
log$1.warn(`memory embeddings: ${params.provider} batch timed out; retrying once`);
|
|
3398
|
+
try {
|
|
3399
|
+
return await params.run();
|
|
3400
|
+
} catch (retryErr) {
|
|
3401
|
+
retryErr.batchAttempts = 2;
|
|
3402
|
+
throw retryErr;
|
|
3403
|
+
}
|
|
3404
|
+
}
|
|
3405
|
+
throw err;
|
|
3406
|
+
}
|
|
3407
|
+
}
|
|
3408
|
+
async runBatchWithFallback(params) {
|
|
3409
|
+
if (!this.batch.enabled) return await params.fallback();
|
|
3410
|
+
try {
|
|
3411
|
+
const result = await this.runBatchWithTimeoutRetry({
|
|
3412
|
+
provider: params.provider,
|
|
3413
|
+
run: params.run
|
|
3414
|
+
});
|
|
3415
|
+
await this.resetBatchFailureCount();
|
|
3416
|
+
return result;
|
|
3417
|
+
} catch (err) {
|
|
3418
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
3419
|
+
const attempts = err.batchAttempts ?? 1;
|
|
3420
|
+
const forceDisable = /asyncBatchEmbedContent not available/i.test(message);
|
|
3421
|
+
const failure = await this.recordBatchFailure({
|
|
3422
|
+
provider: params.provider,
|
|
3423
|
+
message,
|
|
3424
|
+
attempts,
|
|
3425
|
+
forceDisable
|
|
3426
|
+
});
|
|
3427
|
+
const suffix = failure.disabled ? "disabling batch" : "keeping batch enabled";
|
|
3428
|
+
log$1.warn(`memory embeddings: ${params.provider} batch failed (${failure.count}/${BATCH_FAILURE_LIMIT$1}); ${suffix}; falling back to non-batch embeddings: ${message}`);
|
|
3429
|
+
return await params.fallback();
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
getIndexConcurrency() {
|
|
3433
|
+
return this.batch.enabled ? this.batch.concurrency : EMBEDDING_INDEX_CONCURRENCY;
|
|
3434
|
+
}
|
|
3435
|
+
clearIndexedFileData(pathname, source) {
|
|
3436
|
+
if (this.vector.enabled) try {
|
|
3437
|
+
this.db.prepare(`DELETE FROM ${VECTOR_TABLE$1} WHERE id IN (SELECT id FROM chunks WHERE path = ? AND source = ?)`).run(pathname, source);
|
|
3438
|
+
} catch {}
|
|
3439
|
+
if (this.fts.enabled && this.fts.available && this.provider) try {
|
|
3440
|
+
this.db.prepare(`DELETE FROM ${FTS_TABLE$1} WHERE path = ? AND source = ? AND model = ?`).run(pathname, source, this.provider.model);
|
|
3441
|
+
} catch {}
|
|
3442
|
+
this.db.prepare(`DELETE FROM chunks WHERE path = ? AND source = ?`).run(pathname, source);
|
|
3443
|
+
}
|
|
3444
|
+
upsertFileRecord(entry, source) {
|
|
3445
|
+
this.db.prepare(`INSERT INTO files (path, source, hash, mtime, size) VALUES (?, ?, ?, ?, ?)
|
|
3446
|
+
ON CONFLICT(path) DO UPDATE SET
|
|
3447
|
+
source=excluded.source,
|
|
3448
|
+
hash=excluded.hash,
|
|
3449
|
+
mtime=excluded.mtime,
|
|
3450
|
+
size=excluded.size`).run(entry.path, source, entry.hash, entry.mtimeMs, entry.size);
|
|
3451
|
+
}
|
|
3452
|
+
deleteFileRecord(pathname, source) {
|
|
3453
|
+
this.db.prepare(`DELETE FROM files WHERE path = ? AND source = ?`).run(pathname, source);
|
|
3454
|
+
}
|
|
3455
|
+
isStructuredInputTooLargeError(message) {
|
|
3456
|
+
return /(413|payload too large|request too large|input too large|too many tokens|input limit|request size)/i.test(message);
|
|
3457
|
+
}
|
|
3458
|
+
async indexFile(entry, options) {
|
|
3459
|
+
if (!this.provider) {
|
|
3460
|
+
log$1.debug("Skipping embedding indexing in FTS-only mode", {
|
|
3461
|
+
path: entry.path,
|
|
3462
|
+
source: options.source
|
|
3463
|
+
});
|
|
3464
|
+
return;
|
|
3465
|
+
}
|
|
3466
|
+
let chunks;
|
|
3467
|
+
let structuredInputBytes;
|
|
3468
|
+
if ("kind" in entry && entry.kind === "multimodal") {
|
|
3469
|
+
const multimodalChunk = await buildMultimodalChunkForIndexing(entry);
|
|
3470
|
+
if (!multimodalChunk) {
|
|
3471
|
+
this.clearIndexedFileData(entry.path, options.source);
|
|
3472
|
+
this.deleteFileRecord(entry.path, options.source);
|
|
3473
|
+
return;
|
|
3474
|
+
}
|
|
3475
|
+
structuredInputBytes = multimodalChunk.structuredInputBytes;
|
|
3476
|
+
chunks = [multimodalChunk.chunk];
|
|
3477
|
+
} else {
|
|
3478
|
+
const content = options.content ?? await fs$1.readFile(entry.absPath, "utf-8");
|
|
3479
|
+
chunks = enforceEmbeddingMaxInputTokens(this.provider, chunkMarkdown(content, this.settings.chunking).filter((chunk) => chunk.text.trim().length > 0), EMBEDDING_BATCH_MAX_TOKENS);
|
|
3480
|
+
if (options.source === "sessions" && "lineMap" in entry) remapChunkLines(chunks, entry.lineMap);
|
|
3481
|
+
}
|
|
3482
|
+
let embeddings;
|
|
3483
|
+
try {
|
|
3484
|
+
embeddings = this.batch.enabled ? await this.embedChunksWithBatch(chunks, entry, options.source) : await this.embedChunksInBatches(chunks);
|
|
3485
|
+
} catch (err) {
|
|
3486
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
3487
|
+
if ("kind" in entry && entry.kind === "multimodal" && this.isStructuredInputTooLargeError(message)) {
|
|
3488
|
+
log$1.warn("memory embeddings: skipping multimodal file rejected as too large", {
|
|
3489
|
+
path: entry.path,
|
|
3490
|
+
bytes: structuredInputBytes,
|
|
3491
|
+
provider: this.provider.id,
|
|
3492
|
+
model: this.provider.model,
|
|
3493
|
+
error: message
|
|
3494
|
+
});
|
|
3495
|
+
this.clearIndexedFileData(entry.path, options.source);
|
|
3496
|
+
this.upsertFileRecord(entry, options.source);
|
|
3497
|
+
return;
|
|
3498
|
+
}
|
|
3499
|
+
throw err;
|
|
3500
|
+
}
|
|
3501
|
+
const sample = embeddings.find((embedding) => embedding.length > 0);
|
|
3502
|
+
const vectorReady = sample ? await this.ensureVectorReady(sample.length) : false;
|
|
3503
|
+
const now = Date.now();
|
|
3504
|
+
this.clearIndexedFileData(entry.path, options.source);
|
|
3505
|
+
for (let i = 0; i < chunks.length; i++) {
|
|
3506
|
+
const chunk = chunks[i];
|
|
3507
|
+
const embedding = embeddings[i] ?? [];
|
|
3508
|
+
const id = hashText(`${options.source}:${entry.path}:${chunk.startLine}:${chunk.endLine}:${chunk.hash}:${this.provider.model}`);
|
|
3509
|
+
this.db.prepare(`INSERT INTO chunks (id, path, source, start_line, end_line, hash, model, text, embedding, updated_at)
|
|
3510
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
3511
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
3512
|
+
hash=excluded.hash,
|
|
3513
|
+
model=excluded.model,
|
|
3514
|
+
text=excluded.text,
|
|
3515
|
+
embedding=excluded.embedding,
|
|
3516
|
+
updated_at=excluded.updated_at`).run(id, entry.path, options.source, chunk.startLine, chunk.endLine, chunk.hash, this.provider.model, chunk.text, JSON.stringify(embedding), now);
|
|
3517
|
+
if (vectorReady && embedding.length > 0) {
|
|
3518
|
+
try {
|
|
3519
|
+
this.db.prepare(`DELETE FROM ${VECTOR_TABLE$1} WHERE id = ?`).run(id);
|
|
3520
|
+
} catch {}
|
|
3521
|
+
this.db.prepare(`INSERT INTO ${VECTOR_TABLE$1} (id, embedding) VALUES (?, ?)`).run(id, vectorToBlob$1(embedding));
|
|
3522
|
+
}
|
|
3523
|
+
if (this.fts.enabled && this.fts.available) this.db.prepare(`INSERT INTO ${FTS_TABLE$1} (text, id, path, source, model, start_line, end_line)\n VALUES (?, ?, ?, ?, ?, ?, ?)`).run(chunk.text, id, entry.path, options.source, this.provider.model, chunk.startLine, chunk.endLine);
|
|
3524
|
+
}
|
|
3525
|
+
this.upsertFileRecord(entry, options.source);
|
|
3526
|
+
}
|
|
3527
|
+
};
|
|
3528
|
+
//#endregion
|
|
3529
|
+
//#region src/memory/manager-search.ts
|
|
3530
|
+
const vectorToBlob = (embedding) => Buffer.from(new Float32Array(embedding).buffer);
|
|
3531
|
+
async function searchVector(params) {
|
|
3532
|
+
if (params.queryVec.length === 0 || params.limit <= 0) return [];
|
|
3533
|
+
if (await params.ensureVectorReady(params.queryVec.length)) return params.db.prepare(`SELECT c.id, c.path, c.start_line, c.end_line, c.text,
|
|
3534
|
+
c.source,
|
|
3535
|
+
vec_distance_cosine(v.embedding, ?) AS dist
|
|
3536
|
+
FROM ${params.vectorTable} v\n JOIN chunks c ON c.id = v.id\n WHERE c.model = ?${params.sourceFilterVec.sql}\n ORDER BY dist ASC\n LIMIT ?`).all(vectorToBlob(params.queryVec), params.providerModel, ...params.sourceFilterVec.params, params.limit).map((row) => ({
|
|
3537
|
+
id: row.id,
|
|
3538
|
+
path: row.path,
|
|
3539
|
+
startLine: row.start_line,
|
|
3540
|
+
endLine: row.end_line,
|
|
3541
|
+
score: 1 - row.dist,
|
|
3542
|
+
snippet: truncateUtf16Safe(row.text, params.snippetMaxChars),
|
|
3543
|
+
source: row.source
|
|
3544
|
+
}));
|
|
3545
|
+
return listChunks({
|
|
3546
|
+
db: params.db,
|
|
3547
|
+
providerModel: params.providerModel,
|
|
3548
|
+
sourceFilter: params.sourceFilterChunks
|
|
3549
|
+
}).map((chunk) => ({
|
|
3550
|
+
chunk,
|
|
3551
|
+
score: cosineSimilarity(params.queryVec, chunk.embedding)
|
|
3552
|
+
})).filter((entry) => Number.isFinite(entry.score)).toSorted((a, b) => b.score - a.score).slice(0, params.limit).map((entry) => ({
|
|
3553
|
+
id: entry.chunk.id,
|
|
3554
|
+
path: entry.chunk.path,
|
|
3555
|
+
startLine: entry.chunk.startLine,
|
|
3556
|
+
endLine: entry.chunk.endLine,
|
|
3557
|
+
score: entry.score,
|
|
3558
|
+
snippet: truncateUtf16Safe(entry.chunk.text, params.snippetMaxChars),
|
|
3559
|
+
source: entry.chunk.source
|
|
3560
|
+
}));
|
|
3561
|
+
}
|
|
3562
|
+
function listChunks(params) {
|
|
3563
|
+
return params.db.prepare(`SELECT id, path, start_line, end_line, text, embedding, source
|
|
3564
|
+
FROM chunks
|
|
3565
|
+
WHERE model = ?${params.sourceFilter.sql}`).all(params.providerModel, ...params.sourceFilter.params).map((row) => ({
|
|
3566
|
+
id: row.id,
|
|
3567
|
+
path: row.path,
|
|
3568
|
+
startLine: row.start_line,
|
|
3569
|
+
endLine: row.end_line,
|
|
3570
|
+
text: row.text,
|
|
3571
|
+
embedding: parseEmbedding(row.embedding),
|
|
3572
|
+
source: row.source
|
|
3573
|
+
}));
|
|
3574
|
+
}
|
|
3575
|
+
async function searchKeyword(params) {
|
|
3576
|
+
if (params.limit <= 0) return [];
|
|
3577
|
+
const ftsQuery = params.buildFtsQuery(params.query);
|
|
3578
|
+
if (!ftsQuery) return [];
|
|
3579
|
+
const modelClause = params.providerModel ? " AND model = ?" : "";
|
|
3580
|
+
const modelParams = params.providerModel ? [params.providerModel] : [];
|
|
3581
|
+
return params.db.prepare(`SELECT id, path, source, start_line, end_line, text,\n bm25(${params.ftsTable}) AS rank\n FROM ${params.ftsTable}\n WHERE ${params.ftsTable} MATCH ?${modelClause}${params.sourceFilter.sql}\n ORDER BY rank ASC\n LIMIT ?`).all(ftsQuery, ...modelParams, ...params.sourceFilter.params, params.limit).map((row) => {
|
|
3582
|
+
const textScore = params.bm25RankToScore(row.rank);
|
|
3583
|
+
return {
|
|
3584
|
+
id: row.id,
|
|
3585
|
+
path: row.path,
|
|
3586
|
+
startLine: row.start_line,
|
|
3587
|
+
endLine: row.end_line,
|
|
3588
|
+
score: textScore,
|
|
3589
|
+
textScore,
|
|
3590
|
+
snippet: truncateUtf16Safe(row.text, params.snippetMaxChars),
|
|
3591
|
+
source: row.source
|
|
3592
|
+
};
|
|
3593
|
+
});
|
|
3594
|
+
}
|
|
3595
|
+
//#endregion
|
|
3596
|
+
//#region src/memory/read-file.ts
|
|
3597
|
+
async function readMemoryFile(params) {
|
|
3598
|
+
const rawPath = params.relPath.trim();
|
|
3599
|
+
if (!rawPath) throw new Error("path required");
|
|
3600
|
+
const absPath = path.isAbsolute(rawPath) ? path.resolve(rawPath) : path.resolve(params.workspaceDir, rawPath);
|
|
3601
|
+
const relPath = path.relative(params.workspaceDir, absPath).replace(/\\/g, "/");
|
|
3602
|
+
const allowedWorkspace = relPath.length > 0 && !relPath.startsWith("..") && !path.isAbsolute(relPath) && isMemoryPath(relPath);
|
|
3603
|
+
let allowedAdditional = false;
|
|
3604
|
+
if (!allowedWorkspace && (params.extraPaths?.length ?? 0) > 0) {
|
|
3605
|
+
const additionalPaths = normalizeExtraMemoryPaths(params.workspaceDir, params.extraPaths);
|
|
3606
|
+
for (const additionalPath of additionalPaths) try {
|
|
3607
|
+
const stat = await fs$1.lstat(additionalPath);
|
|
3608
|
+
if (stat.isSymbolicLink()) continue;
|
|
3609
|
+
if (stat.isDirectory()) {
|
|
3610
|
+
if (absPath === additionalPath || absPath.startsWith(`${additionalPath}${path.sep}`)) {
|
|
3611
|
+
allowedAdditional = true;
|
|
3612
|
+
break;
|
|
3613
|
+
}
|
|
3614
|
+
continue;
|
|
3615
|
+
}
|
|
3616
|
+
if (stat.isFile() && absPath === additionalPath && absPath.endsWith(".md")) {
|
|
3617
|
+
allowedAdditional = true;
|
|
3618
|
+
break;
|
|
3619
|
+
}
|
|
3620
|
+
} catch {}
|
|
3621
|
+
}
|
|
3622
|
+
if (!allowedWorkspace && !allowedAdditional) throw new Error("path required");
|
|
3623
|
+
if (!absPath.endsWith(".md")) throw new Error("path required");
|
|
3624
|
+
if ((await statRegularFile(absPath)).missing) return {
|
|
3625
|
+
text: "",
|
|
3626
|
+
path: relPath
|
|
3627
|
+
};
|
|
3628
|
+
let content;
|
|
3629
|
+
try {
|
|
3630
|
+
content = await fs$1.readFile(absPath, "utf-8");
|
|
3631
|
+
} catch (err) {
|
|
3632
|
+
if (isFileMissingError(err)) return {
|
|
3633
|
+
text: "",
|
|
3634
|
+
path: relPath
|
|
3635
|
+
};
|
|
3636
|
+
throw err;
|
|
3637
|
+
}
|
|
3638
|
+
if (!params.from && !params.lines) return {
|
|
3639
|
+
text: content,
|
|
3640
|
+
path: relPath
|
|
3641
|
+
};
|
|
3642
|
+
const fileLines = content.split("\n");
|
|
3643
|
+
const start = Math.max(1, params.from ?? 1);
|
|
3644
|
+
const count = Math.max(1, params.lines ?? fileLines.length);
|
|
3645
|
+
return {
|
|
3646
|
+
text: fileLines.slice(start - 1, start - 1 + count).join("\n"),
|
|
3647
|
+
path: relPath
|
|
3648
|
+
};
|
|
3649
|
+
}
|
|
3650
|
+
async function readAgentMemoryFile(params) {
|
|
3651
|
+
const settings = resolveMemorySearchConfig(params.cfg, params.agentId);
|
|
3652
|
+
if (!settings) throw new Error("memory search disabled");
|
|
3653
|
+
return await readMemoryFile({
|
|
3654
|
+
workspaceDir: resolveAgentWorkspaceDir(params.cfg, params.agentId),
|
|
3655
|
+
extraPaths: settings.extraPaths,
|
|
3656
|
+
relPath: params.relPath,
|
|
3657
|
+
from: params.from,
|
|
3658
|
+
lines: params.lines
|
|
3659
|
+
});
|
|
3660
|
+
}
|
|
3661
|
+
//#endregion
|
|
3662
|
+
//#region src/memory/manager.ts
|
|
3663
|
+
const SNIPPET_MAX_CHARS = 700;
|
|
3664
|
+
const VECTOR_TABLE = "chunks_vec";
|
|
3665
|
+
const FTS_TABLE = "chunks_fts";
|
|
3666
|
+
const EMBEDDING_CACHE_TABLE = "embedding_cache";
|
|
3667
|
+
const BATCH_FAILURE_LIMIT = 2;
|
|
3668
|
+
const MEMORY_INDEX_MANAGER_CACHE_KEY = "__openclawMemoryIndexManagerCache";
|
|
3669
|
+
function getMemoryIndexManagerCacheStore() {
|
|
3670
|
+
const globalCache = globalThis;
|
|
3671
|
+
globalCache[MEMORY_INDEX_MANAGER_CACHE_KEY] ??= {
|
|
3672
|
+
indexCache: /* @__PURE__ */ new Map(),
|
|
3673
|
+
indexCachePending: /* @__PURE__ */ new Map()
|
|
3674
|
+
};
|
|
3675
|
+
return globalCache[MEMORY_INDEX_MANAGER_CACHE_KEY];
|
|
3676
|
+
}
|
|
3677
|
+
const log = createSubsystemLogger("memory");
|
|
3678
|
+
const { indexCache: INDEX_CACHE, indexCachePending: INDEX_CACHE_PENDING } = getMemoryIndexManagerCacheStore();
|
|
3679
|
+
async function closeAllMemoryIndexManagers() {
|
|
3680
|
+
const pending = Array.from(INDEX_CACHE_PENDING.values());
|
|
3681
|
+
if (pending.length > 0) await Promise.allSettled(pending);
|
|
3682
|
+
const managers = Array.from(INDEX_CACHE.values());
|
|
3683
|
+
INDEX_CACHE.clear();
|
|
3684
|
+
for (const manager of managers) try {
|
|
3685
|
+
await manager.close();
|
|
3686
|
+
} catch (err) {
|
|
3687
|
+
log.warn(`failed to close memory index manager: ${String(err)}`);
|
|
3688
|
+
}
|
|
3689
|
+
}
|
|
3690
|
+
var MemoryIndexManager = class MemoryIndexManager extends MemoryManagerEmbeddingOps {
|
|
3691
|
+
static async loadProviderResult(params) {
|
|
3692
|
+
return await createEmbeddingProvider({
|
|
3693
|
+
config: params.cfg,
|
|
3694
|
+
agentDir: resolveAgentDir(params.cfg, params.agentId),
|
|
3695
|
+
provider: params.settings.provider,
|
|
3696
|
+
remote: params.settings.remote,
|
|
3697
|
+
model: params.settings.model,
|
|
3698
|
+
outputDimensionality: params.settings.outputDimensionality,
|
|
3699
|
+
fallback: params.settings.fallback,
|
|
3700
|
+
local: params.settings.local
|
|
3701
|
+
});
|
|
3702
|
+
}
|
|
3703
|
+
static async get(params) {
|
|
3704
|
+
const { cfg, agentId } = params;
|
|
3705
|
+
const settings = resolveMemorySearchConfig(cfg, agentId);
|
|
3706
|
+
if (!settings) return null;
|
|
3707
|
+
const workspaceDir = resolveAgentWorkspaceDir(cfg, agentId);
|
|
3708
|
+
const purpose = params.purpose === "status" ? "status" : "default";
|
|
3709
|
+
const key = `${agentId}:${workspaceDir}:${JSON.stringify(settings)}:${purpose}`;
|
|
3710
|
+
const statusOnly = params.purpose === "status";
|
|
3711
|
+
const existing = INDEX_CACHE.get(key);
|
|
3712
|
+
if (existing) return existing;
|
|
3713
|
+
const pending = INDEX_CACHE_PENDING.get(key);
|
|
3714
|
+
if (pending) return pending;
|
|
3715
|
+
if (statusOnly) {
|
|
3716
|
+
const manager = new MemoryIndexManager({
|
|
3717
|
+
cacheKey: key,
|
|
3718
|
+
cfg,
|
|
3719
|
+
agentId,
|
|
3720
|
+
workspaceDir,
|
|
3721
|
+
settings,
|
|
3722
|
+
purpose: params.purpose
|
|
3723
|
+
});
|
|
3724
|
+
INDEX_CACHE.set(key, manager);
|
|
3725
|
+
return manager;
|
|
3726
|
+
}
|
|
3727
|
+
const createPromise = (async () => {
|
|
3728
|
+
const providerResult = await MemoryIndexManager.loadProviderResult({
|
|
3729
|
+
cfg,
|
|
3730
|
+
agentId,
|
|
3731
|
+
settings
|
|
3732
|
+
});
|
|
3733
|
+
const refreshed = INDEX_CACHE.get(key);
|
|
3734
|
+
if (refreshed) return refreshed;
|
|
3735
|
+
const manager = new MemoryIndexManager({
|
|
3736
|
+
cacheKey: key,
|
|
3737
|
+
cfg,
|
|
3738
|
+
agentId,
|
|
3739
|
+
workspaceDir,
|
|
3740
|
+
settings,
|
|
3741
|
+
providerResult,
|
|
3742
|
+
purpose: params.purpose
|
|
3743
|
+
});
|
|
3744
|
+
INDEX_CACHE.set(key, manager);
|
|
3745
|
+
return manager;
|
|
3746
|
+
})();
|
|
3747
|
+
INDEX_CACHE_PENDING.set(key, createPromise);
|
|
3748
|
+
try {
|
|
3749
|
+
return await createPromise;
|
|
3750
|
+
} finally {
|
|
3751
|
+
if (INDEX_CACHE_PENDING.get(key) === createPromise) INDEX_CACHE_PENDING.delete(key);
|
|
3752
|
+
}
|
|
3753
|
+
}
|
|
3754
|
+
constructor(params) {
|
|
3755
|
+
super();
|
|
3756
|
+
this.providerInitPromise = null;
|
|
3757
|
+
this.providerInitialized = false;
|
|
3758
|
+
this.batchFailureCount = 0;
|
|
3759
|
+
this.batchFailureLock = Promise.resolve();
|
|
3760
|
+
this.vectorReady = null;
|
|
3761
|
+
this.watcher = null;
|
|
3762
|
+
this.watchTimer = null;
|
|
3763
|
+
this.sessionWatchTimer = null;
|
|
3764
|
+
this.sessionUnsubscribe = null;
|
|
3765
|
+
this.intervalTimer = null;
|
|
3766
|
+
this.closed = false;
|
|
3767
|
+
this.dirty = false;
|
|
3768
|
+
this.sessionsDirty = false;
|
|
3769
|
+
this.sessionsDirtyFiles = /* @__PURE__ */ new Set();
|
|
3770
|
+
this.sessionPendingFiles = /* @__PURE__ */ new Set();
|
|
3771
|
+
this.sessionDeltas = /* @__PURE__ */ new Map();
|
|
3772
|
+
this.sessionWarm = /* @__PURE__ */ new Set();
|
|
3773
|
+
this.syncing = null;
|
|
3774
|
+
this.queuedSessionFiles = /* @__PURE__ */ new Set();
|
|
3775
|
+
this.queuedSessionSync = null;
|
|
3776
|
+
this.readonlyRecoveryAttempts = 0;
|
|
3777
|
+
this.readonlyRecoverySuccesses = 0;
|
|
3778
|
+
this.readonlyRecoveryFailures = 0;
|
|
3779
|
+
this.cacheKey = params.cacheKey;
|
|
3780
|
+
this.cfg = params.cfg;
|
|
3781
|
+
this.agentId = params.agentId;
|
|
3782
|
+
this.workspaceDir = params.workspaceDir;
|
|
3783
|
+
this.settings = params.settings;
|
|
3784
|
+
this.provider = null;
|
|
3785
|
+
this.requestedProvider = params.settings.provider;
|
|
3786
|
+
if (params.providerResult) this.applyProviderResult(params.providerResult);
|
|
3787
|
+
this.sources = new Set(params.settings.sources);
|
|
3788
|
+
this.db = this.openDatabase();
|
|
3789
|
+
this.providerKey = this.computeProviderKey();
|
|
3790
|
+
this.cache = {
|
|
3791
|
+
enabled: params.settings.cache.enabled,
|
|
3792
|
+
maxEntries: params.settings.cache.maxEntries
|
|
3793
|
+
};
|
|
3794
|
+
this.fts = {
|
|
3795
|
+
enabled: params.settings.query.hybrid.enabled,
|
|
3796
|
+
available: false
|
|
3797
|
+
};
|
|
3798
|
+
this.ensureSchema();
|
|
3799
|
+
this.vector = {
|
|
3800
|
+
enabled: params.settings.store.vector.enabled,
|
|
3801
|
+
available: null,
|
|
3802
|
+
extensionPath: params.settings.store.vector.extensionPath
|
|
3803
|
+
};
|
|
3804
|
+
const meta = this.readMeta();
|
|
3805
|
+
if (meta?.vectorDims) this.vector.dims = meta.vectorDims;
|
|
3806
|
+
const statusOnly = params.purpose === "status";
|
|
3807
|
+
if (!statusOnly) {
|
|
3808
|
+
this.ensureWatcher();
|
|
3809
|
+
this.ensureSessionListener();
|
|
3810
|
+
this.ensureIntervalSync();
|
|
3811
|
+
}
|
|
3812
|
+
this.dirty = this.sources.has("memory") && (statusOnly ? !meta : true);
|
|
3813
|
+
this.batch = this.resolveBatchConfig();
|
|
3814
|
+
}
|
|
3815
|
+
applyProviderResult(providerResult) {
|
|
3816
|
+
this.provider = providerResult.provider;
|
|
3817
|
+
this.fallbackFrom = providerResult.fallbackFrom;
|
|
3818
|
+
this.fallbackReason = providerResult.fallbackReason;
|
|
3819
|
+
this.providerUnavailableReason = providerResult.providerUnavailableReason;
|
|
3820
|
+
this.openAi = providerResult.openAi;
|
|
3821
|
+
this.gemini = providerResult.gemini;
|
|
3822
|
+
this.voyage = providerResult.voyage;
|
|
3823
|
+
this.mistral = providerResult.mistral;
|
|
3824
|
+
this.ollama = providerResult.ollama;
|
|
3825
|
+
this.providerInitialized = true;
|
|
3826
|
+
}
|
|
3827
|
+
async ensureProviderInitialized() {
|
|
3828
|
+
if (this.providerInitialized) return;
|
|
3829
|
+
if (!this.providerInitPromise) this.providerInitPromise = (async () => {
|
|
3830
|
+
const providerResult = await MemoryIndexManager.loadProviderResult({
|
|
3831
|
+
cfg: this.cfg,
|
|
3832
|
+
agentId: this.agentId,
|
|
3833
|
+
settings: this.settings
|
|
3834
|
+
});
|
|
3835
|
+
this.applyProviderResult(providerResult);
|
|
3836
|
+
this.providerKey = this.computeProviderKey();
|
|
3837
|
+
this.batch = this.resolveBatchConfig();
|
|
3838
|
+
})();
|
|
3839
|
+
try {
|
|
3840
|
+
await this.providerInitPromise;
|
|
3841
|
+
} finally {
|
|
3842
|
+
if (this.providerInitialized) this.providerInitPromise = null;
|
|
3843
|
+
}
|
|
3844
|
+
}
|
|
3845
|
+
async warmSession(sessionKey) {
|
|
3846
|
+
if (!this.settings.sync.onSessionStart) return;
|
|
3847
|
+
const key = sessionKey?.trim() || "";
|
|
3848
|
+
if (key && this.sessionWarm.has(key)) return;
|
|
3849
|
+
this.sync({ reason: "session-start" }).catch((err) => {
|
|
3850
|
+
log.warn(`memory sync failed (session-start): ${String(err)}`);
|
|
3851
|
+
});
|
|
3852
|
+
if (key) this.sessionWarm.add(key);
|
|
3853
|
+
}
|
|
3854
|
+
async search(query, opts) {
|
|
3855
|
+
await this.ensureProviderInitialized();
|
|
3856
|
+
this.warmSession(opts?.sessionKey);
|
|
3857
|
+
if (this.settings.sync.onSearch && (this.dirty || this.sessionsDirty)) this.sync({ reason: "search" }).catch((err) => {
|
|
3858
|
+
log.warn(`memory sync failed (search): ${String(err)}`);
|
|
3859
|
+
});
|
|
3860
|
+
const cleaned = query.trim();
|
|
3861
|
+
if (!cleaned) return [];
|
|
3862
|
+
const minScore = opts?.minScore ?? this.settings.query.minScore;
|
|
3863
|
+
const maxResults = opts?.maxResults ?? this.settings.query.maxResults;
|
|
3864
|
+
const hybrid = this.settings.query.hybrid;
|
|
3865
|
+
const candidates = Math.min(200, Math.max(1, Math.floor(maxResults * hybrid.candidateMultiplier)));
|
|
3866
|
+
if (!this.provider) {
|
|
3867
|
+
if (!this.fts.enabled || !this.fts.available) {
|
|
3868
|
+
log.warn("memory search: no provider and FTS unavailable");
|
|
3869
|
+
return [];
|
|
3870
|
+
}
|
|
3871
|
+
const keywords = extractKeywords(cleaned);
|
|
3872
|
+
const searchTerms = keywords.length > 0 ? keywords : [cleaned];
|
|
3873
|
+
const resultSets = await Promise.all(searchTerms.map((term) => this.searchKeyword(term, candidates).catch(() => [])));
|
|
3874
|
+
const seenIds = /* @__PURE__ */ new Map();
|
|
3875
|
+
for (const results of resultSets) for (const result of results) {
|
|
3876
|
+
const existing = seenIds.get(result.id);
|
|
3877
|
+
if (!existing || result.score > existing.score) seenIds.set(result.id, result);
|
|
3878
|
+
}
|
|
3879
|
+
return [...seenIds.values()].toSorted((a, b) => b.score - a.score).filter((entry) => entry.score >= minScore).slice(0, maxResults);
|
|
3880
|
+
}
|
|
3881
|
+
const keywordResults = hybrid.enabled && this.fts.enabled && this.fts.available ? await this.searchKeyword(cleaned, candidates).catch(() => []) : [];
|
|
3882
|
+
const queryVec = await this.embedQueryWithTimeout(cleaned);
|
|
3883
|
+
const vectorResults = queryVec.some((v) => v !== 0) ? await this.searchVector(queryVec, candidates).catch(() => []) : [];
|
|
3884
|
+
if (!hybrid.enabled || !this.fts.enabled || !this.fts.available) return vectorResults.filter((entry) => entry.score >= minScore).slice(0, maxResults);
|
|
3885
|
+
const merged = await this.mergeHybridResults({
|
|
3886
|
+
vector: vectorResults,
|
|
3887
|
+
keyword: keywordResults,
|
|
3888
|
+
vectorWeight: hybrid.vectorWeight,
|
|
3889
|
+
textWeight: hybrid.textWeight,
|
|
3890
|
+
mmr: hybrid.mmr,
|
|
3891
|
+
temporalDecay: hybrid.temporalDecay
|
|
3892
|
+
});
|
|
3893
|
+
const strict = merged.filter((entry) => entry.score >= minScore);
|
|
3894
|
+
if (strict.length > 0 || keywordResults.length === 0) return strict.slice(0, maxResults);
|
|
3895
|
+
const relaxedMinScore = Math.min(minScore, hybrid.textWeight);
|
|
3896
|
+
const keywordKeys = new Set(keywordResults.map((entry) => `${entry.source}:${entry.path}:${entry.startLine}:${entry.endLine}`));
|
|
3897
|
+
return merged.filter((entry) => keywordKeys.has(`${entry.source}:${entry.path}:${entry.startLine}:${entry.endLine}`) && entry.score >= relaxedMinScore).slice(0, maxResults);
|
|
3898
|
+
}
|
|
3899
|
+
async searchVector(queryVec, limit) {
|
|
3900
|
+
if (!this.provider) return [];
|
|
3901
|
+
return (await searchVector({
|
|
3902
|
+
db: this.db,
|
|
3903
|
+
vectorTable: VECTOR_TABLE,
|
|
3904
|
+
providerModel: this.provider.model,
|
|
3905
|
+
queryVec,
|
|
3906
|
+
limit,
|
|
3907
|
+
snippetMaxChars: SNIPPET_MAX_CHARS,
|
|
3908
|
+
ensureVectorReady: async (dimensions) => await this.ensureVectorReady(dimensions),
|
|
3909
|
+
sourceFilterVec: this.buildSourceFilter("c"),
|
|
3910
|
+
sourceFilterChunks: this.buildSourceFilter()
|
|
3911
|
+
})).map((entry) => entry);
|
|
3912
|
+
}
|
|
3913
|
+
buildFtsQuery(raw) {
|
|
3914
|
+
return buildFtsQuery(raw);
|
|
3915
|
+
}
|
|
3916
|
+
async searchKeyword(query, limit) {
|
|
3917
|
+
if (!this.fts.enabled || !this.fts.available) return [];
|
|
3918
|
+
const sourceFilter = this.buildSourceFilter();
|
|
3919
|
+
const providerModel = this.provider?.model;
|
|
3920
|
+
return (await searchKeyword({
|
|
3921
|
+
db: this.db,
|
|
3922
|
+
ftsTable: FTS_TABLE,
|
|
3923
|
+
providerModel,
|
|
3924
|
+
query,
|
|
3925
|
+
limit,
|
|
3926
|
+
snippetMaxChars: SNIPPET_MAX_CHARS,
|
|
3927
|
+
sourceFilter,
|
|
3928
|
+
buildFtsQuery: (raw) => this.buildFtsQuery(raw),
|
|
3929
|
+
bm25RankToScore
|
|
3930
|
+
})).map((entry) => entry);
|
|
3931
|
+
}
|
|
3932
|
+
mergeHybridResults(params) {
|
|
3933
|
+
return mergeHybridResults({
|
|
3934
|
+
vector: params.vector.map((r) => ({
|
|
3935
|
+
id: r.id,
|
|
3936
|
+
path: r.path,
|
|
3937
|
+
startLine: r.startLine,
|
|
3938
|
+
endLine: r.endLine,
|
|
3939
|
+
source: r.source,
|
|
3940
|
+
snippet: r.snippet,
|
|
3941
|
+
vectorScore: r.score
|
|
3942
|
+
})),
|
|
3943
|
+
keyword: params.keyword.map((r) => ({
|
|
3944
|
+
id: r.id,
|
|
3945
|
+
path: r.path,
|
|
3946
|
+
startLine: r.startLine,
|
|
3947
|
+
endLine: r.endLine,
|
|
3948
|
+
source: r.source,
|
|
3949
|
+
snippet: r.snippet,
|
|
3950
|
+
textScore: r.textScore
|
|
3951
|
+
})),
|
|
3952
|
+
vectorWeight: params.vectorWeight,
|
|
3953
|
+
textWeight: params.textWeight,
|
|
3954
|
+
mmr: params.mmr,
|
|
3955
|
+
temporalDecay: params.temporalDecay,
|
|
3956
|
+
workspaceDir: this.workspaceDir
|
|
3957
|
+
}).then((entries) => entries.map((entry) => entry));
|
|
3958
|
+
}
|
|
3959
|
+
async sync(params) {
|
|
3960
|
+
if (this.closed) return;
|
|
3961
|
+
await this.ensureProviderInitialized();
|
|
3962
|
+
if (this.syncing) {
|
|
3963
|
+
if (params?.sessionFiles?.some((sessionFile) => sessionFile.trim().length > 0)) return this.enqueueTargetedSessionSync(params.sessionFiles);
|
|
3964
|
+
return this.syncing;
|
|
3965
|
+
}
|
|
3966
|
+
this.syncing = this.runSyncWithReadonlyRecovery(params).finally(() => {
|
|
3967
|
+
this.syncing = null;
|
|
3968
|
+
});
|
|
3969
|
+
return this.syncing ?? Promise.resolve();
|
|
3970
|
+
}
|
|
3971
|
+
enqueueTargetedSessionSync(sessionFiles) {
|
|
3972
|
+
for (const sessionFile of sessionFiles ?? []) {
|
|
3973
|
+
const trimmed = sessionFile.trim();
|
|
3974
|
+
if (trimmed) this.queuedSessionFiles.add(trimmed);
|
|
3975
|
+
}
|
|
3976
|
+
if (this.queuedSessionFiles.size === 0) return this.syncing ?? Promise.resolve();
|
|
3977
|
+
if (!this.queuedSessionSync) this.queuedSessionSync = (async () => {
|
|
3978
|
+
try {
|
|
3979
|
+
await this.syncing?.catch(() => void 0);
|
|
3980
|
+
while (!this.closed && this.queuedSessionFiles.size > 0) {
|
|
3981
|
+
const queuedSessionFiles = Array.from(this.queuedSessionFiles);
|
|
3982
|
+
this.queuedSessionFiles.clear();
|
|
3983
|
+
await this.sync({
|
|
3984
|
+
reason: "queued-session-files",
|
|
3985
|
+
sessionFiles: queuedSessionFiles
|
|
3986
|
+
});
|
|
3987
|
+
}
|
|
3988
|
+
} finally {
|
|
3989
|
+
this.queuedSessionSync = null;
|
|
3990
|
+
}
|
|
3991
|
+
})();
|
|
3992
|
+
return this.queuedSessionSync;
|
|
3993
|
+
}
|
|
3994
|
+
isReadonlyDbError(err) {
|
|
3995
|
+
const readonlyPattern = /attempt to write a readonly database|database is read-only|SQLITE_READONLY/i;
|
|
3996
|
+
const messages = /* @__PURE__ */ new Set();
|
|
3997
|
+
const pushValue = (value) => {
|
|
3998
|
+
if (typeof value !== "string") return;
|
|
3999
|
+
const normalized = value.trim();
|
|
4000
|
+
if (!normalized) return;
|
|
4001
|
+
messages.add(normalized);
|
|
4002
|
+
};
|
|
4003
|
+
pushValue(err instanceof Error ? err.message : String(err));
|
|
4004
|
+
if (err && typeof err === "object") {
|
|
4005
|
+
const record = err;
|
|
4006
|
+
pushValue(record.message);
|
|
4007
|
+
pushValue(record.code);
|
|
4008
|
+
pushValue(record.name);
|
|
4009
|
+
if (record.cause && typeof record.cause === "object") {
|
|
4010
|
+
const cause = record.cause;
|
|
4011
|
+
pushValue(cause.message);
|
|
4012
|
+
pushValue(cause.code);
|
|
4013
|
+
pushValue(cause.name);
|
|
4014
|
+
}
|
|
4015
|
+
}
|
|
4016
|
+
return [...messages].some((value) => readonlyPattern.test(value));
|
|
4017
|
+
}
|
|
4018
|
+
extractErrorReason(err) {
|
|
4019
|
+
if (err instanceof Error && err.message.trim()) return err.message;
|
|
4020
|
+
if (err && typeof err === "object") {
|
|
4021
|
+
const record = err;
|
|
4022
|
+
if (typeof record.message === "string" && record.message.trim()) return record.message;
|
|
4023
|
+
if (typeof record.code === "string" && record.code.trim()) return record.code;
|
|
4024
|
+
}
|
|
4025
|
+
return String(err);
|
|
4026
|
+
}
|
|
4027
|
+
async runSyncWithReadonlyRecovery(params) {
|
|
4028
|
+
try {
|
|
4029
|
+
await this.runSync(params);
|
|
4030
|
+
return;
|
|
4031
|
+
} catch (err) {
|
|
4032
|
+
if (!this.isReadonlyDbError(err) || this.closed) throw err;
|
|
4033
|
+
const reason = this.extractErrorReason(err);
|
|
4034
|
+
this.readonlyRecoveryAttempts += 1;
|
|
4035
|
+
this.readonlyRecoveryLastError = reason;
|
|
4036
|
+
log.warn(`memory sync readonly handle detected; reopening sqlite connection`, { reason });
|
|
4037
|
+
try {
|
|
4038
|
+
this.db.close();
|
|
4039
|
+
} catch {}
|
|
4040
|
+
this.db = this.openDatabase();
|
|
4041
|
+
this.vectorReady = null;
|
|
4042
|
+
this.vector.available = null;
|
|
4043
|
+
this.vector.loadError = void 0;
|
|
4044
|
+
this.ensureSchema();
|
|
4045
|
+
const meta = this.readMeta();
|
|
4046
|
+
this.vector.dims = meta?.vectorDims;
|
|
4047
|
+
try {
|
|
4048
|
+
await this.runSync(params);
|
|
4049
|
+
this.readonlyRecoverySuccesses += 1;
|
|
4050
|
+
} catch (retryErr) {
|
|
4051
|
+
this.readonlyRecoveryFailures += 1;
|
|
4052
|
+
throw retryErr;
|
|
4053
|
+
}
|
|
4054
|
+
}
|
|
4055
|
+
}
|
|
4056
|
+
async readFile(params) {
|
|
4057
|
+
return await readMemoryFile({
|
|
4058
|
+
workspaceDir: this.workspaceDir,
|
|
4059
|
+
extraPaths: this.settings.extraPaths,
|
|
4060
|
+
relPath: params.relPath,
|
|
4061
|
+
from: params.from,
|
|
4062
|
+
lines: params.lines
|
|
4063
|
+
});
|
|
4064
|
+
}
|
|
4065
|
+
status() {
|
|
4066
|
+
const sourceFilter = this.buildSourceFilter();
|
|
4067
|
+
const files = this.db.prepare(`SELECT COUNT(*) as c FROM files WHERE 1=1${sourceFilter.sql}`).get(...sourceFilter.params);
|
|
4068
|
+
const chunks = this.db.prepare(`SELECT COUNT(*) as c FROM chunks WHERE 1=1${sourceFilter.sql}`).get(...sourceFilter.params);
|
|
4069
|
+
const sourceCounts = (() => {
|
|
4070
|
+
const sources = Array.from(this.sources);
|
|
4071
|
+
if (sources.length === 0) return [];
|
|
4072
|
+
const bySource = /* @__PURE__ */ new Map();
|
|
4073
|
+
for (const source of sources) bySource.set(source, {
|
|
4074
|
+
files: 0,
|
|
4075
|
+
chunks: 0
|
|
4076
|
+
});
|
|
4077
|
+
const fileRows = this.db.prepare(`SELECT source, COUNT(*) as c FROM files WHERE 1=1${sourceFilter.sql} GROUP BY source`).all(...sourceFilter.params);
|
|
4078
|
+
for (const row of fileRows) {
|
|
4079
|
+
const entry = bySource.get(row.source) ?? {
|
|
4080
|
+
files: 0,
|
|
4081
|
+
chunks: 0
|
|
4082
|
+
};
|
|
4083
|
+
entry.files = row.c ?? 0;
|
|
4084
|
+
bySource.set(row.source, entry);
|
|
4085
|
+
}
|
|
4086
|
+
const chunkRows = this.db.prepare(`SELECT source, COUNT(*) as c FROM chunks WHERE 1=1${sourceFilter.sql} GROUP BY source`).all(...sourceFilter.params);
|
|
4087
|
+
for (const row of chunkRows) {
|
|
4088
|
+
const entry = bySource.get(row.source) ?? {
|
|
4089
|
+
files: 0,
|
|
4090
|
+
chunks: 0
|
|
4091
|
+
};
|
|
4092
|
+
entry.chunks = row.c ?? 0;
|
|
4093
|
+
bySource.set(row.source, entry);
|
|
4094
|
+
}
|
|
4095
|
+
return sources.map((source) => Object.assign({ source }, bySource.get(source)));
|
|
4096
|
+
})();
|
|
4097
|
+
const searchMode = this.provider || !this.providerInitialized ? "hybrid" : "fts-only";
|
|
4098
|
+
const providerInfo = this.provider ? {
|
|
4099
|
+
provider: this.provider.id,
|
|
4100
|
+
model: this.provider.model
|
|
4101
|
+
} : this.providerInitialized ? {
|
|
4102
|
+
provider: "none",
|
|
4103
|
+
model: void 0
|
|
4104
|
+
} : {
|
|
4105
|
+
provider: this.requestedProvider,
|
|
4106
|
+
model: this.settings.model || void 0
|
|
4107
|
+
};
|
|
4108
|
+
return {
|
|
4109
|
+
backend: "builtin",
|
|
4110
|
+
files: files?.c ?? 0,
|
|
4111
|
+
chunks: chunks?.c ?? 0,
|
|
4112
|
+
dirty: this.dirty || this.sessionsDirty,
|
|
4113
|
+
workspaceDir: this.workspaceDir,
|
|
4114
|
+
dbPath: this.settings.store.path,
|
|
4115
|
+
provider: providerInfo.provider,
|
|
4116
|
+
model: providerInfo.model,
|
|
4117
|
+
requestedProvider: this.requestedProvider,
|
|
4118
|
+
sources: Array.from(this.sources),
|
|
4119
|
+
extraPaths: this.settings.extraPaths,
|
|
4120
|
+
sourceCounts,
|
|
4121
|
+
cache: this.cache.enabled ? {
|
|
4122
|
+
enabled: true,
|
|
4123
|
+
entries: this.db.prepare(`SELECT COUNT(*) as c FROM ${EMBEDDING_CACHE_TABLE}`).get()?.c ?? 0,
|
|
4124
|
+
maxEntries: this.cache.maxEntries
|
|
4125
|
+
} : {
|
|
4126
|
+
enabled: false,
|
|
4127
|
+
maxEntries: this.cache.maxEntries
|
|
4128
|
+
},
|
|
4129
|
+
fts: {
|
|
4130
|
+
enabled: this.fts.enabled,
|
|
4131
|
+
available: this.fts.available,
|
|
4132
|
+
error: this.fts.loadError
|
|
4133
|
+
},
|
|
4134
|
+
fallback: this.fallbackReason ? {
|
|
4135
|
+
from: this.fallbackFrom ?? "local",
|
|
4136
|
+
reason: this.fallbackReason
|
|
4137
|
+
} : void 0,
|
|
4138
|
+
vector: {
|
|
4139
|
+
enabled: this.vector.enabled,
|
|
4140
|
+
available: this.vector.available ?? void 0,
|
|
4141
|
+
extensionPath: this.vector.extensionPath,
|
|
4142
|
+
loadError: this.vector.loadError,
|
|
4143
|
+
dims: this.vector.dims
|
|
4144
|
+
},
|
|
4145
|
+
batch: {
|
|
4146
|
+
enabled: this.batch.enabled,
|
|
4147
|
+
failures: this.batchFailureCount,
|
|
4148
|
+
limit: BATCH_FAILURE_LIMIT,
|
|
4149
|
+
wait: this.batch.wait,
|
|
4150
|
+
concurrency: this.batch.concurrency,
|
|
4151
|
+
pollIntervalMs: this.batch.pollIntervalMs,
|
|
4152
|
+
timeoutMs: this.batch.timeoutMs,
|
|
4153
|
+
lastError: this.batchFailureLastError,
|
|
4154
|
+
lastProvider: this.batchFailureLastProvider
|
|
4155
|
+
},
|
|
4156
|
+
custom: {
|
|
4157
|
+
searchMode,
|
|
4158
|
+
providerUnavailableReason: this.providerUnavailableReason,
|
|
4159
|
+
readonlyRecovery: {
|
|
4160
|
+
attempts: this.readonlyRecoveryAttempts,
|
|
4161
|
+
successes: this.readonlyRecoverySuccesses,
|
|
4162
|
+
failures: this.readonlyRecoveryFailures,
|
|
4163
|
+
lastError: this.readonlyRecoveryLastError
|
|
4164
|
+
}
|
|
4165
|
+
}
|
|
4166
|
+
};
|
|
4167
|
+
}
|
|
4168
|
+
async probeVectorAvailability() {
|
|
4169
|
+
if (!this.vector.enabled) return false;
|
|
4170
|
+
await this.ensureProviderInitialized();
|
|
4171
|
+
if (!this.provider) return false;
|
|
4172
|
+
return this.ensureVectorReady();
|
|
4173
|
+
}
|
|
4174
|
+
async probeEmbeddingAvailability() {
|
|
4175
|
+
await this.ensureProviderInitialized();
|
|
4176
|
+
if (!this.provider) return {
|
|
4177
|
+
ok: false,
|
|
4178
|
+
error: this.providerUnavailableReason ?? "No embedding provider available (FTS-only mode)"
|
|
4179
|
+
};
|
|
4180
|
+
try {
|
|
4181
|
+
await this.embedBatchWithRetry(["ping"]);
|
|
4182
|
+
return { ok: true };
|
|
4183
|
+
} catch (err) {
|
|
4184
|
+
return {
|
|
4185
|
+
ok: false,
|
|
4186
|
+
error: err instanceof Error ? err.message : String(err)
|
|
4187
|
+
};
|
|
4188
|
+
}
|
|
4189
|
+
}
|
|
4190
|
+
async close() {
|
|
4191
|
+
if (this.closed) return;
|
|
4192
|
+
this.closed = true;
|
|
4193
|
+
const pendingSync = this.syncing;
|
|
4194
|
+
const pendingProviderInit = this.providerInitPromise;
|
|
4195
|
+
if (this.watchTimer) {
|
|
4196
|
+
clearTimeout(this.watchTimer);
|
|
4197
|
+
this.watchTimer = null;
|
|
4198
|
+
}
|
|
4199
|
+
if (this.sessionWatchTimer) {
|
|
4200
|
+
clearTimeout(this.sessionWatchTimer);
|
|
4201
|
+
this.sessionWatchTimer = null;
|
|
4202
|
+
}
|
|
4203
|
+
if (this.intervalTimer) {
|
|
4204
|
+
clearInterval(this.intervalTimer);
|
|
4205
|
+
this.intervalTimer = null;
|
|
4206
|
+
}
|
|
4207
|
+
if (this.watcher) {
|
|
4208
|
+
await this.watcher.close();
|
|
4209
|
+
this.watcher = null;
|
|
4210
|
+
}
|
|
4211
|
+
if (this.sessionUnsubscribe) {
|
|
4212
|
+
this.sessionUnsubscribe();
|
|
4213
|
+
this.sessionUnsubscribe = null;
|
|
4214
|
+
}
|
|
4215
|
+
if (pendingSync) try {
|
|
4216
|
+
await pendingSync;
|
|
4217
|
+
} catch {}
|
|
4218
|
+
if (pendingProviderInit) try {
|
|
4219
|
+
await pendingProviderInit;
|
|
4220
|
+
} catch {}
|
|
4221
|
+
this.db.close();
|
|
4222
|
+
INDEX_CACHE.delete(this.cacheKey);
|
|
4223
|
+
}
|
|
4224
|
+
};
|
|
4225
|
+
//#endregion
|
|
4226
|
+
export { hasConfiguredMemorySecretInput as a, DEFAULT_LOCAL_MODEL as i, closeAllMemoryIndexManagers as n, collectProviderApiKeysForExecution as o, readAgentMemoryFile as r, executeWithApiKeyRotation as s, MemoryIndexManager as t };
|