DeepSeek Harness Plugin

facadefish/dsh-use-kimi

Stars ★ 0 Category Tools & Capabilities Added 2026-12-01

Sidebar workbench for the local Kimi Code (KAP) service: stream any session turn by turn, approve or reject tool calls from the panel, send, steer and cancel runs, and read 5-hour and weekly quota. Also registers six kimi_* tools so the agent can hand work to Kimi and collect the answer. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.

Install

# from a prebuilt release tarball

dsh plugin --profile web add -w "https://github.com/facadefish/dsh-use-kimi/releases/download/v0.2.2/dsh-use-kimi-0.2.2.tgz"

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:facadefish/dsh-use-kimi

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

dsh-use-kimi · Kimi Workbench

Bridge your local Kimi Code into DeepSeek Harness: a live sidebar panel plus six agent tools.

简体中文 | English

Real v0.2 screenshot; account nickname and quota numbers are masked.

One line: DSH plans and orchestrates, Kimi runs the long tasks. This plugin gives them one shared sidebar — see progress, gate risky tool calls, hand off work.

dsh-use-kimi is a DeepSeek Harness (DSH) plugin that connects to your local Kimi Code (KAP) service and turns it into a live panel with approvals, usage and six agent tools. The KAP token never leaves the DSH host process.


Contents

Get started Capabilities Reference
WhyFeaturesQuick startSix tools How it worksSecurityConfiguration FAQLimitationsDocsRoadmap

Why this plugin

DSH and Kimi Code are two pipelines that cannot see each other: one is your AI development environment, the other lives in a terminal.

That creates three daily annoyances:

  • Window juggling — you cannot tell what Kimi is doing without switching back to the terminal.
  • Broken approvals — Kimi pauses before writing a file or running a command, but you are inside DSH and never notice.
  • Copy-paste handoffs — sending a DSH task to Kimi means copying the prompt, pasting it, then coming back for the result.

dsh-use-kimi folds all three into one panel:

Before With the plugin
Terminal ↔ DSH switching Every turn visible in one sidebar
Approvals wait in the terminal Approval card with tool target and countdown
Copy-paste prompts One kimi_handoff call, result returned
Quota unknown until you hit the limit 5-hour / 7-day usage and pressure tier, always visible

Features

  • Connection health — discovers the local KAP service (token + instance files), starts kimi web when needed, flips to "offline" within seconds and reconnects automatically.
  • Session list — recent sessions, activity, last outcome, pending-approval markers; search by title/cwd and load more.
  • Live timeline — KAP WebSocket frames are relayed over same-origin SSE; reasoning, tool calls and text stream token by token, with scroll anchoring that respects your reading.
  • Approval cards — manual sessions park file writes and commands. The card shows the tool, target path/command and a per-second countdown. Approve / reject / cancel only update after the server acknowledges; failures stay on the card with a refresh action — no fake success.
  • Usage & models — 5-hour and 7-day windows, reset times, pressure tier (ample / normal / tight / critical) and model suggestions from /oauth/usage; cross-checks with kap.mjs usage --json.
  • Send / steer / stop / create — chat from the panel. Drafts are per-session, failed sends keep the text and offer retry, Enter sends when idle and steers while a turn is running.
  • Six tools — callable by any DSH agent, see below.

Quick start

Requirements

  1. Kimi Code ≥ 2.7, signed in (anything that can run kimi web).
  2. DeepSeek Harness installed, Web UI reachable (default http://127.0.0.1:3080).
  3. Node.js ≥ 20 (the one bundled with DSH is fine).

Install

Option A — let DSH install it (recommended)

  1. Clone the repository, e.g. ~/dsh-use-kimi:
    git clone https://github.com/facadefish/dsh-use-kimi.git
    
  2. Enable Full access in DSH (installing a plugin writes to the profile).
  3. Tell DSH: install the directory ~/dsh-use-kimi with plugin_manager's install_bundle.

Option B — use the UI

  1. DSH sidebar → Plugins → Add plugin → pick this directory.
  2. Confirm Kimi Workbench / dsh-use-kimi appears and is enabled.

Option C — install from npm (no clone)

  1. Add the package to your DSH profile (web by default — use your own):
    dsh plugin --profile web add dsh-use-kimi
    
  2. Restart DSH, or confirm Kimi Workbench / dsh-use-kimi is enabled in the plugin manager.

You can also open Plugins → Discover in DSH and install dsh-use-kimi with one click once the marketplace entry is live.

No restart needed. A Workbench entry shows up under the sidebar's global panels.

First run

  1. Open Workbench from the sidebar.
  2. The first open discovers KAP; if it is not running and auto-start is on, the plugin spawns kimi web --host 127.0.0.1 --port 0 --no-open --log-level error.
  3. "Online · live" in the header means connected; recent sessions appear on the left.
  4. To try approvals: create a manual session, ask it to write a file, and the approval card appears. Reject it — the file is never written.

No Kimi environment? The panel shows "offline" and explains why (token not found / no instance). That is expected behaviour, not an installation failure.

Six tools

Tool Purpose
kimi_usage Account, quota ratios and reset times, pressure tier, model suggestions
kimi_status Session activity, pending approvals, latest turn summary
kimi_send Send a prompt to an existing session (optionally wait)
kimi_handoff Create a session + send a task (manual approval by default), optionally wait for the final answer
kimi_approve Answer an approval request (approved / rejected / cancelled)
kimi_cancel Stop the current turn (optionally cancel background tasks)

Example:

You:  Ask Kimi to split the logs under scripts/ by day — plan first, don't touch files.
DSH:  → kimi_handoff({ text: "Split logs under scripts/ by day. Plan first.", permissionMode: "manual" })
      → Session created; Kimi requests a file write; the panel shows an approval card.
You:  (click "Approve" in the panel)
DSH:  → follow up with kimi_status or the timeline

How it works

┌──────────────────────────── DSH host (Node process) ─────────────────────────┐
│  lib/kap.js     discovers/starts KAP, holds server.token, wraps REST         │
│  lib/ws.js      minimal RFC6455 client (KAP WS requires an Authorization hdr)│
│  lib/hub.js     connection state, session cache, single-session subscription │
│  lib/routes.js  /kimi/api/* (state / events / sessions / timeline / actions) │
│  lib/tools.js   the six kimi_* tools                                         │
└───────────────┬──────────────────────────────────────────────┬───────────────┘
                │ REST + WebSocket (loopback only)              │ SSE (same origin)
                ▼                                              ▼
     Kimi Code KAP service (random loopback port)      React panel in DSH
                                                       sidebar entry + main panel
  • Credentials stay in the host — the token is read only in Node; the browser talks to same-origin /kimi/api/*.
  • Per-session subscription — KAP's WebSocket subscribes per session; the plugin watches one session at a time and re-subscribes on switch.
  • Approval round-trip — approve/reject goes back through KAP interactions; the card updates only after the server confirms.

Security boundary

  • Token never leaves the host — ~/.kimi-code/server.token is read only by lib/kap.js; the client bundle, /kimi/api/state, SSE, the DOM and web storage never contain it.
  • Same-origin only — requests carrying a foreign Origin get 403 cross-origin request rejected.
  • Approvals are real — rejecting truly prevents tool execution; the plugin does not cache fake success.
  • No profile edits — the plugin does not modify the DSH profile's package.json / cordis.patch.yml; installation is handled by DSH.
  • Zero third-party dependencies — both halves use only runtime built-ins, which keeps auditing and offline install simple.

Configuration

Settings live in ~/.dsh/dsh-use-kimi/settings.json (the v0.1 path ~/.dsh/kimi-bridge/ is still read once; the next save writes the new one):

{
  "autoStart": true,
  "defaultModel": "",
  "defaultPermissionMode": "manual",
  "defaultCwd": "",
  "pollMs": 5000,
  "kimiBin": ""
}
Field Meaning
autoStart Spawn kimi web when no KAP instance is found
defaultModel Default model for new sessions (empty = KAP default)
defaultPermissionMode manual / auto / yolo
defaultCwd Default working directory (empty = current DSH session)
pollMs Session list poll interval (1000–60000)
kimiBin Path to kimi (empty = auto-detect)

FAQ

Do I need Kimi Code installed? Yes. The plugin talks to a local KAP service; it does not bundle a model or proxy your login. Without Kimi you can still read the docs and screenshots, but the panel shows "offline".

How is this different from using kimi in a terminal? A terminal is one session at a time. The plugin puts Kimi inside DSH: multiple sessions visible, approvals in the UI, and tools that let another agent hand work over. They coexist — messages sent from the terminal show up in the panel.

Can the frontend see the token? No. The client only receives sessions, usage, timeline and settings; the token stays in host memory. The repository contains no token.

Why does an approval card not always appear? Only manual sessions park tool calls. auto / yolo sessions execute by design, and one-shot ACP subagents auto-approve according to their config.

Does it work on Windows, macOS and Linux? The plugin runs wherever DSH runs; it works as long as that machine can run kimi web.

The panel says "connecting" forever. Check that the plugin is enabled, then open http://127.0.0.1:3080/kimi/api/state: JSON means the host half is loaded; 404 means it is not. If status is offline, verify kimi web can start manually.

Why is the session list not live? The session you are viewing is live over SSE; the list is polled every 5 seconds to avoid extra load on KAP.

Does it collect data? No. It only talks to your local KAP service — no telemetry, no external reporting.

Known limitations (v0.2)

  • One session is subscribed at a time: KAP's WS subscribes per session, and item / turn frames do not carry a session id.
  • The session list is polled (5 s by default), not a full event mirror.
  • Images and attachments are not rendered; text only.
  • Not implemented: export, fork, archive, multi-instance, remote instances, desktop notifications, one-click digest.
  • Kimi enforces a concurrency limit; 403 provider.auth_error surfaces as a notice, not a plugin bug.

Roadmap

  • v0.1 — discovery, session list, live timeline, approvals, usage, six tools
  • v0.2 — P0 trust fixes, search/pagination, load earlier turns, first-load states, read-only offline snapshot
  • v0.2.1 — terminology unified, settings directory migrated, published to npm and the DSH plugin marketplace
  • Parallel multi-session subscriptions (blocked on KAP frame session ids)
  • Attachment and image previews

Documentation

Document Audience
Guide (HTML, Chinese) First contact: analogies, numbered steps, wireframes, self-check quiz, acceptance log
Plugin details DSH users: connection, panel, approval boundaries, limitations
Architecture Contributors: layout, modules, extension points
Changelog Everyone: what changed per release
Contributing Anyone filing issues or PRs

Project layout

dsh-use-kimi/
├── index.js              # Host entry: create Hub, register routes and tools
├── client.js             # Client entry: sidebar entry + main panel (React, no build)
├── lib/
│   ├── kap.js            # KAP discovery, spawn, REST wrapper
│   ├── ws.js             # minimal RFC6455 client (KAP WS needs the auth header)
│   ├── hub.js            # connection state, session cache, SSE broadcast, actions
│   ├── routes.js         # /kimi/api/* routes (including SSE)
│   ├── tools.js          # the six kimi_* tools
│   └── settings.js       # settings read/write
├── locale/{zh,en}.json   # marketplace display copy
├── docs/                 # details, guide, architecture, screenshots
├── cordis.patch.yml      # DSH bundle entry
└── icon.svg

Development

There is no build step: DSH's module loader loads client.js directly — source is the artifact.

# syntax checks (no dependencies)
node --check index.js
for f in lib/*.js; do node --check "$f"; done
node -e "new Function(require('fs').readFileSync('client.js','utf8'))"

After changing host code, disable and re-enable the plugin to hot-reload; editing client.js triggers DSH's client HMR.

See docs/ARCHITECTURE.md for module responsibilities and extension points.

Contributing

Issues and PRs are welcome — start with CONTRIBUTING.md. If this plugin saves you a few window switches, a star is the simplest way to support it.

License

MIT © facadefish

Related

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.