(cwd: string)
| 8 | import type { ToolContext } from '../src/tools/base.js'; |
| 9 | |
| 10 | function makeCtx(cwd: string): ToolContext { |
| 11 | return { |
| 12 | cwd, |
| 13 | sessionId: 'test', |
| 14 | transaction: {} as any, |
| 15 | permissions: { check: () => ({ ok: true }) } as any, |
| 16 | askUser: async () => 'allow', |
| 17 | signal: new AbortController().signal, |
| 18 | emit: () => {}, |
| 19 | } as ToolContext; |
| 20 | } |
| 21 | |
| 22 | function gitSetup(cwd: string, args: string[]): void { |
| 23 | const r = spawnSync('git', args, { cwd, encoding: 'utf-8' }); |