MCPcopy Create free account
hub / github.com/cortexkit/magic-context / mainAgentRequests

Function mainAgentRequests

packages/e2e-tests/src/cache-analysis.ts:254–261  ·  view source on GitHub ↗
(requests: T[])

Source from the content-addressed store, hash-verified

252
253/** Filter to main-agent requests (those carrying the Magic Context system block). */
254export function mainAgentRequests<T extends MinimalRequest>(requests: T[]): T[] {
255 return requests.filter((r) => {
256 const sys = r.body.system;
257 if (sys === undefined || sys === null) return false;
258 const asString = typeof sys === "string" ? sys : JSON.stringify(sys);
259 return asString.includes("## Magic Context");
260 });
261}
262
263/**
264 * Extract the text of the first wire message whose content contains `marker`.

Callers 3

assertNoBustsFunction · 0.90

Calls

no outgoing calls

Tested by 1

assertNoBustsFunction · 0.72