Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d03debab4b | |||
| a05829f781 |
+5
-9
@@ -1,13 +1,9 @@
|
|||||||
import type { MainParams } from "../main.ts";
|
import type { Inputs } from "../main.ts";
|
||||||
|
|
||||||
const testParams = {
|
const testParams = {
|
||||||
inputs: {
|
prompt:
|
||||||
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.",
|
||||||
"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",
|
||||||
anthropic_api_key: "sk-test-key",
|
} satisfies Inputs;
|
||||||
},
|
|
||||||
env: {},
|
|
||||||
cwd: process.cwd(),
|
|
||||||
} satisfies MainParams;
|
|
||||||
|
|
||||||
export default testParams;
|
export default testParams;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
export { ClaudeAgent } from "./agents/claude.ts";
|
export { ClaudeAgent } from "./agents/claude.ts";
|
||||||
export type { Agent, AgentConfig, AgentResult } from "./agents/types.ts";
|
export type { Agent, AgentConfig, AgentResult } from "./agents/types.ts";
|
||||||
export {
|
export {
|
||||||
type ActionInputs as ExecutionInputs,
|
type Inputs as ExecutionInputs,
|
||||||
type MainResult,
|
type MainResult,
|
||||||
main,
|
main,
|
||||||
} from "./main.ts";
|
} from "./main.ts";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export const Inputs = type({
|
|||||||
"anthropic_api_key?": "string | undefined",
|
"anthropic_api_key?": "string | undefined",
|
||||||
});
|
});
|
||||||
|
|
||||||
export type ActionInputs = typeof Inputs.infer;
|
export type Inputs = typeof Inputs.infer;
|
||||||
|
|
||||||
export interface MainResult {
|
export interface MainResult {
|
||||||
success: boolean;
|
success: boolean;
|
||||||
@@ -16,7 +16,7 @@ export interface MainResult {
|
|||||||
error?: string | undefined;
|
error?: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function main(inputs: ActionInputs): Promise<MainResult> {
|
export async function main(inputs: Inputs): Promise<MainResult> {
|
||||||
try {
|
try {
|
||||||
core.info(`→ Starting agent run with Claude Code`);
|
core.info(`→ Starting agent run with Claude Code`);
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ export async function main(inputs: ActionInputs): Promise<MainResult> {
|
|||||||
|
|
||||||
const agent = new ClaudeAgent({
|
const agent = new ClaudeAgent({
|
||||||
apiKey: inputs.anthropic_api_key!,
|
apiKey: inputs.anthropic_api_key!,
|
||||||
githubInstallationToken
|
githubInstallationToken,
|
||||||
});
|
});
|
||||||
await agent.install();
|
await agent.install();
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pullfrog/action",
|
"name": "@pullfrog/action",
|
||||||
"version": "0.0.46",
|
"version": "0.0.47",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"files": [
|
"files": [
|
||||||
"index.js",
|
"index.js",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { pathToFileURL } from "node:url";
|
|||||||
import { fromHere } from "@ark/fs";
|
import { fromHere } from "@ark/fs";
|
||||||
import arg from "arg";
|
import arg from "arg";
|
||||||
import { config } from "dotenv";
|
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 packageJson from "./package.json" with { type: "json" };
|
||||||
import { runAct } from "./utils/act.ts";
|
import { runAct } from "./utils/act.ts";
|
||||||
import { setupTestRepo } from "./utils/setup.ts";
|
import { setupTestRepo } from "./utils/setup.ts";
|
||||||
@@ -35,7 +35,7 @@ export async function run(
|
|||||||
console.log(prompt);
|
console.log(prompt);
|
||||||
console.log("─".repeat(50));
|
console.log("─".repeat(50));
|
||||||
|
|
||||||
const inputs: ActionInputs = {
|
const inputs: Inputs = {
|
||||||
prompt,
|
prompt,
|
||||||
anthropic_api_key: process.env.ANTHROPIC_API_KEY,
|
anthropic_api_key: process.env.ANTHROPIC_API_KEY,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user