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

Function formatBlockRef

lib/message-ids.ts:37–42  ·  view source on GitHub ↗
(blockId: number)

Source from the content-addressed store, hash-verified

35}
36
37export function formatBlockRef(blockId: number): string {
38 if (!Number.isInteger(blockId) || blockId < 1) {
39 throw new Error(`Invalid block ID: ${blockId}`)
40 }
41 return `b${blockId}`
42}
43
44export function parseMessageRef(ref: string): number | null {
45 const normalized = ref.trim().toLowerCase()

Callers 3

buildBoundaryLookupFunction · 0.90
wrapCompressedSummaryFunction · 0.90
parseBoundaryIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected