/** * Safe Argument Builder * * Input sanitization to prevent command injection. */ export interface BuildOptions { print?: boolean; outputFormat?: 'json' | 'text' | 'stream-json'; prompt: string; model?: string; maxTokens?: number; temperature?: number; systemPrompt?: string; allowedTools?: string[]; dangerouslySkipPermissions?: boolean; /** Session ID for linking to JSONL logs (used for token tracking) */ sessionId?: string; } export declare class SafeArgumentBuilder { /** * Build command line arguments for Claude CLI. */ static build(options: BuildOptions): string[]; /** * Sanitize input string by removing dangerous characters. */ static sanitize(input: string): string; /** * Validate a simple value (no shell metacharacters). */ static validateSimpleValue(value: string, fieldName: string): void; /** * Validate a prompt (allows newlines but not shell metacharacters). */ static validatePrompt(prompt: string, fieldName: string): void; /** * Validate input length. */ private static validateLength; /** * Validate working directory path. */ static validateWorkingDirectory(dir: string): boolean; /** * Escape a string for safe use in shell (if absolutely necessary). * Prefer using spawn with args array instead of shell execution. */ static escapeForShell(input: string): string; } /** * Convenience function to build arguments. */ export declare function buildSafeArgs(options: BuildOptions): string[]; /** * Convenience function to validate working directory. */ export declare function isValidWorkingDirectory(dir: string): boolean; //# sourceMappingURL=safe-args.d.ts.map