@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
64 lines • 3.01 kB
TypeScript
/**
* The reason a bare command pattern under `commands.deny` carries, and
* the one a bare pattern under `commands.ask` carries.
*/
export declare const DEFAULT_DENY_REASON = "denied by policy";
export declare const DEFAULT_ASK_REASON = "no standing approval";
/**
* Ops that act on a whole subtree at once, so a pure path rule refuses
* them on the directory that holds its scope or on any ancestor: moving
* or removing `/x` takes `/x/locked/*` along. `rmdir` removes the scope's
* own directory; `rm_r` removes a tree in one call. They are pinned to what
* the functions declare by constants.test.ts: policy sits below vfs (the Pyodide
* worker loads it), so it cannot read the declarations itself.
*/
export declare const SUBTREE_OPS: ReadonlySet<string>;
/**
* Ops that read an entry's metadata and nothing of its content, which a
* deny rule lets through at the dispatcher: deny means present and refused,
* not absent, so a listing shows the entry's name and size and the read
* of it is what fails, as GNU reports an unreadable file. The command
* tier's guard leaves its `stat` slot unwrapped for the same reason; a
* hidden path is the hide arm's, and stays ENOENT. `exists` is the command
* tier's probe; `stat` is pinned like SUBTREE_OPS's VFS ops.
*/
export declare const METADATA_OPS: ReadonlySet<string>;
/**
* The methods a profile's policy names programs for, the pre_ five
* answered before the action runs and the post_ five after it: the Policy
* interface's spelling to the document's.
*/
export declare const METHODS: {
readonly preExecute: "pre_execute";
readonly preCommand: "pre_command";
readonly preVfs: "pre_vfs";
readonly preSession: "pre_session";
readonly postExecute: "post_execute";
readonly postCommand: "post_command";
readonly postVfs: "post_vfs";
readonly postSession: "post_session";
readonly preNetwork: "pre_network";
readonly postNetwork: "post_network";
};
/** The runtimes a policy program runs on: monty, and Python on wasm. */
export declare const PROGRAM_RUNTIMES: ReadonlySet<string>;
/** The runtime a policy program runs on when it names none. */
export declare const PROGRAM_RUNTIME = "monty";
/**
* The interpreter switches a program runs with, per runtime: `-P` keeps
* the session's directory off `sys.path`, so no file there stands in for
* a module the program imports. Monty has no `sys.path`.
*/
export declare const PROGRAM_FLAGS: ReadonlyMap<string, Readonly<Record<string, boolean>>>;
/**
* The memory a policy program gets when its runtime's config names none:
* monty's own example cap, and enough for Python on wasm, whose worker
* starts at about 50M. `maxMemory: null` in the config lifts it.
*/
export declare const PROGRAM_MEMORY: ReadonlyMap<string, string>;
/**
* The environment variable a policy program reads its context from, as
* JSON; the same text arrives on stdin.
*/
export declare const CTX_ENV = "MIRAGE_POLICY_CTX";
//# sourceMappingURL=constants.d.ts.map