UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

80 lines (79 loc) 3.41 kB
import { type Prompter } from "#setup/prompter.js"; declare const CODING_AGENT_REPLS: readonly [{ readonly command: "claude"; readonly label: "Claude Code"; readonly promptArgs: (prompt: string) => string[]; }, { readonly command: "codex"; readonly label: "Codex"; readonly promptArgs: (prompt: string) => string[]; }, { readonly command: "cursor-agent"; readonly label: "Cursor"; readonly promptArgs: (prompt: string) => string[]; }, { readonly command: "droid"; readonly label: "Droid"; readonly promptArgs: (prompt: string) => string[]; }, { readonly command: "gemini"; readonly label: "Gemini CLI"; readonly promptArgs: (prompt: string) => string[]; }, { readonly command: "opencode"; readonly label: "opencode"; readonly promptArgs: (prompt: string) => string[]; }, { readonly command: "pi"; readonly label: "Pi"; readonly promptArgs: (prompt: string) => string[]; }]; type CodingAgentReplDefinition = (typeof CODING_AGENT_REPLS)[number]; /** A coding-agent REPL that can take over the terminal after `eve init`. */ export type CodingAgentRepl = CodingAgentReplDefinition["command"]; /** The one post-init continuation point for a human terminal session. */ export type InitHandoff = "eve-dev" | CodingAgentRepl; export interface InitReplDependencies { createPrompter(): Prompter; hasInteractiveTerminal(): boolean; isCodingAgentReplAvailable(command: CodingAgentRepl): Promise<boolean>; } /** The full path of the named REPL's executable on `PATH`, or null if absent. */ export declare function resolveCodingAgentRepl(command: CodingAgentRepl): Promise<string | null>; /** True when the named REPL resolves to an executable on the current `PATH`. */ export declare function isCodingAgentReplAvailable(command: CodingAgentRepl): Promise<boolean>; /** * Offers any locally installed coding-agent REPLs immediately before the * existing `eve dev` handoff. Non-interactive sessions, and systems with none * of them on `PATH`, keep the prior direct-to-dev behavior. */ export declare function selectInitHandoff(input: { agentName: string; deps?: Partial<InitReplDependencies>; }): Promise<InitHandoff>; interface ReplSpawnPlan { file: string; args: readonly string[]; shell: boolean; /** False means the prompt is not in argv and the caller must surface it. */ seeded: boolean; } /** * Decides how to launch a REPL from its resolved executable path. A directly * spawnable executable runs without a shell, so the multi-line prompt passes * through argv verbatim. A `.cmd`/`.bat` shim (or an unresolved command) can * only run via cmd.exe, which cannot carry the prompt's newlines or * metacharacters in an argument, so it launches the bare REPL and reports the * prompt as unseeded. */ export declare function replSpawnPlan(command: CodingAgentRepl, resolvedPath: string | null, prompt: string, platform?: NodeJS.Platform): ReplSpawnPlan; /** Starts the selected coding-agent REPL in the newly initialized project. */ export declare function spawnCodingAgentRepl(input: { command: CodingAgentRepl; cwd: string; prompt: string; /** Surfaces the prompt when it could not be seeded into the REPL's argv. */ onPromptUnseeded?: (prompt: string) => void; resolvePath?: (command: CodingAgentRepl) => Promise<string | null>; }): Promise<boolean>; export {};