ARTICLE DETAIL

资讯详情

深耕网站视觉设计与运营推广的一线实战洞察。

Codewhale 集成 DeepSeek Harness(DSH):`codewhale integrations dsh` 官方连接指南

Codewhale 集成 DeepSeek Harness(DSH):`codewhale integrations dsh` 官方连接指南 Codewhale 集成 DeepSeek HarnessDSHcodewhale integrations dsh官方连接指南【免费下载链接】CodewhaleOpen-source coding agent for your terminal, built in Rust and on a journey of continuous community improvement. Issues and PRs welcome.项目地址: https://gitcode.com/GitHub_Trending/de/Codewhalecodewhale integrations dsh把用户已安装的官方 DeepSeek Harnessdshnpm 包deepseek-ai/dsh接入 Codewhale让 DSH 成为一个「集成式 harness 表面」而 Codewhale 继续保有 Fleet 配置、Provider/模型选择、权限、凭据与生命周期的一切主导权。读完本文你将掌握连接前如何理解 Codewhale 与 DSH 各自的数据与权限边界、八种连接状态及对应的处置命令、overlay 补丁的生成规则、可选的 DSH 插件 bundle皮肤与海洋动画场景机制以及彻底移除连接而完全不触碰$DSH_HOME的方法。本文依据仓库文档 docs/INTEGRATIONS_DSH.md 撰写并对照其参考实现crates/tui/src/integrations/dsh/ 下的mod.rs、detect.rs、identity.rs、bundle.rs、skin.rs、scene.rs、brand.rs、receipt.rs与配套测试tests.rs逐条印证。连接什么不连接什么边界先行的设计整个集成建立在“DSH 保持独立、Codewhale 保持权威”的信任模型之上。DSH 不是第二个 Fleet 调度器也绝不是对 Codewhale 权限体系的绕过。Codewhale 只使用 DSH公开文档化的接缝seam见下表DSH 接缝Codewhale 的用法dsh --version/dsh --help只读探测绝不初始化任何 profile$DSH_HOME或~/.dsh只读盘点profile 名称、settings.yaml顶层命名空间、.credentials.yaml是否存在且权限为0600。只读结构从不读值--patch fileoverlayCodewhale 在自己的 home 下写入唯一一份overlay启动时传给 DSHDSH_PERMISSION_MODE环境变量镜像 Codewhale 的权限姿态--profile web/--profile headlessDSH 随发行版自带的两个 profile由 DSH 自己首次启动时初始化其自有文档化行为实现层面对“只读探测”有硬性约束。在 detect.rs 中DshDetection只记录dsh --version输出、launcher help 是否宣称支持--patch、$DSH_HOME是否存在及来源、profiles/目录名、settings.yaml顶层键、凭据文件的存在性与权限位——字段注释明确写着“values are never read / Credential values are never read”。即使调用dsh --version/--helpProcessRunner也会注入DSH_TELEMETRY_DISABLED1作为硬性遥测退出开关见 detect.rs探测进程以/dev/null作为 stdin、从不初始化 profile。Codewhale 只会写入$CODEWHALE_HOME/integrations/dsh/目录mod.rs 定义了INTEGRATION_DIR、OVERLAY_FILE、RECEIPT_FILE等常量其中codewhale.patch.yml— overlay 补丁。只含身份信息Provider 路由、模型、base URL、以及原生 DeepSeek 路由下的reasoningEffort。对所有非原生路由它会在 DSH 的llm-pi-ai适配器上声明一条codewhale-provider路由并用api:声明该路由自己的 wire 方言openai-completions、openai-responses或anthropic-messages用apiKeyEnv指向 Provider 的标准环境变量——只写变量名绝不写值。无密钥的本地路由回环 Ollama / LM Studio / vLLM / SGLang不携带任何凭据引用。receipt.json— 当前连接记录外加connect/update/disable/enable/remove事件的只追加历史每条含 overlay SHA-256、dsh 版本、$DSH_HOME、映射身份、权限模式与时间戳文档另见 docs/RECEIPTS.md。每个事件同时追加进$CODEWHALE_HOME/audit.logmod.rs 的apply_plan中调用audit::log_sensitive_event。bundle/— 仅在install-bundle之后出现详见下文。Codewhale 调色板皮肤与 ambient 海洋场景放在这里、位于 bundle 的 client 半区——不导出任何样式表。Codewhale绝不复制、打印或内嵌 API Key、OAuth 文档、环境机密、提示词或文件系统内容。特别地如果 Codewhale 自己通过--api-key或 keyring 把某个凭据物化到了当前进程该凭据会在启动子进程时被剥离而用户自己在 shell 里导出的密钥则保持原样mod.rs 的launch_env_strip_list只剥离“Codewhale 桥接”的变量区分依据是凭据来源写入$DSH_HOMEsettings、凭据、profiles、会话修改已安装的deepseek-ai/dsh包文件静默切换到云模型或放宽权限Codewhaleread-only→ DSHread-only其余情况 →workspace-write只有同时满足--allow-full-access且Codewhale 处于全访问姿态sandbox_mode danger-full-access/ yolo时才授予danger-full-access。这套“只写自己名下、只读对方结构”的边界在模块文档字符串里写得很明确mod.rs并在 tests.rs 中用大量 StubRunner 测试锁定。八种连接状态谁可启动、如何处置集成状态是一个显式枚举mod.rs 的DshIntegrationState序列化为 kebab-case 标签status/plan依据compute_status的结果映射状态并给出下一步动作状态含义启动launchnot-installeddsh不在PATH上拒绝offline存在dsh但--version执行失败含输出无法解析拒绝incompatible版本低于0.1.0-rc.6或 launcher 未宣称支持--patch拒绝detecteddsh 可用但尚无 Codewhale overlay拒绝需先connectconnectedoverlay 与当前 Codewhale 路由一致允许stale-config路由变更、overlay 被 Codewhale 外部修改或 overlay 缺失拒绝需updatestale-version已连接但 dsh 比验证版本更新允许但标记为“未验证”disabledoverlay 保留但启动被拒绝拒绝需enable版本判定是精确的语义化版本比较。dsh的版本字符串形如MAJOR.MINOR.PATCH[-rc.N]detect.rs 中的DshVersion::parse与cmp_semver正确处理了“同一 base 下任何 rc 都排在正式版之前”的语义classify_version再结合 launcher help 是否出现--patch得出Verified/NewerUnverified/Incompatible/Offline/Unparsed五档兼容性detect.rs。集成验证基准版本常量写死为VERIFIED_DSH_VERSION 0.1.0-rc.6detect.rs与文档表述一致。一个常见且容易踩的坑stale-config不只由“Codewhale 路由变了”触发。compute_statusmod.rs会比对磁盘上 overlay 的 SHA-256与 receipt 里记录的overlay_sha256只要 overlay 文件被手工编辑过即视为 drift对已安装 bundle 的情况还会检查cordis.patch.yml、lib/client.js、profile manifest 是否一致详见下文 bundle 章节。status、plan、/setup toolsTools 与 MCP 步骤以及codewhale doctor都是无副作用操作它们只读文件系统与调用dsh --version/--help。模块里compute_status与status_line的注释都强调这一点mod.rs。命令参考codewhale integrations dsh status [--json] codewhale integrations dsh plan [--profile web|headless] [--allow-full-access] [--skin] [--json] codewhale integrations dsh connect [--profile web|headless] [--allow-full-access] [--skin] [--yes] codewhale integrations dsh update [--profile …] [--allow-full-access] [--skin true|false] [--ocean true|false] [--yes] codewhale integrations dsh launch [--profile web|headless] [--dry-run] [-- dsh app args] codewhale integrations dsh disable codewhale integrations dsh enable codewhale integrations dsh remove [--yes] codewhale integrations dsh install-bundle [--app web|headless] [--yes] codewhale integrations dsh remove-bundle [--yes]命令族注册在integrations dsh之下CLI 帮助文案见 crates/cli/src/lib.rs具体分发与打印逻辑位于 crates/tui/src/integrations/cli.rs。各子命令行为要点status [--json]— 无副作用汇报上述八种状态、当前路由可携带性carry-ability、shadowing 命名空间与插件路径可用性--json输出结构化结果。Detected 状态的一行汇报会提前把“当前路由能否被 DSH 承载”说出来让用户在运行plan之前就看到潜在的拒绝mod.rs。plan [--profile …] [--allow-full-access] [--skin] [--json]— 精确列出将要写入的文件、映射身份、权限模式、disclosure 与overlay 全文但什么都不写mod.rs 的plan返回DshPlanoverlay_text、overlay_sha256、launch_command、env_exports、disclosures一应俱全。connect— 执行计划创建$CODEWHALE_HOME/integrations/dsh/POSIX 下目录权限0700见 mod.rs、原子写入 overlay、落 receipt、写审计日志。update— 重写 overlay 与 receipt若已安装 bundle则就地重建cordis.patch.yml及皮肤文件无需 pnpm 重跑。皮肤 / 海洋的开关语义见下文。launch [--dry-run] [-- dsh app args]— 在 Codewhale 工作区运行DSH_PERMISSION_MODEmode dsh --profile p --patch overlay …使用用户自己的$DSH_HOME因此凭据、会话与 profile 始终归用户所有--dry-run只打印将执行的进程LaunchSpec::display并不真的 spawn。bundle 已安装时默认改用--profile codewhale且不带--patchprofile 自身携带身份launch --profile web|headless则仍走 overlay。子进程继承了 stdiomod.rs 的launch_spec/spawn_launch。disable/enable— 切换disabled标志。overlay 保留在磁盘上disable后一切启动被拒绝enable恢复mod.rs。remove [--yes]— 仅删除 overlay 与历史遗留的 0.9.8 皮肤文件追加removereceipt绝不触碰$DSH_HOME若 bundle 仍安装着则拒绝mod.rs。install-bundle/remove-bundle— 见下文插件路径章节。connect、update、remove都会先打印精确计划文件、身份、权限模式、disclosure 与 overlay 文本并要求确认当 stdin 不是终端时需--yes。overlay 补丁长什么样身份即全部overlay 由 identity.rs 的render_overlay确定性生成——对同一身份输入输出字节完全一致这正是它能被 SHA-256 追踪 drift 的前提。文件首部是固定的注释块声明生成来源、禁止手改、不写凭据随后是配置行。原生 DeepSeek Chat Completions 路由providerdeepseek且 wire 方言为 Chat Completions映射到 DSH 自带的deepseek-ai/dsh-llm-deepseek路由 iddeepseek-official生成的 overlay 形如示意值取决于你的实际配置# DeepSeek Harness connected through Codewhale. # Generated by codewhale integrations dsh connect; do not edit by hand. # Identity only: no API key, token, or credential document is written here. # codewhale.providerdeepseek codewhale.modeldeepseek-chat codewhale.workspace/path/to/workspace - id: agent-default-model name: deepseek-ai/dsh-agent-default-model config: provider: deepseek-official model: deepseek-chat - id: llm-deepseek name: deepseek-ai/dsh-llm-deepseek config: baseURL: https://api.deepseek.com reasoningEffort: high models: - id: deepseek-chat name: deepseek-chat非原生 / 非 Chat Completions 方言的路由则在deepseek-ai/dsh-llm-pi-ai上声明一条codewhale-provider路由路由 id 由 provider id 规范化生成见 identity.rs示意- id: agent-default-model name: deepseek-ai/dsh-agent-default-model config: provider: codewhale-provider model: model-id - id: llm-pi-ai name: deepseek-ai/dsh-llm-pi-ai config: providers: codewhale-provider: displayName: Provider 显示名 (via Codewhale) apiKeyEnv: 标准密钥环境变量名 api: openai-completions # 或 openai-responses / anthropic-messages baseURL: https://endpoint models: - id: model-id name: model-id注意几处细节无密钥本地路由keyless loopback Ollama/LM Studio/vLLM/SGLang没有apiKeyEnv行有凭据的路由只写环境变量名字。向 DSH 的凭据发现机制自身环境或$DSH_HOME/.credentials.yaml负责解析值——Codewhale 从不转交密钥identity.rs 的 disclosure 文本明示这一点。wire 方言被原样携带绝不被近似Chat Completions 路由声明api: openai-completionsOpenAI Responses 方言的路由例如默认的deepseek/deepseek-v4-flash声明api: openai-responsesAnthropic Messages 方言声明api: anthropic-messages。这依据的是已安装适配器自身的声明对deepseek-ai/dsh0.1.0-rc.6验证过deepseek-ai/dsh-llm-deepseek的deepseek-official路由只说 Chat Completions其唯一 wire 调用 POST 到baseURL/chat/completions无协议切换而deepseek-ai/dsh-llm-pi-ai的手写路由 schema 对api:恰好接受openai-completions | openai-responses | anthropic-messagesidentity.rs。因此DeepSeek Chat 路由走原生适配器可带推理档位其余方言——包括 DeepSeek 自己的 Responses 方言模型——都走一条声明自己方言的codewhale-*pi-ai 路由。推理档位reasoning tier如何映射只有原生 DeepSeek 路由会映射推理档位且收敛到 DSH 的三个取值off | high | max。映射函数在 identity.rs测试覆盖见 tests.rsCodewhale 推理档位DSHreasoningEffortoff/none/disabled/falseoffminimal/low/medium/mid/high/autohighxhigh/max/maximum/highest/ultra/ultracodemax其余未知值 / 未显式配置不写该字段DSH 用自身默认手写声明hand-declared的codewhale-*路由不发送任何 effort 参数——因为各 Provider 的 wire 拼写未经逐一验证overlay 宁可省略也不猜测对应的 disclosure 会明确告知这一点。权限如何镜像权限映射规则identity.rs 的permission_mode_forCodewhalesandbox_mode read-only→ DSHread-only其余默认 →workspace-write即使 Codewhale 审批策略为neverDSH 也保持自己的 workspace-write 每次文件操作前询问不照搬 deny仅当 Codewhale 处于全访问姿态yolotrue或sandbox_mode ∈ {danger-full-access, external-sandbox}且显式传了--allow-full-access时 → DSHdanger-full-access否则即使 Codewhale 全访问DSH 也会被压回workspace-write并给出提示。任何缩权或无法传达的事实都会变成plan的 disclosure而不是静默吞掉。plan 必须披露什么shadowing 命名空间DSH 会按字段把用户settings.yaml的agent-default-model、llm-deepseek、llm-pi-ai各节逐字段层叠在 overlay 之上。如果这些节存在DSH 里已保存的选择可能盖住被钉死的身份直到用户在 DSH 中清除它status/plan会把它们列出来mod.rs。推理档位只在原生 DeepSeek 路由下映射手写声明路由不发送 effort 参数。wire 方言原样携带见上不做近似。什么会被拒绝内嵌凭据的 base URLuserinfo即http://user:passhost或带 query/fragment 的 base URL 永远不会被复制进 overlay——plan直接失败并点名当前provider/model与原因status则会在plan运行之前就显示当前路由的可携带性。这一检查实现在 identity.rs 的base_url_is_structural同时校验 scheme 必须是http/https。profile 尚未初始化时会提示 DSH 将在首次启动时自行创建$DSH_HOME/profiles/pDSH 自己的文档化行为。--skin/--ocean相关披露见下。DSH 插件路径install-bundle的皮肤与场景--patch是默认路径因为它只需要 launcher。而DSH 文档化的插件机制则作为显式 opt-in 提供codewhale integrations dsh install-bundle [--app web|headless] [--yes] codewhale integrations dsh remove-bundle [--yes]install-bundle需要一个已存在的连接并且PATH上必须有pnpmdsh 会向外调用它。没有 pnpm 时status显示plugin path: not available: pnpm missing …且命令拒绝执行探测逻辑见 bundle.rs。它做三件事物化一个 npm 形状的 bundle 包到$CODEWHALE_HOME/integrations/dsh/bundle/由 bundle.rs 的render_bundle_files生成package.json包名codewhale-dsh-bundle、private、MIT、版本形如codewhale versiondsh.patch sha12bundle.rsdsh: {bundle: {patch: ./cordis.patch.yml}}额外携带codewhale元数据块generated_by、patch_sha256、skin、ocean、skin_sha256、brand_sha256、ocean_scene_sha256等cordis.patch.yml身份 overlay与--patch文件内容一致皮肤开启时末尾追加一行 skin insertREADME.md、NOTICE.md保留 DSH 的 MIT 声明皮肤开启时还有lib/index.jslib/client.jspalette 插件除非--ocean false否则内嵌海洋场景。运行文档化的dsh plugin --profile codewhale add path两次bundle.rs第一次加 DSH 自带的 app bundledeepseek-ai/dsh-web-app或dsh-headless从已安装 launcher 链接过来以便 profile 能启动无需联网第二次加 Codewhale bundle让它的行最后 patch。DSH 会创建专用profile$DSH_HOME/profiles/codewhalepackage.json里是link:依赖、pnpm-lock.yaml、node_modules链接。用户的web/headlessprofile绝不被触碰。记录install_bundlereceiptprofile 目录、bundle 目录、包版本、patch SHA-256、app bundle 来源、pnpm 版本以及dsh plugin输出的 SHA-256 摘要——输出文本本身不落盘只存摘要。之后dsh --profile codewhale单独启动即携带身份可用dsh --profile codewhale --dump-config验证launch默认使用该 profile、不再需要--patch而launch --profile web|headless仍走 overlay。因为 profile 依赖是指向 Codewhale 所辖目录的link:update可以就地重写cordis.patch.yml与皮肤文件——不需要 pnpm 重跑。Stale 检测覆盖 bundlemod.rs 与 bundle.rsbundle patch 被改动或缺失、patch 与 overlay 不一致、lib/client.js缺失/被改/在 receipt 记录 skinoff 时却存在、海洋场景与 receipt 的ocean决定不一致、或 profile manifest 不再列出codewhale-dsh-bundle——任何一条都会报告stale-config并指向update若 profile 清单本身异常则提示先remove-bundle再install-bundle。remove-bundle运行dsh plugin --profile codewhale remove codewhale-dsh-bundle并只删除 Codewhale 自己拥有的 bundle 文件。profile 目录本身连同 dsh 记录在其中的 app bundle 链接属于 DSH原样保留receipt 中会注明。remove在 bundle 仍安装时拒绝执行。皮肤通过overrideTokens施加的 Codewhale 调色板DSH 0.1.0-rc.6 有一个文档化的 token 级主题接缝ThemeService.overrideTokens(source, tokens)位于deepseek-ai/dsh-client-ui-theme它把一薄层--dsw-alias-*变量叠在当前主题之上逐 token、后层生效并返回 disposer。Codewhale 皮肤用的正是这个机制skin.rs 模块头注释并且只能通过 bundle profile 生效dsh --profile codewhale--patchoverlay 从不携带皮肤代码所以launch --profile web|headless保持纯 overlay 原生主题。install-bundle默认开启皮肤。开启时 bundle 是一个双面dual-faceDSH 插件package.json增加dsh: {client: {platform: web, immediately: true, inject: [deepseek-ai/dsh-client-ui-theme]}}和完整的exportsmap.、./client、./package.json。Node 的 exports map 是穷举式的cordis loader 导入裸包名需要.dsh-client-modules 要解析name/package.json需要./package.json两者缺一就会报ERR_PACKAGE_PATH_NOT_EXPORTED、导致 client 半区被静默丢弃——注释里特别点明了这个坑bundle.rslib/index.js是 no-op 的 Node cordis 入口让行能挂载lib/client.js是一个纯window.__ModuleLoader__.load({ id, factory })脚本其 factory 在ctx.effect内调用ctx.theme.overrideTokens(codewhale-dsh-bundle, TOKENS)并返回 disposerinject: [theme]保证在 theme service 存在之后才执行cordis.patch.yml在身份行之后以- insert: [{ id: codewhale-skin, name: codewhale-dsh-bundle }]收尾。TOKENS是一张有界的--dsw-alias-*映射表背景、边框、brand、按钮、标签、error/success/warn 状态、代码块、滚动条、toast、tooltip对应 light/dark 两套取值全部由 TUI 的真实调色板crate::paletteBlue Stage 暗/亮两套渲染而来skin.rs——只含调色板常量不含任何用户数据或环境信息。receipt 记录skin: true|false与skin_sha256渲染出的 TOKENS JSON 的 SHA-256package.json里codewhale.skin_sha256携带同一哈希任何一侧被改都会在状态机里暴露为 drift。Whale Brothers / Codewhale 身份落款皮肤还会挂载一个小型插件自有的落款位于界面右上角内容为WHALE BROTHERS、CODEWHALE、× DEEPSEEK HARNESS。它是增量式的通过 DSH 帧级shell.overlay槽位注册不替换也不重写 DeepSeek Harness 的 branding 或控件使用当前皮肤的 token、忽略指针输入、在宽度低于 760px 时收成一个紧凑的 whale 标记随 client 插件卸载而移除。package.json以codewhale.brand_sha256记录生成片段的哈希。海洋场景鲸与字形小鱼皮肤开启时lib/client.js还携带一个 ambient 海洋场景一个全视口canvasposition: fixed; inset: 0; z-index: -1; pointer-events: none画在#root之下、body 背景之上含可见的深度渐变、一近一远两头鲸剪影钝头、低背鳍隆起、长胸鳍、水平尾鳍 ±10° 摆动沿柔和正弦缓缓横穿位置偏向画面下半部与顶边以免越过 composer 卡片头部偶尔喷出一小串气泡一小群 Codewhale 字形小鱼/o等宽字体跟随漫游的领队做精简版群游另有淡出的上升气泡。调色取自皮肤自身 tokensurface_bg、accent_primary、text_body、text_dim明暗两套场景监听 DSH 的theme/change事件随应用一起切换明暗。为了在 canvas 后透出画面client 在场景开启时把两个背景 token 以半透明 rgba 重新下发在原本不透明的表格之上--dsw-alias-bg-baseα 0.42边框与中央列都会绘制它与--dsw-specific-sidebar-fillα 0.78保持导航区可辨。面板、composer、代码块及所有其他层保持不透明。设计细节与透明度遮罩常量见 scene.rs。性能预算requestAnimationFrame限制在约 30 fps、document.hidden时暂停、prefers-reduced-motion: reduce下只画一帧静态画面、感知 device-pixel-ratio、无每帧分配复用 typed array。场景只能随client.js发布因为 dsh-client-modules 每个 client 插件只服务一个文件/plugins/id/client.js没有lib/scene.js——场景脚本以include_str!(scene.js)内嵌scene.rs。package.json记录codewhale.ocean与codewhale.ocean_scene_sha256receipt 记录ocean: true|false。下图是在 DSH 0.1.0-rc.6 上对两种配色方案的实际验证结果明/暗1100×687该集成在两种 scheme 下均无 console 错误、帧画面确有差异、文字保持可读。关闭开关从小到大排列在浏览器里设localStorage[codewhale.ocean] off或给body加类codewhale-ocean-off——只在该机器上同时跳过 canvas 与半透明 token控制台调用window.__codewhaleOcean.stop()/.start()/.setIntensity(0..1)句柄常量见 scene.rscodewhale integrations dsh update --ocean false重新生成不含场景的client.js默认开启裸update保持上一次的选择--skin false隐含无场景。逃生舱codewhale integrations dsh update --skin false重新生成不带 client 半区、不带 insert 行的 bundle无需 pnpm——link:依赖让文件就地生效update --skin true重新打开裸update保持上次选择。install-bundle本身不接受--skin旗标connect --skin/plan --skin只是把同样的决定记下来供之后的 bundle 安装使用不写额外文件。remove-bundle会连同 Codewhale 所辖 bundle 文件一起删掉 client 半区overrideTokens层随插件卸载而被 disposeDSH 原生主题随即恢复。0.9.8 时代的--skinCSS/预览导出codewhale-dsh-skin.css、codewhale-dsh-skin-preview.html已经移除因为dsh-client-ui-layout把 alias token 写为内联body.style属性任何样式表规则在构造上都会输给它。connect/update会顺手删除这些遗留文件mod.rs。移除与归属remove只删除$CODEWHALE_HOME/integrations/dsh/下的 overlay以及任何 0.9.8 皮肤/预览遗留追加一条removereceipt从不触碰$DSH_HOME或已安装的包。DSH 在连接前后的行为完全一致集成随时可以干干净净地撤走。最后一点归属说明DeepSeek Harness © 2026 DeepSeekMIT 许可本集成只是调用用户已安装的 launcher并不重新分发它。这也不是Codewhale 的原生功能——所有界面上的标注都是 “DeepSeek Harness connected through Codewhale”常量RELATIONSHIP_LABEL见 mod.rs身份与归属始终如实呈现。【免费下载链接】CodewhaleOpen-source coding agent for your terminal, built in Rust and on a journey of continuous community improvement. Issues and PRs welcome.项目地址: https://gitcode.com/GitHub_Trending/de/Codewhale创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表