codehere 0.3.0 β 0.4.0
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/README.md +223 -42
- package/dist/application/agents/documentation-agent.d.ts +24 -0
- package/dist/application/agents/documentation-agent.d.ts.map +1 -0
- package/dist/application/agents/documentation-agent.js +399 -0
- package/dist/application/agents/documentation-agent.js.map +1 -0
- package/dist/application/agents/execution-agent.d.ts +11 -0
- package/dist/application/agents/execution-agent.d.ts.map +1 -1
- package/dist/application/agents/execution-agent.js +289 -80
- package/dist/application/agents/execution-agent.js.map +1 -1
- package/dist/application/agents/multi-agent-orchestrator.d.ts +3 -0
- package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -1
- package/dist/application/agents/multi-agent-orchestrator.js +86 -0
- package/dist/application/agents/multi-agent-orchestrator.js.map +1 -1
- package/dist/application/agents/planning-agent.d.ts +3 -0
- package/dist/application/agents/planning-agent.d.ts.map +1 -1
- package/dist/application/agents/planning-agent.js +132 -64
- package/dist/application/agents/planning-agent.js.map +1 -1
- package/dist/application/agents/product-requirements-agent.d.ts +21 -0
- package/dist/application/agents/product-requirements-agent.d.ts.map +1 -0
- package/dist/application/agents/product-requirements-agent.js +247 -0
- package/dist/application/agents/product-requirements-agent.js.map +1 -0
- package/dist/application/agents/validation-agent.d.ts +5 -1
- package/dist/application/agents/validation-agent.d.ts.map +1 -1
- package/dist/application/agents/validation-agent.js +156 -21
- package/dist/application/agents/validation-agent.js.map +1 -1
- package/dist/application/services/dependency-container.d.ts +22 -2
- package/dist/application/services/dependency-container.d.ts.map +1 -1
- package/dist/application/services/dependency-container.js +144 -6
- package/dist/application/services/dependency-container.js.map +1 -1
- package/dist/application/services/intelligent-router.d.ts +13 -0
- package/dist/application/services/intelligent-router.d.ts.map +1 -1
- package/dist/application/services/intelligent-router.js +300 -87
- package/dist/application/services/intelligent-router.js.map +1 -1
- package/dist/application/use-cases/ask-question-use-case.d.ts +19 -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 +125 -46
- package/dist/application/use-cases/ask-question-use-case.js.map +1 -1
- package/dist/application/use-cases/edit-file-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/edit-file-use-case.js +16 -1
- package/dist/application/use-cases/edit-file-use-case.js.map +1 -1
- package/dist/domain/entities/documentation.d.ts +35 -0
- package/dist/domain/entities/documentation.d.ts.map +1 -0
- package/dist/domain/entities/documentation.js +6 -0
- package/dist/domain/entities/documentation.js.map +1 -0
- package/dist/domain/entities/product-requirements.d.ts +50 -0
- package/dist/domain/entities/product-requirements.d.ts.map +1 -0
- package/dist/domain/entities/product-requirements.js +6 -0
- package/dist/domain/entities/product-requirements.js.map +1 -0
- package/dist/domain/entities/task.d.ts +152 -0
- package/dist/domain/entities/task.d.ts.map +1 -0
- package/dist/domain/entities/task.js +61 -0
- package/dist/domain/entities/task.js.map +1 -0
- package/dist/domain/interfaces/agent.interface.d.ts +15 -0
- package/dist/domain/interfaces/agent.interface.d.ts.map +1 -0
- package/dist/domain/interfaces/agent.interface.js +6 -0
- package/dist/domain/interfaces/agent.interface.js.map +1 -0
- package/dist/domain/services/environment-mode-manager.d.ts +18 -0
- package/dist/domain/services/environment-mode-manager.d.ts.map +1 -0
- package/dist/domain/services/environment-mode-manager.js +37 -0
- package/dist/domain/services/environment-mode-manager.js.map +1 -0
- package/dist/domain/services/risk-tier-detector.d.ts +18 -0
- package/dist/domain/services/risk-tier-detector.d.ts.map +1 -0
- package/dist/domain/services/risk-tier-detector.js +65 -0
- package/dist/domain/services/risk-tier-detector.js.map +1 -0
- package/dist/formatter.d.ts.map +1 -1
- package/dist/formatter.js +10 -3
- package/dist/formatter.js.map +1 -1
- package/dist/index.js +103 -129
- 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 +15 -2
- package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
- package/dist/infrastructure/ai/fake-ai-service.d.ts +22 -0
- package/dist/infrastructure/ai/fake-ai-service.d.ts.map +1 -0
- package/dist/infrastructure/ai/fake-ai-service.js +59 -0
- package/dist/infrastructure/ai/fake-ai-service.js.map +1 -0
- package/dist/infrastructure/ai/provider-ai-service.d.ts +59 -0
- package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -0
- package/dist/infrastructure/ai/provider-ai-service.js +477 -0
- package/dist/infrastructure/ai/provider-ai-service.js.map +1 -0
- package/dist/infrastructure/cache/embedding-cache.d.ts +13 -1
- package/dist/infrastructure/cache/embedding-cache.d.ts.map +1 -1
- package/dist/infrastructure/cache/embedding-cache.js +80 -9
- package/dist/infrastructure/cache/embedding-cache.js.map +1 -1
- package/dist/infrastructure/cache/response-cache.d.ts +86 -0
- package/dist/infrastructure/cache/response-cache.d.ts.map +1 -0
- package/dist/infrastructure/cache/response-cache.js +224 -0
- package/dist/infrastructure/cache/response-cache.js.map +1 -0
- package/dist/infrastructure/context/conversation-context.d.ts +58 -0
- package/dist/infrastructure/context/conversation-context.d.ts.map +1 -0
- package/dist/infrastructure/context/conversation-context.js +170 -0
- package/dist/infrastructure/context/conversation-context.js.map +1 -0
- package/dist/infrastructure/context/session-manager.d.ts +26 -0
- package/dist/infrastructure/context/session-manager.d.ts.map +1 -0
- package/dist/infrastructure/context/session-manager.js +98 -0
- package/dist/infrastructure/context/session-manager.js.map +1 -0
- package/dist/infrastructure/cost/cost-tracker.d.ts +1 -0
- package/dist/infrastructure/cost/cost-tracker.d.ts.map +1 -1
- package/dist/infrastructure/cost/cost-tracker.js +12 -5
- package/dist/infrastructure/cost/cost-tracker.js.map +1 -1
- package/dist/infrastructure/governance/nist-ai-rmf.d.ts +6 -8
- package/dist/infrastructure/governance/nist-ai-rmf.d.ts.map +1 -1
- package/dist/infrastructure/governance/nist-ai-rmf.js +6 -8
- package/dist/infrastructure/governance/nist-ai-rmf.js.map +1 -1
- package/dist/infrastructure/governance/policy-as-code.d.ts +6 -8
- package/dist/infrastructure/governance/policy-as-code.d.ts.map +1 -1
- package/dist/infrastructure/governance/policy-as-code.js +6 -8
- package/dist/infrastructure/governance/policy-as-code.js.map +1 -1
- package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts +7 -9
- package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts.map +1 -1
- package/dist/infrastructure/governance/prompt-to-code-lineage.js +7 -9
- package/dist/infrastructure/governance/prompt-to-code-lineage.js.map +1 -1
- package/dist/infrastructure/providers/cohere-provider.d.ts +39 -0
- package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/cohere-provider.js +359 -0
- package/dist/infrastructure/providers/cohere-provider.js.map +1 -0
- package/dist/infrastructure/providers/fake-provider.d.ts +43 -0
- package/dist/infrastructure/providers/fake-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/fake-provider.js +130 -0
- package/dist/infrastructure/providers/fake-provider.js.map +1 -0
- package/dist/infrastructure/providers/local-llm-provider.d.ts +49 -0
- package/dist/infrastructure/providers/local-llm-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/local-llm-provider.js +330 -0
- package/dist/infrastructure/providers/local-llm-provider.js.map +1 -0
- package/dist/infrastructure/providers/model-config.types.d.ts +70 -0
- package/dist/infrastructure/providers/model-config.types.d.ts.map +1 -0
- package/dist/infrastructure/providers/model-config.types.js +9 -0
- package/dist/infrastructure/providers/model-config.types.js.map +1 -0
- package/dist/infrastructure/providers/model-provider.interface.d.ts +113 -0
- package/dist/infrastructure/providers/model-provider.interface.d.ts.map +1 -0
- package/dist/infrastructure/providers/model-provider.interface.js +8 -0
- package/dist/infrastructure/providers/model-provider.interface.js.map +1 -0
- package/dist/infrastructure/providers/openai-provider.d.ts +38 -0
- package/dist/infrastructure/providers/openai-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/openai-provider.js +413 -0
- package/dist/infrastructure/providers/openai-provider.js.map +1 -0
- package/dist/infrastructure/providers/operation-provider-resolver.d.ts +48 -0
- package/dist/infrastructure/providers/operation-provider-resolver.d.ts.map +1 -0
- package/dist/infrastructure/providers/operation-provider-resolver.js +105 -0
- package/dist/infrastructure/providers/operation-provider-resolver.js.map +1 -0
- package/dist/infrastructure/providers/provider-config-loader.d.ts +37 -0
- package/dist/infrastructure/providers/provider-config-loader.d.ts.map +1 -0
- package/dist/infrastructure/providers/provider-config-loader.js +120 -0
- package/dist/infrastructure/providers/provider-config-loader.js.map +1 -0
- package/dist/infrastructure/providers/provider-registry.d.ts +53 -0
- package/dist/infrastructure/providers/provider-registry.d.ts.map +1 -0
- package/dist/infrastructure/providers/provider-registry.js +88 -0
- package/dist/infrastructure/providers/provider-registry.js.map +1 -0
- package/dist/infrastructure/storage/task-helpers.d.ts +58 -0
- package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -0
- package/dist/infrastructure/storage/task-helpers.js +157 -0
- package/dist/infrastructure/storage/task-helpers.js.map +1 -0
- package/dist/infrastructure/storage/task-repository.d.ts +67 -0
- package/dist/infrastructure/storage/task-repository.d.ts.map +1 -0
- package/dist/infrastructure/storage/task-repository.js +205 -0
- package/dist/infrastructure/storage/task-repository.js.map +1 -0
- package/dist/infrastructure/ux/bi-directional-learning.d.ts +22 -0
- package/dist/infrastructure/ux/bi-directional-learning.d.ts.map +1 -1
- package/dist/infrastructure/ux/bi-directional-learning.js +144 -7
- package/dist/infrastructure/ux/bi-directional-learning.js.map +1 -1
- package/dist/infrastructure/ux/capability-boundaries.d.ts +50 -0
- package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -0
- package/dist/infrastructure/ux/capability-boundaries.js +167 -0
- package/dist/infrastructure/ux/capability-boundaries.js.map +1 -0
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts +63 -0
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -0
- package/dist/infrastructure/ux/comprehensive-formatter.js +212 -0
- package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -0
- package/dist/infrastructure/ux/feedback-prompt.d.ts +42 -0
- package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -0
- package/dist/infrastructure/ux/feedback-prompt.js +181 -0
- package/dist/infrastructure/ux/feedback-prompt.js.map +1 -0
- package/dist/infrastructure/ux/hitl-review-portal.d.ts.map +1 -1
- package/dist/infrastructure/ux/hitl-review-portal.js +4 -1
- package/dist/infrastructure/ux/hitl-review-portal.js.map +1 -1
- package/dist/infrastructure/ux/hitl-validation.d.ts +35 -0
- package/dist/infrastructure/ux/hitl-validation.d.ts.map +1 -1
- package/dist/infrastructure/ux/hitl-validation.js +86 -0
- package/dist/infrastructure/ux/hitl-validation.js.map +1 -1
- package/dist/infrastructure/ux/progress-indicator.d.ts +2 -1
- package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
- package/dist/infrastructure/ux/progress-indicator.js +13 -3
- package/dist/infrastructure/ux/progress-indicator.js.map +1 -1
- package/dist/infrastructure/ux/proportional-friction.d.ts +73 -0
- package/dist/infrastructure/ux/proportional-friction.d.ts.map +1 -0
- package/dist/infrastructure/ux/proportional-friction.js +200 -0
- package/dist/infrastructure/ux/proportional-friction.js.map +1 -0
- package/dist/infrastructure/validation/agent-feedback.d.ts +115 -0
- package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -0
- package/dist/infrastructure/validation/agent-feedback.js +227 -0
- package/dist/infrastructure/validation/agent-feedback.js.map +1 -0
- package/dist/infrastructure/validation/agent-validation-helper.d.ts +75 -0
- package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -0
- package/dist/infrastructure/validation/agent-validation-helper.js +88 -0
- package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -0
- package/dist/infrastructure/validation/feedback-stats.d.ts +99 -0
- package/dist/infrastructure/validation/feedback-stats.d.ts.map +1 -0
- package/dist/infrastructure/validation/feedback-stats.js +173 -0
- package/dist/infrastructure/validation/feedback-stats.js.map +1 -0
- package/dist/infrastructure/validation/review-handler.d.ts +54 -0
- package/dist/infrastructure/validation/review-handler.d.ts.map +1 -0
- package/dist/infrastructure/validation/review-handler.js +206 -0
- package/dist/infrastructure/validation/review-handler.js.map +1 -0
- package/dist/infrastructure/validation/summary-aggregator.d.ts +42 -0
- package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -0
- package/dist/infrastructure/validation/summary-aggregator.js +156 -0
- package/dist/infrastructure/validation/summary-aggregator.js.map +1 -0
- package/dist/infrastructure/validation/summary-extractor.d.ts +59 -0
- package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -0
- package/dist/infrastructure/validation/summary-extractor.js +102 -0
- package/dist/infrastructure/validation/summary-extractor.js.map +1 -0
- package/dist/infrastructure/validation/trace-summary.d.ts +72 -0
- package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -0
- package/dist/infrastructure/validation/trace-summary.js +371 -0
- package/dist/infrastructure/validation/trace-summary.js.map +1 -0
- package/dist/infrastructure/validation/trust-config.d.ts +27 -0
- package/dist/infrastructure/validation/trust-config.d.ts.map +1 -0
- package/dist/infrastructure/validation/trust-config.js +113 -0
- package/dist/infrastructure/validation/trust-config.js.map +1 -0
- package/dist/infrastructure/xai/attention-visualizer.d.ts +6 -8
- package/dist/infrastructure/xai/attention-visualizer.d.ts.map +1 -1
- package/dist/infrastructure/xai/attention-visualizer.js +6 -8
- package/dist/infrastructure/xai/attention-visualizer.js.map +1 -1
- package/dist/infrastructure/xai/cot-visualizer.d.ts +6 -9
- package/dist/infrastructure/xai/cot-visualizer.d.ts.map +1 -1
- package/dist/infrastructure/xai/cot-visualizer.js +6 -9
- package/dist/infrastructure/xai/cot-visualizer.js.map +1 -1
- package/dist/infrastructure/xai/decision-tree-log.d.ts +6 -10
- package/dist/infrastructure/xai/decision-tree-log.d.ts.map +1 -1
- package/dist/infrastructure/xai/decision-tree-log.js +6 -10
- package/dist/infrastructure/xai/decision-tree-log.js.map +1 -1
- package/dist/infrastructure/xai/interactive-xai.d.ts +6 -8
- package/dist/infrastructure/xai/interactive-xai.d.ts.map +1 -1
- package/dist/infrastructure/xai/interactive-xai.js +6 -8
- package/dist/infrastructure/xai/interactive-xai.js.map +1 -1
- package/dist/infrastructure/xai/uncertainty-quantifier.d.ts +6 -9
- package/dist/infrastructure/xai/uncertainty-quantifier.d.ts.map +1 -1
- package/dist/infrastructure/xai/uncertainty-quantifier.js +6 -9
- package/dist/infrastructure/xai/uncertainty-quantifier.js.map +1 -1
- package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/ask-command.js +84 -2
- package/dist/presentation/cli/commands/ask-command.js.map +1 -1
- package/dist/presentation/cli/commands/docs-command.d.ts +12 -0
- package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/docs-command.js +196 -0
- package/dist/presentation/cli/commands/docs-command.js.map +1 -0
- package/dist/presentation/cli/commands/fix-command.d.ts +8 -0
- package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/fix-command.js +309 -0
- package/dist/presentation/cli/commands/fix-command.js.map +1 -0
- package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/help-command.js +2 -0
- package/dist/presentation/cli/commands/help-command.js.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.d.ts +1 -0
- package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.js +53 -0
- package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
- package/dist/presentation/cli/commands/plan-command.d.ts +1 -0
- package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/plan-command.js +80 -3
- package/dist/presentation/cli/commands/plan-command.js.map +1 -1
- package/dist/presentation/cli/commands/product-command.d.ts +12 -0
- package/dist/presentation/cli/commands/product-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/product-command.js +188 -0
- package/dist/presentation/cli/commands/product-command.js.map +1 -0
- package/dist/presentation/cli/commands/react-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/react-command.js +3 -1
- package/dist/presentation/cli/commands/react-command.js.map +1 -1
- package/dist/presentation/cli/commands/review-command.d.ts +14 -0
- package/dist/presentation/cli/commands/review-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/review-command.js +22 -0
- package/dist/presentation/cli/commands/review-command.js.map +1 -0
- package/dist/presentation/cli/commands/run-command.d.ts +15 -0
- package/dist/presentation/cli/commands/run-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/run-command.js +29 -0
- package/dist/presentation/cli/commands/run-command.js.map +1 -0
- package/dist/presentation/cli/commands/smart-command.d.ts +3 -1
- package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/smart-command.js +92 -6
- package/dist/presentation/cli/commands/smart-command.js.map +1 -1
- package/dist/presentation/cli/commands/status-command.d.ts +11 -0
- package/dist/presentation/cli/commands/status-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/status-command.js +176 -0
- package/dist/presentation/cli/commands/status-command.js.map +1 -0
- package/dist/presentation/cli/commands/suggest-command.d.ts +13 -0
- package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/suggest-command.js +25 -0
- package/dist/presentation/cli/commands/suggest-command.js.map +1 -0
- package/dist/presentation/cli/error-display.d.ts.map +1 -1
- package/dist/presentation/cli/error-display.js +43 -0
- package/dist/presentation/cli/error-display.js.map +1 -1
- package/dist/session.js +19 -2
- package/dist/session.js.map +1 -1
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +8 -5
- package/dist/ui.js.map +1 -1
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# codehere
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> A governed, measurable AI coding OS that plans, edits, validates, and measures its own reliability. Every change is traceable, reviewable, and scored β so you can trust it on real code.
|
|
4
|
+
|
|
5
|
+
Codehere is a multi-agent coding system designed for solo developers and small teams. Unlike simple AI assistants, Codehere orchestrates specialized agents (Planning, Execution, Validation) to handle complex tasks while maintaining full transparency and control through review gates and trust metrics.
|
|
6
|
+
|
|
7
|
+
**π [Documentation β](docs/OVERVIEW.md)** | **πΊοΈ [Roadmap β](docs/ROADMAP.md)**
|
|
4
8
|
|
|
5
9
|
[](https://www.typescriptlang.org/)
|
|
6
10
|
[](https://nodejs.org/)
|
|
@@ -50,19 +54,62 @@ codehere index
|
|
|
50
54
|
codehere "How does authentication work?"
|
|
51
55
|
```
|
|
52
56
|
|
|
57
|
+
### Switching Providers
|
|
58
|
+
|
|
59
|
+
Codehere supports multiple AI providers. By default, it uses **Cohere** (no configuration needed).
|
|
60
|
+
|
|
61
|
+
**Quick Options:**
|
|
62
|
+
|
|
63
|
+
**Default (Cohere):**
|
|
64
|
+
```bash
|
|
65
|
+
export COHERE_API_KEY=your-key
|
|
66
|
+
codehere status
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**OpenAI:**
|
|
70
|
+
```bash
|
|
71
|
+
export CODEHERE_AI_PROVIDER=openai
|
|
72
|
+
export CODEHERE_OPENAI_API_KEY=sk-...
|
|
73
|
+
codehere status
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Local LLM (Ollama, LM Studio):**
|
|
77
|
+
```bash
|
|
78
|
+
export CODEHERE_AI_PROVIDER=local
|
|
79
|
+
export CODEHERE_LOCAL_BASE_URL=http://localhost:11434
|
|
80
|
+
codehere status
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Fake Mode (Testing/Demo):**
|
|
84
|
+
```bash
|
|
85
|
+
export CODEHERE_FAKE_AI=1
|
|
86
|
+
codehere status # No API calls, deterministic outputs
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Per-Operation Routing:**
|
|
90
|
+
|
|
91
|
+
Create `.codehere/providers.json` to route different operations to different providers. See [docs/PROVIDERS_QUICKSTART.md](docs/PROVIDERS_QUICKSTART.md) for complete setup guide.
|
|
92
|
+
|
|
93
|
+
**π [Complete Provider Guide β](docs/PROVIDERS_QUICKSTART.md)**
|
|
94
|
+
|
|
53
95
|
**Using Codehere:**
|
|
54
96
|
|
|
55
97
|
```bash
|
|
56
98
|
# Natural language queries (unified command)
|
|
57
99
|
codehere "explain this function"
|
|
58
|
-
codehere "add error handling to src/utils.ts"
|
|
59
|
-
codehere "refactor user service to use dependency injection"
|
|
100
|
+
codehere "add error handling to src/utils.ts" --review
|
|
101
|
+
codehere "refactor user service to use dependency injection" --review
|
|
60
102
|
|
|
61
103
|
# Or use explicit commands
|
|
62
104
|
codehere ask "How does authentication work?"
|
|
63
105
|
codehere explain src/utils.ts
|
|
64
106
|
codehere plan "implement user authentication system"
|
|
65
|
-
codehere orchestrate "add comprehensive logging"
|
|
107
|
+
codehere orchestrate "add comprehensive logging" --review
|
|
108
|
+
|
|
109
|
+
# Validation Mode: Review before applying changes
|
|
110
|
+
codehere fix src/utils.ts "Add error handling" --review
|
|
111
|
+
codehere orchestrate "Add authentication" --review
|
|
112
|
+
codehere plan "Refactor to DI" --execute --review
|
|
66
113
|
|
|
67
114
|
# Manage configuration
|
|
68
115
|
codehere config # Show current configuration
|
|
@@ -74,57 +121,177 @@ codehere --help
|
|
|
74
121
|
codehere help <command>
|
|
75
122
|
```
|
|
76
123
|
|
|
124
|
+
> **π‘ Tip**: Use `--review` on destructive operations (edit, orchestrate, plan --execute) to see summaries and approve changes before they're applied. This builds trust and prevents mistakes.
|
|
125
|
+
|
|
126
|
+
### π Validation Mode & Trust Scores
|
|
127
|
+
|
|
128
|
+
Validation Mode makes every agent operation traceable, reviewable, and measurable. Use `--review` to pause before applying changes, review structured summaries, and approve or reject. Every operation generates feedback that feeds into trust scores.
|
|
129
|
+
|
|
130
|
+
**How it works:**
|
|
131
|
+
- Run commands with `--review` to enable feedback capture
|
|
132
|
+
- Review summaries show files changed, validation checks, and risk assessment
|
|
133
|
+
- Feedback is stored locally in `data/feedback/agent-feedback.jsonl`
|
|
134
|
+
- Trust scores are computed per agent: `(approved_success_runs / total_runs) Γ 100`
|
|
135
|
+
|
|
136
|
+
**Example:**
|
|
137
|
+
```bash
|
|
138
|
+
# Enable review & feedback capture
|
|
139
|
+
CODEHERE_AUTO_APPROVE=true codehere fix src/file.ts "add input validation" --review
|
|
140
|
+
|
|
141
|
+
# View trust scores
|
|
142
|
+
npm run analyze:feedback
|
|
143
|
+
codehere status
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Optional:** Configure minimum trust thresholds via `config/trust-config.json` to highlight agents that need more validation (warnings only, non-blocking).
|
|
147
|
+
|
|
148
|
+
**For CI/dashboards:** Export trust and feedback stats as JSON:
|
|
149
|
+
- `npm run analyze:feedback -- --json`
|
|
150
|
+
- `codehere status --json`
|
|
151
|
+
|
|
152
|
+
**For CI gates:** Enforce minimum trust scores:
|
|
153
|
+
- `npm run check:trust` - Fails if any agent is below its configured threshold
|
|
154
|
+
|
|
155
|
+
**π [Complete Guide β](docs/VALIDATION_MODE.md)**
|
|
156
|
+
|
|
157
|
+
### π¬ Feedback Collection
|
|
158
|
+
|
|
159
|
+
Codehere collects feedback after operations to improve responses. In interactive mode, you'll see a prompt asking for feedback. In non-interactive mode (scripts, CI), you can provide feedback via environment variables:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Positive feedback (thumbs up)
|
|
163
|
+
CODEHERE_FEEDBACK=y codehere ask "What is main?"
|
|
164
|
+
|
|
165
|
+
# Negative feedback (thumbs down)
|
|
166
|
+
CODEHERE_FEEDBACK=n codehere ask "What is main?"
|
|
167
|
+
|
|
168
|
+
# Request refinement with message
|
|
169
|
+
CODEHERE_FEEDBACK=r CODEHERE_FEEDBACK_MESSAGE="Add more examples" codehere ask "What is main?"
|
|
170
|
+
|
|
171
|
+
# Alternative values
|
|
172
|
+
CODEHERE_FEEDBACK=positive codehere ask "What is main?"
|
|
173
|
+
CODEHERE_FEEDBACK=negative codehere ask "What is main?"
|
|
174
|
+
CODEHERE_FEEDBACK=yes codehere ask "What is main?"
|
|
175
|
+
CODEHERE_FEEDBACK=no codehere ask "What is main?"
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**Environment Variables:**
|
|
179
|
+
- `CODEHERE_FEEDBACK`: `y`/`yes`/`positive` (thumbs up), `n`/`no`/`negative` (thumbs down), `r`/`refine`/`refinement` (request refinement)
|
|
180
|
+
- `CODEHERE_FEEDBACK_MESSAGE`: Optional message for refinement requests
|
|
181
|
+
|
|
77
182
|
## β¨ Features
|
|
78
183
|
|
|
79
|
-
###
|
|
80
|
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
184
|
+
### π― Why Codehere vs Other Coding Agents?
|
|
185
|
+
|
|
186
|
+
- **Explicit Review Gates**: Unlike agents that apply changes immediately, Codehere uses `--review` to pause, show summaries, and request approval before modifying files
|
|
187
|
+
- **Trust Scores & Analytics**: Every agent run is scored. Run `npm run analyze:feedback` to see which agents are most reliable in your workflow
|
|
188
|
+
- **Full Traceability**: Every operation generates a structured TraceSummary showing files changed, reasoning steps, validation checks, and risk assessment
|
|
189
|
+
- **Governed Multi-Agent System**: Specialized agents (Planning, Execution, Validation) work together with full instrumentation β not a black box
|
|
190
|
+
- **Privacy-First Feedback**: All feedback stored locally in JSONL. No telemetry. Opt-out available. Your data stays yours
|
|
191
|
+
|
|
192
|
+
### π€ Multi-Agent Orchestration
|
|
193
|
+
|
|
194
|
+
- **Planning Agent**: Breaks complex tasks into hierarchical sub-plans with risk assessment
|
|
195
|
+
- **Execution Agent**: Executes plans step-by-step, tracks file changes, handles rollbacks
|
|
196
|
+
- **Validation Agent**: Runs compilation checks, tests, and quality analysis before completion
|
|
197
|
+
- **Intelligent Router**: Automatically selects the right workflow (simple, ReAct, or multi-agent) based on query complexity
|
|
198
|
+
- **Multi-Agent Orchestrator**: Coordinates all agents, aggregates summaries, provides unified traceability
|
|
199
|
+
|
|
200
|
+
### π‘οΈ Validation Mode & Review Gates
|
|
201
|
+
|
|
202
|
+
- **`--review` Flag**: Pause before applying changes, review structured summaries, approve or reject
|
|
203
|
+
- **TraceSummary Generation**: Every agent run produces a detailed summary (files, steps, checks, metrics, risk)
|
|
204
|
+
- **Composite Summaries**: Multi-agent operations merge all agent summaries into one reviewable report
|
|
205
|
+
- **Risk Assessment**: Automatic risk level calculation (low/medium/high/critical) with clear reasons
|
|
206
|
+
- **Environment Controls**: `CODEHERE_AUTO_APPROVE=true` for CI/CD, `CODEHERE_FEEDBACK_OPT_OUT=true` for privacy
|
|
207
|
+
|
|
208
|
+
### π Trust & Reliability Metrics
|
|
83
209
|
|
|
84
|
-
|
|
210
|
+
- **Agent Feedback Analytics**: Run `npm run analyze:feedback` to see trust scores, success rates, and operation breakdowns
|
|
211
|
+
- **Trust Score Calculation**: `(approved_success_runs / total_runs) Γ 100` β measurable agent reliability
|
|
212
|
+
- **Outcome Tracking**: Success, failure, partial_success, cancelled, error β complete visibility
|
|
213
|
+
- **User Action Tracking**: Approved, rejected, modified β understand how users interact with agents
|
|
214
|
+
|
|
215
|
+
### π§ Semantic Code Search & Context
|
|
216
|
+
|
|
217
|
+
- Builds local embedding index using Cohere's embedding API
|
|
218
|
+
- Enhanced context with file relationships and dependencies (15+ chunks)
|
|
85
219
|
- Context-aware responses using retrieved code
|
|
86
|
-
- Natural language code explanations
|
|
87
|
-
|
|
88
|
-
|
|
220
|
+
- Natural language code explanations and intelligent editing
|
|
221
|
+
|
|
222
|
+
### π Security & Privacy
|
|
89
223
|
|
|
90
|
-
|
|
91
|
-
- **
|
|
92
|
-
- **
|
|
93
|
-
- **
|
|
94
|
-
- **
|
|
224
|
+
- **Local-first**: All embeddings and feedback stored locally in SQLite
|
|
225
|
+
- **No code transmission**: Only chunks sent to API for embedding, never full files
|
|
226
|
+
- **Audit trail**: Complete JSONL logging of all operations
|
|
227
|
+
- **Policy enforcement**: Line limits, restricted folders, single-file safety checks
|
|
228
|
+
- **Privacy controls**: Opt-out available, anonymization by default
|
|
95
229
|
|
|
96
230
|
### π§ Enterprise Reliability
|
|
97
|
-
- **Automatic error recovery** - Retry with exponential backoff
|
|
98
|
-
- **Circuit breaker** - Protects against API failures
|
|
99
|
-
- **Health monitoring** - System health checks and metrics
|
|
100
|
-
- **24/7 operation ready** - Robust error handling
|
|
101
231
|
|
|
102
|
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
- Comprehensive error handling
|
|
232
|
+
- **Automatic error recovery**: Retry with exponential backoff
|
|
233
|
+
- **Circuit breaker**: Protects against API failures
|
|
234
|
+
- **Health monitoring**: System health checks and metrics
|
|
235
|
+
- **24/7 operation ready**: Robust error handling and graceful degradation
|
|
107
236
|
|
|
108
237
|
## ποΈ Architecture
|
|
109
238
|
|
|
239
|
+
### Multi-Agent System
|
|
240
|
+
|
|
110
241
|
```
|
|
111
|
-
|
|
112
|
-
β
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
242
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
243
|
+
β Intelligent Router β
|
|
244
|
+
β (Routes queries to appropriate workflow) β
|
|
245
|
+
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
|
|
246
|
+
β
|
|
247
|
+
βββββββββββββΌββββββββββββ
|
|
248
|
+
β β β
|
|
249
|
+
βββββΌββββ βββββΌβββββ βββββΌβββββββββββββββ
|
|
250
|
+
β Simpleβ β ReAct β β Multi-Agent β
|
|
251
|
+
β Work β β Agent β β Orchestrator β
|
|
252
|
+
βββββββββ ββββββββββ ββββββββ¬ββββββββββββ
|
|
253
|
+
β
|
|
254
|
+
ββββββββββββΌβββββββββββ
|
|
255
|
+
β β β
|
|
256
|
+
βββββββββΌβββ βββββΌβββββββ ββΌβββββββββββββ
|
|
257
|
+
β Planning β βExecution β β Validation β
|
|
258
|
+
β Agent ββ β Agent ββ β Agent β
|
|
259
|
+
ββββββββββββ ββββββββββββ βββββββββββββββ
|
|
260
|
+
β β β
|
|
261
|
+
ββββββββββββΌβββββββββββ
|
|
262
|
+
β
|
|
263
|
+
ββββββββββββΌβββββββββββ
|
|
264
|
+
β Composite Summary β
|
|
265
|
+
β + Review Gate β
|
|
266
|
+
β + AgentFeedback β
|
|
267
|
+
βββββββββββββββββββββββ
|
|
120
268
|
```
|
|
121
269
|
|
|
270
|
+
### Core Components
|
|
271
|
+
|
|
272
|
+
- **Intelligent Router**: Analyzes query intent, selects optimal workflow
|
|
273
|
+
- **Planning Agent**: Creates hierarchical plans with risk assessment
|
|
274
|
+
- **Execution Agent**: Executes plans, tracks changes, handles rollbacks
|
|
275
|
+
- **Validation Agent**: Compiles, tests, analyzes quality
|
|
276
|
+
- **Multi-Agent Orchestrator**: Coordinates all agents, creates unified run context
|
|
277
|
+
- **Validation Layer**: TraceSummary generation, AgentFeedback recording, review handler
|
|
278
|
+
|
|
279
|
+
### Data Flow
|
|
280
|
+
|
|
281
|
+
1. **Query** β Router determines intent
|
|
282
|
+
2. **Planning** β Agent creates plan with complexity tracking
|
|
283
|
+
3. **Execution** β Agent executes with file change tracking
|
|
284
|
+
4. **Validation** β Agent runs checks with pass/fail tracking
|
|
285
|
+
5. **Summary** β Composite summary aggregated from all agents
|
|
286
|
+
6. **Review** β User reviews summary, approves/rejects
|
|
287
|
+
7. **Feedback** β Outcome recorded to local JSONL, trust scores updated
|
|
288
|
+
|
|
122
289
|
**Tech Stack:**
|
|
123
290
|
- **TypeScript** - Type-safe development
|
|
124
|
-
- **Cohere AI** - Embeddings
|
|
125
|
-
- **
|
|
291
|
+
- **Cohere AI** - Embeddings, chat completion, reranking
|
|
292
|
+
- **SQLite** - Local vector storage and feedback persistence
|
|
126
293
|
- **Commander.js** - CLI interface
|
|
127
|
-
- **
|
|
294
|
+
- **Clean Architecture** - Domain, application, infrastructure layers
|
|
128
295
|
|
|
129
296
|
## π Performance
|
|
130
297
|
|
|
@@ -133,12 +300,26 @@ codehere help <command>
|
|
|
133
300
|
- **Chat:** ~2-5 seconds per query
|
|
134
301
|
- **Storage:** ~13KB per chunk (1024-dim embeddings)
|
|
135
302
|
|
|
303
|
+
## π― Trust & Reliability Dashboard
|
|
304
|
+
|
|
305
|
+
Codehere measures and reports its own reliability. Every operation with `--review` generates feedback that feeds into trust scores.
|
|
306
|
+
|
|
307
|
+
### Run Analytics
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
npm run analyze:feedback
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Shows trust scores per agent, success rates, and operation breakdowns. See `docs/VALIDATION_MODE_USAGE_GUIDE.md` for details.
|
|
314
|
+
|
|
136
315
|
## π Security & Privacy
|
|
137
316
|
|
|
138
|
-
- **Local-first:** All embeddings stored locally in SQLite
|
|
139
|
-
- **No code transmission:** Only chunks sent to API for embedding
|
|
140
|
-
- **
|
|
141
|
-
- **
|
|
317
|
+
- **Local-first storage:** All embeddings and feedback stored locally in SQLite β nothing leaves your machine
|
|
318
|
+
- **No code transmission:** Only chunks sent to API for embedding, never full files
|
|
319
|
+
- **Privacy-first feedback:** All AgentFeedback stored locally in `data/feedback/agent-feedback.jsonl`. No telemetry. Opt out with `CODEHERE_FEEDBACK_OPT_OUT=true`
|
|
320
|
+
- **Audit trail:** Complete JSONL logging of all operations with full traceability
|
|
321
|
+
- **Policy enforcement:** Line limits, restricted folders, single-file safety checks
|
|
322
|
+
- **Review gates:** Explicit approval required before applying destructive changes
|
|
142
323
|
|
|
143
324
|
## π Use Cases
|
|
144
325
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application Agent: Documentation Agent
|
|
3
|
+
* Generates and maintains documentation (README, API docs)
|
|
4
|
+
*/
|
|
5
|
+
import type { IAIService } from '../../domain/interfaces/ai-service.interface.js';
|
|
6
|
+
import type { MemoryStreamService } from '../../infrastructure/storage/memory-stream-service.js';
|
|
7
|
+
import type { IAgent } from '../../domain/interfaces/agent.interface.js';
|
|
8
|
+
import type { DocumentationRequest, DocumentationResponse } from '../../domain/entities/documentation.js';
|
|
9
|
+
export declare class DocumentationAgent implements IAgent<DocumentationRequest, DocumentationResponse> {
|
|
10
|
+
private aiService;
|
|
11
|
+
private memoryStream?;
|
|
12
|
+
private cwd;
|
|
13
|
+
name: string;
|
|
14
|
+
type: "non-engineering";
|
|
15
|
+
constructor(aiService: IAIService, memoryStream?: MemoryStreamService | undefined, cwd?: string);
|
|
16
|
+
execute(request: DocumentationRequest): Promise<DocumentationResponse>;
|
|
17
|
+
private generateREADME;
|
|
18
|
+
private generateAPIDocs;
|
|
19
|
+
private analyzeFolderStructure;
|
|
20
|
+
private findSourceFiles;
|
|
21
|
+
private buildReadmePrompt;
|
|
22
|
+
private buildAPIDocsContent;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=documentation-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentation-agent.d.ts","sourceRoot":"","sources":["../../../src/application/agents/documentation-agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AACjG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,wCAAwC,CAAC;AAOhD,qBAAa,kBAAmB,YAAW,MAAM,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;IAK1F,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,YAAY,CAAC;IACrB,OAAO,CAAC,GAAG;IANb,IAAI,SAAyB;IAC7B,IAAI,EAAG,iBAAiB,CAAU;gBAGxB,SAAS,EAAE,UAAU,EACrB,YAAY,CAAC,EAAE,mBAAmB,YAAA,EAClC,GAAG,GAAE,MAAsB;IAG/B,OAAO,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;YAuD9D,cAAc;YA2Gd,eAAe;IAgG7B,OAAO,CAAC,sBAAsB;IAwC9B,OAAO,CAAC,eAAe;IA8BvB,OAAO,CAAC,iBAAiB;YA2BX,mBAAmB;CA6DlC"}
|