(cwd: string)
| 11 | import type { ToolContext } from '../src/tools/base.js'; |
| 12 | |
| 13 | function makeCtx(cwd: string): ToolContext { |
| 14 | return { |
| 15 | cwd, |
| 16 | sessionId: 'test', |
| 17 | transaction: {} as any, |
| 18 | permissions: { check: () => ({ ok: true }) } as any, |
| 19 | askUser: async () => 'allow', |
| 20 | signal: new AbortController().signal, |
| 21 | emit: () => {}, |
| 22 | } as ToolContext; |
| 23 | } |
| 24 | |
| 25 | /** Run a git command synchronously in the given dir for test setup. */ |
| 26 | function gitSetup(cwd: string, args: string[]): void { |