openai-cli-unofficial
Version:
A powerful OpenAI CLI Coding Agent built with TypeScript
48 lines • 1.7 kB
TypeScript
import { Messages } from '../../types/language';
import { Message } from '../../utils/token-calculator';
export interface Command {
value: string;
name: string;
description: string;
}
export interface CommandExecutionResult {
handled: boolean;
shouldExit?: boolean;
shouldContinue?: boolean;
newMessages?: Message[];
shouldReload?: boolean;
}
export declare class CommandManager {
private messages;
private commands;
private hasExportedHistory;
private isWaitingForFileImport;
private isWaitingForOverwriteConfirm;
private pendingImportFilePath;
constructor(messages: Messages);
private initializeCommands;
getCommands(): Command[];
filterCommands(query: string): Command[];
updateLanguage(messages: Messages): void;
resetStates(): void;
getHasExportedHistory(): boolean;
setHasExportedHistory(value: boolean): void;
handleInput(userInput: string, currentMessages: Message[]): Promise<CommandExecutionResult>;
private handleOverwriteConfirmation;
private handleFileImportWaiting;
private handleDirectFileImport;
private handleStandardCommand;
private handleCheckpointCommand;
private formatTaskName;
private handleExportHistory;
private handleImportHistory;
private handleEditHistory;
importHistoryFromFile(filePath: string, currentMessages: Message[]): Promise<CommandExecutionResult>;
handleExitWithHistoryCheck(currentMessages: Message[]): Promise<'export' | 'skip' | 'cancel'>;
isWaitingForFileImportState(): boolean;
/**
* 显示历史记录
*/
showHistory(messages: Message[]): Promise<void>;
}
//# sourceMappingURL=commands.d.ts.map