| 182 | import type { ToolContext } from '../src/tools/base.js'; |
| 183 | |
| 184 | function makeCtx(cwd: string): ToolContext { |
| 185 | // The three navigation tools are read-only and don't touch transaction/permissions, |
| 186 | // so a loose stub is fine. Cast through unknown to silence the strict ToolContext type. |
| 187 | return { |
| 188 | cwd, |
| 189 | sessionId: 'test', |
| 190 | transaction: {} as any, |
| 191 | permissions: { check: () => ({ ok: true }) } as any, |
| 192 | askUser: async () => 'allow', |
| 193 | signal: new AbortController().signal, |
| 194 | onUiEvent: () => {}, |
| 195 | } as ToolContext; |
| 196 | } |
| 197 | |
| 198 | describe('Code graph: navigation tools (v0.4.0)', () => { |
| 199 | it('find_callers locates call sites and excludes the definition line', async () => { |