@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,150 @@
1
+ import type { Command } from "commander";
2
+ import type { Memory, MemoryCategory, MemoryScope } from "../types/index.js";
3
+ import type { Entity, EntityType } from "../types/index.js";
4
+ export declare function getPackageVersion(): string;
5
+ export declare function importanceColor(importance: number): (s: string) => string;
6
+ export declare function colorScope(scope: MemoryScope): string;
7
+ export declare function colorCategory(category: MemoryCategory): string;
8
+ export declare function colorImportance(importance: number): string;
9
+ export declare function colorEntityType(type: string, suffix?: string): string;
10
+ export declare function resolveEntityArg(nameOrId: string, type?: EntityType): Entity;
11
+ export declare function outputJson(data: unknown): void;
12
+ export declare const DEFAULT_COMPACT_LIMIT = 20;
13
+ export declare const DEFAULT_SEARCH_LIMIT = 10;
14
+ export declare const DEFAULT_SNIPPET_LENGTH = 72;
15
+ export declare function positiveIntOrDefault(value: unknown, fallback: number): number;
16
+ export declare function cursorOrOffset(cursor: unknown, offset: unknown): number | undefined;
17
+ export declare function truncateText(value: string | null | undefined, max?: number): string;
18
+ export interface PagedFetchResult<T> {
19
+ rows: T[];
20
+ /**
21
+ * true = more rows exist; false = the end was reached; undefined = the
22
+ * server did not say (an older server without the pagination contract —
23
+ * the walk falls back to a short-page heuristic).
24
+ */
25
+ has_more: boolean | undefined;
26
+ next_cursor: number | null;
27
+ }
28
+ /**
29
+ * Collect rows across bounded pages (BUG 2796806b). The server caps every
30
+ * single response (1000 rows for list surfaces), so a request for more than
31
+ * one page — or for the full population — must walk pages.
32
+ *
33
+ * `target` is the number of rows the caller will display; the walk probes one
34
+ * row past it so `hasMore` is truthful and a "use --cursor N for more" hint is
35
+ * honest. With `target` undefined every matching row is collected.
36
+ *
37
+ * Guarded against cursor cycles and runaway page counts (mirrors the SDK's
38
+ * traversal guards). Termination: the server's `has_more: false`, or a page
39
+ * shorter than requested when the server carries no signal, or `target` rows
40
+ * collected.
41
+ */
42
+ export declare function collectPagedRows<T>(fetchPage: (offset: number, limit: number) => PagedFetchResult<T>, target: number | undefined, offset: number, opts?: {
43
+ pageSize?: number;
44
+ maxPages?: number;
45
+ }): {
46
+ rows: T[];
47
+ hasMore: boolean;
48
+ };
49
+ export declare function printPageHint(opts: {
50
+ shown: number;
51
+ limit: number;
52
+ offset?: number;
53
+ hasMore: boolean;
54
+ command: string;
55
+ detailHint?: string;
56
+ }): void;
57
+ /**
58
+ * Resolve output format from local command flag, global flag, or --json alias.
59
+ * Priority: localFmt > global --format > --json > "compact"
60
+ */
61
+ export declare function getOutputFormat(program: Command, localFmt?: string): string;
62
+ /**
63
+ * Simple YAML output — no library dependency.
64
+ * Arrays of objects: each item as `- key: value` block.
65
+ * Single objects: `key: value` per line.
66
+ */
67
+ export declare function outputYaml(data: unknown): void;
68
+ export declare function formatMemoryLine(m: Memory, opts?: {
69
+ valueLength?: number;
70
+ preferSummary?: boolean;
71
+ }): string;
72
+ export declare function formatMemoryDetail(m: Memory): string;
73
+ export declare function makeHandleError(program: Command): (e: unknown) => never;
74
+ export declare function resolveMemoryId(partialId: string): string;
75
+ /**
76
+ * Resolve an `--agent` filter value to the agent id the store actually indexes.
77
+ *
78
+ * WHY THIS EXISTS. Every read command declared `--agent <name>` and then used
79
+ * the raw string as an agent ID. A registered NAME therefore matched nothing,
80
+ * and — because an empty list is a legal answer — the miss was reported as
81
+ * "No memories found." at rc=0 with empty stderr. A real name and a fabricated
82
+ * string produced byte-identical output, so no caller could tell an empty set
83
+ * from a mistyped one. The fleet's compliance check for the mementos-discipline
84
+ * rule is `list --agent <seat>`, which meant it reported every seat as
85
+ * non-compliant regardless of truth: a check that cannot pass.
86
+ *
87
+ * RESOLUTION IS DELEGATED, NOT REIMPLEMENTED. `getAgent` already does
88
+ * id -> case-insensitive name -> unique partial id (returning null when a
89
+ * partial is ambiguous), it is what the `save` path uses since #43, and it is
90
+ * MODE-AWARE — in API mode it resolves through `GET /agents/<value>` rather
91
+ * than SQL. A local-only lookup here would have worked on a developer box and
92
+ * failed on the fleet, which runs in API mode.
93
+ *
94
+ * ON A MISS: WARN AND PASS THE RAW VALUE THROUGH.
95
+ *
96
+ * - WARN rather than THROW. The save path throws (#43) because there rc=0 was
97
+ * illusory: the write silently landed in the unowned bucket and destroyed
98
+ * what was there. A read filter destroys nothing, and callers legitimately
99
+ * treat an empty list as a scriptable answer, so the sibling contract to
100
+ * match is `todos list --assigned <bogus>`, which warns at rc=0. Same class,
101
+ * opposite verb, deliberately different remedy.
102
+ * - The warning goes to STDERR so `--format json` stays parseable on stdout.
103
+ * - PASSING THE RAW VALUE THROUGH, rather than dropping the filter, is the
104
+ * load-bearing half. Dropping it is what `search` and `info-stale` did, and
105
+ * it WIDENS the query: an unresolvable agent then returns every agent's
106
+ * rows. Zero rows is a visible failure; other agents' rows returned as
107
+ * yours is an invisible one. Passing the raw value keeps the query narrow
108
+ * and also cannot regress a caller whose id has no `agents` row — measured
109
+ * 0 such rows across 8340 memories at the time of the fix, but the store is
110
+ * not frozen.
111
+ */
112
+ export declare function resolveAgentFilter(nameOrId: string | undefined): string | undefined;
113
+ /**
114
+ * Resolve a key-or-id argument to a Memory object.
115
+ * Tries key lookup first (with optional scope/agent/project filters), then partial ID.
116
+ */
117
+ export declare function resolveKeyOrId(keyOrId: string, opts: {
118
+ scope?: string;
119
+ agent?: string;
120
+ project?: string;
121
+ }, globalOpts: GlobalOpts): Memory | null;
122
+ export declare function formatWatchLine(m: Memory): string;
123
+ export declare function sendNotification(m: Memory): void;
124
+ export interface GlobalOpts {
125
+ project?: string;
126
+ json?: boolean;
127
+ format?: string;
128
+ agent?: string;
129
+ session?: string;
130
+ }
131
+ export declare function diffLines(oldText: string, newText: string): void;
132
+ export declare function diffMemory(memoryId: string, opts: {
133
+ version?: string;
134
+ }, globalOpts: GlobalOpts): void;
135
+ export declare const VALID_SCOPES: string[];
136
+ export declare const VALID_CATEGORIES: string[];
137
+ /** Navigate a nested object using dot-notation key path */
138
+ export declare function getNestedValue(obj: Record<string, unknown>, path: string): unknown;
139
+ /** Set a nested value using dot-notation key path */
140
+ export declare function setNestedValue(obj: Record<string, unknown>, path: string, value: unknown): void;
141
+ /** Remove a nested key using dot-notation key path */
142
+ export declare function deleteNestedKey(obj: Record<string, unknown>, path: string): void;
143
+ /** Parse a CLI value: try JSON.parse for numbers/booleans/arrays, fall back to string */
144
+ export declare function parseConfigValue(raw: string): unknown;
145
+ /** Validate a config key/value pair against known constraints */
146
+ export declare function validateConfigKeyValue(key: string, value: unknown, DEFAULT_CONFIG: unknown): string | null;
147
+ export declare function getConfigPath(): string;
148
+ export declare function readFileConfig(): Record<string, unknown>;
149
+ export declare function writeFileConfig(data: Record<string, unknown>): void;
150
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/cli/helpers.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.tsx"],"names":[],"mappings":""}
package/dist/cli/index.js CHANGED
@@ -1011,7 +1011,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1011
1011
  this._exitCallback = (err) => {
1012
1012
  if (err.code !== "commander.executeSubCommandAsync") {
1013
1013
  throw err;
1014
- }
1014
+ } else {}
1015
1015
  };
1016
1016
  }
1017
1017
  return this;
@@ -5019,6 +5019,30 @@ function redactSecrets(text) {
5019
5019
  }
5020
5020
  return result;
5021
5021
  }
5022
+ function redactValueTree(value) {
5023
+ if (typeof value === "string")
5024
+ return redactSecrets(value);
5025
+ if (Array.isArray(value))
5026
+ return value.map(redactValueTree);
5027
+ if (value !== null && typeof value === "object") {
5028
+ const out = {};
5029
+ for (const [k, v] of Object.entries(value)) {
5030
+ out[k] = redactValueTree(v);
5031
+ }
5032
+ return out;
5033
+ }
5034
+ return value;
5035
+ }
5036
+ function redactMemoryForOutput(memory) {
5037
+ return {
5038
+ ...memory,
5039
+ key: redactSecrets(memory.key),
5040
+ value: redactSecrets(memory.value),
5041
+ summary: memory.summary ? redactSecrets(memory.summary) : null,
5042
+ when_to_use: memory.when_to_use ? redactSecrets(memory.when_to_use) : null,
5043
+ metadata: redactValueTree(memory.metadata)
5044
+ };
5045
+ }
5022
5046
  var REDACTED = "[REDACTED]", SECRET_PATTERNS;
5023
5047
  var init_redact = __esm(() => {
5024
5048
  SECRET_PATTERNS = [
@@ -9952,6 +9976,7 @@ var init_auto_memory = __esm(() => {
9952
9976
  // src/db/webhook_hooks.ts
9953
9977
  var exports_webhook_hooks = {};
9954
9978
  __export(exports_webhook_hooks, {
9979
+ validateWebhookHandlerUrl: () => validateWebhookHandlerUrl,
9955
9980
  updateWebhookHook: () => updateWebhookHook,
9956
9981
  recordWebhookInvocation: () => recordWebhookInvocation,
9957
9982
  listWebhookHooks: () => listWebhookHooks,
@@ -9959,6 +9984,8 @@ __export(exports_webhook_hooks, {
9959
9984
  deleteWebhookHook: () => deleteWebhookHook,
9960
9985
  createWebhookHook: () => createWebhookHook
9961
9986
  });
9987
+ import { isIP } from "net";
9988
+ import { lookup as dnsLookup } from "dns/promises";
9962
9989
  function parseRow(row) {
9963
9990
  return {
9964
9991
  id: row["id"],
@@ -9975,7 +10002,153 @@ function parseRow(row) {
9975
10002
  failureCount: row["failure_count"]
9976
10003
  };
9977
10004
  }
9978
- function createWebhookHook(input, db) {
10005
+ function isBlockedIpv4(parts) {
10006
+ const a = parts[0];
10007
+ const b = parts[1];
10008
+ if (a === 0)
10009
+ return true;
10010
+ if (a === 127)
10011
+ return true;
10012
+ if (a === 169 && b === 254)
10013
+ return true;
10014
+ if (a === 10)
10015
+ return true;
10016
+ if (a === 172 && b >= 16 && b <= 31)
10017
+ return true;
10018
+ if (a === 192 && b === 168)
10019
+ return true;
10020
+ return false;
10021
+ }
10022
+ function isBlockedIpv6(bytes) {
10023
+ const mapped = bytes.slice(0, 10).every((b) => b === 0) && bytes[10] === 255 && bytes[11] === 255;
10024
+ if (mapped)
10025
+ return isBlockedIpv4(bytes.slice(12, 16));
10026
+ if (bytes.every((b) => b === 0))
10027
+ return true;
10028
+ if (bytes.slice(0, 15).every((b) => b === 0) && bytes[15] === 1)
10029
+ return true;
10030
+ if ((bytes[0] & 254) === 252)
10031
+ return true;
10032
+ if (bytes[0] === 254 && (bytes[1] & 192) === 128)
10033
+ return true;
10034
+ return false;
10035
+ }
10036
+ function quadToGroups(quad) {
10037
+ const nums = quad.split(".").map((p) => Number(p));
10038
+ const [a, b, c, d] = nums;
10039
+ const valid = [a, b, c, d].every((n) => n !== undefined && Number.isInteger(n) && n >= 0 && n <= 255);
10040
+ if (!valid)
10041
+ return null;
10042
+ return [a << 8 | b, c << 8 | d];
10043
+ }
10044
+ function parseIpv6Bytes(host) {
10045
+ const groups = host.split("::");
10046
+ if (groups.length > 2)
10047
+ return null;
10048
+ const headRaw = groups[0] ?? "";
10049
+ const tailRaw = groups[1] ?? "";
10050
+ const head = headRaw === "" ? [] : headRaw.split(":");
10051
+ const tail = tailRaw === "" ? [] : tailRaw.split(":");
10052
+ const headNums = [];
10053
+ for (const g of head) {
10054
+ if (!/^[0-9a-f]{1,4}$/i.test(g))
10055
+ return null;
10056
+ headNums.push(parseInt(g, 16));
10057
+ }
10058
+ const tailNums = [];
10059
+ for (const g of tail) {
10060
+ if (/^\d+\.\d+\.\d+\.\d+$/.test(g)) {
10061
+ const quads = quadToGroups(g);
10062
+ if (!quads)
10063
+ return null;
10064
+ tailNums.push(...quads);
10065
+ } else if (/^[0-9a-f]{1,4}$/i.test(g)) {
10066
+ tailNums.push(parseInt(g, 16));
10067
+ } else {
10068
+ return null;
10069
+ }
10070
+ }
10071
+ const hasCompression = groups.length === 2;
10072
+ if (!hasCompression && headNums.length !== 8)
10073
+ return null;
10074
+ if (hasCompression && headNums.length + tailNums.length >= 8)
10075
+ return null;
10076
+ const zeros = 8 - headNums.length - tailNums.length;
10077
+ const all = [...headNums, ...new Array(zeros).fill(0), ...tailNums];
10078
+ const bytes = [];
10079
+ for (const n of all) {
10080
+ bytes.push(n >> 8 & 255, n & 255);
10081
+ }
10082
+ return bytes;
10083
+ }
10084
+ function defaultResolveHost(hostname2) {
10085
+ return dnsLookup(hostname2, { all: true, verbatim: true });
10086
+ }
10087
+ function assertResolvedAddressPublic(address, url) {
10088
+ const version = isIP(address);
10089
+ if (version === 4) {
10090
+ if (isBlockedIpv4(address.split(".").map((p) => Number(p)))) {
10091
+ throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
10092
+ }
10093
+ } else if (version === 6) {
10094
+ const bytes = parseIpv6Bytes(address);
10095
+ if (!bytes || isBlockedIpv6(bytes)) {
10096
+ throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
10097
+ }
10098
+ } else {
10099
+ throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
10100
+ }
10101
+ }
10102
+ async function validateWebhookHandlerUrl(url, opts) {
10103
+ const resolveHost = opts?.lookup ?? defaultResolveHost;
10104
+ let parsed;
10105
+ try {
10106
+ parsed = new URL(url);
10107
+ } catch {
10108
+ throw new Error(`Invalid webhook handler URL "${url}" \u2014 must be a valid http(s) URL`);
10109
+ }
10110
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
10111
+ throw new Error(`Invalid webhook handler URL "${url}" \u2014 only http and https are allowed`);
10112
+ }
10113
+ if (parsed.username || parsed.password) {
10114
+ throw new Error(`Invalid webhook handler URL "${url}" \u2014 embedded credentials are not allowed`);
10115
+ }
10116
+ const host = parsed.hostname.replace(/^\[|\]$/g, "").toLowerCase();
10117
+ if (host === "localhost" || host.endsWith(".localhost")) {
10118
+ throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
10119
+ }
10120
+ const version = isIP(host);
10121
+ if (version === 4 || version === 6) {
10122
+ if (version === 4) {
10123
+ if (isBlockedIpv4(host.split(".").map((p) => Number(p)))) {
10124
+ throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
10125
+ }
10126
+ } else {
10127
+ const bytes = parseIpv6Bytes(host);
10128
+ if (!bytes || isBlockedIpv6(bytes)) {
10129
+ throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
10130
+ }
10131
+ }
10132
+ return;
10133
+ }
10134
+ if (/^[0-9]+(\.[0-9]+)*$/.test(host) || /^0x[0-9a-f]+$/i.test(host) || host.includes("%")) {
10135
+ throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
10136
+ }
10137
+ let addrs;
10138
+ try {
10139
+ addrs = await resolveHost(host);
10140
+ } catch {
10141
+ throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
10142
+ }
10143
+ if (addrs.length === 0) {
10144
+ throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
10145
+ }
10146
+ for (const { address } of addrs) {
10147
+ assertResolvedAddressPublic(address, url);
10148
+ }
10149
+ }
10150
+ async function createWebhookHook(input, db, opts) {
10151
+ await validateWebhookHandlerUrl(input.handlerUrl, opts);
9979
10152
  if (!db && isApiMode()) {
9980
10153
  const { data } = apiJson("POST", "/webhooks", {
9981
10154
  type: input.type,
@@ -10093,6 +10266,7 @@ function recordWebhookInvocation(id, success, db) {
10093
10266
  d.run("UPDATE webhook_hooks SET invocation_count = invocation_count + 1, failure_count = failure_count + 1 WHERE id = ?", [id]);
10094
10267
  }
10095
10268
  }
10269
+ var BLOCKED_TARGET_MESSAGE = "Invalid webhook handler URL \u2014 loopback, link-local, and private network targets are not allowed";
10096
10270
  var init_webhook_hooks = __esm(() => {
10097
10271
  init_database();
10098
10272
  init_api_mode();
@@ -10711,6 +10885,7 @@ var init_contradiction = __esm(() => {
10711
10885
  var exports_built_in_hooks = {};
10712
10886
  __export(exports_built_in_hooks, {
10713
10887
  reloadWebhooks: () => reloadWebhooks,
10888
+ makeWebhookHandler: () => makeWebhookHandler,
10714
10889
  loadWebhooksFromDb: () => loadWebhooksFromDb
10715
10890
  });
10716
10891
  async function getAutoMemory() {
@@ -10720,13 +10895,19 @@ async function getAutoMemory() {
10720
10895
  }
10721
10896
  return _processConversationTurn;
10722
10897
  }
10723
- function loadWebhooksFromDb() {
10898
+ async function loadWebhooksFromDb() {
10724
10899
  if (_webhooksLoaded)
10725
10900
  return;
10726
10901
  _webhooksLoaded = true;
10727
10902
  try {
10728
10903
  const webhooks = listWebhookHooks({ enabled: true });
10729
10904
  for (const wh of webhooks) {
10905
+ try {
10906
+ await validateWebhookHandlerUrl(wh.handlerUrl);
10907
+ } catch (err) {
10908
+ console.error(`[hooks] Skipping webhook ${wh.id} (${wh.type}): ${err instanceof Error ? err.message : String(err)}`);
10909
+ continue;
10910
+ }
10730
10911
  hookRegistry.register({
10731
10912
  type: wh.type,
10732
10913
  blocking: wh.blocking,
@@ -10744,9 +10925,10 @@ function loadWebhooksFromDb() {
10744
10925
  console.error("[hooks] Failed to load webhooks from DB:", err);
10745
10926
  }
10746
10927
  }
10747
- function makeWebhookHandler(webhookId, url) {
10928
+ function makeWebhookHandler(webhookId, url, opts) {
10748
10929
  return async (context) => {
10749
10930
  try {
10931
+ await validateWebhookHandlerUrl(url, opts);
10750
10932
  const res = await fetch(url, {
10751
10933
  method: "POST",
10752
10934
  headers: { "Content-Type": "application/json" },
@@ -10759,9 +10941,9 @@ function makeWebhookHandler(webhookId, url) {
10759
10941
  }
10760
10942
  };
10761
10943
  }
10762
- function reloadWebhooks() {
10944
+ async function reloadWebhooks() {
10763
10945
  _webhooksLoaded = false;
10764
- loadWebhooksFromDb();
10946
+ await loadWebhooksFromDb();
10765
10947
  }
10766
10948
  var _processConversationTurn = null, _webhooksLoaded = false;
10767
10949
  var init_built_in_hooks = __esm(() => {
@@ -27383,7 +27565,7 @@ class JSONSchemaGenerator {
27383
27565
  if (val === undefined) {
27384
27566
  if (this.unrepresentable === "throw") {
27385
27567
  throw new Error("Literal `undefined` cannot be represented in JSON Schema");
27386
- }
27568
+ } else {}
27387
27569
  } else if (typeof val === "bigint") {
27388
27570
  if (this.unrepresentable === "throw") {
27389
27571
  throw new Error("BigInt literals cannot be represented in JSON Schema");
@@ -49033,7 +49215,7 @@ var require_tracestate_impl = __commonJS((exports) => {
49033
49215
  const value = listMember.slice(i + 1, part.length);
49034
49216
  if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_validators_1.validateValue)(value)) {
49035
49217
  agg.set(key, value);
49036
- }
49218
+ } else {}
49037
49219
  }
49038
49220
  return agg;
49039
49221
  }, new Map);
@@ -65226,6 +65408,7 @@ function registerRecallCommand(program2) {
65226
65408
  // src/cli/commands/memory-cmd-list.ts
65227
65409
  init_projects();
65228
65410
  init_memories();
65411
+ init_redact();
65229
65412
  init_helpers();
65230
65413
  import chalk12 from "chalk";
65231
65414
  import { resolve as resolve7 } from "path";
@@ -65273,36 +65456,37 @@ function registerListCommand(program2) {
65273
65456
  };
65274
65457
  }, limit, offset);
65275
65458
  const memories = hasMore && limit !== undefined ? collected.slice(0, limit) : collected;
65459
+ const sanitized = memories.map(redactMemoryForOutput);
65276
65460
  if (fmt === "json") {
65277
- outputJson(memories);
65461
+ outputJson(sanitized);
65278
65462
  return;
65279
65463
  }
65280
65464
  if (fmt === "csv") {
65281
65465
  console.log("key,value,scope,category,importance,id");
65282
- for (const m of memories) {
65466
+ for (const m of sanitized) {
65283
65467
  const v = m.value.replace(/"/g, '""');
65284
65468
  console.log(`"${m.key}","${v}",${m.scope},${m.category},${m.importance},${m.id.slice(0, 8)}`);
65285
65469
  }
65286
65470
  return;
65287
65471
  }
65288
65472
  if (fmt === "yaml") {
65289
- outputYaml(memories);
65473
+ outputYaml(sanitized);
65290
65474
  return;
65291
65475
  }
65292
- if (memories.length === 0) {
65476
+ if (sanitized.length === 0) {
65293
65477
  console.log(chalk12.yellow("No memories found."));
65294
65478
  return;
65295
65479
  }
65296
- console.log(chalk12.bold(`${memories.length}${hasMore ? "+" : ""} memor${memories.length === 1 ? "y" : "ies"}:`));
65297
- for (const m of memories) {
65480
+ console.log(chalk12.bold(`${sanitized.length}${hasMore ? "+" : ""} memor${sanitized.length === 1 ? "y" : "ies"}:`));
65481
+ for (const m of sanitized) {
65298
65482
  console.log(formatMemoryLine(m, {
65299
65483
  valueLength: opts.verbose ? 120 : 64,
65300
65484
  preferSummary: !opts.verbose
65301
65485
  }));
65302
65486
  }
65303
65487
  printPageHint({
65304
- shown: memories.length,
65305
- limit: limit ?? memories.length,
65488
+ shown: sanitized.length,
65489
+ limit: limit ?? sanitized.length,
65306
65490
  offset,
65307
65491
  hasMore,
65308
65492
  command: "mementos list",
@@ -68572,7 +68756,7 @@ By type:`));
68572
68756
  webhooksCmd.command("create <type> <url>").description("Create a persistent webhook hook").option("--blocking", "Block the operation until the webhook responds").option("--priority <n>", "Hook priority (default 50)", "50").option("--agent <id>", "Scope to specific agent").option("--project <id>", "Scope to specific project").option("--description <text>", "Human-readable description").action(async (type, url, opts) => {
68573
68757
  const { createWebhookHook: createWebhookHook2 } = await Promise.resolve().then(() => (init_webhook_hooks(), exports_webhook_hooks));
68574
68758
  const { reloadWebhooks: reloadWebhooks2 } = await Promise.resolve().then(() => (init_built_in_hooks(), exports_built_in_hooks));
68575
- const wh = createWebhookHook2({
68759
+ const wh = await createWebhookHook2({
68576
68760
  type,
68577
68761
  handlerUrl: url,
68578
68762
  blocking: opts.blocking ?? false,
@@ -68581,7 +68765,7 @@ By type:`));
68581
68765
  projectId: opts.project,
68582
68766
  description: opts.description
68583
68767
  });
68584
- reloadWebhooks2();
68768
+ await reloadWebhooks2();
68585
68769
  console.log(chalk31.green("\u2713 Webhook created"));
68586
68770
  console.log(` ID: ${chalk31.cyan(wh.id)}`);
68587
68771
  console.log(` Type: ${wh.type}`);
@@ -68602,7 +68786,7 @@ By type:`));
68602
68786
  const { reloadWebhooks: reloadWebhooks2 } = await Promise.resolve().then(() => (init_built_in_hooks(), exports_built_in_hooks));
68603
68787
  const updated = updateWebhookHook2(id, { enabled: true });
68604
68788
  if (updated) {
68605
- reloadWebhooks2();
68789
+ await reloadWebhooks2();
68606
68790
  console.log(chalk31.green(`\u2713 Webhook ${id} enabled`));
68607
68791
  } else {
68608
68792
  console.error(chalk31.red(`Webhook not found: ${id}`));
@@ -68614,7 +68798,7 @@ By type:`));
68614
68798
  const { reloadWebhooks: reloadWebhooks2 } = await Promise.resolve().then(() => (init_built_in_hooks(), exports_built_in_hooks));
68615
68799
  const updated = updateWebhookHook2(id, { enabled: false });
68616
68800
  if (updated) {
68617
- reloadWebhooks2();
68801
+ await reloadWebhooks2();
68618
68802
  console.log(chalk31.yellow(`\u2298 Webhook ${id} disabled`));
68619
68803
  } else {
68620
68804
  console.error(chalk31.red(`Webhook not found: ${id}`));
@@ -0,0 +1,17 @@
1
+ import type { Command } from "commander";
2
+ /**
3
+ * Attach EVERY command group to `program`, in the order the CLI presents them.
4
+ *
5
+ * This is the single registration list. `index.tsx` calls it to build the real
6
+ * CLI, and `global-options.test.ts` calls it to walk the real option tables — so
7
+ * the structural short-flag guard cannot silently check a smaller tree than the
8
+ * one that ships.
9
+ *
10
+ * That drift was real: the guard originally re-listed 11 groups by hand while
11
+ * the CLI wired 15 sources, leaving `init`, `project-panel`, `brains` and the
12
+ * `@hasna/events` groups (`events`, `webhooks`) unwalked. Seven live `-j`
13
+ * collisions sat in that blind spot while the guard reported clean. Adding a
14
+ * command group here is now the only step required for it to be covered.
15
+ */
16
+ export declare function registerAllCommands(program: Command): Command;
17
+ //# sourceMappingURL=register-all.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-all.d.ts","sourceRoot":"","sources":["../../src/cli/register-all.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBzC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAiB7D"}
@@ -0,0 +1,9 @@
1
+ import type { Command } from "commander";
2
+ /**
3
+ * Mark a command as having no startup database access, and return it so it can
4
+ * be used inline at the end of a builder chain.
5
+ */
6
+ export declare function withoutStartupDbAccess<T extends Command>(command: T): T;
7
+ /** Whether the command about to run has opted out of the startup DB access. */
8
+ export declare function skipsStartupDbAccess(command: Command | undefined): boolean;
9
+ //# sourceMappingURL=startup-side-effects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startup-side-effects.d.ts","sourceRoot":"","sources":["../../src/cli/startup-side-effects.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAGvE;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAE1E"}
@@ -0,0 +1,2 @@
1
+ declare const server: Bun.Server<undefined>;
2
+ //# sourceMappingURL=fail-closed-stub-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fail-closed-stub-server.d.ts","sourceRoot":"","sources":["../../../src/db/__fixtures__/fail-closed-stub-server.ts"],"names":[],"mappings":"AAqBA,QAAA,MAAM,MAAM,uBAyCV,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=list-filter-capture-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-filter-capture-server.d.ts","sourceRoot":"","sources":["../../../src/db/__fixtures__/list-filter-capture-server.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=list-filter-client-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-filter-client-runner.d.ts","sourceRoot":"","sources":["../../../src/db/__fixtures__/list-filter-client-runner.ts"],"names":[],"mappings":""}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Memory Access Control Lists (ACLs).
3
+ *
4
+ * Fine-grained permissions beyond scopes: read-only, read-write, admin
5
+ * per agent per key pattern. Default: no ACLs = full access (backward compat).
6
+ */
7
+ import { SqliteAdapter as Database } from "../storage.js";
8
+ export type AclPermission = "read" | "readwrite" | "admin";
9
+ export interface MemoryAcl {
10
+ id: string;
11
+ agent_id: string;
12
+ key_pattern: string;
13
+ permission: AclPermission;
14
+ project_id: string | null;
15
+ created_at: string;
16
+ }
17
+ /**
18
+ * Set an ACL rule. Upserts by agent_id + key_pattern.
19
+ */
20
+ export declare function setAcl(agentId: string, keyPattern: string, permission: AclPermission, projectId?: string, db?: Database): MemoryAcl;
21
+ /**
22
+ * List ACLs for an agent.
23
+ */
24
+ export declare function listAcls(agentId: string, db?: Database): MemoryAcl[];
25
+ /**
26
+ * Remove an ACL rule.
27
+ */
28
+ export declare function removeAcl(id: string, db?: Database): boolean;
29
+ /**
30
+ * Check if an agent has the required permission for a memory key.
31
+ * Returns true if allowed (no ACLs = full access).
32
+ */
33
+ export declare function checkPermission(agentId: string, memoryKey: string, requiredPermission: "read" | "write", db?: Database): boolean;
34
+ //# sourceMappingURL=acl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acl.d.ts","sourceRoot":"","sources":["../../src/db/acl.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG1D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,aAAa,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,MAAM,CACpB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,aAAa,EACzB,SAAS,CAAC,EAAE,MAAM,EAClB,EAAE,CAAC,EAAE,QAAQ,GACZ,SAAS,CAeX;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,SAAS,EAAE,CAGpE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAI5D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,MAAM,GAAG,OAAO,EACpC,EAAE,CAAC,EAAE,QAAQ,GACZ,OAAO,CAqBT"}