/** * `agentsafe test [name=host:port]...`: the boundary test as a command. The * synthetic run in `gateway/BoundaryTest.ts` is the whole of it; a target * named on the command line adds the containment probe, a TCP dial from * this machine that says whether the real system of record answers without * the gateway, which is what an agent could reach if it went around. The * exit status is the finding: 0 when the boundary holds and no named target * answered, 1 when something adversarial got through or a target answered, * 2 when the test did not run: the arguments were wrong, or the process is * marked production, where the synthetic authority refuses to start. * * `agentsafe test --hosted` is the same requests with Decionis deciding, in * shadow, against the workspace this machine is logged into * (`gateway/HostedBoundaryTest.ts`): the first governed action for that * workspace and the signed record it leaves. Exit 0 when Decionis decided * every consequential request, 1 when it could not be reached for some or * all, 2 when there is no login to run it with. */ import { type ContainmentReport } from "../containment/ContainmentProbe.js"; import { dial as tcpDial } from "../egress/TcpProbe.js"; import { type BoundaryTestOptions, type BoundaryTestReport } from "../gateway/BoundaryTest.js"; import { type AttackReport } from "../gateway/AuthorityAttacks.js"; import { type HostedBoundaryTestOptions, type HostedBoundaryTestReport } from "../gateway/HostedBoundaryTest.js"; import type { CliProcess } from "./CliProcess.js"; export declare const TEST_ARGUMENTS: { readonly valued: readonly []; readonly flags: readonly ["json", "hosted"]; }; /** The report the command prints: the synthetic run, and the containment probe when asked. */ export interface TestReport extends BoundaryTestReport { readonly containment: ContainmentReport | null; /** * The six attacks that live inside the lifecycle rather than in a request: * each needs an authority to exist before it can be attempted, so none of * them can be expressed as bytes sent at a target. */ readonly attacks: AttackReport; /** 0 when the boundary holds and no named target answered; 1 otherwise. */ readonly exit: 0 | 1; /** * The step of the adoption path this command is: the test ran, whatever * it found. Reported here because the gateway cannot see a test that ran * before it, as the installer reports `installation`; nothing is sent. */ readonly activation: { readonly milestone: "boundary_tested"; readonly at: string; }; } /** The hosted report the command prints: the run, and the step of the adoption path it is. */ export interface HostedTestReport extends HostedBoundaryTestReport { /** 0 when Decionis decided every consequential request; 1 otherwise. */ readonly exit: 0 | 1; readonly activation: { readonly milestone: "boundary_tested"; readonly at: string; }; } export interface TestOptions { readonly run?: (options: BoundaryTestOptions) => Promise; readonly runHosted?: (options: HostedBoundaryTestOptions) => Promise; readonly dial?: typeof tcpDial; readonly attacks?: () => Promise; readonly timeoutMs?: number; } /** The report for a terminal: one row per case, the exposure, the evidence, the verdict. */ export declare function renderTestReport(report: TestReport, options: { readonly color: boolean; }): string; /** The hosted report for a terminal: one row per case, what was decided, the record, the verdict. */ export declare function renderHostedTestReport(report: HostedTestReport, options: { readonly color: boolean; }): string; export declare function runTest(io: CliProcess, argv: readonly string[], options?: TestOptions): Promise; //# sourceMappingURL=TestCommand.d.ts.map