codehere 0.4.0 → 0.5.0-alpha
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/LICENSE +1 -1
- package/README.md +113 -30
- package/dist/application/agents/execution-agent.js +2 -2
- package/dist/application/agents/execution-agent.js.map +1 -1
- package/dist/application/agents/multi-agent-orchestrator.d.ts +1 -0
- package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -1
- package/dist/application/agents/multi-agent-orchestrator.js +10 -3
- package/dist/application/agents/multi-agent-orchestrator.js.map +1 -1
- package/dist/application/agents/planning-agent.d.ts.map +1 -1
- package/dist/application/agents/planning-agent.js +22 -10
- 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/reasoning/multi-model-planning-strategy.d.ts +21 -0
- package/dist/application/reasoning/multi-model-planning-strategy.d.ts.map +1 -0
- package/dist/application/reasoning/multi-model-planning-strategy.js +158 -0
- package/dist/application/reasoning/multi-model-planning-strategy.js.map +1 -0
- package/dist/application/reasoning/reasoning-config.d.ts +15 -0
- package/dist/application/reasoning/reasoning-config.d.ts.map +1 -0
- package/dist/application/reasoning/reasoning-config.js +50 -0
- package/dist/application/reasoning/reasoning-config.js.map +1 -0
- package/dist/application/reasoning/reasoning-orchestrator.d.ts +18 -0
- package/dist/application/reasoning/reasoning-orchestrator.d.ts.map +1 -0
- package/dist/application/reasoning/reasoning-orchestrator.js +170 -0
- package/dist/application/reasoning/reasoning-orchestrator.js.map +1 -0
- package/dist/application/reasoning/reasoning-strategy.interface.d.ts +24 -0
- package/dist/application/reasoning/reasoning-strategy.interface.d.ts.map +1 -0
- package/dist/application/reasoning/reasoning-strategy.interface.js +6 -0
- package/dist/application/reasoning/reasoning-strategy.interface.js.map +1 -0
- package/dist/application/reasoning/role-provider-resolver.d.ts +36 -0
- package/dist/application/reasoning/role-provider-resolver.d.ts.map +1 -0
- package/dist/application/reasoning/role-provider-resolver.js +74 -0
- package/dist/application/reasoning/role-provider-resolver.js.map +1 -0
- package/dist/application/reasoning/simple-planning-strategy.d.ts +22 -0
- package/dist/application/reasoning/simple-planning-strategy.d.ts.map +1 -0
- package/dist/application/reasoning/simple-planning-strategy.js +217 -0
- package/dist/application/reasoning/simple-planning-strategy.js.map +1 -0
- package/dist/application/reasoning/types.d.ts +65 -0
- package/dist/application/reasoning/types.d.ts.map +1 -0
- package/dist/application/reasoning/types.js +6 -0
- package/dist/application/reasoning/types.js.map +1 -0
- package/dist/application/reasoning/validator-strategy.d.ts +56 -0
- package/dist/application/reasoning/validator-strategy.d.ts.map +1 -0
- package/dist/application/reasoning/validator-strategy.js +103 -0
- package/dist/application/reasoning/validator-strategy.js.map +1 -0
- 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 +96 -44
- package/dist/application/services/dependency-container.js.map +1 -1
- package/dist/application/services/intelligent-router.d.ts +6 -0
- package/dist/application/services/intelligent-router.d.ts.map +1 -1
- package/dist/application/services/intelligent-router.js +98 -9
- package/dist/application/services/intelligent-router.js.map +1 -1
- package/dist/application/use-cases/ask-question-use-case.d.ts +1 -0
- package/dist/application/use-cases/ask-question-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/ask-question-use-case.js +4 -3
- package/dist/application/use-cases/ask-question-use-case.js.map +1 -1
- package/dist/application/use-cases/planning-use-case.d.ts +14 -1
- package/dist/application/use-cases/planning-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/planning-use-case.js +109 -2
- package/dist/application/use-cases/planning-use-case.js.map +1 -1
- package/dist/domain/entities/memory.d.ts.map +1 -1
- package/dist/domain/entities/task.d.ts +1 -1
- package/dist/domain/entities/task.d.ts.map +1 -1
- package/dist/domain/entities/task.js +2 -2
- 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/query-intent-classifier.d.ts.map +1 -1
- package/dist/domain/services/query-intent-classifier.js +20 -1
- package/dist/domain/services/query-intent-classifier.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 +405 -52
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/ai/cohere-ai-service.js +4 -4
- 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 +7 -7
- 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.d.ts +10 -0
- package/dist/infrastructure/config/config-manager.d.ts.map +1 -1
- package/dist/infrastructure/config/config-manager.js +13 -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 +95 -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/protocols/a2a-metadata.js +1 -1
- package/dist/infrastructure/protocols/mcp-oauth.js +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 +401 -0
- package/dist/infrastructure/providers/openrouter-provider.js.map +1 -0
- package/dist/infrastructure/providers/operation-provider-resolver.d.ts.map +1 -1
- package/dist/infrastructure/providers/operation-provider-resolver.js +33 -7
- package/dist/infrastructure/providers/operation-provider-resolver.js.map +1 -1
- package/dist/infrastructure/security/input-validator.d.ts.map +1 -1
- package/dist/infrastructure/security/input-validator.js +19 -6
- package/dist/infrastructure/security/input-validator.js.map +1 -1
- 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 +12 -1
- package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -1
- package/dist/infrastructure/storage/task-helpers.js +48 -8
- package/dist/infrastructure/storage/task-helpers.js.map +1 -1
- package/dist/infrastructure/storage/task-repository.d.ts +2 -1
- package/dist/infrastructure/storage/task-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/task-repository.js +14 -3
- package/dist/infrastructure/storage/task-repository.js.map +1 -1
- package/dist/infrastructure/telemetry/telemetry-service.d.ts +74 -0
- package/dist/infrastructure/telemetry/telemetry-service.d.ts.map +1 -0
- package/dist/infrastructure/telemetry/telemetry-service.js +167 -0
- package/dist/infrastructure/telemetry/telemetry-service.js.map +1 -0
- 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 +4 -6
- package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
- package/dist/infrastructure/ux/progress-indicator.js +35 -50
- 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 +2 -0
- package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/ask-command.js +316 -129
- 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 +22 -8
- package/dist/presentation/cli/commands/config-command.js.map +1 -1
- package/dist/presentation/cli/commands/decision-command.js +23 -6
- package/dist/presentation/cli/commands/decision-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 +61 -276
- package/dist/presentation/cli/commands/fix-command.js.map +1 -1
- package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/help-command.js +21 -1
- package/dist/presentation/cli/commands/help-command.js.map +1 -1
- package/dist/presentation/cli/commands/memory-command.d.ts +17 -0
- package/dist/presentation/cli/commands/memory-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/memory-command.js +252 -0
- package/dist/presentation/cli/commands/memory-command.js.map +1 -0
- 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 +1 -0
- package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.js +129 -14
- package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
- package/dist/presentation/cli/commands/plan-command.d.ts +1 -0
- package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/plan-command.js +134 -25
- 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/react-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/react-command.js +5 -1
- package/dist/presentation/cli/commands/react-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 +167 -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.d.ts.map +1 -1
- package/dist/presentation/cli/commands/smart-command.js +74 -6
- 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 +151 -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/presentation/cli/error-display.d.ts.map +1 -1
- package/dist/presentation/cli/error-display.js +75 -17
- package/dist/presentation/cli/error-display.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.d.ts +1 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +55 -7
- package/dist/session.js.map +1 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +3 -0
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/git-tool.js +7 -7
- package/dist/tools/git-tool.js.map +1 -1
- package/dist/ui.d.ts +11 -0
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +54 -1
- package/dist/ui.js.map +1 -1
- package/package.json +14 -4
|
@@ -1,167 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Capability Boundaries
|
|
3
|
+
* Detects unsupported operations and displays boundaries
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* - Detects unsupported operation requests
|
|
7
|
-
* - Shows clear capability boundaries
|
|
8
|
-
* - Suggests alternatives when capabilities exceeded
|
|
9
|
-
*/
|
|
10
|
-
import { colors, separator, warning, info, createBox, } from '../../ui.js';
|
|
11
|
-
/**
|
|
12
|
-
* Display capability boundary message when unsupported operation detected
|
|
13
|
-
*/
|
|
14
|
-
export function displayCapabilityBoundary(boundary) {
|
|
15
|
-
console.log('');
|
|
16
|
-
console.log(separator('═', 80));
|
|
17
|
-
console.log(warning('⚠️ Capability Boundary'));
|
|
18
|
-
console.log(separator('═', 80));
|
|
19
|
-
console.log('');
|
|
20
|
-
console.log(colors.bold('Unsupported Operation:'));
|
|
21
|
-
console.log(` ${boundary.unsupportedOperation}`);
|
|
22
|
-
console.log('');
|
|
23
|
-
console.log(colors.bold('Reason:'));
|
|
24
|
-
console.log(` ${colors.dim(boundary.reason)}`);
|
|
25
|
-
console.log('');
|
|
26
|
-
if (boundary.alternatives && boundary.alternatives.length > 0) {
|
|
27
|
-
console.log(colors.bold('Alternatives:'));
|
|
28
|
-
boundary.alternatives.forEach((alt, idx) => {
|
|
29
|
-
console.log(` ${idx + 1}. ${info(alt)}`);
|
|
30
|
-
});
|
|
31
|
-
console.log('');
|
|
32
|
-
}
|
|
33
|
-
console.log(separator('═', 80));
|
|
34
|
-
console.log('');
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Detect unsupported operations in user queries
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
38
6
|
*/
|
|
7
|
+
import { colors, warning } from '../../ui.js';
|
|
39
8
|
export class CapabilityBoundaryDetector {
|
|
40
|
-
unsupportedPatterns = [];
|
|
41
|
-
constructor() {
|
|
42
|
-
this.initializePatterns();
|
|
43
|
-
}
|
|
44
9
|
/**
|
|
45
|
-
* Detect
|
|
10
|
+
* Detect unsupported operations
|
|
46
11
|
*/
|
|
47
12
|
detectUnsupported(query) {
|
|
48
|
-
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
13
|
+
// In alpha, minimal detection
|
|
14
|
+
// Can be enhanced later with more sophisticated detection
|
|
15
|
+
const unsupportedPatterns = [
|
|
16
|
+
{ pattern: /\b(deploy|publish|release|ship)\b/i, reason: 'Deployment operations are not supported' },
|
|
17
|
+
{ pattern: /\b(delete|remove|destroy|wipe)\s+(all|everything|database|data)\b/i, reason: 'Bulk deletion operations are not supported' },
|
|
18
|
+
];
|
|
19
|
+
for (const { pattern, reason } of unsupportedPatterns) {
|
|
20
|
+
if (pattern.test(query)) {
|
|
52
21
|
return {
|
|
53
|
-
|
|
22
|
+
operation: query,
|
|
54
23
|
reason,
|
|
55
|
-
alternatives,
|
|
56
|
-
canSuggest: true,
|
|
57
24
|
};
|
|
58
25
|
}
|
|
59
26
|
}
|
|
60
27
|
return null;
|
|
61
28
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Extract operation from query
|
|
64
|
-
*/
|
|
65
|
-
extractOperation(query, pattern) {
|
|
66
|
-
const match = query.match(pattern);
|
|
67
|
-
if (match) {
|
|
68
|
-
return match[0];
|
|
69
|
-
}
|
|
70
|
-
return query.substring(0, 50) + (query.length > 50 ? '...' : '');
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Initialize unsupported operation patterns
|
|
74
|
-
*/
|
|
75
|
-
initializePatterns() {
|
|
76
|
-
// Code execution (direct execution requests)
|
|
77
|
-
this.unsupportedPatterns.push({
|
|
78
|
-
pattern: /\b(execute|run|test|execute code|run code|run tests|execute tests|run program)\b/i,
|
|
79
|
-
reason: 'I cannot execute code or run tests directly for security reasons.',
|
|
80
|
-
alternatives: [
|
|
81
|
-
'Generate test code: codehere "create tests for src/auth.ts"',
|
|
82
|
-
'Suggest test commands: codehere ask "how to test authentication"',
|
|
83
|
-
'Review code manually and run tests yourself',
|
|
84
|
-
],
|
|
85
|
-
});
|
|
86
|
-
// Database operations
|
|
87
|
-
this.unsupportedPatterns.push({
|
|
88
|
-
pattern: /\b(connect to database|query database|run sql|execute sql|database connection)\b/i,
|
|
89
|
-
reason: 'I cannot connect to or query databases directly for security reasons.',
|
|
90
|
-
alternatives: [
|
|
91
|
-
'Show database connection code: codehere "show database connection example"',
|
|
92
|
-
'Generate database query code: codehere "create SQL query for users table"',
|
|
93
|
-
'Review database schema: codehere "explain database schema"',
|
|
94
|
-
],
|
|
95
|
-
});
|
|
96
|
-
// Network operations
|
|
97
|
-
this.unsupportedPatterns.push({
|
|
98
|
-
pattern: /\b(make http request|send request|fetch from url|call api endpoint)\b/i,
|
|
99
|
-
reason: 'I cannot make HTTP requests or call external APIs directly.',
|
|
100
|
-
alternatives: [
|
|
101
|
-
'Generate HTTP request code: codehere "create HTTP request function"',
|
|
102
|
-
'Show API integration example: codehere "show API integration pattern"',
|
|
103
|
-
'Review existing API calls: codehere "explain API calls in codebase"',
|
|
104
|
-
],
|
|
105
|
-
});
|
|
106
|
-
// File system operations (destructive)
|
|
107
|
-
this.unsupportedPatterns.push({
|
|
108
|
-
pattern: /\b(delete file|remove file|rm -rf|format disk|wipe data)\b/i,
|
|
109
|
-
reason: 'I cannot perform destructive file system operations directly.',
|
|
110
|
-
alternatives: [
|
|
111
|
-
'Suggest deletion commands: codehere ask "how to safely delete files"',
|
|
112
|
-
'Review files before deletion: codehere "list files to delete"',
|
|
113
|
-
'Generate safe deletion script: codehere "create file deletion script"',
|
|
114
|
-
],
|
|
115
|
-
});
|
|
116
|
-
// System commands
|
|
117
|
-
this.unsupportedPatterns.push({
|
|
118
|
-
pattern: /\b(shutdown|restart|kill process|stop service|install package system-wide)\b/i,
|
|
119
|
-
reason: 'I cannot execute system-level commands for security reasons.',
|
|
120
|
-
alternatives: [
|
|
121
|
-
'Suggest commands: codehere ask "how to restart service"',
|
|
122
|
-
'Generate command scripts: codehere "create service restart script"',
|
|
123
|
-
'Review system configuration: codehere "explain system configuration"',
|
|
124
|
-
],
|
|
125
|
-
});
|
|
126
|
-
// Real-time operations
|
|
127
|
-
this.unsupportedPatterns.push({
|
|
128
|
-
pattern: /\b(watch|monitor|stream|real-time|live)\b.*\b(execute|run|perform)\b/i,
|
|
129
|
-
reason: 'I cannot perform real-time monitoring or streaming operations.',
|
|
130
|
-
alternatives: [
|
|
131
|
-
'Generate monitoring code: codehere "create monitoring script"',
|
|
132
|
-
'Show monitoring patterns: codehere "explain monitoring setup"',
|
|
133
|
-
'Suggest monitoring tools: codehere ask "what monitoring tools to use"',
|
|
134
|
-
],
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Register custom unsupported pattern
|
|
139
|
-
*/
|
|
140
|
-
registerPattern(pattern, reason, alternatives) {
|
|
141
|
-
this.unsupportedPatterns.push({ pattern, reason, alternatives });
|
|
142
|
-
}
|
|
143
29
|
}
|
|
144
30
|
/**
|
|
145
|
-
*
|
|
31
|
+
* Display capability boundary message
|
|
146
32
|
*/
|
|
147
|
-
export function
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
'',
|
|
156
|
-
'What I CANNOT do:',
|
|
157
|
-
' ✗ Execute code or run tests directly',
|
|
158
|
-
' ✗ Connect to databases or APIs',
|
|
159
|
-
' ✗ Perform system-level operations',
|
|
160
|
-
' ✗ Guarantee code correctness',
|
|
161
|
-
' ✗ Replace thorough testing',
|
|
162
|
-
'',
|
|
163
|
-
'Always review generated code and test before deploying.',
|
|
164
|
-
].join('\n');
|
|
165
|
-
return createBox(content, { borderColor: colors.yellow });
|
|
33
|
+
export function displayCapabilityBoundary(boundary) {
|
|
34
|
+
console.log(warning('\n⚠️ Capability Boundary'));
|
|
35
|
+
console.log(warning(`Operation: ${boundary.operation}`));
|
|
36
|
+
console.log(warning(`Reason: ${boundary.reason}`));
|
|
37
|
+
if (boundary.alternative) {
|
|
38
|
+
console.log(colors.dim(`Alternative: ${boundary.alternative}`));
|
|
39
|
+
}
|
|
40
|
+
console.log('');
|
|
166
41
|
}
|
|
167
42
|
//# sourceMappingURL=capability-boundaries.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability-boundaries.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/capability-boundaries.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"capability-boundaries.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/capability-boundaries.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAQ9C,MAAM,OAAO,0BAA0B;IACrC;;OAEG;IACH,iBAAiB,CAAC,KAAa;QAC7B,8BAA8B;QAC9B,0DAA0D;QAE1D,MAAM,mBAAmB,GAAG;YAC1B,EAAE,OAAO,EAAE,oCAAoC,EAAE,MAAM,EAAE,yCAAyC,EAAE;YACpG,EAAE,OAAO,EAAE,oEAAoE,EAAE,MAAM,EAAE,4CAA4C,EAAE;SACxI,CAAC;QAEF,KAAK,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,mBAAmB,EAAE,CAAC;YACtD,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBACxB,OAAO;oBACL,SAAS,EAAE,KAAK;oBAChB,MAAM;iBACP,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,QAA4B;IACpE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACnD,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -1,63 +1,21 @@
|
|
|
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
|
-
|
|
6
|
-
* Format any text content with proper indentation, wrapping, and visual hierarchy
|
|
7
|
-
*/
|
|
8
|
-
export declare function formatContent(content: string, options?: {
|
|
7
|
+
interface FormatOptions {
|
|
9
8
|
indent?: number;
|
|
10
9
|
maxWidth?: number;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}): string;
|
|
14
|
-
/**
|
|
15
|
-
* Format section headers with consistent styling and color coding
|
|
16
|
-
* DELIGHTFUL UX: Enhanced color coding for better visual hierarchy
|
|
17
|
-
*/
|
|
18
|
-
export declare function formatSectionHeader(title: string, level?: 1 | 2 | 3): string;
|
|
19
|
-
/**
|
|
20
|
-
* Format numbered lists with proper indentation
|
|
21
|
-
*/
|
|
22
|
-
export declare function formatNumberedList(items: string[], indent?: number): string;
|
|
23
|
-
/**
|
|
24
|
-
* Format bullet lists with proper indentation
|
|
25
|
-
*/
|
|
26
|
-
/**
|
|
27
|
-
* Format bullet list with enhanced color coding and spacing
|
|
28
|
-
* DELIGHTFUL UX: Consistent bullet styling with proper spacing and color
|
|
29
|
-
*/
|
|
30
|
-
export declare function formatBulletList(items: string[], indent?: number): string;
|
|
31
|
-
/**
|
|
32
|
-
* Format reflection/learning content with proper structure
|
|
33
|
-
*/
|
|
34
|
-
export declare function formatReflection(reflection: string): string;
|
|
35
|
-
/**
|
|
36
|
-
* Format code blocks with proper borders and syntax highlighting
|
|
37
|
-
*/
|
|
38
|
-
export declare function formatCodeBlock(code: string, language?: string, filepath?: string): string;
|
|
39
|
-
/**
|
|
40
|
-
* Format table data with consistent styling
|
|
41
|
-
*/
|
|
42
|
-
export declare function formatTableData(rows: string[][]): string;
|
|
43
|
-
/**
|
|
44
|
-
* Format metadata/summary information
|
|
45
|
-
*/
|
|
46
|
-
export declare function formatMetadata(metadata: Record<string, string | number>): string;
|
|
47
|
-
/**
|
|
48
|
-
* Format error messages with proper structure
|
|
49
|
-
*/
|
|
50
|
-
export declare function formatErrorMessage(error: string, suggestions?: string[]): string;
|
|
51
|
-
/**
|
|
52
|
-
* Format success messages
|
|
53
|
-
*/
|
|
54
|
-
export declare function formatSuccessMessage(message: string): string;
|
|
10
|
+
preserveMarkdown?: boolean;
|
|
11
|
+
}
|
|
55
12
|
/**
|
|
56
|
-
* Format
|
|
13
|
+
* Format content for CLI display
|
|
57
14
|
*/
|
|
58
|
-
export declare function
|
|
15
|
+
export declare function formatContent(content: string, options?: FormatOptions): string;
|
|
59
16
|
/**
|
|
60
|
-
* Format
|
|
17
|
+
* Format reflection/analysis output
|
|
61
18
|
*/
|
|
62
|
-
export declare function
|
|
19
|
+
export declare function formatReflection(reflection: any, options?: FormatOptions): string;
|
|
20
|
+
export {};
|
|
63
21
|
//# sourceMappingURL=comprehensive-formatter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comprehensive-formatter.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/comprehensive-formatter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"comprehensive-formatter.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/comprehensive-formatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,CAsDlF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,CAiCrF"}
|
|
@@ -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","sourceRoot":"","sources":["../../../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