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

Function callDrop

packages/pi-plugin/src/tools/ctx-reduce.test.ts:48–67  ·  view source on GitHub ↗
(args: {
	db: ReturnType<typeof createTestDb>;
	sessionId: string;
	drop: string;
	protectedTags?: number;
})

Source from the content-addressed store, hash-verified

46}
47
48async function callDrop(args: {
49 db: ReturnType<typeof createTestDb>;
50 sessionId: string;
51 drop: string;
52 protectedTags?: number;
53}) {
54 const tool = createCtxReduceTool({
55 db: args.db,
56 protectedTags: args.protectedTags ?? 0,
57 });
58 const result = await tool.execute(
59 "call-1",
60 { drop: args.drop },
61 new AbortController().signal,
62 undefined,
63 fakeContext(args.sessionId) as never,
64 );
65 const text = (result.content[0] as { text: string }).text;
66 return { result, text, isError: result.isError === true };
67}
68
69describe("Pi ctx_reduce tool", () => {
70 it("queues a drop for a known active tag", async () => {

Callers 1

ctx-reduce.test.tsFile · 0.85

Calls 2

createCtxReduceToolFunction · 0.90
fakeContextFunction · 0.90

Tested by

no test coverage detected