export type Platform = "windows" | "macos" | "linux";
export interface ExecResult {
stdout: string;
stderr: string;
exitCode: number | null;
timedOut: boolean;
shell: string;
platform: Platform;
command: string;
durationMs: number;
}
export interface ExecOptions {
timeoutMs?: number;
cwd?: string;
shellPath?: string;
windowsShell?: "powershell" | "cmd";
env?: Record<string, string>;
stdin?: string;
maxOutputBytes?: number;
retryCount?: number;
retryDelayMs?: number;
args?: string[];
}
export interface RunProcessResult {
stdout: string;
stderr: string;
exitCode: number | null;
timedOut: boolean;
durationMs: number;
platform: Platform;
signal?: string;
}
export interface RetryOptions {
maxRetries?: number;
retryDelayMs?: number;
retryOnCodes?: string[];
}
export interface ShellInfo {
name: string;
path: string;
platform: Platform;
}
export interface FileStats {
size: number;
createdAt: Date;
modifiedAt: Date;
accessedAt: Date;
isDirectory: boolean;
isFile: boolean;
isSymbolicLink: boolean;
}
export interface DirectoryEntry {
name: string;
path: string;
isDirectory: boolean;
isFile: boolean;
size: number;
createdAt: Date;
modifiedAt: Date;
}
export interface ZipCreateResult {
success: boolean;
outputPath: string;
filesCount: number;
totalUncompressedSize: number;
compressedSize: number;
error?: string;
}
export interface ZipExtractResult {
success: boolean;
extractedFiles: string[];
error?: string;
}
export interface ZipListResult {
success: boolean;
entries: Array<{ name: string; compressedSize: number; uncompressedSize: number; isDirectory: boolean }>;
error?: string;
}
export interface SystemInfo {
platform: string;
arch: string;
hostname: string;
cpuCount: number;
totalMemory: number;
freeMemory: number;
memoryPercent: number;
loadAvg: { load1: number; load5: number; load15: number };
uptime: number;
tempDir: string;
homeDir: string;
cpus: Array<{ model: string; speed: number; usage: number }>;
}
export interface NetworkInterfaceInfo {
name: string;
family: "IPv4" | "IPv6";
address: string;
netmask: string;
mac: string;
internal: boolean;
cidr?: string;
description?: string;
}
export interface ExecParamValidation {
timeoutMs?: number;
maxOutputBytes?: number;
cwd?: string;
env?: Record<string, string>;
stdin?: string;
args?: string[];
}
export interface ProcessInfo {
pid: number;
name: string;
cpuUsage: number;
memoryUsage: string;
status: string;
}