@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
31 lines • 1.5 kB
TypeScript
import type { KillGuardContext, ProcessView } from "./types.ts";
/** A synchronous spawn the judge may use; callers pass an original captured before any judging wrapper (A8). */
export type KillGuardSpawnSync = (file: string, args: readonly string[], timeoutMs: number) => {
readonly status: number | null;
readonly stdout: string;
} | undefined;
type NodeLikeSpawnSync = (file: string, args: readonly string[], options: {
timeout: number;
encoding: "utf8";
}) => {
status: number | null;
stdout: string | null;
error?: Error;
};
type BunLikeSpawnSync = (argv: string[], options: {
timeout: number;
}) => {
exitCode: number | null;
stdout: Uint8Array | null | undefined;
};
export declare function spawnSyncFromNode(spawnSync: NodeLikeSpawnSync): KillGuardSpawnSync;
export declare function spawnSyncFromBun(spawnSync: BunLikeSpawnSync): KillGuardSpawnSync;
/** The production view: `/proc` on Linux (falling back to `ps`), `ps` elsewhere; `undefined` when neither answers. */
export declare function createProcessView(platform: string, spawnSync: KillGuardSpawnSync): ProcessView | undefined;
export interface KillGuardContextOptions extends Omit<KillGuardContext, "view"> {
readonly spawnSync: KillGuardSpawnSync;
}
/** A context whose view is read at most once, and only when a rule needs the table. */
export declare function killGuardContext(options: KillGuardContextOptions): KillGuardContext;
export {};
//# sourceMappingURL=process-view.d.ts.map