( agentType: string, scope: AgentMemoryScope, snapshotTimestamp: string, )
| 77 | } |
| 78 | |
| 79 | async 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. |
no test coverage detected