ShtukbaseStandard
файл пакета→ .shtukbase/packages/harness-dsh/adapter.ts

adapter.ts

25 строк, 1.6 КБ.

Файл как есть в пакете: код и комментарии в нём не переводятся.

  1. // DeepSeek Harness: `dsh --profile headless -` answers one task read from stdin and exits. The model goes in a patch
  2. // overlay for the entry agent-default-model (provider/model); file rights by DSH_PERMISSION_MODE (workspace-write
  3. // or read-only), the workspace is the working folder. dsh has no switch for the network: said in the notes.
  4. import { join } from 'node:path';
  5. import type { Adapter } from '../harness/lib/harness.ts';
  6. export const adapter: Adapter = {
  7. id: 'dsh', pkg: 'harness-dsh', bin: 'dsh', title: 'DeepSeek Harness', defaultModel: 'deepseek-official/deepseek-flash',
  8. install: 'from the source of deepseek-harness (pnpm install, then a link to dsh in PATH); the DeepSeek key is in the dsh settings',
  9. build(s) {
  10. const [provider, model] = s.model.includes('/') ? [s.model.slice(0, s.model.indexOf('/')), s.model.slice(s.model.indexOf('/') + 1)] : ['deepseek-official', s.model];
  11. const patch = join(s.tmp, 'model.patch.yml');
  12. return {
  13. exe: 'dsh',
  14. args: ['--profile', 'headless', '--patch', patch, '-'],
  15. env: { DSH_PERMISSION_MODE: s.access === 'write' ? 'workspace-write' : 'read-only' },
  16. stdin: s.prompt,
  17. 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` }],
  18. notes: [
  19. ...(s.network ? [] : ['dsh cannot switch the network off: network: false cannot be held (the sandbox mode limits only files)']),
  20. ...(s.effort ? ['dsh does not take the effort from the command line: effort was not passed'] : []),
  21. ],
  22. };
  23. },
  24. };