eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
52 lines (51 loc) • 2.38 kB
TypeScript
import type { CustomCommand, IFileSystem } from "just-bash";
/**
* Context passed to a custom just-bash filesystem factory for each live handle.
*/
export interface JustBashFilesystemContext {
/** Stable application root for this backend create call. */
readonly appRoot: string;
/** eve's durable, session-owned filesystem, including `/workspace`. */
readonly defaultFilesystem: IFileSystem;
/** The just-bash engine resolved by eve after its optional installation check. */
readonly justBash: typeof import("just-bash");
}
/**
* Options accepted by `justbash(opts)`.
*
* The just-bash backend runs the workspace under the pure-JS `just-bash`
* interpreter with a virtual filesystem — no daemon or VM required, but
* no real binaries either. The `just-bash` package is not bundled with
* eve; it is loaded lazily from the application install.
*/
export interface JustBashSandboxCreateOptions {
/**
* When the `just-bash` package is missing from the application,
* install it automatically with the project's package manager. Only
* runs during `eve dev`; production processes always fail with an
* actionable install error instead. Defaults to `true`.
*/
readonly autoInstall?: boolean;
/**
* Registers trusted host application code as commands in each live
* just-bash interpreter. Custom commands can participate in normal shell
* composition, including pipelines and redirections.
*
* Custom commands are not available during template prewarming. They run in
* eve's host process, outside the virtual filesystem security boundary, and
* are responsible for validating their own inputs and cleaning up host
* resources.
*/
readonly customCommands?: ReadonlyArray<CustomCommand>;
/**
* Composes the filesystem used by each live sandbox handle. The factory is
* called when a handle opens with eve's durable default filesystem; return a
* fresh filesystem that preserves eve-owned paths such as `/workspace`,
* `/tmp`, and the home directory.
*
* This just-bash-specific escape hatch requires the application to install
* a compatible `just-bash` version. It is not invoked during template
* prewarming.
*/
readonly filesystem?: (context: JustBashFilesystemContext) => IFileSystem | Promise<IFileSystem>;
}