MCPcopy
hub / github.com/codeaashu/claude-code / saveSyncedMeta

Function saveSyncedMeta

src/tools/AgentTool/agentMemorySnapshot.ts:79–93  ·  view source on GitHub ↗
(
  agentType: string,
  scope: AgentMemoryScope,
  snapshotTimestamp: string,
)

Source from the content-addressed store, hash-verified

77}
78
79async function saveSyncedMeta(
80 agentType: string,
81 scope: AgentMemoryScope,
82 snapshotTimestamp: string,
83): Promise<void> {
84 const syncedPath = getSyncedJsonPath(agentType, scope)
85 const localMemDir = getAgentMemoryDir(agentType, scope)
86 await mkdir(localMemDir, { recursive: true })
87 const meta: SyncedMeta = { syncedFrom: snapshotTimestamp }
88 try {
89 await writeFile(syncedPath, jsonStringify(meta))
90 } catch (e) {
91 logForDebugging(`Failed to save snapshot sync metadata: ${e}`)
92 }
93}
94
95/**
96 * Check if a snapshot exists and whether it's newer than what we last synced.

Callers 3

initializeFromSnapshotFunction · 0.85
replaceFromSnapshotFunction · 0.85
markSnapshotSyncedFunction · 0.85

Calls 5

getSyncedJsonPathFunction · 0.85
getAgentMemoryDirFunction · 0.85
mkdirFunction · 0.85
jsonStringifyFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected