(snapshot: {
staged: Array<{
startUuid: string
endUuid: string
summary: string
risk: number
stagedAt: number
}>
armed: boolean
lastSpawnTokens: number
})
| 1561 | * restore — the loader keeps only the most recent snapshot entry. |
| 1562 | */ |
| 1563 | export async function recordContextCollapseSnapshot(snapshot: { |
| 1564 | staged: Array<{ |
| 1565 | startUuid: string |
| 1566 | endUuid: string |
| 1567 | summary: string |
| 1568 | risk: number |
| 1569 | stagedAt: number |
| 1570 | }> |
| 1571 | armed: boolean |
| 1572 | lastSpawnTokens: number |
| 1573 | }): Promise<void> { |
| 1574 | const sessionId = getSessionId() as UUID |
| 1575 | if (!sessionId) return |
| 1576 | await getProject().appendEntry({ |
| 1577 | type: 'marble-origami-snapshot', |
| 1578 | sessionId, |
| 1579 | ...snapshot, |
| 1580 | }) |
| 1581 | } |
| 1582 | |
| 1583 | export async function flushSessionStorage(): Promise<void> { |
| 1584 | await getProject().flush() |
nothing calls this directly
no test coverage detected