* 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
description, kind
| description | kind |
|---|---|
| Plugin detail document selection without state: the meta.detail or README order, language fallback, image paths, and local and npm CDN file sources. | package-library |
dsh-plugin-detail
English | 中文
Summary
Library without state for plugin detail documents, the long Markdown description a plugin's page shows. It owns the order in which a package's document is chosen, the language fallback, image destinations beside a document, and two read-only file sources: a local package directory and a published npm version on public file CDNs. plugin-manager reads profile bundles with it, and plugin-market reads market entries with it and adds repository sources.
Table of Contents
Use this package
It is a library, not a service or plugin: no ctx, no registrations, no state. Reads go through the file source the caller passes.
Document order
A plugin's detail document is the first that exists, in this order:
- Locale
meta.detail. For each language of the chain, the package'slocale/<language>.jsonis read, or, when that file does not exist, the same name with an upper-case two-letter region such aslocale/zh-CN.json. When the file read declaresmeta.detail, that Markdown file is the document; otherwise the next language is tried. - Package README.
README.md,readme.md,Readme.md,README.markdown, orREADME. A source that lists directories takes any letter case ofREADME,README.md, andREADME.markdown. - Repository README, market entries only. The README of the repository directory that the market entry's
repositorynames, otherwise the one that the package'spackage.jsonrepositorynames, at the default branch.plugin-marketreads it; bundle pages in Plugins never read a repository.
readPackageDocument(files, dir, languages, maxBytes, signal) implements steps 1 and 2 and returns undefined when neither applies. meta.detail must be a /-separated path relative to the package root that ends in .md or .markdown and has no empty, ., or .. segment, backslash, or URL scheme. A malformed locale file, a malformed meta.detail, and a named file that does not exist fail with DetailFailure invalid; the README is not read in their place.
languageChain(language) builds the chain: the language in lower case, each shorter prefix, then English, so zh-Hans-CN reads zh-hans-cn, zh-hans, zh, and en.
The returned Markdown has no byte order mark and no leading YAML front matter block.
Images
detailImage(document, destination) resolves an image a document writes: relative to the document, or to the root of its files when it starts with /; a query or fragment is ignored. It returns the image's path and media type, or undefined for a destination that leaves the root, is malformed, or names a type other than PNG, JPEG, GIF, WebP, AVIF, and SVG.
File sources
localFiles(root, revision)reads a package directory. A path whose real location leaves the directory reads as absent.revision, such as the installed version, becomes part of the source'skey.npmFiles(name, version, sources, options)reads a published version from jsDelivr, unpkg, and npmmirror in the given order. A 404 means the package has no such file; a network failure or another status asks the next CDN.npmFileSourceOrder(configured, preferred)puts the preferred CDNs that are configured first, in the preferred order, then the other configured ones.fetchBody(url, maxBytes, signal, options)reads one HTTP body up tomaxBytes, following redirects within the URL's origin.
Every read is bounded by the caller's maxBytes and fails with DetailFailure too-large beyond it, or network when a source cannot be reached.
Image responses
detailImageResponse(outcome, cacheControl) answers an image route: the image with cacheControl, 404 when there is none, or the failure's status (too-large 413, network 502, denied 403, git-unavailable 503, invalid 400) with the reason as its body and Cache-Control: no-store. Every response carries X-Content-Type-Options: nosniff and Content-Security-Policy: sandbox, because an SVG opened directly would otherwise run scripts on the authenticated API origin.
API
import {
DetailFailure, detailImage, detailImageResponse, languageChain, localFiles, NPM_FILE_SOURCES, npmFiles, npmFileSourceOrder,
readPackageDocument,
} from '@deepseek-ai/dsh-plugin-detail'
DetailFailureReason and NpmFileSource, which Remote methods of other packages use, are also exported type-only from @deepseek-ai/dsh-plugin-detail/types.
DetailFiles is the source interface: read(path, maxBytes, signal) returns a file's bytes or undefined, and readme(dir, maxBytes, signal) returns a directory's README. Repository sources implement it in plugin-market.
Model Experience
None, as this library selects documents for plugin pages and adds nothing to model requests.
KV Cache effect
None.
Known Limitations and Deferred Work
- Public npm only — the file CDNs serve packages of the public npm registry; packages of other registries have no npm file source.
Dev Note
Working context for maintainers — click to expand
None.