1abbd7ff41
- Created extensible agent interface with install() and execute() methods - Moved Claude Code logic to agents/claude.ts implementing Agent interface - Added utilities directory for reusable functions (exec, files) - Refactored index.ts to be minimal (35 lines) using agent abstraction - Made anthropic_api_key optional in action.yml - Updated Node.js imports to use node: prefix convention - Bumped version to 0.0.5 - Architecture now supports multiple agents (OpenAI, Gemini, etc.)
17 lines
402 B
TypeScript
17 lines
402 B
TypeScript
import { ClaudeAgent } from "./claude";
|
|
import type { Agent, AgentConfig } from "./types";
|
|
|
|
export type AgentType = "claude";
|
|
|
|
/**
|
|
* Factory for creating agent instances
|
|
*/
|
|
export function createAgent(type: AgentType, config: AgentConfig): Agent {
|
|
switch (type) {
|
|
case "claude":
|
|
return new ClaudeAgent(config);
|
|
default:
|
|
throw new Error(`Unsupported agent type: ${type}`);
|
|
}
|
|
}
|