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

Function claim

packages/opencode/test/cli/run/scrollback.surface.test.ts:27–39  ·  view source on GitHub ↗
(renderer: TestRenderer)

Source from the content-addressed store, hash-verified

25})
26
27function claim(renderer: TestRenderer): ClaimedCommit[] {
28 const queue = Reflect.get(renderer, "externalOutputQueue")
29 if (!queue || typeof queue !== "object" || !("claim" in queue) || typeof queue.claim !== "function") {
30 throw new Error("renderer missing external output queue")
31 }
32
33 const commits = queue.claim()
34 if (!Array.isArray(commits)) {
35 throw new Error("renderer external output queue returned invalid commits")
36 }
37
38 return commits as ClaimedCommit[]
39}
40
41function renderCommit(commit: ClaimedCommit) {
42 return decoder.decode(commit.snapshot.getRealCharBytes(true)).replace(/ +\n/g, "\n")

Callers 2

takeFunction · 0.70

Calls 1

getMethod · 0.65

Tested by

no test coverage detected