@nanocollective/nanocoder
Version:
A local-first CLI coding agent that brings the power of agentic coding tools like Claude Code and Gemini CLI to local models or controlled APIs like OpenRouter
31 lines • 829 B
JavaScript
class CompressionBackup {
backup = null;
timestamp = null;
// Store a backup of messages before compression
storeBackup(messages) {
this.backup = messages.map(msg => ({ ...msg }));
this.timestamp = Date.now();
}
getBackup() {
return this.backup ? this.backup.map(msg => ({ ...msg })) : null;
}
hasBackup() {
return this.backup !== null;
}
getTimestamp() {
return this.timestamp;
}
clearBackup() {
this.backup = null;
this.timestamp = null;
}
restore() {
if (!this.backup) {
return null;
}
const restored = this.backup.map(msg => ({ ...msg }));
return restored;
}
}
export const compressionBackup = new CompressionBackup();
//# sourceMappingURL=compression-backup.js.map