dsh-webapi

DSH PLUGIN会话与消息

仓库 toddpan/dsh-webapi

会话与消息 未标注验证等级 安全审查:未标注 可信度:未标注 可安装插件

把 DeepSeek Harness 开放为 47 条 REST 与 SSE 接口及 OpenAI 兼容端点,让三方客户端、CI 或外部 Agent 直接驱动 DSH 的工作区、会话与模型。

一句话选型结论

按资料字段整理

dsh-webapi 是会话与消息类的 DSH 可安装插件,未做沙盒验证,暂无安全审查结论,列出 5 项功能,没有现成安装命令,需要按仓库 README 接入。验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么;涉及密钥或系统权限的,建议先在隔离环境试装。

分类会话与消息 收录类型可安装插件 验证等级未标注验证等级 安全审查未标注
验证等级 UNKNOWN 未标注验证等级
GitHub 星标 1 复刻 2 · 未关闭 issue 未标注
最近更新 2026-10-09 创建于 2026-09-03
README 20.2 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
  1. 1
    确认版本与运行环境

    仓库没有标注兼容版本与 Node.js 要求,先确认你的 DSH 版本能装,再继续。

  2. 2
    执行安装命令

    在 DSH 里执行上面的命令;多包仓库要注意区分具体子包名,别装错包。

  3. 3
    确认已挂载

    用 dsh plugin list 查看列表里是否出现这个插件,出现即挂载成功。

  4. 4
    试跑并检查权限

    加载后跑一个最小用例,确认它能正常工作;同时看它申请了哪些文件、命令或网络权限。

兼容 DSH 版本未标注版本不匹配时安装会报错
Node.js 要求未标注来自仓库 package.json 的 engines 字段
前置依赖无需要同时安装的同级依赖
npm 包名未发布到 npm可用 npm view 查看包信息

能做什么

5 项功能
字段来自项目仓库与公开索引,中文说明由本站标注

dsh-webapi:把 DeepSeek Harness 开放为 HTTP 接口的 DSH plugin

  • 47 条 REST + SSE 路由
  • OpenAI 兼容 /chat/completions
  • 工作区与会话管理
  • 流式输出与事件订阅
  • 内置 OpenAPI 文档页

上游标签

deepseek-harnessdshdsh-pluginrest-api

验证等级与安全审查

未标注验证等级
自动化流程结论,不是人工审核
验证等级未标注验证等级上游未给出验证结论,安装前请自行确认
安全审查未标注静态分析结论,未标注不代表已通过审查
仓库健康度未标注按仓库活跃度与最近更新时间给出
可信度未标注综合仓库活跃度与验证结果

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 列出了 5 项功能,能直接看出它解决什么问题。

先想清楚的地方

  • 安全审查还没结论,装之前先看仓库改了什么、要什么权限。
  • 没有现成安装命令,要按仓库 README 手动接入。
  • 验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么。

更适合

  • 需要在会话与消息场景里给 DSH 补能力的人。
  • 能接受在本地装依赖、愿意自己确认权限的人。

不太适合

  • 只使用 DSH 官方内置能力、不接受第三方插件的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
插件验证等级安全审查星标兼容版本安装命令
dsh-webapi当前 未做沙盒验证 未标注 1 未标注 无
dsh-desktop L3 · 安装规范通过 低风险 3.0 万 未标注 无
openpets L4 · 沙盒安装通过 低风险 1,274 未标注 有
deeptide L4 · 沙盒安装通过 低风险 1,104 0.1.1-rc.2 有
jingyun-dsh L3 · 安装规范通过 低风险 1,004 未标注 有
study-mate 未做沙盒验证 未标注 856 未标注 无

仓库档案

会话与消息
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方toddpan仓库 dsh-webapi · 默认分支 未标注
分类会话与消息remote
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言TypeScript仓库主语言
许可证BSD-3-Clause商用或二次分发前请确认条款原文
星标 / 复刻 / issue1 / 2 / 未标注收录时的数值,非实时
创建 / 更新2026-09-03 · 2026-10-09最后推送 未标注
本站收录2026-09-27首次进入本站目录的时间

README 全文

20.2 KB
作者原文,中文版优先;只做安全转义,不改内容

dsh-webapi (dsh-web-service)

English | 中文

A DSH plugin that exposes DeepSeek Harness over HTTP: the workspaces, sessions, models, settings,
skills and files already inside DSH become plain REST endpoints and SSE streams, plus an
OpenAI-compatible /chat/completions so an existing OpenAI client can talk to DSH unchanged.

Typical uses: a self-hosted console for DSH, a desktop or mobile client, CI / automation that drives
an agent, a non-DSH agent that calls DSH as a tool, or a gateway that puts DSH behind your own API.

  • No new dependencies — the plugin only injects webServer and tools; the routes ride on the
    DSH host webserver, plus an independent fixed-port service you can start and stop on demand.
  • 80+ routes (REST + SSE), documented by a built-in OpenAPI 3.0 spec and a request page, plus a settings page that starts/stops the independent API service and manages API keys.
  • Bilingual skill included — skills/dsh-web-service/SKILL.md teaches a DSH agent how to drive
    the API (streaming, cancelling, answering pending questions, file uploads).

Install

Requires DSH 0.1.0–0.2.x (peer ranges in package.json; verified on 0.1.7-rc.2, and type-checked plus assembly-verified on 0.2.0-rc.2).

Option 1: prebuilt tarball (recommended — no build step, no allowBuilds approval)

dsh plugin --profile web add \
https://github.com/toddpan/dsh-webapi/releases/latest/download/dsh-web-service.tgz

dsh plugin records the package in the profile package.json (dependency + dsh.profile.bundles);
a profile with HMR assembles it immediately, otherwise restart DSH. Verify:

curl -s http://127.0.0.1:3080/api/v1/system/status   # {"ok":true,...}
curl -sI http://127.0.0.1:3080/api/v1/docs           # HTTP/1.1 200 OK

> Upgrading. The asset name carries no version, so latest/download/dsh-web-service.tgz always
> points at the newest build for a fresh install — but package managers may reuse a cached
> resolution of that URL. To move an existing install to a known build, pin the versioned asset:
> dsh plugin --profile web add https://github.com/toddpan/dsh-webapi/releases/download/v0.1.11/dsh-web-service-0.1.11.tgz

Option 2: install straight from the git repo (the "GitHub repository" install in the plugin manager)

dsh plugin --profile web add github:toddpan/dsh-webapi

lib/ is committed, so a git install is directly runnable. It is kept in sync with src/; after
changing src/, rebuild and commit lib/ in the same change.

Option 3: build from source (needs a DSH source checkout)

git clone https://github.com/toddpan/dsh-webapi && cd dsh-webapi
DSH_CHECKOUT=/path/to/deepseek-harness bash scripts/build.sh     # src/ → lib/
dsh plugin --profile web add "$PWD"

scripts/build.sh symlinks cordis / schemastery / @deepseek-ai/* peers out of the checkout,
so no npm install is needed.

Configuration

All fields are optional; they live in the plugin row's config in your profile patch (defaults in
src/index.ts):

Field Default Meaning
pathPrefix /api/v1 Route prefix
apiKey '' Non-empty enables auth; requests must carry this key
standalonePort 0 Initial port on first install; 0 auto-allocates one (31800-31899). Once assigned, the settings page owns it
standaloneBindIp 127.0.0.1 Initial bind range on first install: 127.0.0.1 (local only) or 0.0.0.0 (LAN reachable); the settings page owns it afterwards
cors true Allow cross-origin requests
defaultCwd '' Default working directory; empty means process.cwd()
maxUploadBytes 2 GiB Upload size limit; use the chunked endpoints for bigger files
adminRemoteAccess false Whether non-loopback clients may reach the API Key admin endpoints; key management is local-only by default

> apiKey is only a legacy single key, kept for backward compatibility. Manage keys from the
> settings page instead — see API Key management.

API service (independent fixed port)

The plugin runs its own HTTP service, decoupled from the DSH host webserver: the host port changes
on every launch, while this port stays fixed for clients, scripts and reverse proxies.

  • A port is allocated on first install — the first free port from 31800, then it never drifts.
  • Start and stop from the settings page — GET /api/v1/settings/api-keys → the "API 服务" card.
    Port and bind range (127.0.0.1 local only / 0.0.0.0 LAN) apply immediately, no DSH restart.
  • Live API URL — the address follows the form as you type a port or switch the range; while
    running it shows the real address and copies with one click.
  • Persistent intent — a running service comes back on the same port after a DSH restart; one you
    stopped stays stopped.

State lives in /dsh-web-service/service-settings.json (0600); the legacy fixedPort
format is migrated on read.

Action Endpoint (admin token)
Read state GET /api/v1/api-keys/service
Start / change port / bind range POST /api/v1/api-keys/service/start { "port": 31800, "bindIp": "127.0.0.1" }
Stop POST /api/v1/api-keys/service/stop
Suggest a free port GET /api/v1/api-keys/service/free-port
Legacy compatibility GET / PUT /api/v1/api-keys/port (fixedPort: 0 stops)

A failed bind (port in use, …) returns 409 and rolls back to the previous listener, so the current
state is unchanged.

API Key management (settings page)

Open GET /api/v1/settings/api-keys to manage the independent API service and the keys
third parties use to call the API:
view (masked), create, rotate, revoke, and turn authentication on or off. The /docs page also
links to it from its header.

Three entry points

Entry Notes
"API 服务" in the DSH Web GUI sidebar The plugin ships a browser half (client half); after a DSH restart the panel appears in the sidebar and embeds this page
GET /api/v1/settings/api-keys The standalone page — bookmarkable
"管理 API Key" button on /docs One click from the API docs

The page sits behind an admin token gate: key management and normal API calls use two separate
credentials. On first open it asks for the admin token and shows the exact command to read it (run
on the machine that hosts DSH): cat /dsh-web-service/admin-token. The token is then kept
in the browser's localStorage. Until the gate passes, management buttons such as "新建 API Key" stay
hidden — no "click, then hit 401" dead ends.

Theming and offline availability

All three pages (/docs, /docs/reference, /settings/api-keys) share the HARNESS design tokens
(--dsw-alias-*, values mirrored from packages/client/ui-theme/src/styles/design-platform.css), so
colours, radii and type match the DSH Web GUI, in both light and dark:

  • Embedded in the GUI sidebar (same-origin iframe) the page reads the parent document's token
    values and follows its theme switches live — user-customised themes included;
  • Opened standalone it follows prefers-color-scheme, and honours ?theme=light / ?theme=dark.

Swagger UI is self-hosted from vendor/swagger-ui/ and served at /api/v1/docs/assets/*, so
/docs/reference needs no public CDN and works on intranets and offline.

Inside the GUI sidebar, in-page buttons such as "Swagger / OpenAPI JSON / interactive docs" navigate
within the panel (the target page offers a "← back" button). DSH Desktop's main window denies all
new windows (webContents.setWindowOpenHandler(() => ({ action: 'deny' }))), so target="_blank"
fails silently inside the app; external links still try a new window and fall back to a
copy-the-link hint when refused.

Creating a key offers two sources for the key value (the plaintext field on POST /api-keys):

Mode Behaviour
Random (default) Server generates dsk_ + 32 bytes of CSPRNG (256-bit entropy)
Use a custom key Paste an existing key (16–256 visible ASCII chars) to slot into an existing client or migrate

> The strength of a custom key is your responsibility, so it never shows even a prefix — otherwise
> my-secret-api-key-xxx would leak most of its value in the first 12 characters. The server still
> stores only its hash, and the list marks such records as custom. A value that already has an
> active record is rejected (400); revoked/expired values may be registered again.

Two separate credentials

Purpose Credential Header
Call business endpoints (data plane) API Key Authorization: Bearer or X-API-Key:
Manage keys (admin plane) Admin Token Authorization: Bearer or X-Admin-Token:

So a third party holding an API key cannot mint new keys for itself. The Admin Token is generated
on first startup and stored under the DSH config root in dsh-web-service/admin-token (mode 0600):

cat "${DSH_HOME:-$HOME/.dsh}/dsh-web-service/admin-token"

Security contract

  • Two things are persisted per key: sha256(plaintext) (for authentication) and a reversible
    sealed blob (for the list's "copy" button). sealed is AES-256-GCM under a key HKDF-derived from
    the admin token, so api-keys.json alone (backup, screenshot, pasted into an issue) does not
    reveal keys — the 0600 admin-token in the same directory is also required.
  • Every key in the list has a "copy" button: the plaintext is fetched on demand over an
    admin-token-authenticated endpoint and written straight to the clipboard — never into the DOM,
    localStorage, or logs.
  • Keys created before sealed storage shipped only have a hash and cannot be recovered; "copy"
    guides you to "rotate" instead. Deleting/recreating the admin token invalidates old sealed blobs,
    which likewise degrades to "not copyable" rather than silently returning a wrong value.
  • Admin endpoints accept loopback clients only by default. Remote key management requires
    adminRemoteAccess: true. Browser requests are same-origin checked (CSRF / DNS-rebinding);
    cross-origin gets 403 FORBIDDEN_ORIGIN.
  • Revoking is immediate and irreversible; rotating invalidates the old key at once. The safer path
    is: create a replacement key, roll it out, then revoke the old one.
  • When apiKey is set in the plugin config, auth is forced on and cannot be switched off from
    the page. Auth cannot be switched on when no valid key exists, which would lock you out.
  • A corrupt key store fails closed: auth is never relaxed and /system/status reports
    keysStoreDegraded. The corrupt file is renamed to api-keys.json.corrupt- for
    forensics and the store recovers from api-keys.json.bak (the last known good state, refreshed
    after every successful write), so existing key records are never silently dropped.
  • The loopback guard looks at the TCP peer address. If DSH sits behind a reverse proxy or tunnel the
    plugin sees the proxy as the peer, so the guard is effectively bypassed — close it off at the
    network layer, or keep adminRemoteAccess: false and manage keys locally only.
  • Data-plane auth is a Bearer/API-Key check with no same-origin rule: it is built for
    cross-origin third-party clients, so a browser page sending a valid key cross-origin is by design.
    The cross-origin surface is governed by the cors option.
  • The admin token is stored in the browser localStorage; use "clear local admin token" on shared
    machines.

The store lives at /dsh-web-service/api-keys.json (mode 0600).

Features

  1. Workspaces — create, update, delete and list workspaces and their sessions.
  2. Sessions — create, delete/archive, retitle or switch model, list, and page through message history.
  3. Models & settings — list models and providers, read and update the global default model, read
    settings namespaces, list agent presets.
  4. Streaming — POST /sessions/:id/prompt-stream pushes delta, reasoning, tool_call,
    tool_result and turn_end over Server-Sent Events; GET /sessions/:id/events taps the session's
    raw event bus.
    Streaming & timeout semantics (important): all three chat entry points (prompt /
    prompt-stream / chat/completions) use a stall watchdog instead of a wall-clock turn limit —
    continuously producing turns (long text generation, multi-step tool runs) are never cut off no
    matter how long they take; only a sustained absence of session events aborts with an explicit
    error. Tune via timeoutMs (sync entry point, stall gap, default 180s) and stallTimeoutMs
    (streaming entry point, default 300s). Every SSE channel emits a ': ping' comment frame every
    15s as a heartbeat so middle proxies/gateways cannot drop idle streams; any internal stream error
    surfaces as a visible error event instead of a silent disconnect.
  5. OpenAI compatibility — POST /chat/completions accepts a standard OpenAI client, streaming or not.
  6. Built-in docs — interactive request page at GET /api/v1/docs, OpenAPI 3.0 spec at
    GET /api/v1/openapi.json.
  7. Interactive sessions — read pending ask_user_question batches and answer them over REST, cancel
    a running turn, upload/list/download workspace files (including resumable chunked upload).
  8. API service & key settings page — GET /api/v1/settings/api-keys starts/stops the independent
    service, edits its port and bind range (with a live URL preview), and manages third-party access
    keys: multiple named keys, masked display, create / rotate / revoke, and an auth on/off switch.
    Hashes plus an admin-token-encrypted sealed copy are persisted.

API routes

Default prefix: /api/v1

Module Method Path Notes
System GET /system/status System status, live models, port info
GET /ping Machine fingerprint (IPs/MACs) to tell whether a 127.0.0.1 (natpass) node is the local machine
Workspaces GET /workspaces List workspaces
POST /workspaces Create / add a workspace
GET /workspaces/:id Workspace detail
PUT /workspaces/:id Rename a workspace
DELETE /workspaces/:id Remove a workspace binding
GET /workspaces/:id/sessions Sessions in a workspace
Sessions GET /sessions List sessions (search + workspace filter)
POST /sessions Create a session
GET /sessions/:id Session detail and state
PUT /sessions/:id Update a session (title / model)
DELETE /sessions/:id Delete or archive a session
GET /sessions/:id/history Paged message history
GET /sessions/:id/stats Live stats: turns/steps, LLM and tool timings, mean first token, decode throughput, cache hits, token ledger (matches the harness session-stats projection)
GET /sessions/:id/todos Task list + elapsed time: todos[{content,status}] (todo_write full-table projection, cleared on turn/start), counts{completed,inProgress,pending}, running/elapsedMs (wall clock of the current or last turn), turnStartedAt/turnEndedAt/updatedAt — for a third-party console's "tasks" panel (≥0.1.8)
GET /sessions/:id/skills Session-scoped skill catalog (resolves skill roots from the session cwd, supports ?search=; mirrors skills/list for a "/" completion menu)
GET /sessions/:id/questions Pending ask_user_question batches (host-side answer bridge, ≥0.1.7; connection-layer race bypass + ALS-only session binding — browser/GUI-origin questions always pass through, ≥0.3.7)
POST /sessions/:id/answers Answer pending questions (answers: [{id, selected, custom?}]); the tool returns as an ordinary tool/result and the session continues
POST /sessions/:id/cancel Abort the current turn
POST /sessions/:id/files Upload into the session workspace (multipart, or raw + ?filename=); duplicate names get -1 suffixes, and the agent can read them with its file tools
GET /sessions/:id/files List the session workspace (?path= browses a subdirectory, directories first)
GET /sessions/:id/files/download Download a workspace file (?path= relative; ?inline=1 for in-browser preview)
Streaming POST /sessions/:id/prompt-stream Send a prompt and receive generation as SSE
GET /sessions/:id/events Subscribe to the session event bus as SSE
POST /sessions/:id/prompt Send a prompt and wait for the result synchronously
OpenAI POST /chat/completions OpenAI Chat protocol (streaming and non-streaming)
Models GET /models Available models and the default model
GET /models/default Read the global default model
PUT /models/default Update the global default model
GET /providers Registered LLM providers
GET /presets Available agent presets
Settings GET /settings Settings namespaces
PATCH /settings/:namespace Update one namespace
API Service GET /api-keys/service Independent service state (running / port / bind range / reachable URLs)
POST /api-keys/service/start Start, or change port / bind range (instant, rolls back on failure)
POST /api-keys/service/stop Stop (keeps the port; does not auto-start after a DSH restart)
GET /api-keys/service/free-port Suggest a free port
GET / PUT /api-keys/port Legacy compatibility (fixedPort: 0 stops)
API Keys GET /settings/api-keys API service & key settings page (HTML, public; data endpoints need the Admin Token)
GET /api-keys List API keys (masked; never returns plaintext or hashes)
POST /api-keys Create an API key (plaintext returned; copyable later)
PATCH /api-keys/:id Update name / note / expiry
POST /api-keys/:id/rotate Rotate (old key dies immediately; new key copyable later)
POST /api-keys/:id/reveal Fetch the plaintext for copying (admin token; 409 for legacy keys)
POST /api-keys/:id/revoke Revoke (idempotent, irreversible)
DELETE /api-keys/:id Delete the record (revoked keys only)
GET /api-keys/auth Read auth status
PUT /api-keys/auth Enable / disable auth (disabling requires confirm: "disable-auth")
Docs GET /docs Interactive API request page
GET /docs/reference Full API reference & online debugging (Swagger UI, try-it-out)
GET /openapi.json OpenAPI 3.0 document

Development

# Build the plugin
bash scripts/build.sh

# Hot-inject at runtime (needs dsh-super-injector)
dev_inject_plugin {"dir": "/path/to/dsh-web-service"}

# Hot reload
dev_reload_package {"packageName": "dsh-web-service"}

Skill: teach an agent to drive this API

The repository ships a DSH-native skill (skills/dsh-web-service/SKILL.md). Once installed, a DSH
agent discovers it automatically and knows how to use every endpoint (triggers: driving DSH over
HTTP, third-party integration, OpenAI-compatible calls; also available in-session as
/dsh-web-service).

Install online (recommended)

curl -fsSL https://raw.githubusercontent.com/toddpan/dsh-webapi/main/scripts/install-skill.sh | bash

It installs into the user-level skill directory ~/.dsh/skills/dsh-web-service/, where DSH's
skill-filesystem provider discovers it live (no restart) — usable from the next session.

Options

# Install into a specific directory (project-level .dsh/skills or .agents/skills)
curl -fsSL .../install-skill.sh | bash -s -- --dir /path/to/project/.dsh/skills

# Pick a branch / repository
curl -fsSL .../install-skill.sh | bash -s -- --branch dev
curl -fsSL .../install-skill.sh | bash -s -- --repo other/dsh-webapi

# Uninstall
curl -fsSL .../install-skill.sh | bash -s -- uninstall
# or locally: bash install-skill.sh uninstall

What the script does: download SKILL.md → validate the frontmatter → install into the target
directory → probe ports 3080/3000 for a running DSH Web Service and report. Idempotent.

Local install (inside the repo)

bash scripts/install-skill.sh

License

BSD-3-Clause

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
dsh-webapi 怎么安装?

本站没有抓到该条目的安装命令,请到仓库主页确认安装方式;这类条目多数是生态应用或尚未发布安装包的项目。

dsh-webapi 的验证等级是什么意思?

未标注验证等级。上游未给出验证结论,安装前请自行确认

dsh-webapi 安全吗?

未标注。

dsh-webapi 装之前要先确认什么?

先看它会读写哪些文件、执行哪些命令、连接哪些网络地址;验证等级只说明装得上、跑得起来,不等于安全。涉及密钥或系统权限的,建议先在隔离环境试装。

dsh-webapi 用的是什么许可证?

上游标注为 BSD-3-Clause。商用或二次分发前请到仓库确认许可证原文。

dsh-webapi 有哪些功能?

47 条 REST + SSE 路由、OpenAI 兼容 /chat/completions、工作区与会话管理、流式输出与事件订阅、内置 OpenAPI 文档页。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

会话与消息
按星标排序,可作替代方案

dsh-desktop

dsh-desktop

为 DeepSeek Harness (DSH) 插件生态打造的现代化桌面端解决方案。万物皆「插件」,桌面本身也是「插件」。

L3 · 安装规范通过 3.0 万 星

openpets

openpets

L4 · 沙盒安装通过 1,274 星

deeptide

deeptide

L4 · 沙盒安装通过 1,104 星

jingyun-dsh

jingyun-dsh

井云 DSH 客户端插件,为 DeepSeek Harness 注入会员登录、订阅支付、算力管控与应用市场,让智能体和技能快速变成可交易商品

L3 · 安装规范通过 1,004 星

study-mate

study-mate

StudyMate 是 DSH 的「学习模式」预设与技能包,为数学、计算机科目定制学习路线、讲解课件与练习评估,跨科目共享记忆。

未标注验证等级 856 星

toddpan 的其它插件

2 个

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 —。