Files
deepseek-harness/packages/core/agent-tool-presentation
Turtle 38c7a9fbf4 feat(release): publish package source, declaration maps, and documentation (#5884)
* feat(release): publish package source, declaration maps, and documentation

Every release member publishes its TypeScript source and the declaration
maps that resolve into it, and @deepseek-ai/dsh publishes the repository
Markdown documentation staged from docs/ at prepack time.

The ./src/* export most members already declared now resolves for an
installed consumer, and a consumer editor follows a declaration to the
implementation. Bundled JavaScript maps stay unpublished; the vendored
family and the Desktop runtime file policy are unchanged.

Rationale: .agents/notes/implemented/process/2026-10-08-published-source-and-docs.md

* feat(release): publish JavaScript maps and compress bundles

Every emitted JavaScript map ships beside the bundle it describes, and the
workspace build and the client preset compress bundles without mangling
identifiers.

The documentation payload now mirrors the website publication manifest and
is removed again by `postpack`; Desktop and the Python executable exclude
the published source, documentation, and maps; `clean` removes a staged
copy. Typert's publication contract gains the Remote declaration map.

* fix(release): keep node bundles readable for the worker image

The browser worker image lowers `yield*` only as a whole statement and
rewrites `for await` loops by their source layout, so compressed node-side
entries either fail that lowering or lower to unparseable code. Only the
browser bundles keep compression, which removes about a third of their text.

The bundle-purity assertion now matches the module-loader call regardless of
the quote style compression picks, and the release-pack fixture exercises
the installed package's new documentation requirement.

* feat(release): publish the whole documentation tree

`@deepseek-ai/dsh` copies `docs/` in full instead of the website's page
set: the maintainer documents, the generated migration records, the
translation guidelines, and the `*.i18n.yaml` consistency records ship
with the installed package, so the documentation's own links resolve
without a checkout.

* feat(release): publish the upgrade guides with the documentation

The staged documentation keeps the website's page set and adds every
`docs/upgrade-guide/` document, which is what an installed reader consults
when a released change breaks something. The rest of the maintainer tree
stays out.

* test(release): expect source and maps in master's new payload cases

* feat(release): keep installed docs and source readable in Desktop

Desktop keeps the published src/ and docs/ trees inside app.asar, and
every model shell call receives DSH_INSTALL_DIR and DSH_NODE_EXECUTABLE
so an agent can read them through Electron's Node mode. Staging also
generates docs/upgrade-guide/README.md, an index of the upgrade guides
grouped by the release they upgrade from.

Minified client bundles print string literals with backticks: the
worker image packer now recognizes those chunk requests, client license
banners are prepended after minification so their text survives, and
the affected artifact tests accept either quote.

* test(desktop): read archived docs through the Windows PowerShell form

Regenerate the config catalog for the shifted shell-env source line.

* test(desktop): wait for the GUI-subsystem Electron process from PowerShell

* build(release): publish source and maps from the message-quotes package

* build(release): publish source and maps from packages new on master

* build(release): publish source and maps from the tool-office package
2026-11-05 00:22:36 +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 | 中文

Deprecated: For new configurations, mount @deepseek-ai/dsh-tool-executor-native or @deepseek-ai/dsh-tool-executor-ptc directly. Existing configurations remain supported. To migrate, replace this selector row with the corresponding executor row and remove config.mode; do not load both in the same scope.

Summary

Existing agent presets can keep using dsh-agent-tool-presentation to select whether models see every native tool schema or only run_code with a generated SDK. Each preset can choose independently, so native and PTC agents can share one process without sharing tool catalogs. Selecting ptc requires a compatible PTC runtime. 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. Agents that declare nothing inherit the nearest executor mounted in their composition.

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

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 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-tool-executor-ptc. Before the runtime first becomes available, this compatibility selector leaves the inherited executor active. Mount dsh-tool-executor-ptc directly when preset activation must reject a missing runtime.

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 resolves its executor, 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.setExecutor() declares an executor 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.setExecutor for the mounting scope

Behavior notes

The selected child plugin registers its executor when its required services are available. After registration, unloading the child or its runtime makes the selected executor unavailable until a replacement registers; calls do not fall back to an inherited executor.


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; PTC selection remains pending until the deployment supplies a runtime.

Dev Note

Working context for maintainers — click to expand

None.