memento-mcp-server 1.36.0 → 2.0.0

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 (625) hide show
  1. package/config/ranking-profiles/default.toml +0 -4
  2. package/config/ranking-profiles/feedback-heavy.toml +0 -4
  3. package/config/ranking-weights.toml +1 -19
  4. package/dist/cli/agent-ops-core.js +1 -1
  5. package/dist/cli/agent-ops-core.js.map +1 -1
  6. package/dist/cli/agent-ops.js +2 -2
  7. package/dist/cli/agent-ops.js.map +1 -1
  8. package/dist/cli/claude-code-hook.js +1 -1
  9. package/dist/cli/claude-code-hook.js.map +1 -1
  10. package/dist/cli/codex-hook.js +1 -1
  11. package/dist/cli/codex-hook.js.map +1 -1
  12. package/dist/cli/project-connect.d.ts +17 -0
  13. package/dist/cli/project-connect.d.ts.map +1 -0
  14. package/dist/cli/project-connect.js +201 -0
  15. package/dist/cli/project-connect.js.map +1 -0
  16. package/dist/cli.d.ts.map +1 -1
  17. package/dist/cli.js +5 -0
  18. package/dist/cli.js.map +1 -1
  19. package/dist/node_modules/@memento/agent-integration/package.json +2 -2
  20. package/dist/node_modules/@memento/core/dist/bootstrap/batch-telemetry-relation.d.ts.map +1 -1
  21. package/dist/node_modules/@memento/core/dist/bootstrap/batch-telemetry-relation.js +3 -1
  22. package/dist/node_modules/@memento/core/dist/bootstrap/batch-telemetry-relation.js.map +1 -1
  23. package/dist/node_modules/@memento/core/dist/bootstrap/write-and-meta.d.ts +1 -5
  24. package/dist/node_modules/@memento/core/dist/bootstrap/write-and-meta.d.ts.map +1 -1
  25. package/dist/node_modules/@memento/core/dist/bootstrap/write-and-meta.js +2 -48
  26. package/dist/node_modules/@memento/core/dist/bootstrap/write-and-meta.js.map +1 -1
  27. package/dist/node_modules/@memento/core/dist/bootstrap.d.ts +0 -4
  28. package/dist/node_modules/@memento/core/dist/bootstrap.d.ts.map +1 -1
  29. package/dist/node_modules/@memento/core/dist/bootstrap.js +2 -18
  30. package/dist/node_modules/@memento/core/dist/bootstrap.js.map +1 -1
  31. package/dist/node_modules/@memento/core/dist/config/ranking-profiles/default.toml +0 -4
  32. package/dist/node_modules/@memento/core/dist/config/ranking-profiles/feedback-heavy.toml +0 -4
  33. package/dist/node_modules/@memento/core/dist/config/ranking-weights.toml +1 -19
  34. package/dist/node_modules/@memento/core/dist/context.d.ts +2 -0
  35. package/dist/node_modules/@memento/core/dist/context.d.ts.map +1 -1
  36. package/dist/node_modules/@memento/core/dist/context.js +1 -2
  37. package/dist/node_modules/@memento/core/dist/context.js.map +1 -1
  38. package/dist/node_modules/@memento/core/dist/database/schema.sql +0 -36
  39. package/dist/node_modules/@memento/core/dist/domains/consolidation/repositories/consolidation-repository.d.ts +4 -2
  40. package/dist/node_modules/@memento/core/dist/domains/consolidation/repositories/consolidation-repository.d.ts.map +1 -1
  41. package/dist/node_modules/@memento/core/dist/domains/consolidation/repositories/consolidation-repository.js +14 -5
  42. package/dist/node_modules/@memento/core/dist/domains/consolidation/repositories/consolidation-repository.js.map +1 -1
  43. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/cluster-judge.d.ts +28 -0
  44. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/cluster-judge.d.ts.map +1 -0
  45. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/cluster-judge.js +83 -0
  46. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/cluster-judge.js.map +1 -0
  47. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/sleep-consolidation-service.d.ts +21 -4
  48. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/sleep-consolidation-service.d.ts.map +1 -1
  49. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/sleep-consolidation-service.js +125 -43
  50. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/sleep-consolidation-service.js.map +1 -1
  51. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/template-label-normalizer.d.ts +2 -0
  52. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/template-label-normalizer.d.ts.map +1 -0
  53. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/template-label-normalizer.js +10 -0
  54. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/template-label-normalizer.js.map +1 -0
  55. package/dist/node_modules/@memento/core/dist/domains/embedding/services/vector-compatibility-service.js +1 -1
  56. package/dist/node_modules/@memento/core/dist/domains/memory/introspection/meta-memory-service.d.ts.map +1 -1
  57. package/dist/node_modules/@memento/core/dist/domains/memory/introspection/meta-memory-service.js +1 -5
  58. package/dist/node_modules/@memento/core/dist/domains/memory/introspection/meta-memory-service.js.map +1 -1
  59. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-definition.d.ts +3 -3
  60. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-definition.d.ts.map +1 -1
  61. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-definition.js +1 -4
  62. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-definition.js.map +1 -1
  63. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-envelope.d.ts.map +1 -1
  64. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-envelope.js +0 -24
  65. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-envelope.js.map +1 -1
  66. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-post-search.d.ts +0 -6
  67. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-post-search.d.ts.map +1 -1
  68. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-post-search.js +0 -85
  69. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-post-search.js.map +1 -1
  70. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-results.d.ts.map +1 -1
  71. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-results.js +0 -5
  72. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-results.js.map +1 -1
  73. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-schema.d.ts +12 -12
  74. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-types.d.ts +0 -1
  75. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-types.d.ts.map +1 -1
  76. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool.d.ts.map +1 -1
  77. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool.js +2 -9
  78. package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool.js.map +1 -1
  79. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-near-duplicate.d.ts.map +1 -1
  80. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-near-duplicate.js +1 -3
  81. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-near-duplicate.js.map +1 -1
  82. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-augmentation.d.ts +1 -9
  83. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-augmentation.d.ts.map +1 -1
  84. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-augmentation.js +1 -141
  85. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-augmentation.js.map +1 -1
  86. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-db-helpers.d.ts.map +1 -1
  87. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-db-helpers.js +1 -3
  88. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-db-helpers.js.map +1 -1
  89. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-memory-item.d.ts.map +1 -1
  90. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-memory-item.js +9 -43
  91. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-memory-item.js.map +1 -1
  92. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-schema.d.ts +12 -19
  93. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-schema.d.ts.map +1 -1
  94. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-schema.js +0 -2
  95. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-schema.js.map +1 -1
  96. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-types.d.ts +0 -2
  97. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-types.d.ts.map +1 -1
  98. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool.d.ts +1 -1
  99. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool.d.ts.map +1 -1
  100. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool.js +8 -17
  101. package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool.js.map +1 -1
  102. package/dist/node_modules/@memento/core/dist/domains/memory/services/knowledge-context-bundle-builder.d.ts +0 -4
  103. package/dist/node_modules/@memento/core/dist/domains/memory/services/knowledge-context-bundle-builder.d.ts.map +1 -1
  104. package/dist/node_modules/@memento/core/dist/domains/memory/services/knowledge-context-bundle-builder.js +3 -110
  105. package/dist/node_modules/@memento/core/dist/domains/memory/services/knowledge-context-bundle-builder.js.map +1 -1
  106. package/dist/node_modules/@memento/core/dist/domains/memory/tools/forget-tool.d.ts.map +1 -1
  107. package/dist/node_modules/@memento/core/dist/domains/memory/tools/forget-tool.js +0 -21
  108. package/dist/node_modules/@memento/core/dist/domains/memory/tools/forget-tool.js.map +1 -1
  109. package/dist/node_modules/@memento/core/dist/domains/memory/tools/memory-injection-prompt.d.ts +2 -0
  110. package/dist/node_modules/@memento/core/dist/domains/memory/tools/memory-injection-prompt.d.ts.map +1 -1
  111. package/dist/node_modules/@memento/core/dist/domains/memory/tools/memory-injection-prompt.js +49 -5
  112. package/dist/node_modules/@memento/core/dist/domains/memory/tools/memory-injection-prompt.js.map +1 -1
  113. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/quality-metrics-collector.d.ts +2 -4
  114. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/quality-metrics-collector.d.ts.map +1 -1
  115. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/quality-metrics-collector.js +0 -9
  116. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/quality-metrics-collector.js.map +1 -1
  117. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/quality-metrics-types.d.ts +1 -14
  118. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/quality-metrics-types.d.ts.map +1 -1
  119. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/quality-threshold-manager.d.ts.map +1 -1
  120. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/quality-threshold-manager.js +0 -3
  121. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/quality-threshold-manager.js.map +1 -1
  122. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-baseline.d.ts +2 -18
  123. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-baseline.d.ts.map +1 -1
  124. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-baseline.js +2 -20
  125. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-baseline.js.map +1 -1
  126. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-comparison.d.ts +2 -4
  127. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-comparison.d.ts.map +1 -1
  128. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-comparison.js +1 -2
  129. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-comparison.js.map +1 -1
  130. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-degradation-alerts.d.ts.map +1 -1
  131. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-degradation-alerts.js +0 -11
  132. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-degradation-alerts.js.map +1 -1
  133. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-files.d.ts +0 -40
  134. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-files.d.ts.map +1 -1
  135. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-files.js +0 -278
  136. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-files.js.map +1 -1
  137. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics.d.ts +2 -2
  138. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics.d.ts.map +1 -1
  139. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics.js +1 -1
  140. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics.js.map +1 -1
  141. package/dist/node_modules/@memento/core/dist/domains/personal-agent/adapters/tool-context-knowledge-context-adapter.d.ts.map +1 -1
  142. package/dist/node_modules/@memento/core/dist/domains/personal-agent/adapters/tool-context-knowledge-context-adapter.js +0 -2
  143. package/dist/node_modules/@memento/core/dist/domains/personal-agent/adapters/tool-context-knowledge-context-adapter.js.map +1 -1
  144. package/dist/node_modules/@memento/core/dist/domains/personal-agent/mappers/knowledge-candidate-to-remember-params.js +1 -1
  145. package/dist/node_modules/@memento/core/dist/domains/personal-agent/mappers/knowledge-candidate-to-remember-params.js.map +1 -1
  146. package/dist/node_modules/@memento/core/dist/domains/relation/tools/add-relation-tool.d.ts.map +1 -1
  147. package/dist/node_modules/@memento/core/dist/domains/relation/tools/add-relation-tool.js +0 -15
  148. package/dist/node_modules/@memento/core/dist/domains/relation/tools/add-relation-tool.js.map +1 -1
  149. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-result-ranker.d.ts +1 -2
  150. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-result-ranker.d.ts.map +1 -1
  151. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-result-ranker.js +10 -63
  152. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-result-ranker.js.map +1 -1
  153. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-engine.d.ts.map +1 -1
  154. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-engine.js +1 -27
  155. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-engine.js.map +1 -1
  156. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-types.d.ts +0 -11
  157. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-types.d.ts.map +1 -1
  158. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-engine/search-engine-ranking.d.ts.map +1 -1
  159. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-engine/search-engine-ranking.js +0 -11
  160. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-engine/search-engine-ranking.js.map +1 -1
  161. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-engine/search-engine-sql-builder.d.ts.map +1 -1
  162. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-engine/search-engine-sql-builder.js +0 -4
  163. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-engine/search-engine-sql-builder.js.map +1 -1
  164. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-engine/search-engine.types.d.ts +0 -1
  165. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-engine/search-engine.types.d.ts.map +1 -1
  166. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking/search-ranking-composite.d.ts +2 -15
  167. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking/search-ranking-composite.d.ts.map +1 -1
  168. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking/search-ranking-composite.js +6 -65
  169. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking/search-ranking-composite.js.map +1 -1
  170. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking/search-ranking-signals.d.ts +0 -9
  171. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking/search-ranking-signals.d.ts.map +1 -1
  172. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking/search-ranking-signals.js +0 -32
  173. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking/search-ranking-signals.js.map +1 -1
  174. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking/search-ranking.types.d.ts +0 -15
  175. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking/search-ranking.types.d.ts.map +1 -1
  176. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking.d.ts +2 -8
  177. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking.d.ts.map +1 -1
  178. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking.js +2 -11
  179. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking.js.map +1 -1
  180. package/dist/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-memory-quality-query.d.ts.map +1 -1
  181. package/dist/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-memory-quality-query.js +1 -41
  182. package/dist/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-memory-quality-query.js.map +1 -1
  183. package/dist/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-repository.d.ts +0 -1
  184. package/dist/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-repository.d.ts.map +1 -1
  185. package/dist/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-repository.js.map +1 -1
  186. package/dist/node_modules/@memento/core/dist/domains/telemetry/tools/get-telemetry-summary-tool.d.ts.map +1 -1
  187. package/dist/node_modules/@memento/core/dist/domains/telemetry/tools/get-telemetry-summary-tool.js +0 -1
  188. package/dist/node_modules/@memento/core/dist/domains/telemetry/tools/get-telemetry-summary-tool.js.map +1 -1
  189. package/dist/node_modules/@memento/core/dist/index.d.ts +0 -10
  190. package/dist/node_modules/@memento/core/dist/index.d.ts.map +1 -1
  191. package/dist/node_modules/@memento/core/dist/index.js +0 -12
  192. package/dist/node_modules/@memento/core/dist/index.js.map +1 -1
  193. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/init.d.ts.map +1 -1
  194. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/init.js +0 -2
  195. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/init.js.map +1 -1
  196. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migration-repair-helpers.d.ts +43 -0
  197. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migration-repair-helpers.d.ts.map +1 -0
  198. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migration-repair-helpers.js +255 -0
  199. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migration-repair-helpers.js.map +1 -0
  200. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/048-repair-duplicate-semantic-content.d.ts +3 -4
  201. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/048-repair-duplicate-semantic-content.d.ts.map +1 -1
  202. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/048-repair-duplicate-semantic-content.js +4 -5
  203. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/048-repair-duplicate-semantic-content.js.map +1 -1
  204. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/049-repair-triple-sentence-memories.d.ts +1 -14
  205. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/049-repair-triple-sentence-memories.d.ts.map +1 -1
  206. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/049-repair-triple-sentence-memories.js +34 -19
  207. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/049-repair-triple-sentence-memories.js.map +1 -1
  208. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/050-drop-triple-schema.d.ts +17 -0
  209. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/050-drop-triple-schema.d.ts.map +1 -0
  210. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/050-drop-triple-schema.js +102 -0
  211. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/050-drop-triple-schema.js.map +1 -0
  212. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/051-drop-consolidation-score-columns.d.ts +17 -0
  213. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/051-drop-consolidation-score-columns.d.ts.map +1 -0
  214. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/051-drop-consolidation-score-columns.js +58 -0
  215. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/051-drop-consolidation-score-columns.js.map +1 -0
  216. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/052-drop-event-outbox.d.ts +17 -0
  217. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/052-drop-event-outbox.d.ts.map +1 -0
  218. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/052-drop-event-outbox.js +42 -0
  219. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/052-drop-event-outbox.js.map +1 -0
  220. package/dist/node_modules/@memento/core/dist/infrastructure/logging/log-rotation-paths.d.ts +0 -1
  221. package/dist/node_modules/@memento/core/dist/infrastructure/logging/log-rotation-paths.d.ts.map +1 -1
  222. package/dist/node_modules/@memento/core/dist/infrastructure/logging/log-rotation-paths.js +0 -2
  223. package/dist/node_modules/@memento/core/dist/infrastructure/logging/log-rotation-paths.js.map +1 -1
  224. package/dist/node_modules/@memento/core/dist/infrastructure/logging/log-rotation-policies.d.ts +0 -2
  225. package/dist/node_modules/@memento/core/dist/infrastructure/logging/log-rotation-policies.d.ts.map +1 -1
  226. package/dist/node_modules/@memento/core/dist/infrastructure/logging/log-rotation-policies.js +0 -3
  227. package/dist/node_modules/@memento/core/dist/infrastructure/logging/log-rotation-policies.js.map +1 -1
  228. package/dist/node_modules/@memento/core/dist/infrastructure/logging/log-rotation.d.ts +1 -1
  229. package/dist/node_modules/@memento/core/dist/infrastructure/logging/log-rotation.d.ts.map +1 -1
  230. package/dist/node_modules/@memento/core/dist/infrastructure/logging/log-rotation.js +0 -47
  231. package/dist/node_modules/@memento/core/dist/infrastructure/logging/log-rotation.js.map +1 -1
  232. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-job-execution-coordinator.d.ts +2 -2
  233. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-job-execution-coordinator.d.ts.map +1 -1
  234. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-job-execution-coordinator.js +49 -27
  235. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-job-execution-coordinator.js.map +1 -1
  236. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-job-timeout-resolver.d.ts +2 -7
  237. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-job-timeout-resolver.d.ts.map +1 -1
  238. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-job-timeout-resolver.js +2 -12
  239. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-job-timeout-resolver.js.map +1 -1
  240. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-recurring-schedules.d.ts +1 -12
  241. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-recurring-schedules.d.ts.map +1 -1
  242. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-recurring-schedules.js +8 -76
  243. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-recurring-schedules.js.map +1 -1
  244. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-context.d.ts +1 -12
  245. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-context.d.ts.map +1 -1
  246. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-context.js +0 -10
  247. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-context.js.map +1 -1
  248. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-default-config.d.ts.map +1 -1
  249. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-default-config.js +0 -12
  250. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-default-config.js.map +1 -1
  251. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-interval.d.ts +1 -1
  252. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-interval.d.ts.map +1 -1
  253. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-interval.js.map +1 -1
  254. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-control.d.ts.map +1 -1
  255. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-control.js +1 -10
  256. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-control.js.map +1 -1
  257. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-processor.d.ts +2 -10
  258. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-processor.d.ts.map +1 -1
  259. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-processor.js +0 -4
  260. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-processor.js.map +1 -1
  261. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-runners.d.ts +1 -5
  262. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-runners.d.ts.map +1 -1
  263. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-runners.js +2 -18
  264. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-runners.js.map +1 -1
  265. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-service-wiring.d.ts +1 -13
  266. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-service-wiring.d.ts.map +1 -1
  267. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-service-wiring.js +0 -15
  268. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-service-wiring.js.map +1 -1
  269. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-types.d.ts +0 -13
  270. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-types.d.ts.map +1 -1
  271. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-types.js.map +1 -1
  272. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-validate-config.d.ts.map +1 -1
  273. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-validate-config.js +0 -33
  274. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-validate-config.js.map +1 -1
  275. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler.d.ts +5 -9
  276. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler.d.ts.map +1 -1
  277. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler.js +85 -29
  278. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler.js.map +1 -1
  279. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-augmentation-handlers.d.ts +0 -1
  280. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-augmentation-handlers.d.ts.map +1 -1
  281. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-augmentation-handlers.js +0 -51
  282. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-augmentation-handlers.js.map +1 -1
  283. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-consolidation-relation-handlers.d.ts +0 -3
  284. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-consolidation-relation-handlers.d.ts.map +1 -1
  285. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-consolidation-relation-handlers.js +0 -149
  286. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-consolidation-relation-handlers.js.map +1 -1
  287. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-run-context.d.ts +0 -6
  288. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-run-context.d.ts.map +1 -1
  289. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/job-queue.d.ts +2 -2
  290. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/job-queue.d.ts.map +1 -1
  291. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/job-queue.js.map +1 -1
  292. package/dist/node_modules/@memento/core/dist/shared/config/api-tokens.d.ts +2 -7
  293. package/dist/node_modules/@memento/core/dist/shared/config/api-tokens.d.ts.map +1 -1
  294. package/dist/node_modules/@memento/core/dist/shared/config/api-tokens.js +22 -40
  295. package/dist/node_modules/@memento/core/dist/shared/config/api-tokens.js.map +1 -1
  296. package/dist/node_modules/@memento/core/dist/shared/config/constants.d.ts +1 -25
  297. package/dist/node_modules/@memento/core/dist/shared/config/constants.d.ts.map +1 -1
  298. package/dist/node_modules/@memento/core/dist/shared/config/constants.js +1 -15
  299. package/dist/node_modules/@memento/core/dist/shared/config/constants.js.map +1 -1
  300. package/dist/node_modules/@memento/core/dist/shared/config/environment.d.ts.map +1 -1
  301. package/dist/node_modules/@memento/core/dist/shared/config/environment.js +1 -2
  302. package/dist/node_modules/@memento/core/dist/shared/config/environment.js.map +1 -1
  303. package/dist/node_modules/@memento/core/dist/shared/config/index.d.ts.map +1 -1
  304. package/dist/node_modules/@memento/core/dist/shared/config/index.js +0 -10
  305. package/dist/node_modules/@memento/core/dist/shared/config/index.js.map +1 -1
  306. package/dist/node_modules/@memento/core/dist/shared/config/llm-model-resolver.d.ts +2 -2
  307. package/dist/node_modules/@memento/core/dist/shared/config/llm-model-resolver.d.ts.map +1 -1
  308. package/dist/node_modules/@memento/core/dist/shared/config/llm-model-resolver.js +1 -1
  309. package/dist/node_modules/@memento/core/dist/shared/config/llm-model-resolver.js.map +1 -1
  310. package/dist/node_modules/@memento/core/dist/shared/config/ranking-weights-loader.d.ts +0 -6
  311. package/dist/node_modules/@memento/core/dist/shared/config/ranking-weights-loader.d.ts.map +1 -1
  312. package/dist/node_modules/@memento/core/dist/shared/config/ranking-weights-loader.js +2 -18
  313. package/dist/node_modules/@memento/core/dist/shared/config/ranking-weights-loader.js.map +1 -1
  314. package/dist/node_modules/@memento/core/dist/shared/types/api-token.d.ts +1 -0
  315. package/dist/node_modules/@memento/core/dist/shared/types/api-token.d.ts.map +1 -1
  316. package/dist/node_modules/@memento/core/dist/shared/types/memory.types.d.ts +0 -4
  317. package/dist/node_modules/@memento/core/dist/shared/types/memory.types.d.ts.map +1 -1
  318. package/dist/node_modules/@memento/core/dist/shared/types/relation.types.d.ts +0 -1
  319. package/dist/node_modules/@memento/core/dist/shared/types/relation.types.d.ts.map +1 -1
  320. package/dist/node_modules/@memento/core/dist/shared/types/search.types.d.ts +0 -1
  321. package/dist/node_modules/@memento/core/dist/shared/types/search.types.d.ts.map +1 -1
  322. package/dist/node_modules/@memento/core/dist/shared/utils/type-param-validator.d.ts +6 -27
  323. package/dist/node_modules/@memento/core/dist/shared/utils/type-param-validator.d.ts.map +1 -1
  324. package/dist/node_modules/@memento/core/dist/shared/utils/type-param-validator.js +11 -71
  325. package/dist/node_modules/@memento/core/dist/shared/utils/type-param-validator.js.map +1 -1
  326. package/dist/node_modules/@memento/core/dist/tools/index.d.ts.map +1 -1
  327. package/dist/node_modules/@memento/core/dist/tools/index.js +0 -2
  328. package/dist/node_modules/@memento/core/dist/tools/index.js.map +1 -1
  329. package/dist/node_modules/@memento/core/dist/tools/types.d.ts +3 -8
  330. package/dist/node_modules/@memento/core/dist/tools/types.d.ts.map +1 -1
  331. package/dist/node_modules/@memento/core/dist/tools/types.js +0 -1
  332. package/dist/node_modules/@memento/core/dist/tools/types.js.map +1 -1
  333. package/dist/node_modules/@memento/core/package.json +1 -1
  334. package/dist/node_modules/@memento/core/scripts/copy-assets.js +2 -10
  335. package/dist/server/audit-tool-dispatch.d.ts +8 -0
  336. package/dist/server/audit-tool-dispatch.d.ts.map +1 -1
  337. package/dist/server/audit-tool-dispatch.js +26 -2
  338. package/dist/server/audit-tool-dispatch.js.map +1 -1
  339. package/dist/server/auth/api-token-registry.d.ts +1 -0
  340. package/dist/server/auth/api-token-registry.d.ts.map +1 -1
  341. package/dist/server/auth/api-token-registry.js +5 -1
  342. package/dist/server/auth/api-token-registry.js.map +1 -1
  343. package/dist/server/http-server-websocket.d.ts +17 -2
  344. package/dist/server/http-server-websocket.d.ts.map +1 -1
  345. package/dist/server/http-server-websocket.js +45 -3
  346. package/dist/server/http-server-websocket.js.map +1 -1
  347. package/dist/server/http-server.d.ts.map +1 -1
  348. package/dist/server/http-server.js +14 -6
  349. package/dist/server/http-server.js.map +1 -1
  350. package/dist/server/mcp-server-factory.d.ts +1 -1
  351. package/dist/server/mcp-server-factory.d.ts.map +1 -1
  352. package/dist/server/mcp-server-factory.js +1 -1
  353. package/dist/server/mcp-server-factory.js.map +1 -1
  354. package/dist/server/middleware/http-audit.middleware.d.ts.map +1 -1
  355. package/dist/server/middleware/http-audit.middleware.js +2 -0
  356. package/dist/server/middleware/http-audit.middleware.js.map +1 -1
  357. package/dist/server/middleware/index.d.ts +1 -1
  358. package/dist/server/middleware/index.d.ts.map +1 -1
  359. package/dist/server/middleware/index.js +1 -1
  360. package/dist/server/middleware/index.js.map +1 -1
  361. package/dist/server/middleware/programmatic-auth.middleware.d.ts +5 -0
  362. package/dist/server/middleware/programmatic-auth.middleware.d.ts.map +1 -1
  363. package/dist/server/middleware/programmatic-auth.middleware.js +35 -2
  364. package/dist/server/middleware/programmatic-auth.middleware.js.map +1 -1
  365. package/dist/server/middleware/tool-context.middleware.d.ts.map +1 -1
  366. package/dist/server/middleware/tool-context.middleware.js +5 -2
  367. package/dist/server/middleware/tool-context.middleware.js.map +1 -1
  368. package/dist/server/routes/admin/admin-batch.routes.d.ts.map +1 -1
  369. package/dist/server/routes/admin/admin-batch.routes.js +18 -11
  370. package/dist/server/routes/admin/admin-batch.routes.js.map +1 -1
  371. package/dist/server/routes/admin/admin-memory-search.routes.d.ts +23 -0
  372. package/dist/server/routes/admin/admin-memory-search.routes.d.ts.map +1 -0
  373. package/dist/server/routes/admin/admin-memory-search.routes.js +90 -0
  374. package/dist/server/routes/admin/admin-memory-search.routes.js.map +1 -0
  375. package/dist/server/routes/admin/admin-tools.routes.d.ts.map +1 -1
  376. package/dist/server/routes/admin/admin-tools.routes.js +1 -36
  377. package/dist/server/routes/admin/admin-tools.routes.js.map +1 -1
  378. package/dist/server/routes/admin.routes.d.ts.map +1 -1
  379. package/dist/server/routes/admin.routes.js +2 -0
  380. package/dist/server/routes/admin.routes.js.map +1 -1
  381. package/dist/server/routes/auth.routes.d.ts.map +1 -1
  382. package/dist/server/routes/auth.routes.js +9 -1
  383. package/dist/server/routes/auth.routes.js.map +1 -1
  384. package/dist/server/routes/mcp/handlers.d.ts.map +1 -1
  385. package/dist/server/routes/mcp/handlers.js +7 -2
  386. package/dist/server/routes/mcp/handlers.js.map +1 -1
  387. package/dist/server/routes/tools.routes.d.ts.map +1 -1
  388. package/dist/server/routes/tools.routes.js +2 -0
  389. package/dist/server/routes/tools.routes.js.map +1 -1
  390. package/dist/server/server-info.js +1 -1
  391. package/dist/server/server-info.js.map +1 -1
  392. package/dist/server/utils/project-id-header.d.ts +4 -0
  393. package/dist/server/utils/project-id-header.d.ts.map +1 -0
  394. package/dist/server/utils/project-id-header.js +9 -0
  395. package/dist/server/utils/project-id-header.js.map +1 -0
  396. package/dist/tools/types.d.ts +0 -1
  397. package/dist/tools/types.d.ts.map +1 -1
  398. package/dist/tools/types.js +0 -2
  399. package/dist/tools/types.js.map +1 -1
  400. package/package.json +4 -10
  401. package/static/css/dashboard.css +79 -0
  402. package/static/dashboard.html +54 -0
  403. package/static/js/dashboard-auth-render-tabs.js +13 -0
  404. package/static/js/dashboard-tabs-init.js +11 -0
  405. package/static/js/dashboard-tabs-panels.js +1 -0
  406. package/static/js/memory-finder-panel.js +155 -0
  407. package/static/js/memory-finder-search.js +170 -0
  408. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/consolidation-outbox-worker.d.ts +0 -20
  409. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/consolidation-outbox-worker.d.ts.map +0 -1
  410. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/consolidation-outbox-worker.js +0 -28
  411. package/dist/node_modules/@memento/core/dist/domains/consolidation/services/consolidation-outbox-worker.js.map +0 -1
  412. package/dist/node_modules/@memento/core/dist/domains/memory/repositories/kg-triple-repository.interface.d.ts +0 -32
  413. package/dist/node_modules/@memento/core/dist/domains/memory/repositories/kg-triple-repository.interface.d.ts.map +0 -1
  414. package/dist/node_modules/@memento/core/dist/domains/memory/repositories/kg-triple-repository.interface.js +0 -5
  415. package/dist/node_modules/@memento/core/dist/domains/memory/repositories/kg-triple-repository.interface.js.map +0 -1
  416. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/convert-episodic-to-semantic-tool.d.ts +0 -35
  417. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/convert-episodic-to-semantic-tool.d.ts.map +0 -1
  418. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/convert-episodic-to-semantic-tool.js +0 -247
  419. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/convert-episodic-to-semantic-tool.js.map +0 -1
  420. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/duplicate-content-plan.d.ts +0 -29
  421. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/duplicate-content-plan.d.ts.map +0 -1
  422. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/duplicate-content-plan.js +0 -104
  423. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/duplicate-content-plan.js.map +0 -1
  424. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/episodic-semantic-conversion.d.ts +0 -43
  425. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/episodic-semantic-conversion.d.ts.map +0 -1
  426. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/episodic-semantic-conversion.js +0 -233
  427. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/episodic-semantic-conversion.js.map +0 -1
  428. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-crud.d.ts +0 -52
  429. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-crud.d.ts.map +0 -1
  430. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-crud.js +0 -353
  431. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-crud.js.map +0 -1
  432. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-relations.d.ts +0 -19
  433. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-relations.d.ts.map +0 -1
  434. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-relations.js +0 -140
  435. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-relations.js.map +0 -1
  436. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-scoring.d.ts +0 -35
  437. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-scoring.d.ts.map +0 -1
  438. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-scoring.js +0 -104
  439. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-scoring.js.map +0 -1
  440. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-similarity.d.ts +0 -39
  441. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-similarity.d.ts.map +0 -1
  442. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-similarity.js +0 -189
  443. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-similarity.js.map +0 -1
  444. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-statistics.d.ts +0 -64
  445. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-statistics.d.ts.map +0 -1
  446. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-statistics.js +0 -113
  447. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-statistics.js.map +0 -1
  448. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-update-pipeline.d.ts +0 -38
  449. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-update-pipeline.d.ts.map +0 -1
  450. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-update-pipeline.js +0 -404
  451. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-update-pipeline.js.map +0 -1
  452. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-update-service.d.ts +0 -38
  453. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-update-service.d.ts.map +0 -1
  454. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-update-service.js +0 -117
  455. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-update-service.js.map +0 -1
  456. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-update-types.d.ts +0 -91
  457. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-update-types.d.ts.map +0 -1
  458. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-update-types.js +0 -16
  459. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/semantic-memory-update-types.js.map +0 -1
  460. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/triple-extraction-metadata.d.ts +0 -24
  461. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/triple-extraction-metadata.d.ts.map +0 -1
  462. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/triple-extraction-metadata.js +0 -47
  463. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/triple-extraction-metadata.js.map +0 -1
  464. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/triple-repair-plan.d.ts +0 -27
  465. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/triple-repair-plan.d.ts.map +0 -1
  466. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/triple-repair-plan.js +0 -47
  467. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/triple-repair-plan.js.map +0 -1
  468. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/triple-sentence.d.ts +0 -25
  469. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/triple-sentence.d.ts.map +0 -1
  470. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/triple-sentence.js +0 -92
  471. package/dist/node_modules/@memento/core/dist/domains/memory/semantic/triple-sentence.js.map +0 -1
  472. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/consolidation-metrics-collector.d.ts +0 -8
  473. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/consolidation-metrics-collector.d.ts.map +0 -1
  474. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/consolidation-metrics-collector.js +0 -207
  475. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/consolidation-metrics-collector.js.map +0 -1
  476. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-extreme-scenarios.d.ts +0 -218
  477. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-extreme-scenarios.d.ts.map +0 -1
  478. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-extreme-scenarios.js +0 -317
  479. package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/vector-search-quality-metrics/report-extreme-scenarios.js.map +0 -1
  480. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/entity-linker.d.ts +0 -55
  481. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/entity-linker.d.ts.map +0 -1
  482. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/entity-linker.js +0 -154
  483. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/entity-linker.js.map +0 -1
  484. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/interfaces.d.ts +0 -99
  485. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/interfaces.d.ts.map +0 -1
  486. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/interfaces.js +0 -6
  487. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/interfaces.js.map +0 -1
  488. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/predicate-canonicalizer.d.ts +0 -65
  489. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/predicate-canonicalizer.d.ts.map +0 -1
  490. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/predicate-canonicalizer.js +0 -219
  491. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/predicate-canonicalizer.js.map +0 -1
  492. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-chunk-merge.d.ts +0 -7
  493. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-chunk-merge.d.ts.map +0 -1
  494. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-chunk-merge.js +0 -26
  495. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-chunk-merge.js.map +0 -1
  496. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-errors.d.ts +0 -8
  497. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-errors.d.ts.map +0 -1
  498. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-errors.js +0 -86
  499. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-errors.js.map +0 -1
  500. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-llm-pipeline.d.ts +0 -50
  501. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-llm-pipeline.d.ts.map +0 -1
  502. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-llm-pipeline.js +0 -120
  503. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-llm-pipeline.js.map +0 -1
  504. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-llm-providers.d.ts +0 -20
  505. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-llm-providers.d.ts.map +0 -1
  506. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-llm-providers.js +0 -232
  507. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-llm-providers.js.map +0 -1
  508. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-result-helpers.d.ts +0 -12
  509. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-result-helpers.d.ts.map +0 -1
  510. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-result-helpers.js +0 -93
  511. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-result-helpers.js.map +0 -1
  512. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-service.d.ts +0 -68
  513. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-service.d.ts.map +0 -1
  514. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-service.js +0 -327
  515. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-service.js.map +0 -1
  516. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-statistics.d.ts +0 -74
  517. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-statistics.d.ts.map +0 -1
  518. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-statistics.js +0 -146
  519. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-statistics.js.map +0 -1
  520. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extractor.d.ts +0 -102
  521. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extractor.d.ts.map +0 -1
  522. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extractor.js +0 -443
  523. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extractor.js.map +0 -1
  524. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-input-normalizer.d.ts +0 -12
  525. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-input-normalizer.d.ts.map +0 -1
  526. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-input-normalizer.js +0 -10
  527. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-input-normalizer.js.map +0 -1
  528. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-normalizer.d.ts +0 -28
  529. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-normalizer.d.ts.map +0 -1
  530. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-normalizer.js +0 -83
  531. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-normalizer.js.map +0 -1
  532. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-parser.d.ts +0 -49
  533. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-parser.d.ts.map +0 -1
  534. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-parser.js +0 -130
  535. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-parser.js.map +0 -1
  536. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-pipeline-orchestrator.d.ts +0 -3
  537. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-pipeline-orchestrator.d.ts.map +0 -1
  538. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-pipeline-orchestrator.js +0 -55
  539. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-pipeline-orchestrator.js.map +0 -1
  540. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-text-chunker.d.ts +0 -9
  541. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-text-chunker.d.ts.map +0 -1
  542. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-text-chunker.js +0 -31
  543. package/dist/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-text-chunker.js.map +0 -1
  544. package/dist/node_modules/@memento/core/dist/domains/relation/tools/extract-triples-tool.d.ts +0 -13
  545. package/dist/node_modules/@memento/core/dist/domains/relation/tools/extract-triples-tool.d.ts.map +0 -1
  546. package/dist/node_modules/@memento/core/dist/domains/relation/tools/extract-triples-tool.js +0 -153
  547. package/dist/node_modules/@memento/core/dist/domains/relation/tools/extract-triples-tool.js.map +0 -1
  548. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/relation-recall-candidate-expansion.d.ts +0 -41
  549. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/relation-recall-candidate-expansion.d.ts.map +0 -1
  550. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/relation-recall-candidate-expansion.js +0 -203
  551. package/dist/node_modules/@memento/core/dist/domains/search/algorithms/relation-recall-candidate-expansion.js.map +0 -1
  552. package/dist/node_modules/@memento/core/dist/domains/telemetry/services/event-outbox-service.d.ts +0 -38
  553. package/dist/node_modules/@memento/core/dist/domains/telemetry/services/event-outbox-service.d.ts.map +0 -1
  554. package/dist/node_modules/@memento/core/dist/domains/telemetry/services/event-outbox-service.js +0 -81
  555. package/dist/node_modules/@memento/core/dist/domains/telemetry/services/event-outbox-service.js.map +0 -1
  556. package/dist/node_modules/@memento/core/dist/infrastructure/consolidation-score-service.d.ts +0 -81
  557. package/dist/node_modules/@memento/core/dist/infrastructure/consolidation-score-service.d.ts.map +0 -1
  558. package/dist/node_modules/@memento/core/dist/infrastructure/consolidation-score-service.js +0 -182
  559. package/dist/node_modules/@memento/core/dist/infrastructure/consolidation-score-service.js.map +0 -1
  560. package/dist/node_modules/@memento/core/dist/infrastructure/database/repositories/kg-triple-repository-sqlite.impl.d.ts +0 -16
  561. package/dist/node_modules/@memento/core/dist/infrastructure/database/repositories/kg-triple-repository-sqlite.impl.d.ts.map +0 -1
  562. package/dist/node_modules/@memento/core/dist/infrastructure/database/repositories/kg-triple-repository-sqlite.impl.js +0 -37
  563. package/dist/node_modules/@memento/core/dist/infrastructure/database/repositories/kg-triple-repository-sqlite.impl.js.map +0 -1
  564. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/ensure-memory-item-triple-extraction-columns.d.ts +0 -7
  565. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/ensure-memory-item-triple-extraction-columns.d.ts.map +0 -1
  566. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/ensure-memory-item-triple-extraction-columns.js +0 -37
  567. package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/ensure-memory-item-triple-extraction-columns.js.map +0 -1
  568. package/dist/node_modules/@memento/core/dist/infrastructure/logging/triple-extraction-logger.d.ts +0 -98
  569. package/dist/node_modules/@memento/core/dist/infrastructure/logging/triple-extraction-logger.d.ts.map +0 -1
  570. package/dist/node_modules/@memento/core/dist/infrastructure/logging/triple-extraction-logger.js +0 -236
  571. package/dist/node_modules/@memento/core/dist/infrastructure/logging/triple-extraction-logger.js.map +0 -1
  572. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job-chunk.d.ts +0 -5
  573. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job-chunk.d.ts.map +0 -1
  574. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job-chunk.js +0 -11
  575. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job-chunk.js.map +0 -1
  576. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job-memory-status.d.ts +0 -6
  577. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job-memory-status.d.ts.map +0 -1
  578. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job-memory-status.js +0 -6
  579. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job-memory-status.js.map +0 -1
  580. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job-retry.d.ts +0 -31
  581. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job-retry.d.ts.map +0 -1
  582. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job-retry.js +0 -210
  583. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job-retry.js.map +0 -1
  584. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job.types.d.ts +0 -82
  585. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job.types.d.ts.map +0 -1
  586. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job.types.js +0 -6
  587. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job/triple-extraction-batch-job.types.js.map +0 -1
  588. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job.d.ts +0 -30
  589. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job.d.ts.map +0 -1
  590. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job.js +0 -175
  591. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/triple-extraction-batch-job.js.map +0 -1
  592. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/relation-validator-executor.d.ts +0 -40
  593. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/relation-validator-executor.d.ts.map +0 -1
  594. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/relation-validator-executor.js +0 -159
  595. package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/relation-validator-executor.js.map +0 -1
  596. package/dist/node_modules/@memento/core/dist/prompts/triple-extraction.txt +0 -81
  597. package/dist/node_modules/@memento/core/dist/shared/interfaces/consolidation-score.interface.d.ts +0 -11
  598. package/dist/node_modules/@memento/core/dist/shared/interfaces/consolidation-score.interface.d.ts.map +0 -1
  599. package/dist/node_modules/@memento/core/dist/shared/interfaces/consolidation-score.interface.js +0 -6
  600. package/dist/node_modules/@memento/core/dist/shared/interfaces/consolidation-score.interface.js.map +0 -1
  601. package/dist/node_modules/@memento/core/dist/shared/types/consolidation-score.types.d.ts +0 -67
  602. package/dist/node_modules/@memento/core/dist/shared/types/consolidation-score.types.d.ts.map +0 -1
  603. package/dist/node_modules/@memento/core/dist/shared/types/consolidation-score.types.js +0 -5
  604. package/dist/node_modules/@memento/core/dist/shared/types/consolidation-score.types.js.map +0 -1
  605. package/dist/node_modules/@memento/core/dist/shared/types/triple-extraction.d.ts +0 -133
  606. package/dist/node_modules/@memento/core/dist/shared/types/triple-extraction.d.ts.map +0 -1
  607. package/dist/node_modules/@memento/core/dist/shared/types/triple-extraction.js +0 -6
  608. package/dist/node_modules/@memento/core/dist/shared/types/triple-extraction.js.map +0 -1
  609. package/dist/node_modules/@memento/core/dist/shared/utils/prompt-template-loader.d.ts +0 -48
  610. package/dist/node_modules/@memento/core/dist/shared/utils/prompt-template-loader.d.ts.map +0 -1
  611. package/dist/node_modules/@memento/core/dist/shared/utils/prompt-template-loader.js +0 -104
  612. package/dist/node_modules/@memento/core/dist/shared/utils/prompt-template-loader.js.map +0 -1
  613. package/dist/node_modules/@memento/core/dist/shared/utils/triple-cache.d.ts +0 -90
  614. package/dist/node_modules/@memento/core/dist/shared/utils/triple-cache.d.ts.map +0 -1
  615. package/dist/node_modules/@memento/core/dist/shared/utils/triple-cache.js +0 -124
  616. package/dist/node_modules/@memento/core/dist/shared/utils/triple-cache.js.map +0 -1
  617. package/dist/node_modules/@memento/core/dist/shared/utils/write-coalescing.d.ts +0 -77
  618. package/dist/node_modules/@memento/core/dist/shared/utils/write-coalescing.d.ts.map +0 -1
  619. package/dist/node_modules/@memento/core/dist/shared/utils/write-coalescing.js +0 -189
  620. package/dist/node_modules/@memento/core/dist/shared/utils/write-coalescing.js.map +0 -1
  621. package/dist/node_modules/@memento/core/dist/workers/consolidation-score-worker.d.ts +0 -99
  622. package/dist/node_modules/@memento/core/dist/workers/consolidation-score-worker.d.ts.map +0 -1
  623. package/dist/node_modules/@memento/core/dist/workers/consolidation-score-worker.js +0 -405
  624. package/dist/node_modules/@memento/core/dist/workers/consolidation-score-worker.js.map +0 -1
  625. package/dist/node_modules/@memento/core/prompts/triple-extraction.txt +0 -81
@@ -1,10 +1,6 @@
1
1
  import Database from 'better-sqlite3';
2
- import { WriteCoalescingManager } from '../shared/utils/write-coalescing.js';
3
- import { ConsolidationScoreService } from '../infrastructure/consolidation-score-service.js';
4
2
  import { MetaMemoryService } from '../domains/memory/introspection/meta-memory-service.js';
5
- export declare function createWriteCoalescingMetaAndScore(db: Database.Database): {
6
- writeCoalescingManager: WriteCoalescingManager;
7
- consolidationScoreService: ConsolidationScoreService | undefined;
3
+ export declare function createMetaMemoryService(db: Database.Database): {
8
4
  metaMemoryService: MetaMemoryService;
9
5
  };
10
6
  //# sourceMappingURL=write-and-meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"write-and-meta.d.ts","sourceRoot":"","sources":["../../src/bootstrap/write-and-meta.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAE,sBAAsB,EAAuB,MAAM,qCAAqC,CAAC;AAIlG,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAE3F,wBAAgB,iCAAiC,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG;IACxE,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,yBAAyB,EAAE,yBAAyB,GAAG,SAAS,CAAC;IACjE,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,CAmDA"}
1
+ {"version":3,"file":"write-and-meta.d.ts","sourceRoot":"","sources":["../../src/bootstrap/write-and-meta.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAE3F,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG;IAC9D,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,CAIA"}
@@ -1,55 +1,9 @@
1
1
  import Database from 'better-sqlite3';
2
- import { mementoConfig } from '../shared/config/index.js';
3
- import { WriteCoalescingManager } from '../shared/utils/write-coalescing.js';
4
- import { DatabaseUtils } from '../shared/utils/database.js';
5
2
  import { logger } from '../shared/utils/logger.js';
6
- import { ConsolidationScoreService } from '../infrastructure/consolidation-score-service.js';
7
3
  import { MetaMemoryService } from '../domains/memory/introspection/meta-memory-service.js';
8
- export function createWriteCoalescingMetaAndScore(db) {
9
- let consolidationScoreService;
10
- const writeCoalescingManager = new WriteCoalescingManager(1000, async (writes) => {
11
- if (!db || writes.length === 0)
12
- return;
13
- const currentDb = db;
14
- try {
15
- await DatabaseUtils.runTransaction(currentDb, async () => {
16
- for (const write of writes) {
17
- const updates = [];
18
- const params = [];
19
- if (write.fields.recall_count !== undefined) {
20
- updates.push('recall_count = ?');
21
- params.push(write.fields.recall_count);
22
- }
23
- if (write.fields.last_accessed_at !== undefined) {
24
- updates.push('last_accessed_at = ?');
25
- params.push(write.fields.last_accessed_at);
26
- }
27
- if (mementoConfig.consolidationScoreEnabled) {
28
- if (write.fields.g_value !== undefined) {
29
- updates.push('g_value = ?');
30
- params.push(write.fields.g_value);
31
- }
32
- if (write.fields.consolidation_score !== undefined) {
33
- updates.push('consolidation_score = ?');
34
- params.push(write.fields.consolidation_score);
35
- }
36
- }
37
- if (updates.length > 0) {
38
- params.push(write.memoryId);
39
- DatabaseUtils.run(currentDb, `UPDATE memory_item SET ${updates.join(', ')} WHERE id = ?`, params);
40
- }
41
- }
42
- });
43
- }
44
- catch (error) {
45
- logger.error(`⚠️ Write coalescing flush 실패: ${error instanceof Error ? error.message : String(error)}`);
46
- }
47
- });
48
- if (mementoConfig.consolidationScoreEnabled) {
49
- consolidationScoreService = new ConsolidationScoreService();
50
- }
4
+ export function createMetaMemoryService(db) {
51
5
  const metaMemoryService = new MetaMemoryService(db);
52
6
  logger.info('MetaMemoryService 초기화 완료');
53
- return { writeCoalescingManager, consolidationScoreService, metaMemoryService };
7
+ return { metaMemoryService };
54
8
  }
55
9
  //# sourceMappingURL=write-and-meta.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"write-and-meta.js","sourceRoot":"","sources":["../../src/bootstrap/write-and-meta.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAuB,MAAM,qCAAqC,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,O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U,uBAAuB,CAAC,EAAqB;IAG3D,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,EAAE,CAAC,CAAC;IACpD,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC/B,CAAC"}
@@ -10,11 +10,9 @@ import { MemoryEmbeddingService } from './domains/memory/services/memory-embeddi
10
10
  import { ForgettingPolicyService } from './domains/forgetting/services/forgetting-policy-service.js';
11
11
  import { getPerformanceMonitor } from './domains/monitoring/services/performance-monitor.js';
12
12
  import { ErrorLoggingService } from './domains/monitoring/services/error-logging-service.js';
13
- import type { WriteCoalescingManager } from './shared/utils/write-coalescing.js';
14
13
  import type { AnchorManager } from './domains/anchor/services/anchor/anchor-manager.js';
15
14
  import type { FailureDetector } from './domains/monitoring/services/failure-detector.js';
16
15
  import type { IBatchScheduler } from './shared/interfaces/batch-scheduler.interface.js';
17
- import type { IConsolidationScoreService } from './shared/interfaces/consolidation-score.interface.js';
18
16
  import type { IDatabaseOptimizer } from './shared/interfaces/database-optimizer.interface.js';
19
17
  import type { IReflexionWorker } from './shared/interfaces/reflexion-worker.interface.js';
20
18
  import { getVectorSearchEngine } from './domains/search/algorithms/vector-search-engine.js';
@@ -34,8 +32,6 @@ export interface ServerServices {
34
32
  performanceMonitor: ReturnType<typeof getPerformanceMonitor>;
35
33
  databaseOptimizer: IDatabaseOptimizer;
36
34
  errorLoggingService: ErrorLoggingService;
37
- consolidationScoreService?: IConsolidationScoreService;
38
- writeCoalescingManager: WriteCoalescingManager;
39
35
  metaMemoryService: MetaMemoryService;
40
36
  anchorManager: AnchorManager;
41
37
  relationGraph: RelationGraphPort;
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,OAAO,KAAK,EAAE,YAAY,EAAE,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c;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,gBAAgB,EAAE,sBAAsB,CAAC;IACzC,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,kBAAkB,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;IAC7D,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,aAAa,EAAE,aAAa,CAAC;IAC7B,aAAa,EAAE,iBAAiB,CAAC;IACjC,eAAe,EAAE,eAAe,CAAC;IACjC,eAAe,CAAC,EAAE,gBAAgB,CAAC;IACnC,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,kBAAkB,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;IAC7D,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,mGAAmG;IACnG,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAChD,8BAA8B;IAC9B,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;IACtD,kCAAkC;IAClC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,+BAA+B;IAC/B,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IACpD,uCAAuC;IACvC,gCAAgC,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAED,wBAAsB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CA0EvF;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAwCjG"}
@@ -12,7 +12,7 @@ import { ForgettingPolicyService } from './domains/forgetting/services/forgettin
12
12
  import { getPerformanceMonitor } from './domains/monitoring/services/performance-monitor.js';
13
13
  import { ErrorLoggingService } from './domains/monitoring/services/error-logging-service.js';
14
14
  import { createAnchorStack } from './bootstrap/anchor-stack.js';
15
- import { createWriteCoalescingMetaAndScore } from './bootstrap/write-and-meta.js';
15
+ import { createMetaMemoryService } from './bootstrap/write-and-meta.js';
16
16
  import { createMonitoringAndSchedulers } from './bootstrap/monitoring-schedulers.js';
17
17
  import { createBatchTelemetryRelationAndSleep } from './bootstrap/batch-telemetry-relation.js';
18
18
  import { createRuntimeDiagnosticsSampler } from './bootstrap/runtime-diagnostics-sampler.js';
@@ -33,7 +33,7 @@ export async function initializeServices(db) {
33
33
  const { vectorSearchEngine, anchorManager, anchorSearchService } = await createAnchorStack(db, embeddingService, hybridSearchEngine, errorLoggingService);
34
34
  const { failureDetector, reflexionWorker } = await startFailureAndReflexion(db);
35
35
  const { performanceMonitor, runtimeDiagnosticsLogger, walCheckpointScheduler, databaseLockMonitor } = await createMonitoringAndSchedulers(db);
36
- const { writeCoalescingManager, consolidationScoreService, metaMemoryService } = createWriteCoalescingMetaAndScore(db);
36
+ const { metaMemoryService } = createMetaMemoryService(db);
37
37
  const { introspectionScanCache, batchScheduler, telemetryService, relationGraph, sleepConsolidationService } = await createBatchTelemetryRelationAndSleep(db, embeddingService, runtimeDiagnosticsLogger, reflexionWorker, anchorManager, mementoConfig.walCheckpointEnabled ? walCheckpointScheduler : undefined, mementoConfig.dbLockMonitorEnabled ? databaseLockMonitor : undefined);
38
38
  anchorSearchService.setRelationGraph(relationGraph);
39
39
  hybridSearchEngine.setRelationGraph(relationGraph);
@@ -51,8 +51,6 @@ export async function initializeServices(db) {
51
51
  performanceMonitor,
52
52
  databaseOptimizer,
53
53
  errorLoggingService,
54
- consolidationScoreService,
55
- writeCoalescingManager,
56
54
  metaMemoryService,
57
55
  anchorManager,
58
56
  relationGraph,
@@ -116,20 +114,6 @@ export async function shutdownServices(services) {
116
114
  catch (error) {
117
115
  logger.warn('데이터베이스 락 모니터 중지 실패', { error });
118
116
  }
119
- if (services.writeCoalescingManager) {
120
- try {
121
- await services.writeCoalescingManager.flush();
122
- }
123
- catch (error) {
124
- logger.warn('Write Coalescing Manager flush 실패', { error });
125
- }
126
- try {
127
- await services.writeCoalescingManager.destroy();
128
- }
129
- catch (error) {
130
- logger.warn('Write Coalescing Manager destroy 실패', { error });
131
- }
132
- }
133
117
  try {
134
118
  resetBatchScheduler();
135
119
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAC;AACzF,OAAO,EAAE,yCAAyC,EAAE,MAAM,qCAAqC,CAAC;AAChG,OAAO,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AAC/F,OAAO,EAAE,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AACrG,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,iCAAiC,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,oCAAoC,EAAE,MAAM,yCAAyC,CAAC;AAC/F,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAO5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAC;AAE5G,OAAO,EAAE,sBAAsB,EAAE,MA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AI,EAAE,CAAC;IACzC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,IAAI,CAAC;QACH,MAAM,QAAQ,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC;IACxC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI,CAAC;QACH,MAAM,QAAQ,CAAC,sBAAsB,EAAE,IAAI,EAAE,CAAC;IAChD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,CAAC;QACH,QAAQ,CAAC,mBAAmB,EAAE,IAAI,EAAE,CAAC;IACvC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,CAAC;QACH,mBAAmB,EAAE,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
@@ -4,14 +4,10 @@ alpha = 0.45
4
4
  beta = 0.20
5
5
  gamma = 0.20
6
6
  delta = 0.10
7
- zeta = 0.0
8
7
  epsilon = 0.10
9
8
  theta = 0.10
10
9
  zeta_fb = 0.05
11
10
 
12
- [relation_weights]
13
- max_relations = 5
14
-
15
11
  [vector_length_decay]
16
12
  enabled = true
17
13
  characteristic_length = 40
@@ -4,10 +4,6 @@ alpha = 0.45
4
4
  beta = 0.18
5
5
  gamma = 0.18
6
6
  delta = 0.08
7
- zeta = 0.12
8
7
  epsilon = 0.12
9
8
  theta = 0.10
10
9
  zeta_fb = 0.12
11
-
12
- [relation_weights]
13
- max_relations = 5
@@ -1,7 +1,7 @@
1
1
  # 검색 랭킹 가중치 설정
2
2
  # 관계 추론 엔진의 검색 랭킹 공식에 사용되는 가중치 값들
3
3
  #
4
- # 랭킹 공식(요약): S = α·relevance + β·recency + γ·importance + δ·usage + ζ·relation_weight
4
+ # 랭킹 공식(요약): S = α·relevance + β·recency + γ·importance + δ·usage
5
5
  # + ζ_fb·(feedback_norm − 0.5) + θ·process_attribute_fit − ε·duplication_penalty
6
6
  # (relevance 슬롯에 절차 부스트 등이 합산되는 경우는 구현·스펙 FR-008 참고)
7
7
 
@@ -18,11 +18,6 @@ gamma = 0.20
18
18
  # usage: 사용 빈도 점수 (access_count 기반)
19
19
  delta = 0.10
20
20
 
21
- # relation_weight: 관계 가중치 (관계 그래프 기반)
22
- # 기본 0 (#1185). 관계 수는 질의와 무관한 문서 출처 prior 라, 링크가 없는 클리핑 정답을 관계 많은 비정답 아래로 눌렀다.
23
- # 운영 실측(고성 왕곡마을 클리핑/semantic top-20): 0.15 에서 비정답(관계 12개)이 4위, 0 에서 정답 4건이 1~4위.
24
- zeta = 0.0
25
-
26
21
  # duplication_penalty: 중복 패널티 (중복 기억에 대한 감점)
27
22
  epsilon = 0.10
28
23
 
@@ -32,19 +27,6 @@ theta = 0.10
32
27
  # zeta_fb: 피드백 신호(helpful/not_helpful 집계, 시그모이드 정규화 후) 가중치
33
28
  zeta_fb = 0.05
34
29
 
35
- # consolidation: α 슬롯 안에서 relevance 와 섞는 consolidation_score 가중치 (#1184).
36
- # relevance_score = (1 - consolidation) * relevance + consolidation * consolidation_score
37
- # consolidation_score 는 recall·memory_injection 이 반환한 후보마다 다시 쓰므로,
38
- # 0 이 아니면 한 번 반환된 기억이 다음 질의에서 관련성 가산을 받는다(자기강화).
39
- # 운영 실측: 1회 호출 뒤 top-10 전원 0.28 → 0.6225, relevance 슬롯 +0.025~0.049.
40
- # 상한 0.4 (SEARCH_RANKING.CONSOLIDATION_SCORE_MAX). #1184 이전 코드 상수는 0.2 였다.
41
- consolidation = 0.0
42
-
43
- [relation_weights]
44
- # 관계 가중치 = 평균(confidence × type_boost) × min(n, max_relations) / max_relations (#1185)
45
- # 관계 수에 단조 증가하고 max_relations 이상에서 평균에 포화합니다.
46
- max_relations = 5
47
-
48
30
  # #921: soft length decay on hybrid vector similarity — factor = len/(len+k)
49
31
  # Applied before HYBRID_VECTOR_THRESHOLD / under-fill / fusion. No create-time gate.
50
32
  [vector_length_decay]
@@ -10,6 +10,8 @@ export interface ServerContext {
10
10
  services: ServerServices;
11
11
  /** HTTP/MCP 요청별 에이전트 식별자 (미설정 시 ToolContext.agentId 생략) */
12
12
  agentId?: string;
13
+ /** HTTP/MCP 요청별 프로젝트 식별자 (미설정 시 ToolContext.projectId 생략) */
14
+ projectId?: string;
13
15
  }
14
16
  export declare function createServerContext(db: Database.Database, services: ServerServices): ServerContext;
15
17
  export declare function createToolContext(serverContext: ServerContext): ToolContext;
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACtB,QAAQ,EAAE,cAAc,CAAC;IACzB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,QAAQ,EAAE,cAAc,GACvB,aAAa,CAEf;AAED,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,aAAa,GAAG,WAAW,CAAC;AAC7E,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,GAAG,WAAW,CAAC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACtB,QAAQ,EAAE,cAAc,CAAC;IACzB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,QAAQ,EAAE,cAAc,GACvB,aAAa,CAEf;AAED,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,aAAa,GAAG,WAAW,CAAC;AAC7E,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,GAAG,WAAW,CAAC"}
@@ -18,6 +18,7 @@ function createToolContextFromServerContext(serverContext) {
18
18
  return {
19
19
  db: serverContext.db,
20
20
  ...(serverContext.agentId ? { agentId: serverContext.agentId } : {}),
21
+ ...(serverContext.projectId ? { projectId: serverContext.projectId } : {}),
21
22
  services: {
22
23
  searchEngine: serverContext.services.searchEngine,
23
24
  hybridSearchEngine: serverContext.services.hybridSearchEngine,
@@ -27,8 +28,6 @@ function createToolContextFromServerContext(serverContext) {
27
28
  performanceMonitor: serverContext.services.performanceMonitor,
28
29
  databaseOptimizer: serverContext.services.databaseOptimizer,
29
30
  errorLoggingService: serverContext.services.errorLoggingService,
30
- consolidationScoreService: serverContext.services.consolidationScoreService,
31
- writeCoalescingManager: serverContext.services.writeCoalescingManager,
32
31
  anchorManager: serverContext.services.anchorManager,
33
32
  relationGraph: serverContext.services.relationGraph,
34
33
  failureDetector: serverContext.services.failureDetector,
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,MAAM,UAAU,mBAAmB,CACjC,EAAqB,EACrB,QAAwB;IAExB,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;AAC1B,CAAC;AAID,MAAM,UAAU,iBAAiB,CAC/B,iBAAoD,EACpD,QAAyB;IAEzB,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,EAAE,GAAG,iBAAsC,CAAC;QAClD,MAAM,aAAa,GAAG,mBAAmB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QACxD,OAAO,kCAAkC,CAAC,aAAa,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,aAAa,GAAG,iBAAkC,CAAC;IACzD,OAAO,kCAAkC,CAAC,aAAa,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,kCAAkC,CAAC,aAA4B;IACtE,OAAO;QACL,EAAE,EAAE,aAAa,CAAC,EAAE;QACpB,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACpE,QAAQ,EAAE;YACR,YAAY,EAAE,aAAa,CAAC,QAAQ,CAAC,YAAY;YACjD,kBAAkB,EAAE,aAAa,CAAC,QAAQ,CAAC,kBAAkB;YAC7D,kBAAkB,EAAE,aAAa,CAAC,QAAQ,CAAC,kBAAkB;YAC7D,gBAAgB,EAAE,aAAa,CAAC,QAAQ,CAAC,gBAAgB;YACzD,uBAAuB,EAAE,aAAa,CAAC,QAAQ,CAAC,uBAAuB;YACvE,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1D;KACF,CAAC;AACJ,CAAC"}
@@ -42,35 +42,18 @@ CREATE TABLE IF NOT EXISTS memory_item (
42
42
  -- Consolidation score (migration 003)
43
43
  recall_count INTEGER NOT NULL DEFAULT 0,
44
44
  last_accessed_at TIMESTAMP,
45
- consolidation_score REAL,
46
- g_value REAL,
47
- -- Arigraph/Semantic triple (migration 008): semantic memory structural storage
48
- subject TEXT,
49
- predicate TEXT,
50
- object TEXT,
51
45
  is_consolidated BOOLEAN DEFAULT FALSE,
52
- triple_extracted BOOLEAN DEFAULT FALSE NOT NULL,
53
- triple_extracted_status TEXT,
54
- triple_extraction_metadata TEXT,
55
46
  is_deleted BOOLEAN DEFAULT FALSE NOT NULL,
56
47
  deleted_at TEXT,
57
48
  -- Project-scoped memory (Issue #81, migration 032)
58
49
  project_id TEXT
59
50
  );
60
- CREATE INDEX IF NOT EXISTS idx_memory_item_triple_extracted_episodic
61
- ON memory_item(triple_extracted)
62
- WHERE type = 'episodic';
63
- CREATE INDEX IF NOT EXISTS idx_memory_item_triple_extracted_status_episodic
64
- ON memory_item(triple_extracted_status)
65
- WHERE type = 'episodic';
66
51
  CREATE INDEX IF NOT EXISTS idx_memory_item_is_deleted_active
67
52
  ON memory_item(is_deleted)
68
53
  WHERE COALESCE(is_deleted, 0) = 0;
69
54
  CREATE INDEX IF NOT EXISTS idx_memory_item_project_id_type
70
55
  ON memory_item(project_id, type)
71
56
  WHERE project_id IS NOT NULL;
72
- CREATE INDEX IF NOT EXISTS idx_memory_item_triple ON memory_item(subject, predicate, object)
73
- WHERE type='semantic' AND subject IS NOT NULL AND predicate IS NOT NULL AND object IS NOT NULL;
74
57
 
75
58
  -- 태그 테이블
76
59
  CREATE TABLE IF NOT EXISTS memory_tag (
@@ -156,25 +139,6 @@ VALUES ('CAUSES', 'Causal', '인과 관계', '["episodic", "semantic"]', 0.7, 1.
156
139
  ('extracted_from', 'Structural', 'Semantic→Episodic 출처(에피소딕에서 시맨틱 추출)', '["semantic", "episodic"]', 0.7, 1.0),
157
140
  ('supported_by', 'Structural', 'Episodic→Semantic 지지(시맨틱이 에피소딕을 지지)', '["episodic", "semantic"]', 0.7, 1.0);
158
141
 
159
- -- kg_triple (migration 018 호환, Issue #90)
160
- CREATE TABLE IF NOT EXISTS kg_triple (
161
- id TEXT PRIMARY KEY,
162
- subject TEXT NOT NULL,
163
- predicate TEXT NOT NULL,
164
- object TEXT NOT NULL,
165
- owner_id TEXT NULL,
166
- process_id TEXT NULL,
167
- session_id TEXT NULL,
168
- representative_memory_id TEXT NULL,
169
- created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
170
- FOREIGN KEY (representative_memory_id) REFERENCES memory_item(id) ON DELETE SET NULL,
171
- UNIQUE(subject, predicate, object)
172
- );
173
- CREATE INDEX IF NOT EXISTS idx_kg_triple_spo ON kg_triple(subject, predicate, object);
174
- CREATE INDEX IF NOT EXISTS idx_kg_triple_representative ON kg_triple(representative_memory_id);
175
- CREATE INDEX IF NOT EXISTS idx_kg_triple_owner ON kg_triple(owner_id);
176
- CREATE INDEX IF NOT EXISTS idx_kg_triple_process ON kg_triple(process_id);
177
-
178
142
  -- 피드백 이벤트 테이블
179
143
  CREATE TABLE IF NOT EXISTS feedback_event (
180
144
  id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -44,6 +44,8 @@ export declare class ConsolidationRepository {
44
44
  * 모든 후보는 저장 시점에 이미 임베딩되어 있으므로, 호출부에서 후보마다 임베딩을
45
45
  * 다시 만들 이유가 없다. 다시 만들면 클러스터 하나당 시맨틱 기억 수만큼 모델 추론이
46
46
  * 돌아 CPU 를 태운다 (#917: 3,902건 × 13ms).
47
+ *
48
+ * Only semantics produced by sleep consolidation are merge targets; triple-extraction semantics must not be overwritten (#1231).
47
49
  */
48
50
  findSemanticsByOwner(ownerId: string | null, embeddingFilter: StoredEmbeddingFilter): SemanticOwnerRow[];
49
51
  updateSemanticMemory(params: {
@@ -52,9 +54,9 @@ export declare class ConsolidationRepository {
52
54
  originSourceJson: string;
53
55
  }): void;
54
56
  /**
55
- * memory_id → 파싱된 임베딩 벡터 (첫 행만, 임의 provider 우선 최신)
57
+ * memory_id → parsed whole-document (projection_type='native') vector; optionally restricted to one provider (#1226).
56
58
  */
57
- loadEmbeddingsMap(memoryIds: string[]): Map<string, number[]>;
59
+ loadEmbeddingsMap(memoryIds: string[], filter?: StoredEmbeddingFilter): Map<string, number[]>;
58
60
  insertSemanticMemory(params: {
59
61
  id: string;
60
62
  content: string;
@@ -1 +1 @@
1
- {"version":3,"file":"consolidation-repository.d.ts","sourceRoot":"","sources":["../../../../src/domains/consolidation/repositories/consolidation-repository.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAI3C,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,QAAQ,CAAC,QAAQ;IAElD,eAAe,IAAI,MAAM;IAMzB;;OAEG;IACH,sBAAsB,CACpB,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACxC,YAAY,CAAC,EAAE,MAAM,GACpB,oBAAoB,EAAE;IA4CzB;;;;;;;OAOG;IACH,oBAAoB,CAClB,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,eAAe,EAAE,qBAAqB,GACrC,gBAAgB,EAAE;IAyDrB,oBAAoB,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAY7F;;OAEG;IACH,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IA6B7D,oBAAoB,CAAC,MAAM,EAAE;QAC3B,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,gBAAgB,EAAE,MAAM,CAAC;QACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,IAAI;IAmBR,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,aAAa,SAAM,GAAG,IAAI;CAiB1E"}
1
+ {"version":3,"file":"consolidation-repository.d.ts","sourceRoot":"","sources":["../../../../src/domains/consolidation/repositories/consolidation-repository.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAI3C,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,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AS,EAAE,MAAM,EAAE,EAAE,aAAa,SAAM,GAAG,IAAI;CAiB1E"}
@@ -53,9 +53,11 @@ export class ConsolidationRepository {
53
53
  * 모든 후보는 저장 시점에 이미 임베딩되어 있으므로, 호출부에서 후보마다 임베딩을
54
54
  * 다시 만들 이유가 없다. 다시 만들면 클러스터 하나당 시맨틱 기억 수만큼 모델 추론이
55
55
  * 돌아 CPU 를 태운다 (#917: 3,902건 × 13ms).
56
+ *
57
+ * Only semantics produced by sleep consolidation are merge targets; triple-extraction semantics must not be overwritten (#1231).
56
58
  */
57
59
  findSemanticsByOwner(ownerId, embeddingFilter) {
58
- const joinConditions = ["me.memory_id = mi.id", "COALESCE(me.model, '') = COALESCE(?, '')"];
60
+ const joinConditions = ["me.memory_id = mi.id", "me.projection_type = 'native'", "COALESCE(me.model, '') = COALESCE(?, '')"];
59
61
  const joinParams = [embeddingFilter.model ?? null];
60
62
  if (embeddingFilter.provider) {
61
63
  joinConditions.push('me.embedding_provider = ?');
@@ -73,6 +75,7 @@ export class ConsolidationRepository {
73
75
  WHERE mi.type = 'semantic'
74
76
  AND (mi.is_deleted IS NULL OR mi.is_deleted = 0)
75
77
  AND COALESCE(mi.owner_id, '') = COALESCE(?, '')
78
+ AND mi.origin_source LIKE '%"tool":"sleep-consolidation"%'
76
79
  ORDER BY mi.created_at ASC
77
80
  `, [...joinParams, ownerId ?? null]);
78
81
  // UNIQUE 는 (memory_id, embedding_provider, projection_type) 이라 provider 를 고정해도
@@ -106,20 +109,26 @@ export class ConsolidationRepository {
106
109
  `, [params.content, params.originSourceJson, params.id]);
107
110
  }
108
111
  /**
109
- * memory_id → 파싱된 임베딩 벡터 (첫 행만, 임의 provider 우선 최신)
112
+ * memory_id → parsed whole-document (projection_type='native') vector; optionally restricted to one provider (#1226).
110
113
  */
111
- loadEmbeddingsMap(memoryIds) {
114
+ loadEmbeddingsMap(memoryIds, filter = {}) {
112
115
  const out = new Map();
113
116
  if (memoryIds.length === 0) {
114
117
  return out;
115
118
  }
116
119
  const placeholders = memoryIds.map(() => '?').join(',');
120
+ const whereParts = [`memory_id IN (${placeholders})`, "projection_type = 'native'"];
121
+ const params = [...memoryIds];
122
+ if (filter.provider) {
123
+ whereParts.push('embedding_provider = ?');
124
+ params.push(filter.provider);
125
+ }
117
126
  const rows = DatabaseUtils.all(this.db, `
118
127
  SELECT memory_id, embedding
119
128
  FROM memory_embedding
120
- WHERE memory_id IN (${placeholders})
129
+ WHERE ${whereParts.join(' AND ')}
121
130
  ORDER BY memory_id, created_at DESC
122
- `, memoryIds);
131
+ `, params);
123
132
  for (const row of rows) {
124
133
  if (out.has(row.memory_id)) {
125
134
  continue;
@@ -1 +1 @@
1
- {"version":3,"file":"consolidation-repository.js","sourceRoot":"","sources":["../../../../src/domains/consolidation/repositories/consolidation-repository.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC;AAgC5F,MAAM,OAAO,uBAAuB;IACL;IAA7B,YAA6B,EAAqB;QAArB,OAAE,GAAF,EAAE,CAAmB;IAAG,CAAC;IAEtD,eAAe;QACb,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC;QACpD,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,sBAAsB,CACpB,aAAwC,EACxC,YAAqB;QAErB,MAAM,IAAI,GAAG,YAAY,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;QACpD,MAAM,IAAI,GAAG,aAAa,CAAC,GAAG,CAC5B,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4BAGsB,YAAY;;KAEnC,EACC,SAAS,CACgD,CAAC;QAE5D,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC3B,SAAS;YACX,CAAC;YACD,MAAM,GAAG,GAAG,wBAAwB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACpD,IAAI,GAAG,EAAE,CAAC;gBACR,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,oBAAoB,CAAC,MAOpB;QACC,aAAa,CAAC,GAAG,CACf,IAAI,CAAC,EAAE,EACP;;;;KAID,EACC;YACE,MAAM,CAAC,EAAE;YACT,MAAM,CAAC,OAAO;YACd,MAAM,CAAC,UAAU;YACjB,MAAM,CAAC,YAAY,IAAI,SAAS;YAChC,MAAM,CAAC,gBAAgB;YACvB,MAAM,CAAC,OAAO;SACf,CACF,CAAC;IACJ,CAAC;IAED,yBAAyB,CAAC,SAAmB,EAAE,aAAa,GAAG,GAAG;QAChE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO;QACT,CAAC;QACD,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxD,aAAa,CAAC,GAAG,CACf,IAAI,CAAC,EAAE,EACP;;;;qBAIe,YAAY;;KAE5B,EACC,CAAC,aAAa,EAAE,GAAG,SAAS,CAAC,CAC9B,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"consolidation-repository.js","sourceRoot":"","sources":["../../../../src/domains/consolidation/repositories/consolidation-repository.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,mCA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AAG,GAAG,wBAAwB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACpD,IAAI,GAAG,EAAE,CAAC;gBACR,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,oBAAoB,CAAC,MAOpB;QACC,aAAa,CAAC,GAAG,CACf,IAAI,CAAC,EAAE,EACP;;;;KAID,EACC;YACE,MAAM,CAAC,EAAE;YACT,MAAM,CAAC,OAAO;YACd,MAAM,CAAC,UAAU;YACjB,MAAM,CAAC,YAAY,IAAI,SAAS;YAChC,MAAM,CAAC,gBAAgB;YACvB,MAAM,CAAC,OAAO;SACf,CACF,CAAC;IACJ,CAAC;IAED,yBAAyB,CAAC,SAAmB,EAAE,aAAa,GAAG,GAAG;QAChE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO;QACT,CAAC;QACD,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxD,aAAa,CAAC,GAAG,CACf,IAAI,CAAC,EAAE,EACP;;;;qBAIe,YAAY;;KAE5B,EACC,CAAC,aAAa,EAAE,GAAG,SAAS,CAAC,CAC9B,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ export interface ClusterJudgePair {
2
+ a: string;
3
+ b: string;
4
+ }
5
+ export interface IClusterJudge {
6
+ /** One P(same task or topic) per pair, in order. Never throws; NaN where no score was obtained. */
7
+ scorePairs(pairs: ClusterJudgePair[]): Promise<number[]>;
8
+ }
9
+ /** 40 labeled production pairs (2026-10-03): 0.6 kept 14/15 same-topic and 0/25 different-topic pairs. */
10
+ export declare function getClusterJudgeThreshold(): number;
11
+ export interface JevClusterJudgeOptions {
12
+ apiKey: string;
13
+ model?: string;
14
+ baseUrl?: string;
15
+ timeoutMs?: number;
16
+ }
17
+ export declare class JevClusterJudge implements IClusterJudge {
18
+ private readonly apiKey;
19
+ private readonly model;
20
+ private readonly baseUrl;
21
+ private readonly timeoutMs;
22
+ constructor(options: JevClusterJudgeOptions);
23
+ scorePairs(pairs: ClusterJudgePair[]): Promise<number[]>;
24
+ private scoreBatch;
25
+ }
26
+ /** CONSOLIDATION_JUDGE=typesafe enables the judge; anything else keeps cosine-only clustering. */
27
+ export declare function createClusterJudge(apiKey: string | undefined, model: string | undefined): IClusterJudge | null;
28
+ //# sourceMappingURL=cluster-judge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cluster-judge.d.ts","sourceRoot":"","sources":["../../../../src/domains/consolidation/services/cluster-judge.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,gBAAgB;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,aAAa;IAC5B,mGAAmG;IACnG,UAAU,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CAC1D;AAED,0GAA0G;AAC1G,wBAAgB,wBAAwB,IAAI,MAAM,CAIjD;AAMD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,eAAgB,YAAW,aAAa;IACnD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,OAAO,EAAE,sBAAsB;IAOrC,UAAU,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAQhD,UAAU;CAmCzB;AAED,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,IAAI,CAS9G"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * #1225: second opinion on consolidation clusters. MiniLM cosine similarity groups records of
3
+ * the same genre (e.g. two unrelated work logs) above the cluster threshold; a judge model
4
+ * decides whether two texts cover the same task or topic.
5
+ */
6
+ import { logger } from '../../../shared/utils/logger.js';
7
+ import { stripMemoryTemplateLabels } from './template-label-normalizer.js';
8
+ /** 40 labeled production pairs (2026-10-03): 0.6 kept 14/15 same-topic and 0/25 different-topic pairs. */
9
+ export function getClusterJudgeThreshold() {
10
+ const raw = process.env.CONSOLIDATION_JUDGE_THRESHOLD;
11
+ const n = raw ? parseFloat(raw) : 0.6;
12
+ return Number.isFinite(n) && n > 0 && n <= 1 ? n : 0.6;
13
+ }
14
+ const QUESTION = '기억 A 와 기억 B 는 같은 작업이나 같은 주제를 다룬다';
15
+ const BATCH_SIZE = 10;
16
+ const TEXT_CHARS = 400;
17
+ export class JevClusterJudge {
18
+ apiKey;
19
+ model;
20
+ baseUrl;
21
+ timeoutMs;
22
+ constructor(options) {
23
+ this.apiKey = options.apiKey;
24
+ this.model = options.model ?? 'jev-latest';
25
+ this.baseUrl = options.baseUrl ?? 'https://api.typesafe.ai/v1/systemone';
26
+ this.timeoutMs = options.timeoutMs ?? 10000;
27
+ }
28
+ async scorePairs(pairs) {
29
+ const scores = [];
30
+ for (let i = 0; i < pairs.length; i += BATCH_SIZE) {
31
+ scores.push(...(await this.scoreBatch(pairs.slice(i, i + BATCH_SIZE))));
32
+ }
33
+ return scores;
34
+ }
35
+ async scoreBatch(batch) {
36
+ const state = {};
37
+ const questions = {};
38
+ batch.forEach((pair, k) => {
39
+ state[`a${k}`] = stripMemoryTemplateLabels(pair.a).slice(0, TEXT_CHARS);
40
+ state[`b${k}`] = stripMemoryTemplateLabels(pair.b).slice(0, TEXT_CHARS);
41
+ questions[`q${k}`] = { type: 'noul', instructions: `${QUESTION} (기억 A = a${k}, 기억 B = b${k})` };
42
+ });
43
+ const controller = new AbortController();
44
+ const timer = setTimeout(() => controller.abort(), this.timeoutMs);
45
+ try {
46
+ const res = await fetch(this.baseUrl, {
47
+ method: 'POST',
48
+ headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${this.apiKey}` },
49
+ body: JSON.stringify({ model: this.model, state, questions }),
50
+ signal: controller.signal
51
+ });
52
+ if (!res.ok) {
53
+ logger.warn(`Consolidation judge: request failed (status ${res.status}, pairs ${batch.length})`);
54
+ return batch.map(() => Number.NaN);
55
+ }
56
+ const data = (await res.json());
57
+ return batch.map((_, k) => {
58
+ const noul = data.answers?.[`q${k}`]?.noul;
59
+ return typeof noul === 'number' ? noul : Number.NaN;
60
+ });
61
+ }
62
+ catch (error) {
63
+ const message = error instanceof Error ? error.message : String(error);
64
+ logger.warn(`Consolidation judge: ${message} (pairs ${batch.length})`);
65
+ return batch.map(() => Number.NaN);
66
+ }
67
+ finally {
68
+ clearTimeout(timer);
69
+ }
70
+ }
71
+ }
72
+ /** CONSOLIDATION_JUDGE=typesafe enables the judge; anything else keeps cosine-only clustering. */
73
+ export function createClusterJudge(apiKey, model) {
74
+ if (process.env.CONSOLIDATION_JUDGE !== 'typesafe') {
75
+ return null;
76
+ }
77
+ if (!apiKey || apiKey.trim() === '') {
78
+ logger.error('CONSOLIDATION_JUDGE=typesafe but TYPESAFE_API_KEY is empty; consolidation runs without the judge.');
79
+ return null;
80
+ }
81
+ return new JevClusterJudge({ apiKey, model: model || undefined });
82
+ }
83
+ //# sourceMappingURL=cluster-judge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cluster-judge.js","sourceRoot":"","sources":["../../../../src/domains/consolidation/services/cluster-judge.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,EA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