@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,50 @@
1
+ /**
2
+ * Hook registry — the central nervous system connecting all memory operations.
3
+ *
4
+ * Blocking hooks: await handler, return false = cancel the operation.
5
+ * Non-blocking hooks: fire-and-forget in background, never delay caller.
6
+ *
7
+ * Hooks run in priority order (ascending — lower number first).
8
+ * Per-agent and per-project scoping supported.
9
+ */
10
+ import type { Hook, HookType, HookHandler, HookRegistration, HookContextMap } from "../types/hooks.js";
11
+ declare class HookRegistry {
12
+ private hooks;
13
+ /**
14
+ * Register a hook. Returns the assigned hookId.
15
+ * Built-in hooks (builtin: true) cannot be unregistered.
16
+ */
17
+ register<T extends HookType>(reg: HookRegistration<T>): string;
18
+ /**
19
+ * Unregister a hook by ID.
20
+ * Returns false if hook not found or is a built-in.
21
+ */
22
+ unregister(hookId: string): boolean;
23
+ /** List all hooks, optionally filtered by type */
24
+ list(type?: HookType): Hook[];
25
+ /**
26
+ * Run all hooks of a given type for a given context.
27
+ *
28
+ * Returns true if the operation should proceed.
29
+ * Returns false if any blocking hook cancelled it.
30
+ *
31
+ * Non-blocking hooks are fired async and never delay the return.
32
+ */
33
+ runHooks<T extends HookType>(type: T, context: HookContextMap[T]): Promise<boolean>;
34
+ /**
35
+ * Get hooks matching type + agent/project scope.
36
+ * A hook with no agentId/projectId matches everything.
37
+ */
38
+ private getMatchingHooks;
39
+ /** Get stats about registered hooks */
40
+ stats(): {
41
+ total: number;
42
+ byType: Record<string, number>;
43
+ blocking: number;
44
+ nonBlocking: number;
45
+ };
46
+ }
47
+ /** Singleton — shared across the whole process */
48
+ export declare const hookRegistry: HookRegistry;
49
+ export type { Hook, HookType, HookHandler, HookRegistration };
50
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/lib/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAO3B,cAAM,YAAY;IAChB,OAAO,CAAC,KAAK,CAA2B;IAExC;;;OAGG;IACH,QAAQ,CAAC,CAAC,SAAS,QAAQ,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,MAAM;IAW9D;;;OAGG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAQnC,kDAAkD;IAClD,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,EAAE;IAM7B;;;;;;;OAOG;IACG,QAAQ,CAAC,CAAC,SAAS,QAAQ,EAC/B,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,GACzB,OAAO,CAAC,OAAO,CAAC;IA8BnB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAaxB,uCAAuC;IACvC,KAAK,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE;CAalG;AAED,kDAAkD;AAClD,eAAO,MAAM,YAAY,cAAqB,CAAC;AAG/C,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Memory importers — parse export formats from Mem0, Zep, and LangMem into mementos memories.
3
+ */
4
+ import type { CreateMemoryInput } from "../../types/index.js";
5
+ export interface ImportResult {
6
+ memories: CreateMemoryInput[];
7
+ warnings: string[];
8
+ source_format: string;
9
+ }
10
+ interface Mem0Export {
11
+ id?: string;
12
+ memory?: string;
13
+ user_id?: string;
14
+ metadata?: Record<string, unknown>;
15
+ created_at?: string;
16
+ categories?: string[];
17
+ }
18
+ export declare function importMem0(data: Mem0Export[]): ImportResult;
19
+ interface ZepExport {
20
+ uuid?: string;
21
+ fact?: string;
22
+ rating?: number;
23
+ valid_at?: string;
24
+ invalid_at?: string;
25
+ source_node_name?: string;
26
+ target_node_name?: string;
27
+ }
28
+ export declare function importZep(data: ZepExport[]): ImportResult;
29
+ interface LangMemExport {
30
+ id?: string;
31
+ content?: string;
32
+ namespace?: string;
33
+ metadata?: Record<string, unknown>;
34
+ }
35
+ export declare function importLangMem(data: LangMemExport[]): ImportResult;
36
+ export declare function detectFormat(data: unknown[]): "mem0" | "zep" | "langmem" | "unknown";
37
+ export {};
38
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/importers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAM9D,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAMD,UAAU,UAAU;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,YAAY,CAqB3D;AAMD,UAAU,SAAS;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,YAAY,CA8BzD;AAMD,UAAU,aAAa;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,YAAY,CAqBjE;AAMD,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,CAOpF"}
@@ -0,0 +1,89 @@
1
+ import { SqliteAdapter as Database } from "../storage.js";
2
+ import type { MemoryCategory, MementosConfig } from "../types/index.js";
3
+ export type InjectionStrategy = "default" | "smart" | "smart-pipeline";
4
+ export interface InjectionOptions {
5
+ agent_id?: string;
6
+ project_id?: string;
7
+ session_id?: string;
8
+ max_tokens?: number;
9
+ categories?: MemoryCategory[];
10
+ min_importance?: number;
11
+ strategy?: InjectionStrategy;
12
+ query?: string;
13
+ machine_id?: string | null;
14
+ db?: Database;
15
+ }
16
+ export interface SmartInjectionOptions {
17
+ /** Free-text description of what the agent is currently doing */
18
+ task_context: string;
19
+ /** Project to scope memories to */
20
+ project_id?: string;
21
+ /** Agent to scope private memories to */
22
+ agent_id?: string;
23
+ /** Session for working memory */
24
+ session_id?: string;
25
+ /** Max tokens for the entire output (~4 chars/token) */
26
+ max_tokens?: number;
27
+ /** Minimum importance threshold (before decay) */
28
+ min_importance?: number;
29
+ /** Current machine ID for machine-local memory visibility */
30
+ machine_id?: string | null;
31
+ /** Force profile resynthesis even if cached */
32
+ force_profile_refresh?: boolean;
33
+ /** Optional DB handle */
34
+ db?: Database;
35
+ }
36
+ /** Structured result from the smart injection pipeline */
37
+ export interface SmartInjectionResult {
38
+ /** Formatted markdown string ready for system prompt */
39
+ output: string;
40
+ /** Token estimate of the output */
41
+ token_estimate: number;
42
+ /** Number of memories included */
43
+ memory_count: number;
44
+ /** Whether the profile was loaded from cache */
45
+ profile_from_cache: boolean;
46
+ /** Tool names detected in task_context */
47
+ detected_tools: string[];
48
+ }
49
+ export declare class MemoryInjector {
50
+ private config;
51
+ private injectedIds;
52
+ constructor(config?: MementosConfig);
53
+ /**
54
+ * Get formatted injection context suitable for system prompt insertion.
55
+ * Produces structured output with Key Memories and Recent Context sections.
56
+ * Token-budget aware.
57
+ */
58
+ getInjectionContext(options?: InjectionOptions): string;
59
+ /**
60
+ * Async smart injection: scores memories by embedding similarity + importance + recency.
61
+ * Falls back to default strategy if no embeddings exist or no query is provided.
62
+ */
63
+ getSmartInjectionContext(options?: InjectionOptions): Promise<string>;
64
+ /**
65
+ * Reset the deduplication window (call between refresh intervals)
66
+ */
67
+ resetDedup(): void;
68
+ /**
69
+ * Get count of memories injected so far in this session
70
+ */
71
+ getInjectedCount(): number;
72
+ }
73
+ /**
74
+ * Smart injection pipeline — the full-featured context injection strategy.
75
+ *
76
+ * Pipeline stages:
77
+ * 1. Parse task context — accept a task_context string describing what the agent is doing
78
+ * 2. Load or synthesize agent/project profile
79
+ * 3. Activation match — semantic search against task_context when embeddings exist
80
+ * 4. Tool guide retrieval — pull tool stats/lessons if task mentions tools
81
+ * 5. Decay scoring — apply forgetting curve to all candidate memories
82
+ * 6. Layer by type — Profile > Core Facts > Tool Guides > Procedural > Preferences > History
83
+ * 7. Token budgeting — fit into max_tokens, trimming lowest-relevance items first
84
+ *
85
+ * Falls back gracefully: no embeddings -> keyword matching, no profile -> skip section,
86
+ * no tool mentions -> skip tool guides.
87
+ */
88
+ export declare function smartInject(options: SmartInjectionOptions): Promise<SmartInjectionResult>;
89
+ //# sourceMappingURL=injector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injector.d.ts","sourceRoot":"","sources":["../../src/lib/injector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAU,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAiBhF,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,OAAO,GAAG,gBAAgB,CAAC;AAEvE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,EAAE,CAAC,EAAE,QAAQ,CAAC;CACf;AAMD,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,+CAA+C;IAC/C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,yBAAyB;IACzB,EAAE,CAAC,EAAE,QAAQ,CAAC;CACf;AAgBD,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,kBAAkB,EAAE,OAAO,CAAC;IAC5B,0CAA0C;IAC1C,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,WAAW,CAA0B;gBAEjC,MAAM,CAAC,EAAE,cAAc;IAInC;;;;OAIG;IACH,mBAAmB,CAAC,OAAO,GAAE,gBAAqB,GAAG,MAAM;IA+L3D;;;OAGG;IACG,wBAAwB,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;IA4L/E;;OAEG;IACH,UAAU,IAAI,IAAI;IAIlB;;OAEG;IACH,gBAAgB,IAAI,MAAM;CAG3B;AAkKD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA2Q/F"}
@@ -0,0 +1,6 @@
1
+ import { SqliteAdapter as Database } from "../storage.js";
2
+ import type { MemoryFilter, Memory } from "../types/index.js";
3
+ export declare function resolveVisibleMachineId(machineId?: string | null, db?: Database): string | null;
4
+ export declare function visibleToMachineFilter(machineId?: string | null, db?: Database): Pick<MemoryFilter, "visible_to_machine_id">;
5
+ export declare function isMemoryVisibleToMachine(memory: Pick<Memory, "machine_id">, machineId?: string | null, db?: Database): boolean;
6
+ //# sourceMappingURL=machine-visibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"machine-visibility.d.ts","sourceRoot":"","sources":["../../src/lib/machine-visibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE9D,wBAAgB,uBAAuB,CACrC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,EACzB,EAAE,CAAC,EAAE,QAAQ,GACZ,MAAM,GAAG,IAAI,CAUf;AAED,wBAAgB,sBAAsB,CACpC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,EACzB,EAAE,CAAC,EAAE,QAAQ,GACZ,IAAI,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAI7C;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,EAClC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,EACzB,EAAE,CAAC,EAAE,QAAQ,GACZ,OAAO,CAOT"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Matryoshka Embedding Slicing — 2-stage retrieval using variable-dimension embedding slices.
3
+ *
4
+ * Key insight: OpenAI text-embedding-3-small supports native dimension reduction.
5
+ * Halving the dimension keeps quality nearly intact, so a 384-dim slice is 4x faster
6
+ * to compare but nearly as accurate for shortlisting. We use this for a 2-stage search:
7
+ * Stage 1: 384-dim slice → fast approximate shortlist (3x limit)
8
+ * Stage 2: Full 1536-dim → precise rerank → top limit results
9
+ */
10
+ import { SqliteAdapter as Database } from "../storage.js";
11
+ import type { Memory } from "../types/index.js";
12
+ export interface MatryoshkaConfig {
13
+ /** Full embedding dimensions (1536 for text-embedding-3-small) */
14
+ full_dims: number;
15
+ /** Shortlist slice dimensions (1/4 of full for fast approximate search) */
16
+ shortlist_dims: number;
17
+ /** How many extra candidates to fetch in Stage 1 (multiplier of final limit) */
18
+ shortlist_multiplier: number;
19
+ }
20
+ export interface MatryoshkaSearchResult {
21
+ memory: Memory;
22
+ score: number;
23
+ shortlist_score: number;
24
+ }
25
+ /**
26
+ * Slice an embedding to the first `dims` dimensions.
27
+ * Exploits the Matryoshka property of text-embedding-3-small where
28
+ * leading dimensions carry the most information.
29
+ */
30
+ export declare function sliceEmbedding(embedding: number[], dims: number): number[];
31
+ /**
32
+ * L2 (Euclidean) normalize a vector to unit length.
33
+ * Required after slicing to ensure cosine similarity remains valid.
34
+ */
35
+ export declare function l2Normalize(embedding: number[]): number[];
36
+ /**
37
+ * 2-stage Matryoshka search:
38
+ * 1. Generate query embedding, slice to 384-dim, shortlist top N*3 candidates
39
+ * 2. Rerank shortlisted candidates using full 1536-dim embeddings
40
+ *
41
+ * Returns the top `limit` results ordered by full-dimension similarity.
42
+ */
43
+ export declare function matryoshkaSearch(db: Database, query: string, opts?: {
44
+ limit?: number;
45
+ project_id?: string;
46
+ agent_id?: string;
47
+ config?: MatryoshkaConfig;
48
+ threshold?: number;
49
+ }): Promise<MatryoshkaSearchResult[]>;
50
+ //# sourceMappingURL=matryoshka.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matryoshka.d.ts","sourceRoot":"","sources":["../../src/lib/matryoshka.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,cAAc,EAAE,MAAM,CAAC;IACvB,gFAAgF;IAChF,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;CACzB;AAYD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAG1E;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAYzD;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE;IACL,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GACA,OAAO,CAAC,sBAAsB,EAAE,CAAC,CA+EnC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * OPE4-00111: Concurrent memory access coordination
3
+ *
4
+ * Uses the resource_locks table (Migration 8) to provide:
5
+ * - Advisory locks for read-heavy coordination
6
+ * - Exclusive locks to prevent simultaneous writes to the same key
7
+ *
8
+ * Design:
9
+ * - Reads: always parallel, no locking needed
10
+ * - Writes: agents SHOULD acquire an exclusive lock on the memory key before writing
11
+ * The lock resource_id uses format: "{scope}:{key}:{agent_id}:{project_id}"
12
+ * This prevents two agents overwriting the same shared memory simultaneously
13
+ * - Optimistic fallback: if lock can't be acquired, VersionConflictError from
14
+ * updateMemory() provides a second layer of protection
15
+ */
16
+ import { SqliteAdapter as Database } from "../storage.js";
17
+ import { type ResourceLock } from "../db/locks.js";
18
+ /**
19
+ * Compute the lock resource_id for a memory key.
20
+ * Scoped by scope + key + project so different projects don't block each other.
21
+ */
22
+ export declare function memoryLockId(key: string, scope: string, projectId?: string | null): string;
23
+ /**
24
+ * Acquire an exclusive write lock on a memory key.
25
+ * Returns the lock if acquired, null if another agent is writing.
26
+ */
27
+ export declare function acquireMemoryWriteLock(agentId: string, key: string, scope: string, projectId?: string | null, ttlSeconds?: number, db?: Database): ResourceLock | null;
28
+ /**
29
+ * Release a memory write lock.
30
+ */
31
+ export declare function releaseMemoryWriteLock(lockId: string, agentId: string, db?: Database): boolean;
32
+ /**
33
+ * Check if a memory key is currently write-locked.
34
+ * Returns the active lock or null.
35
+ */
36
+ export declare function checkMemoryWriteLock(key: string, scope: string, projectId?: string | null, db?: Database): ResourceLock | null;
37
+ /**
38
+ * Execute a callback with an exclusive memory write lock.
39
+ * Throws if the lock cannot be acquired (another agent is writing).
40
+ * Automatically releases the lock after the callback completes.
41
+ *
42
+ * Usage:
43
+ * withMemoryLock(agentId, "my-key", "shared", projectId, () => {
44
+ * createMemory({ key: "my-key", ... });
45
+ * });
46
+ */
47
+ export declare function withMemoryLock<T>(agentId: string, key: string, scope: string, projectId: string | null | undefined, fn: () => T, ttlSeconds?: number, db?: Database): T;
48
+ /**
49
+ * Error thrown when a memory write lock cannot be acquired.
50
+ */
51
+ export declare class MemoryLockConflictError extends Error {
52
+ readonly conflict: true;
53
+ readonly key: string;
54
+ readonly scope: string;
55
+ readonly blocking_agent_id: string;
56
+ constructor(key: string, scope: string, blockingAgentId: string);
57
+ }
58
+ //# sourceMappingURL=memory-lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-lock.d.ts","sourceRoot":"","sources":["../../src/lib/memory-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAuC,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKxF;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,MAAM,CAER;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,EACzB,UAAU,SAAmB,EAC7B,EAAE,CAAC,EAAE,QAAQ,GACZ,YAAY,GAAG,IAAI,CAGrB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,EAAE,CAAC,EAAE,QAAQ,GACZ,OAAO,CAGT;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,EACzB,EAAE,CAAC,EAAE,QAAQ,GACZ,YAAY,GAAG,IAAI,CAIrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,EAAE,EAAE,MAAM,CAAC,EACX,UAAU,SAAmB,EAC7B,EAAE,CAAC,EAAE,QAAQ,GACZ,CAAC,CAcH;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,SAAgB,QAAQ,EAAG,IAAI,CAAU;IACzC,SAAgB,GAAG,EAAE,MAAM,CAAC;IAC5B,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,iBAAiB,EAAE,MAAM,CAAC;gBAE9B,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM;CAUhE"}
@@ -0,0 +1,14 @@
1
+ export declare const DEFAULT_MODEL = "gpt-4o-mini";
2
+ /**
3
+ * Returns the currently active fine-tuned model ID, or the default model.
4
+ */
5
+ export declare function getActiveModel(): string;
6
+ /**
7
+ * Sets the active fine-tuned model ID in ~/.hasna/mementos/config.json.
8
+ */
9
+ export declare function setActiveModel(modelId: string): void;
10
+ /**
11
+ * Clears the active fine-tuned model, reverting to the default.
12
+ */
13
+ export declare function clearActiveModel(): void;
14
+ //# sourceMappingURL=model-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-config.d.ts","sourceRoot":"","sources":["../../src/lib/model-config.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,gBAAgB,CAAC;AA2B3C;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAGvC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAIpD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAIvC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * sessions connector — bridge between the sessions REST API and mementos.
3
+ *
4
+ * When sessions ingests a new session, this connector fetches the session
5
+ * transcript and submits it to mementos for memory extraction.
6
+ *
7
+ * Usage:
8
+ * const connector = new OpenSessionsConnector({ openSessionsUrl, mementosUrl });
9
+ * await connector.ingestSession(sessionId, { agentId, projectId });
10
+ * await connector.syncRecentSessions({ since: "2026-03-17", limit: 10 });
11
+ */
12
+ export interface OpenSessionsConnectorConfig {
13
+ /** sessions REST API base URL */
14
+ openSessionsUrl: string;
15
+ /** mementos REST API base URL */
16
+ mementosUrl: string;
17
+ /** Optional auth token for sessions */
18
+ openSessionsToken?: string;
19
+ /** Default agent ID for extracted memories */
20
+ defaultAgentId?: string;
21
+ /** Default project ID for extracted memories */
22
+ defaultProjectId?: string;
23
+ }
24
+ export interface IngestResult {
25
+ sessionId: string;
26
+ jobId: string;
27
+ status: "queued" | "skipped" | "error";
28
+ message: string;
29
+ }
30
+ export declare class OpenSessionsConnector {
31
+ private config;
32
+ constructor(config: OpenSessionsConnectorConfig);
33
+ /**
34
+ * Fetch a session transcript from sessions and ingest into mementos.
35
+ */
36
+ ingestSession(sessionId: string, options?: {
37
+ agentId?: string;
38
+ projectId?: string;
39
+ }): Promise<IngestResult>;
40
+ /**
41
+ * Fetch and ingest multiple recent sessions.
42
+ */
43
+ syncRecentSessions(options?: {
44
+ since?: string;
45
+ limit?: number;
46
+ agentId?: string;
47
+ projectId?: string;
48
+ }): Promise<IngestResult[]>;
49
+ private fetchSessionTranscript;
50
+ private listRecentSessionIds;
51
+ }
52
+ /**
53
+ * Create a connector from environment variables.
54
+ *
55
+ * OPEN_SESSIONS_URL — sessions server URL
56
+ * OPEN_SESSIONS_TOKEN — optional auth token
57
+ * MEMENTOS_URL — mementos server URL (default: http://localhost:19428)
58
+ */
59
+ export declare function connectorFromEnv(): OpenSessionsConnector;
60
+ //# sourceMappingURL=open-sessions-connector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-sessions-connector.d.ts","sourceRoot":"","sources":["../../src/lib/open-sessions-connector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,2BAA2B;IAC1C,iCAAiC;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,8CAA8C;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,qBAAqB;IAChC,OAAO,CAAC,MAAM,CAA8B;gBAEhC,MAAM,EAAE,2BAA2B;IAI/C;;OAEG;IACG,aAAa,CACjB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GACrD,OAAO,CAAC,YAAY,CAAC;IAwCxB;;OAEG;IACG,kBAAkB,CAAC,OAAO,GAAE;QAChC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;YAelB,sBAAsB;YAiBtB,oBAAoB;CAqBnC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAWxD"}
@@ -0,0 +1,3 @@
1
+ /** Read the package version from source or either bundled output layout. */
2
+ export declare function getMementosPackageVersion(): string;
3
+ //# sourceMappingURL=package-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-version.d.ts","sourceRoot":"","sources":["../../src/lib/package-version.ts"],"names":[],"mappings":"AAIA,4EAA4E;AAC5E,wBAAgB,yBAAyB,IAAI,MAAM,CAclD"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Memory poisoning detection.
3
+ *
4
+ * Computes a trust score (0.0 - 1.0) for incoming memories based on heuristic
5
+ * checks. Low-trust memories are flagged for review.
6
+ */
7
+ import type { Memory } from "../types/index.js";
8
+ /**
9
+ * Compute a trust score for a memory value.
10
+ *
11
+ * Returns a float between 0.0 and 1.0 where 1.0 = fully trusted.
12
+ * Heuristic penalties:
13
+ * - Instruction-like patterns (-0.2)
14
+ * - Promotional patterns (-0.3)
15
+ * - Contradicts existing high-importance memories (-0.3)
16
+ * - Very short value (<10 chars) with high importance claim (-0.1)
17
+ */
18
+ export declare function computeTrustScore(value: string, key: string, existingMemories?: Memory[], claimedImportance?: number): number;
19
+ //# sourceMappingURL=poisoning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poisoning.d.ts","sourceRoot":"","sources":["../../src/lib/poisoning.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AA+BhD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAC3B,iBAAiB,CAAC,EAAE,MAAM,GACzB,MAAM,CAyDR"}
@@ -0,0 +1,17 @@
1
+ import type { SqliteAdapter as Database } from "../storage.js";
2
+ import type { Memory, MemoryScope, MemoryCategory } from "../types/index.js";
3
+ export interface PollOptions {
4
+ interval_ms?: number;
5
+ scope?: MemoryScope;
6
+ category?: MemoryCategory;
7
+ agent_id?: string;
8
+ project_id?: string;
9
+ on_memories: (memories: Memory[]) => void;
10
+ on_error?: (error: Error) => void;
11
+ db?: Database;
12
+ }
13
+ export interface PollHandle {
14
+ stop: () => void;
15
+ }
16
+ export declare function startPolling(opts: PollOptions): PollHandle;
17
+ //# sourceMappingURL=poll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poll.d.ts","sourceRoot":"","sources":["../../src/lib/poll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAS7E,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAClC,EAAE,CAAC,EAAE,QAAQ,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAMD,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CAsJ1D"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * LLM-based procedural memory extractor from session transcripts.
3
+ * Extracts workflow patterns, step sequences, failure lessons, problem-solution pairs.
4
+ * Saves as chained procedural memories with when_to_use and sequence_group.
5
+ */
6
+ interface ExtractedProcedure {
7
+ title: string;
8
+ steps: {
9
+ action: string;
10
+ when_to_use: string;
11
+ }[];
12
+ failure_patterns: string[];
13
+ when_to_use: string;
14
+ }
15
+ export declare function extractProcedures(transcript: string, options?: {
16
+ agent_id?: string;
17
+ project_id?: string;
18
+ session_id?: string;
19
+ }): Promise<ExtractedProcedure[]>;
20
+ export {};
21
+ //# sourceMappingURL=procedural-extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"procedural-extractor.d.ts","sourceRoot":"","sources":["../../src/lib/procedural-extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA2BH,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjD,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GACA,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAyF/B"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Cross-profile memory sync.
3
+ * Selectively copy memories between different mementos profiles/databases.
4
+ */
5
+ import type { MemoryFilter } from "../types/index.js";
6
+ export interface ProfileSyncOptions {
7
+ filter?: MemoryFilter;
8
+ strategy?: "skip" | "merge" | "overwrite";
9
+ }
10
+ export interface ProfileSyncResult {
11
+ copied: number;
12
+ skipped: number;
13
+ source_profile: string;
14
+ target_profile: string;
15
+ }
16
+ /**
17
+ * Sync memories from one profile to another.
18
+ */
19
+ export declare function syncProfiles(sourceProfile: string, targetProfile: string, options?: ProfileSyncOptions): ProfileSyncResult;
20
+ //# sourceMappingURL=profile-sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-sync.d.ts","sourceRoot":"","sources":["../../src/lib/profile-sync.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;CAC3C;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AAUD;;GAEG;AACH,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,kBAAuB,GAC/B,iBAAiB,CAmDnB"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Profile Synthesizer — aggregates preference and fact memories into a coherent profile.
3
+ * Cached as a special pinned memory, auto-refreshed when preferences change.
4
+ */
5
+ export declare function getProfileKey(scope: string, id: string): string;
6
+ export declare function synthesizeProfile(options: {
7
+ project_id?: string;
8
+ agent_id?: string;
9
+ scope?: "agent" | "project" | "global";
10
+ force_refresh?: boolean;
11
+ }): Promise<{
12
+ profile: string;
13
+ memory_count: number;
14
+ from_cache: boolean;
15
+ } | null>;
16
+ /**
17
+ * Mark profile as stale. Called from PostMemorySave hook when a preference/fact is saved.
18
+ */
19
+ export declare function markProfileStale(projectId?: string, _agentId?: string): void;
20
+ //# sourceMappingURL=profile-synthesizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-synthesizer.d.ts","sourceRoot":"","sources":["../../src/lib/profile-synthesizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;IACvC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC,CA6EjF;AA2BD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAa5E"}
@@ -0,0 +1,18 @@
1
+ import { SqliteAdapter as Database } from "../storage.js";
2
+ import type { Project } from "../types/index.js";
3
+ /**
4
+ * Auto-detect the current project from cwd's git root.
5
+ * - Finds the git root directory
6
+ * - Extracts the repo name from the directory basename
7
+ * - Checks if a project is already registered by path
8
+ * - If not, registers it automatically
9
+ * - Returns the Project object, or null if not in a git repo
10
+ *
11
+ * Results are cached for the lifetime of the process.
12
+ */
13
+ export declare function detectProject(db?: Database): Project | null;
14
+ /**
15
+ * Reset the cached project (useful for tests).
16
+ */
17
+ export declare function resetProjectCache(): void;
18
+ //# sourceMappingURL=project-detect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-detect.d.ts","sourceRoot":"","sources":["../../src/lib/project-detect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAI1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAkBjD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,IAAI,CAgC3D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
@@ -0,0 +1,7 @@
1
+ import { type ProjectPanel } from "@hasna/contracts";
2
+ export interface MementosProjectPanelOptions {
3
+ limit?: number;
4
+ }
5
+ export declare function createMementosProjectPanel(projectRef: string, options?: MementosProjectPanelOptions): ProjectPanel;
6
+ export declare function formatMementosProjectPanel(panel: ProjectPanel): string;
7
+ //# sourceMappingURL=project-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-panel.d.ts","sourceRoot":"","sources":["../../src/lib/project-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,kBAAkB,CAAC;AAK1B,MAAM,WAAW,2BAA2B;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAwGD,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,2BAAgC,GAAG,YAAY,CAkGtH;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAgBtE"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Anthropic provider (DEFAULT).
3
+ * Default model: claude-haiku-4-5 — cheap, fast, good quality.
4
+ * Premium option: claude-sonnet-4-5.
5
+ * Never throws — returns [] / empty results on failure.
6
+ */
7
+ import { BaseProvider, type ProviderConfig, type ProviderName, type MemoryExtractionContext, type ExtractedMemory, type EntityExtractionResult } from "./base.js";
8
+ export declare const ANTHROPIC_MODELS: {
9
+ readonly default: "claude-haiku-4-5";
10
+ readonly premium: "claude-sonnet-4-5";
11
+ };
12
+ export declare class AnthropicProvider extends BaseProvider {
13
+ readonly name: ProviderName;
14
+ private readonly baseUrl;
15
+ constructor(config?: Partial<ProviderConfig>);
16
+ extractMemories(text: string, context: MemoryExtractionContext): Promise<ExtractedMemory[]>;
17
+ extractEntities(text: string): Promise<EntityExtractionResult>;
18
+ scoreImportance(content: string, _context: MemoryExtractionContext): Promise<number>;
19
+ private callAPI;
20
+ }
21
+ //# sourceMappingURL=anthropic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/anthropic.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAK5B,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC;AAEX,qBAAa,iBAAkB,SAAQ,YAAY;IACjD,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAe;IAC1C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;gBAE9C,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;IAWtC,eAAe,CACnB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,eAAe,EAAE,CAAC;IAkBvB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAoB9D,eAAe,CACnB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,uBAAuB,GAChC,OAAO,CAAC,MAAM,CAAC;YAaJ,OAAO;CAsCtB"}