@noxsoft/anima 2.0.2 → 2.0.4
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/README.md +1260 -28
- package/dist/accounts-Bth3PpPD.js +260 -0
- package/dist/accounts-D8CPKNkN.js +259 -0
- package/dist/acp-cli-ByK6lS6c.js +1081 -0
- package/dist/acp-cli-CaQCjIw4.js +1084 -0
- package/dist/agent-BgIkqd3F.js +725 -0
- package/dist/agent-N5BDcge4.js +725 -0
- package/dist/agent-events-COH7NDW2.js +182 -0
- package/dist/agent-scope-CPphqq-U.js +452 -0
- package/dist/agent-scope-DZgptr9J.js +452 -0
- package/dist/agent-scope-cj2QCT6R.js +112 -0
- package/dist/agents-NEudYMdg.js +774 -0
- package/dist/agents.config-Bujs-NIy.js +182 -0
- package/dist/agents.config-jp7OLssr.js +182 -0
- package/dist/argv-BMZMiW7v.js +73 -0
- package/dist/audit-C-UJhfdv.js +2401 -0
- package/dist/audit-CeCO7SK5.js +2401 -0
- package/dist/auth-BNZsOHGF.js +648 -0
- package/dist/auth-DMPZWzEa.js +639 -0
- package/dist/auth-choice-5VnaGMD-.js +2681 -0
- package/dist/auth-choice-DA2k4vs8.js +2681 -0
- package/dist/auth-health-B7FqA26_.js +149 -0
- package/dist/auth-health-VO_MPqVX.js +149 -0
- package/dist/auth-profiles-BDrNYX_n.js +1564 -0
- package/dist/auth-profiles-CxSHydjn.js +2689 -0
- package/dist/banner-BtDZPRzi.js +294 -0
- package/dist/browser-cli-8yQMpxb8.js +1679 -0
- package/dist/browser-cli-Czg3JtDH.js +1676 -0
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +16 -16
- package/dist/bundled/bootstrap-extra-files/handler.js +4 -4
- package/dist/bundled/command-logger/handler.js +1 -1
- package/dist/bundled/session-memory/handler.js +5 -5
- package/dist/call-BIzCaKZb.js +282 -0
- package/dist/call-BYDpTVCZ.js +282 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/catalog-CqKiUgu6.js +185 -0
- package/dist/catalog-DMfEg-oK.js +185 -0
- package/dist/channel-options-BrtCtyrT.js +32 -0
- package/dist/channel-options-CO21Gl8p.js +33 -0
- package/dist/channel-selection-Bbm1lq3P.js +51 -0
- package/dist/channel-selection-CqcX7Ocw.js +51 -0
- package/dist/channel-web-DrsT6OAE.js +2162 -0
- package/dist/channels-cli-Juyh1S6n.js +1304 -0
- package/dist/channels-cli-zNvi1m5c.js +1306 -0
- package/dist/channels-status-issues-CqzqshW4.js +18 -0
- package/dist/channels-status-issues-DdJdO866.js +18 -0
- package/dist/chrome-C4dOMO8z.js +1601 -0
- package/dist/chrome-DdcDzAtH.js +1629 -0
- package/dist/chrome-U3DRzjJD.js +1601 -0
- package/dist/chunk-D2nLsrEW.js +348 -0
- package/dist/clack-prompter-BI3RDW5w.js +92 -0
- package/dist/clack-prompter-Dwr1m_IZ.js +92 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-C3cpDaz8.js +99 -0
- package/dist/cli-CjWUGdGC.js +101 -0
- package/dist/cli-session-BVjY_XrW.js +5463 -0
- package/dist/cli-session-gtuYN2Iq.js +5408 -0
- package/dist/client-Dswwze5_.js +1692 -0
- package/dist/client-LRKFjo4A.js +1692 -0
- package/dist/clipboard-BZKS9O1u.js +31 -0
- package/dist/clipboard-DES8b1AM.js +31 -0
- package/dist/command-format-CP1YTNCl.js +52 -0
- package/dist/command-format-CVL4K5cj.js +52 -0
- package/dist/command-format-G6N2zghg.js +38 -0
- package/dist/command-registry-BBvNvysr.js +248 -0
- package/dist/commands-AZ3n8Y2c.js +726 -0
- package/dist/commands-BMnD_QRY.js +726 -0
- package/dist/commands-registry-cFqZ6Ib4.js +766 -0
- package/dist/commands-registry-q13H7ng5.js +766 -0
- package/dist/common-CX5458fH.js +287 -0
- package/dist/common-DJbnT8ws.js +287 -0
- package/dist/completion-cli-BADRBcIl.js +432 -0
- package/dist/completion-cli-DMQgiObF.js +431 -0
- package/dist/config-CU-Axg8P.js +5704 -0
- package/dist/config-DaqbUdkI.js +5705 -0
- package/dist/config-cli-BPlbwiuA.js +244 -0
- package/dist/config-cli-DXgZJkPU.js +247 -0
- package/dist/config-guard-Ba49JNds.js +76 -0
- package/dist/config-guard-Cu0qMKZJ.js +93 -0
- package/dist/config-kVVm5EYV.js +6523 -0
- package/dist/config-sync-CzLnLTXt.js +91 -0
- package/dist/config-sync-DuydxPWx.js +91 -0
- package/dist/configure-CHgacLyi.js +960 -0
- package/dist/configure-DfHXDa1L.js +959 -0
- package/dist/context-DzgXOckU.js +60 -0
- package/dist/control-service-8_wKHwBa.js +72 -0
- package/dist/control-service-BtL1Jto_.js +72 -0
- package/dist/cron-cli-BCzSR2c0.js +448 -0
- package/dist/cron-cli-CCWNkykU.js +451 -0
- package/dist/daemon-cli-Bjkbu9Vy.js +565 -0
- package/dist/daemon-cli-CmlHcC1J.js +566 -0
- package/dist/daemon-cli.js +16 -16
- package/dist/daemon-runtime-C0tz7VAC.js +460 -0
- package/dist/daemon-runtime-rUTqCVwJ.js +460 -0
- package/dist/deliver-BBggsviM.js +1097 -0
- package/dist/deliver-CePITOl8.js +1162 -0
- package/dist/deliver-DFnVaetP.js +1097 -0
- package/dist/delivery-queue-BJQK3oh5.js +220 -0
- package/dist/deps-CeEKhrp7.js +42 -0
- package/dist/devices-cli-DQrDMrZH.js +198 -0
- package/dist/devices-cli-Oe-A1Dv0.js +195 -0
- package/dist/diagnostics-DxMFrBLO.js +35 -0
- package/dist/diagnostics-m79ZlMmZ.js +35 -0
- package/dist/directory-cli-BL6h8cGF.js +246 -0
- package/dist/directory-cli-Cjgmi_sj.js +243 -0
- package/dist/dispatcher-DAFbQM-c.js +100 -0
- package/dist/dispatcher-DNd40gUn.js +100 -0
- package/dist/dist-CqDI82ei.js +929 -0
- package/dist/dist-DnHRxR5U.js +929 -0
- package/dist/dns-cli-CFtV3BXK.js +200 -0
- package/dist/dns-cli-NyIHvQ5S.js +197 -0
- package/dist/dock-BdXLb5oY.js +753 -0
- package/dist/dock-jYICmNcI.js +753 -0
- package/dist/docs-cli-CrOaIK_H.js +161 -0
- package/dist/docs-cli-D_cmJDSr.js +159 -0
- package/dist/doctor-BpGxKrBl.js +1815 -0
- package/dist/doctor-D12wNQPU.js +1813 -0
- package/dist/doctor-completion-DeOfofek.js +92 -0
- package/dist/doctor-completion-DwjqdEcK.js +92 -0
- package/dist/doctor-config-flow-BI3mpkbd.js +1232 -0
- package/dist/doctor-config-flow-wMHheFkC.js +1232 -0
- package/dist/engine-BCtL-AMw.js +563 -0
- package/dist/engine-Bk_UT413.js +563 -0
- package/dist/entry.js +5 -5
- package/dist/env-v6411I8h.js +32 -0
- package/dist/exec-B7sUS164.js +1167 -0
- package/dist/exec-approvals-CroGJRUg.js +1221 -0
- package/dist/exec-approvals-cli-BTxF_RsH.js +371 -0
- package/dist/exec-approvals-cli-n1gyGwH2.js +368 -0
- package/dist/exec-mhSykkaa.js +255 -0
- package/dist/extensionAPI.js +3 -3
- package/dist/frontmatter-BmHq0vRD.js +204 -0
- package/dist/gateway-cli-DDBadlrS.js +19971 -0
- package/dist/gateway-cli-IZNkOMBe.js +19972 -0
- package/dist/gateway-rpc-Dtx8HN-n.js +28 -0
- package/dist/gateway-rpc-L2PVSqGj.js +28 -0
- package/dist/github-copilot-auth-DKyqDaGU.js +1418 -0
- package/dist/github-copilot-auth-DXpOMSd3.js +1418 -0
- package/dist/gmail-setup-utils-BKNczIJ9.js +428 -0
- package/dist/gmail-setup-utils-co0ppccC.js +428 -0
- package/dist/health-Bm8ZTvC3.js +1253 -0
- package/dist/health-DUf1gt4E.js +1258 -0
- package/dist/health-format-BksT6F68.js +208 -0
- package/dist/health-format-uzh1xYLD.js +208 -0
- package/dist/heartbeat-visibility-1TJb1Zao.js +98 -0
- package/dist/heartbeat-visibility-CwodtdcX.js +98 -0
- package/dist/help-format-C6cv_aZp.js +17 -0
- package/dist/helpers-N-uSFKOn.js +10 -0
- package/dist/hooks-cli-1POsXqOl.js +993 -0
- package/dist/hooks-cli-BGjILbze.js +991 -0
- package/dist/hooks-status-DE07n5RC.js +356 -0
- package/dist/hooks-status-Du-d1jde.js +356 -0
- package/dist/image-ops-B_AYV3tp.js +541 -0
- package/dist/image-ops-Bp0C6Mvr.js +541 -0
- package/dist/index.js +82 -82
- package/dist/init-9A0s7bWG.js +122 -0
- package/dist/init-DoyCHJDC.js +122 -0
- package/dist/installs-D1C9wHAq.js +383 -0
- package/dist/installs-Dh4dHayM.js +383 -0
- package/dist/ipv4-DCItfaJo.js +1964 -0
- package/dist/ipv4-DSOUVx0i.js +1964 -0
- package/dist/lanes-BvSnHq2h.js +232 -0
- package/dist/lifecycle-core-BY4WIf9g.js +388 -0
- package/dist/lifecycle-core-TQKyXO-6.js +387 -0
- package/dist/links-CNu_8RZl.js +15 -0
- package/dist/links-D2tt2ouh.js +15 -0
- package/dist/llm-slug-generator.js +4 -4
- package/dist/logging-BIeRw0WR.js +15 -0
- package/dist/logging-C7lb3Vjc.js +15 -0
- package/dist/login-DXWKewA2.js +59 -0
- package/dist/login-Fhh4uWmf.js +61 -0
- package/dist/login-pPs3UO38.js +61 -0
- package/dist/login-qr-CevLD8cV.js +326 -0
- package/dist/login-qr-GF2JMIy-.js +323 -0
- package/dist/login-qr-ZYYKD6Yt.js +321 -0
- package/dist/logs-cli-CzXbX8HZ.js +242 -0
- package/dist/logs-cli-D9ngH9PF.js +245 -0
- package/dist/manager-BD5rA3w0.js +3244 -0
- package/dist/manager-BDPgBQSH.js +3246 -0
- package/dist/manager-DRWMWM--.js +3244 -0
- package/dist/manifest-registry-DbvPaBXY.js +748 -0
- package/dist/manifest-registry-kHX_MFa1.js +748 -0
- package/dist/markdown-tables-CqwihY2m.js +347 -0
- package/dist/markdown-tables-DJV7eAJZ.js +348 -0
- package/dist/media-lUqN-0O9.js +1342 -0
- package/dist/memory-cli-BLXSpgnN.js +868 -0
- package/dist/memory-cli-BcGVkkRJ.js +869 -0
- package/dist/message-channel-D_jIO87f.js +110 -0
- package/dist/migrate-BpVOar4L.js +157 -0
- package/dist/migrate-CkgGDkWy.js +157 -0
- package/dist/model-selection-Cqt6aJ0G.js +2691 -0
- package/dist/models-CExsNQPH.js +2510 -0
- package/dist/models-cli-Ba3Jmwev.js +2739 -0
- package/dist/models-cli-iDAlsbL2.js +258 -0
- package/dist/net-0A_zcaQD.js +218 -0
- package/dist/node-cli-ATmwCXIk.js +1319 -0
- package/dist/node-cli-DYFR_V25.js +1322 -0
- package/dist/node-service-CN4LqR1A.js +67 -0
- package/dist/node-service-CWt3MdSC.js +67 -0
- package/dist/nodes-cli-BeVmhTz3.js +1197 -0
- package/dist/nodes-cli-QeJIfa18.js +1200 -0
- package/dist/nodes-screen-DHyWAlla.js +234 -0
- package/dist/nodes-screen-qs3jRBPk.js +234 -0
- package/dist/note-CSlg2BnB.js +73 -0
- package/dist/note-Ctvglhp1.js +73 -0
- package/dist/npm-registry-spec-DQd4M22q.js +351 -0
- package/dist/npm-registry-spec-PxisIMts.js +351 -0
- package/dist/onboard-DeruD10m.js +1166 -0
- package/dist/onboard-SAcu5N6N.js +1165 -0
- package/dist/onboard-channels-C4iSfFXR.js +672 -0
- package/dist/onboard-channels-oVTVgoyg.js +672 -0
- package/dist/onboard-helpers-B8roRwLP.js +365 -0
- package/dist/onboard-helpers-Dgh26hgP.js +365 -0
- package/dist/onboarding-Bi-ac8we.js +911 -0
- package/dist/onboarding-C2gjB2u8.js +910 -0
- package/dist/orchestrator-DlbAYMQP.js +357 -0
- package/dist/orchestrator-DlwVRVDA.js +357 -0
- package/dist/outbound-CkKgc6iR.js +2062 -0
- package/dist/outbound-Vfm5yDh3.js +214 -0
- package/dist/outbound-bs_VK51X.js +214 -0
- package/dist/outbound-send-deps-DDjiMfEL.js +55 -0
- package/dist/pairing-cli-CJYeuEik.js +118 -0
- package/dist/pairing-cli-mqopHI8s.js +121 -0
- package/dist/pairing-store-BsXzUDPv.js +388 -0
- package/dist/pairing-store-DoNj00-X.js +388 -0
- package/dist/path-env-C_xpiG8l.js +89 -0
- package/dist/path-env-DSSMHu5A.js +89 -0
- package/dist/paths-B1vRVCad.js +126 -0
- package/dist/paths-BMuHNFxg.js +238 -0
- package/dist/paths-BXQQzXGQ.js +129 -0
- package/dist/paths-Buw_geoe.js +54 -0
- package/dist/paths-DA9WYabg.js +222 -0
- package/dist/paths-DfQGx0_k.js +129 -0
- package/dist/pi-auth-json-DOPW3e4X.js +78 -0
- package/dist/pi-auth-json-MruLmI_X.js +82 -0
- package/dist/pi-auth-json-lae_wwwo.js +80 -0
- package/dist/pi-model-discovery-7q0GxMrp.js +3 -0
- package/dist/pi-tools.policy-Csmla32P.js +200 -0
- package/dist/pi-tools.policy-xYdDLEv9.js +200 -0
- package/dist/plugin-auto-enable-CViVVWgg.js +282 -0
- package/dist/plugin-auto-enable-CjZ238UI.js +282 -0
- package/dist/plugin-registry-B4Aw2hzq.js +32 -0
- package/dist/plugin-registry-DW81arxW.js +32 -0
- package/dist/plugin-sdk/cli/cli-name.d.ts +1 -1
- package/dist/plugin-sdk/config/paths.d.ts +2 -2
- package/dist/plugin-sdk/index.js +7 -7
- package/dist/plugins-DhcGAPDB.js +38 -0
- package/dist/plugins-DtghNRtM.js +168 -0
- package/dist/plugins-cli-4vWTmOAb.js +736 -0
- package/dist/plugins-cli-CdTMbP0X.js +734 -0
- package/dist/polls-D6eCdatA.js +1343 -0
- package/dist/ports-BtZx-JKD.js +96 -0
- package/dist/ports-C8bKN8s0.js +96 -0
- package/dist/ports-DHiKnPRX.js +344 -0
- package/dist/ports-vd93M_Pt.js +317 -0
- package/dist/program-CX3aUVeb.js +176 -0
- package/dist/program-context-BPos0ivo.js +496 -0
- package/dist/progress-oiAjiiNi.js +133 -0
- package/dist/prompt-style-Cm4wOtKm.js +9 -0
- package/dist/pw-ai-4QbK5YFe.js +1865 -0
- package/dist/pw-ai-BWz3Cxt7.js +1868 -0
- package/dist/pw-ai-C83HBue2.js +1867 -0
- package/dist/qmd-manager-BcMeZiGD.js +938 -0
- package/dist/qmd-manager-CPypGJ0P.js +935 -0
- package/dist/qmd-manager-CRrSkfia.js +937 -0
- package/dist/register.agent-DDY8KJhn.js +265 -0
- package/dist/register.agent-DKawm-9d.js +1003 -0
- package/dist/register.anima-CEWUo29k.js +193 -0
- package/dist/register.anima-DBWz2rk_.js +193 -0
- package/dist/register.configure-BX67qV8k.js +103 -0
- package/dist/register.configure-CWsySuiq.js +101 -0
- package/dist/register.maintenance-0k-ZNhDg.js +543 -0
- package/dist/register.maintenance-BIwx1fzX.js +543 -0
- package/dist/register.message-CXPsoakA.js +657 -0
- package/dist/register.message-DA3jvfgI.js +660 -0
- package/dist/register.onboard-C4HG7Hqv.js +170 -0
- package/dist/register.onboard-GOpdif-j.js +170 -0
- package/dist/register.setup-B17vZT7C.js +175 -0
- package/dist/register.setup-GJyUDCqh.js +175 -0
- package/dist/register.status-health-sessions-D5876dGx.js +313 -0
- package/dist/register.status-health-sessions-lOewVIZR.js +142 -0
- package/dist/register.subclis-Dwnujj5C.js +255 -0
- package/dist/reply-CR5T_oQJ.js +32212 -0
- package/dist/reply-prefix-BcrS4Umd.js +100 -0
- package/dist/reply-prefix-Btb5o2NH.js +100 -0
- package/dist/reply-r089HuRA.js +32212 -0
- package/dist/routes-B4czFzIb.js +1820 -0
- package/dist/routes-ucJWAk5O.js +1820 -0
- package/dist/rpc-BnKxnQ0v.js +70 -0
- package/dist/rpc-DgE-xnyx.js +70 -0
- package/dist/run-main-B74kv84C.js +371 -0
- package/dist/runtime-guard-CKFdts2L.js +60 -0
- package/dist/sandbox-CJTS3er6.js +858 -0
- package/dist/sandbox-DBSiVHt_.js +859 -0
- package/dist/sandbox-cli-CrkjyU5M.js +461 -0
- package/dist/sandbox-cli-D1r5y6Sz.js +458 -0
- package/dist/security-cli-BZUdnkhn.js +462 -0
- package/dist/security-cli-DS09ebvA.js +465 -0
- package/dist/server-context-C0xZbYhg.js +824 -0
- package/dist/server-context-DVh2z7om.js +824 -0
- package/dist/server-node-events-bu9lpkMH.js +233 -0
- package/dist/server-node-events-i1Rrww31.js +231 -0
- package/dist/service-CJJwLEor.js +642 -0
- package/dist/service-DxLxBhaU.js +642 -0
- package/dist/service-audit-DB4Y3Ekp.js +488 -0
- package/dist/service-audit-M8y4TXVb.js +488 -0
- package/dist/session-CGxOLFs2.js +179 -0
- package/dist/session-DTTbdKb0.js +181 -0
- package/dist/session-cost-usage-FcdJl9c3.js +600 -0
- package/dist/session-cost-usage-qdfsGU2a.js +600 -0
- package/dist/session-yOhWcsD2.js +181 -0
- package/dist/sessions-B-Cu7JZq.js +1296 -0
- package/dist/sessions-BgLN4KFr.js +180 -0
- package/dist/sessions-CnRjwdVr.js +1296 -0
- package/dist/sessions-wRKla1Qh.js +2038 -0
- package/dist/shared-DS3UaJSP.js +66 -0
- package/dist/shared-DxNHzky3.js +77 -0
- package/dist/shared-Qpt4hUDi.js +66 -0
- package/dist/shared-kzrojZ1B.js +77 -0
- package/dist/skill-scanner-DLJji5Ye.js +263 -0
- package/dist/skills-BWFIEp4j.js +807 -0
- package/dist/skills-DV4zKdCx.js +808 -0
- package/dist/skills-cli-BY53ILm2.js +289 -0
- package/dist/skills-cli-CO3gxl8A.js +286 -0
- package/dist/skills-status-DX5pcqY3.js +166 -0
- package/dist/skills-status-zhcKzGkp.js +166 -0
- package/dist/sqlite-B6MojU1I.js +321 -0
- package/dist/sqlite-CuprTGR7.js +453 -0
- package/dist/sqlite-dzD-jMjs.js +368 -0
- package/dist/start-Cu3aLoSf.js +297 -0
- package/dist/start-Dz7tMAl8.js +296 -0
- package/dist/status-CaSxhxfV.js +2132 -0
- package/dist/status-D2C0JCX3.js +2137 -0
- package/dist/status-DlFMsQzh.js +27 -0
- package/dist/status-G0CITnKR.js +27 -0
- package/dist/status.update-CHjhVxJY.js +79 -0
- package/dist/status.update-DVFelehi.js +79 -0
- package/dist/subagent-registry-3Xb4el-8.js +14 -0
- package/dist/subagent-registry-CdSjz14I.js +2760 -0
- package/dist/subagent-registry-DNDhbHWi.js +2759 -0
- package/dist/subsystem-DfKstnEK.js +860 -0
- package/dist/system-cli-B5mt0FWa.js +82 -0
- package/dist/system-cli-Dg3UQ3Zz.js +79 -0
- package/dist/systemd-B43AvOGx.js +452 -0
- package/dist/systemd-RpPE0XGg.js +452 -0
- package/dist/systemd-hints-DMJT-Bbc.js +36 -0
- package/dist/systemd-hints-vRInKcz9.js +36 -0
- package/dist/systemd-linger-Dzyxqsod.js +75 -0
- package/dist/systemd-linger-EujbmI5A.js +75 -0
- package/dist/table-DhXHfRX2.js +279 -0
- package/dist/table-bWCLW-3P.js +279 -0
- package/dist/timeout-Ddn-5kAO.js +232 -0
- package/dist/tokens-3psI_Qk2.js +14 -0
- package/dist/tokens-BaM53PEx.js +14 -0
- package/dist/trash-Bmxs1Rnm.js +23 -0
- package/dist/trash-C39a6hKA.js +23 -0
- package/dist/tui-BHgBWhHE.js +3894 -0
- package/dist/tui-cli-B9Sq5-cC.js +50 -0
- package/dist/tui-cli-Dw7v4JoJ.js +47 -0
- package/dist/tui-mUwDwqvd.js +3894 -0
- package/dist/update-DF0GHG0j.js +317 -0
- package/dist/update-DoZLVjva.js +317 -0
- package/dist/update-check-Bt1dVPVN.js +400 -0
- package/dist/update-check-D5qAKes7.js +400 -0
- package/dist/update-cli-BNu2Oi7H.js +1105 -0
- package/dist/update-cli-D36AmALA.js +1105 -0
- package/dist/update-runner-CNQQaTwA.js +894 -0
- package/dist/update-runner-CvxZmbu-.js +894 -0
- package/dist/usage-BGCwNnjk.js +4516 -0
- package/dist/utils-DZ8pnOD5.js +243 -0
- package/dist/web-B5QG839O.js +46842 -0
- package/dist/web-Cmnvk9v0.js +2203 -0
- package/dist/web-Cv2KnTnL.js +63 -0
- package/dist/webhooks-cli-B6y89Pj_.js +319 -0
- package/dist/webhooks-cli-BDzHON4w.js +316 -0
- package/dist/whatsapp-actions-C_5MwVxM.js +45 -0
- package/dist/whatsapp-actions-hgYA12To.js +53 -0
- package/dist/whatsapp-actions-zTiVOoOV.js +49 -0
- package/dist/widearea-dns-BeIdnISJ.js +127 -0
- package/dist/widearea-dns-CF1gxpJ-.js +127 -0
- package/dist/workspace-DLna1IxR.js +649 -0
- package/dist/ws-log-Q4wO1Ztb.js +267 -0
- package/dist/ws-log-xF0kxDzp.js +267 -0
- package/package.json +1 -2
- package/dist/accounts-Cc5E4IDO.js +0 -260
- package/dist/accounts-CcVrwKqv.js +0 -259
- package/dist/acp-cli-DvphOKuh.js +0 -1081
- package/dist/acp-cli-p28pQ65a.js +0 -1084
- package/dist/agent-Cj7uDJaZ.js +0 -725
- package/dist/agent-Cuj9-2sT.js +0 -725
- package/dist/agent-events-BEBQsyE5.js +0 -182
- package/dist/agent-scope-BVf4aSwY.js +0 -112
- package/dist/agent-scope-OZi7lb8S.js +0 -452
- package/dist/agent-scope-V1bi9OYL.js +0 -452
- package/dist/agents-BUWqn_Ui.js +0 -774
- package/dist/agents.config-Dvo2ULxs.js +0 -182
- package/dist/agents.config-d6H0_3oj.js +0 -182
- package/dist/argv-DqUHKf0o.js +0 -73
- package/dist/audit-C6okOOSh.js +0 -2401
- package/dist/audit-VWjIdwC7.js +0 -2401
- package/dist/auth-91o2YM96.js +0 -648
- package/dist/auth-choice-CAmACV13.js +0 -2681
- package/dist/auth-choice-p3SeHPj2.js +0 -2681
- package/dist/auth-health-B_jXrWe6.js +0 -149
- package/dist/auth-health-DCicUKYR.js +0 -149
- package/dist/auth-lZ26wsbN.js +0 -639
- package/dist/auth-profiles-CCDD56dU.js +0 -1564
- package/dist/auth-profiles-DxI8L7bs.js +0 -2689
- package/dist/banner-Cohn04J6.js +0 -294
- package/dist/browser-cli-DANzjztE.js +0 -1676
- package/dist/browser-cli-WjsVH741.js +0 -1679
- package/dist/call-BAHvlu2G.js +0 -282
- package/dist/call-Ct7EGP_L.js +0 -282
- package/dist/catalog-BAayBt1L.js +0 -185
- package/dist/catalog-BNsf97BM.js +0 -185
- package/dist/channel-options-Dx9nPlX8.js +0 -33
- package/dist/channel-options-ZdvXrTGs.js +0 -32
- package/dist/channel-selection-CujyiWGM.js +0 -51
- package/dist/channel-selection-DfGpCyh2.js +0 -51
- package/dist/channel-web-CC0hkgkR.js +0 -2162
- package/dist/channels-cli-D7lNBpIb.js +0 -1304
- package/dist/channels-cli-DUPG8WDv.js +0 -1306
- package/dist/channels-status-issues-DBc1pU_R.js +0 -18
- package/dist/channels-status-issues-DjO9MHIG.js +0 -18
- package/dist/chrome-Bi6iZ5sG.js +0 -1601
- package/dist/chrome-DNSv7Cpy.js +0 -1629
- package/dist/chrome-DScZx4Lk.js +0 -1601
- package/dist/chunk-mxPVo000.js +0 -348
- package/dist/clack-prompter-B0kl7shw.js +0 -92
- package/dist/clack-prompter-B1YxZdRy.js +0 -92
- package/dist/cli-CfHUkOD0.js +0 -101
- package/dist/cli-ClMrIh6l.js +0 -99
- package/dist/cli-session-BkPTd9Pk.js +0 -5463
- package/dist/cli-session-Dd8DKb5a.js +0 -5408
- package/dist/client-C1avc0vD.js +0 -1692
- package/dist/client-CC94YZrT.js +0 -1692
- package/dist/clipboard-B2fBy8tG.js +0 -31
- package/dist/clipboard-BbGnZskJ.js +0 -31
- package/dist/command-format-Clp46jkj.js +0 -38
- package/dist/command-format-DELazozB.js +0 -52
- package/dist/command-format-SkzzRqR1.js +0 -52
- package/dist/command-registry-DZ4hkmA0.js +0 -248
- package/dist/commands-DtYZJSPn.js +0 -568
- package/dist/commands-Dujk1JmY.js +0 -568
- package/dist/commands-registry-Bd0xbvwG.js +0 -766
- package/dist/commands-registry-DYfRSVF3.js +0 -766
- package/dist/common-D6bu0zHC.js +0 -287
- package/dist/common-zW9Y2P1B.js +0 -287
- package/dist/completion-cli-tSe7Pmqm.js +0 -431
- package/dist/completion-cli-vn4IScs5.js +0 -432
- package/dist/config-C8rUDJXY.js +0 -5704
- package/dist/config-CLZ_XGVw.js +0 -6523
- package/dist/config-SY8M0kM_.js +0 -5705
- package/dist/config-cli-1V7D2Wsw.js +0 -247
- package/dist/config-cli-CjWEC81L.js +0 -244
- package/dist/config-guard-BW2gpKj_.js +0 -93
- package/dist/config-guard-BvxuzHpo.js +0 -76
- package/dist/config-sync-CoIIbEOe.js +0 -91
- package/dist/config-sync-DvAttep0.js +0 -91
- package/dist/configure-Bf0oupCE.js +0 -959
- package/dist/configure-DRM-7zFf.js +0 -960
- package/dist/context-D5iEFzv9.js +0 -60
- package/dist/control-service-C8m8F9pr.js +0 -72
- package/dist/control-service-DKotCWCg.js +0 -72
- package/dist/cron-cli-DB_FLYHD.js +0 -448
- package/dist/cron-cli-bxm5lrrO.js +0 -451
- package/dist/daemon-cli-1LsOnICv.js +0 -566
- package/dist/daemon-cli-CC2NrJ7a.js +0 -565
- package/dist/daemon-runtime-BXZhtBL9.js +0 -460
- package/dist/daemon-runtime-DW4USC7r.js +0 -460
- package/dist/deliver-B4HuPwJA.js +0 -1162
- package/dist/deliver-LiY5oL52.js +0 -1097
- package/dist/deliver-xrmk7xjh.js +0 -1097
- package/dist/delivery-queue-TnQykYsg.js +0 -220
- package/dist/deps-CMMOiOsF.js +0 -42
- package/dist/devices-cli-Be5he2SA.js +0 -195
- package/dist/devices-cli-z6ecoFe9.js +0 -198
- package/dist/diagnostics-Dj75aEHN.js +0 -35
- package/dist/diagnostics-DlIw6fqD.js +0 -35
- package/dist/directory-cli-CEy-0nxj.js +0 -243
- package/dist/directory-cli-DpzKcigr.js +0 -246
- package/dist/dispatcher-10Shiuz3.js +0 -100
- package/dist/dispatcher-3Jae6AiW.js +0 -100
- package/dist/dns-cli-Bat1pkc-.js +0 -200
- package/dist/dns-cli-NohNyEo0.js +0 -197
- package/dist/dock-DbxBBv30.js +0 -753
- package/dist/dock-cPBY4qGl.js +0 -753
- package/dist/docs-cli-BWp6p-Tq.js +0 -161
- package/dist/docs-cli-x22FnZfL.js +0 -159
- package/dist/doctor-BrT5m_on.js +0 -1815
- package/dist/doctor-Pp2HVnjM.js +0 -1813
- package/dist/doctor-completion-DNTimX9o.js +0 -92
- package/dist/doctor-completion-ylN9QAJ6.js +0 -92
- package/dist/doctor-config-flow-D1w3700T.js +0 -1232
- package/dist/doctor-config-flow-Dq50iE1R.js +0 -1232
- package/dist/engine-B9avUJL5.js +0 -563
- package/dist/engine-BiUQ25D4.js +0 -563
- package/dist/env-0lJfCPsw.js +0 -32
- package/dist/exec-BenD3A5l.js +0 -1167
- package/dist/exec-Bv3pyjeM.js +0 -255
- package/dist/exec-approvals-CdLmKX2R.js +0 -1221
- package/dist/exec-approvals-cli-DXfV6G8H.js +0 -368
- package/dist/exec-approvals-cli-J2cZs10o.js +0 -371
- package/dist/frontmatter-YijVi0FQ.js +0 -204
- package/dist/gateway-cli-DOAbA0pc.js +0 -19972
- package/dist/gateway-cli-QpWtBhQy.js +0 -19971
- package/dist/gateway-rpc-DJKBil9s.js +0 -28
- package/dist/gateway-rpc-DVterpLP.js +0 -28
- package/dist/github-copilot-auth-4IUFp669.js +0 -1418
- package/dist/github-copilot-auth-C9E0IROs.js +0 -1418
- package/dist/gmail-setup-utils-BPo_LkKI.js +0 -428
- package/dist/gmail-setup-utils-D3Yqgor7.js +0 -428
- package/dist/health-BeZnqp6m.js +0 -1258
- package/dist/health-Cn2OoVWZ.js +0 -1253
- package/dist/health-format-CdP99j3Y.js +0 -208
- package/dist/health-format-JEChH08S.js +0 -208
- package/dist/heartbeat-visibility-BL3WAchI.js +0 -98
- package/dist/heartbeat-visibility-CQ9QimI7.js +0 -98
- package/dist/help-format-Dl4bsrLI.js +0 -17
- package/dist/helpers-ZKNRexvX.js +0 -10
- package/dist/hooks-cli-D99hXt7K.js +0 -991
- package/dist/hooks-cli-DMB8RiEO.js +0 -993
- package/dist/hooks-status-B-e96dZj.js +0 -356
- package/dist/hooks-status-C_9sE0ox.js +0 -356
- package/dist/image-ops-Dlt3T7th.js +0 -541
- package/dist/image-ops-omlvdfah.js +0 -541
- package/dist/init-Bm04RagW.js +0 -122
- package/dist/init-CaJBf4p1.js +0 -122
- package/dist/installs-C2iMRBVz.js +0 -383
- package/dist/installs-D-cPGdCw.js +0 -383
- package/dist/ipv4-Bf7NS3QU.js +0 -1964
- package/dist/ipv4-wWNs8IH_.js +0 -1964
- package/dist/lanes-CNxj3tit.js +0 -232
- package/dist/lifecycle-core-B_7XRcvF.js +0 -388
- package/dist/lifecycle-core-By83PVAK.js +0 -387
- package/dist/links-BfjHVTB_.js +0 -15
- package/dist/links-DPGe0OHw.js +0 -15
- package/dist/logging-DB6BQmhi.js +0 -15
- package/dist/logging-mcb66J0p.js +0 -15
- package/dist/login-BDCg6D0N.js +0 -61
- package/dist/login-BDfnbjnZ.js +0 -59
- package/dist/login-BqH1itcg.js +0 -61
- package/dist/login-qr-CyOw3R4r.js +0 -321
- package/dist/login-qr-D8ECtb72.js +0 -323
- package/dist/login-qr-RnR7e4Bw.js +0 -326
- package/dist/logs-cli--j89L74J.js +0 -245
- package/dist/logs-cli-DpEMg_Gq.js +0 -242
- package/dist/manager-B4OyvcxT.js +0 -3244
- package/dist/manager-Cqc1CeH7.js +0 -3246
- package/dist/manager-DUyQPFvj.js +0 -3244
- package/dist/manifest-registry-CW1zCyRF.js +0 -748
- package/dist/manifest-registry-D4lM2RdV.js +0 -748
- package/dist/markdown-tables-BT1X6jqH.js +0 -347
- package/dist/markdown-tables-DHgOK2vI.js +0 -348
- package/dist/media-THyainiE.js +0 -1342
- package/dist/memory-cli-BKocCWXM.js +0 -868
- package/dist/memory-cli-Jmma-xI_.js +0 -869
- package/dist/message-channel-dSTVVCyX.js +0 -110
- package/dist/migrate-BR6iAIjO.js +0 -157
- package/dist/migrate-D0EcMs0f.js +0 -157
- package/dist/model-selection-YcSr9CgC.js +0 -2691
- package/dist/models-1vUQBVfw.js +0 -2510
- package/dist/models-cli-BK3BwUhL.js +0 -2739
- package/dist/models-cli-DECrM8oA.js +0 -258
- package/dist/net-B5lXhYLV.js +0 -218
- package/dist/node-cli-cLHUNpPD.js +0 -1319
- package/dist/node-cli-fO7Y132S.js +0 -1322
- package/dist/node-service-BFxHJsno.js +0 -67
- package/dist/node-service-DUnan4uK.js +0 -67
- package/dist/nodes-cli-BCq35E6N.js +0 -1200
- package/dist/nodes-cli-vD7MwAKP.js +0 -1197
- package/dist/nodes-screen-1YiLkqr5.js +0 -234
- package/dist/nodes-screen-DZeD8hE5.js +0 -234
- package/dist/note-Bi8Wb8DV.js +0 -73
- package/dist/note-uiuPxhyX.js +0 -73
- package/dist/npm-registry-spec-B-XIShkB.js +0 -351
- package/dist/npm-registry-spec-za3itb5Y.js +0 -351
- package/dist/onboard-Ds6w_sWo.js +0 -1165
- package/dist/onboard-SAVx3bp4.js +0 -1166
- package/dist/onboard-channels-Cg_EkBa4.js +0 -672
- package/dist/onboard-channels-D7NbA55V.js +0 -672
- package/dist/onboard-helpers-DO_hgZb9.js +0 -365
- package/dist/onboard-helpers-_XgJgeqh.js +0 -365
- package/dist/onboarding-3hLmDd0r.js +0 -911
- package/dist/onboarding-B4LKLsbU.js +0 -910
- package/dist/orchestrator-BKzmyBWy.js +0 -357
- package/dist/orchestrator-BN3QCz2s.js +0 -357
- package/dist/outbound-BgA9hNlP.js +0 -2062
- package/dist/outbound-CjdvVhUI.js +0 -214
- package/dist/outbound-DOGe6qb2.js +0 -214
- package/dist/outbound-send-deps-Du5aBpd7.js +0 -55
- package/dist/pairing-cli-2vnyg_Nd.js +0 -118
- package/dist/pairing-cli-BH1KQtNV.js +0 -121
- package/dist/pairing-store-DJz_9Gv0.js +0 -388
- package/dist/pairing-store-DmOzxcuk.js +0 -388
- package/dist/path-env-Bu6k0jDQ.js +0 -89
- package/dist/path-env-C0zQSjw8.js +0 -89
- package/dist/paths-BTc4nk-6.js +0 -126
- package/dist/paths-BgUi2Z2G.js +0 -54
- package/dist/paths-C6VCWKo3.js +0 -238
- package/dist/paths-CCxa0o9c.js +0 -222
- package/dist/paths-CxRf2rBG.js +0 -129
- package/dist/paths-hcX1Gqg5.js +0 -129
- package/dist/pi-auth-json-B68R7q7_.js +0 -82
- package/dist/pi-auth-json-CR0jXAgq.js +0 -78
- package/dist/pi-auth-json-ZYzi3nxs.js +0 -80
- package/dist/pi-model-discovery-Cxs4pvC2.js +0 -3
- package/dist/pi-tools.policy-D81U5xy0.js +0 -200
- package/dist/pi-tools.policy-DSHkkb5b.js +0 -200
- package/dist/plugin-auto-enable-CxF4bpDN.js +0 -282
- package/dist/plugin-auto-enable-jNaAeyEh.js +0 -282
- package/dist/plugin-registry-C7XWotZG.js +0 -32
- package/dist/plugin-registry-DcUCbGax.js +0 -32
- package/dist/plugins-B362e77G.js +0 -168
- package/dist/plugins-CmSUIUNi.js +0 -38
- package/dist/plugins-cli-BsCEnoQ7.js +0 -734
- package/dist/plugins-cli-QSIsMUG7.js +0 -736
- package/dist/polls-CItfB1H8.js +0 -1343
- package/dist/ports-BVLMN1Sr.js +0 -96
- package/dist/ports-CqLSlU6Z.js +0 -317
- package/dist/ports-D94CwCrv.js +0 -344
- package/dist/ports-D_NHthOz.js +0 -96
- package/dist/program-DkJHjI0R.js +0 -176
- package/dist/program-context-DnyGM2SC.js +0 -496
- package/dist/progress-Bek_GyWS.js +0 -133
- package/dist/prompt-style-lu0clOOE.js +0 -9
- package/dist/pw-ai-BLVMuSLv.js +0 -1867
- package/dist/pw-ai-DZJWEF_f.js +0 -1865
- package/dist/pw-ai-dzf-ptcn.js +0 -1868
- package/dist/qmd-manager-Cur_Ekn0.js +0 -937
- package/dist/qmd-manager-DNAUuwjK.js +0 -938
- package/dist/qmd-manager-DepEoASu.js +0 -935
- package/dist/register.agent-CSWvzOkR.js +0 -265
- package/dist/register.agent-UeH2NXmH.js +0 -1003
- package/dist/register.anima-DOdee0dh.js +0 -193
- package/dist/register.anima-HHDWsz6r.js +0 -193
- package/dist/register.configure-CSJFxdz9.js +0 -103
- package/dist/register.configure-D84Fvcz4.js +0 -101
- package/dist/register.maintenance-B3pvNbZb.js +0 -543
- package/dist/register.maintenance-BKVOwkw6.js +0 -543
- package/dist/register.message-BAO6CPl2.js +0 -657
- package/dist/register.message-OXoOKE_6.js +0 -660
- package/dist/register.onboard-BK_ixVmD.js +0 -170
- package/dist/register.onboard-cfCaPx6j.js +0 -170
- package/dist/register.setup-BGfDnzph.js +0 -175
- package/dist/register.setup-Y-Q74M-0.js +0 -175
- package/dist/register.status-health-sessions-CT14eitH.js +0 -142
- package/dist/register.status-health-sessions-TfZMzAUn.js +0 -313
- package/dist/register.subclis-BZwdlNHC.js +0 -255
- package/dist/reply-mlsExaZm.js +0 -32212
- package/dist/reply-prefix-B0CfR4bM.js +0 -100
- package/dist/reply-prefix-w4a39ybC.js +0 -100
- package/dist/reply-qalRISe_.js +0 -32212
- package/dist/routes-CENsHJyg.js +0 -1820
- package/dist/routes-DO0HqW2e.js +0 -1820
- package/dist/rpc-C0pjNhBi.js +0 -70
- package/dist/rpc-DZ44PIXE.js +0 -70
- package/dist/run-main-BMpKw8Mp.js +0 -371
- package/dist/runtime-guard-BSUFiAQV.js +0 -60
- package/dist/sandbox-BIGfMYEI.js +0 -858
- package/dist/sandbox-DxP3IpUP.js +0 -859
- package/dist/sandbox-cli-DtLGH8sL.js +0 -461
- package/dist/sandbox-cli-_Tg7lfJ_.js +0 -458
- package/dist/security-cli-BRwgbedo.js +0 -462
- package/dist/security-cli-D3bSuyZt.js +0 -465
- package/dist/server-context-49XFFxFg.js +0 -824
- package/dist/server-context-LrlgrZzS.js +0 -824
- package/dist/server-node-events-Dm52i7NW.js +0 -231
- package/dist/server-node-events-QX523UyF.js +0 -233
- package/dist/service-BNVpYcQe.js +0 -642
- package/dist/service-D56aMXUB.js +0 -642
- package/dist/service-audit-D0X_XAB2.js +0 -488
- package/dist/service-audit-qmf6XMmP.js +0 -488
- package/dist/session-CrQQLLhx.js +0 -179
- package/dist/session-LocsOOWJ.js +0 -181
- package/dist/session-Vlce2BAT.js +0 -181
- package/dist/session-cost-usage-BwiTZuKl.js +0 -600
- package/dist/session-cost-usage-DT9YNXTJ.js +0 -600
- package/dist/sessions-BfV53TbG.js +0 -1296
- package/dist/sessions-BimpX_km.js +0 -180
- package/dist/sessions-DcXpzig0.js +0 -1296
- package/dist/sessions-Wd18dukK.js +0 -2038
- package/dist/shared-Bsr69u_7.js +0 -77
- package/dist/shared-Cgly1vPb.js +0 -66
- package/dist/shared-JOo05hST.js +0 -66
- package/dist/shared-f7dvQsi7.js +0 -77
- package/dist/skill-scanner-CkaVLABv.js +0 -263
- package/dist/skills-B-G7UHOa.js +0 -808
- package/dist/skills-B5LQx4lT.js +0 -807
- package/dist/skills-cli-DUGe2ZWW.js +0 -286
- package/dist/skills-cli-DtOk0bvK.js +0 -289
- package/dist/skills-status-Clq9ZnYu.js +0 -166
- package/dist/skills-status-JQluhU-P.js +0 -166
- package/dist/sqlite-BukcjdJa.js +0 -321
- package/dist/sqlite-CGcOZZ0C.js +0 -368
- package/dist/sqlite-Ck6f9KWc.js +0 -453
- package/dist/start--xmSFepB.js +0 -372
- package/dist/start-BdlZbqrr.js +0 -371
- package/dist/status-BgoeFm6g.js +0 -2137
- package/dist/status-BjjDrUq7.js +0 -27
- package/dist/status-Ct0DgOZ-.js +0 -2132
- package/dist/status-RA_uNmK0.js +0 -27
- package/dist/status.update-BjOH3GlS.js +0 -79
- package/dist/status.update-DLU1qBf0.js +0 -79
- package/dist/subagent-registry-9RLdKxES.js +0 -2760
- package/dist/subagent-registry-Byuex3zp.js +0 -2759
- package/dist/subagent-registry-DOBunBYS.js +0 -14
- package/dist/subsystem-Dowf8fSU.js +0 -860
- package/dist/system-cli-C5oBpzni.js +0 -79
- package/dist/system-cli-DXNKD_Id.js +0 -82
- package/dist/systemd-BSrHDyeU.js +0 -452
- package/dist/systemd-By5xdSB4.js +0 -452
- package/dist/systemd-hints-BtjL_5Rh.js +0 -36
- package/dist/systemd-hints-sJmr6cjb.js +0 -36
- package/dist/systemd-linger-CTmV2Gci.js +0 -75
- package/dist/systemd-linger-CmyqQkeC.js +0 -75
- package/dist/table-BL0lJzsm.js +0 -279
- package/dist/table-DoiRPsn0.js +0 -279
- package/dist/timeout-CswI_K-U.js +0 -232
- package/dist/tokens-C-X7wDKj.js +0 -14
- package/dist/tokens-DkvqA72p.js +0 -14
- package/dist/trash-BJLK1vMn.js +0 -23
- package/dist/trash-_x5UZ94k.js +0 -23
- package/dist/tui-BHjxDFZC.js +0 -3894
- package/dist/tui-CgOocwN8.js +0 -3894
- package/dist/tui-cli-5ANH8dE5.js +0 -47
- package/dist/tui-cli-BQ4P-JW_.js +0 -50
- package/dist/update-LFgxHHPd.js +0 -317
- package/dist/update-TxptCqk7.js +0 -317
- package/dist/update-check-CWc7YXmc.js +0 -400
- package/dist/update-check-IhlWaui6.js +0 -400
- package/dist/update-cli-PtXU62w7.js +0 -1105
- package/dist/update-cli-Va0EtETG.js +0 -1105
- package/dist/update-runner-BLeKFkiB.js +0 -894
- package/dist/update-runner-Iuzpc-_y.js +0 -894
- package/dist/usage-ApGvBLVg.js +0 -4516
- package/dist/utils-Bsw__U-F.js +0 -243
- package/dist/web-B6_Ky60G.js +0 -63
- package/dist/web-EZLQEWXY.js +0 -46842
- package/dist/web-pec8YJUX.js +0 -2203
- package/dist/webhooks-cli-BYQKTHTp.js +0 -319
- package/dist/webhooks-cli-C2_xtsUQ.js +0 -316
- package/dist/whatsapp-actions-C72VCq8f.js +0 -49
- package/dist/whatsapp-actions-Ck9Uv0Nw.js +0 -45
- package/dist/whatsapp-actions-D0reTj2k.js +0 -53
- package/dist/widearea-dns-B6ocX23x.js +0 -127
- package/dist/widearea-dns-NsEUNYwz.js +0 -127
- package/dist/workspace-Dcfoy5JJ.js +0 -649
- package/dist/ws-log-N8R5MvGE.js +0 -267
- package/dist/ws-log-gwFxPxj5.js +0 -267
- /package/dist/{auto-update-CUeF99gI.js → auto-update-CpF0fycd.js} +0 -0
- /package/dist/{auto-update-cgkp9ZTJ.js → auto-update-DNWdO7uF.js} +0 -0
- /package/dist/{brew-CVZkr0GU.js → brew-nqf_MiE4.js} +0 -0
- /package/dist/{budget-DxYQSekw.js → budget-CPedI-qW.js} +0 -0
- /package/dist/{budget-BWBp8Res.js → budget-CRpvqDRX.js} +0 -0
- /package/dist/{cli-utils-DtAxdCte.js → cli-utils-C1YHVD4o.js} +0 -0
- /package/dist/{command-options-CSbuuqHr.js → command-options-BbponVnw.js} +0 -0
- /package/dist/{command-options-Cp1tf96a.js → command-options-s0gnvXnS.js} +0 -0
- /package/dist/{constants-O8yBqCBv.js → constants-Dhb6zSIV.js} +0 -0
- /package/dist/{dangerous-tools-5ObDWy1N.js → dangerous-tools-DGTtJ_JR.js} +0 -0
- /package/dist/{dangerous-tools-Jwr7jqNw.js → dangerous-tools-DxrfTOfT.js} +0 -0
- /package/dist/{delivery-queue-B6IHz4Ry.js → delivery-queue-Bxm0nzw7.js} +0 -0
- /package/dist/{display-BDOsXu8F.js → display-Jy3UdGzA.js} +0 -0
- /package/dist/{errors-CHow2wtt.js → errors-CKaCqKga.js} +0 -0
- /package/dist/{exec-BizYYQgP.js → exec-DDmuVVNq.js} +0 -0
- /package/dist/{format-Mq6iU0_5.js → format-ByEjgyTF.js} +0 -0
- /package/dist/{format-duration-DhWzz_5b.js → format-duration-Aaj5tjJd.js} +0 -0
- /package/dist/{format-relative-C6kUHuOj.js → format-relative-79_Y1n2Y.js} +0 -0
- /package/dist/{help-format-DUBI91Ti.js → help-format-BMKzarov.js} +0 -0
- /package/dist/{helpers-eJFa4K6r.js → helpers-DpEB9Mh0.js} +0 -0
- /package/dist/{helpers-DLgbkcEn.js → helpers-FMld9sBT.js} +0 -0
- /package/dist/{input-provenance-DJBdpeKk.js → input-provenance-Cy_KnBlP.js} +0 -0
- /package/dist/{is-main-Dt9DTcH1.js → is-main-yjaVwMtJ.js} +0 -0
- /package/dist/{loader-l2OBdJ8x.js → loader-Br7Vr0zn.js} +0 -0
- /package/dist/{loader-BoYxRfcW.js → loader-CkmOrXcC.js} +0 -0
- /package/dist/{logging-BdnOSVPD.js → logging-CY-Q5cwf.js} +0 -0
- /package/dist/{message-channel-w4F2b2F6.js → message-channel-dua8OOGJ.js} +0 -0
- /package/dist/{mime-B1ZoR53M.js → mime-CBg4KybI.js} +0 -0
- /package/dist/{model-param-b-DPwyNGn8.js → model-param-b-DW9f0NN8.js} +0 -0
- /package/dist/{node-match-8XZnaid6.js → node-match-BV8bTBd4.js} +0 -0
- /package/dist/{normalize-GDK8JTNW.js → normalize-_lmlBOW9.js} +0 -0
- /package/dist/{openclaw-root-C85WMnVV.js → openclaw-root-JPvmPTf7.js} +0 -0
- /package/dist/{outbound-send-deps-ANnAhImn.js → outbound-send-deps-BfUvuWGa.js} +0 -0
- /package/dist/{parse-6-2MDhdT.js → parse-CZRwKocn.js} +0 -0
- /package/dist/{parse-log-line-Bqh1SSzC.js → parse-log-line-CvrZEK6A.js} +0 -0
- /package/dist/{parse-log-line-DUZCjXbl.js → parse-log-line-mLdat0AH.js} +0 -0
- /package/dist/{parse-port-BKB9Exlg.js → parse-port-BSOOdo7I.js} +0 -0
- /package/dist/{parse-port-DrfvwwiL.js → parse-port-Y0NK62x1.js} +0 -0
- /package/dist/{parse-timeout-Di_tcEmi.js → parse-timeout-DVPQ3n9j.js} +0 -0
- /package/dist/{paths-DcVEkYX5.js → paths-DHjlJ6cn.js} +0 -0
- /package/dist/{pi-model-discovery-DsRqYJLy.js → pi-model-discovery-DzEIEgHL.js} +0 -0
- /package/dist/{plugins-CDJw924T.js → plugins-D6PBOdkn.js} +0 -0
- /package/dist/{program-context-Bvn8046-.js → program-context-Q1hkT73c.js} +0 -0
- /package/dist/{progress-CbZ2D53A.js → progress-C9Ha1NJh.js} +0 -0
- /package/dist/{prompt-style-DKy6qQxR.js → prompt-style-DQi8j03a.js} +0 -0
- /package/dist/{prompts-BI__va99.js → prompts-BEHxUC3w.js} +0 -0
- /package/dist/{prompts-_dDWkCAz.js → prompts-CSOhuiqe.js} +0 -0
- /package/dist/{queue-D_u34pbL.js → queue-BJGo7kAB.js} +0 -0
- /package/dist/{queue-PG591iID.js → queue-DYgUbdoq.js} +0 -0
- /package/dist/{redact-ClVwO7Nn.js → redact-CyKvdFrg.js} +0 -0
- /package/dist/{registry-Bs_DJK9E.js → registry-C5MAYD4V.js} +0 -0
- /package/dist/{registry-D_zlP1U-.js → registry-CRrXXVs0.js} +0 -0
- /package/dist/{requirements-BzZxj2Wu.js → requirements-CGkxTCu4.js} +0 -0
- /package/dist/{requirements-DIW1svgA.js → requirements-CIDaOcbO.js} +0 -0
- /package/dist/{runtime-guard-DeOXA_86.js → runtime-guard-nL3Lp8T-.js} +0 -0
- /package/dist/{secret-equal-Dghy3xsA.js → secret-equal-DJpmLXlG.js} +0 -0
- /package/dist/{send-BhAfdGII.js → send-CTcxgDDU.js} +0 -0
- /package/dist/{send-ga9udK1_.js → send-DPezUR3-.js} +0 -0
- /package/dist/{send-C2t9xpXI.js → send-DZQTaG7-.js} +0 -0
- /package/dist/{send-DigO-i9j.js → send-VDff2gra.js} +0 -0
- /package/dist/{send-Dz2BDHll.js → send-bgQNV8d1.js} +0 -0
- /package/dist/{session-key-BGiG_JcT.js → session-key-CQT-NR6w.js} +0 -0
- /package/dist/{shell-argv-CAq1mLa2.js → shell-argv-n9IueeJQ.js} +0 -0
- /package/dist/{skill-scanner-Coo4QoCd.js → skill-scanner-o6NgVMD9.js} +0 -0
- /package/dist/{status-CMnlcBVc.js → status-C53kTIXF.js} +0 -0
- /package/dist/{status-tDZPwewW.js → status-CZDDA_Sy.js} +0 -0
- /package/dist/{system-run-command-X9lDJIy0.js → system-run-command-BCjUffN9.js} +0 -0
- /package/dist/{system-run-command-DGk7dwQP.js → system-run-command-CqAqKL9K.js} +0 -0
- /package/dist/{tailnet-CuiNECdL.js → tailnet-Ciwjv243.js} +0 -0
- /package/dist/{templates-CeYJjVzw.js → templates-37RKpACb.js} +0 -0
- /package/dist/{templates-I3Z0xplD.js → templates-DPalk30o.js} +0 -0
- /package/dist/{thinking-BXEswx1X.js → thinking-2hxwmvTl.js} +0 -0
- /package/dist/{transcript-events-C1hdue6u.js → transcript-events-Bp7fGnwv.js} +0 -0
- /package/dist/{transcript-tools-DuyYOkUq.js → transcript-tools-D4Lbxlka.js} +0 -0
- /package/dist/{usage-format-BAirWUSO.js → usage-format-6Uar63S0.js} +0 -0
- /package/dist/{utils-C9sj30YY.js → utils-DT8uXjFS.js} +0 -0
- /package/dist/{wsl-CqyuRvtM.js → wsl-CrPvx2kZ.js} +0 -0
- /package/dist/{wsl-ymJYvc9Q.js → wsl-UvJ5dHah.js} +0 -0
|
@@ -0,0 +1,935 @@
|
|
|
1
|
+
import { s as resolveStateDir } from "./paths-DA9WYabg.js";
|
|
2
|
+
import { M as parseAgentSessionKey } from "./workspace-DLna1IxR.js";
|
|
3
|
+
import { l as createSubsystemLogger } from "./exec-B7sUS164.js";
|
|
4
|
+
import { s as resolveAgentWorkspaceDir } from "./agent-scope-cj2QCT6R.js";
|
|
5
|
+
import "./paths-B1vRVCad.js";
|
|
6
|
+
import { n as buildSessionEntry, r as listSessionFilesForAgent, t as requireNodeSqlite } from "./sqlite-CuprTGR7.js";
|
|
7
|
+
import fs from "node:fs/promises";
|
|
8
|
+
import os from "node:os";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import { spawn } from "node:child_process";
|
|
11
|
+
import readline from "node:readline";
|
|
12
|
+
|
|
13
|
+
//#region src/memory/qmd-scope.ts
|
|
14
|
+
function isQmdScopeAllowed(scope, sessionKey) {
|
|
15
|
+
if (!scope) return true;
|
|
16
|
+
const parsed = parseQmdSessionScope(sessionKey);
|
|
17
|
+
const channel = parsed.channel;
|
|
18
|
+
const chatType = parsed.chatType;
|
|
19
|
+
const normalizedKey = parsed.normalizedKey ?? "";
|
|
20
|
+
const rawKey = sessionKey?.trim().toLowerCase() ?? "";
|
|
21
|
+
for (const rule of scope.rules ?? []) {
|
|
22
|
+
if (!rule) continue;
|
|
23
|
+
const match = rule.match ?? {};
|
|
24
|
+
if (match.channel && match.channel !== channel) continue;
|
|
25
|
+
if (match.chatType && match.chatType !== chatType) continue;
|
|
26
|
+
const normalizedPrefix = match.keyPrefix?.trim().toLowerCase() || void 0;
|
|
27
|
+
const rawPrefix = match.rawKeyPrefix?.trim().toLowerCase() || void 0;
|
|
28
|
+
if (rawPrefix && !rawKey.startsWith(rawPrefix)) continue;
|
|
29
|
+
if (normalizedPrefix) {
|
|
30
|
+
if (normalizedPrefix.startsWith("agent:")) {
|
|
31
|
+
if (!rawKey.startsWith(normalizedPrefix)) continue;
|
|
32
|
+
} else if (!normalizedKey.startsWith(normalizedPrefix)) continue;
|
|
33
|
+
}
|
|
34
|
+
return rule.action === "allow";
|
|
35
|
+
}
|
|
36
|
+
return (scope.default ?? "allow") === "allow";
|
|
37
|
+
}
|
|
38
|
+
function deriveQmdScopeChannel(key) {
|
|
39
|
+
return parseQmdSessionScope(key).channel;
|
|
40
|
+
}
|
|
41
|
+
function deriveQmdScopeChatType(key) {
|
|
42
|
+
return parseQmdSessionScope(key).chatType;
|
|
43
|
+
}
|
|
44
|
+
function parseQmdSessionScope(key) {
|
|
45
|
+
const normalized = normalizeQmdSessionKey(key);
|
|
46
|
+
if (!normalized) return {};
|
|
47
|
+
const parts = normalized.split(":").filter(Boolean);
|
|
48
|
+
let chatType;
|
|
49
|
+
if (parts.length >= 2 && (parts[1] === "group" || parts[1] === "channel" || parts[1] === "direct" || parts[1] === "dm")) {
|
|
50
|
+
if (parts.includes("group")) chatType = "group";
|
|
51
|
+
else if (parts.includes("channel")) chatType = "channel";
|
|
52
|
+
return {
|
|
53
|
+
normalizedKey: normalized,
|
|
54
|
+
channel: parts[0]?.toLowerCase(),
|
|
55
|
+
chatType: chatType ?? "direct"
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (normalized.includes(":group:")) return {
|
|
59
|
+
normalizedKey: normalized,
|
|
60
|
+
chatType: "group"
|
|
61
|
+
};
|
|
62
|
+
if (normalized.includes(":channel:")) return {
|
|
63
|
+
normalizedKey: normalized,
|
|
64
|
+
chatType: "channel"
|
|
65
|
+
};
|
|
66
|
+
return {
|
|
67
|
+
normalizedKey: normalized,
|
|
68
|
+
chatType: "direct"
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function normalizeQmdSessionKey(key) {
|
|
72
|
+
if (!key) return;
|
|
73
|
+
const trimmed = key.trim();
|
|
74
|
+
if (!trimmed) return;
|
|
75
|
+
const normalized = (parseAgentSessionKey(trimmed)?.rest ?? trimmed).toLowerCase();
|
|
76
|
+
if (normalized.startsWith("subagent:")) return;
|
|
77
|
+
return normalized;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/memory/qmd-query-parser.ts
|
|
82
|
+
const log$1 = createSubsystemLogger("memory");
|
|
83
|
+
function parseQmdQueryJson(stdout, stderr) {
|
|
84
|
+
const trimmedStdout = stdout.trim();
|
|
85
|
+
const trimmedStderr = stderr.trim();
|
|
86
|
+
const stdoutIsMarker = trimmedStdout.length > 0 && isQmdNoResultsOutput(trimmedStdout);
|
|
87
|
+
const stderrIsMarker = trimmedStderr.length > 0 && isQmdNoResultsOutput(trimmedStderr);
|
|
88
|
+
if (stdoutIsMarker || !trimmedStdout && stderrIsMarker) return [];
|
|
89
|
+
if (!trimmedStdout) {
|
|
90
|
+
const message = `stdout empty${trimmedStderr ? ` (stderr: ${summarizeQmdStderr(trimmedStderr)})` : ""}`;
|
|
91
|
+
log$1.warn(`qmd query returned invalid JSON: ${message}`);
|
|
92
|
+
throw new Error(`qmd query returned invalid JSON: ${message}`);
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
const parsed = parseQmdQueryResultArray(trimmedStdout);
|
|
96
|
+
if (parsed !== null) return parsed;
|
|
97
|
+
const noisyPayload = extractFirstJsonArray(trimmedStdout);
|
|
98
|
+
if (!noisyPayload) throw new Error("qmd query JSON response was not an array");
|
|
99
|
+
const fallback = parseQmdQueryResultArray(noisyPayload);
|
|
100
|
+
if (fallback !== null) return fallback;
|
|
101
|
+
throw new Error("qmd query JSON response was not an array");
|
|
102
|
+
} catch (err) {
|
|
103
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
104
|
+
log$1.warn(`qmd query returned invalid JSON: ${message}`);
|
|
105
|
+
throw new Error(`qmd query returned invalid JSON: ${message}`, { cause: err });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function isQmdNoResultsOutput(raw) {
|
|
109
|
+
return raw.split(/\r?\n/).map((line) => line.trim().toLowerCase().replace(/\s+/g, " ")).filter((line) => line.length > 0).some((line) => isQmdNoResultsLine(line));
|
|
110
|
+
}
|
|
111
|
+
function isQmdNoResultsLine(line) {
|
|
112
|
+
if (line === "no results found" || line === "no results found.") return true;
|
|
113
|
+
return /^(?:\[[^\]]+\]\s*)?(?:(?:warn(?:ing)?|info|error|qmd)\s*:\s*)+no results found\.?$/.test(line);
|
|
114
|
+
}
|
|
115
|
+
function summarizeQmdStderr(raw) {
|
|
116
|
+
return raw.length <= 120 ? raw : `${raw.slice(0, 117)}...`;
|
|
117
|
+
}
|
|
118
|
+
function parseQmdQueryResultArray(raw) {
|
|
119
|
+
try {
|
|
120
|
+
const parsed = JSON.parse(raw);
|
|
121
|
+
if (!Array.isArray(parsed)) return null;
|
|
122
|
+
return parsed;
|
|
123
|
+
} catch {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function extractFirstJsonArray(raw) {
|
|
128
|
+
const start = raw.indexOf("[");
|
|
129
|
+
if (start < 0) return null;
|
|
130
|
+
let depth = 0;
|
|
131
|
+
let inString = false;
|
|
132
|
+
let escaped = false;
|
|
133
|
+
for (let i = start; i < raw.length; i += 1) {
|
|
134
|
+
const char = raw[i];
|
|
135
|
+
if (char === void 0) break;
|
|
136
|
+
if (inString) {
|
|
137
|
+
if (escaped) {
|
|
138
|
+
escaped = false;
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (char === "\\") escaped = true;
|
|
142
|
+
else if (char === "\"") inString = false;
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (char === "\"") {
|
|
146
|
+
inString = true;
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
if (char === "[") depth += 1;
|
|
150
|
+
else if (char === "]") {
|
|
151
|
+
depth -= 1;
|
|
152
|
+
if (depth === 0) return raw.slice(start, i + 1);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/memory/qmd-manager.ts
|
|
160
|
+
const log = createSubsystemLogger("memory");
|
|
161
|
+
const SNIPPET_HEADER_RE = /@@\s*-([0-9]+),([0-9]+)/;
|
|
162
|
+
const SEARCH_PENDING_UPDATE_WAIT_MS = 500;
|
|
163
|
+
const MAX_QMD_OUTPUT_CHARS = 2e5;
|
|
164
|
+
const NUL_MARKER_RE = /(?:\^@|\\0|\\x00|\\u0000|null\s*byte|nul\s*byte)/i;
|
|
165
|
+
var QmdMemoryManager = class QmdMemoryManager {
|
|
166
|
+
static async create(params) {
|
|
167
|
+
const resolved = params.resolved.qmd;
|
|
168
|
+
if (!resolved) return null;
|
|
169
|
+
const manager = new QmdMemoryManager({
|
|
170
|
+
cfg: params.cfg,
|
|
171
|
+
agentId: params.agentId,
|
|
172
|
+
resolved
|
|
173
|
+
});
|
|
174
|
+
await manager.initialize(params.mode ?? "full");
|
|
175
|
+
return manager;
|
|
176
|
+
}
|
|
177
|
+
constructor(params) {
|
|
178
|
+
this.collectionRoots = /* @__PURE__ */ new Map();
|
|
179
|
+
this.sources = /* @__PURE__ */ new Set();
|
|
180
|
+
this.docPathCache = /* @__PURE__ */ new Map();
|
|
181
|
+
this.exportedSessionState = /* @__PURE__ */ new Map();
|
|
182
|
+
this.maxQmdOutputChars = MAX_QMD_OUTPUT_CHARS;
|
|
183
|
+
this.updateTimer = null;
|
|
184
|
+
this.pendingUpdate = null;
|
|
185
|
+
this.queuedForcedUpdate = null;
|
|
186
|
+
this.queuedForcedRuns = 0;
|
|
187
|
+
this.closed = false;
|
|
188
|
+
this.db = null;
|
|
189
|
+
this.lastUpdateAt = null;
|
|
190
|
+
this.lastEmbedAt = null;
|
|
191
|
+
this.attemptedNullByteCollectionRepair = false;
|
|
192
|
+
this.cfg = params.cfg;
|
|
193
|
+
this.agentId = params.agentId;
|
|
194
|
+
this.qmd = params.resolved;
|
|
195
|
+
this.workspaceDir = resolveAgentWorkspaceDir(params.cfg, params.agentId);
|
|
196
|
+
this.stateDir = resolveStateDir(process.env, os.homedir);
|
|
197
|
+
this.agentStateDir = path.join(this.stateDir, "agents", this.agentId);
|
|
198
|
+
this.qmdDir = path.join(this.agentStateDir, "qmd");
|
|
199
|
+
this.xdgConfigHome = path.join(this.qmdDir, "xdg-config");
|
|
200
|
+
this.xdgCacheHome = path.join(this.qmdDir, "xdg-cache");
|
|
201
|
+
this.indexPath = path.join(this.xdgCacheHome, "qmd", "index.sqlite");
|
|
202
|
+
this.env = {
|
|
203
|
+
...process.env,
|
|
204
|
+
XDG_CONFIG_HOME: this.xdgConfigHome,
|
|
205
|
+
XDG_CACHE_HOME: this.xdgCacheHome,
|
|
206
|
+
NO_COLOR: "1"
|
|
207
|
+
};
|
|
208
|
+
this.sessionExporter = this.qmd.sessions.enabled ? {
|
|
209
|
+
dir: this.qmd.sessions.exportDir ?? path.join(this.qmdDir, "sessions"),
|
|
210
|
+
retentionMs: this.qmd.sessions.retentionDays ? this.qmd.sessions.retentionDays * 24 * 60 * 60 * 1e3 : void 0,
|
|
211
|
+
collectionName: this.pickSessionCollectionName()
|
|
212
|
+
} : null;
|
|
213
|
+
if (this.sessionExporter) this.qmd.collections = [...this.qmd.collections, {
|
|
214
|
+
name: this.sessionExporter.collectionName,
|
|
215
|
+
path: this.sessionExporter.dir,
|
|
216
|
+
pattern: "**/*.md",
|
|
217
|
+
kind: "sessions"
|
|
218
|
+
}];
|
|
219
|
+
}
|
|
220
|
+
async initialize(mode) {
|
|
221
|
+
this.bootstrapCollections();
|
|
222
|
+
if (mode === "status") return;
|
|
223
|
+
await fs.mkdir(this.xdgConfigHome, { recursive: true });
|
|
224
|
+
await fs.mkdir(this.xdgCacheHome, { recursive: true });
|
|
225
|
+
await fs.mkdir(path.dirname(this.indexPath), { recursive: true });
|
|
226
|
+
await this.symlinkSharedModels();
|
|
227
|
+
await this.ensureCollections();
|
|
228
|
+
if (this.qmd.update.onBoot) {
|
|
229
|
+
const bootRun = this.runUpdate("boot", true);
|
|
230
|
+
if (this.qmd.update.waitForBootSync) await bootRun.catch((err) => {
|
|
231
|
+
log.warn(`qmd boot update failed: ${String(err)}`);
|
|
232
|
+
});
|
|
233
|
+
else bootRun.catch((err) => {
|
|
234
|
+
log.warn(`qmd boot update failed: ${String(err)}`);
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
if (this.qmd.update.intervalMs > 0) this.updateTimer = setInterval(() => {
|
|
238
|
+
this.runUpdate("interval").catch((err) => {
|
|
239
|
+
log.warn(`qmd update failed (${String(err)})`);
|
|
240
|
+
});
|
|
241
|
+
}, this.qmd.update.intervalMs);
|
|
242
|
+
}
|
|
243
|
+
bootstrapCollections() {
|
|
244
|
+
this.collectionRoots.clear();
|
|
245
|
+
this.sources.clear();
|
|
246
|
+
for (const collection of this.qmd.collections) {
|
|
247
|
+
const kind = collection.kind === "sessions" ? "sessions" : "memory";
|
|
248
|
+
this.collectionRoots.set(collection.name, {
|
|
249
|
+
path: collection.path,
|
|
250
|
+
kind
|
|
251
|
+
});
|
|
252
|
+
this.sources.add(kind);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
async ensureCollections() {
|
|
256
|
+
const existing = /* @__PURE__ */ new Set();
|
|
257
|
+
try {
|
|
258
|
+
const result = await this.runQmd([
|
|
259
|
+
"collection",
|
|
260
|
+
"list",
|
|
261
|
+
"--json"
|
|
262
|
+
], { timeoutMs: this.qmd.update.commandTimeoutMs });
|
|
263
|
+
const parsed = JSON.parse(result.stdout);
|
|
264
|
+
if (Array.isArray(parsed)) {
|
|
265
|
+
for (const entry of parsed) if (typeof entry === "string") existing.add(entry);
|
|
266
|
+
else if (entry && typeof entry === "object") {
|
|
267
|
+
const name = entry.name;
|
|
268
|
+
if (typeof name === "string") existing.add(name);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
} catch {}
|
|
272
|
+
for (const collection of this.qmd.collections) {
|
|
273
|
+
if (existing.has(collection.name)) continue;
|
|
274
|
+
try {
|
|
275
|
+
await this.addCollection(collection.path, collection.name, collection.pattern);
|
|
276
|
+
} catch (err) {
|
|
277
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
278
|
+
if (this.isCollectionAlreadyExistsError(message)) continue;
|
|
279
|
+
log.warn(`qmd collection add failed for ${collection.name}: ${message}`);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
isCollectionAlreadyExistsError(message) {
|
|
284
|
+
const lower = message.toLowerCase();
|
|
285
|
+
return lower.includes("already exists") || lower.includes("exists");
|
|
286
|
+
}
|
|
287
|
+
isCollectionMissingError(message) {
|
|
288
|
+
const lower = message.toLowerCase();
|
|
289
|
+
return lower.includes("not found") || lower.includes("does not exist") || lower.includes("missing");
|
|
290
|
+
}
|
|
291
|
+
async addCollection(pathArg, name, pattern) {
|
|
292
|
+
await this.runQmd([
|
|
293
|
+
"collection",
|
|
294
|
+
"add",
|
|
295
|
+
pathArg,
|
|
296
|
+
"--name",
|
|
297
|
+
name,
|
|
298
|
+
"--mask",
|
|
299
|
+
pattern
|
|
300
|
+
], { timeoutMs: this.qmd.update.commandTimeoutMs });
|
|
301
|
+
}
|
|
302
|
+
async removeCollection(name) {
|
|
303
|
+
await this.runQmd([
|
|
304
|
+
"collection",
|
|
305
|
+
"remove",
|
|
306
|
+
name
|
|
307
|
+
], { timeoutMs: this.qmd.update.commandTimeoutMs });
|
|
308
|
+
}
|
|
309
|
+
shouldRepairNullByteCollectionError(err) {
|
|
310
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
311
|
+
const lower = message.toLowerCase();
|
|
312
|
+
return (lower.includes("enotdir") || lower.includes("not a directory")) && NUL_MARKER_RE.test(message);
|
|
313
|
+
}
|
|
314
|
+
async tryRepairNullByteCollections(err, reason) {
|
|
315
|
+
if (this.attemptedNullByteCollectionRepair) return false;
|
|
316
|
+
if (!this.shouldRepairNullByteCollectionError(err)) return false;
|
|
317
|
+
this.attemptedNullByteCollectionRepair = true;
|
|
318
|
+
log.warn(`qmd update failed with suspected null-byte collection metadata (${reason}); rebuilding managed collections and retrying once`);
|
|
319
|
+
for (const collection of this.qmd.collections) {
|
|
320
|
+
try {
|
|
321
|
+
await this.removeCollection(collection.name);
|
|
322
|
+
} catch (removeErr) {
|
|
323
|
+
const removeMessage = removeErr instanceof Error ? removeErr.message : String(removeErr);
|
|
324
|
+
if (!this.isCollectionMissingError(removeMessage)) log.warn(`qmd collection remove failed for ${collection.name}: ${removeMessage}`);
|
|
325
|
+
}
|
|
326
|
+
try {
|
|
327
|
+
await this.addCollection(collection.path, collection.name, collection.pattern);
|
|
328
|
+
} catch (addErr) {
|
|
329
|
+
const addMessage = addErr instanceof Error ? addErr.message : String(addErr);
|
|
330
|
+
if (!this.isCollectionAlreadyExistsError(addMessage)) log.warn(`qmd collection add failed for ${collection.name}: ${addMessage}`);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return true;
|
|
334
|
+
}
|
|
335
|
+
async search(query, opts) {
|
|
336
|
+
if (!this.isScopeAllowed(opts?.sessionKey)) {
|
|
337
|
+
this.logScopeDenied(opts?.sessionKey);
|
|
338
|
+
return [];
|
|
339
|
+
}
|
|
340
|
+
const trimmed = query.trim();
|
|
341
|
+
if (!trimmed) return [];
|
|
342
|
+
await this.waitForPendingUpdateBeforeSearch();
|
|
343
|
+
const limit = Math.min(this.qmd.limits.maxResults, opts?.maxResults ?? this.qmd.limits.maxResults);
|
|
344
|
+
const collectionNames = this.listManagedCollectionNames();
|
|
345
|
+
if (collectionNames.length === 0) {
|
|
346
|
+
log.warn("qmd query skipped: no managed collections configured");
|
|
347
|
+
return [];
|
|
348
|
+
}
|
|
349
|
+
const qmdSearchCommand = this.qmd.searchMode;
|
|
350
|
+
let parsed;
|
|
351
|
+
try {
|
|
352
|
+
if (qmdSearchCommand === "query" && collectionNames.length > 1) parsed = await this.runQueryAcrossCollections(trimmed, limit, collectionNames);
|
|
353
|
+
else {
|
|
354
|
+
const args = this.buildSearchArgs(qmdSearchCommand, trimmed, limit);
|
|
355
|
+
args.push(...this.buildCollectionFilterArgs(collectionNames));
|
|
356
|
+
const result = await this.runQmd(args, { timeoutMs: this.qmd.limits.timeoutMs });
|
|
357
|
+
parsed = parseQmdQueryJson(result.stdout, result.stderr);
|
|
358
|
+
}
|
|
359
|
+
} catch (err) {
|
|
360
|
+
if (qmdSearchCommand !== "query" && this.isUnsupportedQmdOptionError(err)) {
|
|
361
|
+
log.warn(`qmd ${qmdSearchCommand} does not support configured flags; retrying search with qmd query`);
|
|
362
|
+
try {
|
|
363
|
+
if (collectionNames.length > 1) parsed = await this.runQueryAcrossCollections(trimmed, limit, collectionNames);
|
|
364
|
+
else {
|
|
365
|
+
const fallbackArgs = this.buildSearchArgs("query", trimmed, limit);
|
|
366
|
+
fallbackArgs.push(...this.buildCollectionFilterArgs(collectionNames));
|
|
367
|
+
const fallback = await this.runQmd(fallbackArgs, { timeoutMs: this.qmd.limits.timeoutMs });
|
|
368
|
+
parsed = parseQmdQueryJson(fallback.stdout, fallback.stderr);
|
|
369
|
+
}
|
|
370
|
+
} catch (fallbackErr) {
|
|
371
|
+
log.warn(`qmd query fallback failed: ${String(fallbackErr)}`);
|
|
372
|
+
throw fallbackErr instanceof Error ? fallbackErr : new Error(String(fallbackErr));
|
|
373
|
+
}
|
|
374
|
+
} else {
|
|
375
|
+
log.warn(`qmd ${qmdSearchCommand} failed: ${String(err)}`);
|
|
376
|
+
throw err instanceof Error ? err : new Error(String(err));
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
const results = [];
|
|
380
|
+
for (const entry of parsed) {
|
|
381
|
+
const doc = await this.resolveDocLocation(entry.docid);
|
|
382
|
+
if (!doc) continue;
|
|
383
|
+
const snippet = entry.snippet?.slice(0, this.qmd.limits.maxSnippetChars) ?? "";
|
|
384
|
+
const lines = this.extractSnippetLines(snippet);
|
|
385
|
+
const score = typeof entry.score === "number" ? entry.score : 0;
|
|
386
|
+
if (score < (opts?.minScore ?? 0)) continue;
|
|
387
|
+
results.push({
|
|
388
|
+
path: doc.rel,
|
|
389
|
+
startLine: lines.startLine,
|
|
390
|
+
endLine: lines.endLine,
|
|
391
|
+
score,
|
|
392
|
+
snippet,
|
|
393
|
+
source: doc.source
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
return this.clampResultsByInjectedChars(results.slice(0, limit));
|
|
397
|
+
}
|
|
398
|
+
async sync(params) {
|
|
399
|
+
if (params?.progress) params.progress({
|
|
400
|
+
completed: 0,
|
|
401
|
+
total: 1,
|
|
402
|
+
label: "Updating QMD index…"
|
|
403
|
+
});
|
|
404
|
+
await this.runUpdate(params?.reason ?? "manual", params?.force);
|
|
405
|
+
if (params?.progress) params.progress({
|
|
406
|
+
completed: 1,
|
|
407
|
+
total: 1,
|
|
408
|
+
label: "QMD index updated"
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
async readFile(params) {
|
|
412
|
+
const relPath = params.relPath?.trim();
|
|
413
|
+
if (!relPath) throw new Error("path required");
|
|
414
|
+
const absPath = this.resolveReadPath(relPath);
|
|
415
|
+
if (!absPath.endsWith(".md")) throw new Error("path required");
|
|
416
|
+
const stat = await fs.lstat(absPath);
|
|
417
|
+
if (stat.isSymbolicLink() || !stat.isFile()) throw new Error("path required");
|
|
418
|
+
if (params.from !== void 0 || params.lines !== void 0) return {
|
|
419
|
+
text: await this.readPartialText(absPath, params.from, params.lines),
|
|
420
|
+
path: relPath
|
|
421
|
+
};
|
|
422
|
+
const content = await fs.readFile(absPath, "utf-8");
|
|
423
|
+
if (!params.from && !params.lines) return {
|
|
424
|
+
text: content,
|
|
425
|
+
path: relPath
|
|
426
|
+
};
|
|
427
|
+
const lines = content.split("\n");
|
|
428
|
+
const start = Math.max(1, params.from ?? 1);
|
|
429
|
+
const count = Math.max(1, params.lines ?? lines.length);
|
|
430
|
+
return {
|
|
431
|
+
text: lines.slice(start - 1, start - 1 + count).join("\n"),
|
|
432
|
+
path: relPath
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
status() {
|
|
436
|
+
const counts = this.readCounts();
|
|
437
|
+
return {
|
|
438
|
+
backend: "qmd",
|
|
439
|
+
provider: "qmd",
|
|
440
|
+
model: "qmd",
|
|
441
|
+
requestedProvider: "qmd",
|
|
442
|
+
files: counts.totalDocuments,
|
|
443
|
+
chunks: counts.totalDocuments,
|
|
444
|
+
dirty: false,
|
|
445
|
+
workspaceDir: this.workspaceDir,
|
|
446
|
+
dbPath: this.indexPath,
|
|
447
|
+
sources: Array.from(this.sources),
|
|
448
|
+
sourceCounts: counts.sourceCounts,
|
|
449
|
+
vector: {
|
|
450
|
+
enabled: true,
|
|
451
|
+
available: true
|
|
452
|
+
},
|
|
453
|
+
batch: {
|
|
454
|
+
enabled: false,
|
|
455
|
+
failures: 0,
|
|
456
|
+
limit: 0,
|
|
457
|
+
wait: false,
|
|
458
|
+
concurrency: 0,
|
|
459
|
+
pollIntervalMs: 0,
|
|
460
|
+
timeoutMs: 0
|
|
461
|
+
},
|
|
462
|
+
custom: { qmd: {
|
|
463
|
+
collections: this.qmd.collections.length,
|
|
464
|
+
lastUpdateAt: this.lastUpdateAt
|
|
465
|
+
} }
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
async probeEmbeddingAvailability() {
|
|
469
|
+
return { ok: true };
|
|
470
|
+
}
|
|
471
|
+
async probeVectorAvailability() {
|
|
472
|
+
return true;
|
|
473
|
+
}
|
|
474
|
+
async close() {
|
|
475
|
+
if (this.closed) return;
|
|
476
|
+
this.closed = true;
|
|
477
|
+
if (this.updateTimer) {
|
|
478
|
+
clearInterval(this.updateTimer);
|
|
479
|
+
this.updateTimer = null;
|
|
480
|
+
}
|
|
481
|
+
this.queuedForcedRuns = 0;
|
|
482
|
+
await this.pendingUpdate?.catch(() => void 0);
|
|
483
|
+
await this.queuedForcedUpdate?.catch(() => void 0);
|
|
484
|
+
if (this.db) {
|
|
485
|
+
this.db.close();
|
|
486
|
+
this.db = null;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
async runUpdate(reason, force, opts) {
|
|
490
|
+
if (this.closed) return;
|
|
491
|
+
if (this.pendingUpdate) {
|
|
492
|
+
if (force) return this.enqueueForcedUpdate(reason);
|
|
493
|
+
return this.pendingUpdate;
|
|
494
|
+
}
|
|
495
|
+
if (this.queuedForcedUpdate && !opts?.fromForcedQueue) {
|
|
496
|
+
if (force) return this.enqueueForcedUpdate(reason);
|
|
497
|
+
return this.queuedForcedUpdate;
|
|
498
|
+
}
|
|
499
|
+
if (this.shouldSkipUpdate(force)) return;
|
|
500
|
+
const run = async () => {
|
|
501
|
+
if (this.sessionExporter) await this.exportSessions();
|
|
502
|
+
try {
|
|
503
|
+
await this.runQmd(["update"], { timeoutMs: this.qmd.update.updateTimeoutMs });
|
|
504
|
+
} catch (err) {
|
|
505
|
+
if (!await this.tryRepairNullByteCollections(err, reason)) throw err;
|
|
506
|
+
await this.runQmd(["update"], { timeoutMs: this.qmd.update.updateTimeoutMs });
|
|
507
|
+
}
|
|
508
|
+
const embedIntervalMs = this.qmd.update.embedIntervalMs;
|
|
509
|
+
if (Boolean(force) || this.lastEmbedAt === null || embedIntervalMs > 0 && Date.now() - this.lastEmbedAt > embedIntervalMs) try {
|
|
510
|
+
await this.runQmd(["embed"], { timeoutMs: this.qmd.update.embedTimeoutMs });
|
|
511
|
+
this.lastEmbedAt = Date.now();
|
|
512
|
+
} catch (err) {
|
|
513
|
+
log.warn(`qmd embed failed (${reason}): ${String(err)}`);
|
|
514
|
+
}
|
|
515
|
+
this.lastUpdateAt = Date.now();
|
|
516
|
+
this.docPathCache.clear();
|
|
517
|
+
};
|
|
518
|
+
this.pendingUpdate = run().finally(() => {
|
|
519
|
+
this.pendingUpdate = null;
|
|
520
|
+
});
|
|
521
|
+
await this.pendingUpdate;
|
|
522
|
+
}
|
|
523
|
+
enqueueForcedUpdate(reason) {
|
|
524
|
+
this.queuedForcedRuns += 1;
|
|
525
|
+
if (!this.queuedForcedUpdate) this.queuedForcedUpdate = this.drainForcedUpdates(reason).finally(() => {
|
|
526
|
+
this.queuedForcedUpdate = null;
|
|
527
|
+
});
|
|
528
|
+
return this.queuedForcedUpdate;
|
|
529
|
+
}
|
|
530
|
+
async drainForcedUpdates(reason) {
|
|
531
|
+
await this.pendingUpdate?.catch(() => void 0);
|
|
532
|
+
while (!this.closed && this.queuedForcedRuns > 0) {
|
|
533
|
+
this.queuedForcedRuns -= 1;
|
|
534
|
+
await this.runUpdate(`${reason}:queued`, true, { fromForcedQueue: true });
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Symlink the default QMD models directory into our custom XDG_CACHE_HOME so
|
|
539
|
+
* that the pre-installed ML models (~/.cache/qmd/models/) are reused rather
|
|
540
|
+
* than re-downloaded for every agent. If the default models directory does
|
|
541
|
+
* not exist, or a models directory/symlink already exists in the target, this
|
|
542
|
+
* is a no-op.
|
|
543
|
+
*/
|
|
544
|
+
async symlinkSharedModels() {
|
|
545
|
+
const defaultCacheHome = process.env.XDG_CACHE_HOME || (process.platform === "win32" ? process.env.LOCALAPPDATA : void 0) || path.join(os.homedir(), ".cache");
|
|
546
|
+
const defaultModelsDir = path.join(defaultCacheHome, "qmd", "models");
|
|
547
|
+
const targetModelsDir = path.join(this.xdgCacheHome, "qmd", "models");
|
|
548
|
+
try {
|
|
549
|
+
if (!(await fs.stat(defaultModelsDir).catch((err) => {
|
|
550
|
+
if (err.code === "ENOENT") return null;
|
|
551
|
+
throw err;
|
|
552
|
+
}))?.isDirectory()) return;
|
|
553
|
+
try {
|
|
554
|
+
await fs.lstat(targetModelsDir);
|
|
555
|
+
return;
|
|
556
|
+
} catch {}
|
|
557
|
+
try {
|
|
558
|
+
await fs.symlink(defaultModelsDir, targetModelsDir, "dir");
|
|
559
|
+
} catch (symlinkErr) {
|
|
560
|
+
const code = symlinkErr.code;
|
|
561
|
+
if (process.platform === "win32" && (code === "EPERM" || code === "ENOTSUP")) await fs.symlink(defaultModelsDir, targetModelsDir, "junction");
|
|
562
|
+
else throw symlinkErr;
|
|
563
|
+
}
|
|
564
|
+
log.debug(`symlinked qmd models: ${defaultModelsDir} → ${targetModelsDir}`);
|
|
565
|
+
} catch (err) {
|
|
566
|
+
log.warn(`failed to symlink qmd models directory: ${String(err)}`);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
async runQmd(args, opts) {
|
|
570
|
+
return await new Promise((resolve, reject) => {
|
|
571
|
+
const child = spawn(this.qmd.command, args, {
|
|
572
|
+
env: this.env,
|
|
573
|
+
cwd: this.workspaceDir
|
|
574
|
+
});
|
|
575
|
+
let stdout = "";
|
|
576
|
+
let stderr = "";
|
|
577
|
+
let stdoutTruncated = false;
|
|
578
|
+
let stderrTruncated = false;
|
|
579
|
+
const timer = opts?.timeoutMs ? setTimeout(() => {
|
|
580
|
+
child.kill("SIGKILL");
|
|
581
|
+
reject(/* @__PURE__ */ new Error(`qmd ${args.join(" ")} timed out after ${opts.timeoutMs}ms`));
|
|
582
|
+
}, opts.timeoutMs) : null;
|
|
583
|
+
child.stdout.on("data", (data) => {
|
|
584
|
+
const next = appendOutputWithCap(stdout, data.toString("utf8"), this.maxQmdOutputChars);
|
|
585
|
+
stdout = next.text;
|
|
586
|
+
stdoutTruncated = stdoutTruncated || next.truncated;
|
|
587
|
+
});
|
|
588
|
+
child.stderr.on("data", (data) => {
|
|
589
|
+
const next = appendOutputWithCap(stderr, data.toString("utf8"), this.maxQmdOutputChars);
|
|
590
|
+
stderr = next.text;
|
|
591
|
+
stderrTruncated = stderrTruncated || next.truncated;
|
|
592
|
+
});
|
|
593
|
+
child.on("error", (err) => {
|
|
594
|
+
if (timer) clearTimeout(timer);
|
|
595
|
+
reject(err);
|
|
596
|
+
});
|
|
597
|
+
child.on("close", (code) => {
|
|
598
|
+
if (timer) clearTimeout(timer);
|
|
599
|
+
if (stdoutTruncated || stderrTruncated) {
|
|
600
|
+
reject(/* @__PURE__ */ new Error(`qmd ${args.join(" ")} produced too much output (limit ${this.maxQmdOutputChars} chars)`));
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
if (code === 0) resolve({
|
|
604
|
+
stdout,
|
|
605
|
+
stderr
|
|
606
|
+
});
|
|
607
|
+
else reject(/* @__PURE__ */ new Error(`qmd ${args.join(" ")} failed (code ${code}): ${stderr || stdout}`));
|
|
608
|
+
});
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
async readPartialText(absPath, from, lines) {
|
|
612
|
+
const start = Math.max(1, from ?? 1);
|
|
613
|
+
const count = Math.max(1, lines ?? Number.POSITIVE_INFINITY);
|
|
614
|
+
const handle = await fs.open(absPath);
|
|
615
|
+
const stream = handle.createReadStream({ encoding: "utf-8" });
|
|
616
|
+
const rl = readline.createInterface({
|
|
617
|
+
input: stream,
|
|
618
|
+
crlfDelay: Infinity
|
|
619
|
+
});
|
|
620
|
+
const selected = [];
|
|
621
|
+
let index = 0;
|
|
622
|
+
try {
|
|
623
|
+
for await (const line of rl) {
|
|
624
|
+
index += 1;
|
|
625
|
+
if (index < start) continue;
|
|
626
|
+
if (selected.length >= count) break;
|
|
627
|
+
selected.push(line);
|
|
628
|
+
}
|
|
629
|
+
} finally {
|
|
630
|
+
rl.close();
|
|
631
|
+
await handle.close();
|
|
632
|
+
}
|
|
633
|
+
return selected.slice(0, count).join("\n");
|
|
634
|
+
}
|
|
635
|
+
ensureDb() {
|
|
636
|
+
if (this.db) return this.db;
|
|
637
|
+
const { DatabaseSync } = requireNodeSqlite();
|
|
638
|
+
this.db = new DatabaseSync(this.indexPath, { readOnly: true });
|
|
639
|
+
this.db.exec("PRAGMA busy_timeout = 1");
|
|
640
|
+
return this.db;
|
|
641
|
+
}
|
|
642
|
+
async exportSessions() {
|
|
643
|
+
if (!this.sessionExporter) return;
|
|
644
|
+
const exportDir = this.sessionExporter.dir;
|
|
645
|
+
await fs.mkdir(exportDir, { recursive: true });
|
|
646
|
+
const files = await listSessionFilesForAgent(this.agentId);
|
|
647
|
+
const keep = /* @__PURE__ */ new Set();
|
|
648
|
+
const tracked = /* @__PURE__ */ new Set();
|
|
649
|
+
const cutoff = this.sessionExporter.retentionMs ? Date.now() - this.sessionExporter.retentionMs : null;
|
|
650
|
+
for (const sessionFile of files) {
|
|
651
|
+
const entry = await buildSessionEntry(sessionFile);
|
|
652
|
+
if (!entry) continue;
|
|
653
|
+
if (cutoff && entry.mtimeMs < cutoff) continue;
|
|
654
|
+
const target = path.join(exportDir, `${path.basename(sessionFile, ".jsonl")}.md`);
|
|
655
|
+
tracked.add(sessionFile);
|
|
656
|
+
const state = this.exportedSessionState.get(sessionFile);
|
|
657
|
+
if (!state || state.hash !== entry.hash || state.mtimeMs !== entry.mtimeMs) await fs.writeFile(target, this.renderSessionMarkdown(entry), "utf-8");
|
|
658
|
+
this.exportedSessionState.set(sessionFile, {
|
|
659
|
+
hash: entry.hash,
|
|
660
|
+
mtimeMs: entry.mtimeMs,
|
|
661
|
+
target
|
|
662
|
+
});
|
|
663
|
+
keep.add(target);
|
|
664
|
+
}
|
|
665
|
+
const exported = await fs.readdir(exportDir).catch(() => []);
|
|
666
|
+
for (const name of exported) {
|
|
667
|
+
if (!name.endsWith(".md")) continue;
|
|
668
|
+
const full = path.join(exportDir, name);
|
|
669
|
+
if (!keep.has(full)) await fs.rm(full, { force: true });
|
|
670
|
+
}
|
|
671
|
+
for (const [sessionFile, state] of this.exportedSessionState) if (!tracked.has(sessionFile) || !state.target.startsWith(exportDir + path.sep)) this.exportedSessionState.delete(sessionFile);
|
|
672
|
+
}
|
|
673
|
+
renderSessionMarkdown(entry) {
|
|
674
|
+
return `${`# Session ${path.basename(entry.absPath, path.extname(entry.absPath))}`}\n\n${entry.content?.trim().length ? entry.content.trim() : "(empty)"}\n`;
|
|
675
|
+
}
|
|
676
|
+
pickSessionCollectionName() {
|
|
677
|
+
const existing = new Set(this.qmd.collections.map((collection) => collection.name));
|
|
678
|
+
if (!existing.has("sessions")) return "sessions";
|
|
679
|
+
let counter = 2;
|
|
680
|
+
let candidate = `sessions-${counter}`;
|
|
681
|
+
while (existing.has(candidate)) {
|
|
682
|
+
counter += 1;
|
|
683
|
+
candidate = `sessions-${counter}`;
|
|
684
|
+
}
|
|
685
|
+
return candidate;
|
|
686
|
+
}
|
|
687
|
+
async resolveDocLocation(docid) {
|
|
688
|
+
if (!docid) return null;
|
|
689
|
+
const normalized = docid.startsWith("#") ? docid.slice(1) : docid;
|
|
690
|
+
if (!normalized) return null;
|
|
691
|
+
const cached = this.docPathCache.get(normalized);
|
|
692
|
+
if (cached) return cached;
|
|
693
|
+
const db = this.ensureDb();
|
|
694
|
+
let row;
|
|
695
|
+
try {
|
|
696
|
+
row = db.prepare("SELECT collection, path FROM documents WHERE hash = ? AND active = 1 LIMIT 1").get(normalized);
|
|
697
|
+
if (!row) row = db.prepare("SELECT collection, path FROM documents WHERE hash LIKE ? AND active = 1 LIMIT 1").get(`${normalized}%`);
|
|
698
|
+
} catch (err) {
|
|
699
|
+
if (this.isSqliteBusyError(err)) {
|
|
700
|
+
log.debug(`qmd index is busy while resolving doc path: ${String(err)}`);
|
|
701
|
+
throw this.createQmdBusyError(err);
|
|
702
|
+
}
|
|
703
|
+
throw err;
|
|
704
|
+
}
|
|
705
|
+
if (!row) return null;
|
|
706
|
+
const location = this.toDocLocation(row.collection, row.path);
|
|
707
|
+
if (!location) return null;
|
|
708
|
+
this.docPathCache.set(normalized, location);
|
|
709
|
+
return location;
|
|
710
|
+
}
|
|
711
|
+
extractSnippetLines(snippet) {
|
|
712
|
+
const match = SNIPPET_HEADER_RE.exec(snippet);
|
|
713
|
+
if (match) {
|
|
714
|
+
const start = Number(match[1]);
|
|
715
|
+
const count = Number(match[2]);
|
|
716
|
+
if (Number.isFinite(start) && Number.isFinite(count)) return {
|
|
717
|
+
startLine: start,
|
|
718
|
+
endLine: start + count - 1
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
return {
|
|
722
|
+
startLine: 1,
|
|
723
|
+
endLine: snippet.split("\n").length
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
readCounts() {
|
|
727
|
+
try {
|
|
728
|
+
const rows = this.ensureDb().prepare("SELECT collection, COUNT(*) as c FROM documents WHERE active = 1 GROUP BY collection").all();
|
|
729
|
+
const bySource = /* @__PURE__ */ new Map();
|
|
730
|
+
for (const source of this.sources) bySource.set(source, {
|
|
731
|
+
files: 0,
|
|
732
|
+
chunks: 0
|
|
733
|
+
});
|
|
734
|
+
let total = 0;
|
|
735
|
+
for (const row of rows) {
|
|
736
|
+
const source = this.collectionRoots.get(row.collection)?.kind ?? "memory";
|
|
737
|
+
const entry = bySource.get(source) ?? {
|
|
738
|
+
files: 0,
|
|
739
|
+
chunks: 0
|
|
740
|
+
};
|
|
741
|
+
entry.files += row.c ?? 0;
|
|
742
|
+
entry.chunks += row.c ?? 0;
|
|
743
|
+
bySource.set(source, entry);
|
|
744
|
+
total += row.c ?? 0;
|
|
745
|
+
}
|
|
746
|
+
return {
|
|
747
|
+
totalDocuments: total,
|
|
748
|
+
sourceCounts: Array.from(bySource.entries()).map(([source, value]) => ({
|
|
749
|
+
source,
|
|
750
|
+
files: value.files,
|
|
751
|
+
chunks: value.chunks
|
|
752
|
+
}))
|
|
753
|
+
};
|
|
754
|
+
} catch (err) {
|
|
755
|
+
log.warn(`failed to read qmd index stats: ${String(err)}`);
|
|
756
|
+
return {
|
|
757
|
+
totalDocuments: 0,
|
|
758
|
+
sourceCounts: Array.from(this.sources).map((source) => ({
|
|
759
|
+
source,
|
|
760
|
+
files: 0,
|
|
761
|
+
chunks: 0
|
|
762
|
+
}))
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
logScopeDenied(sessionKey) {
|
|
767
|
+
const channel = deriveQmdScopeChannel(sessionKey) ?? "unknown";
|
|
768
|
+
const chatType = deriveQmdScopeChatType(sessionKey) ?? "unknown";
|
|
769
|
+
const key = sessionKey?.trim() || "<none>";
|
|
770
|
+
log.warn(`qmd search denied by scope (channel=${channel}, chatType=${chatType}, session=${key})`);
|
|
771
|
+
}
|
|
772
|
+
isScopeAllowed(sessionKey) {
|
|
773
|
+
return isQmdScopeAllowed(this.qmd.scope, sessionKey);
|
|
774
|
+
}
|
|
775
|
+
toDocLocation(collection, collectionRelativePath) {
|
|
776
|
+
const root = this.collectionRoots.get(collection);
|
|
777
|
+
if (!root) return null;
|
|
778
|
+
const normalizedRelative = collectionRelativePath.replace(/\\/g, "/");
|
|
779
|
+
const absPath = path.normalize(path.resolve(root.path, collectionRelativePath));
|
|
780
|
+
const relativeToWorkspace = path.relative(this.workspaceDir, absPath);
|
|
781
|
+
return {
|
|
782
|
+
rel: this.buildSearchPath(collection, normalizedRelative, relativeToWorkspace, absPath),
|
|
783
|
+
abs: absPath,
|
|
784
|
+
source: root.kind
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
buildSearchPath(collection, collectionRelativePath, relativeToWorkspace, absPath) {
|
|
788
|
+
if (this.isInsideWorkspace(relativeToWorkspace)) {
|
|
789
|
+
const normalized = relativeToWorkspace.replace(/\\/g, "/");
|
|
790
|
+
if (!normalized) return path.basename(absPath);
|
|
791
|
+
return normalized;
|
|
792
|
+
}
|
|
793
|
+
return `qmd/${collection}/${collectionRelativePath.replace(/^\/+/, "")}`;
|
|
794
|
+
}
|
|
795
|
+
isInsideWorkspace(relativePath) {
|
|
796
|
+
if (!relativePath) return true;
|
|
797
|
+
if (relativePath.startsWith("..")) return false;
|
|
798
|
+
if (relativePath.startsWith(`..${path.sep}`)) return false;
|
|
799
|
+
return !path.isAbsolute(relativePath);
|
|
800
|
+
}
|
|
801
|
+
resolveReadPath(relPath) {
|
|
802
|
+
if (relPath.startsWith("qmd/")) {
|
|
803
|
+
const [, collection, ...rest] = relPath.split("/");
|
|
804
|
+
if (!collection || rest.length === 0) throw new Error("invalid qmd path");
|
|
805
|
+
const root = this.collectionRoots.get(collection);
|
|
806
|
+
if (!root) throw new Error(`unknown qmd collection: ${collection}`);
|
|
807
|
+
const joined = rest.join("/");
|
|
808
|
+
const resolved = path.resolve(root.path, joined);
|
|
809
|
+
if (!this.isWithinRoot(root.path, resolved)) throw new Error("qmd path escapes collection");
|
|
810
|
+
return resolved;
|
|
811
|
+
}
|
|
812
|
+
const absPath = path.resolve(this.workspaceDir, relPath);
|
|
813
|
+
if (!this.isWithinWorkspace(absPath)) throw new Error("path escapes workspace");
|
|
814
|
+
return absPath;
|
|
815
|
+
}
|
|
816
|
+
isWithinWorkspace(absPath) {
|
|
817
|
+
const normalizedWorkspace = this.workspaceDir.endsWith(path.sep) ? this.workspaceDir : `${this.workspaceDir}${path.sep}`;
|
|
818
|
+
if (absPath === this.workspaceDir) return true;
|
|
819
|
+
return (absPath.endsWith(path.sep) ? absPath : `${absPath}${path.sep}`).startsWith(normalizedWorkspace);
|
|
820
|
+
}
|
|
821
|
+
isWithinRoot(root, candidate) {
|
|
822
|
+
const normalizedRoot = root.endsWith(path.sep) ? root : `${root}${path.sep}`;
|
|
823
|
+
if (candidate === root) return true;
|
|
824
|
+
return (candidate.endsWith(path.sep) ? candidate : `${candidate}${path.sep}`).startsWith(normalizedRoot);
|
|
825
|
+
}
|
|
826
|
+
clampResultsByInjectedChars(results) {
|
|
827
|
+
const budget = this.qmd.limits.maxInjectedChars;
|
|
828
|
+
if (!budget || budget <= 0) return results;
|
|
829
|
+
let remaining = budget;
|
|
830
|
+
const clamped = [];
|
|
831
|
+
for (const entry of results) {
|
|
832
|
+
if (remaining <= 0) break;
|
|
833
|
+
const snippet = entry.snippet ?? "";
|
|
834
|
+
if (snippet.length <= remaining) {
|
|
835
|
+
clamped.push(entry);
|
|
836
|
+
remaining -= snippet.length;
|
|
837
|
+
} else {
|
|
838
|
+
const trimmed = snippet.slice(0, Math.max(0, remaining));
|
|
839
|
+
clamped.push({
|
|
840
|
+
...entry,
|
|
841
|
+
snippet: trimmed
|
|
842
|
+
});
|
|
843
|
+
break;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
return clamped;
|
|
847
|
+
}
|
|
848
|
+
shouldSkipUpdate(force) {
|
|
849
|
+
if (force) return false;
|
|
850
|
+
const debounceMs = this.qmd.update.debounceMs;
|
|
851
|
+
if (debounceMs <= 0) return false;
|
|
852
|
+
if (!this.lastUpdateAt) return false;
|
|
853
|
+
return Date.now() - this.lastUpdateAt < debounceMs;
|
|
854
|
+
}
|
|
855
|
+
isSqliteBusyError(err) {
|
|
856
|
+
const normalized = (err instanceof Error ? err.message : String(err)).toLowerCase();
|
|
857
|
+
return normalized.includes("sqlite_busy") || normalized.includes("database is locked");
|
|
858
|
+
}
|
|
859
|
+
isUnsupportedQmdOptionError(err) {
|
|
860
|
+
const normalized = (err instanceof Error ? err.message : String(err)).toLowerCase();
|
|
861
|
+
return normalized.includes("unknown flag") || normalized.includes("unknown option") || normalized.includes("unrecognized option") || normalized.includes("flag provided but not defined") || normalized.includes("unexpected argument");
|
|
862
|
+
}
|
|
863
|
+
createQmdBusyError(err) {
|
|
864
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
865
|
+
return /* @__PURE__ */ new Error(`qmd index busy while reading results: ${message}`);
|
|
866
|
+
}
|
|
867
|
+
async waitForPendingUpdateBeforeSearch() {
|
|
868
|
+
const pending = this.pendingUpdate;
|
|
869
|
+
if (!pending) return;
|
|
870
|
+
await Promise.race([pending.catch(() => void 0), new Promise((resolve) => setTimeout(resolve, SEARCH_PENDING_UPDATE_WAIT_MS))]);
|
|
871
|
+
}
|
|
872
|
+
async runQueryAcrossCollections(query, limit, collectionNames) {
|
|
873
|
+
log.debug(`qmd query multi-collection workaround active (${collectionNames.length} collections)`);
|
|
874
|
+
const bestByDocId = /* @__PURE__ */ new Map();
|
|
875
|
+
for (const collectionName of collectionNames) {
|
|
876
|
+
const args = this.buildSearchArgs("query", query, limit);
|
|
877
|
+
args.push("-c", collectionName);
|
|
878
|
+
const result = await this.runQmd(args, { timeoutMs: this.qmd.limits.timeoutMs });
|
|
879
|
+
const parsed = parseQmdQueryJson(result.stdout, result.stderr);
|
|
880
|
+
for (const entry of parsed) {
|
|
881
|
+
if (typeof entry.docid !== "string" || !entry.docid.trim()) continue;
|
|
882
|
+
const prev = bestByDocId.get(entry.docid);
|
|
883
|
+
const prevScore = typeof prev?.score === "number" ? prev.score : Number.NEGATIVE_INFINITY;
|
|
884
|
+
const nextScore = typeof entry.score === "number" ? entry.score : Number.NEGATIVE_INFINITY;
|
|
885
|
+
if (!prev || nextScore > prevScore) bestByDocId.set(entry.docid, entry);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
return [...bestByDocId.values()].toSorted((a, b) => (b.score ?? 0) - (a.score ?? 0));
|
|
889
|
+
}
|
|
890
|
+
listManagedCollectionNames() {
|
|
891
|
+
const seen = /* @__PURE__ */ new Set();
|
|
892
|
+
const names = [];
|
|
893
|
+
for (const collection of this.qmd.collections) {
|
|
894
|
+
const name = collection.name?.trim();
|
|
895
|
+
if (!name || seen.has(name)) continue;
|
|
896
|
+
seen.add(name);
|
|
897
|
+
names.push(name);
|
|
898
|
+
}
|
|
899
|
+
return names;
|
|
900
|
+
}
|
|
901
|
+
buildCollectionFilterArgs(collectionNames) {
|
|
902
|
+
if (collectionNames.length === 0) return [];
|
|
903
|
+
return collectionNames.filter(Boolean).flatMap((name) => ["-c", name]);
|
|
904
|
+
}
|
|
905
|
+
buildSearchArgs(command, query, limit) {
|
|
906
|
+
if (command === "query") return [
|
|
907
|
+
"query",
|
|
908
|
+
query,
|
|
909
|
+
"--json",
|
|
910
|
+
"-n",
|
|
911
|
+
String(limit)
|
|
912
|
+
];
|
|
913
|
+
return [
|
|
914
|
+
command,
|
|
915
|
+
query,
|
|
916
|
+
"--json",
|
|
917
|
+
"-n",
|
|
918
|
+
String(limit)
|
|
919
|
+
];
|
|
920
|
+
}
|
|
921
|
+
};
|
|
922
|
+
function appendOutputWithCap(current, chunk, maxChars) {
|
|
923
|
+
const appended = current + chunk;
|
|
924
|
+
if (appended.length <= maxChars) return {
|
|
925
|
+
text: appended,
|
|
926
|
+
truncated: false
|
|
927
|
+
};
|
|
928
|
+
return {
|
|
929
|
+
text: appended.slice(-maxChars),
|
|
930
|
+
truncated: true
|
|
931
|
+
};
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
//#endregion
|
|
935
|
+
export { QmdMemoryManager };
|