codehere 0.5.1-alpha → 0.5.3-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 +126 -102
- package/dist/application/agents/execution-agent.js +2 -2
- package/dist/application/agents/multi-agent-orchestrator.d.ts +0 -1
- package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -1
- package/dist/application/agents/multi-agent-orchestrator.js +2 -9
- package/dist/application/agents/multi-agent-orchestrator.js.map +1 -1
- package/dist/application/agents/planning-agent.d.ts.map +1 -1
- package/dist/application/agents/planning-agent.js +11 -15
- package/dist/application/agents/planning-agent.js.map +1 -1
- package/dist/application/services/context-importer.d.ts +71 -0
- package/dist/application/services/context-importer.d.ts.map +1 -0
- package/dist/application/services/context-importer.js +436 -0
- package/dist/application/services/context-importer.js.map +1 -0
- package/dist/application/services/context-manager.d.ts +132 -0
- package/dist/application/services/context-manager.d.ts.map +1 -0
- package/dist/application/services/context-manager.js +369 -0
- package/dist/application/services/context-manager.js.map +1 -0
- package/dist/application/services/dependency-container.d.ts.map +1 -1
- package/dist/application/services/dependency-container.js +7 -5
- package/dist/application/services/dependency-container.js.map +1 -1
- package/dist/application/services/intelligent-router.d.ts +8 -5
- package/dist/application/services/intelligent-router.d.ts.map +1 -1
- package/dist/application/services/intelligent-router.js +78 -82
- package/dist/application/services/intelligent-router.js.map +1 -1
- package/dist/application/services/token-counting-service.d.ts +87 -0
- package/dist/application/services/token-counting-service.d.ts.map +1 -0
- package/dist/application/services/token-counting-service.js +196 -0
- package/dist/application/services/token-counting-service.js.map +1 -0
- package/dist/application/use-cases/ask-question-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/ask-question-use-case.js +109 -21
- 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 +19 -0
- package/dist/application/use-cases/edit-file-use-case.js.map +1 -1
- package/dist/application/use-cases/planning-use-case.d.ts +1 -14
- package/dist/application/use-cases/planning-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/planning-use-case.js +2 -109
- package/dist/application/use-cases/planning-use-case.js.map +1 -1
- package/dist/chat.d.ts.map +1 -1
- package/dist/chat.js +6 -17
- package/dist/chat.js.map +1 -1
- package/dist/domain/entities/conversation-context.d.ts +245 -0
- package/dist/domain/entities/conversation-context.d.ts.map +1 -0
- package/dist/domain/entities/conversation-context.js +50 -0
- package/dist/domain/entities/conversation-context.js.map +1 -0
- package/dist/domain/entities/memory.d.ts.map +1 -1
- package/dist/domain/interfaces/context-repository.interface.d.ts +71 -0
- package/dist/domain/interfaces/context-repository.interface.d.ts.map +1 -0
- package/dist/domain/interfaces/context-repository.interface.js +10 -0
- package/dist/domain/interfaces/context-repository.interface.js.map +1 -0
- package/dist/domain/services/query-intent-classifier.d.ts.map +1 -1
- package/dist/domain/services/query-intent-classifier.js +37 -23
- package/dist/domain/services/query-intent-classifier.js.map +1 -1
- package/dist/embed.d.ts.map +1 -1
- package/dist/embed.js +8 -3
- package/dist/embed.js.map +1 -1
- package/dist/index.js +267 -143
- 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 +14 -5
- package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
- package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -1
- package/dist/infrastructure/ai/provider-ai-service.js +64 -14
- package/dist/infrastructure/ai/provider-ai-service.js.map +1 -1
- package/dist/infrastructure/config/config-manager.d.ts +78 -9
- package/dist/infrastructure/config/config-manager.d.ts.map +1 -1
- package/dist/infrastructure/config/config-manager.js +127 -9
- package/dist/infrastructure/config/config-manager.js.map +1 -1
- package/dist/infrastructure/context/conversation-context.d.ts +39 -12
- package/dist/infrastructure/context/conversation-context.d.ts.map +1 -1
- package/dist/infrastructure/context/conversation-context.js +91 -4
- package/dist/infrastructure/context/conversation-context.js.map +1 -1
- package/dist/infrastructure/context/direct-context-provider.d.ts +18 -0
- package/dist/infrastructure/context/direct-context-provider.d.ts.map +1 -0
- package/dist/infrastructure/context/direct-context-provider.js +222 -0
- package/dist/infrastructure/context/direct-context-provider.js.map +1 -0
- package/dist/infrastructure/context/git-context-provider.d.ts +30 -0
- package/dist/infrastructure/context/git-context-provider.d.ts.map +1 -0
- package/dist/infrastructure/context/git-context-provider.js +140 -0
- package/dist/infrastructure/context/git-context-provider.js.map +1 -0
- package/dist/infrastructure/context/project-context-loader.d.ts +35 -0
- package/dist/infrastructure/context/project-context-loader.d.ts.map +1 -0
- package/dist/infrastructure/context/project-context-loader.js +184 -0
- package/dist/infrastructure/context/project-context-loader.js.map +1 -0
- package/dist/infrastructure/cost/cost-tracker.d.ts.map +1 -1
- package/dist/infrastructure/cost/cost-tracker.js +3 -2
- package/dist/infrastructure/cost/cost-tracker.js.map +1 -1
- package/dist/infrastructure/cost/session-token-tracker.d.ts +68 -0
- package/dist/infrastructure/cost/session-token-tracker.d.ts.map +1 -0
- package/dist/infrastructure/cost/session-token-tracker.js +178 -0
- package/dist/infrastructure/cost/session-token-tracker.js.map +1 -0
- package/dist/infrastructure/index.d.ts +1 -0
- package/dist/infrastructure/index.d.ts.map +1 -1
- package/dist/infrastructure/index.js +1 -2
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/infrastructure/observability/execution-tracer.d.ts +21 -0
- package/dist/infrastructure/observability/execution-tracer.d.ts.map +1 -1
- package/dist/infrastructure/observability/execution-tracer.js +157 -4
- package/dist/infrastructure/observability/execution-tracer.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 +1 -2
- package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -1
- package/dist/infrastructure/providers/cohere-provider.js +44 -42
- package/dist/infrastructure/providers/cohere-provider.js.map +1 -1
- package/dist/infrastructure/providers/fake-provider.d.ts.map +1 -1
- package/dist/infrastructure/providers/fake-provider.js +8 -0
- package/dist/infrastructure/providers/fake-provider.js.map +1 -1
- package/dist/infrastructure/providers/local-llm-provider.d.ts.map +1 -1
- package/dist/infrastructure/providers/local-llm-provider.js +8 -2
- package/dist/infrastructure/providers/local-llm-provider.js.map +1 -1
- package/dist/infrastructure/providers/openai-provider.d.ts.map +1 -1
- package/dist/infrastructure/providers/openai-provider.js +40 -7
- package/dist/infrastructure/providers/openai-provider.js.map +1 -1
- package/dist/infrastructure/providers/openrouter-provider.d.ts.map +1 -1
- package/dist/infrastructure/providers/openrouter-provider.js +13 -7
- package/dist/infrastructure/providers/openrouter-provider.js.map +1 -1
- package/dist/infrastructure/security/enhanced-security-gate.d.ts +13 -0
- package/dist/infrastructure/security/enhanced-security-gate.d.ts.map +1 -1
- package/dist/infrastructure/security/enhanced-security-gate.js +56 -1
- package/dist/infrastructure/security/enhanced-security-gate.js.map +1 -1
- package/dist/infrastructure/security/input-validator.d.ts +17 -0
- package/dist/infrastructure/security/input-validator.d.ts.map +1 -1
- package/dist/infrastructure/security/input-validator.js +140 -25
- package/dist/infrastructure/security/input-validator.js.map +1 -1
- package/dist/infrastructure/storage/embeddings-path.d.ts.map +1 -1
- package/dist/infrastructure/storage/embeddings-path.js +14 -4
- package/dist/infrastructure/storage/embeddings-path.js.map +1 -1
- package/dist/infrastructure/storage/memory-stream-service.d.ts.map +1 -1
- package/dist/infrastructure/storage/memory-stream-service.js +58 -88
- package/dist/infrastructure/storage/memory-stream-service.js.map +1 -1
- package/dist/infrastructure/storage/plan-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/plan-repository.js +4 -5
- package/dist/infrastructure/storage/plan-repository.js.map +1 -1
- package/dist/infrastructure/storage/sqlite-context-repository.d.ts +95 -0
- package/dist/infrastructure/storage/sqlite-context-repository.d.ts.map +1 -0
- package/dist/infrastructure/storage/sqlite-context-repository.js +467 -0
- package/dist/infrastructure/storage/sqlite-context-repository.js.map +1 -0
- package/dist/infrastructure/storage/sqlite-decision-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-decision-repository.js +4 -8
- package/dist/infrastructure/storage/sqlite-decision-repository.js.map +1 -1
- package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.js +4 -8
- package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.js.map +1 -1
- package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.js +4 -8
- package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.js.map +1 -1
- package/dist/infrastructure/storage/sqlite-memory-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-memory-repository.js +4 -8
- package/dist/infrastructure/storage/sqlite-memory-repository.js.map +1 -1
- package/dist/infrastructure/storage/sqlite-pattern-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-pattern-repository.js +4 -8
- package/dist/infrastructure/storage/sqlite-pattern-repository.js.map +1 -1
- package/dist/infrastructure/storage/task-repository.d.ts +0 -1
- package/dist/infrastructure/storage/task-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/task-repository.js +2 -13
- package/dist/infrastructure/storage/task-repository.js.map +1 -1
- package/dist/infrastructure/ux/cli-style-guide.d.ts +105 -0
- package/dist/infrastructure/ux/cli-style-guide.d.ts.map +1 -0
- package/dist/infrastructure/ux/cli-style-guide.js +220 -0
- package/dist/infrastructure/ux/cli-style-guide.js.map +1 -0
- package/dist/infrastructure/ux/progress-indicator.d.ts +49 -10
- package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
- package/dist/infrastructure/ux/progress-indicator.js +112 -9
- package/dist/infrastructure/ux/progress-indicator.js.map +1 -1
- package/dist/infrastructure/validation/agent-feedback.d.ts +14 -1
- package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -1
- package/dist/infrastructure/validation/agent-feedback.js +57 -3
- package/dist/infrastructure/validation/agent-feedback.js.map +1 -1
- package/dist/parallel-processor.d.ts.map +1 -1
- package/dist/parallel-processor.js +39 -11
- package/dist/parallel-processor.js.map +1 -1
- package/dist/presentation/cli/commands/ask-command.d.ts +1 -2
- package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/ask-command.js +66 -150
- package/dist/presentation/cli/commands/ask-command.js.map +1 -1
- package/dist/presentation/cli/commands/audit-command.d.ts +13 -0
- package/dist/presentation/cli/commands/audit-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/audit-command.js +96 -0
- package/dist/presentation/cli/commands/audit-command.js.map +1 -0
- package/dist/presentation/cli/commands/config-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/config-command.js +2 -14
- package/dist/presentation/cli/commands/config-command.js.map +1 -1
- package/dist/presentation/cli/commands/context-command.d.ts +32 -0
- package/dist/presentation/cli/commands/context-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/context-command.js +295 -0
- package/dist/presentation/cli/commands/context-command.js.map +1 -0
- package/dist/presentation/cli/commands/context-helper.d.ts +16 -0
- package/dist/presentation/cli/commands/context-helper.d.ts.map +1 -0
- package/dist/presentation/cli/commands/context-helper.js +88 -0
- package/dist/presentation/cli/commands/context-helper.js.map +1 -0
- package/dist/presentation/cli/commands/decision-command.js +6 -23
- package/dist/presentation/cli/commands/decision-command.js.map +1 -1
- package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/fix-command.js +19 -23
- package/dist/presentation/cli/commands/fix-command.js.map +1 -1
- package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/help-command.js +1 -21
- package/dist/presentation/cli/commands/help-command.js.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.d.ts +0 -1
- package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.js +19 -126
- package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
- package/dist/presentation/cli/commands/plan-command.d.ts +0 -1
- package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/plan-command.js +42 -132
- package/dist/presentation/cli/commands/plan-command.js.map +1 -1
- package/dist/presentation/cli/commands/react-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/react-command.js +1 -5
- package/dist/presentation/cli/commands/react-command.js.map +1 -1
- package/dist/presentation/cli/commands/review-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/review-command.js +2 -21
- package/dist/presentation/cli/commands/review-command.js.map +1 -1
- package/dist/presentation/cli/commands/smart-command.d.ts +3 -0
- package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/smart-command.js +127 -93
- package/dist/presentation/cli/commands/smart-command.js.map +1 -1
- package/dist/presentation/cli/commands/status-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/status-command.js +1 -5
- package/dist/presentation/cli/commands/status-command.js.map +1 -1
- package/dist/presentation/cli/commands/trust-command.d.ts +28 -0
- package/dist/presentation/cli/commands/trust-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/trust-command.js +301 -0
- package/dist/presentation/cli/commands/trust-command.js.map +1 -0
- package/dist/presentation/cli/error-display.d.ts.map +1 -1
- package/dist/presentation/cli/error-display.js +17 -75
- package/dist/presentation/cli/error-display.js.map +1 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +5 -18
- package/dist/search.js.map +1 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +221 -57
- package/dist/session.js.map +1 -1
- package/dist/token-optimizer.d.ts.map +1 -1
- package/dist/token-optimizer.js +6 -1
- package/dist/token-optimizer.js.map +1 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +0 -3
- 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 +0 -5
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +0 -19
- package/dist/ui.js.map +1 -1
- package/dist/utils/provider-check.d.ts +21 -0
- package/dist/utils/provider-check.d.ts.map +1 -0
- package/dist/utils/provider-check.js +124 -0
- package/dist/utils/provider-check.js.map +1 -0
- package/package.json +16 -13
- package/dist/application/agents/documentation-agent.d.ts +0 -24
- package/dist/application/agents/documentation-agent.d.ts.map +0 -1
- package/dist/application/agents/documentation-agent.js +0 -399
- package/dist/application/agents/documentation-agent.js.map +0 -1
- package/dist/application/agents/product-requirements-agent.d.ts +0 -21
- package/dist/application/agents/product-requirements-agent.d.ts.map +0 -1
- package/dist/application/agents/product-requirements-agent.js +0 -247
- package/dist/application/agents/product-requirements-agent.js.map +0 -1
- package/dist/application/reasoning/multi-model-planning-strategy.d.ts +0 -21
- package/dist/application/reasoning/multi-model-planning-strategy.d.ts.map +0 -1
- package/dist/application/reasoning/multi-model-planning-strategy.js +0 -158
- package/dist/application/reasoning/multi-model-planning-strategy.js.map +0 -1
- package/dist/application/reasoning/reasoning-config.d.ts +0 -15
- package/dist/application/reasoning/reasoning-config.d.ts.map +0 -1
- package/dist/application/reasoning/reasoning-config.js +0 -50
- package/dist/application/reasoning/reasoning-config.js.map +0 -1
- package/dist/application/reasoning/reasoning-orchestrator.d.ts +0 -18
- package/dist/application/reasoning/reasoning-orchestrator.d.ts.map +0 -1
- package/dist/application/reasoning/reasoning-orchestrator.js +0 -170
- package/dist/application/reasoning/reasoning-orchestrator.js.map +0 -1
- package/dist/application/reasoning/reasoning-strategy.interface.d.ts +0 -24
- package/dist/application/reasoning/reasoning-strategy.interface.d.ts.map +0 -1
- package/dist/application/reasoning/reasoning-strategy.interface.js +0 -6
- package/dist/application/reasoning/reasoning-strategy.interface.js.map +0 -1
- package/dist/application/reasoning/role-provider-resolver.d.ts +0 -36
- package/dist/application/reasoning/role-provider-resolver.d.ts.map +0 -1
- package/dist/application/reasoning/role-provider-resolver.js +0 -74
- package/dist/application/reasoning/role-provider-resolver.js.map +0 -1
- package/dist/application/reasoning/simple-planning-strategy.d.ts +0 -22
- package/dist/application/reasoning/simple-planning-strategy.d.ts.map +0 -1
- package/dist/application/reasoning/simple-planning-strategy.js +0 -217
- package/dist/application/reasoning/simple-planning-strategy.js.map +0 -1
- package/dist/application/reasoning/types.d.ts +0 -65
- package/dist/application/reasoning/types.d.ts.map +0 -1
- package/dist/application/reasoning/types.js +0 -6
- package/dist/application/reasoning/types.js.map +0 -1
- package/dist/application/reasoning/validator-strategy.d.ts +0 -56
- package/dist/application/reasoning/validator-strategy.d.ts.map +0 -1
- package/dist/application/reasoning/validator-strategy.js +0 -103
- package/dist/application/reasoning/validator-strategy.js.map +0 -1
- package/dist/domain/entities/documentation.d.ts +0 -35
- package/dist/domain/entities/documentation.d.ts.map +0 -1
- package/dist/domain/entities/documentation.js +0 -6
- package/dist/domain/entities/documentation.js.map +0 -1
- package/dist/domain/entities/product-requirements.d.ts +0 -50
- package/dist/domain/entities/product-requirements.d.ts.map +0 -1
- package/dist/domain/entities/product-requirements.js +0 -6
- package/dist/domain/entities/product-requirements.js.map +0 -1
- package/dist/domain/interfaces/agent.interface.d.ts +0 -15
- package/dist/domain/interfaces/agent.interface.d.ts.map +0 -1
- package/dist/domain/interfaces/agent.interface.js +0 -6
- package/dist/domain/interfaces/agent.interface.js.map +0 -1
- package/dist/infrastructure/ai/fake-ai-service.d.ts +0 -22
- package/dist/infrastructure/ai/fake-ai-service.d.ts.map +0 -1
- package/dist/infrastructure/ai/fake-ai-service.js +0 -59
- package/dist/infrastructure/ai/fake-ai-service.js.map +0 -1
- package/dist/infrastructure/completion/completion-generator.d.ts +0 -42
- package/dist/infrastructure/completion/completion-generator.d.ts.map +0 -1
- package/dist/infrastructure/completion/completion-generator.js +0 -184
- package/dist/infrastructure/completion/completion-generator.js.map +0 -1
- package/dist/infrastructure/security/network-guard.d.ts +0 -8
- package/dist/infrastructure/security/network-guard.d.ts.map +0 -1
- package/dist/infrastructure/security/network-guard.js +0 -70
- package/dist/infrastructure/security/network-guard.js.map +0 -1
- package/dist/infrastructure/security/offline.d.ts +0 -16
- package/dist/infrastructure/security/offline.d.ts.map +0 -1
- package/dist/infrastructure/security/offline.js +0 -24
- package/dist/infrastructure/security/offline.js.map +0 -1
- package/dist/infrastructure/storage/sqljs-init.d.ts +0 -8
- package/dist/infrastructure/storage/sqljs-init.d.ts.map +0 -1
- package/dist/infrastructure/storage/sqljs-init.js +0 -23
- package/dist/infrastructure/storage/sqljs-init.js.map +0 -1
- package/dist/infrastructure/ux/hitl-review-portal.d.ts +0 -47
- package/dist/infrastructure/ux/hitl-review-portal.d.ts.map +0 -1
- package/dist/infrastructure/ux/hitl-review-portal.js +0 -228
- package/dist/infrastructure/ux/hitl-review-portal.js.map +0 -1
- package/dist/infrastructure/ux/meta-query.d.ts +0 -9
- package/dist/infrastructure/ux/meta-query.d.ts.map +0 -1
- package/dist/infrastructure/ux/meta-query.js +0 -63
- package/dist/infrastructure/ux/meta-query.js.map +0 -1
- package/dist/infrastructure/ux/proportional-friction.d.ts +0 -73
- package/dist/infrastructure/ux/proportional-friction.d.ts.map +0 -1
- package/dist/infrastructure/ux/proportional-friction.js +0 -200
- package/dist/infrastructure/ux/proportional-friction.js.map +0 -1
- package/dist/infrastructure/ux/repo-fingerprint.d.ts +0 -10
- package/dist/infrastructure/ux/repo-fingerprint.d.ts.map +0 -1
- package/dist/infrastructure/ux/repo-fingerprint.js +0 -55
- package/dist/infrastructure/ux/repo-fingerprint.js.map +0 -1
- package/dist/infrastructure/validation/feedback-stats.d.ts +0 -99
- package/dist/infrastructure/validation/feedback-stats.d.ts.map +0 -1
- package/dist/infrastructure/validation/feedback-stats.js +0 -173
- package/dist/infrastructure/validation/feedback-stats.js.map +0 -1
- package/dist/infrastructure/validation/trust-config.d.ts +0 -27
- package/dist/infrastructure/validation/trust-config.d.ts.map +0 -1
- package/dist/infrastructure/validation/trust-config.js +0 -113
- package/dist/infrastructure/validation/trust-config.js.map +0 -1
- package/dist/presentation/cli/commands/memory-command.d.ts +0 -17
- package/dist/presentation/cli/commands/memory-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/memory-command.js +0 -252
- package/dist/presentation/cli/commands/memory-command.js.map +0 -1
- package/dist/presentation/cli/keyboard-shortcuts.d.ts +0 -27
- package/dist/presentation/cli/keyboard-shortcuts.d.ts.map +0 -1
- package/dist/presentation/cli/keyboard-shortcuts.js +0 -77
- package/dist/presentation/cli/keyboard-shortcuts.js.map +0 -1
- package/dist/test_cohere.d.ts +0 -2
- package/dist/test_cohere.d.ts.map +0 -1
- package/dist/test_cohere.js +0 -68
- package/dist/test_cohere.js.map +0 -1
- package/dist/test_env.d.ts +0 -2
- package/dist/test_env.d.ts.map +0 -1
- package/dist/test_env.js +0 -24
- package/dist/test_env.js.map +0 -1
- package/dist/test_retrieval.d.ts +0 -2
- package/dist/test_retrieval.d.ts.map +0 -1
- package/dist/test_retrieval.js +0 -84
- package/dist/test_retrieval.js.map +0 -1
- package/dist/tools/bash.d 2.ts +0 -53
- package/dist/tools/bash.js 2.map +0 -1
- package/dist/tools/edit 2.js +0 -235
- package/dist/tools/edit.d.ts 2.map +0 -1
- package/dist/utils/logger.d.ts +0 -34
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -56
- package/dist/utils/logger.js.map +0 -1
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Application Agent: Product Requirements Agent
|
|
3
|
-
* Generates product requirements documents (PRD) and feature specifications
|
|
4
|
-
*/
|
|
5
|
-
import { writeFileSync, existsSync, mkdirSync } from 'fs';
|
|
6
|
-
import { dirname, resolve } from 'path';
|
|
7
|
-
export class ProductRequirementsAgent {
|
|
8
|
-
aiService;
|
|
9
|
-
memoryStream;
|
|
10
|
-
cwd;
|
|
11
|
-
name = 'product-requirements-agent';
|
|
12
|
-
type = 'non-engineering';
|
|
13
|
-
constructor(aiService, memoryStream, cwd = process.cwd()) {
|
|
14
|
-
this.aiService = aiService;
|
|
15
|
-
this.memoryStream = memoryStream;
|
|
16
|
-
this.cwd = cwd;
|
|
17
|
-
}
|
|
18
|
-
async execute(request) {
|
|
19
|
-
const errors = [];
|
|
20
|
-
const documents = [];
|
|
21
|
-
try {
|
|
22
|
-
// Build prompt for PRD generation
|
|
23
|
-
const prompt = this.buildPRDPrompt(request);
|
|
24
|
-
// Generate PRD content using AI
|
|
25
|
-
const prdContent = await this.aiService.chat(prompt, []);
|
|
26
|
-
// Parse structured data from response
|
|
27
|
-
const structured = this.parseStructuredData(prdContent, request);
|
|
28
|
-
// Generate documents based on format option
|
|
29
|
-
const format = request.options?.format || 'both';
|
|
30
|
-
const outputPath = request.options?.outputPath;
|
|
31
|
-
let markdownPath;
|
|
32
|
-
let jsonPath;
|
|
33
|
-
if (format === 'markdown' || format === 'both') {
|
|
34
|
-
if (outputPath) {
|
|
35
|
-
// Write to file
|
|
36
|
-
const fullPath = resolve(this.cwd, outputPath);
|
|
37
|
-
const dir = dirname(fullPath);
|
|
38
|
-
if (!existsSync(dir)) {
|
|
39
|
-
mkdirSync(dir, { recursive: true });
|
|
40
|
-
}
|
|
41
|
-
writeFileSync(fullPath, prdContent, 'utf-8');
|
|
42
|
-
markdownPath = outputPath;
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
markdownPath = 'stdout';
|
|
46
|
-
}
|
|
47
|
-
documents.push({
|
|
48
|
-
path: markdownPath,
|
|
49
|
-
type: 'prd',
|
|
50
|
-
format: 'markdown',
|
|
51
|
-
contentPreview: prdContent.slice(0, 200),
|
|
52
|
-
content: prdContent, // Store full content for stdout output
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
if (format === 'json' || format === 'both') {
|
|
56
|
-
const jsonContent = JSON.stringify(structured, null, 2);
|
|
57
|
-
if (outputPath && format === 'json') {
|
|
58
|
-
// Write JSON to file
|
|
59
|
-
const fullPath = resolve(this.cwd, outputPath);
|
|
60
|
-
const dir = dirname(fullPath);
|
|
61
|
-
if (!existsSync(dir)) {
|
|
62
|
-
mkdirSync(dir, { recursive: true });
|
|
63
|
-
}
|
|
64
|
-
writeFileSync(fullPath, jsonContent, 'utf-8');
|
|
65
|
-
jsonPath = outputPath;
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
jsonPath = 'stdout';
|
|
69
|
-
}
|
|
70
|
-
documents.push({
|
|
71
|
-
path: jsonPath,
|
|
72
|
-
type: 'features',
|
|
73
|
-
format: 'json',
|
|
74
|
-
contentPreview: jsonContent.slice(0, 200),
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
// Generate technical spec if requested
|
|
78
|
-
if (request.options?.includeTechnicalSpec) {
|
|
79
|
-
const techSpecContent = await this.generateTechnicalSpec(request, structured);
|
|
80
|
-
const techSpecPath = outputPath
|
|
81
|
-
? outputPath.replace(/\.(md|json)$/, '-technical.md')
|
|
82
|
-
: 'stdout';
|
|
83
|
-
if (techSpecPath !== 'stdout' && outputPath) {
|
|
84
|
-
const fullPath = resolve(this.cwd, techSpecPath);
|
|
85
|
-
const dir = dirname(fullPath);
|
|
86
|
-
if (!existsSync(dir)) {
|
|
87
|
-
mkdirSync(dir, { recursive: true });
|
|
88
|
-
}
|
|
89
|
-
writeFileSync(fullPath, techSpecContent, 'utf-8');
|
|
90
|
-
}
|
|
91
|
-
documents.push({
|
|
92
|
-
path: techSpecPath,
|
|
93
|
-
type: 'technical-spec',
|
|
94
|
-
format: 'markdown',
|
|
95
|
-
contentPreview: techSpecContent.slice(0, 200),
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
success: true,
|
|
100
|
-
documents,
|
|
101
|
-
structured,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
catch (error) {
|
|
105
|
-
return {
|
|
106
|
-
success: false,
|
|
107
|
-
documents,
|
|
108
|
-
structured: {
|
|
109
|
-
features: [],
|
|
110
|
-
},
|
|
111
|
-
errors: [error instanceof Error ? error.message : String(error)],
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
buildPRDPrompt(request) {
|
|
116
|
-
const context = request.context || {};
|
|
117
|
-
const detailLevel = request.options?.detailLevel || 'medium';
|
|
118
|
-
let prompt = `Generate a Product Requirements Document (PRD) for the following goal:
|
|
119
|
-
|
|
120
|
-
Goal: ${request.goal}
|
|
121
|
-
|
|
122
|
-
`;
|
|
123
|
-
if (context.targetUsers) {
|
|
124
|
-
prompt += `Target Users: ${context.targetUsers}\n`;
|
|
125
|
-
}
|
|
126
|
-
if (context.constraints && context.constraints.length > 0) {
|
|
127
|
-
prompt += `Constraints: ${context.constraints.join(', ')}\n`;
|
|
128
|
-
}
|
|
129
|
-
if (context.existingFeatures && context.existingFeatures.length > 0) {
|
|
130
|
-
prompt += `Existing Features: ${context.existingFeatures.join(', ')}\n`;
|
|
131
|
-
}
|
|
132
|
-
if (context.technicalStack) {
|
|
133
|
-
prompt += `Technical Stack: ${context.technicalStack}\n`;
|
|
134
|
-
}
|
|
135
|
-
prompt += `
|
|
136
|
-
Detail Level: ${detailLevel}
|
|
137
|
-
|
|
138
|
-
Please provide:
|
|
139
|
-
1. An executive summary
|
|
140
|
-
2. A list of features with priorities (high/medium/low)
|
|
141
|
-
3. User stories or use cases
|
|
142
|
-
4. Success criteria
|
|
143
|
-
|
|
144
|
-
Format the response as a clear, structured markdown document.
|
|
145
|
-
`;
|
|
146
|
-
return prompt;
|
|
147
|
-
}
|
|
148
|
-
parseStructuredData(content, request) {
|
|
149
|
-
// Check if we're using fake AI (detect by content pattern)
|
|
150
|
-
const isFakeAI = content.startsWith('FAKE_RESPONSE:') || content.length < 200;
|
|
151
|
-
const features = [];
|
|
152
|
-
if (isFakeAI) {
|
|
153
|
-
// For fake AI, generate meaningful features from the goal
|
|
154
|
-
const goal = request.goal.toLowerCase();
|
|
155
|
-
const featureCount = request.options?.detailLevel === 'high' ? 5 :
|
|
156
|
-
request.options?.detailLevel === 'low' ? 2 : 3;
|
|
157
|
-
// Extract key nouns/verbs from goal for feature names
|
|
158
|
-
const words = goal.split(/\s+/).filter(w => w.length > 3);
|
|
159
|
-
const keyTerms = words.slice(0, featureCount);
|
|
160
|
-
keyTerms.forEach((term, index) => {
|
|
161
|
-
const capitalized = term.charAt(0).toUpperCase() + term.slice(1);
|
|
162
|
-
features.push({
|
|
163
|
-
id: `feature-${index + 1}`,
|
|
164
|
-
name: `${capitalized} functionality`,
|
|
165
|
-
description: `Implement ${term} as part of: ${request.goal}`,
|
|
166
|
-
priority: index === 0 ? 'high' : index < 2 ? 'medium' : 'low',
|
|
167
|
-
estimatedComplexity: index < 2 ? 'medium' : 'low',
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
// Always ensure at least one main feature
|
|
171
|
-
if (features.length === 0) {
|
|
172
|
-
const mainFeature = request.goal.split(/[.,;]/)[0].trim();
|
|
173
|
-
features.push({
|
|
174
|
-
id: 'feature-1',
|
|
175
|
-
name: mainFeature.length > 50 ? mainFeature.slice(0, 47) + '...' : mainFeature,
|
|
176
|
-
description: request.goal,
|
|
177
|
-
priority: 'high',
|
|
178
|
-
estimatedComplexity: 'medium',
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
// For real AI, try to extract features from content
|
|
184
|
-
const featureMatches = content.match(/###?\s*(.+?)(?:\n|$)/g) || [];
|
|
185
|
-
if (featureMatches.length > 0) {
|
|
186
|
-
featureMatches.forEach((match, index) => {
|
|
187
|
-
const name = match.replace(/###?\s*/, '').trim();
|
|
188
|
-
if (name && !name.toLowerCase().includes('summary') && !name.toLowerCase().includes('overview')) {
|
|
189
|
-
features.push({
|
|
190
|
-
id: `feature-${index + 1}`,
|
|
191
|
-
name,
|
|
192
|
-
description: `Feature extracted from PRD: ${name}`,
|
|
193
|
-
priority: index < 2 ? 'high' : index < 4 ? 'medium' : 'low',
|
|
194
|
-
estimatedComplexity: 'medium',
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
// If no features extracted, create at least one from the goal
|
|
200
|
-
if (features.length === 0) {
|
|
201
|
-
features.push({
|
|
202
|
-
id: 'feature-1',
|
|
203
|
-
name: request.goal.slice(0, 50),
|
|
204
|
-
description: request.goal,
|
|
205
|
-
priority: 'high',
|
|
206
|
-
estimatedComplexity: 'medium',
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
// Limit to reasonable number
|
|
211
|
-
const maxFeatures = request.options?.detailLevel === 'high' ? 10 :
|
|
212
|
-
request.options?.detailLevel === 'low' ? 3 : 5;
|
|
213
|
-
const finalFeatures = features.slice(0, maxFeatures);
|
|
214
|
-
const technicalApproach = request.options?.includeTechnicalSpec
|
|
215
|
-
? {
|
|
216
|
-
stack: request.context?.technicalStack ? [request.context.technicalStack] : [],
|
|
217
|
-
architecture: 'To be determined based on requirements',
|
|
218
|
-
considerations: request.context?.constraints || [],
|
|
219
|
-
}
|
|
220
|
-
: undefined;
|
|
221
|
-
return {
|
|
222
|
-
features: finalFeatures,
|
|
223
|
-
technicalApproach,
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
async generateTechnicalSpec(request, structured) {
|
|
227
|
-
const prompt = `Generate a technical specification document for:
|
|
228
|
-
|
|
229
|
-
Goal: ${request.goal}
|
|
230
|
-
|
|
231
|
-
Features:
|
|
232
|
-
${structured.features.map(f => `- ${f.name}: ${f.description}`).join('\n')}
|
|
233
|
-
|
|
234
|
-
${request.context?.technicalStack ? `Technical Stack: ${request.context.technicalStack}\n` : ''}
|
|
235
|
-
|
|
236
|
-
Provide:
|
|
237
|
-
1. Architecture overview
|
|
238
|
-
2. Technology choices
|
|
239
|
-
3. Implementation approach
|
|
240
|
-
4. Technical considerations
|
|
241
|
-
|
|
242
|
-
Format as markdown.
|
|
243
|
-
`;
|
|
244
|
-
return await this.aiService.chat(prompt, []);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
//# sourceMappingURL=product-requirements-agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product-requirements-agent.js","sourceRoot":"","sources":["../../../src/application/agents/product-requirements-agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC1D,OAAO,EAAQ,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE9C,MAAM,OAAO,wBAAwB;IAKzB;IACA;IACA;IANV,IAAI,GAAG,4BAA4B,CAAC;IACpC,IAAI,GAAG,iBAA0B,CAAC;IAElC,YACU,SAAqB,EACrB,YAAkC,EAClC,MAAc,OAAO,CAAC,GAAG,EAAE;QAF3B,cAAS,GAAT,SAAS,CAAY;QACrB,iBAAY,GAAZ,YAAY,CAAsB;QAClC,QAAG,GAAH,GAAG,CAAwB;IAClC,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,OAAmC;QAC/C,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,MAAM,SAAS,GAA6C,EAAE,CAAC;QAE/D,IAAI,CAAC;YACH,kCAAkC;YAClC,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;YAE5C,gCAAgC;YAChC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAEzD,sCAAsC;YACtC,MAAM,UAAU,GAAG,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YAEjE,4CAA4C;YAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI,MAAM,CAAC;YACjD,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC;YAE/C,IAAI,YAAgC,CAAC;YACrC,IAAI,QAA4B,CAAC;YAE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CAAC,OAAO,EAAE,oBAAoB;YACnG,CAAC,CAAC;gBACE,KAAK,EAAE,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE;gBAC9E,YAAY,EAAE,wCAAwC;gBACtD,cAAc,EAAE,OAAO,CAAC,OAAO,EAAE,WAAW,IAAI,EAAE;aACnD;YACH,CAAC,CAAC,SAAS,CAAC;QAEd,OAAO;YACL,QAAQ,EAAE,aAAa;YACvB,iBAAiB;SAClB,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,qBAAqB,CACjC,OAAmC,EACnC,UAAwF;QAExF,MAAM,MAAM,GAAG;;QAEX,OAAO,CAAC,IAAI;;;EAGlB,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;EAExE,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,oBAAoB,OAAO,CAAC,OAAO,CAAC,cAAc,IAAI,CAAC,CAAC,CAAC,EAAE;;;;;;;;;CAS9F,CAAC;QAEE,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC/C,CAAC;CACF"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Multi-Model Planning Strategy
|
|
3
|
-
* Implements two-stage planning pipeline: planner + optional validator
|
|
4
|
-
*/
|
|
5
|
-
import type { IReasoningStrategy, PlanningResult } from './reasoning-strategy.interface.js';
|
|
6
|
-
import type { PlanningInputContext } from './types.js';
|
|
7
|
-
import type { IAIService } from '../../domain/interfaces/ai-service.interface.js';
|
|
8
|
-
import { RoleProviderResolver } from './role-provider-resolver.js';
|
|
9
|
-
/**
|
|
10
|
-
* Multi-model planning strategy
|
|
11
|
-
* Uses planner role for initial plan, validator role for validation (if configured)
|
|
12
|
-
*/
|
|
13
|
-
export declare class MultiModelPlanningStrategy implements IReasoningStrategy {
|
|
14
|
-
private defaultAIService;
|
|
15
|
-
private plannerStrategy;
|
|
16
|
-
private validatorStrategy;
|
|
17
|
-
private roleResolver;
|
|
18
|
-
constructor(defaultAIService: IAIService, roleResolver?: RoleProviderResolver);
|
|
19
|
-
executePlanning(context: PlanningInputContext): Promise<PlanningResult>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=multi-model-planning-strategy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multi-model-planning-strategy.d.ts","sourceRoot":"","sources":["../../../src/application/reasoning/multi-model-planning-strategy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAC5F,OAAO,KAAK,EAAE,oBAAoB,EAAiC,MAAM,YAAY,CAAC;AAEtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAGlF,OAAO,EAAE,oBAAoB,EAAsB,MAAM,6BAA6B,CAAC;AAKvF;;;GAGG;AACH,qBAAa,0BAA2B,YAAW,kBAAkB;IAMjE,OAAO,CAAC,gBAAgB;IAL1B,OAAO,CAAC,eAAe,CAAyB;IAChD,OAAO,CAAC,iBAAiB,CAAmC;IAC5D,OAAO,CAAC,YAAY,CAAuB;gBAGjC,gBAAgB,EAAE,UAAU,EACpC,YAAY,CAAC,EAAE,oBAAoB;IAsB/B,eAAe,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;CAqI9E"}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Multi-Model Planning Strategy
|
|
3
|
-
* Implements two-stage planning pipeline: planner + optional validator
|
|
4
|
-
*/
|
|
5
|
-
import { SimplePlanningStrategy } from './simple-planning-strategy.js';
|
|
6
|
-
import { SimpleValidatorStrategy } from './validator-strategy.js';
|
|
7
|
-
import { RoleProviderResolver } from './role-provider-resolver.js';
|
|
8
|
-
import { ProviderAIService } from '../../infrastructure/ai/provider-ai-service.js';
|
|
9
|
-
import { randomUUID } from 'crypto';
|
|
10
|
-
/**
|
|
11
|
-
* Multi-model planning strategy
|
|
12
|
-
* Uses planner role for initial plan, validator role for validation (if configured)
|
|
13
|
-
*/
|
|
14
|
-
export class MultiModelPlanningStrategy {
|
|
15
|
-
defaultAIService;
|
|
16
|
-
plannerStrategy;
|
|
17
|
-
validatorStrategy = null;
|
|
18
|
-
roleResolver;
|
|
19
|
-
constructor(defaultAIService, roleResolver) {
|
|
20
|
-
this.defaultAIService = defaultAIService;
|
|
21
|
-
this.roleResolver = roleResolver || new RoleProviderResolver();
|
|
22
|
-
// Create planner strategy with planner provider
|
|
23
|
-
const plannerProvider = this.roleResolver.resolveRoleProvider('planner');
|
|
24
|
-
const plannerAIService = new ProviderAIService(plannerProvider);
|
|
25
|
-
this.plannerStrategy = new SimplePlanningStrategy(plannerAIService);
|
|
26
|
-
// Create validator strategy if validator role is configured
|
|
27
|
-
if (this.roleResolver.isRoleConfigured('validator')) {
|
|
28
|
-
try {
|
|
29
|
-
const validatorProvider = this.roleResolver.resolveRoleProvider('validator');
|
|
30
|
-
const validatorAIService = new ProviderAIService(validatorProvider);
|
|
31
|
-
this.validatorStrategy = new SimpleValidatorStrategy(validatorAIService);
|
|
32
|
-
}
|
|
33
|
-
catch (error) {
|
|
34
|
-
// Validator provider resolution failed - continue without validator
|
|
35
|
-
console.warn('[MultiModelPlanningStrategy] Validator provider resolution failed, continuing without validator:', error instanceof Error ? error.message : String(error));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
async executePlanning(context) {
|
|
40
|
-
const startTime = Date.now();
|
|
41
|
-
const traceId = randomUUID();
|
|
42
|
-
// Stage 1: Planner
|
|
43
|
-
const plannerStepId = randomUUID();
|
|
44
|
-
const plannerStartTime = Date.now();
|
|
45
|
-
// Resolve planner provider before execution
|
|
46
|
-
let plannerProvider;
|
|
47
|
-
try {
|
|
48
|
-
plannerProvider = this.roleResolver.resolveRoleProvider('planner');
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
throw new Error(`Planner provider resolution failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
52
|
-
}
|
|
53
|
-
let plannerResult;
|
|
54
|
-
try {
|
|
55
|
-
plannerResult = await this.plannerStrategy.executePlanning(context);
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
// Planner failure - rethrow to trigger fallback
|
|
59
|
-
throw new Error(`Planner step failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
60
|
-
}
|
|
61
|
-
const plannerDuration = Date.now() - plannerStartTime;
|
|
62
|
-
const plannerStep = {
|
|
63
|
-
id: plannerStepId,
|
|
64
|
-
role: 'planner',
|
|
65
|
-
input: context.goal,
|
|
66
|
-
output: JSON.stringify(plannerResult.plan),
|
|
67
|
-
timestamp: plannerStartTime,
|
|
68
|
-
duration: plannerDuration,
|
|
69
|
-
metadata: {
|
|
70
|
-
provider: plannerProvider.name,
|
|
71
|
-
providerId: plannerProvider.id,
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
// Stage 2: Validator (optional)
|
|
75
|
-
let validatedPlan = plannerResult.plan;
|
|
76
|
-
let validatorStep = null;
|
|
77
|
-
if (this.validatorStrategy) {
|
|
78
|
-
const validatorStepId = randomUUID();
|
|
79
|
-
const validatorStartTime = Date.now();
|
|
80
|
-
let validatorProvider = null;
|
|
81
|
-
try {
|
|
82
|
-
validatorProvider = this.roleResolver.resolveRoleProvider('validator');
|
|
83
|
-
}
|
|
84
|
-
catch (error) {
|
|
85
|
-
// Validator provider resolution failed - skip validation
|
|
86
|
-
console.warn('[MultiModelPlanningStrategy] Validator provider resolution failed, skipping validation:', error instanceof Error ? error.message : String(error));
|
|
87
|
-
}
|
|
88
|
-
if (validatorProvider) {
|
|
89
|
-
try {
|
|
90
|
-
const validationResult = await this.validatorStrategy.validatePlan(plannerResult.plan, {
|
|
91
|
-
goal: context.goal,
|
|
92
|
-
reflections: context.reflections,
|
|
93
|
-
memories: context.memories,
|
|
94
|
-
context: context.context,
|
|
95
|
-
});
|
|
96
|
-
validatedPlan = validationResult.plan;
|
|
97
|
-
const validatorDuration = Date.now() - validatorStartTime;
|
|
98
|
-
validatorStep = {
|
|
99
|
-
id: validatorStepId,
|
|
100
|
-
role: 'validator',
|
|
101
|
-
input: JSON.stringify(plannerResult.plan),
|
|
102
|
-
output: JSON.stringify({
|
|
103
|
-
isValid: validationResult.isValid,
|
|
104
|
-
warnings: validationResult.warnings,
|
|
105
|
-
risks: validationResult.risks,
|
|
106
|
-
}),
|
|
107
|
-
timestamp: validatorStartTime,
|
|
108
|
-
duration: validatorDuration,
|
|
109
|
-
metadata: {
|
|
110
|
-
provider: validatorProvider.name,
|
|
111
|
-
providerId: validatorProvider.id,
|
|
112
|
-
isValid: validationResult.isValid,
|
|
113
|
-
warningsCount: validationResult.warnings?.length || 0,
|
|
114
|
-
risksCount: validationResult.risks?.length || 0,
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
catch (error) {
|
|
119
|
-
// Validator failure - use planner result but log the failure
|
|
120
|
-
console.warn('[MultiModelPlanningStrategy] Validator step failed, using planner result:', error instanceof Error ? error.message : String(error));
|
|
121
|
-
validatorStep = {
|
|
122
|
-
id: validatorStepId,
|
|
123
|
-
role: 'validator',
|
|
124
|
-
input: JSON.stringify(plannerResult.plan),
|
|
125
|
-
output: 'Validation failed',
|
|
126
|
-
timestamp: validatorStartTime,
|
|
127
|
-
duration: Date.now() - validatorStartTime,
|
|
128
|
-
metadata: {
|
|
129
|
-
provider: validatorProvider.name,
|
|
130
|
-
providerId: validatorProvider.id,
|
|
131
|
-
error: error instanceof Error ? error.message : String(error),
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
// Build combined trace
|
|
138
|
-
const steps = [plannerStep];
|
|
139
|
-
if (validatorStep) {
|
|
140
|
-
steps.push(validatorStep);
|
|
141
|
-
}
|
|
142
|
-
const totalDuration = Date.now() - startTime;
|
|
143
|
-
const trace = {
|
|
144
|
-
id: traceId,
|
|
145
|
-
steps,
|
|
146
|
-
summary: `Multi-model plan: ${steps.length} step(s) (planner${validatorStep ? ' + validator' : ''})`,
|
|
147
|
-
metadata: {
|
|
148
|
-
totalDuration,
|
|
149
|
-
totalTokens: steps.reduce((sum, step) => sum + (step.tokenUsage?.inputTokens || 0) + (step.tokenUsage?.outputTokens || 0), 0),
|
|
150
|
-
},
|
|
151
|
-
};
|
|
152
|
-
return {
|
|
153
|
-
plan: validatedPlan,
|
|
154
|
-
trace,
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
//# sourceMappingURL=multi-model-planning-strategy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multi-model-planning-strategy.js","sourceRoot":"","sources":["../../../src/application/reasoning/multi-model-planning-strategy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAA2B,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAsB,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC;;;GAGG;AACH,MAAM,OAAO,0BAA0B;IAM3B;IALF,eAAe,CAAyB;IACxC,iBAAiB,GAA8B,IAAI,CAAC;IACpD,YAAY,CAAuB;IAE3C,YACU,gBAA4B,EACpC,YAAmC;QAD3B,qBAAgB,GAAhB,gBAAgB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AE,OAAO;YACX,KAAK;YACL,OAAO,EAAE,qBAAqB,KAAK,CAAC,MAAM,oBAAoB,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,GAAG;YACpG,QAAQ,EAAE;gBACR,aAAa;gBACb,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CACtC,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,IAAI,CAAC,CAAC,EAAE,CAAC,CACpF;aACF;SACF,CAAC;QAEF,OAAO;YACL,IAAI,EAAE,aAAa;YACnB,KAAK;SACN,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reasoning Configuration Helper
|
|
3
|
-
* Checks reasoning layer configuration (enabled, multi-model mode, etc.)
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Check if reasoning layer is enabled
|
|
7
|
-
* Priority: Environment variable > Config file > Default (false)
|
|
8
|
-
*/
|
|
9
|
-
export declare function isReasoningEnabled(): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Check if multi-model reasoning is enabled
|
|
12
|
-
* Requires reasoning.enabled = true AND reasoning.multiModel.enabled = true
|
|
13
|
-
*/
|
|
14
|
-
export declare function isMultiModelEnabled(): boolean;
|
|
15
|
-
//# sourceMappingURL=reasoning-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning-config.d.ts","sourceRoot":"","sources":["../../../src/application/reasoning/reasoning-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAgB5C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAmB7C"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reasoning Configuration Helper
|
|
3
|
-
* Checks reasoning layer configuration (enabled, multi-model mode, etc.)
|
|
4
|
-
*/
|
|
5
|
-
import { ConfigManager } from '../../infrastructure/config/config-manager.js';
|
|
6
|
-
/**
|
|
7
|
-
* Check if reasoning layer is enabled
|
|
8
|
-
* Priority: Environment variable > Config file > Default (false)
|
|
9
|
-
*/
|
|
10
|
-
export function isReasoningEnabled() {
|
|
11
|
-
// Check environment variable first
|
|
12
|
-
const envEnabled = process.env.CODEHERE_REASONING_ENABLED;
|
|
13
|
-
if (envEnabled !== undefined) {
|
|
14
|
-
return envEnabled === '1' || envEnabled.toLowerCase() === 'true';
|
|
15
|
-
}
|
|
16
|
-
// Check config file
|
|
17
|
-
try {
|
|
18
|
-
const configManager = new ConfigManager();
|
|
19
|
-
const reasoningConfig = configManager.get('reasoning');
|
|
20
|
-
return reasoningConfig?.enabled === true;
|
|
21
|
-
}
|
|
22
|
-
catch (error) {
|
|
23
|
-
// If config not available, default to false
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Check if multi-model reasoning is enabled
|
|
29
|
-
* Requires reasoning.enabled = true AND reasoning.multiModel.enabled = true
|
|
30
|
-
*/
|
|
31
|
-
export function isMultiModelEnabled() {
|
|
32
|
-
if (!isReasoningEnabled()) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
// Check environment variable first
|
|
36
|
-
const envMultiModel = process.env.CODEHERE_REASONING_MULTI_MODEL;
|
|
37
|
-
if (envMultiModel !== undefined) {
|
|
38
|
-
return envMultiModel === '1' || envMultiModel.toLowerCase() === 'true';
|
|
39
|
-
}
|
|
40
|
-
// Check config file
|
|
41
|
-
try {
|
|
42
|
-
const configManager = new ConfigManager();
|
|
43
|
-
const reasoningConfig = configManager.get('reasoning');
|
|
44
|
-
return reasoningConfig?.multiModel?.enabled === true;
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=reasoning-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning-config.js","sourceRoot":"","sources":["../../../src/application/reasoning/reasoning-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAE9E;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,mCAAmC;IACnC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAC1D,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,UAAU,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;IACnE,CAAC;IAED,oBAAoB;IACpB,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;QAC1C,MAAM,eAAe,GAAG,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACvD,OAAO,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,4CAA4C;QAC5C,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,mCAAmC;IACnC,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC;IACjE,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,aAAa,KAAK,GAAG,IAAI,aAAa,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;IACzE,CAAC;IAED,oBAAoB;IACpB,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;QAC1C,MAAM,eAAe,GAAG,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACvD,OAAO,eAAe,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACvD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reasoning Orchestrator
|
|
3
|
-
* Coordinates reasoning strategies and provides unified interface
|
|
4
|
-
*/
|
|
5
|
-
import type { IReasoningStrategy, PlanningResult } from './reasoning-strategy.interface.js';
|
|
6
|
-
import type { PlanningInputContext } from './types.js';
|
|
7
|
-
import type { ExecutionTracer } from '../../infrastructure/observability/execution-tracer.js';
|
|
8
|
-
export interface IReasoningOrchestrator {
|
|
9
|
-
planWithReasoning(context: PlanningInputContext): Promise<PlanningResult>;
|
|
10
|
-
}
|
|
11
|
-
export declare class ReasoningOrchestrator implements IReasoningOrchestrator {
|
|
12
|
-
private strategy;
|
|
13
|
-
private tracer?;
|
|
14
|
-
private providerName?;
|
|
15
|
-
constructor(strategy: IReasoningStrategy, tracer?: ExecutionTracer | undefined, providerName?: string | undefined);
|
|
16
|
-
planWithReasoning(context: PlanningInputContext): Promise<PlanningResult>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=reasoning-orchestrator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning-orchestrator.d.ts","sourceRoot":"","sources":["../../../src/application/reasoning/reasoning-orchestrator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAC5F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AAE9F,MAAM,WAAW,sBAAsB;IACrC,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC3E;AAED,qBAAa,qBAAsB,YAAW,sBAAsB;IAEhE,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,MAAM,CAAC;IACf,OAAO,CAAC,YAAY,CAAC;gBAFb,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,CAAC,EAAE,eAAe,YAAA,EACxB,YAAY,CAAC,EAAE,MAAM,YAAA;IAGzB,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;CAkKhF"}
|