dsh-loopx-plugin
loopx-project/loopxLoopX——面向长周期 Agent 的提供商中立、本地优先状态内核与控制平面:在 DeepSeek Harness 执行层之上持久化 Goal、Todo、门禁、证据、配额、恢复与交接状态;插件负责引导安装 CLI 与技能、准入有界的同会话续跑,并为精确绑定的工作循环提供本地 GoalBar。
DSH 自动模式:用 Flash 模型为每个新会话自动判断最合适的 Agent 预设(标准/PTC/极简/创造)并直接执行,无需确认。
自动模式 (Auto Mode) — an AI pre-judgment layer for DeepSeek Harness (DSH).
Adds a selectable 自动模式 / Auto agent preset. When you start a new session in Auto mode and send your first request, a flash-class model first judges which built-in agent preset fits your intent — 标准模式 (standard) / PTC 模式 (code) / 极简模式 (minimal) / 创造模式 (cordis) — then switches and executes automatically, with no confirmation. A glowing info bar above the input shows the decision for 3 seconds and dismisses itself.
你发送需求 ──► Flash 分类 ──► 自动切换 preset 并执行(无需确认)──► 决策提示条 3 秒后自动消失
Why "per new session"? DSH fixes a session's agent preset the moment the session produces anything (its first
turn/start). Re-routing inside one session after the first message is a platform-level lock (agent-preset-locked). Auto Mode therefore routes every new session's first message — the flash judgment happens before anything is sent, so the session is still blank and the preset can be switched. Once routed, the session is pinned to the chosen preset, exactly like a session you created directly in that preset.
deepseek-v4-flash classifier scores the request against the four built-in presets and returns preset + reason + confidence.Requires DSH with the web app installed. Install into your web profile — from npm when published, or directly from GitHub:
# npm (once published)
dsh plugin --profile web add dsh-agent-preset-router
# or straight from this repository
dsh plugin --profile web add "https://github.com/CTWCTW9999/dsh-agent-preset-router"
(If you develop locally: dsh plugin --profile web add <path-to-this-repo>.)
Restart the web app (or reload the GUI page) so the new bundle row and preset are picked up.
$DSH_HOME/.agent-presets/auto with a .dsh-preset-owner.json marker owned by this plugin.Slash commands (e.g.
/help) bypass routing and execute directly.
| Layer | Piece | Role |
|---|---|---|
| Host | lib/index.js | Installs the auto preset into the user preset root; exposes an HTTP RPC (POST /agent-preset-router/rpc, method classify) that runs the flash classifier through ctx.llm. |
| Client | lib/client.js | Wraps api.sessions.prompt; for blank Auto sessions it calls the classify RPC, then automatically calls api.agentPresets.select and forwards the prompt once the judgment lands, while rendering a 3-second self-dismissing animated info bar in the composer dock (conversation.input.dock). |
| Preset | presets/auto/ | The 自动模式 composition — a compact, safe toolset used as the session's preset when Auto is selected (routing normally switches away before the first turn). |
agentPresets.select only works on blank sessions. Routing must happen client-side before the first session.prompt — hence the prompt wrapper.inject: ['agents', 'llm']; the client injects connection, sessions, slots, locale.All settings are optional. Configure the plugin via the profile's patch layer (cordis.patch.yml in $DSH_HOME/profiles/web/) or by patching the bundle row:
- config:
classifier:
provider: leihuo # default: the session's own provider, else the first registered
model: deepseek-v4-flash
temperature: 0
maxTokens: 256
fallbackPreset: standard # used when classification fails (standard|code|minimal|cordis)
id: agent-preset-router
| Key | Default | Meaning |
|---|---|---|
classifier.provider | session provider → first registered | LLM provider for the classifier |
classifier.model | deepseek-v4-flash | Classifier model (session model overrides when default) |
classifier.temperature | 0 | Sampling temperature |
classifier.maxTokens | 256 | Max output tokens for the classification JSON |
fallbackPreset | standard | Preset used when classification fails |
The classifier prompt is a strict JSON contract: {"preset","reason","confidence"} with the four preset ids, in Chinese, plus a 30s timeout.
auto preset itself is a compact fallback toolset; if you want richer behavior when Auto is the final preset, extend presets/auto/agent.cordis.yml (installed into $DSH_HOME/.agent-presets/auto).npm test # run all three test suites (no DSH needed)
npm pack # build the publishable tarball
# install the tarball: dsh plugin --profile web add ./dsh-agent-preset-router-0.1.0.tgz
Run the test suites individually (no DSH needed):
node test/host.test.mjs # parseClassification + preset installer
node test/rpc.test.mjs # classify RPC handler (stubbed ctx)
node test/client.test.mjs # client bundle load + prompt wrap + HMR
npm publish # publish to npm (runs "prepublishOnly" checks if configured)
# after publishing, install with: dsh plugin --profile web add dsh-agent-preset-router