MCPcopy
hub / github.com/Doorman11991/smallcode / save

Method save

src/session/persistence.js:92–101  ·  view source on GitHub ↗
(messages, metadata = {})

Source from the content-addressed store, hash-verified

90
91 // Save current session state
92 save(messages, metadata = {}) {
93 if (!this.current) return;
94 this.current.messages = messages;
95 this.current.updatedAt = new Date().toISOString();
96 if (metadata.tokens) this.current.tokens = metadata.tokens;
97 if (metadata.cost) this.current.cost = metadata.cost;
98 if (metadata.toolCalls) this.current.toolCalls = metadata.toolCalls;
99 if (metadata.title) this.current.title = metadata.title;
100 this._save(this.current);
101 }
102
103 // Auto-title from first user message
104 autoTitle(messages) {

Callers

nothing calls this directly

Calls 1

_saveMethod · 0.95

Tested by

no test coverage detected