physical.Rantypeno test imports ittype Ran = { readonly code: number; readonly stdout: string; readonly stderr: string };What running a command gave.
Asking a probe: a request sent through a way of running the command (the ssh client on a target, a container, the machine itself), the facts read into an observation, and one osquery SELECT answered as rows. A probe that cannot be reached, refuses, or gives what cannot be read is an error that says so, never an observation that is guessed.
import { observe } from "./run.ts";
const r = await observe(async () => ({ code: 0, stdout: "@probe\nat=2026-12-01T00:00:00Z\nversion=1\n", stderr: "" }));
r.kind; // "ok"physical.Rantypeno test imports ittype Ran = { readonly code: number; readonly stdout: string; readonly stderr: string };What running a command gave.
physical.Sendtypeno test imports ittype Send = (request: string) => Promise<Ran>;A way of sending one request to a probe and getting what it printed: the request is the text the probe is given.
physical.ProbeErrortypeno test imports ittype ProbeError = { readonly kind: "refused" | "unreachable" | "unreadable"; readonly message: string };Why a probe gave no answer.
physical.observefunctionno test imports itfunction observe(send: Send): Promise<Result<Observed, ProbeError>>The facts of a machine as an observation, or why none: unreachable where the command did not run, refused where the probe refused, unreadable where what it printed is not facts.
physical.Rowtypeno test imports ittype Row = Readonly<Record<string, string>>;One row of an osquery answer: every value is text, as osquery prints it.
physical.queryfunctionno test imports itfunction query(send: Send, sql: string): Promise<Result<readonly Readonly<Record<string, string>>[], ProbeError>>The rows of one osquery SELECT, or why not: the query is refused here before it is sent where it is not a single SELECT.
physical.sendViafunctionno test imports itfunction sendVia(executor: Executor): SendA way of sending requests through an executor of Headless: the ssh target (its host key checked against the repository's known hosts), a container or this machine. The request is the command, as the probe's forced command reads it.
Rantypeno test imports ittype Ran = { readonly code: number; readonly stdout: string; readonly stderr: string };What running a command gave.
Sendtypetype Send = (request: string) => Promise<Ran>;A way of sending one request to a probe and getting what it printed: the request is the text the probe is given.
ProbeErrortypeno test imports ittype ProbeError = { readonly kind: "refused" | "unreachable" | "unreadable"; readonly message: string };Why a probe gave no answer.
observefunctionfunction observe(send: Send): Promise<Result<Observed, ProbeError>>The facts of a machine as an observation, or why none: unreachable where the command did not run, refused where the probe refused, unreadable where what it printed is not facts.
Rowtypeno test imports ittype Row = Readonly<Record<string, string>>;One row of an osquery answer: every value is text, as osquery prints it.
queryfunctionfunction query(send: Send, sql: string): Promise<Result<readonly Readonly<Record<string, string>>[], ProbeError>>The rows of one osquery SELECT, or why not: the query is refused here before it is sent where it is not a single SELECT.
sendViafunctionfunction sendVia(executor: Executor): SendA way of sending requests through an executor of Headless: the ssh target (its host key checked against the repository's known hosts), a container or this machine. The request is the command, as the probe's forced command reads it.