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

Function formatMessageRef

lib/message-ids.ts:24–35  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

22 }
23
24export function formatMessageRef(index: number): string {
25 if (
26 !Number.isInteger(index) ||
27 index < MESSAGE_REF_MIN_INDEX ||
28 index > MESSAGE_REF_MAX_INDEX
29 ) {
30 throw new Error(
31 `Message ID index out of bounds: ${index}. Supported range is 0-${MESSAGE_REF_MAX_INDEX}.`,
32 )
33 }
34 return `m${index.toString().padStart(MESSAGE_REF_WIDTH, "0")}`
35}
36
37export function formatBlockRef(blockId: number): string {
38 if (!Number.isInteger(blockId) || blockId < 1) {

Callers 2

parseBoundaryIdFunction · 0.85
allocateNextMessageRefFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected