nolo-cli 0.227.0-alpha.1 → 0.227.1

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 (258) hide show
  1. package/README.md +3 -5
  2. package/{_executeModel-JKQGZ3HU.js → _executeModel-CXOFYVHC.js} +93 -87
  3. package/{action-CK64LS6S.js → action-R2EIXR7I.js} +11 -8
  4. package/{addContentAction-CARFID6E.js → addContentAction-W6JVLQ6H.js} +17 -16
  5. package/{addDialogAgentAction-APLZLFW5.js → addDialogAgentAction-LVNKMXKZ.js} +20 -19
  6. package/{agentDeleteCommand-NVR2V2HH.js → agentDeleteCommand-VFSZPEQ5.js} +145 -137
  7. package/{agentEmailCommands-UCVOWD3S.js → agentEmailCommands-KRUIF4EH.js} +149 -137
  8. package/{agentFavoriteCommands-4PDOP3GW.js → agentFavoriteCommands-7LOP3HUD.js} +6 -6
  9. package/{agentGrantCommands-FLCEXLUH.js → agentGrantCommands-L6O2HVJI.js} +7 -7
  10. package/agentListCommands-TDFOLWN3.js +644 -0
  11. package/{agentMachineCommands-V3DGEJU4.js → agentMachineCommands-PSH7Q5PF.js} +76 -67
  12. package/{agentProviderCommands-7QBFRFRK.js → agentProviderCommands-C5T7C5KZ.js} +7 -7
  13. package/{agentPullCommand-E6JBGBVG.js → agentPullCommand-QQQZSC6S.js} +7 -7
  14. package/agentRecordCommands-KCKCW2QU.js +188 -0
  15. package/agentRunCommand-EF2T2QWD.js +223 -0
  16. package/{agentRunControl-SNZZ5XP4.js → agentRunControl-CSMSJFFB.js} +25 -17
  17. package/{agentRuntimeLocal-GOX2DIY7.js → agentRuntimeLocal-6QXQS3TS.js} +64 -50
  18. package/{agentSlice-N7H2FRJA.js → agentSlice-IZ5ANAF7.js} +19 -18
  19. package/{appDeleteCommands-LZDN26FU.js → appDeleteCommands-4M7ETEEG.js} +68 -59
  20. package/{appDeployCommands-6IO6TTZH.js → appDeployCommands-2VJ2NDW5.js} +68 -59
  21. package/{appDeployStatusCommands-FG3LX24J.js → appDeployStatusCommands-LDFSWOPQ.js} +68 -59
  22. package/{appGetCommands-NAKVDVD4.js → appGetCommands-RHVNOPT4.js} +68 -59
  23. package/{appListCommands-KL56RN73.js → appListCommands-U3XEVTL4.js} +68 -59
  24. package/{authCommand-AUN5MXV2.js → authCommand-PVZ45QRO.js} +36 -31
  25. package/{authCommands-D2IPS6ES.js → authCommands-6AUYO65N.js} +18 -13
  26. package/{builtinSkillRegistry-UQGLKRYP.js → builtinSkillRegistry-LRVAQCPW.js} +6 -6
  27. package/{chromeCommands-G5UDKVSV.js → chromeCommands-S7AW3AOD.js} +383 -6
  28. package/{chromeOpsCommands-UJWN5HWH.js → chromeOpsCommands-TBPM6MR4.js} +8 -8
  29. package/{chunk-ABGULE7H.js → chunk-22YUCKMK.js} +16 -16
  30. package/{chunk-P2ZLUIW2.js → chunk-2BSLGODA.js} +350 -25
  31. package/{chunk-GOLPOTG5.js → chunk-2COM7SAH.js} +4 -4
  32. package/{chunk-ULAQPRHX.js → chunk-2FK2KZSL.js} +1 -1
  33. package/{chunk-PLPLH2XZ.js → chunk-2IPR4PBB.js} +2 -2
  34. package/chunk-2SXN7LAY.js +15 -0
  35. package/{chunk-XI2BWJM5.js → chunk-324FWHUA.js} +20 -3
  36. package/{chunk-7Z3WUZ4Q.js → chunk-3YYFU6H7.js} +74 -46
  37. package/{chunk-C2B7M567.js → chunk-4OXPN3WC.js} +17 -6
  38. package/chunk-4TVOZGOS.js +62 -0
  39. package/chunk-4ZCTKB27.js +31 -0
  40. package/chunk-53AEDFBL.js +33394 -0
  41. package/chunk-53W5BXLN.js +340 -0
  42. package/{chunk-OXA5GWHU.js → chunk-56O2J2Y4.js} +3 -3
  43. package/{chunk-IAJJYHIB.js → chunk-56PB7FEN.js} +8 -8
  44. package/{chunk-JWXITTQB.js → chunk-5HUO7SEX.js} +9 -107
  45. package/{chunk-AGP3YSEC.js → chunk-5PASH2MB.js} +46 -1
  46. package/{chunk-PHOSZT3E.js → chunk-5UAKGCQG.js} +1 -1
  47. package/{chunk-5RKRXQ2H.js → chunk-5VVP7DW3.js} +20 -13
  48. package/chunk-6ASGEP5D.js +21 -0
  49. package/chunk-6PXFEPHL.js +103 -0
  50. package/chunk-6RSNVJGO.js +279 -0
  51. package/{chunk-YGMBIXCF.js → chunk-6XRPBZRS.js} +4 -2
  52. package/{chunk-KMRKZNGT.js → chunk-6YYTTLJV.js} +14 -13
  53. package/{chunk-VREDDN25.js → chunk-76HAJUOJ.js} +14 -9
  54. package/{chunk-FKEZOMIF.js → chunk-7DXFOL5B.js} +1410 -768
  55. package/{chunk-LA7JYAKF.js → chunk-AKPKOI5Z.js} +6 -6
  56. package/{chunk-PWTNI4N7.js → chunk-ANUP75N2.js} +22 -0
  57. package/{chunk-F5AY2UZL.js → chunk-AO6T7U62.js} +592 -68
  58. package/{chunk-LJSNEV7M.js → chunk-AS6L5KSD.js} +8 -8
  59. package/{chunk-GOQ6ZVTN.js → chunk-AVSZ6PBM.js} +5 -5
  60. package/chunk-BIDSIRTS.js +307 -0
  61. package/chunk-C5A54QS7.js +108 -0
  62. package/{chunk-KYH7XW3K.js → chunk-CD2DK5JA.js} +135 -14
  63. package/{chunk-G6HJUMST.js → chunk-CJQBWHNM.js} +2 -2
  64. package/{chunk-EVGU5P4U.js → chunk-CO6E7YK6.js} +1 -1
  65. package/{chunk-ZYA2YDB6.js → chunk-CT5JXREL.js} +17 -17
  66. package/{chunk-VPAZ6BEN.js → chunk-CTWCZKNS.js} +42 -17
  67. package/{chunk-4OKTPFNX.js → chunk-CX2LYFZQ.js} +107 -66
  68. package/{chunk-YFLVRVYK.js → chunk-DLT2DN4M.js} +1 -1
  69. package/{chunk-LKA64WH4.js → chunk-DMPZMYH4.js} +37 -1
  70. package/{chunk-KFHREHUQ.js → chunk-DXWGFL2Z.js} +89 -1
  71. package/{chunk-OQHIVPG4.js → chunk-E6A5NHDH.js} +4 -1
  72. package/{chunk-IX2BXN2K.js → chunk-EDT65EUE.js} +6 -6
  73. package/{chunk-VP3BINY7.js → chunk-EQZZASCD.js} +31 -1
  74. package/{chunk-45LZIYXB.js → chunk-ESN4WNWU.js} +3 -2
  75. package/{chunk-M3JEW6N6.js → chunk-F26GAEH3.js} +10 -0
  76. package/{chunk-CVERLOJM.js → chunk-F4XIS5DL.js} +1215 -1431
  77. package/chunk-FDZ2GBWO.js +166 -0
  78. package/chunk-FGHEF6WI.js +34 -0
  79. package/{chunk-CSW7IPVD.js → chunk-FMYNIAI6.js} +61 -24
  80. package/{chunk-VIHDJ3FK.js → chunk-FNT5VENS.js} +15 -15
  81. package/{chunk-PMDVQBGA.js → chunk-GAHJLSDO.js} +14 -7
  82. package/{chunk-GRXSJR2Z.js → chunk-GVTFSLNI.js} +112 -109
  83. package/{chunk-UN7HIYMH.js → chunk-GX6DITLQ.js} +1 -1
  84. package/{chunk-3VFYQH3I.js → chunk-HIDVLMZC.js} +203 -156
  85. package/{chunk-5LQDHFBN.js → chunk-IDFGIROZ.js} +20 -17
  86. package/{chunk-UCFPVYP7.js → chunk-IFWXH7LH.js} +1 -1
  87. package/{chunk-LXTC53TN.js → chunk-J45ACAOQ.js} +815 -361
  88. package/{chunk-S6K5F3KP.js → chunk-JP2BH4NC.js} +1 -1
  89. package/{chunk-X2KRQP7V.js → chunk-JV5FHHF7.js} +1 -1
  90. package/{chunk-6EDAMVG6.js → chunk-K26XPZRB.js} +11 -11
  91. package/{chunk-RU6DULV4.js → chunk-KB5RQRSJ.js} +1 -1
  92. package/{chunk-T43K75CK.js → chunk-KC2QVCI7.js} +24 -178
  93. package/chunk-KK3FCYZM.js +647 -0
  94. package/{chunk-XZODOEKU.js → chunk-KMDHRVS7.js} +29 -5
  95. package/{chunk-4JVNURX4.js → chunk-KQHEGELM.js} +68 -16
  96. package/{chunk-UAPNPNSG.js → chunk-KW72WVHO.js} +2085 -1046
  97. package/{chunk-ILHQ2AXT.js → chunk-KZAT2M2V.js} +14 -8
  98. package/{chunk-L42CBKBZ.js → chunk-KZKMH374.js} +3 -3
  99. package/{chunk-ZI5SZ3MV.js → chunk-L6BLA6BT.js} +40 -31
  100. package/{chunk-AK5O76CC.js → chunk-LC5CVWP2.js} +3 -3
  101. package/{chunk-N5Z2V73W.js → chunk-LELADM5Q.js} +1 -1
  102. package/chunk-LHCGKAFO.js +739 -0
  103. package/{chunk-YOT437BH.js → chunk-LOF2EFUE.js} +203 -123
  104. package/{chunk-YQETUZ5V.js → chunk-LTVEOOZL.js} +29 -16
  105. package/{chunk-T2BEPTAG.js → chunk-MAA42MMV.js} +272 -26
  106. package/{chunk-NAOO4PVX.js → chunk-MECW2HJG.js} +16 -16
  107. package/{chunk-5HL4KC4A.js → chunk-MEDPR36J.js} +62 -87
  108. package/chunk-MVOZ22RZ.js +26 -0
  109. package/{chunk-YPPKC6FL.js → chunk-MYYNZG2M.js} +140 -40
  110. package/{chunk-UVUVQVZ6.js → chunk-MZVCFV3T.js} +19 -15
  111. package/{chunk-CQVGR3MX.js → chunk-N7MXFYLU.js} +7 -7
  112. package/{chunk-IC2I373Q.js → chunk-NEG5LYK5.js} +4 -4
  113. package/chunk-NJJK3PDA.js +133 -0
  114. package/{chunk-OB6DVWPF.js → chunk-OGZE6BZG.js} +331 -99
  115. package/{chunk-M3Y4IBIR.js → chunk-OHUYN3YU.js} +6 -6
  116. package/chunk-P27E22MA.js +203 -0
  117. package/{chunk-SFTTXGPM.js → chunk-PDAXMBLW.js} +35 -28
  118. package/{chunk-OBSEKCVK.js → chunk-PQ63BDV3.js} +210 -51
  119. package/{chunk-EUCFKKDM.js → chunk-PVFYPUIM.js} +40 -10
  120. package/{chunk-SRG5CNLC.js → chunk-QIVE5WJE.js} +8 -8
  121. package/{chunk-HOCHUZQ7.js → chunk-QJTZ76CP.js} +24 -6
  122. package/{chunk-5RKUPJYL.js → chunk-QLUYDJST.js} +11 -3
  123. package/{chunk-7Z6EW7AH.js → chunk-QOURTDZL.js} +97 -11
  124. package/{chunk-VZW34YUL.js → chunk-QWSH3UAQ.js} +8 -5
  125. package/{chunk-MK2Q7ZJD.js → chunk-R7XWZDOH.js} +58 -24
  126. package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
  127. package/{chunk-SW6OD4KE.js → chunk-RDPAIR67.js} +351 -18
  128. package/{chunk-NO3VBWTL.js → chunk-RXTZB2DH.js} +4 -4
  129. package/{chunk-AXYH4734.js → chunk-S25VJYXV.js} +21 -15
  130. package/{chunk-MWHOH4RJ.js → chunk-SESKIWB4.js} +6 -6
  131. package/{chunk-GUVXQSFZ.js → chunk-SF4GMDZO.js} +18 -108
  132. package/{chunk-TINJKQSO.js → chunk-SQRKAYQW.js} +25 -25
  133. package/chunk-SR4FE5VD.js +9 -0
  134. package/{chunk-3HTP4WZQ.js → chunk-SX6AWTNK.js} +46 -8
  135. package/{chunk-4WVJLODK.js → chunk-T23G6PXQ.js} +8 -3
  136. package/{chunk-CLCXHIBS.js → chunk-T4QY3HZ5.js} +1 -1
  137. package/{chunk-HVUDBOQG.js → chunk-TB5KTLNB.js} +9 -6
  138. package/{chunk-KRRE4A7D.js → chunk-TKE4OJ4B.js} +280 -56
  139. package/{chunk-S2NTVGA2.js → chunk-U35UUM5K.js} +2 -1
  140. package/{chunk-PPJYZRSQ.js → chunk-U5LOKQ2R.js} +30 -14
  141. package/{chunk-CKT6QUE2.js → chunk-UHW6SCVK.js} +1 -1
  142. package/{chunk-T5N6NHAT.js → chunk-UPOW5HTG.js} +6 -6
  143. package/{chunk-WJP4TH6U.js → chunk-VEVLLBFK.js} +2 -2
  144. package/{chunk-HGDKT2D6.js → chunk-VTHWBTRE.js} +177 -1
  145. package/{chunk-KJAAPGBE.js → chunk-VUHKG4KS.js} +6 -6
  146. package/{chunk-TOKPHZ55.js → chunk-W3HSD32M.js} +17 -10
  147. package/{chunk-2SKTCNWO.js → chunk-W5OJBZLZ.js} +4 -4
  148. package/chunk-WBSJAIZP.js +170 -0
  149. package/chunk-WDWZPASX.js +29 -0
  150. package/chunk-WFGNWWJI.js +326 -0
  151. package/{chunk-FIYSMXHY.js → chunk-WWTSEBDF.js} +1 -1
  152. package/{chunk-E2BESSAW.js → chunk-X4O7FJF5.js} +2 -0
  153. package/{chunk-HYKGIXNO.js → chunk-XGWRH3OF.js} +114 -29
  154. package/{chunk-XIEYGCN6.js → chunk-XKV53E4E.js} +460 -117
  155. package/{chunk-JHF6VLVL.js → chunk-XYRTC2Y3.js} +155 -170
  156. package/{chunk-L5I543VB.js → chunk-YGDYYFRX.js} +20 -24
  157. package/{chunk-ZADGPNTV.js → chunk-YHWMKGOX.js} +77 -103
  158. package/{chunk-6OVNSQHN.js → chunk-YLAHYLDQ.js} +5 -0
  159. package/chunk-Z6YTCDU4.js +24 -0
  160. package/{chunk-PVAWNHP5.js → chunk-ZP26NIZE.js} +647 -387
  161. package/{chunk-2G3YSVO6.js → chunk-ZQ6K57FJ.js} +3 -3
  162. package/{cliAgentConfigHelpers-QVSQYTKC.js → cliAgentConfigHelpers-37ZNEY5Y.js} +16 -16
  163. package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-SFPC3WVK.js} +1 -1
  164. package/{cliEnvHelpers-D6HMC46Z.js → cliEnvHelpers-CNMP3RDX.js} +2 -2
  165. package/{cliExecutor-4MAX3PZL.js → cliExecutor-K6FDZTQ2.js} +3 -1
  166. package/cliLocalAgentRecordReader-53773JID.js +102 -0
  167. package/{commandRegistry-TKR6OWXP.js → commandRegistry-RJUO2VOD.js} +113 -101
  168. package/{contentThunks-BQWRPCTM.js → contentThunks-4EFHLUTB.js} +44 -41
  169. package/{cooldownCommands-FZYQOWI5.js → cooldownCommands-QL6DWGVU.js} +3 -3
  170. package/{createAgentAutomationAction-GFI6SJZV.js → createAgentAutomationAction-ZFFGJ7CZ.js} +44 -41
  171. package/{createDialogAction-MMBIHFFU.js → createDialogAction-SDUGVTPS.js} +45 -43
  172. package/{createPageAction-EEYUE5FB.js → createPageAction-NNM3OFLY.js} +49 -46
  173. package/{db-CS4ZJQKV.js → db-6NRZLEW2.js} +10 -7
  174. package/{dbSlice-X4Z4E4QU.js → dbSlice-5MQ3ELID.js} +16 -15
  175. package/{deleteFile-QOOP2UK7.js → deleteFile-VCCHS72Y.js} +12 -9
  176. package/{dialogCommands-OXBQ73DD.js → dialogCommands-SJK5KWXU.js} +73 -66
  177. package/dialogMessageRecord-OAV77LT7.js +7 -0
  178. package/{dialogNotifyCommand-VWS5G4OO.js → dialogNotifyCommand-PST75COP.js} +19 -19
  179. package/{dialogSlice-KGYIABDY.js → dialogSlice-2KLMHECR.js} +44 -41
  180. package/{dialogUsageCommand-FEWCN7IA.js → dialogUsageCommand-BZPKR3DW.js} +8 -8
  181. package/{docCreateCommands-LS32VKY3.js → docCreateCommands-K7CDL2HY.js} +66 -57
  182. package/{docDeleteCommands-JTYR5RPH.js → docDeleteCommands-ZEY5YCSP.js} +69 -60
  183. package/{docReadCommands-E5LTVKWN.js → docReadCommands-A4ROLIQG.js} +66 -57
  184. package/{docStore-TVS2FNER.js → docStore-A4O6YJAM.js} +19 -18
  185. package/{docUpdateCommands-I3J3JDZ2.js → docUpdateCommands-6HTFQY4O.js} +66 -57
  186. package/{fetchMessages-Q3INLN5F.js → fetchMessages-TQEUZD7H.js} +3 -3
  187. package/{getPricing-VNGFM4PN.js → getPricing-FCHYVRJU.js} +6 -6
  188. package/{handleSendMessageAction-SSON36TJ.js → handleSendMessageAction-6WEFYBUC.js} +87 -82
  189. package/{hostCredentialCreate-WTW4THJF.js → hostCredentialCreate-WOWCNOYM.js} +136 -123
  190. package/index.js +54 -16
  191. package/keys-RWF7UCB4.js +1 -1
  192. package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
  193. package/{localDialogRead-V36DX2Q2.js → localDialogRead-3T2KMCRC.js} +2 -2
  194. package/{localRuntimeAdapter-MI2JGXSF.js → localRuntimeAdapter-7EDBDRYW.js} +147 -133
  195. package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-7DKIT7UH.js} +4 -2
  196. package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-5WZ4RJJO.js} +1 -1
  197. package/{machineCommands-3LROJZDK.js → machineCommands-XRPC67LL.js} +290 -354
  198. package/machineWsRunDispatch-SOGFW472.js +203 -0
  199. package/markdownToSlate-KIYM7B3P.js +8 -0
  200. package/mcpLocalAuthorizeCommand-VOJARP3M.js +106 -0
  201. package/{memberThunks-CFEPHAND.js → memberThunks-KC3WJGL3.js} +26 -21
  202. package/{memoryCommands-JQMEJO7J.js → memoryCommands-BC6REPQB.js} +6 -6
  203. package/{models-H5NNZRLH.js → models-EP7VG6N2.js} +2 -2
  204. package/{overlay-THLKYIWY.js → overlay-JA3SPVUS.js} +7 -3
  205. package/package.json +1 -1
  206. package/{projectArchive-3X54XFVN.js → projectArchive-GDVPIZX2.js} +50 -47
  207. package/{providerPresetApply-FO36N5TX.js → providerPresetApply-4H7YP5D7.js} +9 -9
  208. package/{providerRegistry-U2BSFE6K.js → providerRegistry-F3UPOTIY.js} +9 -9
  209. package/{read-KA3L2V7O.js → read-T7VU2IMO.js} +11 -10
  210. package/{readDocTool-AMAZAPAW.js → readDocTool-BPQ3QJSD.js} +1 -1
  211. package/{readlineWorkspace-Z3YUH4SX.js → readlineWorkspace-OWQIIUGH.js} +9406 -6791
  212. package/rememberExplicit-CPAPONSI.js +15 -0
  213. package/{removeDialogAgentAction-JQOJSUM7.js → removeDialogAgentAction-FEUUVMYC.js} +23 -22
  214. package/{runAgentClientLoop-4FCFLMDJ.js → runAgentClientLoop-SJREK2B7.js} +107 -86
  215. package/{runtimeDoctorCommands-CXOCVDPU.js → runtimeDoctorCommands-XQD4MN4I.js} +19 -19
  216. package/{secretCommands-GGUAWAE7.js → secretCommands-LH7QTJO2.js} +3 -3
  217. package/{setDialogExtraReferencesAction-YXQTGXIN.js → setDialogExtraReferencesAction-JSTQJPXL.js} +19 -18
  218. package/{setPrimaryDialogAgentAction-YNLB66WE.js → setPrimaryDialogAgentAction-Z2BQE3IY.js} +23 -22
  219. package/{settingThunks-E6N7RSSS.js → settingThunks-C2YWCNYI.js} +186 -67
  220. package/{skillDiscovery-B5V23AXP.js → skillDiscovery-MDDKPTW3.js} +4 -3
  221. package/{spaceCommands-DB5DKC2J.js → spaceCommands-YRBQ52PG.js} +71 -62
  222. package/{store-JRVN62NM.js → store-Z53ICFL3.js} +3 -1
  223. package/{streamAgentChatTurn-FCBGMD4D.js → streamAgentChatTurn-NCA4BKDZ.js} +244 -185
  224. package/{switchDialogAgentAction-LAHLUECU.js → switchDialogAgentAction-G7XVAOGH.js} +20 -19
  225. package/{tableCommands-VNSXHAMG.js → tableCommands-UHEA5QNL.js} +14 -11
  226. package/{toolApiClient-OGQEBQVX.js → toolApiClient-N5PYW2R3.js} +8 -6
  227. package/{tools-6JD36D6K.js → tools-6WQVUGKV.js} +74 -70
  228. package/tuiRestart-3J7LRMPR.js +41 -0
  229. package/{tuiSummaryLlmCaller-UHZIPGAX.js → tuiSummaryLlmCaller-2J6NG53N.js} +24 -23
  230. package/{updateCommands-KZ54HCU5.js → updateCommands-5OYND6EF.js} +8 -6
  231. package/{updateDialogTitleAction-RV3EUEN3.js → updateDialogTitleAction-QCSN3RYO.js} +46 -43
  232. package/{usageCommand-KFVV6UL3.js → usageCommand-SK7JTEPC.js} +3 -3
  233. package/{usageRebuildCommand-HHFSNK46.js → usageRebuildCommand-DF3HUP6F.js} +4 -4
  234. package/webapi-QVV65DQF.js +2487 -0
  235. package/{windowsSelfUpdate-KERHIAB4.js → windowsSelfUpdate-HIYNL3VR.js} +2 -2
  236. package/workContext-Y3ADAPZU.js +14 -0
  237. package/workContextAccess-UZHDLBUR.js +11 -0
  238. package/workContextWriteNotice-YCSSMHN4.js +7 -0
  239. package/{workloadLifecycle-O2I3NZ2Q.js → workloadLifecycle-ZCSQCHG3.js} +9 -9
  240. package/agentListCommands-C65UESYM.js +0 -1004
  241. package/agentRecordCommands-6RCJS2EY.js +0 -176
  242. package/agentRunCommand-P3GRKXKS.js +0 -208
  243. package/chunk-2WZXXAQD.js +0 -57
  244. package/chunk-5ZMIIR23.js +0 -265
  245. package/chunk-62HXNQVV.js +0 -134
  246. package/chunk-BJF2MHJ3.js +0 -118
  247. package/chunk-KEPOVMF4.js +0 -91
  248. package/chunk-PXKF5CV4.js +0 -357
  249. package/chunk-WACI5I6V.js +0 -147
  250. package/chunk-YGILMZ7N.js +0 -81
  251. package/cliLocalAgentRecordReader-SPKAJYME.js +0 -90
  252. package/machineWsRunDispatch-BUUJRUUB.js +0 -191
  253. package/{accountResolver-EK2S4PWF.js → accountResolver-QETKNC7T.js} +4 -4
  254. package/{chunk-VXL2FZTP.js → chunk-HXER7YJF.js} +3 -3
  255. package/{chunk-BLVSFYQ3.js → chunk-LISC7BD4.js} +3 -3
  256. package/{chunk-SSGTV4FC.js → chunk-USGHJSGO.js} +5 -5
  257. package/{chunk-FJ23FZXF.js → chunk-VIYVRPMJ.js} +0 -0
  258. package/{offlineMarxistsAgentCommand-AGA2X5E4.js → offlineMarxistsAgentCommand-XVXUE6G5.js} +5 -5
@@ -7,8 +7,9 @@ import {
7
7
  import {
8
8
  createCliAuthorityBrokerClient,
9
9
  createCliAuthorityBrokerSocketInvoker,
10
+ isCliAuthorityBrokerTimeoutError,
10
11
  isCliAuthorityBrokerUnavailableError
11
- } from "./chunk-5ZMIIR23.js";
12
+ } from "./chunk-KK3FCYZM.js";
12
13
  import {
13
14
  resolveCliAuthorityBrokerEndpoint,
14
15
  resolveCliAuthorityBrokerHealthPath,
@@ -23,6 +24,7 @@ import {
23
24
 
24
25
  // packages/cli/localRuntimeAuthority.ts
25
26
  import fs4 from "node:fs";
27
+ import { randomUUID } from "node:crypto";
26
28
  import path4 from "node:path";
27
29
 
28
30
  // packages/database-engine/cliAuthorityBrokerServer.ts
@@ -207,6 +209,7 @@ function acquireLevelDbOwnershipLock(dbPath) {
207
209
  var brokerRegistry = /* @__PURE__ */ new Map();
208
210
  var databaseOwners = /* @__PURE__ */ new Map();
209
211
  var DEFAULT_ITERATOR_LIMIT = 200;
212
+ var MAX_BROKER_FRAME_CHARS = 64 * 1024 * 1024;
210
213
  function resolveBrokerListenTarget(endpoint) {
211
214
  if (endpoint.startsWith("unix://")) {
212
215
  return { kind: "unix", path: endpoint.slice("unix://".length) };
@@ -249,18 +252,47 @@ function removeFileIfPresent(filePath) {
249
252
  }
250
253
  }
251
254
  async function buildIteratorPage(store, request) {
252
- const rows = [];
253
- for await (const entry of store.iterator(request.options ?? {})) {
254
- rows.push(entry);
255
+ const base = request.options ?? {};
256
+ const reverse = base.reverse === true;
257
+ const cursor = typeof request.cursor === "string" && request.cursor.length > 0 ? request.cursor : void 0;
258
+ const iterOptions = { ...base };
259
+ if (cursor) {
260
+ if (reverse) {
261
+ if (iterOptions.lte !== void 0 && iterOptions.lte < cursor) {
262
+ } else {
263
+ delete iterOptions.lte;
264
+ iterOptions.lt = iterOptions.lt !== void 0 && iterOptions.lt < cursor ? iterOptions.lt : cursor;
265
+ }
266
+ } else {
267
+ if (iterOptions.gte !== void 0 && iterOptions.gte > cursor) {
268
+ } else {
269
+ delete iterOptions.gte;
270
+ iterOptions.gt = iterOptions.gt !== void 0 && iterOptions.gt > cursor ? iterOptions.gt : cursor;
271
+ }
272
+ }
273
+ }
274
+ const limit = Math.max(0, Math.floor(request.limit ?? DEFAULT_ITERATOR_LIMIT));
275
+ const entries = [];
276
+ let hasMore = false;
277
+ for await (const entry of store.iterator(iterOptions)) {
278
+ const [key] = entry;
279
+ if (cursor && (reverse ? key >= cursor : key <= cursor)) {
280
+ continue;
281
+ }
282
+ if (base.gt !== void 0 && key <= base.gt) {
283
+ continue;
284
+ }
285
+ if (entries.length >= limit) {
286
+ hasMore = true;
287
+ break;
288
+ }
289
+ entries.push(entry);
255
290
  }
256
- const startIndex = request.cursor ? rows.findIndex(([key]) => key === request.cursor) + 1 : 0;
257
- const limit = request.limit ?? DEFAULT_ITERATOR_LIMIT;
258
- const entries = rows.slice(startIndex, startIndex + limit);
259
291
  const lastEntry = entries.at(-1) ?? null;
260
292
  return {
261
293
  entries,
262
294
  nextCursor: lastEntry ? lastEntry[0] : null,
263
- done: startIndex + entries.length >= rows.length
295
+ done: !hasMore
264
296
  };
265
297
  }
266
298
  function createErrorResponse(error) {
@@ -282,9 +314,53 @@ function createErrorResponse(error) {
282
314
  }
283
315
  };
284
316
  }
285
- async function dispatchCliAuthorityBrokerRequest(store, request) {
317
+ var ownerQueues = /* @__PURE__ */ new WeakMap();
318
+ function ownerQueue(store) {
319
+ let state = ownerQueues.get(store);
320
+ if (!state) {
321
+ state = { tail: Promise.resolve(), active: /* @__PURE__ */ new Set(), closed: false };
322
+ ownerQueues.set(store, state);
323
+ }
324
+ return state;
325
+ }
326
+ function validConditionalPut(request) {
327
+ const expected = request.expectedRevision;
328
+ const value = request.value;
329
+ return Object.keys(request).length === 4 && Object.keys(request).every((key) => ["type", "key", "expectedRevision", "value"].includes(key)) && typeof request.key === "string" && request.key.length > 0 && (expected === null || Number.isSafeInteger(expected) && expected >= 0 && expected < Number.MAX_SAFE_INTEGER) && typeof value === "object" && value !== null && !Array.isArray(value) && Object.hasOwn(value, "revision") && value.revision === (expected === null ? 1 : expected + 1);
330
+ }
331
+ function dispatchCliAuthorityBrokerRequest(store, request) {
332
+ const state = ownerQueue(store);
333
+ if (state.closed) return Promise.resolve({ ok: false, error: { code: "BROKER_CLOSING", message: "Authority broker is closing" } });
334
+ const isRead = request?.type === "get" || request?.type === "batchGet" || request?.type === "status" || request?.type === "iterator" || request?.type === "close";
335
+ const execute = () => executeCliAuthorityBrokerRequest(store, request);
336
+ const result = isRead ? Promise.resolve().then(execute) : state.tail.then(execute);
337
+ if (!isRead) state.tail = result.catch(() => void 0);
338
+ const settled = result.then(() => void 0, () => void 0);
339
+ state.active.add(settled);
340
+ void settled.then(() => state.active.delete(settled));
341
+ return result;
342
+ }
343
+ async function executeCliAuthorityBrokerRequest(store, request) {
286
344
  try {
345
+ if (!request || typeof request !== "object") {
346
+ return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: "Invalid broker request" } };
347
+ }
287
348
  switch (request.type) {
349
+ case "conditionalPut": {
350
+ if (!validConditionalPut(request)) {
351
+ return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: "Invalid conditionalPut request" } };
352
+ }
353
+ let current;
354
+ try {
355
+ current = await store.get(request.key);
356
+ } catch (error) {
357
+ if (error?.code !== "LEVEL_NOT_FOUND") throw error;
358
+ }
359
+ const matches = request.expectedRevision === null ? current === void 0 : typeof current === "object" && current !== null && !Array.isArray(current) && Object.hasOwn(current, "revision") && current.revision === request.expectedRevision;
360
+ if (!matches) return { ok: true, result: { type: "conditionalPut", status: "conflict" } };
361
+ await store.put(request.key, request.value);
362
+ return { ok: true, result: { type: "conditionalPut", status: "updated" } };
363
+ }
288
364
  case "status":
289
365
  return { ok: true, result: { type: "status" } };
290
366
  case "open":
@@ -294,6 +370,25 @@ async function dispatchCliAuthorityBrokerRequest(store, request) {
294
370
  return { ok: true, result: { type: "close" } };
295
371
  case "get":
296
372
  return { ok: true, result: { type: "get", value: await store.get(request.key) } };
373
+ case "batchGet": {
374
+ if (!Array.isArray(request.keys) || !request.keys.every((key) => typeof key === "string")) {
375
+ return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: "Invalid batchGet request" } };
376
+ }
377
+ const items = await Promise.all(
378
+ request.keys.map(async (key) => {
379
+ try {
380
+ return { ok: true, value: await store.get(key) };
381
+ } catch (error) {
382
+ const errRes = createErrorResponse(error);
383
+ return {
384
+ ok: false,
385
+ error: errRes.ok ? { code: "BROKER_INTERNAL_ERROR", message: "Unknown error" } : errRes.error
386
+ };
387
+ }
388
+ })
389
+ );
390
+ return { ok: true, result: { type: "batchGet", items } };
391
+ }
297
392
  case "put":
298
393
  await store.put(request.key, request.value);
299
394
  return { ok: true, result: { type: "put" } };
@@ -311,8 +406,13 @@ async function dispatchCliAuthorityBrokerRequest(store, request) {
311
406
  page: await buildIteratorPage(store, request)
312
407
  }
313
408
  };
409
+ default:
410
+ return { ok: false, error: { code: "BROKER_UNSUPPORTED_REQUEST", message: "Unsupported broker request" } };
314
411
  }
315
412
  } catch (error) {
413
+ if (request?.type === "conditionalPut") {
414
+ return { ok: false, error: { code: "BROKER_CONDITIONAL_WRITE_FAILED", message: "Conditional write failed" } };
415
+ }
316
416
  return createErrorResponse(error);
317
417
  }
318
418
  }
@@ -378,7 +478,7 @@ async function createBrokerHandle(options) {
378
478
  });
379
479
  return;
380
480
  }
381
- bindSocketRequestHandler({ socket, store });
481
+ bindSocketRequestHandler({ socket, store, maxFrameChars: options.maxFrameChars });
382
482
  });
383
483
  let storeReady = false;
384
484
  try {
@@ -421,13 +521,27 @@ async function createBrokerHandle(options) {
421
521
  return {
422
522
  endpoint: options.endpoint,
423
523
  listeningEndpoint,
424
- authorityStore: readyStore,
524
+ authorityStore: {
525
+ ...createCliAuthorityBrokerClient({
526
+ endpoint: listeningEndpoint,
527
+ invoke: (request) => dispatchCliAuthorityBrokerRequest(readyStore, request)
528
+ }),
529
+ get location() {
530
+ return readyStore.location;
531
+ },
532
+ get status() {
533
+ return readyStore.status;
534
+ }
535
+ },
425
536
  request(request) {
426
537
  return dispatchCliAuthorityBrokerRequest(readyStore, request);
427
538
  },
428
539
  async close() {
429
540
  closing ??= (async () => {
430
541
  storeReady = false;
542
+ const queue = ownerQueue(readyStore);
543
+ queue.closed = true;
544
+ await Promise.all(queue.active);
431
545
  for (const socket of sockets) socket.destroy();
432
546
  if (server.listening) {
433
547
  await new Promise((resolve, reject) => {
@@ -465,25 +579,159 @@ async function createBrokerHandle(options) {
465
579
  throw error;
466
580
  }
467
581
  }
582
+ function isMultiplexedEnvelope(value) {
583
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
584
+ const record = value;
585
+ return (typeof record.id === "number" || typeof record.id === "string") && "request" in record && typeof record.request === "object" && record.request !== null && !("type" in record);
586
+ }
587
+ function firstNonWhitespaceChar(text) {
588
+ for (let i = 0; i < text.length; i += 1) {
589
+ const ch = text[i];
590
+ if (ch === " " || ch === " " || ch === "\r" || ch === "\n") {
591
+ continue;
592
+ }
593
+ return ch;
594
+ }
595
+ return void 0;
596
+ }
468
597
  function bindSocketRequestHandler(args) {
598
+ const maxFrameChars = args.maxFrameChars ?? MAX_BROKER_FRAME_CHARS;
469
599
  let buffer = "";
600
+ let inFlight = 0;
601
+ let clientEnded = false;
602
+ let sawLegacyBareRequest = false;
603
+ let protocolRejected = false;
604
+ let currentFrameVerifiedObjectStart = false;
470
605
  args.socket.setEncoding("utf8");
471
- args.socket.on("data", async (chunk) => {
472
- buffer += chunk;
473
- if (!buffer.includes("\n")) return;
474
- const [rawRequest] = buffer.split("\n");
606
+ args.socket.setNoDelay?.(true);
607
+ const maybeFinishHalfOpen = () => {
608
+ if (clientEnded && inFlight === 0 && !args.socket.destroyed) {
609
+ args.socket.end();
610
+ }
611
+ };
612
+ const rejectAndDestroy = () => {
613
+ protocolRejected = true;
475
614
  buffer = "";
615
+ currentFrameVerifiedObjectStart = false;
616
+ if (!args.socket.destroyed) {
617
+ args.socket.destroy();
618
+ }
619
+ };
620
+ const handleParsedPayload = async (parsed) => {
621
+ inFlight += 1;
622
+ args.socket.ref?.();
623
+ if (isMultiplexedEnvelope(parsed)) {
624
+ let response2;
625
+ try {
626
+ response2 = await dispatchCliAuthorityBrokerRequest(args.store, parsed.request);
627
+ } catch (error) {
628
+ response2 = createErrorResponse(error);
629
+ }
630
+ inFlight -= 1;
631
+ if (!args.socket.destroyed && args.socket.writable) {
632
+ args.socket.write(`${JSON.stringify({ id: parsed.id, response: response2 })}
633
+ `);
634
+ }
635
+ if (inFlight === 0 && !clientEnded) {
636
+ args.socket.unref?.();
637
+ }
638
+ maybeFinishHalfOpen();
639
+ return;
640
+ }
476
641
  let response;
477
642
  try {
478
643
  response = await dispatchCliAuthorityBrokerRequest(
479
644
  args.store,
480
- JSON.parse(rawRequest)
645
+ parsed
481
646
  );
482
647
  } catch (error) {
483
648
  response = createErrorResponse(error);
484
649
  }
485
- args.socket.end(`${JSON.stringify(response)}
650
+ inFlight -= 1;
651
+ if (!args.socket.destroyed && args.socket.writable) {
652
+ args.socket.end(`${JSON.stringify(response)}
486
653
  `);
654
+ }
655
+ };
656
+ args.socket.on("data", (chunk) => {
657
+ if (protocolRejected || sawLegacyBareRequest) return;
658
+ const textChunk = typeof chunk === "string" ? chunk : chunk.toString("utf8");
659
+ if (!currentFrameVerifiedObjectStart) {
660
+ const firstChar = firstNonWhitespaceChar(textChunk);
661
+ if (firstChar !== void 0) {
662
+ if (firstChar !== "{") {
663
+ rejectAndDestroy();
664
+ return;
665
+ }
666
+ currentFrameVerifiedObjectStart = true;
667
+ }
668
+ }
669
+ buffer += textChunk;
670
+ let newlineIndex;
671
+ while ((newlineIndex = buffer.indexOf("\n")) !== -1) {
672
+ if (newlineIndex > maxFrameChars) {
673
+ rejectAndDestroy();
674
+ break;
675
+ }
676
+ const rawLine = buffer.slice(0, newlineIndex).trim();
677
+ buffer = buffer.slice(newlineIndex + 1);
678
+ currentFrameVerifiedObjectStart = false;
679
+ if (!rawLine) continue;
680
+ if (rawLine[0] !== "{") {
681
+ rejectAndDestroy();
682
+ break;
683
+ }
684
+ let parsed;
685
+ try {
686
+ parsed = JSON.parse(rawLine);
687
+ } catch (error) {
688
+ protocolRejected = true;
689
+ buffer = "";
690
+ args.socket.pause?.();
691
+ if (!args.socket.destroyed && args.socket.writable) {
692
+ args.socket.end(`${JSON.stringify(createErrorResponse(error))}
693
+ `, () => {
694
+ if (!args.socket.destroyed) args.socket.destroy();
695
+ });
696
+ } else if (!args.socket.destroyed) {
697
+ args.socket.destroy();
698
+ }
699
+ break;
700
+ }
701
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
702
+ rejectAndDestroy();
703
+ break;
704
+ }
705
+ if (!isMultiplexedEnvelope(parsed)) {
706
+ sawLegacyBareRequest = true;
707
+ }
708
+ void handleParsedPayload(parsed);
709
+ if (sawLegacyBareRequest) break;
710
+ }
711
+ if (!protocolRejected && !sawLegacyBareRequest) {
712
+ if (buffer.length > maxFrameChars) {
713
+ rejectAndDestroy();
714
+ return;
715
+ }
716
+ if (!currentFrameVerifiedObjectStart && buffer.length > 0) {
717
+ const remainingFirstChar = firstNonWhitespaceChar(buffer);
718
+ if (remainingFirstChar !== void 0) {
719
+ if (remainingFirstChar !== "{") {
720
+ rejectAndDestroy();
721
+ return;
722
+ }
723
+ currentFrameVerifiedObjectStart = true;
724
+ }
725
+ }
726
+ }
727
+ });
728
+ args.socket.on("end", () => {
729
+ if (protocolRejected) {
730
+ if (!args.socket.destroyed) args.socket.destroy();
731
+ return;
732
+ }
733
+ clientEnded = true;
734
+ maybeFinishHalfOpen();
487
735
  });
488
736
  }
489
737
  function canonicalDatabasePath(dbPath) {
@@ -573,6 +821,24 @@ function resolveCliLocalRuntimeDbPath(options = {}) {
573
821
  "leveldb"
574
822
  );
575
823
  }
824
+ var DEFAULT_ATTACH_BACKOFF_MS = [100, 200, 400, 800];
825
+ var DEFAULT_ATTACH_RETRY_BUDGET_MS = 9e3;
826
+ function findOwnerPid(error) {
827
+ const seen = /* @__PURE__ */ new Set();
828
+ let current = error;
829
+ while (current && typeof current === "object" && !seen.has(current)) {
830
+ seen.add(current);
831
+ const pid = current.ownerPid;
832
+ if (typeof pid === "number" && Number.isInteger(pid) && pid > 0) {
833
+ return pid;
834
+ }
835
+ current = current.cause;
836
+ }
837
+ return void 0;
838
+ }
839
+ function isTransientBrokerOpenError(error) {
840
+ return isCliAuthorityBrokerUnavailableError(error) || isCliAuthorityBrokerTimeoutError(error);
841
+ }
576
842
  var defaultCliAuthorityBrokerConnectDeps = {
577
843
  createClient: (options) => createCliAuthorityBrokerClient(options),
578
844
  startBroker: (options) => getOrCreateCliAuthorityBrokerServer(options),
@@ -589,14 +855,32 @@ async function connectCliAuthorityBroker(args) {
589
855
  endpoint: args.endpoint,
590
856
  invoke: createCliAuthorityBrokerSocketInvoker({ endpoint: args.endpoint })
591
857
  });
858
+ const backoffSchedule = deps.attachBackoffMs?.length ? deps.attachBackoffMs : DEFAULT_ATTACH_BACKOFF_MS;
859
+ const retryBudgetMs = deps.attachRetryBudgetMs ?? DEFAULT_ATTACH_RETRY_BUDGET_MS;
860
+ let waitedMs = 0;
861
+ let backoffStep = 0;
862
+ let lastAttachError;
863
+ const waitBackoff = async () => {
864
+ if (waitedMs >= retryBudgetMs) return false;
865
+ const delay = backoffSchedule[Math.min(backoffStep, backoffSchedule.length - 1)];
866
+ if (waitedMs > 0 && waitedMs + delay > retryBudgetMs) return false;
867
+ backoffStep += 1;
868
+ const startedAt = Date.now();
869
+ await deps.sleep(delay);
870
+ waitedMs += Math.max(delay, Date.now() - startedAt);
871
+ return true;
872
+ };
592
873
  async function attachToExistingBroker(attempts) {
593
874
  for (let attempt = 0; attempt < attempts; attempt += 1) {
594
- await deps.sleep(100);
875
+ if (!await waitBackoff()) return false;
876
+ const probeStartedAt = Date.now();
595
877
  try {
596
878
  await client2.open();
597
879
  return true;
598
880
  } catch (error) {
599
- if (!isCliAuthorityBrokerUnavailableError(error)) throw error;
881
+ waitedMs += Date.now() - probeStartedAt;
882
+ if (!isTransientBrokerOpenError(error)) throw error;
883
+ lastAttachError = error;
600
884
  }
601
885
  }
602
886
  return false;
@@ -606,7 +890,8 @@ async function connectCliAuthorityBroker(args) {
606
890
  await client2.open();
607
891
  return client2;
608
892
  } catch (error) {
609
- if (!isCliAuthorityBrokerUnavailableError(error)) throw error;
893
+ if (!isTransientBrokerOpenError(error)) throw error;
894
+ lastAttachError = error;
610
895
  }
611
896
  }
612
897
  try {
@@ -625,8 +910,7 @@ async function connectCliAuthorityBroker(args) {
625
910
  return client2;
626
911
  }
627
912
  let lastError = error;
628
- for (let attempt = 0; attempt < 5; attempt += 1) {
629
- await deps.sleep(100);
913
+ while (await waitBackoff()) {
630
914
  try {
631
915
  await deps.startBroker({
632
916
  endpoint: args.endpoint,
@@ -645,15 +929,30 @@ async function connectCliAuthorityBroker(args) {
645
929
  }
646
930
  continue;
647
931
  }
648
- if (isCliAuthorityBrokerUnavailableError(retryError)) {
932
+ if (isTransientBrokerOpenError(retryError)) {
933
+ lastAttachError = retryError;
649
934
  continue;
650
935
  }
651
936
  throwCliAuthorityStartupError(retryError);
652
937
  }
653
938
  }
654
939
  const lastMessage = toErrorMessage(lastError);
940
+ const attachMessage = lastAttachError ? toErrorMessage(lastAttachError) : "";
655
941
  const portInUse = lastError !== null && typeof lastError === "object" && "code" in lastError && lastError.code === "EADDRINUSE" || /EADDRINUSE/i.test(lastMessage);
656
- const detail = portInUse ? `: EADDRINUSE (${lastMessage}). The broker endpoint is already in use; check the process using it or set NOLO_CLI_AUTHORITY_BROKER_PORT to a free port for all local CLI processes` : "";
942
+ const ownerPid = findOwnerPid(lastError);
943
+ let detail = "";
944
+ if (portInUse) {
945
+ detail = `: EADDRINUSE (${lastMessage}). The broker endpoint is already in use; check the process using it or set NOLO_CLI_AUTHORITY_BROKER_PORT to a free port for all local CLI processes`;
946
+ } else {
947
+ const parts = [
948
+ ownerPid !== void 0 ? `ownerPid=${ownerPid}` : void 0,
949
+ lastMessage || void 0,
950
+ attachMessage && attachMessage !== lastMessage ? `attach=${attachMessage}` : void 0
951
+ ].filter(Boolean);
952
+ if (parts.length > 0) {
953
+ detail = `: ${parts.join("; ")}`;
954
+ }
955
+ }
657
956
  throw new Error(`CLI authority broker could not attach or take ownership for ${args.endpoint}${detail}`, {
658
957
  cause: lastError
659
958
  });
@@ -689,6 +988,12 @@ async function connectCliAuthorityBroker(args) {
689
988
  open: () => runWithSelfHealing((activeClient) => activeClient.open()),
690
989
  close: () => runWithSelfHealing((activeClient) => activeClient.close()),
691
990
  get: (key) => runWithSelfHealing((activeClient) => activeClient.get(key)),
991
+ conditionalPut: (key, expectedRevision, value) => runWithSelfHealing((activeClient) => {
992
+ if (!activeClient.conditionalPut) {
993
+ throw new Error("CLI authority broker does not support conditionalPut");
994
+ }
995
+ return activeClient.conditionalPut(key, expectedRevision, value);
996
+ }),
692
997
  put: (key, value) => runWithSelfHealing((activeClient) => activeClient.put(key, value)),
693
998
  del: (key) => runWithSelfHealing((activeClient) => activeClient.del(key)),
694
999
  batchWrite: (ops) => runWithSelfHealing((activeClient) => activeClient.batchWrite(ops)),
@@ -787,9 +1092,29 @@ async function getDefaultCliLocalRuntimeDb(options = {}) {
787
1092
  const authorityStore = await getDefaultCliLocalRuntimeAuthority(options);
788
1093
  return createLegacyServerDb(authorityStore);
789
1094
  }
1095
+ function createCliLocalMcpConnectionRevisionWriter(authority, authenticatedUserId) {
1096
+ if (!authenticatedUserId) throw new Error("Local MCP connection owner is required");
1097
+ const prefix = `mcp-private:v1:${encodeURIComponent(authenticatedUserId)}:connection:`;
1098
+ const conditionalPut = authority.conditionalPut?.bind(authority);
1099
+ if (!conditionalPut) throw new Error("CLI authority broker does not support conditionalPut");
1100
+ return {
1101
+ async create(value) {
1102
+ const id = randomUUID();
1103
+ const result = await conditionalPut(prefix + id, null, { ...value, revision: 1 });
1104
+ return { id, ...result };
1105
+ },
1106
+ async update(id, expectedRevision, value) {
1107
+ if (!/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(id) || !Number.isSafeInteger(expectedRevision) || expectedRevision < 1 || expectedRevision >= Number.MAX_SAFE_INTEGER) {
1108
+ throw new Error("Invalid local MCP connection identity or revision");
1109
+ }
1110
+ return conditionalPut(prefix + id, expectedRevision, { ...value, revision: expectedRevision + 1 });
1111
+ }
1112
+ };
1113
+ }
790
1114
 
791
1115
  export {
792
1116
  connectCliAuthorityBroker,
793
1117
  getDefaultCliLocalRuntimeAuthority,
794
- getDefaultCliLocalRuntimeDb
1118
+ getDefaultCliLocalRuntimeDb,
1119
+ createCliLocalMcpConnectionRevisionWriter
795
1120
  };
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  fetchReferenceContents,
3
3
  resolveReferenceAssets
4
- } from "./chunk-ZI5SZ3MV.js";
4
+ } from "./chunk-L6BLA6BT.js";
5
5
  import {
6
6
  updateTokensAction
7
- } from "./chunk-PVAWNHP5.js";
7
+ } from "./chunk-ZP26NIZE.js";
8
8
  import {
9
9
  applyUpdateTokensFulfilled
10
- } from "./chunk-S2NTVGA2.js";
10
+ } from "./chunk-U35UUM5K.js";
11
11
  import {
12
12
  extractReasoningFromResponseOutput,
13
13
  extractTextFromResponseOutput,
14
14
  extractToolCallsFromResponseOutput
15
- } from "./chunk-TOKPHZ55.js";
15
+ } from "./chunk-W3HSD32M.js";
16
16
  import {
17
17
  isRecord
18
18
  } from "./chunk-KUG52IAP.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  describeAttachmentForModel
3
- } from "./chunk-YQETUZ5V.js";
3
+ } from "./chunk-LTVEOOZL.js";
4
4
 
5
5
  // packages/ai/attachments/projectUserPart.ts
6
6
  var isRecord = (value) => typeof value === "object" && value !== null;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getRuntimeServerContext,
3
3
  scheduleDeleteReplication
4
- } from "./chunk-CSW7IPVD.js";
4
+ } from "./chunk-FMYNIAI6.js";
5
5
  import {
6
6
  fetchFromClientDb
7
- } from "./chunk-AGP3YSEC.js";
7
+ } from "./chunk-5PASH2MB.js";
8
8
  import {
9
9
  selectIdentityToken
10
10
  } from "./chunk-PXYBUFDB.js";
@@ -0,0 +1,15 @@
1
+ // packages/agent-runtime/staleReplayGuard.ts
2
+ var wrapHistoricalSummaryWithReplayGuard = (summary) => {
3
+ const trimmed = summary.trim();
4
+ if (!trimmed) return "";
5
+ return [
6
+ "\u3010\u5386\u53F2\u53C2\u8003\uFF0C\u975E\u6D3B\u6307\u4EE4\u3011\u4EE5\u4E0B\u4E3A\u51BB\u7ED3\u6458\u8981\uFF1A\u5176\u4E2D\u7684**\u52A8\u4F5C\u6307\u4EE4**\u3001\u53C2\u6570\u4E0E skill \u8C03\u7528\u9ED8\u8BA4\u5DF2\u7ECF\u505A\u8FC7\uFF0C\u4E0D\u8981\u91CD\u653E\uFF08\u91CD\u590D\u5EFA\u5206\u652F/issue/\u4EFB\u52A1\u5C31\u662F\u91CD\u653E\uFF09\u3002",
7
+ "\u4F46**\u7528\u6237\u7684\u76EE\u6807\u4E0E\u610F\u56FE\u4ECD\u7136\u6709\u6548**\uFF1A\u5B83\u89E3\u91CA\u4E86\u8FD9\u6BB5\u5BF9\u8BDD\u4E3A\u4EC0\u4E48\u8981\u505A\u8FD9\u4E9B\u4E8B\uFF1B\u9047\u5230\u76F8\u5173\u8BDD\u9898\u65F6\u5148\u6309\u5B83\u7406\u89E3\u4E0A\u4E0B\u6587\uFF0C\u4E0D\u8981\u5F53\u6210\u5DF2\u8FC7\u671F\u7684\u80CC\u666F\u3002",
8
+ `\u6458\u8981\u4E2D\u6807\u6CE8\u300C\uFF08\u5F85\u9A8C\u8BC1\uFF09\u300D\u7684\u9879\u9700\u590D\u6838\u786E\u8BA4\uFF1B\u672A\u5B8C\u6210\u5F85\u529E\u548C\u300C\u4E0B\u4E00\u6B65\u300D\u9700\u7EE7\u7EED\u63A8\u8FDB\u2014\u2014\u8FD9\u4E9B\u662F\u7EED\u4F5C\u65B9\u5411\uFF0C\u4E0D\u662F\u91CD\u653E\u6307\u4EE4\u3002`,
9
+ trimmed
10
+ ].join("\n");
11
+ };
12
+
13
+ export {
14
+ wrapHistoricalSummaryWithReplayGuard
15
+ };
@@ -27,7 +27,10 @@ var readIndexed = async (db, prefix) => {
27
27
  var putMemoryEntityVNext = async (db, entity) => {
28
28
  await db.put(entityKey(entity.ownerId, entity.id), entity);
29
29
  };
30
- var getMemoryEntityVNext = async (db, ownerId, entityId) => db.get(entityKey(ownerId, entityId)).catch(() => null);
30
+ var getMemoryEntityVNext = async (db, ownerId, entityId) => db.get(entityKey(ownerId, entityId)).catch((error) => {
31
+ if (isLevelNotFoundError(error)) return null;
32
+ throw error;
33
+ });
31
34
  var listMemoryEntitiesVNext = async (db, ownerId) => {
32
35
  const rows = [];
33
36
  for await (const [, value] of db.iterator({
@@ -62,7 +65,10 @@ var putMemoryStateVNext = async (db, state) => {
62
65
  _appendStateBatch(batch, state);
63
66
  await batch.write();
64
67
  };
65
- var getMemoryStateVNext = async (db, ownerId, stateId) => db.get(stateKey(ownerId, stateId)).catch(() => null);
68
+ var getMemoryStateVNext = async (db, ownerId, stateId) => db.get(stateKey(ownerId, stateId)).catch((error) => {
69
+ if (isLevelNotFoundError(error)) return null;
70
+ throw error;
71
+ });
66
72
  var listMemoryStatesForEntityVNext = (db, ownerId, entityId) => readIndexed(db, stateEntityIndexPrefix(ownerId, entityId));
67
73
  var retireMemoryStateVNext = async (db, ownerId, stateId, retiredAt) => {
68
74
  const existing = await getMemoryStateVNext(db, ownerId, stateId);
@@ -129,6 +135,16 @@ var _appendRelationBatch = (batch, relation) => {
129
135
  batch.put(relationFromIndexKey(relation.ownerId, relation.from, relation.id), { key });
130
136
  batch.put(relationToIndexKey(relation.ownerId, relation.to, relation.id), { key });
131
137
  };
138
+ var loadNativeCaptureEvidenceContext = async (db, ownerId, excludeId, limit = 40) => {
139
+ const evidence = [];
140
+ const prefix = `mem2-v-${enc(ownerId)}-`;
141
+ let scanned = 0;
142
+ for await (const [, value] of db.iterator({ ...rangeOf(prefix), reverse: false })) {
143
+ if (++scanned > limit) return { evidence, truncated: true };
144
+ if (value?.nativeCapture && value.id !== excludeId) evidence.push(value);
145
+ }
146
+ return { evidence, truncated: false };
147
+ };
132
148
 
133
149
  export {
134
150
  putMemoryEntityVNext,
@@ -150,5 +166,6 @@ export {
150
166
  _appendEvidenceBatch,
151
167
  _appendStateBatch,
152
168
  _appendRetiredStateBatch,
153
- _appendRelationBatch
169
+ _appendRelationBatch,
170
+ loadNativeCaptureEvidenceContext
154
171
  };