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.)
16 lines
449 B
TypeScript
16 lines
449 B
TypeScript
import { exec } from "node:child_process";
|
|
import { promisify } from "node:util";
|
|
|
|
export const execAsync = promisify(exec);
|
|
|
|
/**
|
|
* Execute a shell command with optional environment variables
|
|
*/
|
|
export async function executeCommand(
|
|
command: string,
|
|
env?: Record<string, string>
|
|
): Promise<{ stdout: string; stderr: string }> {
|
|
const execEnv = env ? { ...process.env, ...env } : process.env;
|
|
return execAsync(command, { env: execEnv });
|
|
}
|