MCPcopy Create free account
hub / github.com/Noumena-Network/code / recordContextCollapseSnapshot

Function recordContextCollapseSnapshot

src/utils/sessionStorage.ts:1721–1739  ·  view source on GitHub ↗
(snapshot: {
  staged: Array<{
    startUuid: string
    endUuid: string
    summary: string
    risk: number
    stagedAt: number
  }>
  armed: boolean
  lastSpawnTokens: number
})

Source from the content-addressed store, hash-verified

1719 * restore — the loader keeps only the most recent snapshot entry.
1720 */
1721export async function recordContextCollapseSnapshot(snapshot: {
1722 staged: Array<{
1723 startUuid: string
1724 endUuid: string
1725 summary: string
1726 risk: number
1727 stagedAt: number
1728 }>
1729 armed: boolean
1730 lastSpawnTokens: number
1731}): Promise<void> {
1732 const sessionId = getSessionId() as UUID
1733 if (!sessionId) return
1734 await getProject().appendEntry({
1735 type: 'marble-origami-snapshot',
1736 sessionId,
1737 ...snapshot,
1738 })
1739}
1740
1741export async function flushSessionStorage(): Promise<void> {
1742 await getProject().flush()

Callers

nothing calls this directly

Calls 3

getSessionIdFunction · 0.85
getProjectFunction · 0.85
appendEntryMethod · 0.80

Tested by

no test coverage detected