DeepSeek Harness开源版保姆级教程

1.开源仓库

https://github.com/deepseek-ai/deepseek-harness

如果github访问不稳定,也可以试试gitee, 以下是我fork的一份到gitee

https://gitee.com/SandwichBoy/deepseek-harness.git

2.初始化项目

复制代码
$ node -v
v16.20.2

Administrator@USER-20230930SH MINGW64 /d/git/deepseek-harness (master)
$ pnpm install
ERROR: This version of pnpm requires at least Node.js v18.12
The current version of Node.js is v16.20.2
Visit https://r.pnpm.io/comp to see the list of past pnpm versions with respective Node.js version support.

可见要求Node.js v18.12 或以上版本

还好我这里有高低版本,切换一下版本, 再安装依赖

复制代码
$ nvm list

    20.11.1
  * 16.20.2 (Currently using 64-bit executable)

$ nvm use 20.11.1
Now using node v20.11.1 (64-bit)

$ pnpm install
 WARN  Unsupported engine: wanted: {"node":"^22.19.0 || >=24.0.0"} (current: {"node":"v20.11.1","pnpm":"9.12.1"})
native/landlock-run/packages/linux-arm64 |  WARN  Unsupported platform: wanted: {"cpu":["arm64"],"os":["linux"],"libc":["any"]} (current: {"os":"win32","cpu":"x64","libc":"unknown"})
native/landlock-run/packages/linux-x64   |  WARN  Unsupported platform: wanted: {"cpu":["x64"],"os":["linux"],"libc":["any"]} (current: {"os":"win32","cpu":"x64","libc":"unknown"})
Scope: all 238 workspace projects
 WARN  There are cyclic workspace dependencies: D:\git\deepseek-harness\packages\api\gateway, D:\git\deepseek-harness\packages\client\connection, D:\git\deepseek-harness\packages\host\apiproxy, D:\git\deepseek-harness\packages\api\remotes; D:\git\deepseek-harness\packages\sandbox\sandbox-local, D:\git\deepseek-harness\packages\sandbox\sandbox-windows-acl; D:\git\deepseek-harness\packages\subagent\subagent-spawn-in-process, D:\git\deepseek-harness\packages\subagent\tool-subagent; D:\git\deepseek-harness\vendor\cordis, D:\git\deepseek-harness\vendor\include

   ╭───────────────────────────────────────────────────────────────────╮
   │                                                                   │
   │                Update available! 9.12.1 → 11.21.0.                │
   │   Changelog: https://github.com/pnpm/pnpm/releases/tag/v11.21.0   │
   │                 Run "pnpm add -g pnpm" to update.                 │
   │                                                                   │
   │         Follow @pnpmjs for updates: https://x.com/pnpmjs          │
   │                                                                   │
   ╰───────────────────────────────────────────────────────────────────╯
....
#依赖安装成功

$ pnpm run build
 WARN  Unsupported engine: wanted: {"node":"^22.19.0 || >=24.0.0"} (current: {"node":"v20.11.1","pnpm":"9.12.1"})

> @deepseek-ai/dsh-root@0.1.0-rc.5 build D:\git\deepseek-harness
> npm run build:lib && npm run build:web


> @deepseek-ai/dsh-root@0.1.0-rc.5 build:lib
> npm run build:lib:host && npm run build:lib:client


> @deepseek-ai/dsh-root@0.1.0-rc.5 build:lib:host
> tsc -b tsconfig.host.json && tsdown --env.DSH_BUILD_FACE host

file:///D:/git/deepseek-harness/node_modules/.pnpm/rolldown@1.1.1/node_modules/rolldown/dist/shared/rolldown-build-abS241_6.mjs:9
import { formatWithOptions, styleText } from "node:util";
                            ^^^^^^^^^
SyntaxError: The requested module 'node:util' does not provide an export named 'styleText'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:132:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:214:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12)

Node.js v20.11.1
 ELIFECYCLE  Command failed with exit code 1.

依赖安装成功,但是build失败了

按建议继续升级 node, node":"^22.19.0 || >=24.0.0

复制代码
$ nvm install 24.0.0
Downloading node.js version 24.0.0 (64-bit)... 
Extracting node and npm...
Complete
npm v11.3.0 installed successfully.


Installation complete. If you want to use this version, type

nvm use 24.0.0

$ nvm use 24.0.0
Now using node v24.0.0 (64-bit)

重新执行以下就正常了

复制代码
pnpm install
pnpm run build

$ pnpm dsh web

> @deepseek-ai/dsh-root@0.1.0-rc.5 dsh D:\git\deepseek-harness
> node --import tsx/esm apps/cli/src/bin.ts "web"

dsh web: http://127.0.0.1:3080

启动页面会要求你配置API Key

填入API Key就可以enjoy了,记得充值,没有免费token, 哈哈

3.原理结构

3.1.整体架构分层图

3.2.Harness 编排层详细结构

3.3.数据流图

3.4.核心模块交互序列图

3.5.模块依赖关系图

3.6.请求生命周期状态机

3.7.多层级时序图

3.8.部署架构图

3.9.Harness 内部数据总线

3.10.配置与插件体系

这里体现了一切皆可插件的思想

4.DeepSeek Harness 工具调用链路

4.1. 主流程图

4.2.消息结构变换序列图

4.3.多轮工具调用循环

4.4.并行工具调用

4.5.Harness 执行器内部逻辑

4.6.异常处理决策树

4.7.完整状态机

后期等我深度使用再来更新,谢谢。

相关推荐
一心同学1 小时前
Hermes架构拆解之Profiles
ai·架构·agent·profiles·hermes
XLYcmy1 小时前
ASR识别任务两篇论文阅读分析与系统方案技术报告 上
论文阅读·ai·gpu·asr·论文分享·speechbrain·wespeaker
SL_staff18 小时前
JVS-APS有限产能建模的七个刚性支点:面向产线真实约束的技术实现解析
java·开源·全栈
七夜zippoe20 小时前
Agent 上线第一天就炸了:6 个生产事故的根因分析与修复记录
大数据·ai·agent·根因分析·修复记录
秋饼20 小时前
GPT-Live 全双工语音 API Java 服务端落地实战:事件协议、会话恢复与生产踩坑
java·ai·技术分享·后端开发
bst@微胖子20 小时前
SpringAI快速入门(7) RAG 实战(三):检索增强配置与重排序实战
ai
SL_staff20 小时前
为什么企业级自动化不能只靠AI编排?——逻辑引擎在确定性业务场景中的不可替代性
java·开源·产品
#六脉神剑20 小时前
myBuilder 11 月新版本:AI辅助设计
ide·人工智能·低代码·ai·mybuilder
Moment1 天前
不会后期的我,发现了一个开源胶片神器😍😍😍
前端·后端·开源