dshbase

插件目录 / Developer / dsh-session-id

dsh-session-id

已验证 · 实测可装 xiaozhiaixue

✓ 持续维护

查看 GitHub ↗ ← 返回插件目录

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

功能简介

在DSH会话区底部显示会话ID,点击一下就能复制

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

在DSH会话区底部显示会话ID,点击一下就能复制 实测能干净安装、正常启动。早期项目,但功能可用。

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

README

dsh-session-id

Session ID footer for DeepSeek Harness (DSH): shows the current session id under the composer, click to copy.

DeepSeek Harness 会话 ID 显示插件:在输入框(composer)下方的 footer 位置以小字显示当前会话 ID,点击一键复制。

仓库 / 目录名是 dsh-session-id;内部 bundle 包名沿用既有安装名 dsh-session-id-footer(与 ~/.dsh/profiles/web/cordis.patch.yml 中的注册名一致,dsh plugin 从本仓库安装后即与现网安装完全同名)。这与官方惯例一致——教程示例仓库 hello-plugin 的包名即为 dsh-hello-plugin(仓库名 ≠ 包名,包名带 dsh- 前缀)。

Why

DSH 的会话 ID 是排查、归档、跨会话协作时的关键标识,但 GUI 默认不展示当前会话 ID——只能靠开发者工具或归档面板间接获取。本插件补上最后一步:在 composer 下方的 dock 内以小字常驻显示当前会话 ID,点击即复制,并给出「✓ 已复制」反馈。

  • 纯 UI 插件:不碰 host 状态、不注册 HTTP 端点,零风险、零权限。
  • 即时复制:优先 navigator.clipboard,降级 execCommand('copy') 兼容旧浏览器。
  • 贴近官方插件机制:走 window.__ModuleLoader__.load 标准 bundle 格式 + slots.inject("conversation.composer.dock") 官方插槽。

Features

  • 🆔 当前会话 ID 以 11px 小字常驻 composer 底部 dock
  • 📋 点击复制会话 ID(1.6s「✓ 已复制」反馈 + 绿色高亮)
  • 🖱️ hover 提亮、user-select: text 可手动框选
  • 🎯 无会话时自动隐藏(sessionId 为空不渲染)

Install

标准 DSH profile bundle(官方外部插件分发路径,见 docs/user/develop/basic/publish.md):仓库根目录即 bundle 包(package.json 声明 dsh.bundle.patch),dsh plugin 安装后由 bundle 的 cordis.patch.yml 自动插入插件行。无需构建步骤——纯 JS,git 安装不需要 prepare 脚本或 allowBuilds。

Option A — official dsh plugin (recommended)

# From a directory that contains this checkout (the repo root IS the package):
dsh plugin --profile web add ./dsh-session-id
# or straight from GitHub (plain JS, no build permission needed):
dsh plugin --profile web add github:realpkuasule/dsh-session-id

# Verify the composed layer without booting:
dsh --profile web --dump-config | grep -A2 dsh-session-id-footer

dsh plugin links the package, records it in the profile's dependencies, and the bundle layer inserts the session-id-footer plugin row.

Discoverability

Add the dsh-plugin topic to your plugin repository for discoverability — the official DeepSeek Harness README recommends it, and dsh-plugin is the shared topic under which the community finds DSH plugins (both mirrors of this repo, realpkuasule/dsh-session-id and xiaozhiaixue/dsh-session-id, carry it).

Option B — manual (no CLI)

# 1. Copy the package (repo root) into your profile's node_modules
DSH_HOME="${DSH_HOME:-$HOME/.dsh}"
mkdir -p "$DSH_HOME/profiles/node_modules/dsh-session-id-footer"
cp -R . "$DSH_HOME/profiles/node_modules/dsh-session-id-footer/"
# 2. Add the bundle layer to $DSH_HOME/profiles/web/cordis.patch.yml
#    (an `- insert:` list entry — same shape as the bundle's own patch file)
    - id: session-id-footer
      name: dsh-session-id-footer
# 3. Restart `dsh web`

Open the GUI: the composer dock now shows the current session ID in small text. Click it to copy.

Architecture

Browser (client.js, __ModuleLoader__ bundle)
 └─ slots.inject("conversation.composer.dock", order 10) ──▶ <span> session id
      • props.sessionId / props.session.id → display string
      • click → navigator.clipboard → fallback execCommand('copy')
      • 1.6s "✓ 已复制" feedback via ctx.timeout
Node (index.js, profile Cordis plugin)
 └─ empty apply(): pure UI plugin, exists only so the package
    registers in the host cordis.yml / Loader; the browser half
    ships via exports["./client"] + the package.json dsh.client declaration
  • 数据来源:composer dock 插槽注入的 props.sessionId(官方 dsh-client-ui-* 渲染链自带),无需额外数据层。
  • 渲染位置:conversation.composer.dock 插槽 order: 10,位于 composer 卡片下方的 dock 条内。
  • 隐藏逻辑:无会话(sessionId 为空)时不渲染任何元素,不占位。

Repository layout

The repository root is the bundle package, following the official bundle layout from publish.md:

dsh-session-id/
├── package.json          # bundle manifest: dsh.bundle.patch + dsh.client.platform: web
├── cordis.patch.yml      # the bundle's patch layer (inserts the plugin row)
├── lib/
│   ├── index.js          # host half (empty apply)
│   └── client.js         # browser half (__ModuleLoader__ bundle)
├── README.md
├── DESIGN.md             # full design doc: decisions, risks, verification
└── LICENSE               # MIT

License

MIT

安装

🧩 让 Agent 自动装(推荐)

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

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-session-id」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:xiaozhiaixue/dsh-session-id

Headless(CLI)profile:

dsh plugin --profile headless add github:xiaozhiaixue/dsh-session-id

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

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

分享徽章

Developer 里更多

浏览全部 7819 个插件 →