codehere 0.2.0 → 0.4.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.
Potentially problematic release.
This version of codehere might be problematic. Click here for more details.
- package/README.md +223 -42
- package/dist/application/agents/documentation-agent.d.ts +24 -0
- package/dist/application/agents/documentation-agent.d.ts.map +1 -0
- package/dist/application/agents/documentation-agent.js +399 -0
- package/dist/application/agents/documentation-agent.js.map +1 -0
- package/dist/application/agents/execution-agent.d.ts +11 -0
- package/dist/application/agents/execution-agent.d.ts.map +1 -1
- package/dist/application/agents/execution-agent.js +289 -80
- package/dist/application/agents/execution-agent.js.map +1 -1
- package/dist/application/agents/multi-agent-orchestrator.d.ts +4 -0
- package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -1
- package/dist/application/agents/multi-agent-orchestrator.js +86 -0
- package/dist/application/agents/multi-agent-orchestrator.js.map +1 -1
- package/dist/application/agents/planning-agent.d.ts +3 -0
- package/dist/application/agents/planning-agent.d.ts.map +1 -1
- package/dist/application/agents/planning-agent.js +132 -64
- package/dist/application/agents/planning-agent.js.map +1 -1
- package/dist/application/agents/product-requirements-agent.d.ts +21 -0
- package/dist/application/agents/product-requirements-agent.d.ts.map +1 -0
- package/dist/application/agents/product-requirements-agent.js +247 -0
- package/dist/application/agents/product-requirements-agent.js.map +1 -0
- package/dist/application/agents/validation-agent.d.ts +5 -1
- package/dist/application/agents/validation-agent.d.ts.map +1 -1
- package/dist/application/agents/validation-agent.js +156 -21
- package/dist/application/agents/validation-agent.js.map +1 -1
- package/dist/application/services/dependency-container.d.ts +25 -2
- package/dist/application/services/dependency-container.d.ts.map +1 -1
- package/dist/application/services/dependency-container.js +163 -1
- package/dist/application/services/dependency-container.js.map +1 -1
- package/dist/application/services/intelligent-router.d.ts +13 -0
- package/dist/application/services/intelligent-router.d.ts.map +1 -1
- package/dist/application/services/intelligent-router.js +300 -87
- package/dist/application/services/intelligent-router.js.map +1 -1
- package/dist/application/use-cases/ask-question-use-case.d.ts +31 -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 +254 -55
- package/dist/application/use-cases/ask-question-use-case.js.map +1 -1
- package/dist/application/use-cases/edit-file-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/edit-file-use-case.js +86 -4
- package/dist/application/use-cases/edit-file-use-case.js.map +1 -1
- package/dist/application/use-cases/planning-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/planning-use-case.js +10 -1
- package/dist/application/use-cases/planning-use-case.js.map +1 -1
- package/dist/application/use-cases/react-orchestration-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/react-orchestration-use-case.js +6 -2
- package/dist/application/use-cases/react-orchestration-use-case.js.map +1 -1
- package/dist/domain/entities/documentation.d.ts +35 -0
- package/dist/domain/entities/documentation.d.ts.map +1 -0
- package/dist/domain/entities/documentation.js +6 -0
- package/dist/domain/entities/documentation.js.map +1 -0
- package/dist/domain/entities/product-requirements.d.ts +50 -0
- package/dist/domain/entities/product-requirements.d.ts.map +1 -0
- package/dist/domain/entities/product-requirements.js +6 -0
- package/dist/domain/entities/product-requirements.js.map +1 -0
- package/dist/domain/entities/task.d.ts +152 -0
- package/dist/domain/entities/task.d.ts.map +1 -0
- package/dist/domain/entities/task.js +61 -0
- package/dist/domain/entities/task.js.map +1 -0
- package/dist/domain/interfaces/agent.interface.d.ts +15 -0
- package/dist/domain/interfaces/agent.interface.d.ts.map +1 -0
- package/dist/domain/interfaces/agent.interface.js +6 -0
- package/dist/domain/interfaces/agent.interface.js.map +1 -0
- package/dist/domain/services/environment-mode-manager.d.ts +18 -0
- package/dist/domain/services/environment-mode-manager.d.ts.map +1 -0
- package/dist/domain/services/environment-mode-manager.js +37 -0
- package/dist/domain/services/environment-mode-manager.js.map +1 -0
- package/dist/domain/services/react-loop.d.ts +8 -0
- package/dist/domain/services/react-loop.d.ts.map +1 -1
- package/dist/domain/services/react-loop.js +82 -6
- package/dist/domain/services/react-loop.js.map +1 -1
- package/dist/domain/services/risk-tier-detector.d.ts +18 -0
- package/dist/domain/services/risk-tier-detector.d.ts.map +1 -0
- package/dist/domain/services/risk-tier-detector.js +65 -0
- package/dist/domain/services/risk-tier-detector.js.map +1 -0
- package/dist/formatter.d.ts +2 -2
- package/dist/formatter.d.ts.map +1 -1
- package/dist/formatter.js +40 -20
- package/dist/formatter.js.map +1 -1
- package/dist/index.js +218 -125
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/ai/cohere-ai-service.d.ts +3 -1
- package/dist/infrastructure/ai/cohere-ai-service.d.ts.map +1 -1
- package/dist/infrastructure/ai/cohere-ai-service.js +65 -5
- package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
- package/dist/infrastructure/ai/fake-ai-service.d.ts +22 -0
- package/dist/infrastructure/ai/fake-ai-service.d.ts.map +1 -0
- package/dist/infrastructure/ai/fake-ai-service.js +59 -0
- package/dist/infrastructure/ai/fake-ai-service.js.map +1 -0
- package/dist/infrastructure/ai/provider-ai-service.d.ts +59 -0
- package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -0
- package/dist/infrastructure/ai/provider-ai-service.js +477 -0
- package/dist/infrastructure/ai/provider-ai-service.js.map +1 -0
- package/dist/infrastructure/cache/embedding-cache.d.ts +13 -1
- package/dist/infrastructure/cache/embedding-cache.d.ts.map +1 -1
- package/dist/infrastructure/cache/embedding-cache.js +80 -9
- package/dist/infrastructure/cache/embedding-cache.js.map +1 -1
- package/dist/infrastructure/cache/query-result-cache.d.ts +68 -0
- package/dist/infrastructure/cache/query-result-cache.d.ts.map +1 -0
- package/dist/infrastructure/cache/query-result-cache.js +138 -0
- package/dist/infrastructure/cache/query-result-cache.js.map +1 -0
- package/dist/infrastructure/cache/response-cache.d.ts +86 -0
- package/dist/infrastructure/cache/response-cache.d.ts.map +1 -0
- package/dist/infrastructure/cache/response-cache.js +224 -0
- package/dist/infrastructure/cache/response-cache.js.map +1 -0
- package/dist/infrastructure/cache/security-scan-cache.d.ts +57 -0
- package/dist/infrastructure/cache/security-scan-cache.d.ts.map +1 -0
- package/dist/infrastructure/cache/security-scan-cache.js +124 -0
- package/dist/infrastructure/cache/security-scan-cache.js.map +1 -0
- package/dist/infrastructure/completion/bash-completion.d.ts +8 -0
- package/dist/infrastructure/completion/bash-completion.d.ts.map +1 -0
- package/dist/infrastructure/completion/bash-completion.js +101 -0
- package/dist/infrastructure/completion/bash-completion.js.map +1 -0
- package/dist/infrastructure/completion/completion-generator.d.ts +42 -0
- package/dist/infrastructure/completion/completion-generator.d.ts.map +1 -0
- package/dist/infrastructure/completion/completion-generator.js +184 -0
- package/dist/infrastructure/completion/completion-generator.js.map +1 -0
- package/dist/infrastructure/completion/fish-completion.d.ts +8 -0
- package/dist/infrastructure/completion/fish-completion.d.ts.map +1 -0
- package/dist/infrastructure/completion/fish-completion.js +65 -0
- package/dist/infrastructure/completion/fish-completion.js.map +1 -0
- package/dist/infrastructure/completion/zsh-completion.d.ts +8 -0
- package/dist/infrastructure/completion/zsh-completion.d.ts.map +1 -0
- package/dist/infrastructure/completion/zsh-completion.js +85 -0
- package/dist/infrastructure/completion/zsh-completion.js.map +1 -0
- package/dist/infrastructure/context/context-compressor.d.ts +94 -0
- package/dist/infrastructure/context/context-compressor.d.ts.map +1 -0
- package/dist/infrastructure/context/context-compressor.js +329 -0
- package/dist/infrastructure/context/context-compressor.js.map +1 -0
- package/dist/infrastructure/context/conversation-context.d.ts +58 -0
- package/dist/infrastructure/context/conversation-context.d.ts.map +1 -0
- package/dist/infrastructure/context/conversation-context.js +170 -0
- package/dist/infrastructure/context/conversation-context.js.map +1 -0
- package/dist/infrastructure/context/session-manager.d.ts +26 -0
- package/dist/infrastructure/context/session-manager.d.ts.map +1 -0
- package/dist/infrastructure/context/session-manager.js +98 -0
- package/dist/infrastructure/context/session-manager.js.map +1 -0
- package/dist/infrastructure/cost/cost-tracker.d.ts +1 -0
- package/dist/infrastructure/cost/cost-tracker.d.ts.map +1 -1
- package/dist/infrastructure/cost/cost-tracker.js +12 -5
- package/dist/infrastructure/cost/cost-tracker.js.map +1 -1
- package/dist/infrastructure/governance/nist-ai-rmf.d.ts +6 -8
- package/dist/infrastructure/governance/nist-ai-rmf.d.ts.map +1 -1
- package/dist/infrastructure/governance/nist-ai-rmf.js +6 -8
- package/dist/infrastructure/governance/nist-ai-rmf.js.map +1 -1
- package/dist/infrastructure/governance/policy-as-code.d.ts +6 -8
- package/dist/infrastructure/governance/policy-as-code.d.ts.map +1 -1
- package/dist/infrastructure/governance/policy-as-code.js +24 -11
- package/dist/infrastructure/governance/policy-as-code.js.map +1 -1
- package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts +7 -9
- package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts.map +1 -1
- package/dist/infrastructure/governance/prompt-to-code-lineage.js +7 -9
- package/dist/infrastructure/governance/prompt-to-code-lineage.js.map +1 -1
- package/dist/infrastructure/observability/execution-tracer.d.ts +5 -2
- package/dist/infrastructure/observability/execution-tracer.d.ts.map +1 -1
- package/dist/infrastructure/observability/execution-tracer.js +45 -8
- package/dist/infrastructure/observability/execution-tracer.js.map +1 -1
- package/dist/infrastructure/providers/cohere-provider.d.ts +39 -0
- package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/cohere-provider.js +359 -0
- package/dist/infrastructure/providers/cohere-provider.js.map +1 -0
- package/dist/infrastructure/providers/fake-provider.d.ts +43 -0
- package/dist/infrastructure/providers/fake-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/fake-provider.js +130 -0
- package/dist/infrastructure/providers/fake-provider.js.map +1 -0
- package/dist/infrastructure/providers/local-llm-provider.d.ts +49 -0
- package/dist/infrastructure/providers/local-llm-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/local-llm-provider.js +330 -0
- package/dist/infrastructure/providers/local-llm-provider.js.map +1 -0
- package/dist/infrastructure/providers/model-config.types.d.ts +70 -0
- package/dist/infrastructure/providers/model-config.types.d.ts.map +1 -0
- package/dist/infrastructure/providers/model-config.types.js +9 -0
- package/dist/infrastructure/providers/model-config.types.js.map +1 -0
- package/dist/infrastructure/providers/model-provider.interface.d.ts +113 -0
- package/dist/infrastructure/providers/model-provider.interface.d.ts.map +1 -0
- package/dist/infrastructure/providers/model-provider.interface.js +8 -0
- package/dist/infrastructure/providers/model-provider.interface.js.map +1 -0
- package/dist/infrastructure/providers/openai-provider.d.ts +38 -0
- package/dist/infrastructure/providers/openai-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/openai-provider.js +413 -0
- package/dist/infrastructure/providers/openai-provider.js.map +1 -0
- package/dist/infrastructure/providers/operation-provider-resolver.d.ts +48 -0
- package/dist/infrastructure/providers/operation-provider-resolver.d.ts.map +1 -0
- package/dist/infrastructure/providers/operation-provider-resolver.js +105 -0
- package/dist/infrastructure/providers/operation-provider-resolver.js.map +1 -0
- package/dist/infrastructure/providers/provider-config-loader.d.ts +37 -0
- package/dist/infrastructure/providers/provider-config-loader.d.ts.map +1 -0
- package/dist/infrastructure/providers/provider-config-loader.js +120 -0
- package/dist/infrastructure/providers/provider-config-loader.js.map +1 -0
- package/dist/infrastructure/providers/provider-registry.d.ts +53 -0
- package/dist/infrastructure/providers/provider-registry.d.ts.map +1 -0
- package/dist/infrastructure/providers/provider-registry.js +88 -0
- package/dist/infrastructure/providers/provider-registry.js.map +1 -0
- package/dist/infrastructure/security/ai-sast-scanner.d.ts +4 -0
- package/dist/infrastructure/security/ai-sast-scanner.d.ts.map +1 -1
- package/dist/infrastructure/security/ai-sast-scanner.js +82 -4
- package/dist/infrastructure/security/ai-sast-scanner.js.map +1 -1
- package/dist/infrastructure/security/enhanced-security-gate.d.ts +2 -0
- package/dist/infrastructure/security/enhanced-security-gate.d.ts.map +1 -1
- package/dist/infrastructure/security/enhanced-security-gate.js +74 -15
- package/dist/infrastructure/security/enhanced-security-gate.js.map +1 -1
- package/dist/infrastructure/storage/plan-repository.d.ts +38 -0
- package/dist/infrastructure/storage/plan-repository.d.ts.map +1 -0
- package/dist/infrastructure/storage/plan-repository.js +133 -0
- package/dist/infrastructure/storage/plan-repository.js.map +1 -0
- package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +11 -0
- package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-embedding-repository.js +121 -6
- package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +1 -1
- package/dist/infrastructure/storage/task-helpers.d.ts +58 -0
- package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -0
- package/dist/infrastructure/storage/task-helpers.js +157 -0
- package/dist/infrastructure/storage/task-helpers.js.map +1 -0
- package/dist/infrastructure/storage/task-repository.d.ts +67 -0
- package/dist/infrastructure/storage/task-repository.d.ts.map +1 -0
- package/dist/infrastructure/storage/task-repository.js +205 -0
- package/dist/infrastructure/storage/task-repository.js.map +1 -0
- package/dist/infrastructure/ux/bi-directional-learning.d.ts +22 -0
- package/dist/infrastructure/ux/bi-directional-learning.d.ts.map +1 -1
- package/dist/infrastructure/ux/bi-directional-learning.js +144 -7
- package/dist/infrastructure/ux/bi-directional-learning.js.map +1 -1
- package/dist/infrastructure/ux/capability-boundaries.d.ts +50 -0
- package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -0
- package/dist/infrastructure/ux/capability-boundaries.js +167 -0
- package/dist/infrastructure/ux/capability-boundaries.js.map +1 -0
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts +63 -0
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -0
- package/dist/infrastructure/ux/comprehensive-formatter.js +212 -0
- package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -0
- package/dist/infrastructure/ux/contextual-feature-discovery.d.ts +24 -0
- package/dist/infrastructure/ux/contextual-feature-discovery.d.ts.map +1 -0
- package/dist/infrastructure/ux/contextual-feature-discovery.js +144 -0
- package/dist/infrastructure/ux/contextual-feature-discovery.js.map +1 -0
- package/dist/infrastructure/ux/expectation-management.d.ts +33 -0
- package/dist/infrastructure/ux/expectation-management.d.ts.map +1 -1
- package/dist/infrastructure/ux/expectation-management.js +138 -4
- package/dist/infrastructure/ux/expectation-management.js.map +1 -1
- package/dist/infrastructure/ux/feature-discovery.d.ts +47 -0
- package/dist/infrastructure/ux/feature-discovery.d.ts.map +1 -0
- package/dist/infrastructure/ux/feature-discovery.js +190 -0
- package/dist/infrastructure/ux/feature-discovery.js.map +1 -0
- package/dist/infrastructure/ux/feedback-prompt.d.ts +42 -0
- package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -0
- package/dist/infrastructure/ux/feedback-prompt.js +181 -0
- package/dist/infrastructure/ux/feedback-prompt.js.map +1 -0
- package/dist/infrastructure/ux/hitl-review-portal.d.ts +47 -0
- package/dist/infrastructure/ux/hitl-review-portal.d.ts.map +1 -0
- package/dist/infrastructure/ux/hitl-review-portal.js +228 -0
- package/dist/infrastructure/ux/hitl-review-portal.js.map +1 -0
- package/dist/infrastructure/ux/hitl-validation.d.ts +35 -0
- package/dist/infrastructure/ux/hitl-validation.d.ts.map +1 -1
- package/dist/infrastructure/ux/hitl-validation.js +86 -0
- package/dist/infrastructure/ux/hitl-validation.js.map +1 -1
- package/dist/infrastructure/ux/progress-indicator.d.ts +55 -0
- package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -0
- package/dist/infrastructure/ux/progress-indicator.js +131 -0
- package/dist/infrastructure/ux/progress-indicator.js.map +1 -0
- package/dist/infrastructure/ux/progressive-disclosure.d.ts.map +1 -1
- package/dist/infrastructure/ux/progressive-disclosure.js +2 -1
- package/dist/infrastructure/ux/progressive-disclosure.js.map +1 -1
- package/dist/infrastructure/ux/proportional-friction.d.ts +73 -0
- package/dist/infrastructure/ux/proportional-friction.d.ts.map +1 -0
- package/dist/infrastructure/ux/proportional-friction.js +200 -0
- package/dist/infrastructure/ux/proportional-friction.js.map +1 -0
- package/dist/infrastructure/ux/review-checkpoint.d.ts +35 -0
- package/dist/infrastructure/ux/review-checkpoint.d.ts.map +1 -0
- package/dist/infrastructure/ux/review-checkpoint.js +119 -0
- package/dist/infrastructure/ux/review-checkpoint.js.map +1 -0
- package/dist/infrastructure/ux/staged-feature-intro.d.ts +47 -0
- package/dist/infrastructure/ux/staged-feature-intro.d.ts.map +1 -0
- package/dist/infrastructure/ux/staged-feature-intro.js +144 -0
- package/dist/infrastructure/ux/staged-feature-intro.js.map +1 -0
- package/dist/infrastructure/ux/syntax-highlighter.d.ts +21 -0
- package/dist/infrastructure/ux/syntax-highlighter.d.ts.map +1 -0
- package/dist/infrastructure/ux/syntax-highlighter.js +172 -0
- package/dist/infrastructure/ux/syntax-highlighter.js.map +1 -0
- package/dist/infrastructure/validation/agent-feedback.d.ts +115 -0
- package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -0
- package/dist/infrastructure/validation/agent-feedback.js +227 -0
- package/dist/infrastructure/validation/agent-feedback.js.map +1 -0
- package/dist/infrastructure/validation/agent-validation-helper.d.ts +75 -0
- package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -0
- package/dist/infrastructure/validation/agent-validation-helper.js +88 -0
- package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -0
- package/dist/infrastructure/validation/feedback-stats.d.ts +99 -0
- package/dist/infrastructure/validation/feedback-stats.d.ts.map +1 -0
- package/dist/infrastructure/validation/feedback-stats.js +173 -0
- package/dist/infrastructure/validation/feedback-stats.js.map +1 -0
- package/dist/infrastructure/validation/review-handler.d.ts +54 -0
- package/dist/infrastructure/validation/review-handler.d.ts.map +1 -0
- package/dist/infrastructure/validation/review-handler.js +206 -0
- package/dist/infrastructure/validation/review-handler.js.map +1 -0
- package/dist/infrastructure/validation/summary-aggregator.d.ts +42 -0
- package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -0
- package/dist/infrastructure/validation/summary-aggregator.js +156 -0
- package/dist/infrastructure/validation/summary-aggregator.js.map +1 -0
- package/dist/infrastructure/validation/summary-extractor.d.ts +59 -0
- package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -0
- package/dist/infrastructure/validation/summary-extractor.js +102 -0
- package/dist/infrastructure/validation/summary-extractor.js.map +1 -0
- package/dist/infrastructure/validation/trace-summary.d.ts +72 -0
- package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -0
- package/dist/infrastructure/validation/trace-summary.js +371 -0
- package/dist/infrastructure/validation/trace-summary.js.map +1 -0
- package/dist/infrastructure/validation/trust-config.d.ts +27 -0
- package/dist/infrastructure/validation/trust-config.d.ts.map +1 -0
- package/dist/infrastructure/validation/trust-config.js +113 -0
- package/dist/infrastructure/validation/trust-config.js.map +1 -0
- package/dist/infrastructure/xai/attention-visualizer.d.ts +6 -8
- package/dist/infrastructure/xai/attention-visualizer.d.ts.map +1 -1
- package/dist/infrastructure/xai/attention-visualizer.js +6 -8
- package/dist/infrastructure/xai/attention-visualizer.js.map +1 -1
- package/dist/infrastructure/xai/cot-visualizer.d.ts +6 -8
- package/dist/infrastructure/xai/cot-visualizer.d.ts.map +1 -1
- package/dist/infrastructure/xai/cot-visualizer.js +62 -18
- package/dist/infrastructure/xai/cot-visualizer.js.map +1 -1
- package/dist/infrastructure/xai/decision-tree-log.d.ts +6 -10
- package/dist/infrastructure/xai/decision-tree-log.d.ts.map +1 -1
- package/dist/infrastructure/xai/decision-tree-log.js +6 -10
- package/dist/infrastructure/xai/decision-tree-log.js.map +1 -1
- package/dist/infrastructure/xai/interactive-xai.d.ts +6 -8
- package/dist/infrastructure/xai/interactive-xai.d.ts.map +1 -1
- package/dist/infrastructure/xai/interactive-xai.js +6 -8
- package/dist/infrastructure/xai/interactive-xai.js.map +1 -1
- package/dist/infrastructure/xai/uncertainty-quantifier.d.ts +6 -9
- package/dist/infrastructure/xai/uncertainty-quantifier.d.ts.map +1 -1
- package/dist/infrastructure/xai/uncertainty-quantifier.js +6 -9
- package/dist/infrastructure/xai/uncertainty-quantifier.js.map +1 -1
- package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/ask-command.js +152 -13
- package/dist/presentation/cli/commands/ask-command.js.map +1 -1
- package/dist/presentation/cli/commands/docs-command.d.ts +12 -0
- package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/docs-command.js +196 -0
- package/dist/presentation/cli/commands/docs-command.js.map +1 -0
- package/dist/presentation/cli/commands/fix-command.d.ts +8 -0
- package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/fix-command.js +309 -0
- package/dist/presentation/cli/commands/fix-command.js.map +1 -0
- package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/help-command.js +2 -0
- package/dist/presentation/cli/commands/help-command.js.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.d.ts +2 -0
- package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.js +88 -1
- 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 +136 -7
- package/dist/presentation/cli/commands/plan-command.js.map +1 -1
- package/dist/presentation/cli/commands/product-command.d.ts +12 -0
- package/dist/presentation/cli/commands/product-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/product-command.js +188 -0
- package/dist/presentation/cli/commands/product-command.js.map +1 -0
- package/dist/presentation/cli/commands/react-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/react-command.js +98 -16
- package/dist/presentation/cli/commands/react-command.js.map +1 -1
- package/dist/presentation/cli/commands/review-command.d.ts +14 -0
- package/dist/presentation/cli/commands/review-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/review-command.js +22 -0
- package/dist/presentation/cli/commands/review-command.js.map +1 -0
- package/dist/presentation/cli/commands/run-command.d.ts +15 -0
- package/dist/presentation/cli/commands/run-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/run-command.js +29 -0
- package/dist/presentation/cli/commands/run-command.js.map +1 -0
- package/dist/presentation/cli/commands/setup-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/setup-command.js +67 -12
- package/dist/presentation/cli/commands/setup-command.js.map +1 -1
- package/dist/presentation/cli/commands/smart-command.d.ts +3 -1
- package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/smart-command.js +227 -23
- package/dist/presentation/cli/commands/smart-command.js.map +1 -1
- package/dist/presentation/cli/commands/status-command.d.ts +11 -0
- package/dist/presentation/cli/commands/status-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/status-command.js +176 -0
- package/dist/presentation/cli/commands/status-command.js.map +1 -0
- package/dist/presentation/cli/commands/suggest-command.d.ts +13 -0
- package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/suggest-command.js +25 -0
- package/dist/presentation/cli/commands/suggest-command.js.map +1 -0
- package/dist/presentation/cli/commands/trace-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/trace-command.js +9 -5
- package/dist/presentation/cli/commands/trace-command.js.map +1 -1
- package/dist/presentation/cli/commands/undo-command.js +15 -6
- package/dist/presentation/cli/commands/undo-command.js.map +1 -1
- package/dist/presentation/cli/error-display.d.ts +2 -0
- package/dist/presentation/cli/error-display.d.ts.map +1 -1
- package/dist/presentation/cli/error-display.js +220 -2
- package/dist/presentation/cli/error-display.js.map +1 -1
- package/dist/presentation/cli/keyboard-shortcuts.d.ts +27 -0
- package/dist/presentation/cli/keyboard-shortcuts.d.ts.map +1 -0
- package/dist/presentation/cli/keyboard-shortcuts.js +77 -0
- package/dist/presentation/cli/keyboard-shortcuts.js.map +1 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +39 -2
- package/dist/session.js.map +1 -1
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +8 -5
- package/dist/ui.js.map +1 -1
- package/dist/utils/version.js +2 -2
- package/dist/verification/backup.d.ts.map +1 -1
- package/dist/verification/backup.js +24 -3
- package/dist/verification/backup.js.map +1 -1
- package/dist/verification/compiler.js +47 -12
- package/dist/verification/compiler.js.map +1 -1
- package/package.json +10 -2
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { MemoryRetriever } from '../../domain/services/memory-retriever.js';
|
|
6
6
|
import { getEmbeddingCache } from '../../infrastructure/cache/embedding-cache.js';
|
|
7
|
+
import { getQueryResultCache } from '../../infrastructure/cache/query-result-cache.js';
|
|
8
|
+
import { getResponseCache } from '../../infrastructure/cache/response-cache.js';
|
|
7
9
|
export class AskQuestionUseCase {
|
|
8
10
|
embeddingRepository;
|
|
9
11
|
aiService;
|
|
@@ -11,6 +13,8 @@ export class AskQuestionUseCase {
|
|
|
11
13
|
uncertaintyQuantifier;
|
|
12
14
|
memoryRetriever;
|
|
13
15
|
embeddingCache = getEmbeddingCache();
|
|
16
|
+
queryResultCache = getQueryResultCache();
|
|
17
|
+
responseCache = getResponseCache();
|
|
14
18
|
constructor(embeddingRepository, aiService, memoryRepository, uncertaintyQuantifier) {
|
|
15
19
|
this.embeddingRepository = embeddingRepository;
|
|
16
20
|
this.aiService = aiService;
|
|
@@ -19,10 +23,61 @@ export class AskQuestionUseCase {
|
|
|
19
23
|
this.memoryRetriever = new MemoryRetriever();
|
|
20
24
|
}
|
|
21
25
|
async execute(request) {
|
|
26
|
+
// 0. Check if query is git-related and use git tool directly
|
|
27
|
+
const gitKeywords = ['git', 'modified', 'changed', 'status', 'commit', 'branch', 'diff', 'staged', 'untracked'];
|
|
28
|
+
const isGitQuery = gitKeywords.some(keyword => request.query.toLowerCase().includes(keyword));
|
|
29
|
+
if (isGitQuery) {
|
|
30
|
+
try {
|
|
31
|
+
const { GitTool } = await import('../../tools/git-tool.js');
|
|
32
|
+
// Use process.cwd() for working directory (request doesn't have context property)
|
|
33
|
+
const gitTool = new GitTool(process.cwd());
|
|
34
|
+
// Check if it's a git repository first
|
|
35
|
+
const isRepo = await gitTool.isRepository();
|
|
36
|
+
if (!isRepo) {
|
|
37
|
+
return {
|
|
38
|
+
answer: 'This directory is not a Git repository. Initialize a Git repository first with `git init`.',
|
|
39
|
+
chunks: [],
|
|
40
|
+
memories: [],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const gitStatus = await gitTool.status();
|
|
44
|
+
// Format git status response
|
|
45
|
+
let gitAnswer = `Git Repository Status:\n`;
|
|
46
|
+
gitAnswer += `Branch: ${gitStatus.branch}\n\n`;
|
|
47
|
+
if (gitStatus.modified.length > 0) {
|
|
48
|
+
gitAnswer += `Modified files:\n${gitStatus.modified.map(f => ` - ${f}`).join('\n')}\n\n`;
|
|
49
|
+
}
|
|
50
|
+
if (gitStatus.staged.length > 0) {
|
|
51
|
+
gitAnswer += `Staged files:\n${gitStatus.staged.map(f => ` - ${f}`).join('\n')}\n\n`;
|
|
52
|
+
}
|
|
53
|
+
if (gitStatus.untracked.length > 0) {
|
|
54
|
+
gitAnswer += `Untracked files:\n${gitStatus.untracked.map(f => ` - ${f}`).join('\n')}\n\n`;
|
|
55
|
+
}
|
|
56
|
+
if (gitStatus.modified.length === 0 && gitStatus.staged.length === 0 && gitStatus.untracked.length === 0) {
|
|
57
|
+
gitAnswer += `No changes detected. Working directory is clean.`;
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
answer: gitAnswer,
|
|
61
|
+
chunks: [],
|
|
62
|
+
memories: [],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
// Fallback to regular search if git tool fails
|
|
67
|
+
// Log error for debugging but don't show to user
|
|
68
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
69
|
+
console.warn('[AskQuestionUseCase] Git tool failed, falling back to regular search:', errorMessage);
|
|
70
|
+
// Continue to regular search flow below
|
|
71
|
+
}
|
|
72
|
+
}
|
|
22
73
|
// 1. Generate query embedding using search_query input type (better matching!)
|
|
23
74
|
// Performance: Check cache first to avoid redundant API calls
|
|
75
|
+
const embeddingStart = Date.now();
|
|
24
76
|
let queryEmbedding = this.embeddingCache.get(request.query);
|
|
77
|
+
const embeddingCacheTime = Date.now() - embeddingStart;
|
|
78
|
+
let embeddingGenTime = 0;
|
|
25
79
|
if (!queryEmbedding) {
|
|
80
|
+
const genStart = Date.now();
|
|
26
81
|
// Use embedQuery if available, fallback to embed for backward compatibility
|
|
27
82
|
if ('embedQuery' in this.aiService && typeof this.aiService.embedQuery === 'function') {
|
|
28
83
|
const embedding = await this.aiService.embedQuery(request.query);
|
|
@@ -35,6 +90,7 @@ export class AskQuestionUseCase {
|
|
|
35
90
|
}
|
|
36
91
|
queryEmbedding = embedding;
|
|
37
92
|
}
|
|
93
|
+
embeddingGenTime = Date.now() - genStart;
|
|
38
94
|
if (!queryEmbedding) {
|
|
39
95
|
throw new Error('Failed to generate query embedding');
|
|
40
96
|
}
|
|
@@ -49,72 +105,159 @@ export class AskQuestionUseCase {
|
|
|
49
105
|
// OPTIMIZATION: For simple queries, reduce operations and skip memory if not needed
|
|
50
106
|
const isSimpleQuery = this.isSimpleQuery(request.query);
|
|
51
107
|
// AGGRESSIVE OPTIMIZATION: For simple queries, use minimal operations
|
|
108
|
+
// OPTIMIZATION: Reduce initial search limit to reduce processing time
|
|
52
109
|
const initialLimit = isSimpleQuery
|
|
53
110
|
? 3 // Only need top 3 chunks for simple queries (fast!)
|
|
54
|
-
: Math.min((request.maxResults ||
|
|
55
|
-
//
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
111
|
+
: Math.min((request.maxResults || 8) * 2, 20); // Reduced from 50 to 20 for faster search
|
|
112
|
+
// Check query result cache first (performance optimization)
|
|
113
|
+
const cachedResults = this.queryResultCache.get(request.query, initialLimit);
|
|
114
|
+
let initialChunks;
|
|
115
|
+
let allMemories = [];
|
|
116
|
+
let searchTime = 0; // Performance metrics
|
|
117
|
+
let rerankTime = 0; // Performance metrics
|
|
118
|
+
// Show progress indicator for search (if not cached and operation >2s expected)
|
|
119
|
+
let searchProgress = null;
|
|
120
|
+
if (!cachedResults && !isSimpleQuery) {
|
|
121
|
+
try {
|
|
122
|
+
const { createEmbeddingSearchProgress } = await import('../../infrastructure/ux/progress-indicator.js');
|
|
123
|
+
// Estimate total chunks (we don't know exact count, so use spinner)
|
|
124
|
+
searchProgress = createEmbeddingSearchProgress(0); // 0 = use spinner
|
|
125
|
+
searchProgress.start({ message: 'Searching codebase...' });
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
// Progress indicator not critical, continue without it
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (cachedResults) {
|
|
132
|
+
// Cache hit - use cached results
|
|
133
|
+
this.queryResultCache.recordHit();
|
|
134
|
+
initialChunks = cachedResults;
|
|
135
|
+
// Still retrieve memories in parallel (if not simple query)
|
|
136
|
+
if (!isSimpleQuery && this.memoryRepository && queryEmbedding) {
|
|
137
|
+
allMemories = await this.memoryRepository.retrieve(request.query, 10).catch(() => []);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
// Cache miss - perform search
|
|
142
|
+
this.queryResultCache.recordMiss();
|
|
143
|
+
// Run code search and memory retrieval in parallel (skip memory for simple queries)
|
|
144
|
+
const searchStart = Date.now();
|
|
145
|
+
const results = await Promise.all([
|
|
146
|
+
// Code search - minimal for simple queries
|
|
147
|
+
this.embeddingRepository.searchWithEmbedding(queryEmbedding, initialLimit),
|
|
148
|
+
// Memory retrieval: Skip for simple queries to save time (they don't need context)
|
|
149
|
+
!isSimpleQuery && this.memoryRepository && queryEmbedding
|
|
150
|
+
? this.memoryRepository.retrieve(request.query, 10).catch(() => []) // Graceful fallback
|
|
151
|
+
: Promise.resolve([]),
|
|
152
|
+
]);
|
|
153
|
+
searchTime = Date.now() - searchStart;
|
|
154
|
+
initialChunks = results[0];
|
|
155
|
+
allMemories = results[1];
|
|
156
|
+
// Cache the results for future use
|
|
157
|
+
this.queryResultCache.set(request.query, initialLimit, initialChunks);
|
|
158
|
+
// Stop progress indicator
|
|
159
|
+
if (searchProgress) {
|
|
160
|
+
searchProgress.stop(true, `Found ${initialChunks.length} chunks`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
64
163
|
if (initialChunks.length === 0) {
|
|
65
164
|
return {
|
|
66
165
|
answer: 'No relevant code found. Please run "codehere index" first.',
|
|
67
166
|
chunks: [],
|
|
68
167
|
};
|
|
69
168
|
}
|
|
70
|
-
// 3.
|
|
169
|
+
// 3. PARALLEL EXECUTION: Rerank + Memory Processing (Story 1: Parallel Context Processing)
|
|
170
|
+
// OPTIMIZATION: These operations are independent and can run in parallel
|
|
71
171
|
// OPTIMIZATION: Skip rerank for simple queries to improve speed
|
|
72
172
|
let chunks = initialChunks;
|
|
173
|
+
let memories = [];
|
|
73
174
|
// For simple queries, use minimal chunks (top 3) for fastest response
|
|
175
|
+
// Story 2: Optimized execution path - reduced context window, minimal processing
|
|
74
176
|
if (isSimpleQuery) {
|
|
75
177
|
chunks = initialChunks.slice(0, 3); // Top 3 for simple queries (aggressive optimization)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
try {
|
|
80
|
-
const documents = initialChunks.map((chunk) => chunk.content);
|
|
81
|
-
const rerankResults = await this.aiService.rerank(request.query, documents, request.maxResults || 15);
|
|
82
|
-
// Reorder chunks based on rerank scores
|
|
83
|
-
chunks = rerankResults.map((result) => {
|
|
84
|
-
const chunk = initialChunks[result.index];
|
|
85
|
-
// Update score with rerank relevance score
|
|
86
|
-
return {
|
|
87
|
-
...chunk,
|
|
88
|
-
score: result.relevanceScore,
|
|
89
|
-
};
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
catch (error) {
|
|
93
|
-
// Fallback to initial results if rerank fails
|
|
94
|
-
console.warn('Rerank API failed, using initial results:', error instanceof Error ? error.message : String(error));
|
|
95
|
-
chunks = initialChunks.slice(0, request.maxResults || 15);
|
|
178
|
+
// Process memories synchronously for simple queries (minimal processing, already fast)
|
|
179
|
+
if (allMemories.length > 0 && queryEmbedding) {
|
|
180
|
+
memories = this.memoryRetriever.retrieve(allMemories, queryEmbedding, 3); // Minimal for simple queries
|
|
96
181
|
}
|
|
97
182
|
}
|
|
98
183
|
else {
|
|
99
|
-
// For
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
184
|
+
// For complex queries: Parallelize rerank + memory processing
|
|
185
|
+
const documents = initialChunks.map((chunk) => chunk.content);
|
|
186
|
+
// Run rerank and memory processing in parallel (they're independent)
|
|
187
|
+
// OPTIMIZATION: Reduce maxResults for complex queries to reduce AI Chat latency
|
|
188
|
+
// Target: 8 chunks max (down from 15) to reduce context window by ~47%
|
|
189
|
+
const maxChunksForAI = Math.min(request.maxResults || 8, 8); // Aggressive: max 8 chunks
|
|
190
|
+
const rerankStart = Date.now();
|
|
191
|
+
const [rerankResults, processedMemories] = await Promise.all([
|
|
192
|
+
// Rerank operation (only if we have enough results)
|
|
193
|
+
initialChunks.length > 5
|
|
194
|
+
? this.aiService.rerank(request.query, documents, maxChunksForAI)
|
|
195
|
+
.then(results => results.map((result) => {
|
|
196
|
+
const chunk = initialChunks[result.index];
|
|
197
|
+
return {
|
|
198
|
+
...chunk,
|
|
199
|
+
score: result.relevanceScore,
|
|
200
|
+
};
|
|
201
|
+
}))
|
|
202
|
+
.catch((error) => {
|
|
203
|
+
// Fallback to initial results if rerank fails
|
|
204
|
+
console.warn('Rerank API failed, using initial results:', error instanceof Error ? error.message : String(error));
|
|
205
|
+
return initialChunks.slice(0, maxChunksForAI);
|
|
206
|
+
})
|
|
207
|
+
: Promise.resolve(initialChunks.slice(0, maxChunksForAI)),
|
|
208
|
+
// Memory processing (reuse query embedding, no recomputation needed)
|
|
209
|
+
allMemories.length > 0 && queryEmbedding
|
|
210
|
+
? Promise.resolve(this.memoryRetriever.retrieve(allMemories, queryEmbedding, 5))
|
|
211
|
+
: Promise.resolve([]),
|
|
212
|
+
]);
|
|
213
|
+
rerankTime = Date.now() - rerankStart;
|
|
214
|
+
chunks = rerankResults;
|
|
215
|
+
memories = processedMemories;
|
|
108
216
|
}
|
|
217
|
+
// 3. Pass conversation history through context chunks (metadata) for AI service
|
|
218
|
+
const chunksWithHistory = request.conversationHistory && request.conversationHistory.length > 0
|
|
219
|
+
? chunks.map((chunk, idx) => {
|
|
220
|
+
if (idx === 0) {
|
|
221
|
+
// Attach conversation history to first chunk as metadata
|
|
222
|
+
return {
|
|
223
|
+
...chunk,
|
|
224
|
+
conversationHistory: request.conversationHistory,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
return chunk;
|
|
228
|
+
})
|
|
229
|
+
: chunks;
|
|
109
230
|
// 3. Generate AI response with context (with optional streaming)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
231
|
+
// OPTIMIZATION: Check response cache first to avoid redundant AI calls
|
|
232
|
+
const contextHash = this.responseCache.generateContextHash(chunks);
|
|
233
|
+
let answer = '';
|
|
234
|
+
let chatTime = 0;
|
|
235
|
+
let wasResponseCached = false;
|
|
236
|
+
// Check cache (skip for streaming as it's real-time)
|
|
237
|
+
if (!request.streamHandler) {
|
|
238
|
+
const cachedAnswer = this.responseCache.get(request.query, contextHash, true);
|
|
239
|
+
if (cachedAnswer) {
|
|
240
|
+
answer = cachedAnswer;
|
|
241
|
+
wasResponseCached = true;
|
|
242
|
+
chatTime = 0; // Cache hit = instant
|
|
243
|
+
}
|
|
114
244
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
245
|
+
// If not cached, call AI service
|
|
246
|
+
if (!wasResponseCached) {
|
|
247
|
+
const chatStart = Date.now();
|
|
248
|
+
if (request.streamHandler && 'chatStream' in this.aiService && typeof this.aiService.chatStream === 'function') {
|
|
249
|
+
// Use streaming if available
|
|
250
|
+
answer = await this.aiService.chatStream(request.query, chunksWithHistory, memories, request.streamHandler);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
// Fallback to regular chat
|
|
254
|
+
answer = await this.aiService.chat(request.query, chunksWithHistory, memories);
|
|
255
|
+
}
|
|
256
|
+
chatTime = Date.now() - chatStart;
|
|
257
|
+
// Cache the response for future use
|
|
258
|
+
if (answer && !request.streamHandler) {
|
|
259
|
+
this.responseCache.set(request.query, answer, contextHash);
|
|
260
|
+
}
|
|
118
261
|
}
|
|
119
262
|
// 4. Estimate tokens (rough: 1 token ≈ 4 characters)
|
|
120
263
|
const tokenEstimate = chunks.reduce((sum, chunk) => sum + Math.ceil(chunk.content.length / 4), 0);
|
|
@@ -123,28 +266,84 @@ export class AskQuestionUseCase {
|
|
|
123
266
|
if (this.uncertaintyQuantifier && answer) {
|
|
124
267
|
uncertainty = await this.uncertaintyQuantifier.quantifyUncertainty(request.query, answer, { chunks });
|
|
125
268
|
}
|
|
269
|
+
// Get cache statistics
|
|
270
|
+
const cacheStats = this.queryResultCache.getStats();
|
|
271
|
+
const wasCacheHit = cachedResults !== null;
|
|
272
|
+
// Get compression metrics from execution tracer if available
|
|
273
|
+
let compressionMetrics;
|
|
274
|
+
try {
|
|
275
|
+
const { executionTracer } = await import('../../infrastructure/observability/execution-tracer.js');
|
|
276
|
+
const runId = executionTracer.getCurrentRunId();
|
|
277
|
+
if (runId) {
|
|
278
|
+
// Get the current run to find compression trace
|
|
279
|
+
const currentRun = executionTracer.currentRun;
|
|
280
|
+
if (currentRun) {
|
|
281
|
+
const compressionTrace = currentRun.traces.find((t) => t.operationType === 'context_compression' && t.operationName === 'compress_context');
|
|
282
|
+
if (compressionTrace && compressionTrace.output) {
|
|
283
|
+
compressionMetrics = {
|
|
284
|
+
originalTokens: compressionTrace.output.originalTokens || 0,
|
|
285
|
+
compressedTokens: compressionTrace.output.compressedTokens || 0,
|
|
286
|
+
reductionPercent: compressionTrace.output.reductionPercent || 0,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
catch {
|
|
293
|
+
// Execution tracer not available, skip compression metrics
|
|
294
|
+
}
|
|
295
|
+
// Calculate total time
|
|
296
|
+
const totalTime = Date.now() - request.__startTime || 0;
|
|
126
297
|
return {
|
|
127
298
|
answer,
|
|
128
299
|
chunks,
|
|
129
300
|
memories,
|
|
130
301
|
tokenEstimate,
|
|
131
302
|
uncertainty, // XAI Foundation - Uncertainty quantification for transparency
|
|
303
|
+
cacheHit: wasCacheHit,
|
|
304
|
+
performanceMetrics: {
|
|
305
|
+
embeddingCacheTime,
|
|
306
|
+
embeddingGenTime,
|
|
307
|
+
searchTime: cachedResults ? 0 : searchTime,
|
|
308
|
+
rerankTime: isSimpleQuery ? 0 : rerankTime,
|
|
309
|
+
chatTime,
|
|
310
|
+
totalTime,
|
|
311
|
+
},
|
|
312
|
+
cacheStats: {
|
|
313
|
+
hitRate: cacheStats.hitRate,
|
|
314
|
+
totalHits: cacheStats.totalHits,
|
|
315
|
+
totalMisses: cacheStats.totalMisses,
|
|
316
|
+
},
|
|
317
|
+
compressionMetrics, // Context compression metrics (P1)
|
|
132
318
|
};
|
|
133
319
|
}
|
|
134
320
|
/**
|
|
135
321
|
* Check if query is simple (short, question-like, single intent)
|
|
136
322
|
* Simple queries can skip rerank for better performance
|
|
137
323
|
*/
|
|
324
|
+
/**
|
|
325
|
+
* Check if query is simple (short, question-like, single intent)
|
|
326
|
+
* Story 2: Enhanced detection with improved accuracy (target: >90%)
|
|
327
|
+
* Simple queries can skip rerank for better performance
|
|
328
|
+
*/
|
|
138
329
|
isSimpleQuery(query) {
|
|
139
|
-
const lower = query.toLowerCase();
|
|
140
|
-
//
|
|
141
|
-
// 1. Short query (< 50 chars)
|
|
142
|
-
// 2. Question-like (starts with what/where/how/why/when/who/which/is/are/does/do/can/could)
|
|
143
|
-
// 3. Single sentence (no "and", "also", "then", etc.)
|
|
330
|
+
const lower = query.toLowerCase().trim();
|
|
331
|
+
// Enhanced detection patterns (Story 2: Query Simplification)
|
|
332
|
+
// 1. Short query (< 50 chars) - primary indicator
|
|
144
333
|
const isShort = query.length < 50;
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
334
|
+
// 2. Question-like patterns (expanded list for better accuracy)
|
|
335
|
+
const questionPatterns = /^(what|where|how|why|when|who|which|is|are|does|do|can|could|will|would|explain|describe|tell|show|find|locate|search|where|what's|what is|how to|how do|how does)/i;
|
|
336
|
+
const isQuestion = questionPatterns.test(lower);
|
|
337
|
+
// 3. Single intent indicators (no complex conjunctions)
|
|
338
|
+
const complexIndicators = /(and|also|then|next|first|second|finally|multiple|several|steps|after|before|while|during|create|implement|add|modify|refactor|change|update|delete|remove)/i;
|
|
339
|
+
const isSingleIntent = !complexIndicators.test(lower);
|
|
340
|
+
// 4. Simple structure (no nested clauses, no semicolons, no colons for lists)
|
|
341
|
+
const hasComplexStructure = /[;:]|\(|\)|\[|\]/.test(query);
|
|
342
|
+
// 5. No code-specific keywords (indicates need for code analysis)
|
|
343
|
+
const codeKeywords = /(function|class|interface|type|import|export|const|let|var|async|await|return|if|else|for|while|try|catch)/i;
|
|
344
|
+
const hasCodeKeywords = codeKeywords.test(lower);
|
|
345
|
+
// Simple query if: short + question-like + single intent + no complex structure + no code keywords
|
|
346
|
+
return isShort && isQuestion && isSingleIntent && !hasComplexStructure && !hasCodeKeywords;
|
|
148
347
|
}
|
|
149
348
|
}
|
|
150
349
|
//# sourceMappingURL=ask-question-use-case.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-question-use-case.js","sourceRoot":"","sources":["../../../src/application/use-cases/ask-question-use-case.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAmBlF,M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IAAI,MAAM,EAAE,CAAC;YACzC,WAAW,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,mBAAmB,CAChE,OAAO,CAAC,KAAK,EACb,MAAM,EACN,EAAE,MAAM,EAAE,CACX,CAAC;QACJ,CAAC;QAED,OAAO;YACL,MAAM;YACN,MAAM;YACN,QAAQ;YACR,aAAa;YACb,WAAW,EAAE,+DAA+D;SAC7E,CAAC;IACJ,CAAC;IAED;;;OAGG;IACK,aAAa,CAAC,KAAa;QACjC,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAElC,aAAa;QACb,8BAA8B;QAC9B,4FAA4F;QAC5F,sDAAsD;QACtD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;QAClC,MAAM,UAAU,GAAG,yHAAyH,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzJ,MAAM,cAAc,GAAG,CAAC,mEAAmE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAExG,OAAO,OAAO,IAAI,UAAU,IAAI,cAAc,CAAC;IACjD,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"ask-question-use-case.js","sourceRoot":"","sources":["../../../src/application/use-cases/ask-question-use-case.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAmChF,MAAM,OAAO,kBAAkB;IAOnB;IACA;IACA;IACA;IATF,eAAe,CAAkB;IACjC,cAAc,GAAG,iBAAiB,EAAE,CAAC;IACrC,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IACzC,aAAa,GAAG,gBAAgB,EAAE,CAAC;IAE3C,YACU,mBAAyC,EACzC,SAAqB,EACrB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oBAAoB;CAkB7B"}
|
|
@@ -192,10 +192,30 @@ export class EditFileUseCase {
|
|
|
192
192
|
metadata: { riskLevel: updatedRiskLevel },
|
|
193
193
|
}, rootNodeId);
|
|
194
194
|
}
|
|
195
|
-
// Generate edit
|
|
195
|
+
// Generate edit (with progress indicator for better UX)
|
|
196
196
|
let diff;
|
|
197
197
|
try {
|
|
198
|
-
|
|
198
|
+
// Show progress indicator for code generation (can take 20-30s)
|
|
199
|
+
const { createSpinner } = await import('../../ui.js');
|
|
200
|
+
const codeGenSpinner = createSpinner('Generating code changes...');
|
|
201
|
+
codeGenSpinner.start();
|
|
202
|
+
// Task 6.2: Include learned patterns and preferences in code generation
|
|
203
|
+
let enhancedInstruction = request.instruction;
|
|
204
|
+
if (this.biDirectionalLearning) {
|
|
205
|
+
const userId = process.env.USER || 'default-user';
|
|
206
|
+
const patternsContext = this.biDirectionalLearning.getPatternsAsPromptContext(userId, 3);
|
|
207
|
+
const preferencesContext = this.biDirectionalLearning.getPreferencesAsPromptContext(userId);
|
|
208
|
+
if (patternsContext || preferencesContext) {
|
|
209
|
+
const contextParts = [];
|
|
210
|
+
if (preferencesContext)
|
|
211
|
+
contextParts.push(preferencesContext);
|
|
212
|
+
if (patternsContext)
|
|
213
|
+
contextParts.push(patternsContext);
|
|
214
|
+
enhancedInstruction = `${request.instruction}\n\n${contextParts.join('\n\n')}`;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
diff = await this.aiService.generateEdit(currentContent, enhancedInstruction, request.filepath);
|
|
218
|
+
codeGenSpinner.stop();
|
|
199
219
|
console.log(`[EditFileUseCase] Generated diff length: ${diff.length} chars`);
|
|
200
220
|
if (diff.length > 0) {
|
|
201
221
|
console.log(`[EditFileUseCase] Diff preview: ${diff.substring(0, 200)}...`);
|
|
@@ -235,13 +255,19 @@ export class EditFileUseCase {
|
|
|
235
255
|
// Comprehensive security scan - before verification
|
|
236
256
|
// RESEARCH CONTEXT: 45% AI code has flaws, 35% license issues, provider bias risk
|
|
237
257
|
// Use Enhanced Security Gate if available (all scanners), fallback to SAST only
|
|
258
|
+
let securityResult = null; // Will be set by security scan
|
|
238
259
|
if (this.enhancedSecurityGate) {
|
|
260
|
+
// Show progress indicator for security scanning (can take 10-15s)
|
|
261
|
+
const { createSpinner } = await import('../../ui.js');
|
|
262
|
+
const securitySpinner = createSpinner('Scanning for security vulnerabilities...');
|
|
263
|
+
securitySpinner.start();
|
|
239
264
|
// Comprehensive scan: SAST + License + Provider Bias + Uncertainty
|
|
240
|
-
|
|
265
|
+
securityResult = await this.enhancedSecurityGate.scan(request.filepath, newContent, request.instruction, { query: request.instruction });
|
|
266
|
+
securitySpinner.stop();
|
|
241
267
|
if (!securityResult.passed) {
|
|
242
268
|
const errorMessages = [
|
|
243
269
|
...securityResult.errors,
|
|
244
|
-
...securityResult.warnings.map(w => `Warning: ${w}`),
|
|
270
|
+
...securityResult.warnings.map((w) => `Warning: ${w}`),
|
|
245
271
|
];
|
|
246
272
|
return {
|
|
247
273
|
success: false,
|
|
@@ -302,6 +328,12 @@ export class EditFileUseCase {
|
|
|
302
328
|
}
|
|
303
329
|
// Policy-as-Code: Evaluate policies before proceeding (Enterprise Governance)
|
|
304
330
|
if (this.policyAsCode) {
|
|
331
|
+
// Debug: Log security findings before policy evaluation
|
|
332
|
+
const criticalHighFindings = securityResult.sast.findings.filter((f) => f.severity === 'critical' || f.severity === 'high');
|
|
333
|
+
console.log(`[EditFileUseCase] Security scan: ${securityResult.sast.findings.length} total findings, ${criticalHighFindings.length} critical/high`);
|
|
334
|
+
if (criticalHighFindings.length > 0) {
|
|
335
|
+
console.log(`[EditFileUseCase] Critical/High findings:`, criticalHighFindings.map((f) => `${f.severity}: ${f.category} - ${f.description}`).join('; '));
|
|
336
|
+
}
|
|
305
337
|
const policyEvaluation = await this.policyAsCode.evaluate({
|
|
306
338
|
filepath: request.filepath,
|
|
307
339
|
code: newContent,
|
|
@@ -311,6 +343,16 @@ export class EditFileUseCase {
|
|
|
311
343
|
providerBiasFindings: securityResult.providerBias.findings,
|
|
312
344
|
uncertainty: securityResult.uncertainty,
|
|
313
345
|
});
|
|
346
|
+
// Debug: Log policy evaluation results
|
|
347
|
+
console.log(`[EditFileUseCase] Policy evaluation: ${policyEvaluation.results.length} rules evaluated, ${policyEvaluation.blockingRules.length} blocking`);
|
|
348
|
+
policyEvaluation.results.forEach((result) => {
|
|
349
|
+
if (!result.passed) {
|
|
350
|
+
console.log(`[EditFileUseCase] Policy rule "${result.ruleName}": ${result.message}`);
|
|
351
|
+
if (result.evidence) {
|
|
352
|
+
console.log(`[EditFileUseCase] Evidence:`, JSON.stringify(result.evidence, null, 2));
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
});
|
|
314
356
|
if (!policyEvaluation.passed && policyEvaluation.blockingRules.length > 0) {
|
|
315
357
|
const blockingRule = policyEvaluation.blockingRules[0];
|
|
316
358
|
console.error(`[EditFileUseCase] Policy violation: ${blockingRule.ruleName} - ${blockingRule.message}`);
|
|
@@ -410,12 +452,52 @@ export class EditFileUseCase {
|
|
|
410
452
|
}
|
|
411
453
|
}
|
|
412
454
|
}
|
|
455
|
+
// Review Checkpoint: Show summary before applying edits (Task 5.1)
|
|
456
|
+
// Display review checkpoint with diff summary, security status, and risk level
|
|
457
|
+
const { displayReviewCheckpoint, calculateDiffSummary } = await import('../../infrastructure/ux/review-checkpoint.js');
|
|
458
|
+
const diffSummary = calculateDiffSummary(currentContent, newContent);
|
|
459
|
+
// Determine risk level for review checkpoint
|
|
460
|
+
let reviewRiskLevel = 'medium';
|
|
461
|
+
if (securityResult) {
|
|
462
|
+
if (securityResult.errors && securityResult.errors.length > 0) {
|
|
463
|
+
reviewRiskLevel = 'critical';
|
|
464
|
+
}
|
|
465
|
+
else if (securityResult.warnings && securityResult.warnings.length > 0) {
|
|
466
|
+
reviewRiskLevel = 'high';
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
reviewRiskLevel = 'low';
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
const reviewInfo = {
|
|
473
|
+
filesToModify: [{
|
|
474
|
+
filepath: request.filepath,
|
|
475
|
+
linesAdded: diffSummary.linesAdded,
|
|
476
|
+
linesRemoved: diffSummary.linesRemoved,
|
|
477
|
+
linesChanged: diffSummary.linesChanged,
|
|
478
|
+
}],
|
|
479
|
+
securityScanPassed: securityResult?.passed ?? true,
|
|
480
|
+
compilationValid: true, // Will be verified after write
|
|
481
|
+
riskLevel: reviewRiskLevel,
|
|
482
|
+
uncertainty: securityResult?.uncertainty?.combined?.value,
|
|
483
|
+
};
|
|
484
|
+
displayReviewCheckpoint(reviewInfo);
|
|
413
485
|
// Verify if verification service available
|
|
414
486
|
let verification;
|
|
415
487
|
if (this.verificationService) {
|
|
416
488
|
console.log(`[EditFileUseCase] Writing file and verifying...`);
|
|
417
489
|
writeFileSync(fullPath, newContent, 'utf-8');
|
|
490
|
+
// Show progress indicator for verification (can take 5-10s)
|
|
491
|
+
const { createSpinner } = await import('../../ui.js');
|
|
492
|
+
const verificationSpinner = createSpinner('Verifying code compilation...');
|
|
493
|
+
verificationSpinner.start();
|
|
418
494
|
verification = await this.verificationService.verify(fullPath);
|
|
495
|
+
if (verification.success) {
|
|
496
|
+
verificationSpinner.succeed('Verification passed');
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
verificationSpinner.fail('Verification failed');
|
|
500
|
+
}
|
|
419
501
|
console.log(`[EditFileUseCase] Verification result: success=${verification.success}, compiled=${verification.compiled}, testsPassed=${verification.testsPassed}`);
|
|
420
502
|
if (verification.errors && verification.errors.length > 0) {
|
|
421
503
|
console.error(`[EditFileUseCase] Verification errors: ${verification.errors.join('; ')}`);
|