/** * Global Process Registry - Cross-Instance Process Tracking * * Provides functionality to list all WrongStack instances running on the system, * track their processes, and display detailed status information. */ import { type PersistentProcessEntry } from './process-registry-persistent.js'; /** * Represents a WrongStack instance's aggregated information. */ export interface InstanceInfo { instanceId: string; hostname: string; mainPid: number; startedAt: number; lastActivity: number; status: 'active' | 'idle' | 'stale'; processCount: number; processes: PersistentProcessEntry[]; sessionIds: Set; } /** * Counts of instances by status. */ export interface InstanceCounts { total: number; active: number; idle: number; stale: number; byHostname: Map; } /** * Global process status encompassing all instances. */ export interface GlobalProcessStatus { localInstance: { instanceId: string; mainPid: number; protectedCount: number; platform: string; hostname: string; uptime: number; }; allInstances: Array<{ instanceId: string; hostname: string; mainPid: number; processes: PersistentProcessEntry[]; startedAt: number; lastActivity: number; }>; summary: { totalProcesses: number; protectedCount: number; staleCount: number; instanceCount: number; activeInstanceCount: number; }; timestamp: number; } /** * Options for filtering instance listings. */ export interface InstanceListOptions { /** Include stale instances in the list */ includeStale?: boolean; /** Filter by hostname pattern (supports glob patterns) */ hostname?: string; /** Filter by instance status */ status?: 'active' | 'idle' | 'stale' | 'all'; } /** * Get list of all known instances (from persistent registry). */ export declare function listInstances(options?: InstanceListOptions): Promise; /** * Get counts of instances by status. */ export declare function getInstanceCount(): Promise; /** * Get global process status across all instances. */ export declare function getGlobalProcessStatus(): Promise; /** * Format the global status as a human-readable string for display. */ export declare function formatGlobalStatus(): Promise; /** * Format a clean instance list suitable for display. */ export declare function formatInstanceList(options?: InstanceListOptions): Promise; /** * Format instance details as a compact summary string. */ export declare function formatInstanceSummary(): Promise; /** * Create the global /ps slash command. */ export declare function createGlobalPsSlashCommand(): { name: 'ps'; description: string; handler(input: string): Promise<{ message: string; }>; }; //# sourceMappingURL=ps-slash.d.ts.map