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

Function resolveRanges

lib/compress/range-utils.ts:41–68  ·  view source on GitHub ↗
(
    args: CompressRangeToolArgs,
    searchContext: SearchContext,
    state: SessionState,
)

Source from the content-addressed store, hash-verified

39}
40
41export function resolveRanges(
42 args: CompressRangeToolArgs,
43 searchContext: SearchContext,
44 state: SessionState,
45): ResolvedRangeCompression[] {
46 return args.content.map((entry, index) => {
47 const normalizedEntry = {
48 startId: entry.startId.trim(),
49 endId: entry.endId.trim(),
50 summary: entry.summary,
51 }
52
53 const { startReference, endReference } = resolveBoundaryIds(
54 searchContext,
55 state,
56 normalizedEntry.startId,
57 normalizedEntry.endId,
58 )
59 const selection = resolveSelection(searchContext, startReference, endReference)
60
61 return {
62 index,
63 entry: normalizedEntry,
64 selection,
65 anchorMessageId: resolveAnchorMessageId(startReference),
66 }
67 })
68}
69
70export function validateNonOverlapping(plans: ResolvedRangeCompression[]): void {
71 const sortedPlans = [...plans].sort(

Callers 1

executeFunction · 0.90

Calls 3

resolveBoundaryIdsFunction · 0.90
resolveSelectionFunction · 0.90
resolveAnchorMessageIdFunction · 0.90

Tested by

no test coverage detected