fix type errors

This commit is contained in:
David Blass
2025-10-14 14:58:46 -04:00
parent c8ba7940e3
commit a05829f781
4 changed files with 12 additions and 16 deletions
+5 -9
View File
@@ -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;
+1 -1
View File
@@ -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";
+4 -4
View File
@@ -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<MainResult> {
export async function main(inputs: Inputs): Promise<MainResult> {
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();
+2 -2
View File
@@ -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,
};