dsh-openlist-sync
OpenList 文件同步插件(含设置面板):自动把 DSH 对话交付文件上传到 OpenList 挂载目录,并提供该目录的完整读写工具集。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:bg8lng/dsh-openlist-sync说明文档
阅读完整 README ↗配置
在 $DSH_HOME/profiles/web/cordis.patch.yml(即 ~/.dsh/profiles/web/cordis.patch.yml)中追加/覆盖:
- id: tool-openlist-sync
config:
baseUrl: "https://your-openlist.example.com" # OpenList 访问地址;挂在子路径则带子路径
username: admin
password: 你的密码 # 建议改用环境变量 DSH_OPENLIST_PASSWORD,见下
# token: "站点令牌" # 二选一:OpenList 后台 设置→其他→站点令牌,优先于账号密码
targetDir: "/DSH交付" # 交付文件自动存放目录(自动创建)
layout: "date" # flat | date(默认)| date-session
autoSync: true # 总开关
syncChatDeliveries: true # dsh_im_return_file 聊天交付
syncProducedFiles: true # write/edit/str_replace_editor 产物
overwrite: false # 远端同名是否覆盖
restrictToRoot: true # 目录工具是否锁定在 targetDir 内
环境变量(优先级最高,避免明文密码进 YAML)
| 变量 | 说明 |
|---|---|
DSH_OPENLIST_BASE_URL | OpenList 地址 |
DSH_OPENLIST_USERNAME | 用户名 |
DSH_OPENLIST_PASSWORD | 密码(推荐) |
DSH_OPENLIST_TOKEN | 站点令牌(替代账号密码) |
DSH_OPENLIST_TARGET_DIR | 目标目录 |
完整配置项
| 配置 | 默认 | 说明 |
|---|---|---|
baseUrl | 空 | OpenList 根地址(含子路径则到子路径) |
username / password | 空 | 账号密码登录 |
token | 空 | 站点令牌(优先) |
targetDir | /DSH交付 | 交付目录 |
layout | date | flat / date / date-session |
autoSync | true | 自动同步总开关 |
syncChatDeliveries | true | 聊天交付文件(dsh_im_return_file) |
syncProducedFiles | true | write/edit/str_replace_editor 产物 |
overwrite | false | 同名覆盖 |
dedupeByContent | false | 按 sha256 内容全局去重 |
includes | [] | 文件名白名单(*/?),空=不限 |
excludes | [] | 文件名黑名单 |
maxBytes | 314572800 | 单文件上限(默认 300MB) |
restrictToRoot | true | 目录工具锁在 targetDir |
dataDir | ~/.dsh/dsh-openlist-sync | state.json 存放处 |
timeoutMs | 30000 | API 超时 |
producedTools | 见下 | 工具名→路径参数映射(扩展) |
默认 producedTools:{ write: file_path, edit: file_path, str_replace_editor: path, dsh_im_return_file: path }。其它插件产出的文件可在配置里追加,例如:
producedTools:
excel_task: outPath # dsh-excel-chat 任务输出也自动同步
run_code: outputPath # 假想示例
完整配置项
| 配置 | 默认 | 说明 |
|---|---|---|
baseUrl | 空 | OpenList 根地址(含子路径则到子路径) |
username / password | 空 | 账号密码登录 |
token | 空 | 站点令牌(优先) |
targetDir | /DSH交付 | 交付目录 |
layout | date | flat / date / date-session |
autoSync | true | 自动同步总开关 |
syncChatDeliveries | true | 聊天交付文件(dsh_im_return_file) |
syncProducedFiles | true | write/edit/str_replace_editor 产物 |
overwrite | false | 同名覆盖 |
dedupeByContent | false | 按 sha256 内容全局去重 |
includes | [] | 文件名白名单(*/?),空=不限 |
excludes | [] | 文件名黑名单 |
maxBytes | 314572800 | 单文件上限(默认 300MB) |
restrictToRoot | true | 目录工具锁在 targetDir |
dataDir | ~/.dsh/dsh-openlist-sync | state.json 存放处 |
timeoutMs | 30000 | API 超时 |
producedTools | 见下 | 工具名→路径参数映射(扩展) |
默认 producedTools:{ write: file_path, edit: file_path, str_replace_editor: path, dsh_im_return_file: path }。其它插件产出的文件可在配置里追加,例如:
producedTools:
excel_task: outPath # dsh-excel-chat 任务输出也自动同步
run_code: outputPath # 假想示例