mira-consciousness
Version:
Memory & Intelligence Retention Archive - Preserving The Spark
64 lines • 1.93 kB
TypeScript
/**
* Cross-Platform Command Utilities
* ================================
*
* Provides cross-platform alternatives for common shell commands
* to ensure MIRA works correctly on Windows, macOS, and Linux.
*/
import { SpawnOptions } from 'child_process';
/**
* Cross-platform directory listing
* Replacement for Unix 'ls' and Windows 'dir'
*/
export declare function listDirectory(dirPath: string, options?: {
detailed?: boolean;
hidden?: boolean;
sort?: 'name' | 'time' | 'size';
}): Promise<string[]>;
/**
* Cross-platform file search
* Replacement for Unix 'find' and Windows 'where'
*/
export declare function findFiles(startPath: string, pattern: string | RegExp, options?: {
type?: 'file' | 'directory';
maxDepth?: number;
excludeDirs?: string[];
}): Promise<string[]>;
/**
* Cross-platform process listing
* Replacement for Unix 'ps' and Windows 'tasklist'
*/
export declare function listProcesses(): {
pid: number;
name: string;
cmd?: string;
}[];
/**
* Cross-platform environment variable handling
*/
export declare function getEnvironmentVariable(name: string): string | undefined;
/**
* Cross-platform command execution with proper escaping
*/
export declare function executeCommand(command: string, args?: string[], options?: SpawnOptions): Promise<{
stdout: string;
stderr: string;
code: number;
}>;
/**
* Cross-platform file permissions
*/
export declare function setFilePermissions(filePath: string, mode: string | number): Promise<void>;
/**
* Cross-platform temporary directory creation
*/
export declare function createTempDirectory(prefix?: string): Promise<string>;
/**
* Cross-platform path resolution
*/
export declare function resolvePath(...paths: string[]): string;
/**
* Check if a command exists on the system
*/
export declare function commandExists(command: string): boolean;
//# sourceMappingURL=crossPlatformCommands.d.ts.map