nolo-cli 0.107.0-alpha.4 → 0.107.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 (211) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-UDCSOTD2.js → _executeModel-M573MKVE.js} +78 -70
  3. package/action-GVA5ARSJ.js +20 -0
  4. package/{addContentAction-MB2HHMDZ.js → addContentAction-M2WOWZCL.js} +13 -12
  5. package/{addDialogAgentAction-MCEABSBA.js → addDialogAgentAction-QMAQ5Z6N.js} +19 -20
  6. package/{agentDeleteCommand-OWYHN6D6.js → agentDeleteCommand-ZFHYRHBS.js} +118 -43
  7. package/{agentEmailCommands-AU5I4M4W.js → agentEmailCommands-X6AVPIVQ.js} +100 -90
  8. package/agentListCommands-PAD2CI2I.js +741 -0
  9. package/{agentMachineCommands-YMNME2L6.js → agentMachineCommands-UPH6RJCC.js} +50 -46
  10. package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-CMVTBY5X.js} +97 -2
  11. package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
  12. package/agentRecordCommands-UMACPRAF.js +138 -0
  13. package/agentRunCommand-H6KKHHMU.js +167 -0
  14. package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
  15. package/{agentRuntimeLocal-KCMC2TBD.js → agentRuntimeLocal-N4YGKL7M.js} +44 -40
  16. package/{agentSlice-R7PR6KYM.js → agentSlice-2LPP43XH.js} +15 -14
  17. package/{appDeleteCommands-JEPA3EWE.js → appDeleteCommands-7DAF33AM.js} +46 -42
  18. package/{appDeployCommands-UTB76XFM.js → appDeployCommands-ZPZSMFGZ.js} +46 -42
  19. package/{appDeployStatusCommands-LGHF2SBD.js → appDeployStatusCommands-FWBDSSS5.js} +46 -42
  20. package/{appGetCommands-PX2BFHOB.js → appGetCommands-SZZOHGEP.js} +46 -42
  21. package/{appListCommands-BSMPTWKC.js → appListCommands-FPMUBDPM.js} +46 -42
  22. package/{authCommand-YW42YZA4.js → authCommand-VL3G26NQ.js} +119 -25
  23. package/{authCommands-RGOGCPP6.js → authCommands-5RTUDYZW.js} +7 -5
  24. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-ZK4K67Y5.js} +11 -9
  25. package/{chromeCommands-FZYAU75D.js → chromeCommands-AU5ZJXBG.js} +289 -37
  26. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-ZYTCMNHG.js} +156 -22
  27. package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
  28. package/{chunk-HVURBGF3.js → chunk-2U3NHADM.js} +6 -6
  29. package/{chunk-QTGQ2LTL.js → chunk-3DQY5IFB.js} +6 -10
  30. package/{chunk-XT35TTFG.js → chunk-3IXAHOJS.js} +19 -21
  31. package/{chunk-UVA7OYO3.js → chunk-3W67RV75.js} +29 -9
  32. package/chunk-4LCOCOR5.js +50 -0
  33. package/{chunk-JPGCXHNM.js → chunk-4LKMZ3RR.js} +1 -1
  34. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  35. package/{chunk-6D6VBVEW.js → chunk-4W24JM32.js} +80 -14
  36. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  37. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  38. package/{chunk-C3M4465B.js → chunk-5HYJ3DSZ.js} +404 -659
  39. package/chunk-5MMAK75Q.js +15 -0
  40. package/{chunk-7S4YWN7P.js → chunk-5UUIGN6I.js} +4 -4
  41. package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
  42. package/{chunk-4MK3I7Y4.js → chunk-6MAW4XOF.js} +5 -5
  43. package/{chunk-3UZPUAES.js → chunk-74PPKIY2.js} +1 -1
  44. package/chunk-76HO2DP6.js +15 -0
  45. package/{chunk-ASIFZ2WY.js → chunk-7BBP7ZX3.js} +66 -54
  46. package/{chunk-VLTIYV3X.js → chunk-7I25CBT5.js} +34 -8
  47. package/{chunk-IBOZNTG2.js → chunk-7X5XZ34C.js} +23 -28
  48. package/chunk-AGIM7IMJ.js +147 -0
  49. package/{chunk-5UTFL4QJ.js → chunk-APO5TOXO.js} +1 -1
  50. package/{chunk-EEGDMATE.js → chunk-AZOVPTL6.js} +91 -81
  51. package/{chunk-6OZ36FXI.js → chunk-BIPGGSJS.js} +22 -4
  52. package/{chunk-EYAQT56M.js → chunk-BNQMNUKZ.js} +9 -6
  53. package/{chunk-62CATUYY.js → chunk-CBUMFIFE.js} +834 -962
  54. package/{chunk-OIVSQH2O.js → chunk-CDEEFJXN.js} +308 -11
  55. package/chunk-CHOZJMJS.js +78 -0
  56. package/{chunk-ETI2NYVF.js → chunk-CIP3AAMT.js} +4 -4
  57. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  58. package/{chunk-W7HLWAQ7.js → chunk-DE45KZNH.js} +118 -90
  59. package/{chunk-Q554LLSI.js → chunk-DMXLXZKL.js} +1 -1
  60. package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
  61. package/{chunk-HKNXJGEC.js → chunk-ECFHBYUW.js} +85 -50
  62. package/{chunk-ACTMNVHM.js → chunk-EHSYSKXV.js} +1 -1
  63. package/{chunk-WV42OMV7.js → chunk-ELUDRSRD.js} +8 -8
  64. package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
  65. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  66. package/{chunk-BFDFRLLQ.js → chunk-EZ4VZHAG.js} +5 -5
  67. package/{chunk-GO3Z72MT.js → chunk-FHLMQIU7.js} +65 -95
  68. package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
  69. package/{chunk-SH43IESU.js → chunk-GGC55Q32.js} +199 -29
  70. package/chunk-GMZLP5DV.js +82 -0
  71. package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  72. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  73. package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
  74. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  75. package/{chunk-BNGW5ASC.js → chunk-I2RGRVQ7.js} +22 -2
  76. package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
  77. package/{chunk-QDSINZM3.js → chunk-IXH3HKY2.js} +1 -22
  78. package/{chunk-GQBOR3G6.js → chunk-JBKHQOYK.js} +8 -4
  79. package/{chunk-XD2MJFUG.js → chunk-JEFXP73H.js} +1 -1
  80. package/{chunk-PBA4UJBK.js → chunk-JIXGJTBU.js} +4 -4
  81. package/{chunk-AEOE4Z6Q.js → chunk-K6L5PNXK.js} +39 -15
  82. package/{chunk-Z77CRGTW.js → chunk-KA5O5KQL.js} +1 -1
  83. package/{chunk-GPCZ7UXG.js → chunk-KD6D6BLA.js} +1 -1
  84. package/{chunk-4CR5I7BD.js → chunk-KFWDYYSS.js} +47 -67
  85. package/{chunk-UZGQNTVW.js → chunk-KHKTDMYG.js} +8 -6
  86. package/{chunk-JDPFV2JV.js → chunk-KWUKOQM2.js} +20 -11
  87. package/{chunk-MRIHM22T.js → chunk-LBFL6RZG.js} +58 -9
  88. package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
  89. package/{chunk-DHDMC6FO.js → chunk-LUBFABMJ.js} +15 -14
  90. package/{chunk-NA35QHCF.js → chunk-LVBFKW65.js} +1 -1
  91. package/chunk-LWLNLZC5.js +265 -0
  92. package/chunk-N4NGJDT6.js +929 -0
  93. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  94. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  95. package/chunk-NWENLDMM.js +42 -0
  96. package/chunk-O7SVKKLY.js +875 -0
  97. package/chunk-OCZKATRC.js +129 -0
  98. package/{chunk-6Z7MY3V7.js → chunk-OEJLGVBL.js} +5 -5
  99. package/{chunk-VMFTFOWF.js → chunk-OKGVNZTL.js} +35 -8
  100. package/{chunk-GEPUP7OO.js → chunk-OR2UWD6X.js} +3 -3
  101. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  102. package/{chunk-J4MOO56S.js → chunk-PNXHPLRU.js} +10 -2
  103. package/{chunk-3BMYXEUW.js → chunk-R5AJODNI.js} +1 -1
  104. package/{chunk-P5EVSOPA.js → chunk-R6EBQEQE.js} +22 -29
  105. package/chunk-RQ6CTX2E.js +164 -0
  106. package/{chunk-MS7TSPZR.js → chunk-RU36ZYSG.js} +19 -17
  107. package/{chunk-ALXHV7NK.js → chunk-RWXLPUKI.js} +40 -4
  108. package/{chunk-KQ4ONNQD.js → chunk-RXA3HAVW.js} +190 -8
  109. package/{chunk-IIVGDG4I.js → chunk-SJKULPGX.js} +13 -7
  110. package/{chunk-Q67DOFOO.js → chunk-SZC4REES.js} +212 -105
  111. package/{chunk-JRQFUXY7.js → chunk-TBAXFWOS.js} +99 -22
  112. package/{chunk-PQFHGD77.js → chunk-TBM2RS3U.js} +161 -14
  113. package/{chunk-NOF3HDSN.js → chunk-TFOIJFCM.js} +11 -9
  114. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  115. package/chunk-TY3TIUJK.js +89 -0
  116. package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
  117. package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
  118. package/chunk-UM7TA3K4.js +1008 -0
  119. package/{chunk-6YTOJY35.js → chunk-VBG7GWWR.js} +253 -8
  120. package/{chunk-GL3EHUR4.js → chunk-VHGYUYQ3.js} +69 -47
  121. package/chunk-VIWDGTDA.js +8 -0
  122. package/chunk-VJVNU77E.js +83 -0
  123. package/chunk-VM6IE2GN.js +8004 -0
  124. package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
  125. package/chunk-VZLO4XJD.js +17 -0
  126. package/chunk-W32HPLTL.js +13692 -0
  127. package/{chunk-AHAHBQMU.js → chunk-WDLSZMTA.js} +2 -2
  128. package/{chunk-53HEEOTT.js → chunk-WF5X57VW.js} +83 -16
  129. package/{chunk-VRTTFDBM.js → chunk-WPHY3VPF.js} +35 -22
  130. package/{chunk-3L2WKC3W.js → chunk-XPWGOTBQ.js} +8 -1
  131. package/chunk-YV25TM3R.js +780 -0
  132. package/chunk-ZRAU6T47.js +56 -0
  133. package/{chunk-IBOOZVVD.js → chunk-ZTKZZY2A.js} +851 -279
  134. package/commandRegistry-ASW6IVZ3.js +833 -0
  135. package/{contentThunks-IV2T3EJC.js → contentThunks-4XNVOIR7.js} +39 -36
  136. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  137. package/{createAgentAutomationAction-JCOIEYY4.js → createAgentAutomationAction-NHHTCJMC.js} +40 -37
  138. package/createDialogAction-XEBTHDB3.js +70 -0
  139. package/{createPageAction-D2VOOLP3.js → createPageAction-VR3WW2AQ.js} +47 -43
  140. package/{chunk-FG3HKPQP.js → cursorProvider-YGGNMVWX.js} +2751 -10185
  141. package/{dbSlice-A6C6H32X.js → dbSlice-TG4MZ5EB.js} +12 -11
  142. package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
  143. package/{dialogCommands-H7FPUYUQ.js → dialogCommands-FJWQG3MX.js} +50 -47
  144. package/{dialogSlice-6JZOOTDS.js → dialogSlice-GVRDGCRG.js} +57 -37
  145. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  146. package/{docCreateCommands-WRG2JLGM.js → docCreateCommands-AZSK4NAG.js} +48 -44
  147. package/{docDeleteCommands-SHWJIBJS.js → docDeleteCommands-DDJMSMFZ.js} +49 -45
  148. package/{docReadCommands-WJN3WT6O.js → docReadCommands-5F5Q6EBZ.js} +47 -43
  149. package/{docStore-HUPQ2FSS.js → docStore-SUZUUWDI.js} +17 -13
  150. package/{docUpdateCommands-IE32IL6O.js → docUpdateCommands-XPNPVZOC.js} +48 -44
  151. package/{fetchMessages-EIU7UFFK.js → fetchMessages-3PXAHKCR.js} +5 -5
  152. package/{getPricing-LUSEABA6.js → getPricing-DOBBZLOK.js} +4 -4
  153. package/{handleSendMessageAction-DFPMQ7YM.js → handleSendMessageAction-VC6VTFKS.js} +109 -42
  154. package/index.js +87 -884
  155. package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
  156. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-UYCKO7YZ.js} +2 -2
  157. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
  158. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
  159. package/{machineCommands-M2T2I5NF.js → machineCommands-M634V2L3.js} +98 -89
  160. package/machineWsRunDispatch-Z3HUSTFI.js +154 -0
  161. package/{memberThunks-P2ECUJ56.js → memberThunks-5S5D3N4U.js} +20 -18
  162. package/{models-T3SG6MJ5.js → models-PQU25T6Q.js} +2 -2
  163. package/oauthTokenStore-ITEB663N.js +23 -0
  164. package/package.json +1 -1
  165. package/processSpawn-SOAV3FEV.js +11 -0
  166. package/profileConfig-ZGOFORWV.js +43 -0
  167. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-HAQWVAQX.js} +7 -7
  168. package/{providerRegistry-757OWH3O.js → providerRegistry-5FGWB3X5.js} +11 -7
  169. package/{read-COE3ZYR6.js → read-LSYFLSIM.js} +8 -7
  170. package/{readDocTool-5USN4A6V.js → readDocTool-XWRXV3DR.js} +5 -3
  171. package/{readlineWorkspace-XQRDGWRZ.js → readlineWorkspace-J3YD3DNW.js} +2596 -2032
  172. package/{removeDialogAgentAction-J6X5QMTA.js → removeDialogAgentAction-4TEFC3VL.js} +22 -26
  173. package/{runAgentClientLoop-5ZA62FBA.js → runAgentClientLoop-APSMCLAF.js} +79 -72
  174. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
  175. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  176. package/{setDialogExtraReferencesAction-WX5VTY6O.js → setDialogExtraReferencesAction-LSEN44OY.js} +16 -14
  177. package/{setPrimaryDialogAgentAction-FN22THHT.js → setPrimaryDialogAgentAction-SR366X5A.js} +23 -27
  178. package/{chunk-GP5LKBUZ.js → settingThunks-CTVPPGIN.js} +226 -940
  179. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  180. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  181. package/{spaceCommands-5GLCWZPO.js → spaceCommands-3UK63WPE.js} +51 -47
  182. package/{streamAgentChatTurn-6UZJMYRB.js → streamAgentChatTurn-DNY2PSRW.js} +215 -115
  183. package/{switchDialogAgentAction-LVTEV3FR.js → switchDialogAgentAction-M6NAFOOU.js} +19 -20
  184. package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
  185. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-AD7CXTA4.js} +4 -3
  186. package/tools-X5UWATZK.js +117 -0
  187. package/{tuiSummaryLlmCaller-OHHFTHMG.js → tuiSummaryLlmCaller-DEH7ZEM6.js} +25 -23
  188. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  189. package/{updateDialogTitleAction-QTKNIURB.js → updateDialogTitleAction-YSY5BF5A.js} +84 -45
  190. package/action-P4TNFGAD.js +0 -31
  191. package/agentListCommands-B2V4YAC4.js +0 -410
  192. package/agentRecordCommands-G4KK4R7H.js +0 -128
  193. package/agentRunCommand-UTZJA23G.js +0 -156
  194. package/browser-image-compression-MFDTD7K6.js +0 -1763
  195. package/chatQueueReduxAdapter-2P6NFX64.js +0 -186
  196. package/chunk-CQ3WA2NE.js +0 -299
  197. package/chunk-M76ECQRD.js +0 -13658
  198. package/chunk-MEYIRKDN.js +0 -8967
  199. package/chunk-PUOC4YRO.js +0 -394
  200. package/chunk-Q5FJJ6XI.js +0 -103
  201. package/chunk-S7Z2HMCN.js +0 -25
  202. package/chunk-T75QD6AB.js +0 -20923
  203. package/chunk-Y5GCAMGP.js +0 -9
  204. package/chunk-YPREESF4.js +0 -225
  205. package/createDialogAction-NGG7YVNU.js +0 -65
  206. package/machineWsRunDispatch-ISBKOOD7.js +0 -144
  207. package/settingSlice-P4ZW7K5X.js +0 -204
  208. package/syncMapping-N6RGXGBW.js +0 -437
  209. package/tools-KMGFWO43.js +0 -110
  210. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  211. package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
@@ -1,15 +1,15 @@
1
- import {
2
- loadProfileConfig
3
- } from "./chunk-BYMV6QZG.js";
4
- import {
5
- resolveDefaultSpawn
6
- } from "./chunk-X7HHHIOZ.js";
7
1
  import {
8
2
  isCompiledBinary
9
3
  } from "./chunk-A7GB5UGH.js";
10
4
  import {
11
5
  DEFAULT_NOLO_SERVER_URL
12
6
  } from "./chunk-OLZBQWZU.js";
7
+ import {
8
+ loadProfileConfig
9
+ } from "./chunk-TNIX77YM.js";
10
+ import {
11
+ resolveDefaultSpawn
12
+ } from "./chunk-Y6ROFCZO.js";
13
13
  import {
14
14
  normalizeServerOrigin
15
15
  } from "./chunk-CF7PE763.js";
@@ -30,6 +30,7 @@ import {
30
30
  readFileSync,
31
31
  renameSync,
32
32
  rmSync,
33
+ statSync,
33
34
  writeSync,
34
35
  writeFileSync
35
36
  } from "node:fs";
@@ -38,6 +39,7 @@ import { dirname, isAbsolute, join, normalize } from "node:path";
38
39
  import { randomUUID } from "node:crypto";
39
40
  var UPDATE_STATE_FILE = "update-result.json";
40
41
  var UPDATE_STALE_MS = 15 * 60 * 1e3;
42
+ var UPDATE_CORRUPT_MAX_AGE_MS = 30 * 60 * 1e3;
41
43
  var UPDATE_LOCK_FILE = "update.lock";
42
44
  function resolveNoloHome(env, homeDir = homedir()) {
43
45
  return env.NOLO_HOME?.trim() || join(homeDir, ".nolo");
@@ -101,6 +103,39 @@ function readWindowsUpdateState(env = process.env, homeDir = homedir()) {
101
103
  return null;
102
104
  }
103
105
  }
106
+ function assessWindowsUpdatePending(state, now, statePath) {
107
+ const startedAtMs = Date.parse(state.startedAt);
108
+ const MAX_CLOCK_SKEW_MS = 5 * 60 * 1e3;
109
+ if (Number.isFinite(startedAtMs) && startedAtMs - now <= MAX_CLOCK_SKEW_MS) {
110
+ const ageMs = now - startedAtMs;
111
+ const stale = ageMs >= UPDATE_STALE_MS;
112
+ return {
113
+ classification: stale ? "stale" : "active",
114
+ ageMs,
115
+ startedAtUsable: true,
116
+ blocksStartup: !stale
117
+ };
118
+ }
119
+ let mtimeAge = Number.NaN;
120
+ try {
121
+ mtimeAge = now - statSync(statePath).mtimeMs;
122
+ } catch {
123
+ }
124
+ if (!Number.isFinite(mtimeAge) || mtimeAge < UPDATE_CORRUPT_MAX_AGE_MS) {
125
+ return {
126
+ classification: "corrupt-unageable",
127
+ ageMs: mtimeAge,
128
+ startedAtUsable: false,
129
+ blocksStartup: true
130
+ };
131
+ }
132
+ return {
133
+ classification: "stale",
134
+ ageMs: mtimeAge,
135
+ startedAtUsable: false,
136
+ blocksStartup: false
137
+ };
138
+ }
104
139
  function consumeWindowsUpdateStartupNotice(env = process.env, options = {}) {
105
140
  const homeDir = options.homeDir ?? homedir();
106
141
  const statePath = resolveWindowsUpdateStatePath(env, homeDir);
@@ -110,26 +145,35 @@ function consumeWindowsUpdateStartupNotice(env = process.env, options = {}) {
110
145
  if (options.ownerUpdateId && state.updateId && options.ownerUpdateId === state.updateId) {
111
146
  return null;
112
147
  }
113
- const startedAt = Date.parse(state.startedAt);
114
- const age = (options.now ?? Date.now()) - startedAt;
115
- if (!Number.isFinite(age) || age < UPDATE_STALE_MS) {
148
+ const now = options.now ?? Date.now();
149
+ const assessment = assessWindowsUpdatePending(state, now, statePath);
150
+ if (assessment.blocksStartup) {
116
151
  return {
117
152
  blocking: true,
118
- text: `Nolo update is still running. Try again shortly.
153
+ text: `A Nolo update may still be in progress (${describeUpdatePhase(state)}). Run "nolo update status" for details, or retry shortly.
119
154
  Log: ${state.logPath}`
120
155
  };
121
156
  }
122
157
  if (state.lockPath && state.updateId) {
123
158
  removeOwnedLock(state.lockPath, state.updateId);
124
159
  }
125
- rmSync(statePath, { force: true });
126
160
  return {
127
161
  blocking: false,
128
- text: `The previous Nolo update helper stopped unexpectedly. Verify with "nolo -v"; a manual npm repair may be required.
162
+ text: `The previous Nolo update helper stopped unexpectedly and its lock was released. Verify with "nolo -v" / "nolo update status"; a manual npm repair may be required.
129
163
  Log: ${state.logPath}`
130
164
  };
131
165
  }
132
- rmSync(statePath, { force: true });
166
+ if (state.noticeAcknowledgedAt) {
167
+ return null;
168
+ }
169
+ const acknowledged = {
170
+ ...state,
171
+ noticeAcknowledgedAt: (/* @__PURE__ */ new Date()).toISOString()
172
+ };
173
+ try {
174
+ writeJsonAtomic(statePath, acknowledged);
175
+ } catch {
176
+ }
133
177
  if (state.status === "success") {
134
178
  return {
135
179
  blocking: false,
@@ -144,6 +188,82 @@ ${state.message}` : ""}
144
188
  Log: ${state.logPath}`
145
189
  };
146
190
  }
191
+ function describeUpdatePhase(state) {
192
+ if (state.phase) {
193
+ return `phase: ${state.phase}`;
194
+ }
195
+ return "helper running";
196
+ }
197
+ function getWindowsUpdateStatus(env = process.env, options = {}) {
198
+ const homeDir = options.homeDir ?? homedir();
199
+ const state = readWindowsUpdateState(env, homeDir);
200
+ const now = options.now ?? Date.now();
201
+ const version = options.currentVersion ?? "unknown";
202
+ if (!state) {
203
+ return {
204
+ status: "none",
205
+ alive: false,
206
+ text: `No recorded Nolo update.
207
+ Installed version: ${version}`
208
+ };
209
+ }
210
+ const lines = [];
211
+ lines.push(`Update status: ${state.status}`);
212
+ lines.push(`Installed version: ${version}`);
213
+ lines.push(`Channel: ${state.channel}`);
214
+ lines.push(`From version: ${state.currentVersion}`);
215
+ if (state.targetVersion) lines.push(`Target version: ${state.targetVersion}`);
216
+ if (state.phase) lines.push(`Phase: ${state.phase}`);
217
+ lines.push(`Started: ${state.startedAt}`);
218
+ if (state.phaseStartedAt) lines.push(`Phase started: ${state.phaseStartedAt}`);
219
+ if (state.phaseDeadline) lines.push(`Phase deadline: ${state.phaseDeadline}`);
220
+ if (state.finishedAt) lines.push(`Finished: ${state.finishedAt}`);
221
+ if (state.helperPid) lines.push(`Helper pid: ${state.helperPid}`);
222
+ if (state.message) lines.push(`Message: ${state.message}`);
223
+ lines.push(`Log: ${state.logPath}`);
224
+ if (state.status === "pending") {
225
+ const statePath = resolveWindowsUpdateStatePath(env, homeDir);
226
+ const assessment = assessWindowsUpdatePending(state, now, statePath);
227
+ const deadline = state.phaseDeadline ? Date.parse(state.phaseDeadline) : NaN;
228
+ const pastDeadline = Number.isFinite(deadline) && now > deadline;
229
+ if (pastDeadline) {
230
+ lines.push(
231
+ `Phase deadline elapsed: the recorded phase has run past its soft ceiling. This can be a hung helper, but it can also be a slow install \u2014 the lock is NOT auto-released on this evidence alone.`
232
+ );
233
+ }
234
+ switch (assessment.classification) {
235
+ case "active":
236
+ lines.push(
237
+ `Diagnosis: update record is fresh (${describeUpdatePhase(state)}). The helper process has not been verified alive; the record simply has not outlived its bound, so startup is still blocked.`
238
+ );
239
+ break;
240
+ case "corrupt-unageable":
241
+ lines.push(
242
+ `Diagnosis: update record has an unreadable start time and cannot be aged reliably. Startup stays conservatively blocked until the record outlives its hard bound; inspect the log to tell a hung helper from a live one.`
243
+ );
244
+ break;
245
+ case "stale":
246
+ lines.push(
247
+ `Diagnosis: update record has outlived its bound; the helper is presumed stopped. The startup guard releases the stale lock on next start, then this record remains here for diagnosis.`
248
+ );
249
+ break;
250
+ }
251
+ return {
252
+ status: "pending",
253
+ alive: assessment.blocksStartup,
254
+ pendingClassification: assessment.classification,
255
+ text: lines.join("\n")
256
+ };
257
+ }
258
+ if (state.status === "success") {
259
+ lines.push(
260
+ state.noticeAcknowledgedAt ? `Diagnosis: update applied and already acknowledged.` : `Diagnosis: update applied; notice pending on next start.`
261
+ );
262
+ } else {
263
+ lines.push(`Diagnosis: update failed; see the log above.`);
264
+ }
265
+ return { status: state.status, alive: false, text: lines.join("\n") };
266
+ }
147
267
  function defaultLaunchWindowsUpdateHelper(input) {
148
268
  const child = spawn(input.execPath, [input.helperPath, input.payload], {
149
269
  detached: true,
@@ -172,6 +292,19 @@ const writeState = (next) => {
172
292
  writeFileSync(temp, JSON.stringify(next, null, 2) + "\n", "utf8");
173
293
  renameSync(temp, payload.statePath);
174
294
  };
295
+ // Record the current helper step with a bounded wall-clock deadline so the
296
+ // startup guard can tell a live phase from a hung one. Deadline is a soft
297
+ // ceiling: a phase that overruns it is reported stale, not killed.
298
+ const setPhase = (base, phase, budgetMs) => {
299
+ const phaseStartedAt = new Date().toISOString();
300
+ const phaseDeadline = new Date(Date.now() + budgetMs).toISOString();
301
+ try {
302
+ writeState({ ...base, status: "pending", phase, phaseStartedAt, phaseDeadline });
303
+ } catch (error) {
304
+ log("Could not persist phase " + phase + ": " + (error && error.message ? error.message : String(error)));
305
+ }
306
+ return { ...base, status: "pending", phase, phaseStartedAt, phaseDeadline };
307
+ };
175
308
  const runNpm = (args) => {
176
309
  const command = [payload.nodePath, payload.npmCliPath, ...args].join(" ");
177
310
  log("> " + command);
@@ -229,6 +362,27 @@ const isWithin = (root, candidate) => {
229
362
  const quoteCmd = (value) => '"' + String(value).replace(/"/g, '""') + '"';
230
363
  const quotePowerShell = (value) => "'" + String(value).replace(/'/g, "''") + "'";
231
364
  const quoteSh = (value) => "'" + String(value).replace(/'/g, "'\\''") + "'";
365
+
366
+ let stagedDirReferenced = false;
367
+ let lockOwnershipLost = false;
368
+ let shimLeftUnrestored = false;
369
+
370
+ const assertLockOwnership = () => {
371
+ try {
372
+ if (!existsSync(payload.lockPath)) {
373
+ throw new Error("Update lock was released or removed; aborting to avoid racing another process");
374
+ }
375
+ const raw = readFileSync(payload.lockPath, "utf8").trim();
376
+ const owner = raw.startsWith("{") ? JSON.parse(raw).updateId : raw;
377
+ if (owner !== payload.updateId) {
378
+ throw new Error("Update lock was reclaimed by " + owner + "; aborting to avoid racing another updater");
379
+ }
380
+ } catch (e) {
381
+ lockOwnershipLost = true;
382
+ throw new Error("Lock ownership check failed: " + (e && e.message ? e.message : String(e)));
383
+ }
384
+ };
385
+
232
386
  const switchWindowsShims = (shimDir, entrypoint) => {
233
387
  const shims = [
234
388
  { path: join(shimDir, "nolo.cmd"), content: "@ECHO off\r\n" + quoteCmd(payload.nodePath) + " " + quoteCmd(entrypoint) + " %*\r\n" },
@@ -243,14 +397,45 @@ const switchWindowsShims = (shimDir, entrypoint) => {
243
397
  return { ...shim, temp, backup, existed: existsSync(shim.path) };
244
398
  });
245
399
  const activated = [];
400
+ const attemptRollback = () => {
401
+ let allRestored = true;
402
+ for (const shim of [...activated].reverse()) {
403
+ try { rmSync(shim.path, { force: true }); } catch (e) {
404
+ log("CRITICAL: Failed to remove new shim " + shim.path + ": " + (e && e.message ? e.message : String(e)));
405
+ }
406
+ if (shim.existed) {
407
+ try {
408
+ renameSync(shim.backup, shim.path);
409
+ } catch (e) {
410
+ allRestored = false;
411
+ log("CRITICAL: Failed to restore backup shim for " + shim.path + ": " + (e && e.message ? e.message : String(e)));
412
+ }
413
+ } else if (existsSync(shim.path)) {
414
+ // The delete above did not remove this shim (locked file, ACL, ...).
415
+ // It still points at the staged directory, so the rollback is NOT clean.
416
+ allRestored = false;
417
+ log("CRITICAL: New shim still present after rollback attempt: " + shim.path);
418
+ }
419
+ }
420
+ for (const shim of prepared) try { rmSync(shim.temp, { force: true }); } catch {}
421
+ stagedDirReferenced = !allRestored;
422
+ return allRestored;
423
+ };
424
+
246
425
  try {
247
426
  for (const shim of prepared) {
248
427
  if (shim.existed) renameSync(shim.path, shim.backup);
249
428
  try {
250
429
  renameSync(shim.temp, shim.path);
430
+ stagedDirReferenced = true;
251
431
  } catch (error) {
252
432
  if (shim.existed) {
253
- try { renameSync(shim.backup, shim.path); } catch {}
433
+ try {
434
+ renameSync(shim.backup, shim.path);
435
+ } catch (restoreErr) {
436
+ shimLeftUnrestored = true;
437
+ log("CRITICAL: Failed to restore backup shim for " + shim.path + ": " + (restoreErr && restoreErr.message ? restoreErr.message : String(restoreErr)));
438
+ }
254
439
  }
255
440
  throw error;
256
441
  }
@@ -258,22 +443,19 @@ const switchWindowsShims = (shimDir, entrypoint) => {
258
443
  activated.push(shim);
259
444
  }
260
445
  } catch (error) {
261
- for (const shim of [...activated].reverse()) {
262
- try { rmSync(shim.path, { force: true }); } catch {}
263
- if (shim.existed) {
264
- try { renameSync(shim.backup, shim.path); } catch {}
446
+ if (!attemptRollback() || shimLeftUnrestored) {
447
+ if (error && typeof error === "object") {
448
+ error.message = (error.message ? error.message : String(error)) + "; rollback incomplete";
265
449
  }
450
+ log("CRITICAL: Rollback incomplete while switching launch shims");
266
451
  }
267
- for (const shim of prepared) try { rmSync(shim.temp, { force: true }); } catch {}
268
452
  throw error;
269
453
  }
270
454
  return {
271
455
  rollback: () => {
272
- for (const shim of [...activated].reverse()) {
273
- try { rmSync(shim.path, { force: true }); } catch {}
274
- if (shim.existed) {
275
- try { renameSync(shim.backup, shim.path); } catch {}
276
- }
456
+ const restored = attemptRollback();
457
+ if (!restored) {
458
+ throw new Error("Rollback incomplete: one or more launch shims could not be restored or removed");
277
459
  }
278
460
  },
279
461
  commit: () => {
@@ -296,7 +478,9 @@ const switchWindowsShims = (shimDir, entrypoint) => {
296
478
  updateId: payload.updateId,
297
479
  lockPath: payload.lockPath,
298
480
  };
481
+ let progress = base;
299
482
  try {
483
+ progress = setPhase(base, "wait-parent-exit", 480 * 250 + 60 * 1000);
300
484
  log("Waiting for parent process " + payload.parentPid + " to exit");
301
485
  let parentExited = false;
302
486
  for (let waited = 0; waited < 480; waited++) {
@@ -306,6 +490,7 @@ const switchWindowsShims = (shimDir, entrypoint) => {
306
490
  if (!parentExited) throw new Error("Timed out waiting for the current Nolo process to exit");
307
491
  await delay(250);
308
492
 
493
+ progress = setPhase(progress, "wait-other-windows", 120 * 1000 + 30 * 1000);
309
494
  const otherProcessDeadline = Date.now() + 120 * 1000;
310
495
  let otherPids = listOtherNoloPids();
311
496
  let checks = 0;
@@ -319,6 +504,7 @@ const switchWindowsShims = (shimDir, entrypoint) => {
319
504
  throw new Error("Other Nolo processes are still running: " + otherPids.join(", "));
320
505
  }
321
506
 
507
+ progress = setPhase(progress, "resolve-prefix", 30 * 1000);
322
508
  const prefixResult = runNpm(["prefix", "-g"]);
323
509
  if (prefixResult.code !== 0 || !prefixResult.stdout) throw new Error("Could not resolve npm global prefix");
324
510
  const prefix = prefixResult.stdout.split(/\r?\n/).at(-1).trim();
@@ -329,6 +515,7 @@ const switchWindowsShims = (shimDir, entrypoint) => {
329
515
  throw new Error("Refusing to update a different npm prefix. Current entrypoint: " + payload.entrypointPath + "; npm prefix: " + prefix);
330
516
  }
331
517
 
518
+ progress = setPhase(progress, "resolve-target-version", 30 * 1000);
332
519
  const targetResult = runNpm(["view", "nolo-cli@" + payload.channel, "version"]);
333
520
  if (targetResult.code !== 0 || !parseVersion(targetResult.stdout)) {
334
521
  throw new Error("Could not resolve nolo-cli@" + payload.channel + " target version");
@@ -339,10 +526,13 @@ const switchWindowsShims = (shimDir, entrypoint) => {
339
526
  }
340
527
 
341
528
  if (compare(targetVersion, payload.currentVersion) > 0) {
529
+ progress = setPhase(progress, "install-target", 5 * 60 * 1000 + 30 * 1000);
342
530
  const versionPrefix = join(payload.managedRoot, targetVersion + "-" + payload.updateId);
343
531
  uncommittedVersionPrefix = versionPrefix;
344
532
  mkdirSync(versionPrefix, { recursive: true });
345
- const install = runNpm(["install", "-g", "--prefix", versionPrefix, "nolo-cli@" + payload.channel, "--force", "--progress"]);
533
+ // Install the exact version resolved from the dist-tag above — never the
534
+ // floating channel tag — so the staged package is the verified one.
535
+ const install = runNpm(["install", "-g", "--prefix", versionPrefix, "nolo-cli@" + targetVersion, "--force", "--progress"]);
346
536
  if (install.code !== 0) throw new Error("npm install exited with code " + install.code);
347
537
  const stagedPackagePath = join(versionPrefix, "node_modules", "nolo-cli", "package.json");
348
538
  const staged = JSON.parse(readFileSync(stagedPackagePath, "utf8"));
@@ -351,6 +541,8 @@ const switchWindowsShims = (shimDir, entrypoint) => {
351
541
  }
352
542
  const stagedEntrypoint = join(versionPrefix, "node_modules", "nolo-cli", "index.js");
353
543
  if (!existsSync(stagedEntrypoint)) throw new Error("Staged nolo entrypoint is missing");
544
+ assertLockOwnership();
545
+ progress = setPhase(progress, "switch-shims", 60 * 1000);
354
546
  const switchedShims = switchWindowsShims(prefix, stagedEntrypoint);
355
547
  const verify = spawnSync(payload.nodePath, [stagedEntrypoint, "-v"], {
356
548
  encoding: "utf8",
@@ -360,29 +552,51 @@ const switchWindowsShims = (shimDir, entrypoint) => {
360
552
  timeout: 30 * 1000,
361
553
  });
362
554
  if (verify.error || verify.status !== 0 || !String(verify.stdout || "").includes(targetVersion)) {
363
- switchedShims.rollback();
555
+ let rollbackError = null;
556
+ try {
557
+ switchedShims.rollback();
558
+ } catch (e) {
559
+ rollbackError = e;
560
+ }
561
+ if (rollbackError) {
562
+ throw new Error(
563
+ "The staged CLI failed its post-switch version check; " +
564
+ (rollbackError && rollbackError.message ? rollbackError.message : String(rollbackError)),
565
+ );
566
+ }
364
567
  throw new Error("The staged CLI failed its post-switch version check; the previous launch shims were restored");
365
568
  }
569
+ // The lock could have been reclaimed (stale timeout / competing updater)
570
+ // during the verify window. Re-check before committing so we never claim
571
+ // success for an update we no longer own. We deliberately do not roll the
572
+ // shims back here: a competing updater may be mid-switch, and nothing is
573
+ // deleted, so leaving our shims in place is recoverable (last writer wins).
574
+ assertLockOwnership();
366
575
  switchedShims.commit();
367
576
  uncommittedVersionPrefix = null;
368
- for (const entry of readdirSync(payload.managedRoot)) {
369
- const candidate = join(payload.managedRoot, entry);
370
- if (normalize(candidate) !== normalize(versionPrefix)) {
371
- try { rmSync(candidate, { recursive: true, force: true }); } catch {}
372
- }
373
- }
577
+ // Previous versions are intentionally retained (unbounded until a
578
+ // reference-aware cleanup exists) because deleting them risks removing a
579
+ // directory that a shim or a rolled-back update still references.
374
580
  log("Verified nolo-cli " + targetVersion + " at " + stagedEntrypoint);
375
581
  } else {
376
582
  log("Already current at " + targetVersion);
377
583
  }
378
- writeState({ ...base, status: "success", targetVersion, finishedAt: new Date().toISOString() });
584
+ writeState({ ...progress, status: "success", phase: "done", targetVersion, finishedAt: new Date().toISOString() });
379
585
  } catch (error) {
380
586
  const message = error && error.message ? error.message : String(error);
381
587
  log("ERROR: " + message);
382
588
  if (uncommittedVersionPrefix) {
383
- try { rmSync(uncommittedVersionPrefix, { recursive: true, force: true }); } catch {}
589
+ if (stagedDirReferenced) {
590
+ log("PRESERVING staged directory " + uncommittedVersionPrefix + " because launch shims may still reference it; deleting it would cause MODULE_NOT_FOUND");
591
+ } else {
592
+ try { rmSync(uncommittedVersionPrefix, { recursive: true, force: true }); } catch {}
593
+ }
594
+ }
595
+ if (lockOwnershipLost) {
596
+ log("Not writing a failed status record: the update lock belongs to another updater");
597
+ } else {
598
+ writeState({ ...progress, status: "failed", finishedAt: new Date().toISOString(), message });
384
599
  }
385
- writeState({ ...base, status: "failed", finishedAt: new Date().toISOString(), message });
386
600
  process.exitCode = 1;
387
601
  } finally {
388
602
  try {
@@ -679,7 +893,11 @@ async function runShellScript(script, {
679
893
  const proc = spawn2({
680
894
  cmd: ["sh", "-c", script],
681
895
  cwd,
682
- stdin: "inherit",
896
+ // Capture mode (TUI sink): ignore stdin — the TUI's own decoder is
897
+ // reading the tty, and a child that reads stdin would race it for keys.
898
+ // The inherit branch is unreachable inside the TUI (useCustomSink is
899
+ // always true there) and stays the correct choice for `nolo update`.
900
+ stdin: useCustomSink ? "ignore" : "inherit",
683
901
  stdout: useCustomSink ? "pipe" : "inherit",
684
902
  stderr: useCustomSink ? "pipe" : "inherit",
685
903
  env
@@ -900,7 +1118,8 @@ Nolo Agent CLI Installer & Updater
900
1118
  const useCustomSink = options.output !== void 0;
901
1119
  const proc = spawn2({
902
1120
  cmd: command,
903
- stdin: "inherit",
1121
+ // Capture mode (TUI sink): ignore stdin — see runShellScript.
1122
+ stdin: useCustomSink ? "ignore" : "inherit",
904
1123
  stdout: useCustomSink ? "pipe" : "inherit",
905
1124
  stderr: useCustomSink ? "pipe" : "inherit",
906
1125
  env
@@ -936,6 +1155,7 @@ async function runSelfUpdate(outputOrOptions) {
936
1155
 
937
1156
  export {
938
1157
  consumeWindowsUpdateStartupNotice,
1158
+ getWindowsUpdateStatus,
939
1159
  getCliInstallChannel,
940
1160
  renderProgressBar,
941
1161
  buildNpmSelfUpdateCommand,
@@ -2,19 +2,19 @@ import {
2
2
  getCredentialsDir,
3
3
  getLegacyCredentialPath,
4
4
  migrateLegacyCredentialFile
5
- } from "./chunk-ONXOABJR.js";
6
- import {
7
- asNonEmptyStringArray
8
- } from "./chunk-VMFTFOWF.js";
5
+ } from "./chunk-HNGRBWYF.js";
9
6
  import {
10
7
  isRecord
11
8
  } from "./chunk-KUG52IAP.js";
12
9
  import {
13
- asTrimmedString
14
- } from "./chunk-3EUW3WEO.js";
10
+ asNonEmptyStringArray
11
+ } from "./chunk-OKGVNZTL.js";
15
12
  import {
16
13
  asOptionalPositiveFiniteNumber
17
14
  } from "./chunk-U6VC4MU4.js";
15
+ import {
16
+ asTrimmedString
17
+ } from "./chunk-3EUW3WEO.js";
18
18
 
19
19
  // packages/agent-runtime/fileCredentialBroker.ts
20
20
  import {
@@ -1,19 +1,15 @@
1
1
  import {
2
- getActiveDialogKey
3
- } from "./chunk-6YTOJY35.js";
2
+ formatISO
3
+ } from "./chunk-ZRAU6T47.js";
4
4
  import {
5
- require_date_fns
6
- } from "./chunk-M76ECQRD.js";
5
+ getActiveDialogKey
6
+ } from "./chunk-VBG7GWWR.js";
7
7
  import {
8
8
  patch,
9
9
  selectById
10
- } from "./chunk-VRTTFDBM.js";
11
- import {
12
- __toESM
13
- } from "./chunk-4VNS5WPM.js";
10
+ } from "./chunk-WPHY3VPF.js";
14
11
 
15
12
  // packages/chat/dialog/actions/setDialogExtraReferencesAction.ts
16
- var import_date_fns = __toESM(require_date_fns());
17
13
  var setDialogExtraReferencesAction = async (extraReferences, thunkApi) => {
18
14
  const { dispatch, getState } = thunkApi;
19
15
  const state = getState();
@@ -33,7 +29,7 @@ var setDialogExtraReferencesAction = async (extraReferences, thunkApi) => {
33
29
  dbKey: currentDialogKey,
34
30
  changes: {
35
31
  extraReferences: extraReferences ?? [],
36
- updatedAt: (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date())
32
+ updatedAt: formatISO(/* @__PURE__ */ new Date())
37
33
  }
38
34
  })
39
35
  ).unwrap();
@@ -7,18 +7,15 @@ import {
7
7
  listUserRecordsFromServers,
8
8
  readDbRecordFromServers,
9
9
  readLiveDbRecordAfterTombstoneMerge
10
- } from "./chunk-GEPUP7OO.js";
10
+ } from "./chunk-OR2UWD6X.js";
11
11
  import {
12
12
  fetchWithTransientRetry
13
- } from "./chunk-5UTFL4QJ.js";
13
+ } from "./chunk-APO5TOXO.js";
14
14
  import {
15
15
  DRAIN_EXHAUSTED_USER_MESSAGE,
16
- isDrainExhaustedResponse
17
- } from "./chunk-3L2WKC3W.js";
18
- import {
19
- buildDialogAttachmentPlan,
20
- extractFileContentIds
21
- } from "./chunk-3BMYXEUW.js";
16
+ isDrainExhaustedResponse,
17
+ parsePositiveFiniteNumberOrFallback
18
+ } from "./chunk-XPWGOTBQ.js";
22
19
  import {
23
20
  isLevelLockError
24
21
  } from "./chunk-URMS4XY2.js";
@@ -26,11 +23,18 @@ import {
26
23
  resolveLocalDialogDbCandidates,
27
24
  resolveServerDbPath
28
25
  } from "./chunk-GLKOYSRU.js";
26
+ import {
27
+ buildDialogAttachmentPlan,
28
+ extractFileContentIds
29
+ } from "./chunk-R5AJODNI.js";
29
30
  import {
30
31
  boundSummaryText,
31
32
  buildDialogReadEnvelope,
32
33
  projectDialogReadForAgent
33
- } from "./chunk-IIVGDG4I.js";
34
+ } from "./chunk-SJKULPGX.js";
35
+ import {
36
+ asRecordOrEmpty
37
+ } from "./chunk-KX6YBIHG.js";
34
38
  import {
35
39
  toErrorMessage
36
40
  } from "./chunk-HNMXYYJR.js";
@@ -43,24 +47,18 @@ import {
43
47
  resolveServerUrl
44
48
  } from "./chunk-A7GB5UGH.js";
45
49
  import {
46
- parsePositiveFiniteNumberOrFallback
47
- } from "./chunk-Y5GCAMGP.js";
48
- import {
49
- asRecordOrEmpty
50
- } from "./chunk-KX6YBIHG.js";
50
+ isRecord
51
+ } from "./chunk-KUG52IAP.js";
51
52
  import {
52
53
  asNonEmptyStringArray,
53
54
  asTrimmedNonEmptyStringArray
54
- } from "./chunk-VMFTFOWF.js";
55
+ } from "./chunk-OKGVNZTL.js";
55
56
  import {
56
57
  createClientLogger
57
- } from "./chunk-QOKAKDPE.js";
58
+ } from "./chunk-HIM3FCLF.js";
58
59
  import {
59
60
  isLevelNotFoundError
60
61
  } from "./chunk-OW765XBU.js";
61
- import {
62
- isRecord
63
- } from "./chunk-KUG52IAP.js";
64
62
  import {
65
63
  asTrimmedString
66
64
  } from "./chunk-3EUW3WEO.js";
@@ -725,7 +723,7 @@ function isExplicitDialogIdMismatch(meta, dialogId) {
725
723
  return meta && typeof meta === "object" && "id" in meta && meta.id != null && String(meta.id) !== dialogId;
726
724
  }
727
725
  async function readDialogFromLocalDb(dialogKey, dialogId, limit, readLocalDialog) {
728
- const reader = readLocalDialog ?? (await import("./localDialogRead-BTFJ4V2I.js")).readDialogFromLocalDb;
726
+ const reader = readLocalDialog ?? (await import("./localDialogRead-UYCKO7YZ.js")).readDialogFromLocalDb;
729
727
  const result = await reader({ dialogKey, dialogId, limit });
730
728
  return {
731
729
  ...result,
@@ -742,7 +740,7 @@ async function readLocalDialogAtDbPathDefault(args) {
742
740
  const [{ Level }, { safeJsonEncoding }, { fetchMessages }] = await Promise.all([
743
741
  import("./levelLazyShim-GZBKODGI.js"),
744
742
  import("./serverStoreFactory-YMXDF4NI.js"),
745
- import("./fetchMessages-EIU7UFFK.js")
743
+ import("./fetchMessages-3PXAHKCR.js")
746
744
  ]);
747
745
  const db = new Level(args.dbPath, {
748
746
  valueEncoding: safeJsonEncoding,