DeepSeek Harness 插件

dsh-copilot-sdk

桥接 GitHub Copilot 订阅到 DeepSeek Harness(移植自 github/copilot-sdk)(英文原文)

跳到安装方式

来源信息

GitHub 仓库
GongYuanCaiJi/dsh-copilot-sdk
最近更新
2026年8月15日
分类
插件开发工具
GitHub stars
3
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/GongYuanCaiJi/dsh-copilot-sdk
插件名:dsh-copilot-sdk
作者:GongYuanCaiJi

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-copilot-sdk

<p align="center">

<b>简体中文</b> | <a href="#english">English</a>

</p>

<p align="center"> <a href="https://github.com/GongYuanCaiJi/dsh-copilot-sdk/blob/main/LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg"></a> <a href="https://www.npmjs.com/package/@github/copilot-sdk"><img alt="upstream: @github/copilot-sdk" src="https://img.shields.io/badge/port%20of-%40github%2Fcopilot--sdk-orange"></a> </p>

把 GitHub Copilot 订阅接进 DeepSeek Harness:一个 copilot LLM provider,直接使用你订阅里的模型(GPT、Claude、DeepSeek……),SDK 库与测试套件 100% 逐字移植自上游。

本插件是 @github/copilot-sdk(MIT,github/copilot-sdk)的 dsh 移植(port),版本钉在 1.0.11(commit 18002a81)。SDK 库本体与上游逐字一致(见 [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md) 的 SHA-256 校验);.pi/ 下的桥接层是本移植自己的代码。喜欢的话,也请给上游一个 star

功能

  • Copilot 订阅即模型池:注册 copilot provider,订阅里可用的模型(gpt-5claude-sonnet-4.5deepseek-r1 等)直接出现在 dsh 的模型列表里
  • 复刻 Copilot CLI 引擎:SDK 自带 Copilot CLI runtime,无需单独安装 CLI;认证走你已有的 GitHub 登录 / token / BYOK
  • 纯聊天桥接:桥接层拒绝一切工具执行请求——Copilot 的 shell、文件编辑等工具绝不会在你的机器上代跑
  • 流式输出:assistant 文本与 reasoning(思维链)增量实时转发
  • /copilot 命令status 查看连接与模型数、models 列出可用模型、stop 停掉 CLI runtime
  • 100% 逐字移植:SDK 库、docs、samples、测试套件(含离线 replay 的 e2e)全部原样保留,npm test 全绿

效果

dsh 会话中
   └─ 模型选择器里出现 copilot / gpt-5、copilot / claude-sonnet-4.5 …
        └─ /copilot status
             Copilot bridge: connected.
             Provider: copilot
             Models available: 8
             Requires a GitHub Copilot subscription (or BYOK …)
  • 每次模型调用对应一个一次性 Copilot 会话:订阅计费走 Copilot 的计费模型(每次 prompt 计入用量)
  • 无 Copilot 订阅时也可以用 BYOK(Bring Your Own Key),见下方 FAQ

安装

> 尚未发布到 npm —— 从 GitHub 或本地目录安装:

# GitHub 源(安装时 prepare 会执行 build)
dsh plugin --profile <你的-profile> add github:GongYuanCaiJi/dsh-copilot-sdk

# 本地路径(先在该目录 npm install)
dsh plugin --profile <你的-profile> add /path/to/dsh-copilot-sdk

pnpm 默认阻止 git 安装的构建脚本(prepare)。如果 addallowBuilds 错误, 把 pnpm 打印的精确 key 加进 profile 的 pnpm-workspace.yamlallowBuilds 再重试; 本插件的原生依赖(koffi FFI)可能被连带拦截,同样放行后重跑。

安装后重启 dsh。插件按需拉起 Copilot CLI(首次模型调用 / /copilot status 时), 不需要订阅之外的任何配置。

使用

dsh 侧命令: /copilot status /copilot models /copilot stop

作为模型 provider: 安装后,会话的模型选择器里会出现 copilot provider 及其订阅模型(也可在 agent 配置里指定 provider: copilot + 具体模型 id)。

配置

全部走环境变量(与上游 SDK 一致):

  • COPILOT_GITHUB_TOKEN / GH_TOKEN / GITHUB_TOKEN —— GitHub 认证 token(缺省用 copilot CLI 的已登录用户)
  • BYOK:在 session/agent 配置里用 SDK 的 provider 配置指定你自己的 API key(OpenAI / Anthropic / 其他)

FAQ

  • 需要 Copilot 订阅吗? 需要(含免费额度档),除非用 BYOK。
  • 桥接会执行 Copilot 的工具吗? 不会。桥接层把所有权限请求判为拒绝,Copilot 只作为聊天模型回答。
  • 模型调用怎么计费? 与 Copilot CLI 相同,每次 prompt 计入你的 Copilot 用量。
  • SDK 完整 API 可用吗? 可用。库本身是逐字移植,API 与上游 @github/copilot-sdk 一致;

完整 API 参考见上游 READMEdocs/

License

MIT —— 见 [LICENSE](./LICENSE)。上游为 github/copilot-sdk(MIT)。

授权 / 合规询问 → GitHub issues

遥测说明: 上游 SDK 自带 telemetry 代码(src/telemetry.ts 与 GitHub telemetry 转发), 本移植逐字保留、未删改。本插件的桥接层不传入 telemetry options、也不注册 handler, 因此默认不发送;若你自行构造 CopilotClient 并启用,则以上游行为为准。

---

<a name="english"></a>

dsh-copilot-sdk

<p align="center">

<a href="#dsh-copilot-sdk">简体中文</a> | <b>English</b>

</p>

<p align="center"> <a href="https://github.com/GongYuanCaiJi/dsh-copilot-sdk/blob/main/LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg"></a> <a href="https://www.npmjs.com/package/@github/copilot-sdk"><img alt="upstream: @github/copilot-sdk" src="https://img.shields.io/badge/port%20of-%40github%2Fcopilot--sdk-orange"></a> </p>

Bring your GitHub Copilot subscription into DeepSeek Harness: a copilot LLM provider that serves the models in your subscription (GPT, Claude, DeepSeek, …), with the SDK library and test suite ported 100% verbatim from upstream.

This plugin is a dsh port of @github/copilot-sdk (MIT, github/copilot-sdk), pinned to 1.0.11 (commit 18002a81). The SDK library is byte-identical to upstream (see [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md) for SHA-256 checks); the bridge under .pi/ is this port's own code. If you like it, star the upstream too

Features

  • Your Copilot subscription as a model pool: a copilot provider whose models

(gpt-5, claude-sonnet-4.5, deepseek-r1, …) show up in dsh's model list

  • The Copilot CLI engine, embedded: the SDK bundles the Copilot CLI runtime —

no separate CLI install; auth via your existing GitHub login / token / BYOK

  • Chat-only bridge: every tool permission request is denied — Copilot's shell,

file-edit, and other tools never run on your machine

  • Streaming: assistant text and reasoning deltas are forwarded live
  • /copilot command: status (connection + model count), models (list), stop (shut the CLI down)
  • 100% verbatim port: SDK library, docs, samples, and the full test suite

(including offline-replay e2e) kept as-is; npm test is green

Preview

Inside a dsh session
   └─ model selector shows copilot / gpt-5, copilot / claude-sonnet-4.5 …
        └─ /copilot status
             Copilot bridge: connected.
             Provider: copilot
             Models available: 8
             Requires a GitHub Copilot subscription (or BYOK …)
  • Each model call uses a fresh one-shot Copilot session; billing follows Copilot's

own model (each prompt counts toward your usage allowance)

  • No subscription? BYOK (Bring Your Own Key) works too — see FAQ

Install

> Not published to npm yet — install from GitHub or a local checkout:

# GitHub source (prepare runs the build on install)
dsh plugin --profile <your-profile> add github:GongYuanCaiJi/dsh-copilot-sdk

# Local path (run `npm install` in the plugin directory first)
dsh plugin --profile <your-profile> add /path/to/dsh-copilot-sdk

pnpm blocks git-hosted installs from running the prepare build script until allowed — if add fails with an allowBuilds error, add the exact key pnpm printed under allowBuilds in the profile's pnpm-workspace.yaml, then re-run. The native dependency (koffi FFI) may be blocked next; allow it the same way.

Restart dsh after installing. The plugin starts the Copilot CLI on demand (first model call / /copilot status); no config beyond your existing GitHub auth.

Usage

dsh-side commands: /copilot status /copilot models /copilot stop

As a model provider: after install, the session model selector shows the copilot provider and its subscription models (or set provider: copilot plus the model id in your agent config).

Configuration

All via environment variables (same as the upstream SDK):

  • COPILOT_GITHUB_TOKEN / GH_TOKEN / GITHUB_TOKEN — GitHub auth token (defaults to the logged-in copilot CLI user)
  • BYOK: use the SDK's provider config with your own API key (OpenAI / Anthropic / others) in the session/agent config

FAQ

  • Is a Copilot subscription required? Yes (free tier included), unless you use BYOK.
  • Does the bridge execute Copilot's tools? No. All permission requests are

denied; Copilot runs purely as a chat model.

  • How is usage billed? Same as Copilot CLI — each prompt counts toward your Copilot usage.
  • Is the full SDK API available? Yes. The library is a verbatim port, so the

API matches upstream @github/copilot-sdk; full API reference is in the upstream README and docs/.

License

MIT — see [LICENSE](./LICENSE). Upstream: github/copilot-sdk (MIT).

License / compliance enquiries → GitHub issues.

Telemetry: the upstream SDK ships telemetry code (src/telemetry.ts and GitHub telemetry forwarding), kept verbatim in this port. This plugin's bridge passes no telemetry options and registers no handler, so it sends nothing by default; if you construct a CopilotClient yourself and enable it, upstream behaviour applies.