@tonycasey/lisa 2.12.0 → 2.25.2

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 (245) hide show
  1. package/README.md +2 -2
  2. package/dist/lib/application/handlers/PromptSubmitHandler.js +2 -2
  3. package/dist/lib/application/handlers/PromptSubmitHandler.js.map +1 -1
  4. package/dist/lib/application/handlers/SessionStopHandler.d.ts.map +1 -1
  5. package/dist/lib/application/handlers/SessionStopHandler.js +12 -2
  6. package/dist/lib/application/handlers/SessionStopHandler.js.map +1 -1
  7. package/dist/lib/commands/init.js +3 -3
  8. package/dist/lib/commands/init.js.map +1 -1
  9. package/dist/lib/commands/knowledge.d.ts.map +1 -1
  10. package/dist/lib/commands/knowledge.js +449 -1
  11. package/dist/lib/commands/knowledge.js.map +1 -1
  12. package/dist/lib/domain/errors/LlmErrors.d.ts +41 -0
  13. package/dist/lib/domain/errors/LlmErrors.d.ts.map +1 -0
  14. package/dist/lib/domain/errors/LlmErrors.js +64 -0
  15. package/dist/lib/domain/errors/LlmErrors.js.map +1 -0
  16. package/dist/lib/domain/interfaces/IConsolidationService.d.ts +65 -0
  17. package/dist/lib/domain/interfaces/IConsolidationService.d.ts.map +1 -0
  18. package/dist/lib/domain/interfaces/IConsolidationService.js +21 -0
  19. package/dist/lib/domain/interfaces/IConsolidationService.js.map +1 -0
  20. package/dist/lib/domain/interfaces/ICurationService.d.ts +81 -0
  21. package/dist/lib/domain/interfaces/ICurationService.d.ts.map +1 -0
  22. package/dist/lib/domain/interfaces/ICurationService.js +65 -0
  23. package/dist/lib/domain/interfaces/ICurationService.js.map +1 -0
  24. package/dist/lib/domain/interfaces/IDeduplicationService.d.ts +67 -0
  25. package/dist/lib/domain/interfaces/IDeduplicationService.d.ts.map +1 -0
  26. package/dist/lib/domain/interfaces/IDeduplicationService.js +9 -0
  27. package/dist/lib/domain/interfaces/IDeduplicationService.js.map +1 -0
  28. package/dist/lib/domain/interfaces/ILlmConfigService.d.ts +36 -0
  29. package/dist/lib/domain/interfaces/ILlmConfigService.d.ts.map +1 -0
  30. package/dist/lib/domain/interfaces/ILlmConfigService.js +11 -0
  31. package/dist/lib/domain/interfaces/ILlmConfigService.js.map +1 -0
  32. package/dist/lib/domain/interfaces/ILlmGuard.d.ts +35 -0
  33. package/dist/lib/domain/interfaces/ILlmGuard.d.ts.map +1 -0
  34. package/dist/lib/domain/interfaces/ILlmGuard.js +12 -0
  35. package/dist/lib/domain/interfaces/ILlmGuard.js.map +1 -0
  36. package/dist/lib/domain/interfaces/ILlmService.d.ts +87 -0
  37. package/dist/lib/domain/interfaces/ILlmService.d.ts.map +1 -0
  38. package/dist/lib/domain/interfaces/ILlmService.js +40 -0
  39. package/dist/lib/domain/interfaces/ILlmService.js.map +1 -0
  40. package/dist/lib/domain/interfaces/ILlmUsageTracker.d.ts +60 -0
  41. package/dist/lib/domain/interfaces/ILlmUsageTracker.d.ts.map +1 -0
  42. package/dist/lib/domain/interfaces/ILlmUsageTracker.js +29 -0
  43. package/dist/lib/domain/interfaces/ILlmUsageTracker.js.map +1 -0
  44. package/dist/lib/domain/interfaces/IMemoryService.d.ts +90 -0
  45. package/dist/lib/domain/interfaces/IMemoryService.d.ts.map +1 -1
  46. package/dist/lib/domain/interfaces/INlCurationService.d.ts +75 -0
  47. package/dist/lib/domain/interfaces/INlCurationService.d.ts.map +1 -0
  48. package/dist/lib/domain/interfaces/INlCurationService.js +31 -0
  49. package/dist/lib/domain/interfaces/INlCurationService.js.map +1 -0
  50. package/dist/lib/domain/interfaces/IPreferenceStore.d.ts +46 -0
  51. package/dist/lib/domain/interfaces/IPreferenceStore.d.ts.map +1 -0
  52. package/dist/lib/domain/interfaces/IPreferenceStore.js +11 -0
  53. package/dist/lib/domain/interfaces/IPreferenceStore.js.map +1 -0
  54. package/dist/lib/domain/interfaces/IRecursionService.d.ts +10 -6
  55. package/dist/lib/domain/interfaces/IRecursionService.d.ts.map +1 -1
  56. package/dist/lib/domain/interfaces/ISummarizationService.d.ts +52 -0
  57. package/dist/lib/domain/interfaces/ISummarizationService.d.ts.map +1 -0
  58. package/dist/lib/domain/interfaces/ISummarizationService.js +11 -0
  59. package/dist/lib/domain/interfaces/ISummarizationService.js.map +1 -0
  60. package/dist/lib/domain/interfaces/ITaskTypeDetector.d.ts +34 -0
  61. package/dist/lib/domain/interfaces/ITaskTypeDetector.d.ts.map +1 -0
  62. package/dist/lib/domain/interfaces/ITaskTypeDetector.js +9 -0
  63. package/dist/lib/domain/interfaces/ITaskTypeDetector.js.map +1 -0
  64. package/dist/lib/domain/interfaces/ITranscriptEnricher.d.ts +68 -0
  65. package/dist/lib/domain/interfaces/ITranscriptEnricher.d.ts.map +1 -0
  66. package/dist/lib/domain/interfaces/ITranscriptEnricher.js +32 -0
  67. package/dist/lib/domain/interfaces/ITranscriptEnricher.js.map +1 -0
  68. package/dist/lib/domain/interfaces/IWorkSummary.d.ts +64 -0
  69. package/dist/lib/domain/interfaces/IWorkSummary.d.ts.map +1 -0
  70. package/dist/lib/domain/interfaces/IWorkSummary.js +13 -0
  71. package/dist/lib/domain/interfaces/IWorkSummary.js.map +1 -0
  72. package/dist/lib/domain/interfaces/dal/IMemoryRelationshipRepository.d.ts +46 -0
  73. package/dist/lib/domain/interfaces/dal/IMemoryRelationshipRepository.d.ts.map +1 -0
  74. package/dist/lib/domain/interfaces/dal/IMemoryRelationshipRepository.js +9 -0
  75. package/dist/lib/domain/interfaces/dal/IMemoryRelationshipRepository.js.map +1 -0
  76. package/dist/lib/domain/interfaces/dal/IMemoryRepository.d.ts +62 -1
  77. package/dist/lib/domain/interfaces/dal/IMemoryRepository.d.ts.map +1 -1
  78. package/dist/lib/domain/interfaces/dal/index.d.ts +3 -2
  79. package/dist/lib/domain/interfaces/dal/index.d.ts.map +1 -1
  80. package/dist/lib/domain/interfaces/dal/index.js.map +1 -1
  81. package/dist/lib/domain/interfaces/dal/types.d.ts +37 -0
  82. package/dist/lib/domain/interfaces/dal/types.d.ts.map +1 -1
  83. package/dist/lib/domain/interfaces/dal/types.js.map +1 -1
  84. package/dist/lib/domain/interfaces/index.d.ts +15 -1
  85. package/dist/lib/domain/interfaces/index.d.ts.map +1 -1
  86. package/dist/lib/domain/interfaces/index.js +21 -1
  87. package/dist/lib/domain/interfaces/index.js.map +1 -1
  88. package/dist/lib/domain/interfaces/types/ICapturedWork.d.ts +3 -0
  89. package/dist/lib/domain/interfaces/types/ICapturedWork.d.ts.map +1 -1
  90. package/dist/lib/domain/interfaces/types/ICapturedWork.js.map +1 -1
  91. package/dist/lib/domain/interfaces/types/IMemoryLifecycle.d.ts +56 -0
  92. package/dist/lib/domain/interfaces/types/IMemoryLifecycle.d.ts.map +1 -0
  93. package/dist/lib/domain/interfaces/types/IMemoryLifecycle.js +94 -0
  94. package/dist/lib/domain/interfaces/types/IMemoryLifecycle.js.map +1 -0
  95. package/dist/lib/domain/interfaces/types/IMemoryQuality.d.ts +113 -0
  96. package/dist/lib/domain/interfaces/types/IMemoryQuality.d.ts.map +1 -0
  97. package/dist/lib/domain/interfaces/types/IMemoryQuality.js +195 -0
  98. package/dist/lib/domain/interfaces/types/IMemoryQuality.js.map +1 -0
  99. package/dist/lib/domain/interfaces/types/IMemoryRelationship.d.ts +49 -0
  100. package/dist/lib/domain/interfaces/types/IMemoryRelationship.d.ts.map +1 -0
  101. package/dist/lib/domain/interfaces/types/IMemoryRelationship.js +62 -0
  102. package/dist/lib/domain/interfaces/types/IMemoryRelationship.js.map +1 -0
  103. package/dist/lib/domain/interfaces/types/ITaskType.d.ts +59 -0
  104. package/dist/lib/domain/interfaces/types/ITaskType.d.ts.map +1 -0
  105. package/dist/lib/domain/interfaces/types/ITaskType.js +104 -0
  106. package/dist/lib/domain/interfaces/types/ITaskType.js.map +1 -0
  107. package/dist/lib/domain/interfaces/types/index.d.ts +4 -0
  108. package/dist/lib/domain/interfaces/types/index.d.ts.map +1 -1
  109. package/dist/lib/domain/interfaces/types/index.js +33 -1
  110. package/dist/lib/domain/interfaces/types/index.js.map +1 -1
  111. package/dist/lib/domain/utils/deduplication.d.ts +38 -0
  112. package/dist/lib/domain/utils/deduplication.d.ts.map +1 -0
  113. package/dist/lib/domain/utils/deduplication.js +225 -0
  114. package/dist/lib/domain/utils/deduplication.js.map +1 -0
  115. package/dist/lib/domain/utils/index.d.ts +1 -0
  116. package/dist/lib/domain/utils/index.d.ts.map +1 -1
  117. package/dist/lib/domain/utils/index.js +6 -1
  118. package/dist/lib/domain/utils/index.js.map +1 -1
  119. package/dist/lib/infrastructure/dal/repositories/mcp/McpMemoryRepository.d.ts +12 -2
  120. package/dist/lib/infrastructure/dal/repositories/mcp/McpMemoryRepository.d.ts.map +1 -1
  121. package/dist/lib/infrastructure/dal/repositories/mcp/McpMemoryRepository.js +14 -0
  122. package/dist/lib/infrastructure/dal/repositories/mcp/McpMemoryRepository.js.map +1 -1
  123. package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jMemoryRepository.d.ts +25 -3
  124. package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jMemoryRepository.d.ts.map +1 -1
  125. package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jMemoryRepository.js +156 -1
  126. package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jMemoryRepository.js.map +1 -1
  127. package/dist/lib/infrastructure/di/bootstrap.d.ts.map +1 -1
  128. package/dist/lib/infrastructure/di/bootstrap.js +92 -2
  129. package/dist/lib/infrastructure/di/bootstrap.js.map +1 -1
  130. package/dist/lib/infrastructure/di/tokens.d.ts +24 -0
  131. package/dist/lib/infrastructure/di/tokens.d.ts.map +1 -1
  132. package/dist/lib/infrastructure/di/tokens.js +12 -0
  133. package/dist/lib/infrastructure/di/tokens.js.map +1 -1
  134. package/dist/lib/infrastructure/services/ConsolidationService.d.ts +21 -0
  135. package/dist/lib/infrastructure/services/ConsolidationService.d.ts.map +1 -0
  136. package/dist/lib/infrastructure/services/ConsolidationService.js +134 -0
  137. package/dist/lib/infrastructure/services/ConsolidationService.js.map +1 -0
  138. package/dist/lib/infrastructure/services/CurationService.d.ts +28 -0
  139. package/dist/lib/infrastructure/services/CurationService.d.ts.map +1 -0
  140. package/dist/lib/infrastructure/services/CurationService.js +112 -0
  141. package/dist/lib/infrastructure/services/CurationService.js.map +1 -0
  142. package/dist/lib/infrastructure/services/DeduplicationService.d.ts +21 -0
  143. package/dist/lib/infrastructure/services/DeduplicationService.d.ts.map +1 -0
  144. package/dist/lib/infrastructure/services/DeduplicationService.js +111 -0
  145. package/dist/lib/infrastructure/services/DeduplicationService.js.map +1 -0
  146. package/dist/lib/infrastructure/services/LlmConfigService.d.ts +19 -0
  147. package/dist/lib/infrastructure/services/LlmConfigService.d.ts.map +1 -0
  148. package/dist/lib/infrastructure/services/LlmConfigService.js +161 -0
  149. package/dist/lib/infrastructure/services/LlmConfigService.js.map +1 -0
  150. package/dist/lib/infrastructure/services/LlmDeduplicationEnhancer.d.ts +47 -0
  151. package/dist/lib/infrastructure/services/LlmDeduplicationEnhancer.d.ts.map +1 -0
  152. package/dist/lib/infrastructure/services/LlmDeduplicationEnhancer.js +176 -0
  153. package/dist/lib/infrastructure/services/LlmDeduplicationEnhancer.js.map +1 -0
  154. package/dist/lib/infrastructure/services/LlmGuard.d.ts +29 -0
  155. package/dist/lib/infrastructure/services/LlmGuard.d.ts.map +1 -0
  156. package/dist/lib/infrastructure/services/LlmGuard.js +92 -0
  157. package/dist/lib/infrastructure/services/LlmGuard.js.map +1 -0
  158. package/dist/lib/infrastructure/services/LlmService.d.ts +19 -0
  159. package/dist/lib/infrastructure/services/LlmService.d.ts.map +1 -0
  160. package/dist/lib/infrastructure/services/LlmService.js +253 -0
  161. package/dist/lib/infrastructure/services/LlmService.js.map +1 -0
  162. package/dist/lib/infrastructure/services/LlmUsageTracker.d.ts +25 -0
  163. package/dist/lib/infrastructure/services/LlmUsageTracker.d.ts.map +1 -0
  164. package/dist/lib/infrastructure/services/LlmUsageTracker.js +130 -0
  165. package/dist/lib/infrastructure/services/LlmUsageTracker.js.map +1 -0
  166. package/dist/lib/infrastructure/services/MemoryService.d.ts +29 -2
  167. package/dist/lib/infrastructure/services/MemoryService.d.ts.map +1 -1
  168. package/dist/lib/infrastructure/services/MemoryService.js +93 -0
  169. package/dist/lib/infrastructure/services/MemoryService.js.map +1 -1
  170. package/dist/lib/infrastructure/services/NlCurationService.d.ts +29 -0
  171. package/dist/lib/infrastructure/services/NlCurationService.d.ts.map +1 -0
  172. package/dist/lib/infrastructure/services/NlCurationService.js +276 -0
  173. package/dist/lib/infrastructure/services/NlCurationService.js.map +1 -0
  174. package/dist/lib/infrastructure/services/PreferenceStore.d.ts +19 -0
  175. package/dist/lib/infrastructure/services/PreferenceStore.d.ts.map +1 -0
  176. package/dist/lib/infrastructure/services/PreferenceStore.js +109 -0
  177. package/dist/lib/infrastructure/services/PreferenceStore.js.map +1 -0
  178. package/dist/lib/infrastructure/services/SessionCaptureService.d.ts +60 -19
  179. package/dist/lib/infrastructure/services/SessionCaptureService.d.ts.map +1 -1
  180. package/dist/lib/infrastructure/services/SessionCaptureService.js +474 -51
  181. package/dist/lib/infrastructure/services/SessionCaptureService.js.map +1 -1
  182. package/dist/lib/infrastructure/services/SummarizationService.d.ts +21 -0
  183. package/dist/lib/infrastructure/services/SummarizationService.d.ts.map +1 -0
  184. package/dist/lib/infrastructure/services/SummarizationService.js +132 -0
  185. package/dist/lib/infrastructure/services/SummarizationService.js.map +1 -0
  186. package/dist/lib/infrastructure/services/TranscriptEnricher.d.ts +23 -0
  187. package/dist/lib/infrastructure/services/TranscriptEnricher.d.ts.map +1 -0
  188. package/dist/lib/infrastructure/services/TranscriptEnricher.js +170 -0
  189. package/dist/lib/infrastructure/services/TranscriptEnricher.js.map +1 -0
  190. package/dist/lib/infrastructure/services/index.d.ts +12 -0
  191. package/dist/lib/infrastructure/services/index.d.ts.map +1 -1
  192. package/dist/lib/infrastructure/services/index.js +31 -1
  193. package/dist/lib/infrastructure/services/index.js.map +1 -1
  194. package/dist/lib/infrastructure/services/prompts/curation.d.ts +22 -0
  195. package/dist/lib/infrastructure/services/prompts/curation.d.ts.map +1 -0
  196. package/dist/lib/infrastructure/services/prompts/curation.js +73 -0
  197. package/dist/lib/infrastructure/services/prompts/curation.js.map +1 -0
  198. package/dist/lib/infrastructure/services/prompts/deduplication.d.ts +31 -0
  199. package/dist/lib/infrastructure/services/prompts/deduplication.d.ts.map +1 -0
  200. package/dist/lib/infrastructure/services/prompts/deduplication.js +52 -0
  201. package/dist/lib/infrastructure/services/prompts/deduplication.js.map +1 -0
  202. package/dist/lib/infrastructure/services/prompts/extraction.d.ts +27 -0
  203. package/dist/lib/infrastructure/services/prompts/extraction.d.ts.map +1 -0
  204. package/dist/lib/infrastructure/services/prompts/extraction.js +94 -0
  205. package/dist/lib/infrastructure/services/prompts/extraction.js.map +1 -0
  206. package/dist/lib/infrastructure/services/prompts/summarization.d.ts +25 -0
  207. package/dist/lib/infrastructure/services/prompts/summarization.d.ts.map +1 -0
  208. package/dist/lib/infrastructure/services/prompts/summarization.js +60 -0
  209. package/dist/lib/infrastructure/services/prompts/summarization.js.map +1 -0
  210. package/dist/lib/skills/common/type-mappings.d.ts.map +1 -1
  211. package/dist/lib/skills/common/type-mappings.js +5 -0
  212. package/dist/lib/skills/common/type-mappings.js.map +1 -1
  213. package/dist/lib/skills/memory/memory.d.ts +8 -2
  214. package/dist/lib/skills/memory/memory.d.ts.map +1 -1
  215. package/dist/lib/skills/memory/memory.js +27 -3
  216. package/dist/lib/skills/memory/memory.js.map +1 -1
  217. package/dist/lib/skills/shared/clients/Neo4jClient.d.ts.map +1 -1
  218. package/dist/lib/skills/shared/clients/Neo4jClient.js +75 -30
  219. package/dist/lib/skills/shared/clients/Neo4jClient.js.map +1 -1
  220. package/dist/lib/skills/shared/clients/interfaces/INeo4jClient.d.ts +16 -0
  221. package/dist/lib/skills/shared/clients/interfaces/INeo4jClient.d.ts.map +1 -1
  222. package/dist/lib/skills/shared/services/MemoryCliService.d.ts +28 -2
  223. package/dist/lib/skills/shared/services/MemoryCliService.d.ts.map +1 -1
  224. package/dist/lib/skills/shared/services/MemoryCliService.js +112 -5
  225. package/dist/lib/skills/shared/services/MemoryCliService.js.map +1 -1
  226. package/dist/lib/skills/shared/services/MemoryService.d.ts.map +1 -1
  227. package/dist/lib/skills/shared/services/MemoryService.js +410 -1
  228. package/dist/lib/skills/shared/services/MemoryService.js.map +1 -1
  229. package/dist/lib/skills/shared/services/index.d.ts +1 -1
  230. package/dist/lib/skills/shared/services/index.d.ts.map +1 -1
  231. package/dist/lib/skills/shared/services/index.js +2 -1
  232. package/dist/lib/skills/shared/services/index.js.map +1 -1
  233. package/dist/lib/skills/shared/services/interfaces/IMemoryService.d.ts +148 -0
  234. package/dist/lib/skills/shared/services/interfaces/IMemoryService.d.ts.map +1 -1
  235. package/dist/lib/skills/shared/services/interfaces/IMemoryService.js +0 -4
  236. package/dist/lib/skills/shared/services/interfaces/IMemoryService.js.map +1 -1
  237. package/dist/opencode/lisa.js +3904 -507
  238. package/dist/package.json +16 -16
  239. package/dist/project/.lisa/skills/git/SKILL.md +4 -13
  240. package/dist/project/.lisa/skills/init-review/SKILL.md +1 -1
  241. package/dist/project/.lisa/skills/jira/SKILL.md +1 -1
  242. package/dist/project/.lisa/skills/lisa/SKILL.md +1 -1
  243. package/dist/project/.lisa/skills/memory/SKILL.md +1 -2
  244. package/dist/project/.lisa/skills/tasks/SKILL.md +3 -4
  245. package/package.json +1 -1
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ /**
3
+ * LLM-specific error classes.
4
+ *
5
+ * Part of Phase 6A: LLM Provider Abstraction Layer.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.LlmBudgetExceededError = exports.LlmFeatureDisabledError = exports.LlmConfigError = exports.LlmProviderError = exports.LlmDisabledError = void 0;
9
+ const LisaError_1 = require("./LisaError");
10
+ /**
11
+ * Error thrown when LLM is disabled but an LLM operation is requested.
12
+ */
13
+ class LlmDisabledError extends LisaError_1.LisaError {
14
+ constructor(message) {
15
+ super(message || 'LLM features are disabled. Enable with: lisa llm config --enable', 'LLM_DISABLED');
16
+ this.name = 'LlmDisabledError';
17
+ }
18
+ }
19
+ exports.LlmDisabledError = LlmDisabledError;
20
+ /**
21
+ * Error thrown when the LLM provider returns an error.
22
+ */
23
+ class LlmProviderError extends LisaError_1.LisaError {
24
+ constructor(message, statusCode, data) {
25
+ super(message, 'LLM_PROVIDER_ERROR', { ...data, statusCode });
26
+ this.statusCode = statusCode;
27
+ this.name = 'LlmProviderError';
28
+ }
29
+ }
30
+ exports.LlmProviderError = LlmProviderError;
31
+ /**
32
+ * Error thrown for invalid LLM configuration.
33
+ */
34
+ class LlmConfigError extends LisaError_1.LisaError {
35
+ constructor(message, data) {
36
+ super(message, 'LLM_CONFIG_ERROR', data);
37
+ this.name = 'LlmConfigError';
38
+ }
39
+ }
40
+ exports.LlmConfigError = LlmConfigError;
41
+ /**
42
+ * Error thrown when a specific LLM feature is disabled.
43
+ */
44
+ class LlmFeatureDisabledError extends LisaError_1.LisaError {
45
+ constructor(feature, data) {
46
+ super(`LLM feature '${feature}' is disabled. Enable with: lisa llm features --enable ${feature}`, 'LLM_FEATURE_DISABLED', { ...data, feature });
47
+ this.feature = feature;
48
+ this.name = 'LlmFeatureDisabledError';
49
+ }
50
+ }
51
+ exports.LlmFeatureDisabledError = LlmFeatureDisabledError;
52
+ /**
53
+ * Error thrown when the monthly LLM budget has been exceeded.
54
+ */
55
+ class LlmBudgetExceededError extends LisaError_1.LisaError {
56
+ constructor(currentCost, budgetLimit, data) {
57
+ super(`Monthly LLM budget exceeded: $${currentCost.toFixed(4)} / $${budgetLimit.toFixed(2)} limit`, 'LLM_BUDGET_EXCEEDED', { ...data, currentCost, budgetLimit });
58
+ this.currentCost = currentCost;
59
+ this.budgetLimit = budgetLimit;
60
+ this.name = 'LlmBudgetExceededError';
61
+ }
62
+ }
63
+ exports.LlmBudgetExceededError = LlmBudgetExceededError;
64
+ //# sourceMappingURL=LlmErrors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LlmErrors.js","sourceRoot":"","sources":["../../../../src/lib/domain/errors/LlmErrors.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,2CAAwC;AAExC;;GAEG;AACH,MAAa,gBAAiB,SAAQ,qBAAS;IAC7C,YAAY,OAAgB;QAC1B,KAAK,CACH,OAAO,IAAI,kEAAkE,EAC7E,cAAc,CACf,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AARD,4CAQC;AAED;;GAEG;AACH,MAAa,gBAAiB,SAAQ,qBAAS;IAC7C,YACE,OAAe,EACC,UAAmB,EACnC,IAA8B;QAE9B,KAAK,CAAC,OAAO,EAAE,oBAAoB,EAAE,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QAH9C,eAAU,GAAV,UAAU,CAAS;QAInC,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AATD,4CASC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,qBAAS;IAC3C,YAAY,OAAe,EAAE,IAA8B;QACzD,KAAK,CAAC,OAAO,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AALD,wCAKC;AAED;;GAEG;AACH,MAAa,uBAAwB,SAAQ,qBAAS;IACpD,YACkB,OAAe,EAC/B,IAA8B;QAE9B,KAAK,CACH,gBAAgB,OAAO,0DAA0D,OAAO,EAAE,EAC1F,sBAAsB,EACtB,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CACrB,CAAC;QAPc,YAAO,GAAP,OAAO,CAAQ;QAQ/B,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF;AAZD,0DAYC;AAED;;GAEG;AACH,MAAa,sBAAuB,SAAQ,qBAAS;IACnD,YACkB,WAAmB,EACnB,WAAmB,EACnC,IAA8B;QAE9B,KAAK,CACH,iCAAiC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAC5F,qBAAqB,EACrB,EAAE,GAAG,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,CACtC,CAAC;QARc,gBAAW,GAAX,WAAW,CAAQ;QACnB,gBAAW,GAAX,WAAW,CAAQ;QAQnC,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AAbD,wDAaC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Consolidation Service Interface.
3
+ *
4
+ * Defines the contract for consolidating duplicate or related memory facts.
5
+ * Supports merging facts into a single retained fact, archiving duplicates,
6
+ * or keeping all facts unchanged.
7
+ *
8
+ * Part of Phase 5C: Curation & Compaction.
9
+ */
10
+ /**
11
+ * Action to take when consolidating facts.
12
+ */
13
+ export type ConsolidationAction = 'merge' | 'archive-duplicates' | 'keep-all';
14
+ /**
15
+ * All valid consolidation actions.
16
+ */
17
+ export declare const CONSOLIDATION_ACTION_VALUES: readonly ConsolidationAction[];
18
+ /**
19
+ * Result of a consolidation operation.
20
+ */
21
+ export interface IConsolidationResult {
22
+ /** The action that was performed */
23
+ readonly action: ConsolidationAction;
24
+ /** UUID of the retained (or newly created) fact */
25
+ readonly retainedUuid: string;
26
+ /** UUIDs of facts that were archived (expired) */
27
+ readonly archivedUuids: readonly string[];
28
+ /** Number of supersedes relationships created */
29
+ readonly relationshipsCreated: number;
30
+ }
31
+ /**
32
+ * Options for consolidation.
33
+ */
34
+ export interface IConsolidationOptions {
35
+ /** UUID of the fact to keep (for archive-duplicates). Defaults to newest. */
36
+ retainUuid?: string;
37
+ /** Merged text for the new fact (for merge action). */
38
+ mergedText?: string;
39
+ }
40
+ /**
41
+ * Consolidation service interface.
42
+ *
43
+ * Provides operations for consolidating duplicate or related facts.
44
+ */
45
+ export interface IConsolidationService {
46
+ /**
47
+ * Consolidate a set of facts.
48
+ *
49
+ * Actions:
50
+ * - `merge`: Create new fact with mergedText, expire all originals,
51
+ * create supersedes relationships from new fact to each original
52
+ * - `archive-duplicates`: Keep the fact with retainUuid (or newest),
53
+ * expire the rest, create supersedes relationships
54
+ * - `keep-all`: No-op, return empty result
55
+ *
56
+ * @param groupId - Group ID the facts belong to
57
+ * @param factUuids - UUIDs of facts to consolidate (minimum 2)
58
+ * @param action - Consolidation action to perform
59
+ * @param options - Additional options (retainUuid, mergedText)
60
+ * @throws Error if fewer than 2 UUIDs provided
61
+ * @throws Error if retainUuid is not in the provided UUIDs
62
+ */
63
+ consolidate(groupId: string, factUuids: readonly string[], action: ConsolidationAction, options?: IConsolidationOptions): Promise<IConsolidationResult>;
64
+ }
65
+ //# sourceMappingURL=IConsolidationService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IConsolidationService.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/IConsolidationService.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,oBAAoB,GAAG,UAAU,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,mBAAmB,EAI5D,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,oCAAoC;IACpC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC,mDAAmD;IACnD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,kDAAkD;IAClD,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,iDAAiD;IACjD,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;;;;;;;;;OAgBG;IACH,WAAW,CACT,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAClC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /**
3
+ * Consolidation Service Interface.
4
+ *
5
+ * Defines the contract for consolidating duplicate or related memory facts.
6
+ * Supports merging facts into a single retained fact, archiving duplicates,
7
+ * or keeping all facts unchanged.
8
+ *
9
+ * Part of Phase 5C: Curation & Compaction.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CONSOLIDATION_ACTION_VALUES = void 0;
13
+ /**
14
+ * All valid consolidation actions.
15
+ */
16
+ exports.CONSOLIDATION_ACTION_VALUES = [
17
+ 'merge',
18
+ 'archive-duplicates',
19
+ 'keep-all',
20
+ ];
21
+ //# sourceMappingURL=IConsolidationService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IConsolidationService.js","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/IConsolidationService.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAOH;;GAEG;AACU,QAAA,2BAA2B,GAAmC;IACzE,OAAO;IACP,oBAAoB;IACpB,UAAU;CACF,CAAC"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Curation Service Interface.
3
+ *
4
+ * Defines the contract for curating memory facts — marking them as
5
+ * authoritative, draft, deprecated, or needing review. Also provides
6
+ * quality scoring to rank facts by reliability.
7
+ *
8
+ * Part of Phase 5C: Curation & Compaction.
9
+ */
10
+ import type { IMemoryItem } from './types';
11
+ /**
12
+ * Curation mark for a memory fact.
13
+ */
14
+ export type CurationMark = 'authoritative' | 'draft' | 'deprecated' | 'needs-review';
15
+ /**
16
+ * All valid curation marks.
17
+ */
18
+ export declare const CURATION_MARK_VALUES: readonly CurationMark[];
19
+ /**
20
+ * Check if a string is a valid CurationMark.
21
+ *
22
+ * @param value - The string to check
23
+ * @returns true if valid curation mark
24
+ */
25
+ export declare function isValidCurationMark(value: string): value is CurationMark;
26
+ /**
27
+ * Resolve a curation mark to its corresponding tag string.
28
+ *
29
+ * @param mark - The curation mark
30
+ * @returns Tag string, e.g. 'curated:authoritative'
31
+ */
32
+ export declare function resolveCurationTag(mark: CurationMark): string;
33
+ /**
34
+ * Parse the curation mark from a tag array.
35
+ * Looks for tags matching 'curated:<mark>'.
36
+ *
37
+ * @param tags - Array of tags to search
38
+ * @returns The curation mark found, or null if none present
39
+ */
40
+ export declare function parseCurationTag(tags: readonly string[]): CurationMark | null;
41
+ /**
42
+ * Curation service interface.
43
+ *
44
+ * Provides operations for curating facts (marking quality)
45
+ * and computing quality scores for ranking.
46
+ */
47
+ export interface ICurationService {
48
+ /**
49
+ * Mark a fact with a curation status.
50
+ *
51
+ * Side effects by mark:
52
+ * - `deprecated`: Also expires the fact
53
+ * - `authoritative`: Promotes confidence to `verified`
54
+ *
55
+ * @param groupId - Group ID the fact belongs to
56
+ * @param uuid - UUID of the fact to mark
57
+ * @param mark - The curation mark to apply
58
+ */
59
+ markFact(groupId: string, uuid: string, mark: CurationMark): Promise<void>;
60
+ /**
61
+ * Compute a quality score for a memory item.
62
+ *
63
+ * Formula: confidenceScore × sourceWeight × recencyBonus
64
+ * - confidenceScore: from CONFIDENCE_SCORES (0.1–1.0)
65
+ * - sourceWeight: varies by source type (0.3–1.0)
66
+ * - recencyBonus: 1.0 for <7 days, decays linearly to 0.5 at 90 days
67
+ *
68
+ * @param item - The memory item to score
69
+ * @returns Quality score between 0.0 and 1.0
70
+ */
71
+ computeQualityScore(item: IMemoryItem): number;
72
+ /**
73
+ * Sort memory items by quality score descending.
74
+ * Returns a new sorted array (immutable).
75
+ *
76
+ * @param items - Items to rank
77
+ * @returns New array sorted by quality score descending
78
+ */
79
+ rankByQuality(items: readonly IMemoryItem[]): readonly IMemoryItem[];
80
+ }
81
+ //# sourceMappingURL=ICurationService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ICurationService.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/ICurationService.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,OAAO,GAAG,YAAY,GAAG,cAAc,CAAC;AAErF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,YAAY,EAK9C,CAAC;AAOX;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,YAAY,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAE7D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,YAAY,GAAG,IAAI,CAU7E;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;OAUG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC;IAE/C;;;;;;OAMG;IACH,aAAa,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,SAAS,WAAW,EAAE,CAAC;CACtE"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ /**
3
+ * Curation Service Interface.
4
+ *
5
+ * Defines the contract for curating memory facts — marking them as
6
+ * authoritative, draft, deprecated, or needing review. Also provides
7
+ * quality scoring to rank facts by reliability.
8
+ *
9
+ * Part of Phase 5C: Curation & Compaction.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CURATION_MARK_VALUES = void 0;
13
+ exports.isValidCurationMark = isValidCurationMark;
14
+ exports.resolveCurationTag = resolveCurationTag;
15
+ exports.parseCurationTag = parseCurationTag;
16
+ /**
17
+ * All valid curation marks.
18
+ */
19
+ exports.CURATION_MARK_VALUES = [
20
+ 'authoritative',
21
+ 'draft',
22
+ 'deprecated',
23
+ 'needs-review',
24
+ ];
25
+ /**
26
+ * Tag prefix used for curation tags.
27
+ */
28
+ const CURATION_TAG_PREFIX = 'curated:';
29
+ /**
30
+ * Check if a string is a valid CurationMark.
31
+ *
32
+ * @param value - The string to check
33
+ * @returns true if valid curation mark
34
+ */
35
+ function isValidCurationMark(value) {
36
+ return exports.CURATION_MARK_VALUES.includes(value);
37
+ }
38
+ /**
39
+ * Resolve a curation mark to its corresponding tag string.
40
+ *
41
+ * @param mark - The curation mark
42
+ * @returns Tag string, e.g. 'curated:authoritative'
43
+ */
44
+ function resolveCurationTag(mark) {
45
+ return `${CURATION_TAG_PREFIX}${mark}`;
46
+ }
47
+ /**
48
+ * Parse the curation mark from a tag array.
49
+ * Looks for tags matching 'curated:<mark>'.
50
+ *
51
+ * @param tags - Array of tags to search
52
+ * @returns The curation mark found, or null if none present
53
+ */
54
+ function parseCurationTag(tags) {
55
+ for (const tag of tags) {
56
+ if (tag.startsWith(CURATION_TAG_PREFIX)) {
57
+ const mark = tag.slice(CURATION_TAG_PREFIX.length);
58
+ if (exports.CURATION_MARK_VALUES.includes(mark)) {
59
+ return mark;
60
+ }
61
+ }
62
+ }
63
+ return null;
64
+ }
65
+ //# sourceMappingURL=ICurationService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ICurationService.js","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/ICurationService.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AA8BH,kDAEC;AAQD,gDAEC;AASD,4CAUC;AApDD;;GAEG;AACU,QAAA,oBAAoB,GAA4B;IAC3D,eAAe;IACf,OAAO;IACP,YAAY;IACZ,cAAc;CACN,CAAC;AAEX;;GAEG;AACH,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAEvC;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,KAAa;IAC/C,OAAO,4BAAoB,CAAC,QAAQ,CAAC,KAAqB,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,IAAkB;IACnD,OAAO,GAAG,mBAAmB,GAAG,IAAI,EAAE,CAAC;AACzC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,IAAuB;IACtD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,GAAG,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAiB,CAAC;YACnE,IAAI,4BAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxC,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Deduplication Service Interfaces.
3
+ *
4
+ * Domain contracts for detecting duplicate memory facts.
5
+ * Detection only — consolidation (acting on duplicates) is separate.
6
+ */
7
+ import type { IMemoryItem } from './types';
8
+ /**
9
+ * Reason why facts were grouped as duplicates.
10
+ */
11
+ export type DuplicateReason = 'exact-match' | 'tag-overlap' | 'similar-content' | 'llm-semantic';
12
+ /**
13
+ * A group of duplicate facts.
14
+ */
15
+ export interface IDuplicateGroup {
16
+ /** Why these facts were grouped as duplicates */
17
+ readonly reason: DuplicateReason;
18
+ /** The duplicate facts */
19
+ readonly facts: readonly IMemoryItem[];
20
+ /** Similarity score between group members (0.0–1.0) */
21
+ readonly similarity: number;
22
+ /** LLM-suggested merged text for the group (only for llm-semantic groups) */
23
+ readonly suggestedMerge?: string;
24
+ }
25
+ /**
26
+ * Result of a deduplication scan.
27
+ */
28
+ export interface IDeduplicationResult {
29
+ /** Total facts scanned */
30
+ readonly totalFactsScanned: number;
31
+ /** Groups of detected duplicates */
32
+ readonly duplicateGroups: readonly IDuplicateGroup[];
33
+ /** Total number of duplicate groups found */
34
+ readonly totalDuplicates: number;
35
+ }
36
+ /**
37
+ * Options for deduplication detection.
38
+ */
39
+ export interface IDeduplicationOptions {
40
+ /** Minimum Jaccard similarity threshold for similar-content detection (default: 0.6) */
41
+ readonly minSimilarity?: number;
42
+ /** Maximum number of duplicate groups to return (default: 10) */
43
+ readonly limit?: number;
44
+ /** Only scan facts created after this date */
45
+ readonly since?: Date;
46
+ /** Enable LLM-assisted semantic deduplication as a 4th pass (default: false) */
47
+ readonly aiAssist?: boolean;
48
+ }
49
+ /**
50
+ * Deduplication detection service.
51
+ * Detects duplicate facts without mutating them.
52
+ */
53
+ export interface IDeduplicationService {
54
+ /**
55
+ * Detect duplicate facts within a group.
56
+ *
57
+ * Three-pass detection:
58
+ * 1. Exact match — identical normalized text (similarity: 1.0)
59
+ * 2. Tag overlap — same type:* tag with 3+ shared words (similarity: 0.5–0.8)
60
+ * 3. Similar content — Jaccard similarity above threshold (similarity: configurable)
61
+ *
62
+ * @param groupId - Group ID to scan
63
+ * @param options - Detection options (threshold, limit, date filter)
64
+ */
65
+ detectDuplicates(groupId: string, options?: IDeduplicationOptions): Promise<IDeduplicationResult>;
66
+ }
67
+ //# sourceMappingURL=IDeduplicationService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDeduplicationService.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/IDeduplicationService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,aAAa,GAAG,iBAAiB,GAAG,cAAc,CAAC;AAEjG;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,0BAA0B;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IACvC,uDAAuD;IACvD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,6EAA6E;IAC7E,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,0BAA0B;IAC1B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,oCAAoC;IACpC,QAAQ,CAAC,eAAe,EAAE,SAAS,eAAe,EAAE,CAAC;IACrD,6CAA6C;IAC7C,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wFAAwF;IACxF,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,iEAAiE;IACjE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC;IACtB,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;;;OAUG;IACH,gBAAgB,CACd,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAClC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * Deduplication Service Interfaces.
4
+ *
5
+ * Domain contracts for detecting duplicate memory facts.
6
+ * Detection only — consolidation (acting on duplicates) is separate.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ //# sourceMappingURL=IDeduplicationService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDeduplicationService.js","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/IDeduplicationService.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * LLM Configuration Service Interface.
3
+ *
4
+ * Domain contract for managing LLM provider configuration.
5
+ * Configuration is persisted via PreferenceStore with env var overrides.
6
+ *
7
+ * Part of Phase 6A: LLM Provider Abstraction Layer.
8
+ */
9
+ import type { LlmProvider, ILlmConfig } from './ILlmService';
10
+ /**
11
+ * Service for reading and writing LLM configuration.
12
+ */
13
+ export interface ILlmConfigService {
14
+ /**
15
+ * Get the resolved LLM configuration.
16
+ * Merge order: defaults <- preferences <- environment variables.
17
+ */
18
+ getConfig(): Promise<ILlmConfig>;
19
+ /** Set the LLM provider. */
20
+ setProvider(provider: LlmProvider): Promise<void>;
21
+ /** Set the model name. */
22
+ setModel(model: string): Promise<void>;
23
+ /** Set a custom endpoint URL. */
24
+ setEndpoint(endpoint: string): Promise<void>;
25
+ /** Set the API key. */
26
+ setApiKey(apiKey: string): Promise<void>;
27
+ /** Enable or disable LLM features. */
28
+ setEnabled(enabled: boolean): Promise<void>;
29
+ /** Set the default max output tokens. */
30
+ setMaxTokens(maxTokens: number): Promise<void>;
31
+ /** Set the default temperature. */
32
+ setTemperature(temperature: number): Promise<void>;
33
+ /** Reset all LLM configuration to defaults (clears stored preferences). */
34
+ reset(): Promise<void>;
35
+ }
36
+ //# sourceMappingURL=ILlmConfigService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ILlmConfigService.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/ILlmConfigService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IAEjC,4BAA4B;IAC5B,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD,0BAA0B;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvC,iCAAiC;IACjC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C,uBAAuB;IACvB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC,sCAAsC;IACtC,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5C,yCAAyC;IACzC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/C,mCAAmC;IACnC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD,2EAA2E;IAC3E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * LLM Configuration Service Interface.
4
+ *
5
+ * Domain contract for managing LLM provider configuration.
6
+ * Configuration is persisted via PreferenceStore with env var overrides.
7
+ *
8
+ * Part of Phase 6A: LLM Provider Abstraction Layer.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ //# sourceMappingURL=ILlmConfigService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ILlmConfigService.js","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/ILlmConfigService.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * LLM Guard Interface.
3
+ *
4
+ * Policy decorator over ILlmService that enforces budget limits,
5
+ * per-feature toggles, and usage tracking. All LLM consumers
6
+ * should go through the guard rather than calling ILlmService directly.
7
+ *
8
+ * Part of Phase 6B: Cost/Privacy Controls.
9
+ */
10
+ import type { ILlmResponse, ILlmRequestOptions } from './ILlmService';
11
+ import type { LlmFeature } from './ILlmUsageTracker';
12
+ /**
13
+ * Guarded LLM completion service.
14
+ * Enforces budget, feature toggles, and records usage.
15
+ */
16
+ export interface ILlmGuard {
17
+ /**
18
+ * Send a completion request with policy enforcement.
19
+ *
20
+ * @param prompt - The user prompt text
21
+ * @param feature - Which LLM feature is making the request
22
+ * @param options - Optional request overrides
23
+ * @throws LlmFeatureDisabledError if the feature is toggled off
24
+ * @throws LlmBudgetExceededError if over the monthly budget
25
+ * @throws LlmDisabledError if LLM is disabled globally
26
+ * @throws LlmProviderError if the provider returns an error
27
+ */
28
+ complete(prompt: string, feature: LlmFeature, options?: ILlmRequestOptions): Promise<ILlmResponse>;
29
+ /**
30
+ * Check whether a specific LLM feature is enabled.
31
+ * Checks both the master switch and per-feature toggles.
32
+ */
33
+ isFeatureEnabled(feature: LlmFeature): Promise<boolean>;
34
+ }
35
+ //# sourceMappingURL=ILlmGuard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ILlmGuard.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/ILlmGuard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;;;;OAUG;IACH,QAAQ,CACN,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,UAAU,EACnB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,YAAY,CAAC,CAAC;IAEzB;;;OAGG;IACH,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACzD"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /**
3
+ * LLM Guard Interface.
4
+ *
5
+ * Policy decorator over ILlmService that enforces budget limits,
6
+ * per-feature toggles, and usage tracking. All LLM consumers
7
+ * should go through the guard rather than calling ILlmService directly.
8
+ *
9
+ * Part of Phase 6B: Cost/Privacy Controls.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ //# sourceMappingURL=ILlmGuard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ILlmGuard.js","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/ILlmGuard.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * LLM Service Interfaces.
3
+ *
4
+ * Domain contracts for interacting with Large Language Model providers.
5
+ * Supports multiple backends: Anthropic (Claude), OpenAI, and Ollama (local).
6
+ *
7
+ * Part of Phase 6A: LLM Provider Abstraction Layer.
8
+ */
9
+ /**
10
+ * Supported LLM providers.
11
+ */
12
+ export type LlmProvider = 'anthropic' | 'openai' | 'ollama';
13
+ /**
14
+ * All valid LLM provider values.
15
+ */
16
+ export declare const LLM_PROVIDER_VALUES: readonly LlmProvider[];
17
+ /**
18
+ * Type guard for LlmProvider.
19
+ */
20
+ export declare function isValidLlmProvider(value: string): value is LlmProvider;
21
+ /**
22
+ * LLM configuration.
23
+ */
24
+ export interface ILlmConfig {
25
+ readonly provider: LlmProvider;
26
+ readonly model: string;
27
+ readonly endpoint?: string;
28
+ readonly apiKey?: string;
29
+ readonly enabled: boolean;
30
+ readonly maxTokens: number;
31
+ readonly temperature: number;
32
+ }
33
+ /**
34
+ * Default LLM configuration.
35
+ */
36
+ export declare function getDefaultLlmConfig(): ILlmConfig;
37
+ /**
38
+ * Token usage from an LLM call.
39
+ */
40
+ export interface ILlmUsage {
41
+ readonly inputTokens: number;
42
+ readonly outputTokens: number;
43
+ readonly totalTokens: number;
44
+ }
45
+ /**
46
+ * Response from an LLM call.
47
+ */
48
+ export interface ILlmResponse {
49
+ readonly text: string;
50
+ readonly usage: ILlmUsage;
51
+ readonly model: string;
52
+ readonly provider: LlmProvider;
53
+ }
54
+ /**
55
+ * Options for an LLM completion request.
56
+ */
57
+ export interface ILlmRequestOptions {
58
+ readonly maxTokens?: number;
59
+ readonly temperature?: number;
60
+ readonly systemPrompt?: string;
61
+ }
62
+ /**
63
+ * LLM completion service.
64
+ * Sends prompts to an LLM provider and returns structured responses.
65
+ */
66
+ export interface ILlmService {
67
+ /**
68
+ * Send a completion request to the configured LLM provider.
69
+ *
70
+ * @param prompt - The user prompt text
71
+ * @param options - Optional request overrides (tokens, temperature, system prompt)
72
+ * @throws LlmDisabledError if LLM is disabled
73
+ * @throws LlmConfigError if configuration is invalid (e.g. missing API key)
74
+ * @throws LlmProviderError if the provider returns an error
75
+ */
76
+ complete(prompt: string, options?: ILlmRequestOptions): Promise<ILlmResponse>;
77
+ /**
78
+ * Check whether the LLM provider is available and configured.
79
+ * Returns false if disabled or provider unreachable.
80
+ */
81
+ isAvailable(): Promise<boolean>;
82
+ /**
83
+ * Get the current resolved LLM configuration.
84
+ */
85
+ getConfig(): Promise<ILlmConfig>;
86
+ }
87
+ //# sourceMappingURL=ILlmService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ILlmService.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/ILlmService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,WAAW,EAI5C,CAAC;AAEX;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,WAAW,CAEtE;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,UAAU,CAQhD;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;OAQG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAE9E;;;OAGG;IACH,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAEhC;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;CAClC"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /**
3
+ * LLM Service Interfaces.
4
+ *
5
+ * Domain contracts for interacting with Large Language Model providers.
6
+ * Supports multiple backends: Anthropic (Claude), OpenAI, and Ollama (local).
7
+ *
8
+ * Part of Phase 6A: LLM Provider Abstraction Layer.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.LLM_PROVIDER_VALUES = void 0;
12
+ exports.isValidLlmProvider = isValidLlmProvider;
13
+ exports.getDefaultLlmConfig = getDefaultLlmConfig;
14
+ /**
15
+ * All valid LLM provider values.
16
+ */
17
+ exports.LLM_PROVIDER_VALUES = [
18
+ 'anthropic',
19
+ 'openai',
20
+ 'ollama',
21
+ ];
22
+ /**
23
+ * Type guard for LlmProvider.
24
+ */
25
+ function isValidLlmProvider(value) {
26
+ return exports.LLM_PROVIDER_VALUES.includes(value);
27
+ }
28
+ /**
29
+ * Default LLM configuration.
30
+ */
31
+ function getDefaultLlmConfig() {
32
+ return {
33
+ provider: 'anthropic',
34
+ model: 'claude-sonnet-4-20250514',
35
+ enabled: false,
36
+ maxTokens: 1024,
37
+ temperature: 0.3,
38
+ };
39
+ }
40
+ //# sourceMappingURL=ILlmService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ILlmService.js","sourceRoot":"","sources":["../../../../src/lib/domain/interfaces/ILlmService.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAmBH,gDAEC;AAkBD,kDAQC;AAxCD;;GAEG;AACU,QAAA,mBAAmB,GAA2B;IACzD,WAAW;IACX,QAAQ;IACR,QAAQ;CACA,CAAC;AAEX;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,OAAO,2BAAmB,CAAC,QAAQ,CAAC,KAAoB,CAAC,CAAC;AAC5D,CAAC;AAeD;;GAEG;AACH,SAAgB,mBAAmB;IACjC,OAAO;QACL,QAAQ,EAAE,WAAW;QACrB,KAAK,EAAE,0BAA0B;QACjC,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,GAAG;KACjB,CAAC;AACJ,CAAC"}