MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / ExportSnapshot

Method ExportSnapshot

skills/persistence.go:161–187  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

159}
160
161func (p *SkillPersistence) ExportSnapshot() map[string]any {
162 if p == nil {
163 return nil
164 }
165 p.mu.Lock()
166 defer p.mu.Unlock()
167 scopes := map[string]any{}
168 for scope, records := range p.records {
169 scopeRecords := map[string]any{}
170 for name, record := range records {
171 scopeRecords[name] = map[string]any{
172 "name": record.Name,
173 "path": record.Path,
174 "content": record.Content,
175 "invoked_at": record.InvokedAt,
176 "agent_scope": record.AgentScope,
177 "last_turn_index": record.LastTurnIndex,
178 "invocation_count": record.InvocationCount,
179 }
180 }
181 scopes[scope] = scopeRecords
182 }
183 return map[string]any{
184 "version": SkillRecoverySnapshotVersion,
185 "agent_scopes": scopes,
186 }
187}
188
189func (p *SkillPersistence) ImportSnapshot(snapshot map[string]any) {
190 if p == nil {

Callers 4

runREPLFunction · 0.45
handleREPLSlashCommandFunction · 0.45
persistStateSnapshotMethod · 0.45

Calls

no outgoing calls

Tested by 1