@noxsoft/anima 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{accounts-D8CPKNkN.js → accounts-CP1IAWeM.js} +3 -3
- package/dist/{acp-cli-ByK6lS6c.js → acp-cli-0JY_DUDb.js} +14 -14
- package/dist/{acp-cli-CaQCjIw4.js → acp-cli-BUGHeckb.js} +1 -1
- package/dist/{agent-N5BDcge4.js → agent-DwTJ59DW.js} +17 -17
- package/dist/{agent-BgIkqd3F.js → agent-eLix7YLB.js} +3 -3
- package/dist/{agent-events-COH7NDW2.js → agent-events-COLRhRBH.js} +2 -2
- package/dist/{agent-scope-cj2QCT6R.js → agent-scope-CcE0DhlL.js} +3 -3
- package/dist/{agent-scope-DZgptr9J.js → agent-scope-OZi7lb8S.js} +4 -4
- package/dist/{agents-NEudYMdg.js → agents-D57WX9dn.js} +16 -16
- package/dist/{agents.config-Bujs-NIy.js → agents.config-Dvo2ULxs.js} +2 -2
- package/dist/{audit-C-UJhfdv.js → audit-BvPmfYxY.js} +5 -5
- package/dist/{audit-CeCO7SK5.js → audit-CmL_VKW9.js} +21 -21
- package/dist/{auth-choice-DA2k4vs8.js → auth-choice-8JX4OqDS.js} +9 -9
- package/dist/{auth-choice-5VnaGMD-.js → auth-choice-DbU0S_0Q.js} +4 -4
- package/dist/{auth-health-B7FqA26_.js → auth-health-CeDOBbt0.js} +1 -1
- package/dist/{auth-DMPZWzEa.js → auth-lZ26wsbN.js} +3 -3
- package/dist/{auth-profiles-BDrNYX_n.js → auth-profiles-BVZBTuls.js} +12 -12
- package/dist/{auth-profiles-CxSHydjn.js → auth-profiles-CC3TFfvS.js} +4 -4
- package/dist/{banner-BtDZPRzi.js → banner-DDcACdvK.js} +1 -1
- package/dist/{browser-cli-8yQMpxb8.js → browser-cli-BZ38kv8Y.js} +3 -3
- package/dist/{browser-cli-Czg3JtDH.js → browser-cli-CYOmCXxE.js} +18 -18
- package/dist/build-info.json +2 -2
- package/dist/bundled/boot-md/handler.js +15 -15
- 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 → call-CTMQygkz.js} +6 -6
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{catalog-DMfEg-oK.js → catalog-BAayBt1L.js} +2 -2
- package/dist/{channel-options-BrtCtyrT.js → channel-options-M44Z9-3q.js} +3 -3
- package/dist/{channel-selection-Bbm1lq3P.js → channel-selection-DfGpCyh2.js} +2 -2
- package/dist/{channel-web-DrsT6OAE.js → channel-web-Q-STsf5N.js} +4 -4
- package/dist/{channels-cli-zNvi1m5c.js → channels-cli-SPO9rJnF.js} +20 -20
- package/dist/{channels-cli-Juyh1S6n.js → channels-cli-zIOBobe6.js} +74 -74
- package/dist/{channels-status-issues-CqzqshW4.js → channels-status-issues-DBc1pU_R.js} +1 -1
- package/dist/{chrome-C4dOMO8z.js → chrome-DlcCwfo_.js} +3 -3
- package/dist/{chrome-DdcDzAtH.js → chrome-mUDT-mA5.js} +11 -11
- package/dist/{chunk-D2nLsrEW.js → chunk-mxPVo000.js} +3 -3
- package/dist/{clack-prompter-BI3RDW5w.js → clack-prompter-B0kl7shw.js} +4 -4
- package/dist/{clack-prompter-Dwr1m_IZ.js → clack-prompter-Ct2BYIXW.js} +3 -3
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/{cli-CjWUGdGC.js → cli-AYZaZSSx.js} +7 -7
- package/dist/cli-XuLBXSur.js +99 -0
- package/dist/{cli-session-gtuYN2Iq.js → cli-session-C70q07GT.js} +23 -23
- package/dist/{cli-session-BVjY_XrW.js → cli-session-CqlE2JFo.js} +1 -1
- package/dist/{client-Dswwze5_.js → client-C1avc0vD.js} +4 -4
- package/dist/{clipboard-BZKS9O1u.js → clipboard-BbGnZskJ.js} +1 -1
- package/dist/{command-registry-BBvNvysr.js → command-registry-CSbw6FZC.js} +13 -13
- package/dist/{commands-BMnD_QRY.js → commands-D5PGoVW4.js} +6 -6
- package/dist/{commands-AZ3n8Y2c.js → commands-D7CbOdcS.js} +6 -6
- package/dist/{commands-registry-cFqZ6Ib4.js → commands-registry-sLFieXCB.js} +2 -2
- package/dist/{common-DJbnT8ws.js → common-D6bu0zHC.js} +2 -2
- package/dist/{completion-cli-DMQgiObF.js → completion-cli-BFdiNmVD.js} +1 -1
- package/dist/{completion-cli-BADRBcIl.js → completion-cli-_SwCoFq6.js} +4 -4
- package/dist/{config-CU-Axg8P.js → config-BeuAT94o.js} +5 -5
- package/dist/{config-kVVm5EYV.js → config-C96685Kz.js} +34 -34
- package/dist/{config-cli-BPlbwiuA.js → config-cli-DhdAhW1h.js} +9 -9
- package/dist/{config-cli-DXgZJkPU.js → config-cli-NqEQjCzV.js} +1 -1
- package/dist/{config-guard-Ba49JNds.js → config-guard-B1rmR88x.js} +4 -4
- package/dist/{config-guard-Cu0qMKZJ.js → config-guard-BCUt7Re8.js} +4 -4
- package/dist/{config-sync-CzLnLTXt.js → config-sync-CoIIbEOe.js} +2 -2
- package/dist/{config-sync-DuydxPWx.js → config-sync-DvAttep0.js} +2 -2
- package/dist/{configure-CHgacLyi.js → configure-B2vlJbd2.js} +14 -14
- package/dist/{configure-DfHXDa1L.js → configure-FENKo5hf.js} +21 -21
- package/dist/{context-DzgXOckU.js → context-ChaAWbwZ.js} +3 -3
- package/dist/{control-service-8_wKHwBa.js → control-service-DXYImShH.js} +4 -4
- package/dist/{control-service-BtL1Jto_.js → control-service-X_1FRl7x.js} +2 -2
- package/dist/{cron-cli-CCWNkykU.js → cron-cli-B6jMeNqC.js} +1 -1
- package/dist/{cron-cli-BCzSR2c0.js → cron-cli-ByPSA5ZE.js} +19 -19
- package/dist/{daemon-cli-CmlHcC1J.js → daemon-cli-Bf0Q00vC.js} +9 -9
- package/dist/{daemon-cli-Bjkbu9Vy.js → daemon-cli-CKOoYhs-.js} +21 -21
- package/dist/{daemon-runtime-rUTqCVwJ.js → daemon-runtime-cglglYsH.js} +4 -4
- package/dist/{deliver-DFnVaetP.js → deliver-DiIOZFml.js} +8 -8
- package/dist/{deliver-CePITOl8.js → deliver-DujkDzqg.js} +15 -15
- package/dist/{deps-CeEKhrp7.js → deps-Bim542L5.js} +1 -1
- package/dist/{devices-cli-DQrDMrZH.js → devices-cli-BbUrME_U.js} +1 -1
- package/dist/{devices-cli-Oe-A1Dv0.js → devices-cli-qvEFBnyH.js} +12 -12
- package/dist/{diagnostics-m79ZlMmZ.js → diagnostics-BCxobJaf.js} +1 -1
- package/dist/{diagnostics-DxMFrBLO.js → diagnostics-DlIw6fqD.js} +1 -1
- package/dist/{directory-cli-Cjgmi_sj.js → directory-cli-BjnpktnO.js} +14 -14
- package/dist/{directory-cli-BL6h8cGF.js → directory-cli-VreWAdNS.js} +2 -2
- package/dist/{dispatcher-DNd40gUn.js → dispatcher-CoqsaA3f.js} +2 -2
- package/dist/{dispatcher-DAFbQM-c.js → dispatcher-DbDPyVIX.js} +1 -1
- package/dist/{dns-cli-CFtV3BXK.js → dns-cli-B-lWrEam.js} +2 -2
- package/dist/{dns-cli-NyIHvQ5S.js → dns-cli-CRKIrBD6.js} +10 -10
- package/dist/{dock-BdXLb5oY.js → dock-Dmxj3en_.js} +4 -4
- package/dist/{docs-cli-D_cmJDSr.js → docs-cli-Bn-mDvE1.js} +7 -7
- package/dist/{doctor-D12wNQPU.js → doctor-CeIWEOAK.js} +41 -41
- package/dist/{doctor-BpGxKrBl.js → doctor-DdOw46pE.js} +23 -23
- package/dist/{doctor-completion-DeOfofek.js → doctor-completion-CBANZ9T9.js} +4 -4
- package/dist/{doctor-completion-DwjqdEcK.js → doctor-completion-aDHxGApN.js} +2 -2
- package/dist/{doctor-config-flow-wMHheFkC.js → doctor-config-flow-Bb8TQwYh.js} +2 -2
- package/dist/{doctor-config-flow-BI3mpkbd.js → doctor-config-flow-Dxjx2igu.js} +9 -9
- package/dist/{engine-BCtL-AMw.js → engine-B9avUJL5.js} +5 -5
- package/dist/{engine-Bk_UT413.js → engine-BiUQ25D4.js} +5 -5
- package/dist/entry.js +1 -1
- package/dist/{exec-approvals-CroGJRUg.js → exec-approvals-CdLmKX2R.js} +2 -2
- package/dist/{exec-approvals-cli-BTxF_RsH.js → exec-approvals-cli-5-h9moQI.js} +6 -6
- package/dist/{exec-approvals-cli-n1gyGwH2.js → exec-approvals-cli-Cne9mMrK.js} +19 -19
- package/dist/{exec-B7sUS164.js → exec-tTxVr8zb.js} +17 -17
- package/dist/{frontmatter-BmHq0vRD.js → frontmatter-YijVi0FQ.js} +2 -2
- package/dist/{gateway-cli-IZNkOMBe.js → gateway-cli-BZpKEMGi.js} +62 -62
- package/dist/{gateway-cli-DDBadlrS.js → gateway-cli-DboOVUi8.js} +128 -128
- package/dist/{gateway-rpc-L2PVSqGj.js → gateway-rpc-C3eniXwh.js} +3 -3
- package/dist/{github-copilot-auth-DKyqDaGU.js → github-copilot-auth-AdaPw_fF.js} +2 -2
- package/dist/{github-copilot-auth-DXpOMSd3.js → github-copilot-auth-C2cJr55I.js} +3 -3
- package/dist/{gmail-setup-utils-BKNczIJ9.js → gmail-setup-utils-BPo_LkKI.js} +3 -3
- package/dist/{health-Bm8ZTvC3.js → health-CdHDOLo6.js} +4 -4
- package/dist/{health-DUf1gt4E.js → health-WvhhwAnn.js} +17 -17
- package/dist/{health-format-uzh1xYLD.js → health-format-CdP99j3Y.js} +2 -2
- package/dist/{heartbeat-visibility-1TJb1Zao.js → heartbeat-visibility-B4oqf1qY.js} +1 -1
- package/dist/{heartbeat-visibility-CwodtdcX.js → heartbeat-visibility-ClqnPSqo.js} +1 -1
- package/dist/{helpers-N-uSFKOn.js → helpers-ZKNRexvX.js} +1 -1
- package/dist/{hooks-cli-BGjILbze.js → hooks-cli-DTMS4Ly9.js} +58 -58
- package/dist/{hooks-cli-1POsXqOl.js → hooks-cli-DfR8cmrL.js} +11 -11
- package/dist/{hooks-status-Du-d1jde.js → hooks-status-B-e96dZj.js} +4 -4
- package/dist/{hooks-status-DE07n5RC.js → hooks-status-LVJDILL8.js} +1 -1
- package/dist/{image-ops-Bp0C6Mvr.js → image-ops-Dlt3T7th.js} +1 -1
- package/dist/index.js +12 -12
- package/dist/{init-9A0s7bWG.js → init-Bm04RagW.js} +2 -2
- package/dist/{init-DoyCHJDC.js → init-CaJBf4p1.js} +3 -3
- package/dist/{installs-D1C9wHAq.js → installs-D-cPGdCw.js} +5 -5
- package/dist/{installs-Dh4dHayM.js → installs-DCTtAJP8.js} +2 -2
- package/dist/{ipv4-DSOUVx0i.js → ipv4-CoPxliya.js} +8 -8
- package/dist/{ipv4-DCItfaJo.js → ipv4-loTbB6OD.js} +15 -15
- package/dist/{lifecycle-core-TQKyXO-6.js → lifecycle-core-BZo7U2jW.js} +8 -8
- package/dist/{lifecycle-core-BY4WIf9g.js → lifecycle-core-Cu_h9gos.js} +5 -5
- package/dist/{links-CNu_8RZl.js → links-BfjHVTB_.js} +1 -1
- package/dist/llm-slug-generator.js +4 -4
- package/dist/{logging-C7lb3Vjc.js → logging-DB6BQmhi.js} +1 -1
- package/dist/{login-DXWKewA2.js → login-CnNpZKOD.js} +3 -3
- package/dist/{login-pPs3UO38.js → login-D4n2DJtf.js} +5 -5
- package/dist/{login-qr-GF2JMIy-.js → login-qr-CaB_Oi7G.js} +9 -9
- package/dist/{login-qr-ZYYKD6Yt.js → login-qr-D3xv0VnI.js} +7 -7
- package/dist/{logs-cli-CzXbX8HZ.js → logs-cli-CFX-tr6f.js} +14 -14
- package/dist/{logs-cli-D9ngH9PF.js → logs-cli-NXQfed5q.js} +2 -2
- package/dist/{manager-BD5rA3w0.js → manager-D_engjHC.js} +9 -9
- package/dist/{manager-DRWMWM--.js → manager-iFc0bAWS.js} +7 -7
- package/dist/{manifest-registry-DbvPaBXY.js → manifest-registry-D4lM2RdV.js} +1 -1
- package/dist/{markdown-tables-CqwihY2m.js → markdown-tables-Bhes7rr4.js} +2 -2
- package/dist/{media-lUqN-0O9.js → media-Bu2L8c_7.js} +6 -6
- package/dist/{memory-cli-BLXSpgnN.js → memory-cli-CvrdGRvA.js} +13 -13
- package/dist/{memory-cli-BcGVkkRJ.js → memory-cli-D6v61Mts.js} +1 -1
- package/dist/{migrate-BpVOar4L.js → migrate-BR6iAIjO.js} +3 -3
- package/dist/{migrate-CkgGDkWy.js → migrate-D0EcMs0f.js} +2 -2
- package/dist/{models-CExsNQPH.js → models-D11W7O93.js} +22 -22
- package/dist/{models-cli-iDAlsbL2.js → models-cli-BfBH9dWH.js} +64 -64
- package/dist/{models-cli-Ba3Jmwev.js → models-cli-ClFZ55qZ.js} +18 -18
- package/dist/{net-0A_zcaQD.js → net-B5lXhYLV.js} +1 -1
- package/dist/{node-cli-DYFR_V25.js → node-cli-Cgn2mwSW.js} +12 -12
- package/dist/{node-cli-ATmwCXIk.js → node-cli-kxhgdSNi.js} +33 -33
- package/dist/{node-service-CN4LqR1A.js → node-service-BFxHJsno.js} +2 -2
- package/dist/{node-service-CWt3MdSC.js → node-service-BL8qVG1X.js} +1 -1
- package/dist/{nodes-cli-QeJIfa18.js → nodes-cli-De6Ta7GH.js} +2 -2
- package/dist/{nodes-cli-BeVmhTz3.js → nodes-cli-deMLu7ch.js} +18 -18
- package/dist/{nodes-screen-DHyWAlla.js → nodes-screen-BST4qOFR.js} +1 -1
- package/dist/{note-CSlg2BnB.js → note-BtE8fGoO.js} +1 -1
- package/dist/{note-Ctvglhp1.js → note-uiuPxhyX.js} +1 -1
- package/dist/{npm-registry-spec-PxisIMts.js → npm-registry-spec-za3itb5Y.js} +1 -1
- package/dist/{onboard-SAcu5N6N.js → onboard-BGv6xY1s.js} +18 -18
- package/dist/{onboard-DeruD10m.js → onboard-DPEqxVx4.js} +13 -13
- package/dist/{onboard-channels-oVTVgoyg.js → onboard-channels-BsTwWmEt.js} +10 -10
- package/dist/{onboard-channels-C4iSfFXR.js → onboard-channels-DEfpenNa.js} +4 -4
- package/dist/{onboard-helpers-B8roRwLP.js → onboard-helpers-CwcaOee8.js} +11 -11
- package/dist/{onboard-helpers-Dgh26hgP.js → onboard-helpers-Cz42ASwv.js} +2 -2
- package/dist/{onboarding-Bi-ac8we.js → onboarding-BxYOAHWD.js} +16 -16
- package/dist/{onboarding-C2gjB2u8.js → onboarding-DvitiaRS.js} +23 -23
- package/dist/{orchestrator-DlbAYMQP.js → orchestrator-BKzmyBWy.js} +4 -4
- package/dist/{orchestrator-DlwVRVDA.js → orchestrator-BN3QCz2s.js} +4 -4
- package/dist/{outbound-CkKgc6iR.js → outbound-Csw4yAYo.js} +5 -5
- package/dist/{outbound-Vfm5yDh3.js → outbound-L1IT5jN_.js} +4 -4
- package/dist/{outbound-send-deps-DDjiMfEL.js → outbound-send-deps-CmzQCbSX.js} +6 -6
- package/dist/{pairing-cli-mqopHI8s.js → pairing-cli-BmPkji_u.js} +1 -1
- package/dist/{pairing-cli-CJYeuEik.js → pairing-cli-CSRakAu-.js} +13 -13
- package/dist/{pairing-store-DoNj00-X.js → pairing-store-uUh4DCdc.js} +3 -3
- package/dist/{path-env-C_xpiG8l.js → path-env-Bu6k0jDQ.js} +1 -1
- package/dist/{paths-B1vRVCad.js → paths-Ba-yiqjy.js} +2 -2
- package/dist/{paths-DA9WYabg.js → paths-C1R4gjRm.js} +5 -5
- package/dist/{paths-DfQGx0_k.js → paths-CxRf2rBG.js} +1 -1
- package/dist/{pi-auth-json-DOPW3e4X.js → pi-auth-json-C2miwJYp.js} +4 -4
- package/dist/{pi-auth-json-lae_wwwo.js → pi-auth-json-I3iYPRAb.js} +5 -5
- package/dist/{pi-model-discovery-7q0GxMrp.js → pi-model-discovery-eIc-PHaM.js} +1 -1
- package/dist/{pi-tools.policy-xYdDLEv9.js → pi-tools.policy-DhmYCpdW.js} +5 -5
- package/dist/{plugin-auto-enable-CViVVWgg.js → plugin-auto-enable-DVD5Kls3.js} +4 -4
- package/dist/{plugin-registry-B4Aw2hzq.js → plugin-registry-NbbyJq_D.js} +2 -2
- package/dist/plugin-sdk/index.js +6 -6
- package/dist/{plugins-DtghNRtM.js → plugins-DdzdfeTc.js} +1 -1
- package/dist/{plugins-cli-4vWTmOAb.js → plugins-cli-Cs_jfROZ.js} +13 -13
- package/dist/{plugins-cli-CdTMbP0X.js → plugins-cli-D0jU5_VE.js} +59 -59
- package/dist/{ports-vd93M_Pt.js → ports-B3Vuo92o.js} +3 -3
- package/dist/{ports-BtZx-JKD.js → ports-Co1kd5qX.js} +2 -2
- package/dist/{program-CX3aUVeb.js → program-Db2-b8Np.js} +64 -64
- package/dist/{program-context-BPos0ivo.js → program-context-DR1cx29i.js} +38 -38
- package/dist/{pw-ai-C83HBue2.js → pw-ai-DM3CIGyg.js} +6 -6
- package/dist/{pw-ai-4QbK5YFe.js → pw-ai-MrkdzeIJ.js} +3 -3
- package/dist/{qmd-manager-CRrSkfia.js → qmd-manager-Cur_Ekn0.js} +7 -7
- package/dist/{qmd-manager-CPypGJ0P.js → qmd-manager-Dgo23O3Q.js} +6 -6
- package/dist/{register.agent-DKawm-9d.js → register.agent-B4CGE-cp.js} +26 -26
- package/dist/{register.agent-DDY8KJhn.js → register.agent-E1qzojq2.js} +76 -76
- package/dist/{register.anima-DBWz2rk_.js → register.anima-BETuBtyq.js} +17 -17
- package/dist/{register.anima-CEWUo29k.js → register.anima-C2coCJM_.js} +17 -17
- package/dist/register.configure-D5huhRa3.js +101 -0
- package/dist/{register.configure-BX67qV8k.js → register.configure-DqYNhIQj.js} +30 -30
- package/dist/{register.maintenance-0k-ZNhDg.js → register.maintenance-DC9IhZ2x.js} +31 -31
- package/dist/{register.maintenance-BIwx1fzX.js → register.maintenance-RuiaMHu7.js} +82 -82
- package/dist/{register.message-CXPsoakA.js → register.message-BRP5Y8SN.js} +59 -59
- package/dist/{register.message-DA3jvfgI.js → register.message-CL5mFcq-.js} +11 -11
- package/dist/{register.onboard-GOpdif-j.js → register.onboard-CdvtyeLg.js} +86 -86
- package/dist/{register.onboard-C4HG7Hqv.js → register.onboard-DFjl0E_x.js} +36 -36
- package/dist/{register.setup-GJyUDCqh.js → register.setup-CVhekh_d.js} +37 -37
- package/dist/{register.setup-B17vZT7C.js → register.setup-CuNhw63j.js} +87 -87
- package/dist/{register.status-health-sessions-D5876dGx.js → register.status-health-sessions-BdyiNJFD.js} +24 -24
- package/dist/{register.status-health-sessions-lOewVIZR.js → register.status-health-sessions-l7qnXORD.js} +73 -73
- package/dist/{register.subclis-Dwnujj5C.js → register.subclis-Bj3GU0St.js} +29 -29
- package/dist/{reply-r089HuRA.js → reply-Brlv-JC-.js} +69 -69
- package/dist/{reply-CR5T_oQJ.js → reply-C9A7Npep.js} +10 -10
- package/dist/{reply-prefix-Btb5o2NH.js → reply-prefix-XqRfG1QY.js} +2 -2
- package/dist/{reply-prefix-BcrS4Umd.js → reply-prefix-m-Nj9VGi.js} +1 -1
- package/dist/{routes-ucJWAk5O.js → routes-C5ylAnNV.js} +8 -8
- package/dist/{routes-B4czFzIb.js → routes-CooYoUCb.js} +1 -1
- package/dist/{rpc-BnKxnQ0v.js → rpc-BoNfgecI.js} +4 -4
- package/dist/{run-main-B74kv84C.js → run-main-DKNJvJ7W.js} +79 -79
- package/dist/{sandbox-CJTS3er6.js → sandbox-D8pgNhTE.js} +6 -6
- package/dist/{sandbox-cli-D1r5y6Sz.js → sandbox-cli-BeOQ8G6W.js} +29 -29
- package/dist/{sandbox-cli-CrkjyU5M.js → sandbox-cli-BlWdpX1h.js} +3 -3
- package/dist/{security-cli-DS09ebvA.js → security-cli-CRSXFNRa.js} +5 -5
- package/dist/{security-cli-BZUdnkhn.js → security-cli-CcYc8gKu.js} +34 -34
- package/dist/{server-context-DVh2z7om.js → server-context-Cu88BsgT.js} +9 -9
- package/dist/{server-context-C0xZbYhg.js → server-context-Du3Gdqy1.js} +3 -3
- package/dist/{server-node-events-i1Rrww31.js → server-node-events-0Una3QLI.js} +28 -28
- package/dist/{server-node-events-bu9lpkMH.js → server-node-events-DCY3mm-A.js} +4 -4
- package/dist/{service-CJJwLEor.js → service-BNVpYcQe.js} +2 -2
- package/dist/{service-DxLxBhaU.js → service-CpG4hCVW.js} +1 -1
- package/dist/{service-audit-M8y4TXVb.js → service-audit-B3atdWsy.js} +3 -3
- package/dist/{service-audit-DB4Y3Ekp.js → service-audit-DP4USmzf.js} +4 -4
- package/dist/{session-CGxOLFs2.js → session-B6T_f3RF.js} +9 -9
- package/dist/{session-cost-usage-qdfsGU2a.js → session-cost-usage-BwiTZuKl.js} +3 -3
- package/dist/{session-yOhWcsD2.js → session-xQxk_AyT.js} +4 -4
- package/dist/{sessions-CnRjwdVr.js → sessions-B9VnNnIk.js} +8 -8
- package/dist/{sessions-BgLN4KFr.js → sessions-BQUf6xj_.js} +6 -6
- package/dist/{sessions-wRKla1Qh.js → sessions-G7nfpjc6.js} +25 -25
- package/dist/{shared-Qpt4hUDi.js → shared-BcqU-KU2.js} +3 -3
- package/dist/{shared-kzrojZ1B.js → shared-CkGP1Gie.js} +5 -5
- package/dist/{shared-DS3UaJSP.js → shared-uOwPcrN5.js} +1 -1
- package/dist/{skill-scanner-DLJji5Ye.js → skill-scanner-CkaVLABv.js} +1 -1
- package/dist/{skills-BWFIEp4j.js → skills-B5LQx4lT.js} +3 -3
- package/dist/{skills-cli-BY53ILm2.js → skills-cli-CBFbV14l.js} +5 -5
- package/dist/{skills-cli-CO3gxl8A.js → skills-cli-gGWq4bgb.js} +13 -13
- package/dist/{skills-status-DX5pcqY3.js → skills-status-DaLLXtp7.js} +1 -1
- package/dist/{skills-status-zhcKzGkp.js → skills-status-JQluhU-P.js} +3 -3
- package/dist/{sqlite-CuprTGR7.js → sqlite-BiXgPbCK.js} +4 -4
- package/dist/{sqlite-B6MojU1I.js → sqlite-BukcjdJa.js} +2 -2
- package/dist/{start-Cu3aLoSf.js → start-DaXwIgOn.js} +10 -10
- package/dist/{start-Dz7tMAl8.js → start-Fy8lVmlo.js} +10 -10
- package/dist/{status-G0CITnKR.js → status-C7YN9z1q.js} +1 -1
- package/dist/{status-D2C0JCX3.js → status-DbxQqh2e.js} +33 -33
- package/dist/{status-CaSxhxfV.js → status-XzLCn872.js} +16 -16
- package/dist/{status-DlFMsQzh.js → status-iUSfyst3.js} +3 -3
- package/dist/{status.update-DVFelehi.js → status.update-DEtEANLh.js} +1 -1
- package/dist/{status.update-CHjhVxJY.js → status.update-ZVrSK04Z.js} +4 -4
- package/dist/{subagent-registry-DNDhbHWi.js → subagent-registry-BJzLJ6FY.js} +12 -12
- package/dist/{subagent-registry-3Xb4el-8.js → subagent-registry-DKRVOkTv.js} +11 -11
- package/dist/{system-cli-B5mt0FWa.js → system-cli-CYypNnD9.js} +1 -1
- package/dist/{system-cli-Dg3UQ3Zz.js → system-cli-VMfIEGoj.js} +12 -12
- package/dist/{systemd-RpPE0XGg.js → systemd-BSrHDyeU.js} +2 -2
- package/dist/{systemd-hints-vRInKcz9.js → systemd-hints-J3cHYZVZ.js} +1 -1
- package/dist/{systemd-linger-EujbmI5A.js → systemd-linger-B4wBMvpg.js} +2 -2
- package/dist/{systemd-linger-Dzyxqsod.js → systemd-linger-CmyqQkeC.js} +2 -2
- package/dist/{table-DhXHfRX2.js → table-DoiRPsn0.js} +1 -1
- package/dist/{timeout-Ddn-5kAO.js → timeout-CswI_K-U.js} +2 -2
- package/dist/{tokens-BaM53PEx.js → tokens-C-X7wDKj.js} +1 -1
- package/dist/{trash-Bmxs1Rnm.js → trash-BJLK1vMn.js} +1 -1
- package/dist/{tui-mUwDwqvd.js → tui-BfPtiXD1.js} +12 -12
- package/dist/{tui-cli-Dw7v4JoJ.js → tui-cli-BcsdagN8.js} +18 -18
- package/dist/{tui-cli-B9Sq5-cC.js → tui-cli-DN5WL85n.js} +1 -1
- package/dist/{update-DoZLVjva.js → update-DhOF8e0Q.js} +1 -1
- package/dist/{update-DF0GHG0j.js → update-TxptCqk7.js} +3 -3
- package/dist/{update-check-D5qAKes7.js → update-check-DmODY9MR.js} +3 -3
- package/dist/{update-cli-D36AmALA.js → update-cli-BVeg9il9.js} +91 -91
- package/dist/{update-cli-BNu2Oi7H.js → update-cli-DXAbudd9.js} +39 -39
- package/dist/{update-runner-CNQQaTwA.js → update-runner-B2bjvdxa.js} +5 -5
- package/dist/{update-runner-CvxZmbu-.js → update-runner-CTCGT1OS.js} +3 -3
- package/dist/{usage-BGCwNnjk.js → usage-kVpWUUrn.js} +25 -25
- package/dist/{web-Cv2KnTnL.js → web-B1OjU-Gf.js} +9 -9
- package/dist/{web-B5QG839O.js → web-BGf92cSU.js} +100 -100
- package/dist/{web-Cmnvk9v0.js → web-C4FxauVQ.js} +60 -60
- package/dist/{webhooks-cli-B6y89Pj_.js → webhooks-cli-bEG0ADkY.js} +1 -1
- package/dist/{webhooks-cli-BDzHON4w.js → webhooks-cli-l0yqYtZW.js} +10 -10
- package/dist/{whatsapp-actions-C_5MwVxM.js → whatsapp-actions-CvnLgxjq.js} +10 -10
- package/dist/{whatsapp-actions-zTiVOoOV.js → whatsapp-actions-CwSwIOO3.js} +16 -16
- package/dist/{widearea-dns-CF1gxpJ-.js → widearea-dns-NsEUNYwz.js} +1 -1
- package/dist/{workspace-DLna1IxR.js → workspace-BTjqqJY-.js} +5 -5
- package/dist/{ws-log-Q4wO1Ztb.js → ws-log-N8R5MvGE.js} +2 -2
- package/package.json +1 -1
- package/dist/cli-C3cpDaz8.js +0 -99
- package/dist/dist-CqDI82ei.js +0 -929
- package/dist/dist-DnHRxR5U.js +0 -929
- package/dist/register.configure-CWsySuiq.js +0 -101
- /package/dist/{agents.config-jp7OLssr.js → agents.config-DWZdxlQw.js} +0 -0
- /package/dist/{auth-health-VO_MPqVX.js → auth-health-CP4Id2rW.js} +0 -0
- /package/dist/{auto-update-CpF0fycd.js → auto-update-CUeF99gI.js} +0 -0
- /package/dist/{auto-update-DNWdO7uF.js → auto-update-cgkp9ZTJ.js} +0 -0
- /package/dist/{brew-nqf_MiE4.js → brew-CVZkr0GU.js} +0 -0
- /package/dist/{budget-CRpvqDRX.js → budget-BWBp8Res.js} +0 -0
- /package/dist/{budget-CPedI-qW.js → budget-DxYQSekw.js} +0 -0
- /package/dist/{channels-status-issues-DdJdO866.js → channels-status-issues-DwHRoeWL.js} +0 -0
- /package/dist/{cli-utils-C1YHVD4o.js → cli-utils-DtAxdCte.js} +0 -0
- /package/dist/{clipboard-DES8b1AM.js → clipboard-SCV-0V39.js} +0 -0
- /package/dist/{command-format-G6N2zghg.js → command-format-DAaqLG8J.js} +0 -0
- /package/dist/{command-options-BbponVnw.js → command-options-CSbuuqHr.js} +0 -0
- /package/dist/{command-options-s0gnvXnS.js → command-options-Cp1tf96a.js} +0 -0
- /package/dist/{constants-Dhb6zSIV.js → constants-O8yBqCBv.js} +0 -0
- /package/dist/{daemon-runtime-C0tz7VAC.js → daemon-runtime-C9KTe-Gn.js} +0 -0
- /package/dist/{dangerous-tools-DGTtJ_JR.js → dangerous-tools-5ObDWy1N.js} +0 -0
- /package/dist/{dangerous-tools-DxrfTOfT.js → dangerous-tools-Jwr7jqNw.js} +0 -0
- /package/dist/{delivery-queue-Bxm0nzw7.js → delivery-queue-B6IHz4Ry.js} +0 -0
- /package/dist/{display-Jy3UdGzA.js → display-BDOsXu8F.js} +0 -0
- /package/dist/{docs-cli-CrOaIK_H.js → docs-cli-B02Wm6DH.js} +0 -0
- /package/dist/{errors-CKaCqKga.js → errors-CHow2wtt.js} +0 -0
- /package/dist/{exec-DDmuVVNq.js → exec-BizYYQgP.js} +0 -0
- /package/dist/{format-ByEjgyTF.js → format-Mq6iU0_5.js} +0 -0
- /package/dist/{format-duration-Aaj5tjJd.js → format-duration-DhWzz_5b.js} +0 -0
- /package/dist/{format-relative-79_Y1n2Y.js → format-relative-C6kUHuOj.js} +0 -0
- /package/dist/{gateway-rpc-Dtx8HN-n.js → gateway-rpc-QOe014D_.js} +0 -0
- /package/dist/{gmail-setup-utils-co0ppccC.js → gmail-setup-utils-Bn8x7djJ.js} +0 -0
- /package/dist/{health-format-BksT6F68.js → health-format-DteBvzWP.js} +0 -0
- /package/dist/{help-format-C6cv_aZp.js → help-format-C4eJQd8a.js} +0 -0
- /package/dist/{help-format-BMKzarov.js → help-format-DUBI91Ti.js} +0 -0
- /package/dist/{helpers-FMld9sBT.js → helpers-DLgbkcEn.js} +0 -0
- /package/dist/{helpers-DpEB9Mh0.js → helpers-eJFa4K6r.js} +0 -0
- /package/dist/{input-provenance-Cy_KnBlP.js → input-provenance-DJBdpeKk.js} +0 -0
- /package/dist/{is-main-yjaVwMtJ.js → is-main-Dt9DTcH1.js} +0 -0
- /package/dist/{loader-CkmOrXcC.js → loader-BoYxRfcW.js} +0 -0
- /package/dist/{loader-Br7Vr0zn.js → loader-l2OBdJ8x.js} +0 -0
- /package/dist/{logging-CY-Q5cwf.js → logging-BdnOSVPD.js} +0 -0
- /package/dist/{logging-BIeRw0WR.js → logging-BuRtGUH1.js} +0 -0
- /package/dist/{login-qr-CevLD8cV.js → login-qr-Cc2QmLhD.js} +0 -0
- /package/dist/{message-channel-dua8OOGJ.js → message-channel-w4F2b2F6.js} +0 -0
- /package/dist/{mime-CBg4KybI.js → mime-B1ZoR53M.js} +0 -0
- /package/dist/{model-param-b-DW9f0NN8.js → model-param-b-DPwyNGn8.js} +0 -0
- /package/dist/{node-match-BV8bTBd4.js → node-match-8XZnaid6.js} +0 -0
- /package/dist/{normalize-_lmlBOW9.js → normalize-GDK8JTNW.js} +0 -0
- /package/dist/{npm-registry-spec-DQd4M22q.js → npm-registry-spec-DvJxezSJ.js} +0 -0
- /package/dist/{openclaw-root-JPvmPTf7.js → openclaw-root-C85WMnVV.js} +0 -0
- /package/dist/{outbound-send-deps-BfUvuWGa.js → outbound-send-deps-ANnAhImn.js} +0 -0
- /package/dist/{parse-CZRwKocn.js → parse-6-2MDhdT.js} +0 -0
- /package/dist/{parse-log-line-CvrZEK6A.js → parse-log-line-Bqh1SSzC.js} +0 -0
- /package/dist/{parse-log-line-mLdat0AH.js → parse-log-line-DUZCjXbl.js} +0 -0
- /package/dist/{parse-port-BSOOdo7I.js → parse-port-BKB9Exlg.js} +0 -0
- /package/dist/{parse-port-Y0NK62x1.js → parse-port-DrfvwwiL.js} +0 -0
- /package/dist/{parse-timeout-DVPQ3n9j.js → parse-timeout-Di_tcEmi.js} +0 -0
- /package/dist/{paths-DHjlJ6cn.js → paths-DcVEkYX5.js} +0 -0
- /package/dist/{pi-auth-json-MruLmI_X.js → pi-auth-json-B1M8W1pO.js} +0 -0
- /package/dist/{pi-model-discovery-DzEIEgHL.js → pi-model-discovery-DsRqYJLy.js} +0 -0
- /package/dist/{plugin-auto-enable-CjZ238UI.js → plugin-auto-enable-d9eDmGOX.js} +0 -0
- /package/dist/{plugins-D6PBOdkn.js → plugins-CDJw924T.js} +0 -0
- /package/dist/{program-context-Q1hkT73c.js → program-context-Bvn8046-.js} +0 -0
- /package/dist/{progress-C9Ha1NJh.js → progress-CbZ2D53A.js} +0 -0
- /package/dist/{prompt-style-Cm4wOtKm.js → prompt-style-D6u56SjJ.js} +0 -0
- /package/dist/{prompt-style-DQi8j03a.js → prompt-style-DKy6qQxR.js} +0 -0
- /package/dist/{prompts-BEHxUC3w.js → prompts-BI__va99.js} +0 -0
- /package/dist/{prompts-CSOhuiqe.js → prompts-_dDWkCAz.js} +0 -0
- /package/dist/{pw-ai-BWz3Cxt7.js → pw-ai-CbEgFH-G.js} +0 -0
- /package/dist/{qmd-manager-BcMeZiGD.js → qmd-manager-DPslO6i9.js} +0 -0
- /package/dist/{queue-BJGo7kAB.js → queue-D_u34pbL.js} +0 -0
- /package/dist/{queue-DYgUbdoq.js → queue-PG591iID.js} +0 -0
- /package/dist/{redact-CyKvdFrg.js → redact-ClVwO7Nn.js} +0 -0
- /package/dist/{registry-C5MAYD4V.js → registry-Bs_DJK9E.js} +0 -0
- /package/dist/{registry-CRrXXVs0.js → registry-D_zlP1U-.js} +0 -0
- /package/dist/{requirements-CGkxTCu4.js → requirements-BzZxj2Wu.js} +0 -0
- /package/dist/{requirements-CIDaOcbO.js → requirements-DIW1svgA.js} +0 -0
- /package/dist/{rpc-DgE-xnyx.js → rpc-aBUUQWC3.js} +0 -0
- /package/dist/{runtime-guard-nL3Lp8T-.js → runtime-guard-DeOXA_86.js} +0 -0
- /package/dist/{secret-equal-DJpmLXlG.js → secret-equal-Dghy3xsA.js} +0 -0
- /package/dist/{send-CTcxgDDU.js → send-BhAfdGII.js} +0 -0
- /package/dist/{send-DZQTaG7-.js → send-C2t9xpXI.js} +0 -0
- /package/dist/{send-VDff2gra.js → send-DigO-i9j.js} +0 -0
- /package/dist/{send-bgQNV8d1.js → send-Dz2BDHll.js} +0 -0
- /package/dist/{send-DPezUR3-.js → send-ga9udK1_.js} +0 -0
- /package/dist/{session-key-CQT-NR6w.js → session-key-BGiG_JcT.js} +0 -0
- /package/dist/{shared-DxNHzky3.js → shared-DwguvoZP.js} +0 -0
- /package/dist/{shell-argv-n9IueeJQ.js → shell-argv-CAq1mLa2.js} +0 -0
- /package/dist/{skill-scanner-o6NgVMD9.js → skill-scanner-Coo4QoCd.js} +0 -0
- /package/dist/{status-C53kTIXF.js → status-CMnlcBVc.js} +0 -0
- /package/dist/{status-CZDDA_Sy.js → status-tDZPwewW.js} +0 -0
- /package/dist/{system-run-command-CqAqKL9K.js → system-run-command-DGk7dwQP.js} +0 -0
- /package/dist/{system-run-command-BCjUffN9.js → system-run-command-X9lDJIy0.js} +0 -0
- /package/dist/{systemd-B43AvOGx.js → systemd-BVVNFIBH.js} +0 -0
- /package/dist/{systemd-hints-DMJT-Bbc.js → systemd-hints-Mpt5QteE.js} +0 -0
- /package/dist/{table-bWCLW-3P.js → table-B_wVcaLO.js} +0 -0
- /package/dist/{tailnet-Ciwjv243.js → tailnet-CuiNECdL.js} +0 -0
- /package/dist/{templates-37RKpACb.js → templates-CeYJjVzw.js} +0 -0
- /package/dist/{templates-DPalk30o.js → templates-I3Z0xplD.js} +0 -0
- /package/dist/{thinking-2hxwmvTl.js → thinking-BXEswx1X.js} +0 -0
- /package/dist/{transcript-events-Bp7fGnwv.js → transcript-events-C1hdue6u.js} +0 -0
- /package/dist/{transcript-tools-D4Lbxlka.js → transcript-tools-DuyYOkUq.js} +0 -0
- /package/dist/{tui-BHgBWhHE.js → tui-r0_5VL_h.js} +0 -0
- /package/dist/{update-check-Bt1dVPVN.js → update-check-DlDloai0.js} +0 -0
- /package/dist/{usage-format-6Uar63S0.js → usage-format-BAirWUSO.js} +0 -0
- /package/dist/{utils-DT8uXjFS.js → utils-C9sj30YY.js} +0 -0
- /package/dist/{whatsapp-actions-hgYA12To.js → whatsapp-actions-DsoA_Bad.js} +0 -0
- /package/dist/{widearea-dns-BeIdnISJ.js → widearea-dns-1txrPZ0I.js} +0 -0
- /package/dist/{ws-log-xF0kxDzp.js → ws-log-BffL5dN_.js} +0 -0
- /package/dist/{wsl-CrPvx2kZ.js → wsl-CqyuRvtM.js} +0 -0
- /package/dist/{wsl-UvJ5dHah.js → wsl-ymJYvc9Q.js} +0 -0
package/dist/dist-DnHRxR5U.js
DELETED
|
@@ -1,929 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from "events";
|
|
2
|
-
import { execFile, spawn } from "child_process";
|
|
3
|
-
import * as fs from "fs";
|
|
4
|
-
import * as path from "path";
|
|
5
|
-
import { fileURLToPath } from "url";
|
|
6
|
-
import * as os from "os";
|
|
7
|
-
import * as crypto from "crypto";
|
|
8
|
-
|
|
9
|
-
//#region node_modules/.pnpm/file+..+svrn-node_typescript@5.9.3_zod@4.3.6/node_modules/@noxsoft/svrn-node/dist/index.js
|
|
10
|
-
var ALL_TASK_TYPES = [
|
|
11
|
-
"ping",
|
|
12
|
-
"relay",
|
|
13
|
-
"compute",
|
|
14
|
-
"store",
|
|
15
|
-
"validate"
|
|
16
|
-
];
|
|
17
|
-
var DEFAULT_CONFIG = {
|
|
18
|
-
enabled: true,
|
|
19
|
-
dataDir: getDefaultDataDir(),
|
|
20
|
-
coordinatorUrl: "https://svrn.noxsoft.net",
|
|
21
|
-
resources: {
|
|
22
|
-
maxCpuPercent: 50,
|
|
23
|
-
maxRamMB: 512,
|
|
24
|
-
maxBandwidthMbps: 10,
|
|
25
|
-
maxDiskGB: 5
|
|
26
|
-
},
|
|
27
|
-
taskTypes: [...ALL_TASK_TYPES],
|
|
28
|
-
autoUpdate: {
|
|
29
|
-
enabled: true,
|
|
30
|
-
checkIntervalHours: 6,
|
|
31
|
-
autoRestart: true,
|
|
32
|
-
channel: "stable"
|
|
33
|
-
},
|
|
34
|
-
heartbeatIntervalSec: 30,
|
|
35
|
-
showEarnings: true
|
|
36
|
-
};
|
|
37
|
-
function getDefaultDataDir() {
|
|
38
|
-
return `${process.env["HOME"] || process.env["USERPROFILE"] || "/tmp"}/.svrn-node`;
|
|
39
|
-
}
|
|
40
|
-
function resolveConfig(partial) {
|
|
41
|
-
if (!partial) return { ...DEFAULT_CONFIG };
|
|
42
|
-
return {
|
|
43
|
-
...DEFAULT_CONFIG,
|
|
44
|
-
...partial,
|
|
45
|
-
resources: {
|
|
46
|
-
...DEFAULT_CONFIG.resources,
|
|
47
|
-
...partial.resources ?? {}
|
|
48
|
-
},
|
|
49
|
-
autoUpdate: {
|
|
50
|
-
...DEFAULT_CONFIG.autoUpdate,
|
|
51
|
-
...partial.autoUpdate ?? {}
|
|
52
|
-
},
|
|
53
|
-
taskTypes: partial.taskTypes ?? [...ALL_TASK_TYPES]
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
var PACKAGE_NAME = "@noxsoft/svrn-node";
|
|
57
|
-
var REGISTRY_BASE = "https://registry.npmjs.org";
|
|
58
|
-
var AutoUpdater = class extends EventEmitter {
|
|
59
|
-
config;
|
|
60
|
-
currentVersion;
|
|
61
|
-
checkTimer = null;
|
|
62
|
-
logFile;
|
|
63
|
-
checking = false;
|
|
64
|
-
constructor(config, dataDir) {
|
|
65
|
-
super();
|
|
66
|
-
this.config = config;
|
|
67
|
-
this.currentVersion = this.readCurrentVersion();
|
|
68
|
-
this.logFile = path.join(dataDir, "updates.log");
|
|
69
|
-
fs.mkdirSync(dataDir, { recursive: true });
|
|
70
|
-
}
|
|
71
|
-
/** Start the periodic update check loop. */
|
|
72
|
-
start() {
|
|
73
|
-
if (!this.config.enabled) return;
|
|
74
|
-
this.check();
|
|
75
|
-
const intervalMs = this.config.checkIntervalHours * 60 * 60 * 1e3;
|
|
76
|
-
this.checkTimer = setInterval(() => void this.check(), intervalMs);
|
|
77
|
-
}
|
|
78
|
-
/** Stop the update check loop. */
|
|
79
|
-
stop() {
|
|
80
|
-
if (this.checkTimer) {
|
|
81
|
-
clearInterval(this.checkTimer);
|
|
82
|
-
this.checkTimer = null;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/** Get the current installed version. */
|
|
86
|
-
getVersion() {
|
|
87
|
-
return this.currentVersion;
|
|
88
|
-
}
|
|
89
|
-
/** Manually trigger an update check. Returns info if update found, null otherwise. */
|
|
90
|
-
async check() {
|
|
91
|
-
if (this.checking) return null;
|
|
92
|
-
this.checking = true;
|
|
93
|
-
try {
|
|
94
|
-
const tag = this.config.channel === "beta" ? "beta" : "latest";
|
|
95
|
-
const latestVersion = await this.fetchLatestVersion(tag);
|
|
96
|
-
if (!latestVersion) return null;
|
|
97
|
-
if (this.isNewer(latestVersion, this.currentVersion)) {
|
|
98
|
-
const info = {
|
|
99
|
-
currentVersion: this.currentVersion,
|
|
100
|
-
latestVersion,
|
|
101
|
-
channel: this.config.channel,
|
|
102
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
103
|
-
};
|
|
104
|
-
this.emit("update-available", info);
|
|
105
|
-
this.log(`Update available: ${this.currentVersion} -> ${latestVersion}`);
|
|
106
|
-
if (this.config.autoRestart) {
|
|
107
|
-
await this.installUpdate(latestVersion);
|
|
108
|
-
this.log(`Update installed: ${latestVersion}`);
|
|
109
|
-
this.emit("update-installed", info);
|
|
110
|
-
this.restartProcess();
|
|
111
|
-
}
|
|
112
|
-
return info;
|
|
113
|
-
}
|
|
114
|
-
return null;
|
|
115
|
-
} catch (error) {
|
|
116
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
117
|
-
this.log(`Update check failed: ${msg}`);
|
|
118
|
-
this.emit("update-error", error);
|
|
119
|
-
return null;
|
|
120
|
-
} finally {
|
|
121
|
-
this.checking = false;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Install a specific version and restart (for manual `svrn-node update`).
|
|
126
|
-
* Returns the UpdateInfo if an update was installed, null if already current.
|
|
127
|
-
*/
|
|
128
|
-
async installAndRestart() {
|
|
129
|
-
const tag = this.config.channel === "beta" ? "beta" : "latest";
|
|
130
|
-
const latestVersion = await this.fetchLatestVersion(tag);
|
|
131
|
-
if (!latestVersion) {
|
|
132
|
-
this.log("No version found on npm — package may not be published yet.");
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
if (!this.isNewer(latestVersion, this.currentVersion)) return null;
|
|
136
|
-
const info = {
|
|
137
|
-
currentVersion: this.currentVersion,
|
|
138
|
-
latestVersion,
|
|
139
|
-
channel: this.config.channel,
|
|
140
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
141
|
-
};
|
|
142
|
-
await this.installUpdate(latestVersion);
|
|
143
|
-
this.log(`Update installed: ${latestVersion}`);
|
|
144
|
-
this.emit("update-installed", info);
|
|
145
|
-
return info;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Fetch the latest version from the npm registry HTTP API.
|
|
149
|
-
* Uses simple fetch — no npm CLI needed for checking.
|
|
150
|
-
*
|
|
151
|
-
* For the 'stable' channel, fetches the 'latest' dist-tag.
|
|
152
|
-
* For the 'beta' channel, fetches the 'beta' dist-tag.
|
|
153
|
-
*/
|
|
154
|
-
async fetchLatestVersion(tag) {
|
|
155
|
-
try {
|
|
156
|
-
const url = `${REGISTRY_BASE}/${encodeURIComponent(PACKAGE_NAME)}/${tag}`;
|
|
157
|
-
const response = await fetch(url, {
|
|
158
|
-
headers: { Accept: "application/json" },
|
|
159
|
-
signal: AbortSignal.timeout(15e3)
|
|
160
|
-
});
|
|
161
|
-
if (!response.ok) {
|
|
162
|
-
if (response.status === 404) return null;
|
|
163
|
-
return null;
|
|
164
|
-
}
|
|
165
|
-
return (await response.json()).version ?? null;
|
|
166
|
-
} catch {
|
|
167
|
-
return null;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
/** Install the specified version via npm. */
|
|
171
|
-
installUpdate(version) {
|
|
172
|
-
return new Promise((resolve, reject) => {
|
|
173
|
-
const thisDir = path.dirname(fileURLToPath(import.meta.url));
|
|
174
|
-
const isGlobal = thisDir.includes("/lib/node_modules/") || thisDir.includes("\\node_modules\\");
|
|
175
|
-
execFile("npm", isGlobal ? [
|
|
176
|
-
"install",
|
|
177
|
-
"-g",
|
|
178
|
-
`${PACKAGE_NAME}@${version}`
|
|
179
|
-
] : ["install", `${PACKAGE_NAME}@${version}`], {
|
|
180
|
-
timeout: 12e4,
|
|
181
|
-
cwd: isGlobal ? void 0 : this.findProjectRoot(thisDir) ?? void 0
|
|
182
|
-
}, (error) => {
|
|
183
|
-
if (error) {
|
|
184
|
-
reject(/* @__PURE__ */ new Error(`Failed to install update: ${error.message}`));
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
resolve();
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Restart the process by exec-ing the svrn-node binary.
|
|
193
|
-
* This replaces the current process entirely with the new version.
|
|
194
|
-
*/
|
|
195
|
-
restartProcess() {
|
|
196
|
-
this.log("Restarting with updated binary...");
|
|
197
|
-
if (!process.argv[1]) {
|
|
198
|
-
this.log("Cannot determine binary path for restart — manual restart required.");
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
const args = process.argv.slice(1);
|
|
202
|
-
try {
|
|
203
|
-
spawn(process.execPath, args, {
|
|
204
|
-
detached: true,
|
|
205
|
-
stdio: "inherit"
|
|
206
|
-
}).unref();
|
|
207
|
-
process.exit(0);
|
|
208
|
-
} catch (error) {
|
|
209
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
210
|
-
this.log(`Restart failed: ${msg} \u2014 manual restart required.`);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
/** Read the current package version from package.json. */
|
|
214
|
-
readCurrentVersion() {
|
|
215
|
-
try {
|
|
216
|
-
let dir = path.dirname(fileURLToPath(import.meta.url));
|
|
217
|
-
for (let i = 0; i < 5; i++) {
|
|
218
|
-
const pkgPath = path.join(dir, "package.json");
|
|
219
|
-
if (fs.existsSync(pkgPath)) {
|
|
220
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
221
|
-
if (pkg.name === PACKAGE_NAME) return pkg.version ?? "0.0.0";
|
|
222
|
-
}
|
|
223
|
-
dir = path.dirname(dir);
|
|
224
|
-
}
|
|
225
|
-
} catch {}
|
|
226
|
-
return "0.0.0";
|
|
227
|
-
}
|
|
228
|
-
/** Compare semver strings. Returns true if `a` is newer than `b`. */
|
|
229
|
-
isNewer(a, b) {
|
|
230
|
-
const parse = (v) => v.replace(/[^0-9.]/g, "").split(".").map(Number);
|
|
231
|
-
const [aMajor = 0, aMinor = 0, aPatch = 0] = parse(a);
|
|
232
|
-
const [bMajor = 0, bMinor = 0, bPatch = 0] = parse(b);
|
|
233
|
-
if (aMajor !== bMajor) return aMajor > bMajor;
|
|
234
|
-
if (aMinor !== bMinor) return aMinor > bMinor;
|
|
235
|
-
return aPatch > bPatch;
|
|
236
|
-
}
|
|
237
|
-
/** Find the nearest ancestor directory containing package.json. */
|
|
238
|
-
findProjectRoot(startDir) {
|
|
239
|
-
let dir = startDir;
|
|
240
|
-
for (let i = 0; i < 10; i++) {
|
|
241
|
-
const pkgPath = path.join(dir, "package.json");
|
|
242
|
-
if (fs.existsSync(pkgPath)) {
|
|
243
|
-
if (JSON.parse(fs.readFileSync(pkgPath, "utf-8")).name !== PACKAGE_NAME) return dir;
|
|
244
|
-
}
|
|
245
|
-
const parent = path.dirname(dir);
|
|
246
|
-
if (parent === dir) break;
|
|
247
|
-
dir = parent;
|
|
248
|
-
}
|
|
249
|
-
return null;
|
|
250
|
-
}
|
|
251
|
-
/** Append a log entry to the updates log file. */
|
|
252
|
-
log(message) {
|
|
253
|
-
const line = `[${(/* @__PURE__ */ new Date()).toISOString()}] ${message}
|
|
254
|
-
`;
|
|
255
|
-
try {
|
|
256
|
-
fs.appendFileSync(this.logFile, line);
|
|
257
|
-
} catch {}
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
var UCU_TO_USD = .001;
|
|
261
|
-
var EarningsTracker = class {
|
|
262
|
-
ledgerFile;
|
|
263
|
-
sessionStart;
|
|
264
|
-
sessionEarnings = 0;
|
|
265
|
-
sessionTasks = 0;
|
|
266
|
-
allTimeEarnings = 0;
|
|
267
|
-
allTimeTasks = 0;
|
|
268
|
-
todayEarnings = 0;
|
|
269
|
-
todayTasks = 0;
|
|
270
|
-
todayDate;
|
|
271
|
-
constructor(dataDir) {
|
|
272
|
-
this.ledgerFile = path.join(dataDir, "earnings-ledger.jsonl");
|
|
273
|
-
this.sessionStart = (/* @__PURE__ */ new Date()).toISOString();
|
|
274
|
-
this.todayDate = this.utcDateString();
|
|
275
|
-
fs.mkdirSync(dataDir, { recursive: true });
|
|
276
|
-
this.loadHistorical();
|
|
277
|
-
}
|
|
278
|
-
/** Record earnings for a completed task. */
|
|
279
|
-
record(taskType, taskId, amount, durationMs) {
|
|
280
|
-
const entry = {
|
|
281
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
282
|
-
taskType,
|
|
283
|
-
taskId,
|
|
284
|
-
amount,
|
|
285
|
-
duration: durationMs
|
|
286
|
-
};
|
|
287
|
-
this.sessionEarnings += amount;
|
|
288
|
-
this.sessionTasks += 1;
|
|
289
|
-
this.allTimeEarnings += amount;
|
|
290
|
-
this.allTimeTasks += 1;
|
|
291
|
-
const today = this.utcDateString();
|
|
292
|
-
if (today !== this.todayDate) {
|
|
293
|
-
this.todayEarnings = 0;
|
|
294
|
-
this.todayTasks = 0;
|
|
295
|
-
this.todayDate = today;
|
|
296
|
-
}
|
|
297
|
-
this.todayEarnings += amount;
|
|
298
|
-
this.todayTasks += 1;
|
|
299
|
-
try {
|
|
300
|
-
fs.appendFileSync(this.ledgerFile, JSON.stringify(entry) + "\n");
|
|
301
|
-
} catch {}
|
|
302
|
-
}
|
|
303
|
-
/** Get a summary of earnings. */
|
|
304
|
-
getSummary() {
|
|
305
|
-
const today = this.utcDateString();
|
|
306
|
-
if (today !== this.todayDate) {
|
|
307
|
-
this.todayEarnings = 0;
|
|
308
|
-
this.todayTasks = 0;
|
|
309
|
-
this.todayDate = today;
|
|
310
|
-
}
|
|
311
|
-
const hoursToday = this.hoursSinceSessionStart();
|
|
312
|
-
const hourlyRate = hoursToday > 0 ? this.sessionEarnings / hoursToday : 0;
|
|
313
|
-
const estimatedMonthlyUCU = hourlyRate * 24 * 30;
|
|
314
|
-
const estimatedAnnualUCU = hourlyRate * 24 * 365;
|
|
315
|
-
return {
|
|
316
|
-
session: round(this.sessionEarnings),
|
|
317
|
-
today: round(this.todayEarnings),
|
|
318
|
-
allTime: round(this.allTimeEarnings),
|
|
319
|
-
tasksThisSession: this.sessionTasks,
|
|
320
|
-
tasksToday: this.todayTasks,
|
|
321
|
-
tasksAllTime: this.allTimeTasks,
|
|
322
|
-
estimatedMonthlySavingsUSD: round(estimatedMonthlyUCU * UCU_TO_USD),
|
|
323
|
-
estimatedAnnualSavingsUSD: round(estimatedAnnualUCU * UCU_TO_USD)
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
|
-
/** Get raw ledger entries for a date range. */
|
|
327
|
-
getLedger(fromDate, toDate) {
|
|
328
|
-
if (!fs.existsSync(this.ledgerFile)) return [];
|
|
329
|
-
const lines = fs.readFileSync(this.ledgerFile, "utf-8").trim().split("\n");
|
|
330
|
-
const entries = [];
|
|
331
|
-
for (const line of lines) {
|
|
332
|
-
if (!line.trim()) continue;
|
|
333
|
-
try {
|
|
334
|
-
const entry = JSON.parse(line);
|
|
335
|
-
if (fromDate && entry.timestamp < fromDate) continue;
|
|
336
|
-
if (toDate && entry.timestamp > toDate) continue;
|
|
337
|
-
entries.push(entry);
|
|
338
|
-
} catch {}
|
|
339
|
-
}
|
|
340
|
-
return entries;
|
|
341
|
-
}
|
|
342
|
-
loadHistorical() {
|
|
343
|
-
if (!fs.existsSync(this.ledgerFile)) return;
|
|
344
|
-
const today = this.utcDateString();
|
|
345
|
-
const lines = fs.readFileSync(this.ledgerFile, "utf-8").trim().split("\n");
|
|
346
|
-
for (const line of lines) {
|
|
347
|
-
if (!line.trim()) continue;
|
|
348
|
-
try {
|
|
349
|
-
const entry = JSON.parse(line);
|
|
350
|
-
this.allTimeEarnings += entry.amount;
|
|
351
|
-
this.allTimeTasks += 1;
|
|
352
|
-
if (entry.timestamp.startsWith(today)) {
|
|
353
|
-
this.todayEarnings += entry.amount;
|
|
354
|
-
this.todayTasks += 1;
|
|
355
|
-
}
|
|
356
|
-
} catch {}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
utcDateString() {
|
|
360
|
-
return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
361
|
-
}
|
|
362
|
-
hoursSinceSessionStart() {
|
|
363
|
-
return (Date.now() - new Date(this.sessionStart).getTime()) / (1e3 * 60 * 60);
|
|
364
|
-
}
|
|
365
|
-
};
|
|
366
|
-
function round(n, decimals = 4) {
|
|
367
|
-
const factor = 10 ** decimals;
|
|
368
|
-
return Math.round(n * factor) / factor;
|
|
369
|
-
}
|
|
370
|
-
var ResourceMonitor = class {
|
|
371
|
-
limits;
|
|
372
|
-
lastCpuInfo = null;
|
|
373
|
-
lastCpuTime = 0;
|
|
374
|
-
pollTimer = null;
|
|
375
|
-
currentSnapshot;
|
|
376
|
-
bytesTransferred = 0;
|
|
377
|
-
lastBandwidthCheck = Date.now();
|
|
378
|
-
constructor(limits) {
|
|
379
|
-
this.limits = limits;
|
|
380
|
-
this.currentSnapshot = {
|
|
381
|
-
cpuPercent: 0,
|
|
382
|
-
ramMB: 0,
|
|
383
|
-
bandwidthMbps: 0,
|
|
384
|
-
timestamp: Date.now()
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
/** Start polling resource usage. */
|
|
388
|
-
start(intervalMs = 2e3) {
|
|
389
|
-
this.lastCpuInfo = os.cpus();
|
|
390
|
-
this.lastCpuTime = Date.now();
|
|
391
|
-
this.poll();
|
|
392
|
-
this.pollTimer = setInterval(() => this.poll(), intervalMs);
|
|
393
|
-
}
|
|
394
|
-
/** Stop polling. */
|
|
395
|
-
stop() {
|
|
396
|
-
if (this.pollTimer) {
|
|
397
|
-
clearInterval(this.pollTimer);
|
|
398
|
-
this.pollTimer = null;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
/** Record bytes transferred for bandwidth estimation. */
|
|
402
|
-
recordBytes(bytes) {
|
|
403
|
-
this.bytesTransferred += bytes;
|
|
404
|
-
}
|
|
405
|
-
/** Get the latest resource snapshot. */
|
|
406
|
-
getSnapshot() {
|
|
407
|
-
return { ...this.currentSnapshot };
|
|
408
|
-
}
|
|
409
|
-
/** Check whether we have capacity to accept a new task. */
|
|
410
|
-
hasCapacity() {
|
|
411
|
-
const snap = this.currentSnapshot;
|
|
412
|
-
return snap.cpuPercent < this.limits.maxCpuPercent && snap.ramMB < this.limits.maxRamMB && snap.bandwidthMbps < this.limits.maxBandwidthMbps;
|
|
413
|
-
}
|
|
414
|
-
/** Get the current resource limits. */
|
|
415
|
-
getLimits() {
|
|
416
|
-
return { ...this.limits };
|
|
417
|
-
}
|
|
418
|
-
/** Update limits at runtime (e.g. user changes config). */
|
|
419
|
-
updateLimits(limits) {
|
|
420
|
-
this.limits = {
|
|
421
|
-
...this.limits,
|
|
422
|
-
...limits
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
poll() {
|
|
426
|
-
const now = Date.now();
|
|
427
|
-
const cpus2 = os.cpus();
|
|
428
|
-
let cpuPercent = 0;
|
|
429
|
-
if (this.lastCpuInfo && cpus2.length > 0) {
|
|
430
|
-
let totalDiff = 0;
|
|
431
|
-
let idleDiff = 0;
|
|
432
|
-
for (let i = 0; i < cpus2.length; i++) {
|
|
433
|
-
const prev = this.lastCpuInfo[i];
|
|
434
|
-
const curr = cpus2[i];
|
|
435
|
-
if (!prev || !curr) continue;
|
|
436
|
-
const prevTotal = prev.times.user + prev.times.nice + prev.times.sys + prev.times.idle + prev.times.irq;
|
|
437
|
-
const currTotal = curr.times.user + curr.times.nice + curr.times.sys + curr.times.idle + curr.times.irq;
|
|
438
|
-
totalDiff += currTotal - prevTotal;
|
|
439
|
-
idleDiff += curr.times.idle - prev.times.idle;
|
|
440
|
-
}
|
|
441
|
-
if (totalDiff > 0) cpuPercent = Math.round((totalDiff - idleDiff) / totalDiff * 100);
|
|
442
|
-
}
|
|
443
|
-
this.lastCpuInfo = cpus2;
|
|
444
|
-
this.lastCpuTime = now;
|
|
445
|
-
const ramMB = Math.round(process.memoryUsage.rss() / (1024 * 1024));
|
|
446
|
-
const bwElapsed = (now - this.lastBandwidthCheck) / 1e3;
|
|
447
|
-
let bandwidthMbps = 0;
|
|
448
|
-
if (bwElapsed > 0) {
|
|
449
|
-
bandwidthMbps = Math.round(this.bytesTransferred * 8 / (bwElapsed * 1e6) * 100) / 100;
|
|
450
|
-
this.bytesTransferred = 0;
|
|
451
|
-
this.lastBandwidthCheck = now;
|
|
452
|
-
}
|
|
453
|
-
this.currentSnapshot = {
|
|
454
|
-
cpuPercent,
|
|
455
|
-
ramMB,
|
|
456
|
-
bandwidthMbps,
|
|
457
|
-
timestamp: now
|
|
458
|
-
};
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
var TaskProcessor = class {
|
|
462
|
-
monitor;
|
|
463
|
-
activeTasks = /* @__PURE__ */ new Map();
|
|
464
|
-
signFn;
|
|
465
|
-
constructor(monitor, signFn) {
|
|
466
|
-
this.monitor = monitor;
|
|
467
|
-
this.signFn = signFn;
|
|
468
|
-
}
|
|
469
|
-
/** Check whether the node can accept a task right now. */
|
|
470
|
-
canAccept(task) {
|
|
471
|
-
if (!this.monitor.hasCapacity()) return false;
|
|
472
|
-
if (Date.now() > task.deadline) return false;
|
|
473
|
-
if (this.activeTasks.size >= 5) return false;
|
|
474
|
-
return true;
|
|
475
|
-
}
|
|
476
|
-
/** Process a task and return the result. */
|
|
477
|
-
async process(task) {
|
|
478
|
-
this.activeTasks.set(task.id, task);
|
|
479
|
-
const start = Date.now();
|
|
480
|
-
try {
|
|
481
|
-
let output;
|
|
482
|
-
switch (task.payload.kind) {
|
|
483
|
-
case "ping":
|
|
484
|
-
output = await this.processPing(task.payload);
|
|
485
|
-
break;
|
|
486
|
-
case "relay":
|
|
487
|
-
output = await this.processRelay(task.payload);
|
|
488
|
-
break;
|
|
489
|
-
case "compute":
|
|
490
|
-
output = await this.processCompute(task.payload);
|
|
491
|
-
break;
|
|
492
|
-
case "store":
|
|
493
|
-
output = await this.processStore(task.payload);
|
|
494
|
-
break;
|
|
495
|
-
case "validate":
|
|
496
|
-
output = this.processValidate(task.payload);
|
|
497
|
-
break;
|
|
498
|
-
default: throw new Error(`Unknown task type: ${task.payload.kind}`);
|
|
499
|
-
}
|
|
500
|
-
const durationMs = Date.now() - start;
|
|
501
|
-
const proof = this.generateProof(task.id, output, durationMs);
|
|
502
|
-
return {
|
|
503
|
-
taskId: task.id,
|
|
504
|
-
success: true,
|
|
505
|
-
output,
|
|
506
|
-
durationMs,
|
|
507
|
-
proof
|
|
508
|
-
};
|
|
509
|
-
} catch (error) {
|
|
510
|
-
const durationMs = Date.now() - start;
|
|
511
|
-
return {
|
|
512
|
-
taskId: task.id,
|
|
513
|
-
success: false,
|
|
514
|
-
output: error instanceof Error ? error.message : "Unknown error",
|
|
515
|
-
durationMs,
|
|
516
|
-
proof: ""
|
|
517
|
-
};
|
|
518
|
-
} finally {
|
|
519
|
-
this.activeTasks.delete(task.id);
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
/** Get number of currently active tasks. */
|
|
523
|
-
getActiveCount() {
|
|
524
|
-
return this.activeTasks.size;
|
|
525
|
-
}
|
|
526
|
-
async processPing(payload) {
|
|
527
|
-
const start = Date.now();
|
|
528
|
-
try {
|
|
529
|
-
const response = await fetch(payload.target, {
|
|
530
|
-
method: "HEAD",
|
|
531
|
-
signal: AbortSignal.timeout(1e4)
|
|
532
|
-
});
|
|
533
|
-
const latencyMs = Date.now() - start;
|
|
534
|
-
const success = response.status === payload.expectedStatusCode;
|
|
535
|
-
return JSON.stringify({
|
|
536
|
-
status: response.status,
|
|
537
|
-
latencyMs,
|
|
538
|
-
success
|
|
539
|
-
});
|
|
540
|
-
} catch (error) {
|
|
541
|
-
const latencyMs = Date.now() - start;
|
|
542
|
-
return JSON.stringify({
|
|
543
|
-
status: 0,
|
|
544
|
-
latencyMs,
|
|
545
|
-
success: false,
|
|
546
|
-
error: error instanceof Error ? error.message : "timeout"
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
async processRelay(payload) {
|
|
551
|
-
const sourceResp = await fetch(payload.sourceUrl, { signal: AbortSignal.timeout(3e4) });
|
|
552
|
-
if (!sourceResp.ok) throw new Error(`Source fetch failed: ${sourceResp.status}`);
|
|
553
|
-
const body = await sourceResp.arrayBuffer();
|
|
554
|
-
this.monitor.recordBytes(body.byteLength);
|
|
555
|
-
const destResp = await fetch(payload.destinationUrl, {
|
|
556
|
-
method: "POST",
|
|
557
|
-
body,
|
|
558
|
-
signal: AbortSignal.timeout(3e4)
|
|
559
|
-
});
|
|
560
|
-
this.monitor.recordBytes(body.byteLength);
|
|
561
|
-
return JSON.stringify({
|
|
562
|
-
bytesRelayed: body.byteLength,
|
|
563
|
-
destinationStatus: destResp.status,
|
|
564
|
-
success: destResp.ok
|
|
565
|
-
});
|
|
566
|
-
}
|
|
567
|
-
async processCompute(payload) {
|
|
568
|
-
const timeoutMs = Math.min(payload.timeoutMs, 3e4);
|
|
569
|
-
return new Promise((resolve, reject) => {
|
|
570
|
-
const timer = setTimeout(() => {
|
|
571
|
-
reject(/* @__PURE__ */ new Error("Compute task timed out"));
|
|
572
|
-
}, timeoutMs);
|
|
573
|
-
try {
|
|
574
|
-
const hash = crypto.createHash("sha256").update(payload.workload).update(payload.input).digest("hex");
|
|
575
|
-
clearTimeout(timer);
|
|
576
|
-
resolve(JSON.stringify({
|
|
577
|
-
resultHash: hash,
|
|
578
|
-
inputLength: payload.input.length
|
|
579
|
-
}));
|
|
580
|
-
} catch (error) {
|
|
581
|
-
clearTimeout(timer);
|
|
582
|
-
reject(error);
|
|
583
|
-
}
|
|
584
|
-
});
|
|
585
|
-
}
|
|
586
|
-
async processStore(payload) {
|
|
587
|
-
const data = Buffer.from(payload.data, "base64");
|
|
588
|
-
const hash = crypto.createHash("sha256").update(data).digest("hex");
|
|
589
|
-
this.monitor.recordBytes(data.byteLength);
|
|
590
|
-
return JSON.stringify({
|
|
591
|
-
chunkId: payload.chunkId,
|
|
592
|
-
sizeBytes: data.byteLength,
|
|
593
|
-
hash,
|
|
594
|
-
ttlSec: payload.ttlSec,
|
|
595
|
-
stored: true
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
processValidate(payload) {
|
|
599
|
-
const actualHash = crypto.createHash("sha256").update(payload.resultData).digest("hex");
|
|
600
|
-
const valid = actualHash === payload.expectedHash;
|
|
601
|
-
return JSON.stringify({
|
|
602
|
-
resultId: payload.resultId,
|
|
603
|
-
expectedHash: payload.expectedHash,
|
|
604
|
-
actualHash,
|
|
605
|
-
valid
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
/** Generate a signed proof-of-work for the completed task. */
|
|
609
|
-
generateProof(taskId, output, durationMs) {
|
|
610
|
-
const proofData = `${taskId}:${crypto.createHash("sha256").update(output).digest("hex")}:${durationMs}`;
|
|
611
|
-
return `${proofData}:${this.signFn(proofData).toString("base64")}`;
|
|
612
|
-
}
|
|
613
|
-
};
|
|
614
|
-
var UCUWallet = class _UCUWallet {
|
|
615
|
-
publicKey;
|
|
616
|
-
privateKey;
|
|
617
|
-
balance = 0;
|
|
618
|
-
pendingBalance = 0;
|
|
619
|
-
totalEarned = 0;
|
|
620
|
-
lastPayout = null;
|
|
621
|
-
stateFile;
|
|
622
|
-
constructor(publicKey, privateKey, stateFile) {
|
|
623
|
-
this.publicKey = publicKey;
|
|
624
|
-
this.privateKey = privateKey;
|
|
625
|
-
this.stateFile = stateFile;
|
|
626
|
-
}
|
|
627
|
-
/**
|
|
628
|
-
* Load or create a wallet from the given data directory.
|
|
629
|
-
* If a keypair exists on disk, it is loaded. Otherwise a new
|
|
630
|
-
* Ed25519 keypair is generated and saved.
|
|
631
|
-
*/
|
|
632
|
-
static async init(dataDir) {
|
|
633
|
-
const keyFile = path.join(dataDir, "wallet.key");
|
|
634
|
-
const stateFile = path.join(dataDir, "wallet.json");
|
|
635
|
-
fs.mkdirSync(dataDir, { recursive: true });
|
|
636
|
-
let publicKey;
|
|
637
|
-
let privateKey;
|
|
638
|
-
if (fs.existsSync(keyFile)) {
|
|
639
|
-
const raw = fs.readFileSync(keyFile, "utf-8");
|
|
640
|
-
const parsed = JSON.parse(raw);
|
|
641
|
-
publicKey = parsed.publicKey;
|
|
642
|
-
privateKey = crypto.createPrivateKey({
|
|
643
|
-
key: Buffer.from(parsed.privateKey, "base64"),
|
|
644
|
-
format: "der",
|
|
645
|
-
type: "pkcs8"
|
|
646
|
-
});
|
|
647
|
-
} else {
|
|
648
|
-
const pair = crypto.generateKeyPairSync("ed25519");
|
|
649
|
-
const pubDer = pair.publicKey.export({
|
|
650
|
-
type: "spki",
|
|
651
|
-
format: "der"
|
|
652
|
-
}).toString("base64");
|
|
653
|
-
const privDer = pair.privateKey.export({
|
|
654
|
-
type: "pkcs8",
|
|
655
|
-
format: "der"
|
|
656
|
-
}).toString("base64");
|
|
657
|
-
publicKey = pubDer;
|
|
658
|
-
privateKey = pair.privateKey;
|
|
659
|
-
fs.writeFileSync(keyFile, JSON.stringify({
|
|
660
|
-
publicKey: pubDer,
|
|
661
|
-
privateKey: privDer
|
|
662
|
-
}), { mode: 384 });
|
|
663
|
-
}
|
|
664
|
-
const wallet = new _UCUWallet(publicKey, privateKey, stateFile);
|
|
665
|
-
if (fs.existsSync(stateFile)) try {
|
|
666
|
-
const saved = JSON.parse(fs.readFileSync(stateFile, "utf-8"));
|
|
667
|
-
wallet.balance = saved.balance ?? 0;
|
|
668
|
-
wallet.pendingBalance = saved.pendingBalance ?? 0;
|
|
669
|
-
wallet.totalEarned = saved.totalEarned ?? 0;
|
|
670
|
-
wallet.lastPayout = saved.lastPayout ?? null;
|
|
671
|
-
} catch {}
|
|
672
|
-
return wallet;
|
|
673
|
-
}
|
|
674
|
-
/** Get the node's public key (base64 DER). */
|
|
675
|
-
getPublicKey() {
|
|
676
|
-
return this.publicKey;
|
|
677
|
-
}
|
|
678
|
-
/** Get a short node ID derived from the public key. */
|
|
679
|
-
getNodeId() {
|
|
680
|
-
return `svrn-${crypto.createHash("sha256").update(this.publicKey).digest("hex").slice(0, 12)}`;
|
|
681
|
-
}
|
|
682
|
-
/** Sign arbitrary data with the node's private key. */
|
|
683
|
-
sign(data) {
|
|
684
|
-
return crypto.sign(null, Buffer.from(data), this.privateKey);
|
|
685
|
-
}
|
|
686
|
-
/** Credit UCU for a completed task. */
|
|
687
|
-
credit(amount) {
|
|
688
|
-
this.balance += amount;
|
|
689
|
-
this.totalEarned += amount;
|
|
690
|
-
this.lastPayout = (/* @__PURE__ */ new Date()).toISOString();
|
|
691
|
-
this.persist();
|
|
692
|
-
}
|
|
693
|
-
/** Move amount from balance to pending (e.g. withdrawal request). */
|
|
694
|
-
reserve(amount) {
|
|
695
|
-
if (amount > this.balance) return false;
|
|
696
|
-
this.balance -= amount;
|
|
697
|
-
this.pendingBalance += amount;
|
|
698
|
-
this.persist();
|
|
699
|
-
return true;
|
|
700
|
-
}
|
|
701
|
-
/** Confirm a pending withdrawal. */
|
|
702
|
-
confirmWithdrawal(amount) {
|
|
703
|
-
this.pendingBalance = Math.max(0, this.pendingBalance - amount);
|
|
704
|
-
this.persist();
|
|
705
|
-
}
|
|
706
|
-
/** Get the current wallet state. */
|
|
707
|
-
getState() {
|
|
708
|
-
return {
|
|
709
|
-
publicKey: this.publicKey,
|
|
710
|
-
balance: this.balance,
|
|
711
|
-
pendingBalance: this.pendingBalance,
|
|
712
|
-
totalEarned: this.totalEarned,
|
|
713
|
-
lastPayout: this.lastPayout
|
|
714
|
-
};
|
|
715
|
-
}
|
|
716
|
-
/** Persist wallet state to disk. */
|
|
717
|
-
persist() {
|
|
718
|
-
try {
|
|
719
|
-
fs.writeFileSync(this.stateFile, JSON.stringify({
|
|
720
|
-
publicKey: this.publicKey,
|
|
721
|
-
balance: this.balance,
|
|
722
|
-
pendingBalance: this.pendingBalance,
|
|
723
|
-
totalEarned: this.totalEarned,
|
|
724
|
-
lastPayout: this.lastPayout
|
|
725
|
-
}, null, 2));
|
|
726
|
-
} catch {}
|
|
727
|
-
}
|
|
728
|
-
};
|
|
729
|
-
var SVRNNode = class extends EventEmitter {
|
|
730
|
-
config;
|
|
731
|
-
state = "stopped";
|
|
732
|
-
startTime = 0;
|
|
733
|
-
wallet;
|
|
734
|
-
monitor;
|
|
735
|
-
processor;
|
|
736
|
-
earnings;
|
|
737
|
-
updater;
|
|
738
|
-
heartbeatTimer = null;
|
|
739
|
-
coordinatorConnected = false;
|
|
740
|
-
constructor(config) {
|
|
741
|
-
super();
|
|
742
|
-
this.config = resolveConfig(config);
|
|
743
|
-
}
|
|
744
|
-
/** Start the SVRN node. */
|
|
745
|
-
async start() {
|
|
746
|
-
if (this.state !== "stopped") throw new Error(`Cannot start: node is ${this.state}`);
|
|
747
|
-
this.state = "starting";
|
|
748
|
-
this.emit("state-change", this.state);
|
|
749
|
-
this.wallet = await UCUWallet.init(this.config.dataDir);
|
|
750
|
-
this.monitor = new ResourceMonitor(this.config.resources);
|
|
751
|
-
this.processor = new TaskProcessor(this.monitor, (data) => this.wallet.sign(data));
|
|
752
|
-
this.earnings = new EarningsTracker(this.config.dataDir);
|
|
753
|
-
this.updater = new AutoUpdater(this.config.autoUpdate, this.config.dataDir);
|
|
754
|
-
this.updater.on("update-available", (info) => {
|
|
755
|
-
this.emit("update-available", info);
|
|
756
|
-
});
|
|
757
|
-
this.updater.on("update-installed", (info) => {
|
|
758
|
-
this.emit("update-installed", info);
|
|
759
|
-
});
|
|
760
|
-
this.monitor.start();
|
|
761
|
-
this.updater.start();
|
|
762
|
-
this.startHeartbeat();
|
|
763
|
-
this.startTime = Date.now();
|
|
764
|
-
this.state = "running";
|
|
765
|
-
this.emit("state-change", this.state);
|
|
766
|
-
this.emit("started", this.getNodeId());
|
|
767
|
-
}
|
|
768
|
-
/** Stop the SVRN node gracefully. */
|
|
769
|
-
async stop() {
|
|
770
|
-
if (this.state !== "running") return;
|
|
771
|
-
this.state = "stopping";
|
|
772
|
-
this.emit("state-change", this.state);
|
|
773
|
-
if (this.heartbeatTimer) {
|
|
774
|
-
clearInterval(this.heartbeatTimer);
|
|
775
|
-
this.heartbeatTimer = null;
|
|
776
|
-
}
|
|
777
|
-
this.monitor.stop();
|
|
778
|
-
this.updater.stop();
|
|
779
|
-
await this.deregisterFromCoordinator().catch(() => {});
|
|
780
|
-
this.state = "stopped";
|
|
781
|
-
this.emit("state-change", this.state);
|
|
782
|
-
this.emit("stopped");
|
|
783
|
-
}
|
|
784
|
-
/** Get the node's unique ID. */
|
|
785
|
-
getNodeId() {
|
|
786
|
-
return this.config.nodeId ?? this.wallet?.getNodeId() ?? "unknown";
|
|
787
|
-
}
|
|
788
|
-
/** Get the current node status. */
|
|
789
|
-
getStatus() {
|
|
790
|
-
const uptime = this.state === "running" ? Math.floor((Date.now() - this.startTime) / 1e3) : 0;
|
|
791
|
-
return {
|
|
792
|
-
state: this.state,
|
|
793
|
-
nodeId: this.getNodeId(),
|
|
794
|
-
uptime,
|
|
795
|
-
resources: this.monitor?.getSnapshot() ?? {
|
|
796
|
-
cpuPercent: 0,
|
|
797
|
-
ramMB: 0,
|
|
798
|
-
bandwidthMbps: 0,
|
|
799
|
-
timestamp: Date.now()
|
|
800
|
-
},
|
|
801
|
-
earnings: this.earnings?.getSummary() ?? {
|
|
802
|
-
session: 0,
|
|
803
|
-
today: 0,
|
|
804
|
-
allTime: 0,
|
|
805
|
-
tasksThisSession: 0,
|
|
806
|
-
tasksToday: 0,
|
|
807
|
-
tasksAllTime: 0,
|
|
808
|
-
estimatedMonthlySavingsUSD: 0,
|
|
809
|
-
estimatedAnnualSavingsUSD: 0
|
|
810
|
-
},
|
|
811
|
-
wallet: this.wallet?.getState() ?? {
|
|
812
|
-
publicKey: "",
|
|
813
|
-
balance: 0,
|
|
814
|
-
pendingBalance: 0,
|
|
815
|
-
totalEarned: 0,
|
|
816
|
-
lastPayout: null
|
|
817
|
-
},
|
|
818
|
-
activeTasks: this.processor?.getActiveCount() ?? 0,
|
|
819
|
-
version: this.updater?.getVersion() ?? "0.0.0",
|
|
820
|
-
connectedToCoordinator: this.coordinatorConnected
|
|
821
|
-
};
|
|
822
|
-
}
|
|
823
|
-
/** Get earnings summary. */
|
|
824
|
-
getEarnings() {
|
|
825
|
-
return this.earnings.getSummary();
|
|
826
|
-
}
|
|
827
|
-
/** Get wallet state. */
|
|
828
|
-
getWallet() {
|
|
829
|
-
return this.wallet.getState();
|
|
830
|
-
}
|
|
831
|
-
/** Get resource snapshot. */
|
|
832
|
-
getResources() {
|
|
833
|
-
return this.monitor.getSnapshot();
|
|
834
|
-
}
|
|
835
|
-
/** Get the list of accepted task types. */
|
|
836
|
-
getTaskTypes() {
|
|
837
|
-
return [...this.config.taskTypes];
|
|
838
|
-
}
|
|
839
|
-
/** Manually trigger an update check. */
|
|
840
|
-
async checkForUpdates() {
|
|
841
|
-
return this.updater.check();
|
|
842
|
-
}
|
|
843
|
-
/** Submit a task to this node for processing. */
|
|
844
|
-
async submitTask(task) {
|
|
845
|
-
if (this.state !== "running") throw new Error("Node is not running");
|
|
846
|
-
if (!this.processor.canAccept(task)) throw new Error("Node cannot accept task: at capacity or deadline passed");
|
|
847
|
-
this.emit("task-received", task);
|
|
848
|
-
const result = await this.processor.process(task);
|
|
849
|
-
if (result.success) {
|
|
850
|
-
this.wallet.credit(task.rewardUCU);
|
|
851
|
-
this.earnings.record(task.type, task.id, task.rewardUCU, result.durationMs);
|
|
852
|
-
this.emit("task-completed", result);
|
|
853
|
-
} else this.emit("task-failed", result);
|
|
854
|
-
return result;
|
|
855
|
-
}
|
|
856
|
-
startHeartbeat() {
|
|
857
|
-
this.registerWithCoordinator();
|
|
858
|
-
this.heartbeatTimer = setInterval(() => void this.sendHeartbeat(), this.config.heartbeatIntervalSec * 1e3);
|
|
859
|
-
}
|
|
860
|
-
async registerWithCoordinator() {
|
|
861
|
-
try {
|
|
862
|
-
const response = await fetch(`${this.config.coordinatorUrl}/api/nodes/register`, {
|
|
863
|
-
method: "POST",
|
|
864
|
-
headers: { "Content-Type": "application/json" },
|
|
865
|
-
body: JSON.stringify({
|
|
866
|
-
nodeId: this.getNodeId(),
|
|
867
|
-
publicKey: this.wallet.getPublicKey(),
|
|
868
|
-
capabilities: this.config.taskTypes,
|
|
869
|
-
resources: this.monitor.getSnapshot(),
|
|
870
|
-
version: this.updater.getVersion()
|
|
871
|
-
}),
|
|
872
|
-
signal: AbortSignal.timeout(1e4)
|
|
873
|
-
});
|
|
874
|
-
this.coordinatorConnected = response.ok;
|
|
875
|
-
if (response.ok) this.emit("coordinator-connected");
|
|
876
|
-
} catch {
|
|
877
|
-
this.coordinatorConnected = false;
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
async sendHeartbeat() {
|
|
881
|
-
try {
|
|
882
|
-
const response = await fetch(`${this.config.coordinatorUrl}/api/nodes/heartbeat`, {
|
|
883
|
-
method: "POST",
|
|
884
|
-
headers: { "Content-Type": "application/json" },
|
|
885
|
-
body: JSON.stringify({
|
|
886
|
-
nodeId: this.getNodeId(),
|
|
887
|
-
resources: this.monitor.getSnapshot(),
|
|
888
|
-
activeTasks: this.processor.getActiveCount(),
|
|
889
|
-
earnings: this.earnings.getSummary()
|
|
890
|
-
}),
|
|
891
|
-
signal: AbortSignal.timeout(1e4)
|
|
892
|
-
});
|
|
893
|
-
const wasConnected = this.coordinatorConnected;
|
|
894
|
-
this.coordinatorConnected = response.ok;
|
|
895
|
-
if (!wasConnected && response.ok) this.emit("coordinator-connected");
|
|
896
|
-
else if (wasConnected && !response.ok) this.emit("coordinator-disconnected");
|
|
897
|
-
if (response.ok) {
|
|
898
|
-
const data = await response.json();
|
|
899
|
-
if (data.tasks && Array.isArray(data.tasks)) for (const task of data.tasks) this.submitTask(task);
|
|
900
|
-
}
|
|
901
|
-
} catch {
|
|
902
|
-
if (this.coordinatorConnected) {
|
|
903
|
-
this.coordinatorConnected = false;
|
|
904
|
-
this.emit("coordinator-disconnected");
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
async deregisterFromCoordinator() {
|
|
909
|
-
try {
|
|
910
|
-
await fetch(`${this.config.coordinatorUrl}/api/nodes/deregister`, {
|
|
911
|
-
method: "POST",
|
|
912
|
-
headers: { "Content-Type": "application/json" },
|
|
913
|
-
body: JSON.stringify({ nodeId: this.getNodeId() }),
|
|
914
|
-
signal: AbortSignal.timeout(5e3)
|
|
915
|
-
});
|
|
916
|
-
} catch {}
|
|
917
|
-
}
|
|
918
|
-
};
|
|
919
|
-
function createNode(config) {
|
|
920
|
-
return new SVRNNode(config);
|
|
921
|
-
}
|
|
922
|
-
async function startNode(config) {
|
|
923
|
-
const node = createNode(config);
|
|
924
|
-
await node.start();
|
|
925
|
-
return node;
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
//#endregion
|
|
929
|
-
export { ALL_TASK_TYPES, AutoUpdater, DEFAULT_CONFIG, EarningsTracker, ResourceMonitor, SVRNNode, TaskProcessor, UCUWallet, createNode, resolveConfig, startNode };
|