UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

62 lines (61 loc) • 1.44 kB
import { ExecutionError, FileError, err, } from "../internal/harness.js"; export class StubExecutionEnv { cwd; externalContentTarget; constructor(cwd = "/") { this.cwd = cwd; } fsErr(path) { return Promise.resolve(err(new FileError("not_supported", "filesystem is not available in this environment", path))); } absolutePath(path) { return this.fsErr(path); } joinPath() { return this.fsErr(); } readTextFile(path) { return this.fsErr(path); } readTextLines(path) { return this.fsErr(path); } readBinaryFile(path) { return this.fsErr(path); } writeFile(path) { return this.fsErr(path); } appendFile(path) { return this.fsErr(path); } fileInfo(path) { return this.fsErr(path); } listDir(path) { return this.fsErr(path); } canonicalPath(path) { return this.fsErr(path); } exists(path) { return this.fsErr(path); } createDir(path) { return this.fsErr(path); } remove(path) { return this.fsErr(path); } createTempDir() { return this.fsErr(); } createTempFile() { return this.fsErr(); } exec() { return Promise.resolve(err(new ExecutionError("shell_unavailable", "shell execution is not available in this environment"))); } async cleanup() { } }