@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
14 lines • 1.21 kB
TypeScript
import type { KillGuardContext, ProcessRow } from "./types.ts";
/** Protected pid -> why it is protected. */
export type Protected = ReadonlyMap<number, string>;
export declare function rowOf(rows: readonly ProcessRow[], pid: number): ProcessRow | undefined;
/** P without a table: pid 1, the agent and its parent. */
export declare function minimalProtected(context: KillGuardContext): Protected;
/** P (DESIGN-12096 v2 §3'): pid 1, the agent, its ancestors, its session leader, and on Linux the user's systemd. */
export declare function protectedSet(context: KillGuardContext, rows: readonly ProcessRow[]): Protected;
export declare function describe(pid: number, rows: readonly ProcessRow[] | undefined, reason: string): string;
/** What BSD `pkill` leaves out by default: its own ancestors, i.e. the caller's chain up to pid 1. */
export declare function vantageChain(context: KillGuardContext, rows: readonly ProcessRow[]): Set<number>;
/** The caller's own process group; undefined for a fresh shell, whose group holds only the command's processes. */
export declare function ownGroup(context: KillGuardContext, rows: readonly ProcessRow[]): number | undefined;
//# sourceMappingURL=protected.d.ts.map