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
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { config } from 'dotenv';
|
|
|
4
4
|
import { join, dirname } from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
import { existsSync } from 'fs';
|
|
7
|
+
import { indexRepositoryParallel } from './embed.js';
|
|
7
8
|
import { executeAskCommand } from './presentation/cli/commands/ask-command.js';
|
|
8
9
|
import { executeReactCommand } from './presentation/cli/commands/react-command.js';
|
|
9
10
|
import { executeSmartCommand } from './presentation/cli/commands/smart-command.js';
|
|
@@ -12,6 +13,7 @@ import { executeSetupCommand } from './presentation/cli/commands/setup-command.j
|
|
|
12
13
|
import { executeConfigCommand } from './presentation/cli/commands/config-command.js';
|
|
13
14
|
import { executeHelpCommand } from './presentation/cli/commands/help-command.js';
|
|
14
15
|
import { initLogFile, logEntry } from './log.js';
|
|
16
|
+
import { checkProviderConfiguration, displayProviderError } from './utils/provider-check.js';
|
|
15
17
|
import { performHealthCheck, formatHealthStatus, getMetrics } from './monitoring.js';
|
|
16
18
|
import { refactorMultiFile, findFilesByPattern } from './refactor.js';
|
|
17
19
|
import { getGitStatus, formatGitStatus, getAllGitDiffs, analyzeDiff, getGitDiff } from './git.js';
|
|
@@ -21,6 +23,9 @@ import { executeDocsCommand } from './presentation/cli/commands/docs-command.js'
|
|
|
21
23
|
import { executeProductCommand } from './presentation/cli/commands/product-command.js';
|
|
22
24
|
import { executeStatusCommand } from './presentation/cli/commands/status-command.js';
|
|
23
25
|
import { executeSuggestCommand } from './presentation/cli/commands/suggest-command.js';
|
|
26
|
+
import { executeCostCommand } from './presentation/cli/commands/cost-command.js';
|
|
27
|
+
import { executeTrustCommand } from './presentation/cli/commands/trust-command.js';
|
|
28
|
+
import { executeContextImportCommand, executeContextExportCommand, executeContextStatsCommand } from './presentation/cli/commands/context-command.js';
|
|
24
29
|
import { executeRunCommand } from './presentation/cli/commands/run-command.js';
|
|
25
30
|
import { executeModelsCommand } from './presentation/cli/commands/models-command.js';
|
|
26
31
|
import { executeReviewCommand } from './presentation/cli/commands/review-command.js';
|
|
@@ -29,7 +34,7 @@ import { executeKnowledgeCommand } from './presentation/cli/commands/knowledge-c
|
|
|
29
34
|
import { executeLearningDashboardCommand } from './presentation/cli/commands/learning-dashboard-command.js';
|
|
30
35
|
import { executeTraceCommand } from './presentation/cli/commands/trace-command.js';
|
|
31
36
|
import { executeUndoCommand } from './presentation/cli/commands/undo-command.js';
|
|
32
|
-
import {
|
|
37
|
+
import { executeAuditCommand } from './presentation/cli/commands/audit-command.js';
|
|
33
38
|
import { reviewFile, formatReview } from './review.js';
|
|
34
39
|
import { formatLearningInsights, getPerformanceInsights } from './learning.js';
|
|
35
40
|
import { getCacheStats, clearAllCaches } from './cache.js';
|
|
@@ -69,25 +74,31 @@ program
|
|
|
69
74
|
program
|
|
70
75
|
.argument('[query]', 'Your query - Codehere will understand what you need')
|
|
71
76
|
.option('--review', 'Enable review & feedback capture (used for trust scoring and Validation Mode)')
|
|
77
|
+
.option('--quick', 'Quick mode - work without indexing by reading files directly')
|
|
78
|
+
.option('-c, --continue', 'Continue from previous conversation (session continuity)')
|
|
79
|
+
.option('-m, --model <model>', 'Specify AI model (e.g., gpt-4, claude-3, command-r-plus, llama3)')
|
|
72
80
|
.action(async (query, options) => {
|
|
73
81
|
if (query && query.trim()) {
|
|
74
82
|
// Direct query - use intelligent router
|
|
75
83
|
initLogFile();
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
console.log(colors.bold('Setup Instructions:'));
|
|
81
|
-
console.log(' 1. Get your API key from: https://dashboard.cohere.com/api-keys');
|
|
82
|
-
console.log(' 2. Create a .env file in your project root:');
|
|
83
|
-
console.log(colors.cyan(' echo "COHERE_API_KEY=your_key_here" > .env'));
|
|
84
|
-
console.log(' 3. Run the command again');
|
|
85
|
-
newline();
|
|
84
|
+
// Check for valid AI provider (supports Cohere, OpenAI, OpenRouter, Local, Fake)
|
|
85
|
+
const providerCheck = checkProviderConfiguration();
|
|
86
|
+
if (!providerCheck.hasValidProvider) {
|
|
87
|
+
displayProviderError(providerCheck);
|
|
86
88
|
process.exit(1);
|
|
87
89
|
}
|
|
88
90
|
try {
|
|
89
91
|
const opts = program.opts();
|
|
90
|
-
|
|
92
|
+
// Set model in environment if specified
|
|
93
|
+
if (opts.model) {
|
|
94
|
+
process.env.CODEHERE_MODEL = opts.model;
|
|
95
|
+
}
|
|
96
|
+
await executeSmartCommand(query.trim(), {
|
|
97
|
+
review: opts.review || false,
|
|
98
|
+
quick: opts.quick || false,
|
|
99
|
+
continue: opts.continue || false,
|
|
100
|
+
model: opts.model,
|
|
101
|
+
});
|
|
91
102
|
logEntry({
|
|
92
103
|
timestamp: new Date().toISOString(),
|
|
93
104
|
command: 'smart',
|
|
@@ -195,34 +206,6 @@ program
|
|
|
195
206
|
newline();
|
|
196
207
|
}
|
|
197
208
|
});
|
|
198
|
-
program
|
|
199
|
-
.command('memory')
|
|
200
|
-
.description('View and manage Codehere\'s operation history (XAI: See what Codehere remembers)')
|
|
201
|
-
.option('-l, --list', 'List all memories')
|
|
202
|
-
.option('-s, --search <term>', 'Search memories by description or type')
|
|
203
|
-
.option('--stats', 'Show memory statistics')
|
|
204
|
-
.option('--clear', 'Clear memories (requires --confirm)')
|
|
205
|
-
.option('--limit <number>', 'Limit number of results (default: 20)')
|
|
206
|
-
.option('--type <type>', 'Filter by memory type (observation, reflection, plan)')
|
|
207
|
-
.option('--json', 'Output in JSON format')
|
|
208
|
-
.action(async (options) => {
|
|
209
|
-
initLogFile();
|
|
210
|
-
try {
|
|
211
|
-
await executeMemoryCommand({
|
|
212
|
-
list: options.list,
|
|
213
|
-
search: options.search,
|
|
214
|
-
stats: options.stats,
|
|
215
|
-
clear: options.clear,
|
|
216
|
-
limit: options.limit ? parseInt(options.limit, 10) : undefined,
|
|
217
|
-
type: options.type,
|
|
218
|
-
json: options.json,
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
catch (err) {
|
|
222
|
-
displayError(err, { operation: 'memory' });
|
|
223
|
-
process.exit(1);
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
209
|
program
|
|
227
210
|
.command('help')
|
|
228
211
|
.description('Show help for commands')
|
|
@@ -236,37 +219,33 @@ program
|
|
|
236
219
|
.option('-r, --repo <path>', 'Repository path (default: current directory)')
|
|
237
220
|
.action(async (options) => {
|
|
238
221
|
initLogFile();
|
|
239
|
-
//
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
console.log(colors.bold('Setup Instructions:'));
|
|
245
|
-
console.log(' 1. Get your API key from: https://dashboard.cohere.com/api-keys');
|
|
246
|
-
console.log(' 2. Create a .env file in your project root:');
|
|
247
|
-
console.log(colors.cyan(' echo "COHERE_API_KEY=your_key_here" > .env'));
|
|
248
|
-
console.log(' 3. Run the command again');
|
|
249
|
-
console.log('');
|
|
250
|
-
console.log(colors.dim('Note: For testing without API calls, set CODEHERE_FAKE_AI=1'));
|
|
251
|
-
newline();
|
|
222
|
+
// Check provider configuration (supports all providers)
|
|
223
|
+
const { checkProviderConfiguration, displayProviderError } = await import('./utils/provider-check.js');
|
|
224
|
+
const providerCheck = checkProviderConfiguration();
|
|
225
|
+
if (!providerCheck.hasValidProvider) {
|
|
226
|
+
displayProviderError(providerCheck);
|
|
252
227
|
process.exit(1);
|
|
253
228
|
}
|
|
254
229
|
try {
|
|
255
230
|
if (isMinimalStyle()) {
|
|
256
231
|
console.log(colors.cyan('Indexing codebase...'));
|
|
257
|
-
newline();
|
|
258
232
|
}
|
|
259
233
|
else {
|
|
260
234
|
console.log(createBanner('Indexing Repository', 'Building semantic search index'));
|
|
261
|
-
newline();
|
|
262
235
|
}
|
|
236
|
+
newline();
|
|
263
237
|
const repoPath = options.repo || process.cwd();
|
|
264
|
-
//
|
|
265
|
-
const
|
|
238
|
+
// Show progress spinner for indexing
|
|
239
|
+
const spinner = createSpinner('Scanning files...');
|
|
240
|
+
spinner.start();
|
|
241
|
+
const startTime = Date.now();
|
|
242
|
+
// NEW: Use parallel indexing with caching
|
|
266
243
|
await indexRepositoryParallel(repoPath, {
|
|
267
244
|
useCache: true,
|
|
268
245
|
maxConcurrency: 5,
|
|
269
246
|
});
|
|
247
|
+
const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
|
|
248
|
+
spinner.succeed(`Indexed codebase in ${elapsed}s`);
|
|
270
249
|
logEntry({
|
|
271
250
|
timestamp: new Date().toISOString(),
|
|
272
251
|
command: 'index',
|
|
@@ -306,42 +285,41 @@ program
|
|
|
306
285
|
.command('ask')
|
|
307
286
|
.description('Ask questions about your codebase using semantic search')
|
|
308
287
|
.argument('<question>', 'The question to ask about your code')
|
|
288
|
+
.option('--quick', 'Quick mode - work without indexing by reading files directly')
|
|
309
289
|
.alias('q')
|
|
310
|
-
.option('--explain', 'Show explainable AI (XAI) reasoning steps')
|
|
311
|
-
.option('--json', 'Output in JSON format')
|
|
312
290
|
.addHelpText('after', `
|
|
313
291
|
Examples:
|
|
314
292
|
$ codehere ask "How does authentication work?"
|
|
315
|
-
$ codehere ask "Where is the user login function?"
|
|
293
|
+
$ codehere ask "Where is the user login function?"
|
|
316
294
|
$ codehere q "Explain the database schema"
|
|
295
|
+
$ codehere ask "What does this project do?" --quick
|
|
317
296
|
|
|
318
297
|
This command will:
|
|
319
298
|
• Search your indexed codebase for relevant code
|
|
320
299
|
• Use AI to generate a contextual answer
|
|
321
300
|
• Show which files were used as context
|
|
322
|
-
• Use memories from past interactions (XAI: visible with --explain)
|
|
323
|
-
|
|
324
|
-
Options:
|
|
325
|
-
--explain Show explainable AI (XAI) reasoning steps
|
|
326
301
|
|
|
327
|
-
Make sure to run "codehere index" first!
|
|
302
|
+
Make sure to run "codehere index" first (or use --quick to bypass indexing)!
|
|
328
303
|
`)
|
|
329
304
|
.action(async (question, options) => {
|
|
330
305
|
initLogFile();
|
|
331
|
-
if
|
|
332
|
-
|
|
333
|
-
|
|
306
|
+
// Check if any valid provider is configured
|
|
307
|
+
const providerCheck = checkProviderConfiguration();
|
|
308
|
+
if (!providerCheck.hasValidProvider) {
|
|
334
309
|
newline();
|
|
335
|
-
console.
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
310
|
+
console.error(error(providerCheck.message));
|
|
311
|
+
if (providerCheck.setupInstructions) {
|
|
312
|
+
newline();
|
|
313
|
+
console.log(colors.bold('Setup Instructions:'));
|
|
314
|
+
providerCheck.setupInstructions.forEach(instruction => {
|
|
315
|
+
console.log(' ' + instruction);
|
|
316
|
+
});
|
|
317
|
+
}
|
|
340
318
|
newline();
|
|
341
319
|
process.exit(1);
|
|
342
320
|
}
|
|
343
321
|
try {
|
|
344
|
-
await executeAskCommand(question, {
|
|
322
|
+
await executeAskCommand(question, { quick: options.quick });
|
|
345
323
|
logEntry({
|
|
346
324
|
timestamp: new Date().toISOString(),
|
|
347
325
|
command: 'ask',
|
|
@@ -388,16 +366,10 @@ Safety policies:
|
|
|
388
366
|
`)
|
|
389
367
|
.action(async (file, instruction, options) => {
|
|
390
368
|
initLogFile();
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
console.error(error('COHERE_API_KEY not found in environment'));
|
|
394
|
-
newline();
|
|
395
|
-
console.log(colors.bold('Setup Instructions:'));
|
|
396
|
-
console.log(' 1. Get your API key from: https://dashboard.cohere.com/api-keys');
|
|
397
|
-
console.log(' 2. Create a .env file in your project root:');
|
|
398
|
-
console.log(colors.cyan(' echo "COHERE_API_KEY=your_key_here" > .env'));
|
|
399
|
-
console.log(' 3. Run the command again');
|
|
369
|
+
const providerCheck = checkProviderConfiguration();
|
|
370
|
+
if (!providerCheck.hasValidProvider) {
|
|
400
371
|
newline();
|
|
372
|
+
displayProviderError(providerCheck);
|
|
401
373
|
process.exit(1);
|
|
402
374
|
}
|
|
403
375
|
try {
|
|
@@ -455,16 +427,10 @@ This command will:
|
|
|
455
427
|
`)
|
|
456
428
|
.action(async (file) => {
|
|
457
429
|
initLogFile();
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
console.error(error('COHERE_API_KEY not found in environment'));
|
|
461
|
-
newline();
|
|
462
|
-
console.log(colors.bold('Setup Instructions:'));
|
|
463
|
-
console.log(' 1. Get your API key from: https://dashboard.cohere.com/api-keys');
|
|
464
|
-
console.log(' 2. Create a .env file in your project root:');
|
|
465
|
-
console.log(colors.cyan(' echo "COHERE_API_KEY=your_key_here" > .env'));
|
|
466
|
-
console.log(' 3. Run the command again');
|
|
430
|
+
const providerCheck = checkProviderConfiguration();
|
|
431
|
+
if (!providerCheck.hasValidProvider) {
|
|
467
432
|
newline();
|
|
433
|
+
displayProviderError(providerCheck);
|
|
468
434
|
process.exit(1);
|
|
469
435
|
}
|
|
470
436
|
try {
|
|
@@ -588,9 +554,9 @@ program
|
|
|
588
554
|
.option('--max-files <number>', 'Maximum files to process', '10')
|
|
589
555
|
.action(async (pattern, instruction, options) => {
|
|
590
556
|
initLogFile();
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
557
|
+
const providerCheck = checkProviderConfiguration();
|
|
558
|
+
if (!providerCheck.hasValidProvider) {
|
|
559
|
+
displayProviderError(providerCheck);
|
|
594
560
|
process.exit(1);
|
|
595
561
|
}
|
|
596
562
|
try {
|
|
@@ -705,28 +671,25 @@ program
|
|
|
705
671
|
.argument('<instruction>', 'Complex instruction to plan')
|
|
706
672
|
.option('-e, --execute', 'Execute the plan after creating it')
|
|
707
673
|
.option('--review', 'Enable review & feedback capture (used for trust scoring and Validation Mode)')
|
|
708
|
-
.option('--json', 'Output in JSON format')
|
|
709
674
|
.action(async (instruction, options) => {
|
|
710
675
|
initLogFile();
|
|
711
|
-
|
|
712
|
-
|
|
676
|
+
const providerCheck = checkProviderConfiguration();
|
|
677
|
+
if (!providerCheck.hasValidProvider) {
|
|
678
|
+
displayProviderError(providerCheck);
|
|
713
679
|
process.exit(1);
|
|
714
680
|
}
|
|
715
681
|
try {
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
else {
|
|
722
|
-
console.log(createBanner('Task Planning', 'Intelligent multi-step execution'));
|
|
723
|
-
newline();
|
|
724
|
-
console.log(colors.bold('Instruction:') + ' ' + colors.cyan(instruction));
|
|
725
|
-
}
|
|
682
|
+
if (isMinimalStyle()) {
|
|
683
|
+
printMinimalHeader('plan', instruction);
|
|
684
|
+
}
|
|
685
|
+
else {
|
|
686
|
+
console.log(createBanner('Task Planning', 'Intelligent multi-step execution'));
|
|
726
687
|
newline();
|
|
688
|
+
console.log(colors.bold('Instruction:') + ' ' + colors.cyan(instruction));
|
|
727
689
|
}
|
|
690
|
+
newline();
|
|
728
691
|
// Use new memory-based planning
|
|
729
|
-
await executePlanCommand(instruction, { execute: options.execute, review: options.review
|
|
692
|
+
await executePlanCommand(instruction, { execute: options.execute, review: options.review });
|
|
730
693
|
}
|
|
731
694
|
catch (err) {
|
|
732
695
|
console.error(error('Error:'), err instanceof Error ? err.message : String(err));
|
|
@@ -800,8 +763,9 @@ program
|
|
|
800
763
|
.argument('<file>', 'File to review')
|
|
801
764
|
.action(async (file) => {
|
|
802
765
|
initLogFile();
|
|
803
|
-
|
|
804
|
-
|
|
766
|
+
const providerCheck = checkProviderConfiguration();
|
|
767
|
+
if (!providerCheck.hasValidProvider) {
|
|
768
|
+
displayProviderError(providerCheck);
|
|
805
769
|
process.exit(1);
|
|
806
770
|
}
|
|
807
771
|
try {
|
|
@@ -905,8 +869,9 @@ program
|
|
|
905
869
|
.option('--plan-only', 'Only show migration plan, do not execute')
|
|
906
870
|
.action(async (from, to, options) => {
|
|
907
871
|
initLogFile();
|
|
908
|
-
|
|
909
|
-
|
|
872
|
+
const providerCheck = checkProviderConfiguration();
|
|
873
|
+
if (!providerCheck.hasValidProvider) {
|
|
874
|
+
displayProviderError(providerCheck);
|
|
910
875
|
process.exit(1);
|
|
911
876
|
}
|
|
912
877
|
try {
|
|
@@ -949,8 +914,9 @@ Warning: This command may modify README.md and docs/api.md files.
|
|
|
949
914
|
console.error(error(`Unknown command: ${cmd}. Use 'generate' to create documentation.`));
|
|
950
915
|
process.exit(1);
|
|
951
916
|
}
|
|
952
|
-
|
|
953
|
-
|
|
917
|
+
const providerCheck = checkProviderConfiguration();
|
|
918
|
+
if (!providerCheck.hasValidProvider) {
|
|
919
|
+
displayProviderError(providerCheck);
|
|
954
920
|
process.exit(1);
|
|
955
921
|
}
|
|
956
922
|
initLogFile();
|
|
@@ -985,8 +951,9 @@ Warning: This command may create new files if --output is specified.
|
|
|
985
951
|
console.error(error(`Unknown command: ${cmd}. Use 'spec' to generate product requirements.`));
|
|
986
952
|
process.exit(1);
|
|
987
953
|
}
|
|
988
|
-
|
|
989
|
-
|
|
954
|
+
const providerCheck = checkProviderConfiguration();
|
|
955
|
+
if (!providerCheck.hasValidProvider) {
|
|
956
|
+
displayProviderError(providerCheck);
|
|
990
957
|
process.exit(1);
|
|
991
958
|
}
|
|
992
959
|
initLogFile();
|
|
@@ -1019,6 +986,146 @@ program
|
|
|
1019
986
|
track: Boolean(options.track),
|
|
1020
987
|
});
|
|
1021
988
|
});
|
|
989
|
+
// Cost tracking command - doesn't require API key
|
|
990
|
+
program
|
|
991
|
+
.command('cost')
|
|
992
|
+
.description('View API cost tracking and budget status (local estimates)')
|
|
993
|
+
.argument('[action]', 'Action: status, summary, run, reset', 'status')
|
|
994
|
+
.argument('[runId]', 'Run ID (for "run" action)')
|
|
995
|
+
.action(async (action, runId) => {
|
|
996
|
+
await executeCostCommand(action, runId);
|
|
997
|
+
});
|
|
998
|
+
// Trust dashboard command - shows agent reliability metrics
|
|
999
|
+
program
|
|
1000
|
+
.command('trust')
|
|
1001
|
+
.description('View agent reliability and trust metrics')
|
|
1002
|
+
.argument('[action]', 'Action: status, history, reset', 'status')
|
|
1003
|
+
.option('--json', 'Output in JSON format')
|
|
1004
|
+
.option('--limit <n>', 'Limit history entries', '20')
|
|
1005
|
+
.action(async (action, options) => {
|
|
1006
|
+
await executeTrustCommand(action, {
|
|
1007
|
+
json: options.json,
|
|
1008
|
+
limit: options.limit ? parseInt(options.limit, 10) : undefined,
|
|
1009
|
+
});
|
|
1010
|
+
});
|
|
1011
|
+
// Context continuity commands - import, export, stats
|
|
1012
|
+
// Use addCommand for proper subcommand handling
|
|
1013
|
+
const contextImportCmd = new Command('import')
|
|
1014
|
+
.description('Import conversation context from other AI tools')
|
|
1015
|
+
.requiredOption('--from <source>', 'Import source: claude-code, opencode, cursor, or file')
|
|
1016
|
+
.option('--session <id>', 'Session ID (default: latest)', 'latest')
|
|
1017
|
+
.option('--file <path>', 'File path (required for file import)')
|
|
1018
|
+
.option('--project <path>', 'Project path override')
|
|
1019
|
+
.addHelpText('after', `
|
|
1020
|
+
Examples:
|
|
1021
|
+
$ codehere context import --from claude-code --session latest
|
|
1022
|
+
$ codehere context import --from claude-code --session <session-id>
|
|
1023
|
+
$ codehere context import --from opencode
|
|
1024
|
+
$ codehere context import --from cursor
|
|
1025
|
+
$ codehere context import --from file --file ./context.json
|
|
1026
|
+
|
|
1027
|
+
Context continuity allows you to:
|
|
1028
|
+
• Import conversations from Claude Code, OpenCode, or Cursor
|
|
1029
|
+
• Continue conversations across different AI tools
|
|
1030
|
+
• Preserve context when switching providers
|
|
1031
|
+
`)
|
|
1032
|
+
.action(async function () {
|
|
1033
|
+
initLogFile();
|
|
1034
|
+
try {
|
|
1035
|
+
// Use 'this' context to access command options in Commander.js subcommands
|
|
1036
|
+
const from = this.getOptionValue('from');
|
|
1037
|
+
const session = this.getOptionValue('session') || 'latest';
|
|
1038
|
+
const file = this.getOptionValue('file');
|
|
1039
|
+
const project = this.getOptionValue('project');
|
|
1040
|
+
if (!from) {
|
|
1041
|
+
console.error(error('--from is required for import'));
|
|
1042
|
+
console.log(info('Usage: codehere context import --from <source> [options]'));
|
|
1043
|
+
process.exit(1);
|
|
1044
|
+
}
|
|
1045
|
+
if (from === 'file' && !file) {
|
|
1046
|
+
console.error(error('--file is required when --from=file'));
|
|
1047
|
+
console.log(info('Usage: codehere context import --from file --file <path>'));
|
|
1048
|
+
process.exit(1);
|
|
1049
|
+
}
|
|
1050
|
+
await executeContextImportCommand(from, {
|
|
1051
|
+
session,
|
|
1052
|
+
file,
|
|
1053
|
+
project,
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
catch (err) {
|
|
1057
|
+
console.error(error('Error:'), err instanceof Error ? err.message : String(err));
|
|
1058
|
+
process.exit(1);
|
|
1059
|
+
}
|
|
1060
|
+
});
|
|
1061
|
+
const contextCmd = new Command('context')
|
|
1062
|
+
.description('Manage conversation contexts (import, export, stats)')
|
|
1063
|
+
.addCommand(contextImportCmd);
|
|
1064
|
+
const contextExportCmd = new Command('export')
|
|
1065
|
+
.description('Export conversation context to portable format')
|
|
1066
|
+
.option('--session <id>', 'Session ID (default: latest)')
|
|
1067
|
+
.option('--output <path>', 'Output file path')
|
|
1068
|
+
.option('--json', 'Output in JSON format')
|
|
1069
|
+
.addHelpText('after', `
|
|
1070
|
+
Examples:
|
|
1071
|
+
$ codehere context export --session <sessionId> --output ./export.json
|
|
1072
|
+
$ codehere context export --output my-context.json
|
|
1073
|
+
$ codehere context export --session <sessionId> --json
|
|
1074
|
+
|
|
1075
|
+
Exports context to portable JSON format that can be:
|
|
1076
|
+
• Re-imported into Codehere
|
|
1077
|
+
• Shared with team members
|
|
1078
|
+
• Backed up for safekeeping
|
|
1079
|
+
`)
|
|
1080
|
+
.action(async function () {
|
|
1081
|
+
initLogFile();
|
|
1082
|
+
try {
|
|
1083
|
+
const session = this.getOptionValue('session');
|
|
1084
|
+
const output = this.getOptionValue('output');
|
|
1085
|
+
const json = this.getOptionValue('json');
|
|
1086
|
+
await executeContextExportCommand(session, {
|
|
1087
|
+
output,
|
|
1088
|
+
json,
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
catch (err) {
|
|
1092
|
+
console.error(error('Error:'), err instanceof Error ? err.message : String(err));
|
|
1093
|
+
process.exit(1);
|
|
1094
|
+
}
|
|
1095
|
+
});
|
|
1096
|
+
contextCmd.addCommand(contextExportCmd);
|
|
1097
|
+
const contextStatsCmd = new Command('stats')
|
|
1098
|
+
.description('View conversation context statistics')
|
|
1099
|
+
.option('--session <id>', 'Session ID (shows all if not specified)')
|
|
1100
|
+
.option('--json', 'Output in JSON format')
|
|
1101
|
+
.addHelpText('after', `
|
|
1102
|
+
Examples:
|
|
1103
|
+
$ codehere context stats
|
|
1104
|
+
$ codehere context stats --session <sessionId>
|
|
1105
|
+
$ codehere context stats --session <sessionId> --json
|
|
1106
|
+
|
|
1107
|
+
Shows:
|
|
1108
|
+
• Message count and token usage
|
|
1109
|
+
• Compaction history
|
|
1110
|
+
• Model and provider information
|
|
1111
|
+
• Project metadata
|
|
1112
|
+
`)
|
|
1113
|
+
.action(async function () {
|
|
1114
|
+
initLogFile();
|
|
1115
|
+
try {
|
|
1116
|
+
const session = this.getOptionValue('session');
|
|
1117
|
+
const json = this.getOptionValue('json');
|
|
1118
|
+
await executeContextStatsCommand(session, {
|
|
1119
|
+
json,
|
|
1120
|
+
});
|
|
1121
|
+
}
|
|
1122
|
+
catch (err) {
|
|
1123
|
+
console.error(error('Error:'), err instanceof Error ? err.message : String(err));
|
|
1124
|
+
process.exit(1);
|
|
1125
|
+
}
|
|
1126
|
+
});
|
|
1127
|
+
contextCmd.addCommand(contextStatsCmd);
|
|
1128
|
+
program.addCommand(contextCmd);
|
|
1022
1129
|
// Suggest command - Read-only assistant mode
|
|
1023
1130
|
program
|
|
1024
1131
|
.command('suggest')
|
|
@@ -1038,9 +1145,9 @@ This command:
|
|
|
1038
1145
|
`)
|
|
1039
1146
|
.action(async (query, options) => {
|
|
1040
1147
|
initLogFile();
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1148
|
+
const providerCheck = checkProviderConfiguration();
|
|
1149
|
+
if (!providerCheck.hasValidProvider) {
|
|
1150
|
+
displayProviderError(providerCheck);
|
|
1044
1151
|
process.exit(1);
|
|
1045
1152
|
}
|
|
1046
1153
|
try {
|
|
@@ -1088,9 +1195,9 @@ This command:
|
|
|
1088
1195
|
`)
|
|
1089
1196
|
.action(async (goal, options) => {
|
|
1090
1197
|
initLogFile();
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1198
|
+
const providerCheck = checkProviderConfiguration();
|
|
1199
|
+
if (!providerCheck.hasValidProvider) {
|
|
1200
|
+
displayProviderError(providerCheck);
|
|
1094
1201
|
process.exit(1);
|
|
1095
1202
|
}
|
|
1096
1203
|
try {
|
|
@@ -1168,8 +1275,9 @@ program
|
|
|
1168
1275
|
.option('--save', 'Save tests to file')
|
|
1169
1276
|
.action(async (file, options) => {
|
|
1170
1277
|
initLogFile();
|
|
1171
|
-
|
|
1172
|
-
|
|
1278
|
+
const providerCheck = checkProviderConfiguration();
|
|
1279
|
+
if (!providerCheck.hasValidProvider) {
|
|
1280
|
+
displayProviderError(providerCheck);
|
|
1173
1281
|
process.exit(1);
|
|
1174
1282
|
}
|
|
1175
1283
|
try {
|
|
@@ -1222,20 +1330,10 @@ This command uses ReAct (Reasoning + Acting) pattern:
|
|
|
1222
1330
|
`)
|
|
1223
1331
|
.action(async (query) => {
|
|
1224
1332
|
initLogFile();
|
|
1225
|
-
|
|
1226
|
-
if (!
|
|
1227
|
-
newline();
|
|
1228
|
-
console.error(error('COHERE_API_KEY not found in environment'));
|
|
1229
|
-
newline();
|
|
1230
|
-
console.log(colors.bold('Setup Instructions:'));
|
|
1231
|
-
console.log(' 1. Get your API key from: https://dashboard.cohere.com/api-keys');
|
|
1232
|
-
console.log(' 2. Create a .env file in your project root:');
|
|
1233
|
-
console.log(colors.cyan(' echo "COHERE_API_KEY=your_key_here" > .env'));
|
|
1234
|
-
console.log(' 3. Run the command again');
|
|
1235
|
-
console.log('');
|
|
1236
|
-
console.log('Or use fake AI mode for testing:');
|
|
1237
|
-
console.log(colors.cyan(' CODEHERE_FAKE_AI=1 codehere react "your query"'));
|
|
1333
|
+
const providerCheck = checkProviderConfiguration();
|
|
1334
|
+
if (!providerCheck.hasValidProvider) {
|
|
1238
1335
|
newline();
|
|
1336
|
+
displayProviderError(providerCheck);
|
|
1239
1337
|
process.exit(1);
|
|
1240
1338
|
}
|
|
1241
1339
|
try {
|
|
@@ -1254,7 +1352,6 @@ This command uses ReAct (Reasoning + Acting) pattern:
|
|
|
1254
1352
|
});
|
|
1255
1353
|
program
|
|
1256
1354
|
.command('orchestrate')
|
|
1257
|
-
.option('--json', 'Output in JSON format')
|
|
1258
1355
|
.description('Orchestrate multi-agent workflows (plan, execute, validate)')
|
|
1259
1356
|
.argument('<goal>', 'The goal to orchestrate')
|
|
1260
1357
|
.option('-m, --mode <mode>', 'Orchestration mode: plan-only, execute-only, or full', 'full')
|
|
@@ -1262,9 +1359,9 @@ program
|
|
|
1262
1359
|
.option('--review', 'Enable review & feedback capture (used for trust scoring and Validation Mode)')
|
|
1263
1360
|
.action(async (goal, options) => {
|
|
1264
1361
|
initLogFile();
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1362
|
+
const providerCheck = checkProviderConfiguration();
|
|
1363
|
+
if (!providerCheck.hasValidProvider) {
|
|
1364
|
+
displayProviderError(providerCheck);
|
|
1268
1365
|
process.exit(1);
|
|
1269
1366
|
}
|
|
1270
1367
|
try {
|
|
@@ -1272,7 +1369,6 @@ program
|
|
|
1272
1369
|
mode: options.mode,
|
|
1273
1370
|
planId: options.planId,
|
|
1274
1371
|
review: options.review,
|
|
1275
|
-
json: options.json,
|
|
1276
1372
|
});
|
|
1277
1373
|
logEntry({
|
|
1278
1374
|
timestamp: new Date().toISOString(),
|
|
@@ -1389,6 +1485,34 @@ program
|
|
|
1389
1485
|
process.exit(1);
|
|
1390
1486
|
}
|
|
1391
1487
|
});
|
|
1488
|
+
// Security audit export command
|
|
1489
|
+
program
|
|
1490
|
+
.command('audit')
|
|
1491
|
+
.description('Security audit trail export for compliance')
|
|
1492
|
+
.argument('<action>', 'Action: export or list')
|
|
1493
|
+
.option('-f, --format <format>', 'Export format: json, jsonl, or csv', 'json')
|
|
1494
|
+
.option('--start-date <date>', 'Start date (ISO 8601 format, e.g., 2025-01-15T00:00:00Z)')
|
|
1495
|
+
.option('--end-date <date>', 'End date (ISO 8601 format, e.g., 2025-01-15T23:59:59Z)')
|
|
1496
|
+
.option('--include-inputs', 'Include input data in export (may contain sensitive data)')
|
|
1497
|
+
.option('--include-outputs', 'Include output data in export (may contain sensitive data)')
|
|
1498
|
+
.option('-o, --output <path>', 'Output file path (default: auto-generated)')
|
|
1499
|
+
.action(async (action, options) => {
|
|
1500
|
+
initLogFile();
|
|
1501
|
+
try {
|
|
1502
|
+
await executeAuditCommand(action, {
|
|
1503
|
+
format: options.format,
|
|
1504
|
+
startDate: options.startDate,
|
|
1505
|
+
endDate: options.endDate,
|
|
1506
|
+
includeInputs: options.includeInputs,
|
|
1507
|
+
includeOutputs: options.includeOutputs,
|
|
1508
|
+
outputPath: options.output,
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
catch (err) {
|
|
1512
|
+
console.error(error('Error:'), err instanceof Error ? err.message : String(err));
|
|
1513
|
+
process.exit(1);
|
|
1514
|
+
}
|
|
1515
|
+
});
|
|
1392
1516
|
// Initialize telemetry and track command
|
|
1393
1517
|
const telemetry = getTelemetryService();
|
|
1394
1518
|
// Track command usage (if enabled)
|