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
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infrastructure: Feedback Statistics Builders
|
|
3
|
+
* Pure functions to compute feedback analytics and status snapshots
|
|
4
|
+
*
|
|
5
|
+
* Clean Architecture: Infrastructure Layer
|
|
6
|
+
* Strategic: Provides machine-readable JSON outputs for CI/dashboards
|
|
7
|
+
*/
|
|
8
|
+
import type { TrustConfig } from './trust-config.js';
|
|
9
|
+
export type FeedbackOutcome = 'success' | 'failure' | 'partial_success' | 'cancelled' | 'error';
|
|
10
|
+
export type UserAction = 'approved' | 'rejected' | 'modified' | 'skipped' | 'not_required';
|
|
11
|
+
export interface AgentFeedback {
|
|
12
|
+
feedbackId: string;
|
|
13
|
+
runId: string;
|
|
14
|
+
agentName: string;
|
|
15
|
+
timestamp: number;
|
|
16
|
+
operation: string;
|
|
17
|
+
query?: string;
|
|
18
|
+
outcome: FeedbackOutcome;
|
|
19
|
+
userAction?: UserAction;
|
|
20
|
+
filesChanged?: string[];
|
|
21
|
+
filesCreated?: string[];
|
|
22
|
+
filesDeleted?: string[];
|
|
23
|
+
errors?: string[];
|
|
24
|
+
warnings?: string[];
|
|
25
|
+
validationChecks?: Array<{
|
|
26
|
+
check: string;
|
|
27
|
+
passed: boolean;
|
|
28
|
+
message?: string;
|
|
29
|
+
}>;
|
|
30
|
+
metrics?: {
|
|
31
|
+
tokensUsed?: number;
|
|
32
|
+
duration?: number;
|
|
33
|
+
filesAnalyzed?: number;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* JSON output for analyze-feedback script
|
|
38
|
+
*/
|
|
39
|
+
export interface FeedbackAnalyticsJson {
|
|
40
|
+
totalRecords: number;
|
|
41
|
+
agents: Array<{
|
|
42
|
+
agentName: string;
|
|
43
|
+
totalRuns: number;
|
|
44
|
+
trustScore: number;
|
|
45
|
+
belowThreshold: boolean;
|
|
46
|
+
threshold: number;
|
|
47
|
+
outcomes: Record<string, number>;
|
|
48
|
+
userActions: Record<string, number>;
|
|
49
|
+
}>;
|
|
50
|
+
operations: Array<{
|
|
51
|
+
operation: string;
|
|
52
|
+
count: number;
|
|
53
|
+
outcomes: Record<string, number>;
|
|
54
|
+
}>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* JSON output for status command
|
|
58
|
+
*/
|
|
59
|
+
export interface StatusSnapshotJson {
|
|
60
|
+
totalRecords: number;
|
|
61
|
+
agents: Array<{
|
|
62
|
+
agentName: string;
|
|
63
|
+
success: {
|
|
64
|
+
runs: number;
|
|
65
|
+
total: number;
|
|
66
|
+
};
|
|
67
|
+
trustScore: number;
|
|
68
|
+
threshold: number;
|
|
69
|
+
belowThreshold: boolean;
|
|
70
|
+
}>;
|
|
71
|
+
operations: Array<{
|
|
72
|
+
operation: string;
|
|
73
|
+
runs: number;
|
|
74
|
+
}>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Build feedback analytics JSON from feedback records and trust config
|
|
78
|
+
*/
|
|
79
|
+
export declare function buildFeedbackAnalyticsJson(feedback: AgentFeedback[], trustConfig: TrustConfig): FeedbackAnalyticsJson;
|
|
80
|
+
/**
|
|
81
|
+
* Build status snapshot JSON from feedback records and trust config
|
|
82
|
+
*/
|
|
83
|
+
export declare function buildStatusSnapshotJson(feedback: AgentFeedback[], trustConfig: TrustConfig): StatusSnapshotJson;
|
|
84
|
+
/**
|
|
85
|
+
* Result of trust threshold evaluation
|
|
86
|
+
*/
|
|
87
|
+
export interface TrustCheckResult {
|
|
88
|
+
offenders: Array<{
|
|
89
|
+
agentName: string;
|
|
90
|
+
trustScore: number;
|
|
91
|
+
threshold: number;
|
|
92
|
+
}>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Evaluate trust thresholds from analytics JSON
|
|
96
|
+
* Returns agents that are below their configured thresholds
|
|
97
|
+
*/
|
|
98
|
+
export declare function evaluateTrustThresholds(analytics: FeedbackAnalyticsJson): TrustCheckResult;
|
|
99
|
+
//# sourceMappingURL=feedback-stats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-stats.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/feedback-stats.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,iBAAiB,GAAG,WAAW,GAAG,OAAO,CAAC;AAChG,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,cAAc,CAAC;AAE3F,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,eAAe,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YA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CAAC;YACb,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;QACF,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,OAAO,CAAC;KACzB,CAAC,CAAC;IACH,UAAU,EAAE,KAAK,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,aAAa,EAAE,EACzB,WAAW,EAAE,WAAW,GACvB,qBAAqB,CAwGvB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,aAAa,EAAE,EACzB,WAAW,EAAE,WAAW,GACvB,kBAAkB,CAwEpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,KAAK,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;CACJ;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,qBAAqB,GAAG,gBAAgB,CAmB1F"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infrastructure: Feedback Statistics Builders
|
|
3
|
+
* Pure functions to compute feedback analytics and status snapshots
|
|
4
|
+
*
|
|
5
|
+
* Clean Architecture: Infrastructure Layer
|
|
6
|
+
* Strategic: Provides machine-readable JSON outputs for CI/dashboards
|
|
7
|
+
*/
|
|
8
|
+
import { getAgentThreshold } from './trust-config.js';
|
|
9
|
+
/**
|
|
10
|
+
* Build feedback analytics JSON from feedback records and trust config
|
|
11
|
+
*/
|
|
12
|
+
export function buildFeedbackAnalyticsJson(feedback, trustConfig) {
|
|
13
|
+
const byAgent = {};
|
|
14
|
+
const byOperationMap = {};
|
|
15
|
+
// Aggregate feedback
|
|
16
|
+
for (const record of feedback) {
|
|
17
|
+
// Aggregate by agent
|
|
18
|
+
if (!byAgent[record.agentName]) {
|
|
19
|
+
byAgent[record.agentName] = {
|
|
20
|
+
totalRuns: 0,
|
|
21
|
+
outcomes: {
|
|
22
|
+
success: 0,
|
|
23
|
+
failure: 0,
|
|
24
|
+
partial_success: 0,
|
|
25
|
+
cancelled: 0,
|
|
26
|
+
error: 0,
|
|
27
|
+
},
|
|
28
|
+
userActions: {
|
|
29
|
+
approved: 0,
|
|
30
|
+
rejected: 0,
|
|
31
|
+
modified: 0,
|
|
32
|
+
skipped: 0,
|
|
33
|
+
not_required: 0,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const agentStats = byAgent[record.agentName];
|
|
38
|
+
agentStats.totalRuns++;
|
|
39
|
+
agentStats.outcomes[record.outcome] = (agentStats.outcomes[record.outcome] || 0) + 1;
|
|
40
|
+
if (record.userAction) {
|
|
41
|
+
agentStats.userActions[record.userAction] =
|
|
42
|
+
(agentStats.userActions[record.userAction] || 0) + 1;
|
|
43
|
+
}
|
|
44
|
+
// Aggregate by operation
|
|
45
|
+
if (record.operation) {
|
|
46
|
+
if (!byOperationMap[record.operation]) {
|
|
47
|
+
byOperationMap[record.operation] = {
|
|
48
|
+
operation: record.operation,
|
|
49
|
+
count: 0,
|
|
50
|
+
outcomes: {
|
|
51
|
+
success: 0,
|
|
52
|
+
failure: 0,
|
|
53
|
+
partial_success: 0,
|
|
54
|
+
cancelled: 0,
|
|
55
|
+
error: 0,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const opStats = byOperationMap[record.operation];
|
|
60
|
+
opStats.count++;
|
|
61
|
+
opStats.outcomes[record.outcome] = (opStats.outcomes[record.outcome] || 0) + 1;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Calculate trust scores and build agent array
|
|
65
|
+
const agents = Object.entries(byAgent)
|
|
66
|
+
.map(([agentName, stats]) => {
|
|
67
|
+
const approvedSuccessRuns = feedback.filter(f => f.agentName === agentName &&
|
|
68
|
+
f.outcome === 'success' &&
|
|
69
|
+
f.userAction === 'approved').length;
|
|
70
|
+
const trustScore = stats.totalRuns > 0
|
|
71
|
+
? (approvedSuccessRuns / stats.totalRuns) * 100
|
|
72
|
+
: 0;
|
|
73
|
+
const threshold = getAgentThreshold(trustConfig, agentName);
|
|
74
|
+
const belowThreshold = threshold > 0 && trustScore < threshold;
|
|
75
|
+
return {
|
|
76
|
+
agentName,
|
|
77
|
+
totalRuns: stats.totalRuns,
|
|
78
|
+
trustScore: Math.round(trustScore * 100) / 100, // Round to 2 decimal places
|
|
79
|
+
belowThreshold,
|
|
80
|
+
threshold,
|
|
81
|
+
outcomes: stats.outcomes,
|
|
82
|
+
userActions: stats.userActions,
|
|
83
|
+
};
|
|
84
|
+
})
|
|
85
|
+
.sort((a, b) => b.totalRuns - a.totalRuns);
|
|
86
|
+
// Build operations array
|
|
87
|
+
const operations = Object.values(byOperationMap)
|
|
88
|
+
.sort((a, b) => b.count - a.count);
|
|
89
|
+
return {
|
|
90
|
+
totalRecords: feedback.length,
|
|
91
|
+
agents,
|
|
92
|
+
operations,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Build status snapshot JSON from feedback records and trust config
|
|
97
|
+
*/
|
|
98
|
+
export function buildStatusSnapshotJson(feedback, trustConfig) {
|
|
99
|
+
const agentStatsMap = {};
|
|
100
|
+
const operationStatsMap = {};
|
|
101
|
+
// Aggregate feedback
|
|
102
|
+
for (const record of feedback) {
|
|
103
|
+
// Aggregate by agent
|
|
104
|
+
if (!agentStatsMap[record.agentName]) {
|
|
105
|
+
agentStatsMap[record.agentName] = {
|
|
106
|
+
totalRuns: 0,
|
|
107
|
+
successRuns: 0,
|
|
108
|
+
trustScore: 0,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const stats = agentStatsMap[record.agentName];
|
|
112
|
+
stats.totalRuns++;
|
|
113
|
+
if (record.outcome === 'success') {
|
|
114
|
+
stats.successRuns++;
|
|
115
|
+
}
|
|
116
|
+
// Aggregate by operation
|
|
117
|
+
if (record.operation) {
|
|
118
|
+
operationStatsMap[record.operation] = (operationStatsMap[record.operation] || 0) + 1;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// Calculate trust scores and build agent array
|
|
122
|
+
const agents = Object.entries(agentStatsMap)
|
|
123
|
+
.map(([agentName, stats]) => {
|
|
124
|
+
const approvedSuccessRuns = feedback.filter(f => f.agentName === agentName &&
|
|
125
|
+
f.outcome === 'success' &&
|
|
126
|
+
f.userAction === 'approved').length;
|
|
127
|
+
const trustScore = stats.totalRuns > 0
|
|
128
|
+
? (approvedSuccessRuns / stats.totalRuns) * 100
|
|
129
|
+
: 0;
|
|
130
|
+
const threshold = getAgentThreshold(trustConfig, agentName);
|
|
131
|
+
const belowThreshold = threshold > 0 && trustScore < threshold;
|
|
132
|
+
return {
|
|
133
|
+
agentName,
|
|
134
|
+
success: {
|
|
135
|
+
runs: stats.successRuns,
|
|
136
|
+
total: stats.totalRuns,
|
|
137
|
+
},
|
|
138
|
+
trustScore: Math.round(trustScore * 100) / 100, // Round to 2 decimal places
|
|
139
|
+
threshold,
|
|
140
|
+
belowThreshold,
|
|
141
|
+
};
|
|
142
|
+
})
|
|
143
|
+
.sort((a, b) => b.trustScore - a.trustScore);
|
|
144
|
+
// Build operations array
|
|
145
|
+
const operations = Object.entries(operationStatsMap)
|
|
146
|
+
.map(([operation, runs]) => ({ operation, runs }))
|
|
147
|
+
.sort((a, b) => b.runs - a.runs)
|
|
148
|
+
.slice(0, 5); // Top 5 operations
|
|
149
|
+
return {
|
|
150
|
+
totalRecords: feedback.length,
|
|
151
|
+
agents,
|
|
152
|
+
operations,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Evaluate trust thresholds from analytics JSON
|
|
157
|
+
* Returns agents that are below their configured thresholds
|
|
158
|
+
*/
|
|
159
|
+
export function evaluateTrustThresholds(analytics) {
|
|
160
|
+
const offenders = [];
|
|
161
|
+
for (const agent of analytics.agents) {
|
|
162
|
+
// Only consider agents with threshold > 0
|
|
163
|
+
if (agent.threshold > 0 && agent.trustScore < agent.threshold) {
|
|
164
|
+
offenders.push({
|
|
165
|
+
agentName: agent.agentName,
|
|
166
|
+
trustScore: agent.trustScore,
|
|
167
|
+
threshold: agent.threshold,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return { offenders };
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=feedback-stats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-stats.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/feedback-stats.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAyEtD;;GAEG;AACH,MAAM,UAAU,0BAA0B,CACxC,QAAyB,EACzB,WAAwB;IAExB,MAAM,OAAO,GAIR,EAAE,CAAC;IAER,MAAM,cAAc,GAIf,EAAE,CAAC;IAER,qBAAqB;IACrB,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC9B,qBAAqB;QACrB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG;gBAC1B,SAAS,EAAE,CAAC;gBACZ,QAAQ,EAAE;oBACR,OAAO,EAAE,CAAC;oBACV,OAAO,EAAE,CAAC;oBACV,eAAe,EAAE,CAAC;oBAClB,SAAS,EAAE,CAAC;oBACZ,KAAK,EAAE,CAAC;iBACT;gBACD,WAAW,EAAE;oBACX,QAAQ,EAAE,CAAC;oBACX,QAAQ,EAAE,CAAC;oBACX,QAAQ,EAAE,CAAC;oBACX,OAAO,EAAE,CAAC;oBACV,YAAY,EAAE,CAAC;iBAChB;aACF,CAAC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AAI,SAAS,CAAC,MAAM,EAAE,CAAC;QACrC,0CAA0C;QAC1C,IAAI,KAAK,CAAC,SAAS,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;YAC9D,SAAS,CAAC,IAAI,CAAC;gBACb,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,SAAS,EAAE,KAAK,CAAC,SAAS;aAC3B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Review Handler
|
|
3
|
+
* Handles review requests and decisions
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
6
|
+
*/
|
|
7
|
+
export interface ReviewDecision {
|
|
8
|
+
approved: boolean;
|
|
9
|
+
proceed: boolean;
|
|
10
|
+
userAction: 'approved' | 'rejected' | 'not_required' | 'cancelled';
|
|
11
|
+
comment?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Review handler instance
|
|
15
|
+
*/
|
|
16
|
+
export declare const reviewHandler: {
|
|
17
|
+
/**
|
|
18
|
+
* Request review from user
|
|
19
|
+
*/
|
|
20
|
+
requestReview(summary: string): Promise<ReviewDecision>;
|
|
21
|
+
/**
|
|
22
|
+
* Get review decision (with optional review requested flag)
|
|
23
|
+
*/
|
|
24
|
+
getReviewDecision(summary: string, reviewRequested: boolean): Promise<ReviewDecision>;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=review-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-handler.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/review-handler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,WAAW,CAAC;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;2BAC0B,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAc7D;;OAEG;+BAEQ,MAAM,mBACE,OAAO,GACvB,OAAO,CAAC,cAAc,CAAC;CAW3B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Review Handler
|
|
3
|
+
* Handles review requests and decisions
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Review handler instance
|
|
9
|
+
*/
|
|
10
|
+
export const reviewHandler = {
|
|
11
|
+
/**
|
|
12
|
+
* Request review from user
|
|
13
|
+
*/
|
|
14
|
+
async requestReview(summary) {
|
|
15
|
+
// In alpha, auto-approve for non-interactive mode
|
|
16
|
+
// Can be enhanced later with interactive prompts
|
|
17
|
+
console.log('\n📋 Review Request:');
|
|
18
|
+
console.log(summary);
|
|
19
|
+
console.log('\n[Auto-approved in alpha mode]');
|
|
20
|
+
return {
|
|
21
|
+
approved: true,
|
|
22
|
+
proceed: true,
|
|
23
|
+
userAction: 'approved',
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* Get review decision (with optional review requested flag)
|
|
28
|
+
*/
|
|
29
|
+
async getReviewDecision(summary, reviewRequested) {
|
|
30
|
+
if (!reviewRequested) {
|
|
31
|
+
return {
|
|
32
|
+
approved: true,
|
|
33
|
+
proceed: true,
|
|
34
|
+
userAction: 'not_required',
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return this.requestReview(summary);
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=review-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-handler.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/review-handler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,OAAe;QACjC,kDAAkD;QAClD,iDAAiD;QACjD,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QACpC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;QAE/C,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,UAAU;SACvB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB,CACrB,OAAe,EACf,eAAwB;QAExB,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,cAAc;aAC3B,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Summary Aggregator
|
|
3
|
+
* Merges multiple trace summaries into a composite summary
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
6
|
+
*/
|
|
7
|
+
import type { TraceSummary } from './trace-summary.js';
|
|
8
|
+
export interface CompositeSummary {
|
|
9
|
+
runId: string;
|
|
10
|
+
operation: string;
|
|
11
|
+
agents: string[];
|
|
12
|
+
totalDuration: number;
|
|
13
|
+
success: boolean;
|
|
14
|
+
summaries: Array<{
|
|
15
|
+
agent: string;
|
|
16
|
+
summary: TraceSummary;
|
|
17
|
+
runId?: string;
|
|
18
|
+
}>;
|
|
19
|
+
filesAffected: string[];
|
|
20
|
+
filesChanged?: string[];
|
|
21
|
+
filesCreated?: string[];
|
|
22
|
+
filesDeleted?: string[];
|
|
23
|
+
errors: string[];
|
|
24
|
+
warnings?: string[];
|
|
25
|
+
validationChecks?: any[];
|
|
26
|
+
metrics?: Record<string, any>;
|
|
27
|
+
startTime: number;
|
|
28
|
+
endTime?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Summary aggregator instance
|
|
32
|
+
*/
|
|
33
|
+
declare class SummaryAggregatorImpl {
|
|
34
|
+
/**
|
|
35
|
+
* Merge multiple trace summaries into a composite summary
|
|
36
|
+
*/
|
|
37
|
+
mergeSummaries(agentSummaries: Array<{
|
|
38
|
+
agent: string;
|
|
39
|
+
summary: TraceSummary;
|
|
40
|
+
runId?: string;
|
|
41
|
+
}>, unifiedRunId: string, operation: string): CompositeSummary;
|
|
42
|
+
}
|
|
43
|
+
export declare const summaryAggregator: SummaryAggregatorImpl;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=summary-aggregator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary-aggregator.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/summary-aggregator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,KAAK,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,YAAY,CAAC;QACtB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,gBAAgB,CAAC,EAAE,GAAG,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,cAAM,qBAAqB;IACzB;;OAEG;IACH,cAAc,CACZ,cAAc,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,YAAY,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAC/E,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,GAChB,gBAAgB;CA+DpB;AAED,eAAO,MAAM,iBAAiB,uBAA8B,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Summary Aggregator
|
|
3
|
+
* Merges multiple trace summaries into a composite summary
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Summary aggregator instance
|
|
9
|
+
*/
|
|
10
|
+
class SummaryAggregatorImpl {
|
|
11
|
+
/**
|
|
12
|
+
* Merge multiple trace summaries into a composite summary
|
|
13
|
+
*/
|
|
14
|
+
mergeSummaries(agentSummaries, unifiedRunId, operation) {
|
|
15
|
+
if (agentSummaries.length === 0) {
|
|
16
|
+
return {
|
|
17
|
+
runId: unifiedRunId,
|
|
18
|
+
operation,
|
|
19
|
+
agents: [],
|
|
20
|
+
totalDuration: 0,
|
|
21
|
+
success: true,
|
|
22
|
+
summaries: [],
|
|
23
|
+
filesAffected: [],
|
|
24
|
+
errors: [],
|
|
25
|
+
startTime: Date.now(),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
// Collect all data
|
|
29
|
+
const agents = [];
|
|
30
|
+
const filesAffected = new Set();
|
|
31
|
+
const errors = [];
|
|
32
|
+
let minStartTime = Infinity;
|
|
33
|
+
let maxEndTime = 0;
|
|
34
|
+
let allSuccess = true;
|
|
35
|
+
for (const { agent, summary } of agentSummaries) {
|
|
36
|
+
agents.push(agent);
|
|
37
|
+
const data = summary.data;
|
|
38
|
+
if (!data.success) {
|
|
39
|
+
allSuccess = false;
|
|
40
|
+
}
|
|
41
|
+
if (data.startTime < minStartTime) {
|
|
42
|
+
minStartTime = data.startTime;
|
|
43
|
+
}
|
|
44
|
+
if (data.endTime && data.endTime > maxEndTime) {
|
|
45
|
+
maxEndTime = data.endTime;
|
|
46
|
+
}
|
|
47
|
+
if (data.filesAffected) {
|
|
48
|
+
data.filesAffected.forEach(f => filesAffected.add(f));
|
|
49
|
+
}
|
|
50
|
+
if (data.error) {
|
|
51
|
+
errors.push(`${agent}: ${data.error}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const compositeSummary = {
|
|
55
|
+
runId: unifiedRunId,
|
|
56
|
+
operation,
|
|
57
|
+
agents,
|
|
58
|
+
totalDuration: maxEndTime > 0 ? maxEndTime - minStartTime : 0,
|
|
59
|
+
success: allSuccess,
|
|
60
|
+
summaries: agentSummaries,
|
|
61
|
+
filesAffected: Array.from(filesAffected),
|
|
62
|
+
errors,
|
|
63
|
+
startTime: minStartTime !== Infinity ? minStartTime : Date.now(),
|
|
64
|
+
endTime: maxEndTime > 0 ? maxEndTime : undefined,
|
|
65
|
+
};
|
|
66
|
+
return compositeSummary;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export const summaryAggregator = new SummaryAggregatorImpl();
|
|
70
|
+
//# sourceMappingURL=summary-aggregator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary-aggregator.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/summary-aggregator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2BH;;GAEG;AACH,MAAM,qBAAqB;IACzB;;OAEG;IACH,cAAc,CACZ,cAA+E,EAC/E,YAAoB,EACpB,SAAiB;QAEjB,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,OAAO;gBACL,KAAK,EAAE,YAAY;gBACnB,SAAS;gBACT,MAAM,EAAE,EAAE;gBACV,aAAa,EAAE,CAAC;gBAChB,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,EAAE;gBACb,aAAa,EAAE,EAAE;gBACjB,MAAM,EAAE,EAAE;gBACV,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;aACtB,CAAC;QACJ,CAAC;QAED,mBAAmB;QACnB,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,MAAM,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;QACxC,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,IAAI,YAAY,GAAG,QAAQ,CAAC;QAC5B,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,UAAU,GAAG,IAAI,CAAC;QAEtB,KAAK,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,cAAc,EAAE,CAAC;YAChD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAEnB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAC1B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBAClB,UAAU,GAAG,KAAK,CAAC;YACrB,CAAC;YAED,IAAI,IAAI,CAAC,SAAS,GAAG,YAAY,EAAE,CAAC;gBAClC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC;YAChC,CAAC;YAED,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,GAAG,UAAU,EAAE,CAAC;gBAC9C,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC;YAC5B,CAAC;YAED,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;gBACvB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACxD,CAAC;YAED,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;QAED,MAAM,gBAAgB,GAAqB;YACzC,KAAK,EAAE,YAAY;YACnB,SAAS;YACT,MAAM;YACN,aAAa,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;YAC7D,OAAO,EAAE,UAAU;YACnB,SAAS,EAAE,cAAc;YACzB,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC;YACxC,MAAM;YACN,SAAS,EAAE,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YAChE,OAAO,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;SACjD,CAAC;QAEF,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Summary Extractor
|
|
3
|
+
* Extracts summaries from routing and orchestration results
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
6
|
+
*/
|
|
7
|
+
export interface SummarySource {
|
|
8
|
+
summary: string;
|
|
9
|
+
metadata?: Record<string, any>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Summary extractor instance
|
|
13
|
+
*/
|
|
14
|
+
export declare const summaryExtractor: {
|
|
15
|
+
/**
|
|
16
|
+
* Extract summary from routing result
|
|
17
|
+
*/
|
|
18
|
+
extractFromRouting(result: any): SummarySource | null;
|
|
19
|
+
/**
|
|
20
|
+
* Extract summary from orchestration result
|
|
21
|
+
*/
|
|
22
|
+
extractFromOrchestration(result: any): SummarySource | null;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=summary-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary-extractor.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/summary-extractor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;OAEG;+BACwB,GAAG,GAAG,aAAa,GAAG,IAAI;IAerD;;OAEG;qCAC8B,GAAG,GAAG,aAAa,GAAG,IAAI;CAe5D,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Summary Extractor
|
|
3
|
+
* Extracts summaries from routing and orchestration results
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Summary extractor instance
|
|
9
|
+
*/
|
|
10
|
+
export const summaryExtractor = {
|
|
11
|
+
/**
|
|
12
|
+
* Extract summary from routing result
|
|
13
|
+
*/
|
|
14
|
+
extractFromRouting(result) {
|
|
15
|
+
if (!result) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const summary = result.message || result.summary || 'Operation completed';
|
|
19
|
+
return {
|
|
20
|
+
summary,
|
|
21
|
+
metadata: {
|
|
22
|
+
action: result.action,
|
|
23
|
+
success: result.success,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* Extract summary from orchestration result
|
|
29
|
+
*/
|
|
30
|
+
extractFromOrchestration(result) {
|
|
31
|
+
if (!result) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const summary = result.message || result.summary || 'Orchestration completed';
|
|
35
|
+
return {
|
|
36
|
+
summary,
|
|
37
|
+
metadata: {
|
|
38
|
+
success: result.success,
|
|
39
|
+
planId: result.plan?.id,
|
|
40
|
+
executionStatus: result.execution?.status,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=summary-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary-extractor.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/summary-extractor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B;;OAEG;IACH,kBAAkB,CAAC,MAAW;QAC5B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,IAAI,qBAAqB,CAAC;QAC1E,OAAO;YACL,OAAO;YACP,QAAQ,EAAE;gBACR,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EAAE,MAAM,CAAC,OAAO;aACxB;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,wBAAwB,CAAC,MAAW;QAClC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,IAAI,yBAAyB,CAAC;QAC9E,OAAO;YACL,OAAO;YACP,QAAQ,EAAE;gBACR,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE;gBACvB,eAAe,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM;aAC1C;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trace Summary
|
|
3
|
+
* Represents execution trace summaries for agents
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
6
|
+
*/
|
|
7
|
+
export interface TraceSummaryData {
|
|
8
|
+
runId: string;
|
|
9
|
+
agentName: string;
|
|
10
|
+
operation: string;
|
|
11
|
+
startTime: number;
|
|
12
|
+
endTime?: number;
|
|
13
|
+
success: boolean;
|
|
14
|
+
steps?: Array<{
|
|
15
|
+
step: number;
|
|
16
|
+
description: string;
|
|
17
|
+
status: 'success' | 'failure' | 'skipped';
|
|
18
|
+
duration?: number;
|
|
19
|
+
}>;
|
|
20
|
+
filesAffected?: string[];
|
|
21
|
+
error?: string;
|
|
22
|
+
metadata?: Record<string, any>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Trace Summary class
|
|
26
|
+
*/
|
|
27
|
+
export declare class TraceSummary {
|
|
28
|
+
data: TraceSummaryData;
|
|
29
|
+
constructor(data: TraceSummaryData);
|
|
30
|
+
/**
|
|
31
|
+
* Get summary as JSON
|
|
32
|
+
*/
|
|
33
|
+
toJSON(): TraceSummaryData;
|
|
34
|
+
/**
|
|
35
|
+
* Get duration in milliseconds
|
|
36
|
+
*/
|
|
37
|
+
getDuration(): number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Format trace summary for display
|
|
41
|
+
*/
|
|
42
|
+
export declare const traceSummaryFormatter: {
|
|
43
|
+
format(summary: TraceSummary): string;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=trace-summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-summary.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/trace-summary.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;QAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,qBAAa,YAAY;IACJ,IAAI,EAAE,gBAAgB;gBAAtB,IAAI,EAAE,gBAAgB;IAEzC;;OAEG;IACH,MAAM,IAAI,gBAAgB;IAI1B;;OAEG;IACH,WAAW,IAAI,MAAM;CAMtB;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB;oBAChB,YAAY,GAAG,MAAM;CAoBtC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trace Summary
|
|
3
|
+
* Represents execution trace summaries for agents
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Trace Summary class
|
|
9
|
+
*/
|
|
10
|
+
export class TraceSummary {
|
|
11
|
+
data;
|
|
12
|
+
constructor(data) {
|
|
13
|
+
this.data = data;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get summary as JSON
|
|
17
|
+
*/
|
|
18
|
+
toJSON() {
|
|
19
|
+
return this.data;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get duration in milliseconds
|
|
23
|
+
*/
|
|
24
|
+
getDuration() {
|
|
25
|
+
if (this.data.endTime && this.data.startTime) {
|
|
26
|
+
return this.data.endTime - this.data.startTime;
|
|
27
|
+
}
|
|
28
|
+
return Date.now() - this.data.startTime;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Format trace summary for display
|
|
33
|
+
*/
|
|
34
|
+
export const traceSummaryFormatter = {
|
|
35
|
+
format(summary) {
|
|
36
|
+
const data = summary.data;
|
|
37
|
+
const duration = summary.getDuration();
|
|
38
|
+
const lines = [];
|
|
39
|
+
lines.push(`Agent: ${data.agentName}`);
|
|
40
|
+
lines.push(`Operation: ${data.operation}`);
|
|
41
|
+
lines.push(`Status: ${data.success ? 'Success' : 'Failed'}`);
|
|
42
|
+
lines.push(`Duration: ${(duration / 1000).toFixed(2)}s`);
|
|
43
|
+
if (data.filesAffected && data.filesAffected.length > 0) {
|
|
44
|
+
lines.push(`Files affected: ${data.filesAffected.length}`);
|
|
45
|
+
}
|
|
46
|
+
if (data.error) {
|
|
47
|
+
lines.push(`Error: ${data.error}`);
|
|
48
|
+
}
|
|
49
|
+
return lines.join('\n');
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=trace-summary.js.map
|