MCPcopy Create free account
hub / github.com/anomalyco/opencode / selectSequential

Function selectSequential

packages/http-recorder/src/matching.ts:95–106  ·  view source on GitHub ↗
(
  interactions: ReadonlyArray<HttpInteraction>,
  incoming: RequestSnapshot,
  match: RequestMatcher,
  index: number,
)

Source from the content-addressed store, hash-verified

93}
94
95export const selectSequential = (
96 interactions: ReadonlyArray<HttpInteraction>,
97 incoming: RequestSnapshot,
98 match: RequestMatcher,
99 index: number,
100): { readonly interaction: HttpInteraction | undefined; readonly detail: string } => {
101 const interaction = interactions[index]
102 if (!interaction) return { interaction, detail: `interaction ${index + 1} of ${interactions.length} not recorded` }
103 if (!match(incoming, interaction.request))
104 return { interaction: undefined, detail: requestDiff(interaction.request, incoming).join("\n") }
105 return { interaction, detail: "" }
106}

Callers 1

recordingLayerFunction · 0.85

Calls 2

requestDiffFunction · 0.85
matchFunction · 0.50

Tested by

no test coverage detected