From a05829f78160478db8dc06558a61be481f9c33c6 Mon Sep 17 00:00:00 2001 From: David Blass Date: Tue, 14 Oct 2025 14:58:46 -0400 Subject: [PATCH] fix type errors --- fixtures/basic.ts | 14 +++++--------- index.ts | 2 +- main.ts | 8 ++++---- play.ts | 4 ++-- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/fixtures/basic.ts b/fixtures/basic.ts index 27e12c6..6479ced 100644 --- a/fixtures/basic.ts +++ b/fixtures/basic.ts @@ -1,13 +1,9 @@ -import type { MainParams } from "../main.ts"; +import type { Inputs } from "../main.ts"; const testParams = { - inputs: { - prompt: - "List all files in the current directory, then create a file called dynamic-test.txt with the content 'This was loaded from a TypeScript file!', then delete it.", - anthropic_api_key: "sk-test-key", - }, - env: {}, - cwd: process.cwd(), -} satisfies MainParams; + prompt: + "List all files in the current directory, then create a file called dynamic-test.txt with the content 'This was loaded from a TypeScript file!', then delete it.", + anthropic_api_key: "sk-test-key", +} satisfies Inputs; export default testParams; diff --git a/index.ts b/index.ts index be8cd04..044ac94 100644 --- a/index.ts +++ b/index.ts @@ -6,7 +6,7 @@ export { ClaudeAgent } from "./agents/claude.ts"; export type { Agent, AgentConfig, AgentResult } from "./agents/types.ts"; export { - type ActionInputs as ExecutionInputs, + type Inputs as ExecutionInputs, type MainResult, main, } from "./main.ts"; diff --git a/main.ts b/main.ts index c8e3d26..40133fb 100644 --- a/main.ts +++ b/main.ts @@ -8,7 +8,7 @@ export const Inputs = type({ "anthropic_api_key?": "string | undefined", }); -export type ActionInputs = typeof Inputs.infer; +export type Inputs = typeof Inputs.infer; export interface MainResult { success: boolean; @@ -16,16 +16,16 @@ export interface MainResult { error?: string | undefined; } -export async function main(inputs: ActionInputs): Promise { +export async function main(inputs: Inputs): Promise { try { core.info(`→ Starting agent run with Claude Code`); // Setup GitHub installation token const githubInstallationToken = await setupGitHubInstallationToken(); - const agent = new ClaudeAgent({ + const agent = new ClaudeAgent({ apiKey: inputs.anthropic_api_key!, - githubInstallationToken + githubInstallationToken, }); await agent.install(); diff --git a/play.ts b/play.ts index 7b7b190..3e0784b 100644 --- a/play.ts +++ b/play.ts @@ -4,7 +4,7 @@ import { pathToFileURL } from "node:url"; import { fromHere } from "@ark/fs"; import arg from "arg"; import { config } from "dotenv"; -import { type ActionInputs, main } from "./main.ts"; +import { type Inputs, main } from "./main.ts"; import packageJson from "./package.json" with { type: "json" }; import { runAct } from "./utils/act.ts"; import { setupTestRepo } from "./utils/setup.ts"; @@ -35,7 +35,7 @@ export async function run( console.log(prompt); console.log("─".repeat(50)); - const inputs: ActionInputs = { + const inputs: Inputs = { prompt, anthropic_api_key: process.env.ANTHROPIC_API_KEY, };