@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,94 @@
1
+ "use strict";
2
+ /**
3
+ * Memory Lifecycle Types
4
+ *
5
+ * Defines lifecycle tiers for memory facts, controlling retention and expiration.
6
+ *
7
+ * Tiers:
8
+ * - permanent: Never expires (e.g., project conventions, key decisions)
9
+ * - project: Lives for the project lifetime, no automatic expiration
10
+ * - session: Expires after 24h (e.g., session-captured work)
11
+ * - ephemeral: Expires after 1h (e.g., user prompts, transient context)
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.LIFECYCLE_DEFAULTS = exports.LIFECYCLE_VALUES = void 0;
15
+ exports.resolveLifecycleTag = resolveLifecycleTag;
16
+ exports.parseLifecycleTag = parseLifecycleTag;
17
+ exports.isValidLifecycle = isValidLifecycle;
18
+ exports.computeExpiresAt = computeExpiresAt;
19
+ /**
20
+ * All valid lifecycle values.
21
+ */
22
+ exports.LIFECYCLE_VALUES = [
23
+ 'permanent',
24
+ 'project',
25
+ 'session',
26
+ 'ephemeral',
27
+ ];
28
+ /**
29
+ * Default TTL (in milliseconds) for each lifecycle tier.
30
+ * null means no automatic expiration.
31
+ */
32
+ exports.LIFECYCLE_DEFAULTS = {
33
+ permanent: null,
34
+ project: null,
35
+ session: 24 * 60 * 60 * 1000, // 24 hours
36
+ ephemeral: 60 * 60 * 1000, // 1 hour
37
+ };
38
+ /**
39
+ * Tag prefix used for lifecycle tags.
40
+ */
41
+ const LIFECYCLE_TAG_PREFIX = 'lifecycle:';
42
+ /**
43
+ * Resolve a lifecycle tier to its corresponding tag string.
44
+ *
45
+ * @param lifecycle - The lifecycle tier
46
+ * @returns Tag string, e.g. 'lifecycle:permanent'
47
+ */
48
+ function resolveLifecycleTag(lifecycle) {
49
+ return `${LIFECYCLE_TAG_PREFIX}${lifecycle}`;
50
+ }
51
+ /**
52
+ * Parse the lifecycle tier from a tag array.
53
+ * Looks for tags matching 'lifecycle:<tier>'.
54
+ *
55
+ * @param tags - Array of tags to search
56
+ * @returns The lifecycle tier found, or 'project' as default
57
+ */
58
+ function parseLifecycleTag(tags) {
59
+ for (const tag of tags) {
60
+ if (tag.startsWith(LIFECYCLE_TAG_PREFIX)) {
61
+ const tier = tag.slice(LIFECYCLE_TAG_PREFIX.length);
62
+ if (exports.LIFECYCLE_VALUES.includes(tier)) {
63
+ return tier;
64
+ }
65
+ }
66
+ }
67
+ return 'project';
68
+ }
69
+ /**
70
+ * Check if a string is a valid MemoryLifecycle value.
71
+ *
72
+ * @param value - The string to check
73
+ * @returns true if valid lifecycle tier
74
+ */
75
+ function isValidLifecycle(value) {
76
+ return exports.LIFECYCLE_VALUES.includes(value);
77
+ }
78
+ /**
79
+ * Compute the expiration date for a lifecycle tier.
80
+ *
81
+ * @param lifecycle - The lifecycle tier
82
+ * @param ttlMs - Optional custom TTL override in milliseconds
83
+ * @param now - Optional reference time (defaults to current time)
84
+ * @returns Expiration Date, or null if the tier never expires
85
+ */
86
+ function computeExpiresAt(lifecycle, ttlMs, now) {
87
+ const ttl = ttlMs ?? exports.LIFECYCLE_DEFAULTS[lifecycle];
88
+ if (ttl === null) {
89
+ return null;
90
+ }
91
+ const referenceTime = now ?? new Date();
92
+ return new Date(referenceTime.getTime() + ttl);
93
+ }
94
+ //# sourceMappingURL=IMemoryLifecycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IMemoryLifecycle.js","sourceRoot":"","sources":["../../../../../src/lib/domain/interfaces/types/IMemoryLifecycle.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAuCH,kDAEC;AASD,8CAUC;AAQD,4CAEC;AAUD,4CAWC;AApFD;;GAEG;AACU,QAAA,gBAAgB,GAA+B;IAC1D,WAAW;IACX,SAAS;IACT,SAAS;IACT,WAAW;CACH,CAAC;AAEX;;;GAGG;AACU,QAAA,kBAAkB,GAAqD;IAClF,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAI,WAAW;IAC3C,SAAS,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAQ,SAAS;CAC3C,CAAC;AAEF;;GAEG;AACH,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAE1C;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,SAA0B;IAC5D,OAAO,GAAG,oBAAoB,GAAG,SAAS,EAAE,CAAC;AAC/C,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAAC,IAAuB;IACvD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,GAAG,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,MAAM,CAAoB,CAAC;YACvE,IAAI,wBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBACpC,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,KAAa;IAC5C,OAAO,wBAAgB,CAAC,QAAQ,CAAC,KAAwB,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAC9B,SAA0B,EAC1B,KAAc,EACd,GAAU;IAEV,MAAM,GAAG,GAAG,KAAK,IAAI,0BAAkB,CAAC,SAAS,CAAC,CAAC;IACnD,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,aAAa,GAAG,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;IACxC,OAAO,IAAI,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,CAAC;AACjD,CAAC"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Memory Quality & Source Tracking Types
3
+ *
4
+ * Defines confidence levels, source types, and helper functions for
5
+ * tracking fact provenance and quality. Follows the same tag-based
6
+ * pattern as IMemoryLifecycle.
7
+ *
8
+ * Confidence levels:
9
+ * - verified: Confirmed by user, code check, or test (1.0)
10
+ * - high: User-stated or documented (0.8)
11
+ * - medium: Auto-captured, consistent with other facts (0.5)
12
+ * - low: Inferred or from low-fidelity source (0.3)
13
+ * - uncertain: Needs verification (0.1)
14
+ *
15
+ * Source types:
16
+ * - user-explicit: User directly stated via `lisa memory add`
17
+ * - session-capture: Extracted from session stop handler
18
+ * - prompt-capture: Captured from user prompt submit
19
+ * - code-analysis: Inferred from code inspection
20
+ * - auto-inferred: System-generated inference
21
+ * - external-sync: Synced from external system (Jira, GitHub, etc.)
22
+ */
23
+ /**
24
+ * Confidence level for a memory fact.
25
+ */
26
+ export type ConfidenceLevel = 'verified' | 'high' | 'medium' | 'low' | 'uncertain';
27
+ /**
28
+ * All valid confidence levels, ordered from highest to lowest.
29
+ */
30
+ export declare const CONFIDENCE_VALUES: readonly ConfidenceLevel[];
31
+ /**
32
+ * Numeric score for each confidence level (0.0 - 1.0).
33
+ */
34
+ export declare const CONFIDENCE_SCORES: Readonly<Record<ConfidenceLevel, number>>;
35
+ /**
36
+ * Source type indicating where a fact originated.
37
+ */
38
+ export type SourceType = 'user-explicit' | 'session-capture' | 'prompt-capture' | 'code-analysis' | 'auto-inferred' | 'external-sync';
39
+ /**
40
+ * All valid source types.
41
+ */
42
+ export declare const SOURCE_VALUES: readonly SourceType[];
43
+ /**
44
+ * Default confidence level assigned for each source type.
45
+ */
46
+ export declare const DEFAULT_CONFIDENCE: Readonly<Record<SourceType, ConfidenceLevel>>;
47
+ /**
48
+ * Resolve a confidence level to its corresponding tag string.
49
+ *
50
+ * @param level - The confidence level
51
+ * @returns Tag string, e.g. 'confidence:high'
52
+ */
53
+ export declare function resolveConfidenceTag(level: ConfidenceLevel): string;
54
+ /**
55
+ * Parse the confidence level from a tag array.
56
+ * Looks for tags matching 'confidence:<level>'.
57
+ *
58
+ * @param tags - Array of tags to search
59
+ * @returns The confidence level found, or null if none present
60
+ */
61
+ export declare function parseConfidenceTag(tags: readonly string[]): ConfidenceLevel | null;
62
+ /**
63
+ * Check if a string is a valid ConfidenceLevel value.
64
+ *
65
+ * @param value - The string to check
66
+ * @returns true if valid confidence level
67
+ */
68
+ export declare function isValidConfidence(value: string): value is ConfidenceLevel;
69
+ /**
70
+ * Convert a confidence level to its numeric score.
71
+ *
72
+ * @param level - The confidence level
73
+ * @returns Numeric score between 0.0 and 1.0
74
+ */
75
+ export declare function confidenceToScore(level: ConfidenceLevel): number;
76
+ /**
77
+ * Convert a numeric score to the nearest confidence level.
78
+ * Uses closest-match: finds the level whose score is nearest.
79
+ *
80
+ * @param score - Numeric score (0.0 - 1.0)
81
+ * @returns The nearest confidence level
82
+ */
83
+ export declare function scoreToConfidence(score: number): ConfidenceLevel;
84
+ /**
85
+ * Resolve a source type to its corresponding tag string.
86
+ *
87
+ * @param source - The source type
88
+ * @returns Tag string, e.g. 'source:user-explicit'
89
+ */
90
+ export declare function resolveSourceTag(source: SourceType): string;
91
+ /**
92
+ * Parse the source type from a tag array.
93
+ * Looks for tags matching 'source:<type>'.
94
+ *
95
+ * @param tags - Array of tags to search
96
+ * @returns The source type found, or null if none present
97
+ */
98
+ export declare function parseSourceTag(tags: readonly string[]): SourceType | null;
99
+ /**
100
+ * Check if a string is a valid SourceType value.
101
+ *
102
+ * @param value - The string to check
103
+ * @returns true if valid source type
104
+ */
105
+ export declare function isValidSource(value: string): value is SourceType;
106
+ /**
107
+ * Get the default confidence level for a given source type.
108
+ *
109
+ * @param source - The source type
110
+ * @returns The default confidence level
111
+ */
112
+ export declare function defaultConfidenceForSource(source: SourceType): ConfidenceLevel;
113
+ //# sourceMappingURL=IMemoryQuality.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IMemoryQuality.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/interfaces/types/IMemoryQuality.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,WAAW,CAAC;AAEnF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,eAAe,EAM9C,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAMvE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,eAAe,GACf,eAAe,GACf,eAAe,CAAC;AAEpB;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,UAAU,EAOrC,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,eAAe,CAAC,CAO5E,CAAC;AAYF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAEnE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,eAAe,GAAG,IAAI,CAUlF;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,eAAe,CAEzE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAEhE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAYhE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,GAAG,IAAI,CAUzE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,UAAU,GAAG,eAAe,CAE9E"}
@@ -0,0 +1,195 @@
1
+ "use strict";
2
+ /**
3
+ * Memory Quality & Source Tracking Types
4
+ *
5
+ * Defines confidence levels, source types, and helper functions for
6
+ * tracking fact provenance and quality. Follows the same tag-based
7
+ * pattern as IMemoryLifecycle.
8
+ *
9
+ * Confidence levels:
10
+ * - verified: Confirmed by user, code check, or test (1.0)
11
+ * - high: User-stated or documented (0.8)
12
+ * - medium: Auto-captured, consistent with other facts (0.5)
13
+ * - low: Inferred or from low-fidelity source (0.3)
14
+ * - uncertain: Needs verification (0.1)
15
+ *
16
+ * Source types:
17
+ * - user-explicit: User directly stated via `lisa memory add`
18
+ * - session-capture: Extracted from session stop handler
19
+ * - prompt-capture: Captured from user prompt submit
20
+ * - code-analysis: Inferred from code inspection
21
+ * - auto-inferred: System-generated inference
22
+ * - external-sync: Synced from external system (Jira, GitHub, etc.)
23
+ */
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.DEFAULT_CONFIDENCE = exports.SOURCE_VALUES = exports.CONFIDENCE_SCORES = exports.CONFIDENCE_VALUES = void 0;
26
+ exports.resolveConfidenceTag = resolveConfidenceTag;
27
+ exports.parseConfidenceTag = parseConfidenceTag;
28
+ exports.isValidConfidence = isValidConfidence;
29
+ exports.confidenceToScore = confidenceToScore;
30
+ exports.scoreToConfidence = scoreToConfidence;
31
+ exports.resolveSourceTag = resolveSourceTag;
32
+ exports.parseSourceTag = parseSourceTag;
33
+ exports.isValidSource = isValidSource;
34
+ exports.defaultConfidenceForSource = defaultConfidenceForSource;
35
+ /**
36
+ * All valid confidence levels, ordered from highest to lowest.
37
+ */
38
+ exports.CONFIDENCE_VALUES = [
39
+ 'verified',
40
+ 'high',
41
+ 'medium',
42
+ 'low',
43
+ 'uncertain',
44
+ ];
45
+ /**
46
+ * Numeric score for each confidence level (0.0 - 1.0).
47
+ */
48
+ exports.CONFIDENCE_SCORES = {
49
+ verified: 1.0,
50
+ high: 0.8,
51
+ medium: 0.5,
52
+ low: 0.3,
53
+ uncertain: 0.1,
54
+ };
55
+ /**
56
+ * All valid source types.
57
+ */
58
+ exports.SOURCE_VALUES = [
59
+ 'user-explicit',
60
+ 'session-capture',
61
+ 'prompt-capture',
62
+ 'code-analysis',
63
+ 'auto-inferred',
64
+ 'external-sync',
65
+ ];
66
+ /**
67
+ * Default confidence level assigned for each source type.
68
+ */
69
+ exports.DEFAULT_CONFIDENCE = {
70
+ 'user-explicit': 'high',
71
+ 'session-capture': 'medium',
72
+ 'prompt-capture': 'low',
73
+ 'code-analysis': 'medium',
74
+ 'auto-inferred': 'low',
75
+ 'external-sync': 'medium',
76
+ };
77
+ /**
78
+ * Tag prefix used for confidence tags.
79
+ */
80
+ const CONFIDENCE_TAG_PREFIX = 'confidence:';
81
+ /**
82
+ * Tag prefix used for source tags.
83
+ */
84
+ const SOURCE_TAG_PREFIX = 'source:';
85
+ /**
86
+ * Resolve a confidence level to its corresponding tag string.
87
+ *
88
+ * @param level - The confidence level
89
+ * @returns Tag string, e.g. 'confidence:high'
90
+ */
91
+ function resolveConfidenceTag(level) {
92
+ return `${CONFIDENCE_TAG_PREFIX}${level}`;
93
+ }
94
+ /**
95
+ * Parse the confidence level from a tag array.
96
+ * Looks for tags matching 'confidence:<level>'.
97
+ *
98
+ * @param tags - Array of tags to search
99
+ * @returns The confidence level found, or null if none present
100
+ */
101
+ function parseConfidenceTag(tags) {
102
+ for (const tag of tags) {
103
+ if (tag.startsWith(CONFIDENCE_TAG_PREFIX)) {
104
+ const level = tag.slice(CONFIDENCE_TAG_PREFIX.length);
105
+ if (exports.CONFIDENCE_VALUES.includes(level)) {
106
+ return level;
107
+ }
108
+ }
109
+ }
110
+ return null;
111
+ }
112
+ /**
113
+ * Check if a string is a valid ConfidenceLevel value.
114
+ *
115
+ * @param value - The string to check
116
+ * @returns true if valid confidence level
117
+ */
118
+ function isValidConfidence(value) {
119
+ return exports.CONFIDENCE_VALUES.includes(value);
120
+ }
121
+ /**
122
+ * Convert a confidence level to its numeric score.
123
+ *
124
+ * @param level - The confidence level
125
+ * @returns Numeric score between 0.0 and 1.0
126
+ */
127
+ function confidenceToScore(level) {
128
+ return exports.CONFIDENCE_SCORES[level];
129
+ }
130
+ /**
131
+ * Convert a numeric score to the nearest confidence level.
132
+ * Uses closest-match: finds the level whose score is nearest.
133
+ *
134
+ * @param score - Numeric score (0.0 - 1.0)
135
+ * @returns The nearest confidence level
136
+ */
137
+ function scoreToConfidence(score) {
138
+ const clamped = Math.max(0, Math.min(1, score));
139
+ let closest = 'uncertain';
140
+ let minDiff = Infinity;
141
+ for (const level of exports.CONFIDENCE_VALUES) {
142
+ const diff = Math.abs(exports.CONFIDENCE_SCORES[level] - clamped);
143
+ if (diff < minDiff) {
144
+ minDiff = diff;
145
+ closest = level;
146
+ }
147
+ }
148
+ return closest;
149
+ }
150
+ /**
151
+ * Resolve a source type to its corresponding tag string.
152
+ *
153
+ * @param source - The source type
154
+ * @returns Tag string, e.g. 'source:user-explicit'
155
+ */
156
+ function resolveSourceTag(source) {
157
+ return `${SOURCE_TAG_PREFIX}${source}`;
158
+ }
159
+ /**
160
+ * Parse the source type from a tag array.
161
+ * Looks for tags matching 'source:<type>'.
162
+ *
163
+ * @param tags - Array of tags to search
164
+ * @returns The source type found, or null if none present
165
+ */
166
+ function parseSourceTag(tags) {
167
+ for (const tag of tags) {
168
+ if (tag.startsWith(SOURCE_TAG_PREFIX)) {
169
+ const source = tag.slice(SOURCE_TAG_PREFIX.length);
170
+ if (exports.SOURCE_VALUES.includes(source)) {
171
+ return source;
172
+ }
173
+ }
174
+ }
175
+ return null;
176
+ }
177
+ /**
178
+ * Check if a string is a valid SourceType value.
179
+ *
180
+ * @param value - The string to check
181
+ * @returns true if valid source type
182
+ */
183
+ function isValidSource(value) {
184
+ return exports.SOURCE_VALUES.includes(value);
185
+ }
186
+ /**
187
+ * Get the default confidence level for a given source type.
188
+ *
189
+ * @param source - The source type
190
+ * @returns The default confidence level
191
+ */
192
+ function defaultConfidenceForSource(source) {
193
+ return exports.DEFAULT_CONFIDENCE[source];
194
+ }
195
+ //# sourceMappingURL=IMemoryQuality.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IMemoryQuality.js","sourceRoot":"","sources":["../../../../../src/lib/domain/interfaces/types/IMemoryQuality.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Memory Relationship Types
3
+ *
4
+ * Defines typed relationships between memory facts, enabling structured
5
+ * knowledge graphs where decisions can supersede others, facts can support
6
+ * or contradict each other, and implementations can be linked to decisions.
7
+ *
8
+ * Relationship types:
9
+ * - supersedes: One fact replaces another (e.g., a new decision overrides an old one)
10
+ * - supports: Evidence backing a decision or fact
11
+ * - contradicts: Conflicting information between facts
12
+ * - implements: Implementation of a decision or plan
13
+ * - relates_to: General association (catch-all)
14
+ * - refines: Clarification or narrowing of a fact
15
+ */
16
+ /**
17
+ * Typed relationship between two memory facts.
18
+ */
19
+ export type MemoryRelationType = 'supersedes' | 'supports' | 'contradicts' | 'implements' | 'relates_to' | 'refines';
20
+ /**
21
+ * All valid memory relation type values.
22
+ */
23
+ export declare const MEMORY_RELATION_VALUES: readonly MemoryRelationType[];
24
+ /**
25
+ * A relationship between two memory facts.
26
+ */
27
+ export interface IMemoryRelationship {
28
+ readonly sourceUuid: string;
29
+ readonly targetUuid: string;
30
+ readonly relationType: MemoryRelationType;
31
+ readonly metadata?: string;
32
+ readonly createdAt?: string;
33
+ }
34
+ /**
35
+ * Human-readable labels for each relation type.
36
+ */
37
+ export declare const RELATION_LABELS: Readonly<Record<MemoryRelationType, string>>;
38
+ /**
39
+ * Inverse labels for display (how the target describes its relationship to the source).
40
+ */
41
+ export declare const INVERSE_RELATIONS: Readonly<Record<MemoryRelationType, string>>;
42
+ /**
43
+ * Check if a string is a valid MemoryRelationType value.
44
+ *
45
+ * @param value - The string to check
46
+ * @returns true if valid relation type
47
+ */
48
+ export declare function isValidRelationType(value: string): value is MemoryRelationType;
49
+ //# sourceMappingURL=IMemoryRelationship.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IMemoryRelationship.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/interfaces/types/IMemoryRelationship.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,YAAY,GACZ,UAAU,GACV,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,SAAS,CAAC;AAEd;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,kBAAkB,EAOtD,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAOxE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAO1E,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,kBAAkB,CAE9E"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /**
3
+ * Memory Relationship Types
4
+ *
5
+ * Defines typed relationships between memory facts, enabling structured
6
+ * knowledge graphs where decisions can supersede others, facts can support
7
+ * or contradict each other, and implementations can be linked to decisions.
8
+ *
9
+ * Relationship types:
10
+ * - supersedes: One fact replaces another (e.g., a new decision overrides an old one)
11
+ * - supports: Evidence backing a decision or fact
12
+ * - contradicts: Conflicting information between facts
13
+ * - implements: Implementation of a decision or plan
14
+ * - relates_to: General association (catch-all)
15
+ * - refines: Clarification or narrowing of a fact
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.INVERSE_RELATIONS = exports.RELATION_LABELS = exports.MEMORY_RELATION_VALUES = void 0;
19
+ exports.isValidRelationType = isValidRelationType;
20
+ /**
21
+ * All valid memory relation type values.
22
+ */
23
+ exports.MEMORY_RELATION_VALUES = [
24
+ 'supersedes',
25
+ 'supports',
26
+ 'contradicts',
27
+ 'implements',
28
+ 'relates_to',
29
+ 'refines',
30
+ ];
31
+ /**
32
+ * Human-readable labels for each relation type.
33
+ */
34
+ exports.RELATION_LABELS = {
35
+ supersedes: 'supersedes',
36
+ supports: 'supports',
37
+ contradicts: 'contradicts',
38
+ implements: 'implements',
39
+ relates_to: 'relates to',
40
+ refines: 'refines',
41
+ };
42
+ /**
43
+ * Inverse labels for display (how the target describes its relationship to the source).
44
+ */
45
+ exports.INVERSE_RELATIONS = {
46
+ supersedes: 'superseded by',
47
+ supports: 'supported by',
48
+ contradicts: 'contradicted by',
49
+ implements: 'implemented by',
50
+ relates_to: 'related to',
51
+ refines: 'refined by',
52
+ };
53
+ /**
54
+ * Check if a string is a valid MemoryRelationType value.
55
+ *
56
+ * @param value - The string to check
57
+ * @returns true if valid relation type
58
+ */
59
+ function isValidRelationType(value) {
60
+ return exports.MEMORY_RELATION_VALUES.includes(value);
61
+ }
62
+ //# sourceMappingURL=IMemoryRelationship.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IMemoryRelationship.js","sourceRoot":"","sources":["../../../../../src/lib/domain/interfaces/types/IMemoryRelationship.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAkEH,kDAEC;AAvDD;;GAEG;AACU,QAAA,sBAAsB,GAAkC;IACnE,YAAY;IACZ,UAAU;IACV,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,SAAS;CACD,CAAC;AAaX;;GAEG;AACU,QAAA,eAAe,GAAiD;IAC3E,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF;;GAEG;AACU,QAAA,iBAAiB,GAAiD;IAC7E,UAAU,EAAE,eAAe;IAC3B,QAAQ,EAAE,cAAc;IACxB,WAAW,EAAE,iBAAiB;IAC9B,UAAU,EAAE,gBAAgB;IAC5B,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,YAAY;CACtB,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,KAAa;IAC/C,OAAO,8BAAsB,CAAC,QAAQ,CAAC,KAA2B,CAAC,CAAC;AACtE,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Task Type & Context Strategy Types
3
+ *
4
+ * Defines task types for mode-aware retrieval and context strategies
5
+ * that control how memory is searched based on what the user is doing.
6
+ *
7
+ * Task types:
8
+ * - planning: Designing architecture, making decisions, evaluating trade-offs
9
+ * - execution: Implementing features, writing code, building functionality
10
+ * - exploration: Brainstorming, investigating possibilities, research
11
+ * - debugging: Fixing bugs, diagnosing errors, troubleshooting
12
+ */
13
+ /**
14
+ * Task type for mode-aware retrieval.
15
+ */
16
+ export type TaskType = 'planning' | 'execution' | 'exploration' | 'debugging';
17
+ /**
18
+ * All valid task type values.
19
+ */
20
+ export declare const TASK_TYPE_VALUES: readonly TaskType[];
21
+ /**
22
+ * Context strategy that controls retrieval behavior per task type.
23
+ */
24
+ export interface IContextStrategy {
25
+ /** Memory search types to query (e.g. 'decision', 'retrospective', 'pattern') */
26
+ readonly searchTypes: readonly string[];
27
+ /** Maximum results per search type */
28
+ readonly maxResults: number;
29
+ /** Timeout for memory queries (ms) */
30
+ readonly timeout: number;
31
+ /** Maximum facts to load in session context */
32
+ readonly factLimit: number;
33
+ /** Search breadth: how many topic keywords to use */
34
+ readonly searchBreadth: number;
35
+ }
36
+ /**
37
+ * Default context strategies per task type.
38
+ */
39
+ export declare const DEFAULT_CONTEXT_STRATEGIES: Readonly<Record<TaskType, IContextStrategy>>;
40
+ /**
41
+ * Detection signal keywords per task type.
42
+ * Used by TaskTypeDetector for signal-based scoring.
43
+ */
44
+ export declare const DETECTION_SIGNALS: Readonly<Record<TaskType, readonly string[]>>;
45
+ /**
46
+ * Check if a string is a valid TaskType value.
47
+ *
48
+ * @param value - The string to check
49
+ * @returns true if valid task type
50
+ */
51
+ export declare function isValidTaskType(value: string): value is TaskType;
52
+ /**
53
+ * Get the default context strategy for a task type.
54
+ *
55
+ * @param taskType - The task type
56
+ * @returns The default context strategy
57
+ */
58
+ export declare function getDefaultStrategy(taskType: TaskType): IContextStrategy;
59
+ //# sourceMappingURL=ITaskType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITaskType.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/interfaces/types/ITaskType.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,WAAW,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,QAAQ,EAKtC,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,sCAAsC;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,sCAAsC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CA6BnF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC,CAqB3E,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,QAAQ,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,gBAAgB,CAEvE"}