codehere 0.3.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 +329 -65
- 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 +95 -2
- 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 +151 -71
- 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/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 +46 -2
- package/dist/application/services/dependency-container.d.ts.map +1 -1
- package/dist/application/services/dependency-container.js +198 -8
- package/dist/application/services/dependency-container.js.map +1 -1
- package/dist/application/services/intelligent-router.d.ts +19 -0
- package/dist/application/services/intelligent-router.d.ts.map +1 -1
- package/dist/application/services/intelligent-router.js +393 -91
- package/dist/application/services/intelligent-router.js.map +1 -1
- package/dist/application/use-cases/ask-question-use-case.d.ts +20 -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 +129 -49
- 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 +16 -1
- package/dist/application/use-cases/edit-file-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/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/memory.d.ts.map +1 -1
- 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/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/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/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 +12 -0
- package/dist/domain/services/environment-mode-manager.d.ts.map +1 -0
- package/dist/domain/services/environment-mode-manager.js +22 -0
- package/dist/domain/services/environment-mode-manager.js.map +1 -0
- 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 +17 -0
- package/dist/domain/services/risk-tier-detector.d.ts.map +1 -0
- package/dist/domain/services/risk-tier-detector.js +78 -0
- package/dist/domain/services/risk-tier-detector.js.map +1 -0
- package/dist/embed.d.ts.map +1 -1
- package/dist/embed.js +18 -8
- package/dist/embed.js.map +1 -1
- package/dist/formatter.d.ts.map +1 -1
- package/dist/formatter.js +10 -3
- package/dist/formatter.js.map +1 -1
- package/dist/index.js +494 -167
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/ai/cohere-ai-service.d.ts.map +1 -1
- package/dist/infrastructure/ai/cohere-ai-service.js +19 -6
- 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 +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 +18 -0
- package/dist/infrastructure/cache/response-cache.d.ts.map +1 -0
- package/dist/infrastructure/cache/response-cache.js +48 -0
- package/dist/infrastructure/cache/response-cache.js.map +1 -0
- 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 +54 -0
- package/dist/infrastructure/context/conversation-context.d.ts.map +1 -0
- package/dist/infrastructure/context/conversation-context.js +129 -0
- package/dist/infrastructure/context/conversation-context.js.map +1 -0
- package/dist/infrastructure/context/session-manager.d.ts +42 -0
- package/dist/infrastructure/context/session-manager.d.ts.map +1 -0
- package/dist/infrastructure/context/session-manager.js +94 -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 +6 -8
- 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/protocols/a2a-metadata.js +1 -1
- package/dist/infrastructure/protocols/mcp-oauth.js +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 +444 -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/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 +48 -0
- package/dist/infrastructure/providers/operation-provider-resolver.d.ts.map +1 -0
- package/dist/infrastructure/providers/operation-provider-resolver.js +131 -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/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 +69 -0
- package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -0
- package/dist/infrastructure/storage/task-helpers.js +197 -0
- package/dist/infrastructure/storage/task-helpers.js.map +1 -0
- package/dist/infrastructure/storage/task-repository.d.ts +68 -0
- package/dist/infrastructure/storage/task-repository.d.ts.map +1 -0
- package/dist/infrastructure/storage/task-repository.js +216 -0
- package/dist/infrastructure/storage/task-repository.js.map +1 -0
- 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/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 +22 -0
- package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -0
- package/dist/infrastructure/ux/capability-boundaries.js +42 -0
- package/dist/infrastructure/ux/capability-boundaries.js.map +1 -0
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts +21 -0
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -0
- package/dist/infrastructure/ux/comprehensive-formatter.js +117 -0
- package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -0
- 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 +26 -0
- package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -0
- package/dist/infrastructure/ux/feedback-prompt.js +45 -0
- package/dist/infrastructure/ux/feedback-prompt.js.map +1 -0
- package/dist/infrastructure/ux/hitl-review-portal.d.ts.map +1 -1
- package/dist/infrastructure/ux/hitl-review-portal.js +4 -1
- package/dist/infrastructure/ux/hitl-review-portal.js.map +1 -1
- 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 +5 -6
- package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
- package/dist/infrastructure/ux/progress-indicator.js +36 -41
- package/dist/infrastructure/ux/progress-indicator.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 +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 +51 -0
- package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -0
- package/dist/infrastructure/validation/agent-feedback.js +55 -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 +137 -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 +26 -0
- package/dist/infrastructure/validation/review-handler.d.ts.map +1 -0
- package/dist/infrastructure/validation/review-handler.js +40 -0
- package/dist/infrastructure/validation/review-handler.js.map +1 -0
- package/dist/infrastructure/validation/summary-aggregator.d.ts +45 -0
- package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -0
- package/dist/infrastructure/validation/summary-aggregator.js +70 -0
- package/dist/infrastructure/validation/summary-aggregator.js.map +1 -0
- package/dist/infrastructure/validation/summary-extractor.d.ts +24 -0
- package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -0
- package/dist/infrastructure/validation/summary-extractor.js +45 -0
- package/dist/infrastructure/validation/summary-extractor.js.map +1 -0
- package/dist/infrastructure/validation/trace-summary.d.ts +45 -0
- package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -0
- package/dist/infrastructure/validation/trace-summary.js +52 -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 -9
- package/dist/infrastructure/xai/cot-visualizer.d.ts.map +1 -1
- package/dist/infrastructure/xai/cot-visualizer.js +6 -9
- 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/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 +356 -87
- 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 +14 -0
- package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/docs-command.js +25 -0
- package/dist/presentation/cli/commands/docs-command.js.map +1 -0
- package/dist/presentation/cli/commands/fix-command.d.ts +10 -0
- package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/fix-command.js +94 -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 +23 -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 +2 -0
- package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.js +182 -14
- package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
- package/dist/presentation/cli/commands/plan-command.d.ts +2 -0
- package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/plan-command.js +212 -26
- package/dist/presentation/cli/commands/plan-command.js.map +1 -1
- package/dist/presentation/cli/commands/product-command.d.ts +14 -0
- package/dist/presentation/cli/commands/product-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/product-command.js +22 -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 +8 -2
- 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 +173 -0
- package/dist/presentation/cli/commands/review-command.js.map +1 -0
- package/dist/presentation/cli/commands/run-command.d.ts +13 -0
- package/dist/presentation/cli/commands/run-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/run-command.js +188 -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 +15 -0
- 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 +165 -11
- package/dist/presentation/cli/commands/smart-command.js.map +1 -1
- package/dist/presentation/cli/commands/status-command.d.ts +14 -0
- package/dist/presentation/cli/commands/status-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/status-command.js +171 -0
- package/dist/presentation/cli/commands/status-command.js.map +1 -0
- package/dist/presentation/cli/commands/suggest-command.d.ts +11 -0
- package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/suggest-command.js +138 -0
- package/dist/presentation/cli/commands/suggest-command.js.map +1 -0
- package/dist/presentation/cli/error-display.d.ts.map +1 -1
- package/dist/presentation/cli/error-display.js +118 -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 +69 -4
- 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 +62 -6
- package/dist/ui.js.map +1 -1
- package/package.json +22 -4
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Feature Discovery
|
|
3
|
-
*
|
|
2
|
+
* Feature Discovery (v0.5.0-alpha.0 - Stub)
|
|
3
|
+
* TODO: Implement feature discovery system
|
|
4
4
|
*/
|
|
5
|
-
export interface OnboardingState {
|
|
6
|
-
onboardingComplete: boolean;
|
|
7
|
-
onboardingDate?: string;
|
|
8
|
-
commandCount: number;
|
|
9
|
-
featuresDiscovered: string[];
|
|
10
|
-
lastDiscoveryShown?: string;
|
|
11
|
-
lastDiscoveryDate?: string;
|
|
12
|
-
}
|
|
13
5
|
export interface FeatureDiscovery {
|
|
14
6
|
id: string;
|
|
15
|
-
trigger: {
|
|
16
|
-
commandCount?: number;
|
|
17
|
-
commands?: string[];
|
|
18
|
-
condition?: (state: OnboardingState) => boolean;
|
|
19
|
-
};
|
|
20
7
|
message: string;
|
|
21
8
|
features: Array<{
|
|
22
9
|
name: string;
|
|
@@ -24,24 +11,7 @@ export interface FeatureDiscovery {
|
|
|
24
11
|
command: string;
|
|
25
12
|
}>;
|
|
26
13
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Track command usage
|
|
29
|
-
*/
|
|
30
14
|
export declare function trackCommand(command: string): void;
|
|
31
|
-
/**
|
|
32
|
-
* Check if feature discovery should be shown
|
|
33
|
-
*/
|
|
34
15
|
export declare function shouldShowFeatureDiscovery(command: string): FeatureDiscovery | null;
|
|
35
|
-
|
|
36
|
-
* Mark feature discovery as shown
|
|
37
|
-
*/
|
|
38
|
-
export declare function markFeatureDiscoveryShown(discoveryId: string): void;
|
|
39
|
-
/**
|
|
40
|
-
* Check if user is first-time (onboarding not complete)
|
|
41
|
-
*/
|
|
42
|
-
export declare function isFirstTimeUser(): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Get command count for analytics
|
|
45
|
-
*/
|
|
46
|
-
export declare function getCommandCount(): number;
|
|
16
|
+
export declare function markFeatureDiscoveryShown(id: string): void;
|
|
47
17
|
//# sourceMappingURL=feature-discovery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-discovery.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/feature-discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"feature-discovery.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/feature-discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACzE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAElD;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAEnF;AAED,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAE1D"}
|
|
@@ -1,190 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Feature Discovery
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
import { readFileSync, existsSync, writeFileSync, mkdirSync } from 'fs';
|
|
6
|
-
import { join } from 'path';
|
|
7
|
-
const DISCOVERY_FEATURES = [
|
|
8
|
-
{
|
|
9
|
-
id: 'basic-commands',
|
|
10
|
-
trigger: { commandCount: 3 },
|
|
11
|
-
message: 'You\'ve mastered the basics! Try these next:',
|
|
12
|
-
features: [
|
|
13
|
-
{
|
|
14
|
-
name: 'Multi-agent Orchestration',
|
|
15
|
-
description: 'Plan and execute complex multi-step tasks',
|
|
16
|
-
command: 'codehere orchestrate "your goal"',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: 'ReAct Reasoning',
|
|
20
|
-
description: 'Debug and solve complex problems step-by-step',
|
|
21
|
-
command: 'codehere react "your problem"',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: 'Planning',
|
|
25
|
-
description: 'Generate hierarchical plans for large tasks',
|
|
26
|
-
command: 'codehere plan "your goal"',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
id: 'advanced-features',
|
|
32
|
-
trigger: { commandCount: 5 },
|
|
33
|
-
message: 'Ready for advanced features? Discover more:',
|
|
34
|
-
features: [
|
|
35
|
-
{
|
|
36
|
-
name: 'Execution Tracing',
|
|
37
|
-
description: 'View and reproduce agent execution traces',
|
|
38
|
-
command: 'codehere trace show <runId>',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: 'Knowledge Management',
|
|
42
|
-
description: 'Query and manage preserved knowledge',
|
|
43
|
-
command: 'codehere knowledge query "your query"',
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'Learning Dashboard',
|
|
47
|
-
description: 'View patterns and insights learned',
|
|
48
|
-
command: 'codehere learning overview',
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
id: 'config-management',
|
|
54
|
-
trigger: { commands: ['ask', 'explain', 'edit'] },
|
|
55
|
-
message: 'Customize your experience:',
|
|
56
|
-
features: [
|
|
57
|
-
{
|
|
58
|
-
name: 'Configuration',
|
|
59
|
-
description: 'Manage preferences and settings',
|
|
60
|
-
command: 'codehere config',
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: 'Auto-completion',
|
|
64
|
-
description: 'Install shell completion for faster commands',
|
|
65
|
-
command: 'codehere completion bash',
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
];
|
|
70
|
-
/**
|
|
71
|
-
* Get onboarding state from file
|
|
72
|
-
*/
|
|
73
|
-
function getOnboardingState() {
|
|
74
|
-
try {
|
|
75
|
-
const configDir = join(process.cwd(), 'data');
|
|
76
|
-
const onboardingPath = join(configDir, 'onboarding.json');
|
|
77
|
-
if (existsSync(onboardingPath)) {
|
|
78
|
-
const state = JSON.parse(readFileSync(onboardingPath, 'utf-8'));
|
|
79
|
-
return {
|
|
80
|
-
onboardingComplete: state.onboardingComplete || false,
|
|
81
|
-
onboardingDate: state.onboardingDate,
|
|
82
|
-
commandCount: state.commandCount || 0,
|
|
83
|
-
featuresDiscovered: state.featuresDiscovered || [],
|
|
84
|
-
lastDiscoveryShown: state.lastDiscoveryShown,
|
|
85
|
-
lastDiscoveryDate: state.lastDiscoveryDate,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
catch {
|
|
90
|
-
// Ignore errors
|
|
91
|
-
}
|
|
92
|
-
return {
|
|
93
|
-
onboardingComplete: false,
|
|
94
|
-
commandCount: 0,
|
|
95
|
-
featuresDiscovered: [],
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Save onboarding state
|
|
100
|
-
*/
|
|
101
|
-
function saveOnboardingState(state) {
|
|
102
|
-
try {
|
|
103
|
-
const configDir = join(process.cwd(), 'data');
|
|
104
|
-
if (!existsSync(configDir)) {
|
|
105
|
-
mkdirSync(configDir, { recursive: true });
|
|
106
|
-
}
|
|
107
|
-
const onboardingPath = join(configDir, 'onboarding.json');
|
|
108
|
-
writeFileSync(onboardingPath, JSON.stringify(state, null, 2));
|
|
109
|
-
}
|
|
110
|
-
catch {
|
|
111
|
-
// Ignore errors - non-critical
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Track command usage
|
|
2
|
+
* Feature Discovery (v0.5.0-alpha.0 - Stub)
|
|
3
|
+
* TODO: Implement feature discovery system
|
|
116
4
|
*/
|
|
117
5
|
export function trackCommand(command) {
|
|
118
|
-
|
|
119
|
-
state.commandCount = (state.commandCount || 0) + 1;
|
|
120
|
-
// Track feature discovery
|
|
121
|
-
if (!state.featuresDiscovered.includes(command)) {
|
|
122
|
-
state.featuresDiscovered.push(command);
|
|
123
|
-
}
|
|
124
|
-
saveOnboardingState(state);
|
|
6
|
+
// Stub implementation
|
|
125
7
|
}
|
|
126
|
-
/**
|
|
127
|
-
* Check if feature discovery should be shown
|
|
128
|
-
*/
|
|
129
8
|
export function shouldShowFeatureDiscovery(command) {
|
|
130
|
-
const state = getOnboardingState();
|
|
131
|
-
// Don't show if onboarding not complete
|
|
132
|
-
if (!state.onboardingComplete) {
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
// Don't show discovery too frequently (once per day max)
|
|
136
|
-
const lastDate = state.lastDiscoveryDate;
|
|
137
|
-
if (lastDate) {
|
|
138
|
-
const lastShown = new Date(lastDate);
|
|
139
|
-
const now = new Date();
|
|
140
|
-
const daysSince = (now.getTime() - lastShown.getTime()) / (1000 * 60 * 60 * 24);
|
|
141
|
-
if (daysSince < 1) {
|
|
142
|
-
return null; // Already shown today
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
// Check each discovery feature
|
|
146
|
-
for (const discovery of DISCOVERY_FEATURES) {
|
|
147
|
-
// Skip if already shown
|
|
148
|
-
if (state.lastDiscoveryShown === discovery.id) {
|
|
149
|
-
continue;
|
|
150
|
-
}
|
|
151
|
-
const trigger = discovery.trigger;
|
|
152
|
-
// Check command count trigger
|
|
153
|
-
if (trigger.commandCount && state.commandCount >= trigger.commandCount) {
|
|
154
|
-
return discovery;
|
|
155
|
-
}
|
|
156
|
-
// Check commands trigger
|
|
157
|
-
if (trigger.commands && trigger.commands.includes(command)) {
|
|
158
|
-
return discovery;
|
|
159
|
-
}
|
|
160
|
-
// Check custom condition
|
|
161
|
-
if (trigger.condition && trigger.condition(state)) {
|
|
162
|
-
return discovery;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
9
|
return null;
|
|
166
10
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
*/
|
|
170
|
-
export function markFeatureDiscoveryShown(discoveryId) {
|
|
171
|
-
const state = getOnboardingState();
|
|
172
|
-
state.lastDiscoveryShown = discoveryId;
|
|
173
|
-
state.lastDiscoveryDate = new Date().toISOString();
|
|
174
|
-
saveOnboardingState(state);
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Check if user is first-time (onboarding not complete)
|
|
178
|
-
*/
|
|
179
|
-
export function isFirstTimeUser() {
|
|
180
|
-
const state = getOnboardingState();
|
|
181
|
-
return !state.onboardingComplete;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Get command count for analytics
|
|
185
|
-
*/
|
|
186
|
-
export function getCommandCount() {
|
|
187
|
-
const state = getOnboardingState();
|
|
188
|
-
return state.commandCount || 0;
|
|
11
|
+
export function markFeatureDiscoveryShown(id) {
|
|
12
|
+
// Stub implementation
|
|
189
13
|
}
|
|
190
14
|
//# sourceMappingURL=feature-discovery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-discovery.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/feature-discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"feature-discovery.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/feature-discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,sBAAsB;AACxB,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,OAAe;IACxD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,EAAU;IAClD,sBAAsB;AACxB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feedback Prompt
|
|
3
|
+
* Collect and store user feedback for bidirectional learning
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
6
|
+
*/
|
|
7
|
+
interface FeedbackContext {
|
|
8
|
+
query?: string;
|
|
9
|
+
response?: string;
|
|
10
|
+
sessionId?: string;
|
|
11
|
+
operation?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Prompt user for feedback (non-blocking, returns null if user skips)
|
|
15
|
+
*/
|
|
16
|
+
export declare function promptForFeedback(operation: string, context: FeedbackContext): Promise<string | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Store feedback in the learning system
|
|
19
|
+
*/
|
|
20
|
+
export declare function storeFeedback(learningSystem: any, userId: string, feedback: string, metadata: FeedbackContext): void;
|
|
21
|
+
/**
|
|
22
|
+
* Display feedback confirmation message
|
|
23
|
+
*/
|
|
24
|
+
export declare function displayFeedbackConfirmation(feedback: string): void;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=feedback-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-prompt.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/feedback-prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,UAAU,eAAe;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAIxB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,cAAc,EAAE,GAAG,EACnB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,eAAe,GACxB,IAAI,CAmBN;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAGlE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feedback Prompt
|
|
3
|
+
* Collect and store user feedback for bidirectional learning
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Prompt user for feedback (non-blocking, returns null if user skips)
|
|
9
|
+
*/
|
|
10
|
+
export async function promptForFeedback(operation, context) {
|
|
11
|
+
// In alpha, we skip interactive prompts to avoid blocking
|
|
12
|
+
// This can be enhanced later with readline-based prompts
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Store feedback in the learning system
|
|
17
|
+
*/
|
|
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
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Display feedback confirmation message
|
|
40
|
+
*/
|
|
41
|
+
export function displayFeedbackConfirmation(feedback) {
|
|
42
|
+
// In alpha, skip confirmation display to keep CLI clean
|
|
43
|
+
// This can be enhanced later
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=feedback-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hitl-review-portal.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/hitl-review-portal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAcH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,cAAc,EAEf,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,cAAc,GAC7B;IACD,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;CACxF,CAyCA;
|
|
1
|
+
{"version":3,"file":"hitl-review-portal.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/hitl-review-portal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAcH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,cAAc,EAEf,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,cAAc,GAC7B;IACD,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;CACxF,CAyCA;AAiCD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,CA0D3E;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,IAAI,CAYxE;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,KAAK,CAAC;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAA;CAAE,CAAC,GACzE,IAAI,CAgBN;AAwDD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,gBAAgB,GAAG,MAAM,CAW7E"}
|
|
@@ -60,13 +60,14 @@ function displayCheckpointsSummary(checkpoints) {
|
|
|
60
60
|
checkpoint.operation.substring(0, 30),
|
|
61
61
|
priorityColor(getPriorityLabel(checkpoint.priority)),
|
|
62
62
|
riskColor(checkpoint.context.riskLevel.toUpperCase()),
|
|
63
|
+
checkpoint.isMandatory ? colors.red('MANDATORY') : colors.yellow('OPTIONAL'),
|
|
63
64
|
`${checkpoint.changes.length} file(s)`,
|
|
64
65
|
checkpoint.context.uncertainty
|
|
65
66
|
? `${(checkpoint.context.uncertainty * 100).toFixed(0)}%`
|
|
66
67
|
: '-',
|
|
67
68
|
];
|
|
68
69
|
});
|
|
69
|
-
const table = createTable(['ID', 'Operation', 'Priority', 'Risk', 'Files', 'Uncertainty'], rows);
|
|
70
|
+
const table = createTable(['ID', 'Operation', 'Priority', 'Risk', 'Review Type', 'Files', 'Uncertainty'], rows);
|
|
70
71
|
console.log(colors.bold('Pending Checkpoints:'));
|
|
71
72
|
console.log(table.toString());
|
|
72
73
|
console.log('');
|
|
@@ -90,6 +91,8 @@ export function displayCheckpointDetails(checkpoint) {
|
|
|
90
91
|
console.log(colors.bold('Risk Assessment:'));
|
|
91
92
|
console.log(` Priority: ${priorityColor(getPriorityLabel(checkpoint.priority))}`);
|
|
92
93
|
console.log(` Risk Level: ${riskColor(checkpoint.context.riskLevel.toUpperCase())}`);
|
|
94
|
+
// Task 4.2: Show mandatory vs optional status
|
|
95
|
+
console.log(` Review Type: ${checkpoint.isMandatory ? colors.red('MANDATORY') : colors.yellow('OPTIONAL')}`);
|
|
93
96
|
if (checkpoint.context.uncertainty) {
|
|
94
97
|
const uncertaintyPercent = (checkpoint.context.uncertainty * 100).toFixed(0);
|
|
95
98
|
const uncertaintyColor = checkpoint.context.uncertainty > 0.7 ? error : warning;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hitl-review-portal.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/hitl-review-portal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,MAAM,EACN,SAAS,EAGT,OAAO,EACP,OAAO,EACP,KAAK,EACL,IAAI,EACJ,WAAW,EACX,SAAS,GACV,MAAM,aAAa,CAAC;AAcrB;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,cAA8B;IAK9B,MAAM,MAAM,GAAG,cAAc,CAAC,oBAAoB,EAAE,CAAC;IACrD,MAAM,WAAW,GAAG,cAAc,CAAC,qBAAqB,EAAE,CAAC;IAE3D,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC,CAAC;QAChE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;IACrC,CAAC;IAED,wBAAwB;IACxB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,GAAG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M,UAAU;KACvC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export type ReviewStatus = 'pending' | 'approved' | 'rejected' | 'needs_changes' | 'cancelled';
|
|
14
14
|
export type ReviewPriority = 'low' | 'normal' | 'high' | 'critical';
|
|
15
|
+
export type HITLStrictness = 'minimal' | 'balanced' | 'strict';
|
|
16
|
+
export interface HITLConfiguration {
|
|
17
|
+
strictness: HITLStrictness;
|
|
18
|
+
allowAutoProceed: boolean;
|
|
19
|
+
mandatoryRiskLevels?: ('low' | 'medium' | 'high' | 'critical')[];
|
|
20
|
+
}
|
|
15
21
|
export interface ReviewCheckpoint {
|
|
16
22
|
checkpointId: string;
|
|
17
23
|
operation: string;
|
|
@@ -21,6 +27,7 @@ export interface ReviewCheckpoint {
|
|
|
21
27
|
createdAt: number;
|
|
22
28
|
reviewedAt?: number;
|
|
23
29
|
reviewedBy?: string;
|
|
30
|
+
isMandatory: boolean;
|
|
24
31
|
changes: {
|
|
25
32
|
type: 'edit' | 'create' | 'delete' | 'move' | 'refactor';
|
|
26
33
|
filepath?: string;
|
|
@@ -52,14 +59,42 @@ export interface ReviewDecision {
|
|
|
52
59
|
/**
|
|
53
60
|
* Human-in-the-Loop Validation System
|
|
54
61
|
* Manages mandatory validation checkpoints for critical operations
|
|
62
|
+
* Task 4.2: Adaptive HITL - Supports mandatory vs optional checkpoints based on risk
|
|
55
63
|
*/
|
|
56
64
|
export declare class HITLValidation {
|
|
57
65
|
private checkpoints;
|
|
58
66
|
private reviewQueue;
|
|
67
|
+
private config;
|
|
68
|
+
constructor(config?: HITLConfiguration);
|
|
69
|
+
/**
|
|
70
|
+
* Set HITL configuration (user preferences)
|
|
71
|
+
*/
|
|
72
|
+
setConfiguration(config: HITLConfiguration): void;
|
|
73
|
+
/**
|
|
74
|
+
* Get current HITL configuration
|
|
75
|
+
*/
|
|
76
|
+
getConfiguration(): HITLConfiguration;
|
|
59
77
|
/**
|
|
60
78
|
* Create review checkpoint
|
|
79
|
+
* Task 4.2: Determines if checkpoint is mandatory or optional based on risk and user preferences
|
|
61
80
|
*/
|
|
62
81
|
createCheckpoint(operation: string, changes: ReviewCheckpoint['changes'], context: ReviewCheckpoint['context'], metadata?: ReviewCheckpoint['metadata']): ReviewCheckpoint;
|
|
82
|
+
/**
|
|
83
|
+
* Task 4.2: Determine if checkpoint requires mandatory approval
|
|
84
|
+
* Low-risk operations can be optional (auto-proceed if user preference allows)
|
|
85
|
+
* High-risk operations are always mandatory
|
|
86
|
+
*/
|
|
87
|
+
isMandatoryCheckpoint(context: {
|
|
88
|
+
riskLevel: 'low' | 'medium' | 'high' | 'critical';
|
|
89
|
+
isDestructive?: boolean;
|
|
90
|
+
modifiesSecuritySensitiveCode?: boolean;
|
|
91
|
+
affectsMultipleFiles?: boolean;
|
|
92
|
+
uncertainty?: number;
|
|
93
|
+
}): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Task 4.2: Check if checkpoint can auto-proceed (optional checkpoint with user preference)
|
|
96
|
+
*/
|
|
97
|
+
canAutoProceed(checkpoint: ReviewCheckpoint): boolean;
|
|
63
98
|
/**
|
|
64
99
|
* Check if operation requires HITL validation
|
|
65
100
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hitl-validation.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/hitl-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,eAAe,GAAG,WAAW,CAAC;AAC/F,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAA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CAAC,OAAO,EAAE;QAC1B,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;QAClD,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,6BAA6B,CAAC,EAAE,OAAO,CAAC;QACxC,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO;IA0CX;;OAEG;IACH,iBAAiB,IAAI,gBAAgB,GAAG,IAAI;IAS5C;;OAEG;IACH,cAAc,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAqB9C;;OAEG;IACH,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAI5D;;OAEG;IACH,qBAAqB,CAAC,QAAQ,CAAC,EAAE,cAAc,GAAG,gBAAgB,EAAE;IAepE;;OAEG;IACH,oBAAoB,IAAI;QACtB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;KAC5C;IAyBD;;OAEG;IACH,gBAAgB,CAAC,UAAU,EAAE,gBAAgB,GAAG,MAAM;IA0CtD,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,mBAAmB;CAQ5B"}
|
|
@@ -13,12 +13,34 @@
|
|
|
13
13
|
/**
|
|
14
14
|
* Human-in-the-Loop Validation System
|
|
15
15
|
* Manages mandatory validation checkpoints for critical operations
|
|
16
|
+
* Task 4.2: Adaptive HITL - Supports mandatory vs optional checkpoints based on risk
|
|
16
17
|
*/
|
|
17
18
|
export class HITLValidation {
|
|
18
19
|
checkpoints = new Map();
|
|
19
20
|
reviewQueue = []; // Checkpoint IDs in review order
|
|
21
|
+
config;
|
|
22
|
+
constructor(config) {
|
|
23
|
+
this.config = config || {
|
|
24
|
+
strictness: 'balanced',
|
|
25
|
+
allowAutoProceed: true,
|
|
26
|
+
mandatoryRiskLevels: ['critical', 'high'],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Set HITL configuration (user preferences)
|
|
31
|
+
*/
|
|
32
|
+
setConfiguration(config) {
|
|
33
|
+
this.config = config;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get current HITL configuration
|
|
37
|
+
*/
|
|
38
|
+
getConfiguration() {
|
|
39
|
+
return { ...this.config };
|
|
40
|
+
}
|
|
20
41
|
/**
|
|
21
42
|
* Create review checkpoint
|
|
43
|
+
* Task 4.2: Determines if checkpoint is mandatory or optional based on risk and user preferences
|
|
22
44
|
*/
|
|
23
45
|
createCheckpoint(operation, changes, context, metadata) {
|
|
24
46
|
const checkpointId = `checkpoint-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
@@ -27,6 +49,8 @@ export class HITLValidation {
|
|
|
27
49
|
context.riskLevel === 'high' ? 'high' :
|
|
28
50
|
context.riskLevel === 'medium' ? 'normal' :
|
|
29
51
|
'low';
|
|
52
|
+
// Task 4.2: Determine if checkpoint is mandatory or optional
|
|
53
|
+
const isMandatory = this.isMandatoryCheckpoint(context);
|
|
30
54
|
const checkpoint = {
|
|
31
55
|
checkpointId,
|
|
32
56
|
operation,
|
|
@@ -34,6 +58,7 @@ export class HITLValidation {
|
|
|
34
58
|
priority,
|
|
35
59
|
status: 'pending',
|
|
36
60
|
createdAt: Date.now(),
|
|
61
|
+
isMandatory,
|
|
37
62
|
changes,
|
|
38
63
|
context,
|
|
39
64
|
metadata: metadata || {},
|
|
@@ -42,6 +67,67 @@ export class HITLValidation {
|
|
|
42
67
|
this.addToReviewQueue(checkpointId, priority);
|
|
43
68
|
return checkpoint;
|
|
44
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Task 4.2: Determine if checkpoint requires mandatory approval
|
|
72
|
+
* Low-risk operations can be optional (auto-proceed if user preference allows)
|
|
73
|
+
* High-risk operations are always mandatory
|
|
74
|
+
*/
|
|
75
|
+
isMandatoryCheckpoint(context) {
|
|
76
|
+
const { riskLevel, isDestructive = false, modifiesSecuritySensitiveCode = false, affectsMultipleFiles = false, uncertainty = 0.5, } = context;
|
|
77
|
+
// Always mandatory for critical operations
|
|
78
|
+
if (riskLevel === 'critical') {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
// Always mandatory for destructive operations
|
|
82
|
+
if (isDestructive) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
// Always mandatory for security-sensitive modifications
|
|
86
|
+
if (modifiesSecuritySensitiveCode) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
// Check user-configured mandatory risk levels
|
|
90
|
+
if (this.config.mandatoryRiskLevels?.includes(riskLevel)) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
// Apply strictness-based rules
|
|
94
|
+
// Note: 'critical' is already handled above, so riskLevel here is 'low' | 'medium' | 'high'
|
|
95
|
+
const strictness = this.config.strictness;
|
|
96
|
+
if (strictness === 'strict') {
|
|
97
|
+
// Strict: All medium+ risk operations are mandatory
|
|
98
|
+
return riskLevel !== 'low';
|
|
99
|
+
}
|
|
100
|
+
else if (strictness === 'balanced') {
|
|
101
|
+
// Balanced: High+ risk operations are mandatory, medium is optional
|
|
102
|
+
return riskLevel === 'high' || (affectsMultipleFiles && riskLevel === 'medium') || uncertainty > 0.8;
|
|
103
|
+
}
|
|
104
|
+
else if (strictness === 'minimal') {
|
|
105
|
+
// Minimal: Only high-risk operations are mandatory (critical already handled above)
|
|
106
|
+
return riskLevel === 'high' || (isDestructive && riskLevel === 'medium');
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
// Default: High+ risk operations are mandatory
|
|
110
|
+
return riskLevel === 'high';
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Task 4.2: Check if checkpoint can auto-proceed (optional checkpoint with user preference)
|
|
115
|
+
*/
|
|
116
|
+
canAutoProceed(checkpoint) {
|
|
117
|
+
// Never auto-proceed mandatory checkpoints
|
|
118
|
+
if (checkpoint.isMandatory) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
// Check if user allows auto-proceed
|
|
122
|
+
if (!this.config.allowAutoProceed) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
// Optional checkpoints can auto-proceed if:
|
|
126
|
+
// 1. Not mandatory
|
|
127
|
+
// 2. User preference allows auto-proceed
|
|
128
|
+
// 3. Risk level is low or medium (not high/critical)
|
|
129
|
+
return checkpoint.context.riskLevel === 'low' || checkpoint.context.riskLevel === 'medium';
|
|
130
|
+
}
|
|
45
131
|
/**
|
|
46
132
|
* Check if operation requires HITL validation
|
|
47
133
|
*/
|