chainlesschain 0.162.149 → 0.162.150
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/package.json +1 -1
- package/src/assets/web-panel/assets/{AIOps-BJif14yR.js → AIOps-CBLvrjeG.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-CXek6gJY.js → ActionButton-DYv2GtE0.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-BgQhdAJi.js → Analytics-CL6PZ-Ww.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-DTYl5NtR.js → AppLayout-xuyHt4uA.js} +3 -3
- package/src/assets/web-panel/assets/{Audit-BzATQAeR.js → Audit-DOvSVycq.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-BzdPEQhL.js → Backup-DMhfTswr.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-BM0KVh8E.js → BaseInput-CQxDdm63.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-D7fHXHkz.js → Chat-BEeNhK2a.js} +5 -5
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-Wm34RR-b.js → ChatBubbleRenderer-8nul8eTq.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-CAiSQ9vO.js → Checkbox-CL04O-ER.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-Df40CrEe.js → Codegen-C50o-n7x.js} +1 -1
- package/src/assets/web-panel/assets/{Col-DIT2fNFU.js → Col-CH-bDkzs.js} +1 -1
- package/src/assets/web-panel/assets/{Community-CSTIbW2k.js → Community-DqAIMvSe.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-DtqXZZUi.js → Compact-C43fo_my.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-CUtzw6o7.js → Compliance-BERnMrdP.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-CezmlnmU.js → Cowork-Baw3w1gp.js} +4 -4
- package/src/assets/web-panel/assets/{Cron-P4BITarg.js → Cron-BEqAHF1-.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-BRRiYwvq.js → Crosschain-CvnmKwK4.js} +1 -1
- package/src/assets/web-panel/assets/{DID-L5ijB9i4.js → DID-iMPxgVdt.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-CFxro4ob.js → Dashboard--4SJX3YR.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-BmAFCQ71.js → Dropdown-BgLV6xgz.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-DJBCEuon.js → EmailListRenderer-Bvb8oUD8.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-z4oLq6eT.js → FamilyGuardDashboard-DpXPjJB5.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-DsVCpHMF.js → Federation-BbFfJ1Xi.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-DP3bP5th.js → FormItemContext-DeGq1B-q.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-BAXP2Gc6.js → GenericCardRenderer-CNW7s9zM.js} +1 -1
- package/src/assets/web-panel/assets/{Git-I3g_bAw9.js → Git-L1PjW-lT.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-jHS5-ioS.js → Governance-PK-X58to.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-CPL7sfx9.js → Inference-BePWEH-d.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-Jf236h4C.js → KnowledgeGraph-LF_sBvdL.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-Cm2tcSKg.js → Logs-BKkfk9hy.js} +2 -2
- package/src/assets/web-panel/assets/{Marketplace-CZK82rhi.js → Marketplace-BNMqUDla.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-CZCeji7a.js → McpTools-w4WPiyz2.js} +5 -5
- package/src/assets/web-panel/assets/{Memory-3l2KVS9k.js → Memory-DUKMVGNi.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-VYdpoLh6.js → MobileBridge-BWhiEyTJ.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-CiB9cmm1.js → MobileProjects-Ocf5JEkX.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-wCFZbBuL.js → Mtc-D2B6MMhU.js} +4 -4
- package/src/assets/web-panel/assets/{MtcAudit-1a3THIyG.js → MtcAudit-DdYjCq1O.js} +2 -2
- package/src/assets/web-panel/assets/{Multisig-DMzLB2hG.js → Multisig-Cb1hfuUZ.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-D9wZbf6l.js → NLProgramming-CTeImGp7.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-hrFe2ZM-.js → Notes-BjYNc7eQ.js} +4 -4
- package/src/assets/web-panel/assets/{NotificationSettings-CHGX5Jwm.js → NotificationSettings-Dn_NtRXQ.js} +1 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-DVYYIizh.js +1 -0
- package/src/assets/web-panel/assets/{Organization-By7FkhtY.js → Organization-Be2Kmr5j.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow--khGSzJn.js → Overflow-Cu_-qRlR.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-CAG9dH35.js → P2P-DD2HoGzE.js} +2 -2
- package/src/assets/web-panel/assets/{PdhVaultBrowser-B3SQZmK9.js → PdhVaultBrowser-BRI7DVth.js} +3 -3
- package/src/assets/web-panel/assets/{Permissions-D35ec6JA.js → Permissions-C9Srcs2M.js} +3 -3
- package/src/assets/web-panel/assets/{PersonalDataHub-CxBF7hW_.js → PersonalDataHub-CUqcMgo1.js} +3 -3
- package/src/assets/web-panel/assets/{Pipeline-s6EtOO1s.js → Pipeline-HBrQGLXt.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-BbJYmWmO.js → Privacy-D-B0vjwh.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-VGQq1jMT.js → ProjectInit-eTeLIu9e.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-B1ew3Teh.js → ProjectSettings-DrRqCsC6.js} +2 -2
- package/src/assets/web-panel/assets/Projects-1G9DNOhI.js +1 -0
- package/src/assets/web-panel/assets/{Providers-mrO47FIK.js → Providers-RkTZzpxP.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-IJF2mHyw.js → QrScannerModal-BSCUgsgC.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-CU0wN_Z0.js → QuickAsk-CHgyM3Bz.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-DhN37R6G.js → Recommend-0lry4OZq.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-D_xOX_hu.js → RemoteSession-Cn45UroZ.js} +2 -2
- package/src/assets/web-panel/assets/{Reputation-D_Ssv7uH.js → Reputation-Q-Zjb707.js} +1 -1
- package/src/assets/web-panel/assets/{Row-Kx5dKxX7.js → Row-BdM70oda.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-BlGwqZkY.js → RssFeed-DmOAKKap.js} +2 -2
- package/src/assets/web-panel/assets/{Search-hLFQzxpb.js → Search-Dwavbm07.js} +1 -1
- package/src/assets/web-panel/assets/{Security-DMlvsVt4.js → Security-DukXFCnk.js} +3 -3
- package/src/assets/web-panel/assets/{Services-Bd0Qsj2m.js → Services-BIlRnITu.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-DFclq9X3.js → Skeleton-YYVQdhhQ.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-BNtln2qY.js → Skills-B8_iYHz2.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-Dch5H19G.js → Sla-BdVrhT31.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-2UfQcU1g.js → SpeechSettings-CD3ggRx7.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-CD9YQr4i.js → SyncSettings-Bp02VZFH.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-BNu-7MzI.js → Tasks-DEVmCEsr.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-D1n9CaIR.js → Templates-B6czWc4N.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-DenL3iBW.js → Tenant-BCJLv17r.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-ZzU0Io1Y.js → Terminal-CD132d2Y.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-D87IfukO.js → TimelineRenderer-ZB-CvkZl.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-BkiZc8E3.js → Tokens-BnSY0S-s.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-BNRSytGN.js → Trigger-VZw9Oy2w.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-Bwbd4X2m.js → Trust-pZq7Hjd2.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-B8O2bs0o.js → UkeySign-DnQaqk4q.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-C2fL8zmH.js → VideoEditing-BEUfmvJV.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-BORYDdE1.js → Wallet-CoZKMXJ2.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-C0V5S2FM.js → WebAuthn-CBOGVx1I.js} +5 -5
- package/src/assets/web-panel/assets/{WorkflowEditor-2dR0fcHL.js → WorkflowEditor-huSKn7TT.js} +1 -1
- package/src/assets/web-panel/assets/{chat-BmuAFAn8.js → chat-A_3w6FBO.js} +1 -1
- package/src/assets/web-panel/assets/{colors-CN3smMcK.js → colors-D1Bem9Oy.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-DCnxb4kW.js → compact-item-CJYJj0oO.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-vlR43pHn.js → createContext-BkbFiKT4.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-WDr3_M_N.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-D04tHYFd.js → hasIn-CKvUafVY.js} +1 -1
- package/src/assets/web-panel/assets/{index-0DnaZGkC.js → index-AjrSPnvv.js} +1 -1
- package/src/assets/web-panel/assets/{index-BudvKQfG.js → index-B8i0lViZ.js} +1 -1
- package/src/assets/web-panel/assets/{index-BeGDEXFs.js → index-B9Svn0zc.js} +1 -1
- package/src/assets/web-panel/assets/{index-D5LZVZ0L.js → index-BHdHSX06.js} +1 -1
- package/src/assets/web-panel/assets/{index-BTPEZTk1.js → index-BHdailyo.js} +1 -1
- package/src/assets/web-panel/assets/{index-DIpY0qM5.js → index-BJwlEnYo.js} +1 -1
- package/src/assets/web-panel/assets/{index-CsAsCPJ6.js → index-BOoAQjJz.js} +1 -1
- package/src/assets/web-panel/assets/{index-ljuBiQW9.js → index-BSgWxAOG.js} +1 -1
- package/src/assets/web-panel/assets/{index-hpvvtAZ3.js → index-BdutMsne.js} +1 -1
- package/src/assets/web-panel/assets/{index-_FIkN3jd.js → index-BiDWxzbn.js} +1 -1
- package/src/assets/web-panel/assets/{index-C-6NO5il.js → index-By5a0T_W.js} +1 -1
- package/src/assets/web-panel/assets/{index-B78xL3s2.js → index-C-WIY-FQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-ClhAHDK3.js → index-C37f6iey.js} +1 -1
- package/src/assets/web-panel/assets/{index-ToUh2b1-.js → index-C9bWmTcO.js} +1 -1
- package/src/assets/web-panel/assets/{index-D28DeAAB.js → index-CBaosWRO.js} +1 -1
- package/src/assets/web-panel/assets/{index-D8vwp4qp.js → index-CBlBVJ_m.js} +1 -1
- package/src/assets/web-panel/assets/{index-BqhASEL4.js → index-CD62EEGo.js} +1 -1
- package/src/assets/web-panel/assets/{index-DDwLgQY9.js → index-CUj-l7GM.js} +1 -1
- package/src/assets/web-panel/assets/{index-DbVsQBOH.js → index-CVS8Ymuq.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cr-A0FYJ.js → index-ChkXUj3f.js} +1 -1
- package/src/assets/web-panel/assets/{index-D65_XseV.js → index-Cj0OZ-37.js} +1 -1
- package/src/assets/web-panel/assets/{index-BXRg8GFQ.js → index-Co3OFL0t.js} +1 -1
- package/src/assets/web-panel/assets/{index-430S68MN.js → index-Crp8CbRg.js} +1 -1
- package/src/assets/web-panel/assets/{index-CngCC8hC.js → index-D22zNXiS.js} +1 -1
- package/src/assets/web-panel/assets/{index-HhNjnCfe.js → index-DTs_D1OL.js} +1 -1
- package/src/assets/web-panel/assets/{index-CP9m9Ggr.js → index-DfgCdFrN.js} +3 -3
- package/src/assets/web-panel/assets/{index-jzR7Ujuw.js → index-DjYrecNb.js} +1 -1
- package/src/assets/web-panel/assets/{index-CTOCnIQ7.js → index-DpW9cf3e.js} +1 -1
- package/src/assets/web-panel/assets/index-Dwix3p4g.js +1 -0
- package/src/assets/web-panel/assets/{index-D_n8_vfI.js → index-F--HuPG1.js} +1 -1
- package/src/assets/web-panel/assets/{index-BasvsWDM.js → index-Fuk6t_3K.js} +1 -1
- package/src/assets/web-panel/assets/{index-CnXebZLL.js → index-JEAGMii9.js} +1 -1
- package/src/assets/web-panel/assets/{index-DYAtmqiv.js → index-PF-mpv8K.js} +1 -1
- package/src/assets/web-panel/assets/index-SHaoZ0CA.js +1 -0
- package/src/assets/web-panel/assets/{index-DTWg-18U.js → index-b-sbVdjQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-C5Sxb1sE.js → index-pyvMVX8r.js} +1 -1
- package/src/assets/web-panel/assets/{index-TslMTwNy.js → index-qNTtOVi_.js} +1 -1
- package/src/assets/web-panel/assets/{index-DTtRscUa.js → index-tgO8iza6.js} +1 -1
- package/src/assets/web-panel/assets/{index-DbADHwhr.js → index-ttDQVhZy.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-C3wUb4je.js → initDefaultProps-DtrnfsZH.js} +1 -1
- package/src/assets/web-panel/assets/{motion-D-jYFUNA.js → motion-D4zqSaX3.js} +1 -1
- package/src/assets/web-panel/assets/{move-tqb8nwJ2.js → move-CGFGOUQj.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-DSOjMJMz.js → mtc-parser-DH2HvkJl.js} +1 -1
- package/src/assets/web-panel/assets/{omit-CJ7VimIW.js → omit-jJ2at5HX.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-qXiG1iT3.js → pickAttrs-CRyMT1Fv.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-CkGBcy1Z.js → placementArrow-DZ_CX0Pt.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-D3WvTlLO.js → responsiveObserve-wruHk-h5.js} +1 -1
- package/src/assets/web-panel/assets/{slide-BEE2ftge.js → slide-BGgx8q67.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-CsfBpxiG.js → statusUtils-Do5M7gKm.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-xPrIiJPI.js → styleChecker-CRa-GZpX.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-C5Yd-SCR.js → useFlexGapSupport-BxPcq6pj.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-D_MDS8HI.js → useFs-v5O2ZcJm.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-BqJh-usA.js → usePersonalDataHub--z2FU0Px.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-chm_p-gz.js → vnode-1emidVKd.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-3-YDNz0Z.js → zoom-CcJaRyHs.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/commands/a2a.js +19 -4
- package/src/commands/activitypub.js +20 -3
- package/src/commands/agent.js +27 -5
- package/src/commands/audit.js +40 -24
- package/src/commands/codeintel.js +68 -0
- package/src/commands/collab.js +15 -2
- package/src/commands/compliance.js +5 -0
- package/src/commands/config.js +4 -1
- package/src/commands/dao.js +86 -14
- package/src/commands/dev.js +2 -0
- package/src/commands/did.js +7 -1
- package/src/commands/dlp.js +23 -1
- package/src/commands/economy.js +29 -3
- package/src/commands/eval.js +7 -0
- package/src/commands/evomap.js +26 -0
- package/src/commands/governance.js +17 -3
- package/src/commands/hardening.js +18 -0
- package/src/commands/incentive.js +5 -0
- package/src/commands/init.js +46 -2
- package/src/commands/kg.js +4 -0
- package/src/commands/loop.js +6 -1
- package/src/commands/lowcode.js +15 -2
- package/src/commands/marketplace.js +40 -6
- package/src/commands/matrix.js +20 -1
- package/src/commands/memory.js +4 -1
- package/src/commands/mtc.js +7 -1
- package/src/commands/nostr.js +31 -4
- package/src/commands/note.js +7 -4
- package/src/commands/plugin.js +125 -5
- package/src/commands/pqc.js +5 -0
- package/src/commands/reputation.js +10 -1
- package/src/commands/scim.js +6 -0
- package/src/commands/session.js +32 -10
- package/src/commands/siem.js +11 -0
- package/src/commands/sla.js +18 -3
- package/src/commands/social.js +38 -5
- package/src/commands/sso.js +10 -2
- package/src/commands/stress.js +23 -4
- package/src/commands/team.js +9 -2
- package/src/commands/tech.js +2 -0
- package/src/commands/tenant.js +10 -1
- package/src/commands/terraform.js +6 -0
- package/src/commands/update.js +1 -1
- package/src/commands/zkp.js +20 -0
- package/src/gateways/ws/message-dispatcher.js +5 -2
- package/src/gateways/ws/remote-session-protocol.js +103 -42
- package/src/harness/jsonl-session-store.js +12 -5
- package/src/harness/plugin-manager.js +16 -4
- package/src/harness/remote-command-ledger.js +46 -15
- package/src/harness/worktree-isolator.js +16 -6
- package/src/lib/__tests__/logger.test.js +5 -2
- package/src/lib/a2a-protocol.js +25 -1
- package/src/lib/activitypub-bridge.js +61 -0
- package/src/lib/agent-core.js +2 -0
- package/src/lib/agent-economy.js +262 -29
- package/src/lib/agent-network.js +7 -1
- package/src/lib/agent-team/team-runner.js +25 -9
- package/src/lib/agent-team/team-worktree.js +36 -4
- package/src/lib/async-hook-supervisor.cjs +102 -16
- package/src/lib/audit-logger.js +7 -6
- package/src/lib/autonomous-developer.js +60 -0
- package/src/lib/chat-core.js +17 -4
- package/src/lib/collaboration-governance.js +56 -0
- package/src/lib/community-governance.js +68 -0
- package/src/lib/compliance-manager.js +63 -0
- package/src/lib/cross-chain.js +5 -0
- package/src/lib/dao-governance.js +151 -2
- package/src/lib/did-manager.js +23 -10
- package/src/lib/dlp-engine.js +70 -0
- package/src/lib/eval/runner.js +89 -1
- package/src/lib/eval/tasks.js +170 -0
- package/src/lib/eval/trend.js +16 -1
- package/src/lib/evolution-system.js +92 -0
- package/src/lib/evomap-federation.js +55 -0
- package/src/lib/evomap-governance.js +94 -0
- package/src/lib/fatal-handler.js +17 -1
- package/src/lib/hardening-manager.js +73 -0
- package/src/lib/hierarchical-memory.js +14 -8
- package/src/lib/knowledge-exporter.js +8 -2
- package/src/lib/knowledge-graph.js +79 -0
- package/src/lib/llm-providers.js +23 -14
- package/src/lib/logger.js +4 -1
- package/src/lib/lsp/__tests__/benchmark.test.js +88 -0
- package/src/lib/lsp/__tests__/lsp-client.test.js +11 -0
- package/src/lib/lsp/__tests__/lsp-manager.test.js +69 -0
- package/src/lib/lsp/benchmark.js +257 -0
- package/src/lib/lsp/lsp-client.js +30 -9
- package/src/lib/lsp/lsp-manager.js +54 -2
- package/src/lib/matrix-bridge.js +84 -0
- package/src/lib/memory-manager.js +5 -3
- package/src/lib/nostr-bridge.js +53 -0
- package/src/lib/permission-engine.js +22 -4
- package/src/lib/plugin-runtime/__tests__/remote-source.test.js +256 -0
- package/src/lib/plugin-runtime/install.js +9 -1
- package/src/lib/plugin-runtime/policy.js +9 -1
- package/src/lib/plugin-runtime/remote-source.js +240 -0
- package/src/lib/pqc-manager.js +64 -0
- package/src/lib/reputation-optimizer.js +101 -0
- package/src/lib/sandbox-egress-proxy.js +159 -59
- package/src/lib/sandbox-fs-policy.js +112 -0
- package/src/lib/sandbox-network-policy.js +18 -1
- package/src/lib/sandbox-v2.js +14 -14
- package/src/lib/scim-manager.js +36 -0
- package/src/lib/session-manager.js +5 -2
- package/src/lib/settings-hooks.cjs +1 -0
- package/src/lib/siem-exporter.js +45 -0
- package/src/lib/skill-loader.js +20 -2
- package/src/lib/skill-marketplace.js +83 -0
- package/src/lib/sla-manager.js +88 -0
- package/src/lib/social-manager.js +74 -0
- package/src/lib/stress-tester.js +65 -0
- package/src/lib/tech-learning-engine.js +75 -0
- package/src/lib/tenant-saas.js +107 -0
- package/src/lib/terraform-manager.js +67 -0
- package/src/lib/token-incentive.js +180 -29
- package/src/lib/wallet-manager.js +81 -35
- package/src/lib/zkp-engine.js +87 -0
- package/src/repl/agent-repl.js +17 -2
- package/src/runtime/__tests__/auto-pin.test.js +104 -0
- package/src/runtime/agent-core.js +241 -68
- package/src/runtime/auto-pin.js +117 -0
- package/src/runtime/headless-runner.js +35 -0
- package/src/assets/web-panel/assets/OrderTableRenderer-CRIFE2Tj.js +0 -1
- package/src/assets/web-panel/assets/Projects-CGcNIs_g.js +0 -1
- package/src/assets/web-panel/assets/devWarning-DxwmsL4j.js +0 -1
- package/src/assets/web-panel/assets/index-Cg2ldRfU.js +0 -1
- package/src/assets/web-panel/assets/index-Dwzo-dtJ.js +0 -1
package/src/commands/plugin.js
CHANGED
|
@@ -587,32 +587,83 @@ export function registerPluginCommand(program) {
|
|
|
587
587
|
|
|
588
588
|
const SCOPES = "user|project|local";
|
|
589
589
|
|
|
590
|
-
// plugin add <source> — install from a local dir, git URL,
|
|
590
|
+
// plugin add <source> — install from a local dir, git URL, owner/repo, or a
|
|
591
|
+
// remote registry/manifest URL (with --name to pick from a multi-plugin index)
|
|
591
592
|
plugin
|
|
592
593
|
.command("add <source>")
|
|
593
594
|
.description(
|
|
594
|
-
`Install a plugin from a local dir, git URL,
|
|
595
|
+
`Install a plugin from a local dir, git URL, owner/repo[#ref], or registry URL (scope: ${SCOPES})`,
|
|
595
596
|
)
|
|
596
597
|
.option("--scope <scope>", "Install scope (user|project|local)", "user")
|
|
597
598
|
.option("--force", "Reinstall over an existing immutable version")
|
|
598
599
|
.option("--sha256 <hex>", "Expected SHA-256 of the manifest file")
|
|
599
600
|
.option("--signature <path>", "Detached Ed25519 signature of the manifest")
|
|
600
601
|
.option("--public-key <path>", "Public key for signature verification")
|
|
602
|
+
.option(
|
|
603
|
+
"--registry <url>",
|
|
604
|
+
"Resolve <source> as a plugin NAME in this registry URL",
|
|
605
|
+
)
|
|
606
|
+
.option(
|
|
607
|
+
"--name <plugin>",
|
|
608
|
+
"Plugin name to select from a multi-plugin registry",
|
|
609
|
+
)
|
|
610
|
+
.option("--token <token>", "Bearer token for a private registry")
|
|
601
611
|
.option("--json", "Output as JSON")
|
|
602
612
|
.action(async (source, options) => {
|
|
603
613
|
const { installFromSource } =
|
|
604
614
|
await import("../lib/plugin-runtime/install.js");
|
|
615
|
+
|
|
616
|
+
// Remote resolution: a registry/manifest URL (or --registry <url> with a
|
|
617
|
+
// plugin name) resolves to a git source the installer already handles.
|
|
618
|
+
let installSource = source;
|
|
619
|
+
let integritySha = null;
|
|
620
|
+
const { isRemoteSource, resolveRemoteSource } =
|
|
621
|
+
await import("../lib/plugin-runtime/remote-source.js");
|
|
622
|
+
if (options.registry || isRemoteSource(source)) {
|
|
623
|
+
const url = options.registry || source;
|
|
624
|
+
// With --registry the positional arg is the plugin NAME; otherwise the
|
|
625
|
+
// URL is positional and --name selects.
|
|
626
|
+
const name = options.registry ? source : options.name;
|
|
627
|
+
let config = null;
|
|
628
|
+
try {
|
|
629
|
+
({ loadConfig: config } = await import("../lib/config-manager.js"));
|
|
630
|
+
config = config();
|
|
631
|
+
} catch {
|
|
632
|
+
config = null; // config is optional — token can come from --token/env
|
|
633
|
+
}
|
|
634
|
+
try {
|
|
635
|
+
const resolved = await resolveRemoteSource(url, {
|
|
636
|
+
name,
|
|
637
|
+
token: options.token,
|
|
638
|
+
config,
|
|
639
|
+
});
|
|
640
|
+
installSource = resolved.source;
|
|
641
|
+
integritySha = resolved.sha256;
|
|
642
|
+
if (resolved.fromCache) {
|
|
643
|
+
logger.warn(
|
|
644
|
+
chalk.yellow(
|
|
645
|
+
" ⚠ registry unreachable — using cached copy (offline)",
|
|
646
|
+
),
|
|
647
|
+
);
|
|
648
|
+
}
|
|
649
|
+
} catch (err) {
|
|
650
|
+
logger.error(`Registry resolution failed: ${err.message}`);
|
|
651
|
+
process.exitCode = 1;
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
605
656
|
const signature =
|
|
606
|
-
options.sha256 || options.signature || options.publicKey
|
|
657
|
+
options.sha256 || options.signature || options.publicKey || integritySha
|
|
607
658
|
? {
|
|
608
|
-
sha256: options.sha256,
|
|
659
|
+
sha256: options.sha256 || integritySha,
|
|
609
660
|
signatureFile: options.signature,
|
|
610
661
|
publicKeyFile: options.publicKey,
|
|
611
662
|
requireSignature: Boolean(options.signature),
|
|
612
663
|
}
|
|
613
664
|
: null;
|
|
614
665
|
try {
|
|
615
|
-
const res = installFromSource(
|
|
666
|
+
const res = installFromSource(installSource, {
|
|
616
667
|
scope: options.scope,
|
|
617
668
|
cwd: process.cwd(),
|
|
618
669
|
force: options.force === true,
|
|
@@ -635,6 +686,75 @@ export function registerPluginCommand(program) {
|
|
|
635
686
|
}
|
|
636
687
|
});
|
|
637
688
|
|
|
689
|
+
// plugin browse — browse the plugins offered by a remote registry (discovery)
|
|
690
|
+
plugin
|
|
691
|
+
.command("browse [query]")
|
|
692
|
+
.description(
|
|
693
|
+
"List plugins in a remote registry (--registry <url>); filter by [query]",
|
|
694
|
+
)
|
|
695
|
+
.requiredOption("--registry <url>", "Registry/manifest URL to browse")
|
|
696
|
+
.option("--token <token>", "Bearer token for a private registry")
|
|
697
|
+
.option("--json", "Output as JSON")
|
|
698
|
+
.action(async (query, options) => {
|
|
699
|
+
const { fetchRegistry, listRegistryPlugins, resolveRegistryToken } =
|
|
700
|
+
await import("../lib/plugin-runtime/remote-source.js");
|
|
701
|
+
let config = null;
|
|
702
|
+
try {
|
|
703
|
+
const cm = await import("../lib/config-manager.js");
|
|
704
|
+
config = cm.loadConfig();
|
|
705
|
+
} catch {
|
|
706
|
+
config = null;
|
|
707
|
+
}
|
|
708
|
+
try {
|
|
709
|
+
const token = resolveRegistryToken(options.registry, {
|
|
710
|
+
token: options.token,
|
|
711
|
+
config,
|
|
712
|
+
});
|
|
713
|
+
const { registry, fromCache } = await fetchRegistry(options.registry, {
|
|
714
|
+
token,
|
|
715
|
+
});
|
|
716
|
+
let rows = listRegistryPlugins(registry);
|
|
717
|
+
if (query) {
|
|
718
|
+
const q = query.toLowerCase();
|
|
719
|
+
rows = rows.filter(
|
|
720
|
+
(r) =>
|
|
721
|
+
r.name.toLowerCase().includes(q) ||
|
|
722
|
+
(r.description || "").toLowerCase().includes(q),
|
|
723
|
+
);
|
|
724
|
+
}
|
|
725
|
+
if (options.json) {
|
|
726
|
+
console.log(JSON.stringify({ fromCache, plugins: rows }, null, 2));
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
if (fromCache) {
|
|
730
|
+
logger.warn(
|
|
731
|
+
chalk.yellow(
|
|
732
|
+
" ⚠ registry unreachable — showing cached copy (offline)",
|
|
733
|
+
),
|
|
734
|
+
);
|
|
735
|
+
}
|
|
736
|
+
if (rows.length === 0) {
|
|
737
|
+
logger.info("No matching plugins in this registry.");
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
logger.log(chalk.bold(`Plugins (${rows.length}):`));
|
|
741
|
+
for (const r of rows) {
|
|
742
|
+
const ver = r.version ? chalk.gray(` v${r.version}`) : "";
|
|
743
|
+
logger.log(
|
|
744
|
+
` ${chalk.cyan(r.name)}${ver} ${chalk.gray(r.description || r.source)}`,
|
|
745
|
+
);
|
|
746
|
+
}
|
|
747
|
+
logger.log(
|
|
748
|
+
chalk.gray(
|
|
749
|
+
`\nInstall with: cc plugin add <name> --registry ${options.registry}`,
|
|
750
|
+
),
|
|
751
|
+
);
|
|
752
|
+
} catch (err) {
|
|
753
|
+
logger.error(`Registry search failed: ${err.message}`);
|
|
754
|
+
process.exitCode = 1;
|
|
755
|
+
}
|
|
756
|
+
});
|
|
757
|
+
|
|
638
758
|
// plugin installed — list runtime-installed plugins across scopes
|
|
639
759
|
plugin
|
|
640
760
|
.command("installed")
|
package/src/commands/pqc.js
CHANGED
|
@@ -8,6 +8,7 @@ import { logger } from "../lib/logger.js";
|
|
|
8
8
|
import { bootstrap, shutdown } from "../runtime/bootstrap.js";
|
|
9
9
|
import {
|
|
10
10
|
ensurePQCTables,
|
|
11
|
+
loadFromDb,
|
|
11
12
|
listKeys,
|
|
12
13
|
generateKey,
|
|
13
14
|
getMigrationStatus,
|
|
@@ -64,6 +65,7 @@ export function registerPqcCommand(program) {
|
|
|
64
65
|
}
|
|
65
66
|
const db = ctx.db.getDatabase();
|
|
66
67
|
ensurePQCTables(db);
|
|
68
|
+
loadFromDb(db);
|
|
67
69
|
|
|
68
70
|
const keys = listKeys({ algorithm: options.algorithm });
|
|
69
71
|
if (options.json) {
|
|
@@ -103,6 +105,7 @@ export function registerPqcCommand(program) {
|
|
|
103
105
|
}
|
|
104
106
|
const db = ctx.db.getDatabase();
|
|
105
107
|
ensurePQCTables(db);
|
|
108
|
+
loadFromDb(db);
|
|
106
109
|
|
|
107
110
|
const key = generateKey(db, algorithm, options.purpose);
|
|
108
111
|
logger.success("PQC key generated");
|
|
@@ -136,6 +139,7 @@ export function registerPqcCommand(program) {
|
|
|
136
139
|
}
|
|
137
140
|
const db = ctx.db.getDatabase();
|
|
138
141
|
ensurePQCTables(db);
|
|
142
|
+
loadFromDb(db);
|
|
139
143
|
|
|
140
144
|
const plans = getMigrationStatus();
|
|
141
145
|
if (options.json) {
|
|
@@ -204,6 +208,7 @@ export function registerPqcCommand(program) {
|
|
|
204
208
|
}
|
|
205
209
|
const db = ctx.db.getDatabase();
|
|
206
210
|
ensurePQCTables(db);
|
|
211
|
+
loadFromDb(db);
|
|
207
212
|
|
|
208
213
|
const plan = migrate(db, planName, options.source, targetAlgorithm);
|
|
209
214
|
logger.success("Migration completed");
|
|
@@ -9,6 +9,7 @@ import { logger } from "../lib/logger.js";
|
|
|
9
9
|
import { bootstrap, shutdown } from "../runtime/bootstrap.js";
|
|
10
10
|
import {
|
|
11
11
|
ensureReputationTables,
|
|
12
|
+
loadFromDb as loadReputationFromDb,
|
|
12
13
|
addObservation,
|
|
13
14
|
computeScore,
|
|
14
15
|
listScores,
|
|
@@ -44,6 +45,10 @@ function _dbFromCtx(ctx) {
|
|
|
44
45
|
}
|
|
45
46
|
const db = ctx.db.getDatabase();
|
|
46
47
|
ensureReputationTables(db);
|
|
48
|
+
// Rehydrate the observation/run/analytics Maps from the reputation_* tables —
|
|
49
|
+
// without this every read is Map-only-empty in the fresh CLI process (scores
|
|
50
|
+
// read back 0, `status <runId>` throws "Optimization run not found").
|
|
51
|
+
loadReputationFromDb(db);
|
|
47
52
|
return db;
|
|
48
53
|
}
|
|
49
54
|
|
|
@@ -165,7 +170,11 @@ export function registerReputationCommand(program) {
|
|
|
165
170
|
"Detection method (z_score|iqr)",
|
|
166
171
|
"z_score",
|
|
167
172
|
)
|
|
168
|
-
.option(
|
|
173
|
+
.option(
|
|
174
|
+
"-t, --threshold <n>",
|
|
175
|
+
"Detection threshold",
|
|
176
|
+
floatArg("--threshold"),
|
|
177
|
+
)
|
|
169
178
|
.option(
|
|
170
179
|
"-d, --decay <model>",
|
|
171
180
|
"Decay model applied before detection",
|
package/src/commands/scim.js
CHANGED
|
@@ -9,6 +9,7 @@ import { parseJsonOption } from "../lib/parse-json-option.js";
|
|
|
9
9
|
import { bootstrap, shutdown } from "../runtime/bootstrap.js";
|
|
10
10
|
import {
|
|
11
11
|
ensureSCIMTables,
|
|
12
|
+
loadFromDb as loadScimFromDb,
|
|
12
13
|
listUsers,
|
|
13
14
|
createUser,
|
|
14
15
|
getUser,
|
|
@@ -73,6 +74,7 @@ export function registerScimCommand(program) {
|
|
|
73
74
|
}
|
|
74
75
|
const db = ctx.db.getDatabase();
|
|
75
76
|
ensureSCIMTables(db);
|
|
77
|
+
loadScimFromDb(db);
|
|
76
78
|
|
|
77
79
|
const result = listUsers();
|
|
78
80
|
if (options.json) {
|
|
@@ -108,6 +110,7 @@ export function registerScimCommand(program) {
|
|
|
108
110
|
}
|
|
109
111
|
const db = ctx.db.getDatabase();
|
|
110
112
|
ensureSCIMTables(db);
|
|
113
|
+
loadScimFromDb(db);
|
|
111
114
|
|
|
112
115
|
const user = createUser(db, username, options.name, options.email);
|
|
113
116
|
logger.success("User created");
|
|
@@ -134,6 +137,7 @@ export function registerScimCommand(program) {
|
|
|
134
137
|
}
|
|
135
138
|
const db = ctx.db.getDatabase();
|
|
136
139
|
ensureSCIMTables(db);
|
|
140
|
+
loadScimFromDb(db);
|
|
137
141
|
|
|
138
142
|
const user = getUser(userId);
|
|
139
143
|
if (!user) {
|
|
@@ -168,6 +172,7 @@ export function registerScimCommand(program) {
|
|
|
168
172
|
}
|
|
169
173
|
const db = ctx.db.getDatabase();
|
|
170
174
|
ensureSCIMTables(db);
|
|
175
|
+
loadScimFromDb(db);
|
|
171
176
|
|
|
172
177
|
deleteUser(db, userId);
|
|
173
178
|
logger.success(`User ${chalk.cyan(userId.slice(0, 8))} deleted`);
|
|
@@ -216,6 +221,7 @@ export function registerScimCommand(program) {
|
|
|
216
221
|
}
|
|
217
222
|
const db = ctx.db.getDatabase();
|
|
218
223
|
ensureSCIMTables(db);
|
|
224
|
+
loadScimFromDb(db);
|
|
219
225
|
|
|
220
226
|
const result = syncProvision(db, connectorId);
|
|
221
227
|
logger.success(`Sync completed via ${chalk.cyan(result.connector)}`);
|
package/src/commands/session.js
CHANGED
|
@@ -61,6 +61,36 @@ import {
|
|
|
61
61
|
readWorkflowSession,
|
|
62
62
|
} from "../lib/workflow-state-reader.js";
|
|
63
63
|
|
|
64
|
+
// DB sessions store `updated_at` as SQLite datetime('now') → "YYYY-MM-DD
|
|
65
|
+
// HH:MM:SS" (UTC, space at index 10); JSONL sessions store toISOString() →
|
|
66
|
+
// "YYYY-MM-DDTHH:MM:SS.sssZ" (UTC, 'T' at index 10). Both are UTC, so normalize
|
|
67
|
+
// the space form to ISO-UTC and compare as epochs — a raw string compare
|
|
68
|
+
// resolves at index 10 ('T' 0x54 > ' ' 0x20) and would rank every JSONL session
|
|
69
|
+
// as newer than any same-date DB session regardless of the actual time.
|
|
70
|
+
function _sessionEpoch(ts) {
|
|
71
|
+
if (typeof ts !== "string" || !ts) return 0;
|
|
72
|
+
const iso =
|
|
73
|
+
ts.includes(" ") && !ts.includes("T") ? ts.replace(" ", "T") + "Z" : ts;
|
|
74
|
+
const n = Date.parse(iso);
|
|
75
|
+
return Number.isFinite(n) ? n : 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function rankSessions(sessions, limit) {
|
|
79
|
+
// Dedup by id, preferring the JSONL copy when a session exists in both stores
|
|
80
|
+
// (the original "JSONL takes precedence" intent, previously achieved only as
|
|
81
|
+
// a side effect of the buggy lexicographic sort). Then rank by real time.
|
|
82
|
+
const byId = new Map();
|
|
83
|
+
for (const s of sessions) {
|
|
84
|
+
const prev = byId.get(s.id);
|
|
85
|
+
if (!prev || (s._store === "jsonl" && prev._store !== "jsonl")) {
|
|
86
|
+
byId.set(s.id, s);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return [...byId.values()]
|
|
90
|
+
.sort((a, b) => _sessionEpoch(b.updated_at) - _sessionEpoch(a.updated_at))
|
|
91
|
+
.slice(0, limit);
|
|
92
|
+
}
|
|
93
|
+
|
|
64
94
|
export function registerSessionCommand(program) {
|
|
65
95
|
const session = program
|
|
66
96
|
.command("session")
|
|
@@ -98,16 +128,8 @@ export function registerSessionCommand(program) {
|
|
|
98
128
|
);
|
|
99
129
|
}
|
|
100
130
|
|
|
101
|
-
// Deduplicate by id (JSONL takes precedence)
|
|
102
|
-
|
|
103
|
-
sessions = sessions
|
|
104
|
-
.sort((a, b) => (b.updated_at > a.updated_at ? 1 : -1))
|
|
105
|
-
.filter((s) => {
|
|
106
|
-
if (seen.has(s.id)) return false;
|
|
107
|
-
seen.add(s.id);
|
|
108
|
-
return true;
|
|
109
|
-
})
|
|
110
|
-
.slice(0, limit);
|
|
131
|
+
// Deduplicate by id (JSONL takes precedence) and rank by real time.
|
|
132
|
+
sessions = rankSessions(sessions, limit);
|
|
111
133
|
|
|
112
134
|
if (options.json) {
|
|
113
135
|
console.log(JSON.stringify(sessions, null, 2));
|
package/src/commands/siem.js
CHANGED
|
@@ -8,6 +8,7 @@ import { logger } from "../lib/logger.js";
|
|
|
8
8
|
import { bootstrap, shutdown } from "../runtime/bootstrap.js";
|
|
9
9
|
import {
|
|
10
10
|
ensureSIEMTables,
|
|
11
|
+
loadFromDb as loadSiemFromDb,
|
|
11
12
|
listTargets,
|
|
12
13
|
addTarget,
|
|
13
14
|
exportLogs,
|
|
@@ -46,6 +47,7 @@ export function registerSiemCommand(program) {
|
|
|
46
47
|
}
|
|
47
48
|
const db = ctx.db.getDatabase();
|
|
48
49
|
ensureSIEMTables(db);
|
|
50
|
+
loadSiemFromDb(db);
|
|
49
51
|
|
|
50
52
|
const targets = listTargets();
|
|
51
53
|
if (options.json) {
|
|
@@ -83,6 +85,7 @@ export function registerSiemCommand(program) {
|
|
|
83
85
|
}
|
|
84
86
|
const db = ctx.db.getDatabase();
|
|
85
87
|
ensureSIEMTables(db);
|
|
88
|
+
loadSiemFromDb(db);
|
|
86
89
|
|
|
87
90
|
const target = addTarget(db, type, url, options.format);
|
|
88
91
|
logger.success("SIEM target added");
|
|
@@ -111,6 +114,7 @@ export function registerSiemCommand(program) {
|
|
|
111
114
|
}
|
|
112
115
|
const db = ctx.db.getDatabase();
|
|
113
116
|
ensureSIEMTables(db);
|
|
117
|
+
loadSiemFromDb(db);
|
|
114
118
|
|
|
115
119
|
// Export with simulated log batch
|
|
116
120
|
const result = exportLogs(db, targetId, [
|
|
@@ -146,6 +150,7 @@ export function registerSiemCommand(program) {
|
|
|
146
150
|
}
|
|
147
151
|
const db = ctx.db.getDatabase();
|
|
148
152
|
ensureSIEMTables(db);
|
|
153
|
+
loadSiemFromDb(db);
|
|
149
154
|
|
|
150
155
|
const stats = getSIEMStats();
|
|
151
156
|
if (options.json) {
|
|
@@ -251,6 +256,7 @@ export function registerSiemCommand(program) {
|
|
|
251
256
|
}
|
|
252
257
|
const db = ctx.db.getDatabase();
|
|
253
258
|
ensureSIEMTables(db);
|
|
259
|
+
loadSiemFromDb(db);
|
|
254
260
|
|
|
255
261
|
let config = {};
|
|
256
262
|
try {
|
|
@@ -286,6 +292,7 @@ export function registerSiemCommand(program) {
|
|
|
286
292
|
}
|
|
287
293
|
const db = ctx.db.getDatabase();
|
|
288
294
|
ensureSIEMTables(db);
|
|
295
|
+
loadSiemFromDb(db);
|
|
289
296
|
|
|
290
297
|
console.log(JSON.stringify(removeTarget(db, targetId), null, 2));
|
|
291
298
|
|
|
@@ -308,6 +315,7 @@ export function registerSiemCommand(program) {
|
|
|
308
315
|
}
|
|
309
316
|
const db = ctx.db.getDatabase();
|
|
310
317
|
ensureSIEMTables(db);
|
|
318
|
+
loadSiemFromDb(db);
|
|
311
319
|
|
|
312
320
|
console.log(
|
|
313
321
|
JSON.stringify(setTargetStatus(db, targetId, status), null, 2),
|
|
@@ -334,6 +342,7 @@ export function registerSiemCommand(program) {
|
|
|
334
342
|
}
|
|
335
343
|
const db = ctx.db.getDatabase();
|
|
336
344
|
ensureSIEMTables(db);
|
|
345
|
+
loadSiemFromDb(db);
|
|
337
346
|
|
|
338
347
|
let logs = [];
|
|
339
348
|
try {
|
|
@@ -368,6 +377,7 @@ export function registerSiemCommand(program) {
|
|
|
368
377
|
}
|
|
369
378
|
const db = ctx.db.getDatabase();
|
|
370
379
|
ensureSIEMTables(db);
|
|
380
|
+
loadSiemFromDb(db);
|
|
371
381
|
|
|
372
382
|
console.log(JSON.stringify(getSIEMStatsV2(), null, 2));
|
|
373
383
|
|
|
@@ -390,6 +400,7 @@ export function registerSiemCommand(program) {
|
|
|
390
400
|
}
|
|
391
401
|
const db = ctx.db.getDatabase();
|
|
392
402
|
ensureSIEMTables(db);
|
|
403
|
+
loadSiemFromDb(db);
|
|
393
404
|
|
|
394
405
|
console.log(JSON.stringify(listTargetsByStatus(status), null, 2));
|
|
395
406
|
|
package/src/commands/sla.js
CHANGED
|
@@ -9,6 +9,7 @@ import { logger } from "../lib/logger.js";
|
|
|
9
9
|
import { bootstrap, shutdown } from "../runtime/bootstrap.js";
|
|
10
10
|
import {
|
|
11
11
|
ensureSlaTables,
|
|
12
|
+
loadFromDb as loadSlaFromDb,
|
|
12
13
|
listTiers,
|
|
13
14
|
createSLA,
|
|
14
15
|
listSLAs,
|
|
@@ -50,6 +51,7 @@ function _dbFromCtx(ctx) {
|
|
|
50
51
|
}
|
|
51
52
|
const db = ctx.db.getDatabase();
|
|
52
53
|
ensureSlaTables(db);
|
|
54
|
+
loadSlaFromDb(db);
|
|
53
55
|
return db;
|
|
54
56
|
}
|
|
55
57
|
|
|
@@ -81,7 +83,11 @@ export function registerSlaCommand(program) {
|
|
|
81
83
|
.command("create <org-id>")
|
|
82
84
|
.description("Create a new SLA contract")
|
|
83
85
|
.option("-t, --tier <tier>", "SLA tier (gold|silver|bronze)", "silver")
|
|
84
|
-
.option(
|
|
86
|
+
.option(
|
|
87
|
+
"-d, --duration <ms>",
|
|
88
|
+
"Contract duration in ms",
|
|
89
|
+
intArg("--duration"),
|
|
90
|
+
)
|
|
85
91
|
.option("-f, --fee <amount>", "Monthly fee", parseFloat, 0)
|
|
86
92
|
.option("--json", "Output as JSON")
|
|
87
93
|
.action(async (orgId, options) => {
|
|
@@ -337,7 +343,11 @@ export function registerSlaCommand(program) {
|
|
|
337
343
|
sla
|
|
338
344
|
.command("report <sla-id>")
|
|
339
345
|
.description("Generate an SLA compliance report")
|
|
340
|
-
.option(
|
|
346
|
+
.option(
|
|
347
|
+
"--start <ms>",
|
|
348
|
+
"Start of window (ms since epoch)",
|
|
349
|
+
intArg("--start"),
|
|
350
|
+
)
|
|
341
351
|
.option("--end <ms>", "End of window (ms since epoch)", intArg("--end"))
|
|
342
352
|
.option("--json", "Output as JSON")
|
|
343
353
|
.action(async (slaId, options) => {
|
|
@@ -380,6 +390,7 @@ export function registerSlaCommand(program) {
|
|
|
380
390
|
try {
|
|
381
391
|
const db = ctx.db.getDatabase();
|
|
382
392
|
ensureSlaTables(db);
|
|
393
|
+
loadSlaFromDb(db);
|
|
383
394
|
return await fn(db);
|
|
384
395
|
} finally {
|
|
385
396
|
await shutdown();
|
|
@@ -461,7 +472,11 @@ export function registerSlaCommand(program) {
|
|
|
461
472
|
.command("create-v2 <org-id>")
|
|
462
473
|
.description("Create a V2 SLA contract (enforces per-org active cap)")
|
|
463
474
|
.option("-t, --tier <tier>", "gold|silver|bronze", "silver")
|
|
464
|
-
.option(
|
|
475
|
+
.option(
|
|
476
|
+
"-d, --duration <ms>",
|
|
477
|
+
"Contract duration in ms",
|
|
478
|
+
intArg("--duration"),
|
|
479
|
+
)
|
|
465
480
|
.option("-f, --fee <amount>", "Monthly fee", floatArg("--fee"))
|
|
466
481
|
.option("--json", "Output as JSON")
|
|
467
482
|
.action(async (orgId, options) => {
|
package/src/commands/social.js
CHANGED
|
@@ -10,6 +10,7 @@ import { parseJsonOption } from "../lib/parse-json-option.js";
|
|
|
10
10
|
import { bootstrap, shutdown } from "../runtime/bootstrap.js";
|
|
11
11
|
import {
|
|
12
12
|
ensureSocialTables,
|
|
13
|
+
loadFromDb as loadSocialFromDb,
|
|
13
14
|
addContact,
|
|
14
15
|
listContacts,
|
|
15
16
|
deleteContact,
|
|
@@ -131,6 +132,7 @@ export function registerSocialCommand(program) {
|
|
|
131
132
|
}
|
|
132
133
|
const db = ctx.db.getDatabase();
|
|
133
134
|
ensureSocialTables(db);
|
|
135
|
+
loadSocialFromDb(db);
|
|
134
136
|
|
|
135
137
|
const c = addContact(
|
|
136
138
|
db,
|
|
@@ -161,6 +163,7 @@ export function registerSocialCommand(program) {
|
|
|
161
163
|
}
|
|
162
164
|
const db = ctx.db.getDatabase();
|
|
163
165
|
ensureSocialTables(db);
|
|
166
|
+
loadSocialFromDb(db);
|
|
164
167
|
|
|
165
168
|
const contacts = listContacts();
|
|
166
169
|
if (options.json) {
|
|
@@ -193,6 +196,7 @@ export function registerSocialCommand(program) {
|
|
|
193
196
|
}
|
|
194
197
|
const db = ctx.db.getDatabase();
|
|
195
198
|
ensureSocialTables(db);
|
|
199
|
+
loadSocialFromDb(db);
|
|
196
200
|
|
|
197
201
|
deleteContact(db, contactId);
|
|
198
202
|
logger.success(`Contact deleted`);
|
|
@@ -216,6 +220,7 @@ export function registerSocialCommand(program) {
|
|
|
216
220
|
}
|
|
217
221
|
const db = ctx.db.getDatabase();
|
|
218
222
|
ensureSocialTables(db);
|
|
223
|
+
loadSocialFromDb(db);
|
|
219
224
|
|
|
220
225
|
const c = showContact(contactId);
|
|
221
226
|
if (options.json) {
|
|
@@ -250,6 +255,7 @@ export function registerSocialCommand(program) {
|
|
|
250
255
|
}
|
|
251
256
|
const db = ctx.db.getDatabase();
|
|
252
257
|
ensureSocialTables(db);
|
|
258
|
+
loadSocialFromDb(db);
|
|
253
259
|
|
|
254
260
|
const f = addFriend(db, contactId);
|
|
255
261
|
logger.success(`Friend request sent (${f.status})`);
|
|
@@ -273,6 +279,7 @@ export function registerSocialCommand(program) {
|
|
|
273
279
|
}
|
|
274
280
|
const db = ctx.db.getDatabase();
|
|
275
281
|
ensureSocialTables(db);
|
|
282
|
+
loadSocialFromDb(db);
|
|
276
283
|
|
|
277
284
|
const friends = listFriends();
|
|
278
285
|
if (options.json) {
|
|
@@ -305,6 +312,7 @@ export function registerSocialCommand(program) {
|
|
|
305
312
|
}
|
|
306
313
|
const db = ctx.db.getDatabase();
|
|
307
314
|
ensureSocialTables(db);
|
|
315
|
+
loadSocialFromDb(db);
|
|
308
316
|
|
|
309
317
|
removeFriend(db, contactId);
|
|
310
318
|
logger.success("Friend removed");
|
|
@@ -328,6 +336,7 @@ export function registerSocialCommand(program) {
|
|
|
328
336
|
}
|
|
329
337
|
const db = ctx.db.getDatabase();
|
|
330
338
|
ensureSocialTables(db);
|
|
339
|
+
loadSocialFromDb(db);
|
|
331
340
|
|
|
332
341
|
const pending = pendingRequests();
|
|
333
342
|
if (options.json) {
|
|
@@ -365,6 +374,7 @@ export function registerSocialCommand(program) {
|
|
|
365
374
|
}
|
|
366
375
|
const db = ctx.db.getDatabase();
|
|
367
376
|
ensureSocialTables(db);
|
|
377
|
+
loadSocialFromDb(db);
|
|
368
378
|
|
|
369
379
|
const p = publishPost(db, content, options.author);
|
|
370
380
|
logger.success("Post published");
|
|
@@ -390,6 +400,7 @@ export function registerSocialCommand(program) {
|
|
|
390
400
|
}
|
|
391
401
|
const db = ctx.db.getDatabase();
|
|
392
402
|
ensureSocialTables(db);
|
|
403
|
+
loadSocialFromDb(db);
|
|
393
404
|
|
|
394
405
|
const posts = listPosts({ author: options.author });
|
|
395
406
|
if (options.json) {
|
|
@@ -422,6 +433,7 @@ export function registerSocialCommand(program) {
|
|
|
422
433
|
}
|
|
423
434
|
const db = ctx.db.getDatabase();
|
|
424
435
|
ensureSocialTables(db);
|
|
436
|
+
loadSocialFromDb(db);
|
|
425
437
|
|
|
426
438
|
const p = likePost(db, postId);
|
|
427
439
|
logger.success(`Post liked (${p.likes} total)`);
|
|
@@ -449,6 +461,7 @@ export function registerSocialCommand(program) {
|
|
|
449
461
|
}
|
|
450
462
|
const db = ctx.db.getDatabase();
|
|
451
463
|
ensureSocialTables(db);
|
|
464
|
+
loadSocialFromDb(db);
|
|
452
465
|
|
|
453
466
|
const msg = sendChatMessage(db, recipient, message, options.sender);
|
|
454
467
|
logger.success(`Message sent to ${chalk.cyan(recipient)}`);
|
|
@@ -474,9 +487,15 @@ export function registerSocialCommand(program) {
|
|
|
474
487
|
}
|
|
475
488
|
const db = ctx.db.getDatabase();
|
|
476
489
|
ensureSocialTables(db);
|
|
490
|
+
loadSocialFromDb(db);
|
|
477
491
|
|
|
478
492
|
const messages = getChatMessages(threadId, {
|
|
479
|
-
limit: numericOption(options.limit, {
|
|
493
|
+
limit: numericOption(options.limit, {
|
|
494
|
+
name: "--limit",
|
|
495
|
+
integer: true,
|
|
496
|
+
min: 1,
|
|
497
|
+
fallback: 50,
|
|
498
|
+
}),
|
|
480
499
|
});
|
|
481
500
|
if (options.json) {
|
|
482
501
|
console.log(JSON.stringify(messages, null, 2));
|
|
@@ -507,6 +526,7 @@ export function registerSocialCommand(program) {
|
|
|
507
526
|
}
|
|
508
527
|
const db = ctx.db.getDatabase();
|
|
509
528
|
ensureSocialTables(db);
|
|
529
|
+
loadSocialFromDb(db);
|
|
510
530
|
|
|
511
531
|
const threads = getChatThreads();
|
|
512
532
|
if (options.json) {
|
|
@@ -542,6 +562,7 @@ export function registerSocialCommand(program) {
|
|
|
542
562
|
}
|
|
543
563
|
const db = ctx.db.getDatabase();
|
|
544
564
|
ensureSocialTables(db);
|
|
565
|
+
loadSocialFromDb(db);
|
|
545
566
|
|
|
546
567
|
const stats = getSocialStats();
|
|
547
568
|
if (options.json) {
|
|
@@ -967,10 +988,22 @@ export function registerSocialCommand(program) {
|
|
|
967
988
|
directed: !!options.directed,
|
|
968
989
|
edgeTypes: _splitEdgeTypes(options.edgeTypes),
|
|
969
990
|
weights: {
|
|
970
|
-
degree: numericOption(options.wDegree, {
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
991
|
+
degree: numericOption(options.wDegree, {
|
|
992
|
+
name: "--w-degree",
|
|
993
|
+
fallback: 0.25,
|
|
994
|
+
}),
|
|
995
|
+
closeness: numericOption(options.wCloseness, {
|
|
996
|
+
name: "--w-closeness",
|
|
997
|
+
fallback: 0.25,
|
|
998
|
+
}),
|
|
999
|
+
betweenness: numericOption(options.wBetweenness, {
|
|
1000
|
+
name: "--w-betweenness",
|
|
1001
|
+
fallback: 0.25,
|
|
1002
|
+
}),
|
|
1003
|
+
eigenvector: numericOption(options.wEigenvector, {
|
|
1004
|
+
name: "--w-eigenvector",
|
|
1005
|
+
fallback: 0.25,
|
|
1006
|
+
}),
|
|
974
1007
|
},
|
|
975
1008
|
});
|
|
976
1009
|
if (options.json) console.log(JSON.stringify(scores, null, 2));
|
package/src/commands/sso.js
CHANGED
|
@@ -72,8 +72,16 @@ import {
|
|
|
72
72
|
} from "../lib/sso-manager.js";
|
|
73
73
|
|
|
74
74
|
function _dbFromCtx(cmd) {
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
// The preAction hook stores the opened db on the `sso` command node, which is
|
|
76
|
+
// an action subcommand's direct parent. The previous `cmd.parent.parent`
|
|
77
|
+
// resolved to the ROOT program node (never assigned _db) because that fallback
|
|
78
|
+
// `?? cmd.parent` never fires for a 3-level tree — so the handle was always
|
|
79
|
+
// undefined and every db.prepare() crashed. Walk up to the first node carrying
|
|
80
|
+
// _db instead.
|
|
81
|
+
for (let node = cmd; node; node = node.parent) {
|
|
82
|
+
if (node._db) return node._db;
|
|
83
|
+
}
|
|
84
|
+
return undefined;
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
async function _prepare(cmd) {
|