Download packages/ptc-runtime/ptc-runtime-node/tests/setup.ts from SaylorTwift/deepseek-harness: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/SaylorTwift/deepseek-harness/resolve/main/packages/ptc-runtime/ptc-runtime-node/tests/setup.ts
- Command line
-
hf download hf://SaylorTwift/deepseek-harness/packages/ptc-runtime/ptc-runtime-node/tests/setup.ts
-
curl -L -o setup.ts https://huggingface.co/SaylorTwift/deepseek-harness/resolve/main/packages/ptc-runtime/ptc-runtime-node/tests/setup.ts
1.26 kB
| import { Context } from '@deepseek-ai/cordis' | |
| import { onTestFinished } from 'vitest' | |
| import SessionStore from '@deepseek-ai/dsh-session' | |
| import FileSystem from '@deepseek-ai/dsh-fs-local' | |
| import Subprocess from '@deepseek-ai/dsh-subprocess-local' | |
| import Sandbox from '@deepseek-ai/dsh-sandbox-local' | |
| import SandboxPolicy from '@deepseek-ai/dsh-sandbox-policy' | |
| import SessionProjections from '@deepseek-ai/dsh-session-projection' | |
| import type { SandboxMode } from '@deepseek-ai/dsh-sandbox' | |
| import NodeRuntime from '../src/index.ts' | |
| import type { Config } from '../src/index.ts' | |
| export async function mountRuntime(ctx: Context, config: Config = {}, policy: { mode?: SandboxMode; workspaceRoot?: string } = {}) { | |
| onTestFinished(async () => { await ctx.fiber.dispose() }) | |
| if (!ctx.get('sessions')) await ctx.plugin(SessionStore) | |
| if (!ctx.get('fs')) await ctx.plugin(FileSystem) | |
| if (!ctx.get('subprocess')) await ctx.plugin(Subprocess) | |
| if (!ctx.get('sandbox')) await ctx.plugin(Sandbox, {}) | |
| if (!ctx.get('sessionProjections')) await ctx.plugin(SessionProjections) | |
| if (!ctx.get('sandboxPolicy')) await ctx.plugin(SandboxPolicy, { mode: 'danger-full-access', ...policy }) | |
| await ctx.plugin(NodeRuntime, config) | |
| return ctx.ptcRuntime as NodeRuntime | |
| } | |