capsule-ai-cli
Version:
The AI Model Orchestrator - Intelligent multi-model workflows with device-locked licensing
27 lines • 958 B
JavaScript
import { contextManager } from '../../services/context.js';
export const deleteCommand = {
name: 'delete',
description: 'Delete a previous chat',
alias: ['del', 'rm'],
async execute() {
const contexts = contextManager.listContexts();
const currentContextId = contextManager.getCurrentContext().id;
const deletableContexts = contexts.filter(ctx => ctx.id !== currentContextId);
if (deletableContexts.length === 0) {
return {
success: false,
message: 'No previous chats to delete (cannot delete current chat)'
};
}
return {
success: true,
action: 'none',
data: {
type: 'chat-delete',
contexts: deletableContexts.sort((a, b) => b.created.getTime() - a.created.getTime()),
currentContextId
}
};
}
};
//# sourceMappingURL=delete.js.map