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.
- package/README.md +7 -0
- package/dist/application/agents/execution-agent.js +2 -2
- package/dist/application/agents/execution-agent.js.map +1 -1
- package/dist/application/agents/planning-agent.d.ts.map +1 -1
- package/dist/application/agents/planning-agent.js +16 -8
- package/dist/application/agents/planning-agent.js.map +1 -1
- package/dist/application/agents/validation-agent.js +2 -2
- package/dist/application/agents/validation-agent.js.map +1 -1
- package/dist/application/services/dependency-container.d.ts +30 -6
- package/dist/application/services/dependency-container.d.ts.map +1 -1
- package/dist/application/services/dependency-container.js +75 -43
- package/dist/application/services/dependency-container.js.map +1 -1
- package/dist/application/services/intelligent-router.d.ts.map +1 -1
- package/dist/application/services/intelligent-router.js +6 -3
- package/dist/application/services/intelligent-router.js.map +1 -1
- package/dist/domain/entities/task.d.ts.map +1 -1
- package/dist/domain/entities/task.js +1 -1
- package/dist/domain/entities/task.js.map +1 -1
- package/dist/domain/errors/embeddings-not-found-error.d.ts +9 -0
- package/dist/domain/errors/embeddings-not-found-error.d.ts.map +1 -0
- package/dist/domain/errors/embeddings-not-found-error.js +13 -0
- package/dist/domain/errors/embeddings-not-found-error.js.map +1 -0
- package/dist/domain/interfaces/embedding-repository.interface.d.ts +5 -0
- package/dist/domain/interfaces/embedding-repository.interface.d.ts.map +1 -1
- package/dist/domain/services/environment-mode-manager.d.ts +4 -10
- package/dist/domain/services/environment-mode-manager.d.ts.map +1 -1
- package/dist/domain/services/environment-mode-manager.js +7 -22
- package/dist/domain/services/environment-mode-manager.js.map +1 -1
- package/dist/domain/services/risk-tier-detector.d.ts +8 -9
- package/dist/domain/services/risk-tier-detector.d.ts.map +1 -1
- package/dist/domain/services/risk-tier-detector.js +53 -40
- package/dist/domain/services/risk-tier-detector.js.map +1 -1
- package/dist/embed.d.ts.map +1 -1
- package/dist/embed.js +18 -8
- package/dist/embed.js.map +1 -1
- package/dist/index.js +308 -48
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/ai/cohere-ai-service.js +3 -3
- package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
- package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -1
- package/dist/infrastructure/ai/provider-ai-service.js +6 -6
- package/dist/infrastructure/ai/provider-ai-service.js.map +1 -1
- package/dist/infrastructure/cache/query-result-cache.d.ts +14 -55
- package/dist/infrastructure/cache/query-result-cache.d.ts.map +1 -1
- package/dist/infrastructure/cache/query-result-cache.js +40 -112
- package/dist/infrastructure/cache/query-result-cache.js.map +1 -1
- package/dist/infrastructure/cache/response-cache.d.ts +10 -78
- package/dist/infrastructure/cache/response-cache.d.ts.map +1 -1
- package/dist/infrastructure/cache/response-cache.js +22 -198
- package/dist/infrastructure/cache/response-cache.js.map +1 -1
- package/dist/infrastructure/cache/security-scan-cache.d.ts +8 -49
- package/dist/infrastructure/cache/security-scan-cache.d.ts.map +1 -1
- package/dist/infrastructure/cache/security-scan-cache.js +25 -102
- package/dist/infrastructure/cache/security-scan-cache.js.map +1 -1
- package/dist/infrastructure/completion/bash-completion.d.ts +2 -3
- package/dist/infrastructure/completion/bash-completion.d.ts.map +1 -1
- package/dist/infrastructure/completion/bash-completion.js +11 -87
- package/dist/infrastructure/completion/bash-completion.js.map +1 -1
- package/dist/infrastructure/completion/fish-completion.d.ts +2 -3
- package/dist/infrastructure/completion/fish-completion.d.ts.map +1 -1
- package/dist/infrastructure/completion/fish-completion.js +15 -58
- package/dist/infrastructure/completion/fish-completion.js.map +1 -1
- package/dist/infrastructure/completion/zsh-completion.d.ts +2 -3
- package/dist/infrastructure/completion/zsh-completion.d.ts.map +1 -1
- package/dist/infrastructure/completion/zsh-completion.js +18 -73
- package/dist/infrastructure/completion/zsh-completion.js.map +1 -1
- package/dist/infrastructure/config/config-manager.js +2 -2
- package/dist/infrastructure/config/config-manager.js.map +1 -1
- package/dist/infrastructure/context/conversation-context.d.ts +27 -31
- package/dist/infrastructure/context/conversation-context.d.ts.map +1 -1
- package/dist/infrastructure/context/conversation-context.js +94 -136
- package/dist/infrastructure/context/conversation-context.js.map +1 -1
- package/dist/infrastructure/context/session-manager.d.ts +27 -11
- package/dist/infrastructure/context/session-manager.d.ts.map +1 -1
- package/dist/infrastructure/context/session-manager.js +69 -73
- package/dist/infrastructure/context/session-manager.js.map +1 -1
- package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -1
- package/dist/infrastructure/providers/cohere-provider.js +102 -17
- package/dist/infrastructure/providers/cohere-provider.js.map +1 -1
- package/dist/infrastructure/providers/openrouter-provider.d.ts +42 -0
- package/dist/infrastructure/providers/openrouter-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/openrouter-provider.js +399 -0
- package/dist/infrastructure/providers/openrouter-provider.js.map +1 -0
- package/dist/infrastructure/serialization/toon-serializer.d.ts +45 -0
- package/dist/infrastructure/serialization/toon-serializer.d.ts.map +1 -0
- package/dist/infrastructure/serialization/toon-serializer.js +119 -0
- package/dist/infrastructure/serialization/toon-serializer.js.map +1 -0
- package/dist/infrastructure/storage/embeddings-path.d.ts +18 -0
- package/dist/infrastructure/storage/embeddings-path.d.ts.map +1 -0
- package/dist/infrastructure/storage/embeddings-path.js +37 -0
- package/dist/infrastructure/storage/embeddings-path.js.map +1 -0
- package/dist/infrastructure/storage/plan-repository.d.ts +2 -0
- package/dist/infrastructure/storage/plan-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/plan-repository.js +36 -73
- package/dist/infrastructure/storage/plan-repository.js.map +1 -1
- package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +10 -1
- package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-embedding-repository.js +37 -3
- package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +1 -1
- package/dist/infrastructure/storage/task-helpers.d.ts +11 -0
- package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -1
- package/dist/infrastructure/storage/task-helpers.js +47 -7
- package/dist/infrastructure/storage/task-helpers.js.map +1 -1
- package/dist/infrastructure/storage/task-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/task-repository.js.map +1 -1
- package/dist/infrastructure/ux/capability-boundaries.d.ts +9 -37
- package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -1
- package/dist/infrastructure/ux/capability-boundaries.js +23 -148
- package/dist/infrastructure/ux/capability-boundaries.js.map +1 -1
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts +12 -54
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -1
- package/dist/infrastructure/ux/comprehensive-formatter.js +87 -182
- package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -1
- package/dist/infrastructure/ux/contextual-feature-discovery.d.ts +5 -18
- package/dist/infrastructure/ux/contextual-feature-discovery.d.ts.map +1 -1
- package/dist/infrastructure/ux/contextual-feature-discovery.js +5 -139
- package/dist/infrastructure/ux/contextual-feature-discovery.js.map +1 -1
- package/dist/infrastructure/ux/feature-discovery.d.ts +3 -33
- package/dist/infrastructure/ux/feature-discovery.d.ts.map +1 -1
- package/dist/infrastructure/ux/feature-discovery.js +5 -181
- package/dist/infrastructure/ux/feature-discovery.js.map +1 -1
- package/dist/infrastructure/ux/feedback-prompt.d.ts +15 -31
- package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -1
- package/dist/infrastructure/ux/feedback-prompt.js +30 -166
- package/dist/infrastructure/ux/feedback-prompt.js.map +1 -1
- package/dist/infrastructure/ux/progress-indicator.d.ts +3 -5
- package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
- package/dist/infrastructure/ux/progress-indicator.js +34 -49
- package/dist/infrastructure/ux/progress-indicator.js.map +1 -1
- package/dist/infrastructure/ux/review-checkpoint.d.ts +3 -1
- package/dist/infrastructure/ux/review-checkpoint.d.ts.map +1 -1
- package/dist/infrastructure/ux/review-checkpoint.js +33 -80
- package/dist/infrastructure/ux/review-checkpoint.js.map +1 -1
- package/dist/infrastructure/ux/staged-feature-intro.d.ts +14 -39
- package/dist/infrastructure/ux/staged-feature-intro.d.ts.map +1 -1
- package/dist/infrastructure/ux/staged-feature-intro.js +12 -132
- package/dist/infrastructure/ux/staged-feature-intro.js.map +1 -1
- package/dist/infrastructure/ux/syntax-highlighter.d.ts +1 -2
- package/dist/infrastructure/ux/syntax-highlighter.d.ts.map +1 -1
- package/dist/infrastructure/ux/syntax-highlighter.js +67 -148
- package/dist/infrastructure/ux/syntax-highlighter.js.map +1 -1
- package/dist/infrastructure/validation/agent-feedback.d.ts +25 -89
- package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -1
- package/dist/infrastructure/validation/agent-feedback.js +32 -204
- package/dist/infrastructure/validation/agent-feedback.js.map +1 -1
- package/dist/infrastructure/validation/agent-validation-helper.d.ts +53 -53
- package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -1
- package/dist/infrastructure/validation/agent-validation-helper.js +110 -61
- package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -1
- package/dist/infrastructure/validation/review-handler.d.ts +13 -41
- package/dist/infrastructure/validation/review-handler.d.ts.map +1 -1
- package/dist/infrastructure/validation/review-handler.js +23 -189
- package/dist/infrastructure/validation/review-handler.js.map +1 -1
- package/dist/infrastructure/validation/summary-aggregator.d.ts +25 -22
- package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -1
- package/dist/infrastructure/validation/summary-aggregator.js +47 -133
- package/dist/infrastructure/validation/summary-aggregator.js.map +1 -1
- package/dist/infrastructure/validation/summary-extractor.d.ts +13 -48
- package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -1
- package/dist/infrastructure/validation/summary-extractor.js +32 -89
- package/dist/infrastructure/validation/summary-extractor.js.map +1 -1
- package/dist/infrastructure/validation/trace-summary.d.ts +30 -57
- package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -1
- package/dist/infrastructure/validation/trace-summary.js +37 -356
- package/dist/infrastructure/validation/trace-summary.js.map +1 -1
- package/dist/monitoring.d.ts +1 -1
- package/dist/monitoring.d.ts.map +1 -1
- package/dist/monitoring.js +12 -9
- package/dist/monitoring.js.map +1 -1
- package/dist/parallel-processor.d.ts.map +1 -1
- package/dist/parallel-processor.js +124 -45
- package/dist/parallel-processor.js.map +1 -1
- package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/ask-command.js +185 -128
- package/dist/presentation/cli/commands/ask-command.js.map +1 -1
- package/dist/presentation/cli/commands/config-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/config-command.js +8 -6
- package/dist/presentation/cli/commands/config-command.js.map +1 -1
- package/dist/presentation/cli/commands/docs-command.d.ts +3 -1
- package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/docs-command.js +13 -184
- package/dist/presentation/cli/commands/docs-command.js.map +1 -1
- package/dist/presentation/cli/commands/fix-command.d.ts +2 -0
- package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/fix-command.js +25 -281
- package/dist/presentation/cli/commands/fix-command.js.map +1 -1
- package/dist/presentation/cli/commands/models-command.d.ts +13 -0
- package/dist/presentation/cli/commands/models-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/models-command.js +194 -0
- package/dist/presentation/cli/commands/models-command.js.map +1 -0
- package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.js +15 -7
- package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
- package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/plan-command.js +9 -6
- package/dist/presentation/cli/commands/plan-command.js.map +1 -1
- package/dist/presentation/cli/commands/product-command.d.ts +6 -4
- package/dist/presentation/cli/commands/product-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/product-command.js +12 -178
- package/dist/presentation/cli/commands/product-command.js.map +1 -1
- package/dist/presentation/cli/commands/review-command.d.ts +7 -7
- package/dist/presentation/cli/commands/review-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/review-command.js +148 -16
- package/dist/presentation/cli/commands/review-command.js.map +1 -1
- package/dist/presentation/cli/commands/run-command.d.ts +6 -8
- package/dist/presentation/cli/commands/run-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/run-command.js +182 -23
- package/dist/presentation/cli/commands/run-command.js.map +1 -1
- package/dist/presentation/cli/commands/setup-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/setup-command.js +15 -0
- package/dist/presentation/cli/commands/setup-command.js.map +1 -1
- package/dist/presentation/cli/commands/smart-command.js +1 -1
- package/dist/presentation/cli/commands/smart-command.js.map +1 -1
- package/dist/presentation/cli/commands/status-command.d.ts +3 -0
- package/dist/presentation/cli/commands/status-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/status-command.js +147 -156
- package/dist/presentation/cli/commands/status-command.js.map +1 -1
- package/dist/presentation/cli/commands/suggest-command.d.ts +3 -5
- package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/suggest-command.js +132 -19
- package/dist/presentation/cli/commands/suggest-command.js.map +1 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +6 -1
- package/dist/search.js.map +1 -1
- package/dist/session.js +1 -1
- package/dist/session.js.map +1 -1
- package/dist/ui.d.ts +6 -0
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +35 -1
- package/dist/ui.js.map +1 -1
- package/package.json +8 -3
|
@@ -1,212 +1,117 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Comprehensive Formatter
|
|
3
|
-
*
|
|
2
|
+
* Comprehensive Formatter
|
|
3
|
+
* Format content for CLI display with proper indentation and wrapping
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
4
6
|
*/
|
|
5
|
-
import { colors } from '../../ui.js';
|
|
6
|
-
import { formatResponse } from '../../formatter.js';
|
|
7
7
|
/**
|
|
8
|
-
* Format
|
|
8
|
+
* Format content for CLI display
|
|
9
9
|
*/
|
|
10
10
|
export function formatContent(content, options = {}) {
|
|
11
|
-
const { indent = 0, maxWidth = 76,
|
|
12
|
-
|
|
13
|
-
if (!content || !content.trim()) {
|
|
11
|
+
const { indent = 0, maxWidth = 76, preserveMarkdown = true, } = options;
|
|
12
|
+
if (!content) {
|
|
14
13
|
return '';
|
|
15
14
|
}
|
|
16
|
-
// First, format markdown if not preserving
|
|
17
|
-
let formatted = preserveFormatting ? content : formatResponse(content, maxWidth);
|
|
18
|
-
// Split into lines
|
|
19
|
-
const lines = formatted.split('\n');
|
|
20
15
|
const indentStr = ' '.repeat(indent);
|
|
21
|
-
const
|
|
16
|
+
const actualMaxWidth = maxWidth - indent;
|
|
17
|
+
// If content is short enough, return as-is with indentation
|
|
18
|
+
if (content.length <= actualMaxWidth && !content.includes('\n')) {
|
|
19
|
+
return indentStr + content;
|
|
20
|
+
}
|
|
21
|
+
// Handle markdown code blocks
|
|
22
|
+
if (preserveMarkdown && content.includes('```')) {
|
|
23
|
+
return formatMarkdownContent(content, indent, actualMaxWidth);
|
|
24
|
+
}
|
|
25
|
+
// Simple word wrapping
|
|
26
|
+
const lines = content.split('\n');
|
|
27
|
+
const wrappedLines = [];
|
|
22
28
|
for (const line of lines) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// Empty line - preserve spacing but avoid multiple consecutive
|
|
26
|
-
if (result.length === 0 || result[result.length - 1] !== '') {
|
|
27
|
-
result.push('');
|
|
28
|
-
}
|
|
29
|
+
if (line.length <= actualMaxWidth) {
|
|
30
|
+
wrappedLines.push(indentStr + line);
|
|
29
31
|
}
|
|
30
32
|
else {
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
+
// Word wrap
|
|
34
|
+
const words = line.split(/\s+/);
|
|
35
|
+
let currentLine = '';
|
|
36
|
+
for (const word of words) {
|
|
37
|
+
if ((currentLine + word).length <= actualMaxWidth) {
|
|
38
|
+
currentLine += (currentLine ? ' ' : '') + word;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
if (currentLine) {
|
|
42
|
+
wrappedLines.push(indentStr + currentLine);
|
|
43
|
+
}
|
|
44
|
+
currentLine = word;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (currentLine) {
|
|
48
|
+
wrappedLines.push(indentStr + currentLine);
|
|
49
|
+
}
|
|
33
50
|
}
|
|
34
51
|
}
|
|
35
|
-
return
|
|
52
|
+
return wrappedLines.join('\n');
|
|
36
53
|
}
|
|
37
54
|
/**
|
|
38
|
-
* Format
|
|
39
|
-
* DELIGHTFUL UX: Enhanced color coding for better visual hierarchy
|
|
55
|
+
* Format reflection/analysis output
|
|
40
56
|
*/
|
|
41
|
-
export function
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// Level 1: Cyan bold for major sections (with spacing)
|
|
45
|
-
return '\n' + colors.bold.cyan(title) + '\n' + colors.dim('─'.repeat(Math.min(title.length, 60))) + '\n';
|
|
46
|
-
case 2:
|
|
47
|
-
// Level 2: Blue bold for subsections
|
|
48
|
-
return '\n' + colors.bold.blue(title) + '\n';
|
|
49
|
-
case 3:
|
|
50
|
-
// Level 3: Regular bold for minor sections
|
|
51
|
-
return colors.bold(title);
|
|
52
|
-
default:
|
|
53
|
-
return colors.bold(title);
|
|
57
|
+
export function formatReflection(reflection, options = {}) {
|
|
58
|
+
if (!reflection) {
|
|
59
|
+
return '';
|
|
54
60
|
}
|
|
61
|
+
if (typeof reflection === 'string') {
|
|
62
|
+
return formatContent(reflection, options);
|
|
63
|
+
}
|
|
64
|
+
if (typeof reflection === 'object') {
|
|
65
|
+
// Format structured reflection
|
|
66
|
+
const parts = [];
|
|
67
|
+
if (reflection.insight) {
|
|
68
|
+
parts.push(`💡 Insight:\n${formatContent(reflection.insight, { ...options, indent: (options.indent || 0) + 2 })}`);
|
|
69
|
+
}
|
|
70
|
+
if (reflection.reasoning) {
|
|
71
|
+
parts.push(`🧠 Reasoning:\n${formatContent(reflection.reasoning, { ...options, indent: (options.indent || 0) + 2 })}`);
|
|
72
|
+
}
|
|
73
|
+
if (reflection.summary) {
|
|
74
|
+
parts.push(`📋 Summary:\n${formatContent(reflection.summary, { ...options, indent: (options.indent || 0) + 2 })}`);
|
|
75
|
+
}
|
|
76
|
+
if (parts.length === 0) {
|
|
77
|
+
return formatContent(JSON.stringify(reflection, null, 2), options);
|
|
78
|
+
}
|
|
79
|
+
return parts.join('\n\n');
|
|
80
|
+
}
|
|
81
|
+
return String(reflection);
|
|
55
82
|
}
|
|
56
83
|
/**
|
|
57
|
-
* Format
|
|
58
|
-
*/
|
|
59
|
-
export function formatNumberedList(items, indent = 2) {
|
|
60
|
-
return items
|
|
61
|
-
.map((item, index) => {
|
|
62
|
-
const num = `${index + 1}.`;
|
|
63
|
-
const indentStr = ' '.repeat(indent);
|
|
64
|
-
const formattedItem = formatContent(item, {
|
|
65
|
-
indent: indent + num.length + 1,
|
|
66
|
-
maxWidth: 76 - indent - num.length - 1,
|
|
67
|
-
});
|
|
68
|
-
return `${indentStr}${colors.bold(num)} ${formattedItem.split('\n').join('\n' + ' '.repeat(indent + num.length + 1))}`;
|
|
69
|
-
})
|
|
70
|
-
.join('\n\n');
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Format bullet lists with proper indentation
|
|
74
|
-
*/
|
|
75
|
-
/**
|
|
76
|
-
* Format bullet list with enhanced color coding and spacing
|
|
77
|
-
* DELIGHTFUL UX: Consistent bullet styling with proper spacing and color
|
|
78
|
-
*/
|
|
79
|
-
export function formatBulletList(items, indent = 2) {
|
|
80
|
-
return items
|
|
81
|
-
.map((item, index) => {
|
|
82
|
-
const indentStr = ' '.repeat(indent);
|
|
83
|
-
// Use cyan bullet for visual consistency and delight
|
|
84
|
-
const bullet = colors.cyan('•');
|
|
85
|
-
const formattedItem = formatContent(item, {
|
|
86
|
-
indent: indent + 2,
|
|
87
|
-
maxWidth: 76 - indent - 2,
|
|
88
|
-
});
|
|
89
|
-
// Add proper spacing between items
|
|
90
|
-
const spacing = index > 0 ? '\n' : '';
|
|
91
|
-
return `${spacing}${indentStr}${bullet} ${formattedItem.split('\n').join('\n' + ' '.repeat(indent + 2))}`;
|
|
92
|
-
})
|
|
93
|
-
.join('\n');
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Format reflection/learning content with proper structure
|
|
84
|
+
* Format markdown content with code block preservation
|
|
97
85
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
let
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const result = [];
|
|
110
|
-
let lastWasEmpty = false;
|
|
111
|
-
for (let i = 0; i < lines.length; i++) {
|
|
112
|
-
const line = lines[i];
|
|
113
|
-
const trimmed = line.trim();
|
|
114
|
-
// Skip redundant "Reflection:" header
|
|
115
|
-
if (trimmed.toLowerCase() === 'reflection:' || trimmed.toLowerCase().startsWith('reflection:')) {
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
if (!trimmed) {
|
|
119
|
-
// Empty line - add spacing but avoid multiple consecutive
|
|
120
|
-
if (!lastWasEmpty && result.length > 0) {
|
|
121
|
-
result.push('');
|
|
122
|
-
lastWasEmpty = true;
|
|
86
|
+
function formatMarkdownContent(content, indent, maxWidth) {
|
|
87
|
+
const indentStr = ' '.repeat(indent);
|
|
88
|
+
const lines = content.split('\n');
|
|
89
|
+
const formatted = [];
|
|
90
|
+
let inCodeBlock = false;
|
|
91
|
+
let codeBlockLang = '';
|
|
92
|
+
for (const line of lines) {
|
|
93
|
+
if (line.trim().startsWith('```')) {
|
|
94
|
+
inCodeBlock = !inCodeBlock;
|
|
95
|
+
if (inCodeBlock) {
|
|
96
|
+
codeBlockLang = line.trim().substring(3).trim();
|
|
123
97
|
}
|
|
98
|
+
formatted.push(indentStr + line);
|
|
99
|
+
}
|
|
100
|
+
else if (inCodeBlock) {
|
|
101
|
+
// Preserve code blocks as-is
|
|
102
|
+
formatted.push(indentStr + line);
|
|
124
103
|
}
|
|
125
104
|
else {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (isNumberedHeader) {
|
|
130
|
-
// Section header - add spacing before and make it stand out
|
|
131
|
-
if (i > 0 && lines[i - 1].trim()) {
|
|
132
|
-
result.push('');
|
|
133
|
-
}
|
|
134
|
-
result.push(' ' + colors.bold.cyan(trimmed));
|
|
135
|
-
}
|
|
136
|
-
else if (trimmed.startsWith('•') || /^\d+\./.test(trimmed)) {
|
|
137
|
-
// List item - indent properly
|
|
138
|
-
result.push(' ' + trimmed);
|
|
105
|
+
// Format regular markdown lines
|
|
106
|
+
if (line.length <= maxWidth) {
|
|
107
|
+
formatted.push(indentStr + line);
|
|
139
108
|
}
|
|
140
109
|
else {
|
|
141
|
-
//
|
|
142
|
-
|
|
110
|
+
// Word wrap for non-code content
|
|
111
|
+
formatted.push(formatContent(line, { indent, maxWidth: maxWidth + indent }));
|
|
143
112
|
}
|
|
144
113
|
}
|
|
145
114
|
}
|
|
146
|
-
return
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Format code blocks with proper borders and syntax highlighting
|
|
150
|
-
*/
|
|
151
|
-
export function formatCodeBlock(code, language, filepath) {
|
|
152
|
-
// Use existing formatter
|
|
153
|
-
const { formatCodeBlock: formatCode } = require('../../formatter.js');
|
|
154
|
-
return formatCode(code, language, filepath);
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Format table data with consistent styling
|
|
158
|
-
*/
|
|
159
|
-
export function formatTableData(rows) {
|
|
160
|
-
return rows
|
|
161
|
-
.map((row) => {
|
|
162
|
-
return row.map((cell, idx) => {
|
|
163
|
-
// First column: bold, others: normal
|
|
164
|
-
return idx === 0 ? colors.bold(cell) : cell;
|
|
165
|
-
}).join(' ');
|
|
166
|
-
})
|
|
167
|
-
.join('\n');
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Format metadata/summary information
|
|
171
|
-
*/
|
|
172
|
-
export function formatMetadata(metadata) {
|
|
173
|
-
const lines = [];
|
|
174
|
-
for (const [key, value] of Object.entries(metadata)) {
|
|
175
|
-
lines.push(` ${colors.dim(key + ':')} ${String(value)}`);
|
|
176
|
-
}
|
|
177
|
-
return lines.join('\n');
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Format error messages with proper structure
|
|
181
|
-
*/
|
|
182
|
-
export function formatErrorMessage(error, suggestions) {
|
|
183
|
-
const parts = [];
|
|
184
|
-
parts.push(colors.red('Error: ' + error));
|
|
185
|
-
if (suggestions && suggestions.length > 0) {
|
|
186
|
-
parts.push('');
|
|
187
|
-
parts.push(colors.bold('Suggestions:'));
|
|
188
|
-
suggestions.forEach((suggestion) => {
|
|
189
|
-
parts.push(' • ' + suggestion);
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
return parts.join('\n');
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Format success messages
|
|
196
|
-
*/
|
|
197
|
-
export function formatSuccessMessage(message) {
|
|
198
|
-
return colors.green('✓ ' + message);
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Format warning messages
|
|
202
|
-
*/
|
|
203
|
-
export function formatWarningMessage(message) {
|
|
204
|
-
return colors.yellow('⚠ ' + message);
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Format info messages
|
|
208
|
-
*/
|
|
209
|
-
export function formatInfoMessage(message) {
|
|
210
|
-
return colors.blue('→ ' + message);
|
|
115
|
+
return formatted.join('\n');
|
|
211
116
|
}
|
|
212
117
|
//# sourceMappingURL=comprehensive-formatter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comprehensive-formatter.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/comprehensive-formatter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"comprehensive-formatter.js","sourceR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E,CAAC;gBAChB,aAAa,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAClD,CAAC;YACD,SAAS,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;QACnC,CAAC;aAAM,IAAI,WAAW,EAAE,CAAC;YACvB,6BAA6B;YAC7B,SAAS,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;QACnC,CAAC;aAAM,CAAC;YACN,gCAAgC;YAChC,IAAI,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,CAAC;gBAC5B,SAAS,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;YACnC,CAAC;iBAAM,CAAC;gBACN,iCAAiC;gBACjC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;YAC/E,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -1,24 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Contextual Feature Discovery
|
|
3
|
-
*
|
|
2
|
+
* Contextual Feature Discovery (v0.5.0-alpha.0 - Stub)
|
|
3
|
+
* TODO: Implement contextual feature suggestions
|
|
4
4
|
*/
|
|
5
5
|
export interface ContextualSuggestion {
|
|
6
|
-
feature: string;
|
|
7
|
-
description: string;
|
|
8
|
-
command: string;
|
|
9
6
|
reason: string;
|
|
10
|
-
|
|
7
|
+
command: string;
|
|
8
|
+
description: string;
|
|
11
9
|
}
|
|
12
|
-
|
|
13
|
-
* Analyze query to suggest contextual features
|
|
14
|
-
*/
|
|
15
|
-
export declare function getContextualSuggestions(query: string): ContextualSuggestion[];
|
|
16
|
-
/**
|
|
17
|
-
* Get contextual feature suggestions based on query limitations
|
|
18
|
-
*/
|
|
19
|
-
export declare function getSuggestionsForLimitation(limitation: string, currentCommand: string): ContextualSuggestion[];
|
|
20
|
-
/**
|
|
21
|
-
* Check if contextual suggestions should be shown
|
|
22
|
-
*/
|
|
23
|
-
export declare function shouldShowContextualSuggestion(query: string, currentCommand: string): ContextualSuggestion | null;
|
|
10
|
+
export declare function shouldShowContextualSuggestion(query: string, command?: string): ContextualSuggestion | null;
|
|
24
11
|
//# sourceMappingURL=contextual-feature-discovery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextual-feature-discovery.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/contextual-feature-discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"contextual-feature-discovery.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/contextual-feature-discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAI3G"}
|
|
@@ -1,144 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Contextual Feature Discovery
|
|
3
|
-
*
|
|
2
|
+
* Contextual Feature Discovery (v0.5.0-alpha.0 - Stub)
|
|
3
|
+
* TODO: Implement contextual feature suggestions
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export function getContextualSuggestions(query) {
|
|
9
|
-
const suggestions = [];
|
|
10
|
-
const queryLower = query.toLowerCase();
|
|
11
|
-
// Multi-file operations → suggest orchestrate
|
|
12
|
-
if ((queryLower.includes('multiple') || queryLower.includes('several') || queryLower.includes('all')) &&
|
|
13
|
-
(queryLower.includes('file') || queryLower.includes('module'))) {
|
|
14
|
-
suggestions.push({
|
|
15
|
-
feature: 'Multi-agent Orchestration',
|
|
16
|
-
description: 'Plan and execute complex multi-step tasks across multiple files',
|
|
17
|
-
command: 'codehere orchestrate "your goal"',
|
|
18
|
-
reason: 'Your query involves multiple files/modules',
|
|
19
|
-
confidence: 0.8,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
// Complex refactoring → suggest plan
|
|
23
|
-
if (queryLower.includes('refactor') &&
|
|
24
|
-
(queryLower.includes('large') || queryLower.includes('complex') || queryLower.includes('multiple'))) {
|
|
25
|
-
suggestions.push({
|
|
26
|
-
feature: 'Planning Mode',
|
|
27
|
-
description: 'Generate hierarchical plans for large refactoring tasks',
|
|
28
|
-
command: 'codehere plan "refactor goal"',
|
|
29
|
-
reason: 'Complex refactoring tasks benefit from structured planning',
|
|
30
|
-
confidence: 0.9,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
// Debugging/problem solving → suggest react
|
|
34
|
-
if (queryLower.includes('debug') ||
|
|
35
|
-
queryLower.includes('fix') ||
|
|
36
|
-
queryLower.includes('error') ||
|
|
37
|
-
queryLower.includes('issue') ||
|
|
38
|
-
queryLower.includes('problem') ||
|
|
39
|
-
queryLower.includes('why') ||
|
|
40
|
-
queryLower.includes('why is')) {
|
|
41
|
-
suggestions.push({
|
|
42
|
-
feature: 'ReAct Reasoning',
|
|
43
|
-
description: 'Debug and solve complex problems step-by-step with reasoning',
|
|
44
|
-
command: 'codehere react "your problem"',
|
|
45
|
-
reason: 'Step-by-step reasoning helps with debugging',
|
|
46
|
-
confidence: 0.85,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
// Security-related → suggest security commands
|
|
50
|
-
if (queryLower.includes('security') ||
|
|
51
|
-
queryLower.includes('vulnerability') ||
|
|
52
|
-
queryLower.includes('vulnerabilities') ||
|
|
53
|
-
queryLower.includes('secure') ||
|
|
54
|
-
queryLower.includes('audit')) {
|
|
55
|
-
suggestions.push({
|
|
56
|
-
feature: 'Security Scanning',
|
|
57
|
-
description: 'Codehere automatically scans for security issues. Use edit command to fix them.',
|
|
58
|
-
command: 'codehere "fix security issues in auth.ts"',
|
|
59
|
-
reason: 'Security-focused queries benefit from comprehensive scanning',
|
|
60
|
-
confidence: 0.9,
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
// Knowledge/documentation → suggest knowledge commands
|
|
64
|
-
if (queryLower.includes('document') ||
|
|
65
|
-
queryLower.includes('knowledge') ||
|
|
66
|
-
queryLower.includes('learn') ||
|
|
67
|
-
queryLower.includes('pattern') ||
|
|
68
|
-
queryLower.includes('remember')) {
|
|
69
|
-
suggestions.push({
|
|
70
|
-
feature: 'Knowledge Management',
|
|
71
|
-
description: 'Query and manage preserved knowledge about your codebase',
|
|
72
|
-
command: 'codehere knowledge query "your query"',
|
|
73
|
-
reason: 'Knowledge management helps with documentation and learning',
|
|
74
|
-
confidence: 0.8,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
// Performance optimization → suggest trace/learning
|
|
78
|
-
if (queryLower.includes('performance') ||
|
|
79
|
-
queryLower.includes('optimize') ||
|
|
80
|
-
queryLower.includes('slow') ||
|
|
81
|
-
queryLower.includes('faster')) {
|
|
82
|
-
suggestions.push({
|
|
83
|
-
feature: 'Execution Tracing',
|
|
84
|
-
description: 'Analyze execution patterns to understand performance',
|
|
85
|
-
command: 'codehere trace list',
|
|
86
|
-
reason: 'Tracing helps identify performance bottlenecks',
|
|
87
|
-
confidence: 0.75,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
// Configuration/setup → suggest config commands
|
|
91
|
-
if (queryLower.includes('config') ||
|
|
92
|
-
queryLower.includes('setting') ||
|
|
93
|
-
queryLower.includes('preference') ||
|
|
94
|
-
queryLower.includes('setup')) {
|
|
95
|
-
suggestions.push({
|
|
96
|
-
feature: 'Configuration Management',
|
|
97
|
-
description: 'Manage preferences and settings',
|
|
98
|
-
command: 'codehere config',
|
|
99
|
-
reason: 'Configuration queries can be handled directly',
|
|
100
|
-
confidence: 0.95,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
return suggestions.sort((a, b) => b.confidence - a.confidence); // Sort by confidence
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Get contextual feature suggestions based on query limitations
|
|
107
|
-
*/
|
|
108
|
-
export function getSuggestionsForLimitation(limitation, currentCommand) {
|
|
109
|
-
const suggestions = [];
|
|
110
|
-
const limitationLower = limitation.toLowerCase();
|
|
111
|
-
// If limitation mentions multi-file, suggest orchestrate
|
|
112
|
-
if (limitationLower.includes('multi-file') || limitationLower.includes('multiple files')) {
|
|
113
|
-
suggestions.push({
|
|
114
|
-
feature: 'Multi-agent Orchestration',
|
|
115
|
-
description: 'Handle complex multi-file operations with planning',
|
|
116
|
-
command: 'codehere orchestrate "your goal"',
|
|
117
|
-
reason: 'Orchestrate mode handles multi-file operations better',
|
|
118
|
-
confidence: 0.9,
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
// If limitation mentions complexity, suggest plan
|
|
122
|
-
if (limitationLower.includes('complex') || limitationLower.includes('complicated')) {
|
|
123
|
-
suggestions.push({
|
|
124
|
-
feature: 'Planning Mode',
|
|
125
|
-
description: 'Break down complex tasks into manageable steps',
|
|
126
|
-
command: 'codehere plan "your goal"',
|
|
127
|
-
reason: 'Planning mode helps with complex tasks',
|
|
128
|
-
confidence: 0.85,
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
return suggestions;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Check if contextual suggestions should be shown
|
|
135
|
-
*/
|
|
136
|
-
export function shouldShowContextualSuggestion(query, currentCommand) {
|
|
137
|
-
const suggestions = getContextualSuggestions(query);
|
|
138
|
-
// Only show top suggestion if confidence is high enough
|
|
139
|
-
if (suggestions.length > 0 && suggestions[0].confidence >= 0.75) {
|
|
140
|
-
return suggestions[0];
|
|
141
|
-
}
|
|
5
|
+
export function shouldShowContextualSuggestion(query, command) {
|
|
6
|
+
// In alpha, return null (no suggestions)
|
|
7
|
+
// Can be enhanced later with heuristics
|
|
142
8
|
return null;
|
|
143
9
|
}
|
|
144
10
|
//# sourceMappingURL=contextual-feature-discovery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextual-feature-discovery.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/contextual-feature-discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"contextual-feature-discovery.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/contextual-feature-discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,MAAM,UAAU,8BAA8B,CAAC,KAAa,EAAE,OAAgB;IAC5E,yCAAyC;IACzC,wCAAwC;IACxC,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Feature Discovery
|
|
3
|
-
*
|
|
2
|
+
* Feature Discovery (v0.5.0-alpha.0 - Stub)
|
|
3
|
+
* TODO: Implement feature discovery system
|
|
4
4
|
*/
|
|
5
|
-
export interface OnboardingState {
|
|
6
|
-
onboardingComplete: boolean;
|
|
7
|
-
onboardingDate?: string;
|
|
8
|
-
commandCount: number;
|
|
9
|
-
featuresDiscovered: string[];
|
|
10
|
-
lastDiscoveryShown?: string;
|
|
11
|
-
lastDiscoveryDate?: string;
|
|
12
|
-
}
|
|
13
5
|
export interface FeatureDiscovery {
|
|
14
6
|
id: string;
|
|
15
|
-
trigger: {
|
|
16
|
-
commandCount?: number;
|
|
17
|
-
commands?: string[];
|
|
18
|
-
condition?: (state: OnboardingState) => boolean;
|
|
19
|
-
};
|
|
20
7
|
message: string;
|
|
21
8
|
features: Array<{
|
|
22
9
|
name: string;
|
|
@@ -24,24 +11,7 @@ export interface FeatureDiscovery {
|
|
|
24
11
|
command: string;
|
|
25
12
|
}>;
|
|
26
13
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Track command usage
|
|
29
|
-
*/
|
|
30
14
|
export declare function trackCommand(command: string): void;
|
|
31
|
-
/**
|
|
32
|
-
* Check if feature discovery should be shown
|
|
33
|
-
*/
|
|
34
15
|
export declare function shouldShowFeatureDiscovery(command: string): FeatureDiscovery | null;
|
|
35
|
-
|
|
36
|
-
* Mark feature discovery as shown
|
|
37
|
-
*/
|
|
38
|
-
export declare function markFeatureDiscoveryShown(discoveryId: string): void;
|
|
39
|
-
/**
|
|
40
|
-
* Check if user is first-time (onboarding not complete)
|
|
41
|
-
*/
|
|
42
|
-
export declare function isFirstTimeUser(): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Get command count for analytics
|
|
45
|
-
*/
|
|
46
|
-
export declare function getCommandCount(): number;
|
|
16
|
+
export declare function markFeatureDiscoveryShown(id: string): void;
|
|
47
17
|
//# sourceMappingURL=feature-discovery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-discovery.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/feature-discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"feature-discovery.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/feature-discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACzE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAElD;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAEnF;AAED,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAE1D"}
|