sensemaking 0.18.4 → 0.19.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 (371) hide show
  1. package/README.md +22 -4
  2. package/dist/cjs/chunk/group.js +10 -23
  3. package/dist/cjs/chunk/group.js.map +1 -1
  4. package/dist/cjs/chunk/parse.js +2 -5
  5. package/dist/cjs/chunk/parse.js.map +1 -1
  6. package/dist/cjs/cli/index.js.map +1 -1
  7. package/dist/cjs/cli/shared.js +6 -10
  8. package/dist/cjs/cli/shared.js.map +1 -1
  9. package/dist/cjs/cli/status.js +44 -10
  10. package/dist/cjs/cli/status.js.map +1 -1
  11. package/dist/cjs/cli.js +2 -8
  12. package/dist/cjs/cli.js.map +1 -1
  13. package/dist/cjs/commands/map.js +1 -3
  14. package/dist/cjs/commands/map.js.map +1 -1
  15. package/dist/cjs/commands/peek.js.map +1 -1
  16. package/dist/cjs/commands/related.js +3 -5
  17. package/dist/cjs/commands/related.js.map +1 -1
  18. package/dist/cjs/commands/scope.js.map +1 -1
  19. package/dist/cjs/commands/search.js +6 -8
  20. package/dist/cjs/commands/search.js.map +1 -1
  21. package/dist/cjs/commands/signals.js.map +1 -1
  22. package/dist/cjs/config/access.js.map +1 -1
  23. package/dist/cjs/config/index.d.cts +1 -1
  24. package/dist/cjs/config/index.d.ts +1 -1
  25. package/dist/cjs/config/index.js +3 -0
  26. package/dist/cjs/config/index.js.map +1 -1
  27. package/dist/cjs/config/load.js +10 -24
  28. package/dist/cjs/config/load.js.map +1 -1
  29. package/dist/cjs/config/resolve.js.map +1 -1
  30. package/dist/cjs/config/signals.js +2 -3
  31. package/dist/cjs/config/signals.js.map +1 -1
  32. package/dist/cjs/config/types.d.cts +2 -1
  33. package/dist/cjs/config/types.d.ts +2 -1
  34. package/dist/cjs/config/types.js +8 -0
  35. package/dist/cjs/config/types.js.map +1 -1
  36. package/dist/cjs/config/validate.d.cts +1 -1
  37. package/dist/cjs/config/validate.d.ts +1 -1
  38. package/dist/cjs/config/validate.js +9 -10
  39. package/dist/cjs/config/validate.js.map +1 -1
  40. package/dist/cjs/embed/cohere.js +2 -2
  41. package/dist/cjs/embed/cohere.js.map +1 -1
  42. package/dist/cjs/embed/distribution.js +3 -3
  43. package/dist/cjs/embed/distribution.js.map +1 -1
  44. package/dist/cjs/embed/handoff.d.cts +3 -0
  45. package/dist/cjs/embed/handoff.d.ts +3 -0
  46. package/dist/cjs/embed/handoff.js +39 -0
  47. package/dist/cjs/embed/handoff.js.map +1 -0
  48. package/dist/cjs/embed/identity.d.cts +11 -10
  49. package/dist/cjs/embed/identity.d.ts +11 -10
  50. package/dist/cjs/embed/identity.js +30 -15
  51. package/dist/cjs/embed/identity.js.map +1 -1
  52. package/dist/cjs/embed/langfit.js +2 -3
  53. package/dist/cjs/embed/langfit.js.map +1 -1
  54. package/dist/cjs/embed/languages.js +2 -4
  55. package/dist/cjs/embed/languages.js.map +1 -1
  56. package/dist/cjs/embed/openai.js +2 -2
  57. package/dist/cjs/embed/openai.js.map +1 -1
  58. package/dist/cjs/embed/query.js +58 -20
  59. package/dist/cjs/embed/query.js.map +1 -1
  60. package/dist/cjs/embed/registry.js +1 -2
  61. package/dist/cjs/embed/registry.js.map +1 -1
  62. package/dist/cjs/embed/static.d.cts +1 -1
  63. package/dist/cjs/embed/static.d.ts +1 -1
  64. package/dist/cjs/embed/static.js +8 -10
  65. package/dist/cjs/embed/static.js.map +1 -1
  66. package/dist/cjs/embed/store.d.cts +2 -2
  67. package/dist/cjs/embed/store.d.ts +2 -2
  68. package/dist/cjs/embed/store.js +48 -34
  69. package/dist/cjs/embed/store.js.map +1 -1
  70. package/dist/cjs/embed/types.js +1 -3
  71. package/dist/cjs/embed/types.js.map +1 -1
  72. package/dist/cjs/errors.d.cts +1 -1
  73. package/dist/cjs/errors.d.ts +1 -1
  74. package/dist/cjs/errors.js.map +1 -1
  75. package/dist/cjs/features/embed.js +19 -17
  76. package/dist/cjs/features/embed.js.map +1 -1
  77. package/dist/cjs/features/fences.js +5 -10
  78. package/dist/cjs/features/fences.js.map +1 -1
  79. package/dist/cjs/features/links.js +20 -37
  80. package/dist/cjs/features/links.js.map +1 -1
  81. package/dist/cjs/features/sections.js +21 -19
  82. package/dist/cjs/features/sections.js.map +1 -1
  83. package/dist/cjs/features/tags.js +5 -8
  84. package/dist/cjs/features/tags.js.map +1 -1
  85. package/dist/cjs/graph/traverse.js +1 -2
  86. package/dist/cjs/graph/traverse.js.map +1 -1
  87. package/dist/cjs/index.d.cts +1 -1
  88. package/dist/cjs/index.d.ts +1 -1
  89. package/dist/cjs/index.js +3 -0
  90. package/dist/cjs/index.js.map +1 -1
  91. package/dist/cjs/output/column-hint.js +3 -6
  92. package/dist/cjs/output/column-hint.js.map +1 -1
  93. package/dist/cjs/output/output.js +7 -14
  94. package/dist/cjs/output/output.js.map +1 -1
  95. package/dist/cjs/output/search-error.js +2 -5
  96. package/dist/cjs/output/search-error.js.map +1 -1
  97. package/dist/cjs/scan/frontmatter.d.cts +1 -0
  98. package/dist/cjs/scan/frontmatter.d.ts +1 -0
  99. package/dist/cjs/scan/frontmatter.js +14 -18
  100. package/dist/cjs/scan/frontmatter.js.map +1 -1
  101. package/dist/cjs/scan/list.js +2 -3
  102. package/dist/cjs/scan/list.js.map +1 -1
  103. package/dist/cjs/scan/reparse.js +12 -26
  104. package/dist/cjs/scan/reparse.js.map +1 -1
  105. package/dist/cjs/scan/worker-error.js.map +1 -1
  106. package/dist/cjs/store/cache.d.cts +2 -0
  107. package/dist/cjs/store/cache.d.ts +2 -0
  108. package/dist/cjs/store/cache.js +20 -0
  109. package/dist/cjs/store/cache.js.map +1 -0
  110. package/dist/cjs/store/duckdb/batch.js +4 -16
  111. package/dist/cjs/store/duckdb/batch.js.map +1 -1
  112. package/dist/cjs/store/duckdb/connection.js +8 -20
  113. package/dist/cjs/store/duckdb/connection.js.map +1 -1
  114. package/dist/cjs/store/duckdb/fieldStats.js +2 -8
  115. package/dist/cjs/store/duckdb/fieldStats.js.map +1 -1
  116. package/dist/cjs/store/duckdb/lexical.js +14 -28
  117. package/dist/cjs/store/duckdb/lexical.js.map +1 -1
  118. package/dist/cjs/store/duckdb/native.js.map +1 -1
  119. package/dist/cjs/store/duckdb/open.js +12 -13
  120. package/dist/cjs/store/duckdb/open.js.map +1 -1
  121. package/dist/cjs/store/duckdb/reconcile.js +4 -11
  122. package/dist/cjs/store/duckdb/reconcile.js.map +1 -1
  123. package/dist/cjs/store/duckdb/sql-functions.js +2 -4
  124. package/dist/cjs/store/duckdb/sql-functions.js.map +1 -1
  125. package/dist/cjs/store/duckdb/store.js +2 -3
  126. package/dist/cjs/store/duckdb/store.js.map +1 -1
  127. package/dist/cjs/store/duckdb/vectors.js +8 -18
  128. package/dist/cjs/store/duckdb/vectors.js.map +1 -1
  129. package/dist/cjs/store/index.d.cts +3 -2
  130. package/dist/cjs/store/index.d.ts +3 -2
  131. package/dist/cjs/store/index.js +7 -8
  132. package/dist/cjs/store/index.js.map +1 -1
  133. package/dist/cjs/store/native.js +6 -16
  134. package/dist/cjs/store/native.js.map +1 -1
  135. package/dist/cjs/store/sql-functions.js.map +1 -1
  136. package/dist/cjs/store/sqlite/connection.js +5 -9
  137. package/dist/cjs/store/sqlite/connection.js.map +1 -1
  138. package/dist/cjs/store/sqlite/fieldStats.js.map +1 -1
  139. package/dist/cjs/store/sqlite/lexical.js +3 -5
  140. package/dist/cjs/store/sqlite/lexical.js.map +1 -1
  141. package/dist/cjs/store/sqlite/open.d.cts +0 -1
  142. package/dist/cjs/store/sqlite/open.d.ts +0 -1
  143. package/dist/cjs/store/sqlite/open.js +47 -45
  144. package/dist/cjs/store/sqlite/open.js.map +1 -1
  145. package/dist/cjs/store/sqlite/reconcile.js +113 -104
  146. package/dist/cjs/store/sqlite/reconcile.js.map +1 -1
  147. package/dist/cjs/store/sqlite/sql-functions.js +2 -4
  148. package/dist/cjs/store/sqlite/sql-functions.js.map +1 -1
  149. package/dist/cjs/store/sqlite/store.js.map +1 -1
  150. package/dist/cjs/store/transaction.d.cts +2 -1
  151. package/dist/cjs/store/transaction.d.ts +2 -1
  152. package/dist/cjs/store/transaction.js +17 -9
  153. package/dist/cjs/store/transaction.js.map +1 -1
  154. package/dist/cjs/store/turso/connection.js +3 -7
  155. package/dist/cjs/store/turso/connection.js.map +1 -1
  156. package/dist/cjs/store/turso/fieldStats.js.map +1 -1
  157. package/dist/cjs/store/turso/lexical.d.cts +2 -0
  158. package/dist/cjs/store/turso/lexical.d.ts +2 -0
  159. package/dist/cjs/store/turso/lexical.js +347 -0
  160. package/dist/cjs/store/turso/lexical.js.map +1 -0
  161. package/dist/cjs/store/turso/native.js.map +1 -1
  162. package/dist/cjs/store/turso/open.d.cts +3 -1
  163. package/dist/cjs/store/turso/open.d.ts +3 -1
  164. package/dist/cjs/store/turso/open.js +150 -66
  165. package/dist/cjs/store/turso/open.js.map +1 -1
  166. package/dist/cjs/store/turso/reconcile.js +286 -152
  167. package/dist/cjs/store/turso/reconcile.js.map +1 -1
  168. package/dist/cjs/store/turso/store.js +18 -41
  169. package/dist/cjs/store/turso/store.js.map +1 -1
  170. package/dist/cjs/store/turso/vectors.d.cts +8 -0
  171. package/dist/cjs/store/turso/vectors.d.ts +8 -0
  172. package/dist/cjs/store/turso/vectors.js +435 -0
  173. package/dist/cjs/store/turso/vectors.js.map +1 -0
  174. package/dist/cjs/store/types.js +2 -3
  175. package/dist/cjs/store/types.js.map +1 -1
  176. package/dist/cjs/store/vectors.js.map +1 -1
  177. package/dist/cjs/text/segment.d.cts +1 -0
  178. package/dist/cjs/text/segment.d.ts +1 -0
  179. package/dist/cjs/text/segment.js +10 -14
  180. package/dist/cjs/text/segment.js.map +1 -1
  181. package/dist/cjs/watch.js +2 -5
  182. package/dist/cjs/watch.js.map +1 -1
  183. package/dist/cjs/workers/parse.js.map +1 -1
  184. package/dist/esm/chunk/group.js +10 -23
  185. package/dist/esm/chunk/group.js.map +1 -1
  186. package/dist/esm/chunk/parse.js +4 -8
  187. package/dist/esm/chunk/parse.js.map +1 -1
  188. package/dist/esm/cli/index.js +3 -5
  189. package/dist/esm/cli/index.js.map +1 -1
  190. package/dist/esm/cli/shared.js +12 -22
  191. package/dist/esm/cli/shared.js.map +1 -1
  192. package/dist/esm/cli/status.js +43 -9
  193. package/dist/esm/cli/status.js.map +1 -1
  194. package/dist/esm/cli.js +2 -8
  195. package/dist/esm/cli.js.map +1 -1
  196. package/dist/esm/commands/map.js +1 -3
  197. package/dist/esm/commands/map.js.map +1 -1
  198. package/dist/esm/commands/peek.js.map +1 -1
  199. package/dist/esm/commands/related.js +3 -5
  200. package/dist/esm/commands/related.js.map +1 -1
  201. package/dist/esm/commands/scope.js +3 -5
  202. package/dist/esm/commands/scope.js.map +1 -1
  203. package/dist/esm/commands/search.js +10 -16
  204. package/dist/esm/commands/search.js.map +1 -1
  205. package/dist/esm/commands/signals.js +3 -7
  206. package/dist/esm/commands/signals.js.map +1 -1
  207. package/dist/esm/config/access.js +8 -13
  208. package/dist/esm/config/access.js.map +1 -1
  209. package/dist/esm/config/index.d.ts +1 -1
  210. package/dist/esm/config/index.js +1 -1
  211. package/dist/esm/config/index.js.map +1 -1
  212. package/dist/esm/config/load.js +10 -24
  213. package/dist/esm/config/load.js.map +1 -1
  214. package/dist/esm/config/resolve.js +2 -3
  215. package/dist/esm/config/resolve.js.map +1 -1
  216. package/dist/esm/config/signals.js +3 -5
  217. package/dist/esm/config/signals.js.map +1 -1
  218. package/dist/esm/config/types.d.ts +2 -1
  219. package/dist/esm/config/types.js +8 -2
  220. package/dist/esm/config/types.js.map +1 -1
  221. package/dist/esm/config/validate.d.ts +1 -1
  222. package/dist/esm/config/validate.js +7 -10
  223. package/dist/esm/config/validate.js.map +1 -1
  224. package/dist/esm/embed/cohere.js +2 -2
  225. package/dist/esm/embed/cohere.js.map +1 -1
  226. package/dist/esm/embed/distribution.js +1 -1
  227. package/dist/esm/embed/distribution.js.map +1 -1
  228. package/dist/esm/embed/handoff.d.ts +3 -0
  229. package/dist/esm/embed/handoff.js +21 -0
  230. package/dist/esm/embed/handoff.js.map +1 -0
  231. package/dist/esm/embed/identity.d.ts +11 -10
  232. package/dist/esm/embed/identity.js +29 -26
  233. package/dist/esm/embed/identity.js.map +1 -1
  234. package/dist/esm/embed/langfit.js +2 -3
  235. package/dist/esm/embed/langfit.js.map +1 -1
  236. package/dist/esm/embed/languages.js +2 -4
  237. package/dist/esm/embed/languages.js.map +1 -1
  238. package/dist/esm/embed/openai.js +2 -2
  239. package/dist/esm/embed/openai.js.map +1 -1
  240. package/dist/esm/embed/query.js +21 -6
  241. package/dist/esm/embed/query.js.map +1 -1
  242. package/dist/esm/embed/registry.js +1 -2
  243. package/dist/esm/embed/registry.js.map +1 -1
  244. package/dist/esm/embed/static.d.ts +1 -1
  245. package/dist/esm/embed/static.js +8 -10
  246. package/dist/esm/embed/static.js.map +1 -1
  247. package/dist/esm/embed/store.d.ts +2 -2
  248. package/dist/esm/embed/store.js +28 -23
  249. package/dist/esm/embed/store.js.map +1 -1
  250. package/dist/esm/embed/types.js +1 -3
  251. package/dist/esm/embed/types.js.map +1 -1
  252. package/dist/esm/errors.d.ts +1 -1
  253. package/dist/esm/errors.js.map +1 -1
  254. package/dist/esm/features/embed.js +16 -16
  255. package/dist/esm/features/embed.js.map +1 -1
  256. package/dist/esm/features/fences.js +9 -19
  257. package/dist/esm/features/fences.js.map +1 -1
  258. package/dist/esm/features/links.js +24 -49
  259. package/dist/esm/features/links.js.map +1 -1
  260. package/dist/esm/features/sections.js +20 -20
  261. package/dist/esm/features/sections.js.map +1 -1
  262. package/dist/esm/features/tags.js +5 -8
  263. package/dist/esm/features/tags.js.map +1 -1
  264. package/dist/esm/features/types.js.map +1 -1
  265. package/dist/esm/graph/traverse.js +1 -2
  266. package/dist/esm/graph/traverse.js.map +1 -1
  267. package/dist/esm/index.d.ts +1 -1
  268. package/dist/esm/index.js +1 -1
  269. package/dist/esm/index.js.map +1 -1
  270. package/dist/esm/output/column-hint.js +3 -6
  271. package/dist/esm/output/column-hint.js.map +1 -1
  272. package/dist/esm/output/output.js +9 -20
  273. package/dist/esm/output/output.js.map +1 -1
  274. package/dist/esm/output/search-error.js +2 -5
  275. package/dist/esm/output/search-error.js.map +1 -1
  276. package/dist/esm/scan/frontmatter.d.ts +1 -0
  277. package/dist/esm/scan/frontmatter.js +13 -18
  278. package/dist/esm/scan/frontmatter.js.map +1 -1
  279. package/dist/esm/scan/list.js +2 -3
  280. package/dist/esm/scan/list.js.map +1 -1
  281. package/dist/esm/scan/reparse.js +16 -34
  282. package/dist/esm/scan/reparse.js.map +1 -1
  283. package/dist/esm/scan/worker-error.js.map +1 -1
  284. package/dist/esm/store/cache.d.ts +2 -0
  285. package/dist/esm/store/cache.js +11 -0
  286. package/dist/esm/store/cache.js.map +1 -0
  287. package/dist/esm/store/duckdb/batch.js +4 -16
  288. package/dist/esm/store/duckdb/batch.js.map +1 -1
  289. package/dist/esm/store/duckdb/connection.js +8 -20
  290. package/dist/esm/store/duckdb/connection.js.map +1 -1
  291. package/dist/esm/store/duckdb/fieldStats.js +4 -12
  292. package/dist/esm/store/duckdb/fieldStats.js.map +1 -1
  293. package/dist/esm/store/duckdb/lexical.js +19 -35
  294. package/dist/esm/store/duckdb/lexical.js.map +1 -1
  295. package/dist/esm/store/duckdb/native.js +2 -7
  296. package/dist/esm/store/duckdb/native.js.map +1 -1
  297. package/dist/esm/store/duckdb/open.js +16 -23
  298. package/dist/esm/store/duckdb/open.js.map +1 -1
  299. package/dist/esm/store/duckdb/reconcile.js +4 -11
  300. package/dist/esm/store/duckdb/reconcile.js.map +1 -1
  301. package/dist/esm/store/duckdb/sql-functions.js +4 -9
  302. package/dist/esm/store/duckdb/sql-functions.js.map +1 -1
  303. package/dist/esm/store/duckdb/store.js +6 -14
  304. package/dist/esm/store/duckdb/store.js.map +1 -1
  305. package/dist/esm/store/duckdb/vectors.js +14 -31
  306. package/dist/esm/store/duckdb/vectors.js.map +1 -1
  307. package/dist/esm/store/index.d.ts +3 -2
  308. package/dist/esm/store/index.js +5 -6
  309. package/dist/esm/store/index.js.map +1 -1
  310. package/dist/esm/store/native.js +10 -25
  311. package/dist/esm/store/native.js.map +1 -1
  312. package/dist/esm/store/sql-functions.js +3 -5
  313. package/dist/esm/store/sql-functions.js.map +1 -1
  314. package/dist/esm/store/sqlite/connection.js +6 -10
  315. package/dist/esm/store/sqlite/connection.js.map +1 -1
  316. package/dist/esm/store/sqlite/fieldStats.js +2 -6
  317. package/dist/esm/store/sqlite/fieldStats.js.map +1 -1
  318. package/dist/esm/store/sqlite/lexical.js +5 -9
  319. package/dist/esm/store/sqlite/lexical.js.map +1 -1
  320. package/dist/esm/store/sqlite/open.d.ts +0 -1
  321. package/dist/esm/store/sqlite/open.js +45 -47
  322. package/dist/esm/store/sqlite/open.js.map +1 -1
  323. package/dist/esm/store/sqlite/reconcile.js +13 -17
  324. package/dist/esm/store/sqlite/reconcile.js.map +1 -1
  325. package/dist/esm/store/sqlite/sql-functions.js +2 -4
  326. package/dist/esm/store/sqlite/sql-functions.js.map +1 -1
  327. package/dist/esm/store/sqlite/store.js +1 -2
  328. package/dist/esm/store/sqlite/store.js.map +1 -1
  329. package/dist/esm/store/transaction.d.ts +2 -1
  330. package/dist/esm/store/transaction.js +12 -10
  331. package/dist/esm/store/transaction.js.map +1 -1
  332. package/dist/esm/store/turso/connection.js +4 -8
  333. package/dist/esm/store/turso/connection.js.map +1 -1
  334. package/dist/esm/store/turso/fieldStats.js +2 -5
  335. package/dist/esm/store/turso/fieldStats.js.map +1 -1
  336. package/dist/esm/store/turso/lexical.d.ts +2 -0
  337. package/dist/esm/store/turso/lexical.js +128 -0
  338. package/dist/esm/store/turso/lexical.js.map +1 -0
  339. package/dist/esm/store/turso/native.js +2 -7
  340. package/dist/esm/store/turso/native.js.map +1 -1
  341. package/dist/esm/store/turso/open.d.ts +3 -1
  342. package/dist/esm/store/turso/open.js +45 -29
  343. package/dist/esm/store/turso/open.js.map +1 -1
  344. package/dist/esm/store/turso/reconcile.js +38 -24
  345. package/dist/esm/store/turso/reconcile.js.map +1 -1
  346. package/dist/esm/store/turso/store.js +17 -28
  347. package/dist/esm/store/turso/store.js.map +1 -1
  348. package/dist/esm/store/turso/vectors.d.ts +8 -0
  349. package/dist/esm/store/turso/vectors.js +98 -0
  350. package/dist/esm/store/turso/vectors.js.map +1 -0
  351. package/dist/esm/store/types.js +2 -3
  352. package/dist/esm/store/types.js.map +1 -1
  353. package/dist/esm/store/vectors.js +2 -3
  354. package/dist/esm/store/vectors.js.map +1 -1
  355. package/dist/esm/text/segment.d.ts +1 -0
  356. package/dist/esm/text/segment.js +13 -21
  357. package/dist/esm/text/segment.js.map +1 -1
  358. package/dist/esm/watch.js +2 -5
  359. package/dist/esm/watch.js.map +1 -1
  360. package/dist/esm/workers/parse.js.map +1 -1
  361. package/package.json +3 -1
  362. package/schema.json +2 -2
  363. package/skills/sense/SKILL.md +2 -2
  364. package/skills/sense-setup/SKILL.md +3 -3
  365. package/dist/cjs/store/meta.d.cts +0 -3
  366. package/dist/cjs/store/meta.d.ts +0 -3
  367. package/dist/cjs/store/meta.js +0 -215
  368. package/dist/cjs/store/meta.js.map +0 -1
  369. package/dist/esm/store/meta.d.ts +0 -3
  370. package/dist/esm/store/meta.js +0 -17
  371. package/dist/esm/store/meta.js.map +0 -1
@@ -13,8 +13,10 @@ var _indexts = require("../../features/index.js");
13
13
  var _progressts = require("../../output/progress.js");
14
14
  var _indexts1 = require("../../scan/index.js");
15
15
  var _reparsets = require("../../scan/reparse.js");
16
+ var _segmentts = require("../../text/segment.js");
16
17
  var _sharedts = require("../shared.js");
17
18
  var _transactionts = require("../transaction.js");
19
+ var _opents = require("./open.js");
18
20
  function _array_like_to_array(arr, len) {
19
21
  if (len == null || len > arr.length) len = arr.length;
20
22
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -187,13 +189,8 @@ function _unsupported_iterable_to_array(o, minLen) {
187
189
  if (n === "Map" || n === "Set") return Array.from(n);
188
190
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
189
191
  }
190
- // Fork of sqlite/reconcile.ts (house precedent: each store owns its engine-specific SQL), not
191
- // duckdb's, even though duckdb's content handling is the structurally closer of the two. duckdb
192
- // dropped sqlite's reconcile_max_ms bookkeeping entirely, and this store's busy timeout (open.ts)
193
- // is derived from exactly that recorded value -- forking duckdb's file would lose it silently.
194
- // content itself follows duckdb's shape instead: a plain table, no rowid coupling, no FTS index
195
- // (phase 2's job, not reconcile's), and no `_seg` sidecars (turso's unspaced-script path is not
196
- // FTS5-shaped).
192
+ // Fork of sqlite/reconcile.ts, not duckdb's, so this store keeps reconcile_max_ms bookkeeping
193
+ // (open.ts's busy timeout derives from it). content is a plain table with "_ngram" sidecars for lexical.ts.
197
194
  var CORE_FRONTMATTER_COLUMNS = new Set([
198
195
  'path',
199
196
  '_mtime',
@@ -201,20 +198,28 @@ var CORE_FRONTMATTER_COLUMNS = new Set([
201
198
  '_size',
202
199
  '_parse_error'
203
200
  ]);
204
- // Not a compile-time cap on ALTER TABLE ADD COLUMN (spike-measured: turso accepts 10,000 with no
205
- // error). The real fence is a SELECT projecting more than this many result columns, which fails
206
- // to prepare (spike-measured, both `SELECT *` and an explicit list), so a wide frontmatter table
207
- // would pass every write silently and only break the first time something selects across it.
208
- // Enforced here, before ALTER, the same shape as sqlite's compile-time fence.
201
+ // '' when the field has no unspaced-script run (the common case), so the ngram index carries
202
+ // nothing for it -- same "pay for nothing when absent" shape as sqlite's segmentField sidecars.
203
+ function ngramSidecar(text) {
204
+ return (0, _segmentts.hasUnspacedRun)(text) ? text : '';
205
+ }
206
+ // Not a compile-time cap on ALTER TABLE ADD COLUMN (spike-measured: turso accepts 10,000 with
207
+ // no error); the real fence is a SELECT projecting more than this many result columns, which fails to prepare.
209
208
  var MAX_FRONTMATTER_COLUMNS = 2000;
209
+ // Changed files above which rebuilding the FTS index beats maintaining it per row (see reconcile).
210
+ var FTS_REBUILD_THRESHOLD = 250;
210
211
  // No rowid coupling (unlike sqlite's FTS5 content): `path` is content's own primary key.
211
- var INSERT_CONTENT_SQL = 'INSERT INTO content ("path", title, summary, text) VALUES (?, ?, ?, ?)';
212
+ var INSERT_CONTENT_SQL = 'INSERT INTO content ("path", title, summary, text, title_ngram, summary_ngram, text_ngram) VALUES (?, ?, ?, ?, ?, ?, ?)';
212
213
  function contentRow(doc) {
214
+ var _doc_search = doc.search, title = _doc_search.title, summary = _doc_search.summary, text = _doc_search.text;
213
215
  return [
214
216
  doc.relPath,
215
- doc.search.title,
216
- doc.search.summary,
217
- doc.search.text
217
+ title,
218
+ summary,
219
+ text,
220
+ ngramSidecar(title),
221
+ ngramSidecar(summary),
222
+ ngramSidecar(text)
218
223
  ];
219
224
  }
220
225
  function reconcile(conn, cfg, baseDir) {
@@ -307,7 +312,7 @@ function reconcile(conn, cfg, baseDir) {
307
312
  writableColumns = allColumns.filter(function(c) {
308
313
  return CORE_FRONTMATTER_COLUMNS.has(c) || !_indexts1.RESERVED_COLUMNS.has(c);
309
314
  });
310
- // ON CONFLICT UPDATE (not OR REPLACE) keeps the row's identity stable across reparses.
315
+ // ON CONFLICT UPDATE, rather than the delete-and-insert `OR` clause, keeps the row's identity stable across reparses.
311
316
  insertSql = "INSERT INTO frontmatter (".concat(writableColumns.map(_sharedts.quoteIdent).join(', '), ") VALUES (").concat(writableColumns.map(function() {
312
317
  return '?';
313
318
  }).join(', '), ') ON CONFLICT("path") DO UPDATE SET ').concat(writableColumns.filter(function(c) {
@@ -339,7 +344,7 @@ function reconcile(conn, cfg, baseDir) {
339
344
  4,
340
345
  (0, _transactionts.withTransaction)(conn, function() {
341
346
  return _async_to_generator(function() {
342
- var _feature_remove, _feature_afterReconcile, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, col, err, rows, contentTouched, presetTouched, presetRows, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator1, _step1, doc, _iterator2, _step2, presetName, removedPaths, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, feature, err, _iteratorNormalCompletion4, _didIteratorError4, _iteratorError4, _loop, _iterator4, _step4, err, _iteratorNormalCompletion5, _didIteratorError5, _iteratorError5, _iterator5, _step5, feature1, err;
347
+ var _feature_remove, _feature_afterReconcile, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, col, err, rows, churn, bulk, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, name, err, contentTouched, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, ddl, err, presetTouched, presetRows, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iteratorNormalCompletion4, _didIteratorError4, _iteratorError4, _iterator3, _step3, doc, _iterator4, _step4, presetName, removedPaths, _iteratorNormalCompletion5, _didIteratorError5, _iteratorError5, _iterator5, _step5, feature, err, _iteratorNormalCompletion6, _didIteratorError6, _iteratorError6, _loop, _iterator6, _step6, err, _iteratorNormalCompletion7, _didIteratorError7, _iteratorError7, _iterator7, _step7, feature1, err;
343
348
  return _ts_generator(this, function(_state) {
344
349
  switch(_state.label){
345
350
  case 0:
@@ -424,12 +429,82 @@ function reconcile(conn, cfg, baseDir) {
424
429
  _state.sent();
425
430
  _state.label = 10;
426
431
  case 10:
432
+ // Tantivy maintains the FTS index per inserted row and the cost grows with the batch, so a
433
+ // large insert is superlinear: 6,566 notes took 945s with the index live, 3.3s built after.
434
+ // Measured crossover against a full rebuild, in changed files: ~250 on a 6,566-note tree
435
+ // (100 -> 895ms, 300 -> 4.1s, 1,300 -> 45.5s, rebuild 3.35s), ~295 on 13,132 (250 -> 5.2s,
436
+ // 400 -> 10.0s, rebuild 6.7s). Doubling the corpus moved it 250 to 295, so a constant fits
437
+ // where a ratio does not: 20% would allow 1,313 files here, costing 45s to save 3.3s.
438
+ // Erring low is the cheap direction, since a needless rebuild is linear and predictable.
439
+ churn = delta.reparsed.length + delta.vanished.length;
440
+ bulk = delta.files.length === 0 || churn > FTS_REBUILD_THRESHOLD;
441
+ _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
442
+ if (!bulk) return [
443
+ 3,
444
+ 18
445
+ ];
446
+ _state.label = 11;
447
+ case 11:
448
+ _state.trys.push([
449
+ 11,
450
+ 16,
451
+ 17,
452
+ 18
453
+ ]);
454
+ _iterator1 = _opents.CONTENT_FTS_NAMES[Symbol.iterator]();
455
+ _state.label = 12;
456
+ case 12:
457
+ if (!!(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done)) return [
458
+ 3,
459
+ 15
460
+ ];
461
+ name = _step1.value;
462
+ return [
463
+ 4,
464
+ conn.exec("DROP INDEX IF EXISTS ".concat(name))
465
+ ];
466
+ case 13:
467
+ _state.sent();
468
+ _state.label = 14;
469
+ case 14:
470
+ _iteratorNormalCompletion1 = true;
471
+ return [
472
+ 3,
473
+ 12
474
+ ];
475
+ case 15:
476
+ return [
477
+ 3,
478
+ 18
479
+ ];
480
+ case 16:
481
+ err = _state.sent();
482
+ _didIteratorError1 = true;
483
+ _iteratorError1 = err;
484
+ return [
485
+ 3,
486
+ 18
487
+ ];
488
+ case 17:
489
+ try {
490
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
491
+ _iterator1.return();
492
+ }
493
+ } finally{
494
+ if (_didIteratorError1) {
495
+ throw _iteratorError1;
496
+ }
497
+ }
498
+ return [
499
+ 7
500
+ ];
501
+ case 18:
427
502
  // content is a plain table keyed by its own path (no rowid subquery, unlike sqlite's FTS5
428
503
  // content), so vanished and reparsed docs delete in one pass.
429
504
  contentTouched = _to_consumable_array(vanished).concat(_to_consumable_array(reparsedExisting));
430
505
  if (!(contentTouched.length > 0)) return [
431
506
  3,
432
- 12
507
+ 20
433
508
  ];
434
509
  return [
435
510
  4,
@@ -439,25 +514,86 @@ function reconcile(conn, cfg, baseDir) {
439
514
  ];
440
515
  }))
441
516
  ];
442
- case 11:
517
+ case 19:
443
518
  _state.sent();
444
- _state.label = 12;
445
- case 12:
519
+ _state.label = 20;
520
+ case 20:
446
521
  if (!(parsedDocs.length > 0)) return [
447
522
  3,
448
- 14
523
+ 22
449
524
  ];
450
525
  return [
451
526
  4,
452
527
  conn.runBatch(INSERT_CONTENT_SQL, parsedDocs.map(contentRow))
453
528
  ];
454
- case 13:
529
+ case 21:
455
530
  _state.sent();
456
- _state.label = 14;
457
- case 14:
531
+ _state.label = 22;
532
+ case 22:
533
+ _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
534
+ if (!bulk) return [
535
+ 3,
536
+ 30
537
+ ];
538
+ _state.label = 23;
539
+ case 23:
540
+ _state.trys.push([
541
+ 23,
542
+ 28,
543
+ 29,
544
+ 30
545
+ ]);
546
+ _iterator2 = _opents.CONTENT_FTS_DDL[Symbol.iterator]();
547
+ _state.label = 24;
548
+ case 24:
549
+ if (!!(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done)) return [
550
+ 3,
551
+ 27
552
+ ];
553
+ ddl = _step2.value;
554
+ return [
555
+ 4,
556
+ conn.exec(ddl)
557
+ ];
558
+ case 25:
559
+ _state.sent();
560
+ _state.label = 26;
561
+ case 26:
562
+ _iteratorNormalCompletion2 = true;
563
+ return [
564
+ 3,
565
+ 24
566
+ ];
567
+ case 27:
568
+ return [
569
+ 3,
570
+ 30
571
+ ];
572
+ case 28:
573
+ err = _state.sent();
574
+ _didIteratorError2 = true;
575
+ _iteratorError2 = err;
576
+ return [
577
+ 3,
578
+ 30
579
+ ];
580
+ case 29:
581
+ try {
582
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
583
+ _iterator2.return();
584
+ }
585
+ } finally{
586
+ if (_didIteratorError2) {
587
+ throw _iteratorError2;
588
+ }
589
+ }
590
+ return [
591
+ 7
592
+ ];
593
+ case 30:
458
594
  if (!(vanished.length > 0)) return [
459
595
  3,
460
- 16
596
+ 32
461
597
  ];
462
598
  return [
463
599
  4,
@@ -467,16 +603,16 @@ function reconcile(conn, cfg, baseDir) {
467
603
  ];
468
604
  }))
469
605
  ];
470
- case 15:
606
+ case 31:
471
607
  _state.sent();
472
- _state.label = 16;
473
- case 16:
608
+ _state.label = 32;
609
+ case 32:
474
610
  // A preset edit forces a full rebuild, so an unchanged doc's coverage is already correct;
475
611
  // new docs have nothing to clear, which keeps cold builds linear.
476
612
  presetTouched = _to_consumable_array(vanished).concat(_to_consumable_array(reparsedExisting));
477
613
  if (!(presetTouched.length > 0)) return [
478
614
  3,
479
- 18
615
+ 34
480
616
  ];
481
617
  return [
482
618
  4,
@@ -486,141 +622,141 @@ function reconcile(conn, cfg, baseDir) {
486
622
  ];
487
623
  }))
488
624
  ];
489
- case 17:
625
+ case 33:
490
626
  _state.sent();
491
- _state.label = 18;
492
- case 18:
627
+ _state.label = 34;
628
+ case 34:
493
629
  presetRows = [];
494
- _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined, _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
630
+ _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = undefined, _iteratorNormalCompletion4 = true, _didIteratorError4 = false, _iteratorError4 = undefined;
495
631
  try {
496
- for(_iterator1 = parsedDocs[Symbol.iterator](); !(_iteratorNormalCompletion2 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion2 = true){
497
- doc = _step1.value;
632
+ for(_iterator3 = parsedDocs[Symbol.iterator](); !(_iteratorNormalCompletion4 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion4 = true){
633
+ doc = _step3.value;
498
634
  try {
499
- for(_iterator2 = doc.presets[Symbol.iterator](); !(_iteratorNormalCompletion1 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion1 = true){
500
- presetName = _step2.value;
635
+ for(_iterator4 = doc.presets[Symbol.iterator](); !(_iteratorNormalCompletion3 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion3 = true){
636
+ presetName = _step4.value;
501
637
  presetRows.push([
502
638
  doc.relPath,
503
639
  presetName
504
640
  ]);
505
641
  }
506
642
  } catch (err) {
507
- _didIteratorError1 = true;
508
- _iteratorError1 = err;
643
+ _didIteratorError3 = true;
644
+ _iteratorError3 = err;
509
645
  } finally{
510
646
  try {
511
- if (!_iteratorNormalCompletion1 && _iterator2.return != null) {
512
- _iterator2.return();
647
+ if (!_iteratorNormalCompletion3 && _iterator4.return != null) {
648
+ _iterator4.return();
513
649
  }
514
650
  } finally{
515
- if (_didIteratorError1) {
516
- throw _iteratorError1;
651
+ if (_didIteratorError3) {
652
+ throw _iteratorError3;
517
653
  }
518
654
  }
519
655
  }
520
656
  }
521
657
  } catch (err) {
522
- _didIteratorError2 = true;
523
- _iteratorError2 = err;
658
+ _didIteratorError4 = true;
659
+ _iteratorError4 = err;
524
660
  } finally{
525
661
  try {
526
- if (!_iteratorNormalCompletion2 && _iterator1.return != null) {
527
- _iterator1.return();
662
+ if (!_iteratorNormalCompletion4 && _iterator3.return != null) {
663
+ _iterator3.return();
528
664
  }
529
665
  } finally{
530
- if (_didIteratorError2) {
531
- throw _iteratorError2;
666
+ if (_didIteratorError4) {
667
+ throw _iteratorError4;
532
668
  }
533
669
  }
534
670
  }
535
671
  if (!(presetRows.length > 0)) return [
536
672
  3,
537
- 20
673
+ 36
538
674
  ];
539
675
  return [
540
676
  4,
541
677
  conn.runBatch('INSERT INTO preset_files ("path", preset) VALUES (?, ?)', presetRows)
542
678
  ];
543
- case 19:
679
+ case 35:
544
680
  _state.sent();
545
- _state.label = 20;
546
- case 20:
681
+ _state.label = 36;
682
+ case 36:
547
683
  removedPaths = _to_consumable_array(vanished).concat(_to_consumable_array(reparsedExisting));
548
- _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = undefined;
684
+ _iteratorNormalCompletion5 = true, _didIteratorError5 = false, _iteratorError5 = undefined;
549
685
  if (!(removedPaths.length > 0)) return [
550
686
  3,
551
- 28
687
+ 44
552
688
  ];
553
- _state.label = 21;
554
- case 21:
689
+ _state.label = 37;
690
+ case 37:
555
691
  _state.trys.push([
556
- 21,
557
- 26,
558
- 27,
559
- 28
692
+ 37,
693
+ 42,
694
+ 43,
695
+ 44
560
696
  ]);
561
- _iterator3 = features[Symbol.iterator]();
562
- _state.label = 22;
563
- case 22:
564
- if (!!(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done)) return [
697
+ _iterator5 = features[Symbol.iterator]();
698
+ _state.label = 38;
699
+ case 38:
700
+ if (!!(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done)) return [
565
701
  3,
566
- 25
702
+ 41
567
703
  ];
568
- feature = _step3.value;
704
+ feature = _step5.value;
569
705
  return [
570
706
  4,
571
707
  (_feature_remove = feature.remove) === null || _feature_remove === void 0 ? void 0 : _feature_remove.call(feature, conn, removedPaths, delta)
572
708
  ];
573
- case 23:
709
+ case 39:
574
710
  _state.sent();
575
- _state.label = 24;
576
- case 24:
577
- _iteratorNormalCompletion3 = true;
711
+ _state.label = 40;
712
+ case 40:
713
+ _iteratorNormalCompletion5 = true;
578
714
  return [
579
715
  3,
580
- 22
716
+ 38
581
717
  ];
582
- case 25:
718
+ case 41:
583
719
  return [
584
720
  3,
585
- 28
721
+ 44
586
722
  ];
587
- case 26:
723
+ case 42:
588
724
  err = _state.sent();
589
- _didIteratorError3 = true;
590
- _iteratorError3 = err;
725
+ _didIteratorError5 = true;
726
+ _iteratorError5 = err;
591
727
  return [
592
728
  3,
593
- 28
729
+ 44
594
730
  ];
595
- case 27:
731
+ case 43:
596
732
  try {
597
- if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
598
- _iterator3.return();
733
+ if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
734
+ _iterator5.return();
599
735
  }
600
736
  } finally{
601
- if (_didIteratorError3) {
602
- throw _iteratorError3;
737
+ if (_didIteratorError5) {
738
+ throw _iteratorError5;
603
739
  }
604
740
  }
605
741
  return [
606
742
  7
607
743
  ];
608
- case 28:
609
- _iteratorNormalCompletion4 = true, _didIteratorError4 = false, _iteratorError4 = undefined;
610
- _state.label = 29;
611
- case 29:
744
+ case 44:
745
+ _iteratorNormalCompletion6 = true, _didIteratorError6 = false, _iteratorError6 = undefined;
746
+ _state.label = 45;
747
+ case 45:
612
748
  _state.trys.push([
613
- 29,
614
- 34,
615
- 35,
616
- 36
749
+ 45,
750
+ 50,
751
+ 51,
752
+ 52
617
753
  ]);
618
754
  _loop = function() {
619
755
  var feature, _feature_store, docsForFeature;
620
756
  return _ts_generator(this, function(_state) {
621
757
  switch(_state.label){
622
758
  case 0:
623
- feature = _step4.value;
759
+ feature = _step6.value;
624
760
  docsForFeature = parsedDocs.map(function(doc) {
625
761
  return {
626
762
  path: doc.relPath,
@@ -639,124 +775,122 @@ function reconcile(conn, cfg, baseDir) {
639
775
  }
640
776
  });
641
777
  };
642
- _iterator4 = features[Symbol.iterator]();
643
- _state.label = 30;
644
- case 30:
645
- if (!!(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done)) return [
778
+ _iterator6 = features[Symbol.iterator]();
779
+ _state.label = 46;
780
+ case 46:
781
+ if (!!(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done)) return [
646
782
  3,
647
- 33
783
+ 49
648
784
  ];
649
785
  return [
650
786
  5,
651
787
  _ts_values(_loop())
652
788
  ];
653
- case 31:
789
+ case 47:
654
790
  _state.sent();
655
- _state.label = 32;
656
- case 32:
657
- _iteratorNormalCompletion4 = true;
791
+ _state.label = 48;
792
+ case 48:
793
+ _iteratorNormalCompletion6 = true;
658
794
  return [
659
795
  3,
660
- 30
796
+ 46
661
797
  ];
662
- case 33:
798
+ case 49:
663
799
  return [
664
800
  3,
665
- 36
801
+ 52
666
802
  ];
667
- case 34:
803
+ case 50:
668
804
  err = _state.sent();
669
- _didIteratorError4 = true;
670
- _iteratorError4 = err;
805
+ _didIteratorError6 = true;
806
+ _iteratorError6 = err;
671
807
  return [
672
808
  3,
673
- 36
809
+ 52
674
810
  ];
675
- case 35:
811
+ case 51:
676
812
  try {
677
- if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
678
- _iterator4.return();
813
+ if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
814
+ _iterator6.return();
679
815
  }
680
816
  } finally{
681
- if (_didIteratorError4) {
682
- throw _iteratorError4;
817
+ if (_didIteratorError6) {
818
+ throw _iteratorError6;
683
819
  }
684
820
  }
685
821
  return [
686
822
  7
687
823
  ];
688
- case 36:
689
- _iteratorNormalCompletion5 = true, _didIteratorError5 = false, _iteratorError5 = undefined;
690
- _state.label = 37;
691
- case 37:
824
+ case 52:
825
+ _iteratorNormalCompletion7 = true, _didIteratorError7 = false, _iteratorError7 = undefined;
826
+ _state.label = 53;
827
+ case 53:
692
828
  _state.trys.push([
693
- 37,
694
- 42,
695
- 43,
696
- 44
829
+ 53,
830
+ 58,
831
+ 59,
832
+ 60
697
833
  ]);
698
- _iterator5 = features[Symbol.iterator]();
699
- _state.label = 38;
700
- case 38:
701
- if (!!(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done)) return [
834
+ _iterator7 = features[Symbol.iterator]();
835
+ _state.label = 54;
836
+ case 54:
837
+ if (!!(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done)) return [
702
838
  3,
703
- 41
839
+ 57
704
840
  ];
705
- feature1 = _step5.value;
841
+ feature1 = _step7.value;
706
842
  return [
707
843
  4,
708
844
  (_feature_afterReconcile = feature1.afterReconcile) === null || _feature_afterReconcile === void 0 ? void 0 : _feature_afterReconcile.call(feature1, conn, delta)
709
845
  ];
710
- case 39:
846
+ case 55:
711
847
  _state.sent();
712
- _state.label = 40;
713
- case 40:
714
- _iteratorNormalCompletion5 = true;
848
+ _state.label = 56;
849
+ case 56:
850
+ _iteratorNormalCompletion7 = true;
715
851
  return [
716
852
  3,
717
- 38
853
+ 54
718
854
  ];
719
- case 41:
855
+ case 57:
720
856
  return [
721
857
  3,
722
- 44
858
+ 60
723
859
  ];
724
- case 42:
860
+ case 58:
725
861
  err = _state.sent();
726
- _didIteratorError5 = true;
727
- _iteratorError5 = err;
862
+ _didIteratorError7 = true;
863
+ _iteratorError7 = err;
728
864
  return [
729
865
  3,
730
- 44
866
+ 60
731
867
  ];
732
- case 43:
868
+ case 59:
733
869
  try {
734
- if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
735
- _iterator5.return();
870
+ if (!_iteratorNormalCompletion7 && _iterator7.return != null) {
871
+ _iterator7.return();
736
872
  }
737
873
  } finally{
738
- if (_didIteratorError5) {
739
- throw _iteratorError5;
874
+ if (_didIteratorError7) {
875
+ throw _iteratorError7;
740
876
  }
741
877
  }
742
878
  return [
743
879
  7
744
880
  ];
745
- case 44:
881
+ case 60:
746
882
  return [
747
883
  2
748
884
  ];
749
885
  }
750
886
  });
751
887
  })();
752
- })
888
+ }, _transactionts.BEGIN_WRITE)
753
889
  ];
754
890
  case 5:
755
891
  _state.sent();
756
- // Reconcile's own write-transaction duration, for open()'s derived busy_timeout: keep the
757
- // observed max so a big watcher reconcile's lock hold is what the next open bounds its wait
758
- // against (the same mechanism sqlite's reconcile records, and the one this store's busy
759
- // timeout is derived from).
892
+ // Reconcile's own write-transaction duration, for open()'s derived busy_timeout: the observed
893
+ // max is what the next open bounds its wait against.
760
894
  durationMs = Date.now() - txStart;
761
895
  return [
762
896
  4,
@@ -765,7 +899,7 @@ function reconcile(conn, cfg, baseDir) {
765
899
  case 6:
766
900
  prevRaw = _state.sent();
767
901
  // -1, not 0, so a genuinely 0ms first reconcile (sub-millisecond, common on a tiny tree)
768
- // still gets recorded instead of losing to the "nothing recorded yet" default.
902
+ // gets recorded rather than losing to the "nothing recorded yet" default.
769
903
  prevMax = prevRaw === null ? -1 : Number(prevRaw);
770
904
  if (!(durationMs > prevMax)) return [
771
905
  3,