/**
 * Sandbox Types
 *
 * Type definitions for Cognigate execution sandbox, network isolation,
 * and filesystem policies.
 *
 * @packageDocumentation
 */
// ============================================================================
// Trust Tier Capabilities
// ============================================================================
/**
 * Network access levels by trust tier
 */
export var NetworkAccessLevel;
(function (NetworkAccessLevel) {
    /** No network access (localhost only) */
    NetworkAccessLevel["NONE"] = "NONE";
    /** Internal APIs only (allowlist) */
    NetworkAccessLevel["INTERNAL"] = "INTERNAL";
    /** External APIs (policy-governed) */
    NetworkAccessLevel["EXTERNAL"] = "EXTERNAL";
    /** Cross-agent communication */
    NetworkAccessLevel["CROSS_AGENT"] = "CROSS_AGENT";
    /** Full network access (monitored) */
    NetworkAccessLevel["FULL"] = "FULL";
})(NetworkAccessLevel || (NetworkAccessLevel = {}));
/**
 * Filesystem access levels by trust tier
 */
export var FilesystemAccessLevel;
(function (FilesystemAccessLevel) {
    /** Read-only sandbox with no persistence */
    FilesystemAccessLevel["READONLY_SANDBOX"] = "READONLY_SANDBOX";
    /** Scoped to agent workspace only */
    FilesystemAccessLevel["WORKSPACE"] = "WORKSPACE";
    /** Workspace + approved mount points */
    FilesystemAccessLevel["EXTENDED"] = "EXTENDED";
    /** Full filesystem access (audited) */
    FilesystemAccessLevel["FULL"] = "FULL";
})(FilesystemAccessLevel || (FilesystemAccessLevel = {}));
/**
 * Default capabilities by trust tier
 */
export const TIER_CAPABILITIES = {
    0: {
        networkAccess: NetworkAccessLevel.NONE,
        filesystemAccess: FilesystemAccessLevel.READONLY_SANDBOX,
        maxMemoryMb: 256,
        maxCpuPercent: 25,
        maxExecutionMs: 30000,
        allowedEgressDomains: [],
        allowedMountPaths: [],
        canSpawnSubprocesses: false,
        canAccessSecrets: false,
        canCommunicateWithAgents: false,
    },
    1: {
        networkAccess: NetworkAccessLevel.NONE,
        filesystemAccess: FilesystemAccessLevel.READONLY_SANDBOX,
        maxMemoryMb: 512,
        maxCpuPercent: 25,
        maxExecutionMs: 60000,
        allowedEgressDomains: [],
        allowedMountPaths: [],
        canSpawnSubprocesses: false,
        canAccessSecrets: false,
        canCommunicateWithAgents: false,
    },
    2: {
        networkAccess: NetworkAccessLevel.INTERNAL,
        filesystemAccess: FilesystemAccessLevel.WORKSPACE,
        maxMemoryMb: 512,
        maxCpuPercent: 50,
        maxExecutionMs: 120000,
        allowedEgressDomains: ['*.internal', 'localhost'],
        allowedMountPaths: ['/workspace'],
        canSpawnSubprocesses: false,
        canAccessSecrets: false,
        canCommunicateWithAgents: false,
    },
    3: {
        networkAccess: NetworkAccessLevel.INTERNAL,
        filesystemAccess: FilesystemAccessLevel.WORKSPACE,
        maxMemoryMb: 1024,
        maxCpuPercent: 50,
        maxExecutionMs: 300000,
        allowedEgressDomains: ['*.internal', 'localhost'],
        allowedMountPaths: ['/workspace', '/data'],
        canSpawnSubprocesses: false,
        canAccessSecrets: true,
        canCommunicateWithAgents: false,
    },
    4: {
        networkAccess: NetworkAccessLevel.EXTERNAL,
        filesystemAccess: FilesystemAccessLevel.WORKSPACE,
        maxMemoryMb: 2048,
        maxCpuPercent: 75,
        maxExecutionMs: 600000,
        allowedEgressDomains: ['*'], // Policy-governed
        allowedMountPaths: ['/workspace', '/data', '/cache'],
        canSpawnSubprocesses: true,
        canAccessSecrets: true,
        canCommunicateWithAgents: false,
    },
    5: {
        networkAccess: NetworkAccessLevel.CROSS_AGENT,
        filesystemAccess: FilesystemAccessLevel.EXTENDED,
        maxMemoryMb: 4096,
        maxCpuPercent: 100,
        maxExecutionMs: 1800000,
        allowedEgressDomains: ['*'],
        allowedMountPaths: ['/workspace', '/data', '/cache', '/shared'],
        canSpawnSubprocesses: true,
        canAccessSecrets: true,
        canCommunicateWithAgents: true,
    },
    6: {
        networkAccess: NetworkAccessLevel.CROSS_AGENT,
        filesystemAccess: FilesystemAccessLevel.EXTENDED,
        maxMemoryMb: 8192,
        maxCpuPercent: 100,
        maxExecutionMs: 3600000,
        allowedEgressDomains: ['*'],
        allowedMountPaths: ['/workspace', '/data', '/cache', '/shared', '/admin'],
        canSpawnSubprocesses: true,
        canAccessSecrets: true,
        canCommunicateWithAgents: true,
    },
    7: {
        networkAccess: NetworkAccessLevel.FULL,
        filesystemAccess: FilesystemAccessLevel.FULL,
        maxMemoryMb: -1, // Unlimited
        maxCpuPercent: 100,
        maxExecutionMs: -1, // Unlimited
        allowedEgressDomains: ['*'],
        allowedMountPaths: ['*'],
        canSpawnSubprocesses: true,
        canAccessSecrets: true,
        canCommunicateWithAgents: true,
    },
};
// ============================================================================
// Sandbox Configuration
// ============================================================================
/**
 * Sandbox runtime type
 */
export var SandboxRuntime;
(function (SandboxRuntime) {
    /** Docker container with seccomp */
    SandboxRuntime["DOCKER"] = "DOCKER";
    /** gVisor for stronger isolation */
    SandboxRuntime["GVISOR"] = "GVISOR";
    /** Firecracker microVM */
    SandboxRuntime["FIRECRACKER"] = "FIRECRACKER";
    /** WebAssembly runtime */
    SandboxRuntime["WASM"] = "WASM";
    /** No isolation (T7 only, monitored) */
    SandboxRuntime["NONE"] = "NONE";
})(SandboxRuntime || (SandboxRuntime = {}));
// ============================================================================
// Sandbox Lifecycle
// ============================================================================
/**
 * Sandbox state
 */
export var SandboxState;
(function (SandboxState) {
    SandboxState["CREATING"] = "CREATING";
    SandboxState["READY"] = "READY";
    SandboxState["RUNNING"] = "RUNNING";
    SandboxState["PAUSED"] = "PAUSED";
    SandboxState["STOPPING"] = "STOPPING";
    SandboxState["STOPPED"] = "STOPPED";
    SandboxState["FAILED"] = "FAILED";
    SandboxState["DESTROYED"] = "DESTROYED";
})(SandboxState || (SandboxState = {}));
//# sourceMappingURL=types.js.map