MCPcopy
hub / github.com/anomalyco/opencode / replaceObservation

Function replaceObservation

packages/core/src/system-context/index.ts:287–291  ·  view source on GitHub ↗
(entries: ReadonlyArray<Entry>, previous: Snapshot)

Source from the content-addressed store, hash-verified

285}
286
287function replaceObservation(entries: ReadonlyArray<Entry>, previous: Snapshot): ReplacementResult {
288 if (entries.some((entry) => entry._tag === "Unavailable" && getSnapshot(previous, entry.key) !== undefined))
289 return { _tag: "ReplacementBlocked" }
290 return { _tag: "ReplacementReady", generation: initializeObservation(entries) }
291}
292
293function context(sources: ReadonlyArray<PackedSource>): SystemContext {
294 return { [ContextTypeId]: sources }

Callers 2

reconcileFunction · 0.85
replaceFunction · 0.85

Calls 2

getSnapshotFunction · 0.85
initializeObservationFunction · 0.85

Tested by

no test coverage detected