Consolidate the prepare and base-action phases into a single composite step that runs src/entrypoints/run.ts. This simplifies the action.yml from multiple steps to one execution step, while keeping the same behavior. Key changes: - Add src/entrypoints/run.ts as unified entrypoint - Simplify action.yml to single 'Run Claude Code Action' step - Pass all inputs via environment variables - Update base-action to accept inputs via env vars - Support agent mode auto-detection from prompt input
26 lines
702 B
TypeScript
26 lines
702 B
TypeScript
import { runClaudeWithSdk } from "./run-claude-sdk";
|
|
import type { ClaudeRunResult } from "./run-claude-sdk";
|
|
import { parseSdkOptions } from "./parse-sdk-options";
|
|
|
|
export type ClaudeOptions = {
|
|
claudeArgs?: string;
|
|
model?: string;
|
|
pathToClaudeCodeExecutable?: string;
|
|
allowedTools?: string;
|
|
disallowedTools?: string;
|
|
maxTurns?: string;
|
|
mcpConfig?: string;
|
|
systemPrompt?: string;
|
|
appendSystemPrompt?: string;
|
|
fallbackModel?: string;
|
|
showFullOutput?: string;
|
|
};
|
|
|
|
export async function runClaude(
|
|
promptPath: string,
|
|
options: ClaudeOptions,
|
|
): Promise<ClaudeRunResult> {
|
|
const parsedOptions = parseSdkOptions(options);
|
|
return runClaudeWithSdk(promptPath, parsedOptions);
|
|
}
|