| 4 | import type { SDKRpcClientBase } from '#/rpc'; |
| 5 | |
| 6 | function makeSession() { |
| 7 | const rpc = { |
| 8 | createGoal: vi.fn(async () => ({ goalId: 'g1' })), |
| 9 | getGoal: vi.fn(async () => ({ goal: null })), |
| 10 | pauseGoal: vi.fn(async () => ({ goalId: 'g1' })), |
| 11 | resumeGoal: vi.fn(async () => ({ goalId: 'g1' })), |
| 12 | cancelGoal: vi.fn(async () => ({ goalId: 'g1' })), |
| 13 | clearSessionHandlers: vi.fn(), |
| 14 | } as unknown as SDKRpcClientBase; |
| 15 | const session = new Session({ id: 'ses_goal', workDir: '/tmp/work', rpc }); |
| 16 | return { session, rpc }; |
| 17 | } |
| 18 | |
| 19 | describe('Session goal methods', () => { |
| 20 | it('createGoal forwards the supported payload with sessionId', async () => { |