# `Opsmaru.Incus.Session`
[🔗](https://github.com/upmaru/opsmaru-incus/blob/v0.1.0/lib/opsmaru/incus/session.ex#L1)

Native exec/console channels and controls, retaining accepted operation identity.

# `close`

Close the local channels without cancelling Incus. A console's control channel
receives the pinned `1000 "Detaching from console"` close frame.

# `close_input`

Send the native write barrier without closing output/control channels.

# `collect`

Collect creator-owned live noninteractive exec output through two binary sinks
returning `:ok`. Pass finite binary `:stdin` to write it while both outputs
drain, or send it with `input/2` first; collection sends the write barrier,
closes local channels after collection starts and never cancels Incus.
`:timeout` covers collection, callbacks and final operation wait (at most the
connection's stream timeout); `:max_output_bytes` bounds stdout + stderr and
`:stdin` is bounded by the connection's `max_stream_bytes`.
Returns final `:operation`, native `:exit_status` and per-stream byte counts.
A limit fails visibly rather than truncating. Recorded/interactive sessions
and foreign creators reject before IO. See `docs/incus-client.md` for scope.

# `console`

Attach to an instance console as the pinned `ConsoleInstance` does: the body
is an `InstanceConsolePost` (type defaults to `"console"`), and the control
channel opens before channel 0. Other accepted channels are ignored. Missing
secrets fail closed with the accepted operation and open no channel. Hosts
drive frames, barriers and resize explicitly; `close/1` detaches.

# `control`

# `exec`

# `exit_status`

# `input`

# `output`

Receive one frame; the default channel is 0 for a console and 1 for exec.

# `resize`

# `run`

Submit live noninteractive exec and exchange finite binary stdin with acknowledged
output sinks concurrently. Options are `:timeout`, `:max_input_bytes` and
`:max_output_bytes`, capped by connection limits. One lifetime covers submission
through completion. Local failures never cancel or replay Incus; known accepted
identity remains usable through the original client. See `docs/incus-client.md`.

# `signal`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
