Read configured plugin market indexes on the Host, search them with fuzzy multilingual matching, and install a chosen version from the Plugins page. - dsh-plugin-market-index validates format-1 indexes and builds install arguments; inline icons are capped at 32 KiB. - The pluginMarket service fetches configured http(s) URLs, parses bodies in a Worker Thread, caches documents, and pages filtered, ordered results with installation status and engines.dsh compatibility. - Discover is an opt-in experimental bundle; the Plugins page gains a plugins.tab slot and confirmed installs. - The plugin_market tool lists indexes, plugins, and versions for Creator mode. - Plugin compatibility reads engines.dsh before DSH peer dependencies.
30 lines
1.3 KiB
TypeScript
30 lines
1.3 KiB
TypeScript
/** Localizable rejections shared by profile management operations. */
|
|
import type { PluginCompatibility } from '@deepseek-ai/dsh-app-boot'
|
|
import type { IncompatiblePlugin, ManagementError } from './types.ts'
|
|
|
|
/** Expected management rejection; presentation belongs to the caller's locale. */
|
|
export class ManagementFailure extends Error {
|
|
/** Code rendered by the caller's locale dictionary. */
|
|
readonly code: ManagementError['code']
|
|
/** The packages an `incompatible-version` rejection names. */
|
|
readonly incompatible: IncompatiblePlugin[] | undefined
|
|
/**
|
|
* @param code Localizable management rejection.
|
|
* @param incompatible Packages the running DSH version rejects, for `incompatible-version`.
|
|
*/
|
|
constructor(code: ManagementError['code'], incompatible?: IncompatiblePlugin[]) {
|
|
super(code)
|
|
this.code = code
|
|
this.incompatible = incompatible
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Drop the exemption status from an unexempted compatibility result.
|
|
* @param issue Result whose exemption is not active.
|
|
* @returns The package, runtime, and unmet DSH requirements.
|
|
*/
|
|
export function incompatiblePlugin(issue: PluginCompatibility): IncompatiblePlugin {
|
|
return { name: issue.name, version: issue.version, runtimeVersion: issue.runtimeVersion, requirements: issue.requirements }
|
|
}
|