@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
48 lines • 2 kB
TypeScript
import type { AdmissionRules, CommandRule, Decision, ProfileScript, ProfileScripts } from '../../policy/types.ts';
import type { SecretRef } from '../../secrets/config.ts';
export interface RuleJSON {
reason: string;
commands?: string[];
paths?: string[];
mount?: string;
}
export declare function ruleToDict(rule: CommandRule): RuleJSON;
export declare function ruleFromDict(data: RuleJSON): CommandRule;
export declare function commandsToDict(spec: AdmissionRules): {
allow: string[] | null;
ask: RuleJSON[];
deny: RuleJSON[];
};
export declare function commandsFromDict(data: ReturnType<typeof commandsToDict>): AdmissionRules;
/** One of a session's policy programs as the record stores it (the Python spelling). */
export interface ScriptJSON {
profile: string;
language: string;
source: string;
runtime: string;
config?: Record<string, unknown>;
env?: Record<string, string | SecretRef>;
}
export declare function scriptToDict(entry: ProfileScript): ScriptJSON;
export declare function scriptFromDict(data: ScriptJSON): ProfileScript;
/** A session's policy programs as the record stores them, keyed by the document's method names. */
export declare function scriptsToDict(scripts: ProfileScripts): Record<string, ScriptJSON[]>;
/** A session's policy programs read back from a record, keyed by the document's method names. */
export declare function scriptsFromDict(data: Record<string, ScriptJSON[]>): ProfileScripts;
/** A ledger record as the session record stores it (the Python spelling). */
export interface DecisionJSON {
id: string;
session_id: string;
command: string;
argv: string[];
cwd: string;
paths: string[];
reason: string;
rule: RuleJSON;
outcome: string | null;
scope: string;
note: string;
}
export declare function decisionToDict(record: Decision): DecisionJSON;
export declare function decisionFromDict(data: DecisionJSON): Decision;
//# sourceMappingURL=serialize.d.ts.map