Download packages/api/session-controller/tests/remote/bench.client.ts from SaylorTwift/deepseek-harness: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/SaylorTwift/deepseek-harness/resolve/main/packages/api/session-controller/tests/remote/bench.client.ts
- Command line
-
hf download hf://SaylorTwift/deepseek-harness/packages/api/session-controller/tests/remote/bench.client.ts
-
curl -L -o bench.client.ts https://huggingface.co/SaylorTwift/deepseek-harness/resolve/main/packages/api/session-controller/tests/remote/bench.client.ts
1.19 kB
| /** Session objects owned by a client test's explicitly started Gateway assembly. */ | |
| import { onTestFinished } from 'vitest' | |
| import type { RemoteMock } from '@deepseek-ai/dsh-remote-mock' | |
| import type { TestClient } from '@deepseek-ai/dsh-client-test-runtime/src/assembly/index.ts' | |
| import type { SessionId } from '@deepseek-ai/dsh-session/types' | |
| import { Session, type SessionOptions } from '../../src/client/sessions/session.ts' | |
| import { sessionWorld } from './session.client.ts' | |
| /** | |
| * Create a Session after installing its default Remote responses. | |
| * @param mock - this case's Remote responses. | |
| * @param start - the fixture's lazy client startup. | |
| * @param sessionId - Session identity. | |
| * @param options - addressed child and parent availability, when applicable. | |
| * @returns the Session, disposed at the end of the case. | |
| */ | |
| export async function sessionBench( | |
| mock: RemoteMock, | |
| start: () => Promise<TestClient>, | |
| sessionId: SessionId, | |
| options: SessionOptions = {}, | |
| ): Promise<Session> { | |
| mock.load(sessionWorld) | |
| const client = await start() | |
| const session = new Session(sessionId, client.ctx.remote, options) | |
| onTestFinished(() => session.dispose()) | |
| return session | |
| } | |