import { MutagentCore } from "../core.js"; import { RequestOptions } from "../lib/sdks.js"; import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/http-client-errors.js"; import * as errors from "../models/errors/index.js"; import { MutagentError } from "../models/errors/mutagent-error.js"; import { ResponseValidationError } from "../models/errors/response-validation-error.js"; import { SDKValidationError } from "../models/errors/sdk-validation-error.js"; import * as operations from "../models/operations/index.js"; import { APIPromise } from "../types/async.js"; import { Result } from "../types/fp.js"; /** * Watch a sandbox's output live * * @remarks * Server-sent events: `stdout`, `stderr`, `rpc`, `unrecognised`, `session`, `live`, `status`, `ping` (every 15s), `error`. `rpc` carries one complete NDJSON frame from a Helix session running in RPC mode, verbatim — parse it client-side. `unrecognised` carries a line the backend could not classify; receiving one means this server and the sandbox image disagree about the protocol, and it is forwarded rather than dropped so that drift is visible instead of silent. Those four output events share the `{seq, ts, text}` shape and one sequence counter, so their interleaving is the order the box produced them. `session` shares that counter too but carries flat fields instead of `text` — `{sessionId, status: "started"|"exited", exitCode, lastSeq, generation}` — and is how a client learns a Helix session began or ended; it is persisted and replayed like any output event, and `exitCode` is the session's real code (the terminal `status` event describes the SANDBOX and reports null by contract). `live` is emitted at most once, before the opening `status`, and only when this instance cannot follow the sandbox: it replays the log and ends rather than tailing. `seq` is monotonic per sandbox and starts at 1, and every seq-bearing event also carries it as the SSE `id:` field; pass the last one seen as `?since=` to resume. A resume is served from the persisted event log first and the live buffer only for the tail, so it survives a restart and can be answered by an instance that never spawned the box. If the requested range has been TRIMMED from that log, an `error` event names the lost range rather than skipping it silently — it carries `code: 'gap'` with the inclusive `from`/`to` wire seqs, and the stream continues past the gap; a source failure instead carries `code: 'upstream'` and is the end of the stream. Branch on `code`, never on `message`. Disconnecting tears down the upstream. * * If set, this operation will use {@link Security.bearerAuth} from the global security. */ export declare function sandboxGetApiSandboxByIdStream(client: MutagentCore, request: operations.GetApiSandboxByIdStreamRequest, options?: RequestOptions): APIPromise>; //# sourceMappingURL=sandbox-get-api-sandbox-by-id-stream.d.ts.map