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.
Potentially problematic release.
This version of codehere might be problematic. Click here for more details.
- 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
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider Layer: Provider Config Loader
|
|
3
|
+
* Loads user-facing provider configuration from JSON files
|
|
4
|
+
*
|
|
5
|
+
* Phase 4G: User-facing provider config files
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync, readFileSync } from 'fs';
|
|
8
|
+
import { join, resolve } from 'path';
|
|
9
|
+
import { findCodebaseRoot } from '../../domain/services/codebase-detector.js';
|
|
10
|
+
/**
|
|
11
|
+
* Load provider configuration from file
|
|
12
|
+
*
|
|
13
|
+
* @param options - Optional configuration
|
|
14
|
+
* @param options.cwd - Working directory (defaults to process.cwd())
|
|
15
|
+
* @returns ProviderConfig if file exists and is valid, undefined otherwise
|
|
16
|
+
*/
|
|
17
|
+
export function loadProviderConfig(options) {
|
|
18
|
+
const cwd = options?.cwd || process.cwd();
|
|
19
|
+
// Determine config file path
|
|
20
|
+
let configPath;
|
|
21
|
+
// Check for explicit path override
|
|
22
|
+
if (process.env.CODEHERE_PROVIDER_CONFIG_PATH) {
|
|
23
|
+
configPath = resolve(process.env.CODEHERE_PROVIDER_CONFIG_PATH);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
// Find codebase root
|
|
27
|
+
const codebaseInfo = findCodebaseRoot(cwd);
|
|
28
|
+
if (codebaseInfo) {
|
|
29
|
+
// Default path: .codehere/providers.json
|
|
30
|
+
configPath = join(codebaseInfo.rootPath, '.codehere', 'providers.json');
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
// Fallback to cwd if codebase root not found
|
|
34
|
+
configPath = join(cwd, '.codehere', 'providers.json');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// If file doesn't exist, return undefined (not an error)
|
|
38
|
+
if (!configPath || !existsSync(configPath)) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
// Read and parse JSON
|
|
43
|
+
const fileContent = readFileSync(configPath, 'utf-8');
|
|
44
|
+
const rawConfig = JSON.parse(fileContent);
|
|
45
|
+
// Validate and normalize config
|
|
46
|
+
return validateAndNormalizeConfig(rawConfig);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
// Log warning but don't throw (non-fatal)
|
|
50
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
51
|
+
console.warn(`[ProviderConfigLoader] Failed to load config from ${configPath}: ${errorMessage}`);
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Validate and normalize raw config object
|
|
57
|
+
* Ignores unknown fields and invalid values gracefully
|
|
58
|
+
*/
|
|
59
|
+
function validateAndNormalizeConfig(raw) {
|
|
60
|
+
if (!raw || typeof raw !== 'object') {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
const config = {};
|
|
64
|
+
const obj = raw;
|
|
65
|
+
// Extract default provider
|
|
66
|
+
if (obj.default !== undefined) {
|
|
67
|
+
if (typeof obj.default === 'string' && obj.default.trim()) {
|
|
68
|
+
config.default = obj.default.trim();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Extract operations
|
|
72
|
+
if (obj.operations !== undefined && typeof obj.operations === 'object' && obj.operations !== null) {
|
|
73
|
+
const operations = obj.operations;
|
|
74
|
+
const normalizedOps = {};
|
|
75
|
+
// Known operation types
|
|
76
|
+
const validOperations = ['chat', 'embedding', 'rerank'];
|
|
77
|
+
for (const op of validOperations) {
|
|
78
|
+
if (operations[op] !== undefined) {
|
|
79
|
+
const providerId = operations[op];
|
|
80
|
+
if (typeof providerId === 'string' && providerId.trim()) {
|
|
81
|
+
normalizedOps[op] = providerId.trim();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// Only set operations if at least one is valid
|
|
86
|
+
if (Object.keys(normalizedOps).length > 0) {
|
|
87
|
+
config.operations = normalizedOps;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Return config only if it has at least one meaningful field
|
|
91
|
+
if (config.default || config.operations) {
|
|
92
|
+
return config;
|
|
93
|
+
}
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Convert ProviderConfig to OperationProviderConfig
|
|
98
|
+
* Used to pass config to OperationProviderResolver
|
|
99
|
+
*/
|
|
100
|
+
export function configToOperationConfig(config) {
|
|
101
|
+
const operationConfig = {};
|
|
102
|
+
// Set default if present
|
|
103
|
+
if (config.default) {
|
|
104
|
+
operationConfig.default = config.default;
|
|
105
|
+
}
|
|
106
|
+
// Map operations
|
|
107
|
+
if (config.operations) {
|
|
108
|
+
if (config.operations.chat) {
|
|
109
|
+
operationConfig.chat = config.operations.chat;
|
|
110
|
+
}
|
|
111
|
+
if (config.operations.embedding) {
|
|
112
|
+
operationConfig.embedding = config.operations.embedding;
|
|
113
|
+
}
|
|
114
|
+
if (config.operations.rerank) {
|
|
115
|
+
operationConfig.rerank = config.operations.rerank;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return operationConfig;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=provider-config-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-config-loader.js","sourceRoot":"","sources":["../../../src/infrastructure/providers/provider-config-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAmB9E;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAA0B;IAC3D,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAE1C,6BAA6B;IAC7B,IAAI,UAA8B,CAAC;IAEnC,mCAAmC;IACnC,IAAI,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,CAAC;QAC9C,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAClE,CAAC;SAAM,CAAC;QACN,qBAAqB;QACrB,MAAM,Y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,MAAM,UAAU,uBAAuB,CAAC,MAAsB;IAC5D,MAAM,eAAe,GAA4B,EAAE,CAAC;IAEpD,yBAAyB;IACzB,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,eAAe,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC3C,CAAC;IAED,iBAAiB;IACjB,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YAC3B,eAAe,CAAC,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC;QAChD,CAAC;QACD,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;YAChC,eAAe,CAAC,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC;QAC1D,CAAC;QACD,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YAC7B,eAAe,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC;QACpD,CAAC;IACH,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider Layer: ProviderRegistry
|
|
3
|
+
* Central registry for all model providers
|
|
4
|
+
*
|
|
5
|
+
* Phase 4A: Foundation Implementation (No Behavior Change)
|
|
6
|
+
*/
|
|
7
|
+
import type { IModelProvider } from './model-provider.interface.js';
|
|
8
|
+
/**
|
|
9
|
+
* Provider Registry
|
|
10
|
+
* Singleton registry for managing model providers
|
|
11
|
+
*/
|
|
12
|
+
export declare class ProviderRegistry {
|
|
13
|
+
private static instance;
|
|
14
|
+
private providers;
|
|
15
|
+
private defaultProviderId?;
|
|
16
|
+
/**
|
|
17
|
+
* Get singleton instance
|
|
18
|
+
*/
|
|
19
|
+
static getInstance(): ProviderRegistry;
|
|
20
|
+
/**
|
|
21
|
+
* Register a provider
|
|
22
|
+
*/
|
|
23
|
+
register(provider: IModelProvider): void;
|
|
24
|
+
/**
|
|
25
|
+
* Get provider by ID
|
|
26
|
+
*/
|
|
27
|
+
get(providerId: string): IModelProvider | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Get default provider
|
|
30
|
+
*/
|
|
31
|
+
getDefault(): IModelProvider;
|
|
32
|
+
/**
|
|
33
|
+
* Set default provider
|
|
34
|
+
*/
|
|
35
|
+
setDefault(providerId: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Get all registered providers
|
|
38
|
+
*/
|
|
39
|
+
getAll(): IModelProvider[];
|
|
40
|
+
/**
|
|
41
|
+
* Find providers by capability
|
|
42
|
+
*/
|
|
43
|
+
findByCapability(capability: keyof import('./model-provider.interface.js').ProviderCapabilities): IModelProvider[];
|
|
44
|
+
/**
|
|
45
|
+
* Check if provider is registered
|
|
46
|
+
*/
|
|
47
|
+
has(providerId: string): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Clear all providers (mainly for testing)
|
|
50
|
+
*/
|
|
51
|
+
clear(): void;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=provider-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-registry.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/providers/provider-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAEpE;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiC;IACxD,OAAO,CAAC,SAAS,CAA0C;IAC3D,OAAO,CAAC,iBAAiB,CAAC,CAAS;IAEnC;;OAEG;IACH,MAAM,CAAC,WAAW,IAAI,gBAAgB;IAOtC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IASxC;;OAEG;IACH,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAInD;;OAEG;IACH,UAAU,IAAI,cAAc;IAW5B;;OAEG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAOpC;;OAEG;IACH,MAAM,IAAI,cAAc,EAAE;IAI1B;;OAEG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,OAAO,+BAA+B,EAAE,oBAAoB,GAAG,cAAc,EAAE;IAIlH;;OAEG;IACH,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAIhC;;OAEG;IACH,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider Layer: ProviderRegistry
|
|
3
|
+
* Central registry for all model providers
|
|
4
|
+
*
|
|
5
|
+
* Phase 4A: Foundation Implementation (No Behavior Change)
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Provider Registry
|
|
9
|
+
* Singleton registry for managing model providers
|
|
10
|
+
*/
|
|
11
|
+
export class ProviderRegistry {
|
|
12
|
+
static instance = null;
|
|
13
|
+
providers = new Map();
|
|
14
|
+
defaultProviderId;
|
|
15
|
+
/**
|
|
16
|
+
* Get singleton instance
|
|
17
|
+
*/
|
|
18
|
+
static getInstance() {
|
|
19
|
+
if (!ProviderRegistry.instance) {
|
|
20
|
+
ProviderRegistry.instance = new ProviderRegistry();
|
|
21
|
+
}
|
|
22
|
+
return ProviderRegistry.instance;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Register a provider
|
|
26
|
+
*/
|
|
27
|
+
register(provider) {
|
|
28
|
+
this.providers.set(provider.id, provider);
|
|
29
|
+
// Auto-set as default if this is the first provider
|
|
30
|
+
if (!this.defaultProviderId) {
|
|
31
|
+
this.defaultProviderId = provider.id;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get provider by ID
|
|
36
|
+
*/
|
|
37
|
+
get(providerId) {
|
|
38
|
+
return this.providers.get(providerId);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get default provider
|
|
42
|
+
*/
|
|
43
|
+
getDefault() {
|
|
44
|
+
if (!this.defaultProviderId) {
|
|
45
|
+
throw new Error('No default provider configured');
|
|
46
|
+
}
|
|
47
|
+
const provider = this.get(this.defaultProviderId);
|
|
48
|
+
if (!provider) {
|
|
49
|
+
throw new Error(`Default provider '${this.defaultProviderId}' not found`);
|
|
50
|
+
}
|
|
51
|
+
return provider;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Set default provider
|
|
55
|
+
*/
|
|
56
|
+
setDefault(providerId) {
|
|
57
|
+
if (!this.providers.has(providerId)) {
|
|
58
|
+
throw new Error(`Provider '${providerId}' not registered`);
|
|
59
|
+
}
|
|
60
|
+
this.defaultProviderId = providerId;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get all registered providers
|
|
64
|
+
*/
|
|
65
|
+
getAll() {
|
|
66
|
+
return Array.from(this.providers.values());
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Find providers by capability
|
|
70
|
+
*/
|
|
71
|
+
findByCapability(capability) {
|
|
72
|
+
return this.getAll().filter(p => p.capabilities[capability]);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Check if provider is registered
|
|
76
|
+
*/
|
|
77
|
+
has(providerId) {
|
|
78
|
+
return this.providers.has(providerId);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Clear all providers (mainly for testing)
|
|
82
|
+
*/
|
|
83
|
+
clear() {
|
|
84
|
+
this.providers.clear();
|
|
85
|
+
this.defaultProviderId = undefined;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=provider-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-registry.js","sourceRoot":"","sources":["../../../src/infrastructure/providers/provider-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;GAGG;AACH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AAM,IAAI,KAAK,CAAC,aAAa,UAAU,kBAAkB,CAAC,CAAC;QAC7D,CAAC;QACD,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,gBAAgB,CAAC,UAA8E;QAC7F,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,UAAkB;QACpB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;IACrC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infrastructure: Task Helpers
|
|
3
|
+
* Helper functions for creating and updating tasks (non-breaking)
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha
|
|
6
|
+
* See: docs/ARCHITECTURE/TASK_MODEL.md
|
|
7
|
+
*/
|
|
8
|
+
import { TaskStatus, ReviewStatus, type CodehereTask } from '../../domain/entities/task.js';
|
|
9
|
+
import type { CodebaseInfo } from '../../domain/services/codebase-detector.js';
|
|
10
|
+
/**
|
|
11
|
+
* Create task for plan command
|
|
12
|
+
* Non-breaking: silent failure, doesn't affect user workflow
|
|
13
|
+
*/
|
|
14
|
+
export declare function createPlanTask(options: {
|
|
15
|
+
goal: string;
|
|
16
|
+
plan: any;
|
|
17
|
+
codebaseInfo: CodebaseInfo | null;
|
|
18
|
+
runId: string;
|
|
19
|
+
}): Promise<string | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Create task for fix/run command
|
|
22
|
+
* Non-breaking: silent failure, doesn't affect user workflow
|
|
23
|
+
*/
|
|
24
|
+
export declare function createRunTask(options: {
|
|
25
|
+
goal: string;
|
|
26
|
+
filePath?: string;
|
|
27
|
+
codebaseInfo: CodebaseInfo | null;
|
|
28
|
+
runId: string;
|
|
29
|
+
files?: string[];
|
|
30
|
+
}): Promise<string | null>;
|
|
31
|
+
/**
|
|
32
|
+
* Update task status
|
|
33
|
+
* Non-breaking: silent failure
|
|
34
|
+
*/
|
|
35
|
+
export declare function updateTaskStatus(taskId: string | null, status: TaskStatus, updates?: Partial<CodehereTask>): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Update task with execution results
|
|
38
|
+
* Non-breaking: silent failure
|
|
39
|
+
*/
|
|
40
|
+
export declare function updateTaskWithResults(taskId: string | null, results: {
|
|
41
|
+
filesChanged?: string[];
|
|
42
|
+
filesCreated?: string[];
|
|
43
|
+
filesDeleted?: string[];
|
|
44
|
+
testResults?: any;
|
|
45
|
+
sastResults?: any;
|
|
46
|
+
error?: any;
|
|
47
|
+
status: TaskStatus;
|
|
48
|
+
executionCompletedAt?: number;
|
|
49
|
+
executionStartedAt?: number;
|
|
50
|
+
agentFeedbackId?: string;
|
|
51
|
+
traceSummaryId?: string;
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Update task review status
|
|
55
|
+
* Non-breaking: silent failure
|
|
56
|
+
*/
|
|
57
|
+
export declare function updateTaskReview(taskId: string | null, reviewStatus: ReviewStatus, reviewedBy?: string, comments?: string): Promise<void>;
|
|
58
|
+
//# sourceMappingURL=task-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-helpers.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/storage/task-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAY,UAAU,EAA6B,YAA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MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GACA,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,YAAY,EAAE,YAAY,EAC1B,UAAU,CAAC,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infrastructure: Task Helpers
|
|
3
|
+
* Helper functions for creating and updating tasks (non-breaking)
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha
|
|
6
|
+
* See: docs/ARCHITECTURE/TASK_MODEL.md
|
|
7
|
+
*/
|
|
8
|
+
import { getTaskRepository } from './task-repository.js';
|
|
9
|
+
import { TaskMode, TaskStatus, ReviewStatus } from '../../domain/entities/task.js';
|
|
10
|
+
import { getCurrentEnvironmentMode } from '../../domain/services/environment-mode-manager.js';
|
|
11
|
+
import { detectRiskTier, detectRiskTierFromPlan } from '../../domain/services/risk-tier-detector.js';
|
|
12
|
+
import { randomUUID } from 'crypto';
|
|
13
|
+
/**
|
|
14
|
+
* Create task for plan command
|
|
15
|
+
* Non-breaking: silent failure, doesn't affect user workflow
|
|
16
|
+
*/
|
|
17
|
+
export async function createPlanTask(options) {
|
|
18
|
+
const { goal, plan, codebaseInfo, runId } = options;
|
|
19
|
+
try {
|
|
20
|
+
const taskRepo = getTaskRepository();
|
|
21
|
+
const environment = getCurrentEnvironmentMode();
|
|
22
|
+
const riskTier = detectRiskTierFromPlan(plan);
|
|
23
|
+
const taskId = `task-${randomUUID()}`;
|
|
24
|
+
await taskRepo.create({
|
|
25
|
+
id: taskId,
|
|
26
|
+
createdAt: Date.now(),
|
|
27
|
+
updatedAt: Date.now(),
|
|
28
|
+
codebaseId: codebaseInfo?.codebaseId || codebaseInfo?.rootPath || process.cwd(),
|
|
29
|
+
cwd: process.cwd(),
|
|
30
|
+
mode: TaskMode.PLAN,
|
|
31
|
+
goal,
|
|
32
|
+
command: 'plan',
|
|
33
|
+
status: TaskStatus.PLANNED,
|
|
34
|
+
riskTier,
|
|
35
|
+
environment,
|
|
36
|
+
planId: plan.id,
|
|
37
|
+
plan: plan, // Store serialized plan
|
|
38
|
+
traceSummaryId: runId,
|
|
39
|
+
});
|
|
40
|
+
return taskId;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// Silent failure - task creation is optional
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Create task for fix/run command
|
|
49
|
+
* Non-breaking: silent failure, doesn't affect user workflow
|
|
50
|
+
*/
|
|
51
|
+
export async function createRunTask(options) {
|
|
52
|
+
const { goal, filePath, codebaseInfo, runId, files = [] } = options;
|
|
53
|
+
try {
|
|
54
|
+
const taskRepo = getTaskRepository();
|
|
55
|
+
const environment = getCurrentEnvironmentMode();
|
|
56
|
+
const riskTier = detectRiskTier(files);
|
|
57
|
+
const taskId = `task-${randomUUID()}`;
|
|
58
|
+
const fullGoal = filePath ? `${goal} (file: ${filePath})` : goal;
|
|
59
|
+
await taskRepo.create({
|
|
60
|
+
id: taskId,
|
|
61
|
+
createdAt: Date.now(),
|
|
62
|
+
updatedAt: Date.now(),
|
|
63
|
+
codebaseId: codebaseInfo?.codebaseId || codebaseInfo?.rootPath || process.cwd(),
|
|
64
|
+
cwd: process.cwd(),
|
|
65
|
+
mode: TaskMode.RUN,
|
|
66
|
+
goal: fullGoal,
|
|
67
|
+
command: filePath ? 'fix' : 'run',
|
|
68
|
+
status: TaskStatus.CREATED,
|
|
69
|
+
riskTier,
|
|
70
|
+
environment,
|
|
71
|
+
filesChanged: files.length > 0 ? files : undefined,
|
|
72
|
+
traceSummaryId: runId,
|
|
73
|
+
});
|
|
74
|
+
return taskId;
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// Silent failure - task creation is optional
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Update task status
|
|
83
|
+
* Non-breaking: silent failure
|
|
84
|
+
*/
|
|
85
|
+
export async function updateTaskStatus(taskId, status, updates) {
|
|
86
|
+
if (!taskId)
|
|
87
|
+
return;
|
|
88
|
+
try {
|
|
89
|
+
const taskRepo = getTaskRepository();
|
|
90
|
+
const existing = await taskRepo.getById(taskId);
|
|
91
|
+
if (!existing)
|
|
92
|
+
return;
|
|
93
|
+
await taskRepo.update({
|
|
94
|
+
...existing,
|
|
95
|
+
...updates,
|
|
96
|
+
status,
|
|
97
|
+
updatedAt: Date.now(),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
// Silent failure
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Update task with execution results
|
|
106
|
+
* Non-breaking: silent failure
|
|
107
|
+
*/
|
|
108
|
+
export async function updateTaskWithResults(taskId, results) {
|
|
109
|
+
if (!taskId)
|
|
110
|
+
return;
|
|
111
|
+
try {
|
|
112
|
+
const taskRepo = getTaskRepository();
|
|
113
|
+
const existing = await taskRepo.getById(taskId);
|
|
114
|
+
if (!existing)
|
|
115
|
+
return;
|
|
116
|
+
await taskRepo.update({
|
|
117
|
+
...existing,
|
|
118
|
+
...results,
|
|
119
|
+
updatedAt: Date.now(),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
// Silent failure
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Update task review status
|
|
128
|
+
* Non-breaking: silent failure
|
|
129
|
+
*/
|
|
130
|
+
export async function updateTaskReview(taskId, reviewStatus, reviewedBy, comments) {
|
|
131
|
+
if (!taskId)
|
|
132
|
+
return;
|
|
133
|
+
try {
|
|
134
|
+
const taskRepo = getTaskRepository();
|
|
135
|
+
const existing = await taskRepo.getById(taskId);
|
|
136
|
+
if (!existing)
|
|
137
|
+
return;
|
|
138
|
+
const newStatus = reviewStatus === ReviewStatus.APPROVED
|
|
139
|
+
? TaskStatus.APPROVED
|
|
140
|
+
: reviewStatus === ReviewStatus.REJECTED
|
|
141
|
+
? TaskStatus.REJECTED
|
|
142
|
+
: existing.status;
|
|
143
|
+
await taskRepo.update({
|
|
144
|
+
...existing,
|
|
145
|
+
reviewStatus,
|
|
146
|
+
reviewedAt: Date.now(),
|
|
147
|
+
reviewedBy,
|
|
148
|
+
reviewComments: comments,
|
|
149
|
+
status: newStatus,
|
|
150
|
+
updatedAt: Date.now(),
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
// Silent failure
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=task-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-helpers.js","sourceRoot":"","sources":["../../../src/infrastructure/storage/task-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA6B,YAAY,EAAqB,MAAM,+BAA+B,CAAC;AACjI,OAAO,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrG,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGpC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAKpC;IACC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAEpD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,iBAAiB,EAAE,CAAC;QACrC,MAAM,W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,QAAQ;YACxB,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,iBAAiB;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infrastructure: Task Repository
|
|
3
|
+
* Task storage and retrieval using JSONL format
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha
|
|
6
|
+
* See: docs/ARCHITECTURE/TASK_MODEL.md section 3
|
|
7
|
+
*/
|
|
8
|
+
import type { CodehereTask } from '../../domain/entities/task.js';
|
|
9
|
+
import { TaskStatus, TaskMode } from '../../domain/entities/task.js';
|
|
10
|
+
export interface TaskRepository {
|
|
11
|
+
create(task: CodehereTask): Promise<void>;
|
|
12
|
+
getById(id: string): Promise<CodehereTask | null>;
|
|
13
|
+
getByStatus(status: TaskStatus): Promise<CodehereTask[]>;
|
|
14
|
+
getByMode(mode: TaskMode): Promise<CodehereTask[]>;
|
|
15
|
+
getRecent(limit: number): Promise<CodehereTask[]>;
|
|
16
|
+
update(task: CodehereTask): Promise<void>;
|
|
17
|
+
getAll(): Promise<CodehereTask[]>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* JSONL-based task repository
|
|
21
|
+
* Stores tasks in .codehere/tasks.jsonl at codebase root
|
|
22
|
+
*/
|
|
23
|
+
export declare class JsonlTaskRepository implements TaskRepository {
|
|
24
|
+
private tasksPath;
|
|
25
|
+
private tasksCache;
|
|
26
|
+
private cacheLoaded;
|
|
27
|
+
constructor(customPath?: string);
|
|
28
|
+
/**
|
|
29
|
+
* Load tasks from JSONL file into cache
|
|
30
|
+
* For duplicate IDs, keeps the latest version (by updatedAt)
|
|
31
|
+
*/
|
|
32
|
+
private loadTasks;
|
|
33
|
+
/**
|
|
34
|
+
* Create a new task
|
|
35
|
+
*/
|
|
36
|
+
create(task: CodehereTask): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Get task by ID (returns latest version if multiple exist)
|
|
39
|
+
*/
|
|
40
|
+
getById(id: string): Promise<CodehereTask | null>;
|
|
41
|
+
/**
|
|
42
|
+
* Get tasks by status
|
|
43
|
+
*/
|
|
44
|
+
getByStatus(status: TaskStatus): Promise<CodehereTask[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Get tasks by mode
|
|
47
|
+
*/
|
|
48
|
+
getByMode(mode: TaskMode): Promise<CodehereTask[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Get recent tasks (latest updated first)
|
|
51
|
+
*/
|
|
52
|
+
getRecent(limit?: number): Promise<CodehereTask[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Get all tasks (latest version of each)
|
|
55
|
+
*/
|
|
56
|
+
getAll(): Promise<CodehereTask[]>;
|
|
57
|
+
/**
|
|
58
|
+
* Update existing task
|
|
59
|
+
* Creates a new entry in JSONL (append-only)
|
|
60
|
+
*/
|
|
61
|
+
update(task: CodehereTask): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get task repository instance
|
|
65
|
+
*/
|
|
66
|
+
export declare function getTaskRepository(customPath?: string): TaskRepository;
|
|
67
|
+
//# sourceMappingURL=task-repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-repository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/storage/task-repository.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAErE,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;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