@danielsimonjr/memoryjs 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +266 -0
  3. package/dist/core/EntityManager.d.ts +268 -0
  4. package/dist/core/EntityManager.d.ts.map +1 -0
  5. package/dist/core/EntityManager.js +512 -0
  6. package/dist/core/EntityManager.js.map +1 -0
  7. package/dist/core/GraphEventEmitter.d.ts +202 -0
  8. package/dist/core/GraphEventEmitter.d.ts.map +1 -0
  9. package/dist/core/GraphEventEmitter.js +347 -0
  10. package/dist/core/GraphEventEmitter.js.map +1 -0
  11. package/dist/core/GraphStorage.d.ts +395 -0
  12. package/dist/core/GraphStorage.d.ts.map +1 -0
  13. package/dist/core/GraphStorage.js +786 -0
  14. package/dist/core/GraphStorage.js.map +1 -0
  15. package/dist/core/GraphTraversal.d.ts +141 -0
  16. package/dist/core/GraphTraversal.d.ts.map +1 -0
  17. package/dist/core/GraphTraversal.js +574 -0
  18. package/dist/core/GraphTraversal.js.map +1 -0
  19. package/dist/core/HierarchyManager.d.ts +111 -0
  20. package/dist/core/HierarchyManager.d.ts.map +1 -0
  21. package/dist/core/HierarchyManager.js +225 -0
  22. package/dist/core/HierarchyManager.js.map +1 -0
  23. package/dist/core/ManagerContext.d.ts +76 -0
  24. package/dist/core/ManagerContext.d.ts.map +1 -0
  25. package/dist/core/ManagerContext.js +129 -0
  26. package/dist/core/ManagerContext.js.map +1 -0
  27. package/dist/core/ObservationManager.d.ts +85 -0
  28. package/dist/core/ObservationManager.d.ts.map +1 -0
  29. package/dist/core/ObservationManager.js +124 -0
  30. package/dist/core/ObservationManager.js.map +1 -0
  31. package/dist/core/RelationManager.d.ts +131 -0
  32. package/dist/core/RelationManager.d.ts.map +1 -0
  33. package/dist/core/RelationManager.js +212 -0
  34. package/dist/core/RelationManager.js.map +1 -0
  35. package/dist/core/SQLiteStorage.d.ts +354 -0
  36. package/dist/core/SQLiteStorage.d.ts.map +1 -0
  37. package/dist/core/SQLiteStorage.js +919 -0
  38. package/dist/core/SQLiteStorage.js.map +1 -0
  39. package/dist/core/StorageFactory.d.ts +45 -0
  40. package/dist/core/StorageFactory.d.ts.map +1 -0
  41. package/dist/core/StorageFactory.js +65 -0
  42. package/dist/core/StorageFactory.js.map +1 -0
  43. package/dist/core/TransactionManager.d.ts +464 -0
  44. package/dist/core/TransactionManager.d.ts.map +1 -0
  45. package/dist/core/TransactionManager.js +869 -0
  46. package/dist/core/TransactionManager.js.map +1 -0
  47. package/dist/core/index.d.ts +17 -0
  48. package/dist/core/index.d.ts.map +1 -0
  49. package/dist/core/index.js +20 -0
  50. package/dist/core/index.js.map +1 -0
  51. package/dist/features/AnalyticsManager.d.ts +44 -0
  52. package/dist/features/AnalyticsManager.d.ts.map +1 -0
  53. package/dist/features/AnalyticsManager.js +224 -0
  54. package/dist/features/AnalyticsManager.js.map +1 -0
  55. package/dist/features/ArchiveManager.d.ts +133 -0
  56. package/dist/features/ArchiveManager.d.ts.map +1 -0
  57. package/dist/features/ArchiveManager.js +282 -0
  58. package/dist/features/ArchiveManager.js.map +1 -0
  59. package/dist/features/CompressionManager.d.ts +119 -0
  60. package/dist/features/CompressionManager.d.ts.map +1 -0
  61. package/dist/features/CompressionManager.js +470 -0
  62. package/dist/features/CompressionManager.js.map +1 -0
  63. package/dist/features/IOManager.d.ts +225 -0
  64. package/dist/features/IOManager.d.ts.map +1 -0
  65. package/dist/features/IOManager.js +1093 -0
  66. package/dist/features/IOManager.js.map +1 -0
  67. package/dist/features/KeywordExtractor.d.ts +61 -0
  68. package/dist/features/KeywordExtractor.d.ts.map +1 -0
  69. package/dist/features/KeywordExtractor.js +127 -0
  70. package/dist/features/KeywordExtractor.js.map +1 -0
  71. package/dist/features/ObservationNormalizer.d.ts +90 -0
  72. package/dist/features/ObservationNormalizer.d.ts.map +1 -0
  73. package/dist/features/ObservationNormalizer.js +194 -0
  74. package/dist/features/ObservationNormalizer.js.map +1 -0
  75. package/dist/features/StreamingExporter.d.ts +128 -0
  76. package/dist/features/StreamingExporter.d.ts.map +1 -0
  77. package/dist/features/StreamingExporter.js +212 -0
  78. package/dist/features/StreamingExporter.js.map +1 -0
  79. package/dist/features/TagManager.d.ts +147 -0
  80. package/dist/features/TagManager.d.ts.map +1 -0
  81. package/dist/features/TagManager.js +211 -0
  82. package/dist/features/TagManager.js.map +1 -0
  83. package/dist/features/index.d.ts +14 -0
  84. package/dist/features/index.d.ts.map +1 -0
  85. package/dist/features/index.js +15 -0
  86. package/dist/features/index.js.map +1 -0
  87. package/dist/index.d.ts +15 -0
  88. package/dist/index.d.ts.map +1 -0
  89. package/dist/index.js +20 -0
  90. package/dist/index.js.map +1 -0
  91. package/dist/search/BM25Search.d.ts +148 -0
  92. package/dist/search/BM25Search.d.ts.map +1 -0
  93. package/dist/search/BM25Search.js +340 -0
  94. package/dist/search/BM25Search.js.map +1 -0
  95. package/dist/search/BasicSearch.d.ts +51 -0
  96. package/dist/search/BasicSearch.d.ts.map +1 -0
  97. package/dist/search/BasicSearch.js +138 -0
  98. package/dist/search/BasicSearch.js.map +1 -0
  99. package/dist/search/BooleanSearch.d.ts +98 -0
  100. package/dist/search/BooleanSearch.d.ts.map +1 -0
  101. package/dist/search/BooleanSearch.js +431 -0
  102. package/dist/search/BooleanSearch.js.map +1 -0
  103. package/dist/search/EarlyTerminationManager.d.ts +140 -0
  104. package/dist/search/EarlyTerminationManager.d.ts.map +1 -0
  105. package/dist/search/EarlyTerminationManager.js +280 -0
  106. package/dist/search/EarlyTerminationManager.js.map +1 -0
  107. package/dist/search/EmbeddingCache.d.ts +175 -0
  108. package/dist/search/EmbeddingCache.d.ts.map +1 -0
  109. package/dist/search/EmbeddingCache.js +247 -0
  110. package/dist/search/EmbeddingCache.js.map +1 -0
  111. package/dist/search/EmbeddingService.d.ts +277 -0
  112. package/dist/search/EmbeddingService.d.ts.map +1 -0
  113. package/dist/search/EmbeddingService.js +531 -0
  114. package/dist/search/EmbeddingService.js.map +1 -0
  115. package/dist/search/FuzzySearch.d.ts +118 -0
  116. package/dist/search/FuzzySearch.d.ts.map +1 -0
  117. package/dist/search/FuzzySearch.js +313 -0
  118. package/dist/search/FuzzySearch.js.map +1 -0
  119. package/dist/search/HybridScorer.d.ts +181 -0
  120. package/dist/search/HybridScorer.d.ts.map +1 -0
  121. package/dist/search/HybridScorer.js +258 -0
  122. package/dist/search/HybridScorer.js.map +1 -0
  123. package/dist/search/HybridSearchManager.d.ts +80 -0
  124. package/dist/search/HybridSearchManager.d.ts.map +1 -0
  125. package/dist/search/HybridSearchManager.js +188 -0
  126. package/dist/search/HybridSearchManager.js.map +1 -0
  127. package/dist/search/IncrementalIndexer.d.ts +201 -0
  128. package/dist/search/IncrementalIndexer.d.ts.map +1 -0
  129. package/dist/search/IncrementalIndexer.js +343 -0
  130. package/dist/search/IncrementalIndexer.js.map +1 -0
  131. package/dist/search/OptimizedInvertedIndex.d.ts +163 -0
  132. package/dist/search/OptimizedInvertedIndex.d.ts.map +1 -0
  133. package/dist/search/OptimizedInvertedIndex.js +359 -0
  134. package/dist/search/OptimizedInvertedIndex.js.map +1 -0
  135. package/dist/search/ParallelSearchExecutor.d.ts +172 -0
  136. package/dist/search/ParallelSearchExecutor.d.ts.map +1 -0
  137. package/dist/search/ParallelSearchExecutor.js +310 -0
  138. package/dist/search/ParallelSearchExecutor.js.map +1 -0
  139. package/dist/search/QuantizedVectorStore.d.ts +171 -0
  140. package/dist/search/QuantizedVectorStore.d.ts.map +1 -0
  141. package/dist/search/QuantizedVectorStore.js +308 -0
  142. package/dist/search/QuantizedVectorStore.js.map +1 -0
  143. package/dist/search/QueryAnalyzer.d.ts +76 -0
  144. package/dist/search/QueryAnalyzer.d.ts.map +1 -0
  145. package/dist/search/QueryAnalyzer.js +228 -0
  146. package/dist/search/QueryAnalyzer.js.map +1 -0
  147. package/dist/search/QueryCostEstimator.d.ts +244 -0
  148. package/dist/search/QueryCostEstimator.d.ts.map +1 -0
  149. package/dist/search/QueryCostEstimator.js +653 -0
  150. package/dist/search/QueryCostEstimator.js.map +1 -0
  151. package/dist/search/QueryPlanCache.d.ts +220 -0
  152. package/dist/search/QueryPlanCache.d.ts.map +1 -0
  153. package/dist/search/QueryPlanCache.js +380 -0
  154. package/dist/search/QueryPlanCache.js.map +1 -0
  155. package/dist/search/QueryPlanner.d.ts +58 -0
  156. package/dist/search/QueryPlanner.d.ts.map +1 -0
  157. package/dist/search/QueryPlanner.js +138 -0
  158. package/dist/search/QueryPlanner.js.map +1 -0
  159. package/dist/search/RankedSearch.d.ts +71 -0
  160. package/dist/search/RankedSearch.d.ts.map +1 -0
  161. package/dist/search/RankedSearch.js +239 -0
  162. package/dist/search/RankedSearch.js.map +1 -0
  163. package/dist/search/ReflectionManager.d.ts +120 -0
  164. package/dist/search/ReflectionManager.d.ts.map +1 -0
  165. package/dist/search/ReflectionManager.js +232 -0
  166. package/dist/search/ReflectionManager.js.map +1 -0
  167. package/dist/search/SavedSearchManager.d.ts +79 -0
  168. package/dist/search/SavedSearchManager.d.ts.map +1 -0
  169. package/dist/search/SavedSearchManager.js +147 -0
  170. package/dist/search/SavedSearchManager.js.map +1 -0
  171. package/dist/search/SearchFilterChain.d.ts +120 -0
  172. package/dist/search/SearchFilterChain.d.ts.map +1 -0
  173. package/dist/search/SearchFilterChain.js +186 -0
  174. package/dist/search/SearchFilterChain.js.map +1 -0
  175. package/dist/search/SearchManager.d.ts +326 -0
  176. package/dist/search/SearchManager.d.ts.map +1 -0
  177. package/dist/search/SearchManager.js +454 -0
  178. package/dist/search/SearchManager.js.map +1 -0
  179. package/dist/search/SearchSuggestions.d.ts +27 -0
  180. package/dist/search/SearchSuggestions.d.ts.map +1 -0
  181. package/dist/search/SearchSuggestions.js +58 -0
  182. package/dist/search/SearchSuggestions.js.map +1 -0
  183. package/dist/search/SemanticSearch.d.ts +149 -0
  184. package/dist/search/SemanticSearch.d.ts.map +1 -0
  185. package/dist/search/SemanticSearch.js +324 -0
  186. package/dist/search/SemanticSearch.js.map +1 -0
  187. package/dist/search/SymbolicSearch.d.ts +61 -0
  188. package/dist/search/SymbolicSearch.d.ts.map +1 -0
  189. package/dist/search/SymbolicSearch.js +164 -0
  190. package/dist/search/SymbolicSearch.js.map +1 -0
  191. package/dist/search/TFIDFEventSync.d.ts +85 -0
  192. package/dist/search/TFIDFEventSync.d.ts.map +1 -0
  193. package/dist/search/TFIDFEventSync.js +134 -0
  194. package/dist/search/TFIDFEventSync.js.map +1 -0
  195. package/dist/search/TFIDFIndexManager.d.ts +151 -0
  196. package/dist/search/TFIDFIndexManager.d.ts.map +1 -0
  197. package/dist/search/TFIDFIndexManager.js +433 -0
  198. package/dist/search/TFIDFIndexManager.js.map +1 -0
  199. package/dist/search/VectorStore.d.ts +235 -0
  200. package/dist/search/VectorStore.d.ts.map +1 -0
  201. package/dist/search/VectorStore.js +312 -0
  202. package/dist/search/VectorStore.js.map +1 -0
  203. package/dist/search/index.d.ts +35 -0
  204. package/dist/search/index.d.ts.map +1 -0
  205. package/dist/search/index.js +53 -0
  206. package/dist/search/index.js.map +1 -0
  207. package/dist/types/index.d.ts +13 -0
  208. package/dist/types/index.d.ts.map +1 -0
  209. package/dist/types/index.js +13 -0
  210. package/dist/types/index.js.map +1 -0
  211. package/dist/types/types.d.ts +1811 -0
  212. package/dist/types/types.d.ts.map +1 -0
  213. package/dist/types/types.js +10 -0
  214. package/dist/types/types.js.map +1 -0
  215. package/dist/utils/BatchProcessor.d.ts +271 -0
  216. package/dist/utils/BatchProcessor.d.ts.map +1 -0
  217. package/dist/utils/BatchProcessor.js +377 -0
  218. package/dist/utils/BatchProcessor.js.map +1 -0
  219. package/dist/utils/MemoryMonitor.d.ts +176 -0
  220. package/dist/utils/MemoryMonitor.d.ts.map +1 -0
  221. package/dist/utils/MemoryMonitor.js +306 -0
  222. package/dist/utils/MemoryMonitor.js.map +1 -0
  223. package/dist/utils/WorkerPoolManager.d.ts +233 -0
  224. package/dist/utils/WorkerPoolManager.d.ts.map +1 -0
  225. package/dist/utils/WorkerPoolManager.js +421 -0
  226. package/dist/utils/WorkerPoolManager.js.map +1 -0
  227. package/dist/utils/compressedCache.d.ts +221 -0
  228. package/dist/utils/compressedCache.d.ts.map +1 -0
  229. package/dist/utils/compressedCache.js +349 -0
  230. package/dist/utils/compressedCache.js.map +1 -0
  231. package/dist/utils/compressionUtil.d.ts +214 -0
  232. package/dist/utils/compressionUtil.d.ts.map +1 -0
  233. package/dist/utils/compressionUtil.js +248 -0
  234. package/dist/utils/compressionUtil.js.map +1 -0
  235. package/dist/utils/constants.d.ts +245 -0
  236. package/dist/utils/constants.d.ts.map +1 -0
  237. package/dist/utils/constants.js +253 -0
  238. package/dist/utils/constants.js.map +1 -0
  239. package/dist/utils/entityUtils.d.ts +379 -0
  240. package/dist/utils/entityUtils.d.ts.map +1 -0
  241. package/dist/utils/entityUtils.js +649 -0
  242. package/dist/utils/entityUtils.js.map +1 -0
  243. package/dist/utils/errors.d.ts +95 -0
  244. package/dist/utils/errors.d.ts.map +1 -0
  245. package/dist/utils/errors.js +146 -0
  246. package/dist/utils/errors.js.map +1 -0
  247. package/dist/utils/formatters.d.ts +145 -0
  248. package/dist/utils/formatters.d.ts.map +1 -0
  249. package/dist/utils/formatters.js +133 -0
  250. package/dist/utils/formatters.js.map +1 -0
  251. package/dist/utils/index.d.ts +26 -0
  252. package/dist/utils/index.d.ts.map +1 -0
  253. package/dist/utils/index.js +88 -0
  254. package/dist/utils/index.js.map +1 -0
  255. package/dist/utils/indexes.d.ts +270 -0
  256. package/dist/utils/indexes.d.ts.map +1 -0
  257. package/dist/utils/indexes.js +527 -0
  258. package/dist/utils/indexes.js.map +1 -0
  259. package/dist/utils/logger.d.ts +31 -0
  260. package/dist/utils/logger.d.ts.map +1 -0
  261. package/dist/utils/logger.js +41 -0
  262. package/dist/utils/logger.js.map +1 -0
  263. package/dist/utils/operationUtils.d.ts +124 -0
  264. package/dist/utils/operationUtils.d.ts.map +1 -0
  265. package/dist/utils/operationUtils.js +176 -0
  266. package/dist/utils/operationUtils.js.map +1 -0
  267. package/dist/utils/parallelUtils.d.ts +76 -0
  268. package/dist/utils/parallelUtils.d.ts.map +1 -0
  269. package/dist/utils/parallelUtils.js +192 -0
  270. package/dist/utils/parallelUtils.js.map +1 -0
  271. package/dist/utils/schemas.d.ts +556 -0
  272. package/dist/utils/schemas.d.ts.map +1 -0
  273. package/dist/utils/schemas.js +485 -0
  274. package/dist/utils/schemas.js.map +1 -0
  275. package/dist/utils/searchAlgorithms.d.ts +99 -0
  276. package/dist/utils/searchAlgorithms.d.ts.map +1 -0
  277. package/dist/utils/searchAlgorithms.js +168 -0
  278. package/dist/utils/searchAlgorithms.js.map +1 -0
  279. package/dist/utils/searchCache.d.ts +108 -0
  280. package/dist/utils/searchCache.d.ts.map +1 -0
  281. package/dist/utils/searchCache.js +210 -0
  282. package/dist/utils/searchCache.js.map +1 -0
  283. package/dist/utils/taskScheduler.d.ts +294 -0
  284. package/dist/utils/taskScheduler.d.ts.map +1 -0
  285. package/dist/utils/taskScheduler.js +487 -0
  286. package/dist/utils/taskScheduler.js.map +1 -0
  287. package/dist/workers/index.d.ts +12 -0
  288. package/dist/workers/index.d.ts.map +1 -0
  289. package/dist/workers/index.js +10 -0
  290. package/dist/workers/index.js.map +1 -0
  291. package/dist/workers/levenshteinWorker.d.ts +60 -0
  292. package/dist/workers/levenshteinWorker.d.ts.map +1 -0
  293. package/dist/workers/levenshteinWorker.js +99 -0
  294. package/dist/workers/levenshteinWorker.js.map +1 -0
  295. package/package.json +69 -0
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Custom Error Types
3
+ *
4
+ * Defines custom error classes for better error handling and debugging.
5
+ *
6
+ * @module utils/errors
7
+ */
8
+ /**
9
+ * Base error class for all knowledge graph errors.
10
+ * Extends the native Error class with additional context.
11
+ */
12
+ export declare class KnowledgeGraphError extends Error {
13
+ readonly code?: string | undefined;
14
+ constructor(message: string, code?: string | undefined);
15
+ }
16
+ /**
17
+ * Error thrown when an entity is not found.
18
+ */
19
+ export declare class EntityNotFoundError extends KnowledgeGraphError {
20
+ constructor(entityName: string);
21
+ }
22
+ /**
23
+ * Error thrown when a relation is not found.
24
+ */
25
+ export declare class RelationNotFoundError extends KnowledgeGraphError {
26
+ constructor(from: string, to: string, relationType?: string);
27
+ }
28
+ /**
29
+ * Error thrown when attempting to create a duplicate entity.
30
+ */
31
+ export declare class DuplicateEntityError extends KnowledgeGraphError {
32
+ constructor(entityName: string);
33
+ }
34
+ /**
35
+ * Error thrown when validation fails.
36
+ */
37
+ export declare class ValidationError extends KnowledgeGraphError {
38
+ readonly errors: string[];
39
+ constructor(message: string, errors: string[]);
40
+ }
41
+ /**
42
+ * Error thrown when a cycle is detected in hierarchies.
43
+ */
44
+ export declare class CycleDetectedError extends KnowledgeGraphError {
45
+ constructor(entityName: string, parentName: string);
46
+ }
47
+ /**
48
+ * Error thrown when an invalid importance value is provided.
49
+ */
50
+ export declare class InvalidImportanceError extends KnowledgeGraphError {
51
+ constructor(value: number, min?: number, max?: number);
52
+ }
53
+ /**
54
+ * Error thrown when a file operation fails.
55
+ */
56
+ export declare class FileOperationError extends KnowledgeGraphError {
57
+ constructor(operation: string, filePath: string, cause?: Error);
58
+ }
59
+ /**
60
+ * Error thrown when an import operation fails.
61
+ */
62
+ export declare class ImportError extends KnowledgeGraphError {
63
+ constructor(format: string, message: string);
64
+ }
65
+ /**
66
+ * Error thrown when an export operation fails.
67
+ */
68
+ export declare class ExportError extends KnowledgeGraphError {
69
+ constructor(format: string, message: string);
70
+ }
71
+ /**
72
+ * Error thrown when insufficient entities are provided for an operation.
73
+ */
74
+ export declare class InsufficientEntitiesError extends KnowledgeGraphError {
75
+ constructor(operation: string, required: number, provided: number);
76
+ }
77
+ /**
78
+ * Phase 9B: Error thrown when an operation is cancelled via AbortSignal.
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * const controller = new AbortController();
83
+ * try {
84
+ * await manager.createEntities(entities, { signal: controller.signal });
85
+ * } catch (error) {
86
+ * if (error instanceof OperationCancelledError) {
87
+ * console.log('Operation was cancelled');
88
+ * }
89
+ * }
90
+ * ```
91
+ */
92
+ export declare class OperationCancelledError extends KnowledgeGraphError {
93
+ constructor(operation?: string);
94
+ }
95
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;aACC,IAAI,CAAC,EAAE,MAAM;gBAA9C,OAAO,EAAE,MAAM,EAAkB,IAAI,CAAC,EAAE,MAAM,YAAA;CAQ3D;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,mBAAmB;gBAC9C,UAAU,EAAE,MAAM;CAI/B;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,mBAAmB;gBAChD,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM;CAO5D;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,mBAAmB;gBAC/C,UAAU,EAAE,MAAM;CAI/B;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,mBAAmB;aAGpC,MAAM,EAAE,MAAM,EAAE;gBADhC,OAAO,EAAE,MAAM,EACC,MAAM,EAAE,MAAM,EAAE;CAKnC;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,mBAAmB;gBAC7C,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAOnD;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,mBAAmB;gBACjD,KAAK,EAAE,MAAM,EAAE,GAAG,GAAE,MAAU,EAAE,GAAG,GAAE,MAAW;CAO7D;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,mBAAmB;gBAEvD,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,KAAK;CAWhB;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,mBAAmB;gBACtC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAI5C;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,mBAAmB;gBACtC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAI5C;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,mBAAmB;gBACpD,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAOlE;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,uBAAwB,SAAQ,mBAAmB;gBAClD,SAAS,CAAC,EAAE,MAAM;CAO/B"}
@@ -0,0 +1,146 @@
1
+ /**
2
+ * Custom Error Types
3
+ *
4
+ * Defines custom error classes for better error handling and debugging.
5
+ *
6
+ * @module utils/errors
7
+ */
8
+ /**
9
+ * Base error class for all knowledge graph errors.
10
+ * Extends the native Error class with additional context.
11
+ */
12
+ export class KnowledgeGraphError extends Error {
13
+ code;
14
+ constructor(message, code) {
15
+ super(message);
16
+ this.code = code;
17
+ this.name = 'KnowledgeGraphError';
18
+ // Maintains proper stack trace in V8 engines
19
+ if (Error.captureStackTrace) {
20
+ Error.captureStackTrace(this, this.constructor);
21
+ }
22
+ }
23
+ }
24
+ /**
25
+ * Error thrown when an entity is not found.
26
+ */
27
+ export class EntityNotFoundError extends KnowledgeGraphError {
28
+ constructor(entityName) {
29
+ super(`Entity "${entityName}" not found`, 'ENTITY_NOT_FOUND');
30
+ this.name = 'EntityNotFoundError';
31
+ }
32
+ }
33
+ /**
34
+ * Error thrown when a relation is not found.
35
+ */
36
+ export class RelationNotFoundError extends KnowledgeGraphError {
37
+ constructor(from, to, relationType) {
38
+ const desc = relationType
39
+ ? `Relation "${from}" --[${relationType}]--> "${to}"`
40
+ : `Relation from "${from}" to "${to}"`;
41
+ super(`${desc} not found`, 'RELATION_NOT_FOUND');
42
+ this.name = 'RelationNotFoundError';
43
+ }
44
+ }
45
+ /**
46
+ * Error thrown when attempting to create a duplicate entity.
47
+ */
48
+ export class DuplicateEntityError extends KnowledgeGraphError {
49
+ constructor(entityName) {
50
+ super(`Entity "${entityName}" already exists`, 'DUPLICATE_ENTITY');
51
+ this.name = 'DuplicateEntityError';
52
+ }
53
+ }
54
+ /**
55
+ * Error thrown when validation fails.
56
+ */
57
+ export class ValidationError extends KnowledgeGraphError {
58
+ errors;
59
+ constructor(message, errors) {
60
+ super(message, 'VALIDATION_ERROR');
61
+ this.errors = errors;
62
+ this.name = 'ValidationError';
63
+ }
64
+ }
65
+ /**
66
+ * Error thrown when a cycle is detected in hierarchies.
67
+ */
68
+ export class CycleDetectedError extends KnowledgeGraphError {
69
+ constructor(entityName, parentName) {
70
+ super(`Setting parent "${parentName}" for entity "${entityName}" would create a cycle`, 'CYCLE_DETECTED');
71
+ this.name = 'CycleDetectedError';
72
+ }
73
+ }
74
+ /**
75
+ * Error thrown when an invalid importance value is provided.
76
+ */
77
+ export class InvalidImportanceError extends KnowledgeGraphError {
78
+ constructor(value, min = 0, max = 10) {
79
+ super(`Importance must be between ${min} and ${max}, got ${value}`, 'INVALID_IMPORTANCE');
80
+ this.name = 'InvalidImportanceError';
81
+ }
82
+ }
83
+ /**
84
+ * Error thrown when a file operation fails.
85
+ */
86
+ export class FileOperationError extends KnowledgeGraphError {
87
+ constructor(operation, filePath, cause) {
88
+ super(`Failed to ${operation} file: ${filePath}${cause ? ` - ${cause.message}` : ''}`, 'FILE_OPERATION_ERROR');
89
+ this.name = 'FileOperationError';
90
+ if (cause) {
91
+ this.cause = cause;
92
+ }
93
+ }
94
+ }
95
+ /**
96
+ * Error thrown when an import operation fails.
97
+ */
98
+ export class ImportError extends KnowledgeGraphError {
99
+ constructor(format, message) {
100
+ super(`Import failed (${format}): ${message}`, 'IMPORT_ERROR');
101
+ this.name = 'ImportError';
102
+ }
103
+ }
104
+ /**
105
+ * Error thrown when an export operation fails.
106
+ */
107
+ export class ExportError extends KnowledgeGraphError {
108
+ constructor(format, message) {
109
+ super(`Export failed (${format}): ${message}`, 'EXPORT_ERROR');
110
+ this.name = 'ExportError';
111
+ }
112
+ }
113
+ /**
114
+ * Error thrown when insufficient entities are provided for an operation.
115
+ */
116
+ export class InsufficientEntitiesError extends KnowledgeGraphError {
117
+ constructor(operation, required, provided) {
118
+ super(`${operation} requires at least ${required} entities, got ${provided}`, 'INSUFFICIENT_ENTITIES');
119
+ this.name = 'InsufficientEntitiesError';
120
+ }
121
+ }
122
+ /**
123
+ * Phase 9B: Error thrown when an operation is cancelled via AbortSignal.
124
+ *
125
+ * @example
126
+ * ```typescript
127
+ * const controller = new AbortController();
128
+ * try {
129
+ * await manager.createEntities(entities, { signal: controller.signal });
130
+ * } catch (error) {
131
+ * if (error instanceof OperationCancelledError) {
132
+ * console.log('Operation was cancelled');
133
+ * }
134
+ * }
135
+ * ```
136
+ */
137
+ export class OperationCancelledError extends KnowledgeGraphError {
138
+ constructor(operation) {
139
+ const message = operation
140
+ ? `Operation '${operation}' was cancelled`
141
+ : 'Operation was cancelled';
142
+ super(message, 'OPERATION_CANCELLED');
143
+ this.name = 'OperationCancelledError';
144
+ }
145
+ }
146
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACC;IAA7C,YAAY,OAAe,EAAkB,IAAa;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QAD4B,SAAI,GAAJ,IAAI,CAAS;QAExD,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,6CAA6C;QAC7C,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CA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,KAAK,CACH,GAAG,SAAS,sBAAsB,QAAQ,kBAAkB,QAAQ,EAAE,EACtE,uBAAuB,CACxB,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,uBAAwB,SAAQ,mBAAmB;IAC9D,YAAY,SAAkB;QAC5B,MAAM,OAAO,GAAG,SAAS;YACvB,CAAC,CAAC,cAAc,SAAS,iBAAiB;YAC1C,CAAC,CAAC,yBAAyB,CAAC;QAC9B,KAAK,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF"}
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Response and Pagination Formatters
3
+ *
4
+ * Consolidated module for MCP tool response formatting and pagination utilities.
5
+ * Centralizes response formatting for MCP tool calls to eliminate redundant patterns.
6
+ *
7
+ * @module utils/formatters
8
+ */
9
+ /**
10
+ * MCP Tool Response type - uses the exact shape expected by the SDK.
11
+ * The 'as const' assertion ensures the type literal is preserved.
12
+ */
13
+ export type ToolResponse = {
14
+ content: Array<{
15
+ type: 'text';
16
+ text: string;
17
+ }>;
18
+ isError?: boolean;
19
+ };
20
+ /**
21
+ * Formats data as an MCP tool response with JSON content.
22
+ * Centralizes the response format to ensure consistency and reduce duplication.
23
+ *
24
+ * @param data - Any data to be JSON stringified
25
+ * @returns Formatted MCP tool response
26
+ */
27
+ export declare function formatToolResponse(data: unknown): {
28
+ content: {
29
+ type: "text";
30
+ text: string;
31
+ }[];
32
+ };
33
+ /**
34
+ * Formats a simple text message as an MCP tool response.
35
+ * Use for success messages that don't need JSON formatting.
36
+ *
37
+ * @param message - Plain text message
38
+ * @returns Formatted MCP tool response
39
+ */
40
+ export declare function formatTextResponse(message: string): {
41
+ content: {
42
+ type: "text";
43
+ text: string;
44
+ }[];
45
+ };
46
+ /**
47
+ * Formats raw string content as an MCP tool response.
48
+ * Use for export formats that return pre-formatted strings (markdown, CSV, etc.)
49
+ *
50
+ * @param content - Raw string content
51
+ * @returns Formatted MCP tool response
52
+ */
53
+ export declare function formatRawResponse(content: string): {
54
+ content: {
55
+ type: "text";
56
+ text: string;
57
+ }[];
58
+ };
59
+ /**
60
+ * Formats an error as an MCP tool response with isError flag.
61
+ *
62
+ * @param error - Error object or message string
63
+ * @returns Formatted MCP tool error response
64
+ */
65
+ export declare function formatErrorResponse(error: Error | string): {
66
+ content: {
67
+ type: "text";
68
+ text: string;
69
+ }[];
70
+ isError: boolean;
71
+ };
72
+ /**
73
+ * Validated pagination parameters with helper methods.
74
+ */
75
+ export interface ValidatedPagination {
76
+ /** Validated offset (guaranteed >= 0) */
77
+ offset: number;
78
+ /** Validated limit (guaranteed within SEARCH_LIMITS.MIN to SEARCH_LIMITS.MAX) */
79
+ limit: number;
80
+ /**
81
+ * Check if there are more results beyond the current page.
82
+ * @param totalCount - Total number of items
83
+ * @returns true if there are more items after this page
84
+ */
85
+ hasMore: (totalCount: number) => boolean;
86
+ }
87
+ /**
88
+ * Validates and normalizes pagination parameters.
89
+ * Ensures offset is non-negative and limit is within configured bounds.
90
+ *
91
+ * @param offset - Starting position (default: 0)
92
+ * @param limit - Maximum results to return (default: SEARCH_LIMITS.DEFAULT)
93
+ * @returns Validated pagination parameters with helper methods
94
+ *
95
+ * @example
96
+ * ```typescript
97
+ * const pagination = validatePagination(10, 50);
98
+ * const results = items.slice(pagination.offset, pagination.offset + pagination.limit);
99
+ * if (pagination.hasMore(items.length)) {
100
+ * console.log('More results available');
101
+ * }
102
+ * ```
103
+ */
104
+ export declare function validatePagination(offset?: number, limit?: number): ValidatedPagination;
105
+ /**
106
+ * Applies pagination to an array of items.
107
+ *
108
+ * @param items - Array to paginate
109
+ * @param pagination - Validated pagination parameters
110
+ * @returns Paginated slice of the array
111
+ *
112
+ * @example
113
+ * ```typescript
114
+ * const pagination = validatePagination(offset, limit);
115
+ * const pageResults = applyPagination(allResults, pagination);
116
+ * ```
117
+ */
118
+ export declare function applyPagination<T>(items: T[], pagination: ValidatedPagination): T[];
119
+ /**
120
+ * Applies pagination using raw offset and limit values.
121
+ * Combines validation and application in one call.
122
+ *
123
+ * @param items - Array to paginate
124
+ * @param offset - Starting position
125
+ * @param limit - Maximum results
126
+ * @returns Paginated slice of the array
127
+ */
128
+ export declare function paginateArray<T>(items: T[], offset?: number, limit?: number): T[];
129
+ /**
130
+ * Calculates pagination metadata for a result set.
131
+ *
132
+ * @param totalCount - Total number of items
133
+ * @param offset - Current offset
134
+ * @param limit - Current limit
135
+ * @returns Pagination metadata
136
+ */
137
+ export declare function getPaginationMeta(totalCount: number, offset?: number, limit?: number): {
138
+ totalCount: number;
139
+ offset: number;
140
+ limit: number;
141
+ hasMore: boolean;
142
+ pageNumber: number;
143
+ totalPages: number;
144
+ };
145
+ //# sourceMappingURL=formatters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/utils/formatters.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO;;;;;EAI/C;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM;;;;;EAIjD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM;;;;;EAIhD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM;;;;;;EAMxD;AAID;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,GAAE,MAAU,EAClB,KAAK,GAAE,MAA8B,GACpC,mBAAmB,CAYrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,KAAK,EAAE,CAAC,EAAE,EACV,UAAU,EAAE,mBAAmB,GAC9B,CAAC,EAAE,CAEL;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,EAAE,EACV,MAAM,GAAE,MAAU,EAClB,KAAK,GAAE,MAA8B,GACpC,CAAC,EAAE,CAGL;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,MAAU,EAClB,KAAK,GAAE,MAA8B,GACpC;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAWA"}
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Response and Pagination Formatters
3
+ *
4
+ * Consolidated module for MCP tool response formatting and pagination utilities.
5
+ * Centralizes response formatting for MCP tool calls to eliminate redundant patterns.
6
+ *
7
+ * @module utils/formatters
8
+ */
9
+ import { SEARCH_LIMITS } from './constants.js';
10
+ /**
11
+ * Formats data as an MCP tool response with JSON content.
12
+ * Centralizes the response format to ensure consistency and reduce duplication.
13
+ *
14
+ * @param data - Any data to be JSON stringified
15
+ * @returns Formatted MCP tool response
16
+ */
17
+ export function formatToolResponse(data) {
18
+ return {
19
+ content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
20
+ };
21
+ }
22
+ /**
23
+ * Formats a simple text message as an MCP tool response.
24
+ * Use for success messages that don't need JSON formatting.
25
+ *
26
+ * @param message - Plain text message
27
+ * @returns Formatted MCP tool response
28
+ */
29
+ export function formatTextResponse(message) {
30
+ return {
31
+ content: [{ type: 'text', text: message }],
32
+ };
33
+ }
34
+ /**
35
+ * Formats raw string content as an MCP tool response.
36
+ * Use for export formats that return pre-formatted strings (markdown, CSV, etc.)
37
+ *
38
+ * @param content - Raw string content
39
+ * @returns Formatted MCP tool response
40
+ */
41
+ export function formatRawResponse(content) {
42
+ return {
43
+ content: [{ type: 'text', text: content }],
44
+ };
45
+ }
46
+ /**
47
+ * Formats an error as an MCP tool response with isError flag.
48
+ *
49
+ * @param error - Error object or message string
50
+ * @returns Formatted MCP tool error response
51
+ */
52
+ export function formatErrorResponse(error) {
53
+ const message = error instanceof Error ? error.message : error;
54
+ return {
55
+ content: [{ type: 'text', text: message }],
56
+ isError: true,
57
+ };
58
+ }
59
+ /**
60
+ * Validates and normalizes pagination parameters.
61
+ * Ensures offset is non-negative and limit is within configured bounds.
62
+ *
63
+ * @param offset - Starting position (default: 0)
64
+ * @param limit - Maximum results to return (default: SEARCH_LIMITS.DEFAULT)
65
+ * @returns Validated pagination parameters with helper methods
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * const pagination = validatePagination(10, 50);
70
+ * const results = items.slice(pagination.offset, pagination.offset + pagination.limit);
71
+ * if (pagination.hasMore(items.length)) {
72
+ * console.log('More results available');
73
+ * }
74
+ * ```
75
+ */
76
+ export function validatePagination(offset = 0, limit = SEARCH_LIMITS.DEFAULT) {
77
+ const validatedOffset = Math.max(0, offset);
78
+ const validatedLimit = Math.min(Math.max(SEARCH_LIMITS.MIN, limit), SEARCH_LIMITS.MAX);
79
+ return {
80
+ offset: validatedOffset,
81
+ limit: validatedLimit,
82
+ hasMore: (totalCount) => validatedOffset + validatedLimit < totalCount,
83
+ };
84
+ }
85
+ /**
86
+ * Applies pagination to an array of items.
87
+ *
88
+ * @param items - Array to paginate
89
+ * @param pagination - Validated pagination parameters
90
+ * @returns Paginated slice of the array
91
+ *
92
+ * @example
93
+ * ```typescript
94
+ * const pagination = validatePagination(offset, limit);
95
+ * const pageResults = applyPagination(allResults, pagination);
96
+ * ```
97
+ */
98
+ export function applyPagination(items, pagination) {
99
+ return items.slice(pagination.offset, pagination.offset + pagination.limit);
100
+ }
101
+ /**
102
+ * Applies pagination using raw offset and limit values.
103
+ * Combines validation and application in one call.
104
+ *
105
+ * @param items - Array to paginate
106
+ * @param offset - Starting position
107
+ * @param limit - Maximum results
108
+ * @returns Paginated slice of the array
109
+ */
110
+ export function paginateArray(items, offset = 0, limit = SEARCH_LIMITS.DEFAULT) {
111
+ const pagination = validatePagination(offset, limit);
112
+ return applyPagination(items, pagination);
113
+ }
114
+ /**
115
+ * Calculates pagination metadata for a result set.
116
+ *
117
+ * @param totalCount - Total number of items
118
+ * @param offset - Current offset
119
+ * @param limit - Current limit
120
+ * @returns Pagination metadata
121
+ */
122
+ export function getPaginationMeta(totalCount, offset = 0, limit = SEARCH_LIMITS.DEFAULT) {
123
+ const pagination = validatePagination(offset, limit);
124
+ return {
125
+ totalCount,
126
+ offset: pagination.offset,
127
+ limit: pagination.limit,
128
+ hasMore: pagination.hasMore(totalCount),
129
+ pageNumber: Math.floor(pagination.offset / pagination.limit) + 1,
130
+ totalPages: Math.ceil(totalCount / pagination.limit),
131
+ };
132
+ }
133
+ //# sourceMappingURL=formatters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../src/utils/formatters.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAa/C;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAa;IAC9C,OAAO;QACL,OAAO,EAAE,CAA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AAC,eAAe,GAAG,cAAc,GAAG,UAAU;KAC/E,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAU,EACV,UAA+B;IAE/B,OAAO,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAU,EACV,SAAiB,CAAC,EAClB,QAAgB,aAAa,CAAC,OAAO;IAErC,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACrD,OAAO,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAAkB,EAClB,SAAiB,CAAC,EAClB,QAAgB,aAAa,CAAC,OAAO;IASrC,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAErD,OAAO;QACL,UAAU;QACV,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC;QACvC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC;QAChE,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC;KACrD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Utilities Module Barrel Export
3
+ *
4
+ * Centralizes all utility exports for convenient importing.
5
+ * Consolidated from 17 files to 9 focused modules (Phase 5 cleanup).
6
+ *
7
+ * @module utils
8
+ */
9
+ export { KnowledgeGraphError, EntityNotFoundError, RelationNotFoundError, DuplicateEntityError, ValidationError, CycleDetectedError, InvalidImportanceError, FileOperationError, ImportError, ExportError, InsufficientEntitiesError, OperationCancelledError, } from './errors.js';
10
+ export { FILE_EXTENSIONS, FILE_SUFFIXES, DEFAULT_FILE_NAMES, ENV_VARS, DEFAULT_BASE_DIR, LOG_PREFIXES, SIMILARITY_WEIGHTS, DEFAULT_DUPLICATE_THRESHOLD, SEARCH_LIMITS, IMPORTANCE_RANGE, GRAPH_LIMITS, QUERY_LIMITS, COMPRESSION_CONFIG, STREAMING_CONFIG, type CompressionQuality, } from './constants.js';
11
+ export { compress, decompress, compressFile, decompressFile, compressToBase64, decompressFromBase64, hasBrotliExtension, getCompressionRatio, createMetadata, createUncompressedMetadata, type CompressionOptions, type CompressionResult, type CompressionMetadata, } from './compressionUtil.js';
12
+ export { CompressedCache, type CompressedCacheOptions, type CompressedCacheStats, } from './compressedCache.js';
13
+ export { logger } from './logger.js';
14
+ export { levenshteinDistance, calculateTF, calculateIDF, calculateIDFFromTokenSets, calculateTFIDF, tokenize, } from './searchAlgorithms.js';
15
+ export { NameIndex, TypeIndex, LowercaseCache, RelationIndex, } from './indexes.js';
16
+ export { SearchCache, searchCaches, clearAllSearchCaches, getAllCacheStats, cleanupAllCaches, type CacheStats, } from './searchCache.js';
17
+ export { EntitySchema, CreateEntitySchema, UpdateEntitySchema, RelationSchema, CreateRelationSchema, SearchQuerySchema, DateRangeSchema, TagAliasSchema, ExportFormatSchema, BatchCreateEntitiesSchema, BatchCreateRelationsSchema, EntityNamesSchema, DeleteRelationsSchema, AddObservationInputSchema, AddObservationsInputSchema, DeleteObservationInputSchema, DeleteObservationsInputSchema, ArchiveCriteriaSchema, SavedSearchInputSchema, SavedSearchUpdateSchema, ImportFormatSchema, ExtendedExportFormatSchema, MergeStrategySchema, ExportFilterSchema, OptionalTagsSchema, OptionalEntityNamesSchema, type EntityInput, type CreateEntityInput, type UpdateEntityInput, type RelationInput, type CreateRelationInput, type SearchQuery, type DateRange, type TagAliasInput, type AddObservationInput, type DeleteObservationInput, type ArchiveCriteriaInput, type SavedSearchInput, type SavedSearchUpdateInput, type ImportFormatInput, type ExtendedExportFormatInput, type MergeStrategyInput, type ExportFilterInput, type ValidationResult, formatZodErrors, validateWithSchema, validateSafe, validateArrayWithSchema, validateEntity, validateRelation, validateImportance, validateTags, } from './schemas.js';
18
+ export { formatToolResponse, formatTextResponse, formatRawResponse, formatErrorResponse, type ToolResponse, validatePagination, applyPagination, paginateArray, getPaginationMeta, type ValidatedPagination, } from './formatters.js';
19
+ export { fnv1aHash, findEntityByName, findEntitiesByNames, entityExists, getEntityIndex, removeEntityByName, getEntityNameSet, groupEntitiesByType, touchEntity, normalizeTag, normalizeTags, hasMatchingTag, hasAllTags, filterByTags, addUniqueTags, removeTags, isWithinDateRange, parseDateRange, isValidISODate, getCurrentTimestamp, isWithinImportanceRange, filterByImportance, filterByCreatedDate, filterByModifiedDate, filterByEntityType, entityPassesFilters, type CommonSearchFilters, validateFilePath, defaultMemoryPath, ensureMemoryFilePath, sanitizeObject, escapeCsvFormula, } from './entityUtils.js';
20
+ export { parallelMap, parallelFilter, getPoolStats, shutdownParallelUtils, } from './parallelUtils.js';
21
+ export { TaskPriority, TaskStatus, type Task, type TaskResult, type ProgressCallback, type TaskBatchOptions, type QueueStats, TaskQueue, batchProcess, rateLimitedProcess, withRetry, debounce, throttle, } from './taskScheduler.js';
22
+ export { checkCancellation, createProgressReporter, createProgress, executeWithPhases, processBatchesWithProgress, type PhaseDefinition, } from './operationUtils.js';
23
+ export { WorkerPoolManager, getWorkerPoolManager, type WorkerPoolConfig, type ExtendedPoolStats, type PoolEventCallback, } from './WorkerPoolManager.js';
24
+ export { BatchProcessor, processBatch, processWithRetry, chunkArray, parallelLimit, mapParallel, filterParallel, type BatchProgress, type BatchProgressCallback, type BatchItemResult, type BatchProcessResult, type BatchProcessorOptions, } from './BatchProcessor.js';
25
+ export { MemoryMonitor, globalMemoryMonitor, type ComponentMemoryUsage, type MemoryUsageStats, type MemoryThresholds, type MemoryAlert, type MemoryChangeCallback, } from './MemoryMonitor.js';
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,2BAA2B,EAC3B,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,0BAA0B,EAC1B,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACzB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,yBAAyB,EACzB,cAAc,EACd,QAAQ,GACT,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,SAAS,EACT,SAAS,EACT,cAAc,EACd,aAAa,GACd,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,WAAW,EACX,YAAY,EACZ,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BAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Utilities Module Barrel Export
3
+ *
4
+ * Centralizes all utility exports for convenient importing.
5
+ * Consolidated from 17 files to 9 focused modules (Phase 5 cleanup).
6
+ *
7
+ * @module utils
8
+ */
9
+ // ==================== Error Types ====================
10
+ export { KnowledgeGraphError, EntityNotFoundError, RelationNotFoundError, DuplicateEntityError, ValidationError, CycleDetectedError, InvalidImportanceError, FileOperationError, ImportError, ExportError, InsufficientEntitiesError, OperationCancelledError, } from './errors.js';
11
+ // ==================== Constants ====================
12
+ export { FILE_EXTENSIONS, FILE_SUFFIXES, DEFAULT_FILE_NAMES, ENV_VARS, DEFAULT_BASE_DIR, LOG_PREFIXES, SIMILARITY_WEIGHTS, DEFAULT_DUPLICATE_THRESHOLD, SEARCH_LIMITS, IMPORTANCE_RANGE, GRAPH_LIMITS, QUERY_LIMITS, COMPRESSION_CONFIG, STREAMING_CONFIG, } from './constants.js';
13
+ // ==================== Compression Utilities ====================
14
+ export { compress, decompress, compressFile, decompressFile, compressToBase64, decompressFromBase64, hasBrotliExtension, getCompressionRatio, createMetadata, createUncompressedMetadata, } from './compressionUtil.js';
15
+ // ==================== Compressed Cache ====================
16
+ export { CompressedCache, } from './compressedCache.js';
17
+ // ==================== Logger ====================
18
+ export { logger } from './logger.js';
19
+ // ==================== Search Algorithms ====================
20
+ export { levenshteinDistance, calculateTF, calculateIDF, calculateIDFFromTokenSets, calculateTFIDF, tokenize, } from './searchAlgorithms.js';
21
+ // ==================== Indexes ====================
22
+ export { NameIndex, TypeIndex, LowercaseCache, RelationIndex, } from './indexes.js';
23
+ // ==================== Search Cache ====================
24
+ export { SearchCache, searchCaches, clearAllSearchCaches, getAllCacheStats, cleanupAllCaches, } from './searchCache.js';
25
+ // ==================== Schemas and Validation ====================
26
+ // Consolidated from: schemas.ts, validationHelper.ts, validationUtils.ts
27
+ export {
28
+ // Zod schemas - Entity/Relation
29
+ EntitySchema, CreateEntitySchema, UpdateEntitySchema, RelationSchema, CreateRelationSchema, SearchQuerySchema, DateRangeSchema, TagAliasSchema, ExportFormatSchema, BatchCreateEntitiesSchema, BatchCreateRelationsSchema, EntityNamesSchema, DeleteRelationsSchema,
30
+ // Zod schemas - Observations
31
+ AddObservationInputSchema, AddObservationsInputSchema, DeleteObservationInputSchema, DeleteObservationsInputSchema,
32
+ // Zod schemas - Archive
33
+ ArchiveCriteriaSchema,
34
+ // Zod schemas - Saved Search
35
+ SavedSearchInputSchema, SavedSearchUpdateSchema,
36
+ // Zod schemas - Import/Export
37
+ ImportFormatSchema, ExtendedExportFormatSchema, MergeStrategySchema, ExportFilterSchema,
38
+ // Zod schemas - Search
39
+ OptionalTagsSchema, OptionalEntityNamesSchema,
40
+ // Zod helpers
41
+ formatZodErrors, validateWithSchema, validateSafe, validateArrayWithSchema,
42
+ // Manual validation functions
43
+ validateEntity, validateRelation, validateImportance, validateTags, } from './schemas.js';
44
+ // ==================== Formatters ====================
45
+ // Consolidated from: responseFormatter.ts, paginationUtils.ts
46
+ export {
47
+ // Response formatting
48
+ formatToolResponse, formatTextResponse, formatRawResponse, formatErrorResponse,
49
+ // Pagination utilities
50
+ validatePagination, applyPagination, paginateArray, getPaginationMeta, } from './formatters.js';
51
+ // ==================== Entity Utilities ====================
52
+ // Consolidated from: entityUtils.ts, tagUtils.ts, dateUtils.ts, filterUtils.ts, pathUtils.ts
53
+ export {
54
+ // Hash functions (Phase 12 Sprint 1)
55
+ fnv1aHash,
56
+ // Entity lookup
57
+ findEntityByName, findEntitiesByNames, entityExists, getEntityIndex, removeEntityByName, getEntityNameSet, groupEntitiesByType, touchEntity,
58
+ // Tag utilities
59
+ normalizeTag, normalizeTags, hasMatchingTag, hasAllTags, filterByTags, addUniqueTags, removeTags,
60
+ // Date utilities
61
+ isWithinDateRange, parseDateRange, isValidISODate, getCurrentTimestamp,
62
+ // Filter utilities
63
+ isWithinImportanceRange, filterByImportance, filterByCreatedDate, filterByModifiedDate, filterByEntityType, entityPassesFilters,
64
+ // Path utilities
65
+ validateFilePath, defaultMemoryPath, ensureMemoryFilePath,
66
+ // Security utilities
67
+ sanitizeObject, escapeCsvFormula, } from './entityUtils.js';
68
+ // ==================== Parallel Utilities ====================
69
+ export { parallelMap, parallelFilter, getPoolStats, shutdownParallelUtils, } from './parallelUtils.js';
70
+ // ==================== Task Scheduler ====================
71
+ export {
72
+ // Types and Enums
73
+ TaskPriority, TaskStatus,
74
+ // Task Queue
75
+ TaskQueue,
76
+ // Batch Processing
77
+ batchProcess, rateLimitedProcess, withRetry,
78
+ // Rate Limiting
79
+ debounce, throttle, } from './taskScheduler.js';
80
+ // ==================== Operation Utilities (Phase 9B) ====================
81
+ export { checkCancellation, createProgressReporter, createProgress, executeWithPhases, processBatchesWithProgress, } from './operationUtils.js';
82
+ // ==================== Worker Pool Manager (Phase 12 Sprint 2) ====================
83
+ export { WorkerPoolManager, getWorkerPoolManager, } from './WorkerPoolManager.js';
84
+ // ==================== Batch Processor (Phase 12 Sprint 2) ====================
85
+ export { BatchProcessor, processBatch, processWithRetry, chunkArray, parallelLimit, mapParallel, filterParallel, } from './BatchProcessor.js';
86
+ // ==================== Memory Monitor (Phase 12 Sprint 6) ====================
87
+ export { MemoryMonitor, globalMemoryMonitor, } from './MemoryMonitor.js';
88
+ //# sourceMappingURL=index.js.map