improve types
This commit is contained in:
+2
-2
@@ -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>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 });
|
||||||
|
|||||||
Reference in New Issue
Block a user