UNPKG

@luxorai/sandbox

Version:

TypeScript SDK for Luxor Sandbox: cloud sandboxes (microVMs) for AI agents on Luxor Agent Cloud

35 lines (34 loc) • 1.66 kB
import { type EgressPolicy as EgressPolicyMessage, type SessionEgressPolicy as SessionEgressPolicyMessage } from "./internal/proto/tenki/sandbox/v1/sandbox_pb.js"; import type { EgressHttpRule, WorkspaceScopeOptions } from "./options.js"; import { type SessionEgressPolicy } from "./session.js"; /** The body of a named egress policy, checked by the server like an inline session policy. */ export interface EgressPolicySpec { allowDomains?: string[]; allowCidrs?: string[]; interceptHttps?: boolean; /** Extra public TCP ports bypass HTTP inspection and still require an allowed destination. */ allowedPorts?: number[]; publicEgress?: { tcpPorts?: number[]; udpPorts?: number[]; }; httpRules?: EgressHttpRule[]; } /** A named workspace egress policy that sessions pin with `egressPolicies`. */ export interface EgressPolicy { id: string; workspaceId: string; name: string; revision: number; /** The stored policy; its policyNames is always empty. */ egress: SessionEgressPolicy; /** Sessions not yet terminated that pinned this policy. */ activeSessionCount: number; createdAt?: Date; updatedAt?: Date; deletedAt?: Date; } export declare function egressPolicySpecToProto(spec: EgressPolicySpec): SessionEgressPolicyMessage; export declare function egressPolicyFromMessage(policy: EgressPolicyMessage | undefined): EgressPolicy; export declare function workspaceScope(options?: WorkspaceScopeOptions): string | undefined; export declare function publicEgressAcknowledged(requested: EgressPolicySpec["publicEgress"], actual: SessionEgressPolicy["publicEgress"]): boolean;