MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / makeSession

Function makeSession

packages/node-sdk/test/session-goal.test.ts:6–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import type { SDKRpcClientBase } from '#/rpc';
5
6function 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
19describe('Session goal methods', () => {
20 it('createGoal forwards the supported payload with sessionId', async () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected