nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:D120697/dshctl
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Control a running DeepSeek Harness (DSH) instance from scripts: create sessions in the right workspace, send prompts, wait for replies, and read back the conversation and the memory blocks that were injected into it.
No clicking. No restart. No separate agent runtime.
$ dshctl instances
DSH 进程 [13928, 20532, ...]
API 端口 [49890]
49890: 133 个会话
$ dshctl ask "summarize today's logs"
会话 session-3e270bb9-...(工作区 E:\VScode\ai)
等待回复…
DSH already ships a headless profile: one task, one answer, process exits. That is great
for batch jobs, but it does not let you reach the instance you are actually using — the
desktop app with your workspace, skills, plugins, and memory already loaded.
dshctl talks to that live instance's own /api Remote gateway, so anything you script
shows up in the same GUI, in the same workspace, with the same plugins.
Python 3.10+, standard library only (one optional dependency for reading compressed session logs):
git clone https://github.com/<you>/dshctl
cd dshctl
python -m pip install zstandard # optional: needed for `history` / `memory`
Put the folder on PATH (Windows: dshctl.cmd is included) or call python dshctl.py.
| Command | What it does |
|---|---|
dshctl instances |
Find running DSH processes and their API ports |
dshctl workspaces |
List registered workspaces, marking the current directory |
dshctl sessions [--limit N] [--all] |
List sessions with state, cwd, title |
dshctl new [--cwd DIR] [--workspace ID] [--preset NAME] |
Create a session |
dshctl ask "TEXT" [--timeout S] |
Create a session in the current workspace, send a prompt, print the reply |
dshctl send SESSION "TEXT" [--wait] [--mode queue\|steer] |
Send to an existing session |
dshctl history SESSION [--chars N] [--full] |
Read the user/assistant conversation |
dshctl memory SESSION [--json] |
Show the memory blocks injected into that session |
--port, --json, and --token work before or after the subcommand.
Port discovery. DSH binds a fresh HTTP port on every launch (we observed 63195 → 49890).
dshctl never hardcodes it: it lists listening ports owned by the DeepSeek Harness
process, then confirms the API port by the fact that an unauthenticated request returns
401.
Authentication. Two paths:
--token (or set DSH_API_TOKEN) with the token from the
URL DSH prints/opens at startup. dshctl does GET /?token=…, receives the signed
session cookie from Set-Cookie, and uses it. No local secret is read.dshctl reads the client-connection/browser-session
signing secret from ~/.dsh/.credentials.yaml and mints an equivalent cookie with the
same v1.HMAC-SHA256 scheme DSH itself uses. The secret is read locally and never
transmitted anywhere.Wire format. Requests are POST /api/<method> with a client-request envelope:
{"type":"client-request","rpcId":"…","method":"session/create",
"payload":{"args":{"request":{"workspaceId":"…"}}}}
Workspace attachment — the trap. session/create accepts either cwd or workspaceId.
Passing only cwd gives the session the right directory but does not attach it to the
workspace, so it never shows up in the sidebar. DSH only calls attachSession when the
request carries a workspaceId. dshctl resolves the current directory to a registered
workspace first, and only falls back to cwd (with a warning) for unregistered directories.
Reading logs. Session records live at
~/.dsh/sessions/<workspace>/<sessionId>/session.v4.jsonl.zstd — zstd-compressed JSONL.
Assistant text lives under data.message.content; user text under data.content. Anything
that is not a plain text part (reasoning, tool calls) is skipped.
$ dshctl ask "定时任务" --no-wait
$ dshctl memory <sessionId>
── 长期底色(stable) seq=11 2479 字 ──
── 本轮召回(recall) seq=13 1021 字 ──
### 定时任务(相关度 1.22)
…
ask with --no-wait returns immediately; memory then shows exactly which notes were
injected for that prompt. Useful when you are tuning retrieval thresholds, or when you want
proof that a plugin actually injected something (the log line says "injected", the session
record shows what).
DSH is open source (MIT) with a large ecosystem. Related projects worth knowing:
headless profile, sdk-minimal profile and SDK packagesdshctl is deliberately narrow: a small CLI that drives the already running instance and
reads back what it recorded. If you need a runtime of your own, use the official headless
or sdk-minimal profiles instead.
tasklist/netstat, so it is Windows-first. Elsewhere, pass --port.history / memory need zstandard.session.v4), and an
upgrade may change them. Treat this as a userland tool, not a stable SDK.MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: session-management。