@cchistory/lite 0.4.5 → 0.6.0

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 (556) hide show
  1. package/INSTALL.md +1 -1
  2. package/apps/lite-cli/dist/agent-contract.d.ts +7 -5
  3. package/apps/lite-cli/dist/agent-contract.d.ts.map +1 -1
  4. package/apps/lite-cli/dist/agent-contract.js +36 -25
  5. package/apps/lite-cli/dist/agent-contract.js.map +1 -1
  6. package/apps/lite-cli/dist/bin.js +2 -2
  7. package/apps/lite-cli/dist/bin.js.map +1 -1
  8. package/apps/lite-cli/dist/index.d.ts.map +1 -1
  9. package/apps/lite-cli/dist/index.js +151 -66
  10. package/apps/lite-cli/dist/index.js.map +1 -1
  11. package/apps/lite-cli/dist/index.test.js +59 -89
  12. package/apps/lite-cli/dist/index.test.js.map +1 -1
  13. package/apps/lite-cli/dist/query.d.ts +4 -1
  14. package/apps/lite-cli/dist/query.d.ts.map +1 -1
  15. package/apps/lite-cli/dist/query.js +45 -29
  16. package/apps/lite-cli/dist/query.js.map +1 -1
  17. package/apps/lite-cli/dist/resource-errors.d.ts +3 -0
  18. package/apps/lite-cli/dist/resource-errors.d.ts.map +1 -0
  19. package/apps/lite-cli/dist/resource-errors.js +17 -0
  20. package/apps/lite-cli/dist/resource-errors.js.map +1 -0
  21. package/apps/lite-cli/dist/shell.d.ts +12 -2
  22. package/apps/lite-cli/dist/shell.d.ts.map +1 -1
  23. package/apps/lite-cli/dist/shell.js +129 -57
  24. package/apps/lite-cli/dist/shell.js.map +1 -1
  25. package/apps/lite-cli/dist/sql-query.test.d.ts +2 -0
  26. package/apps/lite-cli/dist/sql-query.test.d.ts.map +1 -0
  27. package/apps/lite-cli/dist/sql-query.test.js +290 -0
  28. package/apps/lite-cli/dist/sql-query.test.js.map +1 -0
  29. package/apps/lite-cli/dist/version.d.ts +1 -1
  30. package/apps/lite-cli/dist/version.js +1 -1
  31. package/apps/lite-tui/dist/bin.js +2 -2
  32. package/apps/lite-tui/dist/bin.js.map +1 -1
  33. package/apps/lite-tui/dist/index.d.ts.map +1 -1
  34. package/apps/lite-tui/dist/index.js +6 -2
  35. package/apps/lite-tui/dist/index.js.map +1 -1
  36. package/apps/lite-tui/dist/index.test.js +10 -8
  37. package/apps/lite-tui/dist/index.test.js.map +1 -1
  38. package/apps/lite-tui/dist/render.d.ts +1 -1
  39. package/apps/lite-tui/dist/version.d.ts +1 -1
  40. package/apps/lite-tui/dist/version.js +1 -1
  41. package/bin/cchistory-lite-tui.mjs +2 -2
  42. package/bin/cchistory-lite.mjs +2 -2
  43. package/docs/guide/for-agents.md +66 -46
  44. package/docs/guide/lite.md +53 -11
  45. package/docs/guide/queries/latest-sessions.sql +4 -0
  46. package/docs/guide/queries/latest-turns.sql +1 -0
  47. package/docs/guide/queries/list-sessions.sql +2 -0
  48. package/docs/guide/query.md +153 -0
  49. package/node_modules/@cchistory/canonical/dist/directory-scope.d.ts +7 -0
  50. package/node_modules/@cchistory/canonical/dist/directory-scope.d.ts.map +1 -1
  51. package/node_modules/@cchistory/canonical/dist/directory-scope.js +11 -0
  52. package/node_modules/@cchistory/canonical/dist/directory-scope.js.map +1 -1
  53. package/node_modules/@cchistory/canonical/dist/index.d.ts +5 -1
  54. package/node_modules/@cchistory/canonical/dist/index.d.ts.map +1 -1
  55. package/node_modules/@cchistory/canonical/dist/index.js +5 -1
  56. package/node_modules/@cchistory/canonical/dist/index.js.map +1 -1
  57. package/node_modules/@cchistory/canonical/dist/query.d.ts +15 -0
  58. package/node_modules/@cchistory/canonical/dist/query.d.ts.map +1 -0
  59. package/node_modules/@cchistory/canonical/dist/query.js +208 -0
  60. package/node_modules/@cchistory/canonical/dist/query.js.map +1 -0
  61. package/node_modules/@cchistory/canonical/dist/session-family.d.ts +1 -0
  62. package/node_modules/@cchistory/canonical/dist/session-family.d.ts.map +1 -1
  63. package/node_modules/@cchistory/canonical/dist/session-family.js +3 -0
  64. package/node_modules/@cchistory/canonical/dist/session-family.js.map +1 -1
  65. package/node_modules/@cchistory/canonical/dist/session-family.test.js +61 -0
  66. package/node_modules/@cchistory/canonical/dist/session-family.test.js.map +1 -1
  67. package/node_modules/@cchistory/canonical/dist/session-interpreter.d.ts +30 -0
  68. package/node_modules/@cchistory/canonical/dist/session-interpreter.d.ts.map +1 -0
  69. package/node_modules/@cchistory/canonical/dist/session-interpreter.js +713 -0
  70. package/node_modules/@cchistory/canonical/dist/session-interpreter.js.map +1 -0
  71. package/node_modules/@cchistory/canonical/dist/session-interpreter.test.d.ts +2 -0
  72. package/node_modules/@cchistory/canonical/dist/session-interpreter.test.d.ts.map +1 -0
  73. package/node_modules/@cchistory/canonical/dist/session-interpreter.test.js +56 -0
  74. package/node_modules/@cchistory/canonical/dist/session-interpreter.test.js.map +1 -0
  75. package/node_modules/@cchistory/canonical/package.json +1 -1
  76. package/node_modules/@cchistory/domain/dist/evidence-atoms.d.ts +7 -0
  77. package/node_modules/@cchistory/domain/dist/evidence-atoms.d.ts.map +1 -0
  78. package/node_modules/@cchistory/domain/dist/evidence-atoms.js +36 -0
  79. package/node_modules/@cchistory/domain/dist/evidence-atoms.js.map +1 -0
  80. package/node_modules/@cchistory/domain/dist/evidence-values.d.ts +26 -0
  81. package/node_modules/@cchistory/domain/dist/evidence-values.d.ts.map +1 -0
  82. package/node_modules/@cchistory/domain/dist/evidence-values.js +80 -0
  83. package/node_modules/@cchistory/domain/dist/evidence-values.js.map +1 -0
  84. package/node_modules/@cchistory/domain/dist/index.d.ts +6 -0
  85. package/node_modules/@cchistory/domain/dist/index.d.ts.map +1 -1
  86. package/node_modules/@cchistory/domain/dist/index.js +5 -0
  87. package/node_modules/@cchistory/domain/dist/index.js.map +1 -1
  88. package/node_modules/@cchistory/domain/dist/masks.d.ts +31 -0
  89. package/node_modules/@cchistory/domain/dist/masks.d.ts.map +1 -0
  90. package/node_modules/@cchistory/domain/dist/masks.js +342 -0
  91. package/node_modules/@cchistory/domain/dist/masks.js.map +1 -0
  92. package/node_modules/@cchistory/domain/dist/parsed-session.d.ts +58 -0
  93. package/node_modules/@cchistory/domain/dist/parsed-session.d.ts.map +1 -0
  94. package/node_modules/@cchistory/domain/dist/parsed-session.js +2 -0
  95. package/node_modules/@cchistory/domain/dist/parsed-session.js.map +1 -0
  96. package/node_modules/@cchistory/domain/dist/query.d.ts +67 -0
  97. package/node_modules/@cchistory/domain/dist/query.d.ts.map +1 -0
  98. package/node_modules/@cchistory/domain/dist/query.js +2 -0
  99. package/node_modules/@cchistory/domain/dist/query.js.map +1 -0
  100. package/node_modules/@cchistory/domain/dist/token-evidence.d.ts +14 -0
  101. package/node_modules/@cchistory/domain/dist/token-evidence.d.ts.map +1 -0
  102. package/node_modules/@cchistory/domain/dist/token-evidence.js +247 -0
  103. package/node_modules/@cchistory/domain/dist/token-evidence.js.map +1 -0
  104. package/node_modules/@cchistory/domain/package.json +1 -1
  105. package/node_modules/@cchistory/live-runtime/dist/bootstrap.d.ts +1 -1
  106. package/node_modules/@cchistory/live-runtime/dist/bootstrap.d.ts.map +1 -1
  107. package/node_modules/@cchistory/live-runtime/dist/bootstrap.js +1 -1
  108. package/node_modules/@cchistory/live-runtime/dist/bootstrap.js.map +1 -1
  109. package/node_modules/@cchistory/live-runtime/dist/index.d.ts +30 -9
  110. package/node_modules/@cchistory/live-runtime/dist/index.d.ts.map +1 -1
  111. package/node_modules/@cchistory/live-runtime/dist/index.js +314 -143
  112. package/node_modules/@cchistory/live-runtime/dist/index.js.map +1 -1
  113. package/node_modules/@cchistory/live-runtime/dist/index.test.js +177 -20
  114. package/node_modules/@cchistory/live-runtime/dist/index.test.js.map +1 -1
  115. package/node_modules/@cchistory/live-runtime/dist/launcher-memory.d.ts +12 -0
  116. package/node_modules/@cchistory/live-runtime/dist/launcher-memory.d.ts.map +1 -0
  117. package/node_modules/@cchistory/live-runtime/dist/launcher-memory.js +44 -0
  118. package/node_modules/@cchistory/live-runtime/dist/launcher-memory.js.map +1 -0
  119. package/node_modules/@cchistory/live-runtime/dist/launcher-memory.test.d.ts +2 -0
  120. package/node_modules/@cchistory/live-runtime/dist/launcher-memory.test.d.ts.map +1 -0
  121. package/node_modules/@cchistory/live-runtime/dist/launcher-memory.test.js +20 -0
  122. package/node_modules/@cchistory/live-runtime/dist/launcher-memory.test.js.map +1 -0
  123. package/node_modules/@cchistory/live-runtime/dist/live-read-recovery.test.d.ts +2 -0
  124. package/node_modules/@cchistory/live-runtime/dist/live-read-recovery.test.d.ts.map +1 -0
  125. package/node_modules/@cchistory/live-runtime/dist/live-read-recovery.test.js +92 -0
  126. package/node_modules/@cchistory/live-runtime/dist/live-read-recovery.test.js.map +1 -0
  127. package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.d.ts +16 -0
  128. package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.d.ts.map +1 -0
  129. package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.js +55 -0
  130. package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.js.map +1 -0
  131. package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.d.ts +2 -0
  132. package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.d.ts.map +1 -0
  133. package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.js +192 -0
  134. package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.js.map +1 -0
  135. package/node_modules/@cchistory/live-runtime/dist/scan-guard.d.ts +22 -22
  136. package/node_modules/@cchistory/live-runtime/dist/scan-guard.d.ts.map +1 -1
  137. package/node_modules/@cchistory/live-runtime/dist/scan-guard.js +53 -47
  138. package/node_modules/@cchistory/live-runtime/dist/scan-guard.js.map +1 -1
  139. package/node_modules/@cchistory/live-runtime/dist/scan-guard.test.js +287 -83
  140. package/node_modules/@cchistory/live-runtime/dist/scan-guard.test.js.map +1 -1
  141. package/node_modules/@cchistory/live-runtime/dist/selective-query.d.ts +47 -0
  142. package/node_modules/@cchistory/live-runtime/dist/selective-query.d.ts.map +1 -0
  143. package/node_modules/@cchistory/live-runtime/dist/selective-query.js +15 -0
  144. package/node_modules/@cchistory/live-runtime/dist/selective-query.js.map +1 -0
  145. package/node_modules/@cchistory/live-runtime/dist/selective-query.test.d.ts +2 -0
  146. package/node_modules/@cchistory/live-runtime/dist/selective-query.test.d.ts.map +1 -0
  147. package/node_modules/@cchistory/live-runtime/dist/selective-query.test.js +171 -0
  148. package/node_modules/@cchistory/live-runtime/dist/selective-query.test.js.map +1 -0
  149. package/node_modules/@cchistory/live-runtime/dist/sql-query.d.ts +37 -0
  150. package/node_modules/@cchistory/live-runtime/dist/sql-query.d.ts.map +1 -0
  151. package/node_modules/@cchistory/live-runtime/dist/sql-query.js +301 -0
  152. package/node_modules/@cchistory/live-runtime/dist/sql-query.js.map +1 -0
  153. package/node_modules/@cchistory/live-runtime/dist/sql-query.test.d.ts +2 -0
  154. package/node_modules/@cchistory/live-runtime/dist/sql-query.test.d.ts.map +1 -0
  155. package/node_modules/@cchistory/live-runtime/dist/sql-query.test.js +67 -0
  156. package/node_modules/@cchistory/live-runtime/dist/sql-query.test.js.map +1 -0
  157. package/node_modules/@cchistory/live-runtime/dist/sql-worker.d.ts +2 -0
  158. package/node_modules/@cchistory/live-runtime/dist/sql-worker.d.ts.map +1 -0
  159. package/node_modules/@cchistory/live-runtime/dist/sql-worker.js +14 -0
  160. package/node_modules/@cchistory/live-runtime/dist/sql-worker.js.map +1 -0
  161. package/node_modules/@cchistory/live-runtime/dist/system-memory.d.ts +13 -10
  162. package/node_modules/@cchistory/live-runtime/dist/system-memory.d.ts.map +1 -1
  163. package/node_modules/@cchistory/live-runtime/dist/system-memory.js +61 -34
  164. package/node_modules/@cchistory/live-runtime/dist/system-memory.js.map +1 -1
  165. package/node_modules/@cchistory/live-runtime/dist/system-memory.test.d.ts +2 -0
  166. package/node_modules/@cchistory/live-runtime/dist/system-memory.test.d.ts.map +1 -0
  167. package/node_modules/@cchistory/live-runtime/dist/system-memory.test.js +76 -0
  168. package/node_modules/@cchistory/live-runtime/dist/system-memory.test.js.map +1 -0
  169. package/node_modules/@cchistory/live-runtime/package.json +1 -1
  170. package/node_modules/@cchistory/source-adapters/dist/core/discovery.test.js +2 -1
  171. package/node_modules/@cchistory/source-adapters/dist/core/discovery.test.js.map +1 -1
  172. package/node_modules/@cchistory/source-adapters/dist/core/factories.d.ts +2 -4
  173. package/node_modules/@cchistory/source-adapters/dist/core/factories.d.ts.map +1 -1
  174. package/node_modules/@cchistory/source-adapters/dist/core/factories.js +1 -23
  175. package/node_modules/@cchistory/source-adapters/dist/core/factories.js.map +1 -1
  176. package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.d.ts +25 -0
  177. package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.d.ts.map +1 -0
  178. package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.js +81 -0
  179. package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.js.map +1 -0
  180. package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.d.ts +2 -0
  181. package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.d.ts.map +1 -0
  182. package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.js +122 -0
  183. package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.js.map +1 -0
  184. package/node_modules/@cchistory/source-adapters/dist/core/git-project.d.ts +1 -1
  185. package/node_modules/@cchistory/source-adapters/dist/core/git-project.d.ts.map +1 -1
  186. package/node_modules/@cchistory/source-adapters/dist/core/git-project.js +2 -11
  187. package/node_modules/@cchistory/source-adapters/dist/core/git-project.js.map +1 -1
  188. package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.test.js +31 -1
  189. package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.test.js.map +1 -1
  190. package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts +4 -3
  191. package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts.map +1 -1
  192. package/node_modules/@cchistory/source-adapters/dist/core/parser.js +32 -13
  193. package/node_modules/@cchistory/source-adapters/dist/core/parser.js.map +1 -1
  194. package/node_modules/@cchistory/source-adapters/dist/core/probe.d.ts +8 -6
  195. package/node_modules/@cchistory/source-adapters/dist/core/probe.d.ts.map +1 -1
  196. package/node_modules/@cchistory/source-adapters/dist/core/probe.js +46 -45
  197. package/node_modules/@cchistory/source-adapters/dist/core/probe.js.map +1 -1
  198. package/node_modules/@cchistory/source-adapters/dist/core/projections.d.ts +2 -28
  199. package/node_modules/@cchistory/source-adapters/dist/core/projections.d.ts.map +1 -1
  200. package/node_modules/@cchistory/source-adapters/dist/core/projections.js +2 -695
  201. package/node_modules/@cchistory/source-adapters/dist/core/projections.js.map +1 -1
  202. package/node_modules/@cchistory/source-adapters/dist/core/projections.test.js +2 -1
  203. package/node_modules/@cchistory/source-adapters/dist/core/projections.test.js.map +1 -1
  204. package/node_modules/@cchistory/source-adapters/dist/core/read-budget.d.ts +18 -0
  205. package/node_modules/@cchistory/source-adapters/dist/core/read-budget.d.ts.map +1 -0
  206. package/node_modules/@cchistory/source-adapters/dist/core/read-budget.js +27 -0
  207. package/node_modules/@cchistory/source-adapters/dist/core/read-budget.js.map +1 -0
  208. package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.d.ts +2 -0
  209. package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.d.ts.map +1 -0
  210. package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.js +76 -0
  211. package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.js.map +1 -0
  212. package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.d.ts +6 -0
  213. package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.d.ts.map +1 -1
  214. package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.js +1 -1
  215. package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.js.map +1 -1
  216. package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.test.js +1 -1
  217. package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.test.js.map +1 -1
  218. package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts +1 -1
  219. package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts.map +1 -1
  220. package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js +1 -1
  221. package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js.map +1 -1
  222. package/node_modules/@cchistory/source-adapters/dist/core/token-usage.d.ts +1 -13
  223. package/node_modules/@cchistory/source-adapters/dist/core/token-usage.d.ts.map +1 -1
  224. package/node_modules/@cchistory/source-adapters/dist/core/token-usage.js +1 -246
  225. package/node_modules/@cchistory/source-adapters/dist/core/token-usage.js.map +1 -1
  226. package/node_modules/@cchistory/source-adapters/dist/core/tokens.test.js +1 -1
  227. package/node_modules/@cchistory/source-adapters/dist/core/tokens.test.js.map +1 -1
  228. package/node_modules/@cchistory/source-adapters/dist/core/type-guards.d.ts +1 -25
  229. package/node_modules/@cchistory/source-adapters/dist/core/type-guards.d.ts.map +1 -1
  230. package/node_modules/@cchistory/source-adapters/dist/core/type-guards.js +1 -79
  231. package/node_modules/@cchistory/source-adapters/dist/core/type-guards.js.map +1 -1
  232. package/node_modules/@cchistory/source-adapters/dist/core/types.d.ts +6 -35
  233. package/node_modules/@cchistory/source-adapters/dist/core/types.d.ts.map +1 -1
  234. package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.d.ts +2 -1
  235. package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.d.ts.map +1 -1
  236. package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.js +14 -10
  237. package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.js.map +1 -1
  238. package/node_modules/@cchistory/source-adapters/dist/index.d.ts +6 -0
  239. package/node_modules/@cchistory/source-adapters/dist/index.d.ts.map +1 -1
  240. package/node_modules/@cchistory/source-adapters/dist/index.js +4 -0
  241. package/node_modules/@cchistory/source-adapters/dist/index.js.map +1 -1
  242. package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts +2 -0
  243. package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts.map +1 -1
  244. package/node_modules/@cchistory/source-adapters/dist/index.test.js +2 -0
  245. package/node_modules/@cchistory/source-adapters/dist/index.test.js.map +1 -1
  246. package/node_modules/@cchistory/source-adapters/dist/masks.d.ts +1 -30
  247. package/node_modules/@cchistory/source-adapters/dist/masks.d.ts.map +1 -1
  248. package/node_modules/@cchistory/source-adapters/dist/masks.js +1 -341
  249. package/node_modules/@cchistory/source-adapters/dist/masks.js.map +1 -1
  250. package/node_modules/@cchistory/source-adapters/dist/platforms/accio.test.js +1 -1
  251. package/node_modules/@cchistory/source-adapters/dist/platforms/accio.test.js.map +1 -1
  252. package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.js +1 -1
  253. package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.js.map +1 -1
  254. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.test.js +2 -1
  255. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.test.js.map +1 -1
  256. package/node_modules/@cchistory/source-adapters/dist/platforms/claude.test.js +1 -1
  257. package/node_modules/@cchistory/source-adapters/dist/platforms/claude.test.js.map +1 -1
  258. package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.test.js +1 -1
  259. package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.test.js.map +1 -1
  260. package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.d.ts +14 -0
  261. package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.d.ts.map +1 -0
  262. package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.js +103 -0
  263. package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.js.map +1 -0
  264. package/node_modules/@cchistory/source-adapters/dist/platforms/codex.test.js +1 -1
  265. package/node_modules/@cchistory/source-adapters/dist/platforms/codex.test.js.map +1 -1
  266. package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.d.ts +2 -1
  267. package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.d.ts.map +1 -1
  268. package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.js +5 -3
  269. package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.js.map +1 -1
  270. package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.js +2 -1
  271. package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.js.map +1 -1
  272. package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.test.js +2 -1
  273. package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.test.js.map +1 -1
  274. package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.test.js +1 -1
  275. package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.test.js.map +1 -1
  276. package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.test.js +2 -1
  277. package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.test.js.map +1 -1
  278. package/node_modules/@cchistory/source-adapters/dist/platforms/grok.d.ts.map +1 -1
  279. package/node_modules/@cchistory/source-adapters/dist/platforms/grok.js +24 -1
  280. package/node_modules/@cchistory/source-adapters/dist/platforms/grok.js.map +1 -1
  281. package/node_modules/@cchistory/source-adapters/dist/platforms/grok.test.js +2 -1
  282. package/node_modules/@cchistory/source-adapters/dist/platforms/grok.test.js.map +1 -1
  283. package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.test.js +2 -1
  284. package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.test.js.map +1 -1
  285. package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.test.js +1 -1
  286. package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.test.js.map +1 -1
  287. package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.test.js +1 -1
  288. package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.test.js.map +1 -1
  289. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.test.js +2 -1
  290. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.test.js.map +1 -1
  291. package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.d.ts +2 -1
  292. package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.d.ts.map +1 -1
  293. package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.js +11 -9
  294. package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.js.map +1 -1
  295. package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.test.js +2 -1
  296. package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.test.js.map +1 -1
  297. package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.d.ts +8 -0
  298. package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.d.ts.map +1 -0
  299. package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.js +7 -0
  300. package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.js.map +1 -0
  301. package/node_modules/@cchistory/source-adapters/dist/test-helpers.js.map +1 -1
  302. package/node_modules/@cchistory/source-adapters/package.json +1 -1
  303. package/node_modules/commander/LICENSE +22 -0
  304. package/node_modules/commander/Readme.md +428 -0
  305. package/node_modules/commander/index.js +1224 -0
  306. package/node_modules/commander/package.json +38 -0
  307. package/node_modules/commander/typings/index.d.ts +310 -0
  308. package/node_modules/discontinuous-range/.npmignore +28 -0
  309. package/node_modules/discontinuous-range/.travis.yml +4 -0
  310. package/node_modules/discontinuous-range/LICENSE +21 -0
  311. package/node_modules/discontinuous-range/README.md +23 -0
  312. package/node_modules/discontinuous-range/index.js +144 -0
  313. package/node_modules/discontinuous-range/package.json +27 -0
  314. package/node_modules/discontinuous-range/test/main-test.js +96 -0
  315. package/node_modules/moo/LICENSE +29 -0
  316. package/node_modules/moo/README.md +385 -0
  317. package/node_modules/moo/moo.js +645 -0
  318. package/node_modules/moo/package.json +29 -0
  319. package/node_modules/nearley/LICENSE.txt +21 -0
  320. package/node_modules/nearley/README.md +80 -0
  321. package/node_modules/nearley/bin/nearley-railroad.js +121 -0
  322. package/node_modules/nearley/bin/nearley-test.js +64 -0
  323. package/node_modules/nearley/bin/nearley-unparse.js +29 -0
  324. package/node_modules/nearley/bin/nearleyc.js +38 -0
  325. package/node_modules/nearley/builtin/cow.ne +2 -0
  326. package/node_modules/nearley/builtin/number.ne +51 -0
  327. package/node_modules/nearley/builtin/postprocessors.ne +36 -0
  328. package/node_modules/nearley/builtin/string.ne +26 -0
  329. package/node_modules/nearley/builtin/whitespace.ne +5 -0
  330. package/node_modules/nearley/lib/compile.js +307 -0
  331. package/node_modules/nearley/lib/generate.js +244 -0
  332. package/node_modules/nearley/lib/lint.js +28 -0
  333. package/node_modules/nearley/lib/nearley-language-bootstrapped.js +132 -0
  334. package/node_modules/nearley/lib/nearley-language-bootstrapped.ne +126 -0
  335. package/node_modules/nearley/lib/nearley.js +564 -0
  336. package/node_modules/nearley/lib/stream.js +18 -0
  337. package/node_modules/nearley/lib/unparse.js +139 -0
  338. package/node_modules/nearley/package.json +63 -0
  339. package/node_modules/pgsql-ast-parser/ast-mapper.d.ts +237 -0
  340. package/node_modules/pgsql-ast-parser/ast-mapper.d.ts.map +1 -0
  341. package/node_modules/pgsql-ast-parser/ast-mapper.spec.d.ts +3 -0
  342. package/node_modules/pgsql-ast-parser/ast-mapper.spec.d.ts.map +1 -0
  343. package/node_modules/pgsql-ast-parser/ast-visitor.d.ts +33 -0
  344. package/node_modules/pgsql-ast-parser/ast-visitor.d.ts.map +1 -0
  345. package/node_modules/pgsql-ast-parser/ast-visitor.spec.d.ts +3 -0
  346. package/node_modules/pgsql-ast-parser/ast-visitor.spec.d.ts.map +1 -0
  347. package/node_modules/pgsql-ast-parser/index.d.ts +11 -0
  348. package/node_modules/pgsql-ast-parser/index.d.ts.map +1 -0
  349. package/node_modules/pgsql-ast-parser/index.js +6484 -0
  350. package/node_modules/pgsql-ast-parser/index.js.map +1 -0
  351. package/node_modules/pgsql-ast-parser/interfaces.d.ts +1 -0
  352. package/node_modules/pgsql-ast-parser/interfaces.d.ts.map +1 -0
  353. package/node_modules/pgsql-ast-parser/keywords.d.ts +2 -0
  354. package/node_modules/pgsql-ast-parser/keywords.d.ts.map +1 -0
  355. package/node_modules/pgsql-ast-parser/lexer.d.ts +15 -0
  356. package/node_modules/pgsql-ast-parser/lexer.d.ts.map +1 -0
  357. package/node_modules/pgsql-ast-parser/lexer.spec.d.ts +3 -0
  358. package/node_modules/pgsql-ast-parser/lexer.spec.d.ts.map +1 -0
  359. package/node_modules/pgsql-ast-parser/literal-syntaxes/array-lexer.d.ts +3 -0
  360. package/node_modules/pgsql-ast-parser/literal-syntaxes/array-lexer.d.ts.map +1 -0
  361. package/node_modules/pgsql-ast-parser/literal-syntaxes/array.ne.d.ts +29 -0
  362. package/node_modules/pgsql-ast-parser/literal-syntaxes/array.ne.d.ts.map +1 -0
  363. package/node_modules/pgsql-ast-parser/literal-syntaxes/array.spec.d.ts +3 -0
  364. package/node_modules/pgsql-ast-parser/literal-syntaxes/array.spec.d.ts.map +1 -0
  365. package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric-lexer.d.ts +3 -0
  366. package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric-lexer.d.ts.map +1 -0
  367. package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.ne.d.ts +29 -0
  368. package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.ne.d.ts.map +1 -0
  369. package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.spec.d.ts +3 -0
  370. package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.spec.d.ts.map +1 -0
  371. package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-builder.d.ts +10 -0
  372. package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-builder.d.ts.map +1 -0
  373. package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso-lexer.d.ts +3 -0
  374. package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso-lexer.d.ts.map +1 -0
  375. package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso.ne.d.ts +29 -0
  376. package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso.ne.d.ts.map +1 -0
  377. package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-lexer.d.ts +3 -0
  378. package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-lexer.d.ts.map +1 -0
  379. package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.ne.d.ts +29 -0
  380. package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.ne.d.ts.map +1 -0
  381. package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.spec.d.ts +3 -0
  382. package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.spec.d.ts.map +1 -0
  383. package/node_modules/pgsql-ast-parser/package.json +69 -0
  384. package/node_modules/pgsql-ast-parser/parser.d.ts +33 -0
  385. package/node_modules/pgsql-ast-parser/parser.d.ts.map +1 -0
  386. package/node_modules/pgsql-ast-parser/pg-escape.d.ts +2 -0
  387. package/node_modules/pgsql-ast-parser/pg-escape.d.ts.map +1 -0
  388. package/node_modules/pgsql-ast-parser/readme.md +255 -0
  389. package/node_modules/pgsql-ast-parser/src/ast-mapper.spec.ts +296 -0
  390. package/node_modules/pgsql-ast-parser/src/ast-mapper.ts +1378 -0
  391. package/node_modules/pgsql-ast-parser/src/ast-visitor.spec.ts +57 -0
  392. package/node_modules/pgsql-ast-parser/src/ast-visitor.ts +101 -0
  393. package/node_modules/pgsql-ast-parser/src/index.ts +10 -0
  394. package/node_modules/pgsql-ast-parser/src/interfaces.ts +0 -0
  395. package/node_modules/pgsql-ast-parser/src/keywords.ts +8 -0
  396. package/node_modules/pgsql-ast-parser/src/lexer.spec.ts +245 -0
  397. package/node_modules/pgsql-ast-parser/src/lexer.ts +267 -0
  398. package/node_modules/pgsql-ast-parser/src/literal-syntaxes/array-lexer.ts +27 -0
  399. package/node_modules/pgsql-ast-parser/src/literal-syntaxes/array.ne +18 -0
  400. package/node_modules/pgsql-ast-parser/src/literal-syntaxes/array.spec.ts +55 -0
  401. package/node_modules/pgsql-ast-parser/src/literal-syntaxes/geometric-lexer.ts +26 -0
  402. package/node_modules/pgsql-ast-parser/src/literal-syntaxes/geometric.ne +88 -0
  403. package/node_modules/pgsql-ast-parser/src/literal-syntaxes/geometric.spec.ts +131 -0
  404. package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-builder.ts +148 -0
  405. package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-iso-lexer.ts +17 -0
  406. package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-iso.ne +53 -0
  407. package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-lexer.ts +26 -0
  408. package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval.ne +54 -0
  409. package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval.spec.ts +106 -0
  410. package/node_modules/pgsql-ast-parser/src/parser.ts +142 -0
  411. package/node_modules/pgsql-ast-parser/src/pg-escape.ts +14 -0
  412. package/node_modules/pgsql-ast-parser/src/syntax/alter-index.ne +29 -0
  413. package/node_modules/pgsql-ast-parser/src/syntax/alter-index.spec.ts +35 -0
  414. package/node_modules/pgsql-ast-parser/src/syntax/alter-table.ne +123 -0
  415. package/node_modules/pgsql-ast-parser/src/syntax/alter-table.spec.ts +476 -0
  416. package/node_modules/pgsql-ast-parser/src/syntax/alter-type.ne +33 -0
  417. package/node_modules/pgsql-ast-parser/src/syntax/alter-type.spec.ts +29 -0
  418. package/node_modules/pgsql-ast-parser/src/syntax/ast.ts +1150 -0
  419. package/node_modules/pgsql-ast-parser/src/syntax/base.ne +369 -0
  420. package/node_modules/pgsql-ast-parser/src/syntax/create-extension.ne +17 -0
  421. package/node_modules/pgsql-ast-parser/src/syntax/create-extension.spec.ts +37 -0
  422. package/node_modules/pgsql-ast-parser/src/syntax/create-index.ne +62 -0
  423. package/node_modules/pgsql-ast-parser/src/syntax/create-index.spec.ts +245 -0
  424. package/node_modules/pgsql-ast-parser/src/syntax/create-table.ne +174 -0
  425. package/node_modules/pgsql-ast-parser/src/syntax/create-table.spec.ts +761 -0
  426. package/node_modules/pgsql-ast-parser/src/syntax/create-type.ne +40 -0
  427. package/node_modules/pgsql-ast-parser/src/syntax/create-type.spec.ts +32 -0
  428. package/node_modules/pgsql-ast-parser/src/syntax/create-view.ne +68 -0
  429. package/node_modules/pgsql-ast-parser/src/syntax/create-view.spec.ts +187 -0
  430. package/node_modules/pgsql-ast-parser/src/syntax/deallocate.ne +13 -0
  431. package/node_modules/pgsql-ast-parser/src/syntax/deallocate.spec.ts +19 -0
  432. package/node_modules/pgsql-ast-parser/src/syntax/delete.ne +36 -0
  433. package/node_modules/pgsql-ast-parser/src/syntax/delete.spec.ts +71 -0
  434. package/node_modules/pgsql-ast-parser/src/syntax/drop.ne +28 -0
  435. package/node_modules/pgsql-ast-parser/src/syntax/drop.spec.ts +77 -0
  436. package/node_modules/pgsql-ast-parser/src/syntax/edge-cases.spec.ts +41 -0
  437. package/node_modules/pgsql-ast-parser/src/syntax/expr.ne +350 -0
  438. package/node_modules/pgsql-ast-parser/src/syntax/expr.spec.ts +1638 -0
  439. package/node_modules/pgsql-ast-parser/src/syntax/functions.ne +114 -0
  440. package/node_modules/pgsql-ast-parser/src/syntax/functions.spec.ts +235 -0
  441. package/node_modules/pgsql-ast-parser/src/syntax/insert.ne +63 -0
  442. package/node_modules/pgsql-ast-parser/src/syntax/insert.spec.ts +292 -0
  443. package/node_modules/pgsql-ast-parser/src/syntax/main.ne +77 -0
  444. package/node_modules/pgsql-ast-parser/src/syntax/nearley.d.ts +3 -0
  445. package/node_modules/pgsql-ast-parser/src/syntax/prepare.ne +8 -0
  446. package/node_modules/pgsql-ast-parser/src/syntax/prepare.spec.ts +44 -0
  447. package/node_modules/pgsql-ast-parser/src/syntax/refresh-materialized-view.ne +19 -0
  448. package/node_modules/pgsql-ast-parser/src/syntax/refresh-materialized-view.spec.ts +42 -0
  449. package/node_modules/pgsql-ast-parser/src/syntax/select.ne +223 -0
  450. package/node_modules/pgsql-ast-parser/src/syntax/select.spec.ts +1063 -0
  451. package/node_modules/pgsql-ast-parser/src/syntax/sequence.ne +101 -0
  452. package/node_modules/pgsql-ast-parser/src/syntax/sequence.spec.ts +103 -0
  453. package/node_modules/pgsql-ast-parser/src/syntax/simple-statements.ne +168 -0
  454. package/node_modules/pgsql-ast-parser/src/syntax/simple-statements.spec.ts +327 -0
  455. package/node_modules/pgsql-ast-parser/src/syntax/spec-utils.ts +333 -0
  456. package/node_modules/pgsql-ast-parser/src/syntax/union.ne +18 -0
  457. package/node_modules/pgsql-ast-parser/src/syntax/union.spec.ts +125 -0
  458. package/node_modules/pgsql-ast-parser/src/syntax/update.ne +56 -0
  459. package/node_modules/pgsql-ast-parser/src/syntax/update.spec.ts +87 -0
  460. package/node_modules/pgsql-ast-parser/src/syntax/with.ne +41 -0
  461. package/node_modules/pgsql-ast-parser/src/syntax/with.spec.ts +155 -0
  462. package/node_modules/pgsql-ast-parser/src/to-sql.spec.ts +85 -0
  463. package/node_modules/pgsql-ast-parser/src/to-sql.ts +1555 -0
  464. package/node_modules/pgsql-ast-parser/src/utils.ts +47 -0
  465. package/node_modules/pgsql-ast-parser/syntax/alter-index.spec.d.ts +3 -0
  466. package/node_modules/pgsql-ast-parser/syntax/alter-index.spec.d.ts.map +1 -0
  467. package/node_modules/pgsql-ast-parser/syntax/alter-table.spec.d.ts +3 -0
  468. package/node_modules/pgsql-ast-parser/syntax/alter-table.spec.d.ts.map +1 -0
  469. package/node_modules/pgsql-ast-parser/syntax/alter-type.spec.d.ts +3 -0
  470. package/node_modules/pgsql-ast-parser/syntax/alter-type.spec.d.ts.map +1 -0
  471. package/node_modules/pgsql-ast-parser/syntax/ast.d.ts +826 -0
  472. package/node_modules/pgsql-ast-parser/syntax/ast.d.ts.map +1 -0
  473. package/node_modules/pgsql-ast-parser/syntax/create-extension.spec.d.ts +3 -0
  474. package/node_modules/pgsql-ast-parser/syntax/create-extension.spec.d.ts.map +1 -0
  475. package/node_modules/pgsql-ast-parser/syntax/create-index.spec.d.ts +3 -0
  476. package/node_modules/pgsql-ast-parser/syntax/create-index.spec.d.ts.map +1 -0
  477. package/node_modules/pgsql-ast-parser/syntax/create-table.spec.d.ts +3 -0
  478. package/node_modules/pgsql-ast-parser/syntax/create-table.spec.d.ts.map +1 -0
  479. package/node_modules/pgsql-ast-parser/syntax/create-type.spec.d.ts +3 -0
  480. package/node_modules/pgsql-ast-parser/syntax/create-type.spec.d.ts.map +1 -0
  481. package/node_modules/pgsql-ast-parser/syntax/create-view.spec.d.ts +3 -0
  482. package/node_modules/pgsql-ast-parser/syntax/create-view.spec.d.ts.map +1 -0
  483. package/node_modules/pgsql-ast-parser/syntax/deallocate.spec.d.ts +3 -0
  484. package/node_modules/pgsql-ast-parser/syntax/deallocate.spec.d.ts.map +1 -0
  485. package/node_modules/pgsql-ast-parser/syntax/delete.spec.d.ts +3 -0
  486. package/node_modules/pgsql-ast-parser/syntax/delete.spec.d.ts.map +1 -0
  487. package/node_modules/pgsql-ast-parser/syntax/drop.spec.d.ts +3 -0
  488. package/node_modules/pgsql-ast-parser/syntax/drop.spec.d.ts.map +1 -0
  489. package/node_modules/pgsql-ast-parser/syntax/edge-cases.spec.d.ts +3 -0
  490. package/node_modules/pgsql-ast-parser/syntax/edge-cases.spec.d.ts.map +1 -0
  491. package/node_modules/pgsql-ast-parser/syntax/expr.spec.d.ts +3 -0
  492. package/node_modules/pgsql-ast-parser/syntax/expr.spec.d.ts.map +1 -0
  493. package/node_modules/pgsql-ast-parser/syntax/functions.spec.d.ts +3 -0
  494. package/node_modules/pgsql-ast-parser/syntax/functions.spec.d.ts.map +1 -0
  495. package/node_modules/pgsql-ast-parser/syntax/insert.spec.d.ts +3 -0
  496. package/node_modules/pgsql-ast-parser/syntax/insert.spec.d.ts.map +1 -0
  497. package/node_modules/pgsql-ast-parser/syntax/main.ne.d.ts +29 -0
  498. package/node_modules/pgsql-ast-parser/syntax/main.ne.d.ts.map +1 -0
  499. package/node_modules/pgsql-ast-parser/syntax/prepare.spec.d.ts +3 -0
  500. package/node_modules/pgsql-ast-parser/syntax/prepare.spec.d.ts.map +1 -0
  501. package/node_modules/pgsql-ast-parser/syntax/refresh-materialized-view.spec.d.ts +3 -0
  502. package/node_modules/pgsql-ast-parser/syntax/refresh-materialized-view.spec.d.ts.map +1 -0
  503. package/node_modules/pgsql-ast-parser/syntax/select.spec.d.ts +3 -0
  504. package/node_modules/pgsql-ast-parser/syntax/select.spec.d.ts.map +1 -0
  505. package/node_modules/pgsql-ast-parser/syntax/sequence.spec.d.ts +3 -0
  506. package/node_modules/pgsql-ast-parser/syntax/sequence.spec.d.ts.map +1 -0
  507. package/node_modules/pgsql-ast-parser/syntax/simple-statements.spec.d.ts +3 -0
  508. package/node_modules/pgsql-ast-parser/syntax/simple-statements.spec.d.ts.map +1 -0
  509. package/node_modules/pgsql-ast-parser/syntax/spec-utils.d.ts +35 -0
  510. package/node_modules/pgsql-ast-parser/syntax/spec-utils.d.ts.map +1 -0
  511. package/node_modules/pgsql-ast-parser/syntax/union.spec.d.ts +3 -0
  512. package/node_modules/pgsql-ast-parser/syntax/union.spec.d.ts.map +1 -0
  513. package/node_modules/pgsql-ast-parser/syntax/update.spec.d.ts +3 -0
  514. package/node_modules/pgsql-ast-parser/syntax/update.spec.d.ts.map +1 -0
  515. package/node_modules/pgsql-ast-parser/syntax/with.spec.d.ts +3 -0
  516. package/node_modules/pgsql-ast-parser/syntax/with.spec.d.ts.map +1 -0
  517. package/node_modules/pgsql-ast-parser/to-sql.d.ts +7 -0
  518. package/node_modules/pgsql-ast-parser/to-sql.d.ts.map +1 -0
  519. package/node_modules/pgsql-ast-parser/to-sql.spec.d.ts +3 -0
  520. package/node_modules/pgsql-ast-parser/to-sql.spec.d.ts.map +1 -0
  521. package/node_modules/pgsql-ast-parser/utils.d.ts +16 -0
  522. package/node_modules/pgsql-ast-parser/utils.d.ts.map +1 -0
  523. package/node_modules/railroad-diagrams/.gitattributes +22 -0
  524. package/node_modules/railroad-diagrams/.npmignore +163 -0
  525. package/node_modules/railroad-diagrams/README.md +86 -0
  526. package/node_modules/railroad-diagrams/css-example.py-js +183 -0
  527. package/node_modules/railroad-diagrams/example.html +141 -0
  528. package/node_modules/railroad-diagrams/generator.html +59 -0
  529. package/node_modules/railroad-diagrams/package.json +23 -0
  530. package/node_modules/railroad-diagrams/railroad-diagrams.css +23 -0
  531. package/node_modules/railroad-diagrams/railroad-diagrams.js +524 -0
  532. package/node_modules/railroad-diagrams/railroad_diagrams.py +427 -0
  533. package/node_modules/randexp/LICENSE +19 -0
  534. package/node_modules/randexp/README.md +134 -0
  535. package/node_modules/randexp/lib/randexp.js +245 -0
  536. package/node_modules/randexp/package.json +48 -0
  537. package/node_modules/ret/LICENSE +19 -0
  538. package/node_modules/ret/README.md +183 -0
  539. package/node_modules/ret/lib/index.js +282 -0
  540. package/node_modules/ret/lib/positions.js +17 -0
  541. package/node_modules/ret/lib/sets.js +82 -0
  542. package/node_modules/ret/lib/types.js +10 -0
  543. package/node_modules/ret/lib/util.js +111 -0
  544. package/node_modules/ret/package.json +35 -0
  545. package/package.json +22 -6
  546. package/schemas/cchistory-lite-agent-v1.schema.json +6 -7
  547. package/schemas/cchistory-lite-error-v1.schema.json +58 -8
  548. package/schemas/cchistory-lite-query-result-v2.schema.json +66 -11
  549. package/schemas/cchistory-lite-query-result-v3.schema.json +219 -0
  550. package/schemas/cchistory-lite-query-v3.schema.json +57 -0
  551. package/schemas/cchistory-lite-source-inventory-v1.schema.json +72 -0
  552. package/skills/using-cchistory-lite/SKILL.md +126 -55
  553. package/node_modules/@cchistory/live-runtime/dist/node-memory.d.ts +0 -8
  554. package/node_modules/@cchistory/live-runtime/dist/node-memory.d.ts.map +0 -1
  555. package/node_modules/@cchistory/live-runtime/dist/node-memory.js +0 -110
  556. package/node_modules/@cchistory/live-runtime/dist/node-memory.js.map +0 -1
@@ -0,0 +1,296 @@
1
+ import 'mocha';
2
+ import 'chai';
3
+ import { parse as _parse, parseFirst } from './parser';
4
+ import { astMapper, assignChanged, IAstPartialMapper, MapperBuilder } from './ast-mapper';
5
+ import { assert, expect } from 'chai';
6
+ import { Expr } from './syntax/ast';
7
+ import { toSql } from './to-sql';
8
+
9
+ describe('Ast mapper', () => {
10
+
11
+ function parse(str: string) {
12
+ const ret = _parse(str);
13
+ if (ret.length !== 1) {
14
+ assert.fail('Expected single statement');
15
+ }
16
+ return ret[0];
17
+ }
18
+
19
+ function testExpr(statement: string, map: MapperBuilder, expr: Expr) {
20
+ const toMap = parse(statement);
21
+ const mapped = astMapper(map).statement(toMap);
22
+ assert.deepEqual(mapped, {
23
+ type: 'select',
24
+ columns: [{
25
+ expr
26
+ }]
27
+ })
28
+ }
29
+
30
+ function testExprs(statement: string, map: MapperBuilder, exprs: Expr[]) {
31
+ const toMap = parse(statement);
32
+ const mapped = astMapper(map).statement(toMap);
33
+ assert.deepEqual(mapped, {
34
+ type: 'select',
35
+ columns: exprs.map(expr => ({ expr })),
36
+ })
37
+ }
38
+
39
+ it('maps a select constant', () => {
40
+ testExpr('select 42', b => ({
41
+ constant: c => assignChanged(c, {
42
+ value: 51,
43
+ })
44
+ }), {
45
+ type: 'integer',
46
+ value: 51
47
+ });
48
+ });
49
+
50
+ it('maps binaries', () => {
51
+ testExpr('select 42+51', b => ({
52
+ binary: c => c.right
53
+ }), {
54
+ type: 'integer',
55
+ value: 51
56
+ });
57
+ });
58
+
59
+ it('maps unaries', () => {
60
+ testExpr('select -b', b => ({
61
+ unary: c => c.operand
62
+ }), {
63
+ type: 'ref',
64
+ name: 'b',
65
+ });
66
+ });
67
+
68
+
69
+ it('maps ternaries', () => {
70
+ testExpr('select a between b and 42', b => ({
71
+ ternary: c => c.hi
72
+ }), {
73
+ type: 'integer',
74
+ value: 42
75
+ });
76
+ });
77
+
78
+ it('maps array index', () => {
79
+ testExpr('select a[42]', b => ({
80
+ arrayIndex: c => c.index
81
+ }), {
82
+ type: 'integer',
83
+ value: 42
84
+ });
85
+ });
86
+
87
+ it('maps member', () => {
88
+ testExpr(`select a->'b'`, b => ({
89
+ member: c => c.operand,
90
+ }), {
91
+ type: 'ref',
92
+ name: 'a',
93
+ });
94
+ });
95
+
96
+
97
+ it('calls submap', () => {
98
+ testExpr(`select a->'b'`, b => ({
99
+ ref: c => assignChanged(c, { name: 'foo' }),
100
+ member: c => b.expr(c.operand),
101
+ }), {
102
+ type: 'ref',
103
+ name: 'foo',
104
+ });
105
+ });
106
+
107
+ it('maps case', () => {
108
+ testExpr('select case a when b then 1 end', b => ({
109
+ case: c => c.whens[0].when,
110
+ }), {
111
+ type: 'ref',
112
+ name: 'b',
113
+ });
114
+ });
115
+
116
+
117
+ it('maps cast', () => {
118
+ testExpr('select a::jsonb', b => ({
119
+ cast: c => c.operand
120
+ }), {
121
+ type: 'ref',
122
+ name: 'a',
123
+ });
124
+ });
125
+
126
+ it('maps call', () => {
127
+ testExpr('select fn(a)', b => ({
128
+ call: c => c.args[0],
129
+ }), {
130
+ type: 'ref',
131
+ name: 'a',
132
+ });
133
+ })
134
+
135
+ it('maps multiple calls', () => {
136
+ testExprs('select fn(a), fn(b), fn(c)', () => ({
137
+ call: c => c.args[0],
138
+ }), [
139
+ {
140
+ type: 'ref',
141
+ name: 'a',
142
+ }, {
143
+ type: 'ref',
144
+ name: 'b',
145
+ }, {
146
+ type: 'ref',
147
+ name: 'c',
148
+ }
149
+ ]);
150
+ })
151
+
152
+ it('maps array literal', () => {
153
+ testExpr('select (a,b)', b => ({
154
+ array: c => c.expressions[1],
155
+ }), {
156
+ type: 'ref',
157
+ name: 'b',
158
+ });
159
+ })
160
+
161
+ it('maps ref', () => {
162
+ testExpr('select a', b => ({
163
+ ref: x => assignChanged(x, { name: 'foo' })
164
+ }), {
165
+ type: 'ref',
166
+ name: 'foo',
167
+ });
168
+ });
169
+
170
+ it('maps deep', () => {
171
+ // create a mapper
172
+ const mapper = astMapper(map => ({
173
+ tableRef: t => {
174
+ if (t.name === 'foo') {
175
+ return {
176
+ // Dont do that... see below
177
+ // (I wrote this like that for the sake of explainability)
178
+ ...t,
179
+ name: 'bar',
180
+ }
181
+ }
182
+
183
+ // call the default implementation of 'tableRef'
184
+ // this will ensure that the subtree is also traversed.
185
+ return map.super().tableRef(t);
186
+ }
187
+ }))
188
+
189
+ // parse + map + reconvert to sql
190
+ const modified = mapper.statement(parseFirst('select * from foo'));
191
+
192
+ assert.exists(modified);
193
+ expect(toSql.statement(modified!)).to.equal('SELECT * FROM bar');
194
+ })
195
+
196
+
197
+ it('allows super call', () => {
198
+ // create a mapper
199
+ const mapper = astMapper(map => ({
200
+ tableRef: t => {
201
+ const sup = map.super();
202
+ return sup.tableRef(t);
203
+ }
204
+ }))
205
+
206
+ // parse + map + reconvert to sql
207
+ const modified = mapper.statement(parseFirst('select * from foo'));
208
+ assert.exists(modified);
209
+ expect(toSql.statement(modified!)).to.equal('SELECT * FROM foo');
210
+ })
211
+
212
+ it('removes node', () => {
213
+ // create a mapper
214
+ const mapper = astMapper(map => ({
215
+ ref: c => c.name === 'foo' ? null : c,
216
+ }))
217
+
218
+ // process sql
219
+ const result = mapper.statement(parseFirst('select foo, bar from test'));
220
+
221
+ expect(toSql.statement(result!)).to.deep.equal('SELECT bar FROM test');
222
+
223
+ })
224
+
225
+ it('removes WITH node if one of its contained statements is removed', () => {
226
+ // create a mapper
227
+ const mapper = astMapper(map => ({
228
+ statement: s => {
229
+ return (s.type !== 'select' && s.type !== 'with') ? null : map.super().statement(s)
230
+ },
231
+ }));
232
+
233
+ // process sql
234
+ const killed = mapper.statement(parse('with ids as (select id from t1) delete from t1 where 1=1 returning id'));
235
+ assert.isNull(killed, 'default mapper maps a WITH to null if its contained `in` statement gets mapped to null');
236
+ const survived = mapper.statement(parse('with ids as (select id from t1) select * from ids'));
237
+ assert.equal(toSql.statement(survived!), 'WITH ids AS (SELECT id FROM t1 ) SELECT * FROM ids');
238
+ });
239
+
240
+ it('maps insert with super() call', () => {
241
+
242
+ // create a mapper
243
+ const mapper = astMapper(map => ({
244
+ insert: i => map.super().insert({
245
+ ...i,
246
+ columns: i.columns?.filter(c => c.name !== 'a'),
247
+ })
248
+ }))
249
+
250
+ const source = parseFirst(`insert into test (a, b) values ('a', 'b')`);
251
+ const target = parseFirst(`insert into test (b) values ('a', 'b')`);
252
+ const mapped = mapper.statement(source);
253
+
254
+ expect(mapped).to.deep.equal(target);
255
+ })
256
+
257
+
258
+ it('runs deno test - match', () => {
259
+ const mapper = astMapper(map => ({
260
+ tableRef: t => {
261
+ if (t.name === 'foo') {
262
+ return {
263
+ ...t,
264
+ name: 'bar',
265
+ }
266
+ }
267
+ return map.super().tableRef(t);
268
+ }
269
+ }))
270
+
271
+ // parse + map + reconvert to sql
272
+ const modified = mapper.statement(parseFirst('select * from foo'));
273
+
274
+ expect(toSql.statement(modified!)).to.equal(`SELECT * FROM bar`);
275
+ })
276
+
277
+ it('runs deno test - nomatch', () => {
278
+ const mapper = astMapper(map => ({
279
+ tableRef: t => {
280
+ if (t.name === 'other') {
281
+ return {
282
+ ...t,
283
+ name: 'bar',
284
+ }
285
+ }
286
+ return map.super().tableRef(t);
287
+ }
288
+ }))
289
+
290
+ // parse + map + reconvert to sql
291
+ const modified = mapper.statement(parseFirst('select * from foo'));
292
+
293
+ expect(toSql.statement(modified!)).to.equal(`SELECT * FROM foo`);
294
+ })
295
+
296
+ });