Background
While Rust has the Extension trait, the JavaScript @everruns/bashkit library lacks this capability, ScriptedTool cannot be registered as a Bash instance.
While the API does provide capabilities for mounting file systems and loading environment variables (via the files, mounts, and env options), these are defined within BashOptions and can only be passed once during construction. As a result, they cannot be broken down into a reusable, publishable extension module.
Suggestion
- Expose a TypeScript extension API in
@everruns/bashkit.
const bash = await Bash.create({ extensions: [skill] });
bash.installExtension(skill);
- The extension is an object containing a set of hooks responsible for mounting the file system, loading environment variables, registering commands, and other operations. Bash calls these hooks when the extension is created and each time it is executed.
class SkillExtension {
// Initialization hook: mount the file system, load environment variables, and register commands
onInit(ctx: ExtensionInitContext) {
ctx.mount(“/skills/my-skill”, skillData.fs); // Mount the file system
ctx.env(“SKILL_PATH”, “/skills/my-skill”); // Load environment variables
ctx.command(...);
}
// Lifecycle hook: Before each `execute` begins
onBeforeExecute(ctx: ExecContext) {
// Optional preparation before each execution
}
}
Expectations
Users should be able to create a skill extension that mounts an external S3 bucket into a virtual Bash environment during initialization, stores the mount path as an environment variable, and then creates a new command skill. This extension can be published for others to use.
Background
While Rust has the
Extensiontrait, the JavaScript@everruns/bashkitlibrary lacks this capability,ScriptedToolcannot be registered as aBashinstance.While the API does provide capabilities for mounting file systems and loading environment variables (via the
files,mounts, andenvoptions), these are defined withinBashOptionsand can only be passed once during construction. As a result, they cannot be broken down into a reusable, publishable extension module.Suggestion
@everruns/bashkit.Expectations
Users should be able to create a skill extension that mounts an external S3 bucket into a virtual Bash environment during initialization, stores the mount path as an environment variable, and then creates a new
commandskill. This extension can be published for others to use.