MCPcopy Index your code
hub / github.com/anomalyco/opencode / buildLayer

Function buildLayer

packages/core/test/models.test.ts:90–98  ·  view source on GitHub ↗
(state: Ref.Ref<MockState>)

Source from the content-addressed store, hash-verified

88 )
89
90const buildLayer = (state: Ref.Ref<MockState>) =>
91 // Layer.fresh is required because the ModelsDev implementation is a module-level Layer constant,
92 // and Effect.provide uses a process-global MemoMap by default — without fresh,
93 // every test would reuse the cachedInvalidateWithTTL state from the first run.
94 Layer.fresh(
95 AppNodeBuilder.build(ModelsDev.node, [
96 [LayerNodePlatform.httpClient, Layer.succeed(HttpClient.HttpClient, makeMockClient(state))],
97 ]),
98 )
99
100const writeCacheText = (text: string, mtimeMs?: number) =>
101 Effect.promise(async () => {

Callers 2

providedFunction · 0.85
models.test.tsFile · 0.85

Calls 1

makeMockClientFunction · 0.85

Tested by

no test coverage detected