chainlesschain 0.162.149 → 0.162.151

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.
Files changed (285) hide show
  1. package/README.md +1 -1
  2. package/package.json +3 -2
  3. package/src/assets/web-panel/assets/{AIOps-BJif14yR.js → AIOps-DuEOzebi.js} +1 -1
  4. package/src/assets/web-panel/assets/{ActionButton-CXek6gJY.js → ActionButton-C6GiJa5H.js} +1 -1
  5. package/src/assets/web-panel/assets/{Analytics-BgQhdAJi.js → Analytics-BBIiL_pO.js} +3 -3
  6. package/src/assets/web-panel/assets/{AppLayout-DTYl5NtR.js → AppLayout-CuI2gZRy.js} +3 -3
  7. package/src/assets/web-panel/assets/{Audit-BzATQAeR.js → Audit-CbUjfr-K.js} +1 -1
  8. package/src/assets/web-panel/assets/{Backup-BzdPEQhL.js → Backup-CsSW9ljf.js} +1 -1
  9. package/src/assets/web-panel/assets/{BaseInput-BM0KVh8E.js → BaseInput-kM3rLe7F.js} +1 -1
  10. package/src/assets/web-panel/assets/{Chat-D7fHXHkz.js → Chat-kfE51YN3.js} +4 -4
  11. package/src/assets/web-panel/assets/{ChatBubbleRenderer-Wm34RR-b.js → ChatBubbleRenderer-Bg2FTW6A.js} +1 -1
  12. package/src/assets/web-panel/assets/{Checkbox-CAiSQ9vO.js → Checkbox-jYb1uj-M.js} +1 -1
  13. package/src/assets/web-panel/assets/{Codegen-Df40CrEe.js → Codegen-X9XiD5Lj.js} +1 -1
  14. package/src/assets/web-panel/assets/{Col-DIT2fNFU.js → Col-BfbHu1xI.js} +1 -1
  15. package/src/assets/web-panel/assets/{Community-CSTIbW2k.js → Community-c4oJMFS-.js} +1 -1
  16. package/src/assets/web-panel/assets/{Compact-DtqXZZUi.js → Compact-BFmnZpH7.js} +1 -1
  17. package/src/assets/web-panel/assets/{Compliance-CUtzw6o7.js → Compliance-s9shVHBS.js} +1 -1
  18. package/src/assets/web-panel/assets/{Cowork-CezmlnmU.js → Cowork-C5da--TC.js} +2 -2
  19. package/src/assets/web-panel/assets/{Cron-P4BITarg.js → Cron-9kNbyNE4.js} +2 -2
  20. package/src/assets/web-panel/assets/{Crosschain-BRRiYwvq.js → Crosschain-C1k3NJD4.js} +1 -1
  21. package/src/assets/web-panel/assets/{DID-L5ijB9i4.js → DID-DkheEvNK.js} +2 -2
  22. package/src/assets/web-panel/assets/{Dashboard-CFxro4ob.js → Dashboard-C3FuSGmJ.js} +2 -2
  23. package/src/assets/web-panel/assets/{Dropdown-BmAFCQ71.js → Dropdown-CAV6FMFD.js} +1 -1
  24. package/src/assets/web-panel/assets/{EmailListRenderer-DJBCEuon.js → EmailListRenderer-Cc-Ulc4l.js} +1 -1
  25. package/src/assets/web-panel/assets/{FamilyGuardDashboard-z4oLq6eT.js → FamilyGuardDashboard-8CitHEtv.js} +1 -1
  26. package/src/assets/web-panel/assets/{Federation-DsVCpHMF.js → Federation-DFSZ5KDt.js} +1 -1
  27. package/src/assets/web-panel/assets/{FormItemContext-DP3bP5th.js → FormItemContext-CEWCtnG2.js} +1 -1
  28. package/src/assets/web-panel/assets/{GenericCardRenderer-BAXP2Gc6.js → GenericCardRenderer-CwRzNzmX.js} +1 -1
  29. package/src/assets/web-panel/assets/{Git-I3g_bAw9.js → Git-0rgDM7cJ.js} +2 -2
  30. package/src/assets/web-panel/assets/{Governance-jHS5-ioS.js → Governance-CfBKtK9F.js} +1 -1
  31. package/src/assets/web-panel/assets/{Inference-CPL7sfx9.js → Inference-CzcUVvud.js} +1 -1
  32. package/src/assets/web-panel/assets/{KnowledgeGraph-Jf236h4C.js → KnowledgeGraph-Dwc4YL4A.js} +1 -1
  33. package/src/assets/web-panel/assets/{Logs-Cm2tcSKg.js → Logs-DgFPwR2F.js} +2 -2
  34. package/src/assets/web-panel/assets/{Marketplace-CZK82rhi.js → Marketplace-DnpPTbGU.js} +1 -1
  35. package/src/assets/web-panel/assets/{McpTools-CZCeji7a.js → McpTools-DRxxINyW.js} +4 -4
  36. package/src/assets/web-panel/assets/{Memory-3l2KVS9k.js → Memory-OhmW_6Z3.js} +2 -2
  37. package/src/assets/web-panel/assets/{MobileBridge-VYdpoLh6.js → MobileBridge-DkTW-RK5.js} +1 -1
  38. package/src/assets/web-panel/assets/{MobileProjects-CiB9cmm1.js → MobileProjects-DpCGV_lI.js} +1 -1
  39. package/src/assets/web-panel/assets/{Mtc-wCFZbBuL.js → Mtc--vmkL0AS.js} +2 -2
  40. package/src/assets/web-panel/assets/{MtcAudit-1a3THIyG.js → MtcAudit-DGoFWjD4.js} +4 -4
  41. package/src/assets/web-panel/assets/{Multisig-DMzLB2hG.js → Multisig-B4kWgq95.js} +3 -3
  42. package/src/assets/web-panel/assets/{NLProgramming-D9wZbf6l.js → NLProgramming-YQwvommE.js} +1 -1
  43. package/src/assets/web-panel/assets/{Notes-hrFe2ZM-.js → Notes-CgjtUADJ.js} +3 -3
  44. package/src/assets/web-panel/assets/{NotificationSettings-CHGX5Jwm.js → NotificationSettings-6JDrpBG5.js} +1 -1
  45. package/src/assets/web-panel/assets/OrderTableRenderer-PM6IlxjO.js +1 -0
  46. package/src/assets/web-panel/assets/{Organization-By7FkhtY.js → Organization-8McOT_OF.js} +4 -4
  47. package/src/assets/web-panel/assets/{Overflow--khGSzJn.js → Overflow-DAZpSCGc.js} +1 -1
  48. package/src/assets/web-panel/assets/{P2P-CAG9dH35.js → P2P-B7l2ZWLy.js} +2 -2
  49. package/src/assets/web-panel/assets/{PdhVaultBrowser-B3SQZmK9.js → PdhVaultBrowser-W1Ud-NAL.js} +3 -3
  50. package/src/assets/web-panel/assets/{Permissions-D35ec6JA.js → Permissions-Czm_w9u_.js} +4 -4
  51. package/src/assets/web-panel/assets/{PersonalDataHub-CxBF7hW_.js → PersonalDataHub-B4F0_ZVM.js} +2 -2
  52. package/src/assets/web-panel/assets/{Pipeline-s6EtOO1s.js → Pipeline-B37aFiWv.js} +1 -1
  53. package/src/assets/web-panel/assets/{Privacy-BbJYmWmO.js → Privacy-94KBnRrD.js} +1 -1
  54. package/src/assets/web-panel/assets/{ProjectInit-VGQq1jMT.js → ProjectInit-B5h8_dlh.js} +2 -2
  55. package/src/assets/web-panel/assets/{ProjectSettings-B1ew3Teh.js → ProjectSettings-lmeI3Lpm.js} +2 -2
  56. package/src/assets/web-panel/assets/Projects-D5AYOasl.js +1 -0
  57. package/src/assets/web-panel/assets/{Providers-mrO47FIK.js → Providers-B3cNWwJg.js} +1 -1
  58. package/src/assets/web-panel/assets/{QrScannerModal-IJF2mHyw.js → QrScannerModal-CHRvOw1R.js} +1 -1
  59. package/src/assets/web-panel/assets/{QuickAsk-CU0wN_Z0.js → QuickAsk-D1JMgFEd.js} +1 -1
  60. package/src/assets/web-panel/assets/{Recommend-DhN37R6G.js → Recommend-EYWGR79p.js} +1 -1
  61. package/src/assets/web-panel/assets/{RemoteSession-D_xOX_hu.js → RemoteSession-BAMC2pJt.js} +2 -2
  62. package/src/assets/web-panel/assets/{Reputation-D_Ssv7uH.js → Reputation-X2Hk1XG_.js} +1 -1
  63. package/src/assets/web-panel/assets/{Row-Kx5dKxX7.js → Row-Eq98LRtU.js} +1 -1
  64. package/src/assets/web-panel/assets/{RssFeed-BlGwqZkY.js → RssFeed-i76s6z_o.js} +2 -2
  65. package/src/assets/web-panel/assets/{Search-hLFQzxpb.js → Search-D_Es7CAI.js} +1 -1
  66. package/src/assets/web-panel/assets/{Security-DMlvsVt4.js → Security-kayD2e94.js} +3 -3
  67. package/src/assets/web-panel/assets/{Services-Bd0Qsj2m.js → Services-Ctsm6ul8.js} +2 -2
  68. package/src/assets/web-panel/assets/{Skeleton-DFclq9X3.js → Skeleton-CRNYlfdf.js} +1 -1
  69. package/src/assets/web-panel/assets/{Skills-BNtln2qY.js → Skills-DkZYpF4-.js} +1 -1
  70. package/src/assets/web-panel/assets/{Sla-Dch5H19G.js → Sla-DXkoBcOP.js} +1 -1
  71. package/src/assets/web-panel/assets/{SpeechSettings-2UfQcU1g.js → SpeechSettings-DXi_GI1d.js} +1 -1
  72. package/src/assets/web-panel/assets/{SyncSettings-CD9YQr4i.js → SyncSettings-rNKpfomn.js} +2 -2
  73. package/src/assets/web-panel/assets/{Tasks-BNu-7MzI.js → Tasks-XF4uPtG-.js} +1 -1
  74. package/src/assets/web-panel/assets/{Templates-D1n9CaIR.js → Templates-i0Hzfeyu.js} +1 -1
  75. package/src/assets/web-panel/assets/{Tenant-DenL3iBW.js → Tenant-sMpHAi27.js} +1 -1
  76. package/src/assets/web-panel/assets/Terminal-BoZvaYAl.js +3 -0
  77. package/src/assets/web-panel/assets/{TimelineRenderer-D87IfukO.js → TimelineRenderer-yuC6K7Rf.js} +1 -1
  78. package/src/assets/web-panel/assets/{Tokens-BkiZc8E3.js → Tokens-B8O8i0s6.js} +1 -1
  79. package/src/assets/web-panel/assets/{Trigger-BNRSytGN.js → Trigger-Bv6yrlCr.js} +1 -1
  80. package/src/assets/web-panel/assets/{Trust-Bwbd4X2m.js → Trust-C4mW95Ev.js} +1 -1
  81. package/src/assets/web-panel/assets/{UkeySign-B8O2bs0o.js → UkeySign-DV6yKaHn.js} +1 -1
  82. package/src/assets/web-panel/assets/{VideoEditing-C2fL8zmH.js → VideoEditing-UI479-sD.js} +1 -1
  83. package/src/assets/web-panel/assets/{Wallet-BORYDdE1.js → Wallet-M5oV9EVP.js} +4 -4
  84. package/src/assets/web-panel/assets/{WebAuthn-C0V5S2FM.js → WebAuthn-DDyDHPDR.js} +4 -4
  85. package/src/assets/web-panel/assets/{WorkflowEditor-2dR0fcHL.js → WorkflowEditor-RoBv4rqk.js} +1 -1
  86. package/src/assets/web-panel/assets/{chat-BmuAFAn8.js → chat-Cw1mE5LS.js} +1 -1
  87. package/src/assets/web-panel/assets/{colors-CN3smMcK.js → colors-BFP62Gwf.js} +1 -1
  88. package/src/assets/web-panel/assets/{compact-item-DCnxb4kW.js → compact-item-17HL6pyC.js} +1 -1
  89. package/src/assets/web-panel/assets/{createContext-vlR43pHn.js → createContext-D55X4fZX.js} +1 -1
  90. package/src/assets/web-panel/assets/devWarning-CqbHYuRc.js +1 -0
  91. package/src/assets/web-panel/assets/{hasIn-D04tHYFd.js → hasIn-D3E5mNsP.js} +1 -1
  92. package/src/assets/web-panel/assets/{index-DbVsQBOH.js → index--44J50mc.js} +1 -1
  93. package/src/assets/web-panel/assets/{index-TslMTwNy.js → index-ASPYTzMK.js} +1 -1
  94. package/src/assets/web-panel/assets/{index-CTOCnIQ7.js → index-BC6zxOlU.js} +1 -1
  95. package/src/assets/web-panel/assets/{index-ljuBiQW9.js → index-BEa1RW4c.js} +1 -1
  96. package/src/assets/web-panel/assets/{index-jzR7Ujuw.js → index-BQmZg5si.js} +1 -1
  97. package/src/assets/web-panel/assets/{index-BudvKQfG.js → index-BY_xZ2jy.js} +1 -1
  98. package/src/assets/web-panel/assets/{index-CP9m9Ggr.js → index-BgN5G5vF.js} +3 -3
  99. package/src/assets/web-panel/assets/{index-Cr-A0FYJ.js → index-BnGpft-Z.js} +1 -1
  100. package/src/assets/web-panel/assets/{index-D5LZVZ0L.js → index-Bq83UBDr.js} +1 -1
  101. package/src/assets/web-panel/assets/{index-ToUh2b1-.js → index-Bzpp2z2S.js} +1 -1
  102. package/src/assets/web-panel/assets/{index-DbADHwhr.js → index-CFYGn88j.js} +1 -1
  103. package/src/assets/web-panel/assets/{index-ClhAHDK3.js → index-CGyTos4p.js} +1 -1
  104. package/src/assets/web-panel/assets/index-CKBI1U5K.js +1 -0
  105. package/src/assets/web-panel/assets/{index-C-6NO5il.js → index-CLEzsZ8A.js} +1 -1
  106. package/src/assets/web-panel/assets/{index-D8vwp4qp.js → index-CR9rNUvi.js} +1 -1
  107. package/src/assets/web-panel/assets/{index-_FIkN3jd.js → index-CW6LLoJO.js} +1 -1
  108. package/src/assets/web-panel/assets/{index-D65_XseV.js → index-C_MfcrLf.js} +1 -1
  109. package/src/assets/web-panel/assets/{index-CnXebZLL.js → index-Cdvk2_2q.js} +1 -1
  110. package/src/assets/web-panel/assets/{index-D_n8_vfI.js → index-CjCwi7we.js} +1 -1
  111. package/src/assets/web-panel/assets/index-CkLp6DTO.js +1 -0
  112. package/src/assets/web-panel/assets/{index-DDwLgQY9.js → index-CvCFKojj.js} +1 -1
  113. package/src/assets/web-panel/assets/{index-430S68MN.js → index-D4LHSde4.js} +1 -1
  114. package/src/assets/web-panel/assets/{index-BXRg8GFQ.js → index-DCLu84x-.js} +1 -1
  115. package/src/assets/web-panel/assets/{index-DTtRscUa.js → index-DD_qGBrt.js} +1 -1
  116. package/src/assets/web-panel/assets/{index-BasvsWDM.js → index-DIRvdwBX.js} +1 -1
  117. package/src/assets/web-panel/assets/{index-BeGDEXFs.js → index-DOjA8bvj.js} +1 -1
  118. package/src/assets/web-panel/assets/{index-CsAsCPJ6.js → index-Da27u6j0.js} +1 -1
  119. package/src/assets/web-panel/assets/{index-D28DeAAB.js → index-DkBVYlE4.js} +1 -1
  120. package/src/assets/web-panel/assets/{index-CngCC8hC.js → index-DtAnPBWP.js} +1 -1
  121. package/src/assets/web-panel/assets/{index-B78xL3s2.js → index-DzG7mkgW.js} +1 -1
  122. package/src/assets/web-panel/assets/{index-DIpY0qM5.js → index-H9_X1Cg_.js} +1 -1
  123. package/src/assets/web-panel/assets/{index-C5Sxb1sE.js → index-ITeEHb8L.js} +1 -1
  124. package/src/assets/web-panel/assets/{index-BTPEZTk1.js → index-KtLJXn4s.js} +1 -1
  125. package/src/assets/web-panel/assets/{index-hpvvtAZ3.js → index-RYZgFIwo.js} +1 -1
  126. package/src/assets/web-panel/assets/{index-HhNjnCfe.js → index-gAVxDiTZ.js} +1 -1
  127. package/src/assets/web-panel/assets/{index-DTWg-18U.js → index-paVubXzn.js} +1 -1
  128. package/src/assets/web-panel/assets/{index-BqhASEL4.js → index-tUH_6bdJ.js} +1 -1
  129. package/src/assets/web-panel/assets/{index-DYAtmqiv.js → index-tVRPgYGr.js} +1 -1
  130. package/src/assets/web-panel/assets/{index-0DnaZGkC.js → index-uSsiwgZ2.js} +1 -1
  131. package/src/assets/web-panel/assets/{initDefaultProps-C3wUb4je.js → initDefaultProps-Ckp7xVZS.js} +1 -1
  132. package/src/assets/web-panel/assets/{motion-D-jYFUNA.js → motion-DUZgCpn6.js} +1 -1
  133. package/src/assets/web-panel/assets/{move-tqb8nwJ2.js → move-B2rttglH.js} +1 -1
  134. package/src/assets/web-panel/assets/{mtc-parser-DSOjMJMz.js → mtc-parser-BYWcLTuN.js} +1 -1
  135. package/src/assets/web-panel/assets/{omit-CJ7VimIW.js → omit-DhHqKeFx.js} +1 -1
  136. package/src/assets/web-panel/assets/{pickAttrs-qXiG1iT3.js → pickAttrs-ANpJaWMO.js} +1 -1
  137. package/src/assets/web-panel/assets/{placementArrow-CkGBcy1Z.js → placementArrow-CfZWe7CA.js} +1 -1
  138. package/src/assets/web-panel/assets/{responsiveObserve-D3WvTlLO.js → responsiveObserve-D7Xz2y-R.js} +1 -1
  139. package/src/assets/web-panel/assets/{slide-BEE2ftge.js → slide-DekqCBY9.js} +1 -1
  140. package/src/assets/web-panel/assets/{statusUtils-CsfBpxiG.js → statusUtils-BET6XU7h.js} +1 -1
  141. package/src/assets/web-panel/assets/{styleChecker-xPrIiJPI.js → styleChecker-qHmJjV62.js} +1 -1
  142. package/src/assets/web-panel/assets/{useFlexGapSupport-C5Yd-SCR.js → useFlexGapSupport-BoMCTNyu.js} +1 -1
  143. package/src/assets/web-panel/assets/{useFs-D_MDS8HI.js → useFs-TdW-NgFC.js} +1 -1
  144. package/src/assets/web-panel/assets/{usePersonalDataHub-BqJh-usA.js → usePersonalDataHub-Dyox7wCu.js} +1 -1
  145. package/src/assets/web-panel/assets/{vnode-chm_p-gz.js → vnode-XUn5S8CP.js} +1 -1
  146. package/src/assets/web-panel/assets/{zoom-3-YDNz0Z.js → zoom-Ls77i8hn.js} +1 -1
  147. package/src/assets/web-panel/index.html +1 -1
  148. package/src/command-manifest.json +8 -1
  149. package/src/commands/a2a.js +19 -4
  150. package/src/commands/activitypub.js +20 -3
  151. package/src/commands/agent.js +27 -5
  152. package/src/commands/audit.js +40 -24
  153. package/src/commands/changelog.js +148 -0
  154. package/src/commands/codeintel.js +68 -0
  155. package/src/commands/collab.js +15 -2
  156. package/src/commands/compliance.js +5 -0
  157. package/src/commands/config.js +4 -1
  158. package/src/commands/dao.js +86 -14
  159. package/src/commands/dev.js +2 -0
  160. package/src/commands/did.js +7 -1
  161. package/src/commands/dlp.js +23 -1
  162. package/src/commands/economy.js +29 -3
  163. package/src/commands/eval.js +7 -0
  164. package/src/commands/evomap.js +26 -0
  165. package/src/commands/governance.js +17 -3
  166. package/src/commands/hardening.js +18 -0
  167. package/src/commands/incentive.js +5 -0
  168. package/src/commands/init.js +46 -2
  169. package/src/commands/kg.js +4 -0
  170. package/src/commands/loop.js +6 -1
  171. package/src/commands/lowcode.js +15 -2
  172. package/src/commands/marketplace.js +40 -6
  173. package/src/commands/matrix.js +20 -1
  174. package/src/commands/memory.js +4 -1
  175. package/src/commands/mtc.js +7 -1
  176. package/src/commands/nostr.js +31 -4
  177. package/src/commands/note.js +7 -4
  178. package/src/commands/plugin.js +125 -5
  179. package/src/commands/pqc.js +5 -0
  180. package/src/commands/reputation.js +10 -1
  181. package/src/commands/scim.js +6 -0
  182. package/src/commands/session.js +32 -10
  183. package/src/commands/siem.js +11 -0
  184. package/src/commands/sla.js +18 -3
  185. package/src/commands/social.js +38 -5
  186. package/src/commands/sso.js +10 -2
  187. package/src/commands/stress.js +23 -4
  188. package/src/commands/team.js +9 -2
  189. package/src/commands/tech.js +2 -0
  190. package/src/commands/tenant.js +10 -1
  191. package/src/commands/terraform.js +6 -0
  192. package/src/commands/update.js +1 -1
  193. package/src/commands/zkp.js +20 -0
  194. package/src/data/changelog.json +189 -0
  195. package/src/gateways/ws/message-dispatcher.js +5 -2
  196. package/src/gateways/ws/remote-session-protocol.js +110 -42
  197. package/src/harness/jsonl-session-store.js +12 -5
  198. package/src/harness/plugin-manager.js +16 -4
  199. package/src/harness/remote-command-ledger.js +46 -15
  200. package/src/harness/worktree-isolator.js +16 -6
  201. package/src/index.js +2 -0
  202. package/src/lib/__tests__/logger.test.js +5 -2
  203. package/src/lib/a2a-protocol.js +25 -1
  204. package/src/lib/activitypub-bridge.js +61 -0
  205. package/src/lib/agent-core.js +2 -0
  206. package/src/lib/agent-economy.js +262 -29
  207. package/src/lib/agent-network.js +7 -1
  208. package/src/lib/agent-team/team-runner.js +25 -9
  209. package/src/lib/agent-team/team-worktree.js +36 -4
  210. package/src/lib/async-hook-supervisor.cjs +102 -16
  211. package/src/lib/audit-logger.js +7 -6
  212. package/src/lib/autonomous-developer.js +60 -0
  213. package/src/lib/changelog.js +252 -0
  214. package/src/lib/chat-core.js +17 -4
  215. package/src/lib/collaboration-governance.js +56 -0
  216. package/src/lib/community-governance.js +68 -0
  217. package/src/lib/compliance-manager.js +63 -0
  218. package/src/lib/cross-chain.js +5 -0
  219. package/src/lib/dao-governance.js +151 -2
  220. package/src/lib/did-manager.js +23 -10
  221. package/src/lib/dlp-engine.js +70 -0
  222. package/src/lib/eval/runner.js +89 -1
  223. package/src/lib/eval/tasks.js +170 -0
  224. package/src/lib/eval/trend.js +16 -1
  225. package/src/lib/evolution-system.js +92 -0
  226. package/src/lib/evomap-federation.js +55 -0
  227. package/src/lib/evomap-governance.js +94 -0
  228. package/src/lib/fatal-handler.js +17 -1
  229. package/src/lib/hardening-manager.js +73 -0
  230. package/src/lib/hierarchical-memory.js +14 -8
  231. package/src/lib/knowledge-exporter.js +8 -2
  232. package/src/lib/knowledge-graph.js +79 -0
  233. package/src/lib/llm-providers.js +23 -14
  234. package/src/lib/logger.js +4 -1
  235. package/src/lib/lsp/__tests__/benchmark.test.js +88 -0
  236. package/src/lib/lsp/__tests__/lsp-client.test.js +11 -0
  237. package/src/lib/lsp/__tests__/lsp-manager.test.js +69 -0
  238. package/src/lib/lsp/benchmark.js +257 -0
  239. package/src/lib/lsp/lsp-client.js +30 -9
  240. package/src/lib/lsp/lsp-manager.js +54 -2
  241. package/src/lib/lsp/lsp-server-registry.js +15 -4
  242. package/src/lib/matrix-bridge.js +84 -0
  243. package/src/lib/memory-manager.js +5 -3
  244. package/src/lib/nostr-bridge.js +53 -0
  245. package/src/lib/permission-engine.js +22 -4
  246. package/src/lib/plugin-runtime/__tests__/remote-source.test.js +256 -0
  247. package/src/lib/plugin-runtime/hooks.js +20 -4
  248. package/src/lib/plugin-runtime/install.js +9 -1
  249. package/src/lib/plugin-runtime/monitors.js +20 -4
  250. package/src/lib/plugin-runtime/policy.js +9 -1
  251. package/src/lib/plugin-runtime/remote-source.js +240 -0
  252. package/src/lib/plugin-runtime/signature.js +16 -0
  253. package/src/lib/pqc-manager.js +64 -0
  254. package/src/lib/reputation-optimizer.js +101 -0
  255. package/src/lib/sandbox-egress-proxy.js +195 -59
  256. package/src/lib/sandbox-fs-policy.js +112 -0
  257. package/src/lib/sandbox-network-policy.js +44 -5
  258. package/src/lib/sandbox-v2.js +14 -14
  259. package/src/lib/scim-manager.js +36 -0
  260. package/src/lib/session-manager.js +5 -2
  261. package/src/lib/settings-hooks.cjs +1 -0
  262. package/src/lib/siem-exporter.js +45 -0
  263. package/src/lib/skill-loader.js +20 -2
  264. package/src/lib/skill-marketplace.js +83 -0
  265. package/src/lib/sla-manager.js +88 -0
  266. package/src/lib/social-manager.js +74 -0
  267. package/src/lib/stress-tester.js +65 -0
  268. package/src/lib/tech-learning-engine.js +75 -0
  269. package/src/lib/telemetry/span-recorder.js +12 -1
  270. package/src/lib/tenant-saas.js +107 -0
  271. package/src/lib/terraform-manager.js +67 -0
  272. package/src/lib/token-incentive.js +180 -29
  273. package/src/lib/wallet-manager.js +81 -35
  274. package/src/lib/zkp-engine.js +87 -0
  275. package/src/repl/agent-repl.js +17 -2
  276. package/src/runtime/__tests__/auto-pin.test.js +104 -0
  277. package/src/runtime/agent-core.js +241 -68
  278. package/src/runtime/auto-pin.js +117 -0
  279. package/src/runtime/headless-runner.js +35 -0
  280. package/src/assets/web-panel/assets/OrderTableRenderer-CRIFE2Tj.js +0 -1
  281. package/src/assets/web-panel/assets/Projects-CGcNIs_g.js +0 -1
  282. package/src/assets/web-panel/assets/Terminal-ZzU0Io1Y.js +0 -3
  283. package/src/assets/web-panel/assets/devWarning-DxwmsL4j.js +0 -1
  284. package/src/assets/web-panel/assets/index-Cg2ldRfU.js +0 -1
  285. package/src/assets/web-panel/assets/index-Dwzo-dtJ.js +0 -1
@@ -109,34 +109,58 @@ export function getBalance(agentId) {
109
109
  }
110
110
 
111
111
  export function pay(db, fromAgent, toAgent, amount, description) {
112
- if (amount <= 0) throw new Error("Amount must be positive");
112
+ if (!Number.isFinite(amount) || amount <= 0)
113
+ throw new Error("Amount must be positive");
113
114
 
114
115
  const fromBal = _getBalance(fromAgent);
115
116
  if (fromBal.balance < amount) {
116
117
  throw new Error(`Insufficient balance: ${fromBal.balance} < ${amount}`);
117
118
  }
118
119
 
119
- fromBal.balance -= amount;
120
120
  const toBal = _getBalance(toAgent);
121
+
122
+ // The ledger row, the debit and the credit must all land or none of them.
123
+ // Without a transaction a mid-way failure would debit the sender without
124
+ // crediting the receiver (tokens vanish); the CLI re-hydrates from these
125
+ // tables, so the loss would persist.
126
+ const fromSnap = { balance: fromBal.balance, locked: fromBal.locked };
127
+ const toSnap = { balance: toBal.balance, locked: toBal.locked };
128
+
129
+ fromBal.balance -= amount;
121
130
  toBal.balance += amount;
122
131
 
123
132
  const txId = crypto.randomUUID();
124
133
  const now = new Date().toISOString();
125
134
 
126
- db.prepare(
127
- `INSERT INTO economy_transactions (id, from_agent, to_agent, amount, type, description, created_at)
128
- VALUES (?, ?, ?, ?, ?, ?, ?)`,
129
- ).run(txId, fromAgent, toAgent, amount, "transfer", description || "", now);
135
+ const applyWrites = () => {
136
+ db.prepare(
137
+ `INSERT INTO economy_transactions (id, from_agent, to_agent, amount, type, description, created_at)
138
+ VALUES (?, ?, ?, ?, ?, ?, ?)`,
139
+ ).run(txId, fromAgent, toAgent, amount, "transfer", description || "", now);
130
140
 
131
- db.prepare(
132
- `INSERT OR REPLACE INTO economy_balances (agent_id, balance, locked, updated_at)
133
- VALUES (?, ?, ?, ?)`,
134
- ).run(fromAgent, fromBal.balance, fromBal.locked, now);
141
+ db.prepare(
142
+ `INSERT OR REPLACE INTO economy_balances (agent_id, balance, locked, updated_at)
143
+ VALUES (?, ?, ?, ?)`,
144
+ ).run(fromAgent, fromBal.balance, fromBal.locked, now);
135
145
 
136
- db.prepare(
137
- `INSERT OR REPLACE INTO economy_balances (agent_id, balance, locked, updated_at)
138
- VALUES (?, ?, ?, ?)`,
139
- ).run(toAgent, toBal.balance, toBal.locked, now);
146
+ db.prepare(
147
+ `INSERT OR REPLACE INTO economy_balances (agent_id, balance, locked, updated_at)
148
+ VALUES (?, ?, ?, ?)`,
149
+ ).run(toAgent, toBal.balance, toBal.locked, now);
150
+ };
151
+
152
+ try {
153
+ if (db && typeof db.transaction === "function") {
154
+ db.transaction(applyWrites)();
155
+ } else {
156
+ applyWrites();
157
+ }
158
+ } catch (err) {
159
+ // Roll the in-memory balances back to match the rolled-back DB.
160
+ Object.assign(fromBal, fromSnap);
161
+ Object.assign(toBal, toSnap);
162
+ throw err;
163
+ }
140
164
 
141
165
  return {
142
166
  txId,
@@ -158,6 +182,7 @@ export function openChannel(db, partyA, partyB, depositA) {
158
182
  );
159
183
  }
160
184
 
185
+ const balSnap = { balance: balA.balance, locked: balA.locked };
161
186
  if (deposit > 0) {
162
187
  balA.balance -= deposit;
163
188
  balA.locked += deposit;
@@ -174,12 +199,35 @@ export function openChannel(db, partyA, partyB, depositA) {
174
199
  status: "open",
175
200
  createdAt: now,
176
201
  };
177
- _channels.set(id, channel);
178
202
 
179
- db.prepare(
180
- `INSERT INTO economy_channels (id, party_a, party_b, balance_a, balance_b, status, created_at)
181
- VALUES (?, ?, ?, ?, ?, ?, ?)`,
182
- ).run(id, partyA, partyB, deposit, 0, "open", now);
203
+ // Persist the channel row AND the deposit debit together. Persisting only the
204
+ // channel (as before) left the locked deposit still fully available in
205
+ // economy_balances after the next process re-hydrates — double-counted, so a
206
+ // party could lock a deposit and still spend the same funds via pay().
207
+ const applyWrites = () => {
208
+ db.prepare(
209
+ `INSERT INTO economy_channels (id, party_a, party_b, balance_a, balance_b, status, created_at)
210
+ VALUES (?, ?, ?, ?, ?, ?, ?)`,
211
+ ).run(id, partyA, partyB, deposit, 0, "open", now);
212
+ if (deposit > 0) {
213
+ db.prepare(
214
+ `INSERT OR REPLACE INTO economy_balances (agent_id, balance, locked, updated_at)
215
+ VALUES (?, ?, ?, ?)`,
216
+ ).run(partyA, balA.balance, balA.locked, now);
217
+ }
218
+ };
219
+
220
+ try {
221
+ if (db && typeof db.transaction === "function") {
222
+ db.transaction(applyWrites)();
223
+ } else {
224
+ applyWrites();
225
+ }
226
+ _channels.set(id, channel);
227
+ } catch (err) {
228
+ Object.assign(balA, balSnap);
229
+ throw err;
230
+ }
183
231
 
184
232
  return channel;
185
233
  }
@@ -189,18 +237,49 @@ export function closeChannel(db, channelId) {
189
237
  if (!channel) throw new Error(`Channel not found: ${channelId}`);
190
238
  if (channel.status === "closed") throw new Error("Channel already closed");
191
239
 
192
- channel.status = "closed";
193
-
194
- // Settle: return balances to parties
195
240
  const balA = _getBalance(channel.partyA);
196
241
  const balB = _getBalance(channel.partyB);
242
+ const aSnap = { balance: balA.balance, locked: balA.locked };
243
+ const bSnap = { balance: balB.balance, locked: balB.locked };
244
+ const prevStatus = channel.status;
245
+
246
+ channel.status = "closed";
247
+ // Settle: return balances to parties.
197
248
  balA.balance += channel.balanceA;
198
249
  balA.locked = Math.max(0, balA.locked - channel.balanceA);
199
250
  balB.balance += channel.balanceB;
200
251
 
201
- db.prepare(`UPDATE economy_channels SET status = 'closed' WHERE id = ?`).run(
202
- channelId,
203
- );
252
+ const now = new Date().toISOString();
253
+ // Persist the settled balances alongside the status flip. Previously only the
254
+ // channel status was written, so the returned deposit was lost on re-hydrate.
255
+ const persistBal = (agentId, bal) =>
256
+ db
257
+ .prepare(
258
+ `INSERT OR REPLACE INTO economy_balances (agent_id, balance, locked, updated_at)
259
+ VALUES (?, ?, ?, ?)`,
260
+ )
261
+ .run(agentId, bal.balance, bal.locked, now);
262
+
263
+ const applyWrites = () => {
264
+ db.prepare(
265
+ `UPDATE economy_channels SET status = 'closed' WHERE id = ?`,
266
+ ).run(channelId);
267
+ persistBal(channel.partyA, balA);
268
+ if (channel.partyB !== channel.partyA) persistBal(channel.partyB, balB);
269
+ };
270
+
271
+ try {
272
+ if (db && typeof db.transaction === "function") {
273
+ db.transaction(applyWrites)();
274
+ } else {
275
+ applyWrites();
276
+ }
277
+ } catch (err) {
278
+ Object.assign(balA, aSnap);
279
+ Object.assign(balB, bSnap);
280
+ channel.status = prevStatus;
281
+ throw err;
282
+ }
204
283
 
205
284
  return { ...channel };
206
285
  }
@@ -257,9 +336,11 @@ export function getMarketListings(filter) {
257
336
  return listings;
258
337
  }
259
338
 
260
- export function tradeResource(listingId, buyer, quantity) {
339
+ export function tradeResource(db, listingId, buyer, quantity) {
261
340
  const listing = _market.get(listingId);
262
341
  if (!listing) throw new Error(`Listing not found: ${listingId}`);
342
+ if (!Number.isFinite(quantity) || quantity <= 0)
343
+ throw new Error("Quantity must be positive");
263
344
  if (listing.available < quantity) {
264
345
  throw new Error(
265
346
  `Insufficient availability: ${listing.available} < ${quantity}`,
@@ -272,13 +353,52 @@ export function tradeResource(listingId, buyer, quantity) {
272
353
  throw new Error(`Insufficient balance: ${buyerBal.balance} < ${cost}`);
273
354
  }
274
355
 
275
- buyerBal.balance -= cost;
276
356
  const sellerBal = _getBalance(listing.provider);
357
+ const buyerSnap = { balance: buyerBal.balance, locked: buyerBal.locked };
358
+ const sellerSnap = { balance: sellerBal.balance, locked: sellerBal.locked };
359
+ const listingSnap = { available: listing.available, status: listing.status };
360
+
361
+ buyerBal.balance -= cost;
277
362
  sellerBal.balance += cost;
278
363
  listing.available -= quantity;
279
-
280
364
  if (listing.available <= 0) listing.status = "sold_out";
281
365
 
366
+ const now = new Date().toISOString();
367
+ // Persist the money movement and the listing depletion. Previously this
368
+ // mutated only the in-memory Maps (the fn took no db at all), so a trade
369
+ // reported success but never survived the next process re-hydrate — the
370
+ // buyer was never charged, the seller never paid, and the listing never
371
+ // depleted (unlimited free re-purchases). Sibling listResource/pay persist.
372
+ const persistBal = (agentId, bal) =>
373
+ db
374
+ .prepare(
375
+ `INSERT OR REPLACE INTO economy_balances (agent_id, balance, locked, updated_at)
376
+ VALUES (?, ?, ?, ?)`,
377
+ )
378
+ .run(agentId, bal.balance, bal.locked, now);
379
+
380
+ const applyWrites = () => {
381
+ persistBal(buyer, buyerBal);
382
+ if (listing.provider !== buyer) persistBal(listing.provider, sellerBal);
383
+ db.prepare(
384
+ `UPDATE economy_market SET available = ?, status = ? WHERE id = ?`,
385
+ ).run(listing.available, listing.status, listingId);
386
+ };
387
+
388
+ try {
389
+ if (db && typeof db.transaction === "function") {
390
+ db.transaction(applyWrites)();
391
+ } else if (db) {
392
+ applyWrites();
393
+ }
394
+ } catch (err) {
395
+ // Roll the in-memory Maps back to match the rolled-back DB.
396
+ Object.assign(buyerBal, buyerSnap);
397
+ Object.assign(sellerBal, sellerSnap);
398
+ Object.assign(listing, listingSnap);
399
+ throw err;
400
+ }
401
+
282
402
  return { listingId, buyer, quantity, cost, remaining: listing.available };
283
403
  }
284
404
 
@@ -332,7 +452,8 @@ export function getContributions(agentId) {
332
452
  export function distributeRevenue(db, pool, agentIds) {
333
453
  if (!agentIds || agentIds.length === 0)
334
454
  throw new Error("No agents specified");
335
- if (pool <= 0) throw new Error("Pool must be positive");
455
+ if (!Number.isFinite(pool) || pool <= 0)
456
+ throw new Error("Pool must be positive");
336
457
 
337
458
  const share = pool / agentIds.length;
338
459
  const results = [];
@@ -364,6 +485,118 @@ export function _resetState() {
364
485
  _priceList.clear();
365
486
  }
366
487
 
488
+ /**
489
+ * Rehydrate the DB-backed in-memory Maps from the economy_* tables. The CLI runs
490
+ * each `cc economy` subcommand in a fresh node process, so these module-level
491
+ * Maps start empty every invocation. Every write dual-writes (Map + INSERT into
492
+ * economy_balances/channels/market/nfts/contributions) but every read
493
+ * (getBalance/getMarketListings/closeChannel/tradeResource/getContributions) is
494
+ * Map-only and nothing SELECTed the tables back — so `balance` read back 0, and
495
+ * `channel close`/`trade` threw "not found" for rows that genuinely exist on
496
+ * disk. Call after ensureEconomyTables(db).
497
+ *
498
+ * `_priceList` has no table and stays in-memory (out of scope).
499
+ */
500
+ export function loadFromDb(db) {
501
+ if (!db) return 0;
502
+ ensureEconomyTables(db);
503
+ _balances.clear();
504
+ _channels.clear();
505
+ _market.clear();
506
+ _nfts.clear();
507
+ _contributions.clear();
508
+
509
+ for (const r of db
510
+ .prepare(`SELECT agent_id, balance, locked FROM economy_balances`)
511
+ .all()) {
512
+ _balances.set(r.agent_id, {
513
+ balance: Number(r.balance) || 0,
514
+ locked: Number(r.locked) || 0,
515
+ });
516
+ }
517
+
518
+ for (const r of db
519
+ .prepare(
520
+ `SELECT id, party_a, party_b, balance_a, balance_b, status, created_at
521
+ FROM economy_channels ORDER BY created_at ASC`,
522
+ )
523
+ .all()) {
524
+ _channels.set(r.id, {
525
+ id: r.id,
526
+ partyA: r.party_a,
527
+ partyB: r.party_b,
528
+ balanceA: Number(r.balance_a) || 0,
529
+ balanceB: Number(r.balance_b) || 0,
530
+ status: r.status,
531
+ createdAt: r.created_at,
532
+ });
533
+ }
534
+
535
+ for (const r of db
536
+ .prepare(
537
+ `SELECT id, resource_type, provider, price, available, unit, status, created_at
538
+ FROM economy_market ORDER BY created_at ASC`,
539
+ )
540
+ .all()) {
541
+ _market.set(r.id, {
542
+ id: r.id,
543
+ resourceType: r.resource_type,
544
+ provider: r.provider,
545
+ price: Number(r.price),
546
+ available: Number(r.available) || 0,
547
+ unit: r.unit || "unit",
548
+ status: r.status,
549
+ createdAt: r.created_at,
550
+ });
551
+ }
552
+
553
+ for (const r of db
554
+ .prepare(
555
+ `SELECT id, owner, type, metadata, created_at FROM economy_nfts ORDER BY created_at ASC`,
556
+ )
557
+ .all()) {
558
+ // One corrupt metadata cell must not sink the whole NFT load.
559
+ let metadata = {};
560
+ try {
561
+ metadata = r.metadata ? JSON.parse(r.metadata) : {};
562
+ } catch {
563
+ metadata = {};
564
+ }
565
+ _nfts.set(r.id, {
566
+ id: r.id,
567
+ owner: r.owner,
568
+ type: r.type,
569
+ metadata,
570
+ createdAt: r.created_at,
571
+ });
572
+ }
573
+
574
+ for (const r of db
575
+ .prepare(
576
+ `SELECT id, agent_id, type, value, proof, created_at
577
+ FROM economy_contributions ORDER BY created_at ASC`,
578
+ )
579
+ .all()) {
580
+ if (!_contributions.has(r.agent_id)) _contributions.set(r.agent_id, []);
581
+ _contributions.get(r.agent_id).push({
582
+ id: r.id,
583
+ agentId: r.agent_id,
584
+ type: r.type,
585
+ value: Number(r.value) || 0,
586
+ proof: r.proof || "",
587
+ createdAt: r.created_at,
588
+ });
589
+ }
590
+
591
+ return (
592
+ _balances.size +
593
+ _channels.size +
594
+ _market.size +
595
+ _nfts.size +
596
+ _contributions.size
597
+ );
598
+ }
599
+
367
600
  export function _setBalance(agentId, balance, locked) {
368
601
  _balances.set(agentId, { balance, locked: locked || 0 });
369
602
  }
@@ -966,7 +966,13 @@ export function updateReputation(
966
966
  throw new Error(
967
967
  `Invalid dimension: ${dimension}. Expected one of ${REPUTATION_DIMENSIONS.join(",")}`,
968
968
  );
969
- const s = Math.max(MIN_REPUTATION, Math.min(MAX_REPUTATION, Number(score)));
969
+ // Reject non-finite scores: Math.max/min pass NaN straight through, so a
970
+ // non-numeric CLI arg (Number("abc") → NaN) would persist NaN (→ NULL) and
971
+ // corrupt every getReputation average + routeTask agent scoring.
972
+ const numericScore = Number(score);
973
+ if (!Number.isFinite(numericScore))
974
+ throw new Error("score must be a finite number");
975
+ const s = Math.max(MIN_REPUTATION, Math.min(MAX_REPUTATION, numericScore));
970
976
  const id = `rep:${_uuid()}`;
971
977
  const now = _now();
972
978
  db.prepare(
@@ -217,9 +217,10 @@ export class TeamRunner {
217
217
  mailbox: this.mailbox,
218
218
  budget: this.budget,
219
219
  });
220
- this.registry.complete(key, { holder, result });
221
- // Fold usage/cost into the team budget. `--exec` shell tasks carry no
222
- // usage only the task-count / wall-clock dimensions move.
220
+ const done = this.registry.complete(key, { holder, result });
221
+ // Fold usage/cost into the team budget regardless the task DID execute
222
+ // and consumed resources. `--exec` shell tasks carry no usage → only the
223
+ // task-count / wall-clock dimensions move.
223
224
  if (this.budget) {
224
225
  this.budget.record(
225
226
  {
@@ -230,12 +231,27 @@ export class TeamRunner {
230
231
  this._now(),
231
232
  );
232
233
  }
233
- this._setState(holder, "completed-task");
234
- this._emit("task:completed", {
235
- key,
236
- holder,
237
- ms: this._now() - startedAt,
238
- });
234
+ if (done.ok) {
235
+ this._setState(holder, "completed-task");
236
+ this._emit("task:completed", {
237
+ key,
238
+ holder,
239
+ ms: this._now() - startedAt,
240
+ });
241
+ } else {
242
+ // The registry REJECTED the completion — the lease expired mid-run (the
243
+ // task outran its TTL without renewing), so a peer may already own it.
244
+ // Reporting `task:completed` + bumping the completed counter here would
245
+ // be a phantom success (the registry has no record of it, and the task
246
+ // will be reclaimed and re-run). Surface the discard honestly instead so
247
+ // the event stream and per-teammate stats stay truthful.
248
+ this._emit("task:completion-discarded", {
249
+ key,
250
+ holder,
251
+ reason: done.reason,
252
+ ms: this._now() - startedAt,
253
+ });
254
+ }
239
255
  } catch (err) {
240
256
  // A failed task still consumed a task-count slot (and any wall-clock) — fold
241
257
  // it so a doomed retry loop can't dodge the budget.
@@ -96,6 +96,24 @@ export class TeamWorktreeCoordinator {
96
96
  makeRunTask({ runInWorktree = null } = {}) {
97
97
  return async ({ key, task, holder }) => {
98
98
  const branch = this.branchFor(key);
99
+ // A retry (the prior attempt failed and TaskLeaseRegistry re-queued the
100
+ // task) would collide with its own leftover worktree: createWorktree
101
+ // derives a DETERMINISTIC path from the branch and throws "Worktree
102
+ // already exists" (and `worktree add -b` rejects the existing branch), so
103
+ // the retry can never recover — it just re-fails on the collision instead
104
+ // of the real task. Tear down the prior attempt's worktree + branch first
105
+ // so a retry starts clean.
106
+ const prior = this._created.get(key);
107
+ if (prior) {
108
+ try {
109
+ _deps.removeWorktree(this.repoDir, prior.path, {
110
+ deleteBranch: true,
111
+ });
112
+ } catch {
113
+ /* best-effort — a real problem will resurface in createWorktree */
114
+ }
115
+ this._created.delete(key);
116
+ }
99
117
  const { path: worktreePath } = _deps.createWorktree(this.repoDir, branch);
100
118
  this._created.set(key, { branch, path: worktreePath, committed: false });
101
119
  if (typeof runInWorktree === "function") {
@@ -157,20 +175,34 @@ export class TeamWorktreeCoordinator {
157
175
  const conflicts = preview?.conflicts || [];
158
176
  let merged = false;
159
177
  if (clean && merge) {
178
+ // mergeWorktree does NOT throw on a failed merge — it catches internally
179
+ // and RETURNS {success:false, conflicts?, message} (a conflict the clean
180
+ // preview didn't predict, or any non-conflict git failure). The old
181
+ // try/catch was dead for that path and set merged:true unconditionally,
182
+ // reporting a real merge failure as success with empty conflicts. Inspect
183
+ // the return value. (The try still catches assertSafeGitRef, the only
184
+ // throw path — a malformed branch ref.)
185
+ let mergeResult;
160
186
  try {
161
- _deps.mergeWorktree(this.repoDir, info.branch, {
187
+ mergeResult = _deps.mergeWorktree(this.repoDir, info.branch, {
162
188
  message: `Merge team task ${key}`,
163
189
  });
164
- merged = true;
165
190
  } catch (err) {
191
+ mergeResult = { success: false, message: err.message };
192
+ }
193
+ if (mergeResult?.success === true) {
194
+ merged = true;
195
+ } else {
166
196
  results.push({
167
197
  key,
168
198
  branch: info.branch,
169
199
  committed: true,
170
200
  clean: false,
171
201
  merged: false,
172
- conflicts,
173
- error: `merge failed: ${err.message}`,
202
+ conflicts: mergeResult?.conflicts?.length
203
+ ? mergeResult.conflicts
204
+ : conflicts,
205
+ error: `merge failed: ${mergeResult?.message || "unknown error"}`,
174
206
  });
175
207
  continue;
176
208
  }