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

Function callNote

packages/pi-plugin/src/tools/ctx-note-smart.test.ts:24–47  ·  view source on GitHub ↗
(args: {
	db: ReturnType<typeof createTestDb>;
	dreamerEnabled?: boolean;
	sessionId?: string;
	cwd?: string;
	params: Record<string, unknown>;
})

Source from the content-addressed store, hash-verified

22import { createCtxNoteTool } from "./ctx-note";
23
24async function callNote(args: {
25 db: ReturnType<typeof createTestDb>;
26 dreamerEnabled?: boolean;
27 sessionId?: string;
28 cwd?: string;
29 params: Record<string, unknown>;
30}) {
31 const tool = createCtxNoteTool({
32 db: args.db,
33 dreamerEnabled: args.dreamerEnabled,
34 });
35 const result = await tool.execute(
36 "call-1",
37 args.params,
38 new AbortController().signal,
39 undefined,
40 fakeContext(
41 args.sessionId ?? "ses-note-1",
42 args.cwd ?? process.cwd(),
43 ) as never,
44 );
45 const text = (result.content[0] as { text: string }).text;
46 return { result, text, isError: result.isError === true };
47}
48
49describe("Pi ctx_note smart notes", () => {
50 it("matches OpenCode's default empty-read string", async () => {

Callers 1

Calls 2

createCtxNoteToolFunction · 0.90
fakeContextFunction · 0.90

Tested by

no test coverage detected