(args: {
db: ReturnType<typeof createTestDb>;
dreamerEnabled?: boolean;
sessionId?: string;
cwd?: string;
params: Record<string, unknown>;
})
| 22 | import { createCtxNoteTool } from "./ctx-note"; |
| 23 | |
| 24 | async 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 | |
| 49 | describe("Pi ctx_note smart notes", () => { |
| 50 | it("matches OpenCode's default empty-read string", async () => { |
no test coverage detected