@pod-protocol/cli
Version:
Command-line interface for PoD Protocol (Prompt or Die) AI Agent Communication Protocol
76 lines • 2.35 kB
TypeScript
import { PodComClient } from "@pod-protocol/sdk";
import { Keypair } from "@solana/web3.js";
import { EnhancedErrorHandler } from "./enhanced-error-handler.js";
import { OutputFormatter } from "./output-formatter.js";
/**
* Enhanced Command Context System
* Provides centralized context, logging, and diagnostics for CLI commands
*/
export interface CommandOptions {
verbose?: boolean;
debug?: boolean;
quiet?: boolean;
network?: string;
keypair?: string;
showBanner?: boolean;
}
export interface DiagnosticInfo {
timestamp: string;
command: string;
network: string;
walletAddress?: string;
clientVersion: string;
nodeVersion: string;
platform: string;
performance: {
startTime: number;
endTime?: number;
duration?: number;
};
errors: any[];
warnings: any[];
}
export declare class CommandContext {
readonly client: PodComClient;
readonly wallet: Keypair;
readonly options: CommandOptions;
readonly errorHandler: EnhancedErrorHandler;
readonly formatter: OutputFormatter;
readonly diagnostics: DiagnosticInfo;
private logBuffer;
constructor(client: PodComClient, wallet: Keypair, options?: CommandOptions, command?: string);
/**
* Log a message with appropriate level
*/
log(level: 'debug' | 'info' | 'warn' | 'error', message: string, data?: any): void;
/**
* Execute an operation with comprehensive error handling and diagnostics
*/
executeWithDiagnostics<T>(operation: () => Promise<T>, operationName: string): Promise<T>;
/**
* Validate network connectivity and program availability
*/
validateEnvironment(): Promise<void>;
/**
* Display comprehensive diagnostics
*/
displayDiagnostics(): void;
/**
* Display system information for troubleshooting
*/
displaySystemInfo(): void;
/**
* Export diagnostics for debugging
*/
exportDiagnostics(): string;
/**
* Cleanup resources and finalize
*/
finalize(): void;
private getClientVersion;
}
/**
* Factory function to create a command context
*/
export declare function createCommandContext(client: PodComClient, wallet: Keypair, options: CommandOptions, command: string): Promise<CommandContext>;
//# sourceMappingURL=command-context.d.ts.map