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,170 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reasoning Orchestrator
|
|
3
|
-
* Coordinates reasoning strategies and provides unified interface
|
|
4
|
-
*/
|
|
5
|
-
export class ReasoningOrchestrator {
|
|
6
|
-
strategy;
|
|
7
|
-
tracer;
|
|
8
|
-
providerName;
|
|
9
|
-
constructor(strategy, tracer, providerName) {
|
|
10
|
-
this.strategy = strategy;
|
|
11
|
-
this.tracer = tracer;
|
|
12
|
-
this.providerName = providerName;
|
|
13
|
-
}
|
|
14
|
-
async planWithReasoning(context) {
|
|
15
|
-
const runId = this.tracer?.getCurrentRunId();
|
|
16
|
-
const startTime = Date.now();
|
|
17
|
-
// Trace start event
|
|
18
|
-
const traceId = this.tracer?.trace({
|
|
19
|
-
operationType: 'plan_generation',
|
|
20
|
-
operationName: 'reasoning_orchestrator_plan_start',
|
|
21
|
-
input: {
|
|
22
|
-
goal: context.goal,
|
|
23
|
-
planningMode: context.planningMode,
|
|
24
|
-
},
|
|
25
|
-
metadata: {
|
|
26
|
-
reasoningEnabled: true,
|
|
27
|
-
role: 'planner',
|
|
28
|
-
providerName: this.providerName || 'unknown',
|
|
29
|
-
startTime,
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
try {
|
|
33
|
-
const result = await this.strategy.executePlanning(context);
|
|
34
|
-
// Trace completion with metrics
|
|
35
|
-
const endTime = Date.now();
|
|
36
|
-
const totalDuration = endTime - startTime;
|
|
37
|
-
if (this.tracer && traceId) {
|
|
38
|
-
// Trace each reasoning step with role-specific events
|
|
39
|
-
result.trace.steps.forEach((step, idx) => {
|
|
40
|
-
const stepProviderName = step.metadata?.provider || this.providerName || 'unknown';
|
|
41
|
-
// Trace role start event
|
|
42
|
-
this.tracer.trace({
|
|
43
|
-
operationType: 'llm_call',
|
|
44
|
-
operationName: 'reasoning_role_start',
|
|
45
|
-
input: {
|
|
46
|
-
stepId: step.id,
|
|
47
|
-
role: step.role,
|
|
48
|
-
inputLength: step.input.length,
|
|
49
|
-
},
|
|
50
|
-
metadata: {
|
|
51
|
-
reasoningEnabled: true,
|
|
52
|
-
role: step.role,
|
|
53
|
-
stepIndex: idx,
|
|
54
|
-
providerName: stepProviderName,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
// Trace role end event
|
|
58
|
-
this.tracer.trace({
|
|
59
|
-
operationType: 'llm_call',
|
|
60
|
-
operationName: 'reasoning_role_end',
|
|
61
|
-
input: {
|
|
62
|
-
stepId: step.id,
|
|
63
|
-
role: step.role,
|
|
64
|
-
inputLength: step.input.length,
|
|
65
|
-
},
|
|
66
|
-
output: {
|
|
67
|
-
outputLength: step.output.length,
|
|
68
|
-
},
|
|
69
|
-
duration: step.duration,
|
|
70
|
-
metadata: {
|
|
71
|
-
reasoningEnabled: true,
|
|
72
|
-
role: step.role,
|
|
73
|
-
stepIndex: idx,
|
|
74
|
-
inputTokens: step.tokenUsage?.inputTokens,
|
|
75
|
-
outputTokens: step.tokenUsage?.outputTokens,
|
|
76
|
-
providerName: stepProviderName,
|
|
77
|
-
durationMs: step.duration,
|
|
78
|
-
success: true,
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
// Trace overall orchestration end event
|
|
83
|
-
this.tracer.trace({
|
|
84
|
-
operationType: 'plan_generation',
|
|
85
|
-
operationName: 'reasoning_orchestrator_plan_end',
|
|
86
|
-
input: {
|
|
87
|
-
goal: context.goal,
|
|
88
|
-
planningMode: context.planningMode,
|
|
89
|
-
},
|
|
90
|
-
output: {
|
|
91
|
-
planId: result.plan.id,
|
|
92
|
-
subPlansCount: result.plan.subPlans.length,
|
|
93
|
-
traceId: result.trace.id,
|
|
94
|
-
stepsCount: result.trace.steps.length,
|
|
95
|
-
success: true,
|
|
96
|
-
},
|
|
97
|
-
duration: totalDuration,
|
|
98
|
-
metadata: {
|
|
99
|
-
reasoningEnabled: true,
|
|
100
|
-
totalDuration: result.trace.metadata?.totalDuration,
|
|
101
|
-
totalTokens: result.trace.metadata?.totalTokens,
|
|
102
|
-
role: 'planner',
|
|
103
|
-
providerName: this.providerName || 'unknown',
|
|
104
|
-
durationMs: totalDuration,
|
|
105
|
-
startTime,
|
|
106
|
-
endTime,
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
return result;
|
|
111
|
-
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
// Trace error event
|
|
114
|
-
const endTime = Date.now();
|
|
115
|
-
const totalDuration = endTime - startTime;
|
|
116
|
-
if (this.tracer && traceId) {
|
|
117
|
-
// Trace role error event
|
|
118
|
-
const roleErrorTrace = {
|
|
119
|
-
operationType: 'plan_generation',
|
|
120
|
-
operationName: 'reasoning_role_error',
|
|
121
|
-
input: {
|
|
122
|
-
goal: context.goal,
|
|
123
|
-
planningMode: context.planningMode,
|
|
124
|
-
},
|
|
125
|
-
error: {
|
|
126
|
-
message: error instanceof Error ? error.message : String(error),
|
|
127
|
-
stack: error instanceof Error ? error.stack : undefined,
|
|
128
|
-
},
|
|
129
|
-
duration: totalDuration,
|
|
130
|
-
metadata: {
|
|
131
|
-
reasoningEnabled: true,
|
|
132
|
-
role: 'planner',
|
|
133
|
-
providerName: this.providerName || 'unknown',
|
|
134
|
-
durationMs: totalDuration,
|
|
135
|
-
startTime,
|
|
136
|
-
endTime,
|
|
137
|
-
success: false,
|
|
138
|
-
},
|
|
139
|
-
};
|
|
140
|
-
this.tracer.trace(roleErrorTrace);
|
|
141
|
-
// Also trace overall orchestration error
|
|
142
|
-
const errorTrace = {
|
|
143
|
-
operationType: 'plan_generation',
|
|
144
|
-
operationName: 'reasoning_orchestrator_plan_error',
|
|
145
|
-
input: {
|
|
146
|
-
goal: context.goal,
|
|
147
|
-
planningMode: context.planningMode,
|
|
148
|
-
},
|
|
149
|
-
error: {
|
|
150
|
-
message: error instanceof Error ? error.message : String(error),
|
|
151
|
-
stack: error instanceof Error ? error.stack : undefined,
|
|
152
|
-
},
|
|
153
|
-
duration: totalDuration,
|
|
154
|
-
metadata: {
|
|
155
|
-
reasoningEnabled: true,
|
|
156
|
-
role: 'planner',
|
|
157
|
-
providerName: this.providerName || 'unknown',
|
|
158
|
-
durationMs: totalDuration,
|
|
159
|
-
startTime,
|
|
160
|
-
endTime,
|
|
161
|
-
success: false,
|
|
162
|
-
},
|
|
163
|
-
};
|
|
164
|
-
this.tracer.trace(errorTrace);
|
|
165
|
-
}
|
|
166
|
-
throw error;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
//# sourceMappingURL=reasoning-orchestrator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning-orchestrator.js","sourceRoot":"","sources":["../../../src/application/reasoning/reasoning-orchestrator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,MAAM,OAAO,qBAAqB;IAEtB;IACA;IACA;IAHV,YACU,QAA4B,EAC5B,MAAwB,EACxB,YAAqB;QAFrB,aAAQ,GAAR,QAAQ,CAAoB;QAC5B,WAAM,GAAN,MAAM,CAAkB;QACxB,iBAAY,GAAZ,YAAY,CAAS;IAC5B,CAAC;IAEJ,KAAK,CAAC,iBAAiB,CAAC,OAA6B;QACnD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC;QAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,oBAAoB;QACpB,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC;YACjC,aAAa,EAAE,iBAAiB;YAChC,aAAa,EAAE,mCAAmC;YAClD,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,YAAY,EAAE,OAAO,CAAC,YAAY;aACnC;YACD,QAAQ,EAAE;gBACR,gBAAgB,EAAE,IAAI;gBACtB,IAAI,EAAE,SAAS;gBACf,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,SAAS;gBAC5C,SAAS;aACV;SACF,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAE5D,gCAAgC;YAChC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAC3B,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,CAAC;YAC1C,IAAI,IAAI,CAAC,MAAM,IAAI,OAAO,EAAE,CAAC;gBAC3B,sDAAsD;gBACtD,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI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BACzB,SAAS;wBACT,OAAO;wBACP,OAAO,EAAE,KAAK;qBACf;iBACF,CAAC;gBACF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAChC,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reasoning Strategy Interface
|
|
3
|
-
* Defines how reasoning is executed for different use cases
|
|
4
|
-
*/
|
|
5
|
-
import type { ReasoningTrace, PlanningInputContext } from './types.js';
|
|
6
|
-
import type { Plan } from '../../domain/entities/plan.js';
|
|
7
|
-
/**
|
|
8
|
-
* Planning result from reasoning strategy
|
|
9
|
-
*/
|
|
10
|
-
export interface PlanningResult {
|
|
11
|
-
plan: Plan;
|
|
12
|
-
trace: ReasoningTrace;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Reasoning strategy interface
|
|
16
|
-
* Different strategies can implement different reasoning patterns
|
|
17
|
-
*/
|
|
18
|
-
export interface IReasoningStrategy {
|
|
19
|
-
/**
|
|
20
|
-
* Execute planning with structured reasoning
|
|
21
|
-
*/
|
|
22
|
-
executePlanning(context: PlanningInputContext): Promise<PlanningResult>;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=reasoning-strategy.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning-strategy.interface.d.ts","sourceRoot":"","sources":["../../../src/application/reasoning/reasoning-strategy.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,cAAc,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACzE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning-strategy.interface.js","sourceRoot":"","sources":["../../../src/application/reasoning/reasoning-strategy.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Role-Aware Provider Resolver
|
|
3
|
-
* Resolves providers for reasoning roles (planner, validator)
|
|
4
|
-
* Falls back to OperationProviderResolver if role not configured
|
|
5
|
-
*/
|
|
6
|
-
import type { IModelProvider } from '../../infrastructure/providers/model-provider.interface.js';
|
|
7
|
-
import { ProviderRegistry } from '../../infrastructure/providers/provider-registry.js';
|
|
8
|
-
import { OperationProviderResolver } from '../../infrastructure/providers/operation-provider-resolver.js';
|
|
9
|
-
import { ConfigManager } from '../../infrastructure/config/config-manager.js';
|
|
10
|
-
export type ReasoningRole = 'planner' | 'validator';
|
|
11
|
-
/**
|
|
12
|
-
* Resolve provider for a reasoning role
|
|
13
|
-
* Priority:
|
|
14
|
-
* 1. reasoning.multiModel.roles[role] if multiModel.enabled = true
|
|
15
|
-
* 2. OperationProviderResolver for 'chat' operation
|
|
16
|
-
* 3. Default provider
|
|
17
|
-
*/
|
|
18
|
-
export declare class RoleProviderResolver {
|
|
19
|
-
private configManager;
|
|
20
|
-
private providerRegistry;
|
|
21
|
-
private operationResolver;
|
|
22
|
-
constructor(configManager?: ConfigManager, providerRegistry?: ProviderRegistry, operationResolver?: OperationProviderResolver);
|
|
23
|
-
/**
|
|
24
|
-
* Resolve provider for a reasoning role
|
|
25
|
-
*/
|
|
26
|
-
resolveRoleProvider(role: ReasoningRole): IModelProvider;
|
|
27
|
-
/**
|
|
28
|
-
* Check if multi-model reasoning is enabled
|
|
29
|
-
*/
|
|
30
|
-
isMultiModelEnabled(): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Check if a specific role is configured
|
|
33
|
-
*/
|
|
34
|
-
isRoleConfigured(role: ReasoningRole): boolean;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=role-provider-resolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"role-provider-resolver.d.ts","sourceRoot":"","sources":["../../../src/application/reasoning/role-provider-resolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4DAA4D,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAsB,MAAM,+DAA+D,CAAC;AAC9H,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAE9E,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,CAAC;AAEpD;;;;;;GAMG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,iBAAiB,CAA4B;gBAGnD,aAAa,CAAC,EAAE,aAAa,EAC7B,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,iBAAiB,CAAC,EAAE,yBAAyB;IAW/C;;OAEG;IACH,mBAAmB,CAAC,IAAI,EAAE,aAAa,GAAG,cAAc;IA4BxD;;OAEG;IACH,mBAAmB,IAAI,OAAO;IAK9B;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAS/C"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Role-Aware Provider Resolver
|
|
3
|
-
* Resolves providers for reasoning roles (planner, validator)
|
|
4
|
-
* Falls back to OperationProviderResolver if role not configured
|
|
5
|
-
*/
|
|
6
|
-
import { ProviderRegistry } from '../../infrastructure/providers/provider-registry.js';
|
|
7
|
-
import { OperationProviderResolver } from '../../infrastructure/providers/operation-provider-resolver.js';
|
|
8
|
-
import { ConfigManager } from '../../infrastructure/config/config-manager.js';
|
|
9
|
-
/**
|
|
10
|
-
* Resolve provider for a reasoning role
|
|
11
|
-
* Priority:
|
|
12
|
-
* 1. reasoning.multiModel.roles[role] if multiModel.enabled = true
|
|
13
|
-
* 2. OperationProviderResolver for 'chat' operation
|
|
14
|
-
* 3. Default provider
|
|
15
|
-
*/
|
|
16
|
-
export class RoleProviderResolver {
|
|
17
|
-
configManager;
|
|
18
|
-
providerRegistry;
|
|
19
|
-
operationResolver;
|
|
20
|
-
constructor(configManager, providerRegistry, operationResolver) {
|
|
21
|
-
this.configManager = configManager || new ConfigManager();
|
|
22
|
-
this.providerRegistry = providerRegistry || ProviderRegistry.getInstance();
|
|
23
|
-
this.operationResolver = operationResolver || new OperationProviderResolver(this.providerRegistry, null, null);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Resolve provider for a reasoning role
|
|
27
|
-
*/
|
|
28
|
-
resolveRoleProvider(role) {
|
|
29
|
-
// Check if multi-model is enabled
|
|
30
|
-
const reasoningConfig = this.configManager.get('reasoning');
|
|
31
|
-
const multiModelEnabled = reasoningConfig?.multiModel?.enabled === true;
|
|
32
|
-
if (multiModelEnabled) {
|
|
33
|
-
// Try role-specific provider
|
|
34
|
-
const roleProviderId = reasoningConfig?.multiModel?.roles?.[role];
|
|
35
|
-
if (roleProviderId) {
|
|
36
|
-
const provider = this.providerRegistry.get(roleProviderId);
|
|
37
|
-
if (provider) {
|
|
38
|
-
return provider;
|
|
39
|
-
}
|
|
40
|
-
// Invalid provider name - log warning and fall through
|
|
41
|
-
console.warn(`[RoleProviderResolver] Provider '${roleProviderId}' not found for role '${role}', falling back to operation resolver`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
// Fallback to OperationProviderResolver for 'chat' operation
|
|
45
|
-
// (planning uses chat operation)
|
|
46
|
-
try {
|
|
47
|
-
return this.operationResolver.resolveProvider('chat');
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
// Final fallback to default provider
|
|
51
|
-
return this.providerRegistry.getDefault();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Check if multi-model reasoning is enabled
|
|
56
|
-
*/
|
|
57
|
-
isMultiModelEnabled() {
|
|
58
|
-
const reasoningConfig = this.configManager.get('reasoning');
|
|
59
|
-
return reasoningConfig?.multiModel?.enabled === true;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Check if a specific role is configured
|
|
63
|
-
*/
|
|
64
|
-
isRoleConfigured(role) {
|
|
65
|
-
const reasoningConfig = this.configManager.get('reasoning');
|
|
66
|
-
const multiModelEnabled = reasoningConfig?.multiModel?.enabled === true;
|
|
67
|
-
if (!multiModelEnabled) {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
const roleProviderId = reasoningConfig?.multiModel?.roles?.[role];
|
|
71
|
-
return !!roleProviderId && !!this.providerRegistry.get(roleProviderId);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=role-provider-resolver.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"role-provider-resolver.js","sourceRoot":"","sources":["../../../src/application/reasoning/role-provider-resolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAsB,MAAM,+DAA+D,CAAC;AAC9H,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAI9E;;;;;;GAMG;AACH,MAAM,OAAO,oBAAoB;IACvB,aAAa,CAAgB;IAC7B,gBAAgB,CAAmB;IACnC,iBAAiB,CAA4B;IAErD,YACE,aAA6B,EAC7B,gBAAmC,EACnC,iBAA6C;QAE7C,IAAI,CAAC,aAAa,GAAG,aAAa,IAAI,IAAI,aAAa,EAAE,CAAC;QA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AE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACvD,CAAC;IAED;;OAEG;IACH,gBAAgB,CAAC,IAAmB;QAClC,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC5D,MAAM,iBAAiB,GAAG,eAAe,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;QACxE,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACvB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,cAAc,GAAG,eAAe,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC;QAClE,OAAO,CAAC,CAAC,cAAc,IAAI,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACzE,CAAC;CACF"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple Planning Strategy
|
|
3
|
-
* Wraps current planning behavior into structured reasoning trace
|
|
4
|
-
* Behaviorally equivalent to current PlanningUseCase, but structured
|
|
5
|
-
*/
|
|
6
|
-
import type { IReasoningStrategy, PlanningResult } from './reasoning-strategy.interface.js';
|
|
7
|
-
import type { PlanningInputContext } from './types.js';
|
|
8
|
-
import type { IAIService } from '../../domain/interfaces/ai-service.interface.js';
|
|
9
|
-
export declare class SimplePlanningStrategy implements IReasoningStrategy {
|
|
10
|
-
private aiService;
|
|
11
|
-
constructor(aiService: IAIService);
|
|
12
|
-
executePlanning(context: PlanningInputContext): Promise<PlanningResult>;
|
|
13
|
-
/**
|
|
14
|
-
* Build planning prompt (reuses logic from PlanningUseCase)
|
|
15
|
-
*/
|
|
16
|
-
private buildPlanningPrompt;
|
|
17
|
-
/**
|
|
18
|
-
* Parse plan from AI response (reuses logic from PlanningAgent)
|
|
19
|
-
*/
|
|
20
|
-
private parsePlanFromResponse;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=simple-planning-strategy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simple-planning-strategy.d.ts","sourceRoot":"","sources":["../../../src/application/reasoning/simple-planning-strategy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,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;AAIlF,qBAAa,sBAAuB,YAAW,kBAAkB;IACnD,OAAO,CAAC,SAAS;gBAAT,SAAS,EAAE,UAAU;IAEnC,eAAe,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IA0E7E;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA+D3B;;OAEG;IACH,OAAO,CAAC,qBAAqB;CA6E9B"}
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple Planning Strategy
|
|
3
|
-
* Wraps current planning behavior into structured reasoning trace
|
|
4
|
-
* Behaviorally equivalent to current PlanningUseCase, but structured
|
|
5
|
-
*/
|
|
6
|
-
import { randomUUID } from 'crypto';
|
|
7
|
-
export class SimplePlanningStrategy {
|
|
8
|
-
aiService;
|
|
9
|
-
constructor(aiService) {
|
|
10
|
-
this.aiService = aiService;
|
|
11
|
-
}
|
|
12
|
-
async executePlanning(context) {
|
|
13
|
-
const startTime = Date.now();
|
|
14
|
-
const stepId = randomUUID();
|
|
15
|
-
// Build the same prompt as PlanningUseCase.createHierarchicalPlan
|
|
16
|
-
const prompt = this.buildPlanningPrompt(context);
|
|
17
|
-
// Convert memories to CodeChunk[] format expected by aiService.chat
|
|
18
|
-
const codeChunks = [];
|
|
19
|
-
const memories = context.memories?.map(m => {
|
|
20
|
-
const memory = {
|
|
21
|
-
id: randomUUID(),
|
|
22
|
-
type: 'reflection',
|
|
23
|
-
description: m.description,
|
|
24
|
-
embedding: [],
|
|
25
|
-
timestamp: new Date(),
|
|
26
|
-
importance: 5,
|
|
27
|
-
lastAccessed: new Date(),
|
|
28
|
-
};
|
|
29
|
-
// Only add metadata if it has valid MemoryMetadata fields
|
|
30
|
-
if (m && typeof m === 'object') {
|
|
31
|
-
memory.metadata = m;
|
|
32
|
-
}
|
|
33
|
-
return memory;
|
|
34
|
-
}) || [];
|
|
35
|
-
// Call AI service (same as current implementation)
|
|
36
|
-
const response = await this.aiService.chat(prompt, codeChunks, memories);
|
|
37
|
-
const duration = Date.now() - startTime;
|
|
38
|
-
// Try to extract token usage from response if available
|
|
39
|
-
// Note: IAIService.chat() returns string, but provider responses may have usage info
|
|
40
|
-
// For now, we'll estimate tokens (can be enhanced in future to get actual usage)
|
|
41
|
-
const estimatedInputTokens = Math.ceil(prompt.length / 4);
|
|
42
|
-
const estimatedOutputTokens = Math.ceil(response.length / 4);
|
|
43
|
-
// Parse plan from response (same logic as PlanningUseCase)
|
|
44
|
-
const plan = this.parsePlanFromResponse(response, context);
|
|
45
|
-
// Create reasoning step
|
|
46
|
-
const step = {
|
|
47
|
-
id: stepId,
|
|
48
|
-
role: 'planner',
|
|
49
|
-
input: prompt,
|
|
50
|
-
output: response,
|
|
51
|
-
timestamp: startTime,
|
|
52
|
-
duration,
|
|
53
|
-
tokenUsage: {
|
|
54
|
-
inputTokens: estimatedInputTokens,
|
|
55
|
-
outputTokens: estimatedOutputTokens,
|
|
56
|
-
},
|
|
57
|
-
metadata: {
|
|
58
|
-
planningMode: context.planningMode || 'hybrid',
|
|
59
|
-
goal: context.goal,
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
// Create reasoning trace
|
|
63
|
-
const trace = {
|
|
64
|
-
id: randomUUID(),
|
|
65
|
-
steps: [step],
|
|
66
|
-
summary: `Generated plan with ${plan.subPlans.length} sub-plans`,
|
|
67
|
-
metadata: {
|
|
68
|
-
totalDuration: duration,
|
|
69
|
-
totalTokens: estimatedInputTokens + estimatedOutputTokens,
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
return {
|
|
73
|
-
plan,
|
|
74
|
-
trace,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Build planning prompt (reuses logic from PlanningUseCase)
|
|
79
|
-
*/
|
|
80
|
-
buildPlanningPrompt(context) {
|
|
81
|
-
const reflectionContext = context.reflections
|
|
82
|
-
?.map((r, i) => `${i + 1}. ${r}`)
|
|
83
|
-
.join('\n') || 'No specific reflections.';
|
|
84
|
-
const memoryContext = context.memories
|
|
85
|
-
?.slice(0, 20)
|
|
86
|
-
.map((m, i) => `${i + 1}. ${m.description}`)
|
|
87
|
-
.join('\n') || 'No relevant past experiences.';
|
|
88
|
-
const planningMode = context.planningMode || 'hybrid';
|
|
89
|
-
const fileContext = context.context?.files?.length
|
|
90
|
-
? `\nFiles to consider: ${context.context.files.join(', ')}`
|
|
91
|
-
: '';
|
|
92
|
-
const constraintsContext = context.context?.constraints?.length
|
|
93
|
-
? `\nConstraints: ${context.context.constraints.join(', ')}`
|
|
94
|
-
: '';
|
|
95
|
-
return `You are a Planning Agent (Architect) for an AI coding system. Your role is to create detailed, step-by-step modification plans.
|
|
96
|
-
|
|
97
|
-
Goal: "${context.goal}"${fileContext}${constraintsContext}
|
|
98
|
-
|
|
99
|
-
Consider:
|
|
100
|
-
- **Relevant Past Experiences/Memories**:
|
|
101
|
-
${memoryContext}
|
|
102
|
-
- **Synthesized Reflections/Insights**:
|
|
103
|
-
${reflectionContext}
|
|
104
|
-
|
|
105
|
-
Create a detailed plan with:
|
|
106
|
-
1. Clear sub-plans with specific actions
|
|
107
|
-
2. Dependencies between sub-plans
|
|
108
|
-
3. Estimated complexity for each sub-plan
|
|
109
|
-
4. Required tools/resources for each step
|
|
110
|
-
|
|
111
|
-
For each sub-plan, specify:
|
|
112
|
-
- \`id\`: Unique identifier (e.g., "subplan_1")
|
|
113
|
-
- \`description\`: Clear, actionable description WITH filepath if applicable
|
|
114
|
-
- \`type\`: Action type (search, edit, refactor, review, analyze, implement, test, debug)
|
|
115
|
-
- \`dependencies\`: Array of sub-plan IDs that must complete first
|
|
116
|
-
- \`status\`: Always "pending" initially
|
|
117
|
-
- \`estimatedComplexity\`: "low" | "medium" | "high"
|
|
118
|
-
- \`requiredTools\`: Array of tool names needed
|
|
119
|
-
|
|
120
|
-
Planning Mode: ${planningMode}
|
|
121
|
-
|
|
122
|
-
Respond with ONLY a JSON array of sub-plan objects.
|
|
123
|
-
|
|
124
|
-
Example:
|
|
125
|
-
[
|
|
126
|
-
{
|
|
127
|
-
"id": "subplan_1",
|
|
128
|
-
"description": "Search codebase for existing authentication patterns",
|
|
129
|
-
"type": "search",
|
|
130
|
-
"dependencies": [],
|
|
131
|
-
"status": "pending",
|
|
132
|
-
"estimatedComplexity": "low",
|
|
133
|
-
"requiredTools": ["search"]
|
|
134
|
-
}
|
|
135
|
-
]
|
|
136
|
-
|
|
137
|
-
JSON only, no other text:`;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Parse plan from AI response (reuses logic from PlanningAgent)
|
|
141
|
-
*/
|
|
142
|
-
parsePlanFromResponse(response, context) {
|
|
143
|
-
try {
|
|
144
|
-
// Try to extract JSON array from response
|
|
145
|
-
const jsonMatch = response.match(/\[[\s\S]*\]/);
|
|
146
|
-
if (jsonMatch) {
|
|
147
|
-
const subPlansData = JSON.parse(jsonMatch[0]);
|
|
148
|
-
const subPlans = subPlansData.map((sp, idx) => ({
|
|
149
|
-
id: sp.id || `subplan_${idx + 1}`,
|
|
150
|
-
description: sp.description || '',
|
|
151
|
-
type: (sp.type || 'implement'),
|
|
152
|
-
dependencies: sp.dependencies || [],
|
|
153
|
-
status: 'pending',
|
|
154
|
-
estimatedSteps: sp.estimatedSteps || 1,
|
|
155
|
-
estimatedComplexity: sp.estimatedComplexity || 'medium',
|
|
156
|
-
}));
|
|
157
|
-
// Build dependencies from sub-plan dependencies
|
|
158
|
-
const dependencies = [];
|
|
159
|
-
subPlans.forEach(sp => {
|
|
160
|
-
sp.dependencies.forEach((depId) => {
|
|
161
|
-
dependencies.push({
|
|
162
|
-
from: depId,
|
|
163
|
-
to: sp.id,
|
|
164
|
-
type: 'sequential',
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
return {
|
|
169
|
-
id: randomUUID(),
|
|
170
|
-
goal: context.goal,
|
|
171
|
-
description: `Plan to achieve: ${context.goal}`,
|
|
172
|
-
status: 'draft',
|
|
173
|
-
createdAt: new Date(),
|
|
174
|
-
subPlans,
|
|
175
|
-
dependencies,
|
|
176
|
-
metadata: {
|
|
177
|
-
memoriesUsed: [],
|
|
178
|
-
reflections: [],
|
|
179
|
-
complexity: 'medium',
|
|
180
|
-
priority: 5,
|
|
181
|
-
},
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
catch (error) {
|
|
186
|
-
// Fallback: create a simple plan
|
|
187
|
-
console.warn('[SimplePlanningStrategy] Failed to parse plan, creating fallback:', error);
|
|
188
|
-
}
|
|
189
|
-
// Fallback plan
|
|
190
|
-
return {
|
|
191
|
-
id: randomUUID(),
|
|
192
|
-
goal: context.goal,
|
|
193
|
-
description: `Plan to achieve: ${context.goal}`,
|
|
194
|
-
status: 'draft',
|
|
195
|
-
createdAt: new Date(),
|
|
196
|
-
subPlans: [
|
|
197
|
-
{
|
|
198
|
-
id: 'subplan_1',
|
|
199
|
-
description: context.goal,
|
|
200
|
-
type: 'implement',
|
|
201
|
-
dependencies: [],
|
|
202
|
-
status: 'pending',
|
|
203
|
-
estimatedSteps: 1,
|
|
204
|
-
estimatedComplexity: 'medium',
|
|
205
|
-
},
|
|
206
|
-
],
|
|
207
|
-
dependencies: [],
|
|
208
|
-
metadata: {
|
|
209
|
-
memoriesUsed: [],
|
|
210
|
-
reflections: [],
|
|
211
|
-
complexity: 'medium',
|
|
212
|
-
priority: 5,
|
|
213
|
-
},
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
//# sourceMappingURL=simple-planning-strategy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simple-planning-strategy.js","sourceRoot":"","sources":["../../../src/application/reasoning/simple-planning-strategy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAQpC,MAAM,OAAO,sBAAsB;IACb;IAApB,YAAoB,SAAqB;QAArB,cAAS,GAAT,SAAS,CAAY;IAAG,CAAC;IAE7C,KAAK,CAAC,eAAe,CAAC,OAA6B;QACjD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;QAE5B,kEAAkE;QAClE,MAAM,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAEjD,oEAAoE;QACpE,MAAM,UAAU,GAAgB,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAa,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE;YACnD,MAAM,MAAM,GAAW;gBACrB,EAAE,EAAE,UAAU,EAAE;gBAChB,IAAI,EAAE,YAAqB;gBAC3B,WAAW,EAAE,CAAC,CAAC,WAAW;gBAC1B,SAAS,EAAE,EAAE;gBACb,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,UAAU,EAAE,CAAC;gBACb,YAAY,EAAE,IAAI,IAAI,EAAE;aACzB,CAAC;YACF,0DAA0D;YAC1D,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;gBAC/B,MAAM,CAAC,QAAQ,GAAG,CAAmB,CAAC;YACxC,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,IAAI,EAAE,CAAC;QAET,mDAAmD;QACnD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,C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;wBACf,UAAU,EAAE,QAAiB;wBAC7B,QAAQ,EAAE,CAAC;qBACI;iBAClB,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,iCAAiC;YACjC,OAAO,CAAC,IAAI,CAAC,mEAAmE,EAAE,KAAK,CAAC,CAAC;QAC3F,CAAC;QAED,gBAAgB;QAChB,OAAO;YACL,EAAE,EAAE,UAAU,EAAE;YAChB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,oBAAoB,OAAO,CAAC,IAAI,EAAE;YAC/C,MAAM,EAAE,OAAgB;YACxB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,QAAQ,EAAE;gBACR;oBACE,EAAE,EAAE,WAAW;oBACf,WAAW,EAAE,OAAO,CAAC,IAAI;oBACzB,IAAI,EAAE,WAAoB;oBAC1B,YAAY,EAAE,EAAE;oBAChB,MAAM,EAAE,SAAkB;oBAC1B,cAAc,EAAE,CAAC;oBACjB,mBAAmB,EAAE,QAAiB;iBACvC;aACF;YACD,YAAY,EAAE,EAAE;YAChB,QAAQ,EAAE;gBACR,YAAY,EAAE,EAAE;gBAChB,WAAW,EAAE,EAAE;gBACf,UAAU,EAAE,QAAiB;gBAC7B,QAAQ,EAAE,CAAC;aACZ;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reasoning Layer Types
|
|
3
|
-
* Core abstractions for structured reasoning and token optimization
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Reasoning role - defines the purpose of a reasoning step
|
|
7
|
-
*/
|
|
8
|
-
export type ReasoningRole = 'planner' | 'worker' | 'validator' | 'summarizer';
|
|
9
|
-
/**
|
|
10
|
-
* Single reasoning step - atomic unit of reasoning
|
|
11
|
-
*/
|
|
12
|
-
export interface ReasoningStep {
|
|
13
|
-
id: string;
|
|
14
|
-
role: ReasoningRole;
|
|
15
|
-
input: string;
|
|
16
|
-
output: string;
|
|
17
|
-
metadata?: Record<string, unknown>;
|
|
18
|
-
timestamp: number;
|
|
19
|
-
duration?: number;
|
|
20
|
-
tokenUsage?: {
|
|
21
|
-
inputTokens?: number;
|
|
22
|
-
outputTokens?: number;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Reasoning trace - sequence of reasoning steps with summary metadata
|
|
27
|
-
*/
|
|
28
|
-
export interface ReasoningTrace {
|
|
29
|
-
id: string;
|
|
30
|
-
steps: ReasoningStep[];
|
|
31
|
-
summary?: string;
|
|
32
|
-
metadata?: {
|
|
33
|
-
provider?: string;
|
|
34
|
-
model?: string;
|
|
35
|
-
totalTokens?: number;
|
|
36
|
-
totalDuration?: number;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Compressed reasoning - compact representation for later use
|
|
41
|
-
* Can be expanded to use Toon serialization in future phases
|
|
42
|
-
*/
|
|
43
|
-
export interface CompressedReasoning {
|
|
44
|
-
traceId: string;
|
|
45
|
-
compressed: string;
|
|
46
|
-
metadata?: Record<string, unknown>;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Planning input context - what the planner needs to generate a plan
|
|
50
|
-
*/
|
|
51
|
-
export interface PlanningInputContext {
|
|
52
|
-
goal: string;
|
|
53
|
-
reflections?: string[];
|
|
54
|
-
memories?: Array<{
|
|
55
|
-
description: string;
|
|
56
|
-
[key: string]: unknown;
|
|
57
|
-
}>;
|
|
58
|
-
context?: {
|
|
59
|
-
files?: string[];
|
|
60
|
-
currentDirectory?: string;
|
|
61
|
-
constraints?: string[];
|
|
62
|
-
};
|
|
63
|
-
planningMode?: 'plan-then-execute' | 'iterative' | 'hybrid';
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=types.d.ts.map
|