@snoai/memory 0.0.0-stage → 1.0.1

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 (478) hide show
  1. package/LICENSE +176 -0
  2. package/README.md +33 -2
  3. package/config/b-profile-section-registry.json +118 -0
  4. package/config/llm/compiled/2026-05-19T230932Z/manifest.json +25 -0
  5. package/config/llm/compiled/2026-05-19T230932Z/registry-root.json +67 -0
  6. package/config/llm/compiled/2026-05-19T230932Z/resolved/mem_claw/openai_gpt_5_nano.json +5 -0
  7. package/config/llm/compiled/2026-05-19T230932Z/resolved/mem_claw/openrouter_auto.json +5 -0
  8. package/config/llm/compiled/2026-05-19T230932Z/resolved/mem_claw/sno_ai_extract.json +5 -0
  9. package/config/llm/compiled/2026-05-19T230932Z/source/mem_claw/openai_gpt_5_nano.mda +24 -0
  10. package/config/llm/compiled/2026-05-19T230932Z/source/mem_claw/openrouter_auto.mda +24 -0
  11. package/config/llm/compiled/2026-05-19T230932Z/source/mem_claw/sno_ai_extract.mda +24 -0
  12. package/config/llm/compiled/2026-07-21T001311Z/manifest.json +43 -0
  13. package/config/llm/compiled/2026-07-21T001311Z/registry-root.json +97 -0
  14. package/config/llm/compiled/2026-07-21T001311Z/resolved/mem_claw/openai_gpt_5_nano.json +5 -0
  15. package/config/llm/compiled/2026-07-21T001311Z/resolved/mem_claw/openrouter_auto.json +5 -0
  16. package/config/llm/compiled/2026-07-21T001311Z/resolved/mem_claw/sno_ai_extract.json +5 -0
  17. package/config/llm/compiled/2026-07-21T001311Z/resolved/mem_claw/sno_conflict_verdict.json +10 -0
  18. package/config/llm/compiled/2026-07-21T001311Z/resolved/mem_claw/sno_extract_chat.json +10 -0
  19. package/config/llm/compiled/2026-07-21T001311Z/resolved/mem_claw/sno_extract_profile.json +10 -0
  20. package/config/llm/compiled/2026-07-21T001311Z/source/mem_claw/openai_gpt_5_nano.mda +24 -0
  21. package/config/llm/compiled/2026-07-21T001311Z/source/mem_claw/openrouter_auto.mda +24 -0
  22. package/config/llm/compiled/2026-07-21T001311Z/source/mem_claw/sno_ai_extract.mda +24 -0
  23. package/config/llm/compiled/2026-07-21T001311Z/source/mem_claw/sno_conflict_verdict.mda +27 -0
  24. package/config/llm/compiled/2026-07-21T001311Z/source/mem_claw/sno_extract_chat.mda +27 -0
  25. package/config/llm/compiled/2026-07-21T001311Z/source/mem_claw/sno_extract_profile.mda +27 -0
  26. package/config/llm/compiled/2026-08-29T060335Z/manifest.json +43 -0
  27. package/config/llm/compiled/2026-08-29T060335Z/registry-root.json +97 -0
  28. package/config/llm/compiled/2026-08-29T060335Z/resolved/mem_claw/openai_gpt_5_nano.json +5 -0
  29. package/config/llm/compiled/2026-08-29T060335Z/resolved/mem_claw/openrouter_auto.json +5 -0
  30. package/config/llm/compiled/2026-08-29T060335Z/resolved/mem_claw/sno_ai_extract.json +5 -0
  31. package/config/llm/compiled/2026-08-29T060335Z/resolved/mem_claw/sno_conflict_verdict.json +10 -0
  32. package/config/llm/compiled/2026-08-29T060335Z/resolved/mem_claw/sno_extract_chat.json +10 -0
  33. package/config/llm/compiled/2026-08-29T060335Z/resolved/mem_claw/sno_extract_profile.json +10 -0
  34. package/config/llm/compiled/2026-08-29T060335Z/source/mem_claw/openai_gpt_5_nano.mda +24 -0
  35. package/config/llm/compiled/2026-08-29T060335Z/source/mem_claw/openrouter_auto.mda +24 -0
  36. package/config/llm/compiled/2026-08-29T060335Z/source/mem_claw/sno_ai_extract.mda +24 -0
  37. package/config/llm/compiled/2026-08-29T060335Z/source/mem_claw/sno_conflict_verdict.mda +27 -0
  38. package/config/llm/compiled/2026-08-29T060335Z/source/mem_claw/sno_extract_chat.mda +27 -0
  39. package/config/llm/compiled/2026-08-29T060335Z/source/mem_claw/sno_extract_profile.mda +27 -0
  40. package/config/llm/compiled/2026-09-04T004828Z/manifest.json +43 -0
  41. package/config/llm/compiled/2026-09-04T004828Z/registry-root.json +97 -0
  42. package/config/llm/compiled/2026-09-04T004828Z/resolved/mem_claw/openai_gpt_5_nano.json +5 -0
  43. package/config/llm/compiled/2026-09-04T004828Z/resolved/mem_claw/openrouter_auto.json +5 -0
  44. package/config/llm/compiled/2026-09-04T004828Z/resolved/mem_claw/sno_ai_extract.json +5 -0
  45. package/config/llm/compiled/2026-09-04T004828Z/resolved/mem_claw/sno_conflict_verdict.json +10 -0
  46. package/config/llm/compiled/2026-09-04T004828Z/resolved/mem_claw/sno_extract_chat.json +10 -0
  47. package/config/llm/compiled/2026-09-04T004828Z/resolved/mem_claw/sno_extract_profile.json +10 -0
  48. package/config/llm/compiled/2026-09-04T004828Z/source/mem_claw/openai_gpt_5_nano.mda +24 -0
  49. package/config/llm/compiled/2026-09-04T004828Z/source/mem_claw/openrouter_auto.mda +24 -0
  50. package/config/llm/compiled/2026-09-04T004828Z/source/mem_claw/sno_ai_extract.mda +24 -0
  51. package/config/llm/compiled/2026-09-04T004828Z/source/mem_claw/sno_conflict_verdict.mda +27 -0
  52. package/config/llm/compiled/2026-09-04T004828Z/source/mem_claw/sno_extract_chat.mda +27 -0
  53. package/config/llm/compiled/2026-09-04T004828Z/source/mem_claw/sno_extract_profile.mda +27 -0
  54. package/config/llm/current.json +4 -0
  55. package/config/llm/source/mem_claw/openai_gpt_5_nano.mda +24 -0
  56. package/config/llm/source/mem_claw/openrouter_auto.mda +24 -0
  57. package/config/llm/source/mem_claw/sno_ai_extract.mda +24 -0
  58. package/config/llm/source/mem_claw/sno_conflict_verdict.mda +27 -0
  59. package/config/llm/source/mem_claw/sno_extract_chat.mda +27 -0
  60. package/config/llm/source/mem_claw/sno_extract_profile.mda +27 -0
  61. package/config/llm.trust.json +37 -0
  62. package/dist/_types-CUKHSRkS.d.ts +103 -0
  63. package/dist/access-tracker-BbEvEocb.d.ts +110 -0
  64. package/dist/adapter-B7Jox9-6.d.ts +69 -0
  65. package/dist/adapter-XaRHZWZ2.js +333 -0
  66. package/dist/agent-llm-port-5oXgBpzJ.d.ts +53 -0
  67. package/dist/all-resources-BQK2ugjB.js +6379 -0
  68. package/dist/all-resources-Dij6l5h0.d.ts +18 -0
  69. package/dist/ambient-learning-text-normalizer-CxjATmMp.js +170 -0
  70. package/dist/ambient-learning-text-normalizer-_fH3LeuK.d.ts +10 -0
  71. package/dist/atomic-extraction-reply-BJ9XV_9s.js +863 -0
  72. package/dist/atomic-extraction-skill-CcXmuCqL.js +56 -0
  73. package/dist/atomic-memory-extraction-C5rmogoY.js +3605 -0
  74. package/dist/atomic-memory-extraction-d9EG-4ti.d.ts +327 -0
  75. package/dist/b-profile-section-dictionary-provider-BHkoNqgk.js +1812 -0
  76. package/dist/b-profile-section-dictionary-provider-BxbksLj3.d.ts +62 -0
  77. package/dist/best-effort-BPZSzKk0.d.ts +9 -0
  78. package/dist/calendar-instruction-CzqZbAPG.js +194 -0
  79. package/dist/capture-policy-detector-CxbHPkMX.d.ts +53 -0
  80. package/dist/capture-policy-detector-DaMfy9CZ.js +357 -0
  81. package/dist/classifier-DnbbtwTS.d.ts +272 -0
  82. package/dist/client.d.ts +34 -0
  83. package/dist/client.js +306 -0
  84. package/dist/coding-skin.d.ts +51 -0
  85. package/dist/coding-skin.js +55 -0
  86. package/dist/config-CL90qYva.js +2576 -0
  87. package/dist/connection-3IVXpuPE.d.ts +391 -0
  88. package/dist/connection-C9YD5sgm.js +297 -0
  89. package/dist/daily-log-generator-CH_KuWHs.js +469 -0
  90. package/dist/daily-log-generator-CsQPHl4A.d.ts +73 -0
  91. package/dist/daily-spend-estimator-DiwzBlo1.d.ts +8 -0
  92. package/dist/data-bootstrap-Bl3lthzE.d.ts +30 -0
  93. package/dist/data-bootstrap-P8sie9WA.js +172 -0
  94. package/dist/data-paths-C7sNdqvP.d.ts +22 -0
  95. package/dist/derived-suppression-cache-CI0durYx.d.ts +36 -0
  96. package/dist/diagnostic-encoder.d.ts +6 -0
  97. package/dist/diagnostic-encoder.js +29 -0
  98. package/dist/embedding-provider-client-Q_hJonK9.js +294 -0
  99. package/dist/embedding-provider-client-vynZMuit.d.ts +94 -0
  100. package/dist/entry-metadata-parser-BIVSMCIk.js +20 -0
  101. package/dist/error-D-wb-rZw.js +23 -0
  102. package/dist/error-signals-D8_3vYu4.d.ts +28 -0
  103. package/dist/error-signals-lMH2uAdV.js +134 -0
  104. package/dist/errors-CeVRxf9V.d.ts +49 -0
  105. package/dist/extraction-text-sanitizer-B_AhIecT.d.ts +32 -0
  106. package/dist/i18n-text-DbD6Qify.d.ts +13 -0
  107. package/dist/index-0aqS8pVF.d.ts +351 -0
  108. package/dist/index-BO4RU_mc.d.ts +650 -0
  109. package/dist/index-DL8AVj0Z.d.ts +571 -0
  110. package/dist/index.d.ts +65 -0
  111. package/dist/index.js +1201 -0
  112. package/dist/intent-analyzer-B5XVrWwe.d.ts +28 -0
  113. package/dist/internal/config/index.d.ts +2 -0
  114. package/dist/internal/config/index.js +581 -0
  115. package/dist/internal/config/plugin-config-schema.d.ts +2 -0
  116. package/dist/internal/config/plugin-config-schema.js +2 -0
  117. package/dist/internal/config/product-mode.d.ts +2 -0
  118. package/dist/internal/config/product-mode.js +36 -0
  119. package/dist/internal/config/settings.d.ts +2 -0
  120. package/dist/internal/config/settings.js +265 -0
  121. package/dist/internal/config/skill-categories.d.ts +4 -0
  122. package/dist/internal/config/skill-categories.js +68 -0
  123. package/dist/internal/config/skin-defaults.d.ts +6 -0
  124. package/dist/internal/config/skin-defaults.js +6 -0
  125. package/dist/internal/contract/discovery.d.ts +10 -0
  126. package/dist/internal/contract/discovery.js +53 -0
  127. package/dist/internal/contract/profile.d.ts +2 -0
  128. package/dist/internal/contract/profile.js +44 -0
  129. package/dist/internal/contract/routes.d.ts +2 -0
  130. package/dist/internal/contract/routes.js +62 -0
  131. package/dist/internal/engine/bindings/memory-cli-shared.d.ts +47 -0
  132. package/dist/internal/engine/bindings/memory-cli-shared.js +84 -0
  133. package/dist/internal/engine/bindings/memory-forget-tool.d.ts +5 -0
  134. package/dist/internal/engine/bindings/memory-forget-tool.js +66 -0
  135. package/dist/internal/engine/bindings/memory-list-tool.d.ts +5 -0
  136. package/dist/internal/engine/bindings/memory-list-tool.js +57 -0
  137. package/dist/internal/engine/bindings/memory-recall-tool.d.ts +10 -0
  138. package/dist/internal/engine/bindings/memory-recall-tool.js +283 -0
  139. package/dist/internal/engine/bindings/memory-reflection-resolve-tool.d.ts +5 -0
  140. package/dist/internal/engine/bindings/memory-reflection-resolve-tool.js +150 -0
  141. package/dist/internal/engine/bindings/memory-stats-tool.d.ts +5 -0
  142. package/dist/internal/engine/bindings/memory-stats-tool.js +43 -0
  143. package/dist/internal/engine/bindings/memory-store-tool.d.ts +5 -0
  144. package/dist/internal/engine/bindings/memory-store-tool.js +165 -0
  145. package/dist/internal/engine/bindings/memory-tool-access.d.ts +16 -0
  146. package/dist/internal/engine/bindings/memory-tool-access.js +46 -0
  147. package/dist/internal/engine/bindings/memory-tool-formatting.d.ts +62 -0
  148. package/dist/internal/engine/bindings/memory-tool-formatting.js +106 -0
  149. package/dist/internal/engine/bindings/memory-tool-results.d.ts +8 -0
  150. package/dist/internal/engine/bindings/memory-tool-results.js +41 -0
  151. package/dist/internal/engine/bindings/memory-tool-schemas.d.ts +109 -0
  152. package/dist/internal/engine/bindings/memory-tool-schemas.js +75 -0
  153. package/dist/internal/engine/bindings/memory-update-tool.d.ts +5 -0
  154. package/dist/internal/engine/bindings/memory-update-tool.js +127 -0
  155. package/dist/internal/engine/bindings/sno-station-mem-ambient-learning-hook.d.ts +14 -0
  156. package/dist/internal/engine/bindings/sno-station-mem-ambient-learning-hook.js +248 -0
  157. package/dist/internal/engine/bindings/sno-station-mem-auto-recall-hook.d.ts +12 -0
  158. package/dist/internal/engine/bindings/sno-station-mem-auto-recall-hook.js +324 -0
  159. package/dist/internal/engine/bindings/sno-station-mem-hook-types.d.ts +56 -0
  160. package/dist/internal/engine/bindings/sno-station-mem-hook-types.js +1 -0
  161. package/dist/internal/engine/bindings/sno-station-mem-insight-distill-factory.d.ts +14 -0
  162. package/dist/internal/engine/bindings/sno-station-mem-insight-distill-factory.js +119 -0
  163. package/dist/internal/engine/bindings/sno-station-mem-message-transcript.d.ts +52 -0
  164. package/dist/internal/engine/bindings/sno-station-mem-message-transcript.js +145 -0
  165. package/dist/internal/engine/bindings/sno-station-mem-reset-hook.d.ts +10 -0
  166. package/dist/internal/engine/bindings/sno-station-mem-reset-hook.js +9 -0
  167. package/dist/internal/engine/bindings/sno-station-mem-runtime-mode.d.ts +36 -0
  168. package/dist/internal/engine/bindings/sno-station-mem-runtime-mode.js +104 -0
  169. package/dist/internal/engine/bindings/sno-station-mem-session-state.d.ts +10 -0
  170. package/dist/internal/engine/bindings/sno-station-mem-session-state.js +27 -0
  171. package/dist/internal/engine/eval/trace.d.ts +2 -0
  172. package/dist/internal/engine/eval/trace.js +151 -0
  173. package/dist/internal/engine/extraction/ambient-learning-text-normalizer.d.ts +2 -0
  174. package/dist/internal/engine/extraction/ambient-learning-text-normalizer.js +2 -0
  175. package/dist/internal/engine/extraction/atomic-memory-extraction.d.ts +2 -0
  176. package/dist/internal/engine/extraction/atomic-memory-extraction.js +2 -0
  177. package/dist/internal/engine/extraction/b-profile-section-dictionary-provider.d.ts +2 -0
  178. package/dist/internal/engine/extraction/b-profile-section-dictionary-provider.js +2 -0
  179. package/dist/internal/engine/extraction/b-profile-section-rekey.d.ts +49 -0
  180. package/dist/internal/engine/extraction/b-profile-section-rekey.js +730 -0
  181. package/dist/internal/engine/extraction/capture-policy-detector.d.ts +2 -0
  182. package/dist/internal/engine/extraction/capture-policy-detector.js +2 -0
  183. package/dist/internal/engine/extraction/embedding-provider-client.d.ts +2 -0
  184. package/dist/internal/engine/extraction/embedding-provider-client.js +2 -0
  185. package/dist/internal/engine/extraction/extraction-text-sanitizer.d.ts +2 -0
  186. package/dist/internal/engine/extraction/extraction-text-sanitizer.js +114 -0
  187. package/dist/internal/engine/extraction/memory-metadata-codec.d.ts +3 -0
  188. package/dist/internal/engine/extraction/memory-metadata-codec.js +2 -0
  189. package/dist/internal/engine/extraction/memory-temporality-classifier.d.ts +2 -0
  190. package/dist/internal/engine/extraction/memory-temporality-classifier.js +2 -0
  191. package/dist/internal/engine/i18n/all-resources.d.ts +2 -0
  192. package/dist/internal/engine/i18n/all-resources.js +2 -0
  193. package/dist/internal/engine/i18n/locales.d.ts +2 -0
  194. package/dist/internal/engine/i18n/locales.js +19 -0
  195. package/dist/internal/engine/i18n/res/_types.d.ts +2 -0
  196. package/dist/internal/engine/i18n/res/_types.js +11 -0
  197. package/dist/internal/engine/observability/adapter.d.ts +2 -0
  198. package/dist/internal/engine/observability/adapter.js +2 -0
  199. package/dist/internal/engine/observability/best-effort.d.ts +2 -0
  200. package/dist/internal/engine/observability/best-effort.js +41 -0
  201. package/dist/internal/engine/observability/early-diagnostics.js +2 -0
  202. package/dist/internal/engine/observability/memory-snapshot.d.ts +2 -0
  203. package/dist/internal/engine/observability/memory-snapshot.js +44 -0
  204. package/dist/internal/engine/observability/observable-embedder.d.ts +2 -0
  205. package/dist/internal/engine/observability/observable-embedder.js +43 -0
  206. package/dist/internal/engine/observability/observable-llm-client.d.ts +2 -0
  207. package/dist/internal/engine/observability/observable-llm-client.js +98 -0
  208. package/dist/internal/engine/observability/observable-memory-store.d.ts +2 -0
  209. package/dist/internal/engine/observability/observable-memory-store.js +701 -0
  210. package/dist/internal/engine/observability/observable-retriever.d.ts +2 -0
  211. package/dist/internal/engine/observability/observable-retriever.js +95 -0
  212. package/dist/internal/engine/observability/runtime-diagnostics.d.ts +13 -0
  213. package/dist/internal/engine/observability/runtime-diagnostics.js +96 -0
  214. package/dist/internal/engine/observability/session-registry.d.ts +2 -0
  215. package/dist/internal/engine/observability/session-registry.js +58 -0
  216. package/dist/internal/engine/observability/version-metadata.d.ts +7 -0
  217. package/dist/internal/engine/observability/version-metadata.js +59 -0
  218. package/dist/internal/engine/operations/daily-spend-estimator.d.ts +2 -0
  219. package/dist/internal/engine/operations/daily-spend-estimator.js +97 -0
  220. package/dist/internal/engine/operations/learning-file-maintenance.d.ts +2 -0
  221. package/dist/internal/engine/operations/learning-file-maintenance.js +255 -0
  222. package/dist/internal/engine/operations/memory-tier-promoter.d.ts +2 -0
  223. package/dist/internal/engine/operations/memory-tier-promoter.js +95 -0
  224. package/dist/internal/engine/operations/runtime-audit-log.d.ts +3 -0
  225. package/dist/internal/engine/operations/runtime-audit-log.js +3 -0
  226. package/dist/internal/engine/provider/canonical-memory-corpus.d.ts +38 -0
  227. package/dist/internal/engine/provider/canonical-memory-corpus.js +253 -0
  228. package/dist/internal/engine/provider/provider-registration.d.ts +39 -0
  229. package/dist/internal/engine/provider/provider-registration.js +2 -0
  230. package/dist/internal/engine/provider/provider-row-renderer.d.ts +7 -0
  231. package/dist/internal/engine/provider/provider-row-renderer.js +53 -0
  232. package/dist/internal/engine/provider/provider-types.d.ts +2 -0
  233. package/dist/internal/engine/provider/provider-types.js +1 -0
  234. package/dist/internal/engine/reflection/daily-log-generator.d.ts +2 -0
  235. package/dist/internal/engine/reflection/daily-log-generator.js +2 -0
  236. package/dist/internal/engine/reflection/reflection-command-hooks.d.ts +2 -0
  237. package/dist/internal/engine/reflection/reflection-command-hooks.js +2 -0
  238. package/dist/internal/engine/reflection/reflection-deps.d.ts +2 -0
  239. package/dist/internal/engine/reflection/reflection-deps.js +1 -0
  240. package/dist/internal/engine/reflection/reflection-embedded-generator.d.ts +2 -0
  241. package/dist/internal/engine/reflection/reflection-embedded-generator.js +2 -0
  242. package/dist/internal/engine/reflection/reflection-injection-hooks.d.ts +2 -0
  243. package/dist/internal/engine/reflection/reflection-injection-hooks.js +219 -0
  244. package/dist/internal/engine/reflection/reflection-lifecycle-hooks.d.ts +2 -0
  245. package/dist/internal/engine/reflection/reflection-lifecycle-hooks.js +63 -0
  246. package/dist/internal/engine/reflection/strategy-hook-runner.d.ts +4 -0
  247. package/dist/internal/engine/reflection/strategy-hook-runner.js +3 -0
  248. package/dist/internal/engine/rem/classifier.d.ts +2 -0
  249. package/dist/internal/engine/rem/classifier.js +180 -0
  250. package/dist/internal/engine/rem/index.d.ts +4 -0
  251. package/dist/internal/engine/rem/index.js +2551 -0
  252. package/dist/internal/engine/rem/types.d.ts +2 -0
  253. package/dist/internal/engine/rem/types.js +40 -0
  254. package/dist/internal/engine/retrieval/access-tracker.d.ts +2 -0
  255. package/dist/internal/engine/retrieval/access-tracker.js +314 -0
  256. package/dist/internal/engine/retrieval/intent-analyzer.d.ts +2 -0
  257. package/dist/internal/engine/retrieval/intent-analyzer.js +27 -0
  258. package/dist/internal/engine/retrieval/retrieval-gate.d.ts +2 -0
  259. package/dist/internal/engine/retrieval/retrieval-gate.js +47 -0
  260. package/dist/internal/engine/retrieval/retriever.d.ts +2 -0
  261. package/dist/internal/engine/retrieval/retriever.js +2 -0
  262. package/dist/internal/engine/security/memory-scope-policy.d.ts +2 -0
  263. package/dist/internal/engine/security/memory-scope-policy.js +2 -0
  264. package/dist/internal/engine/security/redact.d.ts +2 -0
  265. package/dist/internal/engine/security/redact.js +34 -0
  266. package/dist/internal/engine/security/scopes.d.ts +3 -0
  267. package/dist/internal/engine/security/scopes.js +3 -0
  268. package/dist/internal/engine/shared/errors.d.ts +2 -0
  269. package/dist/internal/engine/shared/errors.js +66 -0
  270. package/dist/internal/engine/shared/i18n-text.d.ts +2 -0
  271. package/dist/internal/engine/shared/i18n-text.js +58 -0
  272. package/dist/internal/engine/shared/iso-date-time.d.ts +16 -0
  273. package/dist/internal/engine/shared/iso-date-time.js +40 -0
  274. package/dist/internal/engine/shared/lru.d.ts +2 -0
  275. package/dist/internal/engine/shared/lru.js +30 -0
  276. package/dist/internal/engine/shared/memory-kind-policy.d.ts +2 -0
  277. package/dist/internal/engine/shared/memory-kind-policy.js +64 -0
  278. package/dist/internal/engine/shared/paths.d.ts +3 -0
  279. package/dist/internal/engine/shared/paths.js +2 -0
  280. package/dist/internal/engine/shared/types.d.ts +3 -0
  281. package/dist/internal/engine/shared/types.js +25 -0
  282. package/dist/internal/engine/shared/utils.d.ts +2 -0
  283. package/dist/internal/engine/shared/utils.js +175 -0
  284. package/dist/internal/engine/telemetry/memory-telemetry-api.d.ts +134 -0
  285. package/dist/internal/engine/telemetry/memory-telemetry-api.js +730 -0
  286. package/dist/internal/engine/telemetry/memory-telemetry-observability.d.ts +24 -0
  287. package/dist/internal/engine/telemetry/memory-telemetry-observability.js +133 -0
  288. package/dist/internal/engine/telemetry/memory-telemetry-outbox.d.ts +2 -0
  289. package/dist/internal/engine/telemetry/memory-telemetry-outbox.js +443 -0
  290. package/dist/internal/engine/telemetry/memory-telemetry-types.d.ts +2 -0
  291. package/dist/internal/engine/telemetry/memory-telemetry-types.js +21 -0
  292. package/dist/internal/engine/telemetry/observe-ledger.d.ts +30 -0
  293. package/dist/internal/engine/telemetry/observe-ledger.js +111 -0
  294. package/dist/internal/model/agent-llm-port.d.ts +2 -0
  295. package/dist/internal/model/agent-llm-port.js +1 -0
  296. package/dist/internal/model/llm-client.d.ts +3 -0
  297. package/dist/internal/model/llm-client.js +3 -0
  298. package/dist/internal/model/llm-failure.d.ts +26 -0
  299. package/dist/internal/model/llm-failure.js +63 -0
  300. package/dist/internal/model/llm-mode-routing.d.ts +22 -0
  301. package/dist/internal/model/llm-mode-routing.js +37 -0
  302. package/dist/internal/store/atomic-memory-cutover-sql.d.ts +13 -0
  303. package/dist/internal/store/atomic-memory-cutover-sql.js +237 -0
  304. package/dist/internal/store/connection.d.ts +2 -0
  305. package/dist/internal/store/connection.js +2 -0
  306. package/dist/internal/store/data-bootstrap.d.ts +2 -0
  307. package/dist/internal/store/data-bootstrap.js +2 -0
  308. package/dist/internal/store/data-paths.d.ts +2 -0
  309. package/dist/internal/store/data-paths.js +65 -0
  310. package/dist/internal/store/maintenance.d.ts +75 -0
  311. package/dist/internal/store/maintenance.js +1401 -0
  312. package/dist/internal/store/memory-kinds-cutover-migrator.d.ts +28 -0
  313. package/dist/internal/store/memory-kinds-cutover-migrator.js +415 -0
  314. package/dist/internal/store/migrations.d.ts +27 -0
  315. package/dist/internal/store/migrations.js +201 -0
  316. package/dist/internal/store/sqlite-runtime.d.ts +2 -0
  317. package/dist/internal/store/sqlite-runtime.js +109 -0
  318. package/dist/internal/store/store.d.ts +3 -0
  319. package/dist/internal/store/store.js +2 -0
  320. package/dist/learning-file-maintenance-9b-Ut6Kv.d.ts +30 -0
  321. package/dist/llm-client-BSYUAcUb.js +1374 -0
  322. package/dist/llm-client-DOTSGzhe.d.ts +51 -0
  323. package/dist/locales-JxGmkG6t.d.ts +7 -0
  324. package/dist/log-site-catalog.generated-BMKWj-Nx.js +2321 -0
  325. package/dist/log-site-catalog.json +1 -0
  326. package/dist/lru-DyoaTyIs.d.ts +14 -0
  327. package/dist/memdump.d.ts +52 -0
  328. package/dist/memdump.js +163 -0
  329. package/dist/memory-entry-projector-DHo8jH10.js +1015 -0
  330. package/dist/memory-kind-policy-BiuRjSJc.d.ts +23 -0
  331. package/dist/memory-metadata-codec-DL1sbJiN.js +577 -0
  332. package/dist/memory-metadata-codec-DUvsYe_X.d.ts +68 -0
  333. package/dist/memory-runtime-DqUS4cWi.js +19459 -0
  334. package/dist/memory-scope-policy-1gg5QlWZ.d.ts +67 -0
  335. package/dist/memory-scope-policy-DICSCURA.js +283 -0
  336. package/dist/memory-snapshot-CqY1BUUA.d.ts +16 -0
  337. package/dist/memory-source-order-YMRoeDLd.js +134 -0
  338. package/dist/memory-store-base-CQ_bHlYA.d.ts +1094 -0
  339. package/dist/memory-store-shared-DqpWJXZZ.js +158 -0
  340. package/dist/memory-store-write-validation-B_hDG2zf.js +243 -0
  341. package/dist/memory-telemetry-incidents-BWA9kcZx.js +8 -0
  342. package/dist/memory-telemetry-metadata-CA7W8tK6.js +77 -0
  343. package/dist/memory-telemetry-outbox-ddTdImt7.d.ts +74 -0
  344. package/dist/memory-telemetry-receipts-MAJecvXQ.d.ts +34 -0
  345. package/dist/memory-telemetry-receipts-YsxbwOAf.js +91 -0
  346. package/dist/memory-telemetry-types-CufVmrCs.d.ts +14 -0
  347. package/dist/memory-temporality-classifier-BUjXG5o7.js +184 -0
  348. package/dist/memory-temporality-classifier-Brht5jyK.d.ts +43 -0
  349. package/dist/memory-tier-promoter-CqGxCkue.d.ts +43 -0
  350. package/dist/memory-tool-dependencies-CatGzI9R.d.ts +14 -0
  351. package/dist/memory-tool-dependencies-DjUoelnm.js +19 -0
  352. package/dist/model-call-table-CspopkBg.js +563 -0
  353. package/dist/model-reply-text-CKopStP2.js +334 -0
  354. package/dist/observable-embedder-CNNe9gkg.d.ts +17 -0
  355. package/dist/observable-llm-client-CRuKlefQ.d.ts +21 -0
  356. package/dist/observable-memory-store-CnGDpOY5.d.ts +73 -0
  357. package/dist/observable-retriever-Cooc62Qw.d.ts +23 -0
  358. package/dist/operation-cancellation-CTKWwNHk.js +81 -0
  359. package/dist/paths-qVF-5uBq.d.ts +1 -0
  360. package/dist/plugin-config-schema-C0UUbOmG.d.ts +413 -0
  361. package/dist/plugin-config-schema-YJLyIIcJ.js +361 -0
  362. package/dist/profile-TWPJ_myr.d.ts +13 -0
  363. package/dist/profile-section-writer-BhGKPBjw.js +2149 -0
  364. package/dist/provider-registration-CF1tg8Xy.js +721 -0
  365. package/dist/provider-runtime-types-DFhtdA6d.d.ts +134 -0
  366. package/dist/provider-types-CZGm6v88.d.ts +23 -0
  367. package/dist/redact-BTIZcHQL.d.ts +5 -0
  368. package/dist/reflection-command-hooks-ClUl-iv6.js +644 -0
  369. package/dist/reflection-command-hooks-G1-dI2Av.d.ts +32 -0
  370. package/dist/reflection-deps-Ccm2Jf5W.d.ts +19 -0
  371. package/dist/reflection-embedded-generator-BRvqV5N-.js +130 -0
  372. package/dist/reflection-embedded-generator-kfQfKEYV.d.ts +14 -0
  373. package/dist/reflection-injection-hooks-CS_uhjoD.d.ts +43 -0
  374. package/dist/reflection-lifecycle-hooks-CRSpUdLi.d.ts +27 -0
  375. package/dist/relation-dictionary-Cev1kyLe.js +4248 -0
  376. package/dist/release-download.d.ts +8 -0
  377. package/dist/release-download.js +32 -0
  378. package/dist/relevant-memories-context-m8nuFZcM.js +23 -0
  379. package/dist/rem-batch-executor-Dg2HgROM.js +2 -0
  380. package/dist/rem-batch-executor-DuC4nYyf.js +31640 -0
  381. package/dist/rem-consumer-retrieval-CR0dtcHR.js +246 -0
  382. package/dist/rem-trigger-Hn6od8IV.js +730 -0
  383. package/dist/resolver-Dy-hnjCR.js +103 -0
  384. package/dist/results-C3ZLroMb.js +140 -0
  385. package/dist/retrieval-gate-Bx2Zg7jD.d.ts +31 -0
  386. package/dist/retriever-Dxss5fRv.d.ts +469 -0
  387. package/dist/retriever-ZoLvPRHq.js +1757 -0
  388. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  389. package/dist/routes-DLHT__Ay.js +60 -0
  390. package/dist/runtime-audit-log-BCeujlEp.js +430 -0
  391. package/dist/runtime-audit-log-zpQiR9HT.d.ts +149 -0
  392. package/dist/scopes-CSOn6zdd.js +71 -0
  393. package/dist/scopes-CtrY-YQ3.d.ts +23 -0
  394. package/dist/server-CSvxchqg.js +1412 -0
  395. package/dist/session-registry-DBoE7AvZ.d.ts +14 -0
  396. package/dist/sidecar/main.d.ts +1 -0
  397. package/dist/sidecar/main.js +56 -0
  398. package/dist/signed-registry-constants-Bv0fgZ8Q.d.ts +12 -0
  399. package/dist/signed-registry-constants-yq3DlG3B.js +82 -0
  400. package/dist/sno-station-mem-runtime-dependencies-CoWqUMbK.js +30 -0
  401. package/dist/sno-station-mem-runtime-dependencies-DHESIuPn.d.ts +31 -0
  402. package/dist/sqlite-runtime-L_ywirTm.d.ts +58 -0
  403. package/dist/store-C8sUTssE.d.ts +27 -0
  404. package/dist/store-nPql26YM.js +5830 -0
  405. package/dist/strategy-hook-runner-Bxy851Xx.d.ts +16 -0
  406. package/dist/strategy-hook-runner-Djify5Rw.js +110 -0
  407. package/dist/token-counter-BD1f48Km.js +73 -0
  408. package/dist/trace-C1JxMfs-.d.ts +86 -0
  409. package/dist/types-CWdhXLxr.d.ts +477 -0
  410. package/dist/types-pVomjzqR.d.ts +132 -0
  411. package/dist/unplaced-candidate-migration-CbQHzcEM.js +940 -0
  412. package/dist/utils-Ctb9aevJ.d.ts +34 -0
  413. package/drizzle/0000_initial.sql +10 -0
  414. package/drizzle/0001_virtual_tables.sql +34 -0
  415. package/drizzle/0002_add_indexes.sql +11 -0
  416. package/drizzle/0003_content_hash_lookup_index.sql +2 -0
  417. package/drizzle/0004_chunk_swap.sql +60 -0
  418. package/drizzle/0005_drop_legacy_vec_fts.sql +10 -0
  419. package/drizzle/0006_fts_simple.sql +45 -0
  420. package/drizzle/0007_restore_simple_fts.sql +40 -0
  421. package/drizzle/0008_widen_memory_hash_unique_index.sql +4 -0
  422. package/drizzle/0009_memory_telemetry.sql +109 -0
  423. package/drizzle/0010_provider_mappings.sql +27 -0
  424. package/drizzle/0011_db_optimization.sql +82 -0
  425. package/drizzle/0012_b_profile_lanes.sql +9 -0
  426. package/drizzle/0013_extraction_timestamps.sql +6 -0
  427. package/drizzle/0014_extraction_timestamp_source.sql +3 -0
  428. package/drizzle/0015_task_lifecycle_state.sql +101 -0
  429. package/drizzle/0016_task_lifecycle_legacy_migration.sql +144 -0
  430. package/drizzle/0017_unplaced_candidates.sql +15 -0
  431. package/drizzle/0018_rem_batch_chassis.sql +71 -0
  432. package/drizzle/0019_profile_recovery_entries.sql +17 -0
  433. package/drizzle/0020_rem_scan_retry_progress.down.sql +14 -0
  434. package/drizzle/0020_rem_scan_retry_progress.sql +24 -0
  435. package/drizzle/0021_rem_two_facet_storage.down.sql +14 -0
  436. package/drizzle/0021_rem_two_facet_storage.sql +42 -0
  437. package/drizzle/0022_rem_facet_chunk_versions.down.sql +4 -0
  438. package/drizzle/0022_rem_facet_chunk_versions.sql +4 -0
  439. package/drizzle/0023_rem_defect_ledger.sql +40 -0
  440. package/drizzle/0024_rem_unbuilt_foundations.down.sql +13 -0
  441. package/drizzle/0024_rem_unbuilt_foundations.sql +65 -0
  442. package/drizzle/0025_rem_journal_operation_constraint.sql +28 -0
  443. package/drizzle/0026_rem_journal_detail.sql +1 -0
  444. package/drizzle/0027_legacy_nodix_namespace.sql +3 -0
  445. package/drizzle/0028_memory_timezone.sql +23 -0
  446. package/drizzle/0029_rem_write_hash_symmetry.sql +17 -0
  447. package/drizzle/0030_atomic_memory_additive.sql +105 -0
  448. package/drizzle/0031_atomic_extraction_ledger.sql +23 -0
  449. package/drizzle/0032_atomic_memory_entities.sql +12 -0
  450. package/drizzle/0033_todo_own_store.sql +99 -0
  451. package/drizzle/meta/0000_snapshot.json +87 -0
  452. package/drizzle/meta/_journal.json +244 -0
  453. package/generated/rem-operations.json +1 -0
  454. package/package.json +126 -4
  455. package/scripts/download-simple-tokenizer.mjs +254 -0
  456. package/settings.default.json +243 -0
  457. package/skills/extract-atomic-memory/SKILL.md +298 -0
  458. package/skills/extract-atomic-memory/references/account-for-turns.md +9 -0
  459. package/skills/extract-atomic-memory/references/calendar-meaning.md +64 -0
  460. package/skills/extract-atomic-memory/references/capture.md +120 -0
  461. package/skills/extract-atomic-memory/references/enrichment.md +92 -0
  462. package/skills/extract-atomic-memory/references/missing-durable-half.md +6 -0
  463. package/skills/extract-atomic-memory/references/progress-classification.md +21 -0
  464. package/skills/extract-atomic-memory/references/resolve-subject.md +19 -0
  465. package/skills/extract-atomic-memory/references/surrounding-context.md +10 -0
  466. package/skills/extract-atomic-memory/references/user-subject-guard.md +29 -0
  467. package/skills/judge-group-closure/SKILL.md +25 -0
  468. package/skills/judge-rem-memory-updates/SKILL.md +56 -0
  469. package/skills/judge-rem-memory-updates/agents/openai.yaml +4 -0
  470. package/skills/judge-retired-position/SKILL.md +25 -0
  471. package/skills/judge-task-lifecycle/SKILL.md +45 -0
  472. package/skills/key-state-attribute/SKILL.md +16 -0
  473. package/skills/resolve-entity-identity/SKILL.md +24 -0
  474. package/skills/resolve-relative-time/SKILL.md +22 -0
  475. package/sqlite-extensions/LICENSE-simple-tokenizer +28 -0
  476. package/sqlite-extensions/LICENSE-sqlite-vec +21 -0
  477. package/sqlite-extensions/linux-arm64/vec0.so +0 -0
  478. package/sqlite-extensions/linux-x64/vec0.so +0 -0
@@ -0,0 +1,413 @@
1
+ import { Tn as recallLifecycleSchema } from "./index-DL8AVj0Z.js";
2
+ import { n as Locale, r as SUPPORTED_LOCALES } from "./locales-JxGmkG6t.js";
3
+ import { c as FIXED_PROTOCOL_VALUE_72, i as FIXED_MEMORY_SNO_EXTRACT_PROFILE, l as PERSISTED_PROVIDER_SYSTEM, n as FIXED_MEMORY_SNO_CONFLICT_VERDICT, o as FIXED_PROTOCOL_VALUE_70, r as FIXED_MEMORY_SNO_EXTRACT_CHAT, s as FIXED_PROTOCOL_VALUE_71, t as FIXED_MEMORY_SNO_AI_EXTRACT } from "./signed-registry-constants-Bv0fgZ8Q.js";
4
+ import { n as AgentLlmPort } from "./agent-llm-port-5oXgBpzJ.js";
5
+ import { z } from "zod";
6
+ import { LLMConfig } from "@snoai/llmix";
7
+ //#region config/session-strategy.d.ts
8
+ /** @file session-strategy.ts
9
+ * @purpose Defines session-memory strategy constants without importing plugin config schemas.
10
+ * @boundary Shared literal values only; no schema or runtime registration dependencies.
11
+ */
12
+ declare const SESSION_STRATEGIES: readonly ["memoryReflection", "systemSessionMemory", "none"];
13
+ type SessionStrategy = (typeof SESSION_STRATEGIES)[number];
14
+ //#endregion
15
+ //#region config/plugin-config-embedding-schema.d.ts
16
+ declare const embeddingConfigSchema: z.ZodType<{
17
+ provider: "local-onnx";
18
+ model?: string | undefined;
19
+ dimensions: number;
20
+ nativeDim?: number | undefined;
21
+ revision?: string | undefined;
22
+ pooling?: "last_token" | "mean" | "cls" | undefined;
23
+ normalized?: boolean | undefined;
24
+ cacheDir?: string | undefined;
25
+ offline?: boolean | undefined;
26
+ mirror?: string | undefined;
27
+ dtype: "q4" | "q8" | "fp16" | "fp32";
28
+ sessionOptions: {
29
+ graphOptimizationLevel: "disabled" | "basic" | "extended" | "all";
30
+ enableMemPattern: boolean;
31
+ enableCpuMemArena: boolean;
32
+ executionMode?: "sequential" | "parallel" | undefined;
33
+ interOpNumThreads?: number | undefined;
34
+ intraOpNumThreads?: number | undefined;
35
+ };
36
+ chunking: boolean;
37
+ }, unknown>;
38
+ //#endregion
39
+ //#region config/settings.d.ts
40
+ type Settings = {
41
+ mode: ProductMode;
42
+ modelCalls: Record<keyof typeof MODEL_CALLS, Record<ProductMode, ModelDestination>>;
43
+ user: {
44
+ id: string;
45
+ language: Locale;
46
+ };
47
+ snoGpu: {
48
+ baseUrl: string;
49
+ apiKey: string;
50
+ };
51
+ rerank: {
52
+ mode: "lightweight" | "cross-encoder" | "none";
53
+ provider: "jina" | "siliconflow" | "pinecone" | "voyage" | "dashscope" | "tei" | "custom";
54
+ endpoint: string;
55
+ model: string;
56
+ apiKey: string;
57
+ timeoutMs: number;
58
+ maxCandidates: number;
59
+ };
60
+ store: {
61
+ path: string;
62
+ encryptionKey: string;
63
+ };
64
+ embedding: {
65
+ model: string;
66
+ revision: string;
67
+ dtype: "q4" | "q8" | "fp16" | "fp32";
68
+ threads: number;
69
+ cacheDir: string;
70
+ offline: boolean;
71
+ mirror: string;
72
+ };
73
+ recall: {
74
+ auto: boolean;
75
+ sessionStart: {
76
+ limit: number;
77
+ maxChars: number;
78
+ timeoutMs: number;
79
+ };
80
+ prompt: {
81
+ limit: number;
82
+ maxChars: number;
83
+ timeoutMs: number;
84
+ minChars: number;
85
+ minScore: number;
86
+ };
87
+ explicitLimit: number;
88
+ };
89
+ capture: {
90
+ assistant: boolean;
91
+ ambient: boolean;
92
+ sessionMemory: {
93
+ enabled: boolean;
94
+ messageCount: number;
95
+ };
96
+ sessionStrategy: (typeof SESSION_STRATEGIES)[number];
97
+ };
98
+ rem: {
99
+ tick: boolean;
100
+ operations: ("rem-replace" | "rem-update")[];
101
+ };
102
+ telemetry: {
103
+ memoryUsage: {
104
+ enabled: boolean;
105
+ key: string;
106
+ historicKeys: string[];
107
+ };
108
+ observe: {
109
+ enabled: boolean;
110
+ baseUrl: string;
111
+ };
112
+ redactionRules: string[];
113
+ };
114
+ logging: {
115
+ level: "debug" | "info" | "warn" | "error";
116
+ file: string;
117
+ debugContent: boolean;
118
+ };
119
+ memoryPackage: {
120
+ path: string;
121
+ node: string;
122
+ };
123
+ };
124
+ declare const settingsSchema: z.ZodType<Settings>;
125
+ declare function defaultSettings(): Settings;
126
+ declare function settingsToPluginConfig(settings: Settings): PluginConfig;
127
+ //#endregion
128
+ //#region config/plugin-config-mode-schema.d.ts
129
+ /**
130
+ * Product LLM modes, tier-ordered: Local First (selected calls on host) → Agent
131
+ * Native (every call borrows the host agent's model) → REM Enhanced (top
132
+ * tier: SNO-REM-MEM serves the LoRA-covered calls, the host model covers
133
+ * the rest).
134
+ */
135
+ declare const PRODUCT_MODES: readonly ["local-first", "agent-native", "rem-enhanced"];
136
+ type ProductMode = (typeof PRODUCT_MODES)[number];
137
+ declare const DEFAULT_MODEL_MODE: ProductMode;
138
+ /** Occasions select system messages; call ids select destinations. */
139
+ declare const LLM_OCCASIONS: readonly ["memoryExtract", "profileSectionMerge", "profileActiveTaskClassify", "conflictAdjudication", "summaryBuild", "dateResolution"];
140
+ type LlmOccasion = (typeof LLM_OCCASIONS)[number];
141
+ declare const remEnhancedConfigSchema: z.ZodType<{
142
+ trigger: {
143
+ tick: boolean;
144
+ };
145
+ }, unknown>;
146
+ /** The schema-defaulted config slice the request-time route resolver consumes. */
147
+ type LlmRoutingConfig = {
148
+ mode: ProductMode;
149
+ language: Locale;
150
+ modelCalls?: Settings["modelCalls"];
151
+ };
152
+ declare const llmRoutingConfigSchema: z.ZodType<LlmRoutingConfig, unknown>;
153
+ type LlmRoutingConfigInput = {
154
+ mode: ProductMode;
155
+ language?: unknown;
156
+ modelCalls?: Settings["modelCalls"];
157
+ };
158
+ //#endregion
159
+ //#region src/model/model-call-table.d.ts
160
+ type ModelDestination = "off" | "host" | "sno-gpu";
161
+ type ModelCallId = "E1" | "E2" | "E3" | "E4" | "E5" | "E6" | "E7" | "E8" | "E9" | "E10" | "E11" | "E12" | "P1" | "P2" | "P3" | "P4" | "P5" | "P6" | "T1" | "R1" | "REM1" | "REM2" | "REM3" | "REM4" | "REM5" | "REM6" | "REM7" | "REM8";
162
+ type RsiModelCallId = "R2" | "R3" | "R4";
163
+ type ModelCall = {
164
+ description: string;
165
+ occasion: LlmOccasion;
166
+ destinations: Record<ProductMode, ModelDestination>;
167
+ snoPreset: LlmPreset;
168
+ transport: {
169
+ host: "agent-host-seam";
170
+ snoGpu: "chat-completions" | "raw-completions";
171
+ };
172
+ promptVariant: {
173
+ host: "standard" | "adapter-a-chat";
174
+ snoGpu: "standard" | "adapter-a-raw";
175
+ };
176
+ replyParser: {
177
+ host: "json" | "text" | "json-or-single-token-verdict";
178
+ snoGpu: "json" | "text" | "single-token-verdict";
179
+ };
180
+ };
181
+ declare const MODEL_CALLS: Record<ModelCallId, ModelCall> & Record<RsiModelCallId, {
182
+ description: string;
183
+ calledBy: "RSI skill";
184
+ destinations: Record<ProductMode, ModelDestination>;
185
+ }>;
186
+ //#endregion
187
+ //#region src/model/llm-client-types.d.ts
188
+ declare const LLM_PRESETS: readonly [typeof FIXED_MEMORY_SNO_AI_EXTRACT, typeof FIXED_MEMORY_SNO_EXTRACT_CHAT, typeof FIXED_MEMORY_SNO_EXTRACT_PROFILE, typeof FIXED_MEMORY_SNO_CONFLICT_VERDICT];
189
+ type LlmPreset = (typeof LLM_PRESETS)[number];
190
+ type LlmProvider = "openai" | "openrouter" | "sno-gpu";
191
+ type MemoryLlmRequest = {
192
+ prompt: string;
193
+ hostPrompt?: string;
194
+ callId: ModelCallId;
195
+ /** Content-free correlation token forwarded as X-Request-ID when present. */
196
+ requestId?: string;
197
+ /** Hash of the static prompt asset, never the rendered user prompt. */
198
+ promptTemplateHash?: string;
199
+ extractionSkillHash?: string;
200
+ maxTokens?: number;
201
+ /** Per-request empty-body attempts. Defaults to the shared bounded retry policy. */
202
+ emptyReplyAttempts?: number;
203
+ timeoutMs?: number;
204
+ enableThinking?: boolean;
205
+ signal?: AbortSignal;
206
+ /**
207
+ * completeJson only: the caller's own shape check, run on each payload candidate in order.
208
+ *
209
+ * Without it the first syntactically valid object wins and a caller whose schema rejects it
210
+ * never sees the correct payload sitting behind it — measured on the live route, the subject
211
+ * guard returned null that way and parked a whole batch.
212
+ */
213
+ accept?: (value: unknown) => boolean;
214
+ };
215
+ interface LlmClientConfig {
216
+ /** Signed LLMIx preset id. */
217
+ preset: LlmPreset;
218
+ /** API key from settings. */
219
+ apiKey?: string;
220
+ /** Full base URL including /v1 suffix. */
221
+ baseURL?: string;
222
+ timeoutMs?: number;
223
+ agentPort?: AgentLlmPort;
224
+ operationId?: string;
225
+ onTransportAttempt?: (attempt: {
226
+ callId: ModelCallId;
227
+ destination: "host" | "sno-gpu";
228
+ transport: "chat-completions" | "raw-completions" | "agent-host-seam";
229
+ }) => void;
230
+ onProviderResponse?: (response: ProviderResponseTrace) => void;
231
+ /**
232
+ * Product-mode routing slice. When present, every request is resolved
233
+ * through resolveLlmRoute first; a routed-OFF request returns null without
234
+ * touching the network (callers' deterministic fallbacks take over).
235
+ */
236
+ routing?: LlmRoutingConfig;
237
+ }
238
+ type ResolvedLlmConfig = {
239
+ preset: LlmPreset;
240
+ provider: LlmProvider;
241
+ model: string;
242
+ providerOptions?: LLMConfig["providerOptions"];
243
+ baseURL?: string;
244
+ timeoutMs?: number;
245
+ };
246
+ interface LlmClient {
247
+ /** Send a prompt and parse the JSON response. Degradable failures return null; host cancellation and authentication rejection throw. */
248
+ completeJson<T>(request: MemoryLlmRequest): Promise<T | null>;
249
+ /** Send a prompt and return raw text. Degradable failures return null; host cancellation and authentication rejection throw. */
250
+ completeText(request: MemoryLlmRequest): Promise<string | null>;
251
+ /** Signed preset resolved through the bundled LLMIx registry. */
252
+ getResolvedConfig(): Promise<ResolvedLlmConfig>;
253
+ /** Best-effort diagnostics for the most recent failure, if any. */
254
+ getLastError(): string | null;
255
+ /** Provider-reported usage from the most recent successful response, if available. */
256
+ getLastUsage(): TokenUsage | null;
257
+ }
258
+ type TokenUsage = {
259
+ inputTokens: number;
260
+ outputTokens: number;
261
+ totalTokens: number;
262
+ estimated?: boolean;
263
+ };
264
+ type ProviderResponseTrace = {
265
+ durationMs?: number;
266
+ callId: ModelCallId;
267
+ destination: "host" | "sno-gpu";
268
+ provider: LlmProvider;
269
+ requestId?: string;
270
+ model?: string;
271
+ usage?: Omit<TokenUsage, "estimated">;
272
+ /** Set when the call produced no answer; the value is the failure category. */
273
+ failure?: string;
274
+ };
275
+ //#endregion
276
+ //#region config/plugin-config-feature-schema.d.ts
277
+ declare const sessionMemoryConfigSchema: z.ZodType<{
278
+ enabled: boolean;
279
+ messageCount: number;
280
+ }, unknown>;
281
+ declare const selfImprovementConfigSchema: z.ZodType<{
282
+ enabled: boolean;
283
+ beforeResetNote: boolean;
284
+ skipSubagentBootstrap: boolean;
285
+ ensureLearningFiles: boolean;
286
+ }, unknown>;
287
+ declare const extractionConfigSchema: z.ZodType<{
288
+ llm: {
289
+ preset: (typeof LLM_PRESETS)[number];
290
+ baseURL?: string | undefined;
291
+ apiKey?: string | undefined;
292
+ timeoutMs: number;
293
+ };
294
+ }, unknown>;
295
+ declare const memoryReflectionConfigSchema: z.ZodType<{
296
+ messageCount: number;
297
+ maxInputChars: number;
298
+ timeoutMs: number;
299
+ errorReminderMaxEntries: number;
300
+ dedupeErrorSignals: boolean;
301
+ injectMode: "inheritance+derived" | "inheritance-only" | "none";
302
+ storeToDb: boolean;
303
+ injectIntoPrompt: boolean;
304
+ agentId?: string | undefined;
305
+ }, unknown>;
306
+ //#endregion
307
+ //#region config/plugin-config-observe-schema.d.ts
308
+ declare const AGENT_IDS: readonly [typeof PERSISTED_PROVIDER_SYSTEM, typeof FIXED_PROTOCOL_VALUE_70, typeof FIXED_PROTOCOL_VALUE_71, typeof FIXED_PROTOCOL_VALUE_72];
309
+ declare const observeConfigSchema: z.ZodType<{
310
+ enabled: boolean;
311
+ baseUrl: string;
312
+ agentId: (typeof AGENT_IDS)[number];
313
+ }, unknown>;
314
+ //#endregion
315
+ //#region config/plugin-config-retrieval-schema.d.ts
316
+ declare const retrievalConfigSchema: z.ZodType<{
317
+ mode: "precision-recall" | "vector";
318
+ recallTopK: number;
319
+ vectorWeight: number;
320
+ bm25Weight: number;
321
+ minScore: number;
322
+ rerank: "cross-encoder" | "lightweight" | "none";
323
+ candidatePoolSize: number;
324
+ rerankApiKey?: string | undefined;
325
+ rerankModel: string;
326
+ rerankTimeoutMs: number;
327
+ recencyHalfLifeDays: number;
328
+ recencyWeight: number;
329
+ temporalWeighting: boolean;
330
+ mmrWindowOnly: boolean;
331
+ temporalExpiry: boolean;
332
+ temporalDecay: boolean;
333
+ lengthNormAnchor: number;
334
+ hardMinScore: number;
335
+ timeDecayHalfLifeDays: number;
336
+ rerankBlendVector?: number | undefined;
337
+ rerankBlendCross?: number | undefined;
338
+ lightweightFusionWeight?: number | undefined;
339
+ lightweightCosineWeight?: number | undefined;
340
+ importanceWeightBase?: number | undefined;
341
+ timeDecayFloor?: number | undefined;
342
+ mmrLambda?: number | undefined;
343
+ rerankEndpoint?: string | undefined;
344
+ rerankProvider?: "jina" | "siliconflow" | "pinecone" | "voyage" | "dashscope" | "tei" | "custom" | undefined;
345
+ rerankMaxCandidates?: number | undefined;
346
+ reinforcementFactor: number;
347
+ maxHalfLifeMultiplier: number;
348
+ }, unknown>;
349
+ //#endregion
350
+ //#region config/plugin-config-schema.d.ts
351
+ declare const ONBOARDING_PROFILES: readonly ["local-active", "capture-only", "manual-only", "custom"];
352
+ declare const REM_OPERATIONS: readonly ["rem-replace", "rem-update"];
353
+ type PluginConfigOutput = {
354
+ embedding: z.output<typeof embeddingConfigSchema>;
355
+ observe: z.output<typeof observeConfigSchema>;
356
+ dbPath?: string | undefined;
357
+ provider: {
358
+ userId?: string | undefined;
359
+ };
360
+ ambientLearning: boolean;
361
+ autoRecall: boolean;
362
+ autoRecallMinLength: number;
363
+ autoRecallMinRepeated: number;
364
+ autoRecallMaxQueryLength: number;
365
+ autoRecallTimeoutMs: number;
366
+ autoRecallIncludeAgents: string[];
367
+ autoRecallExcludeAgents: string[];
368
+ captureAssistant: boolean;
369
+ retrieval: z.output<typeof retrievalConfigSchema>;
370
+ scopes: {
371
+ default: string;
372
+ definitions: Record<string, {
373
+ description?: string | undefined;
374
+ metadata?: Record<string, unknown> | undefined;
375
+ }>;
376
+ agentAccess: Record<string, string[]>;
377
+ };
378
+ enableManagementTools: boolean;
379
+ language?: (typeof SUPPORTED_LOCALES)[number] | undefined;
380
+ sessionStrategy: (typeof SESSION_STRATEGIES)[number];
381
+ sessionMemory: z.output<typeof sessionMemoryConfigSchema>;
382
+ compression?: {
383
+ enabled: boolean;
384
+ } | undefined;
385
+ selfImprovement: z.output<typeof selfImprovementConfigSchema>;
386
+ extraction: z.output<typeof extractionConfigSchema>;
387
+ memoryReflection: z.output<typeof memoryReflectionConfigSchema>;
388
+ recallLifecycle: z.output<typeof recallLifecycleSchema>;
389
+ memoryTelemetry: {
390
+ enabled: boolean;
391
+ currentKeyVersion: number;
392
+ key: string;
393
+ historicKeys: string[];
394
+ };
395
+ debugContent: boolean;
396
+ mode: (typeof PRODUCT_MODES)[number];
397
+ modelCalls?: Settings["modelCalls"];
398
+ remOperations: (typeof REM_OPERATIONS)[number][];
399
+ remEnhanced?: {
400
+ trigger: {
401
+ tick: boolean;
402
+ };
403
+ };
404
+ onboarding?: {
405
+ version: number;
406
+ completedAt: string;
407
+ profile: (typeof ONBOARDING_PROFILES)[number];
408
+ } | undefined;
409
+ };
410
+ declare const pluginConfigSchema: z.ZodType<PluginConfigOutput, unknown>;
411
+ type PluginConfig = z.output<typeof pluginConfigSchema>;
412
+ //#endregion
413
+ export { SESSION_STRATEGIES as C, settingsToPluginConfig as S, llmRoutingConfigSchema as _, LlmPreset as a, defaultSettings as b, ResolvedLlmConfig as c, LLM_OCCASIONS as d, LlmOccasion as f, ProductMode as g, PRODUCT_MODES as h, LlmClientConfig as i, ModelCallId as l, LlmRoutingConfigInput as m, pluginConfigSchema as n, LlmProvider as o, LlmRoutingConfig as p, LlmClient as r, MemoryLlmRequest as s, PluginConfig as t, DEFAULT_MODEL_MODE as u, remEnhancedConfigSchema as v, SessionStrategy as w, settingsSchema as x, Settings as y };