Skip to content

NodeExecEnv

The local ExecEnv: Node’s file system and a bash shell on this machine. Every local environment shares one file namespace (id), whatever its cwd.

import { Harness, NodeExecEnv } from "@effective-harness/core"
const env = NodeExecEnv.make({ cwd: "/work/project" })
const layer = Harness.layer({ env: NodeExecEnv.layer() })

Since v0.0.0


The file namespace of every local environment.

Signature

declare const ID: "node:local"

Source

Since v0.0.0

Signature

export interface Options {
/** The working directory; relative paths resolve against it. */
readonly cwd: string
/** The bash to run commands with. Default: `/bin/bash`, else `bash` on `PATH`, else `sh`. */
readonly shellPath?: string
/** Variables commands see on top of the process environment. */
readonly shellEnv?: Readonly<Record<string, string | undefined>>
}

Source

Since v0.0.0

Local environments for every conversation, each in its agent’s cwd (resolved against options.cwd), else in options.cwd, which defaults to the process’s working directory.

Signature

declare const layer: (options?: {
readonly cwd?: string
readonly shellPath?: string
readonly shellEnv?: Options["shellEnv"]
}) => Layer.Layer<ExecEnv.ExecEnvBuilder>

Source

Since v0.0.0

A local environment rooted at options.cwd. exec runs commands through bash in their own process group, which is killed when the command times out or the effect is interrupted.

Signature

declare const make: (options: Options) => ExecEnv.ExecEnv

Source

Since v0.0.0