dshbase

插件目录 / Automation / dsh-chat-sync

dsh-chat-sync

已验证 · 实测可装 nan1010082085

✓ 持续维护 基于 1 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

0Stars
0Forks
0未关闭 issue
JavaScript语言
2026-08-19最近推送
跨平台平台

功能简介

将本地 Claude Code、Codex CLI、Cursor Agent 对话同步为 DSH 会话。

我们的评价
可用 — 实测通过,早期项目

将本地 Claude Code、Codex CLI、Cursor Agent 对话同步为 DSH 会话。 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

dsh-chat-sync

GitHub
npm

DSH(DeepSeek Harness)插件:把本地 Claude Code / Codex CLI / Cursor Agent 的对话自动导入为 DSH 会话,在侧边栏统一查看。

功能

能力 说明
自动导入 发现新对话自动创建 DSH 会话
工作区匹配 按源对话的项目路径自动匹配或创建 DSH 工作区
三源分组 侧边栏按 Claude Code / Codex CLI / Cursor Agent 分组显示
动态同步 fs.watch 递归监听 + SSE 推送,列表自动刷新
隐私围栏 所有 API 仅接受 loopback 请求

数据源

路径
Claude Code ~/.claude/projects/<项目>/<sessionId>.jsonl
Codex CLI ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl
Cursor Agent ~/.cursor/projects/<项目>/agent-transcripts/<uuid>/<uuid>.jsonl

工作原理

自动导入流程

  1. 扫描:定期扫描三个数据源目录,发现新的对话文件
  2. 匹配工作区:根据源对话的 cwd(工作目录)查找匹配的 DSH 工作区
    • 匹配到 → 直接使用
    • 未匹配 → 自动创建新工作区目录
  3. 创建会话:通过 DSH API 创建新会话,挂载到对应工作区
  4. 命名:会话标题格式为 [来源] 原始标题(如 [Claude] 修复登录bug

状态追踪

已导入的会话记录在 .chat-sync/imported.json,避免重复导入。只导入最近 24 小时内有更新的会话。

安装

# 使用 dsh plugin 安装
dsh plugin --profile web add dsh-chat-sync

配置

在 profile 的 cordis.patch.yml~/.dsh/profiles/web/cordis.patch.yml)按 id 覆盖:

- id: chat-sync
  config:
    enabled: true
    # 浏览功能
    watch: true                    # 动态同步
    syncToWorkspace: true          # 文件复制到 .chat-sync 目录
    # 自动导入
    autoImport: true               # 自动导入为 DSH 会话
    autoImportIntervalMs: 60000    # 扫描间隔(毫秒)
    # 高级
    maxSessions: 500               # 会话列表上限
    maxMessageChars: 8000          # 单条消息截断长度
    recentLiveMs: 180000           # 「活跃」判定窗口

配置项说明

配置项 默认值 说明
enabled true 插件总开关
watch true 文件监听 + SSE 推送
syncToWorkspace true 文件复制到 .chat-sync 目录
autoImport true 自动导入为 DSH 会话
autoImportIntervalMs 60000 自动导入扫描间隔

API(均 loopback-only)

路由 说明
GET /api/dsh-chat-sync/status 各源可用性 / 会话数 / 同步模式
GET /api/dsh-chat-sync/sessions 过滤后的会话列表
GET /api/dsh-chat-sync/session?id=<source:uuid> 消息流(增量)
GET /api/dsh-chat-sync/events SSE 实时更新

开发与测试

node --check lib/index.js lib/sources.js lib/routes.js lib/client.js lib/auto-import.js
node tests/smoke.mjs         # 端到端测试
node tests/client-load.mjs   # 客户端加载测试

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-chat-sync」,它会在目录里找到并自动安装。

Web profile:

dsh plugin --profile web add dsh-chat-sync

Headless(CLI)profile:

dsh plugin --profile headless add dsh-chat-sync

包信息

npm:dsh-chat-sync · 版本 0.3.4 · 实测环境 dsh 0.1.0-rc.6

实测报告

端到端验证通过:`dsh plugin add` 安装成功、进入 profile 配置树、启动任务正常。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Automation 里更多

浏览全部 1784 个插件 →

🌐 English