官方生态标准规范与开源创作者白皮书

DeepSeek Harness 插件开发与生态算法指南

深入了解 DeepSeek Harness 官方开源插件的标准文件结构、桌面端一键安装联动协议(含全环境适配工程规范)、创作者荣誉与经济算法。

一、DeepSeek Harness 官方标准插件结构规范

仅支持 .zip 官方标准打包格式,服务端自动解压与规范安全校验

DeepSeek Harness (DSH) 插件采用轻量模块化设计,一个标准的 DSH 开源插件压缩包根目录或单一主目录下,包含核心清单文件 `plugin.json` (或 `manifest.json`)、`package.json`、`cordis.patch.yml`、说明文档 `README.md` 以及入口脚本。

📦 官方标准目录树 (Directory Tree):

dsh-my-plugin/
├── plugin.json       # 必选:插件核心元数据声明清单
├── package.json      # 必选:NPM 元数据、files 与 dsh.bundle
├── cordis.patch.yml  # 必选:官方 Bundle 容器装载切片声明
├── README.md         # 必选:中文使用说明与交互范例
├── lib/              # 核心代码产物 (或 index.js)
├── index.js          # 系统半体:后端逻辑 / MCP 工具调度
├── client.js         # 客户端半体:UI 浮窗 / 快捷按键 (可选)
├── prompts/          # 提示词库:CoT 结构化提示词模板 (可选)
│   └── main.md
└── assets/           # 静态素材:图标与效果预览图 (可选)
    └── icon.png

📄 plugin.json 规范事实源示例:

{
  "id": "dsh-infinite-gen",
  "name": "无限生成加速引擎",
  "version": "1.0.0",
  "description": "多轮思维链自动提纯与无损续写",
  "author": "创作者开发者昵称",
  "platform": "all", // all | desktop-exe | linux | web
  "harnessVersion": ">=0.1.0",
  "entry": "index.js",
  "permissions": ["network", "storage"],
  "tags": ["deepseek", "productivity", "cot"],
  "category": "tools"
}

智能容错解包支持:

若压缩包由 7-Zip 或系统自带工具多包了一层同名文件夹,本平台的开源 7z-CLI 服务端解析器会自动穿透单层包裹并精准定位 `plugin.json`。若缺少该文件,系统将基于文件名和 `README.md` 进行智能元数据推导,确保即传即用。

二、DeepSeek Harness 桌面端与插件市场「一键安装联动协议规范」

定义网页端、文档及第三方服务如何通过系统级 URI Scheme 安全唤起官方桌面客户端 (EXE) 并完成免命令行秒级装载(含全环境工程适配补充规范)

本协议定义了 DeepSeek 插件市场(网页端/第三方服务) 如何通过自定义 URI Scheme 协议安全唤起 DeepSeek Harness 官方桌面端客户端(EXE) 并完成插件的一键导入与自动装载。同时,下方附带由核心标杆插件沉淀的插件全环境适配工程规范,作为一键安装协议的底层装载保障与重要补充。

1协议基础定义 (URI Scheme)

协议头 (Protocol Scheme)

dsh://

操作路由 (Path)

/plugin/install

dsh://plugin/install?id={id}&name={name}&version={version}&repo={repo}&permissions={permissions}&downloadUrl={downloadUrl}

2参数定义与数据字典 (Query Parameters)

所有 Query 参数均需经过标准的 URL 编码(encodeURIComponent):

参数名 (Key)类型 (Type)是否必填说明与示例
idstring必填插件唯一标识符,英文小写。例如:open-design、latex-ocr
namestring必填插件中文/英文展示名称。例如:打开 Design 视觉设计助手
versionstring必填插件语义化版本号。例如:1.0.0、latest
repostring必填官方/开源仓库地址或 npm 包名。例如:nexu-io/open-design 或 @deepseek-ai/dsh-latex-ocr
permissionsstring可选插件所需权限描述(客户端弹窗提示用)。例如:网络访问, 本地文件读取
downloadUrlstring可选离线 zip/tar 安装包直链地址(备用回退分发渠道)。

3标准 URL 示例 (URI Scheme Examples)

示例 1:基础安装请求
dsh://plugin/install?id=open-design&name=%E6%89%93%E5%BC%80%20Design&version=1.0.0&repo=nexu-io/open-design
示例 2:完整权限声明与下载源
dsh://plugin/install?id=latex-ocr&name=LaTeX%20%E5%85%AC%E5%BC%8F%E8%AF%86%E5%88%AB&version=1.2.0&repo=deepseek-community/latex-ocr&permissions=%E7%BD%91%E7%BB%9C%E8%AF%B7%E6%B1%82%2C%E6%9C%AC%E5%9C%B0%E6%96%87%E4%BB%B6%E8%AF%BB%E5%86%99&downloadUrl=https%3A%2F%2Fapi.deepseek.stream%2Fplugins%2Flatex-ocr-1.2.0.zip

4网页端(前端)触发代码规范

JavaScript / TypeScript 标准拉起函数
/**
 * 唤起 DeepSeek Harness 桌面客户端一键安装插件
 */
export function installPluginToDesktop(plugin: {
  id: string;
  name: string;
  version: string;
  repo: string;
  permissions?: string;
  downloadUrl?: string;
}) {
  const params = new URLSearchParams({
    id: plugin.id,
    name: plugin.name,
    version: plugin.version || 'latest',
    repo: plugin.repo || plugin.id,
    permissions: plugin.permissions || '常规权限',
    downloadUrl: plugin.downloadUrl || '',
  });

  const deepLink = `dsh://plugin/install?${params.toString()}`;

  // 1. 通过隐藏 iframe 安全静默拉起协议
  const iframe = document.createElement('iframe');
  iframe.style.display = 'none';
  iframe.src = deepLink;
  document.body.appendChild(iframe);
  setTimeout(() => document.body.removeChild(iframe), 2000);
}
HTML 静态链接触发方式 (适用于博客、README、第三方网站)
<a href="dsh://plugin/install?id=open-design&name=%E6%89%93%E5%BC%80%20Design&version=1.0.0&repo=nexu-io/open-design" class="btn-install"> 🚀 唤起客户端一键安装 </a>

5桌面端(Electron / Tauri / Native EXE)生命周期处理规范

桌面客户端在接收到系统级 dsh:// 请求后,需严格遵循以下安全交互与自动装载流程:

步骤 1

协议捕获与窗口置顶

解析 URL Query 参数,主进程唤醒客户端并置顶显示。

步骤 2

元数据与权限弹窗

弹出安装授权面板,明确向用户展示插件名称、版本与申请权限。

步骤 3

用户确认与拉取包

用户点击确认后,客户端优先拉取 GitHub 仓库或备用下载源。

步骤 4

热重载与完成通知

解压至 ~/.dsh/plugins/,热加载插件并弹出成功通知。

6Windows 系统注册表关联规范(供打包工具参考)

安装包(Inno Setup / NSIS / Electron Builder / Tauri)或应用初始化时向系统注册表写入 dsh:// 关联:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\dsh]
@="DeepSeek Harness Protocol"
"URL Protocol"=""

[HKEY_CURRENT_USER\Software\Classes\dsh\DefaultIcon]
@="\"C:\\Users\\Administrator\\AppData\\Local\\Programs\\DeepSeek-Harness\\icon.ico\",0"

[HKEY_CURRENT_USER\Software\Classes\dsh\shell]

[HKEY_CURRENT_USER\Software\Classes\dsh\shell\open]

[HKEY_CURRENT_USER\Software\Classes\dsh\shell\open\command]
@="\"C:\\Users\\Administrator\\AppData\\Local\\Programs\\DeepSeek-Harness\\DeepSeek Harness.exe\" \"%1\""

DeepSeek Harness 官方桌面客户端 (EXE) 已内置支持该协议

无需任何繁复配置,安装官方桌面端后即可在任意浏览器或第三方平台享受「一键装载」极致体验。

获取官方最新版 v0.1.2 (.exe)

插件工程环境适配规范一键安装协议补充

适用于所有外部插件、第三方扩展与工具包的一体化适配标准与一键安装部署原则(兼容 DSH 0.1.x / 0.2.x 容器)

适配工程规范背景与定位:

本规范总结了 @dsh-external/dsh-graded-mode 等核心标杆插件适配 DeepSeek Harness(以下简称 DSH)0.1.x / 0.2.x 容器微内核的全部工程经验,作为一键安装联动协议在宿主底层执行时的环境适配标准、双向软链架构与一键安装脚本设计原则。

1整体架构与模块加载拓扑 (Topology & Architecture)

DSH 采用 Cordis 容器微内核架构,混合了 Node.js / Electron 后端运行时与 Web 前端 Combo 注入机制。插件从一键安装到容器装载并向前端分发的完整链路如下:

[用户安装 / install.bat]
         │
         ▼
[~/.dsh/plugins/<plugin-id>]  (插件实体根目录)
         │
         ├── (NTFS Junction 双向软链) ────────┐
         │                                   │
         ▼                                   ▼
[profiles/web/node_modules/<bare-name>]   [profiles/web/node_modules/@scope/<name>]
         │
         ▼
[profiles/web/package.json]
   ├── dependencies: { "<id>": "link:..." }
   └── dsh.profile.bundles: [ "<id>" ]
         │
         ▼ (DSH 启动: dsh-app-boot)
 1. 验证 package.json 中存在 dsh.bundle
 2. 执行 cordis.patch.yml 容器注入
 3. 加载 index.js 后端服务 (Schema 动态解析)
 4. 向 Web / Desktop 前端分发 client.js (双 ID 注册)

2核心适配七大铁律 (Seven Core Principles)

原则 1元数据与标识符双重对齐 (Identity & Manifest Alignment)

痛点:DSH 在 NPM 生态中支持带有 @scope/name 的组织包,但在本地目录软链、前端 Combo 打包以及部分 Profile 解析器中,常将斜杠转义或使用裸名称(Bare Name)如 scope-name。缺少 dsh.bundle 声明会直接触发致命异常崩溃。

适配规则:

  1. package.json 中的 name 保持标准命名(如 @dsh-external/my-plugin)。
  2. 插件必须在元数据中声明 dsh.bundle,缺少此字段将直接触发致命异常 declares no dsh.bundle in its package.json 导致容器崩溃。
  3. plugin.json 需严格匹配宿主契约,将 harnessVersion 下调以兼容当前容器(例如 ">=0.1.0",避免限制为 ">=1.0.0" 导致低版本拒绝加载)。
// package.json 核心元数据配置
{
  "name": "@dsh-external/my-plugin",
  "version": "1.0.0",
  "main": "lib/index.js",
  "dsh": {
    "bundle": {
      "patch": "./cordis.patch.yml"
    }
  }
}
官方 Bundle 规范,杜绝装载报错

标准声明 cordis.patch.yml 与 package.json 发布项,杜绝宿主容器装载崩溃

官方生态标准规范
1步骤 1:在插件根目录下新增 cordis.patch.yml

文件路径:cordis.patch.yml

# yaml
- insert:
    - id: ui-model-switcher
      name: 'dsh-client-ui-model-switcher'
2步骤 2:在 package.json 中补齐 dsh.bundle 与文件发布声明

编辑 package.json:

  • 在 "files" 列表中加入 "cordis.patch.yml"。
  • 在 "dsh" 对象中增加 "bundle": { "patch": "./cordis.patch.yml" }。

修改后的 package.json 关键段落如下:

# json
{
  "name": "dsh-client-ui-model-switcher",
  "version": "0.7.1",
  "files": [
    "lib",
    "cordis.patch.yml"
  ],
  "dsh": {
    "client": {
      "platform": "web"
    },
    "bundle": {
      "patch": "./cordis.patch.yml"
    }
  }
}
原则 2双向 NTFS Junction 软链架构 (Dual Junction Topology)

痛点:Windows 环境下若使用全量文件复制,会导致代码修改无法实时生效;使用标准符号链接(Symlink)则必须 Windows 管理员提权(UAC),严重阻碍普通用户一键运行。

适配规则:

  1. 统一采用 NTFS Junction(目录联接 mklink /J),普通用户权限即可秒级创建,无须管理员提权。
  2. 必须向每个活跃 Profile(web 和 default)的 node_modules 目录下建立双重软链:• Bare 别名:node_modules/dsh-external-my-plugin
    • Scoped 路径:node_modules/@dsh-external/my-plugin
  3. 彻底消除 Node 模块解析器在不同加载钩子下的路径找不到(ERR_MODULE_NOT_FOUND)问题。
原则 3运行时依赖三级安全回退 (Dynamic Dependency Fallback)

痛点:插件外部独立分发包通常不携带宿主级私有依赖(如 @deepseek-ai/schemastery 或 cordis),模块顶层直接裸 import 会直接抛出无法捕获的模块未找到错误,导致容器进程直接崩溃。

适配规则:禁止模块顶层裸导入可能缺失的宿主包,必须封装多级动态解析链与轻量桩兜底:

// 标准三级安全导入模式 (lib/index.js)
async function loadSchemaLib() {
  // Level 1: 宿主上下文解析 (import.meta.resolve)
  try {
    return await import('@deepseek-ai/schemastery');
  } catch (_) {}

  // Level 2: 宿主根路径与全局 node_modules 遍历
  const searchDirs = [
    path.resolve(process.env.USERPROFILE || '', '.dsh/node_modules/@deepseek-ai/schemastery'),
    path.resolve(process.cwd(), 'node_modules/@deepseek-ai/schemastery')
  ];
  for (const dir of searchDirs) {
    if (fs.existsSync(dir)) {
      try {
        return await import(pathToFileURL(dir).href);
      } catch (_) {}
    }
  }

  // Level 3: 轻量内联 Mock 兜底,防止进程崩溃
  return {
    default: {
      object: (shape) => ({ shape, parse: (v) => v }),
      string: () => ({ default: (v) => v }),
      number: () => ({ default: (v) => v }),
      boolean: () => ({ default: (v) => v })
    }
  };
}
原则 4前端客户端脚本双 ID 注册 (Dual Client Registration)

痛点:Web 页面静态 Combo 收集器和桌面客户端内嵌加载器对模块请求的键值可能不同(一个使用全名 @dsh-external/my-plugin,另一个使用文件别名 dsh-external-my-plugin)。

// client/client.js 必须一次性向前端模块池注册所有可能的键
(function registerClient(factory) {
  if (typeof window !== 'undefined' && window.__ModuleLoader__) {
    const IDs = ['@dsh-external/my-plugin', 'dsh-external-my-plugin'];
    for (const id of IDs) {
      window.__ModuleLoader__.define(id, factory);
    }
  }
})(function (require, exports, module) {
  // 客户端组件实现...
});
原则 5文件编码防 BOM 铁律 (Strict Non-BOM UTF-8)

痛点:Windows PowerShell 5.1 默认的 Out-File -Encoding utf8 或 Set-Content 会强制写入 3 字节 UTF-8 BOM 头(\\xEF\\xBB\\xBF)。Node.js 原生 JSON.parse() 在解析含 BOM 的 package.json 时会直接崩溃并报 SyntaxError: Unexpected token ''。

# PowerShell 修改/保存 JSON 文件时,必须明确禁用 BOM
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
[System.IO.File]::WriteAllText($jsonPath, $jsonString, $utf8NoBom)

💡 提示:安装脚本本身(.ps1)在 Windows 下应以 UTF-8 with BOM 保存,避免中文注释和路径在 GBK 代码页环境下被解析为乱码。

原则 6配置热写入与事务性备份 (Atomic Update & Rollback)

痛点:安装脚本直接覆写宿主配置文件,若中途异常或格式损坏,将导致宿主永久损坏无法开机。

  • 修改前必须对目标 package.json 进行时间戳备份(package.json.bak.YYYYMMDD_HHmmss)。
  • 结构化解析与合流更新:同时检查并更新 dependencies(记录插件版本或 link: 引用),更新 dsh.profile.bundles(幂等追加,避免重复添加数组项)。
  • 自动格式化对齐缩进(2 空格)。
原则 7闭环式无依赖自检验证 (Self-Test Closure)

痛点:安装脚本输出成功,但因文件缺失、软链失效或权限问题宿主启动后依然崩溃。

适配规则:安装脚本末尾必须直接调用轻量级 Node 自检脚本(如 scripts/check-install.js),真实模拟模块解析并验证:

  1. 软链是否真实可达;
  2. 目标目录中的 package.json 是否包含合法的 dsh.bundle;
  3. JSON.parse 是否报错。自检返回码非 0 则立刻告警提示。

3标准化工程目录结构规范 (Standard Project Structure)

新项目或适配项目建议统一保持以下工程结构,兼顾全生命周期安装、自检、卸载与跨平台适配:

my-plugin-v1.0.0/
├── client/                     # 前端组件源码
│   └── client.js
├── docs/                       # 架构与协议文档
├── lib/                        # 编译/运行时分发代码
│   ├── client.js               # 打包后的前端模块
│   └── index.js                # 后端主入口 (含三级依赖安全兜底)
├── src/                        # 后端源码
│   └── index.js
├── scripts/
│   ├── build.mjs               # 构建/同步产物脚本
│   └── check-install.js        # 核心安装自检器
├── cordis.patch.yml            # DSH 容器服务编排声明
├── package.json                # 包含 dsh.bundle 声明的标准清单
├── plugin.json                 # 插件元信息与 harnessVersion 契约
├── install.bat                 # Windows 用户一键运行批处理
├── install.ps1                 # Windows 全自动化安全部署脚本
├── uninstall.bat               # Windows 一键安全卸载批处理 (补充推荐)
├── uninstall.ps1               # Windows 一键安全卸载脚本 (补充推荐)
├── install.sh                  # Linux / macOS 一键安装脚本 (补充推荐)
└── uninstall.sh                # Linux / macOS 一键卸载脚本 (补充推荐)

4标准化安装脚本通用模板与工程实现 (Script Templates)

后续项目可直接复用以下经过严格实战检验的脚本模板:

1. install.bat (Windows 一键引导)
@echo off
chcp 65001 >nul
title 正在安装 DSH 插件...
cd /d "%~dp0"
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\install.ps1"
pause
2. scripts/check-install.js (自检逻辑)
const fs = require('fs');
const path = require('path');

const userHome = process.env.USERPROFILE || process.env.HOME || '';
const targetPkg = path.join(userHome, '.dsh', 'profiles', 'web', 'node_modules', 'dsh-external-my-plugin', 'package.json');

try {
  if (!fs.existsSync(targetPkg)) {
    console.error('Self-test FAILED: Target node_modules not found:', targetPkg);
    process.exit(1);
  }
  const raw = fs.readFileSync(targetPkg, 'utf8');
  const parsed = JSON.parse(raw);
  if (!parsed.dsh || !parsed.dsh.bundle) {
    console.error('Self-test FAILED: package.json missing dsh.bundle declaration');
    process.exit(1);
  }
  console.log('Self-test PASSED: Plugin bundle verified.');
  process.exit(0);
} catch (err) {
  console.error('Self-test ERROR:', err.message);
  process.exit(1);
}
3. install.ps1 核心执行框架
# 1. 目标定位与环境检查
$homeDir = [Environment]::GetFolderPath("UserProfile")
$dshRoot = Join-Path $homeDir ".dsh"
$pluginName = "dsh-external-my-plugin"
$scopedName = "@dsh-external/my-plugin"
$sourceDir = $PSScriptRoot

# 2. 插件实体目录同步与 Junction 软链配置
$installedPluginDir = Join-Path $dshRoot "plugins\$pluginName"
if (!(Test-Path $installedPluginDir)) { New-Item -ItemType Directory -Path $installedPluginDir -Force | Out-Null }
robocopy $sourceDir $installedPluginDir /E /XD .git tests /R:1 /W:1 | Out-Null

# 3. 对 web 与 default profiles 建立双向 Junction 与注册
$profiles = @("web", "default")
foreach ($p in $profiles) {
    $nmDir = Join-Path $dshRoot "profiles\$p\node_modules"
    $scopeDir = Join-Path $nmDir "@dsh-external"
    
    # 建立 Bare Junction (无需管理员提权)
    $bareTarget = Join-Path $nmDir $pluginName
    if (Test-Path $bareTarget) { cmd /c rmdir "$bareTarget" }
    cmd /c mklink /J "$bareTarget" "$installedPluginDir" | Out-Null
    
    # 建立 Scoped Junction
    if (!(Test-Path $scopeDir)) { New-Item -ItemType Directory -Path $scopeDir -Force | Out-Null }
    $scopedTarget = Join-Path $scopeDir "my-plugin"
    if (Test-Path $scopedTarget) { cmd /c rmdir "$scopedTarget" }
    cmd /c mklink /J "$scopedTarget" "$installedPluginDir" | Out-Null
    
    # 无 BOM 安全更新 profile package.json
    $profPkg = Join-Path $dshRoot "profiles\$p\package.json"
    if (Test-Path $profPkg) {
        $backupPkg = "$profPkg.bak." + (Get-Date -Format "yyyyMMdd_HHmmss")
        Copy-Item -Path $profPkg -Destination $backupPkg -Force
        
        $json = Get-Content -Raw -Path $profPkg -Encoding UTF8 | ConvertFrom-Json
        # 确保 dependencies 与 bundles 包含本插件...
        if (-not $json.dependencies) { $json | Add-Member -MemberType NoteProperty -Name "dependencies" -Value (New-Object PSObject) }
        $json.dependencies | Add-Member -MemberType NoteProperty -Name $scopedName -Value "link:../../plugins/$pluginName" -Force
        
        if ($json.dsh -and $json.dsh.profile -and $json.dsh.profile.bundles) {
            $bundles = [System.Collections.ArrayList]@($json.dsh.profile.bundles)
            if (-not $bundles.Contains($scopedName)) { [void]$bundles.Add($scopedName) }
            $json.dsh.profile.bundles = $bundles
        }

        $utf8NoBom = New-Object System.Text.UTF8Encoding($false)
        [System.IO.File]::WriteAllText($profPkg, ($json | ConvertTo-Json -Depth 10), $utf8NoBom)
    }
}

# 4. 执行 Node 自检
node "$sourceDir\scripts\check-install.js"
4. [补充] uninstall.ps1 (全自动一键安全卸载与环境还原)
# 一键卸载与配置还原脚本
$homeDir = [Environment]::GetFolderPath("UserProfile")
$dshRoot = Join-Path $homeDir ".dsh"
$pluginName = "dsh-external-my-plugin"
$scopedName = "@dsh-external/my-plugin"

$profiles = @("web", "default")
foreach ($p in $profiles) {
    $nmDir = Join-Path $dshRoot "profiles\$p\node_modules"
    # 移除 Bare 与 Scoped Junction 软链
    $bareTarget = Join-Path $nmDir $pluginName
    if (Test-Path $bareTarget) { cmd /c rmdir "$bareTarget" }
    $scopedTarget = Join-Path $nmDir "@dsh-external\my-plugin"
    if (Test-Path $scopedTarget) { cmd /c rmdir "$scopedTarget" }

    # 清理 package.json 依赖
    $profPkg = Join-Path $dshRoot "profiles\$p\package.json"
    if (Test-Path $profPkg) {
        $json = Get-Content -Raw -Path $profPkg -Encoding UTF8 | ConvertFrom-Json
        if ($json.dependencies -and $json.dependencies.$scopedName) {
            $json.dependencies.PSObject.Properties.Remove($scopedName)
        }
        if ($json.dsh -and $json.dsh.profile -and $json.dsh.profile.bundles) {
            $json.dsh.profile.bundles = @($json.dsh.profile.bundles | Where-Object { $_ -ne $scopedName })
        }
        $utf8NoBom = New-Object System.Text.UTF8Encoding($false)
        [System.IO.File]::WriteAllText($profPkg, ($json | ConvertTo-Json -Depth 10), $utf8NoBom)
    }
}
Write-Host "Plugin $pluginName uninstalled successfully." -ForegroundColor Green
5. [补充] install.sh (Linux / macOS 跨平台自动化安装脚本)
#!/usr/bin/env bash
set -e
DSH_ROOT="$HOME/.dsh"
PLUGIN_NAME="dsh-external-my-plugin"
SCOPED_NAME="@dsh-external/my-plugin"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TARGET_DIR="$DSH_ROOT/plugins/$PLUGIN_NAME"

mkdir -p "$TARGET_DIR"
cp -R "$SCRIPT_DIR/"* "$TARGET_DIR/"

for P in "web" "default"; do
  NM_DIR="$DSH_ROOT/profiles/$P/node_modules"
  if [ -d "$DSH_ROOT/profiles/$P" ]; then
    mkdir -p "$NM_DIR/@dsh-external"
    ln -sfn "$TARGET_DIR" "$NM_DIR/$PLUGIN_NAME"
    ln -sfn "$TARGET_DIR" "$NM_DIR/@dsh-external/my-plugin"
    # 使用 Node 安全更新 package.json
    node -e "
      const fs = require('fs');
      const p = '$DSH_ROOT/profiles/$P/package.json';
      if (!fs.existsSync(p)) process.exit(0);
      const pkg = JSON.parse(fs.readFileSync(p, 'utf8'));
      pkg.dependencies = pkg.dependencies || {};
      pkg.dependencies['$SCOPED_NAME'] = 'link:../../plugins/$PLUGIN_NAME';
      if (pkg.dsh?.profile?.bundles && !pkg.dsh.profile.bundles.includes('$SCOPED_NAME')) {
        pkg.dsh.profile.bundles.push('$SCOPED_NAME');
      }
      fs.writeFileSync(p, JSON.stringify(pkg, null, 2) + '\n');
    "
  fi
done
node "$SCRIPT_DIR/scripts/check-install.js"
echo "DeepSeek Harness plugin installed successfully."

5核心异常诊断与故障排查速查表 (Troubleshooting Matrix)

异常报错 (Error Signature)根因分析 (Root Cause)一键修复方案 (Resolution)
SyntaxError: Unexpected token '' in package.jsonPowerShell 默认输出了 3 字节 UTF-8 BOM 头(\\xEF\\xBB\\xBF)。使用 New-Object System.Text.UTF8Encoding($false) 覆写文件彻底去除 BOM 头。
declares no dsh.bundle in its package.json插件根 package.json 缺少 dsh.bundle.patch 容器编排入口字段。补齐 "dsh": { "bundle": { "patch": "./cordis.patch.yml" } }。
ERR_MODULE_NOT_FOUNDNode 解析器无法在 node_modules 下定位到裸名或 Scoped 别名。检查双向 NTFS Junction 软链是否同时建立了 Bare 别名与 Scoped 路径。
A required privilege is not held by the client脚本误使用了需要管理员权限的 mklink /D。改用目录联接 mklink /J,普通用户权限秒级执行,无须管理员提权。
UI 状态条未展示 / 前端白屏client.js 未在 window.__ModuleLoader__ 中注册全量双 ID。在 client.js 注册循环中同时传入 Scoped 全名与 Bare 裸名别名。

6交付与对齐核对清单 (Checklist)

新项目发布前,请逐项核对确认:

BOM 纯净检查

所有 .json 产物均无 0xEF 0xBB 0xBF 头。

Bundle 契约

package.json 包含 dsh.bundle.patch。

版本契约

plugin.json 中的 harnessVersion 与目标宿主版本兼容(推荐 >=0.1.0)。

运行时兜底

lib/index.js 不直接硬导入可能缺失的宿主私有库,具备三级安全 Fallback。

双 ID 注入

client.js 注册了完整 scoped ID 与 bare name。

自检自动化与安全卸载

install.bat 执行完毕后自动触发 check-install.js,且提供配套的卸载还原方案。

三、创作者荣誉等级体系

创作者等级越高,享有越显著的生态荣誉与榜单加成

创作者荣誉等级与榜单加权积分对照表

创作者等级累计获得鲸鱼币荣誉头衔徽章额外榜单加权积分
Lv.1 初级探索者0 ~ 9 币初级探索者基础积分 (+0)
Lv.2 活跃极客10 ~ 29 币活跃极客+50 点权重积分
Lv.3 资深创作者30 ~ 99 币资深创作者+150 点权重积分
Lv.4 生态领航者100 ~ 299 币生态领航者+300 点权重积分
Lv.5 社区巨鲸300+ 币社区巨鲸+500 点顶级加权积分

四、鲸鱼币获取与生态应用场景

每日签到、投币打榜、自主定价与悬赏认领

📅 1. 每日签到 (+1 币)

每天在导航栏或控制台签到立得 1 鲸鱼币,连续签到满 7 天额外奖励 +2 币连签大礼包。

💰 2. 创作者自主定价

创作者可将插件设为 1~5 鲸鱼币专享下载(一次解锁,终身免费升级),收益 100% 归创作者。

🙋‍♂️ 3. 需求悬赏认领

在需求广场认领并解决社区用户的定制需求,方案被采纳后直接获取悬赏池中的全部鲸鱼币。

开启你的 DeepSeek Harness 插件创作之路

支持 7-Zip 万能打包格式,即传即发布,享受原创顶级算法曝光保护。