@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
package/dist/status-BgoeFm6g.js
DELETED
|
@@ -1,2137 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { M as theme, j as isRich, q as resolveGatewayPort, x as info } from "./entry.js";
|
|
3
|
-
import { Dt as DEFAULT_PROVIDER, Et as DEFAULT_MODEL, F as resolveConfiguredModelRef, Tt as DEFAULT_CONTEXT_TOKENS } from "./auth-profiles-DxI8L7bs.js";
|
|
4
|
-
import { t as formatCliCommand } from "./command-format-Clp46jkj.js";
|
|
5
|
-
import { x as parseAgentSessionKey } from "./session-key-BGiG_JcT.js";
|
|
6
|
-
import { n as runExec } from "./exec-BizYYQgP.js";
|
|
7
|
-
import { t as resolveAnimaPackageRoot } from "./openclaw-root-C85WMnVV.js";
|
|
8
|
-
import { s as resolveAgentWorkspaceDir } from "./agent-scope-OZi7lb8S.js";
|
|
9
|
-
import { t as buildWorkspaceSkillStatus } from "./skills-status-JQluhU-P.js";
|
|
10
|
-
import { M as VERSION, i as loadConfig, o as readConfigFileSnapshot } from "./config-C8rUDJXY.js";
|
|
11
|
-
import { n as callGateway, t as buildGatewayConnectionDetails } from "./call-BAHvlu2G.js";
|
|
12
|
-
import { S as resolveMainSessionKey, i as loadSessionStore, v as resolveFreshSessionTotalTokens } from "./sessions-DcXpzig0.js";
|
|
13
|
-
import { Ct as buildChannelAccountSnapshot, M as summarizeRestartSentinel, St as buildChannelSummary, c as loadProviderUsageSummary, j as readRestartSentinel, l as formatUsageReportLines, wt as formatChannelAllowFrom } from "./reply-mlsExaZm.js";
|
|
14
|
-
import { n as listChannelPlugins } from "./plugins-CDJw924T.js";
|
|
15
|
-
import { c as resolveStorePath } from "./paths-CxRf2rBG.js";
|
|
16
|
-
import { m as readTailscaleStatusJson, p as getTailnetHostname } from "./auth-lZ26wsbN.js";
|
|
17
|
-
import { i as formatPortDiagnostics, n as inspectPortUsage } from "./ports-CqLSlU6Z.js";
|
|
18
|
-
import { c as listAgentsForGateway, i as sha256HexPrefix, mt as getRemoteSkillEligibility, qt as peekSystemEvents } from "./cli-session-Dd8DKb5a.js";
|
|
19
|
-
import { t as lookupContextTokens } from "./context-D5iEFzv9.js";
|
|
20
|
-
import { r as formatDurationPrecise } from "./format-duration-DhWzz_5b.js";
|
|
21
|
-
import { n as formatTimeAgo } from "./format-relative-C6kUHuOj.js";
|
|
22
|
-
import { r as getMemorySearchManager } from "./memory-cli-BKocCWXM.js";
|
|
23
|
-
import { n as withProgress } from "./progress-CbZ2D53A.js";
|
|
24
|
-
import { t as resolveChannelDefaultAccountId } from "./helpers-ZKNRexvX.js";
|
|
25
|
-
import { t as collectChannelStatusIssues } from "./channels-status-issues-DBc1pU_R.js";
|
|
26
|
-
import { S as normalizeControlUiBasePath, h as resolveControlUiLinks } from "./onboard-helpers-DO_hgZb9.js";
|
|
27
|
-
import { s as resolveGatewayLogPaths, t as resolveGatewayService } from "./service-BNVpYcQe.js";
|
|
28
|
-
import { t as readLastGatewayErrorLine } from "./diagnostics-DlIw6fqD.js";
|
|
29
|
-
import { t as renderTable } from "./table-DoiRPsn0.js";
|
|
30
|
-
import { a as resolveGatewayProbeAuth$1, c as probeGateway, t as runSecurityAudit } from "./audit-C6okOOSh.js";
|
|
31
|
-
import { o as resolveHeartbeatSummaryForAgent, t as formatHealthChannelLines } from "./health-BeZnqp6m.js";
|
|
32
|
-
import { d as formatUpdateChannelLabel, h as resolveEffectiveUpdateChannel, i as formatGitInstallLabel, m as normalizeUpdateChannel, n as compareSemverStrings, t as checkUpdateStatus } from "./update-check-IhlWaui6.js";
|
|
33
|
-
import { t as resolveNodeService } from "./node-service-BFxHJsno.js";
|
|
34
|
-
import { n as redactSecrets, t as formatGatewayAuthUsed } from "./format-Mq6iU0_5.js";
|
|
35
|
-
import { i as resolveUpdateAvailability, n as formatUpdateOneLiner, r as getUpdateCheckResult, t as formatUpdateAvailableHint } from "./status.update-BjOH3GlS.js";
|
|
36
|
-
import { spawnSync } from "node:child_process";
|
|
37
|
-
import os from "node:os";
|
|
38
|
-
import path from "node:path";
|
|
39
|
-
import fs from "node:fs";
|
|
40
|
-
import fs$1 from "node:fs/promises";
|
|
41
|
-
|
|
42
|
-
//#region src/commands/gateway-presence.ts
|
|
43
|
-
function pickGatewaySelfPresence(presence) {
|
|
44
|
-
if (!Array.isArray(presence)) return null;
|
|
45
|
-
const entries = presence;
|
|
46
|
-
const self = entries.find((e) => e.mode === "gateway" && e.reason === "self") ?? entries.find((e) => typeof e.text === "string" && String(e.text).startsWith("Gateway:")) ?? null;
|
|
47
|
-
if (!self) return null;
|
|
48
|
-
return {
|
|
49
|
-
host: typeof self.host === "string" ? self.host : void 0,
|
|
50
|
-
ip: typeof self.ip === "string" ? self.ip : void 0,
|
|
51
|
-
version: typeof self.version === "string" ? self.version : void 0,
|
|
52
|
-
platform: typeof self.platform === "string" ? self.platform : void 0
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/memory/status-format.ts
|
|
58
|
-
function resolveMemoryVectorState(vector) {
|
|
59
|
-
if (!vector.enabled) return {
|
|
60
|
-
tone: "muted",
|
|
61
|
-
state: "disabled"
|
|
62
|
-
};
|
|
63
|
-
if (vector.available === true) return {
|
|
64
|
-
tone: "ok",
|
|
65
|
-
state: "ready"
|
|
66
|
-
};
|
|
67
|
-
if (vector.available === false) return {
|
|
68
|
-
tone: "warn",
|
|
69
|
-
state: "unavailable"
|
|
70
|
-
};
|
|
71
|
-
return {
|
|
72
|
-
tone: "muted",
|
|
73
|
-
state: "unknown"
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
function resolveMemoryFtsState(fts) {
|
|
77
|
-
if (!fts.enabled) return {
|
|
78
|
-
tone: "muted",
|
|
79
|
-
state: "disabled"
|
|
80
|
-
};
|
|
81
|
-
return fts.available ? {
|
|
82
|
-
tone: "ok",
|
|
83
|
-
state: "ready"
|
|
84
|
-
} : {
|
|
85
|
-
tone: "warn",
|
|
86
|
-
state: "unavailable"
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function resolveMemoryCacheSummary(cache) {
|
|
90
|
-
if (!cache.enabled) return {
|
|
91
|
-
tone: "muted",
|
|
92
|
-
text: "cache off"
|
|
93
|
-
};
|
|
94
|
-
return {
|
|
95
|
-
tone: "ok",
|
|
96
|
-
text: `cache on${typeof cache.entries === "number" ? ` (${cache.entries})` : ""}`
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
//#endregion
|
|
101
|
-
//#region src/infra/os-summary.ts
|
|
102
|
-
function safeTrim(value) {
|
|
103
|
-
return typeof value === "string" ? value.trim() : "";
|
|
104
|
-
}
|
|
105
|
-
function macosVersion() {
|
|
106
|
-
return safeTrim(spawnSync("sw_vers", ["-productVersion"], { encoding: "utf-8" }).stdout) || os.release();
|
|
107
|
-
}
|
|
108
|
-
function resolveOsSummary() {
|
|
109
|
-
const platform = os.platform();
|
|
110
|
-
const release = os.release();
|
|
111
|
-
const arch = os.arch();
|
|
112
|
-
return {
|
|
113
|
-
platform,
|
|
114
|
-
arch,
|
|
115
|
-
release,
|
|
116
|
-
label: (() => {
|
|
117
|
-
if (platform === "darwin") return `macos ${macosVersion()} (${arch})`;
|
|
118
|
-
if (platform === "win32") return `windows ${release} (${arch})`;
|
|
119
|
-
return `${platform} ${release} (${arch})`;
|
|
120
|
-
})()
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/commands/status-all/agents.ts
|
|
126
|
-
async function fileExists$1(p) {
|
|
127
|
-
try {
|
|
128
|
-
await fs$1.access(p);
|
|
129
|
-
return true;
|
|
130
|
-
} catch {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
async function getAgentLocalStatuses$1(cfg) {
|
|
135
|
-
const agentList = listAgentsForGateway(cfg);
|
|
136
|
-
const now = Date.now();
|
|
137
|
-
const agents = await Promise.all(agentList.agents.map(async (agent) => {
|
|
138
|
-
const workspaceDir = (() => {
|
|
139
|
-
try {
|
|
140
|
-
return resolveAgentWorkspaceDir(cfg, agent.id);
|
|
141
|
-
} catch {
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
})();
|
|
145
|
-
const bootstrapPending = workspaceDir != null ? await fileExists$1(path.join(workspaceDir, "BOOTSTRAP.md")) : null;
|
|
146
|
-
const sessionsPath = resolveStorePath(cfg.session?.store, { agentId: agent.id });
|
|
147
|
-
const store = (() => {
|
|
148
|
-
try {
|
|
149
|
-
return loadSessionStore(sessionsPath);
|
|
150
|
-
} catch {
|
|
151
|
-
return {};
|
|
152
|
-
}
|
|
153
|
-
})();
|
|
154
|
-
const updatedAt = Object.values(store).reduce((max, entry) => Math.max(max, entry?.updatedAt ?? 0), 0);
|
|
155
|
-
const lastUpdatedAt = updatedAt > 0 ? updatedAt : null;
|
|
156
|
-
const lastActiveAgeMs = lastUpdatedAt ? now - lastUpdatedAt : null;
|
|
157
|
-
const sessionsCount = Object.keys(store).filter((k) => k !== "global" && k !== "unknown").length;
|
|
158
|
-
return {
|
|
159
|
-
id: agent.id,
|
|
160
|
-
name: agent.name,
|
|
161
|
-
workspaceDir,
|
|
162
|
-
bootstrapPending,
|
|
163
|
-
sessionsPath,
|
|
164
|
-
sessionsCount,
|
|
165
|
-
lastUpdatedAt,
|
|
166
|
-
lastActiveAgeMs
|
|
167
|
-
};
|
|
168
|
-
}));
|
|
169
|
-
const totalSessions = agents.reduce((sum, a) => sum + a.sessionsCount, 0);
|
|
170
|
-
const bootstrapPendingCount = agents.reduce((sum, a) => sum + (a.bootstrapPending ? 1 : 0), 0);
|
|
171
|
-
return {
|
|
172
|
-
defaultId: agentList.defaultId,
|
|
173
|
-
agents,
|
|
174
|
-
totalSessions,
|
|
175
|
-
bootstrapPendingCount
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
//#endregion
|
|
180
|
-
//#region src/commands/status-all/channels.ts
|
|
181
|
-
const asRecord = (value) => value && typeof value === "object" ? value : {};
|
|
182
|
-
function summarizeSources(sources) {
|
|
183
|
-
const counts = /* @__PURE__ */ new Map();
|
|
184
|
-
for (const s of sources) {
|
|
185
|
-
const key = s?.trim() ? s.trim() : "unknown";
|
|
186
|
-
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
187
|
-
}
|
|
188
|
-
const parts = [...counts.entries()].toSorted((a, b) => b[1] - a[1]).map(([key, n]) => `${key}${n > 1 ? `×${n}` : ""}`);
|
|
189
|
-
return {
|
|
190
|
-
label: parts.length > 0 ? parts.join("+") : "unknown",
|
|
191
|
-
parts
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
function existsSyncMaybe(p) {
|
|
195
|
-
const path = p?.trim() || "";
|
|
196
|
-
if (!path) return null;
|
|
197
|
-
try {
|
|
198
|
-
return fs.existsSync(path);
|
|
199
|
-
} catch {
|
|
200
|
-
return null;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
function formatTokenHint(token, opts) {
|
|
204
|
-
const t = token.trim();
|
|
205
|
-
if (!t) return "empty";
|
|
206
|
-
if (!opts.showSecrets) return `sha256:${sha256HexPrefix(t, 8)} · len ${t.length}`;
|
|
207
|
-
const head = t.slice(0, 4);
|
|
208
|
-
const tail = t.slice(-4);
|
|
209
|
-
if (t.length <= 10) return `${t} · len ${t.length}`;
|
|
210
|
-
return `${head}…${tail} · len ${t.length}`;
|
|
211
|
-
}
|
|
212
|
-
const formatAccountLabel = (params) => {
|
|
213
|
-
const base = params.accountId || "default";
|
|
214
|
-
if (params.name?.trim()) return `${base} (${params.name.trim()})`;
|
|
215
|
-
return base;
|
|
216
|
-
};
|
|
217
|
-
const resolveAccountEnabled = (plugin, account, cfg) => {
|
|
218
|
-
if (plugin.config.isEnabled) return plugin.config.isEnabled(account, cfg);
|
|
219
|
-
return asRecord(account).enabled !== false;
|
|
220
|
-
};
|
|
221
|
-
const resolveAccountConfigured = async (plugin, account, cfg) => {
|
|
222
|
-
if (plugin.config.isConfigured) return await plugin.config.isConfigured(account, cfg);
|
|
223
|
-
return asRecord(account).configured !== false;
|
|
224
|
-
};
|
|
225
|
-
const buildAccountNotes = (params) => {
|
|
226
|
-
const { plugin, cfg, entry } = params;
|
|
227
|
-
const notes = [];
|
|
228
|
-
const snapshot = entry.snapshot;
|
|
229
|
-
if (snapshot.enabled === false) notes.push("disabled");
|
|
230
|
-
if (snapshot.dmPolicy) notes.push(`dm:${snapshot.dmPolicy}`);
|
|
231
|
-
if (snapshot.tokenSource && snapshot.tokenSource !== "none") notes.push(`token:${snapshot.tokenSource}`);
|
|
232
|
-
if (snapshot.botTokenSource && snapshot.botTokenSource !== "none") notes.push(`bot:${snapshot.botTokenSource}`);
|
|
233
|
-
if (snapshot.appTokenSource && snapshot.appTokenSource !== "none") notes.push(`app:${snapshot.appTokenSource}`);
|
|
234
|
-
if (snapshot.baseUrl) notes.push(snapshot.baseUrl);
|
|
235
|
-
if (snapshot.port != null) notes.push(`port:${snapshot.port}`);
|
|
236
|
-
if (snapshot.cliPath) notes.push(`cli:${snapshot.cliPath}`);
|
|
237
|
-
if (snapshot.dbPath) notes.push(`db:${snapshot.dbPath}`);
|
|
238
|
-
const allowFrom = plugin.config.resolveAllowFrom?.({
|
|
239
|
-
cfg,
|
|
240
|
-
accountId: snapshot.accountId
|
|
241
|
-
}) ?? snapshot.allowFrom;
|
|
242
|
-
if (allowFrom?.length) {
|
|
243
|
-
const formatted = formatChannelAllowFrom({
|
|
244
|
-
plugin,
|
|
245
|
-
cfg,
|
|
246
|
-
accountId: snapshot.accountId,
|
|
247
|
-
allowFrom
|
|
248
|
-
}).slice(0, 3);
|
|
249
|
-
if (formatted.length > 0) notes.push(`allow:${formatted.join(",")}`);
|
|
250
|
-
}
|
|
251
|
-
return notes;
|
|
252
|
-
};
|
|
253
|
-
function resolveLinkFields(summary) {
|
|
254
|
-
const rec = asRecord(summary);
|
|
255
|
-
const linked = typeof rec.linked === "boolean" ? rec.linked : null;
|
|
256
|
-
const authAgeMs = typeof rec.authAgeMs === "number" ? rec.authAgeMs : null;
|
|
257
|
-
const self = asRecord(rec.self);
|
|
258
|
-
return {
|
|
259
|
-
linked,
|
|
260
|
-
authAgeMs,
|
|
261
|
-
selfE164: typeof self.e164 === "string" && self.e164.trim() ? self.e164.trim() : null
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
function collectMissingPaths(accounts) {
|
|
265
|
-
const missing = [];
|
|
266
|
-
for (const entry of accounts) {
|
|
267
|
-
const accountRec = asRecord(entry.account);
|
|
268
|
-
const snapshotRec = asRecord(entry.snapshot);
|
|
269
|
-
for (const key of [
|
|
270
|
-
"tokenFile",
|
|
271
|
-
"botTokenFile",
|
|
272
|
-
"appTokenFile",
|
|
273
|
-
"cliPath",
|
|
274
|
-
"dbPath",
|
|
275
|
-
"authDir"
|
|
276
|
-
]) {
|
|
277
|
-
const raw = accountRec[key] ?? snapshotRec[key];
|
|
278
|
-
if (existsSyncMaybe(raw) === false) missing.push(String(raw));
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
return missing;
|
|
282
|
-
}
|
|
283
|
-
function summarizeTokenConfig(params) {
|
|
284
|
-
const enabled = params.accounts.filter((a) => a.enabled);
|
|
285
|
-
if (enabled.length === 0) return {
|
|
286
|
-
state: null,
|
|
287
|
-
detail: null
|
|
288
|
-
};
|
|
289
|
-
const accountRecs = enabled.map((a) => asRecord(a.account));
|
|
290
|
-
const hasBotOrAppTokenFields = accountRecs.some((r) => "botToken" in r || "appToken" in r);
|
|
291
|
-
const hasTokenField = accountRecs.some((r) => "token" in r);
|
|
292
|
-
if (!hasBotOrAppTokenFields && !hasTokenField) return {
|
|
293
|
-
state: null,
|
|
294
|
-
detail: null
|
|
295
|
-
};
|
|
296
|
-
if (hasBotOrAppTokenFields) {
|
|
297
|
-
const ready = enabled.filter((a) => {
|
|
298
|
-
const rec = asRecord(a.account);
|
|
299
|
-
const bot = typeof rec.botToken === "string" ? rec.botToken.trim() : "";
|
|
300
|
-
const app = typeof rec.appToken === "string" ? rec.appToken.trim() : "";
|
|
301
|
-
return Boolean(bot) && Boolean(app);
|
|
302
|
-
});
|
|
303
|
-
const partial = enabled.filter((a) => {
|
|
304
|
-
const rec = asRecord(a.account);
|
|
305
|
-
const bot = typeof rec.botToken === "string" ? rec.botToken.trim() : "";
|
|
306
|
-
const app = typeof rec.appToken === "string" ? rec.appToken.trim() : "";
|
|
307
|
-
const hasBot = Boolean(bot);
|
|
308
|
-
const hasApp = Boolean(app);
|
|
309
|
-
return hasBot && !hasApp || !hasBot && hasApp;
|
|
310
|
-
});
|
|
311
|
-
if (partial.length > 0) return {
|
|
312
|
-
state: "warn",
|
|
313
|
-
detail: `partial tokens (need bot+app) · accounts ${partial.length}`
|
|
314
|
-
};
|
|
315
|
-
if (ready.length === 0) return {
|
|
316
|
-
state: "setup",
|
|
317
|
-
detail: "no tokens (need bot+app)"
|
|
318
|
-
};
|
|
319
|
-
const botSources = summarizeSources(ready.map((a) => a.snapshot.botTokenSource ?? "none"));
|
|
320
|
-
const appSources = summarizeSources(ready.map((a) => a.snapshot.appTokenSource ?? "none"));
|
|
321
|
-
const sample = ready[0]?.account ? asRecord(ready[0].account) : {};
|
|
322
|
-
const botToken = typeof sample.botToken === "string" ? sample.botToken : "";
|
|
323
|
-
const appToken = typeof sample.appToken === "string" ? sample.appToken : "";
|
|
324
|
-
const botHint = botToken.trim() ? formatTokenHint(botToken, { showSecrets: params.showSecrets }) : "";
|
|
325
|
-
const appHint = appToken.trim() ? formatTokenHint(appToken, { showSecrets: params.showSecrets }) : "";
|
|
326
|
-
const hint = botHint || appHint ? ` (bot ${botHint || "?"}, app ${appHint || "?"})` : "";
|
|
327
|
-
return {
|
|
328
|
-
state: "ok",
|
|
329
|
-
detail: `tokens ok (bot ${botSources.label}, app ${appSources.label})${hint} · accounts ${ready.length}/${enabled.length || 1}`
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
const ready = enabled.filter((a) => {
|
|
333
|
-
const rec = asRecord(a.account);
|
|
334
|
-
return typeof rec.token === "string" ? Boolean(rec.token.trim()) : false;
|
|
335
|
-
});
|
|
336
|
-
if (ready.length === 0) return {
|
|
337
|
-
state: "setup",
|
|
338
|
-
detail: "no token"
|
|
339
|
-
};
|
|
340
|
-
const sources = summarizeSources(ready.map((a) => a.snapshot.tokenSource));
|
|
341
|
-
const sample = ready[0]?.account ? asRecord(ready[0].account) : {};
|
|
342
|
-
const token = typeof sample.token === "string" ? sample.token : "";
|
|
343
|
-
const hint = token.trim() ? ` (${formatTokenHint(token, { showSecrets: params.showSecrets })})` : "";
|
|
344
|
-
return {
|
|
345
|
-
state: "ok",
|
|
346
|
-
detail: `token ${sources.label}${hint} · accounts ${ready.length}/${enabled.length || 1}`
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
async function buildChannelsTable(cfg, opts) {
|
|
350
|
-
const showSecrets = opts?.showSecrets === true;
|
|
351
|
-
const rows = [];
|
|
352
|
-
const details = [];
|
|
353
|
-
for (const plugin of listChannelPlugins()) {
|
|
354
|
-
const accountIds = plugin.config.listAccountIds(cfg);
|
|
355
|
-
const defaultAccountId = resolveChannelDefaultAccountId({
|
|
356
|
-
plugin,
|
|
357
|
-
cfg,
|
|
358
|
-
accountIds
|
|
359
|
-
});
|
|
360
|
-
const resolvedAccountIds = accountIds.length > 0 ? accountIds : [defaultAccountId];
|
|
361
|
-
const accounts = [];
|
|
362
|
-
for (const accountId of resolvedAccountIds) {
|
|
363
|
-
const account = plugin.config.resolveAccount(cfg, accountId);
|
|
364
|
-
const enabled = resolveAccountEnabled(plugin, account, cfg);
|
|
365
|
-
const configured = await resolveAccountConfigured(plugin, account, cfg);
|
|
366
|
-
const snapshot = buildChannelAccountSnapshot({
|
|
367
|
-
plugin,
|
|
368
|
-
cfg,
|
|
369
|
-
accountId,
|
|
370
|
-
account,
|
|
371
|
-
enabled,
|
|
372
|
-
configured
|
|
373
|
-
});
|
|
374
|
-
accounts.push({
|
|
375
|
-
accountId,
|
|
376
|
-
account,
|
|
377
|
-
enabled,
|
|
378
|
-
configured,
|
|
379
|
-
snapshot
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
const anyEnabled = accounts.some((a) => a.enabled);
|
|
383
|
-
const enabledAccounts = accounts.filter((a) => a.enabled);
|
|
384
|
-
const configuredAccounts = enabledAccounts.filter((a) => a.configured);
|
|
385
|
-
const defaultEntry = accounts.find((a) => a.accountId === defaultAccountId) ?? accounts[0];
|
|
386
|
-
const link = resolveLinkFields(plugin.status?.buildChannelSummary ? await plugin.status.buildChannelSummary({
|
|
387
|
-
account: defaultEntry?.account ?? {},
|
|
388
|
-
cfg,
|
|
389
|
-
defaultAccountId,
|
|
390
|
-
snapshot: defaultEntry?.snapshot ?? { accountId: defaultAccountId }
|
|
391
|
-
}) : void 0);
|
|
392
|
-
const missingPaths = collectMissingPaths(enabledAccounts);
|
|
393
|
-
const tokenSummary = summarizeTokenConfig({
|
|
394
|
-
plugin,
|
|
395
|
-
cfg,
|
|
396
|
-
accounts,
|
|
397
|
-
showSecrets
|
|
398
|
-
});
|
|
399
|
-
const issues = plugin.status?.collectStatusIssues ? plugin.status.collectStatusIssues(accounts.map((a) => a.snapshot)) : [];
|
|
400
|
-
const label = plugin.meta.label ?? plugin.id;
|
|
401
|
-
const state = (() => {
|
|
402
|
-
if (!anyEnabled) return "off";
|
|
403
|
-
if (missingPaths.length > 0) return "warn";
|
|
404
|
-
if (issues.length > 0) return "warn";
|
|
405
|
-
if (link.linked === false) return "setup";
|
|
406
|
-
if (tokenSummary.state) return tokenSummary.state;
|
|
407
|
-
if (link.linked === true) return "ok";
|
|
408
|
-
if (configuredAccounts.length > 0) return "ok";
|
|
409
|
-
return "setup";
|
|
410
|
-
})();
|
|
411
|
-
const detail = (() => {
|
|
412
|
-
if (!anyEnabled) {
|
|
413
|
-
if (!defaultEntry) return "disabled";
|
|
414
|
-
return plugin.config.disabledReason?.(defaultEntry.account, cfg) ?? "disabled";
|
|
415
|
-
}
|
|
416
|
-
if (missingPaths.length > 0) return `missing file (${missingPaths[0]})`;
|
|
417
|
-
if (issues.length > 0) return issues[0]?.message ?? "misconfigured";
|
|
418
|
-
if (link.linked !== null) {
|
|
419
|
-
const base = link.linked ? "linked" : "not linked";
|
|
420
|
-
const extra = [];
|
|
421
|
-
if (link.linked && link.selfE164) extra.push(link.selfE164);
|
|
422
|
-
if (link.linked && link.authAgeMs != null && link.authAgeMs >= 0) extra.push(`auth ${formatTimeAgo(link.authAgeMs)}`);
|
|
423
|
-
if (accounts.length > 1 || plugin.meta.forceAccountBinding) extra.push(`accounts ${accounts.length || 1}`);
|
|
424
|
-
return extra.length > 0 ? `${base} · ${extra.join(" · ")}` : base;
|
|
425
|
-
}
|
|
426
|
-
if (tokenSummary.detail) return tokenSummary.detail;
|
|
427
|
-
if (configuredAccounts.length > 0) {
|
|
428
|
-
const head = "configured";
|
|
429
|
-
if (accounts.length <= 1 && !plugin.meta.forceAccountBinding) return head;
|
|
430
|
-
return `${head} · accounts ${configuredAccounts.length}/${enabledAccounts.length || 1}`;
|
|
431
|
-
}
|
|
432
|
-
return (defaultEntry && plugin.config.unconfiguredReason ? plugin.config.unconfiguredReason(defaultEntry.account, cfg) : null) ?? "not configured";
|
|
433
|
-
})();
|
|
434
|
-
rows.push({
|
|
435
|
-
id: plugin.id,
|
|
436
|
-
label,
|
|
437
|
-
enabled: anyEnabled,
|
|
438
|
-
state,
|
|
439
|
-
detail
|
|
440
|
-
});
|
|
441
|
-
if (configuredAccounts.length > 0) details.push({
|
|
442
|
-
title: `${label} accounts`,
|
|
443
|
-
columns: [
|
|
444
|
-
"Account",
|
|
445
|
-
"Status",
|
|
446
|
-
"Notes"
|
|
447
|
-
],
|
|
448
|
-
rows: configuredAccounts.map((entry) => {
|
|
449
|
-
const notes = buildAccountNotes({
|
|
450
|
-
plugin,
|
|
451
|
-
cfg,
|
|
452
|
-
entry
|
|
453
|
-
});
|
|
454
|
-
return {
|
|
455
|
-
Account: formatAccountLabel({
|
|
456
|
-
accountId: entry.accountId,
|
|
457
|
-
name: entry.snapshot.name
|
|
458
|
-
}),
|
|
459
|
-
Status: entry.enabled ? "OK" : "WARN",
|
|
460
|
-
Notes: notes.join(" · ")
|
|
461
|
-
};
|
|
462
|
-
})
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
return {
|
|
466
|
-
rows,
|
|
467
|
-
details
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
//#endregion
|
|
472
|
-
//#region src/commands/status-all/gateway.ts
|
|
473
|
-
async function readFileTailLines(filePath, maxLines) {
|
|
474
|
-
const raw = await fs$1.readFile(filePath, "utf8").catch(() => "");
|
|
475
|
-
if (!raw.trim()) return [];
|
|
476
|
-
const lines = raw.replace(/\r/g, "").split("\n");
|
|
477
|
-
return lines.slice(Math.max(0, lines.length - maxLines)).map((line) => line.trimEnd()).filter((line) => line.trim().length > 0);
|
|
478
|
-
}
|
|
479
|
-
function countMatches(haystack, needle) {
|
|
480
|
-
if (!haystack || !needle) return 0;
|
|
481
|
-
return haystack.split(needle).length - 1;
|
|
482
|
-
}
|
|
483
|
-
function shorten(message, maxLen) {
|
|
484
|
-
const cleaned = message.replace(/\s+/g, " ").trim();
|
|
485
|
-
if (cleaned.length <= maxLen) return cleaned;
|
|
486
|
-
return `${cleaned.slice(0, Math.max(0, maxLen - 1))}…`;
|
|
487
|
-
}
|
|
488
|
-
function normalizeGwsLine(line) {
|
|
489
|
-
return line.replace(/\s+runId=[^\s]+/g, "").replace(/\s+conn=[^\s]+/g, "").replace(/\s+id=[^\s]+/g, "").replace(/\s+error=Error:.*$/g, "").trim();
|
|
490
|
-
}
|
|
491
|
-
function consumeJsonBlock(lines, startIndex) {
|
|
492
|
-
const startLine = lines[startIndex] ?? "";
|
|
493
|
-
const braceAt = startLine.indexOf("{");
|
|
494
|
-
if (braceAt < 0) return null;
|
|
495
|
-
const parts = [startLine.slice(braceAt)];
|
|
496
|
-
let depth = countMatches(parts[0] ?? "", "{") - countMatches(parts[0] ?? "", "}");
|
|
497
|
-
let i = startIndex;
|
|
498
|
-
while (depth > 0 && i + 1 < lines.length) {
|
|
499
|
-
i += 1;
|
|
500
|
-
const next = lines[i] ?? "";
|
|
501
|
-
parts.push(next);
|
|
502
|
-
depth += countMatches(next, "{") - countMatches(next, "}");
|
|
503
|
-
}
|
|
504
|
-
return {
|
|
505
|
-
json: parts.join("\n"),
|
|
506
|
-
endIndex: i
|
|
507
|
-
};
|
|
508
|
-
}
|
|
509
|
-
function summarizeLogTail(rawLines, opts) {
|
|
510
|
-
const maxLines = Math.max(6, opts?.maxLines ?? 26);
|
|
511
|
-
const out = [];
|
|
512
|
-
const groups = /* @__PURE__ */ new Map();
|
|
513
|
-
const addGroup = (key, base) => {
|
|
514
|
-
const existing = groups.get(key);
|
|
515
|
-
if (existing) {
|
|
516
|
-
existing.count += 1;
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
groups.set(key, {
|
|
520
|
-
count: 1,
|
|
521
|
-
index: out.length,
|
|
522
|
-
base
|
|
523
|
-
});
|
|
524
|
-
out.push(base);
|
|
525
|
-
};
|
|
526
|
-
const addLine = (line) => {
|
|
527
|
-
const trimmed = line.trimEnd();
|
|
528
|
-
if (!trimmed) return;
|
|
529
|
-
out.push(trimmed);
|
|
530
|
-
};
|
|
531
|
-
const lines = rawLines.map((line) => line.trimEnd()).filter(Boolean);
|
|
532
|
-
for (let i = 0; i < lines.length; i += 1) {
|
|
533
|
-
const line = lines[i] ?? "";
|
|
534
|
-
const trimmedStart = line.trimStart();
|
|
535
|
-
if ((trimmedStart.startsWith("\"") || trimmedStart === "}" || trimmedStart === "{" || trimmedStart.startsWith("}") || trimmedStart.startsWith("{")) && !trimmedStart.startsWith("[") && !trimmedStart.startsWith("#")) continue;
|
|
536
|
-
const tokenRefresh = line.match(/^\[([^\]]+)\]\s+Token refresh failed:\s*(\d+)\s*(\{)?\s*$/);
|
|
537
|
-
if (tokenRefresh) {
|
|
538
|
-
const tag = tokenRefresh[1] ?? "unknown";
|
|
539
|
-
const status = tokenRefresh[2] ?? "unknown";
|
|
540
|
-
const block = consumeJsonBlock(lines, i);
|
|
541
|
-
if (block) {
|
|
542
|
-
i = block.endIndex;
|
|
543
|
-
const parsed = (() => {
|
|
544
|
-
try {
|
|
545
|
-
return JSON.parse(block.json);
|
|
546
|
-
} catch {
|
|
547
|
-
return null;
|
|
548
|
-
}
|
|
549
|
-
})();
|
|
550
|
-
const code = parsed?.error?.code?.trim() || null;
|
|
551
|
-
const msg = parsed?.error?.message?.trim() || null;
|
|
552
|
-
const msgShort = msg ? msg.toLowerCase().includes("signing in again") ? "re-auth required" : shorten(msg, 52) : null;
|
|
553
|
-
const base = `[${tag}] token refresh ${status}${code ? ` ${code}` : ""}${msgShort ? ` · ${msgShort}` : ""}`;
|
|
554
|
-
addGroup(`token:${tag}:${status}:${code ?? ""}:${msgShort ?? ""}`, base);
|
|
555
|
-
continue;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
const embedded = line.match(/^Embedded agent failed before reply:\s+OAuth token refresh failed for ([^:]+):/);
|
|
559
|
-
if (embedded) {
|
|
560
|
-
const provider = embedded[1]?.trim() || "unknown";
|
|
561
|
-
addGroup(`embedded:${provider}`, `Embedded agent: OAuth token refresh failed (${provider})`);
|
|
562
|
-
continue;
|
|
563
|
-
}
|
|
564
|
-
if (line.startsWith("[gws]") && line.includes("errorCode=UNAVAILABLE") && line.includes("OAuth token refresh failed")) {
|
|
565
|
-
const normalized = normalizeGwsLine(line);
|
|
566
|
-
addGroup(`gws:${normalized}`, normalized);
|
|
567
|
-
continue;
|
|
568
|
-
}
|
|
569
|
-
addLine(line);
|
|
570
|
-
}
|
|
571
|
-
for (const g of groups.values()) {
|
|
572
|
-
if (g.count <= 1) continue;
|
|
573
|
-
out[g.index] = `${g.base} ×${g.count}`;
|
|
574
|
-
}
|
|
575
|
-
const deduped = [];
|
|
576
|
-
for (const line of out) {
|
|
577
|
-
if (deduped[deduped.length - 1] === line) continue;
|
|
578
|
-
deduped.push(line);
|
|
579
|
-
}
|
|
580
|
-
if (deduped.length <= maxLines) return deduped;
|
|
581
|
-
const head = Math.min(6, Math.floor(maxLines / 3));
|
|
582
|
-
const tail = Math.max(1, maxLines - head - 1);
|
|
583
|
-
return [
|
|
584
|
-
...deduped.slice(0, head),
|
|
585
|
-
`… ${deduped.length - head - tail} lines omitted …`,
|
|
586
|
-
...deduped.slice(-tail)
|
|
587
|
-
];
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
//#endregion
|
|
591
|
-
//#region src/commands/status-all/diagnosis.ts
|
|
592
|
-
async function appendStatusAllDiagnosis(params) {
|
|
593
|
-
const { lines, muted, ok, warn, fail } = params;
|
|
594
|
-
const emitCheck = (label, status) => {
|
|
595
|
-
const icon = status === "ok" ? ok("✓") : status === "warn" ? warn("!") : fail("✗");
|
|
596
|
-
const colored = status === "ok" ? ok(label) : status === "warn" ? warn(label) : fail(label);
|
|
597
|
-
lines.push(`${icon} ${colored}`);
|
|
598
|
-
};
|
|
599
|
-
lines.push("");
|
|
600
|
-
lines.push(muted("Gateway connection details:"));
|
|
601
|
-
for (const line of redactSecrets(params.connectionDetailsForReport).split("\n").map((l) => l.trimEnd())) lines.push(` ${muted(line)}`);
|
|
602
|
-
lines.push("");
|
|
603
|
-
if (params.snap) {
|
|
604
|
-
const status = !params.snap.exists ? "fail" : params.snap.valid ? "ok" : "warn";
|
|
605
|
-
emitCheck(`Config: ${params.snap.path ?? "(unknown)"}`, status);
|
|
606
|
-
const issues = [...params.snap.legacyIssues ?? [], ...params.snap.issues ?? []];
|
|
607
|
-
const uniqueIssues = issues.filter((issue, index) => issues.findIndex((x) => x.path === issue.path && x.message === issue.message) === index);
|
|
608
|
-
for (const issue of uniqueIssues.slice(0, 12)) lines.push(` - ${issue.path}: ${issue.message}`);
|
|
609
|
-
if (uniqueIssues.length > 12) lines.push(` ${muted(`… +${uniqueIssues.length - 12} more`)}`);
|
|
610
|
-
} else emitCheck("Config: read failed", "warn");
|
|
611
|
-
if (params.remoteUrlMissing) {
|
|
612
|
-
lines.push("");
|
|
613
|
-
emitCheck("Gateway remote mode misconfigured (gateway.remote.url missing)", "warn");
|
|
614
|
-
lines.push(` ${muted("Fix: set gateway.remote.url, or set gateway.mode=local.")}`);
|
|
615
|
-
}
|
|
616
|
-
if (params.sentinel?.payload) {
|
|
617
|
-
emitCheck("Restart sentinel present", "warn");
|
|
618
|
-
lines.push(` ${muted(`${summarizeRestartSentinel(params.sentinel.payload)} · ${formatTimeAgo(Date.now() - params.sentinel.payload.ts)}`)}`);
|
|
619
|
-
} else emitCheck("Restart sentinel: none", "ok");
|
|
620
|
-
const lastErrClean = params.lastErr?.trim() ?? "";
|
|
621
|
-
const isTrivialLastErr = lastErrClean.length < 8 || lastErrClean === "}" || lastErrClean === "{";
|
|
622
|
-
if (lastErrClean && !isTrivialLastErr) {
|
|
623
|
-
lines.push("");
|
|
624
|
-
lines.push(muted("Gateway last log line:"));
|
|
625
|
-
lines.push(` ${muted(redactSecrets(lastErrClean))}`);
|
|
626
|
-
}
|
|
627
|
-
if (params.portUsage) {
|
|
628
|
-
const portOk = params.portUsage.listeners.length === 0;
|
|
629
|
-
emitCheck(`Port ${params.port}`, portOk ? "ok" : "warn");
|
|
630
|
-
if (!portOk) for (const line of formatPortDiagnostics(params.portUsage)) lines.push(` ${muted(line)}`);
|
|
631
|
-
}
|
|
632
|
-
{
|
|
633
|
-
const backend = params.tailscale.backendState ?? "unknown";
|
|
634
|
-
const okBackend = backend === "Running";
|
|
635
|
-
const hasDns = Boolean(params.tailscale.dnsName);
|
|
636
|
-
emitCheck(params.tailscaleMode === "off" ? `Tailscale: off · ${backend}${params.tailscale.dnsName ? ` · ${params.tailscale.dnsName}` : ""}` : `Tailscale: ${params.tailscaleMode} · ${backend}${params.tailscale.dnsName ? ` · ${params.tailscale.dnsName}` : ""}`, okBackend && (params.tailscaleMode === "off" || hasDns) ? "ok" : "warn");
|
|
637
|
-
if (params.tailscale.error) lines.push(` ${muted(`error: ${params.tailscale.error}`)}`);
|
|
638
|
-
if (params.tailscale.ips.length > 0) lines.push(` ${muted(`ips: ${params.tailscale.ips.slice(0, 3).join(", ")}${params.tailscale.ips.length > 3 ? "…" : ""}`)}`);
|
|
639
|
-
if (params.tailscaleHttpsUrl) lines.push(` ${muted(`https: ${params.tailscaleHttpsUrl}`)}`);
|
|
640
|
-
}
|
|
641
|
-
if (params.skillStatus) {
|
|
642
|
-
const eligible = params.skillStatus.skills.filter((s) => s.eligible).length;
|
|
643
|
-
const missing = params.skillStatus.skills.filter((s) => s.eligible && Object.values(s.missing).some((arr) => arr.length)).length;
|
|
644
|
-
emitCheck(`Skills: ${eligible} eligible · ${missing} missing · ${params.skillStatus.workspaceDir}`, missing === 0 ? "ok" : "warn");
|
|
645
|
-
}
|
|
646
|
-
params.progress.setLabel("Reading logs…");
|
|
647
|
-
const logPaths = (() => {
|
|
648
|
-
try {
|
|
649
|
-
return resolveGatewayLogPaths(process.env);
|
|
650
|
-
} catch {
|
|
651
|
-
return null;
|
|
652
|
-
}
|
|
653
|
-
})();
|
|
654
|
-
if (logPaths) {
|
|
655
|
-
params.progress.setLabel("Reading logs…");
|
|
656
|
-
const [stderrTail, stdoutTail] = await Promise.all([readFileTailLines(logPaths.stderrPath, 40).catch(() => []), readFileTailLines(logPaths.stdoutPath, 40).catch(() => [])]);
|
|
657
|
-
if (stderrTail.length > 0 || stdoutTail.length > 0) {
|
|
658
|
-
lines.push("");
|
|
659
|
-
lines.push(muted(`Gateway logs (tail, summarized): ${logPaths.logDir}`));
|
|
660
|
-
lines.push(` ${muted(`# stderr: ${logPaths.stderrPath}`)}`);
|
|
661
|
-
for (const line of summarizeLogTail(stderrTail, { maxLines: 22 }).map(redactSecrets)) lines.push(` ${muted(line)}`);
|
|
662
|
-
lines.push(` ${muted(`# stdout: ${logPaths.stdoutPath}`)}`);
|
|
663
|
-
for (const line of summarizeLogTail(stdoutTail, { maxLines: 22 }).map(redactSecrets)) lines.push(` ${muted(line)}`);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
params.progress.tick();
|
|
667
|
-
if (params.channelsStatus) {
|
|
668
|
-
emitCheck(`Channel issues (${params.channelIssues.length || "none"})`, params.channelIssues.length === 0 ? "ok" : "warn");
|
|
669
|
-
for (const issue of params.channelIssues.slice(0, 12)) {
|
|
670
|
-
const fixText = issue.fix ? ` · fix: ${issue.fix}` : "";
|
|
671
|
-
lines.push(` - ${issue.channel}[${issue.accountId}] ${issue.kind}: ${issue.message}${fixText}`);
|
|
672
|
-
}
|
|
673
|
-
if (params.channelIssues.length > 12) lines.push(` ${muted(`… +${params.channelIssues.length - 12} more`)}`);
|
|
674
|
-
} else emitCheck(`Channel issues skipped (gateway ${params.gatewayReachable ? "query failed" : "unreachable"})`, "warn");
|
|
675
|
-
const healthErr = (() => {
|
|
676
|
-
if (!params.health || typeof params.health !== "object") return "";
|
|
677
|
-
const record = params.health;
|
|
678
|
-
if (!("error" in record)) return "";
|
|
679
|
-
const value = record.error;
|
|
680
|
-
if (!value) return "";
|
|
681
|
-
if (typeof value === "string") return value;
|
|
682
|
-
try {
|
|
683
|
-
return JSON.stringify(value, null, 2);
|
|
684
|
-
} catch {
|
|
685
|
-
return "[unserializable error]";
|
|
686
|
-
}
|
|
687
|
-
})();
|
|
688
|
-
if (healthErr) {
|
|
689
|
-
lines.push("");
|
|
690
|
-
lines.push(muted("Gateway health:"));
|
|
691
|
-
lines.push(` ${muted(redactSecrets(healthErr))}`);
|
|
692
|
-
}
|
|
693
|
-
lines.push("");
|
|
694
|
-
lines.push(muted("Pasteable debug report. Auth tokens redacted."));
|
|
695
|
-
lines.push("Troubleshooting: https://docs.anima.ai/troubleshooting");
|
|
696
|
-
lines.push("");
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
//#endregion
|
|
700
|
-
//#region src/commands/status-all/report-lines.ts
|
|
701
|
-
async function buildStatusAllReportLines(params) {
|
|
702
|
-
const rich = isRich();
|
|
703
|
-
const heading = (text) => rich ? theme.heading(text) : text;
|
|
704
|
-
const ok = (text) => rich ? theme.success(text) : text;
|
|
705
|
-
const warn = (text) => rich ? theme.warn(text) : text;
|
|
706
|
-
const fail = (text) => rich ? theme.error(text) : text;
|
|
707
|
-
const muted = (text) => rich ? theme.muted(text) : text;
|
|
708
|
-
const tableWidth = Math.max(60, (process.stdout.columns ?? 120) - 1);
|
|
709
|
-
const overview = renderTable({
|
|
710
|
-
width: tableWidth,
|
|
711
|
-
columns: [{
|
|
712
|
-
key: "Item",
|
|
713
|
-
header: "Item",
|
|
714
|
-
minWidth: 10
|
|
715
|
-
}, {
|
|
716
|
-
key: "Value",
|
|
717
|
-
header: "Value",
|
|
718
|
-
flex: true,
|
|
719
|
-
minWidth: 24
|
|
720
|
-
}],
|
|
721
|
-
rows: params.overviewRows
|
|
722
|
-
});
|
|
723
|
-
const channelRows = params.channels.rows.map((row) => ({
|
|
724
|
-
channelId: row.id,
|
|
725
|
-
Channel: row.label,
|
|
726
|
-
Enabled: row.enabled ? ok("ON") : muted("OFF"),
|
|
727
|
-
State: row.state === "ok" ? ok("OK") : row.state === "warn" ? warn("WARN") : row.state === "off" ? muted("OFF") : theme.accentDim("SETUP"),
|
|
728
|
-
Detail: row.detail
|
|
729
|
-
}));
|
|
730
|
-
const channelIssuesByChannel = (() => {
|
|
731
|
-
const map = /* @__PURE__ */ new Map();
|
|
732
|
-
for (const issue of params.channelIssues) {
|
|
733
|
-
const key = issue.channel;
|
|
734
|
-
const list = map.get(key);
|
|
735
|
-
if (list) list.push(issue);
|
|
736
|
-
else map.set(key, [issue]);
|
|
737
|
-
}
|
|
738
|
-
return map;
|
|
739
|
-
})();
|
|
740
|
-
const channelsTable = renderTable({
|
|
741
|
-
width: tableWidth,
|
|
742
|
-
columns: [
|
|
743
|
-
{
|
|
744
|
-
key: "Channel",
|
|
745
|
-
header: "Channel",
|
|
746
|
-
minWidth: 10
|
|
747
|
-
},
|
|
748
|
-
{
|
|
749
|
-
key: "Enabled",
|
|
750
|
-
header: "Enabled",
|
|
751
|
-
minWidth: 7
|
|
752
|
-
},
|
|
753
|
-
{
|
|
754
|
-
key: "State",
|
|
755
|
-
header: "State",
|
|
756
|
-
minWidth: 8
|
|
757
|
-
},
|
|
758
|
-
{
|
|
759
|
-
key: "Detail",
|
|
760
|
-
header: "Detail",
|
|
761
|
-
flex: true,
|
|
762
|
-
minWidth: 28
|
|
763
|
-
}
|
|
764
|
-
],
|
|
765
|
-
rows: channelRows.map((row) => {
|
|
766
|
-
const issues = channelIssuesByChannel.get(row.channelId) ?? [];
|
|
767
|
-
if (issues.length === 0) return row;
|
|
768
|
-
const issue = issues[0];
|
|
769
|
-
const suffix = ` · ${warn(`gateway: ${String(issue.message).slice(0, 90)}`)}`;
|
|
770
|
-
return {
|
|
771
|
-
...row,
|
|
772
|
-
State: warn("WARN"),
|
|
773
|
-
Detail: `${row.Detail}${suffix}`
|
|
774
|
-
};
|
|
775
|
-
})
|
|
776
|
-
});
|
|
777
|
-
const agentsTable = renderTable({
|
|
778
|
-
width: tableWidth,
|
|
779
|
-
columns: [
|
|
780
|
-
{
|
|
781
|
-
key: "Agent",
|
|
782
|
-
header: "Agent",
|
|
783
|
-
minWidth: 12
|
|
784
|
-
},
|
|
785
|
-
{
|
|
786
|
-
key: "Bootstrap",
|
|
787
|
-
header: "Bootstrap",
|
|
788
|
-
minWidth: 10
|
|
789
|
-
},
|
|
790
|
-
{
|
|
791
|
-
key: "Sessions",
|
|
792
|
-
header: "Sessions",
|
|
793
|
-
align: "right",
|
|
794
|
-
minWidth: 8
|
|
795
|
-
},
|
|
796
|
-
{
|
|
797
|
-
key: "Active",
|
|
798
|
-
header: "Active",
|
|
799
|
-
minWidth: 10
|
|
800
|
-
},
|
|
801
|
-
{
|
|
802
|
-
key: "Store",
|
|
803
|
-
header: "Store",
|
|
804
|
-
flex: true,
|
|
805
|
-
minWidth: 34
|
|
806
|
-
}
|
|
807
|
-
],
|
|
808
|
-
rows: params.agentStatus.agents.map((a) => ({
|
|
809
|
-
Agent: a.name?.trim() ? `${a.id} (${a.name.trim()})` : a.id,
|
|
810
|
-
Bootstrap: a.bootstrapPending === true ? warn("PENDING") : a.bootstrapPending === false ? ok("OK") : "unknown",
|
|
811
|
-
Sessions: String(a.sessionsCount),
|
|
812
|
-
Active: a.lastActiveAgeMs != null ? formatTimeAgo(a.lastActiveAgeMs) : "unknown",
|
|
813
|
-
Store: a.sessionsPath
|
|
814
|
-
}))
|
|
815
|
-
});
|
|
816
|
-
const lines = [];
|
|
817
|
-
lines.push(heading("Anima status --all"));
|
|
818
|
-
lines.push("");
|
|
819
|
-
lines.push(heading("Overview"));
|
|
820
|
-
lines.push(overview.trimEnd());
|
|
821
|
-
lines.push("");
|
|
822
|
-
lines.push(heading("Channels"));
|
|
823
|
-
lines.push(channelsTable.trimEnd());
|
|
824
|
-
for (const detail of params.channels.details) {
|
|
825
|
-
lines.push("");
|
|
826
|
-
lines.push(heading(detail.title));
|
|
827
|
-
lines.push(renderTable({
|
|
828
|
-
width: tableWidth,
|
|
829
|
-
columns: detail.columns.map((c) => ({
|
|
830
|
-
key: c,
|
|
831
|
-
header: c,
|
|
832
|
-
flex: c === "Notes",
|
|
833
|
-
minWidth: c === "Notes" ? 28 : 10
|
|
834
|
-
})),
|
|
835
|
-
rows: detail.rows.map((r) => ({
|
|
836
|
-
...r,
|
|
837
|
-
...r.Status === "OK" ? { Status: ok("OK") } : r.Status === "WARN" ? { Status: warn("WARN") } : {}
|
|
838
|
-
}))
|
|
839
|
-
}).trimEnd());
|
|
840
|
-
}
|
|
841
|
-
lines.push("");
|
|
842
|
-
lines.push(heading("Agents"));
|
|
843
|
-
lines.push(agentsTable.trimEnd());
|
|
844
|
-
lines.push("");
|
|
845
|
-
lines.push(heading("Diagnosis (read-only)"));
|
|
846
|
-
await appendStatusAllDiagnosis({
|
|
847
|
-
lines,
|
|
848
|
-
progress: params.progress,
|
|
849
|
-
muted,
|
|
850
|
-
ok,
|
|
851
|
-
warn,
|
|
852
|
-
fail,
|
|
853
|
-
connectionDetailsForReport: params.connectionDetailsForReport,
|
|
854
|
-
...params.diagnosis
|
|
855
|
-
});
|
|
856
|
-
return lines;
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
//#endregion
|
|
860
|
-
//#region src/commands/status-all.ts
|
|
861
|
-
async function statusAllCommand(runtime, opts) {
|
|
862
|
-
await withProgress({
|
|
863
|
-
label: "Scanning status --all…",
|
|
864
|
-
total: 11
|
|
865
|
-
}, async (progress) => {
|
|
866
|
-
progress.setLabel("Loading config…");
|
|
867
|
-
const cfg = loadConfig();
|
|
868
|
-
const osSummary = resolveOsSummary();
|
|
869
|
-
const snap = await readConfigFileSnapshot().catch(() => null);
|
|
870
|
-
progress.tick();
|
|
871
|
-
progress.setLabel("Checking Tailscale…");
|
|
872
|
-
const tailscaleMode = cfg.gateway?.tailscale?.mode ?? "off";
|
|
873
|
-
const tailscale = await (async () => {
|
|
874
|
-
try {
|
|
875
|
-
const parsed = await readTailscaleStatusJson(runExec, { timeoutMs: 1200 });
|
|
876
|
-
const backendState = typeof parsed.BackendState === "string" ? parsed.BackendState : null;
|
|
877
|
-
const self = typeof parsed.Self === "object" && parsed.Self !== null ? parsed.Self : null;
|
|
878
|
-
const dnsNameRaw = self && typeof self.DNSName === "string" ? self.DNSName : null;
|
|
879
|
-
return {
|
|
880
|
-
ok: true,
|
|
881
|
-
backendState,
|
|
882
|
-
dnsName: dnsNameRaw ? dnsNameRaw.replace(/\.$/, "") : null,
|
|
883
|
-
ips: self && Array.isArray(self.TailscaleIPs) ? self.TailscaleIPs.filter((v) => typeof v === "string" && v.trim().length > 0).map((v) => v.trim()) : [],
|
|
884
|
-
error: null
|
|
885
|
-
};
|
|
886
|
-
} catch (err) {
|
|
887
|
-
return {
|
|
888
|
-
ok: false,
|
|
889
|
-
backendState: null,
|
|
890
|
-
dnsName: null,
|
|
891
|
-
ips: [],
|
|
892
|
-
error: String(err)
|
|
893
|
-
};
|
|
894
|
-
}
|
|
895
|
-
})();
|
|
896
|
-
const tailscaleHttpsUrl = tailscaleMode !== "off" && tailscale.dnsName ? `https://${tailscale.dnsName}${normalizeControlUiBasePath(cfg.gateway?.controlUi?.basePath)}` : null;
|
|
897
|
-
progress.tick();
|
|
898
|
-
progress.setLabel("Checking for updates…");
|
|
899
|
-
const update = await checkUpdateStatus({
|
|
900
|
-
root: await resolveAnimaPackageRoot({
|
|
901
|
-
moduleUrl: import.meta.url,
|
|
902
|
-
argv1: process.argv[1],
|
|
903
|
-
cwd: process.cwd()
|
|
904
|
-
}),
|
|
905
|
-
timeoutMs: 6500,
|
|
906
|
-
fetchGit: true,
|
|
907
|
-
includeRegistry: true
|
|
908
|
-
});
|
|
909
|
-
const channelInfo = resolveEffectiveUpdateChannel({
|
|
910
|
-
configChannel: normalizeUpdateChannel(cfg.update?.channel),
|
|
911
|
-
installKind: update.installKind,
|
|
912
|
-
git: update.git ? {
|
|
913
|
-
tag: update.git.tag,
|
|
914
|
-
branch: update.git.branch
|
|
915
|
-
} : void 0
|
|
916
|
-
});
|
|
917
|
-
const channelLabel = formatUpdateChannelLabel({
|
|
918
|
-
channel: channelInfo.channel,
|
|
919
|
-
source: channelInfo.source,
|
|
920
|
-
gitTag: update.git?.tag ?? null,
|
|
921
|
-
gitBranch: update.git?.branch ?? null
|
|
922
|
-
});
|
|
923
|
-
const gitLabel = formatGitInstallLabel(update);
|
|
924
|
-
progress.tick();
|
|
925
|
-
progress.setLabel("Probing gateway…");
|
|
926
|
-
const connection = buildGatewayConnectionDetails({ config: cfg });
|
|
927
|
-
const isRemoteMode = cfg.gateway?.mode === "remote";
|
|
928
|
-
const remoteUrlRaw = typeof cfg.gateway?.remote?.url === "string" ? cfg.gateway.remote.url.trim() : "";
|
|
929
|
-
const remoteUrlMissing = isRemoteMode && !remoteUrlRaw;
|
|
930
|
-
const gatewayMode = isRemoteMode ? "remote" : "local";
|
|
931
|
-
const localFallbackAuth = resolveGatewayProbeAuth$1({
|
|
932
|
-
cfg,
|
|
933
|
-
mode: "local"
|
|
934
|
-
});
|
|
935
|
-
const remoteAuth = resolveGatewayProbeAuth$1({
|
|
936
|
-
cfg,
|
|
937
|
-
mode: "remote"
|
|
938
|
-
});
|
|
939
|
-
const probeAuth = isRemoteMode && !remoteUrlMissing ? remoteAuth : localFallbackAuth;
|
|
940
|
-
const gatewayProbe = await probeGateway({
|
|
941
|
-
url: connection.url,
|
|
942
|
-
auth: probeAuth,
|
|
943
|
-
timeoutMs: Math.min(5e3, opts?.timeoutMs ?? 1e4)
|
|
944
|
-
}).catch(() => null);
|
|
945
|
-
const gatewayReachable = gatewayProbe?.ok === true;
|
|
946
|
-
const gatewaySelf = pickGatewaySelfPresence(gatewayProbe?.presence ?? null);
|
|
947
|
-
progress.tick();
|
|
948
|
-
progress.setLabel("Checking services…");
|
|
949
|
-
const readServiceSummary = async (service) => {
|
|
950
|
-
try {
|
|
951
|
-
const [loaded, runtimeInfo, command] = await Promise.all([
|
|
952
|
-
service.isLoaded({ env: process.env }).catch(() => false),
|
|
953
|
-
service.readRuntime(process.env).catch(() => void 0),
|
|
954
|
-
service.readCommand(process.env).catch(() => null)
|
|
955
|
-
]);
|
|
956
|
-
const installed = command != null;
|
|
957
|
-
return {
|
|
958
|
-
label: service.label,
|
|
959
|
-
installed,
|
|
960
|
-
loaded,
|
|
961
|
-
loadedText: loaded ? service.loadedText : service.notLoadedText,
|
|
962
|
-
runtime: runtimeInfo
|
|
963
|
-
};
|
|
964
|
-
} catch {
|
|
965
|
-
return null;
|
|
966
|
-
}
|
|
967
|
-
};
|
|
968
|
-
const daemon = await readServiceSummary(resolveGatewayService());
|
|
969
|
-
const nodeService = await readServiceSummary(resolveNodeService());
|
|
970
|
-
progress.tick();
|
|
971
|
-
progress.setLabel("Scanning agents…");
|
|
972
|
-
const agentStatus = await getAgentLocalStatuses$1(cfg);
|
|
973
|
-
progress.tick();
|
|
974
|
-
progress.setLabel("Summarizing channels…");
|
|
975
|
-
const channels = await buildChannelsTable(cfg, { showSecrets: false });
|
|
976
|
-
progress.tick();
|
|
977
|
-
const connectionDetailsForReport = (() => {
|
|
978
|
-
if (!remoteUrlMissing) return connection.message;
|
|
979
|
-
const bindMode = cfg.gateway?.bind ?? "loopback";
|
|
980
|
-
return [
|
|
981
|
-
"Gateway mode: remote",
|
|
982
|
-
"Gateway target: (missing gateway.remote.url)",
|
|
983
|
-
`Config: ${snap?.path?.trim() ? snap.path.trim() : "(unknown config path)"}`,
|
|
984
|
-
`Bind: ${bindMode}`,
|
|
985
|
-
`Local fallback (used for probes): ${connection.url}`,
|
|
986
|
-
"Fix: set gateway.remote.url, or set gateway.mode=local."
|
|
987
|
-
].join("\n");
|
|
988
|
-
})();
|
|
989
|
-
const callOverrides = remoteUrlMissing ? {
|
|
990
|
-
url: connection.url,
|
|
991
|
-
token: localFallbackAuth.token,
|
|
992
|
-
password: localFallbackAuth.password
|
|
993
|
-
} : {};
|
|
994
|
-
progress.setLabel("Querying gateway…");
|
|
995
|
-
const health = gatewayReachable ? await callGateway({
|
|
996
|
-
method: "health",
|
|
997
|
-
timeoutMs: Math.min(8e3, opts?.timeoutMs ?? 1e4),
|
|
998
|
-
...callOverrides
|
|
999
|
-
}).catch((err) => ({ error: String(err) })) : { error: gatewayProbe?.error ?? "gateway unreachable" };
|
|
1000
|
-
const channelsStatus = gatewayReachable ? await callGateway({
|
|
1001
|
-
method: "channels.status",
|
|
1002
|
-
params: {
|
|
1003
|
-
probe: false,
|
|
1004
|
-
timeoutMs: opts?.timeoutMs ?? 1e4
|
|
1005
|
-
},
|
|
1006
|
-
timeoutMs: Math.min(8e3, opts?.timeoutMs ?? 1e4),
|
|
1007
|
-
...callOverrides
|
|
1008
|
-
}).catch(() => null) : null;
|
|
1009
|
-
const channelIssues = channelsStatus ? collectChannelStatusIssues(channelsStatus) : [];
|
|
1010
|
-
progress.tick();
|
|
1011
|
-
progress.setLabel("Checking local state…");
|
|
1012
|
-
const sentinel = await readRestartSentinel().catch(() => null);
|
|
1013
|
-
const lastErr = await readLastGatewayErrorLine(process.env).catch(() => null);
|
|
1014
|
-
const port = resolveGatewayPort(cfg);
|
|
1015
|
-
const portUsage = await inspectPortUsage(port).catch(() => null);
|
|
1016
|
-
progress.tick();
|
|
1017
|
-
const defaultWorkspace = agentStatus.agents.find((a) => a.id === agentStatus.defaultId)?.workspaceDir ?? agentStatus.agents[0]?.workspaceDir ?? null;
|
|
1018
|
-
const skillStatus = defaultWorkspace != null ? (() => {
|
|
1019
|
-
try {
|
|
1020
|
-
return buildWorkspaceSkillStatus(defaultWorkspace, {
|
|
1021
|
-
config: cfg,
|
|
1022
|
-
eligibility: { remote: getRemoteSkillEligibility() }
|
|
1023
|
-
});
|
|
1024
|
-
} catch {
|
|
1025
|
-
return null;
|
|
1026
|
-
}
|
|
1027
|
-
})() : null;
|
|
1028
|
-
const dashboard = cfg.gateway?.controlUi?.enabled ?? true ? resolveControlUiLinks({
|
|
1029
|
-
port,
|
|
1030
|
-
bind: cfg.gateway?.bind,
|
|
1031
|
-
customBindHost: cfg.gateway?.customBindHost,
|
|
1032
|
-
basePath: cfg.gateway?.controlUi?.basePath
|
|
1033
|
-
}).httpUrl : null;
|
|
1034
|
-
const updateLine = (() => {
|
|
1035
|
-
const appendRegistryAndDepsStatus = (parts) => {
|
|
1036
|
-
const latest = update.registry?.latestVersion;
|
|
1037
|
-
if (latest) {
|
|
1038
|
-
const cmp = compareSemverStrings(VERSION, latest);
|
|
1039
|
-
if (cmp === 0) parts.push(`npm latest ${latest}`);
|
|
1040
|
-
else if (cmp != null && cmp < 0) parts.push(`npm update ${latest}`);
|
|
1041
|
-
else parts.push(`npm latest ${latest} (local newer)`);
|
|
1042
|
-
} else if (update.registry?.error) parts.push("npm latest unknown");
|
|
1043
|
-
if (update.deps?.status === "ok") parts.push("deps ok");
|
|
1044
|
-
if (update.deps?.status === "stale") parts.push("deps stale");
|
|
1045
|
-
if (update.deps?.status === "missing") parts.push("deps missing");
|
|
1046
|
-
};
|
|
1047
|
-
if (update.installKind === "git" && update.git) {
|
|
1048
|
-
const parts = [];
|
|
1049
|
-
parts.push(update.git.branch ? `git ${update.git.branch}` : "git");
|
|
1050
|
-
if (update.git.upstream) parts.push(`↔ ${update.git.upstream}`);
|
|
1051
|
-
if (update.git.dirty) parts.push("dirty");
|
|
1052
|
-
if (update.git.behind != null && update.git.ahead != null) if (update.git.behind === 0 && update.git.ahead === 0) parts.push("up to date");
|
|
1053
|
-
else if (update.git.behind > 0 && update.git.ahead === 0) parts.push(`behind ${update.git.behind}`);
|
|
1054
|
-
else if (update.git.behind === 0 && update.git.ahead > 0) parts.push(`ahead ${update.git.ahead}`);
|
|
1055
|
-
else parts.push(`diverged (ahead ${update.git.ahead}, behind ${update.git.behind})`);
|
|
1056
|
-
if (update.git.fetchOk === false) parts.push("fetch failed");
|
|
1057
|
-
appendRegistryAndDepsStatus(parts);
|
|
1058
|
-
return parts.join(" · ");
|
|
1059
|
-
}
|
|
1060
|
-
const parts = [];
|
|
1061
|
-
parts.push(update.packageManager !== "unknown" ? update.packageManager : "pkg");
|
|
1062
|
-
appendRegistryAndDepsStatus(parts);
|
|
1063
|
-
return parts.join(" · ");
|
|
1064
|
-
})();
|
|
1065
|
-
const gatewayTarget = remoteUrlMissing ? `fallback ${connection.url}` : connection.url;
|
|
1066
|
-
const gatewayStatus = gatewayReachable ? `reachable ${formatDurationPrecise(gatewayProbe?.connectLatencyMs ?? 0)}` : gatewayProbe?.error ? `unreachable (${gatewayProbe.error})` : "unreachable";
|
|
1067
|
-
const gatewayAuth = gatewayReachable ? ` · auth ${formatGatewayAuthUsed(probeAuth)}` : "";
|
|
1068
|
-
const gatewaySelfLine = gatewaySelf?.host || gatewaySelf?.ip || gatewaySelf?.version || gatewaySelf?.platform ? [
|
|
1069
|
-
gatewaySelf.host ? gatewaySelf.host : null,
|
|
1070
|
-
gatewaySelf.ip ? `(${gatewaySelf.ip})` : null,
|
|
1071
|
-
gatewaySelf.version ? `app ${gatewaySelf.version}` : null,
|
|
1072
|
-
gatewaySelf.platform ? gatewaySelf.platform : null
|
|
1073
|
-
].filter(Boolean).join(" ") : null;
|
|
1074
|
-
const aliveThresholdMs = 10 * 6e4;
|
|
1075
|
-
const aliveAgents = agentStatus.agents.filter((a) => a.lastActiveAgeMs != null && a.lastActiveAgeMs <= aliveThresholdMs).length;
|
|
1076
|
-
const lines = await buildStatusAllReportLines({
|
|
1077
|
-
progress,
|
|
1078
|
-
overviewRows: [
|
|
1079
|
-
{
|
|
1080
|
-
Item: "Version",
|
|
1081
|
-
Value: VERSION
|
|
1082
|
-
},
|
|
1083
|
-
{
|
|
1084
|
-
Item: "OS",
|
|
1085
|
-
Value: osSummary.label
|
|
1086
|
-
},
|
|
1087
|
-
{
|
|
1088
|
-
Item: "Node",
|
|
1089
|
-
Value: process.versions.node
|
|
1090
|
-
},
|
|
1091
|
-
{
|
|
1092
|
-
Item: "Config",
|
|
1093
|
-
Value: snap?.path?.trim() ? snap.path.trim() : "(unknown config path)"
|
|
1094
|
-
},
|
|
1095
|
-
dashboard ? {
|
|
1096
|
-
Item: "Dashboard",
|
|
1097
|
-
Value: dashboard
|
|
1098
|
-
} : {
|
|
1099
|
-
Item: "Dashboard",
|
|
1100
|
-
Value: "disabled"
|
|
1101
|
-
},
|
|
1102
|
-
{
|
|
1103
|
-
Item: "Tailscale",
|
|
1104
|
-
Value: tailscaleMode === "off" ? `off${tailscale.backendState ? ` · ${tailscale.backendState}` : ""}${tailscale.dnsName ? ` · ${tailscale.dnsName}` : ""}` : tailscale.dnsName && tailscaleHttpsUrl ? `${tailscaleMode} · ${tailscale.backendState ?? "unknown"} · ${tailscale.dnsName} · ${tailscaleHttpsUrl}` : `${tailscaleMode} · ${tailscale.backendState ?? "unknown"} · magicdns unknown`
|
|
1105
|
-
},
|
|
1106
|
-
{
|
|
1107
|
-
Item: "Channel",
|
|
1108
|
-
Value: channelLabel
|
|
1109
|
-
},
|
|
1110
|
-
...gitLabel ? [{
|
|
1111
|
-
Item: "Git",
|
|
1112
|
-
Value: gitLabel
|
|
1113
|
-
}] : [],
|
|
1114
|
-
{
|
|
1115
|
-
Item: "Update",
|
|
1116
|
-
Value: updateLine
|
|
1117
|
-
},
|
|
1118
|
-
{
|
|
1119
|
-
Item: "Gateway",
|
|
1120
|
-
Value: `${gatewayMode}${remoteUrlMissing ? " (remote.url missing)" : ""} · ${gatewayTarget} (${connection.urlSource}) · ${gatewayStatus}${gatewayAuth}`
|
|
1121
|
-
},
|
|
1122
|
-
{
|
|
1123
|
-
Item: "Security",
|
|
1124
|
-
Value: `Run: ${formatCliCommand("anima security audit --deep")}`
|
|
1125
|
-
},
|
|
1126
|
-
gatewaySelfLine ? {
|
|
1127
|
-
Item: "Gateway self",
|
|
1128
|
-
Value: gatewaySelfLine
|
|
1129
|
-
} : {
|
|
1130
|
-
Item: "Gateway self",
|
|
1131
|
-
Value: "unknown"
|
|
1132
|
-
},
|
|
1133
|
-
daemon ? {
|
|
1134
|
-
Item: "Gateway service",
|
|
1135
|
-
Value: !daemon.installed ? `${daemon.label} not installed` : `${daemon.label} ${daemon.installed ? "installed · " : ""}${daemon.loadedText}${daemon.runtime?.status ? ` · ${daemon.runtime.status}` : ""}${daemon.runtime?.pid ? ` (pid ${daemon.runtime.pid})` : ""}`
|
|
1136
|
-
} : {
|
|
1137
|
-
Item: "Gateway service",
|
|
1138
|
-
Value: "unknown"
|
|
1139
|
-
},
|
|
1140
|
-
nodeService ? {
|
|
1141
|
-
Item: "Node service",
|
|
1142
|
-
Value: !nodeService.installed ? `${nodeService.label} not installed` : `${nodeService.label} ${nodeService.installed ? "installed · " : ""}${nodeService.loadedText}${nodeService.runtime?.status ? ` · ${nodeService.runtime.status}` : ""}${nodeService.runtime?.pid ? ` (pid ${nodeService.runtime.pid})` : ""}`
|
|
1143
|
-
} : {
|
|
1144
|
-
Item: "Node service",
|
|
1145
|
-
Value: "unknown"
|
|
1146
|
-
},
|
|
1147
|
-
{
|
|
1148
|
-
Item: "Agents",
|
|
1149
|
-
Value: `${agentStatus.agents.length} total · ${agentStatus.bootstrapPendingCount} bootstrapping · ${aliveAgents} active · ${agentStatus.totalSessions} sessions`
|
|
1150
|
-
}
|
|
1151
|
-
],
|
|
1152
|
-
channels,
|
|
1153
|
-
channelIssues: channelIssues.map((issue) => ({
|
|
1154
|
-
channel: issue.channel,
|
|
1155
|
-
message: issue.message
|
|
1156
|
-
})),
|
|
1157
|
-
agentStatus,
|
|
1158
|
-
connectionDetailsForReport,
|
|
1159
|
-
diagnosis: {
|
|
1160
|
-
snap,
|
|
1161
|
-
remoteUrlMissing,
|
|
1162
|
-
sentinel,
|
|
1163
|
-
lastErr,
|
|
1164
|
-
port,
|
|
1165
|
-
portUsage,
|
|
1166
|
-
tailscaleMode,
|
|
1167
|
-
tailscale,
|
|
1168
|
-
tailscaleHttpsUrl,
|
|
1169
|
-
skillStatus,
|
|
1170
|
-
channelsStatus,
|
|
1171
|
-
channelIssues,
|
|
1172
|
-
gatewayReachable,
|
|
1173
|
-
health
|
|
1174
|
-
}
|
|
1175
|
-
});
|
|
1176
|
-
progress.setLabel("Rendering…");
|
|
1177
|
-
runtime.log(lines.join("\n"));
|
|
1178
|
-
progress.tick();
|
|
1179
|
-
});
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
|
-
//#endregion
|
|
1183
|
-
//#region src/commands/status.format.ts
|
|
1184
|
-
const formatKTokens = (value) => `${(value / 1e3).toFixed(value >= 1e4 ? 0 : 1)}k`;
|
|
1185
|
-
const formatDuration = (ms) => {
|
|
1186
|
-
if (ms == null || !Number.isFinite(ms)) return "unknown";
|
|
1187
|
-
return formatDurationPrecise(ms, { decimals: 1 });
|
|
1188
|
-
};
|
|
1189
|
-
const shortenText = (value, maxLen) => {
|
|
1190
|
-
const chars = Array.from(value);
|
|
1191
|
-
if (chars.length <= maxLen) return value;
|
|
1192
|
-
return `${chars.slice(0, Math.max(0, maxLen - 1)).join("")}…`;
|
|
1193
|
-
};
|
|
1194
|
-
const formatTokensCompact = (sess) => {
|
|
1195
|
-
const used = sess.totalTokens;
|
|
1196
|
-
const ctx = sess.contextTokens;
|
|
1197
|
-
if (used == null) return ctx ? `unknown/${formatKTokens(ctx)} (?%)` : "unknown used";
|
|
1198
|
-
if (!ctx) return `${formatKTokens(used)} used`;
|
|
1199
|
-
const pctLabel = sess.percentUsed != null ? `${sess.percentUsed}%` : "?%";
|
|
1200
|
-
return `${formatKTokens(used)}/${formatKTokens(ctx)} (${pctLabel})`;
|
|
1201
|
-
};
|
|
1202
|
-
const formatDaemonRuntimeShort = (runtime) => {
|
|
1203
|
-
if (!runtime) return null;
|
|
1204
|
-
const status = runtime.status ?? "unknown";
|
|
1205
|
-
const details = [];
|
|
1206
|
-
if (runtime.pid) details.push(`pid ${runtime.pid}`);
|
|
1207
|
-
if (runtime.state && runtime.state.toLowerCase() !== status) details.push(`state ${runtime.state}`);
|
|
1208
|
-
const detail = runtime.detail?.replace(/\s+/g, " ").trim() || "";
|
|
1209
|
-
const noisyLaunchctlDetail = runtime.missingUnit === true && detail.toLowerCase().includes("could not find service");
|
|
1210
|
-
if (detail && !noisyLaunchctlDetail) details.push(detail);
|
|
1211
|
-
return details.length > 0 ? `${status} (${details.join(", ")})` : status;
|
|
1212
|
-
};
|
|
1213
|
-
|
|
1214
|
-
//#endregion
|
|
1215
|
-
//#region src/commands/status.daemon.ts
|
|
1216
|
-
async function buildDaemonStatusSummary(service, fallbackLabel) {
|
|
1217
|
-
try {
|
|
1218
|
-
const [loaded, runtime, command] = await Promise.all([
|
|
1219
|
-
service.isLoaded({ env: process.env }).catch(() => false),
|
|
1220
|
-
service.readRuntime(process.env).catch(() => void 0),
|
|
1221
|
-
service.readCommand(process.env).catch(() => null)
|
|
1222
|
-
]);
|
|
1223
|
-
const installed = command != null;
|
|
1224
|
-
const loadedText = loaded ? service.loadedText : service.notLoadedText;
|
|
1225
|
-
const runtimeShort = formatDaemonRuntimeShort(runtime);
|
|
1226
|
-
return {
|
|
1227
|
-
label: service.label,
|
|
1228
|
-
installed,
|
|
1229
|
-
loadedText,
|
|
1230
|
-
runtimeShort
|
|
1231
|
-
};
|
|
1232
|
-
} catch {
|
|
1233
|
-
return {
|
|
1234
|
-
label: fallbackLabel,
|
|
1235
|
-
installed: null,
|
|
1236
|
-
loadedText: "unknown",
|
|
1237
|
-
runtimeShort: null
|
|
1238
|
-
};
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
async function getDaemonStatusSummary() {
|
|
1242
|
-
return await buildDaemonStatusSummary(resolveGatewayService(), "Daemon");
|
|
1243
|
-
}
|
|
1244
|
-
async function getNodeDaemonStatusSummary() {
|
|
1245
|
-
return await buildDaemonStatusSummary(resolveNodeService(), "Node");
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
//#endregion
|
|
1249
|
-
//#region src/commands/status.gateway-probe.ts
|
|
1250
|
-
function resolveGatewayProbeAuth(cfg) {
|
|
1251
|
-
const isRemoteMode = cfg.gateway?.mode === "remote";
|
|
1252
|
-
const remote = isRemoteMode ? cfg.gateway?.remote : void 0;
|
|
1253
|
-
const authToken = cfg.gateway?.auth?.token;
|
|
1254
|
-
const authPassword = cfg.gateway?.auth?.password;
|
|
1255
|
-
return {
|
|
1256
|
-
token: isRemoteMode ? typeof remote?.token === "string" && remote.token.trim().length > 0 ? remote.token.trim() : void 0 : process.env.ANIMA_GATEWAY_TOKEN?.trim() || (typeof authToken === "string" && authToken.trim().length > 0 ? authToken.trim() : void 0),
|
|
1257
|
-
password: process.env.ANIMA_GATEWAY_PASSWORD?.trim() || (isRemoteMode ? typeof remote?.password === "string" && remote.password.trim().length > 0 ? remote.password.trim() : void 0 : typeof authPassword === "string" && authPassword.trim().length > 0 ? authPassword.trim() : void 0)
|
|
1258
|
-
};
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
//#endregion
|
|
1262
|
-
//#region src/commands/status.agent-local.ts
|
|
1263
|
-
async function fileExists(p) {
|
|
1264
|
-
try {
|
|
1265
|
-
await fs$1.access(p);
|
|
1266
|
-
return true;
|
|
1267
|
-
} catch {
|
|
1268
|
-
return false;
|
|
1269
|
-
}
|
|
1270
|
-
}
|
|
1271
|
-
async function getAgentLocalStatuses() {
|
|
1272
|
-
const cfg = loadConfig();
|
|
1273
|
-
const agentList = listAgentsForGateway(cfg);
|
|
1274
|
-
const now = Date.now();
|
|
1275
|
-
const statuses = [];
|
|
1276
|
-
for (const agent of agentList.agents) {
|
|
1277
|
-
const agentId = agent.id;
|
|
1278
|
-
const workspaceDir = (() => {
|
|
1279
|
-
try {
|
|
1280
|
-
return resolveAgentWorkspaceDir(cfg, agentId);
|
|
1281
|
-
} catch {
|
|
1282
|
-
return null;
|
|
1283
|
-
}
|
|
1284
|
-
})();
|
|
1285
|
-
const bootstrapPath = workspaceDir != null ? path.join(workspaceDir, "BOOTSTRAP.md") : null;
|
|
1286
|
-
const bootstrapPending = bootstrapPath != null ? await fileExists(bootstrapPath) : null;
|
|
1287
|
-
const sessionsPath = resolveStorePath(cfg.session?.store, { agentId });
|
|
1288
|
-
const store = (() => {
|
|
1289
|
-
try {
|
|
1290
|
-
return loadSessionStore(sessionsPath);
|
|
1291
|
-
} catch {
|
|
1292
|
-
return {};
|
|
1293
|
-
}
|
|
1294
|
-
})();
|
|
1295
|
-
const sessions = Object.entries(store).filter(([key]) => key !== "global" && key !== "unknown").map(([, entry]) => entry);
|
|
1296
|
-
const sessionsCount = sessions.length;
|
|
1297
|
-
const lastUpdatedAt = sessions.reduce((max, e) => Math.max(max, e?.updatedAt ?? 0), 0);
|
|
1298
|
-
const resolvedLastUpdatedAt = lastUpdatedAt > 0 ? lastUpdatedAt : null;
|
|
1299
|
-
const lastActiveAgeMs = resolvedLastUpdatedAt ? now - resolvedLastUpdatedAt : null;
|
|
1300
|
-
statuses.push({
|
|
1301
|
-
id: agentId,
|
|
1302
|
-
name: agent.name,
|
|
1303
|
-
workspaceDir,
|
|
1304
|
-
bootstrapPending,
|
|
1305
|
-
sessionsPath,
|
|
1306
|
-
sessionsCount,
|
|
1307
|
-
lastUpdatedAt: resolvedLastUpdatedAt,
|
|
1308
|
-
lastActiveAgeMs
|
|
1309
|
-
});
|
|
1310
|
-
}
|
|
1311
|
-
const totalSessions = statuses.reduce((sum, s) => sum + s.sessionsCount, 0);
|
|
1312
|
-
const bootstrapPendingCount = statuses.reduce((sum, s) => sum + (s.bootstrapPending ? 1 : 0), 0);
|
|
1313
|
-
return {
|
|
1314
|
-
defaultId: agentList.defaultId,
|
|
1315
|
-
agents: statuses,
|
|
1316
|
-
totalSessions,
|
|
1317
|
-
bootstrapPendingCount
|
|
1318
|
-
};
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
//#endregion
|
|
1322
|
-
//#region src/commands/status.link-channel.ts
|
|
1323
|
-
async function resolveLinkChannelContext(cfg) {
|
|
1324
|
-
for (const plugin of listChannelPlugins()) {
|
|
1325
|
-
const defaultAccountId = resolveChannelDefaultAccountId({
|
|
1326
|
-
plugin,
|
|
1327
|
-
cfg,
|
|
1328
|
-
accountIds: plugin.config.listAccountIds(cfg)
|
|
1329
|
-
});
|
|
1330
|
-
const account = plugin.config.resolveAccount(cfg, defaultAccountId);
|
|
1331
|
-
const enabled = plugin.config.isEnabled ? plugin.config.isEnabled(account, cfg) : true;
|
|
1332
|
-
const configured = plugin.config.isConfigured ? await plugin.config.isConfigured(account, cfg) : true;
|
|
1333
|
-
const snapshot = plugin.config.describeAccount ? plugin.config.describeAccount(account, cfg) : {
|
|
1334
|
-
accountId: defaultAccountId,
|
|
1335
|
-
enabled,
|
|
1336
|
-
configured
|
|
1337
|
-
};
|
|
1338
|
-
const summaryRecord = plugin.status?.buildChannelSummary ? await plugin.status.buildChannelSummary({
|
|
1339
|
-
account,
|
|
1340
|
-
cfg,
|
|
1341
|
-
defaultAccountId,
|
|
1342
|
-
snapshot
|
|
1343
|
-
}) : void 0;
|
|
1344
|
-
const linked = summaryRecord && typeof summaryRecord.linked === "boolean" ? summaryRecord.linked : null;
|
|
1345
|
-
if (linked === null) continue;
|
|
1346
|
-
return {
|
|
1347
|
-
linked,
|
|
1348
|
-
authAgeMs: summaryRecord && typeof summaryRecord.authAgeMs === "number" ? summaryRecord.authAgeMs : null,
|
|
1349
|
-
account,
|
|
1350
|
-
accountId: defaultAccountId,
|
|
1351
|
-
plugin
|
|
1352
|
-
};
|
|
1353
|
-
}
|
|
1354
|
-
return null;
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
//#endregion
|
|
1358
|
-
//#region src/commands/status.summary.ts
|
|
1359
|
-
const classifyKey = (key, entry) => {
|
|
1360
|
-
if (key === "global") return "global";
|
|
1361
|
-
if (key === "unknown") return "unknown";
|
|
1362
|
-
if (entry?.chatType === "group" || entry?.chatType === "channel") return "group";
|
|
1363
|
-
if (key.includes(":group:") || key.includes(":channel:")) return "group";
|
|
1364
|
-
return "direct";
|
|
1365
|
-
};
|
|
1366
|
-
const buildFlags = (entry) => {
|
|
1367
|
-
if (!entry) return [];
|
|
1368
|
-
const flags = [];
|
|
1369
|
-
const think = entry?.thinkingLevel;
|
|
1370
|
-
if (typeof think === "string" && think.length > 0) flags.push(`think:${think}`);
|
|
1371
|
-
const verbose = entry?.verboseLevel;
|
|
1372
|
-
if (typeof verbose === "string" && verbose.length > 0) flags.push(`verbose:${verbose}`);
|
|
1373
|
-
const reasoning = entry?.reasoningLevel;
|
|
1374
|
-
if (typeof reasoning === "string" && reasoning.length > 0) flags.push(`reasoning:${reasoning}`);
|
|
1375
|
-
const elevated = entry?.elevatedLevel;
|
|
1376
|
-
if (typeof elevated === "string" && elevated.length > 0) flags.push(`elevated:${elevated}`);
|
|
1377
|
-
if (entry?.systemSent) flags.push("system");
|
|
1378
|
-
if (entry?.abortedLastRun) flags.push("aborted");
|
|
1379
|
-
const sessionId = entry?.sessionId;
|
|
1380
|
-
if (typeof sessionId === "string" && sessionId.length > 0) flags.push(`id:${sessionId}`);
|
|
1381
|
-
return flags;
|
|
1382
|
-
};
|
|
1383
|
-
function redactSensitiveStatusSummary(summary) {
|
|
1384
|
-
return {
|
|
1385
|
-
...summary,
|
|
1386
|
-
sessions: {
|
|
1387
|
-
...summary.sessions,
|
|
1388
|
-
paths: [],
|
|
1389
|
-
defaults: {
|
|
1390
|
-
model: null,
|
|
1391
|
-
contextTokens: null
|
|
1392
|
-
},
|
|
1393
|
-
recent: [],
|
|
1394
|
-
byAgent: summary.sessions.byAgent.map((entry) => ({
|
|
1395
|
-
...entry,
|
|
1396
|
-
path: "[redacted]",
|
|
1397
|
-
recent: []
|
|
1398
|
-
}))
|
|
1399
|
-
}
|
|
1400
|
-
};
|
|
1401
|
-
}
|
|
1402
|
-
async function getStatusSummary(options = {}) {
|
|
1403
|
-
const { includeSensitive = true } = options;
|
|
1404
|
-
const cfg = loadConfig();
|
|
1405
|
-
const linkContext = await resolveLinkChannelContext(cfg);
|
|
1406
|
-
const agentList = listAgentsForGateway(cfg);
|
|
1407
|
-
const heartbeatAgents = agentList.agents.map((agent) => {
|
|
1408
|
-
const summary = resolveHeartbeatSummaryForAgent(cfg, agent.id);
|
|
1409
|
-
return {
|
|
1410
|
-
agentId: agent.id,
|
|
1411
|
-
enabled: summary.enabled,
|
|
1412
|
-
every: summary.every,
|
|
1413
|
-
everyMs: summary.everyMs
|
|
1414
|
-
};
|
|
1415
|
-
});
|
|
1416
|
-
const channelSummary = await buildChannelSummary(cfg, {
|
|
1417
|
-
colorize: true,
|
|
1418
|
-
includeAllowFrom: true
|
|
1419
|
-
});
|
|
1420
|
-
const queuedSystemEvents = peekSystemEvents(resolveMainSessionKey(cfg));
|
|
1421
|
-
const configModel = resolveConfiguredModelRef({
|
|
1422
|
-
cfg,
|
|
1423
|
-
defaultProvider: DEFAULT_PROVIDER,
|
|
1424
|
-
defaultModel: DEFAULT_MODEL
|
|
1425
|
-
}).model ?? DEFAULT_MODEL;
|
|
1426
|
-
const configContextTokens = cfg.agents?.defaults?.contextTokens ?? lookupContextTokens(configModel) ?? DEFAULT_CONTEXT_TOKENS;
|
|
1427
|
-
const now = Date.now();
|
|
1428
|
-
const storeCache = /* @__PURE__ */ new Map();
|
|
1429
|
-
const loadStore = (storePath) => {
|
|
1430
|
-
const cached = storeCache.get(storePath);
|
|
1431
|
-
if (cached) return cached;
|
|
1432
|
-
const store = loadSessionStore(storePath);
|
|
1433
|
-
storeCache.set(storePath, store);
|
|
1434
|
-
return store;
|
|
1435
|
-
};
|
|
1436
|
-
const buildSessionRows = (store, opts = {}) => Object.entries(store).filter(([key]) => key !== "global" && key !== "unknown").map(([key, entry]) => {
|
|
1437
|
-
const updatedAt = entry?.updatedAt ?? null;
|
|
1438
|
-
const age = updatedAt ? now - updatedAt : null;
|
|
1439
|
-
const model = entry?.model ?? configModel ?? null;
|
|
1440
|
-
const contextTokens = entry?.contextTokens ?? lookupContextTokens(model) ?? configContextTokens ?? null;
|
|
1441
|
-
const total = resolveFreshSessionTotalTokens(entry);
|
|
1442
|
-
const totalTokensFresh = typeof entry?.totalTokens === "number" ? entry?.totalTokensFresh !== false : false;
|
|
1443
|
-
const remaining = contextTokens != null && total !== void 0 ? Math.max(0, contextTokens - total) : null;
|
|
1444
|
-
const pct = contextTokens && contextTokens > 0 && total !== void 0 ? Math.min(999, Math.round(total / contextTokens * 100)) : null;
|
|
1445
|
-
const parsedAgentId = parseAgentSessionKey(key)?.agentId;
|
|
1446
|
-
return {
|
|
1447
|
-
agentId: opts.agentIdOverride ?? parsedAgentId,
|
|
1448
|
-
key,
|
|
1449
|
-
kind: classifyKey(key, entry),
|
|
1450
|
-
sessionId: entry?.sessionId,
|
|
1451
|
-
updatedAt,
|
|
1452
|
-
age,
|
|
1453
|
-
thinkingLevel: entry?.thinkingLevel,
|
|
1454
|
-
verboseLevel: entry?.verboseLevel,
|
|
1455
|
-
reasoningLevel: entry?.reasoningLevel,
|
|
1456
|
-
elevatedLevel: entry?.elevatedLevel,
|
|
1457
|
-
systemSent: entry?.systemSent,
|
|
1458
|
-
abortedLastRun: entry?.abortedLastRun,
|
|
1459
|
-
inputTokens: entry?.inputTokens,
|
|
1460
|
-
outputTokens: entry?.outputTokens,
|
|
1461
|
-
totalTokens: total ?? null,
|
|
1462
|
-
totalTokensFresh,
|
|
1463
|
-
remainingTokens: remaining,
|
|
1464
|
-
percentUsed: pct,
|
|
1465
|
-
model,
|
|
1466
|
-
contextTokens,
|
|
1467
|
-
flags: buildFlags(entry)
|
|
1468
|
-
};
|
|
1469
|
-
}).sort((a, b) => (b.updatedAt ?? 0) - (a.updatedAt ?? 0));
|
|
1470
|
-
const paths = /* @__PURE__ */ new Set();
|
|
1471
|
-
const byAgent = agentList.agents.map((agent) => {
|
|
1472
|
-
const storePath = resolveStorePath(cfg.session?.store, { agentId: agent.id });
|
|
1473
|
-
paths.add(storePath);
|
|
1474
|
-
const sessions = buildSessionRows(loadStore(storePath), { agentIdOverride: agent.id });
|
|
1475
|
-
return {
|
|
1476
|
-
agentId: agent.id,
|
|
1477
|
-
path: storePath,
|
|
1478
|
-
count: sessions.length,
|
|
1479
|
-
recent: sessions.slice(0, 10)
|
|
1480
|
-
};
|
|
1481
|
-
});
|
|
1482
|
-
const allSessions = Array.from(paths).flatMap((storePath) => buildSessionRows(loadStore(storePath))).toSorted((a, b) => (b.updatedAt ?? 0) - (a.updatedAt ?? 0));
|
|
1483
|
-
const recent = allSessions.slice(0, 10);
|
|
1484
|
-
const totalSessions = allSessions.length;
|
|
1485
|
-
const summary = {
|
|
1486
|
-
linkChannel: linkContext ? {
|
|
1487
|
-
id: linkContext.plugin.id,
|
|
1488
|
-
label: linkContext.plugin.meta.label ?? "Channel",
|
|
1489
|
-
linked: linkContext.linked,
|
|
1490
|
-
authAgeMs: linkContext.authAgeMs
|
|
1491
|
-
} : void 0,
|
|
1492
|
-
heartbeat: {
|
|
1493
|
-
defaultAgentId: agentList.defaultId,
|
|
1494
|
-
agents: heartbeatAgents
|
|
1495
|
-
},
|
|
1496
|
-
channelSummary,
|
|
1497
|
-
queuedSystemEvents,
|
|
1498
|
-
sessions: {
|
|
1499
|
-
paths: Array.from(paths),
|
|
1500
|
-
count: totalSessions,
|
|
1501
|
-
defaults: {
|
|
1502
|
-
model: configModel ?? null,
|
|
1503
|
-
contextTokens: configContextTokens ?? null
|
|
1504
|
-
},
|
|
1505
|
-
recent,
|
|
1506
|
-
byAgent
|
|
1507
|
-
}
|
|
1508
|
-
};
|
|
1509
|
-
return includeSensitive ? summary : redactSensitiveStatusSummary(summary);
|
|
1510
|
-
}
|
|
1511
|
-
|
|
1512
|
-
//#endregion
|
|
1513
|
-
//#region src/commands/status.scan.ts
|
|
1514
|
-
function resolveMemoryPluginStatus(cfg) {
|
|
1515
|
-
if (!(cfg.plugins?.enabled !== false)) return {
|
|
1516
|
-
enabled: false,
|
|
1517
|
-
slot: null,
|
|
1518
|
-
reason: "plugins disabled"
|
|
1519
|
-
};
|
|
1520
|
-
const raw = typeof cfg.plugins?.slots?.memory === "string" ? cfg.plugins.slots.memory.trim() : "";
|
|
1521
|
-
if (raw && raw.toLowerCase() === "none") return {
|
|
1522
|
-
enabled: false,
|
|
1523
|
-
slot: null,
|
|
1524
|
-
reason: "plugins.slots.memory=\"none\""
|
|
1525
|
-
};
|
|
1526
|
-
return {
|
|
1527
|
-
enabled: true,
|
|
1528
|
-
slot: raw || "memory-core"
|
|
1529
|
-
};
|
|
1530
|
-
}
|
|
1531
|
-
async function scanStatus(opts, _runtime) {
|
|
1532
|
-
return await withProgress({
|
|
1533
|
-
label: "Scanning status…",
|
|
1534
|
-
total: 10,
|
|
1535
|
-
enabled: opts.json !== true
|
|
1536
|
-
}, async (progress) => {
|
|
1537
|
-
progress.setLabel("Loading config…");
|
|
1538
|
-
const cfg = loadConfig();
|
|
1539
|
-
const osSummary = resolveOsSummary();
|
|
1540
|
-
progress.tick();
|
|
1541
|
-
progress.setLabel("Checking Tailscale…");
|
|
1542
|
-
const tailscaleMode = cfg.gateway?.tailscale?.mode ?? "off";
|
|
1543
|
-
const tailscaleDns = tailscaleMode === "off" ? null : await getTailnetHostname((cmd, args) => runExec(cmd, args, {
|
|
1544
|
-
timeoutMs: 1200,
|
|
1545
|
-
maxBuffer: 2e5
|
|
1546
|
-
})).catch(() => null);
|
|
1547
|
-
const tailscaleHttpsUrl = tailscaleMode !== "off" && tailscaleDns ? `https://${tailscaleDns}${normalizeControlUiBasePath(cfg.gateway?.controlUi?.basePath)}` : null;
|
|
1548
|
-
progress.tick();
|
|
1549
|
-
progress.setLabel("Checking for updates…");
|
|
1550
|
-
const update = await getUpdateCheckResult({
|
|
1551
|
-
timeoutMs: opts.all ? 6500 : 2500,
|
|
1552
|
-
fetchGit: true,
|
|
1553
|
-
includeRegistry: true
|
|
1554
|
-
});
|
|
1555
|
-
progress.tick();
|
|
1556
|
-
progress.setLabel("Resolving agents…");
|
|
1557
|
-
const agentStatus = await getAgentLocalStatuses();
|
|
1558
|
-
progress.tick();
|
|
1559
|
-
progress.setLabel("Probing gateway…");
|
|
1560
|
-
const gatewayConnection = buildGatewayConnectionDetails();
|
|
1561
|
-
const isRemoteMode = cfg.gateway?.mode === "remote";
|
|
1562
|
-
const remoteUrlRaw = typeof cfg.gateway?.remote?.url === "string" ? cfg.gateway.remote.url : "";
|
|
1563
|
-
const remoteUrlMissing = isRemoteMode && !remoteUrlRaw.trim();
|
|
1564
|
-
const gatewayMode = isRemoteMode ? "remote" : "local";
|
|
1565
|
-
const gatewayProbe = remoteUrlMissing ? null : await probeGateway({
|
|
1566
|
-
url: gatewayConnection.url,
|
|
1567
|
-
auth: resolveGatewayProbeAuth(cfg),
|
|
1568
|
-
timeoutMs: Math.min(opts.all ? 5e3 : 2500, opts.timeoutMs ?? 1e4)
|
|
1569
|
-
}).catch(() => null);
|
|
1570
|
-
const gatewayReachable = gatewayProbe?.ok === true;
|
|
1571
|
-
const gatewaySelf = gatewayProbe?.presence ? pickGatewaySelfPresence(gatewayProbe.presence) : null;
|
|
1572
|
-
progress.tick();
|
|
1573
|
-
progress.setLabel("Querying channel status…");
|
|
1574
|
-
const channelsStatus = gatewayReachable ? await callGateway({
|
|
1575
|
-
method: "channels.status",
|
|
1576
|
-
params: {
|
|
1577
|
-
probe: false,
|
|
1578
|
-
timeoutMs: Math.min(8e3, opts.timeoutMs ?? 1e4)
|
|
1579
|
-
},
|
|
1580
|
-
timeoutMs: Math.min(opts.all ? 5e3 : 2500, opts.timeoutMs ?? 1e4)
|
|
1581
|
-
}).catch(() => null) : null;
|
|
1582
|
-
const channelIssues = channelsStatus ? collectChannelStatusIssues(channelsStatus) : [];
|
|
1583
|
-
progress.tick();
|
|
1584
|
-
progress.setLabel("Summarizing channels…");
|
|
1585
|
-
const channels = await buildChannelsTable(cfg, { showSecrets: process.env.ANIMA_SHOW_SECRETS?.trim() !== "0" });
|
|
1586
|
-
progress.tick();
|
|
1587
|
-
progress.setLabel("Checking memory…");
|
|
1588
|
-
const memoryPlugin = resolveMemoryPluginStatus(cfg);
|
|
1589
|
-
const memory = await (async () => {
|
|
1590
|
-
if (!memoryPlugin.enabled) return null;
|
|
1591
|
-
if (memoryPlugin.slot !== "memory-core") return null;
|
|
1592
|
-
const agentId = agentStatus.defaultId ?? "main";
|
|
1593
|
-
const { manager } = await getMemorySearchManager({
|
|
1594
|
-
cfg,
|
|
1595
|
-
agentId,
|
|
1596
|
-
purpose: "status"
|
|
1597
|
-
});
|
|
1598
|
-
if (!manager) return null;
|
|
1599
|
-
try {
|
|
1600
|
-
await manager.probeVectorAvailability();
|
|
1601
|
-
} catch {}
|
|
1602
|
-
const status = manager.status();
|
|
1603
|
-
await manager.close?.().catch(() => {});
|
|
1604
|
-
return {
|
|
1605
|
-
agentId,
|
|
1606
|
-
...status
|
|
1607
|
-
};
|
|
1608
|
-
})();
|
|
1609
|
-
progress.tick();
|
|
1610
|
-
progress.setLabel("Reading sessions…");
|
|
1611
|
-
const summary = await getStatusSummary();
|
|
1612
|
-
progress.tick();
|
|
1613
|
-
progress.setLabel("Rendering…");
|
|
1614
|
-
progress.tick();
|
|
1615
|
-
return {
|
|
1616
|
-
cfg,
|
|
1617
|
-
osSummary,
|
|
1618
|
-
tailscaleMode,
|
|
1619
|
-
tailscaleDns,
|
|
1620
|
-
tailscaleHttpsUrl,
|
|
1621
|
-
update,
|
|
1622
|
-
gatewayConnection,
|
|
1623
|
-
remoteUrlMissing,
|
|
1624
|
-
gatewayMode,
|
|
1625
|
-
gatewayProbe,
|
|
1626
|
-
gatewayReachable,
|
|
1627
|
-
gatewaySelf,
|
|
1628
|
-
channelIssues,
|
|
1629
|
-
agentStatus,
|
|
1630
|
-
channels,
|
|
1631
|
-
summary,
|
|
1632
|
-
memory,
|
|
1633
|
-
memoryPlugin
|
|
1634
|
-
};
|
|
1635
|
-
});
|
|
1636
|
-
}
|
|
1637
|
-
|
|
1638
|
-
//#endregion
|
|
1639
|
-
//#region src/commands/status.command.ts
|
|
1640
|
-
async function statusCommand(opts, runtime) {
|
|
1641
|
-
if (opts.all && !opts.json) {
|
|
1642
|
-
await statusAllCommand(runtime, { timeoutMs: opts.timeoutMs });
|
|
1643
|
-
return;
|
|
1644
|
-
}
|
|
1645
|
-
const { cfg, osSummary, tailscaleMode, tailscaleDns, tailscaleHttpsUrl, update, gatewayConnection, remoteUrlMissing, gatewayMode, gatewayProbe, gatewayReachable, gatewaySelf, channelIssues, agentStatus, channels, summary, memory, memoryPlugin } = await scanStatus({
|
|
1646
|
-
json: opts.json,
|
|
1647
|
-
timeoutMs: opts.timeoutMs,
|
|
1648
|
-
all: opts.all
|
|
1649
|
-
}, runtime);
|
|
1650
|
-
const securityAudit = await withProgress({
|
|
1651
|
-
label: "Running security audit…",
|
|
1652
|
-
indeterminate: true,
|
|
1653
|
-
enabled: opts.json !== true
|
|
1654
|
-
}, async () => await runSecurityAudit({
|
|
1655
|
-
config: cfg,
|
|
1656
|
-
deep: false,
|
|
1657
|
-
includeFilesystem: true,
|
|
1658
|
-
includeChannelSecurity: true
|
|
1659
|
-
}));
|
|
1660
|
-
const usage = opts.usage ? await withProgress({
|
|
1661
|
-
label: "Fetching usage snapshot…",
|
|
1662
|
-
indeterminate: true,
|
|
1663
|
-
enabled: opts.json !== true
|
|
1664
|
-
}, async () => await loadProviderUsageSummary({ timeoutMs: opts.timeoutMs })) : void 0;
|
|
1665
|
-
const health = opts.deep ? await withProgress({
|
|
1666
|
-
label: "Checking gateway health…",
|
|
1667
|
-
indeterminate: true,
|
|
1668
|
-
enabled: opts.json !== true
|
|
1669
|
-
}, async () => await callGateway({
|
|
1670
|
-
method: "health",
|
|
1671
|
-
params: { probe: true },
|
|
1672
|
-
timeoutMs: opts.timeoutMs
|
|
1673
|
-
})) : void 0;
|
|
1674
|
-
const lastHeartbeat = opts.deep && gatewayReachable ? await callGateway({
|
|
1675
|
-
method: "last-heartbeat",
|
|
1676
|
-
params: {},
|
|
1677
|
-
timeoutMs: opts.timeoutMs
|
|
1678
|
-
}).catch(() => null) : null;
|
|
1679
|
-
const channelInfo = resolveEffectiveUpdateChannel({
|
|
1680
|
-
configChannel: normalizeUpdateChannel(cfg.update?.channel),
|
|
1681
|
-
installKind: update.installKind,
|
|
1682
|
-
git: update.git ? {
|
|
1683
|
-
tag: update.git.tag,
|
|
1684
|
-
branch: update.git.branch
|
|
1685
|
-
} : void 0
|
|
1686
|
-
});
|
|
1687
|
-
if (opts.json) {
|
|
1688
|
-
const [daemon, nodeDaemon] = await Promise.all([getDaemonStatusSummary(), getNodeDaemonStatusSummary()]);
|
|
1689
|
-
runtime.log(JSON.stringify({
|
|
1690
|
-
...summary,
|
|
1691
|
-
os: osSummary,
|
|
1692
|
-
update,
|
|
1693
|
-
updateChannel: channelInfo.channel,
|
|
1694
|
-
updateChannelSource: channelInfo.source,
|
|
1695
|
-
memory,
|
|
1696
|
-
memoryPlugin,
|
|
1697
|
-
gateway: {
|
|
1698
|
-
mode: gatewayMode,
|
|
1699
|
-
url: gatewayConnection.url,
|
|
1700
|
-
urlSource: gatewayConnection.urlSource,
|
|
1701
|
-
misconfigured: remoteUrlMissing,
|
|
1702
|
-
reachable: gatewayReachable,
|
|
1703
|
-
connectLatencyMs: gatewayProbe?.connectLatencyMs ?? null,
|
|
1704
|
-
self: gatewaySelf,
|
|
1705
|
-
error: gatewayProbe?.error ?? null
|
|
1706
|
-
},
|
|
1707
|
-
gatewayService: daemon,
|
|
1708
|
-
nodeService: nodeDaemon,
|
|
1709
|
-
agents: agentStatus,
|
|
1710
|
-
securityAudit,
|
|
1711
|
-
...health || usage || lastHeartbeat ? {
|
|
1712
|
-
health,
|
|
1713
|
-
usage,
|
|
1714
|
-
lastHeartbeat
|
|
1715
|
-
} : {}
|
|
1716
|
-
}, null, 2));
|
|
1717
|
-
return;
|
|
1718
|
-
}
|
|
1719
|
-
const muted = (value) => theme.muted(value);
|
|
1720
|
-
const ok = (value) => theme.success(value);
|
|
1721
|
-
const warn = (value) => theme.warn(value);
|
|
1722
|
-
if (opts.verbose) {
|
|
1723
|
-
const details = buildGatewayConnectionDetails();
|
|
1724
|
-
runtime.log(info("Gateway connection:"));
|
|
1725
|
-
for (const line of details.message.split("\n")) runtime.log(` ${line}`);
|
|
1726
|
-
runtime.log("");
|
|
1727
|
-
}
|
|
1728
|
-
const tableWidth = Math.max(60, (process.stdout.columns ?? 120) - 1);
|
|
1729
|
-
const dashboard = (() => {
|
|
1730
|
-
if (!(cfg.gateway?.controlUi?.enabled ?? true)) return "disabled";
|
|
1731
|
-
return resolveControlUiLinks({
|
|
1732
|
-
port: resolveGatewayPort(cfg),
|
|
1733
|
-
bind: cfg.gateway?.bind,
|
|
1734
|
-
customBindHost: cfg.gateway?.customBindHost,
|
|
1735
|
-
basePath: cfg.gateway?.controlUi?.basePath
|
|
1736
|
-
}).httpUrl;
|
|
1737
|
-
})();
|
|
1738
|
-
const gatewayValue = (() => {
|
|
1739
|
-
const target = remoteUrlMissing ? `fallback ${gatewayConnection.url}` : `${gatewayConnection.url}${gatewayConnection.urlSource ? ` (${gatewayConnection.urlSource})` : ""}`;
|
|
1740
|
-
const reach = remoteUrlMissing ? warn("misconfigured (remote.url missing)") : gatewayReachable ? ok(`reachable ${formatDuration(gatewayProbe?.connectLatencyMs)}`) : warn(gatewayProbe?.error ? `unreachable (${gatewayProbe.error})` : "unreachable");
|
|
1741
|
-
const auth = gatewayReachable && !remoteUrlMissing ? ` · auth ${formatGatewayAuthUsed(resolveGatewayProbeAuth(cfg))}` : "";
|
|
1742
|
-
const self = gatewaySelf?.host || gatewaySelf?.version || gatewaySelf?.platform ? [
|
|
1743
|
-
gatewaySelf?.host ? gatewaySelf.host : null,
|
|
1744
|
-
gatewaySelf?.ip ? `(${gatewaySelf.ip})` : null,
|
|
1745
|
-
gatewaySelf?.version ? `app ${gatewaySelf.version}` : null,
|
|
1746
|
-
gatewaySelf?.platform ? gatewaySelf.platform : null
|
|
1747
|
-
].filter(Boolean).join(" ") : null;
|
|
1748
|
-
return `${gatewayMode} · ${target} · ${reach}${auth}${self ? ` · ${self}` : ""}`;
|
|
1749
|
-
})();
|
|
1750
|
-
const agentsValue = (() => {
|
|
1751
|
-
const pending = agentStatus.bootstrapPendingCount > 0 ? `${agentStatus.bootstrapPendingCount} bootstrapping` : "no bootstraps";
|
|
1752
|
-
const def = agentStatus.agents.find((a) => a.id === agentStatus.defaultId);
|
|
1753
|
-
const defActive = def?.lastActiveAgeMs != null ? formatTimeAgo(def.lastActiveAgeMs) : "unknown";
|
|
1754
|
-
const defSuffix = def ? ` · default ${def.id} active ${defActive}` : "";
|
|
1755
|
-
return `${agentStatus.agents.length} · ${pending} · sessions ${agentStatus.totalSessions}${defSuffix}`;
|
|
1756
|
-
})();
|
|
1757
|
-
const [daemon, nodeDaemon] = await Promise.all([getDaemonStatusSummary(), getNodeDaemonStatusSummary()]);
|
|
1758
|
-
const daemonValue = (() => {
|
|
1759
|
-
if (daemon.installed === false) return `${daemon.label} not installed`;
|
|
1760
|
-
const installedPrefix = daemon.installed === true ? "installed · " : "";
|
|
1761
|
-
return `${daemon.label} ${installedPrefix}${daemon.loadedText}${daemon.runtimeShort ? ` · ${daemon.runtimeShort}` : ""}`;
|
|
1762
|
-
})();
|
|
1763
|
-
const nodeDaemonValue = (() => {
|
|
1764
|
-
if (nodeDaemon.installed === false) return `${nodeDaemon.label} not installed`;
|
|
1765
|
-
const installedPrefix = nodeDaemon.installed === true ? "installed · " : "";
|
|
1766
|
-
return `${nodeDaemon.label} ${installedPrefix}${nodeDaemon.loadedText}${nodeDaemon.runtimeShort ? ` · ${nodeDaemon.runtimeShort}` : ""}`;
|
|
1767
|
-
})();
|
|
1768
|
-
const defaults = summary.sessions.defaults;
|
|
1769
|
-
const defaultCtx = defaults.contextTokens ? ` (${formatKTokens(defaults.contextTokens)} ctx)` : "";
|
|
1770
|
-
const eventsValue = summary.queuedSystemEvents.length > 0 ? `${summary.queuedSystemEvents.length} queued` : "none";
|
|
1771
|
-
const probesValue = health ? ok("enabled") : muted("skipped (use --deep)");
|
|
1772
|
-
const heartbeatValue = (() => {
|
|
1773
|
-
const parts = summary.heartbeat.agents.map((agent) => {
|
|
1774
|
-
if (!agent.enabled || !agent.everyMs) return `disabled (${agent.agentId})`;
|
|
1775
|
-
return `${agent.every} (${agent.agentId})`;
|
|
1776
|
-
}).filter(Boolean);
|
|
1777
|
-
return parts.length > 0 ? parts.join(", ") : "disabled";
|
|
1778
|
-
})();
|
|
1779
|
-
const lastHeartbeatValue = (() => {
|
|
1780
|
-
if (!opts.deep) return null;
|
|
1781
|
-
if (!gatewayReachable) return warn("unavailable");
|
|
1782
|
-
if (!lastHeartbeat) return muted("none");
|
|
1783
|
-
const age = formatTimeAgo(Date.now() - lastHeartbeat.ts);
|
|
1784
|
-
const channel = lastHeartbeat.channel ?? "unknown";
|
|
1785
|
-
const accountLabel = lastHeartbeat.accountId ? `account ${lastHeartbeat.accountId}` : null;
|
|
1786
|
-
return [
|
|
1787
|
-
lastHeartbeat.status,
|
|
1788
|
-
`${age} ago`,
|
|
1789
|
-
channel,
|
|
1790
|
-
accountLabel
|
|
1791
|
-
].filter(Boolean).join(" · ");
|
|
1792
|
-
})();
|
|
1793
|
-
const storeLabel = summary.sessions.paths.length > 1 ? `${summary.sessions.paths.length} stores` : summary.sessions.paths[0] ?? "unknown";
|
|
1794
|
-
const memoryValue = (() => {
|
|
1795
|
-
if (!memoryPlugin.enabled) return muted(`disabled${memoryPlugin.reason ? ` (${memoryPlugin.reason})` : ""}`);
|
|
1796
|
-
if (!memory) {
|
|
1797
|
-
const slot = memoryPlugin.slot ? `plugin ${memoryPlugin.slot}` : "plugin";
|
|
1798
|
-
if (memoryPlugin.slot && memoryPlugin.slot !== "memory-core") return `enabled (${slot})`;
|
|
1799
|
-
return muted(`enabled (${slot}) · unavailable`);
|
|
1800
|
-
}
|
|
1801
|
-
const parts = [];
|
|
1802
|
-
const dirtySuffix = memory.dirty ? ` · ${warn("dirty")}` : "";
|
|
1803
|
-
parts.push(`${memory.files} files · ${memory.chunks} chunks${dirtySuffix}`);
|
|
1804
|
-
if (memory.sources?.length) parts.push(`sources ${memory.sources.join(", ")}`);
|
|
1805
|
-
if (memoryPlugin.slot) parts.push(`plugin ${memoryPlugin.slot}`);
|
|
1806
|
-
const colorByTone = (tone, text) => tone === "ok" ? ok(text) : tone === "warn" ? warn(text) : muted(text);
|
|
1807
|
-
const vector = memory.vector;
|
|
1808
|
-
if (vector) {
|
|
1809
|
-
const state = resolveMemoryVectorState(vector);
|
|
1810
|
-
const label = state.state === "disabled" ? "vector off" : `vector ${state.state}`;
|
|
1811
|
-
parts.push(colorByTone(state.tone, label));
|
|
1812
|
-
}
|
|
1813
|
-
const fts = memory.fts;
|
|
1814
|
-
if (fts) {
|
|
1815
|
-
const state = resolveMemoryFtsState(fts);
|
|
1816
|
-
const label = state.state === "disabled" ? "fts off" : `fts ${state.state}`;
|
|
1817
|
-
parts.push(colorByTone(state.tone, label));
|
|
1818
|
-
}
|
|
1819
|
-
const cache = memory.cache;
|
|
1820
|
-
if (cache) {
|
|
1821
|
-
const summary = resolveMemoryCacheSummary(cache);
|
|
1822
|
-
parts.push(colorByTone(summary.tone, summary.text));
|
|
1823
|
-
}
|
|
1824
|
-
return parts.join(" · ");
|
|
1825
|
-
})();
|
|
1826
|
-
const updateAvailability = resolveUpdateAvailability(update);
|
|
1827
|
-
const updateLine = formatUpdateOneLiner(update).replace(/^Update:\s*/i, "");
|
|
1828
|
-
const channelLabel = formatUpdateChannelLabel({
|
|
1829
|
-
channel: channelInfo.channel,
|
|
1830
|
-
source: channelInfo.source,
|
|
1831
|
-
gitTag: update.git?.tag ?? null,
|
|
1832
|
-
gitBranch: update.git?.branch ?? null
|
|
1833
|
-
});
|
|
1834
|
-
const gitLabel = formatGitInstallLabel(update);
|
|
1835
|
-
const overviewRows = [
|
|
1836
|
-
{
|
|
1837
|
-
Item: "Dashboard",
|
|
1838
|
-
Value: dashboard
|
|
1839
|
-
},
|
|
1840
|
-
{
|
|
1841
|
-
Item: "OS",
|
|
1842
|
-
Value: `${osSummary.label} · node ${process.versions.node}`
|
|
1843
|
-
},
|
|
1844
|
-
{
|
|
1845
|
-
Item: "Tailscale",
|
|
1846
|
-
Value: tailscaleMode === "off" ? muted("off") : tailscaleDns && tailscaleHttpsUrl ? `${tailscaleMode} · ${tailscaleDns} · ${tailscaleHttpsUrl}` : warn(`${tailscaleMode} · magicdns unknown`)
|
|
1847
|
-
},
|
|
1848
|
-
{
|
|
1849
|
-
Item: "Channel",
|
|
1850
|
-
Value: channelLabel
|
|
1851
|
-
},
|
|
1852
|
-
...gitLabel ? [{
|
|
1853
|
-
Item: "Git",
|
|
1854
|
-
Value: gitLabel
|
|
1855
|
-
}] : [],
|
|
1856
|
-
{
|
|
1857
|
-
Item: "Update",
|
|
1858
|
-
Value: updateAvailability.available ? warn(`available · ${updateLine}`) : updateLine
|
|
1859
|
-
},
|
|
1860
|
-
{
|
|
1861
|
-
Item: "Gateway",
|
|
1862
|
-
Value: gatewayValue
|
|
1863
|
-
},
|
|
1864
|
-
{
|
|
1865
|
-
Item: "Gateway service",
|
|
1866
|
-
Value: daemonValue
|
|
1867
|
-
},
|
|
1868
|
-
{
|
|
1869
|
-
Item: "Node service",
|
|
1870
|
-
Value: nodeDaemonValue
|
|
1871
|
-
},
|
|
1872
|
-
{
|
|
1873
|
-
Item: "Agents",
|
|
1874
|
-
Value: agentsValue
|
|
1875
|
-
},
|
|
1876
|
-
{
|
|
1877
|
-
Item: "Memory",
|
|
1878
|
-
Value: memoryValue
|
|
1879
|
-
},
|
|
1880
|
-
{
|
|
1881
|
-
Item: "Probes",
|
|
1882
|
-
Value: probesValue
|
|
1883
|
-
},
|
|
1884
|
-
{
|
|
1885
|
-
Item: "Events",
|
|
1886
|
-
Value: eventsValue
|
|
1887
|
-
},
|
|
1888
|
-
{
|
|
1889
|
-
Item: "Heartbeat",
|
|
1890
|
-
Value: heartbeatValue
|
|
1891
|
-
},
|
|
1892
|
-
...lastHeartbeatValue ? [{
|
|
1893
|
-
Item: "Last heartbeat",
|
|
1894
|
-
Value: lastHeartbeatValue
|
|
1895
|
-
}] : [],
|
|
1896
|
-
{
|
|
1897
|
-
Item: "Sessions",
|
|
1898
|
-
Value: `${summary.sessions.count} active · default ${defaults.model ?? "unknown"}${defaultCtx} · ${storeLabel}`
|
|
1899
|
-
}
|
|
1900
|
-
];
|
|
1901
|
-
runtime.log(theme.heading("Anima status"));
|
|
1902
|
-
runtime.log("");
|
|
1903
|
-
runtime.log(theme.heading("Overview"));
|
|
1904
|
-
runtime.log(renderTable({
|
|
1905
|
-
width: tableWidth,
|
|
1906
|
-
columns: [{
|
|
1907
|
-
key: "Item",
|
|
1908
|
-
header: "Item",
|
|
1909
|
-
minWidth: 12
|
|
1910
|
-
}, {
|
|
1911
|
-
key: "Value",
|
|
1912
|
-
header: "Value",
|
|
1913
|
-
flex: true,
|
|
1914
|
-
minWidth: 32
|
|
1915
|
-
}],
|
|
1916
|
-
rows: overviewRows
|
|
1917
|
-
}).trimEnd());
|
|
1918
|
-
runtime.log("");
|
|
1919
|
-
runtime.log(theme.heading("Security audit"));
|
|
1920
|
-
const fmtSummary = (value) => {
|
|
1921
|
-
return [
|
|
1922
|
-
theme.error(`${value.critical} critical`),
|
|
1923
|
-
theme.warn(`${value.warn} warn`),
|
|
1924
|
-
theme.muted(`${value.info} info`)
|
|
1925
|
-
].join(" · ");
|
|
1926
|
-
};
|
|
1927
|
-
runtime.log(theme.muted(`Summary: ${fmtSummary(securityAudit.summary)}`));
|
|
1928
|
-
const importantFindings = securityAudit.findings.filter((f) => f.severity === "critical" || f.severity === "warn");
|
|
1929
|
-
if (importantFindings.length === 0) runtime.log(theme.muted("No critical or warn findings detected."));
|
|
1930
|
-
else {
|
|
1931
|
-
const severityLabel = (sev) => {
|
|
1932
|
-
if (sev === "critical") return theme.error("CRITICAL");
|
|
1933
|
-
if (sev === "warn") return theme.warn("WARN");
|
|
1934
|
-
return theme.muted("INFO");
|
|
1935
|
-
};
|
|
1936
|
-
const sevRank = (sev) => sev === "critical" ? 0 : sev === "warn" ? 1 : 2;
|
|
1937
|
-
const sorted = [...importantFindings].toSorted((a, b) => sevRank(a.severity) - sevRank(b.severity));
|
|
1938
|
-
const shown = sorted.slice(0, 6);
|
|
1939
|
-
for (const f of shown) {
|
|
1940
|
-
runtime.log(` ${severityLabel(f.severity)} ${f.title}`);
|
|
1941
|
-
runtime.log(` ${shortenText(f.detail.replaceAll("\n", " "), 160)}`);
|
|
1942
|
-
if (f.remediation?.trim()) runtime.log(` ${theme.muted(`Fix: ${f.remediation.trim()}`)}`);
|
|
1943
|
-
}
|
|
1944
|
-
if (sorted.length > shown.length) runtime.log(theme.muted(`… +${sorted.length - shown.length} more`));
|
|
1945
|
-
}
|
|
1946
|
-
runtime.log(theme.muted(`Full report: ${formatCliCommand("anima security audit")}`));
|
|
1947
|
-
runtime.log(theme.muted(`Deep probe: ${formatCliCommand("anima security audit --deep")}`));
|
|
1948
|
-
runtime.log("");
|
|
1949
|
-
runtime.log(theme.heading("Channels"));
|
|
1950
|
-
const channelIssuesByChannel = (() => {
|
|
1951
|
-
const map = /* @__PURE__ */ new Map();
|
|
1952
|
-
for (const issue of channelIssues) {
|
|
1953
|
-
const key = issue.channel;
|
|
1954
|
-
const list = map.get(key);
|
|
1955
|
-
if (list) list.push(issue);
|
|
1956
|
-
else map.set(key, [issue]);
|
|
1957
|
-
}
|
|
1958
|
-
return map;
|
|
1959
|
-
})();
|
|
1960
|
-
runtime.log(renderTable({
|
|
1961
|
-
width: tableWidth,
|
|
1962
|
-
columns: [
|
|
1963
|
-
{
|
|
1964
|
-
key: "Channel",
|
|
1965
|
-
header: "Channel",
|
|
1966
|
-
minWidth: 10
|
|
1967
|
-
},
|
|
1968
|
-
{
|
|
1969
|
-
key: "Enabled",
|
|
1970
|
-
header: "Enabled",
|
|
1971
|
-
minWidth: 7
|
|
1972
|
-
},
|
|
1973
|
-
{
|
|
1974
|
-
key: "State",
|
|
1975
|
-
header: "State",
|
|
1976
|
-
minWidth: 8
|
|
1977
|
-
},
|
|
1978
|
-
{
|
|
1979
|
-
key: "Detail",
|
|
1980
|
-
header: "Detail",
|
|
1981
|
-
flex: true,
|
|
1982
|
-
minWidth: 24
|
|
1983
|
-
}
|
|
1984
|
-
],
|
|
1985
|
-
rows: channels.rows.map((row) => {
|
|
1986
|
-
const issues = channelIssuesByChannel.get(row.id) ?? [];
|
|
1987
|
-
const effectiveState = row.state === "off" ? "off" : issues.length > 0 ? "warn" : row.state;
|
|
1988
|
-
const issueSuffix = issues.length > 0 ? ` · ${warn(`gateway: ${shortenText(issues[0]?.message ?? "issue", 84)}`)}` : "";
|
|
1989
|
-
return {
|
|
1990
|
-
Channel: row.label,
|
|
1991
|
-
Enabled: row.enabled ? ok("ON") : muted("OFF"),
|
|
1992
|
-
State: effectiveState === "ok" ? ok("OK") : effectiveState === "warn" ? warn("WARN") : effectiveState === "off" ? muted("OFF") : theme.accentDim("SETUP"),
|
|
1993
|
-
Detail: `${row.detail}${issueSuffix}`
|
|
1994
|
-
};
|
|
1995
|
-
})
|
|
1996
|
-
}).trimEnd());
|
|
1997
|
-
runtime.log("");
|
|
1998
|
-
runtime.log(theme.heading("Sessions"));
|
|
1999
|
-
runtime.log(renderTable({
|
|
2000
|
-
width: tableWidth,
|
|
2001
|
-
columns: [
|
|
2002
|
-
{
|
|
2003
|
-
key: "Key",
|
|
2004
|
-
header: "Key",
|
|
2005
|
-
minWidth: 20,
|
|
2006
|
-
flex: true
|
|
2007
|
-
},
|
|
2008
|
-
{
|
|
2009
|
-
key: "Kind",
|
|
2010
|
-
header: "Kind",
|
|
2011
|
-
minWidth: 6
|
|
2012
|
-
},
|
|
2013
|
-
{
|
|
2014
|
-
key: "Age",
|
|
2015
|
-
header: "Age",
|
|
2016
|
-
minWidth: 9
|
|
2017
|
-
},
|
|
2018
|
-
{
|
|
2019
|
-
key: "Model",
|
|
2020
|
-
header: "Model",
|
|
2021
|
-
minWidth: 14
|
|
2022
|
-
},
|
|
2023
|
-
{
|
|
2024
|
-
key: "Tokens",
|
|
2025
|
-
header: "Tokens",
|
|
2026
|
-
minWidth: 16
|
|
2027
|
-
}
|
|
2028
|
-
],
|
|
2029
|
-
rows: summary.sessions.recent.length > 0 ? summary.sessions.recent.map((sess) => ({
|
|
2030
|
-
Key: shortenText(sess.key, 32),
|
|
2031
|
-
Kind: sess.kind,
|
|
2032
|
-
Age: sess.updatedAt ? formatTimeAgo(sess.age) : "no activity",
|
|
2033
|
-
Model: sess.model ?? "unknown",
|
|
2034
|
-
Tokens: formatTokensCompact(sess)
|
|
2035
|
-
})) : [{
|
|
2036
|
-
Key: muted("no sessions yet"),
|
|
2037
|
-
Kind: "",
|
|
2038
|
-
Age: "",
|
|
2039
|
-
Model: "",
|
|
2040
|
-
Tokens: ""
|
|
2041
|
-
}]
|
|
2042
|
-
}).trimEnd());
|
|
2043
|
-
if (summary.queuedSystemEvents.length > 0) {
|
|
2044
|
-
runtime.log("");
|
|
2045
|
-
runtime.log(theme.heading("System events"));
|
|
2046
|
-
runtime.log(renderTable({
|
|
2047
|
-
width: tableWidth,
|
|
2048
|
-
columns: [{
|
|
2049
|
-
key: "Event",
|
|
2050
|
-
header: "Event",
|
|
2051
|
-
flex: true,
|
|
2052
|
-
minWidth: 24
|
|
2053
|
-
}],
|
|
2054
|
-
rows: summary.queuedSystemEvents.slice(0, 5).map((event) => ({ Event: event }))
|
|
2055
|
-
}).trimEnd());
|
|
2056
|
-
if (summary.queuedSystemEvents.length > 5) runtime.log(muted(`… +${summary.queuedSystemEvents.length - 5} more`));
|
|
2057
|
-
}
|
|
2058
|
-
if (health) {
|
|
2059
|
-
runtime.log("");
|
|
2060
|
-
runtime.log(theme.heading("Health"));
|
|
2061
|
-
const rows = [];
|
|
2062
|
-
rows.push({
|
|
2063
|
-
Item: "Gateway",
|
|
2064
|
-
Status: ok("reachable"),
|
|
2065
|
-
Detail: `${health.durationMs}ms`
|
|
2066
|
-
});
|
|
2067
|
-
for (const line of formatHealthChannelLines(health, { accountMode: "all" })) {
|
|
2068
|
-
const colon = line.indexOf(":");
|
|
2069
|
-
if (colon === -1) continue;
|
|
2070
|
-
const item = line.slice(0, colon).trim();
|
|
2071
|
-
const detail = line.slice(colon + 1).trim();
|
|
2072
|
-
const normalized = detail.toLowerCase();
|
|
2073
|
-
const status = (() => {
|
|
2074
|
-
if (normalized.startsWith("ok")) return ok("OK");
|
|
2075
|
-
if (normalized.startsWith("failed")) return warn("WARN");
|
|
2076
|
-
if (normalized.startsWith("not configured")) return muted("OFF");
|
|
2077
|
-
if (normalized.startsWith("configured")) return ok("OK");
|
|
2078
|
-
if (normalized.startsWith("linked")) return ok("LINKED");
|
|
2079
|
-
if (normalized.startsWith("not linked")) return warn("UNLINKED");
|
|
2080
|
-
return warn("WARN");
|
|
2081
|
-
})();
|
|
2082
|
-
rows.push({
|
|
2083
|
-
Item: item,
|
|
2084
|
-
Status: status,
|
|
2085
|
-
Detail: detail
|
|
2086
|
-
});
|
|
2087
|
-
}
|
|
2088
|
-
runtime.log(renderTable({
|
|
2089
|
-
width: tableWidth,
|
|
2090
|
-
columns: [
|
|
2091
|
-
{
|
|
2092
|
-
key: "Item",
|
|
2093
|
-
header: "Item",
|
|
2094
|
-
minWidth: 10
|
|
2095
|
-
},
|
|
2096
|
-
{
|
|
2097
|
-
key: "Status",
|
|
2098
|
-
header: "Status",
|
|
2099
|
-
minWidth: 8
|
|
2100
|
-
},
|
|
2101
|
-
{
|
|
2102
|
-
key: "Detail",
|
|
2103
|
-
header: "Detail",
|
|
2104
|
-
flex: true,
|
|
2105
|
-
minWidth: 28
|
|
2106
|
-
}
|
|
2107
|
-
],
|
|
2108
|
-
rows
|
|
2109
|
-
}).trimEnd());
|
|
2110
|
-
}
|
|
2111
|
-
if (usage) {
|
|
2112
|
-
runtime.log("");
|
|
2113
|
-
runtime.log(theme.heading("Usage"));
|
|
2114
|
-
for (const line of formatUsageReportLines(usage)) runtime.log(line);
|
|
2115
|
-
}
|
|
2116
|
-
runtime.log("");
|
|
2117
|
-
runtime.log("FAQ: https://docs.anima.ai/faq");
|
|
2118
|
-
runtime.log("Troubleshooting: https://docs.anima.ai/troubleshooting");
|
|
2119
|
-
runtime.log("");
|
|
2120
|
-
const updateHint = formatUpdateAvailableHint(update);
|
|
2121
|
-
if (updateHint) {
|
|
2122
|
-
runtime.log(theme.warn(updateHint));
|
|
2123
|
-
runtime.log("");
|
|
2124
|
-
}
|
|
2125
|
-
runtime.log("Next steps:");
|
|
2126
|
-
runtime.log(` Need to share? ${formatCliCommand("anima status --all")}`);
|
|
2127
|
-
runtime.log(` Need to debug live? ${formatCliCommand("anima logs --follow")}`);
|
|
2128
|
-
if (gatewayReachable) runtime.log(` Need to test channels? ${formatCliCommand("anima status --deep")}`);
|
|
2129
|
-
else runtime.log(` Fix reachability first: ${formatCliCommand("anima gateway probe")}`);
|
|
2130
|
-
}
|
|
2131
|
-
|
|
2132
|
-
//#endregion
|
|
2133
|
-
//#region src/commands/status.ts
|
|
2134
|
-
var status_exports = /* @__PURE__ */ __exportAll({ statusCommand: () => statusCommand });
|
|
2135
|
-
|
|
2136
|
-
//#endregion
|
|
2137
|
-
export { pickGatewaySelfPresence as i, statusCommand as n, getStatusSummary as r, status_exports as t };
|