MCPcopy Create free account
hub / github.com/anomalyco/opencode / createSessionKeyReader

Function createSessionKeyReader

packages/app/src/context/layout-helpers.ts:9–16  ·  view source on GitHub ↗
(sessionKey: string | Accessor<string>, ensure: (key: string) => void)

Source from the content-addressed store, hash-verified

7}
8
9export function createSessionKeyReader(sessionKey: string | Accessor<string>, ensure: (key: string) => void) {
10 const key = typeof sessionKey === "function" ? sessionKey : () => sessionKey
11 return () => {
12 const value = key()
13 ensure(value)
14 return value
15 }
16}
17
18export function pruneSessionKeys(input: {
19 keep?: string

Callers 3

viewFunction · 0.90
tabsFunction · 0.90
layout.test.tsFile · 0.90

Calls 2

keyFunction · 0.70
ensureFunction · 0.70

Tested by

no test coverage detected