Repository navigation
Expand file tree
/
Copy pathagent_capability_composition_root.ts
More file actions
42 lines (36 loc) · 1.75 KB
/
Copy pathagent_capability_composition_root.ts
File metadata and controls
42 lines (36 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import type { FindingsQueryPort } from '../../application/ports/agent_findings_ports';
import type { FixerQueryPort } from '../../application/ports/agent_fixer_ports';
import type { LanguageQueryPort } from '../../application/ports/agent_language_ports';
import type { AgentCliPort } from '../agents/ports/agent_provider_ports';
import { AgentCliClient } from '../../data/repository/agent_cli_client';
import { AgentExecutionPlanner } from '../agents/agent_execution_planner';
import { LoggerAgentExecutionObserverAdapter } from '../logging/logger_agent_execution_observer_adapter';
import { FindingsAgentAdapter } from '../../data/repository/ai/findings_agent_adapter';
import { FixerAgentAdapter } from '../../data/repository/ai/fixer_agent_adapter';
import { LanguageAgentAdapter } from '../../data/repository/ai/language_agent_adapter';
export interface AgentCapabilityCompositionInfrastructure {
readonly cli: AgentCliPort;
}
function defaultInfrastructure(): AgentCapabilityCompositionInfrastructure {
return {
cli: new AgentCliClient(
new AgentExecutionPlanner(),
new LoggerAgentExecutionObserverAdapter(),
),
};
}
export function createFindingsQueryPort(
infrastructure: AgentCapabilityCompositionInfrastructure = defaultInfrastructure(),
): FindingsQueryPort {
return new FindingsAgentAdapter(infrastructure);
}
export function createFixerQueryPort(
infrastructure: AgentCapabilityCompositionInfrastructure = defaultInfrastructure(),
): FixerQueryPort {
return new FixerAgentAdapter(infrastructure);
}
export function createLanguageQueryPort(
infrastructure: AgentCapabilityCompositionInfrastructure = defaultInfrastructure(),
): LanguageQueryPort {
return new LanguageAgentAdapter(infrastructure);
}