archivo del paquete→ .shtukbase/packages/harness-dsh/adapter.ts
adapter.ts
25 líneas, 1.6 KB.
El archivo tal como está en el paquete: el código y sus comentarios no se traducen.
- // DeepSeek Harness: `dsh --profile headless -` answers one task read from stdin and exits. The model goes in a patch
- // overlay for the entry agent-default-model (provider/model); file rights by DSH_PERMISSION_MODE (workspace-write
- // or read-only), the workspace is the working folder. dsh has no switch for the network: said in the notes.
- import { join } from 'node:path';
- import type { Adapter } from '../harness/lib/harness.ts';
- export const adapter: Adapter = {
- id: 'dsh', pkg: 'harness-dsh', bin: 'dsh', title: 'DeepSeek Harness', defaultModel: 'deepseek-official/deepseek-flash',
- install: 'from the source of deepseek-harness (pnpm install, then a link to dsh in PATH); the DeepSeek key is in the dsh settings',
- build(s) {
- const [provider, model] = s.model.includes('/') ? [s.model.slice(0, s.model.indexOf('/')), s.model.slice(s.model.indexOf('/') + 1)] : ['deepseek-official', s.model];
- const patch = join(s.tmp, 'model.patch.yml');
- return {
- exe: 'dsh',
- args: ['--profile', 'headless', '--patch', patch, '-'],
- env: { DSH_PERMISSION_MODE: s.access === 'write' ? 'workspace-write' : 'read-only' },
- stdin: s.prompt,
- files: [{ path: patch, text: `- id: agent-default-model\n name: '@deepseek-ai/dsh-agent-default-model'\n config:\n provider: ${JSON.stringify(provider)}\n model: ${JSON.stringify(model)}\n` }],
- notes: [
- ...(s.network ? [] : ['dsh cannot switch the network off: network: false cannot be held (the sandbox mode limits only files)']),
- ...(s.effort ? ['dsh does not take the effort from the command line: effort was not passed'] : []),
- ],
- };
- },
- };