fongap-labs/delta--packages-boot-plugin-market ↗★ 0
@deepseek-ai/dsh-plugin-market
Configured plugin market indexes for the Web Discover page and the plugin_market agent tool
같은 패키지 이름의 다른 저장소
설치
검증된 bundle이 없거나 호환성 검사에 실패했습니다. 먼저 저장소 설명을 읽어 주세요. 전체 README 읽기 ↗
description: "Host reader of the plugin indexes a user configures, with installation status, compatibility, and the read-only plugin_market tool." kind: "package-reference"
@deepseek-ai/dsh-plugin-market
English | 中文
Summary
pluginMarket reads the plugin indexes the user configures, validates them with dsh-plugin-market-index, and annotates every entry with the profile's installation status, DSH compatibility, and the exact arguments that install it. It also reads each index entry's long description, a Markdown document with images, for Discover entry pages. The Web Discover tab and the plugin_market agent tool read through it; installation itself goes through pluginManager.installBundle. The format and its rationale live in the index format Agent Note; the Host and Web design lives in the Discover Agent Note.
Table of Contents
- Use this package
- Understand the implementation
- Model Experience
- Known Limitations and Deferred Work
- Dev Note
Use this package
The optional custom plugin indexes bundle mounts the service as the plugin-market row; shipped profiles leave the bundle off. Like plugin-manager, the row is disabled without a profile, and it waits for pluginManager. No index source is configured by default, so the Host sends no index request until a user adds one.
| Config | Default | Meaning |
|---|---|---|
indexes | [] | Canonical index source URLs in display order. Discover, Settings, and setIndexes change this field without remounting this service or plugin-manager. |
fetchTimeoutMs | 15000 | Deadline for each HTTP(S) index or detail file request, including the response body. |
maxBytes | 134217728 | Largest accepted index file. |
cacheTtlMs | 600000 | Lifetime of a successfully read index document, a detail read result, and a repository's default-branch commit. |
detailMaxBytes | 1048576 | Largest detail document, and largest locale file read for one. |
detailImageMaxBytes | 5242880 | Largest image served beside a detail document. |
detailRepositoryMaxBytes | 52428800 | Largest amount one Git command adds to a partial clone; a repository whose fetch adds more is not read. |
detailCacheMaxBytes | 524288000 | Largest total size of the partial clones; least recently used ones are deleted beyond it after each fetch. |
detailCacheDir | .plugin-market/repositories | Directory of the partial clones, relative to the profile directory; required, as an absolute path, when the service runs outside a dsh profile. |
detailGitTimeoutMs | 60000 | Deadline for a complete Git index file read, including queue and lock waits, and for each Git command used to read an index or detail file. |
detailNpmFileSources | ['jsdelivr', 'unpkg', 'npmmirror'] | npm file CDNs read in order; a read's npmFileSources moves the CDNs it names first, and CDNs this list omits are not asked. |
detailGitlabHosts | ['gitlab.com'] | Hosts whose GitLab repository files API serves public repositories, compared without letter case. |
An index source can be a direct JSON address such as https://example.com/index.json or a Git repository such as git+https://github.com/acme/plugins.git or git+ssh://git@git.example.com/platform/plugins.git. Direct JSON addresses use HTTP or HTTPS and exclude credentials and fragments. A Git source reads index.json at the repository root on the default branch. Add ?path=market%2Findex.json&ref=main to select another repository-relative path or ref. The ref can be a branch name or a full lower-case SHA-1 commit ID.
Git uses the DSH Host user's Git credential helper for HTTPS or the user's SSH configuration and keys for SSH. Set up access on the machine running the Host before adding a private index. Git's url..insteadOf rules may rewrite the repository address to another HTTPS or SSH address. The Host reports a failed connection for the chosen address so you can correct the source or the Host's Git access.
The service validates each source when it lists or reads it. listIndexes reports an unusable URL with its refusal, and search and entry refuse to contact it. A repeated URL is listed once.
The Remote methods are:
listIndexes()returns each configured URL with the title and description of its last successful read and, when the last read failed, its error. It never fetches.setIndexes(urls)normalizes and validates each URL not already configured, keeps configured ones as written, refuses a repeated URL, and writes it throughsettings.updateto this service's profile entry. It fails withplugin-market/settings-unavailablewithout Settings or a profile entry. The committed list is announced byplugin-market/changed.search(url, query)accepts only a configured URL, so the service never fetches an arbitrary address. It returns one page of the plugins that matchquery, with the index title, description, and declarations, the document'sfetchedAt, thetotalnumber of matches, and thenextOffset; each plugin carries itsdefaultVersionandinstallation, and each version itsinstallandcompatibility.readEntryDetail(url, name, version, language, { refresh?, npmFileSources? })reads the long description of one listed version of a configured index's entry from that version's source: the npm file CDNs for a version withoutregistryor with the npm or npmmirror registry, or its pinned Git commit andpath. An npm version from another registry has no readable package files.
The service method entry(url, name), which is not a Remote method, returns one plugin of a configured index in the same form, or undefined when the index does not list it.
A query selects plugins with every one of its conditions:
| Field | Meaning |
|---|---|
text | Fuzzy words; see below. Text without letters or digits selects every plugin. |
category | The plugin's category id. |
labels | Label ids the plugin must all have. An undeclared category or label id matches no plugin. |
sort | index order; relevance, best text match first and index order without text; latest published time; or a declared sort key, with plugins lacking the value last. Each takes asc or desc where it has a direction, and ties keep index order. An undeclared sort key leaves index order. |
offset, limit | The page: offset is a non-negative integer and limit an integer from 1 to 100; other values fail with plugin-market/invalid-query. |
refresh | Fetch again instead of using the cached document. |
fetchedAt | fetchedAt of an earlier page: answer from that document while it is cached, even after cacheTtlMs, so later pages continue the same results. |
Text matches the package name, author, keywords, and every language of the title, description, and category and label titles. It is split into runs of letters, marks, and digits; a run of Chinese, Japanese, or Korean characters becomes its overlapping character pairs and its last character, so text written without spaces matches without a dictionary. Words are compared after NFKC normalization and without case. Every query word must match an indexed word as a prefix or, from four characters, within an edit distance of one fifth of its length rounded to the nearest integer, at most 2. Name and title matches weigh three times, and keyword matches twice, a match elsewhere.
Plugin detail documents
readEntryDetail reads all three steps of the document order: the locale meta.detail file and the README from the entry version's source, then the declared repository's README. For an npm version the README is the one npm shows for it. A Git entry whose repository is its own source directory skips the repository step. A malformed locale file or meta.detail, or a named file that does not exist, fails the read instead of moving to the next step.
Without any, the result is { status: 'none' }. A found document carries its origin (locale, readme, or repository), its Markdown without a leading YAML front matter block, and a document id. Results, and the too-large, denied, and invalid failures that reading again would repeat, are cached for cacheTtlMs; refresh reads again instead, and concurrent reads share one read. A document id stays valid while a read returns it or an image request names it at least once every cacheTtlMs; an unused id is forgotten, and its images answer 404 until the document is read again.
Repository files are read through GitHub's raw file host for github.com and the GitLab repository files API for detailGitlabHosts. API requests follow redirects within their origin. When an API answers 401, 403, or 404, a request to the repository's smart HTTP endpoint without any credentials decides whether the repository is public; a public repository's miss means the file does not exist. A repository that needs credentials, and a repository on a host without such an API, is read from a partial clone over https, http, or ssh. Git uses the user's configuration, credential helpers, and url..insteadOf rules without prompting, so an https URL can be routed to ssh. When Git refuses an http(s) URL, the clone fetches again from ssh://git@/ , the SSH form plugin installation also uses, and keeps that remote; a failed retry reports both diagnostics, as network or too-large for those causes and denied otherwise. Opening a detail page can therefore connect over ssh to the host an index entry names; with batch mode and the default host key checking, ssh authenticates only to hosts in the user's known hosts. ssh runs in batch mode unless GIT_SSH or GIT_SSH_COMMAND is set.
GET /api/plugin-market/detail-file?document=&path= serves an image beside a read document to authenticated owner connections. The destination is relative to the document, or to the package or repository root when it starts with /; its query and fragment are ignored. Only PNG, JPEG, GIF, WebP, AVIF, and SVG files inside that root are served, with Content-Security-Policy: sandbox, X-Content-Type-Options: nosniff, and a private cache for cacheTtlMs. A missing file, unknown document, or other path answers 404; the failures below answer 413, 502, 403, 503, and 400; failure responses are not cached.
A source that exists but cannot be read fails with plugin-market/detail-unavailable and one reason: too-large for a document, image, or repository over its limit; network when a source cannot be reached or times out; denied when Git refuses the repository with the user's credentials; git-unavailable when a repository must be cloned and Git cannot run; invalid for a malformed locale file or meta.detail, or a named file that does not exist. An unlisted entry or version fails with plugin-market/unknown-plugin; an invalid language fails with plugin-market/invalid-query. A Git that cannot start and a local Git command that fails, such as on a full disk, fail the read without a detail reason and are not cached.
Failures use plugin-market/invalid-query, plugin-market/invalid-index-url, plugin-market/unknown-index, plugin-market/fetch-failed, and plugin-market/invalid-index; the last carries the JSON path of the offending value.
The plugin_market tool lists the configured indexes, pages the plugins of one index in index order or, with a query, by best match, or pages one plugin's versions. It requires no approval because it reads only the sources the user configured and changes nothing; each version it returns carries the target and registry to pass to plugin_manager's install_bundle, which keeps its own approval. The tool cannot change index sources. A missing argument or an out-of-range page fails as ToolArgsError with INVALID_ARGS. Market failures reach the tool registry as PluginMarketError, which keeps the service's message and its RemoteError as cause: for example plugin-market/unknown-index becomes PLUGIN_MARKET_INDEX_NOT_FOUND, plugin-market/fetch-failed becomes PLUGIN_MARKET_FETCH_FAILED, and an unlisted plugin is PLUGIN_MARKET_PLUGIN_NOT_FOUND; any other failure is PLUGIN_MARKET_FAILED. Creator mode keeps its row beside plugin_manager, and the row registers the tool only while pluginMarket is mounted; other presets keep it disabled.
Understand the implementation
The Host uses the process fetch for direct JSON addresses, so the configured outbound proxy applies. It refuses redirects for these addresses. For Git sources, it reads the index from a partial clone kept apart from detail clones. The Git read defaults to refusing HTTPS redirects and does not retry with a different remote. A fresh index read fetches the default branch or the configured branch again and reuses a pinned commit when it is cached.
The index is read up to maxBytes. A fresh Worker Thread decodes the bytes as strict UTF-8, parses them as JSON, and validates the result. Relative icon references in a direct JSON source resolve against its URL. The buffer moves to the Worker, and the validated index returns to the Host by structured clone. Disposal terminates the self-contained lib/worker.cjs Worker. A Worker failure is reported as plugin-market/fetch-failed.
Concurrent reads of one URL share one fetch. A successful document is cached for cacheTtlMs; refresh bypasses the cache. Each fetched document gets a new fetchedAt, and the cached document stays answerable by its fetchedAt until a later fetch replaces it. A failed read records its message for listIndexes and keeps no document. A read that finishes after its URL left the configuration updates neither cache nor error. On loader/volatile-update the service drops state of removed URLs and emits plugin-market/changed. Disposal aborts in-flight fetches.
Filtering and ordering read only the document; installation status and compatibility are computed for the returned page on every call. The first query with text in a document builds its text index with MiniSearch, 500 plugins per event-loop turn, and later queries reuse it until the document is replaced.
Compatibility is computed per version with evaluatePluginCompatibility, the version's engines.dsh, and the profile's version exemptions, the same check installation applies. A plugin's default version is its highest compatible version without a prerelease tag, or its highest compatible prerelease when it lists no version without one; a plugin with no compatible version has none. Installation status comes from pluginManager.listBundles() by package name, measured against the default version, or the highest version without one: not-installed, also for an on-demand catalog entry the profile has not installed; installed at that version; update-available when that version is greater; different-version when the installed version is unknown, not valid SemVer, or greater; and provided for a bundle the DSH installation ships. A version's update is true when it is newer than a copy listBundles marks update: 'git' and pins a commit of the repository and directory that copy pins, so the Plugins page can replace that copy with it through pluginManager.updateBundle; a registry copy's newer versions come from