@cchistory/lite 0.6.0 → 0.8.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 (308) hide show
  1. package/INSTALL.md +1 -1
  2. package/apps/lite-cli/dist/agent-contract.d.ts.map +1 -1
  3. package/apps/lite-cli/dist/agent-contract.js +41 -9
  4. package/apps/lite-cli/dist/agent-contract.js.map +1 -1
  5. package/apps/lite-cli/dist/agent-journeys.test.d.ts +2 -0
  6. package/apps/lite-cli/dist/agent-journeys.test.d.ts.map +1 -0
  7. package/apps/lite-cli/dist/agent-journeys.test.js +403 -0
  8. package/apps/lite-cli/dist/agent-journeys.test.js.map +1 -0
  9. package/apps/lite-cli/dist/index.d.ts.map +1 -1
  10. package/apps/lite-cli/dist/index.js +137 -60
  11. package/apps/lite-cli/dist/index.js.map +1 -1
  12. package/apps/lite-cli/dist/index.test.js +48 -5
  13. package/apps/lite-cli/dist/index.test.js.map +1 -1
  14. package/apps/lite-cli/dist/json-v2.d.ts.map +1 -1
  15. package/apps/lite-cli/dist/json-v2.js +8 -1
  16. package/apps/lite-cli/dist/json-v2.js.map +1 -1
  17. package/apps/lite-cli/dist/query.d.ts +15 -2
  18. package/apps/lite-cli/dist/query.d.ts.map +1 -1
  19. package/apps/lite-cli/dist/query.js +79 -4
  20. package/apps/lite-cli/dist/query.js.map +1 -1
  21. package/apps/lite-cli/dist/shell.d.ts +2 -1
  22. package/apps/lite-cli/dist/shell.d.ts.map +1 -1
  23. package/apps/lite-cli/dist/shell.js +20 -16
  24. package/apps/lite-cli/dist/shell.js.map +1 -1
  25. package/apps/lite-cli/dist/stats-command.d.ts +52 -0
  26. package/apps/lite-cli/dist/stats-command.d.ts.map +1 -0
  27. package/apps/lite-cli/dist/stats-command.js +322 -0
  28. package/apps/lite-cli/dist/stats-command.js.map +1 -0
  29. package/apps/lite-cli/dist/stats-command.test.d.ts +2 -0
  30. package/apps/lite-cli/dist/stats-command.test.d.ts.map +1 -0
  31. package/apps/lite-cli/dist/stats-command.test.js +154 -0
  32. package/apps/lite-cli/dist/stats-command.test.js.map +1 -0
  33. package/apps/lite-cli/dist/stats-render.d.ts +21 -0
  34. package/apps/lite-cli/dist/stats-render.d.ts.map +1 -0
  35. package/apps/lite-cli/dist/stats-render.js +207 -0
  36. package/apps/lite-cli/dist/stats-render.js.map +1 -0
  37. package/apps/lite-cli/dist/version.d.ts +1 -1
  38. package/apps/lite-cli/dist/version.js +1 -1
  39. package/apps/lite-tui/dist/index.d.ts.map +1 -1
  40. package/apps/lite-tui/dist/index.js +75 -4
  41. package/apps/lite-tui/dist/index.js.map +1 -1
  42. package/apps/lite-tui/dist/input.d.ts.map +1 -1
  43. package/apps/lite-tui/dist/input.js +124 -3
  44. package/apps/lite-tui/dist/input.js.map +1 -1
  45. package/apps/lite-tui/dist/model.d.ts +29 -4
  46. package/apps/lite-tui/dist/model.d.ts.map +1 -1
  47. package/apps/lite-tui/dist/model.js +91 -8
  48. package/apps/lite-tui/dist/model.js.map +1 -1
  49. package/apps/lite-tui/dist/render.d.ts +1 -1
  50. package/apps/lite-tui/dist/render.d.ts.map +1 -1
  51. package/apps/lite-tui/dist/render.js +21 -51
  52. package/apps/lite-tui/dist/render.js.map +1 -1
  53. package/apps/lite-tui/dist/state.d.ts +3 -1
  54. package/apps/lite-tui/dist/state.d.ts.map +1 -1
  55. package/apps/lite-tui/dist/state.js +31 -13
  56. package/apps/lite-tui/dist/state.js.map +1 -1
  57. package/apps/lite-tui/dist/state.test.js +118 -0
  58. package/apps/lite-tui/dist/state.test.js.map +1 -1
  59. package/apps/lite-tui/dist/stats-dashboard.test.d.ts +2 -0
  60. package/apps/lite-tui/dist/stats-dashboard.test.d.ts.map +1 -0
  61. package/apps/lite-tui/dist/stats-dashboard.test.js +191 -0
  62. package/apps/lite-tui/dist/stats-dashboard.test.js.map +1 -0
  63. package/apps/lite-tui/dist/stats-query.d.ts +11 -0
  64. package/apps/lite-tui/dist/stats-query.d.ts.map +1 -0
  65. package/apps/lite-tui/dist/stats-query.js +104 -0
  66. package/apps/lite-tui/dist/stats-query.js.map +1 -0
  67. package/apps/lite-tui/dist/stats-render.d.ts +9 -0
  68. package/apps/lite-tui/dist/stats-render.d.ts.map +1 -0
  69. package/apps/lite-tui/dist/stats-render.js +311 -0
  70. package/apps/lite-tui/dist/stats-render.js.map +1 -0
  71. package/apps/lite-tui/dist/stats-state.d.ts +121 -0
  72. package/apps/lite-tui/dist/stats-state.d.ts.map +1 -0
  73. package/apps/lite-tui/dist/stats-state.js +335 -0
  74. package/apps/lite-tui/dist/stats-state.js.map +1 -0
  75. package/apps/lite-tui/dist/version.d.ts +1 -1
  76. package/apps/lite-tui/dist/version.js +1 -1
  77. package/docs/guide/agent-evidence.md +154 -0
  78. package/docs/guide/for-agents.md +29 -10
  79. package/docs/guide/lite.md +31 -4
  80. package/docs/guide/pricing.example.json +38 -0
  81. package/docs/guide/query.md +10 -1
  82. package/node_modules/@cchistory/canonical/dist/conversation-evidence.d.ts +85 -0
  83. package/node_modules/@cchistory/canonical/dist/conversation-evidence.d.ts.map +1 -0
  84. package/node_modules/@cchistory/canonical/dist/conversation-evidence.js +191 -0
  85. package/node_modules/@cchistory/canonical/dist/conversation-evidence.js.map +1 -0
  86. package/node_modules/@cchistory/canonical/dist/conversation-evidence.test.d.ts +2 -0
  87. package/node_modules/@cchistory/canonical/dist/conversation-evidence.test.d.ts.map +1 -0
  88. package/node_modules/@cchistory/canonical/dist/conversation-evidence.test.js +105 -0
  89. package/node_modules/@cchistory/canonical/dist/conversation-evidence.test.js.map +1 -0
  90. package/node_modules/@cchistory/canonical/dist/index.d.ts +9 -2
  91. package/node_modules/@cchistory/canonical/dist/index.d.ts.map +1 -1
  92. package/node_modules/@cchistory/canonical/dist/index.js +9 -2
  93. package/node_modules/@cchistory/canonical/dist/index.js.map +1 -1
  94. package/node_modules/@cchistory/canonical/dist/index.test.js +62 -1
  95. package/node_modules/@cchistory/canonical/dist/index.test.js.map +1 -1
  96. package/node_modules/@cchistory/canonical/dist/model-pricing-catalog.d.ts +11 -0
  97. package/node_modules/@cchistory/canonical/dist/model-pricing-catalog.d.ts.map +1 -0
  98. package/node_modules/@cchistory/canonical/dist/model-pricing-catalog.js +96 -0
  99. package/node_modules/@cchistory/canonical/dist/model-pricing-catalog.js.map +1 -0
  100. package/node_modules/@cchistory/canonical/dist/projection-audit.d.ts +4 -3
  101. package/node_modules/@cchistory/canonical/dist/projection-audit.d.ts.map +1 -1
  102. package/node_modules/@cchistory/canonical/dist/projection-audit.js +34 -0
  103. package/node_modules/@cchistory/canonical/dist/projection-audit.js.map +1 -1
  104. package/node_modules/@cchistory/canonical/dist/query.js +1 -1
  105. package/node_modules/@cchistory/canonical/dist/query.js.map +1 -1
  106. package/node_modules/@cchistory/canonical/dist/read-order.d.ts +2 -0
  107. package/node_modules/@cchistory/canonical/dist/read-order.d.ts.map +1 -1
  108. package/node_modules/@cchistory/canonical/dist/read-order.js +10 -0
  109. package/node_modules/@cchistory/canonical/dist/read-order.js.map +1 -1
  110. package/node_modules/@cchistory/canonical/dist/read-status.d.ts +11 -0
  111. package/node_modules/@cchistory/canonical/dist/read-status.d.ts.map +1 -0
  112. package/node_modules/@cchistory/canonical/dist/read-status.js +14 -0
  113. package/node_modules/@cchistory/canonical/dist/read-status.js.map +1 -0
  114. package/node_modules/@cchistory/canonical/dist/session-family.js +3 -3
  115. package/node_modules/@cchistory/canonical/dist/session-family.js.map +1 -1
  116. package/node_modules/@cchistory/canonical/dist/session-interpreter.d.ts +7 -3
  117. package/node_modules/@cchistory/canonical/dist/session-interpreter.d.ts.map +1 -1
  118. package/node_modules/@cchistory/canonical/dist/session-interpreter.js +40 -14
  119. package/node_modules/@cchistory/canonical/dist/session-interpreter.js.map +1 -1
  120. package/node_modules/@cchistory/canonical/dist/usage-breakdown.d.ts +37 -0
  121. package/node_modules/@cchistory/canonical/dist/usage-breakdown.d.ts.map +1 -0
  122. package/node_modules/@cchistory/canonical/dist/usage-breakdown.js +274 -0
  123. package/node_modules/@cchistory/canonical/dist/usage-breakdown.js.map +1 -0
  124. package/node_modules/@cchistory/canonical/dist/usage-pricing-config.d.ts +11 -0
  125. package/node_modules/@cchistory/canonical/dist/usage-pricing-config.d.ts.map +1 -0
  126. package/node_modules/@cchistory/canonical/dist/usage-pricing-config.js +297 -0
  127. package/node_modules/@cchistory/canonical/dist/usage-pricing-config.js.map +1 -0
  128. package/node_modules/@cchistory/canonical/dist/usage-pricing.d.ts +28 -0
  129. package/node_modules/@cchistory/canonical/dist/usage-pricing.d.ts.map +1 -0
  130. package/node_modules/@cchistory/canonical/dist/usage-pricing.js +267 -0
  131. package/node_modules/@cchistory/canonical/dist/usage-pricing.js.map +1 -0
  132. package/node_modules/@cchistory/canonical/dist/usage-pricing.test.d.ts +2 -0
  133. package/node_modules/@cchistory/canonical/dist/usage-pricing.test.d.ts.map +1 -0
  134. package/node_modules/@cchistory/canonical/dist/usage-pricing.test.js +365 -0
  135. package/node_modules/@cchistory/canonical/dist/usage-pricing.test.js.map +1 -0
  136. package/node_modules/@cchistory/canonical/dist/usage-time.d.ts +53 -0
  137. package/node_modules/@cchistory/canonical/dist/usage-time.d.ts.map +1 -0
  138. package/node_modules/@cchistory/canonical/dist/usage-time.js +323 -0
  139. package/node_modules/@cchistory/canonical/dist/usage-time.js.map +1 -0
  140. package/node_modules/@cchistory/canonical/dist/usage.d.ts +46 -31
  141. package/node_modules/@cchistory/canonical/dist/usage.d.ts.map +1 -1
  142. package/node_modules/@cchistory/canonical/dist/usage.js +187 -96
  143. package/node_modules/@cchistory/canonical/dist/usage.js.map +1 -1
  144. package/node_modules/@cchistory/canonical/package.json +1 -1
  145. package/node_modules/@cchistory/domain/dist/conversation-evidence.d.ts +24 -0
  146. package/node_modules/@cchistory/domain/dist/conversation-evidence.d.ts.map +1 -0
  147. package/node_modules/@cchistory/domain/dist/conversation-evidence.js +2 -0
  148. package/node_modules/@cchistory/domain/dist/conversation-evidence.js.map +1 -0
  149. package/node_modules/@cchistory/domain/dist/index.d.ts +27 -2
  150. package/node_modules/@cchistory/domain/dist/index.d.ts.map +1 -1
  151. package/node_modules/@cchistory/domain/dist/index.js +1 -0
  152. package/node_modules/@cchistory/domain/dist/index.js.map +1 -1
  153. package/node_modules/@cchistory/domain/dist/usage-pricing.d.ts +145 -0
  154. package/node_modules/@cchistory/domain/dist/usage-pricing.d.ts.map +1 -0
  155. package/node_modules/@cchistory/domain/dist/usage-pricing.js +7 -0
  156. package/node_modules/@cchistory/domain/dist/usage-pricing.js.map +1 -0
  157. package/node_modules/@cchistory/domain/package.json +1 -1
  158. package/node_modules/@cchistory/live-runtime/dist/antigravity.test.d.ts +2 -0
  159. package/node_modules/@cchistory/live-runtime/dist/antigravity.test.d.ts.map +1 -0
  160. package/node_modules/@cchistory/live-runtime/dist/antigravity.test.js +104 -0
  161. package/node_modules/@cchistory/live-runtime/dist/antigravity.test.js.map +1 -0
  162. package/node_modules/@cchistory/live-runtime/dist/bounded-cache.d.ts +15 -0
  163. package/node_modules/@cchistory/live-runtime/dist/bounded-cache.d.ts.map +1 -0
  164. package/node_modules/@cchistory/live-runtime/dist/bounded-cache.js +44 -0
  165. package/node_modules/@cchistory/live-runtime/dist/bounded-cache.js.map +1 -0
  166. package/node_modules/@cchistory/live-runtime/dist/bounded-cache.test.d.ts +2 -0
  167. package/node_modules/@cchistory/live-runtime/dist/bounded-cache.test.d.ts.map +1 -0
  168. package/node_modules/@cchistory/live-runtime/dist/bounded-cache.test.js +45 -0
  169. package/node_modules/@cchistory/live-runtime/dist/bounded-cache.test.js.map +1 -0
  170. package/node_modules/@cchistory/live-runtime/dist/diagnostics.d.ts +7 -0
  171. package/node_modules/@cchistory/live-runtime/dist/diagnostics.d.ts.map +1 -0
  172. package/node_modules/@cchistory/live-runtime/dist/diagnostics.js +2 -0
  173. package/node_modules/@cchistory/live-runtime/dist/diagnostics.js.map +1 -0
  174. package/node_modules/@cchistory/live-runtime/dist/grok-bot.test.d.ts +2 -0
  175. package/node_modules/@cchistory/live-runtime/dist/grok-bot.test.d.ts.map +1 -0
  176. package/node_modules/@cchistory/live-runtime/dist/grok-bot.test.js +211 -0
  177. package/node_modules/@cchistory/live-runtime/dist/grok-bot.test.js.map +1 -0
  178. package/node_modules/@cchistory/live-runtime/dist/history-reader.d.ts +24 -0
  179. package/node_modules/@cchistory/live-runtime/dist/history-reader.d.ts.map +1 -0
  180. package/node_modules/@cchistory/live-runtime/dist/history-reader.js +155 -0
  181. package/node_modules/@cchistory/live-runtime/dist/history-reader.js.map +1 -0
  182. package/node_modules/@cchistory/live-runtime/dist/index.d.ts +102 -5
  183. package/node_modules/@cchistory/live-runtime/dist/index.d.ts.map +1 -1
  184. package/node_modules/@cchistory/live-runtime/dist/index.js +245 -58
  185. package/node_modules/@cchistory/live-runtime/dist/index.js.map +1 -1
  186. package/node_modules/@cchistory/live-runtime/dist/index.test.js +43 -2
  187. package/node_modules/@cchistory/live-runtime/dist/index.test.js.map +1 -1
  188. package/node_modules/@cchistory/live-runtime/dist/selective-query.d.ts +2 -1
  189. package/node_modules/@cchistory/live-runtime/dist/selective-query.d.ts.map +1 -1
  190. package/node_modules/@cchistory/live-runtime/dist/selective-query.js.map +1 -1
  191. package/node_modules/@cchistory/live-runtime/package.json +1 -1
  192. package/node_modules/@cchistory/source-adapters/dist/core/atomizer.d.ts.map +1 -1
  193. package/node_modules/@cchistory/source-adapters/dist/core/atomizer.js +10 -0
  194. package/node_modules/@cchistory/source-adapters/dist/core/atomizer.js.map +1 -1
  195. package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.d.ts +7 -0
  196. package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.d.ts.map +1 -1
  197. package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.js.map +1 -1
  198. package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.d.ts +12 -0
  199. package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.d.ts.map +1 -0
  200. package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.js +32 -0
  201. package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.js.map +1 -0
  202. package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.test.d.ts +2 -0
  203. package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.test.d.ts.map +1 -0
  204. package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.test.js +21 -0
  205. package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.test.js.map +1 -0
  206. package/node_modules/@cchistory/source-adapters/dist/core/discovery.d.ts.map +1 -1
  207. package/node_modules/@cchistory/source-adapters/dist/core/discovery.js +16 -2
  208. package/node_modules/@cchistory/source-adapters/dist/core/discovery.js.map +1 -1
  209. package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.d.ts +3 -1
  210. package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.d.ts.map +1 -1
  211. package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.js +56 -38
  212. package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.js.map +1 -1
  213. package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.test.js +46 -1
  214. package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.test.js.map +1 -1
  215. package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts +15 -4
  216. package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts.map +1 -1
  217. package/node_modules/@cchistory/source-adapters/dist/core/parser.js +181 -65
  218. package/node_modules/@cchistory/source-adapters/dist/core/parser.js.map +1 -1
  219. package/node_modules/@cchistory/source-adapters/dist/core/probe.d.ts.map +1 -1
  220. package/node_modules/@cchistory/source-adapters/dist/core/probe.js +223 -61
  221. package/node_modules/@cchistory/source-adapters/dist/core/probe.js.map +1 -1
  222. package/node_modules/@cchistory/source-adapters/dist/core/read-budget.d.ts +4 -1
  223. package/node_modules/@cchistory/source-adapters/dist/core/read-budget.d.ts.map +1 -1
  224. package/node_modules/@cchistory/source-adapters/dist/core/read-budget.js +4 -2
  225. package/node_modules/@cchistory/source-adapters/dist/core/read-budget.js.map +1 -1
  226. package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.js +58 -0
  227. package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.js.map +1 -1
  228. package/node_modules/@cchistory/source-adapters/dist/core/registry.test.js +2 -1
  229. package/node_modules/@cchistory/source-adapters/dist/core/registry.test.js.map +1 -1
  230. package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts +6 -2
  231. package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts.map +1 -1
  232. package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js +16 -5
  233. package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js.map +1 -1
  234. package/node_modules/@cchistory/source-adapters/dist/core/types.d.ts +5 -2
  235. package/node_modules/@cchistory/source-adapters/dist/core/types.d.ts.map +1 -1
  236. package/node_modules/@cchistory/source-adapters/dist/core/user-text.d.ts +9 -7
  237. package/node_modules/@cchistory/source-adapters/dist/core/user-text.d.ts.map +1 -1
  238. package/node_modules/@cchistory/source-adapters/dist/core/user-text.js +34 -8
  239. package/node_modules/@cchistory/source-adapters/dist/core/user-text.js.map +1 -1
  240. package/node_modules/@cchistory/source-adapters/dist/core/utils.test.js +11 -0
  241. package/node_modules/@cchistory/source-adapters/dist/core/utils.test.js.map +1 -1
  242. package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts +3 -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 +3 -0
  245. package/node_modules/@cchistory/source-adapters/dist/index.test.js.map +1 -1
  246. package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.js +49 -1
  247. package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.js.map +1 -1
  248. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/live.d.ts +1 -0
  249. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/live.d.ts.map +1 -1
  250. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/live.js +2 -0
  251. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/live.js.map +1 -1
  252. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/protobuf.d.ts +18 -0
  253. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/protobuf.d.ts.map +1 -0
  254. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/protobuf.js +105 -0
  255. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/protobuf.js.map +1 -0
  256. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/sqlite.d.ts +8 -0
  257. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/sqlite.d.ts.map +1 -0
  258. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/sqlite.js +227 -0
  259. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/sqlite.js.map +1 -0
  260. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/usage.d.ts +6 -0
  261. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/usage.d.ts.map +1 -0
  262. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/usage.js +22 -0
  263. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/usage.js.map +1 -0
  264. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity-sqlite.test.d.ts +2 -0
  265. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity-sqlite.test.d.ts.map +1 -0
  266. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity-sqlite.test.js +145 -0
  267. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity-sqlite.test.js.map +1 -0
  268. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.d.ts +1 -0
  269. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.d.ts.map +1 -1
  270. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.js +14 -5
  271. package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.js.map +1 -1
  272. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/runtime.d.ts +27 -0
  273. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/runtime.d.ts.map +1 -0
  274. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/runtime.js +262 -0
  275. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/runtime.js.map +1 -0
  276. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/title.d.ts +18 -0
  277. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/title.d.ts.map +1 -0
  278. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/title.js +101 -0
  279. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/title.js.map +1 -0
  280. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.d.ts +17 -0
  281. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.d.ts.map +1 -0
  282. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.js +145 -0
  283. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.js.map +1 -0
  284. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.test.d.ts +2 -0
  285. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.test.d.ts.map +1 -0
  286. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.test.js +423 -0
  287. package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.test.js.map +1 -0
  288. package/node_modules/@cchistory/source-adapters/dist/platforms/registry.d.ts.map +1 -1
  289. package/node_modules/@cchistory/source-adapters/dist/platforms/registry.js +2 -0
  290. package/node_modules/@cchistory/source-adapters/dist/platforms/registry.js.map +1 -1
  291. package/node_modules/@cchistory/source-adapters/dist/platforms/types.d.ts +1 -1
  292. package/node_modules/@cchistory/source-adapters/dist/platforms/types.d.ts.map +1 -1
  293. package/node_modules/@cchistory/source-adapters/dist/platforms/types.js +2 -1
  294. package/node_modules/@cchistory/source-adapters/dist/platforms/types.js.map +1 -1
  295. package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.d.ts +2 -0
  296. package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.d.ts.map +1 -1
  297. package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.js +48 -29
  298. package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.js.map +1 -1
  299. package/node_modules/@cchistory/source-adapters/package.json +1 -1
  300. package/package.json +5 -5
  301. package/schemas/cchistory-lite-agent-v1.schema.json +8 -5
  302. package/schemas/cchistory-lite-canonical-v1.schema.json +82 -0
  303. package/schemas/cchistory-lite-diagnostic-v1.schema.json +27 -0
  304. package/schemas/cchistory-lite-query-result-v2.schema.json +232 -4
  305. package/schemas/cchistory-lite-query-result-v3.schema.json +45 -1
  306. package/schemas/cchistory-lite-query-v2.schema.json +150 -8
  307. package/schemas/cchistory-lite-v2.schema.json +82 -0
  308. package/skills/using-cchistory-lite/SKILL.md +86 -128
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Title + hidden-prompt helpers for Grok Bot sidebar agents.
3
+ * Prefer profile.json name, then SAND_AGENT_PROFILE_UPDATE payload, then first
4
+ * real user text, then a short agent id. Never leave SAND_HIDDEN_PROMPT as title.
5
+ */
6
+ const SAND_HIDDEN_PREFIX = "[SAND_HIDDEN_PROMPT]";
7
+ const PROFILE_UPDATE_RE = /SAND_AGENT_PROFILE_UPDATE:v1:([A-Za-z0-9_-]+)/u;
8
+ const TURN_TAG_RE = /^\[t\d+[a-z]?\d*\]\s*/iu;
9
+ const TIMESTAMP_RE = /<timestamp>[\s\S]*?<\/timestamp>/giu;
10
+ const USER_QUERY_RE = /<user_query>\s*([\s\S]*?)<\/user_query>/iu;
11
+ export function isGrokBotHiddenPromptText(text) {
12
+ if (!text) {
13
+ return false;
14
+ }
15
+ const trimmed = text.replace(/\r\n/g, "\n").trim();
16
+ if (!trimmed) {
17
+ return false;
18
+ }
19
+ if (trimmed.startsWith(SAND_HIDDEN_PREFIX)) {
20
+ return true;
21
+ }
22
+ const query = trimmed.match(USER_QUERY_RE)?.[1]?.trim();
23
+ return Boolean(query?.startsWith(SAND_HIDDEN_PREFIX));
24
+ }
25
+ export function extractGrokBotProfileUpdateName(text) {
26
+ if (!text) {
27
+ return undefined;
28
+ }
29
+ const match = text.match(PROFILE_UPDATE_RE);
30
+ const token = match?.[1];
31
+ if (!token) {
32
+ return undefined;
33
+ }
34
+ const payload = decodeBase64JsonObject(token);
35
+ const name = typeof payload?.name === "string" ? payload.name.trim() : undefined;
36
+ return name || undefined;
37
+ }
38
+ export function cleanGrokBotUserTitleText(text) {
39
+ if (!text) {
40
+ return undefined;
41
+ }
42
+ let value = text.replace(/\r\n/g, "\n").trim();
43
+ if (!value || isGrokBotHiddenPromptText(value)) {
44
+ return undefined;
45
+ }
46
+ const query = value.match(USER_QUERY_RE)?.[1]?.trim();
47
+ if (query) {
48
+ value = query;
49
+ }
50
+ value = value
51
+ .replace(TIMESTAMP_RE, " ")
52
+ .replace(TURN_TAG_RE, "")
53
+ .replace(/\s+/gu, " ")
54
+ .trim();
55
+ if (!value || isGrokBotHiddenPromptText(value)) {
56
+ return undefined;
57
+ }
58
+ return value;
59
+ }
60
+ export function shortGrokBotAgentLabel(agentId) {
61
+ const compact = agentId.replace(/[^a-zA-Z0-9]/gu, "");
62
+ const short = (compact || agentId).slice(0, 8);
63
+ return short || "agent";
64
+ }
65
+ export function resolveGrokBotSessionTitle(options) {
66
+ const profileName = options.profileName?.trim();
67
+ if (profileName) {
68
+ return options.truncate(profileName, 72);
69
+ }
70
+ const profileTitle = options.profileTitle?.trim();
71
+ if (profileTitle) {
72
+ return options.truncate(profileTitle, 72);
73
+ }
74
+ const updateName = options.profileUpdateName?.trim();
75
+ if (updateName) {
76
+ return options.truncate(updateName, 72);
77
+ }
78
+ const cleaned = cleanGrokBotUserTitleText(options.firstUserText);
79
+ if (cleaned) {
80
+ return options.truncate(cleaned, 72);
81
+ }
82
+ return shortGrokBotAgentLabel(options.agentId);
83
+ }
84
+ function decodeBase64JsonObject(token) {
85
+ const pad = "=".repeat((4 - (token.length % 4)) % 4);
86
+ const padded = `${token}${pad}`;
87
+ for (const encoding of ["base64url", "base64"]) {
88
+ try {
89
+ const raw = Buffer.from(padded, encoding).toString("utf8");
90
+ const parsed = JSON.parse(raw);
91
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
92
+ return parsed;
93
+ }
94
+ }
95
+ catch {
96
+ // try next encoding
97
+ }
98
+ }
99
+ return undefined;
100
+ }
101
+ //# sourceMappingURL=title.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"title.js","sourceRoot":"","sources":["../../../src/platforms/grok-bot/title.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAClD,MAAM,iBAAiB,GAAG,gDAAgD,CAAC;AAC3E,MAAM,WAAW,GAAG,yBAAyB,CAAC;AAC9C,MAAM,YAAY,GAAG,qCAAqC,CAAC;AAC3D,MAAM,aAAa,GAAG,2CAA2C,CAAC;AAElE,MAAM,UAAU,yBAAyB,CAAC,IAAwB;IAChE,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IACnD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IACxD,OAAO,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAC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,sBAAsB,CAAC,KAAa;IAC3C,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,GAAG,KAAK,GAAG,GAAG,EAAE,CAAC;IAChC,KAAK,MAAM,QAAQ,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAU,EAAE,CAAC;QACxD,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAY,CAAC;YAC1C,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBACnE,OAAO,MAAiC,CAAC;YAC3C,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,oBAAoB;QACtB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { PlatformAdapter } from "./types.js";
2
+ export declare function isGrokBotStorePath(filePath: string): boolean;
3
+ export declare function isGrokBotTranscriptPath(filePath: string): boolean;
4
+ export declare function isGrokBotConversationBlobsPath(filePath: string): boolean;
5
+ export declare function parseGrokBotAgentIdFromPath(filePath: string): string | undefined;
6
+ export declare function resolveGrokBotDataRoot(baseDir: string): string;
7
+ export declare function listGrokBotSourceRoots(baseDir: string): string[];
8
+ export declare function uniqueExistingPaths(candidates: readonly string[]): string[];
9
+ /**
10
+ * Companion evidence for identity + SQLite WAL. conversation-blobs.db is an
11
+ * opaque LLM payload cache (often tens of MB) not referenced by store message
12
+ * rows; listing it for full-byte capture caused memory pressure and empty
13
+ * parse diagnostics without improving projection. Keep store.db as truth.
14
+ */
15
+ export declare function listGrokBotCompanionEvidencePaths(_baseDir: string, filePath: string): string[];
16
+ export declare const grokBotAdapter: PlatformAdapter;
17
+ //# sourceMappingURL=grok-bot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grok-bot.d.ts","sourceRoot":"","sources":["../../src/platforms/grok-bot.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAOlD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAM5D;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGjE;AAED,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAMxE;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAehF;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAS9D;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAUhE;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAY3E;AAYD;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAmB9F;AAED,eAAO,MAAM,cAAc,EAAE,eA0C5B,CAAC"}
@@ -0,0 +1,145 @@
1
+ import path from "node:path";
2
+ import { normalizePathSeparators } from "../core/path-utils.js";
3
+ const STORE_BASENAME = "store.db";
4
+ const BLOBS_BASENAME = "conversation-blobs.db";
5
+ const AGENTS_DIR = "agents";
6
+ const TRANSCRIPTS_DIR = "agent-transcripts";
7
+ export function isGrokBotStorePath(filePath) {
8
+ const normalized = normalizePathSeparators(filePath);
9
+ return (path.basename(normalized) === STORE_BASENAME &&
10
+ /\/agents\/[^/]+\/store\.db$/u.test(normalized));
11
+ }
12
+ export function isGrokBotTranscriptPath(filePath) {
13
+ const normalized = normalizePathSeparators(filePath);
14
+ return normalized.includes(`/${TRANSCRIPTS_DIR}/`) && normalized.endsWith(".jsonl");
15
+ }
16
+ export function isGrokBotConversationBlobsPath(filePath) {
17
+ const normalized = normalizePathSeparators(filePath);
18
+ return (path.basename(normalized) === BLOBS_BASENAME &&
19
+ /\/agents\/[^/]+\/conversation-blobs\.db$/u.test(normalized));
20
+ }
21
+ export function parseGrokBotAgentIdFromPath(filePath) {
22
+ const normalized = normalizePathSeparators(filePath);
23
+ const storeMatch = normalized.match(/\/agents\/([^/]+)\/store\.db$/u);
24
+ if (storeMatch?.[1]) {
25
+ return storeMatch[1];
26
+ }
27
+ const blobsMatch = normalized.match(/\/agents\/([^/]+)\/conversation-blobs\.db$/u);
28
+ if (blobsMatch?.[1]) {
29
+ return blobsMatch[1];
30
+ }
31
+ const transcriptMatch = normalized.match(/\/agent-transcripts\/([^/]+)\/[^/]+\.jsonl$/u);
32
+ if (transcriptMatch?.[1]) {
33
+ return transcriptMatch[1];
34
+ }
35
+ return undefined;
36
+ }
37
+ export function resolveGrokBotDataRoot(baseDir) {
38
+ const normalized = normalizePathSeparators(baseDir);
39
+ if (normalized.endsWith(`/${AGENTS_DIR}`) || path.basename(normalized) === AGENTS_DIR) {
40
+ return path.dirname(path.normalize(baseDir));
41
+ }
42
+ if (normalized.endsWith(`/${TRANSCRIPTS_DIR}`) || path.basename(normalized) === TRANSCRIPTS_DIR) {
43
+ return path.dirname(path.normalize(baseDir));
44
+ }
45
+ return path.normalize(baseDir);
46
+ }
47
+ export function listGrokBotSourceRoots(baseDir) {
48
+ const normalized = normalizePathSeparators(baseDir);
49
+ if (normalized.endsWith(`/${AGENTS_DIR}`) || path.basename(normalized) === AGENTS_DIR) {
50
+ return [path.normalize(baseDir)];
51
+ }
52
+ if (normalized.endsWith(`/${TRANSCRIPTS_DIR}`) || path.basename(normalized) === TRANSCRIPTS_DIR) {
53
+ return [path.normalize(baseDir)];
54
+ }
55
+ const root = path.normalize(baseDir);
56
+ return [path.join(root, AGENTS_DIR), path.join(root, TRANSCRIPTS_DIR)];
57
+ }
58
+ export function uniqueExistingPaths(candidates) {
59
+ const seen = new Set();
60
+ const unique = [];
61
+ for (const candidate of candidates) {
62
+ const normalized = path.normalize(candidate);
63
+ if (seen.has(normalized)) {
64
+ continue;
65
+ }
66
+ seen.add(normalized);
67
+ unique.push(normalized);
68
+ }
69
+ return unique;
70
+ }
71
+ function resolveGrokBotDataRootFromTranscript(filePath) {
72
+ const normalized = normalizePathSeparators(filePath);
73
+ const marker = `/${TRANSCRIPTS_DIR}/`;
74
+ const index = normalized.lastIndexOf(marker);
75
+ if (index < 0) {
76
+ return undefined;
77
+ }
78
+ return normalized.slice(0, index);
79
+ }
80
+ /**
81
+ * Companion evidence for identity + SQLite WAL. conversation-blobs.db is an
82
+ * opaque LLM payload cache (often tens of MB) not referenced by store message
83
+ * rows; listing it for full-byte capture caused memory pressure and empty
84
+ * parse diagnostics without improving projection. Keep store.db as truth.
85
+ */
86
+ export function listGrokBotCompanionEvidencePaths(_baseDir, filePath) {
87
+ const companions = [];
88
+ if (isGrokBotStorePath(filePath)) {
89
+ const agentDir = path.dirname(filePath);
90
+ companions.push(path.join(agentDir, "profile.json"), `${filePath}-wal`, `${filePath}-shm`);
91
+ }
92
+ if (isGrokBotTranscriptPath(filePath)) {
93
+ const agentId = parseGrokBotAgentIdFromPath(filePath);
94
+ const dataRoot = resolveGrokBotDataRootFromTranscript(filePath);
95
+ if (agentId && dataRoot) {
96
+ const agentDir = path.join(dataRoot, AGENTS_DIR, agentId);
97
+ companions.push(path.join(agentDir, "profile.json"));
98
+ }
99
+ }
100
+ return companions;
101
+ }
102
+ export const grokBotAdapter = {
103
+ platform: "grok_bot",
104
+ supportTier: "experimental",
105
+ sessionTargeting: "hybrid",
106
+ projectionBoundary: "source",
107
+ getDefaultBaseDirCandidates: (options) => {
108
+ const homeDir = options.homeDir ?? "";
109
+ const envRoots = [
110
+ process.env.GROK_BOT_HOME,
111
+ process.env.AGENT_DATA,
112
+ process.env.SAND_DATA,
113
+ ]
114
+ .map((value) => value?.trim())
115
+ .filter((value) => Boolean(value))
116
+ .map((value) => path.normalize(value));
117
+ return uniqueExistingPaths([
118
+ ...envRoots,
119
+ path.join(homeDir, "agent-data"),
120
+ path.join(homeDir, "sand-data"),
121
+ path.join(homeDir, ".agent-data"),
122
+ path.join(homeDir, ".sand-data"),
123
+ ]);
124
+ },
125
+ getSourceRoots: (baseDir) => listGrokBotSourceRoots(baseDir),
126
+ matchesSourceFile: (filePath) => {
127
+ if (isGrokBotStorePath(filePath)) {
128
+ return true;
129
+ }
130
+ // Inventory stays path-only. The probe selects a preferred store only after
131
+ // its budgeted parse succeeds, using attempt-local evidence rather than mtime.
132
+ return isGrokBotTranscriptPath(filePath);
133
+ },
134
+ getSourceFilePriority: (filePath) => {
135
+ if (isGrokBotStorePath(filePath)) {
136
+ return 0;
137
+ }
138
+ if (isGrokBotTranscriptPath(filePath)) {
139
+ return 1;
140
+ }
141
+ return 2;
142
+ },
143
+ getCompanionEvidencePaths: (baseDir, filePath) => listGrokBotCompanionEvidencePaths(baseDir, filePath),
144
+ };
145
+ //# sourceMappingURL=grok-bot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grok-bot.js","sourceRoot":"","sources":["../../src/platforms/grok-bot.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAGhE,MAAM,cAAc,GAAG,UAAU,CAAC;AAClC,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAC/C,MAAM,UAAU,GAAG,QAAQ,CAAC;AAC5B,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAE5C,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,MAAM,UAAU,GAAG,uBAAuB,CAAC,QAAQ,C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,QAAQ;YACX,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC;YAChC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC;YAC/B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC;SACjC,CAAC,CAAC;IACL,CAAC;IACD,cAAc,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC;IAC5D,iBAAiB,EAAE,CAAC,QAAQ,EAAE,EAAE;QAC9B,IAAI,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,4EAA4E;QAC5E,+EAA+E;QAC/E,OAAO,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IACD,qBAAqB,EAAE,CAAC,QAAQ,EAAE,EAAE;QAClC,IAAI,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjC,OAAO,CAAC,CAAC;QACX,CAAC;QACD,IAAI,uBAAuB,CAAC,QAAQ,CAAC,EAAE,CAAC;YACtC,OAAO,CAAC,CAAC;QACX,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;IACD,yBAAyB,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAC,iCAAiC,CAAC,OAAO,EAAE,QAAQ,CAAC;CACvG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=grok-bot.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grok-bot.test.d.ts","sourceRoot":"","sources":["../../src/platforms/grok-bot.test.ts"],"names":[],"mappings":""}