Documentation Index
Fetch the complete documentation index at: https://mintlify.com/withastro/flue/llms.txt
Use this file to discover all available pages before exploring further.
FlueHarness is returned by init() and represents a configured handle for model defaults, tools, sandbox, filesystem, and sessions within a single run. Most agent code interacts with a harness to open sessions and run shell commands outside the conversation context.
Properties
The harness name. Defaults to
"default". Use init({ name }) to create multiple isolated harnesses per run.Out-of-band filesystem access to the harness sandbox. Operations do not appear in any conversation transcript. Use
fs for plumbing (staging files, capturing artifacts, managing scratch space). If a write should feed into the model’s next turn, prompt the model to read the file itself.Explicit session management: get, create, or delete named sessions. Use
harness.session() for the common get-or-create pattern; use harness.sessions when you need strict control over session existence.Methods
session(name?, options?)
Get or create a named session. If the session already exists it is returned; otherwise a new one is created.
Session name. Defaults to
"default".Session-wide default role. Per-call roles override this.
Promise<FlueSession>.
shell(command, options?)
Run a shell command in the harness sandbox. Unlike session.shell(), this call is not recorded in any conversation transcript. Use it for setup, artifact extraction, or any shell work the model shouldn’t see.
Shell command to execute.
Working directory for the command.
Additional environment variables.
Cancel the in-flight command.
CallHandle<ShellResult>.
FlueSessions
Explicit session management. Access viaharness.sessions.
sessions.get(name?, options?)
Load an existing session. Throws if the session does not exist.
sessions.create(name?, options?)
Create a new session. Throws if a session with that name already exists.
sessions.delete(name?)
Delete a session’s stored conversation state. No-op if the session does not exist.
FlueFs
Thefs object on both FlueHarness and FlueSession exposes the sandbox filesystem for out-of-band reads and writes.
| Method | Signature | Description |
|---|---|---|
readFile | (path) → Promise<string> | Read a UTF-8 file. Throws if missing. |
readFileBuffer | (path) → Promise<Uint8Array> | Read raw bytes. |
writeFile | (path, content) → Promise<void> | Write string or bytes. Creates if missing, replaces if present. |
stat | (path) → Promise<FileStat> | File metadata: isFile, isDirectory, isSymbolicLink, size, mtime. |
readdir | (path) → Promise<string[]> | List directory entry names (not full paths). |
exists | (path) → Promise<boolean> | Returns true if path exists. Never throws. |
mkdir | (path, options?) → Promise<void> | Create directory. Pass { recursive: true } for mkdir -p. |
rm | (path, options?) → Promise<void> | Remove file or directory. Pass { recursive: true, force: true } as needed. |
CallHandle
All methods that returnCallHandle<T> are awaitable and cancellable.
Fires when the call is aborted, whether via
handle.abort() or an options.signal passed at call time.Cancel the in-flight call. The awaited promise rejects with an
AbortError.ShellResult
Returned byharness.shell() and session.shell().
Standard output of the command.
Standard error of the command.
Exit code.
0 indicates success.