/** * RecourseOS Agent Gateway * * The enforcement layer that agents cannot bypass. * All infrastructure mutations flow through the gate. * * @example * ```typescript * import { RecourseGate } from 'recourse-cli/gateway'; * * const gate = new RecourseGate({ * environment: 'production', * protectedEnvironments: ['production', 'staging'], * onEscalate: async (result) => { * // Send to approval system, return true if approved * return await requestApproval(result); * }, * }); * * // All mutations go through the gate * const result = await gate.terraform.apply({ planFile: 'tfplan' }); * if (!result.executed) { * console.error('Blocked:', result.error); * } * ``` */ import { ShellGate } from './shell.js'; import { TerraformGate } from './terraform.js'; import { KubectlGate } from './kubectl.js'; import type { GatePolicy, GateResult } from './types.js'; export { ShellGate } from './shell.js'; export { TerraformGate } from './terraform.js'; export { KubectlGate } from './kubectl.js'; export * from './types.js'; export { runGatewayMcpServer, type GatewayMcpServerOptions } from './mcp-server.js'; export { InMemoryPlanStore, InMemoryApprovalStore, getPlanStore, getApprovalStore, setPlanStore, setApprovalStore, } from './stores.js'; export { runGatewayDoctor, type DoctorOptions } from './doctor.js'; export interface RecourseGateOptions extends Partial { /** Path to policy YAML file */ policyFile?: string; } /** * RecourseOS Agent Gateway * * Provides gated access to infrastructure mutation tools. * Every operation is evaluated before execution. */ export declare class RecourseGate { readonly terraform: TerraformGate; readonly shell: ShellGate; readonly kubectl: KubectlGate; private policy; constructor(options?: RecourseGateOptions); /** * Get the current policy configuration. */ getPolicy(): Readonly; /** * Update the policy at runtime. */ updatePolicy(updates: Partial): void; /** * Set the current environment. * Affects whether operations are escalated based on protected environments. */ setEnvironment(environment: string): void; /** * Quick evaluation without execution. * Useful for pre-flight checks. */ evaluate(type: 'shell' | 'terraform' | 'kubectl', input: string | unknown): Promise; private loadPolicy; } /** * Create a simple gate with default policy. * For quick usage without custom configuration. */ export declare function createGate(options?: RecourseGateOptions): RecourseGate; /** * Utility: Check if a result should block execution. */ export declare function shouldBlock(result: GateResult): boolean; /** * Utility: Format a gate result for logging/display. */ export declare function formatGateResult(result: GateResult): string; //# sourceMappingURL=index.d.ts.map