@hasna/mementos 0.14.85 → 0.14.86

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 (564) hide show
  1. package/bun.lock +63 -4
  2. package/dist/cli/index.js +419 -188
  3. package/dist/diagnostics/historical-project-registration-receipt.js +36 -17
  4. package/dist/index.js +139 -50
  5. package/dist/mcp/index.js +181 -60
  6. package/dist/pg-sync-worker.js +7 -5
  7. package/dist/project-registration.js +108 -36
  8. package/dist/sdk/index.js +1 -0
  9. package/dist/server/index.js +384 -280
  10. package/dist/storage.js +63 -26
  11. package/hasna.contract.json +5 -4
  12. package/package.json +4 -3
  13. package/dist/cli/__fixtures__/clean-fallback-stub-server.d.ts +0 -2
  14. package/dist/cli/__fixtures__/clean-fallback-stub-server.d.ts.map +0 -1
  15. package/dist/cli/brains.d.ts +0 -3
  16. package/dist/cli/brains.d.ts.map +0 -1
  17. package/dist/cli/commands/agent.d.ts +0 -3
  18. package/dist/cli/commands/agent.d.ts.map +0 -1
  19. package/dist/cli/commands/consolidation.d.ts +0 -3
  20. package/dist/cli/commands/consolidation.d.ts.map +0 -1
  21. package/dist/cli/commands/entity.d.ts +0 -3
  22. package/dist/cli/commands/entity.d.ts.map +0 -1
  23. package/dist/cli/commands/graph.d.ts +0 -3
  24. package/dist/cli/commands/graph.d.ts.map +0 -1
  25. package/dist/cli/commands/info-context.d.ts +0 -3
  26. package/dist/cli/commands/info-context.d.ts.map +0 -1
  27. package/dist/cli/commands/info-history.d.ts +0 -3
  28. package/dist/cli/commands/info-history.d.ts.map +0 -1
  29. package/dist/cli/commands/info-report.d.ts +0 -3
  30. package/dist/cli/commands/info-report.d.ts.map +0 -1
  31. package/dist/cli/commands/info-stale.d.ts +0 -3
  32. package/dist/cli/commands/info-stale.d.ts.map +0 -1
  33. package/dist/cli/commands/info-stats.d.ts +0 -3
  34. package/dist/cli/commands/info-stats.d.ts.map +0 -1
  35. package/dist/cli/commands/info.d.ts +0 -12
  36. package/dist/cli/commands/info.d.ts.map +0 -1
  37. package/dist/cli/commands/init.d.ts +0 -3
  38. package/dist/cli/commands/init.d.ts.map +0 -1
  39. package/dist/cli/commands/io-backup.d.ts +0 -3
  40. package/dist/cli/commands/io-backup.d.ts.map +0 -1
  41. package/dist/cli/commands/io-clean.d.ts +0 -3
  42. package/dist/cli/commands/io-clean.d.ts.map +0 -1
  43. package/dist/cli/commands/io-export.d.ts +0 -3
  44. package/dist/cli/commands/io-export.d.ts.map +0 -1
  45. package/dist/cli/commands/io-import.d.ts +0 -3
  46. package/dist/cli/commands/io-import.d.ts.map +0 -1
  47. package/dist/cli/commands/io-restore.d.ts +0 -3
  48. package/dist/cli/commands/io-restore.d.ts.map +0 -1
  49. package/dist/cli/commands/io.d.ts +0 -12
  50. package/dist/cli/commands/io.d.ts.map +0 -1
  51. package/dist/cli/commands/memory-cmd-bulk.d.ts +0 -3
  52. package/dist/cli/commands/memory-cmd-bulk.d.ts.map +0 -1
  53. package/dist/cli/commands/memory-cmd-chain.d.ts +0 -3
  54. package/dist/cli/commands/memory-cmd-chain.d.ts.map +0 -1
  55. package/dist/cli/commands/memory-cmd-crud.d.ts +0 -3
  56. package/dist/cli/commands/memory-cmd-crud.d.ts.map +0 -1
  57. package/dist/cli/commands/memory-cmd-diff.d.ts +0 -3
  58. package/dist/cli/commands/memory-cmd-diff.d.ts.map +0 -1
  59. package/dist/cli/commands/memory-cmd-list.d.ts +0 -3
  60. package/dist/cli/commands/memory-cmd-list.d.ts.map +0 -1
  61. package/dist/cli/commands/memory-cmd-recall-exit.d.ts +0 -3
  62. package/dist/cli/commands/memory-cmd-recall-exit.d.ts.map +0 -1
  63. package/dist/cli/commands/memory-cmd-recall.d.ts +0 -3
  64. package/dist/cli/commands/memory-cmd-recall.d.ts.map +0 -1
  65. package/dist/cli/commands/memory-cmd-remove.d.ts +0 -3
  66. package/dist/cli/commands/memory-cmd-remove.d.ts.map +0 -1
  67. package/dist/cli/commands/memory-cmd-search.d.ts +0 -3
  68. package/dist/cli/commands/memory-cmd-search.d.ts.map +0 -1
  69. package/dist/cli/commands/memory-cmd-tail.d.ts +0 -3
  70. package/dist/cli/commands/memory-cmd-tail.d.ts.map +0 -1
  71. package/dist/cli/commands/memory-cmd-util.d.ts +0 -3
  72. package/dist/cli/commands/memory-cmd-util.d.ts.map +0 -1
  73. package/dist/cli/commands/memory-cmd-view.d.ts +0 -3
  74. package/dist/cli/commands/memory-cmd-view.d.ts.map +0 -1
  75. package/dist/cli/commands/memory-cmd-watch.d.ts +0 -3
  76. package/dist/cli/commands/memory-cmd-watch.d.ts.map +0 -1
  77. package/dist/cli/commands/memory-cmd-when-to-use.d.ts +0 -3
  78. package/dist/cli/commands/memory-cmd-when-to-use.d.ts.map +0 -1
  79. package/dist/cli/commands/memory.d.ts +0 -3
  80. package/dist/cli/commands/memory.d.ts.map +0 -1
  81. package/dist/cli/commands/project-panel.d.ts +0 -3
  82. package/dist/cli/commands/project-panel.d.ts.map +0 -1
  83. package/dist/cli/commands/project.d.ts +0 -3
  84. package/dist/cli/commands/project.d.ts.map +0 -1
  85. package/dist/cli/commands/relation.d.ts +0 -3
  86. package/dist/cli/commands/relation.d.ts.map +0 -1
  87. package/dist/cli/commands/storage.d.ts +0 -3
  88. package/dist/cli/commands/storage.d.ts.map +0 -1
  89. package/dist/cli/commands/system-auto-memory.d.ts +0 -3
  90. package/dist/cli/commands/system-auto-memory.d.ts.map +0 -1
  91. package/dist/cli/commands/system-completions.d.ts +0 -13
  92. package/dist/cli/commands/system-completions.d.ts.map +0 -1
  93. package/dist/cli/commands/system-config.d.ts +0 -3
  94. package/dist/cli/commands/system-config.d.ts.map +0 -1
  95. package/dist/cli/commands/system-doctor.d.ts +0 -3
  96. package/dist/cli/commands/system-doctor.d.ts.map +0 -1
  97. package/dist/cli/commands/system-hooks.d.ts +0 -3
  98. package/dist/cli/commands/system-hooks.d.ts.map +0 -1
  99. package/dist/cli/commands/system-mcp.d.ts +0 -3
  100. package/dist/cli/commands/system-mcp.d.ts.map +0 -1
  101. package/dist/cli/commands/system-misc.d.ts +0 -3
  102. package/dist/cli/commands/system-misc.d.ts.map +0 -1
  103. package/dist/cli/commands/system-profile.d.ts +0 -3
  104. package/dist/cli/commands/system-profile.d.ts.map +0 -1
  105. package/dist/cli/commands/system-session.d.ts +0 -3
  106. package/dist/cli/commands/system-session.d.ts.map +0 -1
  107. package/dist/cli/commands/system-sessions.d.ts +0 -3
  108. package/dist/cli/commands/system-sessions.d.ts.map +0 -1
  109. package/dist/cli/commands/system-synthesis.d.ts +0 -3
  110. package/dist/cli/commands/system-synthesis.d.ts.map +0 -1
  111. package/dist/cli/commands/system-synthesized-profile.d.ts +0 -3
  112. package/dist/cli/commands/system-synthesized-profile.d.ts.map +0 -1
  113. package/dist/cli/commands/system-tools.d.ts +0 -3
  114. package/dist/cli/commands/system-tools.d.ts.map +0 -1
  115. package/dist/cli/commands/system-watch.d.ts +0 -3
  116. package/dist/cli/commands/system-watch.d.ts.map +0 -1
  117. package/dist/cli/commands/system.d.ts +0 -3
  118. package/dist/cli/commands/system.d.ts.map +0 -1
  119. package/dist/cli/exit-codes.d.ts +0 -13
  120. package/dist/cli/exit-codes.d.ts.map +0 -1
  121. package/dist/cli/global-options.d.ts +0 -27
  122. package/dist/cli/global-options.d.ts.map +0 -1
  123. package/dist/cli/helpers.d.ts +0 -150
  124. package/dist/cli/helpers.d.ts.map +0 -1
  125. package/dist/cli/index.d.ts +0 -3
  126. package/dist/cli/index.d.ts.map +0 -1
  127. package/dist/cli/register-all.d.ts +0 -17
  128. package/dist/cli/register-all.d.ts.map +0 -1
  129. package/dist/cli/startup-side-effects.d.ts +0 -9
  130. package/dist/cli/startup-side-effects.d.ts.map +0 -1
  131. package/dist/db/__fixtures__/fail-closed-stub-server.d.ts +0 -2
  132. package/dist/db/__fixtures__/fail-closed-stub-server.d.ts.map +0 -1
  133. package/dist/db/acl.d.ts +0 -34
  134. package/dist/db/acl.d.ts.map +0 -1
  135. package/dist/db/agents.d.ts +0 -21
  136. package/dist/db/agents.d.ts.map +0 -1
  137. package/dist/db/analytics.d.ts +0 -120
  138. package/dist/db/analytics.d.ts.map +0 -1
  139. package/dist/db/api-mode.d.ts +0 -127
  140. package/dist/db/api-mode.d.ts.map +0 -1
  141. package/dist/db/audit.d.ts +0 -53
  142. package/dist/db/audit.d.ts.map +0 -1
  143. package/dist/db/database.d.ts +0 -26
  144. package/dist/db/database.d.ts.map +0 -1
  145. package/dist/db/entities.d.ts +0 -62
  146. package/dist/db/entities.d.ts.map +0 -1
  147. package/dist/db/entity-memories.d.ts +0 -34
  148. package/dist/db/entity-memories.d.ts.map +0 -1
  149. package/dist/db/feedback.d.ts +0 -9
  150. package/dist/db/feedback.d.ts.map +0 -1
  151. package/dist/db/locks.d.ts +0 -63
  152. package/dist/db/locks.d.ts.map +0 -1
  153. package/dist/db/machines.d.ts +0 -23
  154. package/dist/db/machines.d.ts.map +0 -1
  155. package/dist/db/memories.d.ts +0 -193
  156. package/dist/db/memories.d.ts.map +0 -1
  157. package/dist/db/memory-links.d.ts +0 -21
  158. package/dist/db/memory-links.d.ts.map +0 -1
  159. package/dist/db/memory-project-link.d.ts +0 -13
  160. package/dist/db/memory-project-link.d.ts.map +0 -1
  161. package/dist/db/migrations.d.ts +0 -3
  162. package/dist/db/migrations.d.ts.map +0 -1
  163. package/dist/db/pg-migrate.d.ts +0 -27
  164. package/dist/db/pg-migrate.d.ts.map +0 -1
  165. package/dist/db/pg-migrations.d.ts +0 -2
  166. package/dist/db/pg-migrations.d.ts.map +0 -1
  167. package/dist/db/projects.d.ts +0 -27
  168. package/dist/db/projects.d.ts.map +0 -1
  169. package/dist/db/ratings.d.ts +0 -23
  170. package/dist/db/ratings.d.ts.map +0 -1
  171. package/dist/db/relations.d.ts +0 -49
  172. package/dist/db/relations.d.ts.map +0 -1
  173. package/dist/db/session-jobs.d.ts +0 -49
  174. package/dist/db/session-jobs.d.ts.map +0 -1
  175. package/dist/db/store-backend.d.ts +0 -42
  176. package/dist/db/store-backend.d.ts.map +0 -1
  177. package/dist/db/subscriptions.d.ts +0 -24
  178. package/dist/db/subscriptions.d.ts.map +0 -1
  179. package/dist/db/synthesis.d.ts +0 -101
  180. package/dist/db/synthesis.d.ts.map +0 -1
  181. package/dist/db/tasks.d.ts +0 -89
  182. package/dist/db/tasks.d.ts.map +0 -1
  183. package/dist/db/tool-events.d.ts +0 -27
  184. package/dist/db/tool-events.d.ts.map +0 -1
  185. package/dist/db/webhook_hooks.d.ts +0 -25
  186. package/dist/db/webhook_hooks.d.ts.map +0 -1
  187. package/dist/diagnostics/historical-project-registration-receipt.d.ts +0 -39
  188. package/dist/diagnostics/historical-project-registration-receipt.d.ts.map +0 -1
  189. package/dist/generated/storage-kit/backend.d.ts +0 -20
  190. package/dist/generated/storage-kit/backend.d.ts.map +0 -1
  191. package/dist/generated/storage-kit/health.d.ts +0 -20
  192. package/dist/generated/storage-kit/health.d.ts.map +0 -1
  193. package/dist/generated/storage-kit/index.d.ts +0 -8
  194. package/dist/generated/storage-kit/index.d.ts.map +0 -1
  195. package/dist/generated/storage-kit/migrations.d.ts +0 -48
  196. package/dist/generated/storage-kit/migrations.d.ts.map +0 -1
  197. package/dist/generated/storage-kit/own.d.ts +0 -11
  198. package/dist/generated/storage-kit/own.d.ts.map +0 -1
  199. package/dist/generated/storage-kit/pool.d.ts +0 -35
  200. package/dist/generated/storage-kit/pool.d.ts.map +0 -1
  201. package/dist/generated/storage-kit/query.d.ts +0 -36
  202. package/dist/generated/storage-kit/query.d.ts.map +0 -1
  203. package/dist/generated/storage-kit/tls.d.ts +0 -53
  204. package/dist/generated/storage-kit/tls.d.ts.map +0 -1
  205. package/dist/index.d.ts +0 -45
  206. package/dist/index.d.ts.map +0 -1
  207. package/dist/lib/activation-matcher.d.ts +0 -17
  208. package/dist/lib/activation-matcher.d.ts.map +0 -1
  209. package/dist/lib/asmr/categorizer.d.ts +0 -31
  210. package/dist/lib/asmr/categorizer.d.ts.map +0 -1
  211. package/dist/lib/asmr/context-agent.d.ts +0 -4
  212. package/dist/lib/asmr/context-agent.d.ts.map +0 -1
  213. package/dist/lib/asmr/ensemble.d.ts +0 -23
  214. package/dist/lib/asmr/ensemble.d.ts.map +0 -1
  215. package/dist/lib/asmr/fact-agent.d.ts +0 -4
  216. package/dist/lib/asmr/fact-agent.d.ts.map +0 -1
  217. package/dist/lib/asmr/index.d.ts +0 -7
  218. package/dist/lib/asmr/index.d.ts.map +0 -1
  219. package/dist/lib/asmr/orchestrator.d.ts +0 -4
  220. package/dist/lib/asmr/orchestrator.d.ts.map +0 -1
  221. package/dist/lib/asmr/recall.d.ts +0 -3
  222. package/dist/lib/asmr/recall.d.ts.map +0 -1
  223. package/dist/lib/asmr/temporal-agent.d.ts +0 -4
  224. package/dist/lib/asmr/temporal-agent.d.ts.map +0 -1
  225. package/dist/lib/asmr/types.d.ts +0 -27
  226. package/dist/lib/asmr/types.d.ts.map +0 -1
  227. package/dist/lib/auto-inject-orchestrator.d.ts +0 -57
  228. package/dist/lib/auto-inject-orchestrator.d.ts.map +0 -1
  229. package/dist/lib/auto-memory-queue.d.ts +0 -48
  230. package/dist/lib/auto-memory-queue.d.ts.map +0 -1
  231. package/dist/lib/auto-memory.d.ts +0 -19
  232. package/dist/lib/auto-memory.d.ts.map +0 -1
  233. package/dist/lib/bench.d.ts +0 -20
  234. package/dist/lib/bench.d.ts.map +0 -1
  235. package/dist/lib/built-in-hooks.d.ts +0 -12
  236. package/dist/lib/built-in-hooks.d.ts.map +0 -1
  237. package/dist/lib/channel-pusher.d.ts +0 -39
  238. package/dist/lib/channel-pusher.d.ts.map +0 -1
  239. package/dist/lib/config.d.ts +0 -9
  240. package/dist/lib/config.d.ts.map +0 -1
  241. package/dist/lib/connectors/files.d.ts +0 -8
  242. package/dist/lib/connectors/files.d.ts.map +0 -1
  243. package/dist/lib/connectors/github.d.ts +0 -7
  244. package/dist/lib/connectors/github.d.ts.map +0 -1
  245. package/dist/lib/connectors/index.d.ts +0 -12
  246. package/dist/lib/connectors/index.d.ts.map +0 -1
  247. package/dist/lib/connectors/notion.d.ts +0 -7
  248. package/dist/lib/connectors/notion.d.ts.map +0 -1
  249. package/dist/lib/connectors/types.d.ts +0 -27
  250. package/dist/lib/connectors/types.d.ts.map +0 -1
  251. package/dist/lib/consolidation.d.ts +0 -52
  252. package/dist/lib/consolidation.d.ts.map +0 -1
  253. package/dist/lib/context-extractor.d.ts +0 -14
  254. package/dist/lib/context-extractor.d.ts.map +0 -1
  255. package/dist/lib/context.d.ts +0 -36
  256. package/dist/lib/context.d.ts.map +0 -1
  257. package/dist/lib/contradiction.d.ts +0 -50
  258. package/dist/lib/contradiction.d.ts.map +0 -1
  259. package/dist/lib/decay.d.ts +0 -35
  260. package/dist/lib/decay.d.ts.map +0 -1
  261. package/dist/lib/dedup.d.ts +0 -33
  262. package/dist/lib/dedup.d.ts.map +0 -1
  263. package/dist/lib/duration.d.ts +0 -28
  264. package/dist/lib/duration.d.ts.map +0 -1
  265. package/dist/lib/embeddings.d.ts +0 -20
  266. package/dist/lib/embeddings.d.ts.map +0 -1
  267. package/dist/lib/enum-validation.d.ts +0 -20
  268. package/dist/lib/enum-validation.d.ts.map +0 -1
  269. package/dist/lib/export-v1.d.ts +0 -30
  270. package/dist/lib/export-v1.d.ts.map +0 -1
  271. package/dist/lib/extractor.d.ts +0 -9
  272. package/dist/lib/extractor.d.ts.map +0 -1
  273. package/dist/lib/extractors/audio.d.ts +0 -8
  274. package/dist/lib/extractors/audio.d.ts.map +0 -1
  275. package/dist/lib/extractors/index.d.ts +0 -12
  276. package/dist/lib/extractors/index.d.ts.map +0 -1
  277. package/dist/lib/extractors/ocr.d.ts +0 -7
  278. package/dist/lib/extractors/ocr.d.ts.map +0 -1
  279. package/dist/lib/extractors/pdf.d.ts +0 -7
  280. package/dist/lib/extractors/pdf.d.ts.map +0 -1
  281. package/dist/lib/extractors/types.d.ts +0 -12
  282. package/dist/lib/extractors/types.d.ts.map +0 -1
  283. package/dist/lib/file-deps.d.ts +0 -27
  284. package/dist/lib/file-deps.d.ts.map +0 -1
  285. package/dist/lib/focus.d.ts +0 -58
  286. package/dist/lib/focus.d.ts.map +0 -1
  287. package/dist/lib/gatherer.d.ts +0 -16
  288. package/dist/lib/gatherer.d.ts.map +0 -1
  289. package/dist/lib/gdpr.d.ts +0 -39
  290. package/dist/lib/gdpr.d.ts.map +0 -1
  291. package/dist/lib/hooks.d.ts +0 -50
  292. package/dist/lib/hooks.d.ts.map +0 -1
  293. package/dist/lib/importers/index.d.ts +0 -38
  294. package/dist/lib/importers/index.d.ts.map +0 -1
  295. package/dist/lib/injector.d.ts +0 -89
  296. package/dist/lib/injector.d.ts.map +0 -1
  297. package/dist/lib/machine-visibility.d.ts +0 -6
  298. package/dist/lib/machine-visibility.d.ts.map +0 -1
  299. package/dist/lib/matryoshka.d.ts +0 -50
  300. package/dist/lib/matryoshka.d.ts.map +0 -1
  301. package/dist/lib/memory-lock.d.ts +0 -58
  302. package/dist/lib/memory-lock.d.ts.map +0 -1
  303. package/dist/lib/model-config.d.ts +0 -14
  304. package/dist/lib/model-config.d.ts.map +0 -1
  305. package/dist/lib/open-sessions-connector.d.ts +0 -60
  306. package/dist/lib/open-sessions-connector.d.ts.map +0 -1
  307. package/dist/lib/package-version.d.ts +0 -3
  308. package/dist/lib/package-version.d.ts.map +0 -1
  309. package/dist/lib/poisoning.d.ts +0 -19
  310. package/dist/lib/poisoning.d.ts.map +0 -1
  311. package/dist/lib/poll.d.ts +0 -17
  312. package/dist/lib/poll.d.ts.map +0 -1
  313. package/dist/lib/procedural-extractor.d.ts +0 -21
  314. package/dist/lib/procedural-extractor.d.ts.map +0 -1
  315. package/dist/lib/profile-sync.d.ts +0 -20
  316. package/dist/lib/profile-sync.d.ts.map +0 -1
  317. package/dist/lib/profile-synthesizer.d.ts +0 -20
  318. package/dist/lib/profile-synthesizer.d.ts.map +0 -1
  319. package/dist/lib/project-detect.d.ts +0 -18
  320. package/dist/lib/project-detect.d.ts.map +0 -1
  321. package/dist/lib/project-panel.d.ts +0 -7
  322. package/dist/lib/project-panel.d.ts.map +0 -1
  323. package/dist/lib/providers/anthropic.d.ts +0 -21
  324. package/dist/lib/providers/anthropic.d.ts.map +0 -1
  325. package/dist/lib/providers/base.d.ts +0 -96
  326. package/dist/lib/providers/base.d.ts.map +0 -1
  327. package/dist/lib/providers/cerebras.d.ts +0 -20
  328. package/dist/lib/providers/cerebras.d.ts.map +0 -1
  329. package/dist/lib/providers/grok.d.ts +0 -19
  330. package/dist/lib/providers/grok.d.ts.map +0 -1
  331. package/dist/lib/providers/index.d.ts +0 -7
  332. package/dist/lib/providers/index.d.ts.map +0 -1
  333. package/dist/lib/providers/openai-compat.d.ts +0 -18
  334. package/dist/lib/providers/openai-compat.d.ts.map +0 -1
  335. package/dist/lib/providers/openai.d.ts +0 -20
  336. package/dist/lib/providers/openai.d.ts.map +0 -1
  337. package/dist/lib/providers/registry.d.ts +0 -38
  338. package/dist/lib/providers/registry.d.ts.map +0 -1
  339. package/dist/lib/quality.d.ts +0 -16
  340. package/dist/lib/quality.d.ts.map +0 -1
  341. package/dist/lib/redact.d.ts +0 -10
  342. package/dist/lib/redact.d.ts.map +0 -1
  343. package/dist/lib/reflection.d.ts +0 -83
  344. package/dist/lib/reflection.d.ts.map +0 -1
  345. package/dist/lib/retention.d.ts +0 -17
  346. package/dist/lib/retention.d.ts.map +0 -1
  347. package/dist/lib/retired-storage-mode.d.ts +0 -11
  348. package/dist/lib/retired-storage-mode.d.ts.map +0 -1
  349. package/dist/lib/search.d.ts +0 -52
  350. package/dist/lib/search.d.ts.map +0 -1
  351. package/dist/lib/session-auto-resolve.d.ts +0 -28
  352. package/dist/lib/session-auto-resolve.d.ts.map +0 -1
  353. package/dist/lib/session-processor.d.ts +0 -38
  354. package/dist/lib/session-processor.d.ts.map +0 -1
  355. package/dist/lib/session-queue.d.ts +0 -28
  356. package/dist/lib/session-queue.d.ts.map +0 -1
  357. package/dist/lib/session-registry.d.ts +0 -47
  358. package/dist/lib/session-registry.d.ts.map +0 -1
  359. package/dist/lib/session-start-briefing.d.ts +0 -10
  360. package/dist/lib/session-start-briefing.d.ts.map +0 -1
  361. package/dist/lib/session-watcher.d.ts +0 -30
  362. package/dist/lib/session-watcher.d.ts.map +0 -1
  363. package/dist/lib/storage-sync.d.ts +0 -45
  364. package/dist/lib/storage-sync.d.ts.map +0 -1
  365. package/dist/lib/sync.d.ts +0 -10
  366. package/dist/lib/sync.d.ts.map +0 -1
  367. package/dist/lib/synthesis/corpus-builder.d.ts +0 -30
  368. package/dist/lib/synthesis/corpus-builder.d.ts.map +0 -1
  369. package/dist/lib/synthesis/executor.d.ts +0 -14
  370. package/dist/lib/synthesis/executor.d.ts.map +0 -1
  371. package/dist/lib/synthesis/index.d.ts +0 -37
  372. package/dist/lib/synthesis/index.d.ts.map +0 -1
  373. package/dist/lib/synthesis/llm-analyzer.d.ts +0 -18
  374. package/dist/lib/synthesis/llm-analyzer.d.ts.map +0 -1
  375. package/dist/lib/synthesis/metrics.d.ts +0 -13
  376. package/dist/lib/synthesis/metrics.d.ts.map +0 -1
  377. package/dist/lib/synthesis/scheduler.d.ts +0 -18
  378. package/dist/lib/synthesis/scheduler.d.ts.map +0 -1
  379. package/dist/lib/synthesis/validator.d.ts +0 -19
  380. package/dist/lib/synthesis/validator.d.ts.map +0 -1
  381. package/dist/lib/task-runner.d.ts +0 -37
  382. package/dist/lib/task-runner.d.ts.map +0 -1
  383. package/dist/lib/tool-lesson-extractor.d.ts +0 -24
  384. package/dist/lib/tool-lesson-extractor.d.ts.map +0 -1
  385. package/dist/lib/tool-memory-synthesizer.d.ts +0 -28
  386. package/dist/lib/tool-memory-synthesizer.d.ts.map +0 -1
  387. package/dist/lib/topic-clusterer.d.ts +0 -21
  388. package/dist/lib/topic-clusterer.d.ts.map +0 -1
  389. package/dist/lib/when-to-use-generator.d.ts +0 -22
  390. package/dist/lib/when-to-use-generator.d.ts.map +0 -1
  391. package/dist/mcp/http.d.ts +0 -17
  392. package/dist/mcp/http.d.ts.map +0 -1
  393. package/dist/mcp/index.d.ts +0 -6
  394. package/dist/mcp/index.d.ts.map +0 -1
  395. package/dist/mcp/memory-broadcast.d.ts +0 -12
  396. package/dist/mcp/memory-broadcast.d.ts.map +0 -1
  397. package/dist/mcp/tools/agent-tools.d.ts +0 -3
  398. package/dist/mcp/tools/agent-tools.d.ts.map +0 -1
  399. package/dist/mcp/tools/auto-memory-tools.d.ts +0 -5
  400. package/dist/mcp/tools/auto-memory-tools.d.ts.map +0 -1
  401. package/dist/mcp/tools/bulk-tools.d.ts +0 -3
  402. package/dist/mcp/tools/bulk-tools.d.ts.map +0 -1
  403. package/dist/mcp/tools/consolidation-tools.d.ts +0 -3
  404. package/dist/mcp/tools/consolidation-tools.d.ts.map +0 -1
  405. package/dist/mcp/tools/focus-tools.d.ts +0 -3
  406. package/dist/mcp/tools/focus-tools.d.ts.map +0 -1
  407. package/dist/mcp/tools/graph-entity-tools.d.ts +0 -3
  408. package/dist/mcp/tools/graph-entity-tools.d.ts.map +0 -1
  409. package/dist/mcp/tools/graph-query-tools.d.ts +0 -3
  410. package/dist/mcp/tools/graph-query-tools.d.ts.map +0 -1
  411. package/dist/mcp/tools/graph-relation-tools.d.ts +0 -3
  412. package/dist/mcp/tools/graph-relation-tools.d.ts.map +0 -1
  413. package/dist/mcp/tools/graph-tools.d.ts +0 -3
  414. package/dist/mcp/tools/graph-tools.d.ts.map +0 -1
  415. package/dist/mcp/tools/graph-utils.d.ts +0 -5
  416. package/dist/mcp/tools/graph-utils.d.ts.map +0 -1
  417. package/dist/mcp/tools/hook-tools.d.ts +0 -3
  418. package/dist/mcp/tools/hook-tools.d.ts.map +0 -1
  419. package/dist/mcp/tools/lock-tools.d.ts +0 -3
  420. package/dist/mcp/tools/lock-tools.d.ts.map +0 -1
  421. package/dist/mcp/tools/memory-audit.d.ts +0 -3
  422. package/dist/mcp/tools/memory-audit.d.ts.map +0 -1
  423. package/dist/mcp/tools/memory-crud.d.ts +0 -3
  424. package/dist/mcp/tools/memory-crud.d.ts.map +0 -1
  425. package/dist/mcp/tools/memory-health.d.ts +0 -3
  426. package/dist/mcp/tools/memory-health.d.ts.map +0 -1
  427. package/dist/mcp/tools/memory-history.d.ts +0 -3
  428. package/dist/mcp/tools/memory-history.d.ts.map +0 -1
  429. package/dist/mcp/tools/memory-inject.d.ts +0 -3
  430. package/dist/mcp/tools/memory-inject.d.ts.map +0 -1
  431. package/dist/mcp/tools/memory-io.d.ts +0 -3
  432. package/dist/mcp/tools/memory-io.d.ts.map +0 -1
  433. package/dist/mcp/tools/memory-lifecycle.d.ts +0 -3
  434. package/dist/mcp/tools/memory-lifecycle.d.ts.map +0 -1
  435. package/dist/mcp/tools/memory-search.d.ts +0 -3
  436. package/dist/mcp/tools/memory-search.d.ts.map +0 -1
  437. package/dist/mcp/tools/memory-stats.d.ts +0 -3
  438. package/dist/mcp/tools/memory-stats.d.ts.map +0 -1
  439. package/dist/mcp/tools/memory-tools.d.ts +0 -17
  440. package/dist/mcp/tools/memory-tools.d.ts.map +0 -1
  441. package/dist/mcp/tools/memory-utils.d.ts +0 -27
  442. package/dist/mcp/tools/memory-utils.d.ts.map +0 -1
  443. package/dist/mcp/tools/memory-validation.d.ts +0 -3
  444. package/dist/mcp/tools/memory-validation.d.ts.map +0 -1
  445. package/dist/mcp/tools/project-tools.d.ts +0 -3
  446. package/dist/mcp/tools/project-tools.d.ts.map +0 -1
  447. package/dist/mcp/tools/session-tools.d.ts +0 -3
  448. package/dist/mcp/tools/session-tools.d.ts.map +0 -1
  449. package/dist/mcp/tools/storage-tools.d.ts +0 -3
  450. package/dist/mcp/tools/storage-tools.d.ts.map +0 -1
  451. package/dist/mcp/tools/synthesis-tools.d.ts +0 -3
  452. package/dist/mcp/tools/synthesis-tools.d.ts.map +0 -1
  453. package/dist/mcp/tools/system-tools-events.d.ts +0 -3
  454. package/dist/mcp/tools/system-tools-events.d.ts.map +0 -1
  455. package/dist/mcp/tools/system-tools-memory-admin.d.ts +0 -3
  456. package/dist/mcp/tools/system-tools-memory-admin.d.ts.map +0 -1
  457. package/dist/mcp/tools/system-tools-shared.d.ts +0 -23
  458. package/dist/mcp/tools/system-tools-shared.d.ts.map +0 -1
  459. package/dist/mcp/tools/system-tools.d.ts +0 -3
  460. package/dist/mcp/tools/system-tools.d.ts.map +0 -1
  461. package/dist/mcp/tools/tool-registry.d.ts +0 -30
  462. package/dist/mcp/tools/tool-registry.d.ts.map +0 -1
  463. package/dist/mcp/tools/utility-tools.d.ts +0 -3
  464. package/dist/mcp/tools/utility-tools.d.ts.map +0 -1
  465. package/dist/memory-project-link/index.d.ts +0 -2
  466. package/dist/memory-project-link/index.d.ts.map +0 -1
  467. package/dist/memory-project-link/schema.d.ts +0 -5
  468. package/dist/memory-project-link/schema.d.ts.map +0 -1
  469. package/dist/pg-sync-worker.d.ts +0 -2
  470. package/dist/pg-sync-worker.d.ts.map +0 -1
  471. package/dist/project-registration/authority.d.ts +0 -43
  472. package/dist/project-registration/authority.d.ts.map +0 -1
  473. package/dist/project-registration/historical-receipt.d.ts +0 -38
  474. package/dist/project-registration/historical-receipt.d.ts.map +0 -1
  475. package/dist/project-registration/http.d.ts +0 -32
  476. package/dist/project-registration/http.d.ts.map +0 -1
  477. package/dist/project-registration/identity.d.ts +0 -20
  478. package/dist/project-registration/identity.d.ts.map +0 -1
  479. package/dist/project-registration/index.d.ts +0 -11
  480. package/dist/project-registration/index.d.ts.map +0 -1
  481. package/dist/project-registration/project-references.d.ts +0 -71
  482. package/dist/project-registration/project-references.d.ts.map +0 -1
  483. package/dist/project-registration/project-resources.d.ts +0 -22
  484. package/dist/project-registration/project-resources.d.ts.map +0 -1
  485. package/dist/project-registration/schema.d.ts +0 -5
  486. package/dist/project-registration/schema.d.ts.map +0 -1
  487. package/dist/project-registration/types.d.ts +0 -319
  488. package/dist/project-registration/types.d.ts.map +0 -1
  489. package/dist/project-registration.d.ts +0 -2
  490. package/dist/project-registration.d.ts.map +0 -1
  491. package/dist/sdk/index.d.ts +0 -978
  492. package/dist/sdk/index.d.ts.map +0 -1
  493. package/dist/server/auth.d.ts +0 -11
  494. package/dist/server/auth.d.ts.map +0 -1
  495. package/dist/server/helpers.d.ts +0 -22
  496. package/dist/server/helpers.d.ts.map +0 -1
  497. package/dist/server/index.d.ts +0 -14
  498. package/dist/server/index.d.ts.map +0 -1
  499. package/dist/server/openapi.d.ts +0 -2
  500. package/dist/server/openapi.d.ts.map +0 -1
  501. package/dist/server/router.d.ts +0 -17
  502. package/dist/server/router.d.ts.map +0 -1
  503. package/dist/server/routes/agents.d.ts +0 -2
  504. package/dist/server/routes/agents.d.ts.map +0 -1
  505. package/dist/server/routes/entities.d.ts +0 -2
  506. package/dist/server/routes/entities.d.ts.map +0 -1
  507. package/dist/server/routes/memories-bulk.d.ts +0 -2
  508. package/dist/server/routes/memories-bulk.d.ts.map +0 -1
  509. package/dist/server/routes/memories-crud.d.ts +0 -2
  510. package/dist/server/routes/memories-crud.d.ts.map +0 -1
  511. package/dist/server/routes/memories-io.d.ts +0 -2
  512. package/dist/server/routes/memories-io.d.ts.map +0 -1
  513. package/dist/server/routes/memories-misc.d.ts +0 -2
  514. package/dist/server/routes/memories-misc.d.ts.map +0 -1
  515. package/dist/server/routes/memories-search.d.ts +0 -2
  516. package/dist/server/routes/memories-search.d.ts.map +0 -1
  517. package/dist/server/routes/memories-stats.d.ts +0 -2
  518. package/dist/server/routes/memories-stats.d.ts.map +0 -1
  519. package/dist/server/routes/memories.d.ts +0 -19
  520. package/dist/server/routes/memories.d.ts.map +0 -1
  521. package/dist/server/routes/memory-project-link.d.ts +0 -2
  522. package/dist/server/routes/memory-project-link.d.ts.map +0 -1
  523. package/dist/server/routes/project-registration.d.ts +0 -2
  524. package/dist/server/routes/project-registration.d.ts.map +0 -1
  525. package/dist/server/routes/projects.d.ts +0 -2
  526. package/dist/server/routes/projects.d.ts.map +0 -1
  527. package/dist/server/routes/system-auto-memory.d.ts +0 -2
  528. package/dist/server/routes/system-auto-memory.d.ts.map +0 -1
  529. package/dist/server/routes/system-chain.d.ts +0 -2
  530. package/dist/server/routes/system-chain.d.ts.map +0 -1
  531. package/dist/server/routes/system-consolidation.d.ts +0 -2
  532. package/dist/server/routes/system-consolidation.d.ts.map +0 -1
  533. package/dist/server/routes/system-hooks.d.ts +0 -2
  534. package/dist/server/routes/system-hooks.d.ts.map +0 -1
  535. package/dist/server/routes/system-sessions.d.ts +0 -2
  536. package/dist/server/routes/system-sessions.d.ts.map +0 -1
  537. package/dist/server/routes/system-subscriptions.d.ts +0 -2
  538. package/dist/server/routes/system-subscriptions.d.ts.map +0 -1
  539. package/dist/server/routes/system-synthesis.d.ts +0 -2
  540. package/dist/server/routes/system-synthesis.d.ts.map +0 -1
  541. package/dist/server/routes/system-tools.d.ts +0 -2
  542. package/dist/server/routes/system-tools.d.ts.map +0 -1
  543. package/dist/server/routes/system.d.ts +0 -2
  544. package/dist/server/routes/system.d.ts.map +0 -1
  545. package/dist/server/routes/tasks.d.ts +0 -2
  546. package/dist/server/routes/tasks.d.ts.map +0 -1
  547. package/dist/storage.d.ts +0 -266
  548. package/dist/storage.d.ts.map +0 -1
  549. package/dist/test-support/memories-page-stub-server.d.ts +0 -2
  550. package/dist/test-support/memories-page-stub-server.d.ts.map +0 -1
  551. package/dist/test-support/memories-page-stub.d.ts +0 -28
  552. package/dist/test-support/memories-page-stub.d.ts.map +0 -1
  553. package/dist/test-support/preload-local-store.d.ts +0 -2
  554. package/dist/test-support/preload-local-store.d.ts.map +0 -1
  555. package/dist/test-support/project-authority-identity.d.ts +0 -8
  556. package/dist/test-support/project-authority-identity.d.ts.map +0 -1
  557. package/dist/test-support/store-isolation.d.ts +0 -108
  558. package/dist/test-support/store-isolation.d.ts.map +0 -1
  559. package/dist/test-support/strip-ansi.d.ts +0 -3
  560. package/dist/test-support/strip-ansi.d.ts.map +0 -1
  561. package/dist/types/hooks.d.ts +0 -136
  562. package/dist/types/hooks.d.ts.map +0 -1
  563. package/dist/types/index.d.ts +0 -472
  564. package/dist/types/index.d.ts.map +0 -1
@@ -1,978 +0,0 @@
1
- /**
2
- * @hasna/mementos/sdk — Zero-dependency TypeScript client for @hasna/mementos REST API.
3
- *
4
- * Import: `import { MementosClient } from "@hasna/mementos/sdk"`
5
- *
6
- * Works in Node.js, Bun, Deno, and browsers. No external dependencies beyond fetch.
7
- */
8
- export type MemoryScope = "global" | "shared" | "private" | "working";
9
- export type MemoryCategory = "preference" | "fact" | "knowledge" | "history" | "procedural" | "resource";
10
- export type MemorySource = "user" | "agent" | "system" | "auto" | "imported";
11
- export type MemoryStatus = "active" | "archived" | "expired";
12
- export type EntityType = "person" | "place" | "thing" | "concept" | "project" | "agent" | "file" | "url";
13
- export type RelationType = "uses" | "knows" | "depends_on" | "created_by" | "related_to" | "contradicts" | "part_of" | "implements" | "happened_before" | "happened_after" | "caused_by" | "resulted_in" | "supersedes" | "version_of";
14
- export type EntityRole = "subject" | "object" | "context" | "author" | "target";
15
- export type TaskStatus = "pending" | "in_progress" | "completed" | "failed" | "cancelled";
16
- export type TaskPriority = "critical" | "high" | "medium" | "low";
17
- export interface Task {
18
- id: string;
19
- subject: string;
20
- description: string;
21
- status: TaskStatus;
22
- priority: TaskPriority;
23
- tags: string[];
24
- assigned_agent_id: string | null;
25
- project_id: string | null;
26
- session_id: string | null;
27
- parent_task_id: string | null;
28
- metadata: Record<string, unknown>;
29
- progress: number;
30
- due_at: string | null;
31
- started_at: string | null;
32
- completed_at: string | null;
33
- failed_at: string | null;
34
- error: string | null;
35
- created_at: string;
36
- updated_at: string;
37
- }
38
- export interface TaskComment {
39
- id: string;
40
- task_id: string;
41
- agent_id: string | null;
42
- body: string;
43
- created_at: string;
44
- }
45
- export interface CreateTaskInput {
46
- subject: string;
47
- description?: string;
48
- priority?: TaskPriority;
49
- tags?: string[];
50
- assigned_agent_id?: string;
51
- project_id?: string;
52
- session_id?: string;
53
- parent_task_id?: string;
54
- metadata?: Record<string, unknown>;
55
- due_at?: string;
56
- }
57
- export interface UpdateTaskInput {
58
- subject?: string;
59
- description?: string;
60
- status?: TaskStatus;
61
- priority?: TaskPriority;
62
- tags?: string[];
63
- assigned_agent_id?: string | null;
64
- metadata?: Record<string, unknown>;
65
- progress?: number;
66
- due_at?: string | null;
67
- error?: string | null;
68
- }
69
- export interface TaskStats {
70
- total: number;
71
- by_status: Record<TaskStatus, number>;
72
- by_priority: Record<TaskPriority, number>;
73
- overdue: number;
74
- }
75
- export interface Memory {
76
- id: string;
77
- key: string;
78
- value: string;
79
- category: MemoryCategory;
80
- scope: MemoryScope;
81
- summary: string | null;
82
- tags: string[];
83
- importance: number;
84
- source: MemorySource;
85
- status: MemoryStatus;
86
- pinned: boolean;
87
- agent_id: string | null;
88
- project_id: string | null;
89
- session_id: string | null;
90
- metadata: Record<string, unknown>;
91
- access_count: number;
92
- version: number;
93
- expires_at: string | null;
94
- created_at: string;
95
- updated_at: string;
96
- accessed_at: string | null;
97
- }
98
- export interface MemoryVersion {
99
- id: string;
100
- memory_id: string;
101
- version: number;
102
- value: string;
103
- importance: number;
104
- scope: MemoryScope;
105
- category: MemoryCategory;
106
- tags: string[];
107
- summary: string | null;
108
- pinned: boolean;
109
- status: MemoryStatus;
110
- created_at: string;
111
- }
112
- export interface Agent {
113
- id: string;
114
- name: string;
115
- role: string | null;
116
- description: string | null;
117
- active_project_id?: string | null;
118
- created_at: string;
119
- last_seen_at: string | null;
120
- }
121
- export interface Project {
122
- id: string;
123
- name: string;
124
- path: string | null;
125
- description: string | null;
126
- memory_prefix: string | null;
127
- created_at: string;
128
- updated_at: string;
129
- }
130
- export type MementosProjectResourceKind = "project" | "knowledge" | "memory" | "session";
131
- export interface MementosProjectResourceAuthority {
132
- authority: "mementos";
133
- authority_id: string;
134
- tenant_id: string;
135
- corpus_id: string;
136
- package_version: string;
137
- }
138
- export interface MementosProjectResource {
139
- authority: "mementos";
140
- source_package: "@hasna/mementos";
141
- project_id: string;
142
- resource_kind: MementosProjectResourceKind;
143
- stable_id: string;
144
- revision: string;
145
- digest: string;
146
- membership: "project_aggregate" | "explicit_project_id_or_focus";
147
- }
148
- export interface MementosProjectResourcePage {
149
- schema: "mementos.project-resources.v1";
150
- authority: MementosProjectResourceAuthority;
151
- project_id: string;
152
- project_revision: string;
153
- collection_revision: string;
154
- resource_kinds: MementosProjectResourceKind[];
155
- resources: MementosProjectResource[];
156
- count: number;
157
- total: number;
158
- limit: number;
159
- cursor: string | null;
160
- next_cursor: string | null;
161
- has_more: boolean;
162
- complete: true;
163
- truncated: false;
164
- }
165
- export interface MementosProjectResourceExactResult {
166
- schema: "mementos.project-resource.v1";
167
- authority: MementosProjectResourceAuthority;
168
- project_id: string;
169
- project_revision: string;
170
- collection_revision: string;
171
- resource: MementosProjectResource;
172
- complete: true;
173
- truncated: false;
174
- }
175
- export interface ListMementosProjectResourcesOptions {
176
- limit?: number;
177
- cursor?: string;
178
- resource_kinds?: MementosProjectResourceKind[];
179
- }
180
- export interface ListAllMementosProjectResourcesOptions {
181
- page_size?: number;
182
- resource_kinds?: MementosProjectResourceKind[];
183
- }
184
- export interface UpdateProjectInput {
185
- name?: string;
186
- path?: string;
187
- description?: string | null;
188
- memory_prefix?: string | null;
189
- }
190
- export interface ProjectAuthorityIdentity {
191
- authority_id: string;
192
- tenant_id: string;
193
- corpus_id: string;
194
- }
195
- export interface ProjectGuardedUpdateRequest extends ProjectAuthorityIdentity {
196
- operation_id: string;
197
- step_id: string;
198
- idempotency_key: string;
199
- expected_revision: string;
200
- updates: UpdateProjectInput;
201
- }
202
- export interface ProjectGuardedRollbackRequest extends ProjectAuthorityIdentity {
203
- operation_id: string;
204
- step_id: string;
205
- idempotency_key: string;
206
- expected_revision: string;
207
- accepted_receipt_id: string;
208
- }
209
- export interface ProjectUpdateReceipt {
210
- receipt_id: string;
211
- authority: "mementos";
212
- route: "mementos.project-guarded-update.v1";
213
- package_version: string;
214
- authority_id: string;
215
- tenant_id: string;
216
- corpus_id: string;
217
- operation_id: string;
218
- step_id: string;
219
- direction: "forward" | "rollback";
220
- idempotency_key: string;
221
- request_digest: string;
222
- outcome: "accepted";
223
- target_id: string;
224
- expected_revision: string;
225
- result_revision: string;
226
- result_digest: string;
227
- accepted_receipt_id: string | null;
228
- before_project: Project;
229
- after_project: Project;
230
- created_at: string;
231
- }
232
- export interface ProjectGuardedUpdateResult {
233
- dry_run: boolean;
234
- applied: boolean;
235
- project: Project;
236
- receipt: ProjectUpdateReceipt | null;
237
- }
238
- export interface MemoryProjectLinkSnapshot {
239
- memory_id: string;
240
- project_id: string | null;
241
- memory_version: number;
242
- memory_revision: string;
243
- memory_digest: string;
244
- }
245
- export interface MemoryProjectLinkRequest extends ProjectAuthorityIdentity {
246
- operation_id: string;
247
- step_id: string;
248
- idempotency_key: string;
249
- expected_memory_version: number;
250
- expected_memory_revision: string;
251
- target_project_id: string;
252
- expected_project_revision: string;
253
- }
254
- export interface MemoryProjectLinkRollbackRequest extends ProjectAuthorityIdentity {
255
- operation_id: string;
256
- step_id: string;
257
- idempotency_key: string;
258
- expected_memory_version: number;
259
- expected_memory_revision: string;
260
- accepted_receipt_id: string;
261
- }
262
- export interface MemoryProjectLinkReceipt {
263
- receipt_id: string;
264
- authority: "mementos";
265
- route: "mementos.memory-project-link.v1";
266
- package_version: string;
267
- authority_id: string;
268
- tenant_id: string;
269
- corpus_id: string;
270
- operation_id: string;
271
- step_id: string;
272
- direction: "forward" | "rollback";
273
- idempotency_key: string;
274
- request_digest: string;
275
- outcome: "accepted" | "no_change";
276
- target_memory_id: string;
277
- requested_project_id: string;
278
- expected_memory_version: number;
279
- expected_memory_revision: string;
280
- expected_project_revision: string | null;
281
- result_memory_version: number;
282
- result_memory_revision: string;
283
- result_memory_digest: string;
284
- result_project_revision: string | null;
285
- result_project_digest: string | null;
286
- accepted_receipt_id: string | null;
287
- before_link: MemoryProjectLinkSnapshot;
288
- after_link: MemoryProjectLinkSnapshot;
289
- before_project_revision: string | null;
290
- before_project_digest: string | null;
291
- after_project_revision: string | null;
292
- after_project_digest: string | null;
293
- created_at: string;
294
- }
295
- export interface MemoryProjectLinkResult {
296
- dry_run: boolean;
297
- applied: boolean;
298
- no_change: boolean;
299
- memory: Memory;
300
- project: Project | null;
301
- receipt: MemoryProjectLinkReceipt | null;
302
- }
303
- export interface Entity {
304
- id: string;
305
- name: string;
306
- type: EntityType;
307
- description: string | null;
308
- metadata: Record<string, unknown>;
309
- project_id: string | null;
310
- created_at: string;
311
- updated_at: string;
312
- }
313
- export interface Relation {
314
- id: string;
315
- source_entity_id: string;
316
- target_entity_id: string;
317
- relation_type: RelationType;
318
- weight: number;
319
- metadata: Record<string, unknown>;
320
- created_at: string;
321
- }
322
- export type ResourceType = "project" | "memory" | "entity" | "agent" | "connector" | "file";
323
- export type LockType = "advisory" | "exclusive";
324
- export interface ResourceLock {
325
- id: string;
326
- resource_type: ResourceType;
327
- resource_id: string;
328
- agent_id: string;
329
- lock_type: LockType;
330
- locked_at: string;
331
- expires_at: string;
332
- }
333
- export interface AcquireLockInput {
334
- agent_id: string;
335
- resource_type: ResourceType;
336
- resource_id: string;
337
- lock_type?: LockType;
338
- ttl_seconds?: number;
339
- }
340
- export interface MemoryStats {
341
- total: number;
342
- by_scope: Record<MemoryScope, number>;
343
- by_category: Record<MemoryCategory, number>;
344
- by_status: Record<MemoryStatus, number>;
345
- by_agent: Record<string, number>;
346
- pinned_count: number;
347
- expired_count: number;
348
- }
349
- export interface CreateMemoryInput {
350
- key: string;
351
- value: string;
352
- category?: MemoryCategory;
353
- scope?: MemoryScope;
354
- summary?: string;
355
- tags?: string[];
356
- importance?: number;
357
- source?: MemorySource;
358
- agent_id?: string;
359
- project_id?: string;
360
- session_id?: string;
361
- metadata?: Record<string, unknown>;
362
- expires_at?: string;
363
- ttl?: string;
364
- }
365
- export interface UpdateMemoryInput {
366
- value?: string;
367
- category?: MemoryCategory;
368
- scope?: MemoryScope;
369
- summary?: string | null;
370
- tags?: string[];
371
- importance?: number;
372
- pinned?: boolean;
373
- status?: MemoryStatus;
374
- metadata?: Record<string, unknown>;
375
- expires_at?: string | null;
376
- version?: number;
377
- }
378
- export interface ListMemoriesFilter {
379
- scope?: MemoryScope;
380
- category?: MemoryCategory;
381
- tags?: string[];
382
- min_importance?: number;
383
- pinned?: boolean;
384
- agent_id?: string;
385
- project_id?: string;
386
- session_id?: string;
387
- namespace?: string;
388
- status?: MemoryStatus;
389
- limit?: number;
390
- offset?: number;
391
- fields?: string[];
392
- }
393
- export interface SearchMemoriesInput {
394
- query: string;
395
- scope?: MemoryScope;
396
- category?: MemoryCategory;
397
- tags?: string[];
398
- session_id?: string;
399
- namespace?: string;
400
- limit?: number;
401
- }
402
- export interface ExportMemoriesInput {
403
- scope?: MemoryScope;
404
- category?: MemoryCategory;
405
- agent_id?: string;
406
- project_id?: string;
407
- tags?: string[];
408
- limit?: number;
409
- }
410
- export interface ImportMemoriesInput {
411
- memories: Partial<Memory>[];
412
- overwrite?: boolean;
413
- }
414
- export interface CreateEntityInput {
415
- name: string;
416
- type: EntityType;
417
- description?: string;
418
- metadata?: Record<string, unknown>;
419
- project_id?: string;
420
- }
421
- export interface UpdateEntityInput {
422
- name?: string;
423
- type?: EntityType;
424
- description?: string | null;
425
- metadata?: Record<string, unknown>;
426
- }
427
- export interface CreateRelationInput {
428
- source_entity_id: string;
429
- target_entity_id: string;
430
- relation_type: RelationType;
431
- weight?: number;
432
- metadata?: Record<string, unknown>;
433
- }
434
- export interface ListTasksFilter {
435
- status?: TaskStatus;
436
- priority?: TaskPriority;
437
- assigned_agent_id?: string;
438
- project_id?: string;
439
- session_id?: string;
440
- parent_task_id?: string | null;
441
- tags?: string[];
442
- limit?: number;
443
- offset?: number;
444
- }
445
- export interface MementosClientConfig {
446
- baseUrl?: string;
447
- fetch?: typeof globalThis.fetch;
448
- /**
449
- * API key issued by `contracts issue-key --app mementos`. Sent as both
450
- * `Authorization: Bearer <key>` and `x-api-key`. Required against a
451
- * self_hosted deployment with API-key auth enabled.
452
- */
453
- apiKey?: string;
454
- /**
455
- * Versioned route prefix. Defaults to the canonical `/v1`. The deployed
456
- * service also serves the legacy `/api` prefix; set `prefix: "/api"` to target
457
- * it explicitly.
458
- */
459
- prefix?: string;
460
- }
461
- export declare class MementosError extends Error {
462
- readonly status: number;
463
- readonly details?: unknown | undefined;
464
- constructor(message: string, status: number, details?: unknown | undefined);
465
- }
466
- export interface AutoMemoryQueueStats {
467
- pending: number;
468
- processing: number;
469
- processed: number;
470
- failed: number;
471
- dropped: number;
472
- }
473
- export interface AutoMemoryConfig {
474
- provider: "anthropic" | "openai" | "cerebras" | "grok";
475
- model?: string;
476
- enabled: boolean;
477
- minImportance: number;
478
- autoEntityLink: boolean;
479
- fallback?: Array<"anthropic" | "openai" | "cerebras" | "grok">;
480
- }
481
- export interface SdkExtractedMemory {
482
- content: string;
483
- category: "preference" | "fact" | "knowledge" | "history";
484
- importance: number;
485
- tags: string[];
486
- suggestedScope: "private" | "shared" | "global";
487
- reasoning?: string;
488
- }
489
- export interface SdkHook {
490
- id: string;
491
- type: string;
492
- blocking: boolean;
493
- priority: number;
494
- builtin: boolean;
495
- agentId?: string;
496
- projectId?: string;
497
- description?: string;
498
- }
499
- export interface SdkWebhook {
500
- id: string;
501
- type: string;
502
- handlerUrl: string;
503
- priority: number;
504
- blocking: boolean;
505
- agentId?: string;
506
- projectId?: string;
507
- description?: string;
508
- enabled: boolean;
509
- createdAt: string;
510
- invocationCount: number;
511
- failureCount: number;
512
- }
513
- export interface SynthesisRun {
514
- id: string;
515
- triggered_by: string;
516
- project_id: string | null;
517
- agent_id: string | null;
518
- corpus_size: number;
519
- proposals_generated: number;
520
- proposals_accepted: number;
521
- proposals_rejected: number;
522
- status: "pending" | "running" | "completed" | "failed" | "rolled_back";
523
- error: string | null;
524
- started_at: string;
525
- completed_at: string | null;
526
- }
527
- export interface SynthesisResult {
528
- run: SynthesisRun;
529
- proposals: unknown[];
530
- executed: number;
531
- metrics: {
532
- corpusReduction: number;
533
- deduplicationRate: number;
534
- } | null;
535
- dryRun: boolean;
536
- }
537
- export interface SessionMemoryJob {
538
- id: string;
539
- session_id: string;
540
- agent_id: string | null;
541
- project_id: string | null;
542
- source: string;
543
- status: "pending" | "processing" | "completed" | "failed";
544
- transcript: string;
545
- chunk_count: number;
546
- memories_extracted: number;
547
- error: string | null;
548
- metadata: Record<string, unknown>;
549
- created_at: string;
550
- started_at: string | null;
551
- completed_at: string | null;
552
- }
553
- export declare class MementosClient {
554
- private baseUrl;
555
- private _fetch;
556
- private apiKey?;
557
- private prefix;
558
- constructor(config?: MementosClientConfig);
559
- static fromEnv(overrides?: Partial<MementosClientConfig>): MementosClient;
560
- private request;
561
- private get;
562
- private post;
563
- private patch;
564
- private delete;
565
- listMemories(filter?: ListMemoriesFilter): Promise<{
566
- memories: Memory[];
567
- count: number;
568
- total?: number;
569
- has_more?: boolean;
570
- next_cursor?: number | null;
571
- }>;
572
- getStats(): Promise<MemoryStats>;
573
- getHealth(): Promise<{
574
- status: "ok" | "warn";
575
- version: string;
576
- mode: "local" | "cloud";
577
- profile: string;
578
- db_path: string;
579
- hostname: string;
580
- memories: {
581
- total: number;
582
- expired: number;
583
- pinned: number;
584
- };
585
- agents: number;
586
- projects: number;
587
- }>;
588
- /** Liveness/readiness probe — verifies backing-store connectivity. */
589
- getReady(): Promise<{
590
- status: "ready" | "not_ready";
591
- version: string;
592
- mode: "local" | "cloud";
593
- }>;
594
- /** Service version + storage mode. */
595
- getVersion(): Promise<{
596
- status: "ok";
597
- version: string;
598
- mode: "local" | "cloud";
599
- }>;
600
- getReport(options?: {
601
- days?: number;
602
- project_id?: string;
603
- agent_id?: string;
604
- }): Promise<{
605
- total: number;
606
- pinned: number;
607
- days: number;
608
- recent: {
609
- total: number;
610
- activity: {
611
- date: string;
612
- memories_created: number;
613
- }[];
614
- };
615
- by_scope: Record<string, number>;
616
- by_category: Record<string, number>;
617
- top_memories: {
618
- id: string;
619
- key: string;
620
- value: string;
621
- importance: number;
622
- scope: string;
623
- category: string;
624
- }[];
625
- top_agents: {
626
- agent_id: string;
627
- c: number;
628
- }[];
629
- }>;
630
- getStaleMemories(options?: {
631
- days?: number;
632
- project_id?: string;
633
- agent_id?: string;
634
- limit?: number;
635
- offset?: number;
636
- }): Promise<{
637
- memories: Memory[];
638
- count: number;
639
- days: number;
640
- total?: number;
641
- has_more?: boolean;
642
- next_cursor?: number | null;
643
- }>;
644
- getActivity(options?: {
645
- days?: number;
646
- scope?: MemoryScope;
647
- agent_id?: string;
648
- project_id?: string;
649
- }): Promise<{
650
- activity: {
651
- date: string;
652
- memories_created: number;
653
- global_count: number;
654
- shared_count: number;
655
- private_count: number;
656
- avg_importance: number;
657
- }[];
658
- days: number;
659
- total: number;
660
- }>;
661
- searchMemories(input: SearchMemoriesInput | string): Promise<{
662
- results: Memory[];
663
- count: number;
664
- }>;
665
- exportMemories(input?: ExportMemoriesInput): Promise<{
666
- memories: Memory[];
667
- count: number;
668
- }>;
669
- importMemories(input: ImportMemoriesInput): Promise<{
670
- imported: number;
671
- errors: string[];
672
- total: number;
673
- }>;
674
- cleanExpired(): Promise<{
675
- cleaned: number;
676
- }>;
677
- extractFromSession(input: {
678
- session_id: string;
679
- title?: string;
680
- project?: string;
681
- model?: string;
682
- messages?: number;
683
- key_topics?: string[];
684
- summary?: string;
685
- agent_id?: string;
686
- project_id?: string;
687
- memories?: Partial<CreateMemoryInput>[];
688
- }): Promise<{
689
- created: number;
690
- memory_ids: string[];
691
- errors: string[];
692
- session_id: string;
693
- }>;
694
- saveMemory(input: CreateMemoryInput): Promise<Memory>;
695
- getMemory(id: string): Promise<Memory>;
696
- getMemoryVersions(id: string): Promise<{
697
- versions: MemoryVersion[];
698
- count: number;
699
- current_version: number;
700
- }>;
701
- updateMemory(id: string, input: UpdateMemoryInput): Promise<Memory>;
702
- deleteMemory(id: string): Promise<{
703
- deleted: boolean;
704
- }>;
705
- listAgents(): Promise<{
706
- agents: Agent[];
707
- }>;
708
- registerAgent(input: {
709
- name: string;
710
- role?: string;
711
- description?: string;
712
- }): Promise<Agent>;
713
- getAgent(idOrName: string): Promise<Agent>;
714
- updateAgent(idOrName: string, updates: {
715
- name?: string;
716
- role?: string;
717
- description?: string;
718
- metadata?: Record<string, unknown>;
719
- active_project_id?: string | null;
720
- }): Promise<Agent>;
721
- listAgentsByProject(projectId: string): Promise<{
722
- agents: Agent[];
723
- count: number;
724
- }>;
725
- listProjects(): Promise<{
726
- projects: Project[];
727
- }>;
728
- registerProject(input: {
729
- name: string;
730
- path?: string;
731
- description?: string;
732
- memory_prefix?: string;
733
- }): Promise<Project>;
734
- getProject(idOrName: string): Promise<Project>;
735
- listProjectResources(projectId: string, options?: ListMementosProjectResourcesOptions): Promise<MementosProjectResourcePage>;
736
- listAllProjectResources(projectId: string, options?: ListAllMementosProjectResourcesOptions): Promise<MementosProjectResourcePage>;
737
- getProjectResource(projectId: string, resourceKind: MementosProjectResourceKind, stableId: string): Promise<MementosProjectResourceExactResult>;
738
- updateProject(id: string, request: ProjectGuardedUpdateRequest): Promise<ProjectGuardedUpdateResult>;
739
- previewProjectUpdate(id: string, request: ProjectGuardedUpdateRequest): Promise<ProjectGuardedUpdateResult>;
740
- rollbackProjectUpdate(id: string, request: ProjectGuardedRollbackRequest): Promise<ProjectGuardedUpdateResult>;
741
- getProjectUpdateReceipt(id: string, receiptId: string, identity: ProjectAuthorityIdentity): Promise<ProjectUpdateReceipt>;
742
- linkMemoryProject(memoryId: string, request: MemoryProjectLinkRequest): Promise<MemoryProjectLinkResult>;
743
- previewMemoryProjectLink(memoryId: string, request: MemoryProjectLinkRequest): Promise<MemoryProjectLinkResult>;
744
- rollbackMemoryProjectLink(memoryId: string, request: MemoryProjectLinkRollbackRequest): Promise<MemoryProjectLinkResult>;
745
- getMemoryProjectLinkReceipt(memoryId: string, receiptId: string, identity: ProjectAuthorityIdentity): Promise<MemoryProjectLinkReceipt>;
746
- getProjectAgents(idOrName: string): Promise<{
747
- agents: Agent[];
748
- count: number;
749
- }>;
750
- listEntities(filter?: {
751
- type?: EntityType;
752
- limit?: number;
753
- offset?: number;
754
- }): Promise<{
755
- entities: Entity[];
756
- count: number;
757
- }>;
758
- createEntity(input: CreateEntityInput): Promise<Entity>;
759
- mergeEntities(input: {
760
- source_id: string;
761
- target_id: string;
762
- }): Promise<Entity>;
763
- getEntity(id: string): Promise<Entity>;
764
- updateEntity(id: string, input: UpdateEntityInput): Promise<Entity>;
765
- deleteEntity(id: string): Promise<{
766
- deleted: boolean;
767
- }>;
768
- getEntityMemories(entityId: string): Promise<{
769
- memories: Memory[];
770
- count: number;
771
- }>;
772
- linkEntityMemory(entityId: string, input: {
773
- memory_id: string;
774
- role?: EntityRole;
775
- }): Promise<{
776
- linked: boolean;
777
- }>;
778
- unlinkEntityMemory(entityId: string, memoryId: string): Promise<{
779
- unlinked: boolean;
780
- }>;
781
- getEntityRelations(entityId: string, filter?: {
782
- relation_type?: RelationType;
783
- direction?: "from" | "to" | "both";
784
- }): Promise<{
785
- relations: Relation[];
786
- }>;
787
- createRelation(input: CreateRelationInput): Promise<Relation>;
788
- getRelation(id: string): Promise<Relation>;
789
- deleteRelation(id: string): Promise<{
790
- deleted: boolean;
791
- }>;
792
- getGraph(entityId: string, options?: {
793
- depth?: number;
794
- relation_types?: RelationType[];
795
- }): Promise<{
796
- nodes: Entity[];
797
- edges: Relation[];
798
- }>;
799
- findPath(fromId: string, toId: string): Promise<{
800
- path: Entity[];
801
- found: boolean;
802
- }>;
803
- getGraphStats(): Promise<{
804
- entity_count: number;
805
- relation_count: number;
806
- by_type: Record<string, number>;
807
- }>;
808
- acquireLock(input: AcquireLockInput): Promise<ResourceLock | null>;
809
- checkLock(resourceType: ResourceType, resourceId: string, lockType?: LockType): Promise<ResourceLock[]>;
810
- releaseLock(lockId: string, agentId: string): Promise<{
811
- released: boolean;
812
- }>;
813
- listAgentLocks(agentId: string): Promise<ResourceLock[]>;
814
- releaseAllAgentLocks(agentId: string): Promise<{
815
- released: number;
816
- }>;
817
- cleanExpiredLocks(): Promise<{
818
- cleaned: number;
819
- }>;
820
- /** Create a task. */
821
- createTask(input: CreateTaskInput): Promise<Task>;
822
- /** List tasks with optional filters. */
823
- listTasks(filter?: ListTasksFilter): Promise<{
824
- tasks: Task[];
825
- count: number;
826
- }>;
827
- /** Get task stats (by status, priority, overdue). */
828
- getTaskStats(options?: {
829
- project_id?: string;
830
- agent_id?: string;
831
- }): Promise<TaskStats>;
832
- /** Get a task by ID. */
833
- getTask(id: string): Promise<Task>;
834
- /** Update a task. */
835
- updateTask(id: string, input: UpdateTaskInput): Promise<Task>;
836
- /** Delete a task. */
837
- deleteTask(id: string): Promise<{
838
- deleted: boolean;
839
- }>;
840
- /** List comments on a task. */
841
- listTaskComments(taskId: string): Promise<{
842
- comments: TaskComment[];
843
- count: number;
844
- }>;
845
- /** Add a comment to a task. */
846
- addTaskComment(taskId: string, body: string, agentId?: string): Promise<TaskComment>;
847
- /** Delete a task comment. */
848
- deleteTaskComment(taskId: string, commentId: string): Promise<{
849
- deleted: boolean;
850
- }>;
851
- getContext(options?: {
852
- agent_id?: string;
853
- project_id?: string;
854
- max_tokens?: number;
855
- format?: "xml" | "markdown" | "compact" | "json";
856
- }): Promise<{
857
- context: string;
858
- memories_count: number;
859
- }>;
860
- processConversationTurn(turn: string, context?: {
861
- agent_id?: string;
862
- project_id?: string;
863
- session_id?: string;
864
- }): Promise<{
865
- queued: boolean;
866
- queue: AutoMemoryQueueStats;
867
- }>;
868
- getAutoMemoryStatus(): Promise<{
869
- queue: AutoMemoryQueueStats;
870
- config: AutoMemoryConfig;
871
- providers: Record<string, {
872
- available: boolean;
873
- model: string;
874
- }>;
875
- }>;
876
- configureAutoMemory(config: Partial<AutoMemoryConfig> & {
877
- min_importance?: number;
878
- auto_entity_link?: boolean;
879
- }): Promise<{
880
- updated: boolean;
881
- config: AutoMemoryConfig;
882
- }>;
883
- testExtraction(turn: string, options?: {
884
- provider?: "anthropic" | "openai" | "cerebras" | "grok";
885
- agent_id?: string;
886
- project_id?: string;
887
- }): Promise<{
888
- provider: string;
889
- model: string;
890
- extracted: SdkExtractedMemory[];
891
- count: number;
892
- note: string;
893
- }>;
894
- listHooks(type?: string): Promise<SdkHook[]>;
895
- getHookStats(): Promise<{
896
- total: number;
897
- byType: Record<string, number>;
898
- blocking: number;
899
- nonBlocking: number;
900
- }>;
901
- listWebhooks(filter?: {
902
- type?: string;
903
- enabled?: boolean;
904
- }): Promise<SdkWebhook[]>;
905
- createWebhook(input: {
906
- type: string;
907
- handler_url: string;
908
- priority?: number;
909
- blocking?: boolean;
910
- agent_id?: string;
911
- project_id?: string;
912
- description?: string;
913
- }): Promise<SdkWebhook>;
914
- getWebhook(id: string): Promise<SdkWebhook>;
915
- updateWebhook(id: string, updates: {
916
- enabled?: boolean;
917
- priority?: number;
918
- description?: string;
919
- }): Promise<SdkWebhook>;
920
- deleteWebhook(id: string): Promise<void>;
921
- enableWebhook(id: string): Promise<SdkWebhook>;
922
- disableWebhook(id: string): Promise<SdkWebhook>;
923
- runSynthesis(options?: {
924
- project_id?: string;
925
- agent_id?: string;
926
- dry_run?: boolean;
927
- max_proposals?: number;
928
- provider?: string;
929
- }): Promise<SynthesisResult>;
930
- listSynthesisRuns(filter?: {
931
- project_id?: string;
932
- limit?: number;
933
- }): Promise<{
934
- runs: SynthesisRun[];
935
- count: number;
936
- }>;
937
- getSynthesisStatus(options?: {
938
- project_id?: string;
939
- run_id?: string;
940
- }): Promise<{
941
- lastRun: SynthesisRun | null;
942
- recentRuns: SynthesisRun[];
943
- }>;
944
- rollbackSynthesis(runId: string): Promise<{
945
- rolled_back: number;
946
- errors: string[];
947
- }>;
948
- ingestSession(input: {
949
- transcript: string;
950
- session_id: string;
951
- agent_id?: string;
952
- project_id?: string;
953
- source?: "claude-code" | "codex" | "manual" | "open-sessions";
954
- metadata?: Record<string, unknown>;
955
- }): Promise<{
956
- job_id: string;
957
- status: string;
958
- message: string;
959
- }>;
960
- getSessionJob(jobId: string): Promise<SessionMemoryJob>;
961
- listSessionJobs(filter?: {
962
- agent_id?: string;
963
- project_id?: string;
964
- status?: string;
965
- limit?: number;
966
- }): Promise<{
967
- jobs: SessionMemoryJob[];
968
- count: number;
969
- }>;
970
- getSessionQueueStats(): Promise<{
971
- pending: number;
972
- processing: number;
973
- completed: number;
974
- failed: number;
975
- }>;
976
- }
977
- export default MementosClient;
978
- //# sourceMappingURL=index.d.ts.map