improve types

This commit is contained in:
David Blass
2025-11-20 16:09:55 -05:00
parent 975eaa9a64
commit 43acacd25a
2 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ import { log } from "../utils/cli.ts";
*/ */
export interface AgentResult { export interface AgentResult {
success: boolean; success: boolean;
output?: string; output?: string | undefined;
error?: string; error?: string | undefined;
metadata?: Record<string, unknown>; metadata?: Record<string, unknown>;
} }
+2 -3
View File
@@ -6,15 +6,14 @@ import { flatMorph } from "@ark/util";
import arg from "arg"; import arg from "arg";
import { config } from "dotenv"; import { config } from "dotenv";
import { agents } from "./agents/index.ts"; import { agents } from "./agents/index.ts";
import type { AgentResult } from "./agents/shared.ts";
import { type Inputs, main } from "./main.ts"; import { type Inputs, main } from "./main.ts";
import { log } from "./utils/cli.ts"; import { log } from "./utils/cli.ts";
import { setupTestRepo } from "./utils/setup.ts"; import { setupTestRepo } from "./utils/setup.ts";
config(); config();
export async function run( export async function run(prompt: string): Promise<AgentResult> {
prompt: string
): Promise<{ success: boolean; output?: string | undefined; error?: string | undefined }> {
try { try {
const tempDir = join(process.cwd(), ".temp"); const tempDir = join(process.cwd(), ".temp");
setupTestRepo({ tempDir, forceClean: true }); setupTestRepo({ tempDir, forceClean: true });