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,181 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Feedback Prompt
|
|
3
|
+
* Collect and store user feedback for bidirectional learning
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* - Feedback prompts after operations
|
|
7
|
-
* - Thumbs up/down collection
|
|
8
|
-
* - Refinement request option
|
|
9
|
-
* - Feedback storage for learning
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
10
6
|
*/
|
|
11
|
-
import { colors, createBox, separator, newline } from '../../ui.js';
|
|
12
|
-
import * as readline from 'readline';
|
|
13
7
|
/**
|
|
14
|
-
*
|
|
15
|
-
* Task 6.1: Explicit feedback collection after operations
|
|
16
|
-
* FIXED: Now works in non-TTY mode via environment variables
|
|
8
|
+
* Prompt user for feedback (non-blocking, returns null if user skips)
|
|
17
9
|
*/
|
|
18
10
|
export async function promptForFeedback(operation, context) {
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
// Check for environment variable feedback (for non-interactive mode)
|
|
23
|
-
const envFeedback = process.env.CODEHERE_FEEDBACK;
|
|
24
|
-
if (envFeedback) {
|
|
25
|
-
const normalized = envFeedback.trim().toLowerCase();
|
|
26
|
-
let action;
|
|
27
|
-
let signal;
|
|
28
|
-
if (normalized === 'y' || normalized === 'yes' || normalized === 'positive' || normalized === 'thumbs_up') {
|
|
29
|
-
action = 'thumbs_up';
|
|
30
|
-
signal = 'positive';
|
|
31
|
-
}
|
|
32
|
-
else if (normalized === 'n' || normalized === 'no' || normalized === 'negative' || normalized === 'thumbs_down') {
|
|
33
|
-
action = 'thumbs_down';
|
|
34
|
-
signal = 'negative';
|
|
35
|
-
}
|
|
36
|
-
else if (normalized === 'r' || normalized === 'refine' || normalized === 'refinement') {
|
|
37
|
-
action = 'refine';
|
|
38
|
-
signal = 'neutral';
|
|
39
|
-
// Get refinement message from env var if available
|
|
40
|
-
const refineMsg = process.env.CODEHERE_FEEDBACK_MESSAGE;
|
|
41
|
-
return {
|
|
42
|
-
action,
|
|
43
|
-
signal,
|
|
44
|
-
message: refineMsg?.trim() || undefined,
|
|
45
|
-
timestamp: Date.now(),
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
// Invalid or skip
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
return {
|
|
53
|
-
action,
|
|
54
|
-
signal,
|
|
55
|
-
timestamp: Date.now(),
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
// No TTY and no env var - skip silently (non-blocking)
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
newline();
|
|
62
|
-
console.log(separator('─', 80));
|
|
63
|
-
const feedbackBox = createBox([
|
|
64
|
-
`${colors.bold('Was this helpful?')}`,
|
|
65
|
-
'',
|
|
66
|
-
`${colors.dim('Press:')}`,
|
|
67
|
-
` ${colors.green('👍')} ${colors.cyan('y')} or ${colors.cyan('Enter')} - Yes (thumbs up)`,
|
|
68
|
-
` ${colors.red('👎')} ${colors.cyan('n')} - No (thumbs down)`,
|
|
69
|
-
` ${colors.yellow('✏️')} ${colors.cyan('r')} - Request refinement`,
|
|
70
|
-
` ${colors.dim('s')} - Skip`,
|
|
71
|
-
'',
|
|
72
|
-
`${colors.dim('Your feedback helps improve Codehere!')}`,
|
|
73
|
-
].join('\n'), { borderColor: colors.cyan });
|
|
74
|
-
console.log(feedbackBox);
|
|
75
|
-
console.log(separator('─', 80));
|
|
76
|
-
newline();
|
|
77
|
-
// Create readline interface for input
|
|
78
|
-
const rl = readline.createInterface({
|
|
79
|
-
input: process.stdin,
|
|
80
|
-
output: process.stdout,
|
|
81
|
-
});
|
|
82
|
-
return new Promise((resolve) => {
|
|
83
|
-
const timeout = setTimeout(() => {
|
|
84
|
-
rl.close();
|
|
85
|
-
resolve(null); // Timeout - skip feedback
|
|
86
|
-
}, 10000); // 10 second timeout
|
|
87
|
-
rl.question(colors.dim('Your choice: '), (answer) => {
|
|
88
|
-
clearTimeout(timeout);
|
|
89
|
-
rl.close();
|
|
90
|
-
const normalized = answer.trim().toLowerCase();
|
|
91
|
-
let action;
|
|
92
|
-
let signal;
|
|
93
|
-
if (normalized === 'y' || normalized === 'yes' || normalized === '' || normalized === '👍') {
|
|
94
|
-
action = 'thumbs_up';
|
|
95
|
-
signal = 'positive';
|
|
96
|
-
}
|
|
97
|
-
else if (normalized === 'n' || normalized === 'no' || normalized === '👎') {
|
|
98
|
-
action = 'thumbs_down';
|
|
99
|
-
signal = 'negative';
|
|
100
|
-
}
|
|
101
|
-
else if (normalized === 'r' || normalized === 'refine' || normalized === '✏️') {
|
|
102
|
-
action = 'refine';
|
|
103
|
-
signal = 'neutral';
|
|
104
|
-
}
|
|
105
|
-
else if (normalized === 's' || normalized === 'skip') {
|
|
106
|
-
resolve(null); // Skip feedback
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
// Invalid input - skip
|
|
111
|
-
resolve(null);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const result = {
|
|
115
|
-
action,
|
|
116
|
-
signal,
|
|
117
|
-
timestamp: Date.now(),
|
|
118
|
-
};
|
|
119
|
-
// If refinement requested, ask for details
|
|
120
|
-
if (action === 'refine') {
|
|
121
|
-
const refineRl = readline.createInterface({
|
|
122
|
-
input: process.stdin,
|
|
123
|
-
output: process.stdout,
|
|
124
|
-
});
|
|
125
|
-
refineRl.question(colors.cyan('What would you like to refine? '), (refinementMessage) => {
|
|
126
|
-
refineRl.close();
|
|
127
|
-
result.message = refinementMessage.trim() || undefined;
|
|
128
|
-
resolve(result);
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
resolve(result);
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
});
|
|
11
|
+
// In alpha, we skip interactive prompts to avoid blocking
|
|
12
|
+
// This can be enhanced later with readline-based prompts
|
|
13
|
+
return null;
|
|
136
14
|
}
|
|
137
15
|
/**
|
|
138
|
-
* Store feedback
|
|
16
|
+
* Store feedback in the learning system
|
|
139
17
|
*/
|
|
140
|
-
export function storeFeedback(learningSystem, userId, feedback,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
18
|
+
export function storeFeedback(learningSystem, userId, feedback, metadata) {
|
|
19
|
+
if (!learningSystem || !feedback) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
// Store feedback if learning system supports it
|
|
24
|
+
if (typeof learningSystem.storeFeedback === 'function') {
|
|
25
|
+
learningSystem.storeFeedback({
|
|
26
|
+
userId,
|
|
27
|
+
feedback,
|
|
28
|
+
metadata,
|
|
29
|
+
timestamp: new Date().toISOString(),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
// Silent failure - feedback collection should not break the workflow
|
|
35
|
+
console.error('Failed to store feedback:', error);
|
|
36
|
+
}
|
|
151
37
|
}
|
|
152
38
|
/**
|
|
153
|
-
* Display feedback confirmation
|
|
39
|
+
* Display feedback confirmation message
|
|
154
40
|
*/
|
|
155
41
|
export function displayFeedbackConfirmation(feedback) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
let color;
|
|
159
|
-
switch (feedback.action) {
|
|
160
|
-
case 'thumbs_up':
|
|
161
|
-
message = `${colors.green('👍')} Thank you for your positive feedback!`;
|
|
162
|
-
color = colors.green;
|
|
163
|
-
break;
|
|
164
|
-
case 'thumbs_down':
|
|
165
|
-
message = `${colors.red('👎')} Thank you for your feedback. We'll use this to improve.`;
|
|
166
|
-
color = colors.yellow;
|
|
167
|
-
break;
|
|
168
|
-
case 'refine':
|
|
169
|
-
message = `${colors.yellow('✏️')} Refinement request recorded. We'll work on improving this.`;
|
|
170
|
-
color = colors.cyan;
|
|
171
|
-
break;
|
|
172
|
-
default:
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
console.log(color(message));
|
|
176
|
-
if (feedback.message) {
|
|
177
|
-
console.log(colors.dim(` Note: "${feedback.message}"`));
|
|
178
|
-
}
|
|
179
|
-
newline();
|
|
42
|
+
// In alpha, skip confirmation display to keep CLI clean
|
|
43
|
+
// This can be enhanced later
|
|
180
44
|
}
|
|
181
45
|
//# sourceMappingURL=feedback-prompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback-prompt.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/feedback-prompt.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"feedback-prompt.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/feedback-prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,SAAiB,EACjB,OAAwB;IAExB,0DAA0D;IAC1D,yDAAyD;IACzD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,cAAmB,EACnB,MAAc,EACd,QAAgB,EAChB,QAAyB;IAEzB,IAAI,CAAC,cAAc,IAAI,CAAC,QAAQ,EAAE,CAAC;QACjC,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,gDAAgD;QAChD,IAAI,OAAO,cAAc,CAAC,aAAa,KAAK,UAAU,EAAE,CAAC;YACvD,cAAc,CAAC,aAAa,CAAC;gBAC3B,MAAM;gBACN,QAAQ;gBACR,QAAQ;gBACR,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACpC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,qEAAqE;QACrE,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,QAAgB;IAC1D,wDAAwD;IACxD,6BAA6B;AAC/B,CAAC"}
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
* Progress Indicator Utilities
|
|
3
3
|
* Provides progress indicators for long-running operations
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* - Progress bars for operations with known total
|
|
7
|
-
* - Spinners for operations with unknown duration
|
|
8
|
-
* - Context-aware progress messages
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
9
6
|
*/
|
|
10
7
|
export interface ProgressOptions {
|
|
11
8
|
total?: number;
|
|
@@ -18,6 +15,8 @@ export declare class ProgressIndicator {
|
|
|
18
15
|
private progressBar;
|
|
19
16
|
private operationStartTime;
|
|
20
17
|
private currentValue;
|
|
18
|
+
private total;
|
|
19
|
+
private message;
|
|
21
20
|
/**
|
|
22
21
|
* Start progress indicator
|
|
23
22
|
*/
|
|
@@ -32,9 +31,8 @@ export declare class ProgressIndicator {
|
|
|
32
31
|
increment(delta?: number, message?: string): void;
|
|
33
32
|
/**
|
|
34
33
|
* Stop progress indicator with smooth transition
|
|
35
|
-
* DELIGHTFUL UX: Smooth completion with visual feedback
|
|
36
34
|
*/
|
|
37
|
-
stop(success?: boolean, finalMessage?: string): void;
|
|
35
|
+
stop(success?: boolean, finalMessage?: string, suppressMessage?: boolean): void;
|
|
38
36
|
/**
|
|
39
37
|
* Get elapsed time
|
|
40
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-indicator.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/progress-indicator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"progress-indicator.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/progress-indicator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAAiD;IAChE,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,kBAAkB,CAAa;IACvC,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,OAAO,CAAc;IAE7B;;OAEG;IACH,KAAK,CAAC,OAAO,GAAE,eAAoB,GAAG,IAAI;IAgB1C;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAoB7C;;OAEG;IACH,SAAS,CAAC,KAAK,GAAE,MAAU,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAIpD;;OAEG;IACH,IAAI,CAAC,OAAO,GAAE,OAAc,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,eAAe,GAAE,OAAe,GAAG,IAAI;IAc5F;;OAEG;IACH,cAAc,IAAI,MAAM;CAGzB;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAS9E;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,iBAAiB,CAMhE;AAED;;GAEG;AACH,wBAAgB,6BAA6B,IAAI,iBAAiB,CAMjE"}
|
|
@@ -2,35 +2,31 @@
|
|
|
2
2
|
* Progress Indicator Utilities
|
|
3
3
|
* Provides progress indicators for long-running operations
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* - Progress bars for operations with known total
|
|
7
|
-
* - Spinners for operations with unknown duration
|
|
8
|
-
* - Context-aware progress messages
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
9
6
|
*/
|
|
10
|
-
import { createSpinner
|
|
7
|
+
import { createSpinner } from '../../ui.js';
|
|
11
8
|
export class ProgressIndicator {
|
|
12
9
|
spinner = null;
|
|
13
|
-
progressBar =
|
|
10
|
+
progressBar = '';
|
|
14
11
|
operationStartTime = 0;
|
|
15
12
|
currentValue = 0;
|
|
13
|
+
total = 0;
|
|
14
|
+
message = '';
|
|
16
15
|
/**
|
|
17
16
|
* Start progress indicator
|
|
18
17
|
*/
|
|
19
18
|
start(options = {}) {
|
|
20
19
|
this.operationStartTime = Date.now();
|
|
21
20
|
this.currentValue = 0;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this.progressBar = createProgressBar(options.total, format);
|
|
28
|
-
this.progressBar.start(options.total, 0);
|
|
21
|
+
this.total = options.total || 0;
|
|
22
|
+
this.message = options.message || 'Processing...';
|
|
23
|
+
if (this.total > 0) {
|
|
24
|
+
// Progress bar mode
|
|
25
|
+
this.update(0, this.message);
|
|
29
26
|
}
|
|
30
27
|
else {
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
this.spinner = createSpinner(message);
|
|
28
|
+
// Spinner mode
|
|
29
|
+
this.spinner = createSpinner(this.message);
|
|
34
30
|
this.spinner.start();
|
|
35
31
|
}
|
|
36
32
|
}
|
|
@@ -39,16 +35,20 @@ export class ProgressIndicator {
|
|
|
39
35
|
*/
|
|
40
36
|
update(value, message) {
|
|
41
37
|
this.currentValue = value;
|
|
42
|
-
if (
|
|
43
|
-
this.
|
|
44
|
-
if (message) {
|
|
45
|
-
// Update progress bar format with new message
|
|
46
|
-
// Note: cli-progress doesn't support dynamic message updates easily
|
|
47
|
-
// So we'll just update the value
|
|
48
|
-
}
|
|
38
|
+
if (message) {
|
|
39
|
+
this.message = message;
|
|
49
40
|
}
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
if (this.total > 0) {
|
|
42
|
+
// Progress bar
|
|
43
|
+
const percentage = Math.min(100, Math.floor((value / this.total) * 100));
|
|
44
|
+
const barLength = 20;
|
|
45
|
+
const filled = Math.floor((percentage / 100) * barLength);
|
|
46
|
+
const bar = '█'.repeat(filled) + '░'.repeat(barLength - filled);
|
|
47
|
+
process.stdout.write(`\r${this.message} [${bar}] ${percentage}% (${value}/${this.total})`);
|
|
48
|
+
}
|
|
49
|
+
else if (this.spinner) {
|
|
50
|
+
// Spinner
|
|
51
|
+
this.spinner.text = this.message;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
@@ -59,33 +59,18 @@ export class ProgressIndicator {
|
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Stop progress indicator with smooth transition
|
|
62
|
-
* DELIGHTFUL UX: Smooth completion with visual feedback
|
|
63
62
|
*/
|
|
64
|
-
stop(success = true, finalMessage) {
|
|
65
|
-
|
|
66
|
-
if (this.progressBar) {
|
|
67
|
-
// Smooth completion - ensure bar reaches 100%
|
|
68
|
-
if (this.progressBar.getTotal() && this.currentValue < this.progressBar.getTotal()) {
|
|
69
|
-
this.progressBar.update(this.progressBar.getTotal());
|
|
70
|
-
}
|
|
71
|
-
this.progressBar.stop();
|
|
72
|
-
this.progressBar = null;
|
|
73
|
-
if (finalMessage) {
|
|
74
|
-
// Color-coded success message
|
|
75
|
-
const messageColor = success ? colors.green : colors.red;
|
|
76
|
-
console.log(messageColor(` ${finalMessage} (${duration}s)`));
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
else if (this.spinner) {
|
|
80
|
-
// Smooth spinner stop with success indicator
|
|
63
|
+
stop(success = true, finalMessage, suppressMessage = false) {
|
|
64
|
+
if (this.spinner) {
|
|
81
65
|
this.spinner.stop();
|
|
82
66
|
this.spinner = null;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
67
|
+
}
|
|
68
|
+
else if (this.total > 0) {
|
|
69
|
+
// Clear progress bar
|
|
70
|
+
process.stdout.write('\r' + ' '.repeat(80) + '\r');
|
|
71
|
+
}
|
|
72
|
+
if (finalMessage && !suppressMessage) {
|
|
73
|
+
console.log(finalMessage);
|
|
89
74
|
}
|
|
90
75
|
}
|
|
91
76
|
/**
|
|
@@ -102,7 +87,7 @@ export function createEmbeddingSearchProgress(total) {
|
|
|
102
87
|
const indicator = new ProgressIndicator();
|
|
103
88
|
indicator.start({
|
|
104
89
|
total,
|
|
105
|
-
message: 'Searching
|
|
90
|
+
message: 'Searching embeddings',
|
|
106
91
|
showPercentage: true,
|
|
107
92
|
showCount: true,
|
|
108
93
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-indicator.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/progress-indicator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"progress-indicator.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/progress-indicator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C,MAAM,OAAO,iBAAiB;IACpB,OAAO,GAA4C,IAAI,CAAC;IACxD,WAAW,GAAW,EAAE,CAAC;IACzB,kBAAkB,GAAW,CAAC,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;AACH,MAAM,UAAU,6BAA6B,CAAC,KAAa;IACzD,MAAM,SAAS,GAAG,IAAI,iBAAiB,EAAE,CAAC;IAC1C,SAAS,CAAC,KAAK,CAAC;QACd,KAAK;QACL,OAAO,EAAE,sBAAsB;QAC/B,cAAc,EAAE,IAAI;QACpB,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B;IAC1C,MAAM,SAAS,GAAG,IAAI,iBAAiB,EAAE,CAAC;IAC1C,SAAS,CAAC,KAAK,CAAC;QACd,OAAO,EAAE,iBAAiB;KAC3B,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,6BAA6B;IAC3C,MAAM,SAAS,GAAG,IAAI,iBAAiB,EAAE,CAAC;IAC1C,SAAS,CAAC,KAAK,CAAC;QACd,OAAO,EAAE,uBAAuB;KACjC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-checkpoint.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/review-checkpoint.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"review-checkpoint.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/review-checkpoint.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,WAAW,EAAE,CAAC;IAC7B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CA8BxE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CA4BA;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAE9D"}
|
|
@@ -1,66 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Review Checkpoint UI
|
|
3
|
-
* Shows summary before applying edits
|
|
3
|
+
* Shows summary before applying edits
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
4
6
|
*/
|
|
5
|
-
import { colors, separator
|
|
7
|
+
import { colors, separator } from '../../ui.js';
|
|
6
8
|
/**
|
|
7
9
|
* Display review checkpoint before applying edits
|
|
8
10
|
*/
|
|
9
11
|
export function displayReviewCheckpoint(info) {
|
|
10
|
-
|
|
12
|
+
console.log('\n' + separator('═', 80));
|
|
13
|
+
console.log(colors.bold('📋 Review Checkpoint'));
|
|
11
14
|
console.log(separator('═', 80));
|
|
12
|
-
console.log(colors.bold('📝 Review Changes'));
|
|
13
|
-
console.log(separator('═', 80));
|
|
14
|
-
newline();
|
|
15
15
|
// Files summary
|
|
16
|
-
console.log(colors.bold(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
],
|
|
34
|
-
[
|
|
35
|
-
'Compilation',
|
|
36
|
-
info.compilationValid ? success('✓ Valid') : error('✗ Invalid'),
|
|
37
|
-
],
|
|
38
|
-
];
|
|
39
|
-
const statusTable = createTable(['Check', 'Status'], statusRows);
|
|
40
|
-
console.log(statusTable.toString());
|
|
41
|
-
newline();
|
|
42
|
-
// Risk level indicator
|
|
43
|
-
const riskColors = {
|
|
44
|
-
low: colors.green,
|
|
45
|
-
medium: colors.yellow,
|
|
46
|
-
high: colors.yellow,
|
|
47
|
-
critical: colors.red,
|
|
48
|
-
};
|
|
49
|
-
const riskLabels = {
|
|
50
|
-
low: 'Low Risk',
|
|
51
|
-
medium: 'Medium Risk',
|
|
52
|
-
high: 'High Risk',
|
|
53
|
-
critical: 'Critical Risk',
|
|
54
|
-
};
|
|
55
|
-
console.log(colors.bold('Risk Level: ') +
|
|
56
|
-
riskColors[info.riskLevel](riskLabels[info.riskLevel]));
|
|
57
|
-
if (info.uncertainty && info.uncertainty > 0.5) {
|
|
58
|
-
const percent = (info.uncertainty * 100).toFixed(0);
|
|
59
|
-
console.log(warning(`⚠️ Uncertainty: ${percent}% - Please verify output carefully`));
|
|
16
|
+
console.log(`\n${colors.bold('Files to modify:')} ${info.filesToModify.length}`);
|
|
17
|
+
info.filesToModify.forEach((file, idx) => {
|
|
18
|
+
console.log(` ${idx + 1}. ${file.filepath}`);
|
|
19
|
+
console.log(` +${file.linesAdded} -${file.linesRemoved} ~${file.linesChanged}`);
|
|
20
|
+
});
|
|
21
|
+
// Validation status
|
|
22
|
+
console.log(`\n${colors.bold('Validation:')}`);
|
|
23
|
+
console.log(` Security scan: ${info.securityScanPassed ? colors.green('✓ Passed') : colors.red('✗ Failed')}`);
|
|
24
|
+
console.log(` Compilation: ${info.compilationValid ? colors.green('✓ Valid') : colors.red('✗ Invalid')}`);
|
|
25
|
+
// Risk level
|
|
26
|
+
const riskColor = info.riskLevel === 'low' ? colors.green :
|
|
27
|
+
info.riskLevel === 'medium' ? colors.yellow :
|
|
28
|
+
info.riskLevel === 'high' ? colors.red :
|
|
29
|
+
colors.red;
|
|
30
|
+
console.log(` Risk level: ${riskColor(info.riskLevel.toUpperCase())}`);
|
|
31
|
+
if (info.uncertainty !== undefined) {
|
|
32
|
+
console.log(` Uncertainty: ${(info.uncertainty * 100).toFixed(1)}%`);
|
|
60
33
|
}
|
|
61
|
-
|
|
62
|
-
console.log(separator('═', 80));
|
|
63
|
-
newline();
|
|
34
|
+
console.log(separator('═', 80) + '\n');
|
|
64
35
|
}
|
|
65
36
|
/**
|
|
66
37
|
* Calculate diff summary from old and new content
|
|
@@ -71,26 +42,18 @@ export function calculateDiffSummary(oldContent, newContent) {
|
|
|
71
42
|
let linesAdded = 0;
|
|
72
43
|
let linesRemoved = 0;
|
|
73
44
|
let linesChanged = 0;
|
|
74
|
-
// Simple line-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (
|
|
45
|
+
// Simple line-by-line comparison
|
|
46
|
+
const maxLen = Math.max(oldLines.length, newLines.length);
|
|
47
|
+
for (let i = 0; i < maxLen; i++) {
|
|
48
|
+
const oldLine = oldLines[i];
|
|
49
|
+
const newLine = newLines[i];
|
|
50
|
+
if (oldLine === undefined) {
|
|
80
51
|
linesAdded++;
|
|
81
52
|
}
|
|
82
|
-
|
|
83
|
-
// Count removed lines (in old but not in new)
|
|
84
|
-
for (const line of oldLines) {
|
|
85
|
-
if (!newSet.has(line)) {
|
|
53
|
+
else if (newLine === undefined) {
|
|
86
54
|
linesRemoved++;
|
|
87
55
|
}
|
|
88
|
-
|
|
89
|
-
// Changed lines = lines that exist in both but at different positions
|
|
90
|
-
// Simplified: count lines that are in both but position differs
|
|
91
|
-
const minLength = Math.min(oldLines.length, newLines.length);
|
|
92
|
-
for (let i = 0; i < minLength; i++) {
|
|
93
|
-
if (oldLines[i] !== newLines[i] && oldSet.has(newLines[i])) {
|
|
56
|
+
else if (oldLine !== newLine) {
|
|
94
57
|
linesChanged++;
|
|
95
58
|
}
|
|
96
59
|
}
|
|
@@ -104,16 +67,6 @@ export function calculateDiffSummary(oldContent, newContent) {
|
|
|
104
67
|
* Format edit summary for display
|
|
105
68
|
*/
|
|
106
69
|
export function formatEditSummary(summary) {
|
|
107
|
-
|
|
108
|
-
if (summary.linesAdded > 0) {
|
|
109
|
-
changes.push(`${summary.linesAdded} added`);
|
|
110
|
-
}
|
|
111
|
-
if (summary.linesRemoved > 0) {
|
|
112
|
-
changes.push(`${summary.linesRemoved} removed`);
|
|
113
|
-
}
|
|
114
|
-
if (summary.linesChanged > 0) {
|
|
115
|
-
changes.push(`${summary.linesChanged} changed`);
|
|
116
|
-
}
|
|
117
|
-
return changes.length > 0 ? changes.join(', ') : 'No changes';
|
|
70
|
+
return `${summary.filepath}: +${summary.linesAdded} -${summary.linesRemoved} ~${summary.linesChanged}`;
|
|
118
71
|
}
|
|
119
72
|
//# sourceMappingURL=review-checkpoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-checkpoint.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/review-checkpoint.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"review-checkpoint.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/review-checkpoint.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAkBhD;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAA0B;IAChE,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;IAEhC,gBAAgB;IAChB,OAAO,CAAC,G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