@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
42 lines • 1.66 kB
TypeScript
export interface MontySessionLike {
readonly workerPid?: number;
feedRun(code: string, options?: Record<string, unknown>): Promise<unknown>;
close(): Promise<void>;
}
export interface MontyPoolLike {
checkout(options?: Record<string, unknown>): Promise<MontySessionLike>;
close(): Promise<void>;
}
/**
* The three pieces `MontyFs` needs from the engine: the decline
* sentinel, the handle class an `open` answer must be an instance of
* (the engine wraps it into the guest's `_io.*` object),
* and the wrapper that carries a host object into the guest as a class
* instance rather than a dict, which is what lets a stat answer arrive
* with `st_size` on it.
*/
export interface MontyFsBits {
NOT_HANDLED: symbol;
MontyFileHandle: new (path: string, mode: string, options?: {
position: number;
}) => unknown;
ClassInstance: new (instance: object, options?: {
name?: string;
eagerAttrs?: readonly string[] | 'all';
}) => object;
}
/** A worker-death error, the one shape run() maps to an exit code. */
export interface MontyCrashedLike extends Error {
timedOut: boolean;
}
export interface MontyModuleLike extends MontyFsBits {
Monty: {
create(options?: Record<string, unknown>): Promise<MontyPoolLike>;
};
MontySyntaxError: new (...args: never[]) => Error;
MontyRuntimeError: new (...args: never[]) => Error;
MontyCrashedError: new (...args: never[]) => MontyCrashedLike;
}
/** Import the optional engine package, failing loud when it is absent. */
export declare function loadMontyModule(): Promise<MontyModuleLike>;
//# sourceMappingURL=loader.d.ts.map