Files
deepseek-harness/packages/core/agent-tool-presentation
Turtle e7def469e1 feat(i18n): key translation pairing records by heading section (#5036)
* feat(i18n): key translation pairing records by heading section

Replace the whole-file blob hashes in *.i18n.yaml with one entry per
heading section that still holds language-specific content, keyed by the
English heading-slug path. Blocks identical across the pair (generated
table rows, code blocks, shared regions) stay out of the hash, so edits to
different sections and identical regenerations merge with Git's default
text merge, including on GitHub.

Remove the dsh-translation-pairing merge driver, its resolver command and
installer wiring; gen-translation-brief recovers last-confirmed text from
commit history. Migrate all active records, archive the superseded Agent
Note, and record the replayed conflict reduction in the new one.

* test(i18n): refresh translation prompt snapshot for the terminology note

* feat(i18n): exclude only code blocks and generated regions from pairing records

Replace byte-equality masking with an explicit rule: a record hash skips
fenced code blocks and BEGIN/END GENERATED regions, the two kinds of
content the pairing gate already requires to be identical on both sides.

Move generated data into regions written into both pages:
gen-config-catalog renders both languages and the record with per-package
regions labelled by code identifiers; gen-module-graph keeps its table in a
region; gen-doc-graphs splices the event matrix regions into the Chinese
page. Add a generic region splice beside the region grammar.
2026-09-23 22:32:06 +08:00
..
2026-09-23 20:47:45 +08:00

description, kind
description kind
The agent-plane presentation selector for users and maintainers choosing, configuring, or debugging which form of its tools an agent preset's models see. package-reference

@deepseek-ai/dsh-agent-tool-presentation

English | 中文

Summary

Use dsh-agent-tool-presentation in an agent preset to fix whether models see every native tool schema, only run_code with a generated SDK, or both forms. Each preset can choose independently, so native and PTC agents can share one process without sharing tool catalogs. Selecting ptc or both requires a compatible PTC runtime; a deployment without one rejects the preset at mount time before its first prompt. The mode field is required when this package is present, while omitting the package keeps the deployment default.

Table of Contents


Use this package

Add this row to an agent preset to fix how every agent joined to that preset sees its tools. native presents each visible tool schema as a function definition; ptc presents only the run_code transport plus a generated SDK and the rule that only run_code may be called directly; both presents both forms. Agents that declare nothing get the deployment-wide mode on the dsh-tools row.

Add the row to a preset

- name: '@deepseek-ai/dsh-agent-tool-presentation'
  config:
    mode: ptc
Field Default Meaning
mode required native — every schema; ptc — run_code plus generated SDK; both — both forms

The generated configuration catalog is the exhaustive source for every accepted field. mode is required rather than defaulted because a preset without this row inherits the deployment default.

What PTC mode requires

Selecting ptc or both needs a composed PTC runtime (ctx.ptcRuntime) whose language has a registered SDK renderer — the TypeScript runtime ships via dsh-ptc-runtime-node, and both the TypeScript and Python SDK renderers are built into dsh-tools. A preset that selects a PTC mode against a deployment composing no such runtime refuses to mount, naming this row, so the failure lands where the operator can act instead of at the session's first request.

One presentation per agent

One agent declares one presentation. A second declaration in the same composition is refused rather than merged: two answers to "which form does the model see" is a contradiction, not an override.


Understand the implementation

Implementation internals — click to expand

This section explains how the package realizes the behavior above; the observable contract is covered in Use this package.

Design concept

The tool registry cannot move into a preset: its consumers are all host-plane — the agent loop reads its scheduler, the API proxy reads its presenters, and every tool plugin registers into it — and a service only moves down when all of its consumers move with it. What a preset can own is the presentation of that registry. ctx.tools.presentAs() declares it for the mounting scope, which is the preset's standing mount, so the declaration covers every agent joined to that preset and a PTC mode preset runs beside native ones in one process. One row per composition, not one per session.

Source map

File Role
src/index.ts Plugin entry: mode config, apply wiring ctx.tools.presentAs for the mounting scope
— No runtime invariant companion is published; this package makes exactly one scoped call into ctx.tools and owns no event or snapshot of its own; the relation it establishes — which presentation one agent's assembly uses — is the tool registry's to hold, and dsh-tools observes it there.

Behavior notes

native applies immediately. A PTC mode instead waits for ctx.ptcRuntime, a host-plane service: a preset selecting PTC mode against a deployment composing no runtime holds this row pending, and dsh-agent-preset-registry refuses the mount naming this id. presentAs is itself the effect, so the declaration unwinds with this row without a second wrapper owning it.


Further Exploration

The package-level contract is enough for most consumers; read these when you need the surrounding domain.


Model Experience

Indirectly, through the tool presentation it selects in dsh-tools — the row only chooses between the two projections dsh-tools owns and registers no prompt, schema, or result of its own.

KV Cache effect

No direct invalidation; the presentation is fixed when the agent is composed, so its request prefix is stable for the session's life.

Known Limitations and Deferred Work

These limits define when this row needs special care. They are current package constraints, not a task backlog.

  • The runtime stays host-plane — a preset can select PTC mode but cannot supply the TypeScript runtime it needs; a deployment that composes none can compose no PTC preset.

Dev Note

Working context for maintainers — click to expand

None.