From 89e93d339841d6345654f1d7db39256a1fb998af Mon Sep 17 00:00:00 2001 From: David Blass Date: Sat, 10 Jan 2026 12:48:02 -0500 Subject: [PATCH] fix play --- entry | 2 +- main.ts | 2 +- play.ts | 24 +++--------------------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/entry b/entry index d8f8dd8..0fd2c25 100755 --- a/entry +++ b/entry @@ -138360,7 +138360,7 @@ var Timer = class { // main.ts var Inputs = type({ prompt: "string", - effort: Effort + "effort?": Effort }); async function main(inputs) { var _stack2 = []; diff --git a/main.ts b/main.ts index ccccd79..a705420 100644 --- a/main.ts +++ b/main.ts @@ -23,7 +23,7 @@ import { Timer } from "./utils/timer.ts"; export const Inputs = type({ prompt: "string", - effort: Effort, + "effort?": Effort, }); export type Inputs = typeof Inputs.infer; diff --git a/play.ts b/play.ts index ce5ae3b..f7c5582 100644 --- a/play.ts +++ b/play.ts @@ -3,10 +3,8 @@ import { existsSync, readFileSync } from "node:fs"; import { extname, join, resolve } from "node:path"; import { pathToFileURL } from "node:url"; import { fromHere } from "@ark/fs"; -import { flatMorph } from "@ark/util"; import arg from "arg"; import { config } from "dotenv"; -import { agents } from "./agents/index.ts"; import type { AgentResult } from "./agents/shared.ts"; import { type Inputs, main } from "./main.ts"; import { log } from "./utils/cli.ts"; @@ -25,26 +23,10 @@ export async function run(prompt: string): Promise { const originalCwd = process.cwd(); process.chdir(tempDir); - // check if prompt is a pullfrog payload and extract agent - // note: agent from payload will be used by determineAgent with highest precedence - // we don't need to extract it here since main() will parse the payload - const inputs = { + const inputs: Inputs = { prompt, - ...flatMorph(agents, (_, agent) => { - // for OpenCode, scan all API_KEY environment variables - if (agent.name === "opencode") { - const opencodeKeys: Array<[string, string | undefined]> = []; - for (const [key, value] of Object.entries(process.env)) { - if (value && typeof value === "string" && key.includes("API_KEY")) { - opencodeKeys.push([key.toLowerCase(), value]); - } - } - return opencodeKeys; - } - // for other agents, use apiKeyNames - return agent.apiKeyNames.map((inputKey) => [inputKey, process.env[inputKey.toUpperCase()]]); - }), - } as Required; + effort: "nothink", + }; const result = await main(inputs);