codehere 0.4.0 → 0.5.0-alpha.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 (231) hide show
  1. package/README.md +7 -0
  2. package/dist/application/agents/execution-agent.js +2 -2
  3. package/dist/application/agents/execution-agent.js.map +1 -1
  4. package/dist/application/agents/planning-agent.d.ts.map +1 -1
  5. package/dist/application/agents/planning-agent.js +16 -8
  6. package/dist/application/agents/planning-agent.js.map +1 -1
  7. package/dist/application/agents/validation-agent.js +2 -2
  8. package/dist/application/agents/validation-agent.js.map +1 -1
  9. package/dist/application/services/dependency-container.d.ts +30 -6
  10. package/dist/application/services/dependency-container.d.ts.map +1 -1
  11. package/dist/application/services/dependency-container.js +75 -43
  12. package/dist/application/services/dependency-container.js.map +1 -1
  13. package/dist/application/services/intelligent-router.d.ts.map +1 -1
  14. package/dist/application/services/intelligent-router.js +6 -3
  15. package/dist/application/services/intelligent-router.js.map +1 -1
  16. package/dist/domain/entities/task.d.ts.map +1 -1
  17. package/dist/domain/entities/task.js +1 -1
  18. package/dist/domain/entities/task.js.map +1 -1
  19. package/dist/domain/errors/embeddings-not-found-error.d.ts +9 -0
  20. package/dist/domain/errors/embeddings-not-found-error.d.ts.map +1 -0
  21. package/dist/domain/errors/embeddings-not-found-error.js +13 -0
  22. package/dist/domain/errors/embeddings-not-found-error.js.map +1 -0
  23. package/dist/domain/interfaces/embedding-repository.interface.d.ts +5 -0
  24. package/dist/domain/interfaces/embedding-repository.interface.d.ts.map +1 -1
  25. package/dist/domain/services/environment-mode-manager.d.ts +4 -10
  26. package/dist/domain/services/environment-mode-manager.d.ts.map +1 -1
  27. package/dist/domain/services/environment-mode-manager.js +7 -22
  28. package/dist/domain/services/environment-mode-manager.js.map +1 -1
  29. package/dist/domain/services/risk-tier-detector.d.ts +8 -9
  30. package/dist/domain/services/risk-tier-detector.d.ts.map +1 -1
  31. package/dist/domain/services/risk-tier-detector.js +53 -40
  32. package/dist/domain/services/risk-tier-detector.js.map +1 -1
  33. package/dist/embed.d.ts.map +1 -1
  34. package/dist/embed.js +18 -8
  35. package/dist/embed.js.map +1 -1
  36. package/dist/index.js +308 -48
  37. package/dist/index.js.map +1 -1
  38. package/dist/infrastructure/ai/cohere-ai-service.js +3 -3
  39. package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
  40. package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -1
  41. package/dist/infrastructure/ai/provider-ai-service.js +6 -6
  42. package/dist/infrastructure/ai/provider-ai-service.js.map +1 -1
  43. package/dist/infrastructure/cache/query-result-cache.d.ts +14 -55
  44. package/dist/infrastructure/cache/query-result-cache.d.ts.map +1 -1
  45. package/dist/infrastructure/cache/query-result-cache.js +40 -112
  46. package/dist/infrastructure/cache/query-result-cache.js.map +1 -1
  47. package/dist/infrastructure/cache/response-cache.d.ts +10 -78
  48. package/dist/infrastructure/cache/response-cache.d.ts.map +1 -1
  49. package/dist/infrastructure/cache/response-cache.js +22 -198
  50. package/dist/infrastructure/cache/response-cache.js.map +1 -1
  51. package/dist/infrastructure/cache/security-scan-cache.d.ts +8 -49
  52. package/dist/infrastructure/cache/security-scan-cache.d.ts.map +1 -1
  53. package/dist/infrastructure/cache/security-scan-cache.js +25 -102
  54. package/dist/infrastructure/cache/security-scan-cache.js.map +1 -1
  55. package/dist/infrastructure/completion/bash-completion.d.ts +2 -3
  56. package/dist/infrastructure/completion/bash-completion.d.ts.map +1 -1
  57. package/dist/infrastructure/completion/bash-completion.js +11 -87
  58. package/dist/infrastructure/completion/bash-completion.js.map +1 -1
  59. package/dist/infrastructure/completion/fish-completion.d.ts +2 -3
  60. package/dist/infrastructure/completion/fish-completion.d.ts.map +1 -1
  61. package/dist/infrastructure/completion/fish-completion.js +15 -58
  62. package/dist/infrastructure/completion/fish-completion.js.map +1 -1
  63. package/dist/infrastructure/completion/zsh-completion.d.ts +2 -3
  64. package/dist/infrastructure/completion/zsh-completion.d.ts.map +1 -1
  65. package/dist/infrastructure/completion/zsh-completion.js +18 -73
  66. package/dist/infrastructure/completion/zsh-completion.js.map +1 -1
  67. package/dist/infrastructure/config/config-manager.js +2 -2
  68. package/dist/infrastructure/config/config-manager.js.map +1 -1
  69. package/dist/infrastructure/context/conversation-context.d.ts +27 -31
  70. package/dist/infrastructure/context/conversation-context.d.ts.map +1 -1
  71. package/dist/infrastructure/context/conversation-context.js +94 -136
  72. package/dist/infrastructure/context/conversation-context.js.map +1 -1
  73. package/dist/infrastructure/context/session-manager.d.ts +27 -11
  74. package/dist/infrastructure/context/session-manager.d.ts.map +1 -1
  75. package/dist/infrastructure/context/session-manager.js +69 -73
  76. package/dist/infrastructure/context/session-manager.js.map +1 -1
  77. package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -1
  78. package/dist/infrastructure/providers/cohere-provider.js +102 -17
  79. package/dist/infrastructure/providers/cohere-provider.js.map +1 -1
  80. package/dist/infrastructure/providers/openrouter-provider.d.ts +42 -0
  81. package/dist/infrastructure/providers/openrouter-provider.d.ts.map +1 -0
  82. package/dist/infrastructure/providers/openrouter-provider.js +399 -0
  83. package/dist/infrastructure/providers/openrouter-provider.js.map +1 -0
  84. package/dist/infrastructure/serialization/toon-serializer.d.ts +45 -0
  85. package/dist/infrastructure/serialization/toon-serializer.d.ts.map +1 -0
  86. package/dist/infrastructure/serialization/toon-serializer.js +119 -0
  87. package/dist/infrastructure/serialization/toon-serializer.js.map +1 -0
  88. package/dist/infrastructure/storage/embeddings-path.d.ts +18 -0
  89. package/dist/infrastructure/storage/embeddings-path.d.ts.map +1 -0
  90. package/dist/infrastructure/storage/embeddings-path.js +37 -0
  91. package/dist/infrastructure/storage/embeddings-path.js.map +1 -0
  92. package/dist/infrastructure/storage/plan-repository.d.ts +2 -0
  93. package/dist/infrastructure/storage/plan-repository.d.ts.map +1 -1
  94. package/dist/infrastructure/storage/plan-repository.js +36 -73
  95. package/dist/infrastructure/storage/plan-repository.js.map +1 -1
  96. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +10 -1
  97. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +1 -1
  98. package/dist/infrastructure/storage/sqlite-embedding-repository.js +37 -3
  99. package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +1 -1
  100. package/dist/infrastructure/storage/task-helpers.d.ts +11 -0
  101. package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -1
  102. package/dist/infrastructure/storage/task-helpers.js +47 -7
  103. package/dist/infrastructure/storage/task-helpers.js.map +1 -1
  104. package/dist/infrastructure/storage/task-repository.d.ts.map +1 -1
  105. package/dist/infrastructure/storage/task-repository.js.map +1 -1
  106. package/dist/infrastructure/ux/capability-boundaries.d.ts +9 -37
  107. package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -1
  108. package/dist/infrastructure/ux/capability-boundaries.js +23 -148
  109. package/dist/infrastructure/ux/capability-boundaries.js.map +1 -1
  110. package/dist/infrastructure/ux/comprehensive-formatter.d.ts +12 -54
  111. package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -1
  112. package/dist/infrastructure/ux/comprehensive-formatter.js +87 -182
  113. package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -1
  114. package/dist/infrastructure/ux/contextual-feature-discovery.d.ts +5 -18
  115. package/dist/infrastructure/ux/contextual-feature-discovery.d.ts.map +1 -1
  116. package/dist/infrastructure/ux/contextual-feature-discovery.js +5 -139
  117. package/dist/infrastructure/ux/contextual-feature-discovery.js.map +1 -1
  118. package/dist/infrastructure/ux/feature-discovery.d.ts +3 -33
  119. package/dist/infrastructure/ux/feature-discovery.d.ts.map +1 -1
  120. package/dist/infrastructure/ux/feature-discovery.js +5 -181
  121. package/dist/infrastructure/ux/feature-discovery.js.map +1 -1
  122. package/dist/infrastructure/ux/feedback-prompt.d.ts +15 -31
  123. package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -1
  124. package/dist/infrastructure/ux/feedback-prompt.js +30 -166
  125. package/dist/infrastructure/ux/feedback-prompt.js.map +1 -1
  126. package/dist/infrastructure/ux/progress-indicator.d.ts +3 -5
  127. package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
  128. package/dist/infrastructure/ux/progress-indicator.js +34 -49
  129. package/dist/infrastructure/ux/progress-indicator.js.map +1 -1
  130. package/dist/infrastructure/ux/review-checkpoint.d.ts +3 -1
  131. package/dist/infrastructure/ux/review-checkpoint.d.ts.map +1 -1
  132. package/dist/infrastructure/ux/review-checkpoint.js +33 -80
  133. package/dist/infrastructure/ux/review-checkpoint.js.map +1 -1
  134. package/dist/infrastructure/ux/staged-feature-intro.d.ts +14 -39
  135. package/dist/infrastructure/ux/staged-feature-intro.d.ts.map +1 -1
  136. package/dist/infrastructure/ux/staged-feature-intro.js +12 -132
  137. package/dist/infrastructure/ux/staged-feature-intro.js.map +1 -1
  138. package/dist/infrastructure/ux/syntax-highlighter.d.ts +1 -2
  139. package/dist/infrastructure/ux/syntax-highlighter.d.ts.map +1 -1
  140. package/dist/infrastructure/ux/syntax-highlighter.js +67 -148
  141. package/dist/infrastructure/ux/syntax-highlighter.js.map +1 -1
  142. package/dist/infrastructure/validation/agent-feedback.d.ts +25 -89
  143. package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -1
  144. package/dist/infrastructure/validation/agent-feedback.js +32 -204
  145. package/dist/infrastructure/validation/agent-feedback.js.map +1 -1
  146. package/dist/infrastructure/validation/agent-validation-helper.d.ts +53 -53
  147. package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -1
  148. package/dist/infrastructure/validation/agent-validation-helper.js +110 -61
  149. package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -1
  150. package/dist/infrastructure/validation/review-handler.d.ts +13 -41
  151. package/dist/infrastructure/validation/review-handler.d.ts.map +1 -1
  152. package/dist/infrastructure/validation/review-handler.js +23 -189
  153. package/dist/infrastructure/validation/review-handler.js.map +1 -1
  154. package/dist/infrastructure/validation/summary-aggregator.d.ts +25 -22
  155. package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -1
  156. package/dist/infrastructure/validation/summary-aggregator.js +47 -133
  157. package/dist/infrastructure/validation/summary-aggregator.js.map +1 -1
  158. package/dist/infrastructure/validation/summary-extractor.d.ts +13 -48
  159. package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -1
  160. package/dist/infrastructure/validation/summary-extractor.js +32 -89
  161. package/dist/infrastructure/validation/summary-extractor.js.map +1 -1
  162. package/dist/infrastructure/validation/trace-summary.d.ts +30 -57
  163. package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -1
  164. package/dist/infrastructure/validation/trace-summary.js +37 -356
  165. package/dist/infrastructure/validation/trace-summary.js.map +1 -1
  166. package/dist/monitoring.d.ts +1 -1
  167. package/dist/monitoring.d.ts.map +1 -1
  168. package/dist/monitoring.js +12 -9
  169. package/dist/monitoring.js.map +1 -1
  170. package/dist/parallel-processor.d.ts.map +1 -1
  171. package/dist/parallel-processor.js +124 -45
  172. package/dist/parallel-processor.js.map +1 -1
  173. package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
  174. package/dist/presentation/cli/commands/ask-command.js +185 -128
  175. package/dist/presentation/cli/commands/ask-command.js.map +1 -1
  176. package/dist/presentation/cli/commands/config-command.d.ts.map +1 -1
  177. package/dist/presentation/cli/commands/config-command.js +8 -6
  178. package/dist/presentation/cli/commands/config-command.js.map +1 -1
  179. package/dist/presentation/cli/commands/docs-command.d.ts +3 -1
  180. package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -1
  181. package/dist/presentation/cli/commands/docs-command.js +13 -184
  182. package/dist/presentation/cli/commands/docs-command.js.map +1 -1
  183. package/dist/presentation/cli/commands/fix-command.d.ts +2 -0
  184. package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -1
  185. package/dist/presentation/cli/commands/fix-command.js +25 -281
  186. package/dist/presentation/cli/commands/fix-command.js.map +1 -1
  187. package/dist/presentation/cli/commands/models-command.d.ts +13 -0
  188. package/dist/presentation/cli/commands/models-command.d.ts.map +1 -0
  189. package/dist/presentation/cli/commands/models-command.js +194 -0
  190. package/dist/presentation/cli/commands/models-command.js.map +1 -0
  191. package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
  192. package/dist/presentation/cli/commands/orchestrate-command.js +15 -7
  193. package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
  194. package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
  195. package/dist/presentation/cli/commands/plan-command.js +9 -6
  196. package/dist/presentation/cli/commands/plan-command.js.map +1 -1
  197. package/dist/presentation/cli/commands/product-command.d.ts +6 -4
  198. package/dist/presentation/cli/commands/product-command.d.ts.map +1 -1
  199. package/dist/presentation/cli/commands/product-command.js +12 -178
  200. package/dist/presentation/cli/commands/product-command.js.map +1 -1
  201. package/dist/presentation/cli/commands/review-command.d.ts +7 -7
  202. package/dist/presentation/cli/commands/review-command.d.ts.map +1 -1
  203. package/dist/presentation/cli/commands/review-command.js +148 -16
  204. package/dist/presentation/cli/commands/review-command.js.map +1 -1
  205. package/dist/presentation/cli/commands/run-command.d.ts +6 -8
  206. package/dist/presentation/cli/commands/run-command.d.ts.map +1 -1
  207. package/dist/presentation/cli/commands/run-command.js +182 -23
  208. package/dist/presentation/cli/commands/run-command.js.map +1 -1
  209. package/dist/presentation/cli/commands/setup-command.d.ts.map +1 -1
  210. package/dist/presentation/cli/commands/setup-command.js +15 -0
  211. package/dist/presentation/cli/commands/setup-command.js.map +1 -1
  212. package/dist/presentation/cli/commands/smart-command.js +1 -1
  213. package/dist/presentation/cli/commands/smart-command.js.map +1 -1
  214. package/dist/presentation/cli/commands/status-command.d.ts +3 -0
  215. package/dist/presentation/cli/commands/status-command.d.ts.map +1 -1
  216. package/dist/presentation/cli/commands/status-command.js +147 -156
  217. package/dist/presentation/cli/commands/status-command.js.map +1 -1
  218. package/dist/presentation/cli/commands/suggest-command.d.ts +3 -5
  219. package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -1
  220. package/dist/presentation/cli/commands/suggest-command.js +132 -19
  221. package/dist/presentation/cli/commands/suggest-command.js.map +1 -1
  222. package/dist/search.d.ts.map +1 -1
  223. package/dist/search.js +6 -1
  224. package/dist/search.js.map +1 -1
  225. package/dist/session.js +1 -1
  226. package/dist/session.js.map +1 -1
  227. package/dist/ui.d.ts +6 -0
  228. package/dist/ui.d.ts.map +1 -1
  229. package/dist/ui.js +35 -1
  230. package/dist/ui.js.map +1 -1
  231. package/package.json +8 -3
@@ -1,138 +1,66 @@
1
1
  /**
2
- * Infrastructure: Query Result Cache
3
- * Caches search results (query + topK results) to avoid redundant searches
2
+ * Query Result Cache
3
+ * Caches search query results
4
4
  *
5
- * Performance optimization: Reduces search latency by ~80% for repeated queries
6
- * Cache invalidation: Automatically clears on codebase re-index
5
+ * Phase 1: v0.5.0-alpha.0
7
6
  */
8
7
  import { createHash } from 'crypto';
9
- export class QueryResultCache {
8
+ class QueryResultCache {
10
9
  cache = new Map();
11
- maxSize = 500; // Max cached queries
12
- ttl = 60 * 60 * 1000; // 1 hour TTL
13
- accessOrder = []; // LRU tracking
14
- constructor(options) {
15
- this.maxSize = options?.maxSize || 500;
16
- this.ttl = options?.ttl || 60 * 60 * 1000;
17
- }
18
- /**
19
- * Generate cache key from query and topK
20
- */
21
- getCacheKey(query, topK) {
22
- const normalized = query.toLowerCase().trim();
23
- const key = `${normalized}:${topK}`;
24
- return createHash('sha256').update(key).digest('hex');
25
- }
26
- /**
27
- * Get cached result if available and not expired
28
- */
29
- get(query, topK) {
30
- const key = this.getCacheKey(query, topK);
10
+ hits = 0;
11
+ misses = 0;
12
+ ttl = 3600000; // 1 hour
13
+ get(query, maxResults) {
14
+ const key = this.getCacheKey(query, maxResults);
31
15
  const cached = this.cache.get(key);
32
- if (!cached) {
33
- this.recordMiss();
34
- return null;
35
- }
36
- // Check if expired
37
- const now = Date.now();
38
- if (now - cached.timestamp > this.ttl) {
39
- this.cache.delete(key);
40
- this.removeFromAccessOrder(key);
41
- this.recordMiss();
42
- return null;
16
+ if (cached) {
17
+ const age = Date.now() - cached.timestamp;
18
+ if (age < this.ttl) {
19
+ return cached.chunks;
20
+ }
21
+ else {
22
+ this.cache.delete(key);
23
+ }
43
24
  }
44
- // Update access order (LRU)
45
- this.updateAccessOrder(key);
46
- this.recordHit();
47
- return cached.chunks;
25
+ return null;
48
26
  }
49
- /**
50
- * Store result in cache
51
- */
52
- set(query, topK, chunks) {
53
- const key = this.getCacheKey(query, topK);
54
- // Evict oldest if cache is full
55
- if (this.cache.size >= this.maxSize && !this.cache.has(key)) {
56
- this.evictOldest();
57
- }
27
+ set(query, maxResults, chunks) {
28
+ const key = this.getCacheKey(query, maxResults);
58
29
  this.cache.set(key, {
59
30
  chunks,
60
31
  timestamp: Date.now(),
61
32
  query,
62
- topK,
63
33
  });
64
- this.updateAccessOrder(key);
65
- }
66
- /**
67
- * Clear all cached results (called on codebase re-index)
68
- */
69
- clear() {
70
- this.cache.clear();
71
- this.accessOrder = [];
72
- }
73
- /**
74
- * Get cache statistics
75
- */
76
- getStats() {
77
- const total = this.totalHits + this.totalMisses;
78
- return {
79
- size: this.cache.size,
80
- maxSize: this.maxSize,
81
- hitRate: total > 0 ? this.totalHits / total : 0,
82
- totalHits: this.totalHits,
83
- totalMisses: this.totalMisses,
84
- };
85
34
  }
86
- totalHits = 0;
87
- totalMisses = 0;
88
- /**
89
- * Record cache hit
90
- */
91
35
  recordHit() {
92
- this.totalHits++;
36
+ this.hits++;
93
37
  }
94
- /**
95
- * Record cache miss
96
- */
97
38
  recordMiss() {
98
- this.totalMisses++;
39
+ this.misses++;
99
40
  }
100
- /**
101
- * Update access order for LRU eviction
102
- */
103
- updateAccessOrder(key) {
104
- const index = this.accessOrder.indexOf(key);
105
- if (index > -1) {
106
- this.accessOrder.splice(index, 1);
107
- }
108
- this.accessOrder.push(key);
41
+ getStats() {
42
+ const total = this.hits + this.misses;
43
+ return {
44
+ hitRate: total > 0 ? this.hits / total : 0,
45
+ totalHits: this.hits,
46
+ totalMisses: this.misses,
47
+ };
109
48
  }
110
- /**
111
- * Remove key from access order
112
- */
113
- removeFromAccessOrder(key) {
114
- const index = this.accessOrder.indexOf(key);
115
- if (index > -1) {
116
- this.accessOrder.splice(index, 1);
117
- }
49
+ clear() {
50
+ this.cache.clear();
51
+ this.hits = 0;
52
+ this.misses = 0;
118
53
  }
119
- /**
120
- * Evict oldest entry (LRU)
121
- */
122
- evictOldest() {
123
- if (this.accessOrder.length === 0)
124
- return;
125
- const oldestKey = this.accessOrder[0];
126
- this.cache.delete(oldestKey);
127
- this.accessOrder.shift();
54
+ getCacheKey(query, maxResults) {
55
+ const normalized = query.trim().toLowerCase();
56
+ return createHash('sha256').update(`${normalized}:${maxResults}`).digest('hex');
128
57
  }
129
58
  }
130
- // Singleton instance
131
- let queryResultCacheInstance = null;
59
+ let instance = null;
132
60
  export function getQueryResultCache() {
133
- if (!queryResultCacheInstance) {
134
- queryResultCacheInstance = new QueryResultCache();
61
+ if (!instance) {
62
+ instance = new QueryResultCache();
135
63
  }
136
- return queryResultCacheInstance;
64
+ return instance;
137
65
  }
138
66
  //# sourceMappingURL=query-result-cache.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"query-result-cache.js","sourceRoot":"","sources":["../../../src/infrastructure/cache/query-result-cache.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAUpC,MAAM,OAAO,gBAAgB;IACnB,KAAK,GAA8B,IAAI,GAAG,EAAE,CAAC;IAC7C,OAAO,GAAW,GAAG,CAAC,CAAC,qBAAqB;IAC5C,GAAG,GAAW,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;IAC3C,WAAW,GAAa,EAAE,CAAC,CAAC,eAAe;IAEnD,YAAY,OAA4C;QACtD,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,GAAG,CAAC;QACvC,IAAI,CAAC,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,EAAE,GA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G,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;YACf,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,GAAW;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;YACf,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAED;;OAEG;IACK,WAAW;QACjB,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAE1C,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC7B,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;CACF;AAED,qBAAqB;AACrB,IAAI,wBAAwB,GAA4B,IAAI,CAAC;AAE7D,MAAM,UAAU,mBAAmB;IACjC,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAC9B,wBAAwB,GAAG,IAAI,gBAAgB,EAAE,CAAC;IACpD,CAAC;IACD,OAAO,wBAAwB,CAAC;AAClC,CAAC"}
1
+ {"version":3,"file":"query-result-cache.js","sourceRoot":"","sources":["../../../src/infrastructure/cache/query-result-cache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAQpC,MAAM,gBAAgB;IACZ,KAAK,GAA8B,IAAI,GAAG,EAA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CAAC;YAC1C,SAAS,EAAE,IAAI,CAAC,IAAI;YACpB,WAAW,EAAE,IAAI,CAAC,MAAM;SACzB,CAAC;IACJ,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAClB,CAAC;IAEO,WAAW,CAAC,KAAa,EAAE,UAAkB;QACnD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC9C,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,UAAU,IAAI,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClF,CAAC;CACF;AAED,IAAI,QAAQ,GAA4B,IAAI,CAAC;AAE7C,MAAM,UAAU,mBAAmB;IACjC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,GAAG,IAAI,gBAAgB,EAAE,CAAC;IACpC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1,86 +1,18 @@
1
1
  /**
2
- * Infrastructure: Response Cache
3
- * Caches AI chat responses to avoid redundant API calls for similar queries
2
+ * Response Cache
3
+ * Caches AI-generated responses
4
4
  *
5
- * Performance optimization: Reduces AI Chat latency by ~90% for cached queries
6
- * Uses fuzzy matching to cache similar queries (85%+ similarity)
5
+ * Phase 1: v0.5.0-alpha.0
7
6
  */
8
- export declare class ResponseCache {
7
+ import type { CodeChunk } from '../../domain/entities/code-chunk.js';
8
+ declare class ResponseCache {
9
9
  private cache;
10
- private maxSize;
11
- private ttl;
12
- private accessOrder;
13
- constructor(options?: {
14
- maxSize?: number;
15
- ttl?: number;
16
- });
17
- /**
18
- * Generate cache key from query and context hash
19
- */
10
+ private readonly ttl;
11
+ generateContextHash(chunks: CodeChunk[]): string;
12
+ get(query: string, contextHash: string, checkStale?: boolean): string | null;
13
+ set(query: string, response: string, contextHash: string): void;
20
14
  private getCacheKey;
21
- /**
22
- * Generate hash from context chunks (for cache key)
23
- */
24
- generateContextHash(chunks: Array<{
25
- filepath: string;
26
- content: string;
27
- }>): string;
28
- /**
29
- * Get cached response if available and not expired
30
- * OPTIMIZATION: Also checks for similar queries with fuzzy matching
31
- * Strategy: Try exact match first, then try without context hash (for same query, different context)
32
- */
33
- get(query: string, contextHash?: string, enableFuzzyMatch?: boolean): string | null;
34
- /**
35
- * Find similar query using word overlap similarity
36
- * Returns cached response if similarity >= threshold
37
- */
38
- private findSimilarQuery;
39
- /**
40
- * Calculate string similarity using word overlap (Jaccard similarity)
41
- * Returns value between 0.0 (no similarity) and 1.0 (identical)
42
- */
43
- private calculateSimilarity;
44
- /**
45
- * Store response in cache
46
- */
47
- set(query: string, answer: string, contextHash?: string): void;
48
- /**
49
- * Clear all cached responses
50
- */
51
- clear(): void;
52
- /**
53
- * Get cache statistics
54
- */
55
- getStats(): {
56
- size: number;
57
- maxSize: number;
58
- hitRate: number;
59
- totalHits: number;
60
- totalMisses: number;
61
- };
62
- private totalHits;
63
- private totalMisses;
64
- /**
65
- * Record cache hit
66
- */
67
- recordHit(): void;
68
- /**
69
- * Record cache miss
70
- */
71
- recordMiss(): void;
72
- /**
73
- * Update access order for LRU eviction
74
- */
75
- private updateAccessOrder;
76
- /**
77
- * Remove key from access order
78
- */
79
- private removeFromAccessOrder;
80
- /**
81
- * Evict oldest entry (LRU)
82
- */
83
- private evictOldest;
84
15
  }
85
16
  export declare function getResponseCache(): ResponseCache;
17
+ export {};
86
18
  //# sourceMappingURL=response-cache.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"response-cache.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/cache/response-cache.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,qBAAa,aAAa;IACxB,OAAO,CAAC,KAAK,CAA0C;IACvD,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,C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"","sources":["../../../src/infrastructure/cache/response-cache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AASrE,cAAM,aAAa;IACjB,OAAO,CAAC,KAAK,CAA0C;IACvD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAW;IAE/B,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM;IAKhD,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAE,OAAe,GAAG,MAAM,GAAG,IAAI;IAenF,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAS/D,OAAO,CAAC,WAAW;CAIpB;AAID,wBAAgB,gBAAgB,IAAI,aAAa,CAKhD"}
@@ -1,224 +1,48 @@
1
1
  /**
2
- * Infrastructure: Response Cache
3
- * Caches AI chat responses to avoid redundant API calls for similar queries
2
+ * Response Cache
3
+ * Caches AI-generated responses
4
4
  *
5
- * Performance optimization: Reduces AI Chat latency by ~90% for cached queries
6
- * Uses fuzzy matching to cache similar queries (85%+ similarity)
5
+ * Phase 1: v0.5.0-alpha.0
7
6
  */
8
7
  import { createHash } from 'crypto';
9
- export class ResponseCache {
8
+ class ResponseCache {
10
9
  cache = new Map();
11
- maxSize = 200; // Max cached responses
12
- ttl = 60 * 60 * 1000; // 1 hour TTL
13
- accessOrder = []; // LRU tracking
14
- constructor(options) {
15
- this.maxSize = options?.maxSize || 200;
16
- this.ttl = options?.ttl || 60 * 60 * 1000;
17
- }
18
- /**
19
- * Generate cache key from query and context hash
20
- */
21
- getCacheKey(query, contextHash) {
22
- const normalized = query.trim().toLowerCase();
23
- const key = contextHash ? `${normalized}:${contextHash}` : normalized;
24
- return createHash('sha256').update(key).digest('hex');
25
- }
26
- /**
27
- * Generate hash from context chunks (for cache key)
28
- */
10
+ ttl = 3600000; // 1 hour
29
11
  generateContextHash(chunks) {
30
- // Create hash from filepaths and content lengths (not full content for performance)
31
- const contextKey = chunks
32
- .map(c => `${c.filepath}:${c.content.length}`)
33
- .sort()
34
- .join('|');
35
- return createHash('sha256').update(contextKey).digest('hex').substring(0, 16);
12
+ const chunkIds = chunks.map(c => c.id || c.filepath).sort().join(',');
13
+ return createHash('sha256').update(chunkIds).digest('hex');
36
14
  }
37
- /**
38
- * Get cached response if available and not expired
39
- * OPTIMIZATION: Also checks for similar queries with fuzzy matching
40
- * Strategy: Try exact match first, then try without context hash (for same query, different context)
41
- */
42
- get(query, contextHash, enableFuzzyMatch = true) {
43
- // Try exact match with context hash first
44
- const keyWithContext = this.getCacheKey(query, contextHash);
45
- let cached = this.cache.get(keyWithContext);
15
+ get(query, contextHash, checkStale = false) {
16
+ const key = this.getCacheKey(query, contextHash);
17
+ const cached = this.cache.get(key);
46
18
  if (cached) {
47
- const now = Date.now();
48
- if (now - cached.timestamp > this.ttl) {
49
- this.cache.delete(keyWithContext);
50
- this.removeFromAccessOrder(keyWithContext);
19
+ if (!checkStale || (Date.now() - cached.timestamp) < this.ttl) {
20
+ return cached.response;
51
21
  }
52
22
  else {
53
- this.updateAccessOrder(keyWithContext);
54
- this.recordHit();
55
- return cached.answer;
56
- }
57
- }
58
- // Try without context hash (same query, different context order is usually fine)
59
- if (contextHash) {
60
- const keyWithoutContext = this.getCacheKey(query);
61
- cached = this.cache.get(keyWithoutContext);
62
- if (cached) {
63
- const now = Date.now();
64
- if (now - cached.timestamp <= this.ttl) {
65
- this.updateAccessOrder(keyWithoutContext);
66
- this.recordHit();
67
- return cached.answer;
68
- }
23
+ this.cache.delete(key);
69
24
  }
70
25
  }
71
- // Fuzzy matching for similar queries (85%+ similarity threshold)
72
- if (enableFuzzyMatch && this.cache.size > 0) {
73
- const normalizedQuery = query.trim().toLowerCase();
74
- const bestMatch = this.findSimilarQuery(normalizedQuery, contextHash, 0.85);
75
- if (bestMatch && bestMatch.response) {
76
- // Found similar query - reuse its response
77
- this.updateAccessOrder(bestMatch.key);
78
- this.recordHit();
79
- return bestMatch.response.answer;
80
- }
81
- }
82
- this.recordMiss();
83
26
  return null;
84
27
  }
85
- /**
86
- * Find similar query using word overlap similarity
87
- * Returns cached response if similarity >= threshold
88
- */
89
- findSimilarQuery(query, contextHash, threshold = 0.85) {
90
- let bestMatch = null;
91
- const now = Date.now();
92
- for (const [key, cached] of this.cache.entries()) {
93
- // Skip expired entries
94
- if (now - cached.timestamp > this.ttl) {
95
- continue;
96
- }
97
- // If context hash provided, only match responses with same context
98
- if (contextHash && cached.contextHash && cached.contextHash !== contextHash) {
99
- continue;
100
- }
101
- const normalizedCached = cached.query.trim().toLowerCase();
102
- const similarity = this.calculateSimilarity(query, normalizedCached);
103
- if (similarity >= threshold) {
104
- if (!bestMatch || similarity > bestMatch.similarity) {
105
- bestMatch = { key, response: cached, similarity };
106
- }
107
- }
108
- }
109
- return bestMatch;
110
- }
111
- /**
112
- * Calculate string similarity using word overlap (Jaccard similarity)
113
- * Returns value between 0.0 (no similarity) and 1.0 (identical)
114
- */
115
- calculateSimilarity(str1, str2) {
116
- if (str1 === str2)
117
- return 1.0;
118
- if (str1.length === 0 || str2.length === 0)
119
- return 0.0;
120
- // Use word overlap for performance (faster than full Levenshtein)
121
- const words1 = new Set(str1.split(/\s+/).filter(w => w.length > 2)); // Ignore short words
122
- const words2 = new Set(str2.split(/\s+/).filter(w => w.length > 2));
123
- if (words1.size === 0 || words2.size === 0)
124
- return 0.0;
125
- // Calculate Jaccard similarity (word overlap)
126
- let intersection = 0;
127
- for (const word of words1) {
128
- if (words2.has(word)) {
129
- intersection++;
130
- }
131
- }
132
- const union = words1.size + words2.size - intersection;
133
- return union > 0 ? intersection / union : 0.0;
134
- }
135
- /**
136
- * Store response in cache
137
- */
138
- set(query, answer, contextHash) {
28
+ set(query, response, contextHash) {
139
29
  const key = this.getCacheKey(query, contextHash);
140
- // Evict oldest if cache is full
141
- if (this.cache.size >= this.maxSize && !this.cache.has(key)) {
142
- this.evictOldest();
143
- }
144
30
  this.cache.set(key, {
145
- answer,
31
+ response,
146
32
  timestamp: Date.now(),
147
- query: query.trim(),
148
33
  contextHash,
149
34
  });
150
- this.updateAccessOrder(key);
151
- }
152
- /**
153
- * Clear all cached responses
154
- */
155
- clear() {
156
- this.cache.clear();
157
- this.accessOrder = [];
158
- }
159
- /**
160
- * Get cache statistics
161
- */
162
- getStats() {
163
- const total = this.totalHits + this.totalMisses;
164
- return {
165
- size: this.cache.size,
166
- maxSize: this.maxSize,
167
- hitRate: total > 0 ? this.totalHits / total : 0,
168
- totalHits: this.totalHits,
169
- totalMisses: this.totalMisses,
170
- };
171
- }
172
- totalHits = 0;
173
- totalMisses = 0;
174
- /**
175
- * Record cache hit
176
- */
177
- recordHit() {
178
- this.totalHits++;
179
35
  }
180
- /**
181
- * Record cache miss
182
- */
183
- recordMiss() {
184
- this.totalMisses++;
185
- }
186
- /**
187
- * Update access order for LRU eviction
188
- */
189
- updateAccessOrder(key) {
190
- const index = this.accessOrder.indexOf(key);
191
- if (index > -1) {
192
- this.accessOrder.splice(index, 1);
193
- }
194
- this.accessOrder.push(key);
195
- }
196
- /**
197
- * Remove key from access order
198
- */
199
- removeFromAccessOrder(key) {
200
- const index = this.accessOrder.indexOf(key);
201
- if (index > -1) {
202
- this.accessOrder.splice(index, 1);
203
- }
204
- }
205
- /**
206
- * Evict oldest entry (LRU)
207
- */
208
- evictOldest() {
209
- if (this.accessOrder.length === 0)
210
- return;
211
- const oldestKey = this.accessOrder[0];
212
- this.cache.delete(oldestKey);
213
- this.accessOrder.shift();
36
+ getCacheKey(query, contextHash) {
37
+ const normalized = query.trim().toLowerCase();
38
+ return createHash('sha256').update(`${normalized}:${contextHash}`).digest('hex');
214
39
  }
215
40
  }
216
- // Singleton instance
217
- let responseCacheInstance = null;
41
+ let instance = null;
218
42
  export function getResponseCache() {
219
- if (!responseCacheInstance) {
220
- responseCacheInstance = new ResponseCache();
43
+ if (!instance) {
44
+ instance = new ResponseCache();
221
45
  }
222
- return responseCacheInstance;
46
+ return instance;
223
47
  }
224
48
  //# sourceMappingURL=response-cache.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"response-cache.js","sourceRoot":"","sources":["../../../src/infrastructure/cache/response-cache.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AASpC,MAAM,OAAO,aAAa;IAChB,KAAK,GAAgC,IAAI,GAAG,EAAE,CAAC;IAC/C,OAAO,GAAW,GAAG,CAAC,CAAC,uBAAuB;IAC9C,GAAG,GAAW,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;IAC3C,WAAW,GAAa,EAAE,CAAC,CAAC,eAAe;IAEnD,YAAY,OAA4C;QACtD,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,GAAG,CAAC;QACvC,IAAI,CAAC,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC5C,CAAC;IAED;;OAEG;IACK,WAAW,CAAC,KAAa,EAAE,WAAoB;QACrD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC9C,MAAM,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;QACtE,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,MAAoD;QACtE,oFAAoF;QACpF,MAAM,UAAU,GAAG,MAAM;aACtB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;aAC7C,IAAI,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B,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACzB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,GAAG,CAAC,KAAa,EAAE,QAAgB,EAAE,WAAmB;QACtD,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE;YAClB,QAAQ;YACR,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;IAEO,WAAW,CAAC,KAAa,EAAE,WAAmB;QACpD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC9C,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,UAAU,IAAI,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnF,CAAC;CACF;AAED,IAAI,QAAQ,GAAyB,IAAI,CAAC;AAE1C,MAAM,UAAU,gBAAgB;IAC9B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;IACjC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1,57 +1,16 @@
1
1
  /**
2
- * Infrastructure: Security Scan Cache
3
- * Caches security scan results by file content hash to avoid redundant scans
2
+ * Security Scan Cache
3
+ * Caches security scan results
4
4
  *
5
- * Performance optimization: Reduces scan latency by ~80% for unchanged files
6
- * Cache invalidation: Automatically invalidates when file content changes
5
+ * Phase 1: v0.5.0-alpha.0
7
6
  */
8
- import type { SASTResult } from '../security/ai-sast-scanner.js';
9
- import type { LicenseScanResult } from '../security/license-scanner.js';
10
- import type { ProviderBiasResult } from '../security/provider-bias-detector.js';
11
- export declare class SecurityScanCache {
7
+ declare class SecurityScanCache {
12
8
  private cache;
13
- private maxSize;
14
- private ttl;
15
- constructor(maxSize?: number, ttl?: number);
16
- /**
17
- * Generate content hash from file path and code content
18
- */
19
- private getContentHash;
20
- /**
21
- * Generate cache key from filepath
22
- */
23
- private getCacheKey;
24
- /**
25
- * Get cached scan results if available and not expired
26
- */
27
- get(filepath: string, code: string): {
28
- sast: SASTResult;
29
- license: LicenseScanResult;
30
- providerBias: ProviderBiasResult;
31
- } | null;
32
- /**
33
- * Store scan results in cache
34
- */
35
- set(filepath: string, code: string, sast: SASTResult, license: LicenseScanResult, providerBias: ProviderBiasResult): void;
36
- /**
37
- * Evict oldest entries (LRU eviction)
38
- */
39
- private evictOldest;
40
- /**
41
- * Clear expired entries
42
- */
43
- clearExpired(): void;
44
- /**
45
- * Clear all cache
46
- */
9
+ private readonly ttl;
10
+ get(filepath: string, contentHash: string): any | null;
11
+ set(filepath: string, code: string, sast: any, license?: any, providerBias?: any): void;
47
12
  clear(): void;
48
- /**
49
- * Get cache statistics
50
- */
51
- getStats(): {
52
- size: number;
53
- maxSize: number;
54
- };
55
13
  }
56
14
  export declare function getSecurityScanCache(): SecurityScanCache;
15
+ export {};
57
16
  //# sourceMappingURL=security-scan-cache.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"security-scan-cache.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/cache/security-scan-cache.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAWhF,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,KAAK,CAA8C;IAC3D,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,GAAG,CAAS;gBAER,OAAO,GAAE,MAAY,EAAE,GAAG,GAAE,MAA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