UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

23 lines • 1.85 kB
declare const KILL_GUARD_SHIM_NAMES: readonly ["kill", "pkill", "killall"]; export type KillGuardShimName = (typeof KILL_GUARD_SHIM_NAMES)[number]; export declare const KILL_GUARD_BASH_ENV = "bash_env.sh"; declare const KILL_GUARD_BASH_KILL = "bash_kill.sh"; /** Every PROMPT_COMMAND hook starts with this, so an inherited hook is recognised as the kill guard's own. */ export declare const KILL_GUARD_PROMPT_HOOK_PREFIX = "__senpi_kg_q=$?;"; /** A file every shim directory holds, so a shim looking for the real binary skips every kill-guard directory. */ export declare const KILL_GUARD_SHIM_MARKER = ".senpi-kill-guard"; /** The table read and the dry run are bounded at 2 s each; the rest covers the judge's own start. */ export declare const KILL_GUARD_JUDGE_DEADLINE_SECONDS = 10; export type KillGuardShimFiles = Record<KillGuardShimName | typeof KILL_GUARD_BASH_ENV | typeof KILL_GUARD_BASH_KILL, string>; /** * The PROMPT_COMMAND that carries the `kill` wrapper into interactive bash, which reads no BASH_ENV. Before a prompt it * sources `bash_kill.sh` once per shell (the marker is an unexported variable keyed on `$$`, so a child bash sources it * again), then runs the user's own PROMPT_COMMAND with `$?` as the last command left it. A kill-guard hook inside the * user's value is not re-entered: the re-entry marker is a `local` of the function that evals the user's value, so it * exists only while that eval runs, and bash drops it when Ctrl-C or an expansion error abandons the eval midway. */ export declare function killGuardPromptCommand(dir: string): string; /** Every file of one shim directory; `dir` is baked into the shims so a shim never resolves to itself. */ export declare function renderKillGuardShims(dir: string, deadlineSeconds?: number): KillGuardShimFiles; export {}; //# sourceMappingURL=shim-script.d.ts.map