acp-extension-dsh
No description
- Stars
- 0
- Language
- TypeScript
- Created
- Aug 13, 2026
- Updated
- Sep 16, 2026
Introduction
acp-extension-dsh
ACP session controls and a pinned coding profile for DeepSeek Harness.
The package is a Cordis plugin, not a replacement for Harness. It adds ACP model,
reasoning-effort, permission, and agent-preset selectors, accepts inline images
when the selected model declares image input (the default deepseek-flash / DeepSeek-V41-Flash does), and mounts ACP-provided stdio or
Streamable HTTP MCP servers into each Harness Agent scope. Harness
continues to own model execution, sandbox enforcement, persistence, preset
composition, tool execution, and one-shot approvals.
The adapter advertises Core's _meta.lody.compaction capability and translates
Harness compaction/start and compaction/end events into a standard ACP tool
lifecycle carrying _meta.lody.activity. Manual and automatic compaction remain
distinguishable, and failed compactions keep the Harness error reason.
Committed assistant images are read back through the attachment store and sent as
ACP image blocks. Prompt completion and cancellation wait for admission, Harness
idle, and ordered output delivery before releasing the session's prompt slot.
ACP model choices are discovered from Harness when each session is created and
returned through both the standard model config option and the legacy ACP
models response. Exact per-model metadata controls the reasoning selector and
image admission, and the legacy response carries model[effort] entries so a
host can cache the reasoning choices for every model rather than only the model
that happened to be active during the probe. Permission choices use the composed
Harness preset table.
When DEEPSEEK_BASE_URL is set, the adapter requests its OpenAI-compatible
GET /models endpoint once per ACP connection, resolves every advertised id
through Harness, and selects the first result initially. Discovery is bounded,
does not follow redirects, and reports an actionable startup failure when the
endpoint cannot provide a usable list. Without an endpoint, the Harness catalog
remains advisory: an explicitly configured or selected model is still resolved
even when it is not listed.
The ACP host mounts Harness's file-backed settings provider. It reads
$DSH_HOME/settings.yaml, falling back to ~/.dsh/settings.yaml, and exposes
user sections to settings-aware plugins. Missing settings preserve composition
defaults; malformed settings documents fail startup instead of being silently ignored.
The llm-deepseek.models array replaces the local catalog in full, so retain any
default models and their vision metadata that should remain selectable. For example:
llm-deepseek:
models:
- id: deepseek-flash
name: DeepSeek-V41-Flash
inputModalities: [text, image]
- id: deepseek-v4-flash
name: DeepSeek-V4-Flash
- id: deepseek-v4-pro
name: DeepSeek-V4-Pro
- id: deepseek-v4-flash-vision-exp
name: DeepSeek-V4-Flash-Vision-Exp
inputModalities: [text, image]
- id: custom-model
name: Custom model
The provider watches file edits, but ACP model choices are cached per connection.
Reconnect and refresh the host's model capabilities after catalog edits.
DEEPSEEK_BASE_URL still selects endpoint discovery: this setting does not merge
local-only model IDs into an endpoint's /models response. API credentials remain
in the host environment; generated compositions contain no credentials.
Token and USD accounting
Core's usage capability reports committed request usage, cumulative per-model
totals and already-included deltas. The pinned Harness 0.1.1-rc.2 supplies usage
on assistant/message and actual route metadata on request/context; raw stream
chunks are not counted again. No model request or transcript is needed by tests.
Only reported activity in the ACP-owned Harness session is counted; separate
background agents or internal operations without usage events are not invented.
Official DeepSeek prices,
checked directly on 2026-09-13, are estimated per request at completion time.
Off-peak USD/million tokens (cache miss / hit / output): Flash 0.15 / 0.003 / 0.6;
V4 Pro 0.66 / 0.022 / 1.98. Weekday 01:00–04:00 and 06:00–10:00 UTC are twice
those rates. deepseek-v4-flash and deepseek-v4-flash-vision-exp now alias the
new deepseek-flash price. Unknown models/custom endpoints have no estimated cost.
These are list-price estimates, not invoices; cross-boundary requests can differ.
Only the registered deepseek-official route at the official endpoint is priced;
an arbitrary provider named deepseek is not evidence of official billing.
Publish Core 0.1.5 before releasing this adapter dependency.
Exports
acp-extension-dshexports the Cordis plugin:apply,inject, andname.acp-extension-dsh/capabilitiesexports the selector vocabulary for host UIs.acp-extension-dsh/profileexports the pinned Harness version, the same-release npx package closure, andcreateDeepSeekHarnessProfileFiles, which renders the generateddshprofile files.
The host launches the pinned dsh executable with
--profile lody-acp, writing the generated profile (the @deepseek-ai/dsh-base
bundle plus the Lody cordis.patch.yml overlay) under
$DSH_HOME/profiles/lody-acp. It stages this package's official
standard/ptc/minimal/cordis preset snapshot beside the ACP adapter.
Harness mounts the selected preset per session and also discovers user presets
below $DSH_HOME/.agent-presets. MCP tools use Harness's native
mcp__<server>__<tool> naming and are removed with their owning ACP session.
The generated profile defaults session persistence to upstream's zstd
encoding. A host that reuses an existing Harness session root may pass none
to the profile builder only after verifying that the root contains raw
session.jsonl artifacts and no session.jsonl.zstd artifacts. Harness roots
are single-encoding stores: hosts must refuse mixed roots without moving,
rewriting, or deleting user artifacts.
The ACP profile keeps the session-query service mounted for exact reads but sets
its full-text SQLite index to openAt: never. This composition does not expose
the session-search tool, and public Node distributions cannot be assumed to
include SQLite FTS5. Disabling the unused index prevents ACP startup from
depending on that optional SQLite build feature.
Development
npm install
npm run build
npm test
npm run format:check
Node.js 22 or newer is required.
The optional real-runtime settings regression test uses a preinstalled profile
closure. Install every specifier createDeepSeekHarnessNpxSpecifiers() returns
in a separate directory first, then run:
DSH_TEST_RUNTIME_ROOT=/absolute/runtime/node_modules npm run test:settings-profile
The test itself uses isolated temporary homes, synthetic settings, and ACP
initialization/session creation only. It does not install packages, use API keys,
send model requests, or edit the user's Harness home. It checks first-request
catalog visibility, absent settings, invalid YAML, non-mapping settings documents, and
preservation of the settings document. The profile's ACP entry explicitly waits
for settings so catalog discovery cannot race the initial file read.
Plan configuration
Core’s boolean plan_mode option is available only when the current Agent preset mounts the native Plan service. It calls planMode.set, preserves sandbox/approval settings, and publishes durable Plan changes as config updates. A pending selection is reflected until its next-step commit; Plan is guidance, not a sandbox policy.