Files
deepseek-harness/packages/session/session-title-llm
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
Shared model-execution policy for session-title providers: route, bounds, cancellation, request logging, and stream assembly. package-library

@deepseek-ai/dsh-session-title-llm

English | 中文

Summary

dsh-session-title-llm executes one prepared auxiliary title request under consistent execution controls. Each provider supplies its own system instruction, user input, source-message attribution, reasoning selection, and output interpretation. This package resolves the route, caps the input, output, and end-to-end duration, keeps caller cancellation effective throughout streaming, records the exact model-visible request, and assembles the stream. Invalid or late operational results reject before a title can be replaced.

Table of Contents


Use this package

As a deployment, configure this policy through the first-prompt or all-prompts provider plugin. As a provider author, build your own prepared input and execute it through the shared function.

Executing a provider request

A provider plugin registers directly on ctx.sessionTitle and, inside its generate(request), passes { system, input, messageSeqs, selectReasoningEffort } to executeSessionTitleLlm. The provider owns the system instruction, input framing, its reasoning selection, and output interpretation; the function owns route preparation, bounds, cancellation, request logging, and stream assembly. A second registration on the service throws.

Every request carries currentTitle, the latest accepted title snapshot the service captured for the call, including an accepted fallback. A provider decides whether to use it: the all-prompts provider anchors only a provider-sourced title, including one inherited from a different provider, and treats fallback, user, and absent titles as initial generation. The first-prompt provider ignores currentTitle.

Route and failure contract

provider and model overrides are optional but must be supplied together as non-empty strings. Without that pair, the function uses the exact provider/model route captured from the current session's logged request/header, so an explicit refresh before any route exists needs overrides. It measures the final prepared user input against maxInputBytes before logging or dispatch instead of truncating it, and rechecks timeout and caller cancellation while consuming the stream and after it completes, so a late successful result cannot be accepted even if an interceptor or adapter ignores abort. It records the exact request in session/title-llm-request and returns the assembled content blocks plus the terminal finish and the used model identity. Operational errors, aborts, and unsupported finish reasons reject; stop, tool-calls, and max-tokens return to the provider for its own acceptance decision. The title request uses maxOutputTokens independently of the conversation's cap. Its route must have a registered adapter so preparation can resolve the request before it is recorded.

Configuration

Every execution field is required except the paired route override; there are no library defaults. Each provider adds its own title-length target settings, which that provider's README documents.

Key Default Meaning
maxInputBytes required UTF-8 byte ceiling for the prepared user input
maxOutputTokens required Title output-token cap, independent of conversation requests
timeoutMs required End-to-end deadline within the runtime timer limit
provider, model optional Explicit route; both or neither

Understand the implementation

Implementation internals — click to expand

This section explains the generation path; the observable behavior is fully covered in Use this package.

Design concept

One small shared execution policy so operational behavior cannot drift: execution-control validation, route resolution, budget enforcement, cancellation, request logging, and stream assembly live here. Prompt wording, title-length targets, reasoning selection, and output interpretation stay with each provider.

Source map

File Role
src/index.ts Config schema and validation, route resolution, request bounds, dispatch, logging, and stream assembly

Request flow

The caller builds the prepared input and frames it; the function checks the complete input against maxInputBytes. The provider's reasoning selector chooses at most one effort during ctx.llm.prepareCall(). The function records the exact input, output cap, and resolved effort in session/title-llm-request, then dispatches through the same captured adapter generation under the shared deadline. purpose: 'session-title' supplies attribution only. The request has no agent-loop identity and does not enter conversation history. Generation failures preserve the request record. The package declares session-title in LlmRequestPurposeMap; importing its public entry loads that declaration.


Further Exploration

Read these pages when the generation policy is not enough. They move from the service it plugs into to the provider plugins that consume it.


Model Experience

Auxiliary title request

What the model sees

The title model receives the provider-owned system instruction and one user message containing the provider-owned input. The executor records and dispatches those exact values without reconstruction; the framing and the output instruction belong to each provider, which the first-prompt and all-prompts READMEs document.

Token effect

The auxiliary request consumes tokens according to the provider-prepared input size and maxOutputTokens. It is separate from the main agent request and does not add title text or framing to agent history. The executor applies the provider's selected reasoning effort, or the route's normal default when the selector returns undefined; a model that still reasons spends part of maxOutputTokens on it. The main conversation retains its configured thinking mode.

KV Cache effect

No main-request invalidation. Auxiliary cache reuse is provider-specific: this executor dispatches the provider's exact system prompt and input, so reuse depends on how each provider frames successive revisions.

Known Limitations and Deferred Work

These limits define the accepted generation shapes. They are current package constraints.

  • Provider-interpreted output — the executor returns assembled content blocks and the terminal finish and does not accept or reject them; each shipped provider's README owns its acceptance policy.
  • Whole-input byte ceiling — it rejects prepared input over maxInputBytes rather than truncating it.
  • Reasoning is provider-selected — the executor applies the effort the provider returns and never chooses one; when the selector returns undefined, the route's normal default applies.

Dev Note

Working context for maintainers — click to expand

None.