MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / allocateBlockId

Function allocateBlockId

lib/compress/state.ts:7–16  ·  view source on GitHub ↗
(state: SessionState)

Source from the content-addressed store, hash-verified

5export const COMPRESSED_BLOCK_HEADER = "[Compressed conversation section]"
6
7export function allocateBlockId(state: SessionState): number {
8 const next = state.prune.messages.nextBlockId
9 if (!Number.isInteger(next) || next < 1) {
10 state.prune.messages.nextBlockId = 2
11 return 1
12 }
13
14 state.prune.messages.nextBlockId = next + 1
15 return next
16}
17
18export function allocateRunId(state: SessionState): number {
19 const next = state.prune.messages.nextRunId

Callers 2

executeFunction · 0.90
executeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected