@hasna/mementos 0.14.86 → 0.14.87

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 (565) hide show
  1. package/dist/cli/__fixtures__/clean-fallback-stub-server.d.ts +2 -0
  2. package/dist/cli/__fixtures__/clean-fallback-stub-server.d.ts.map +1 -0
  3. package/dist/cli/__fixtures__/io-restore-stub-server.d.ts +2 -0
  4. package/dist/cli/__fixtures__/io-restore-stub-server.d.ts.map +1 -0
  5. package/dist/cli/brains.d.ts +3 -0
  6. package/dist/cli/brains.d.ts.map +1 -0
  7. package/dist/cli/commands/agent.d.ts +3 -0
  8. package/dist/cli/commands/agent.d.ts.map +1 -0
  9. package/dist/cli/commands/consolidation.d.ts +3 -0
  10. package/dist/cli/commands/consolidation.d.ts.map +1 -0
  11. package/dist/cli/commands/entity.d.ts +3 -0
  12. package/dist/cli/commands/entity.d.ts.map +1 -0
  13. package/dist/cli/commands/graph.d.ts +3 -0
  14. package/dist/cli/commands/graph.d.ts.map +1 -0
  15. package/dist/cli/commands/info-context.d.ts +3 -0
  16. package/dist/cli/commands/info-context.d.ts.map +1 -0
  17. package/dist/cli/commands/info-history.d.ts +3 -0
  18. package/dist/cli/commands/info-history.d.ts.map +1 -0
  19. package/dist/cli/commands/info-report.d.ts +3 -0
  20. package/dist/cli/commands/info-report.d.ts.map +1 -0
  21. package/dist/cli/commands/info-stale.d.ts +3 -0
  22. package/dist/cli/commands/info-stale.d.ts.map +1 -0
  23. package/dist/cli/commands/info-stats.d.ts +3 -0
  24. package/dist/cli/commands/info-stats.d.ts.map +1 -0
  25. package/dist/cli/commands/info.d.ts +12 -0
  26. package/dist/cli/commands/info.d.ts.map +1 -0
  27. package/dist/cli/commands/init.d.ts +3 -0
  28. package/dist/cli/commands/init.d.ts.map +1 -0
  29. package/dist/cli/commands/io-backup.d.ts +3 -0
  30. package/dist/cli/commands/io-backup.d.ts.map +1 -0
  31. package/dist/cli/commands/io-clean.d.ts +3 -0
  32. package/dist/cli/commands/io-clean.d.ts.map +1 -0
  33. package/dist/cli/commands/io-export.d.ts +3 -0
  34. package/dist/cli/commands/io-export.d.ts.map +1 -0
  35. package/dist/cli/commands/io-import.d.ts +3 -0
  36. package/dist/cli/commands/io-import.d.ts.map +1 -0
  37. package/dist/cli/commands/io-restore.d.ts +3 -0
  38. package/dist/cli/commands/io-restore.d.ts.map +1 -0
  39. package/dist/cli/commands/io.d.ts +12 -0
  40. package/dist/cli/commands/io.d.ts.map +1 -0
  41. package/dist/cli/commands/memory-cmd-bulk.d.ts +3 -0
  42. package/dist/cli/commands/memory-cmd-bulk.d.ts.map +1 -0
  43. package/dist/cli/commands/memory-cmd-chain.d.ts +3 -0
  44. package/dist/cli/commands/memory-cmd-chain.d.ts.map +1 -0
  45. package/dist/cli/commands/memory-cmd-crud.d.ts +3 -0
  46. package/dist/cli/commands/memory-cmd-crud.d.ts.map +1 -0
  47. package/dist/cli/commands/memory-cmd-diff.d.ts +3 -0
  48. package/dist/cli/commands/memory-cmd-diff.d.ts.map +1 -0
  49. package/dist/cli/commands/memory-cmd-list.d.ts +3 -0
  50. package/dist/cli/commands/memory-cmd-list.d.ts.map +1 -0
  51. package/dist/cli/commands/memory-cmd-recall-exit.d.ts +3 -0
  52. package/dist/cli/commands/memory-cmd-recall-exit.d.ts.map +1 -0
  53. package/dist/cli/commands/memory-cmd-recall.d.ts +3 -0
  54. package/dist/cli/commands/memory-cmd-recall.d.ts.map +1 -0
  55. package/dist/cli/commands/memory-cmd-remove.d.ts +3 -0
  56. package/dist/cli/commands/memory-cmd-remove.d.ts.map +1 -0
  57. package/dist/cli/commands/memory-cmd-search.d.ts +3 -0
  58. package/dist/cli/commands/memory-cmd-search.d.ts.map +1 -0
  59. package/dist/cli/commands/memory-cmd-tail.d.ts +3 -0
  60. package/dist/cli/commands/memory-cmd-tail.d.ts.map +1 -0
  61. package/dist/cli/commands/memory-cmd-util.d.ts +3 -0
  62. package/dist/cli/commands/memory-cmd-util.d.ts.map +1 -0
  63. package/dist/cli/commands/memory-cmd-view.d.ts +3 -0
  64. package/dist/cli/commands/memory-cmd-view.d.ts.map +1 -0
  65. package/dist/cli/commands/memory-cmd-watch.d.ts +3 -0
  66. package/dist/cli/commands/memory-cmd-watch.d.ts.map +1 -0
  67. package/dist/cli/commands/memory-cmd-when-to-use.d.ts +3 -0
  68. package/dist/cli/commands/memory-cmd-when-to-use.d.ts.map +1 -0
  69. package/dist/cli/commands/memory.d.ts +3 -0
  70. package/dist/cli/commands/memory.d.ts.map +1 -0
  71. package/dist/cli/commands/project-panel.d.ts +3 -0
  72. package/dist/cli/commands/project-panel.d.ts.map +1 -0
  73. package/dist/cli/commands/project.d.ts +3 -0
  74. package/dist/cli/commands/project.d.ts.map +1 -0
  75. package/dist/cli/commands/relation.d.ts +3 -0
  76. package/dist/cli/commands/relation.d.ts.map +1 -0
  77. package/dist/cli/commands/storage.d.ts +3 -0
  78. package/dist/cli/commands/storage.d.ts.map +1 -0
  79. package/dist/cli/commands/system-auto-memory.d.ts +3 -0
  80. package/dist/cli/commands/system-auto-memory.d.ts.map +1 -0
  81. package/dist/cli/commands/system-completions.d.ts +13 -0
  82. package/dist/cli/commands/system-completions.d.ts.map +1 -0
  83. package/dist/cli/commands/system-config.d.ts +3 -0
  84. package/dist/cli/commands/system-config.d.ts.map +1 -0
  85. package/dist/cli/commands/system-doctor.d.ts +3 -0
  86. package/dist/cli/commands/system-doctor.d.ts.map +1 -0
  87. package/dist/cli/commands/system-hooks.d.ts +3 -0
  88. package/dist/cli/commands/system-hooks.d.ts.map +1 -0
  89. package/dist/cli/commands/system-mcp.d.ts +3 -0
  90. package/dist/cli/commands/system-mcp.d.ts.map +1 -0
  91. package/dist/cli/commands/system-misc.d.ts +3 -0
  92. package/dist/cli/commands/system-misc.d.ts.map +1 -0
  93. package/dist/cli/commands/system-profile.d.ts +3 -0
  94. package/dist/cli/commands/system-profile.d.ts.map +1 -0
  95. package/dist/cli/commands/system-session.d.ts +3 -0
  96. package/dist/cli/commands/system-session.d.ts.map +1 -0
  97. package/dist/cli/commands/system-sessions.d.ts +3 -0
  98. package/dist/cli/commands/system-sessions.d.ts.map +1 -0
  99. package/dist/cli/commands/system-synthesis.d.ts +3 -0
  100. package/dist/cli/commands/system-synthesis.d.ts.map +1 -0
  101. package/dist/cli/commands/system-synthesized-profile.d.ts +3 -0
  102. package/dist/cli/commands/system-synthesized-profile.d.ts.map +1 -0
  103. package/dist/cli/commands/system-tools.d.ts +3 -0
  104. package/dist/cli/commands/system-tools.d.ts.map +1 -0
  105. package/dist/cli/commands/system-watch.d.ts +3 -0
  106. package/dist/cli/commands/system-watch.d.ts.map +1 -0
  107. package/dist/cli/commands/system.d.ts +3 -0
  108. package/dist/cli/commands/system.d.ts.map +1 -0
  109. package/dist/cli/exit-codes.d.ts +13 -0
  110. package/dist/cli/exit-codes.d.ts.map +1 -0
  111. package/dist/cli/global-options.d.ts +27 -0
  112. package/dist/cli/global-options.d.ts.map +1 -0
  113. package/dist/cli/helpers.d.ts +150 -0
  114. package/dist/cli/helpers.d.ts.map +1 -0
  115. package/dist/cli/index.d.ts +3 -0
  116. package/dist/cli/index.d.ts.map +1 -0
  117. package/dist/cli/index.js +204 -20
  118. package/dist/cli/register-all.d.ts +17 -0
  119. package/dist/cli/register-all.d.ts.map +1 -0
  120. package/dist/cli/startup-side-effects.d.ts +9 -0
  121. package/dist/cli/startup-side-effects.d.ts.map +1 -0
  122. package/dist/db/__fixtures__/fail-closed-stub-server.d.ts +2 -0
  123. package/dist/db/__fixtures__/fail-closed-stub-server.d.ts.map +1 -0
  124. package/dist/db/__fixtures__/list-filter-capture-server.d.ts +2 -0
  125. package/dist/db/__fixtures__/list-filter-capture-server.d.ts.map +1 -0
  126. package/dist/db/__fixtures__/list-filter-client-runner.d.ts +2 -0
  127. package/dist/db/__fixtures__/list-filter-client-runner.d.ts.map +1 -0
  128. package/dist/db/acl.d.ts +34 -0
  129. package/dist/db/acl.d.ts.map +1 -0
  130. package/dist/db/agents.d.ts +35 -0
  131. package/dist/db/agents.d.ts.map +1 -0
  132. package/dist/db/analytics.d.ts +124 -0
  133. package/dist/db/analytics.d.ts.map +1 -0
  134. package/dist/db/api-mode.d.ts +127 -0
  135. package/dist/db/api-mode.d.ts.map +1 -0
  136. package/dist/db/audit.d.ts +53 -0
  137. package/dist/db/audit.d.ts.map +1 -0
  138. package/dist/db/database.d.ts +26 -0
  139. package/dist/db/database.d.ts.map +1 -0
  140. package/dist/db/entities.d.ts +62 -0
  141. package/dist/db/entities.d.ts.map +1 -0
  142. package/dist/db/entity-memories.d.ts +34 -0
  143. package/dist/db/entity-memories.d.ts.map +1 -0
  144. package/dist/db/feedback.d.ts +9 -0
  145. package/dist/db/feedback.d.ts.map +1 -0
  146. package/dist/db/locks.d.ts +63 -0
  147. package/dist/db/locks.d.ts.map +1 -0
  148. package/dist/db/machines.d.ts +23 -0
  149. package/dist/db/machines.d.ts.map +1 -0
  150. package/dist/db/memories.d.ts +199 -0
  151. package/dist/db/memories.d.ts.map +1 -0
  152. package/dist/db/memory-links.d.ts +21 -0
  153. package/dist/db/memory-links.d.ts.map +1 -0
  154. package/dist/db/memory-project-link.d.ts +13 -0
  155. package/dist/db/memory-project-link.d.ts.map +1 -0
  156. package/dist/db/migrations.d.ts +3 -0
  157. package/dist/db/migrations.d.ts.map +1 -0
  158. package/dist/db/pg-migrate.d.ts +27 -0
  159. package/dist/db/pg-migrate.d.ts.map +1 -0
  160. package/dist/db/pg-migrations.d.ts +2 -0
  161. package/dist/db/pg-migrations.d.ts.map +1 -0
  162. package/dist/db/projects.d.ts +27 -0
  163. package/dist/db/projects.d.ts.map +1 -0
  164. package/dist/db/ratings.d.ts +23 -0
  165. package/dist/db/ratings.d.ts.map +1 -0
  166. package/dist/db/relations.d.ts +49 -0
  167. package/dist/db/relations.d.ts.map +1 -0
  168. package/dist/db/session-jobs.d.ts +67 -0
  169. package/dist/db/session-jobs.d.ts.map +1 -0
  170. package/dist/db/store-backend.d.ts +42 -0
  171. package/dist/db/store-backend.d.ts.map +1 -0
  172. package/dist/db/subscriptions.d.ts +24 -0
  173. package/dist/db/subscriptions.d.ts.map +1 -0
  174. package/dist/db/synthesis.d.ts +101 -0
  175. package/dist/db/synthesis.d.ts.map +1 -0
  176. package/dist/db/tasks.d.ts +89 -0
  177. package/dist/db/tasks.d.ts.map +1 -0
  178. package/dist/db/tool-events.d.ts +27 -0
  179. package/dist/db/tool-events.d.ts.map +1 -0
  180. package/dist/db/webhook_hooks.d.ts +48 -0
  181. package/dist/db/webhook_hooks.d.ts.map +1 -0
  182. package/dist/diagnostics/historical-project-registration-receipt.d.ts +39 -0
  183. package/dist/diagnostics/historical-project-registration-receipt.d.ts.map +1 -0
  184. package/dist/generated/storage-kit/backend.d.ts +20 -0
  185. package/dist/generated/storage-kit/backend.d.ts.map +1 -0
  186. package/dist/generated/storage-kit/health.d.ts +20 -0
  187. package/dist/generated/storage-kit/health.d.ts.map +1 -0
  188. package/dist/generated/storage-kit/index.d.ts +8 -0
  189. package/dist/generated/storage-kit/index.d.ts.map +1 -0
  190. package/dist/generated/storage-kit/migrations.d.ts +48 -0
  191. package/dist/generated/storage-kit/migrations.d.ts.map +1 -0
  192. package/dist/generated/storage-kit/own.d.ts +11 -0
  193. package/dist/generated/storage-kit/own.d.ts.map +1 -0
  194. package/dist/generated/storage-kit/pool.d.ts +35 -0
  195. package/dist/generated/storage-kit/pool.d.ts.map +1 -0
  196. package/dist/generated/storage-kit/query.d.ts +36 -0
  197. package/dist/generated/storage-kit/query.d.ts.map +1 -0
  198. package/dist/generated/storage-kit/tls.d.ts +53 -0
  199. package/dist/generated/storage-kit/tls.d.ts.map +1 -0
  200. package/dist/index.d.ts +45 -0
  201. package/dist/index.d.ts.map +1 -0
  202. package/dist/index.js +2 -2
  203. package/dist/lib/activation-matcher.d.ts +17 -0
  204. package/dist/lib/activation-matcher.d.ts.map +1 -0
  205. package/dist/lib/asmr/categorizer.d.ts +31 -0
  206. package/dist/lib/asmr/categorizer.d.ts.map +1 -0
  207. package/dist/lib/asmr/context-agent.d.ts +4 -0
  208. package/dist/lib/asmr/context-agent.d.ts.map +1 -0
  209. package/dist/lib/asmr/ensemble.d.ts +23 -0
  210. package/dist/lib/asmr/ensemble.d.ts.map +1 -0
  211. package/dist/lib/asmr/fact-agent.d.ts +4 -0
  212. package/dist/lib/asmr/fact-agent.d.ts.map +1 -0
  213. package/dist/lib/asmr/index.d.ts +7 -0
  214. package/dist/lib/asmr/index.d.ts.map +1 -0
  215. package/dist/lib/asmr/orchestrator.d.ts +4 -0
  216. package/dist/lib/asmr/orchestrator.d.ts.map +1 -0
  217. package/dist/lib/asmr/recall.d.ts +3 -0
  218. package/dist/lib/asmr/recall.d.ts.map +1 -0
  219. package/dist/lib/asmr/temporal-agent.d.ts +4 -0
  220. package/dist/lib/asmr/temporal-agent.d.ts.map +1 -0
  221. package/dist/lib/asmr/types.d.ts +27 -0
  222. package/dist/lib/asmr/types.d.ts.map +1 -0
  223. package/dist/lib/auto-inject-orchestrator.d.ts +57 -0
  224. package/dist/lib/auto-inject-orchestrator.d.ts.map +1 -0
  225. package/dist/lib/auto-memory-queue.d.ts +48 -0
  226. package/dist/lib/auto-memory-queue.d.ts.map +1 -0
  227. package/dist/lib/auto-memory.d.ts +19 -0
  228. package/dist/lib/auto-memory.d.ts.map +1 -0
  229. package/dist/lib/bench.d.ts +20 -0
  230. package/dist/lib/bench.d.ts.map +1 -0
  231. package/dist/lib/built-in-hooks.d.ts +32 -0
  232. package/dist/lib/built-in-hooks.d.ts.map +1 -0
  233. package/dist/lib/channel-pusher.d.ts +39 -0
  234. package/dist/lib/channel-pusher.d.ts.map +1 -0
  235. package/dist/lib/config.d.ts +9 -0
  236. package/dist/lib/config.d.ts.map +1 -0
  237. package/dist/lib/connectors/files.d.ts +8 -0
  238. package/dist/lib/connectors/files.d.ts.map +1 -0
  239. package/dist/lib/connectors/github.d.ts +7 -0
  240. package/dist/lib/connectors/github.d.ts.map +1 -0
  241. package/dist/lib/connectors/index.d.ts +12 -0
  242. package/dist/lib/connectors/index.d.ts.map +1 -0
  243. package/dist/lib/connectors/notion.d.ts +7 -0
  244. package/dist/lib/connectors/notion.d.ts.map +1 -0
  245. package/dist/lib/connectors/types.d.ts +27 -0
  246. package/dist/lib/connectors/types.d.ts.map +1 -0
  247. package/dist/lib/consolidation.d.ts +52 -0
  248. package/dist/lib/consolidation.d.ts.map +1 -0
  249. package/dist/lib/context-extractor.d.ts +14 -0
  250. package/dist/lib/context-extractor.d.ts.map +1 -0
  251. package/dist/lib/context.d.ts +36 -0
  252. package/dist/lib/context.d.ts.map +1 -0
  253. package/dist/lib/contradiction.d.ts +50 -0
  254. package/dist/lib/contradiction.d.ts.map +1 -0
  255. package/dist/lib/decay.d.ts +35 -0
  256. package/dist/lib/decay.d.ts.map +1 -0
  257. package/dist/lib/dedup.d.ts +33 -0
  258. package/dist/lib/dedup.d.ts.map +1 -0
  259. package/dist/lib/duration.d.ts +28 -0
  260. package/dist/lib/duration.d.ts.map +1 -0
  261. package/dist/lib/embeddings.d.ts +20 -0
  262. package/dist/lib/embeddings.d.ts.map +1 -0
  263. package/dist/lib/enum-validation.d.ts +20 -0
  264. package/dist/lib/enum-validation.d.ts.map +1 -0
  265. package/dist/lib/export-v1.d.ts +30 -0
  266. package/dist/lib/export-v1.d.ts.map +1 -0
  267. package/dist/lib/extractor.d.ts +9 -0
  268. package/dist/lib/extractor.d.ts.map +1 -0
  269. package/dist/lib/extractors/audio.d.ts +8 -0
  270. package/dist/lib/extractors/audio.d.ts.map +1 -0
  271. package/dist/lib/extractors/index.d.ts +12 -0
  272. package/dist/lib/extractors/index.d.ts.map +1 -0
  273. package/dist/lib/extractors/ocr.d.ts +7 -0
  274. package/dist/lib/extractors/ocr.d.ts.map +1 -0
  275. package/dist/lib/extractors/pdf.d.ts +7 -0
  276. package/dist/lib/extractors/pdf.d.ts.map +1 -0
  277. package/dist/lib/extractors/types.d.ts +12 -0
  278. package/dist/lib/extractors/types.d.ts.map +1 -0
  279. package/dist/lib/file-deps.d.ts +27 -0
  280. package/dist/lib/file-deps.d.ts.map +1 -0
  281. package/dist/lib/focus.d.ts +58 -0
  282. package/dist/lib/focus.d.ts.map +1 -0
  283. package/dist/lib/gatherer.d.ts +16 -0
  284. package/dist/lib/gatherer.d.ts.map +1 -0
  285. package/dist/lib/gdpr.d.ts +39 -0
  286. package/dist/lib/gdpr.d.ts.map +1 -0
  287. package/dist/lib/hooks.d.ts +50 -0
  288. package/dist/lib/hooks.d.ts.map +1 -0
  289. package/dist/lib/importers/index.d.ts +38 -0
  290. package/dist/lib/importers/index.d.ts.map +1 -0
  291. package/dist/lib/injector.d.ts +89 -0
  292. package/dist/lib/injector.d.ts.map +1 -0
  293. package/dist/lib/machine-visibility.d.ts +6 -0
  294. package/dist/lib/machine-visibility.d.ts.map +1 -0
  295. package/dist/lib/matryoshka.d.ts +50 -0
  296. package/dist/lib/matryoshka.d.ts.map +1 -0
  297. package/dist/lib/memory-lock.d.ts +58 -0
  298. package/dist/lib/memory-lock.d.ts.map +1 -0
  299. package/dist/lib/model-config.d.ts +14 -0
  300. package/dist/lib/model-config.d.ts.map +1 -0
  301. package/dist/lib/open-sessions-connector.d.ts +60 -0
  302. package/dist/lib/open-sessions-connector.d.ts.map +1 -0
  303. package/dist/lib/package-version.d.ts +3 -0
  304. package/dist/lib/package-version.d.ts.map +1 -0
  305. package/dist/lib/poisoning.d.ts +19 -0
  306. package/dist/lib/poisoning.d.ts.map +1 -0
  307. package/dist/lib/poll.d.ts +17 -0
  308. package/dist/lib/poll.d.ts.map +1 -0
  309. package/dist/lib/procedural-extractor.d.ts +21 -0
  310. package/dist/lib/procedural-extractor.d.ts.map +1 -0
  311. package/dist/lib/profile-sync.d.ts +20 -0
  312. package/dist/lib/profile-sync.d.ts.map +1 -0
  313. package/dist/lib/profile-synthesizer.d.ts +20 -0
  314. package/dist/lib/profile-synthesizer.d.ts.map +1 -0
  315. package/dist/lib/project-detect.d.ts +18 -0
  316. package/dist/lib/project-detect.d.ts.map +1 -0
  317. package/dist/lib/project-panel.d.ts +7 -0
  318. package/dist/lib/project-panel.d.ts.map +1 -0
  319. package/dist/lib/providers/anthropic.d.ts +21 -0
  320. package/dist/lib/providers/anthropic.d.ts.map +1 -0
  321. package/dist/lib/providers/base.d.ts +96 -0
  322. package/dist/lib/providers/base.d.ts.map +1 -0
  323. package/dist/lib/providers/cerebras.d.ts +20 -0
  324. package/dist/lib/providers/cerebras.d.ts.map +1 -0
  325. package/dist/lib/providers/grok.d.ts +19 -0
  326. package/dist/lib/providers/grok.d.ts.map +1 -0
  327. package/dist/lib/providers/index.d.ts +7 -0
  328. package/dist/lib/providers/index.d.ts.map +1 -0
  329. package/dist/lib/providers/openai-compat.d.ts +18 -0
  330. package/dist/lib/providers/openai-compat.d.ts.map +1 -0
  331. package/dist/lib/providers/openai.d.ts +20 -0
  332. package/dist/lib/providers/openai.d.ts.map +1 -0
  333. package/dist/lib/providers/registry.d.ts +38 -0
  334. package/dist/lib/providers/registry.d.ts.map +1 -0
  335. package/dist/lib/quality.d.ts +16 -0
  336. package/dist/lib/quality.d.ts.map +1 -0
  337. package/dist/lib/redact.d.ts +26 -0
  338. package/dist/lib/redact.d.ts.map +1 -0
  339. package/dist/lib/reflection.d.ts +83 -0
  340. package/dist/lib/reflection.d.ts.map +1 -0
  341. package/dist/lib/retention.d.ts +17 -0
  342. package/dist/lib/retention.d.ts.map +1 -0
  343. package/dist/lib/retired-storage-mode.d.ts +11 -0
  344. package/dist/lib/retired-storage-mode.d.ts.map +1 -0
  345. package/dist/lib/search.d.ts +52 -0
  346. package/dist/lib/search.d.ts.map +1 -0
  347. package/dist/lib/session-auto-resolve.d.ts +28 -0
  348. package/dist/lib/session-auto-resolve.d.ts.map +1 -0
  349. package/dist/lib/session-processor.d.ts +38 -0
  350. package/dist/lib/session-processor.d.ts.map +1 -0
  351. package/dist/lib/session-queue.d.ts +28 -0
  352. package/dist/lib/session-queue.d.ts.map +1 -0
  353. package/dist/lib/session-registry.d.ts +47 -0
  354. package/dist/lib/session-registry.d.ts.map +1 -0
  355. package/dist/lib/session-start-briefing.d.ts +10 -0
  356. package/dist/lib/session-start-briefing.d.ts.map +1 -0
  357. package/dist/lib/session-watcher.d.ts +30 -0
  358. package/dist/lib/session-watcher.d.ts.map +1 -0
  359. package/dist/lib/storage-sync.d.ts +45 -0
  360. package/dist/lib/storage-sync.d.ts.map +1 -0
  361. package/dist/lib/sync.d.ts +10 -0
  362. package/dist/lib/sync.d.ts.map +1 -0
  363. package/dist/lib/synthesis/corpus-builder.d.ts +30 -0
  364. package/dist/lib/synthesis/corpus-builder.d.ts.map +1 -0
  365. package/dist/lib/synthesis/executor.d.ts +14 -0
  366. package/dist/lib/synthesis/executor.d.ts.map +1 -0
  367. package/dist/lib/synthesis/index.d.ts +37 -0
  368. package/dist/lib/synthesis/index.d.ts.map +1 -0
  369. package/dist/lib/synthesis/llm-analyzer.d.ts +18 -0
  370. package/dist/lib/synthesis/llm-analyzer.d.ts.map +1 -0
  371. package/dist/lib/synthesis/metrics.d.ts +13 -0
  372. package/dist/lib/synthesis/metrics.d.ts.map +1 -0
  373. package/dist/lib/synthesis/scheduler.d.ts +18 -0
  374. package/dist/lib/synthesis/scheduler.d.ts.map +1 -0
  375. package/dist/lib/synthesis/validator.d.ts +19 -0
  376. package/dist/lib/synthesis/validator.d.ts.map +1 -0
  377. package/dist/lib/task-runner.d.ts +37 -0
  378. package/dist/lib/task-runner.d.ts.map +1 -0
  379. package/dist/lib/tool-lesson-extractor.d.ts +24 -0
  380. package/dist/lib/tool-lesson-extractor.d.ts.map +1 -0
  381. package/dist/lib/tool-memory-synthesizer.d.ts +28 -0
  382. package/dist/lib/tool-memory-synthesizer.d.ts.map +1 -0
  383. package/dist/lib/topic-clusterer.d.ts +21 -0
  384. package/dist/lib/topic-clusterer.d.ts.map +1 -0
  385. package/dist/lib/when-to-use-generator.d.ts +22 -0
  386. package/dist/lib/when-to-use-generator.d.ts.map +1 -0
  387. package/dist/mcp/http.d.ts +17 -0
  388. package/dist/mcp/http.d.ts.map +1 -0
  389. package/dist/mcp/index.d.ts +6 -0
  390. package/dist/mcp/index.d.ts.map +1 -0
  391. package/dist/mcp/index.js +167 -10
  392. package/dist/mcp/memory-broadcast.d.ts +12 -0
  393. package/dist/mcp/memory-broadcast.d.ts.map +1 -0
  394. package/dist/mcp/tools/agent-tools.d.ts +3 -0
  395. package/dist/mcp/tools/agent-tools.d.ts.map +1 -0
  396. package/dist/mcp/tools/auto-memory-tools.d.ts +5 -0
  397. package/dist/mcp/tools/auto-memory-tools.d.ts.map +1 -0
  398. package/dist/mcp/tools/bulk-tools.d.ts +3 -0
  399. package/dist/mcp/tools/bulk-tools.d.ts.map +1 -0
  400. package/dist/mcp/tools/consolidation-tools.d.ts +3 -0
  401. package/dist/mcp/tools/consolidation-tools.d.ts.map +1 -0
  402. package/dist/mcp/tools/focus-tools.d.ts +3 -0
  403. package/dist/mcp/tools/focus-tools.d.ts.map +1 -0
  404. package/dist/mcp/tools/graph-entity-tools.d.ts +3 -0
  405. package/dist/mcp/tools/graph-entity-tools.d.ts.map +1 -0
  406. package/dist/mcp/tools/graph-query-tools.d.ts +3 -0
  407. package/dist/mcp/tools/graph-query-tools.d.ts.map +1 -0
  408. package/dist/mcp/tools/graph-relation-tools.d.ts +3 -0
  409. package/dist/mcp/tools/graph-relation-tools.d.ts.map +1 -0
  410. package/dist/mcp/tools/graph-tools.d.ts +3 -0
  411. package/dist/mcp/tools/graph-tools.d.ts.map +1 -0
  412. package/dist/mcp/tools/graph-utils.d.ts +5 -0
  413. package/dist/mcp/tools/graph-utils.d.ts.map +1 -0
  414. package/dist/mcp/tools/hook-tools.d.ts +3 -0
  415. package/dist/mcp/tools/hook-tools.d.ts.map +1 -0
  416. package/dist/mcp/tools/lock-tools.d.ts +3 -0
  417. package/dist/mcp/tools/lock-tools.d.ts.map +1 -0
  418. package/dist/mcp/tools/memory-audit.d.ts +3 -0
  419. package/dist/mcp/tools/memory-audit.d.ts.map +1 -0
  420. package/dist/mcp/tools/memory-crud.d.ts +3 -0
  421. package/dist/mcp/tools/memory-crud.d.ts.map +1 -0
  422. package/dist/mcp/tools/memory-health.d.ts +3 -0
  423. package/dist/mcp/tools/memory-health.d.ts.map +1 -0
  424. package/dist/mcp/tools/memory-history.d.ts +3 -0
  425. package/dist/mcp/tools/memory-history.d.ts.map +1 -0
  426. package/dist/mcp/tools/memory-inject.d.ts +3 -0
  427. package/dist/mcp/tools/memory-inject.d.ts.map +1 -0
  428. package/dist/mcp/tools/memory-io.d.ts +3 -0
  429. package/dist/mcp/tools/memory-io.d.ts.map +1 -0
  430. package/dist/mcp/tools/memory-lifecycle.d.ts +3 -0
  431. package/dist/mcp/tools/memory-lifecycle.d.ts.map +1 -0
  432. package/dist/mcp/tools/memory-search.d.ts +3 -0
  433. package/dist/mcp/tools/memory-search.d.ts.map +1 -0
  434. package/dist/mcp/tools/memory-stats.d.ts +3 -0
  435. package/dist/mcp/tools/memory-stats.d.ts.map +1 -0
  436. package/dist/mcp/tools/memory-tools.d.ts +17 -0
  437. package/dist/mcp/tools/memory-tools.d.ts.map +1 -0
  438. package/dist/mcp/tools/memory-utils.d.ts +27 -0
  439. package/dist/mcp/tools/memory-utils.d.ts.map +1 -0
  440. package/dist/mcp/tools/memory-validation.d.ts +3 -0
  441. package/dist/mcp/tools/memory-validation.d.ts.map +1 -0
  442. package/dist/mcp/tools/project-tools.d.ts +3 -0
  443. package/dist/mcp/tools/project-tools.d.ts.map +1 -0
  444. package/dist/mcp/tools/session-tools.d.ts +3 -0
  445. package/dist/mcp/tools/session-tools.d.ts.map +1 -0
  446. package/dist/mcp/tools/storage-tools.d.ts +3 -0
  447. package/dist/mcp/tools/storage-tools.d.ts.map +1 -0
  448. package/dist/mcp/tools/synthesis-tools.d.ts +3 -0
  449. package/dist/mcp/tools/synthesis-tools.d.ts.map +1 -0
  450. package/dist/mcp/tools/system-tools-events.d.ts +3 -0
  451. package/dist/mcp/tools/system-tools-events.d.ts.map +1 -0
  452. package/dist/mcp/tools/system-tools-memory-admin.d.ts +3 -0
  453. package/dist/mcp/tools/system-tools-memory-admin.d.ts.map +1 -0
  454. package/dist/mcp/tools/system-tools-shared.d.ts +23 -0
  455. package/dist/mcp/tools/system-tools-shared.d.ts.map +1 -0
  456. package/dist/mcp/tools/system-tools.d.ts +3 -0
  457. package/dist/mcp/tools/system-tools.d.ts.map +1 -0
  458. package/dist/mcp/tools/tool-registry.d.ts +30 -0
  459. package/dist/mcp/tools/tool-registry.d.ts.map +1 -0
  460. package/dist/mcp/tools/utility-tools.d.ts +3 -0
  461. package/dist/mcp/tools/utility-tools.d.ts.map +1 -0
  462. package/dist/memory-project-link/index.d.ts +2 -0
  463. package/dist/memory-project-link/index.d.ts.map +1 -0
  464. package/dist/memory-project-link/schema.d.ts +5 -0
  465. package/dist/memory-project-link/schema.d.ts.map +1 -0
  466. package/dist/pg-sync-worker.d.ts +2 -0
  467. package/dist/pg-sync-worker.d.ts.map +1 -0
  468. package/dist/project-registration/authority.d.ts +43 -0
  469. package/dist/project-registration/authority.d.ts.map +1 -0
  470. package/dist/project-registration/historical-receipt.d.ts +38 -0
  471. package/dist/project-registration/historical-receipt.d.ts.map +1 -0
  472. package/dist/project-registration/http.d.ts +32 -0
  473. package/dist/project-registration/http.d.ts.map +1 -0
  474. package/dist/project-registration/identity.d.ts +20 -0
  475. package/dist/project-registration/identity.d.ts.map +1 -0
  476. package/dist/project-registration/index.d.ts +11 -0
  477. package/dist/project-registration/index.d.ts.map +1 -0
  478. package/dist/project-registration/project-references.d.ts +71 -0
  479. package/dist/project-registration/project-references.d.ts.map +1 -0
  480. package/dist/project-registration/project-resources.d.ts +22 -0
  481. package/dist/project-registration/project-resources.d.ts.map +1 -0
  482. package/dist/project-registration/schema.d.ts +5 -0
  483. package/dist/project-registration/schema.d.ts.map +1 -0
  484. package/dist/project-registration/types.d.ts +319 -0
  485. package/dist/project-registration/types.d.ts.map +1 -0
  486. package/dist/project-registration.d.ts +2 -0
  487. package/dist/project-registration.d.ts.map +1 -0
  488. package/dist/sdk/index.d.ts +987 -0
  489. package/dist/sdk/index.d.ts.map +1 -0
  490. package/dist/server/auth.d.ts +11 -0
  491. package/dist/server/auth.d.ts.map +1 -0
  492. package/dist/server/helpers.d.ts +22 -0
  493. package/dist/server/helpers.d.ts.map +1 -0
  494. package/dist/server/index.d.ts +14 -0
  495. package/dist/server/index.d.ts.map +1 -0
  496. package/dist/server/index.js +179 -19
  497. package/dist/server/openapi.d.ts +2 -0
  498. package/dist/server/openapi.d.ts.map +1 -0
  499. package/dist/server/router.d.ts +17 -0
  500. package/dist/server/router.d.ts.map +1 -0
  501. package/dist/server/routes/agents.d.ts +2 -0
  502. package/dist/server/routes/agents.d.ts.map +1 -0
  503. package/dist/server/routes/entities.d.ts +2 -0
  504. package/dist/server/routes/entities.d.ts.map +1 -0
  505. package/dist/server/routes/memories-bulk.d.ts +2 -0
  506. package/dist/server/routes/memories-bulk.d.ts.map +1 -0
  507. package/dist/server/routes/memories-crud.d.ts +2 -0
  508. package/dist/server/routes/memories-crud.d.ts.map +1 -0
  509. package/dist/server/routes/memories-io.d.ts +2 -0
  510. package/dist/server/routes/memories-io.d.ts.map +1 -0
  511. package/dist/server/routes/memories-misc.d.ts +2 -0
  512. package/dist/server/routes/memories-misc.d.ts.map +1 -0
  513. package/dist/server/routes/memories-search.d.ts +2 -0
  514. package/dist/server/routes/memories-search.d.ts.map +1 -0
  515. package/dist/server/routes/memories-stats.d.ts +2 -0
  516. package/dist/server/routes/memories-stats.d.ts.map +1 -0
  517. package/dist/server/routes/memories.d.ts +19 -0
  518. package/dist/server/routes/memories.d.ts.map +1 -0
  519. package/dist/server/routes/memory-project-link.d.ts +2 -0
  520. package/dist/server/routes/memory-project-link.d.ts.map +1 -0
  521. package/dist/server/routes/project-registration.d.ts +2 -0
  522. package/dist/server/routes/project-registration.d.ts.map +1 -0
  523. package/dist/server/routes/projects.d.ts +2 -0
  524. package/dist/server/routes/projects.d.ts.map +1 -0
  525. package/dist/server/routes/system-auto-memory.d.ts +2 -0
  526. package/dist/server/routes/system-auto-memory.d.ts.map +1 -0
  527. package/dist/server/routes/system-chain.d.ts +2 -0
  528. package/dist/server/routes/system-chain.d.ts.map +1 -0
  529. package/dist/server/routes/system-consolidation.d.ts +2 -0
  530. package/dist/server/routes/system-consolidation.d.ts.map +1 -0
  531. package/dist/server/routes/system-hooks.d.ts +2 -0
  532. package/dist/server/routes/system-hooks.d.ts.map +1 -0
  533. package/dist/server/routes/system-sessions.d.ts +2 -0
  534. package/dist/server/routes/system-sessions.d.ts.map +1 -0
  535. package/dist/server/routes/system-subscriptions.d.ts +2 -0
  536. package/dist/server/routes/system-subscriptions.d.ts.map +1 -0
  537. package/dist/server/routes/system-synthesis.d.ts +2 -0
  538. package/dist/server/routes/system-synthesis.d.ts.map +1 -0
  539. package/dist/server/routes/system-tools.d.ts +2 -0
  540. package/dist/server/routes/system-tools.d.ts.map +1 -0
  541. package/dist/server/routes/system.d.ts +2 -0
  542. package/dist/server/routes/system.d.ts.map +1 -0
  543. package/dist/server/routes/tasks.d.ts +2 -0
  544. package/dist/server/routes/tasks.d.ts.map +1 -0
  545. package/dist/storage.d.ts +280 -0
  546. package/dist/storage.d.ts.map +1 -0
  547. package/dist/test-support/memories-page-stub-server.d.ts +2 -0
  548. package/dist/test-support/memories-page-stub-server.d.ts.map +1 -0
  549. package/dist/test-support/memories-page-stub.d.ts +28 -0
  550. package/dist/test-support/memories-page-stub.d.ts.map +1 -0
  551. package/dist/test-support/pg-sync-stub-worker.d.ts +2 -0
  552. package/dist/test-support/pg-sync-stub-worker.d.ts.map +1 -0
  553. package/dist/test-support/preload-local-store.d.ts +2 -0
  554. package/dist/test-support/preload-local-store.d.ts.map +1 -0
  555. package/dist/test-support/project-authority-identity.d.ts +8 -0
  556. package/dist/test-support/project-authority-identity.d.ts.map +1 -0
  557. package/dist/test-support/store-isolation.d.ts +108 -0
  558. package/dist/test-support/store-isolation.d.ts.map +1 -0
  559. package/dist/test-support/strip-ansi.d.ts +3 -0
  560. package/dist/test-support/strip-ansi.d.ts.map +1 -0
  561. package/dist/types/hooks.d.ts +136 -0
  562. package/dist/types/hooks.d.ts.map +1 -0
  563. package/dist/types/index.d.ts +482 -0
  564. package/dist/types/index.d.ts.map +1 -0
  565. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/connectors/types.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE1D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,KAAK,GAAG,aAAa,CAAC,CAAC;CACjD;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB"}
@@ -0,0 +1,52 @@
1
+ import { SqliteAdapter as Database } from "../storage.js";
2
+ import type { MemoryScope } from "../types/index.js";
3
+ export type ConsolidationActionType = "merge_duplicate" | "promote_semantic" | "summarize_cluster" | "decay_forget";
4
+ export interface ConsolidationRun {
5
+ id: string;
6
+ scope: string | null;
7
+ project_id: string | null;
8
+ agent_id: string | null;
9
+ dry_run: boolean;
10
+ status: "pending" | "running" | "completed" | "failed";
11
+ summary: Record<string, unknown>;
12
+ error: string | null;
13
+ started_at: string;
14
+ completed_at: string | null;
15
+ }
16
+ export interface ConsolidationAction {
17
+ id: string;
18
+ runId: string;
19
+ type: ConsolidationActionType;
20
+ sourceMemoryIds: string[];
21
+ targetMemoryId: string | null;
22
+ createdMemoryId: string | null;
23
+ reason: string;
24
+ plannedChanges: Record<string, unknown>;
25
+ applied: boolean;
26
+ }
27
+ export interface ConsolidationOptions {
28
+ dryRun?: boolean;
29
+ scope?: MemoryScope;
30
+ projectId?: string;
31
+ agentId?: string;
32
+ duplicateThreshold?: number;
33
+ staleDays?: number;
34
+ decayThreshold?: number;
35
+ limit?: number;
36
+ db?: Database;
37
+ }
38
+ export interface ConsolidationResult {
39
+ run: ConsolidationRun;
40
+ actions: ConsolidationAction[];
41
+ dryRun: boolean;
42
+ summary: {
43
+ planned: number;
44
+ applied: number;
45
+ mergeDuplicates: number;
46
+ promoteSemantic: number;
47
+ summarizeClusters: number;
48
+ decayForget: number;
49
+ };
50
+ }
51
+ export declare function runConsolidation(options?: ConsolidationOptions): Promise<ConsolidationResult>;
52
+ //# sourceMappingURL=consolidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consolidation.d.ts","sourceRoot":"","sources":["../../src/lib/consolidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAU,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAS7D,MAAM,MAAM,uBAAuB,GAC/B,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,GACnB,cAAc,CAAC;AAEnB,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IACvD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,uBAAuB,CAAC;IAC9B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,QAAQ,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,gBAAgB,CAAC;IACtB,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,MAAM,CAAC;QACxB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAgfD,wBAAsB,gBAAgB,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA2DvG"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Context Extractor — parses session messages and extracts meaningful
3
+ * context strings for memory activation matching.
4
+ */
5
+ import type { SessionMessage } from "./session-watcher.js";
6
+ export interface ExtractedContext {
7
+ context_text: string;
8
+ tools_mentioned: string[];
9
+ is_significant: boolean;
10
+ source: "user" | "assistant" | "tool_result" | "tool_use";
11
+ }
12
+ export declare function extractContext(message: SessionMessage): ExtractedContext;
13
+ export declare function resetContext(): void;
14
+ //# sourceMappingURL=context-extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-extractor.d.ts","sourceRoot":"","sources":["../../src/lib/context-extractor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;CAC3D;AAmDD,wBAAgB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,gBAAgB,CAmExE;AAED,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Layered context assembly — structured multi-section memory context.
3
+ *
4
+ * Assembles memories into sections:
5
+ * - Core Facts: high-importance facts and preferences (importance >= 8)
6
+ * - Recent History: memories from the last 24h
7
+ * - Relevant Knowledge: query-matched knowledge (if query provided)
8
+ * - Active Decisions: recent fact-category memories
9
+ */
10
+ import type { Memory } from "../types/index.js";
11
+ import { SqliteAdapter as Database } from "../storage.js";
12
+ export interface ContextSection {
13
+ title: string;
14
+ memories: Memory[];
15
+ }
16
+ export interface LayeredContext {
17
+ sections: ContextSection[];
18
+ total_memories: number;
19
+ token_estimate: number;
20
+ }
21
+ /**
22
+ * Assemble layered context from memories.
23
+ */
24
+ export declare function assembleContext(options?: {
25
+ project_id?: string;
26
+ agent_id?: string;
27
+ machine_id?: string | null;
28
+ scope?: string;
29
+ query?: string;
30
+ max_per_section?: number;
31
+ }, db?: Database): LayeredContext;
32
+ /**
33
+ * Format layered context as markdown.
34
+ */
35
+ export declare function formatLayeredContext(ctx: LayeredContext): string;
36
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/lib/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAgB,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG1D,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,GAAE;IACP,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;CACrB,EACN,EAAE,CAAC,EAAE,QAAQ,GACZ,cAAc,CAwEhB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAUhE"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Fact contradiction detection.
3
+ *
4
+ * On memory_save, checks if a new memory contradicts existing high-importance facts.
5
+ * Uses heuristic matching first, then optionally calls an LLM (Cerebras for speed)
6
+ * for deeper analysis.
7
+ */
8
+ import { SqliteAdapter as Database } from "../storage.js";
9
+ import type { Memory } from "../types/index.js";
10
+ export interface InvalidationResult {
11
+ invalidated_memory_id: string;
12
+ new_memory_id: string | null;
13
+ valid_until: string;
14
+ supersedes_id: string;
15
+ }
16
+ /**
17
+ * Invalidate an existing fact by setting its valid_until to now.
18
+ * Optionally links the new superseding memory via metadata.supersedes_id.
19
+ *
20
+ * Call this when a contradiction is detected and the user/agent confirms
21
+ * the old fact should be invalidated.
22
+ */
23
+ export declare function invalidateFact(oldMemoryId: string, newMemoryId?: string, db?: Database): InvalidationResult;
24
+ export interface ContradictionResult {
25
+ /** Whether a contradiction was detected */
26
+ contradicts: boolean;
27
+ /** The conflicting existing memory, if any */
28
+ conflicting_memory: Memory | null;
29
+ /** Confidence score 0-1 */
30
+ confidence: number;
31
+ /** Explanation of why it's a contradiction */
32
+ reasoning: string;
33
+ }
34
+ /**
35
+ * Check if a new memory contradicts any existing high-importance facts.
36
+ *
37
+ * Returns the contradiction result. Does NOT modify any data — the caller
38
+ * decides what to do (warn, invalidate, reject).
39
+ *
40
+ * Only checks against memories with importance >= minImportance that share
41
+ * the same key and are in the same scope/project.
42
+ */
43
+ export declare function detectContradiction(newKey: string, newValue: string, options?: {
44
+ scope?: string;
45
+ project_id?: string;
46
+ agent_id?: string;
47
+ min_importance?: number;
48
+ use_llm?: boolean;
49
+ }, db?: Database): Promise<ContradictionResult>;
50
+ //# sourceMappingURL=contradiction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contradiction.d.ts","sourceRoot":"","sources":["../../src/lib/contradiction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAOhD,MAAM,WAAW,kBAAkB;IACjC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,EACpB,EAAE,CAAC,EAAE,QAAQ,GACZ,kBAAkB,CA6BpB;AAMD,MAAM,WAAW,mBAAmB;IAClC,2CAA2C;IAC3C,WAAW,EAAE,OAAO,CAAC;IACrB,8CAA8C;IAC9C,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;CACnB;AAsED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IACP,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACd,EACN,EAAE,CAAC,EAAE,QAAQ,GACZ,OAAO,CAAC,mBAAmB,CAAC,CAqE9B"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Compute time decay factor (0–1).
3
+ * Uses exponential forgetting curve: exp(-lambda * days_since_access).
4
+ *
5
+ * Returns 1.0 for today, ~0.9 for 10 days, ~0.74 for 30 days, ~0.37 for 100 days.
6
+ *
7
+ * @param daysSinceAccess Non-negative number of days since last access.
8
+ * @param lambda Decay rate constant (default 0.01).
9
+ */
10
+ export declare function timeDecay(daysSinceAccess: number, lambda?: number): number;
11
+ /**
12
+ * Compute access frequency boost (>= 1.0).
13
+ * Formula: 1 + log(1 + access_count) * 0.1
14
+ *
15
+ * Returns 1.0 for 0 accesses, ~1.07 for 1, ~1.11 for 2, ~1.24 for 10.
16
+ *
17
+ * @param accessCount Non-negative number of times the memory was accessed.
18
+ */
19
+ export declare function accessBoost(accessCount: number): number;
20
+ /**
21
+ * Compute effective importance using a forgetting curve model.
22
+ *
23
+ * effective_importance = importance * time_decay(days_since_access) * access_boost(access_count)
24
+ *
25
+ * Pinned memories always return their raw importance (no decay).
26
+ * When accessed_at is null, falls back to created_at for age calculation.
27
+ */
28
+ export declare function computeDecayScore(memory: {
29
+ importance: number;
30
+ access_count: number;
31
+ accessed_at: string | null;
32
+ created_at: string;
33
+ pinned: boolean;
34
+ }): number;
35
+ //# sourceMappingURL=decay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decay.d.ts","sourceRoot":"","sources":["../../src/lib/decay.ts"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,GAAE,MAAa,GAAG,MAAM,CAGhF;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;CACjB,GAAG,MAAM,CAaT"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Smart deduplication for auto-extracted memories.
3
+ * FTS5-based similarity check — no LLM needed, pure SQLite.
4
+ * Prevents memory bloat from repeated similar extractions.
5
+ */
6
+ import type { MemoryFilter } from "../types/index.js";
7
+ export interface DedupConfig {
8
+ /** Jaccard similarity threshold 0-1. Above this = duplicate. Default: 0.8 */
9
+ threshold: number;
10
+ /** If near-duplicate found, keep the longer/more specific one. Default: true */
11
+ keepLonger: boolean;
12
+ }
13
+ export interface DedupStats {
14
+ checked: number;
15
+ skipped: number;
16
+ updated: number;
17
+ }
18
+ export declare function getDedupStats(): Readonly<DedupStats>;
19
+ export declare function resetDedupStats(): void;
20
+ /**
21
+ * Check if content is a near-duplicate of an existing memory.
22
+ * Returns: 'unique' | 'duplicate' | { updateId: string } (update existing with better content)
23
+ */
24
+ export declare function checkDuplicate(content: string, filter: Pick<MemoryFilter, "agent_id" | "project_id" | "scope">, config?: DedupConfig): "unique" | "duplicate" | {
25
+ updateId: string;
26
+ existingContent: string;
27
+ };
28
+ /**
29
+ * Full dedup pipeline: check and optionally update existing memory.
30
+ * Returns: null = save as new | string = skipped/updated (reason)
31
+ */
32
+ export declare function dedup(content: string, filter: Pick<MemoryFilter, "agent_id" | "project_id" | "scope">, config?: DedupConfig): "save" | "skip";
33
+ //# sourceMappingURL=dedup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dedup.d.ts","sourceRoot":"","sources":["../../src/lib/dedup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AASD,wBAAgB,aAAa,IAAI,QAAQ,CAAC,UAAU,CAAC,CAEpD;AAED,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,YAAY,GAAG,OAAO,CAAC,EAC/D,MAAM,GAAE,WAA4B,GACnC,QAAQ,GAAG,WAAW,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,CAwCxE;AAED;;;GAGG;AACH,wBAAgB,KAAK,CACnB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,YAAY,GAAG,OAAO,CAAC,EAC/D,MAAM,GAAE,WAA4B,GACnC,MAAM,GAAG,MAAM,CAqBjB"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Human-readable duration parsing and formatting.
3
+ *
4
+ * Supported formats:
5
+ * Ns — seconds
6
+ * Nm — minutes
7
+ * Nh — hours
8
+ * Nd — days
9
+ * Nw — weeks
10
+ * Combinations: 1d12h, 2h30m
11
+ * Plain numbers: treated as milliseconds (backwards compat)
12
+ */
13
+ /**
14
+ * Parse a human-readable duration string into milliseconds.
15
+ *
16
+ * @param input - Duration string (e.g. "1d12h", "30m", "500") or numeric ms
17
+ * @returns milliseconds
18
+ * @throws Error on invalid format
19
+ */
20
+ export declare function parseDuration(input: string | number): number;
21
+ /**
22
+ * Format milliseconds into a human-readable duration string.
23
+ *
24
+ * @param ms - Duration in milliseconds
25
+ * @returns Human-readable string (e.g. "1d12h", "30m", "500ms")
26
+ */
27
+ export declare function formatDuration(ms: number): string;
28
+ //# sourceMappingURL=duration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../../src/lib/duration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAaH;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAiC5D;AAWD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAoBjD"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Embedding generation and cosine similarity for semantic memory search.
3
+ *
4
+ * Uses OpenAI text-embedding-3-small if OPENAI_API_KEY is set,
5
+ * falls back to a simple TF-IDF term frequency vector otherwise.
6
+ */
7
+ export declare function cosineSimilarity(a: number[], b: number[]): number;
8
+ export interface EmbeddingResult {
9
+ embedding: number[];
10
+ model: string;
11
+ dimensions: number;
12
+ }
13
+ /**
14
+ * Generate an embedding for a text string.
15
+ * Uses OpenAI if OPENAI_API_KEY is available, otherwise uses TF-IDF hash trick.
16
+ */
17
+ export declare function generateEmbedding(text: string): Promise<EmbeddingResult>;
18
+ export declare function serializeEmbedding(embedding: number[]): string;
19
+ export declare function deserializeEmbedding(raw: string): number[];
20
+ //# sourceMappingURL=embeddings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embeddings.d.ts","sourceRoot":"","sources":["../../src/lib/embeddings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAUjE;AAwDD,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAY9E;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAE9D;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAE1D"}
@@ -0,0 +1,20 @@
1
+ export interface EnumViolation {
2
+ field: string;
3
+ value: string;
4
+ allowed: readonly string[];
5
+ }
6
+ /** Human-readable, actionable rejection message naming the field and the accepted set. */
7
+ export declare function formatEnumViolation(v: EnumViolation): string;
8
+ /**
9
+ * Validate one enum-constrained field. Returns the violation, or `null` when
10
+ * the value is acceptable. `undefined`/`null` are acceptable — they mean "leave
11
+ * the column at its default", which is a separate concern from a bad value.
12
+ */
13
+ export declare function validateEnumField(field: string, value: unknown): EnumViolation | null;
14
+ /**
15
+ * Validate every enum-constrained field present on a create/update payload.
16
+ * Returns the first violation so the caller can fail fast with one clear
17
+ * message, or `null` when the payload is clean.
18
+ */
19
+ export declare function validateMemoryEnums(input: Record<string, unknown>): EnumViolation | null;
20
+ //# sourceMappingURL=enum-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum-validation.d.ts","sourceRoot":"","sources":["../../src/lib/enum-validation.ts"],"names":[],"mappings":"AA6BA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B;AAED,0FAA0F;AAC1F,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,aAAa,GAAG,MAAM,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAMrF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,aAAa,GAAG,IAAI,CAOxF"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Mementos Export v1 — portable JSONL format.
3
+ * One JSON object per line. Includes all memory fields + entity links.
4
+ */
5
+ import type { Memory, MemoryFilter } from "../types/index.js";
6
+ import { SqliteAdapter as Database } from "../storage.js";
7
+ export interface ExportV1Entry {
8
+ _format: "mementos-export-v1";
9
+ _exported_at: string;
10
+ memory: Memory;
11
+ entity_links: Array<{
12
+ entity_name: string;
13
+ entity_type: string;
14
+ role: string;
15
+ }>;
16
+ }
17
+ /**
18
+ * Export memories in mementos-export-v1 JSONL format.
19
+ * Returns an array of export entries (caller serializes to JSONL).
20
+ */
21
+ export declare function exportV1(filter?: MemoryFilter, db?: Database): ExportV1Entry[];
22
+ /**
23
+ * Serialize export entries to JSONL string (one JSON object per line).
24
+ */
25
+ export declare function toJsonl(entries: ExportV1Entry[]): string;
26
+ /**
27
+ * Parse JSONL string back to export entries.
28
+ */
29
+ export declare function fromJsonl(jsonl: string): ExportV1Entry[];
30
+ //# sourceMappingURL=export-v1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-v1.d.ts","sourceRoot":"","sources":["../../src/lib/export-v1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAI9D,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG1D,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,MAAM,CAAC,EAAE,YAAY,EACrB,EAAE,CAAC,EAAE,QAAQ,GACZ,aAAa,EAAE,CA6BjB;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,MAAM,CAExD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,EAAE,CAKxD"}
@@ -0,0 +1,9 @@
1
+ import { SqliteAdapter as Database } from "../storage.js";
2
+ import type { EntityType, Memory } from "../types/index.js";
3
+ export interface ExtractedEntity {
4
+ name: string;
5
+ type: EntityType;
6
+ confidence: number;
7
+ }
8
+ export declare function extractEntities(memory: Memory, db?: Database): ExtractedEntity[];
9
+ //# sourceMappingURL=extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../src/lib/extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAI1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAuBD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,eAAe,EAAE,CA0EhF"}
@@ -0,0 +1,8 @@
1
+ import type { ExtractionResult } from "./types.js";
2
+ /**
3
+ * Transcribe an audio file using the OpenAI Whisper API.
4
+ * Requires the OPENAI_API_KEY environment variable.
5
+ * Returns empty result on failure — never throws.
6
+ */
7
+ export declare function transcribeAudio(filePath: string): Promise<ExtractionResult>;
8
+ //# sourceMappingURL=audio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../../src/lib/extractors/audio.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAqBnD;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA2EjF"}
@@ -0,0 +1,12 @@
1
+ import type { ExtractionResult } from "./types.js";
2
+ export type { ExtractionResult } from "./types.js";
3
+ export { emptyResult } from "./types.js";
4
+ export { extractPdf } from "./pdf.js";
5
+ export { extractImage } from "./ocr.js";
6
+ export { transcribeAudio } from "./audio.js";
7
+ /**
8
+ * Auto-detect file type by extension and route to the correct extractor.
9
+ * Returns an empty result for unsupported file types — never throws.
10
+ */
11
+ export declare function extractFile(filePath: string): Promise<ExtractionResult>;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/extractors/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMnD,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAa7C;;;GAGG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAoB7E"}
@@ -0,0 +1,7 @@
1
+ import type { ExtractionResult } from "./types.js";
2
+ /**
3
+ * Extract text from an image file using Tesseract.js OCR.
4
+ * Returns empty result on failure — never throws.
5
+ */
6
+ export declare function extractImage(filePath: string): Promise<ExtractionResult>;
7
+ //# sourceMappingURL=ocr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ocr.d.ts","sourceRoot":"","sources":["../../../src/lib/extractors/ocr.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA2B9E"}
@@ -0,0 +1,7 @@
1
+ import type { ExtractionResult } from "./types.js";
2
+ /**
3
+ * Extract text from a PDF file using pdf-parse.
4
+ * Returns empty result on failure — never throws.
5
+ */
6
+ export declare function extractPdf(filePath: string): Promise<ExtractionResult>;
7
+ //# sourceMappingURL=pdf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdf.d.ts","sourceRoot":"","sources":["../../../src/lib/extractors/pdf.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA2B5E"}
@@ -0,0 +1,12 @@
1
+ export interface ExtractionResult {
2
+ text: string;
3
+ metadata: Record<string, unknown>;
4
+ pages?: number;
5
+ confidence?: number;
6
+ }
7
+ /**
8
+ * Returns an empty extraction result — used as a safe fallback when
9
+ * extraction fails or the file type is unsupported.
10
+ */
11
+ export declare function emptyResult(metadata?: Record<string, unknown>): ExtractionResult;
12
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/extractors/types.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CAMhF"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * File dependency graph builder for mementos.
3
+ * Scans a codebase, creates 'file' entities for each source file, and
4
+ * creates 'depends_on' relations between files based on import/require statements.
5
+ *
6
+ * Supports: TypeScript, JavaScript, Python, Go (basic), Rust (basic).
7
+ */
8
+ import type { SqliteAdapter as Database } from "../storage.js";
9
+ export interface FileDepsOptions {
10
+ root_dir: string;
11
+ project_id?: string;
12
+ extensions?: string[];
13
+ exclude_patterns?: string[];
14
+ incremental?: boolean;
15
+ }
16
+ export interface FileDepsResult {
17
+ files_scanned: number;
18
+ entities_created: number;
19
+ entities_updated: number;
20
+ relations_created: number;
21
+ errors: string[];
22
+ }
23
+ /**
24
+ * Scan a codebase, create file entities and import-based depends_on relations.
25
+ */
26
+ export declare function buildFileDependencyGraph(opts: FileDepsOptions, db?: Database): Promise<FileDepsResult>;
27
+ //# sourceMappingURL=file-deps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-deps.d.ts","sourceRoot":"","sources":["../../src/lib/file-deps.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK/D,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAgFD;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,eAAe,EACrB,EAAE,CAAC,EAAE,QAAQ,GACZ,OAAO,CAAC,cAAc,CAAC,CAwFzB"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Focus mode — agents can "focus" on a project, which auto-scopes
3
+ * memory operations to that project's shared memories + their own private
4
+ * memories + all global memories.
5
+ *
6
+ * Priority for project_id resolution:
7
+ * 1. Per-call param (explicit override)
8
+ * 2. Session focus (in-memory Map, fastest)
9
+ * 3. DB active_project_id on agent record
10
+ * 4. No filter
11
+ */
12
+ /**
13
+ * Set focus for an agent. Persists to DB + sets in-memory session focus.
14
+ * Pass project_id=null to unfocus.
15
+ */
16
+ export declare function setFocus(agentId: string, projectId: string | null): void;
17
+ /**
18
+ * Get the current focus project_id for an agent.
19
+ * Checks session cache first, then DB.
20
+ */
21
+ export declare function getFocus(agentId: string): string | null;
22
+ /**
23
+ * Remove focus for an agent (sets to null).
24
+ */
25
+ export declare function unfocus(agentId: string): void;
26
+ /**
27
+ * Resolve the effective project_id for a memory operation.
28
+ * Priority: explicit per-call param > session/DB focus > null
29
+ */
30
+ export declare function resolveProjectId(agentId: string | undefined | null, explicitProjectId: string | undefined | null): string | null;
31
+ /**
32
+ * Build the scope filter for memory queries when an agent is focused.
33
+ *
34
+ * When focused on project P:
35
+ * - private memories of this agent (scope=private, agent_id=agentId)
36
+ * - shared memories of project P (scope=shared, project_id=P)
37
+ * - global memories (scope=global)
38
+ *
39
+ * When not focused: no automatic scope restriction (existing behavior).
40
+ */
41
+ export interface FocusScopeFilter {
42
+ /** If set, apply this multi-scope filter instead of a single scope */
43
+ focusMode: true;
44
+ agentId: string;
45
+ projectId: string;
46
+ }
47
+ export declare function buildFocusFilter(agentId: string | undefined | null, explicitProjectId: string | undefined | null, explicitScope: string | undefined | null): FocusScopeFilter | null;
48
+ /**
49
+ * Apply focus filter to a SQL WHERE clause builder.
50
+ * Returns SQL fragment + params for the focused scope filter.
51
+ *
52
+ * Generates: (scope = 'global') OR (scope = 'private' AND agent_id = ?) OR (scope = 'shared' AND project_id = ?)
53
+ */
54
+ export declare function focusFilterSQL(agentId: string, projectId: string): {
55
+ sql: string;
56
+ params: string[];
57
+ };
58
+ //# sourceMappingURL=focus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../src/lib/focus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAqBxE;AAOD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWvD;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAClC,iBAAiB,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAC3C,MAAM,GAAG,IAAI,CAUf;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAClC,iBAAiB,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAC5C,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GACvC,gBAAgB,GAAG,IAAI,CAazB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAKnC"}
@@ -0,0 +1,16 @@
1
+ type GatherTrainingDataFn = (options?: {
2
+ limit?: number;
3
+ since?: Date;
4
+ }) => Promise<{
5
+ source: string;
6
+ examples: Array<{
7
+ messages: Array<{
8
+ role: "system" | "user" | "assistant";
9
+ content: string;
10
+ }>;
11
+ }>;
12
+ count: number;
13
+ }>;
14
+ export declare const gatherTrainingData: GatherTrainingDataFn;
15
+ export {};
16
+ //# sourceMappingURL=gatherer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gatherer.d.ts","sourceRoot":"","sources":["../../src/lib/gatherer.ts"],"names":[],"mappings":"AAMA,KAAK,oBAAoB,GAAG,CAAC,OAAO,CAAC,EAAE;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,CAAC;CACd,KAAK,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC;QACd,QAAQ,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAC7E,CAAC,CAAC;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAyEH,eAAO,MAAM,kBAAkB,EAAE,oBAkDhC,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * GDPR-compliant erasure (right to be forgotten).
3
+ *
4
+ * Deletes PII from memory values while preserving anonymized audit trail.
5
+ * The audit log entries remain with hashes only (no content).
6
+ */
7
+ import { SqliteAdapter as Database } from "../storage.js";
8
+ export interface GdprErasureResult {
9
+ erased_count: number;
10
+ memory_ids: string[];
11
+ timestamp: string;
12
+ }
13
+ /**
14
+ * Erase all memories containing the given PII identifier.
15
+ *
16
+ * Replaces `value` with "[REDACTED]", clears `summary`, `tags` and `metadata`,
17
+ * and rewrites `key` to `[REDACTED]:<random token>` — per-row, for the reason
18
+ * given at the UPDATE below. Nothing derived from the original key or imported
19
+ * row id is retained.
20
+ *
21
+ * The erase runs in ONE TRANSACTION and is therefore all-or-nothing: a caller
22
+ * never observes a partially-erased subject, and a failed attempt leaves the
23
+ * store fully intact so a retry starts from a clean, still-fully-matching set.
24
+ *
25
+ * Preserves the audit trail (audit_log entries have hashes, not content).
26
+ *
27
+ * NOTE: an erased memory is no longer reachable by its original key, so a later
28
+ * `save` under that key creates a NEW record rather than merging into the
29
+ * tombstone. That is deliberate: silently resurrecting an erased row and
30
+ * re-associating it with the data subject is precisely what erasure must
31
+ * prevent. Every foreign key into `memories` references `memories(id)` — no
32
+ * relational integrity depends on `key`, which is a human lookup handle only.
33
+ */
34
+ export declare function gdprErase(identifier: string, options?: {
35
+ project_id?: string;
36
+ agent_id?: string;
37
+ dry_run?: boolean;
38
+ }, db?: Database): GdprErasureResult;
39
+ //# sourceMappingURL=gdpr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gdpr.d.ts","sourceRoot":"","sources":["../../src/lib/gdpr.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG1D,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IACP,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACd,EACN,EAAE,CAAC,EAAE,QAAQ,GACZ,iBAAiB,CA8JnB"}