/** * probes.ts, executing one declarative probe. * * Four kinds, all data-driven: http, file, command (argv, never a shell) and * sdk-tool. Each returns a TriggerValue the extractor then narrows. Nothing * here interpolates a previously extracted value back into the probe: a probe * is a fixed measurement, so there is no path by which an observed value can * become part of the next request or command line. * * All I/O is injectable so the whole probe layer is testable without a network, * a filesystem or a subprocess, the policy lives here, the host supplies the * effects. */ import type { TriggerProbe, TriggerValue } from './types.js'; export interface ProbeCommandResult { readonly exitCode: number | null; readonly stdout: string; readonly stderr: string; } /** * The effects a probe needs. A host wires the real ones; a test wires fakes. * `runCommand` takes argv, not a command string, there is no shell anywhere in * this path, so no extracted value can ever be interpreted as a metacharacter. */ export interface ProbeIo { readonly fetch: (url: string, init: RequestInit, timeoutMs: number) => Promise<{ readonly status: number; readonly ok: boolean; readonly text: () => Promise; }>; readonly readFile: (path: string, maxBytes: number) => Promise; readonly statFile: (path: string) => { readonly size: number; readonly mtimeMs: number; } | null; readonly runCommand: (command: string, args: readonly string[], options: { readonly cwd?: string | undefined; readonly timeoutMs: number; }) => Promise; readonly callTool: (tool: string, input: Readonly>, timeoutMs: number) => Promise; } export declare class ProbeTimeoutError extends Error { constructor(kind: string, timeoutMs: number); } /** Node/Bun-backed default effects. Hosts may substitute their own. */ export declare function createDefaultProbeIo(): ProbeIo; /** Runs one probe and returns its raw result for the extractor to narrow. */ export declare function runProbe(probe: TriggerProbe, io: ProbeIo, defaults?: { readonly timeoutMs?: number | undefined; }): Promise; //# sourceMappingURL=probes.d.ts.map