@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
30 lines • 1.43 kB
TypeScript
export interface LedgeredGroup {
readonly launchId: string;
readonly pgid: number;
/** The group leader's start identity as recorded at launch (`readProcessStartTime` form). */
readonly leaderStart: string | undefined;
readonly lifetime: "owned" | "detached";
}
export type GroupVerdict = "sweep" | "detached" | "empty" | "own-group" | "leader-reused";
export interface GroupProbes {
readonly groupHasMembers: (pgid: number) => boolean;
readonly isAlive: (pid: number) => boolean;
readonly startOf: (pid: number) => Promise<string | undefined>;
readonly ownGroup: () => Promise<number | undefined>;
readonly signalGroup: (pgid: number, signal: NodeJS.Signals) => void;
readonly wait: (ms: number) => Promise<void>;
}
export declare function classifyGroup(group: LedgeredGroup, ownGroup: number | undefined, probes: Pick<GroupProbes, "groupHasMembers" | "isAlive" | "startOf">): Promise<GroupVerdict>;
export interface SweepOutcome {
readonly launchId: string;
readonly pgid: number;
readonly verdict: GroupVerdict;
readonly survived?: boolean;
}
export declare function sweepGroups(groups: readonly LedgeredGroup[], options: {
readonly graceMs: number;
readonly killWaitMs: number;
readonly pollMs?: number;
}, probes?: GroupProbes): Promise<SweepOutcome[]>;
export declare const defaultGroupProbes: GroupProbes;
//# sourceMappingURL=group-ownership.d.ts.map