dsh-turn-meta
其他 活跃维护

dsh-turn-meta

randerous/dsh-turn-meta

最小化首款插件模板,支持选择性启用每步回合元数据能力,无额外依赖开箱即用,方便开发者快速自定义回合处理逻辑,适配大模型推理框架扩展开发需求。

1
Stars 标星
0
Forks 分支
1
Watchers 关注
0
Open Issues
TypeScript
主要语言
MIT
开源协议
12 KB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:randerous/dsh-turn-meta
git clone https://github.com/randerous/dsh-turn-meta.git
git clone git@github.com:randerous/dsh-turn-meta.git
README.md main

dsh-turn-meta

English | 中文

Opt-in per-step turn metadata for DeepSeek Harness. Each entering agent step appends one compact, source-attributed header naming the session, the current turn and step, how many real user messages and tool results belong to the open turn, and how many turns preceded it.

[turn-meta] session=<id> turn=<turn> step=<step> user_msgs=<a> tool_results=<b> prior_turns=<p>

The package doubles as a minimal first-plugin template: it exercises the same seams every Harness plugin uses with the smallest surface that still shows them — a named-export function plugin (name / inject / Config / apply), schemastery-validated config, one ctx.on('agent/pre-step', …) hook with { prepend: true }, and a ./invariant companion that owns the durable message shape.

Install into a profile

The plugin is opt-in. Add it to a cordis.patch.yml overlay (or pass as --patch):

- insert:
    - id: turn-meta
      name: '@deepseek-ai/dsh-turn-meta'
      config:
        enabled: true
        minStep: 1

Or, for a self-contained checkout, symlink the dependencies from your installed dsh profile and run the smoke:

node tests/smoke.mjs

smoke.mjs drives the real TypeScript source (Node ≥ 23 type stripping) against an installed dsh distribution; it needs @deepseek-ai/{cordis,dsh-agent,dsh-llm,dsh-session,schemastery} resolvable from the package's node_modules.

Verification status

  • Runtime smoke against an installed dsh distribution: 6/6 assertions pass (injection, exact header text, disabled config, invalid-config load failure, disposal, proposed-message counting).
  • Monorepo CI gates (vitest full suite, coverage, typecheck, doc-sync) require the deepseek-harness workspace install; they are expected to pass but have not been run here. The package also lives at packages/context/turn-meta in the harness repo for when external contributions open up.

License

MIT