@remnic/core 10.0.186 → 10.0.188

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 (292) hide show
  1. package/dist/access-admin-ops-surface.js +105 -104
  2. package/dist/access-audit.js +2 -2
  3. package/dist/access-cli.js +105 -104
  4. package/dist/access-cli.js.map +1 -1
  5. package/dist/access-coding-context-resolution.js +6 -6
  6. package/dist/access-extraction-force-flush-preempt.js +105 -104
  7. package/dist/access-extraction-force-flush.js +105 -104
  8. package/dist/access-http-briefing.js +105 -104
  9. package/dist/access-http-query.js +105 -104
  10. package/dist/access-http.js +105 -104
  11. package/dist/access-identity-continuity-surface.js +105 -104
  12. package/dist/access-lcm-surface.js +105 -104
  13. package/dist/access-mcp.js +105 -104
  14. package/dist/access-observe-write-category.js +6 -6
  15. package/dist/access-observe-write-surface.js +105 -104
  16. package/dist/access-offline-manifest.js +5 -5
  17. package/dist/access-operations-batch.js +105 -104
  18. package/dist/access-operations.js +105 -104
  19. package/dist/access-recall-concurrency.js +105 -104
  20. package/dist/access-recall-response.js +105 -104
  21. package/dist/access-recall-surface.js +105 -104
  22. package/dist/access-schema.js +5 -5
  23. package/dist/access-service.js +105 -104
  24. package/dist/active-recall.js +10 -10
  25. package/dist/adapters/index.js +4 -4
  26. package/dist/adapters/registry.js +2 -2
  27. package/dist/{auto-sync-OOEY2FSA.js → auto-sync-BJUAGKI5.js} +4 -4
  28. package/dist/briefing.js +7 -7
  29. package/dist/buffer-add-turns-bounded.js +2 -2
  30. package/dist/buffer-admission-idempotency.d.ts.map +1 -1
  31. package/dist/buffer-admission-idempotency.js +1 -1
  32. package/dist/buffer-persistence.d.ts +14 -0
  33. package/dist/buffer-persistence.d.ts.map +1 -1
  34. package/dist/buffer-persistence.js +3 -1
  35. package/dist/buffer.js +9 -8
  36. package/dist/calibration.js +4 -4
  37. package/dist/causal-consolidation.js +8 -8
  38. package/dist/{chunk-XYZR3NBU.js → chunk-2I3ETW3G.js} +2 -2
  39. package/dist/{chunk-5RWIZISF.js → chunk-2VNMSEZR.js} +3 -3
  40. package/dist/{chunk-4TPU36X4.js → chunk-4N33L4HY.js} +2 -2
  41. package/dist/{chunk-BFPF5N3H.js → chunk-4RASUAN3.js} +4 -4
  42. package/dist/{chunk-N2PXVLV3.js → chunk-56BNHKZM.js} +7 -7
  43. package/dist/{chunk-R3UQIS3F.js → chunk-5AFBFAFX.js} +4 -4
  44. package/dist/{chunk-3FEQNKMB.js → chunk-5WDUY2ZZ.js} +2 -2
  45. package/dist/{chunk-5ITPOAKW.js → chunk-65DWWJKI.js} +2 -2
  46. package/dist/{chunk-O5ZCDK32.js → chunk-6AMFGXG2.js} +39 -11
  47. package/dist/chunk-6AMFGXG2.js.map +1 -0
  48. package/dist/{chunk-L4TYD52M.js → chunk-6MDHK6NO.js} +2 -2
  49. package/dist/{chunk-FYHFM64A.js → chunk-6OHCNTKU.js} +2 -2
  50. package/dist/{chunk-PY5XP7GR.js → chunk-6TIQLG7I.js} +2 -2
  51. package/dist/{chunk-A3HLZMHD.js → chunk-7KTORRIK.js} +2 -2
  52. package/dist/{chunk-ENKXMLE3.js → chunk-A32EBVCZ.js} +2 -2
  53. package/dist/{chunk-H4HBQRGI.js → chunk-ATPY63F5.js} +2 -2
  54. package/dist/{chunk-2LXROA34.js → chunk-AXSQGJSG.js} +2 -2
  55. package/dist/chunk-B256MMS7.js +205 -0
  56. package/dist/chunk-B256MMS7.js.map +1 -0
  57. package/dist/{chunk-VUC3DLQ5.js → chunk-C6Y2YHJL.js} +2 -2
  58. package/dist/{chunk-FBNR3JI5.js → chunk-CIAQK2OU.js} +7 -2
  59. package/dist/{chunk-FBNR3JI5.js.map → chunk-CIAQK2OU.js.map} +1 -1
  60. package/dist/{chunk-FDXLO6CX.js → chunk-CRS2NY44.js} +2 -2
  61. package/dist/{chunk-AJVCM2E3.js → chunk-CYX7JI4O.js} +2 -2
  62. package/dist/{chunk-JK5YFQQT.js → chunk-D3FP4JQI.js} +2 -2
  63. package/dist/{chunk-ZNHLUYIT.js → chunk-D7HOJFDS.js} +4 -4
  64. package/dist/{chunk-ZX5N5D6M.js → chunk-DAOMWGO2.js} +4 -4
  65. package/dist/{chunk-VN3RYYMS.js → chunk-DR4TYD56.js} +2 -2
  66. package/dist/{chunk-7DFJ4JX2.js → chunk-DTTDMK7Q.js} +7 -7
  67. package/dist/{chunk-YNDLCWXS.js → chunk-EZ25VE3G.js} +4 -4
  68. package/dist/{chunk-QJBULLKG.js → chunk-F2MVWUNF.js} +2 -2
  69. package/dist/{chunk-TQXKUQFX.js → chunk-FZU62GIV.js} +7 -6
  70. package/dist/chunk-FZU62GIV.js.map +1 -0
  71. package/dist/{chunk-BAMF6J4W.js → chunk-GCHM5BYL.js} +4 -4
  72. package/dist/{chunk-6SROXED4.js → chunk-GRX5BE73.js} +2 -2
  73. package/dist/{chunk-TKWIUL3D.js → chunk-H442UKDV.js} +8 -8
  74. package/dist/{chunk-VFJ3PBZI.js → chunk-HL53XYHC.js} +4 -4
  75. package/dist/{chunk-CKTKATXL.js → chunk-IMSLPQJB.js} +20 -16
  76. package/dist/chunk-IMSLPQJB.js.map +1 -0
  77. package/dist/{chunk-63FIQIER.js → chunk-JJ42IDJU.js} +2 -2
  78. package/dist/{chunk-N33M4NWM.js → chunk-K3JGILZC.js} +3 -3
  79. package/dist/{chunk-CJERJ724.js → chunk-K6BS5RB4.js} +2 -2
  80. package/dist/{chunk-VAQIBC2L.js → chunk-KQIOW3TG.js} +2 -2
  81. package/dist/{chunk-UMGO4LEZ.js → chunk-KVTUUU7H.js} +2 -2
  82. package/dist/{chunk-TRFSTCQK.js → chunk-LL6WEMTC.js} +34 -6
  83. package/dist/chunk-LL6WEMTC.js.map +1 -0
  84. package/dist/{chunk-LALPM2DN.js → chunk-MTKSH7HY.js} +143 -139
  85. package/dist/chunk-MTKSH7HY.js.map +1 -0
  86. package/dist/{chunk-IK7NPYYU.js → chunk-NFQKIZK3.js} +2 -2
  87. package/dist/{chunk-2WITFW6F.js → chunk-NKHRIDYP.js} +2 -2
  88. package/dist/{chunk-KYZMCH4I.js → chunk-NN3LMWKA.js} +12 -4
  89. package/dist/chunk-NN3LMWKA.js.map +1 -0
  90. package/dist/{chunk-RXAWE76Y.js → chunk-O6QSBI3U.js} +2 -2
  91. package/dist/{chunk-5RBHL5TF.js → chunk-OA7YDB6A.js} +2 -2
  92. package/dist/{chunk-SSKIXUR5.js → chunk-PCGBESAN.js} +2 -2
  93. package/dist/{chunk-DYZDFOBX.js → chunk-Q6S67LHR.js} +2 -2
  94. package/dist/{chunk-WCXWCAUC.js → chunk-QGT5KNQT.js} +2 -2
  95. package/dist/{chunk-KYPFQO43.js → chunk-QPD7EYGI.js} +2 -2
  96. package/dist/{chunk-4KUK3KGI.js → chunk-QXHWOUS6.js} +3 -3
  97. package/dist/{chunk-FE43YKNJ.js → chunk-RBPC4XGU.js} +31 -8
  98. package/dist/chunk-RBPC4XGU.js.map +1 -0
  99. package/dist/{chunk-CXGD3N2Y.js → chunk-RPOG6HLI.js} +2 -2
  100. package/dist/{chunk-3N7I53KR.js → chunk-RVODERA5.js} +2 -2
  101. package/dist/{chunk-G6V32Q4F.js → chunk-SFWQZBPN.js} +2 -2
  102. package/dist/{chunk-DNXQVCIC.js → chunk-SUI75NTN.js} +8 -8
  103. package/dist/{chunk-3GD5SFDT.js → chunk-T3XOP7TA.js} +5 -5
  104. package/dist/{chunk-FDLPNFKE.js → chunk-T7R42MWB.js} +2 -2
  105. package/dist/{chunk-5BESLEU7.js → chunk-TAPF7T26.js} +2 -2
  106. package/dist/chunk-TK6EBBKG.js +13 -0
  107. package/dist/chunk-TK6EBBKG.js.map +1 -0
  108. package/dist/{chunk-PZ4OA7CP.js → chunk-TQODBIMW.js} +2 -2
  109. package/dist/{chunk-PDXO4LIH.js → chunk-UWKHLWUE.js} +13 -9
  110. package/dist/chunk-UWKHLWUE.js.map +1 -0
  111. package/dist/{chunk-QJG6PEAM.js → chunk-VQQZJ6KJ.js} +3 -3
  112. package/dist/{chunk-CIC3WZVO.js → chunk-X3ERYOLO.js} +2 -2
  113. package/dist/{chunk-T4MKFTJF.js → chunk-XHDS6HIX.js} +5 -5
  114. package/dist/{chunk-J7BAJ6BF.js → chunk-XQF2KLV5.js} +2 -2
  115. package/dist/{chunk-U7VEZ2XS.js → chunk-XWPYK5T4.js} +2 -2
  116. package/dist/{chunk-L7MVHAMS.js → chunk-YVXR7CPS.js} +2 -2
  117. package/dist/{chunk-NU5JRN3A.js → chunk-ZDLVHGIC.js} +2 -2
  118. package/dist/{chunk-OJXK5C6Z.js → chunk-ZG4GNPRE.js} +7 -7
  119. package/dist/{chunk-IJKO5RVJ.js → chunk-ZNYDDZVW.js} +3 -3
  120. package/dist/cli.js +105 -104
  121. package/dist/coding/export-okf-codegraph.js +13 -13
  122. package/dist/compounding/engine.js +8 -8
  123. package/dist/config.js +10 -10
  124. package/dist/connectors/codex-materialize-runner.js +7 -7
  125. package/dist/connectors/index.js +7 -7
  126. package/dist/convergence-refresh.js +9 -9
  127. package/dist/corpus-watermark.js +9 -9
  128. package/dist/dashboard-runtime.js +2 -2
  129. package/dist/deep-recall-http-glue.js +6 -6
  130. package/dist/deep-recall.js +2 -2
  131. package/dist/entity-retrieval.js +7 -7
  132. package/dist/explicit-capture.js +105 -104
  133. package/dist/extraction-entities-source.d.ts +11 -0
  134. package/dist/extraction-entities-source.d.ts.map +1 -0
  135. package/dist/extraction-entities-source.js +8 -0
  136. package/dist/extraction-entities-source.js.map +1 -0
  137. package/dist/extraction-judge.js +2 -2
  138. package/dist/extraction-normalization.js +2 -2
  139. package/dist/extraction-prompt.d.ts +19 -2
  140. package/dist/extraction-prompt.d.ts.map +1 -1
  141. package/dist/extraction-prompt.js +5 -1
  142. package/dist/extraction.d.ts +2 -1
  143. package/dist/extraction.d.ts.map +1 -1
  144. package/dist/extraction.js +18 -17
  145. package/dist/{first-start-migration-TCPK2I7J.js → first-start-migration-CCZ5SM3V.js} +4 -4
  146. package/dist/harmonic-retrieval.js +7 -7
  147. package/dist/index.js +125 -124
  148. package/dist/lcm/engine.js +3 -3
  149. package/dist/lcm/index.js +8 -8
  150. package/dist/local-llm-helpers.d.ts.map +1 -1
  151. package/dist/local-llm-helpers.js +2 -2
  152. package/dist/local-llm-transport.d.ts +82 -9
  153. package/dist/local-llm-transport.d.ts.map +1 -1
  154. package/dist/local-llm-transport.js +11 -3
  155. package/dist/local-llm.d.ts.map +1 -1
  156. package/dist/local-llm.js +3 -3
  157. package/dist/location/index.js +8 -8
  158. package/dist/maintenance/memory-governance.js +7 -7
  159. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +7 -7
  160. package/dist/maintenance/rebuild-memory-projection-runner.js +9 -9
  161. package/dist/maintenance/rebuild-memory-projection.js +8 -8
  162. package/dist/memory-browse.js +5 -5
  163. package/dist/namespaces/migrate.js +8 -8
  164. package/dist/namespaces/search.js +4 -4
  165. package/dist/namespaces/storage.js +7 -7
  166. package/dist/offline-sync-changeset-generations.js +3 -3
  167. package/dist/offline-sync-embedding-generation.js +2 -2
  168. package/dist/offline-sync-snapshot-stream.js +5 -5
  169. package/dist/offline-sync.js +6 -6
  170. package/dist/operator-doctor-corpus.js +10 -10
  171. package/dist/operator-toolkit.js +17 -17
  172. package/dist/orchestration/backlog-scheduler.js +106 -105
  173. package/dist/orchestration/backlog-scheduler.js.map +1 -1
  174. package/dist/orchestration/buffer-drain-runner.js +106 -105
  175. package/dist/orchestration/extraction-queue-coordinator.d.ts.map +1 -1
  176. package/dist/orchestration/extraction-run-helpers.d.ts +2 -1
  177. package/dist/orchestration/extraction-run-helpers.d.ts.map +1 -1
  178. package/dist/orchestration/extraction-run.d.ts.map +1 -1
  179. package/dist/orchestration/maintenance.js +18 -18
  180. package/dist/orchestrator.js +107 -106
  181. package/dist/qmd.js +2 -2
  182. package/dist/recall-navigation.js +105 -104
  183. package/dist/recall-state-view-admission.js +5 -5
  184. package/dist/recall-why-service.js +5 -5
  185. package/dist/resume-bundles.js +13 -13
  186. package/dist/search/factory.js +3 -3
  187. package/dist/search/index.js +3 -3
  188. package/dist/semantic-consolidation.js +8 -8
  189. package/dist/semantic-rule-promotion.js +7 -7
  190. package/dist/semantic-rule-verifier.js +7 -7
  191. package/dist/source-agent-qualifier.js +11 -10
  192. package/dist/standup/build.js +7 -7
  193. package/dist/storage/entity-canonical-id-migration-runner.d.ts.map +1 -1
  194. package/dist/storage.js +6 -6
  195. package/dist/summarizer.js +4 -4
  196. package/dist/support-passport/index.js +4 -4
  197. package/dist/transcript.js +2 -2
  198. package/dist/transfer/export-okf.js +7 -7
  199. package/dist/verified-recall.js +7 -7
  200. package/dist/who-knows-cli.js +8 -8
  201. package/dist/who-knows.js +7 -7
  202. package/package.json +2 -2
  203. package/src/buffer-admission-idempotency.test.ts +115 -0
  204. package/src/buffer-admission-idempotency.ts +67 -11
  205. package/src/buffer-persistence.ts +46 -5
  206. package/src/extraction-carry-forward.test.ts +147 -0
  207. package/src/extraction-entities-source.ts +19 -0
  208. package/src/extraction-prompt.ts +60 -9
  209. package/src/extraction.ts +11 -8
  210. package/src/local-llm-headers-timeout.test.ts +246 -16
  211. package/src/local-llm-helpers.ts +14 -4
  212. package/src/local-llm-transport.ts +253 -16
  213. package/src/local-llm.ts +7 -8
  214. package/src/orchestration/extraction-queue-coordinator.ts +7 -1
  215. package/src/orchestration/extraction-queue-lane-bias.test.ts +35 -0
  216. package/src/orchestration/extraction-run-helpers.ts +11 -4
  217. package/src/orchestration/extraction-run.test.ts +23 -12
  218. package/src/orchestration/extraction-run.ts +6 -5
  219. package/src/storage/entity-canonical-id-migration-runner.test.ts +90 -0
  220. package/src/storage/entity-canonical-id-migration-runner.ts +10 -0
  221. package/dist/chunk-5YQXWVCP.js +0 -74
  222. package/dist/chunk-5YQXWVCP.js.map +0 -1
  223. package/dist/chunk-CKTKATXL.js.map +0 -1
  224. package/dist/chunk-FE43YKNJ.js.map +0 -1
  225. package/dist/chunk-KYZMCH4I.js.map +0 -1
  226. package/dist/chunk-LALPM2DN.js.map +0 -1
  227. package/dist/chunk-O5ZCDK32.js.map +0 -1
  228. package/dist/chunk-PDXO4LIH.js.map +0 -1
  229. package/dist/chunk-TQXKUQFX.js.map +0 -1
  230. package/dist/chunk-TRFSTCQK.js.map +0 -1
  231. /package/dist/{auto-sync-OOEY2FSA.js.map → auto-sync-BJUAGKI5.js.map} +0 -0
  232. /package/dist/{chunk-XYZR3NBU.js.map → chunk-2I3ETW3G.js.map} +0 -0
  233. /package/dist/{chunk-5RWIZISF.js.map → chunk-2VNMSEZR.js.map} +0 -0
  234. /package/dist/{chunk-4TPU36X4.js.map → chunk-4N33L4HY.js.map} +0 -0
  235. /package/dist/{chunk-BFPF5N3H.js.map → chunk-4RASUAN3.js.map} +0 -0
  236. /package/dist/{chunk-N2PXVLV3.js.map → chunk-56BNHKZM.js.map} +0 -0
  237. /package/dist/{chunk-R3UQIS3F.js.map → chunk-5AFBFAFX.js.map} +0 -0
  238. /package/dist/{chunk-3FEQNKMB.js.map → chunk-5WDUY2ZZ.js.map} +0 -0
  239. /package/dist/{chunk-5ITPOAKW.js.map → chunk-65DWWJKI.js.map} +0 -0
  240. /package/dist/{chunk-L4TYD52M.js.map → chunk-6MDHK6NO.js.map} +0 -0
  241. /package/dist/{chunk-FYHFM64A.js.map → chunk-6OHCNTKU.js.map} +0 -0
  242. /package/dist/{chunk-PY5XP7GR.js.map → chunk-6TIQLG7I.js.map} +0 -0
  243. /package/dist/{chunk-A3HLZMHD.js.map → chunk-7KTORRIK.js.map} +0 -0
  244. /package/dist/{chunk-ENKXMLE3.js.map → chunk-A32EBVCZ.js.map} +0 -0
  245. /package/dist/{chunk-H4HBQRGI.js.map → chunk-ATPY63F5.js.map} +0 -0
  246. /package/dist/{chunk-2LXROA34.js.map → chunk-AXSQGJSG.js.map} +0 -0
  247. /package/dist/{chunk-VUC3DLQ5.js.map → chunk-C6Y2YHJL.js.map} +0 -0
  248. /package/dist/{chunk-FDXLO6CX.js.map → chunk-CRS2NY44.js.map} +0 -0
  249. /package/dist/{chunk-AJVCM2E3.js.map → chunk-CYX7JI4O.js.map} +0 -0
  250. /package/dist/{chunk-JK5YFQQT.js.map → chunk-D3FP4JQI.js.map} +0 -0
  251. /package/dist/{chunk-ZNHLUYIT.js.map → chunk-D7HOJFDS.js.map} +0 -0
  252. /package/dist/{chunk-ZX5N5D6M.js.map → chunk-DAOMWGO2.js.map} +0 -0
  253. /package/dist/{chunk-VN3RYYMS.js.map → chunk-DR4TYD56.js.map} +0 -0
  254. /package/dist/{chunk-7DFJ4JX2.js.map → chunk-DTTDMK7Q.js.map} +0 -0
  255. /package/dist/{chunk-YNDLCWXS.js.map → chunk-EZ25VE3G.js.map} +0 -0
  256. /package/dist/{chunk-QJBULLKG.js.map → chunk-F2MVWUNF.js.map} +0 -0
  257. /package/dist/{chunk-BAMF6J4W.js.map → chunk-GCHM5BYL.js.map} +0 -0
  258. /package/dist/{chunk-6SROXED4.js.map → chunk-GRX5BE73.js.map} +0 -0
  259. /package/dist/{chunk-TKWIUL3D.js.map → chunk-H442UKDV.js.map} +0 -0
  260. /package/dist/{chunk-VFJ3PBZI.js.map → chunk-HL53XYHC.js.map} +0 -0
  261. /package/dist/{chunk-63FIQIER.js.map → chunk-JJ42IDJU.js.map} +0 -0
  262. /package/dist/{chunk-N33M4NWM.js.map → chunk-K3JGILZC.js.map} +0 -0
  263. /package/dist/{chunk-CJERJ724.js.map → chunk-K6BS5RB4.js.map} +0 -0
  264. /package/dist/{chunk-VAQIBC2L.js.map → chunk-KQIOW3TG.js.map} +0 -0
  265. /package/dist/{chunk-UMGO4LEZ.js.map → chunk-KVTUUU7H.js.map} +0 -0
  266. /package/dist/{chunk-IK7NPYYU.js.map → chunk-NFQKIZK3.js.map} +0 -0
  267. /package/dist/{chunk-2WITFW6F.js.map → chunk-NKHRIDYP.js.map} +0 -0
  268. /package/dist/{chunk-RXAWE76Y.js.map → chunk-O6QSBI3U.js.map} +0 -0
  269. /package/dist/{chunk-5RBHL5TF.js.map → chunk-OA7YDB6A.js.map} +0 -0
  270. /package/dist/{chunk-SSKIXUR5.js.map → chunk-PCGBESAN.js.map} +0 -0
  271. /package/dist/{chunk-DYZDFOBX.js.map → chunk-Q6S67LHR.js.map} +0 -0
  272. /package/dist/{chunk-WCXWCAUC.js.map → chunk-QGT5KNQT.js.map} +0 -0
  273. /package/dist/{chunk-KYPFQO43.js.map → chunk-QPD7EYGI.js.map} +0 -0
  274. /package/dist/{chunk-4KUK3KGI.js.map → chunk-QXHWOUS6.js.map} +0 -0
  275. /package/dist/{chunk-CXGD3N2Y.js.map → chunk-RPOG6HLI.js.map} +0 -0
  276. /package/dist/{chunk-3N7I53KR.js.map → chunk-RVODERA5.js.map} +0 -0
  277. /package/dist/{chunk-G6V32Q4F.js.map → chunk-SFWQZBPN.js.map} +0 -0
  278. /package/dist/{chunk-DNXQVCIC.js.map → chunk-SUI75NTN.js.map} +0 -0
  279. /package/dist/{chunk-3GD5SFDT.js.map → chunk-T3XOP7TA.js.map} +0 -0
  280. /package/dist/{chunk-FDLPNFKE.js.map → chunk-T7R42MWB.js.map} +0 -0
  281. /package/dist/{chunk-5BESLEU7.js.map → chunk-TAPF7T26.js.map} +0 -0
  282. /package/dist/{chunk-PZ4OA7CP.js.map → chunk-TQODBIMW.js.map} +0 -0
  283. /package/dist/{chunk-QJG6PEAM.js.map → chunk-VQQZJ6KJ.js.map} +0 -0
  284. /package/dist/{chunk-CIC3WZVO.js.map → chunk-X3ERYOLO.js.map} +0 -0
  285. /package/dist/{chunk-T4MKFTJF.js.map → chunk-XHDS6HIX.js.map} +0 -0
  286. /package/dist/{chunk-J7BAJ6BF.js.map → chunk-XQF2KLV5.js.map} +0 -0
  287. /package/dist/{chunk-U7VEZ2XS.js.map → chunk-XWPYK5T4.js.map} +0 -0
  288. /package/dist/{chunk-L7MVHAMS.js.map → chunk-YVXR7CPS.js.map} +0 -0
  289. /package/dist/{chunk-NU5JRN3A.js.map → chunk-ZDLVHGIC.js.map} +0 -0
  290. /package/dist/{chunk-OJXK5C6Z.js.map → chunk-ZG4GNPRE.js.map} +0 -0
  291. /package/dist/{chunk-IJKO5RVJ.js.map → chunk-ZNYDDZVW.js.map} +0 -0
  292. /package/dist/{first-start-migration-TCPK2I7J.js.map → first-start-migration-CCZ5SM3V.js.map} +0 -0
@@ -0,0 +1,205 @@
1
+ import {
2
+ log
3
+ } from "./chunk-3WCASNQZ.js";
4
+
5
+ // src/local-llm-transport.ts
6
+ import {
7
+ Agent,
8
+ EnvHttpProxyAgent,
9
+ MockAgent,
10
+ fetch as undiciFetch,
11
+ getGlobalDispatcher
12
+ } from "undici";
13
+ var EXTRACTION_MIN_TRANSPORT_BUDGET_MS = 9e5;
14
+ function routeBudgets(operation, ceilingMs, operatorMs) {
15
+ const routeFloorMs = operation === "extraction" ? EXTRACTION_MIN_TRANSPORT_BUDGET_MS : 0;
16
+ const operatorBudgetMs = operatorMs ?? ceilingMs;
17
+ const effectiveTimeoutMs = Math.min(ceilingMs, operatorBudgetMs);
18
+ const transportBudgetMs = routeFloorMs ? Math.max(ceilingMs, routeFloorMs) : ceilingMs;
19
+ return { effectiveTimeoutMs, transportBudgetMs };
20
+ }
21
+ var HTTP_PROXY_KEYS = ["http_proxy", "HTTP_PROXY"];
22
+ var HTTPS_PROXY_KEYS = ["https_proxy", "HTTPS_PROXY"];
23
+ var NO_PROXY_KEYS = ["no_proxy", "NO_PROXY"];
24
+ var PROXY_ENV_KEYS = [...HTTP_PROXY_KEYS, ...HTTPS_PROXY_KEYS];
25
+ function envValue(keys) {
26
+ for (const key of keys) {
27
+ const value = process.env[key]?.trim();
28
+ if (value) return value;
29
+ }
30
+ return void 0;
31
+ }
32
+ function resolveProxyEnv() {
33
+ return {
34
+ httpProxy: envValue(HTTP_PROXY_KEYS),
35
+ httpsProxy: envValue(HTTPS_PROXY_KEYS),
36
+ noProxy: envValue(NO_PROXY_KEYS)
37
+ };
38
+ }
39
+ function defaultPortFor(protocol) {
40
+ return protocol === "http:" ? 80 : protocol === "https:" ? 443 : 0;
41
+ }
42
+ function noProxyBypasses(url, noProxy) {
43
+ if (!noProxy) return false;
44
+ if (noProxy === "*") return true;
45
+ let hostname;
46
+ let port;
47
+ try {
48
+ const parsed = new URL(url);
49
+ hostname = parsed.host.replace(/:\d*$/, "").toLowerCase();
50
+ port = Number.parseInt(parsed.port, 10) || defaultPortFor(parsed.protocol);
51
+ } catch {
52
+ return false;
53
+ }
54
+ for (const entry of noProxy.split(/[,\s]/)) {
55
+ if (!entry) continue;
56
+ const hostPort = entry.match(/^(.+):(\d+)$/);
57
+ const entryHost = (hostPort ? hostPort[1] : entry).toLowerCase();
58
+ const entryPort = hostPort ? Number.parseInt(hostPort[2], 10) : 0;
59
+ if (entryPort && entryPort !== port) continue;
60
+ if (!/^[.*]/.test(entryHost)) {
61
+ if (hostname === entryHost) return true;
62
+ } else if (hostname.endsWith(entryHost.replace(/^\*/, ""))) {
63
+ return true;
64
+ }
65
+ }
66
+ return false;
67
+ }
68
+ function isInvalidDispatcherArg(err) {
69
+ let current = err;
70
+ for (let depth = 0; current instanceof Error && depth < 5; depth += 1) {
71
+ const errno = current;
72
+ if (errno.code === "UND_ERR_INVALID_ARG") return true;
73
+ current = errno.cause;
74
+ }
75
+ return false;
76
+ }
77
+ function isPlainPoolingAgent(dispatcher) {
78
+ if (dispatcher instanceof Agent) return true;
79
+ if (!dispatcher || typeof dispatcher !== "object") return false;
80
+ const ctor = dispatcher.constructor;
81
+ if (!ctor || typeof ctor !== "function") return false;
82
+ return ctor.name === "Agent";
83
+ }
84
+ var directProbeAgent = null;
85
+ function directProbeDispatcher() {
86
+ if (process.env.REMNIC_LOCAL_LLM_DIRECT !== "1") return void 0;
87
+ directProbeAgent ??= new Agent();
88
+ return directProbeAgent;
89
+ }
90
+ var ChatTransport = class {
91
+ agent = null;
92
+ agentBudgetMs = null;
93
+ warnedAboutCustomDispatcher = false;
94
+ /** Chained proxy pool: the proxyline stays in the path with widened budgets. */
95
+ proxyAgent = null;
96
+ proxyKey = null;
97
+ /**
98
+ * The widened pool, or `undefined` when the process installed its own
99
+ * transport that we must not displace.
100
+ *
101
+ * A deployment can route the local endpoint through a process-wide
102
+ * dispatcher — an agent runtime's managed proxy ("proxyline") or a custom
103
+ * connect/TLS/DNS transport.
104
+ *
105
+ * - When the standard egress-proxy environment variables name the proxy,
106
+ * the transport chains its own `ProxyAgent` over that URI with the
107
+ * widened budgets: the proxyline stays in the path and the budgets take
108
+ * effect. This is the issue-#2148 root cause fix — the managed proxyline
109
+ * dispatcher kept undici's 300s `headersTimeout`, so extraction
110
+ * completions slower than five minutes died.
111
+ * - A NO_PROXY/no_proxy exemption on the request host routes it direct,
112
+ * but a plain direct pool cannot reproduce a custom dispatcher's
113
+ * DNS/connect/TLS logic — the installed transport stays in place.
114
+ * - With no proxy environment to mirror, the installed dispatcher is left
115
+ * alone and the 300s cap stands — only its owner knows how to rebuild
116
+ * it. The trade-off is logged once.
117
+ * - `REMNIC_LOCAL_LLM_DIRECT=1` declares the local endpoint is reached
118
+ * directly even though a global dispatcher exists; the widened direct
119
+ * pool is used, bypassing the proxy.
120
+ *
121
+ * A `MockAgent` is excluded by the same check, so test transports keep
122
+ * working.
123
+ */
124
+ dispatcherFor(budgetMs, url) {
125
+ const normalized = Number.isFinite(budgetMs) ? Math.max(0, budgetMs) : 0;
126
+ const installed = getGlobalDispatcher();
127
+ const custom = !isPlainPoolingAgent(installed);
128
+ const installedIsMock = custom && (installed instanceof MockAgent || installed.constructor.name === "MockAgent");
129
+ if (custom && process.env.REMNIC_LOCAL_LLM_DIRECT !== "1") {
130
+ const proxyEnv = installedIsMock ? void 0 : resolveProxyEnv();
131
+ const proxyUri = proxyEnv ? proxyEnv.httpsProxy ?? proxyEnv.httpProxy : void 0;
132
+ if (proxyUri) {
133
+ if (url && noProxyBypasses(url, proxyEnv?.noProxy)) {
134
+ if (!this.warnedAboutCustomDispatcher) {
135
+ this.warnedAboutCustomDispatcher = true;
136
+ log.debug(
137
+ "local LLM: NO_PROXY exempts the local endpoint from the proxy environment; leaving the installed custom dispatcher in place. localLlmTimeoutMs above that dispatcher's headersTimeout will not take effect."
138
+ );
139
+ }
140
+ return void 0;
141
+ }
142
+ const key = [
143
+ proxyUri,
144
+ ...PROXY_ENV_KEYS.map((k) => process.env[k] ?? ""),
145
+ ...NO_PROXY_KEYS.map((k) => process.env[k] ?? ""),
146
+ normalized
147
+ ].join("|");
148
+ if (this.proxyAgent && this.proxyKey === key) return this.proxyAgent;
149
+ void this.proxyAgent?.close().catch(() => {
150
+ });
151
+ this.proxyAgent = new EnvHttpProxyAgent({
152
+ httpProxy: proxyEnv?.httpProxy,
153
+ httpsProxy: proxyEnv?.httpsProxy,
154
+ noProxy: proxyEnv?.noProxy,
155
+ headersTimeout: normalized,
156
+ bodyTimeout: normalized
157
+ });
158
+ this.proxyKey = key;
159
+ return this.proxyAgent;
160
+ }
161
+ if (!this.warnedAboutCustomDispatcher) {
162
+ this.warnedAboutCustomDispatcher = true;
163
+ log.debug(
164
+ "local LLM: a custom global dispatcher is installed and no proxy environment names it; leaving it in place. localLlmTimeoutMs above that dispatcher's headersTimeout will not take effect."
165
+ );
166
+ }
167
+ return void 0;
168
+ }
169
+ if (this.agent && this.agentBudgetMs === normalized) return this.agent;
170
+ void this.agent?.close().catch(() => {
171
+ });
172
+ this.agent = new Agent({
173
+ headersTimeout: normalized,
174
+ bodyTimeout: normalized
175
+ });
176
+ this.agentBudgetMs = normalized;
177
+ return this.agent;
178
+ }
179
+ async post(request) {
180
+ const init = {
181
+ method: "POST",
182
+ headers: request.headers,
183
+ body: request.body,
184
+ signal: request.signal
185
+ };
186
+ const dispatcher = this.dispatcherFor(request.budgetMs, request.url);
187
+ if (dispatcher) init.dispatcher = dispatcher;
188
+ try {
189
+ return await fetch(request.url, init);
190
+ } catch (err) {
191
+ if (!(err instanceof Error) || !isInvalidDispatcherArg(err)) throw err;
192
+ return await undiciFetch(request.url, init);
193
+ }
194
+ }
195
+ };
196
+
197
+ export {
198
+ EXTRACTION_MIN_TRANSPORT_BUDGET_MS,
199
+ routeBudgets,
200
+ resolveProxyEnv,
201
+ isInvalidDispatcherArg,
202
+ directProbeDispatcher,
203
+ ChatTransport
204
+ };
205
+ //# sourceMappingURL=chunk-B256MMS7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/local-llm-transport.ts"],"sourcesContent":["import {\n Agent,\n EnvHttpProxyAgent,\n MockAgent,\n fetch as undiciFetch,\n getGlobalDispatcher,\n type Dispatcher,\n type Response as UndiciResponse,\n} from \"undici\";\n\nimport { log } from \"./logger.js\";\n\n/**\n * Transport floor for the extraction route (issue #2148 root cause):\n * extraction completions routinely run past undici's default 300s header\n * budget, and the generic `localLlmTimeoutMs` ceiling is sized for chat. The\n * extraction operation's dispatcher inactivity budgets are floored at this\n * value; the call's abort budget still follows the ceiling/operator bound and\n * the caller's own cancellation signal still ends the request early.\n */\nexport const EXTRACTION_MIN_TRANSPORT_BUDGET_MS = 900_000;\n\n/**\n * Route-sized budgets: the generic ceiling is `min(ceiling, operator)`,\n * except the extraction route, whose dispatcher inactivity budgets are\n * floored at EXTRACTION_MIN_TRANSPORT_BUDGET_MS (extraction completions\n * routinely outlast chat-sized budgets; issue #2148 root cause). The abort\n * budget (effectiveTimeoutMs) is not floored.\n */\nexport interface RouteBudgets {\n effectiveTimeoutMs: number;\n transportBudgetMs: number;\n}\n\nexport function routeBudgets(\n operation: string,\n ceilingMs: number,\n operatorMs?: number,\n): RouteBudgets {\n const routeFloorMs =\n operation === \"extraction\" ? EXTRACTION_MIN_TRANSPORT_BUDGET_MS : 0;\n const operatorBudgetMs = operatorMs ?? ceilingMs;\n // The operator's budget (the signal's ceiling) bounds the call; the floor\n // widens only the transport's inactivity budgets, so a proxyline host's\n // 300s dispatcher cap cannot dead-letter a longer configured budget.\n const effectiveTimeoutMs = Math.min(ceilingMs, operatorBudgetMs);\n const transportBudgetMs = routeFloorMs\n ? Math.max(ceilingMs, routeFloorMs)\n : ceilingMs;\n return { effectiveTimeoutMs, transportBudgetMs };\n}\n\n/** The standard egress-proxy environment variables, undici's lowercase-first\n * read order (the `lower ?? upper` read inside EnvHttpProxyAgent). */\nconst HTTP_PROXY_KEYS = [\"http_proxy\", \"HTTP_PROXY\"] as const;\nconst HTTPS_PROXY_KEYS = [\"https_proxy\", \"HTTPS_PROXY\"] as const;\nconst NO_PROXY_KEYS = [\"no_proxy\", \"NO_PROXY\"] as const;\nconst PROXY_ENV_KEYS = [...HTTP_PROXY_KEYS, ...HTTPS_PROXY_KEYS] as const;\n\nfunction envValue(keys: readonly string[]): string | undefined {\n // An empty variable must not hide a later one: HTTPS_PROXY=\"\" means \"unset\",\n // not \"the proxy is the empty string\".\n for (const key of keys) {\n const value = process.env[key]?.trim();\n if (value) return value;\n }\n return undefined;\n}\n\n/**\n * The egress-proxy environment after resolution: lowercase-first read order\n * with empty values treated as unset. The same resolved values are handed\n * to EnvHttpProxyAgent's overrides, so the gate and the pool can never\n * disagree about which proxy applies (undici's own read skips only unset\n * variables — an empty lowercase value would hide a set uppercase one).\n */\nexport interface ResolvedProxyEnv {\n httpProxy?: string;\n httpsProxy?: string;\n noProxy?: string;\n}\n\nexport function resolveProxyEnv(): ResolvedProxyEnv {\n return {\n httpProxy: envValue(HTTP_PROXY_KEYS),\n httpsProxy: envValue(HTTPS_PROXY_KEYS),\n noProxy: envValue(NO_PROXY_KEYS),\n };\n}\n\nfunction proxyUriFromEnv(): string | undefined {\n const { httpsProxy, httpProxy } = resolveProxyEnv();\n return httpsProxy ?? httpProxy;\n}\n\n/** undici's DEFAULT_PORTS for the schemes the local endpoint uses. */\nfunction defaultPortFor(protocol: string): number {\n return protocol === \"http:\" ? 80 : protocol === \"https:\" ? 443 : 0;\n}\n\n/**\n * EnvHttpProxyAgent's `#shouldProxy` semantics, mirrored: true when `url`'s\n * host and port are exempt from the proxy environment via NO_PROXY/no_proxy.\n */\nfunction noProxyBypasses(url: string, noProxy: string | undefined): boolean {\n if (!noProxy) return false;\n if (noProxy === \"*\") return true;\n let hostname: string;\n let port: number;\n try {\n const parsed = new URL(url);\n hostname = parsed.host.replace(/:\\d*$/, \"\").toLowerCase();\n port = Number.parseInt(parsed.port, 10) || defaultPortFor(parsed.protocol);\n } catch {\n return false;\n }\n for (const entry of noProxy.split(/[,\\s]/)) {\n if (!entry) continue;\n const hostPort = entry.match(/^(.+):(\\d+)$/);\n const entryHost = (hostPort ? hostPort[1] : entry).toLowerCase();\n const entryPort = hostPort ? Number.parseInt(hostPort[2], 10) : 0;\n if (entryPort && entryPort !== port) continue;\n if (!/^[.*]/.test(entryHost)) {\n if (hostname === entryHost) return true;\n } else if (hostname.endsWith(entryHost.replace(/^\\*/, \"\"))) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The per-request init shape the transport hands fetch: undici's RequestInit\n * (minus the body union this client never uses — chat bodies are strings)\n * plus the dispatcher the #2148 fix passes per request.\n */\nexport type TransportRequestInit = Omit<RequestInit, \"body\" | \"dispatcher\"> & {\n body?: string;\n dispatcher?: Dispatcher;\n};\n\n/**\n * True when `err` or its cause chain (node 26 wraps dispatch failures in\n * TypeError(\"fetch failed\")) carries undici's UND_ERR_INVALID_ARG — the\n * runtime's rejection of a per-request dispatcher.\n */\nexport function isInvalidDispatcherArg(err: Error): boolean {\n let current: unknown = err;\n for (let depth = 0; current instanceof Error && depth < 5; depth += 1) {\n // SAFETY: undici codes ride NodeJS.ErrnoException-style `code` and `cause` members.\n const errno = current as NodeJS.ErrnoException;\n if (errno.code === \"UND_ERR_INVALID_ARG\") return true;\n current = errno.cause;\n }\n return false;\n}\n\n/**\n * Either wire response: the runtime's (global fetch) or undici's (the\n * dispatcher-carrying fallback for runtimes that reject per-request\n * dispatchers). Every consumer only reads ok/status/headers/text/json.\n */\nexport type ChatWireResponse = Response | UndiciResponse;\n\n/**\n * Wire transport for local LLM chat completions.\n *\n * Split out of `local-llm.ts` so the client module keeps prompt and\n * response semantics while connection budgets live in one place.\n */\n\nexport interface ChatCompletionRequest {\n url: string;\n headers: Record<string, string>;\n body: string;\n signal: AbortSignal;\n /**\n * Ceiling for this endpoint, i.e. `localLlmTimeoutMs`. Sizes the\n * connection's inactivity budgets. Per-request budgets below the ceiling\n * stay enforced by `signal`.\n */\n budgetMs: number;\n}\n\n/**\n * Is this undici's stock pooling `Agent` — the transport we may widen?\n *\n * `instanceof` alone is not enough: Node's global fetch is backed by its\n * OWN bundled copy of undici, so the dispatcher parked on the well-known\n * global symbol is an `Agent` from a different copy than the one we import,\n * and cross-copy `instanceof` is false. Fall back to the constructor name,\n * which is stable across copies and still distinguishes `ProxyAgent` and\n * `MockAgent` from the stock pool.\n */\nfunction isPlainPoolingAgent(dispatcher: unknown): boolean {\n if (dispatcher instanceof Agent) return true;\n if (!dispatcher || typeof dispatcher !== \"object\") return false;\n const ctor = (dispatcher as { constructor?: unknown }).constructor;\n if (!ctor || typeof ctor !== \"function\") return false;\n return ctor.name === \"Agent\";\n}\n\n/**\n * REMNIC_LOCAL_LLM_DIRECT=1 declares that the local endpoint is reached\n * directly. Availability probes use this shared plain pool in that mode so they\n * take the same route as chat requests; `undefined` keeps the global dispatcher.\n */\nlet directProbeAgent: Agent | null = null;\nexport function directProbeDispatcher(): Agent | undefined {\n if (process.env.REMNIC_LOCAL_LLM_DIRECT !== \"1\") return undefined;\n directProbeAgent ??= new Agent();\n return directProbeAgent;\n}\n\n/**\n * Connection pool whose header/body inactivity budgets track the configured\n * request budget.\n *\n * Node's global fetch runs on undici, which applies a default\n * `headersTimeout` and `bodyTimeout` of 300s. A non-streaming completion\n * sends its response headers only once generation finishes, so any\n * completion slower than 300s died with a bare `fetch failed` no matter how\n * high `localLlmTimeoutMs` was set — the configured budget was dead letter\n * past five minutes (issue #2148).\n *\n * One pool per client is enough: it is keyed on the ceiling and rebuilt when\n * that changes.\n */\nexport class ChatTransport {\n private agent: Agent | null = null;\n private agentBudgetMs: number | null = null;\n private warnedAboutCustomDispatcher = false;\n /** Chained proxy pool: the proxyline stays in the path with widened budgets. */\n private proxyAgent: EnvHttpProxyAgent | null = null;\n private proxyKey: string | null = null;\n\n /**\n * The widened pool, or `undefined` when the process installed its own\n * transport that we must not displace.\n *\n * A deployment can route the local endpoint through a process-wide\n * dispatcher — an agent runtime's managed proxy (\"proxyline\") or a custom\n * connect/TLS/DNS transport.\n *\n * - When the standard egress-proxy environment variables name the proxy,\n * the transport chains its own `ProxyAgent` over that URI with the\n * widened budgets: the proxyline stays in the path and the budgets take\n * effect. This is the issue-#2148 root cause fix — the managed proxyline\n * dispatcher kept undici's 300s `headersTimeout`, so extraction\n * completions slower than five minutes died.\n * - A NO_PROXY/no_proxy exemption on the request host routes it direct,\n * but a plain direct pool cannot reproduce a custom dispatcher's\n * DNS/connect/TLS logic — the installed transport stays in place.\n * - With no proxy environment to mirror, the installed dispatcher is left\n * alone and the 300s cap stands — only its owner knows how to rebuild\n * it. The trade-off is logged once.\n * - `REMNIC_LOCAL_LLM_DIRECT=1` declares the local endpoint is reached\n * directly even though a global dispatcher exists; the widened direct\n * pool is used, bypassing the proxy.\n *\n * A `MockAgent` is excluded by the same check, so test transports keep\n * working.\n */\n dispatcherFor(budgetMs: number, url?: string): Agent | EnvHttpProxyAgent | undefined {\n const normalized = Number.isFinite(budgetMs) ? Math.max(0, budgetMs) : 0;\n const installed = getGlobalDispatcher();\n const custom = !isPlainPoolingAgent(installed);\n // A MockAgent is a test transport: it is left in place like any other\n // dispatcher the transport cannot mirror. The constructor-name check\n // covers a MockAgent from a different undici copy than the one we import\n // (same reason isPlainPoolingAgent checks ctor.name).\n const installedIsMock =\n custom && (installed instanceof MockAgent || installed.constructor.name === \"MockAgent\");\n if (custom && process.env.REMNIC_LOCAL_LLM_DIRECT !== \"1\") {\n const proxyEnv = installedIsMock ? undefined : resolveProxyEnv();\n const proxyUri = proxyEnv ? proxyEnv.httpsProxy ?? proxyEnv.httpProxy : undefined;\n if (proxyUri) {\n if (url && noProxyBypasses(url, proxyEnv?.noProxy)) {\n // The environment routes this host direct — but a fresh direct pool\n // cannot reproduce the installed transport's custom DNS/connect\n // logic, so it stays. The 300s trade-off is logged once.\n if (!this.warnedAboutCustomDispatcher) {\n this.warnedAboutCustomDispatcher = true;\n log.debug(\n \"local LLM: NO_PROXY exempts the local endpoint from the proxy environment; \" +\n \"leaving the installed custom dispatcher in place. \" +\n \"localLlmTimeoutMs above that dispatcher's headersTimeout will not take effect.\",\n );\n }\n return undefined;\n }\n // The chained agent's behavior tracks the whole proxy environment, so\n // the cache key must too: a changed HTTP_PROXY or NO_PROXY with a\n // steady HTTPS_PROXY must not hand back the stale pool.\n const key = [\n proxyUri,\n ...PROXY_ENV_KEYS.map((k) => process.env[k] ?? \"\"),\n ...NO_PROXY_KEYS.map((k) => process.env[k] ?? \"\"),\n normalized,\n ].join(\"|\");\n if (this.proxyAgent && this.proxyKey === key) return this.proxyAgent;\n void this.proxyAgent?.close().catch(() => {\n /* pool teardown is best-effort */\n });\n // EnvHttpProxyAgent keeps NO_PROXY and per-protocol proxy selection;\n // the resolved values are passed as overrides so its raw env read can\n // never disagree with the gate's resolution (empty-lowercase skew).\n this.proxyAgent = new EnvHttpProxyAgent({\n httpProxy: proxyEnv?.httpProxy,\n httpsProxy: proxyEnv?.httpsProxy,\n noProxy: proxyEnv?.noProxy,\n headersTimeout: normalized,\n bodyTimeout: normalized,\n });\n this.proxyKey = key;\n return this.proxyAgent;\n }\n if (!this.warnedAboutCustomDispatcher) {\n this.warnedAboutCustomDispatcher = true;\n log.debug(\n \"local LLM: a custom global dispatcher is installed and no proxy environment names it; leaving it in place. \" +\n \"localLlmTimeoutMs above that dispatcher's headersTimeout will not take effect.\",\n );\n }\n return undefined;\n }\n if (this.agent && this.agentBudgetMs === normalized) return this.agent;\n void this.agent?.close().catch(() => {\n /* pool teardown is best-effort */\n });\n this.agent = new Agent({\n headersTimeout: normalized,\n bodyTimeout: normalized,\n });\n this.agentBudgetMs = normalized;\n return this.agent;\n }\n\n async post(request: ChatCompletionRequest): Promise<Response | UndiciResponse> {\n const init: TransportRequestInit = {\n method: \"POST\",\n headers: request.headers,\n body: request.body,\n signal: request.signal,\n };\n const dispatcher = this.dispatcherFor(request.budgetMs, request.url);\n if (dispatcher) init.dispatcher = dispatcher;\n try {\n return await fetch(request.url, init);\n } catch (err) {\n // node >= 26 wraps dispatch failures in TypeError(\"fetch failed\"),\n // so UND_ERR_INVALID_ARG can ride `err` or its cause chain; the\n // bundled undici's fetch accepts the same init on every supported\n // Node, so the widened budget still rides.\n if (!(err instanceof Error) || !isInvalidDispatcherArg(err)) throw err;\n return await undiciFetch(request.url, init);\n }\n }\n}\n"],"mappings":";;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,OAGK;AAYA,IAAM,qCAAqC;AAc3C,SAAS,aACd,WACA,WACA,YACc;AACd,QAAM,eACJ,cAAc,eAAe,qCAAqC;AACpE,QAAM,mBAAmB,cAAc;AAIvC,QAAM,qBAAqB,KAAK,IAAI,WAAW,gBAAgB;AAC/D,QAAM,oBAAoB,eACtB,KAAK,IAAI,WAAW,YAAY,IAChC;AACJ,SAAO,EAAE,oBAAoB,kBAAkB;AACjD;AAIA,IAAM,kBAAkB,CAAC,cAAc,YAAY;AACnD,IAAM,mBAAmB,CAAC,eAAe,aAAa;AACtD,IAAM,gBAAgB,CAAC,YAAY,UAAU;AAC7C,IAAM,iBAAiB,CAAC,GAAG,iBAAiB,GAAG,gBAAgB;AAE/D,SAAS,SAAS,MAA6C;AAG7D,aAAW,OAAO,MAAM;AACtB,UAAM,QAAQ,QAAQ,IAAI,GAAG,GAAG,KAAK;AACrC,QAAI,MAAO,QAAO;AAAA,EACpB;AACA,SAAO;AACT;AAeO,SAAS,kBAAoC;AAClD,SAAO;AAAA,IACL,WAAW,SAAS,eAAe;AAAA,IACnC,YAAY,SAAS,gBAAgB;AAAA,IACrC,SAAS,SAAS,aAAa;AAAA,EACjC;AACF;AAQA,SAAS,eAAe,UAA0B;AAChD,SAA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JI5.js";
3
+ } from "./chunk-CIAQK2OU.js";
4
4
  import {
5
5
  composeMemoryEnvelope
6
6
  } from "./chunk-X26YOFGS.js";
@@ -546,4 +546,4 @@ export {
546
546
  setSemanticRulePromotionTestHooks,
547
547
  promoteSemanticRuleFromMemory
548
548
  };
549
- //# sourceMappingURL=chunk-VUC3DLQ5.js.map
549
+ //# sourceMappingURL=chunk-C6Y2YHJL.js.map
@@ -26,7 +26,7 @@ import {
26
26
  import {
27
27
  normalizeQmdResultPath,
28
28
  resolveNamespaceResultPath
29
- } from "./chunk-5RBHL5TF.js";
29
+ } from "./chunk-OA7YDB6A.js";
30
30
  import {
31
31
  withholdToolScopedFromSharedNamespace
32
32
  } from "./chunk-S2V7RUCL.js";
@@ -4220,6 +4220,11 @@ var EntityCanonicalIdMigrationRunner = class {
4220
4220
  async runOrReuse() {
4221
4221
  let fingerprintAtStart = await this.readFingerprint();
4222
4222
  if (this.migrationComplete && fingerprintAtStart === this.completedFingerprint) return;
4223
+ if (this.migrationComplete) {
4224
+ const stabilityRead = await this.readFingerprint();
4225
+ if (stabilityRead !== fingerprintAtStart) return;
4226
+ fingerprintAtStart = stabilityRead;
4227
+ }
4223
4228
  for (let attempt = 0; attempt < 3; attempt += 1) {
4224
4229
  const completionFingerprint = await this.runMigration();
4225
4230
  const fingerprintAfterMigration = await this.readFingerprint();
@@ -13356,4 +13361,4 @@ export {
13356
13361
  isValidBufferSurpriseEvent,
13357
13362
  StorageManager3 as StorageManager
13358
13363
  };
13359
- //# sourceMappingURL=chunk-FBNR3JI5.js.map
13364
+ //# sourceMappingURL=chunk-CIAQK2OU.js.map