@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
24 lines • 1.39 kB
TypeScript
import type { CreatedTerminalSession } from "../manager.ts";
import type { TerminalExitView, TerminalToolContext } from "./context.ts";
export interface SpawnRequest {
readonly command: string;
readonly cols: number;
readonly rows: number;
/** Kill deadline in ms for foreground runs; omit for background sessions. */
readonly timeoutMs?: number;
/** Working directory override (execute-time `ctx.cwd`); falls back to the tool context cwd. */
readonly cwd?: string;
/** Environment overrides merged over `ctx.getEnv()` (foreground non-interactive env). */
readonly envOverrides?: Readonly<Record<string, string>>;
/** The session the command runs for; its pid is attested to that session (senpi#6972). */
readonly sessionId?: string;
}
/**
* Resolve the configured shell (honoring `SENPI_GIT_BASH_PATH` + shell kind) and spawn a
* terminal session that runs `command` through it. For stdin-transport shells (legacy WSL
* bash `-s`) the command is written to the PTY after start; otherwise it rides in argv.
*/
export declare function spawnCommandSession(ctx: TerminalToolContext, request: SpawnRequest): Promise<CreatedTerminalSession>;
/** Snapshot the human-facing exit status of a finished session. */
export declare function describeExit(runtime: Pick<TerminalExitView, "exitResult">): string | null;
//# sourceMappingURL=spawn.d.ts.map