UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

25 lines (24 loc) • 1.58 kB
import type { ExecutionEnv } from "../../internal/harness.js"; import type { StartedShell } from "../../shell/lex.js"; /** One killer the command spells and the questions to put to `pgrep` for it, or why the question cannot be put. */ export interface PatternKillReading { readonly text: string; readonly probes: readonly (readonly string[])[]; /** Set when a word of the selector is decided only when the command runs. */ readonly computed?: string; /** Set when the kill names every process the caller may signal — this agent's own among them — so there is nothing to ask. */ readonly everyProcess?: true; } /** The killers a command text spells, read off the plan the read station plans (nothing is read from disk or run). */ export declare function patternKillReadings(shell: StartedShell, command: string, cwd: string): PatternKillReading[]; /** * The refusal for a command whose pattern-kill would select this agent's own process or one above it — or undefined (run it). * `cwd`: where the command stands, for the plan's read of its words (nothing is read from disk). Where the question is put is * the env's own declaration ({@link processTableOf}): this process's table is asked, another table is not, and an env that does * not say is refused. Windows is not asked: this process's table is not read there. */ export declare function patternKillRefusal(shell: StartedShell, command: string, env: ExecutionEnv, cwd: string, signal?: AbortSignal): Promise<{ content: string; isError: true; details?: unknown; } | undefined>;