import { StorageManager, LogManager } from '../storage/index.js'; import { EnvCPConfig, ToolDefinition, LogsRole, RateLimitConfig } from '../types.js'; import { SessionManager } from '../utils/session.js'; import * as http from 'node:http'; export declare abstract class BaseAdapter { protected storage: StorageManager; protected logs: LogManager; protected sessionManager: SessionManager; protected config: EnvCPConfig; protected projectPath: string; protected tools: Map; constructor(config: EnvCPConfig, projectPath: string, password?: string, vaultPath?: string, sessionPath?: string); protected registerTools(): void; protected registerDefaultTools(): void; protected readLogs(args: { date?: string; operation?: string; variable?: string; source?: string; success?: boolean; tail?: number; }): Promise<{ entries: import('../types.js').OperationLog[]; count: number; role: LogsRole; }>; init(): Promise; protected ensurePassword(): Promise; getToolDefinitions(): ToolDefinition[]; protected getStructuredToolDefinitions(): Array<{ name: string; description: string; parameters: { type: 'object'; properties: Record; required?: string[]; }; }>; protected currentClientId: string; callTool(name: string, params: Record, clientId?: string): Promise; protected resolveLogsRole(clientId: string): LogsRole; protected logEvent(entry: import('../types.js').OperationLog): Promise; protected listVariables(args: { tags?: string[]; }): Promise<{ variables: Array; count: number; }>; protected getVariable(args: { name: string; show_value?: boolean; variable_password?: string; }): Promise<{ name: string; value: string; tags?: string[]; description?: string; encrypted: boolean; protected: boolean; }>; protected setVariable(args: { name: string; value: string; tags?: string[]; description?: string; protect?: boolean; unprotect?: boolean; variable_password?: string; }): Promise<{ success: boolean; message: string; }>; protected deleteVariable(args: { name: string; }): Promise<{ success: boolean; message: string; }>; private canonicalizeEnvPath; protected syncToEnv(): Promise<{ success: boolean; message: string; }>; protected addToEnv(args: { name: string; env_file?: string; }): Promise<{ success: boolean; message: string; }>; protected checkAccess(args: { name: string; }): Promise<{ name: string; accessible: boolean; message: string; }>; private parseCommand; private validateCommand; /** * Detects destructive rm invocations targeting the root filesystem. * Checks for recursive (-r/--recursive) + any arg that resolves to /, including * path-equivalent variants like //, /./, /../ (normalized before comparison). */ private checkRootDelete; /** * Validates that a critical environment variable value is safe. * Rejects HOME/TMPDIR set to root, and PATH entries containing `..` as a path segment. * OWASP A01:2025 – CWE-22 (Path Traversal) via environment variable manipulation */ private validateEnvVarValue; protected runCommand(args: { command: string; variables: string[]; }): Promise<{ exitCode: number | null; stdout: string; stderr: string; }>; protected createHttpServer(opts: { port: number; host: string; apiKey?: string; rateLimitConfig?: RateLimitConfig; defaultClientId: string; authHeaderFn: (req: http.IncomingMessage) => string | undefined; onRequest: (req: http.IncomingMessage, res: http.ServerResponse, pathname: string, clientId: string) => Promise; authFailureResponse?: (message: string) => unknown; internalErrorResponse?: (message: string) => unknown; healthEndpoints: string[]; mode: string; }): Promise; } //# sourceMappingURL=base.d.ts.map