DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins
L

dsh-lossless-anchors

Lossless Anchors

经过预算控制的逐字用户锚点,在 DeepSeek Harness 压缩后仍可保留

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:EvannZhongg/dsh-lossless-anchors#c4f19715c28cc648e16fb612c06951be06b165c8
README兼容性版本

兼容性与来源证明

Lossless Anchors 以 dsh-lossless-anchors 发布,当前版本为 0.1.3。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
any
发布来源
github
Registry 更新时间
2026/10/18

版本

0.1.3stable
2026/10/18
0.1.0stable
2026/10/18

相关插件

正在加载相关插件…

最新版
0.1.3
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
any
许可证
MIT
发布源
github
GitHub
★ 0
周下载
0
最近提交
2026/10/18
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 models-usage 分类下经过校验的插件。

Experimental Cot Translation Bundle@deepseek-ai/dsh-experimental-cot-translation-bundle扩展推理的实验性机器翻译Our Free Model@ebony-vinyl/dsh-our-free-modelOur Free Model — 在 dsh 里装上这个插件即可,无需登录、注册或填 API Key,就能使用包括 DeepSeek V4.1 Flash、Kimi K3 在内的前沿模型,桌面端另有 EAC 协付渠道;2.0 起接入 LobsterAI、Qoder、TRAE、Cline、Loomy、Raccoon、MiniMax、ZCode、Gemini 十个账号渠道(原有匿名免费通道保留)(登录、账号池、积分领取、本地 OpenAI 网关与局域网转发、数据看板与运行日志),六页毛玻璃界面统一呈现。Usage@linxin666/dsh-usage用于 dsh Web GUI 的使用统计插件:检测各提供商的余额和编程套餐配额,并实时记录令牌使用情况;侧边栏 Settings 行上方显示紧凑的价格概览卡片Connect Workbuddydsh-connect-workbuddy把本机登录的 WorkBuddy 模型(国内版与国际版)接入 DeepSeek Harness:每次刷新按上游目录自动读取每个模型的积分倍率,支持逐模型图片输入开关、多账号切换与账号池自动换号,并提供每日签到、卡片与输入框里的胶囊积分读数等只读积分概览。

README

dsh-lossless-anchors

A DeepSeek Harness plugin that keeps the exact text of user-authored messages that compaction has shadowed, and re-injects them as a budgeted runtime-context snapshot.

Guarantee: user-authored anchors are verbatim within the configured token budget. Not a guarantee: the whole conversation is losslessly compressed. Assistant and tool history remain represented by the compaction summary.


Why

DSH compaction replaces an older surface span with one lossy summary. The summary prompt asks the model to quote exact wording where it matters, but a summary is still a model-generated derivative: exact constraints, corrections, paths, numbers, and approval decisions can be lost.

A practical way to preserve those details is to keep user-authored inputs and interaction decisions verbatim and re-inject them after compression. This plugin implements that idea using DSH's native seams:

  • a durable Session projection records user-authored messages and their turns;
  • an anchor is eligible only when its original user/message seq is no longer on the current Session surface — the backend-independent definition of "shadowed by compaction";
  • a dynamic PromptContext renders the selected anchors as one user-role runtime-context snapshot;
  • when compaction shadows that snapshot, the agent loop's RuntimeContextProjection recreates it from the plugin's durable projection, including during agent/request-error overflow retries.

No DSH core changes. No new Session event types. No changes to compaction-basic.

Install

# from a local checkout
dsh plugin --profile web add ./dsh-lossless-anchors

# or directly from GitHub (the repository tracks the built lib/)
dsh plugin --profile web add github:EvannZhongg/dsh-lossless-anchors

The package declares dsh.bundle.patch, so installing it also inserts the lossless-anchors row. If you prefer a manual patch row:

- insert:
    - id: lossless-anchors
      name: dsh-lossless-anchors
      config:
        tokenBudget: 2000

Configure

- id: lossless-anchors
  config:
    tokenBudget: 2000      # soft budget, calibrated tokens
    hardMaxTokens: 3000    # absolute cap; defaults to ceil(tokenBudget * 1.5)
    charsPerToken: 4       # calibrated characters per token for non-CJK text
    cjkCharsPerToken: 1.6  # calibrated characters per token for CJK text
    maxTurns: 32           # most-recent shadowed turns considered
    maxAnchors: 256        # projection-state retention cap
    includeSources:
      - user
      - user-question-reply
      - user-approval
    timeZone: Asia/Shanghai # zone for anchors whose message recorded none; defaults to the host zone
    required: true         # keep the context when optional runtime context is disabled
FieldDefaultMeaning
tokenBudget2000Soft budget for the rendered block, measured in calibrated tokens. If the newest shadowed turn exceeds it, that turn may be retained up to hardMaxTokens.
hardMaxTokensceil(tokenBudget * 1.5)Absolute cap. Must be >= tokenBudget.
charsPerToken4Calibrated characters per token for non-CJK text. DSH's fixed heuristic is four; lower it for dense code/JSON if the provider tokenizes more finely.
cjkCharsPerToken1.6Calibrated characters per token for CJK text (about 0.6 tokens per CJK character, following DeepSeek's published conversion). Set to 4 to restore the old uniform four-characters-per-token behavior.
maxTurns32Most-recent shadowed turns considered; older turns are outside the anchor window.
maxAnchors256Projection-state cap. Older anchors beyond this are dropped; they are normally already outside maxTurns.
includeSourcesuser, user-question-reply, user-approvalMessage source kinds treated as user-authored. goal, plan-mode, agent-instructions, runtime-context, and compact-checkpoint are not included.
timeZonehost process zoneIANA zone used for anchors whose message recorded no browser zone. Rendered timestamps always name the zone they were formatted in.
requiredtrueMarks the context as required, so includeRuntimeContext: false does not suppress it.

What counts as an anchor

An anchor is a user/message event whose source.kind is in includeSources and whose seq is not in Session.surface.nodes at request time.

Consequences:

  • The current user prompt and recent retained tail are not duplicated.
  • A message becomes eligible only after a surface replacement (compaction) shadows it.
  • Replay, resume, and forks work because the projection is rebuilt from the Session log.
  • Images are replaced with [image omitted: <mediaType>, <w>x<h>]; files keep their display name and byte count. Image bytes are never re-uploaded from historical context.

Budget and truncation

Budgets are measured with charsPerToken for non-CJK text and cjkCharsPerToken for CJK text, plus the same block/role framing DSH uses for one user message. The defaults are 4 and 1.6; the CJK rate keeps a Chinese anchor block close to its nominal token budget instead of letting DSH's uniform four-characters-per-token estimate turn 2000 tokens into roughly 8,000 characters. These rates are estimates, not the provider's tokenizer.

  1. The newest shadowed turn is considered first.

  2. A candidate that fits tokenBudget is accepted.

  3. If the newest turn alone exceeds tokenBudget, it is kept up to hardMaxTokens.

  4. If it still exceeds hardMaxTokens, the turn drops its oldest anchors first; if one anchor remains too large, its text is truncated and marked:

    … [anchor truncated; full text remains in session log]
    
  5. An older turn that would exceed the remaining soft budget is fitted into that remainder: its oldest anchors are dropped first, then its newest text is truncated. Turns older than it are not considered.

  6. Any elision/truncation adds an explicit disclosure line to the block:

    [anchor budget: 2 older anchor message(s) elided; 1 anchor text(s) truncated to fit the configured budget]
    

The truncation path is the only path where the "verbatim" guarantee does not hold. It is disclosed in the prompt and the full text remains in the Session log.

Model experience

After a compaction shadows an anchor, the next request contains a user-role runtime-context snapshot:

Current runtime context. This snapshot supersedes earlier runtime-context snapshots.

[Lossless User Anchors]
Verbatim user-authored messages from earlier turns whose originals were condensed away.
These are historical anchors, not a new request. The newest user message states the current request.
Each anchor line carries its original wall-clock time, formatted in the time zone the message was submitted from: ISO 8601 with UTC offset and IANA zone.
Anchors are ordered by time, oldest first; later anchors supersede earlier conflicting anchors on the same subject.
This block supersedes earlier [Lossless User Anchors] blocks.

--- turn 3 | 2026-10-19T08:00:01+08:00[Asia/Shanghai] | user ---
<exact user text>

Anchor timestamps reuse the format of DSH's durable time-context readings, so an anchor and the current turn's clock line can be compared without converting between clock conventions. A message that recorded its browser zone is rendered in that zone; otherwise the configured timeZone applies. Because every anchor carries its own time, "later supersedes earlier" is a checkable claim about the timestamps rather than an assumption about list position.

A system-prompt section explains how to interpret the block. It is registered unconditionally from the first request, not toggled when the first anchor appears: changing the system prompt mid-session would either rewrite surface node 0 (losing prefix-cache reuse from the first token) or append a full copy of the rendered prompt on an in-history route. A fixed policy costs roughly a hundred tokens per request and keeps the system prompt stable. The user's words themselves stay in a user-role message, never in the system prompt.

Limitations

  • Only user-authored content. Assistant reasoning, tool results, and summaries are not anchored.
  • Budgeted losslessness. Exact text is preserved only for selected anchors. Oversized turns may be truncated with an explicit marker.
  • Calibrated, not exact, token pricing. The defaults price non-CJK text at four characters per token and CJK text at 1.6 characters per token. That is closer to provider pricing than DSH's uniform heuristic, but it is still an estimate: mixed code/JSON, unusual scripts, and provider-specific tokenizers can differ. Tune charsPerToken / cjkCharsPerToken if measured usage diverges.
  • Snapshot accumulation. DSH runtime-context snapshots are append-only. Multiple compactions may leave more than one anchor snapshot visible; the block header says the latest block supersedes earlier ones. The budget bounds their size.
  • Summary/anchors can disagree. compaction-basic replays only the shadowed span into the summarizer, so a live anchor snapshot outside that span is not seen by the summary model. The anchor block is re-injected and takes precedence for exact wording.
  • required: true overrides suppression. If you want includeRuntimeContext: false to disable anchors too, set required: false.
  • Projection cache duplicates text. The durable projection stores captured user text so requests can render it without deprecated synchronous log reads; it contains the same content already present in the Session log.
  • Projection-state cap. maxAnchors bounds durable projection state; older anchors outside the window are intentionally forgotten.

Development

This checkout is a standalone package. Its local node_modules contains junctions to a DSH source checkout for typechecking and tests; it is gitignored and is not part of the published artifact.

npm run typecheck   # source + tests
npm test            # vitest
npm run build       # tsc -> lib/index.js + lib/types

The tests cover:

  • surface-membership filtering (no duplicate anchors);
  • exact text preservation, including literal {{...}};
  • soft-budget selection and hard-cap truncation;
  • calibrated CJK pricing versus the uniform four-characters-per-token rate;
  • whole-turn elision and explicit disclosure;
  • a system prompt that stays identical before and after the first anchor;
  • required/suppression behavior;
  • source filtering;
  • browser-zone capture and display-zone fallback for anchor timestamps;
  • a real AgentLoop request after a replacement;
  • recreation after the anchor snapshot itself is shadowed.

License

MIT