MCPcopy Create free account
hub / github.com/anus-dev/ANUS / saveCheckpoint

Method saveCheckpoint

packages/core/src/core/logger.ts:313–327  ·  view source on GitHub ↗
(conversation: Content[], tag: string)

Source from the content-addressed store, hash-verified

311 }
312
313 async saveCheckpoint(conversation: Content[], tag: string): Promise<void> {
314 if (!this.initialized) {
315 console.error(
316 'Logger not initialized or checkpoint file path not set. Cannot save a checkpoint.',
317 );
318 return;
319 }
320 // Always save with the new encoded path.
321 const path = this._checkpointPath(tag);
322 try {
323 await fs.writeFile(path, JSON.stringify(conversation, null, 2), 'utf-8');
324 } catch (error) {
325 console.error('Error writing to checkpoint file:', error);
326 }
327 }
328
329 async loadCheckpoint(tag: string): Promise<Content[]> {
330 if (!this.initialized) {

Callers 2

logger.test.tsFile · 0.80
chatCommand.tsFile · 0.80

Calls 1

_checkpointPathMethod · 0.95

Tested by

no test coverage detected