@linxin666/dsh-client-ui-plugin-manager 0.3.6 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +3 -2
- package/lib/client.js.map +1 -1
- package/lib/types/client/index.d.ts +1 -1
- package/package.json +16 -12
package/lib/client.js
CHANGED
|
@@ -900,6 +900,7 @@ window.__ModuleLoader__.load({
|
|
|
900
900
|
onClose: () => {
|
|
901
901
|
setUninstallTarget(void 0);
|
|
902
902
|
},
|
|
903
|
+
closeLabel: t("cancel"),
|
|
903
904
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
904
905
|
className: plugin_manager_module_css_default.confirmBody,
|
|
905
906
|
children: t("uninstallConfirmBody", { name: uninstallTarget?.name ?? "" })
|
|
@@ -1239,7 +1240,7 @@ window.__ModuleLoader__.load({
|
|
|
1239
1240
|
/** The building package's version, when the bundle carries it. */
|
|
1240
1241
|
function bakedVersion() {
|
|
1241
1242
|
try {
|
|
1242
|
-
return "0.3.
|
|
1243
|
+
return "0.3.10";
|
|
1243
1244
|
} catch {
|
|
1244
1245
|
return;
|
|
1245
1246
|
}
|
|
@@ -1503,7 +1504,7 @@ window.__ModuleLoader__.load({
|
|
|
1503
1504
|
*/
|
|
1504
1505
|
const repairPlugin = async (pluginRoot, message) => {
|
|
1505
1506
|
const workspace = await ctx.workspaces.create({ path: pluginRoot });
|
|
1506
|
-
const sessionId = await ctx.
|
|
1507
|
+
const sessionId = await ctx.sessions.create({ workspaceId: workspace.workspaceId });
|
|
1507
1508
|
const binding = ctx.sessions.binding(sessionId);
|
|
1508
1509
|
if (binding === void 0) throw new Error(`plugin-manager: repair session ${sessionId} is unavailable`);
|
|
1509
1510
|
const result = await binding.session.prompt([{
|
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["css","Button","Modal"],"sources":["../../../packages/dsh-plugin-manager/src/core/conflict.ts","../../../packages/dsh-plugin-manager/src/core/repair.ts","../../../packages/dsh-plugin-manager/src/core/version.ts","../../../packages/dsh-plugin-manager/src/client/PluginManagerTab.tsx","../../../packages/dsh-plugin-manager/src/client/locales.ts","../../../packages/dsh-plugin-manager/src/core/protocol.ts","../../../packages/dsh-plugin-manager/src/core/service.ts","../../../packages/dsh-plugin-manager/src/client/telemetry.ts","../../../packages/dsh-plugin-manager/src/client/index.ts"],"sourcesContent":["/**\n * Conflict-ledger diffing. The official host applies structural conflict\n * rules at install time (disableControlsOnInstall: installing the dsh-web\n * family disables the built-in web-ui product rows so the two never\n * double-mount), but no UI surfaces what the rules just did. This module\n * diffs the plugin-control snapshots taken before and after an install and\n * classifies every state change so the tab can render it as a reversible,\n * attributable conflict notice.\n *\n * The install-time authority ends here: duplicate insert-id claims between\n * two user plugins carry no at-install signal through the RPC channels (the\n * Loader only re-reads the composition at the next start), so that failure\n * shape is left to the boot-failure ring — the real start is the authoritative\n * conflict detector.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\nimport type { PluginControlItem } from './protocol.ts'\n\n/** One observed product-control state change between two snapshots. */\nexport interface ControlChange {\n id: string\n name: string\n from: PluginControlItem['state']\n to: PluginControlItem['state']\n}\n\n/** Meaningful change kinds a conflict notice distinguishes. */\nexport type ControlChangeKind = 'rule-disabled' | 'rule-enabled' | 'state-change'\n\n/**\n * Diff two plugin-control snapshots by id. Only entries present in both\n * snapshots with a changed state are reported; entries appearing or\n * disappearing are ordinary install/uninstall outcomes, not conflicts.\n * @param before - snapshot taken before the install.\n * @param after - snapshot taken after the install.\n * @returns one change per id whose state moved, in id order.\n */\nexport function diffControls(before: readonly PluginControlItem[], after: readonly PluginControlItem[]): ControlChange[] {\n const afterById = new Map(after.map(item => [item.id, item]))\n const changes: ControlChange[] = []\n for (const item of before) {\n const current = afterById.get(item.id)\n if (current === undefined || current.state === item.state) continue\n changes.push({ id: item.id, name: item.name, from: item.state, to: current.state })\n }\n return changes\n}\n\n/**\n * Classify one control-state change for messaging. A change into `disabled`\n * is the conflict rule's action (reversible by re-enabling); a change out of\n * `disabled` is a manual undo; anything else is reported neutrally.\n * @param change - one diff entry.\n * @returns the message kind.\n */\nexport function classifyChange(change: ControlChange): ControlChangeKind {\n if (change.to === 'disabled') return 'rule-disabled'\n if (change.from === 'disabled') return 'rule-enabled'\n return 'state-change'\n}\n","/**\n * Repair-conversation seed text. Two failure surfaces hand off to the agent\n * through the same shape: a failed install (target spec + install error) and\n * a recorded boot failure (the failure-ring row). The seeded message must be\n * self-contained — the repair session's workspace is the plugin install root,\n * so the agent's file tools reach the plugin code without leaving the\n * workspace boundary.\n *\n * Secret discipline: the seed carries only the spec, the host's truncated\n * failure message/stack, and paths. Callers must never append credentials,\n * tokens, or environment contents; the failure ring is the host's bounded,\n * pruned record and nothing else is added.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\nimport type { PluginFailureItem } from './protocol.ts'\nimport type { LayerState } from './patch-diff.ts'\n\n/** Localized fragments the builders assemble. */\nexport interface RepairCopy {\n installTitle: string\n installSpecLabel: string\n installErrorLabel: string\n installAsk: string\n failureTitle: string\n failurePluginLabel: string\n failureKindLabel: string\n failureAtLabel: string\n failureMessageLabel: string\n failureStackLabel: string\n failurePathLabel: string\n failureAsk: string\n conflictTitle: string\n conflictPluginLabel: string\n conflictChangeLabel: string\n conflictAsk: string\n /** Localized names of the failure kinds. */\n kindNames: Record<PluginFailureItem['kind'], string>\n /** Localized names of the layer states a conflict change traverses. */\n stateNames: Record<LayerState, string>\n}\n\n/** Default copy (zh): the package's zh dictionary keys map onto these strings. */\nexport const DEFAULT_REPAIR_COPY: RepairCopy = {\n installTitle: '正在修复插件安装失败',\n installSpecLabel: '安装目标',\n installErrorLabel: '安装错误',\n installAsk: '请在插件安装根目录内检查插件包或依赖并修复,然后重试安装。',\n failureTitle: '正在修复插件启动失败',\n failurePluginLabel: '插件',\n failureKindLabel: '失败类型',\n failureAtLabel: '时间',\n failureMessageLabel: '错误信息',\n failureStackLabel: '堆栈',\n failurePathLabel: '安装路径',\n failureAsk: '请修复插件后重新启用并重启 dsh web。',\n conflictTitle: '正在处理插件安装冲突',\n conflictPluginLabel: '冲突条目',\n conflictChangeLabel: '状态变化',\n conflictAsk: '请检查冲突双方的入口行 id 与挂载方式,消除重复挂载后告诉我如何重新启用。',\n kindNames: {\n 'load-failure': '加载失败',\n hang: '启动挂起',\n 'late-rejection': '迟到拒绝',\n },\n stateNames: {\n enabled: '已开启',\n disabled: '已关闭',\n uninstalled: '已卸载',\n },\n}\n\n/**\n * Seed text for a failed install: the target and the rendered error,\n * self-contained for the agent.\n * @param spec - the install target (npm spec or git URL) that failed.\n * @param error - the rendered install error text.\n * @param copy - localized fragments.\n * @returns the repair prompt text.\n */\nexport function installRepairMessage(spec: string, error: string, copy: RepairCopy = DEFAULT_REPAIR_COPY): string {\n return [\n copy.installTitle,\n `${copy.installSpecLabel}: ${spec}`,\n `${copy.installErrorLabel}:\\n${error}`,\n copy.installAsk,\n ].join('\\n\\n')\n}\n\n/**\n * Seed text for one boot-failure ring row: the failure record, so the agent\n * can attribute and fix it in place.\n * @param failure - the recorded failure row.\n * @param copy - localized fragments.\n * @returns the repair prompt text.\n */\nexport function failureRepairMessage(failure: PluginFailureItem, copy: RepairCopy = DEFAULT_REPAIR_COPY): string {\n const parts = [\n copy.failureTitle,\n `${copy.failurePluginLabel}: ${failure.pluginId || '-'}`,\n `${copy.failureKindLabel}: ${copy.kindNames[failure.kind] ?? failure.kind}`,\n `${copy.failureAtLabel}: ${failure.at}`,\n `${copy.failureMessageLabel}:\\n${failure.message}`,\n ]\n if (failure.stack !== '') parts.push(`${copy.failureStackLabel}:\\n${failure.stack}`)\n if (failure.installPath !== '') parts.push(`${copy.failurePathLabel}: ${failure.installPath}`)\n parts.push(copy.failureAsk)\n return parts.join('\\n\\n')\n}\n\n/**\n * Seed text for one install-conflict notice: the entry and its state change,\n * so the agent can attribute the conflict and resolve the double mount.\n * @param change - the conflict change (id, display name, from/to states).\n * @param copy - localized fragments.\n * @returns the repair prompt text.\n */\nexport function conflictRepairMessage(\n change: { id: string; name: string; from: LayerState; to: LayerState },\n copy: RepairCopy = DEFAULT_REPAIR_COPY,\n): string {\n return [\n copy.conflictTitle,\n `${copy.conflictPluginLabel}: ${change.name} (${change.id})`,\n `${copy.conflictChangeLabel}: ${copy.stateNames[change.from] ?? change.from} -> ${copy.stateNames[change.to] ?? change.to}`,\n copy.conflictAsk,\n ].join('\\n\\n')\n}\n","/**\n * DSH host version parsing and comparison for the update compatibility\n * check. The declared minimum lives in the published package manifest under\n * `dsh.engines.dsh`, falling back to the top-level `engines.dsh`; the only\n * supported form is `>=X.Y.Z[-prerelease]`.\n *\n * Comparison deliberately uses plain semver ordering instead of\n * `semver.satisfies`: npm's prerelease rule only allows a prerelease version\n * to satisfy a comparator set carrying a prerelease on the same\n * major.minor.patch tuple, which would reject a newer host line (0.1.1-rc.2)\n * against a declared `>=0.1.0-rc.8` — exactly the cross-cohort upgrade path\n * this check must allow. Everything here is pure and tolerant of untrusted\n * input: a malformed value means \"cannot verify\", which the callers treat as\n * a fail-closed verdict when a requirement was declared (issue #754).\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\n/** One parsed DSH host or package version. */\nexport interface DshVersion {\n major: number\n minor: number\n patch: number\n /** Prerelease identifiers, numeric identifiers kept as numbers (semver order). */\n prerelease: readonly (number | string)[]\n}\n\nconst VERSION_PATTERN = /^v?(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z.-]+))?$/\n\n/**\n * Parse a DSH host or package version string.\n * @param value - e.g. `0.1.0-rc.8`, `v1.2.3`.\n * @returns the parsed version, or undefined when malformed.\n */\nexport function parseDshVersion(value: string): DshVersion | undefined {\n const match = VERSION_PATTERN.exec(value.trim())\n if (match === null) return undefined\n const prereleaseParts = match[4] === undefined ? [] : match[4].split('.')\n if (prereleaseParts.some(part => part === '')) return undefined\n return {\n major: Number(match[1]),\n minor: Number(match[2]),\n patch: Number(match[3]),\n prerelease: prereleaseParts.map(part => /^\\d+$/.test(part) ? Number(part) : part),\n }\n}\n\n/**\n * Compare two version strings by semver order (a release is newer than any\n * prerelease of the same tuple).\n * @returns -1 / 0 / 1, or undefined when either side is malformed.\n */\nexport function compareVersions(left: string, right: string): number | undefined {\n const a = parseDshVersion(left)\n const b = parseDshVersion(right)\n if (a === undefined || b === undefined) return undefined\n for (const key of ['major', 'minor', 'patch'] as const) {\n if (a[key] !== b[key]) return a[key] < b[key] ? -1 : 1\n }\n return comparePrerelease(a.prerelease, b.prerelease)\n}\n\n/**\n * Semver prerelease ordering: numeric identifiers compare numerically,\n * numeric identifiers rank below alphanumeric ones, alphanumeric identifiers\n * compare lexically, and a longer list wins when the shared prefix is equal.\n */\nfunction comparePrerelease(left: readonly (number | string)[], right: readonly (number | string)[]): number {\n if (left.length === 0 && right.length === 0) return 0\n if (left.length === 0) return 1\n if (right.length === 0) return -1\n const length = Math.max(left.length, right.length)\n for (let index = 0; index < length; index += 1) {\n const a = left[index]\n const b = right[index]\n if (a === undefined) return -1\n if (b === undefined) return 1\n if (typeof a === 'number' && typeof b === 'number') {\n if (a !== b) return a < b ? -1 : 1\n } else if (typeof a === 'number') {\n return -1\n } else if (typeof b === 'number') {\n return 1\n } else if (a !== b) {\n return a < b ? -1 : 1\n }\n }\n return 0\n}\n\nconst MINIMUM_RANGE_PATTERN = /^>=\\s*(v?\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?)$/\n\n/**\n * Whether a host version satisfies a declared `>=X.Y.Z[-prerelease]` minimum.\n * @param host - the running DSH host version.\n * @param minimum - the declared minimum; any form other than `>=<semver>`\n * (plain semver, `^`, `~`, multi-comparator ranges, empty) returns undefined.\n * @returns true / false, or undefined when the host version is malformed or\n * the minimum uses an unsupported form — callers treat undefined as\n * \"cannot verify\" and fail closed for declared requirements.\n */\nexport function meetsMinimumDsh(host: string, minimum: string): boolean | undefined {\n const match = MINIMUM_RANGE_PATTERN.exec(minimum.trim())\n if (match === null) return undefined\n const compared = compareVersions(host, match[1])\n if (compared === undefined) return undefined\n return compared >= 0\n}\n\n/**\n * The bare minimum version for display: strips the `>=` operator (and an\n * optional leading `v`) from a declared requirement so UI copy that already\n * contains the comparison operator renders `0.1.1-rc.1` instead of\n * `>= >=0.1.1-rc.1`. Unsupported range forms render unchanged.\n * @param minimum - the declared minimum range.\n * @returns the version portion for display.\n */\nexport function displayMinimumVersion(minimum: string): string {\n const match = MINIMUM_RANGE_PATTERN.exec(minimum.trim())\n return match === null ? minimum.trim() : match[1].replace(/^v/, '')\n}\n\n/**\n * Read the declared DSH minimum from a published registry manifest:\n * `dsh.engines.dsh` first, top-level `engines.dsh` as the fallback.\n * Defensive against malformed or untrusted metadata: anything that is not a\n * non-empty string reads as absent.\n * @param manifest - the decoded registry version manifest.\n * @returns the declared minimum, or undefined when not declared.\n */\nexport function dshRequirementOf(manifest: { dsh?: unknown; engines?: unknown }): string | undefined {\n const dshEngines = (manifest.dsh as { engines?: unknown } | undefined)?.engines as { dsh?: unknown } | undefined\n const engines = (manifest.engines as { dsh?: unknown } | undefined)?.dsh\n const value = dshEngines?.dsh ?? engines\n return typeof value === 'string' && value.trim() !== '' ? value.trim() : undefined\n}\n","/**\n * The plugin-manager tab: an install box, one row per installed user plugin\n * (next-start enablement switch, source badge, update availability, update and\n * uninstall actions, per-plugin boot-failure block), the built-in product\n * switches, an install-conflict notice (the diff of the plugin-control\n * snapshot around each install, reversible through the product switch), and\n * the failure-repair affordances. Enablement switches and installs persist\n * through the official host channels and apply at the next restart; the web\n * build shows a restart hint instead of an in-place restart.\n *\n * This tab registers into the official Plugins settings section\n * (`settings.plugins.tab` slot) next to the official installer tab; its added\n * value over that tab is the conflict ledger, the bilingual repair seeds, and\n * the family card vocabulary.\n */\nimport { useEffect, useRef, useState } from 'react'\nimport { Button, Modal } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport { classifyChange, diffControls, type ControlChange } from '../core/conflict.ts'\nimport type {\n InstallProgressItem,\n InstalledPluginItem,\n PluginControlItem,\n PluginFailureItem,\n PluginFailuresSnapshot,\n PluginUpdateItem,\n} from '../core/protocol.ts'\nimport { conflictRepairMessage, failureRepairMessage, installRepairMessage, type RepairCopy } from '../core/repair.ts'\nimport { displayMinimumVersion } from '../core/version.ts'\nimport css from './plugin-manager.module.css'\n\n/** Registration-side wire face used by the tab. */\nexport interface PluginManagerTabInjected {\n /** Whether this browser has loopback authority to use the host routes. */\n isLoopback: boolean\n /** Read the installed snapshot. */\n list: () => Promise<InstalledPluginItem[]>\n /** Install one plugin from an npm spec or git URL. */\n install: (spec: string) => Promise<InstalledPluginItem>\n /** Re-install one plugin from its recorded source. */\n update: (id: string) => Promise<InstalledPluginItem>\n /** Remove one plugin. */\n uninstall: (id: string) => Promise<InstalledPluginItem[]>\n /** Persist one user plugin's next-start enablement. */\n setEnabled: (id: string, enabled: boolean) => Promise<InstalledPluginItem>\n /** Compare installed versions against their sources. */\n checkUpdates: () => Promise<PluginUpdateItem[]>\n /** Read the current install/update progress. */\n status: () => Promise<InstallProgressItem>\n /** Read the recorded boot failures, plugin root, and safe-mode state. */\n failures: () => Promise<PluginFailuresSnapshot>\n /** Persist the safe-mode marker (web: applied at the next manual restart). */\n setSafeMode: (enabled: boolean) => Promise<void>\n /** Start a repair conversation over the plugin install root. */\n repairPlugin: (pluginRoot: string, message: string) => Promise<void>\n /** Read the deployment-configured built-in product switches. */\n controlsList: () => Promise<PluginControlItem[]>\n /** Persist one product's next-start enablement. */\n controlsSetEnabled: (pluginId: string, enabled: boolean) => Promise<PluginControlItem[]>\n /** Conflicts the gateway host computed around the last install (gateway mode only). */\n lastInstallConflicts?: () => readonly ControlChange[]\n}\n\n/** Full component props assembled by the Settings slot renderer. */\nexport type PluginManagerTabProps =\n PropsRuntime<'settings.plugins.tab'>\n & PropsLocale<'settings.pluginManager'>\n & InjectFace<PluginManagerTabInjected>\n\ntype ViewState =\n | { readonly status: 'loading' }\n | { readonly status: 'error' }\n | {\n readonly status: 'ready'\n readonly plugins: readonly InstalledPluginItem[]\n readonly controls: readonly PluginControlItem[]\n readonly failures: PluginFailuresSnapshot\n }\n\n/** One row operation in flight. */\ntype BusyAction = { readonly kind: 'install' | 'update' | 'uninstall' | 'check'; readonly id?: string }\n\n/** One enablement switch in flight: a user plugin or a built-in product. */\ntype ToggleBusy = { readonly kind: 'user' | 'product'; readonly id: string }\n\n/** One uninstall target awaiting confirmation. */\ninterface UninstallTarget {\n readonly id: string\n readonly name: string\n}\n\n/** Error text for a caught request or lifecycle failure. */\nfunction messageOf(error: unknown): string {\n if (error instanceof AggregateError) {\n const details = error.errors.map(messageOf).join('; ')\n return details === '' ? error.message : `${error.message}: ${details}`\n }\n return error instanceof Error ? error.message : String(error)\n}\n\n/** Localized fragments for the repair seed builders, read from the tab's dictionaries. */\nfunction repairCopy(t: PluginManagerTabProps['t']): RepairCopy {\n return {\n installTitle: t('repairInstallTitle'),\n installSpecLabel: t('repairInstallSpecLabel'),\n installErrorLabel: t('repairInstallErrorLabel'),\n installAsk: t('repairInstallAsk'),\n failureTitle: t('repairFailureTitle'),\n failurePluginLabel: t('repairFailurePluginLabel'),\n failureKindLabel: t('repairFailureKindLabel'),\n failureAtLabel: t('repairFailureAtLabel'),\n failureMessageLabel: t('repairFailureMessageLabel'),\n failureStackLabel: t('repairFailureStackLabel'),\n failurePathLabel: t('repairFailurePathLabel'),\n failureAsk: t('repairFailureAsk'),\n kindNames: {\n 'load-failure': t('repairKindLoad'),\n hang: t('repairKindHang'),\n 'late-rejection': t('repairKindLate'),\n },\n conflictTitle: t('repairConflictTitle'),\n conflictPluginLabel: t('repairConflictPluginLabel'),\n conflictChangeLabel: t('repairConflictChangeLabel'),\n conflictAsk: t('repairConflictAsk'),\n stateNames: {\n enabled: t('repairStateEnabled'),\n disabled: t('repairStateDisabled'),\n uninstalled: t('repairStateUninstalled'),\n },\n }\n}\n\n/** Localized label for one install phase, with percent when the download has one. */\nfunction progressLabel(progress: InstallProgressItem, t: PluginManagerTabProps['t']): string {\n if (progress.stage === 'fetch') return t('fetching')\n if (progress.stage === 'extract') return t('extracting')\n if (progress.stage === 'write') return t('writing')\n return progress.percent === undefined ? t('downloading') : t('downloadingPercent', { percent: String(progress.percent) })\n}\n\n/** The plugin-manager settings tab. */\nexport function PluginManagerTab(props: PluginManagerTabProps) {\n const {\n t,\n isLoopback,\n list,\n install,\n update,\n uninstall,\n setEnabled,\n checkUpdates,\n status,\n failures,\n setSafeMode,\n repairPlugin,\n controlsList,\n controlsSetEnabled,\n lastInstallConflicts,\n } = props\n\n const [view, setView] = useState<ViewState>({ status: 'loading' })\n const [busy, setBusy] = useState<BusyAction | undefined>(undefined)\n const [toggleBusy, setToggleBusy] = useState<ToggleBusy | undefined>(undefined)\n const [error, setError] = useState<string | undefined>(undefined)\n const [failedSpec, setFailedSpec] = useState<string | undefined>(undefined)\n const [installError, setInstallError] = useState<string | undefined>(undefined)\n const [spec, setSpec] = useState('')\n const [dirty, setDirty] = useState(false)\n const [repairing, setRepairing] = useState<string | undefined>(undefined)\n const [copied, setCopied] = useState<string | undefined>(undefined)\n const [updates, setUpdates] = useState<ReadonlyMap<string, PluginUpdateItem>>(new Map())\n const [uninstallTarget, setUninstallTarget] = useState<UninstallTarget | undefined>(undefined)\n const [conflicts, setConflicts] = useState<readonly ControlChange[]>([])\n const [progress, setProgress] = useState<InstallProgressItem>({ kind: 'idle', stage: 'fetch' })\n /** Synchronous in-flight mirror of `busy`: the render-time guard alone lets a\n * click and an Enter land in the same frame and double-fire. */\n const busyRef = useRef(false)\n\n /** Reload every snapshot into the ready view. */\n const reload = async (): Promise<void> => {\n const [plugins, controls, failureSnapshot] = await Promise.all([list(), controlsList(), failures()])\n setView({ status: 'ready', plugins, controls, failures: failureSnapshot })\n }\n\n useEffect(() => {\n let cancelled = false\n void reload().catch(() => {\n if (!cancelled) setView({ status: 'error' })\n })\n return () => { cancelled = true }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n /** One row/form operation: busy state, error row, dirty flag on success. */\n const run = async (action: BusyAction, body: () => Promise<void>): Promise<void> => {\n if (busyRef.current) return\n busyRef.current = true\n setBusy(action)\n setError(undefined)\n try {\n await body()\n setDirty(true)\n } catch (reason) {\n setError(t('failed', { reason: messageOf(reason) }))\n } finally {\n busyRef.current = false\n setBusy(undefined)\n }\n }\n\n /** Install one spec, then diff the product snapshot into a conflict notice. */\n const onInstall = (): void => {\n const target = spec.trim()\n if (target === '' || busy !== undefined || busyRef.current) return\n void (async () => {\n busyRef.current = true\n const before = view.status === 'ready' ? view.controls : await controlsList().catch(() => [])\n setBusy({ kind: 'install' })\n setError(undefined)\n setFailedSpec(undefined)\n setInstallError(undefined)\n try {\n await install(target)\n setSpec('')\n setDirty(true)\n const after = await controlsList().catch(() => [] as readonly PluginControlItem[])\n setConflicts(lastInstallConflicts !== undefined ? lastInstallConflicts() : diffControls(before, after))\n await reload()\n } catch (reason) {\n const reasonText = messageOf(reason)\n setFailedSpec(target)\n setInstallError(reasonText)\n setError(t('failed', { reason: reasonText }))\n } finally {\n busyRef.current = false\n setBusy(undefined)\n }\n })()\n }\n\n /** Poll install/update progress while such an operation is in flight. */\n useEffect(() => {\n if (busy === undefined || (busy.kind !== 'install' && busy.kind !== 'update')) {\n setProgress({ kind: 'idle', stage: 'fetch' })\n return\n }\n let stopped = false\n let timer: ReturnType<typeof setTimeout> | undefined\n const tick = (delay: number): void => {\n timer = setTimeout(() => {\n void status().then(next => {\n if (!stopped && next !== undefined) {\n setProgress(next)\n tick(400)\n }\n }).catch(() => { /* status polling fails silently; the operation itself owns the error row */ })\n }, delay)\n }\n tick(100)\n return () => {\n stopped = true\n if (timer !== undefined) clearTimeout(timer)\n }\n }, [busy, status])\n\n const toggleDisabled = busy !== undefined || toggleBusy !== undefined\n || (view.status === 'ready' && view.failures.safeMode)\n\n const onUserToggle = (id: string, enabled: boolean): void => {\n setToggleBusy({ kind: 'user', id })\n setError(undefined)\n void setEnabled(id, enabled).then(plugin => {\n setView(current => current.status === 'ready'\n ? { ...current, plugins: current.plugins.map(item => item.id === id ? plugin : item) }\n : current)\n setDirty(true)\n setToggleBusy(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setToggleBusy(undefined)\n })\n }\n\n const onProductToggle = (id: string, enabled: boolean): void => {\n setToggleBusy({ kind: 'product', id })\n setError(undefined)\n void controlsSetEnabled(id, enabled).then(controls => {\n setView(current => current.status === 'ready' ? { ...current, controls } : current)\n setConflicts(previous => previous.filter(change => change.id !== id))\n setDirty(true)\n setToggleBusy(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setToggleBusy(undefined)\n })\n }\n\n const onCheck = (): void => {\n void run({ kind: 'check' }, async () => {\n const found = await checkUpdates()\n setUpdates(new Map(found.map(item => [item.id, item])))\n })\n }\n\n const onUpdate = (id: string): void => {\n void run({ kind: 'update', id }, async () => {\n await update(id)\n setUpdates(previous => {\n const next = new Map(previous)\n next.delete(id)\n return next\n })\n await reload()\n })\n }\n\n const onUninstall = (): void => {\n const target = uninstallTarget\n if (target === undefined) return\n void run({ kind: 'uninstall', id: target.id }, async () => {\n await uninstall(target.id)\n setUninstallTarget(undefined)\n await reload()\n })\n }\n\n /** Open a repair conversation seeded with one boot-failure record. `token`\n * identifies the row for the in-flight label (plugin id, or a row key for\n * unattributable failures). */\n const onRepair = (failure: PluginFailureItem, token: string): void => {\n if (view.status !== 'ready' || busy !== undefined || repairing !== undefined) return\n setError(undefined)\n setRepairing(token)\n void repairPlugin(view.failures.pluginRoot, failureRepairMessage(failure, repairCopy(t))).then(() => {\n setRepairing(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setRepairing(undefined)\n })\n }\n\n /** Hand the latest failed install off to a repair conversation over the\n * install root. The seed carries the install's own error (installError), not\n * whatever error the row currently shows. */\n const onRepairInstall = (): void => {\n if (view.status !== 'ready' || repairing !== undefined) return\n setError(undefined)\n setRepairing('install')\n void repairPlugin(view.failures.pluginRoot, installRepairMessage(failedSpec ?? '', installError ?? '', repairCopy(t))).then(() => {\n setError(undefined)\n setFailedSpec(undefined)\n setInstallError(undefined)\n setRepairing(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setRepairing(undefined)\n })\n }\n\n /** Copy a boot failure's message and stack for a manual repair conversation. */\n const onCopy = (failure: PluginFailureItem, token: string): void => {\n void navigator.clipboard.writeText(`${failure.message}\\n\\n${failure.stack}`).then(() => {\n setCopied(token)\n }).catch(() => {\n setError(t('failed', { reason: 'clipboard unavailable' }))\n })\n }\n\n const onExitSafeMode = (): void => {\n if (busy !== undefined) return\n setError(undefined)\n void setSafeMode(false).then(() => {\n setDirty(true)\n void reload().catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n })\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n })\n }\n\n /** Undo one conflict action by flipping the product switch back. */\n const onUndoConflict = (change: ControlChange): void => {\n if (change.to !== 'disabled') return\n onProductToggle(change.id, true)\n }\n\n /** Hand one conflict notice off to a repair conversation over the plugin root. */\n const onRepairConflict = (change: ControlChange): void => {\n if (view.status !== 'ready' || busy !== undefined || repairing !== undefined) return\n setError(undefined)\n const token = `conflict:${change.id}`\n setRepairing(token)\n void repairPlugin(view.failures.pluginRoot, conflictRepairMessage({\n id: change.id,\n name: change.name,\n from: change.from === 'enabled' || change.from === 'disabled' ? change.from : 'uninstalled',\n to: change.to === 'enabled' || change.to === 'disabled' ? change.to : 'uninstalled',\n }, repairCopy(t))).then(() => {\n setRepairing(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setRepairing(undefined)\n })\n }\n\n if (!isLoopback) {\n return (\n <div className={css.notice}>\n <strong>{t('localOnlyTitle')}</strong>\n <p>{t('localOnlyBody')}</p>\n </div>\n )\n }\n if (view.status === 'loading') return <div className={css.state}>{t('loading')}</div>\n if (view.status === 'error') return <div className={css.state}>{t('failed', { reason: 'load' })}</div>\n\n const attributable = new Map(view.failures.items.filter(item => item.pluginId !== '').map(item => [item.pluginId, item]))\n const unattributable = view.failures.items.filter(item => item.pluginId === '')\n\n return (\n <div className={css.section} aria-busy={busy !== undefined || toggleBusy !== undefined}>\n {view.failures.safeMode && (\n <div className={css.safeModeBanner} data-safe-mode>\n <p>{t('safeModeBanner')}</p>\n <Button variant=\"primary\" disabled={busy !== undefined} onClick={onExitSafeMode}>\n {t('exitSafeMode')}\n </Button>\n </div>\n )}\n\n <div className={css.installRow}>\n <input\n className={css.spec}\n type=\"text\"\n value={spec}\n placeholder={t('installPlaceholder')}\n disabled={busy !== undefined}\n onChange={event => { setSpec(event.target.value) }}\n onKeyDown={event => {\n if (event.key === 'Enter' && spec.trim() !== '' && busy === undefined) onInstall()\n }}\n />\n <Button\n variant=\"primary\"\n disabled={spec.trim() === '' || busy !== undefined}\n onClick={onInstall}\n >\n {busy !== undefined && busy.kind === 'install' ? t('installing') : t('install')}\n </Button>\n </div>\n <p className={css.hint}>{t('installHint')}</p>\n\n {(busy?.kind === 'install' || busy?.kind === 'update') && (\n <div className={css.progressRow} role=\"status\">\n <div className={css.progressTrack}>\n <div\n className={css.progressBar}\n style={progress.percent === undefined ? undefined : { width: `${progress.percent}%` }}\n data-indeterminate={progress.percent === undefined ? 'true' : undefined}\n />\n </div>\n <p className={css.progressLabel}>{progressLabel(progress, t)}</p>\n </div>\n )}\n\n {error !== undefined && (\n <div className={css.errorRow}>\n <span className={css.error}>{error}</span>\n {failedSpec !== undefined && (\n <Button variant=\"outline\" disabled={repairing !== undefined} onClick={onRepairInstall}>\n {repairing === 'install' ? t('repairing') : t('repair')}\n </Button>\n )}\n </div>\n )}\n\n {conflicts.length > 0 && (\n <div className={css.conflicts}>\n <h3 className={css.sectionTitle}>{t('conflictTitle')}</h3>\n <ul className={css.list}>\n {conflicts.map(change => (\n <li key={change.id} className={css.row} data-conflict={change.id}>\n <div className={css.meta}>\n <span className={css.name}>{change.name}</span>\n <span className={css.sub}>\n {classifyChange(change) === 'rule-disabled'\n ? t('conflictDisabled', { name: change.name })\n : classifyChange(change) === 'rule-enabled'\n ? t('conflictEnabled', { name: change.name })\n : t('conflictChanged', { name: change.name })}\n </span>\n </div>\n <div className={css.actions}>\n {change.to === 'disabled' && (\n <Button\n variant=\"outline\"\n disabled={toggleDisabled}\n onClick={() => { onUndoConflict(change) }}\n >\n {t('undoConflict')}\n </Button>\n )}\n <Button\n variant=\"outline\"\n disabled={busy !== undefined || repairing !== undefined}\n onClick={() => { onRepairConflict(change) }}\n >\n {repairing === `conflict:${change.id}` ? t('repairing') : t('repair')}\n </Button>\n </div>\n </li>\n ))}\n </ul>\n <p className={css.hint}>{t('conflictHint')}</p>\n </div>\n )}\n\n <div className={css.group}>\n <h3 className={css.sectionTitle}>{t('userPlugins')}</h3>\n {view.plugins.length === 0\n ? <p className={css.empty}>{t('empty')}</p>\n : (\n <ul className={css.list}>\n {view.plugins.map(plugin => {\n const updateItem = updates.get(plugin.id)\n const latest = updateItem?.latest\n const dshRequirement = updateItem?.requiresDsh\n const failure = attributable.get(plugin.id)\n return (\n <li key={plugin.id} className={css.row} data-plugin-id={plugin.id}>\n <div className={css.meta}>\n <span className={css.name}>{plugin.name}</span>\n <span className={css.sub}>\n <span className={css.version}>{t('version', { version: plugin.version })}</span>\n <span className={css.sourceBadge} data-source={plugin.source.kind}>\n {plugin.source.kind === 'npm' ? t('npmSource') : t('gitSource')}\n </span>\n <span className={css.specText} title={plugin.source.spec}>{plugin.source.spec}</span>\n </span>\n {latest !== undefined && <span className={css.latest}>{t('latest', { version: latest })}</span>}\n {updateItem !== undefined && dshRequirement !== undefined && (\n <span className={updateItem.compatible === false ? css.compatBlocked : css.compatHint}>\n {updateItem.compatible === false\n ? t('updateBlockedDsh', { min: displayMinimumVersion(dshRequirement) })\n : t('updateRequiresDsh', { min: displayMinimumVersion(dshRequirement) })}\n </span>\n )}\n {failure !== undefined && (\n <div className={css.failure} data-plugin-failure={plugin.id}>\n <span className={css.badge}>{t('failureBadge')}</span>\n <span className={css.failureMessage} title={failure.message}>{failure.message}</span>\n <div className={css.failureActions}>\n <Button\n variant=\"primary\"\n disabled={busy !== undefined || repairing !== undefined}\n onClick={() => { onRepair(failure, plugin.id) }}\n >\n {repairing === plugin.id ? t('repairing') : t('repair')}\n </Button>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={() => { onCopy(failure, plugin.id) }}>\n {copied === plugin.id ? t('copied') : t('copyError')}\n </Button>\n </div>\n </div>\n )}\n </div>\n <div className={css.actions}>\n <span className={css.stateLabel} data-state={plugin.enabled ? 'enabled' : 'disabled'}>\n {plugin.enabled ? t('enabled') : t('disabled')}\n </span>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={plugin.enabled}\n aria-label={plugin.enabled ? t('disableSwitch', { name: plugin.name }) : t('enableSwitch', { name: plugin.name })}\n className={css.switch}\n disabled={toggleDisabled}\n onClick={() => { onUserToggle(plugin.id, !plugin.enabled) }}\n />\n {latest !== undefined && (\n <Button\n variant=\"outline\"\n disabled={busy !== undefined || updateItem?.compatible === false}\n onClick={() => { onUpdate(plugin.id) }}\n >\n {busy?.kind === 'update' && busy.id === plugin.id ? t('updating') : t('update')}\n </Button>\n )}\n <Button\n variant=\"outline\"\n disabled={busy !== undefined}\n onClick={() => { setUninstallTarget({ id: plugin.id, name: plugin.name }) }}\n >\n {t('uninstall')}\n </Button>\n </div>\n </li>\n )\n })}\n </ul>\n )}\n </div>\n\n {view.controls.length > 0 && (\n <div className={css.group}>\n <h3 className={css.sectionTitle}>{t('products')}</h3>\n <ul className={css.list}>\n {view.controls.map(control => (\n <li key={control.id} className={css.row} data-product-id={control.id}>\n <div className={css.meta}>\n <span className={css.name}>{control.name}</span>\n <span className={css.sub}>\n <a className={css.link} href={control.repository} target=\"_blank\" rel=\"noreferrer\">{t('source')}</a>\n </span>\n </div>\n <div className={css.actions}>\n <span className={css.stateLabel} data-state={control.state}>\n {t(control.state)}\n </span>\n {control.state === 'enabled' || control.state === 'disabled'\n ? (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={control.state === 'enabled'}\n aria-label={control.state === 'enabled'\n ? t('disableSwitch', { name: control.name })\n : t('enableSwitch', { name: control.name })}\n className={css.switch}\n disabled={toggleDisabled}\n onClick={() => { onProductToggle(control.id, control.state !== 'enabled') }}\n />\n )\n : null}\n </div>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {unattributable.length > 0 && (\n <div className={css.group}>\n <h3 className={css.sectionTitle}>{t('failureGroupTitle')}</h3>\n <ul className={css.list}>\n {unattributable.map((failure, index) => {\n const token = `other:${index}`\n return (\n <li key={`${failure.at}-${index}`} className={css.row} data-plugin-failure=\"other\">\n <div className={css.meta}>\n <span className={css.badge}>{t('failureBadge')}</span>\n <span className={css.failureMessage} title={failure.message}>{failure.message}</span>\n <div className={css.failureActions}>\n <Button\n variant=\"primary\"\n disabled={busy !== undefined || repairing !== undefined}\n onClick={() => { onRepair(failure, token) }}\n >\n {repairing === token ? t('repairing') : t('repair')}\n </Button>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={() => { onCopy(failure, token) }}>\n {copied === token ? t('copied') : t('copyError')}\n </Button>\n </div>\n </div>\n </li>\n )\n })}\n </ul>\n </div>\n )}\n\n <div className={css.actionsRow}>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={onCheck}>\n {busy?.kind === 'check' ? t('checking') : t('checkUpdates')}\n </Button>\n {updates.size === 0 && busy === undefined && view.plugins.length > 0 && (\n <p className={css.ok}>{t('noUpdates')}</p>\n )}\n </div>\n\n {toggleBusy !== undefined && <p className={css.applying} aria-live=\"polite\">{t('applying')}</p>}\n\n {dirty && (\n <div className={css.restartRow}>\n <p>{t('restartHint')}</p>\n </div>\n )}\n\n <Modal\n title={t('uninstallConfirmTitle')}\n open={uninstallTarget !== undefined}\n onClose={() => { setUninstallTarget(undefined) }}\n >\n <p className={css.confirmBody}>{t('uninstallConfirmBody', { name: uninstallTarget?.name ?? '' })}</p>\n <div className={css.modalActions}>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={() => { setUninstallTarget(undefined) }}>\n {t('cancel')}\n </Button>\n <Button variant=\"primary\" className={css.dangerButton} disabled={busy !== undefined} onClick={onUninstall}>\n {t('confirm')}\n </Button>\n </div>\n </Modal>\n </div>\n )\n}\n","/**\n * Locale dictionaries for the plugin-manager tab. The zh dictionary is the\n * key source; the en dictionary mirrors the exact key set.\n * @module @linxin666/dsh-client-ui-plugin-manager/client\n */\n\n/** Simplified Chinese copy (the key-set source of truth). */\nconst STATIC_ZH = {\n tab: '插件管理',\n loading: '正在读取插件…',\n empty: '尚未安装任何用户插件。',\n userPlugins: '用户插件',\n products: '内置产品',\n conflictTitle: '安装冲突',\n conflictDisabled: '已自动禁用 {name},避免重复挂载。',\n conflictEnabled: '已重新启用 {name}。',\n conflictChanged: '{name} 的状态已变更。',\n undoConflict: '撤销',\n conflictHint: '冲突动作在安装时自动执行,撤销会写回开关并在重启后生效。',\n installPlaceholder: 'npm 包名(如 @scope/name)或 git 仓库 URL',\n install: '安装',\n installing: '安装中…',\n installHint: '在 GitHub 或 npm 找到插件后,粘贴其 npm 包名或仓库地址安装;应用重启后插件生效。',\n version: '已安装 {version}',\n latest: '最新 {version}',\n update: '更新',\n updating: '更新中…',\n checkUpdates: '检查更新',\n checking: '检查中…',\n noUpdates: '所有插件都是最新版本。',\n updateRequiresDsh: '需要 DSH ≥ {min}',\n updateBlockedDsh: '需要 DSH ≥ {min},请先升级 DSH 再更新',\n uninstall: '卸载',\n uninstallConfirmTitle: '卸载插件',\n uninstallConfirmBody: '将删除 {name} 的安装目录与配置行,并在重启后生效。',\n confirm: '确认卸载',\n cancel: '取消',\n restartHint: '插件变更将在重启应用后生效。',\n failed: '操作失败:{reason}',\n enabled: '已开启',\n disabled: '已关闭',\n mixed: '部分开启',\n unavailable: '不可用',\n uninstalled: '已卸载',\n source: '查看源码',\n applying: '正在应用更改…',\n fetching: '正在获取插件信息…',\n downloading: '正在下载…',\n downloadingPercent: '正在下载 {percent}%',\n extracting: '正在解压…',\n writing: '正在写入配置…',\n localOnlyTitle: '仅限本机操作',\n localOnlyBody: '为了保护主机配置,插件管理只能从本机打开。',\n failureBadge: '启动失败',\n failureGroupTitle: '其他启动失败',\n repair: '让 Agent 修复',\n repairing: '正在创建修复对话…',\n copyError: '复制错误',\n copied: '已复制',\n safeModeBanner: '安全模式:用户插件配置已跳过,插件开关不可用。',\n exitSafeMode: '恢复正常模式并重启',\n npmSource: 'npm',\n gitSource: 'git',\n enableSwitch: '开启 {name}',\n disableSwitch: '关闭 {name}',\n repairInstallTitle: '插件安装失败,请帮我诊断并修复。',\n repairInstallSpecLabel: '安装目标',\n repairInstallErrorLabel: '错误信息',\n repairInstallAsk: '请检查该插件并重新安装;完成后告诉我结果。',\n repairFailureTitle: '插件上次启动失败。请修复它。',\n repairFailurePluginLabel: '插件',\n repairFailureKindLabel: '失败类型',\n repairFailureAtLabel: '时间',\n repairFailureMessageLabel: '失败详情',\n repairFailureStackLabel: '原始堆栈',\n repairFailurePathLabel: '插件安装目录',\n repairFailureAsk: '请检查并修复该插件;修复完成后告诉我如何重新启用。',\n repairKindLoad: '加载失败',\n repairKindHang: '启动挂起',\n repairKindLate: '迟到拒绝',\n repairConflictTitle: '正在处理插件安装冲突',\n repairConflictPluginLabel: '冲突条目',\n repairConflictChangeLabel: '状态变化',\n repairConflictAsk: '请检查冲突双方的入口行 id 与挂载方式,消除重复挂载后告诉我如何重新启用。',\n repairStateEnabled: '已开启',\n repairStateDisabled: '已关闭',\n repairStateUninstalled: '已卸载',\n} satisfies Record<string, string>\n\n/** English copy, checked complete against the zh key set. */\nconst STATIC_EN = {\n tab: 'Plugin manager',\n loading: 'Reading plugins…',\n empty: 'No user plugins installed yet.',\n userPlugins: 'User plugins',\n products: 'Built-in products',\n conflictTitle: 'Install conflicts',\n conflictDisabled: 'Automatically disabled {name} to avoid double mounting.',\n conflictEnabled: 'Re-enabled {name}.',\n conflictChanged: 'The state of {name} changed.',\n undoConflict: 'Undo',\n conflictHint: 'Conflict actions run automatically at install time; undoing writes the switch back and applies after a restart.',\n installPlaceholder: 'npm package (e.g. @scope/name) or git repository URL',\n install: 'Install',\n installing: 'Installing…',\n installHint: 'Find a plugin on GitHub or npm, then paste its npm package name or repository URL; plugins load after a restart.',\n version: 'Installed {version}',\n latest: 'Latest {version}',\n update: 'Update',\n updating: 'Updating…',\n checkUpdates: 'Check for updates',\n checking: 'Checking…',\n noUpdates: 'All plugins are up to date.',\n updateRequiresDsh: 'Requires DSH >= {min}',\n updateBlockedDsh: 'Requires DSH >= {min}; upgrade DSH before updating',\n uninstall: 'Uninstall',\n uninstallConfirmTitle: 'Uninstall plugin',\n uninstallConfirmBody: '{name} and its configuration row will be removed; the change applies after a restart.',\n confirm: 'Uninstall',\n cancel: 'Cancel',\n restartHint: 'Plugin changes take effect after restarting the application.',\n failed: 'Operation failed: {reason}',\n enabled: 'On',\n disabled: 'Off',\n mixed: 'Partially on',\n unavailable: 'Unavailable',\n uninstalled: 'Uninstalled',\n source: 'View source',\n applying: 'Applying change…',\n fetching: 'Fetching plugin metadata…',\n downloading: 'Downloading…',\n downloadingPercent: 'Downloading {percent}%',\n extracting: 'Extracting…',\n writing: 'Writing configuration…',\n localOnlyTitle: 'Available on this computer only',\n localOnlyBody: 'To protect host configuration, plugin management is only available from a local browser.',\n failureBadge: 'Startup failure',\n failureGroupTitle: 'Other startup failures',\n repair: 'Ask the agent to fix',\n repairing: 'Opening repair conversation…',\n copyError: 'Copy error',\n copied: 'Copied',\n safeModeBanner: 'Safe mode: user plugin configuration is skipped; plugin switches are disabled.',\n exitSafeMode: 'Restore normal mode and restart',\n npmSource: 'npm',\n gitSource: 'git',\n enableSwitch: 'Turn on {name}',\n disableSwitch: 'Turn off {name}',\n repairInstallTitle: 'The plugin installation failed. Please diagnose and fix it.',\n repairInstallSpecLabel: 'Install target',\n repairInstallErrorLabel: 'Error message',\n repairInstallAsk: 'Please inspect the plugin and reinstall it; tell me when it is done.',\n repairFailureTitle: 'A plugin failed to start last time. Please fix it.',\n repairFailurePluginLabel: 'Plugin',\n repairFailureKindLabel: 'Failure kind',\n repairFailureAtLabel: 'At',\n repairFailureMessageLabel: 'Failure details',\n repairFailureStackLabel: 'Original stack',\n repairFailurePathLabel: 'Plugin install directory',\n repairFailureAsk: 'Please inspect and fix the plugin; tell me how to re-enable it afterwards.',\n repairKindLoad: 'Load failure',\n repairKindHang: 'Startup hang',\n repairKindLate: 'Late rejection',\n repairConflictTitle: 'Handling a plugin install conflict',\n repairConflictPluginLabel: 'Conflicting entry',\n repairConflictChangeLabel: 'State change',\n repairConflictAsk: 'Inspect the entry ids and mounting of both sides, resolve the double mount, and tell me how to re-enable.',\n repairStateEnabled: 'On',\n repairStateDisabled: 'Off',\n repairStateUninstalled: 'Uninstalled',\n} satisfies Record<keyof typeof STATIC_ZH, string>\n\nexport const zh = STATIC_ZH\nexport const en = STATIC_EN\nexport type PluginManagerKey = keyof typeof STATIC_ZH\n","/**\n * Wire parsing for the official plugin-installer / plugin-control RPC\n * channels. This package is a browser-side consumer of those channels: every\n * response is decoded but untrusted, so each parser validates the shape it\n * needs and throws a typed error on mismatch. Callers treat a parse failure\n * as \"channel unavailable or drifted\" and degrade to command hints.\n *\n * The shapes mirror the official web installer tab's wire protocol (see the\n * DSH checkout's packages/client/ui-settings-plugin-installer/src/client/\n * protocol.ts); they are a contract observation, not an import.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\n/** One installed user-plugin row served by `/plugin-installer list`. */\nexport interface InstalledPluginItem {\n id: string\n name: string\n version: string\n source: { kind: 'npm' | 'git'; spec: string }\n installedAt: string\n /** Saved next-start enablement from the managed profile patch row. */\n enabled: boolean\n commit?: string\n}\n\n/** Point-in-time install/update progress reported by the host. */\nexport interface InstallProgressItem {\n kind: 'idle' | 'install' | 'update'\n stage: 'fetch' | 'download' | 'extract' | 'write'\n percent?: number\n}\n\n/** Whether an update row is a normal same-name update or a legacy package migration. */\nexport type PluginUpdateKind = 'update' | 'migrate'\n\n/** One plugin with a newer version available. */\nexport interface PluginUpdateItem {\n id: string\n current: string\n latest: string\n /** Normal same-name update or legacy aggregate migration. Defaults to update. */\n kind?: PluginUpdateKind\n /** Target package name when kind is migrate. */\n target?: string\n /** Exact target package version when kind is migrate. */\n targetVersion?: string\n /** Declared DSH minimum the update needs (package manifest's `dsh.engines.dsh`). */\n requiresDsh?: string\n /** Whether the running DSH host satisfies requiresDsh; absent when unknown. */\n compatible?: boolean\n}\n\n/** One recorded plugin boot failure served by the host. */\nexport interface PluginFailureItem {\n /** Installed plugin id (package name); empty for unattributable failures. */\n pluginId: string\n kind: 'load-failure' | 'hang' | 'late-rejection'\n message: string\n stack: string\n installPath: string\n at: string\n}\n\n/** Recovery facts served by the host: the failure ring, the plugin root, and safe mode. */\nexport interface PluginFailuresSnapshot {\n items: PluginFailureItem[]\n /** Absolute plugin install root — the repair conversation's workspace. */\n pluginRoot: string\n /** Whether the host is running in safe mode (user plugins skipped). */\n safeMode: boolean\n}\n\n/** One deployment-configured logical product switch. */\nexport interface PluginControlItem {\n id: string\n name: string\n repository: string\n state: 'enabled' | 'disabled' | 'mixed' | 'unavailable' | 'uninstalled'\n}\n\n/** Whether a decoded value is a non-array object. */\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\n/** Whether a decoded value is a string. */\nfunction isString(value: unknown): value is string {\n return typeof value === 'string'\n}\n\n/** Validate one installed-plugin row. */\nfunction parsePlugin(value: unknown, index: number): InstalledPluginItem {\n if (!isRecord(value) || !isString(value.id) || !isString(value.name)\n || !isString(value.version) || !isString(value.installedAt)\n || typeof value.enabled !== 'boolean'\n || !isRecord(value.source) || (value.source.kind !== 'npm' && value.source.kind !== 'git')\n || !isString(value.source.spec)) {\n throw new Error(`plugin-manager: plugin row ${String(index)} is invalid`)\n }\n return {\n id: value.id,\n name: value.name,\n version: value.version,\n source: { kind: value.source.kind, spec: value.source.spec },\n installedAt: value.installedAt,\n enabled: value.enabled,\n ...isString(value.commit) ? { commit: value.commit } : {},\n }\n}\n\n/**\n * Validate and normalize a `list` / `uninstall` response value.\n * @param value - decoded but untrusted response value.\n * @returns typed installed-plugin rows.\n */\nexport function parsePluginList(value: unknown): InstalledPluginItem[] {\n if (!isRecord(value) || !Array.isArray(value.plugins)) {\n throw new Error('plugin-manager: response must contain a plugins array')\n }\n return value.plugins.map((plugin, index) => parsePlugin(plugin, index))\n}\n\n/**\n * Validate and normalize an `install` / `update` / `set-enabled` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed installed-plugin row.\n */\nexport function parseInstalledPlugin(value: unknown): InstalledPluginItem {\n if (!isRecord(value) || value.plugin === undefined) {\n throw new Error('plugin-manager: response must contain a plugin row')\n }\n return parsePlugin(value.plugin, 0)\n}\n\n/**\n * Validate and normalize a plugin-control `list` / `set-enabled` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed control items.\n */\nexport function parsePluginControlSnapshot(value: unknown): PluginControlItem[] {\n if (!isRecord(value) || !Array.isArray(value.controls)) {\n throw new Error('plugin-manager: response must contain a controls array')\n }\n return value.controls.map((control, index) => {\n if (!isRecord(control) || !isString(control.id) || !isString(control.name)\n || !isString(control.repository)\n || (control.state !== 'enabled' && control.state !== 'disabled'\n && control.state !== 'mixed' && control.state !== 'unavailable'\n && control.state !== 'uninstalled')) {\n throw new Error(`plugin-manager: control row ${String(index)} is invalid`)\n }\n return {\n id: control.id,\n name: control.name,\n repository: control.repository,\n state: control.state,\n }\n })\n}\n\n/**\n * Validate and normalize a `status` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed progress state.\n */\nexport function parseInstallStatus(value: unknown): InstallProgressItem {\n if (!isRecord(value) || !isRecord(value.progress)\n || (value.progress.kind !== 'idle' && value.progress.kind !== 'install' && value.progress.kind !== 'update')\n || (value.progress.stage !== 'fetch' && value.progress.stage !== 'download'\n && value.progress.stage !== 'extract' && value.progress.stage !== 'write')\n || (value.progress.percent !== undefined\n && (typeof value.progress.percent !== 'number' || !Number.isFinite(value.progress.percent)))) {\n throw new Error('plugin-manager: response must contain a valid progress state')\n }\n return {\n kind: value.progress.kind,\n stage: value.progress.stage,\n ...typeof value.progress.percent === 'number' ? { percent: value.progress.percent } : {},\n }\n}\n\n/**\n * Validate and normalize a `check-updates` response value.\n * @param value - decoded but untrusted response value.\n * @returns typed update rows.\n */\nexport function parseUpdateList(value: unknown): PluginUpdateItem[] {\n if (!isRecord(value) || !Array.isArray(value.updates)) {\n throw new Error('plugin-manager: response must contain an updates array')\n }\n return value.updates.map((update, index) => {\n if (!isRecord(update) || !isString(update.id) || !isString(update.current) || !isString(update.latest)) {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n const kind = update.kind === undefined ? 'update' : update.kind\n if (kind !== 'update' && kind !== 'migrate') {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n const row: PluginUpdateItem = { id: update.id, current: update.current, latest: update.latest }\n if (kind === 'migrate') {\n if (!isString(update.target) || !isString(update.targetVersion)) {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n row.kind = 'migrate'\n row.target = update.target\n row.targetVersion = update.targetVersion\n }\n if (update.requiresDsh !== undefined) {\n if (!isString(update.requiresDsh)) {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n row.requiresDsh = update.requiresDsh\n }\n if (update.compatible !== undefined) {\n if (typeof update.compatible !== 'boolean') {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n row.compatible = update.compatible\n }\n return row\n })\n}\n\n/**\n * Validate and normalize a `failures` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed failures snapshot.\n */\nexport function parseFailuresSnapshot(value: unknown): PluginFailuresSnapshot {\n if (!isRecord(value) || !Array.isArray(value.items)\n || !isString(value.pluginRoot) || typeof value.safeMode !== 'boolean') {\n throw new Error('plugin-manager: response must contain a failures snapshot')\n }\n return {\n items: value.items.map((item, index) => {\n if (!isRecord(item) || !isString(item.pluginId)\n || (item.kind !== 'load-failure' && item.kind !== 'hang' && item.kind !== 'late-rejection')\n || !isString(item.message) || !isString(item.stack)\n || !isString(item.installPath) || !isString(item.at)) {\n throw new Error(`plugin-manager: failure row ${String(index)} is invalid`)\n }\n return {\n pluginId: item.pluginId,\n kind: item.kind,\n message: item.message,\n stack: item.stack,\n installPath: item.installPath,\n at: item.at,\n }\n }),\n pluginRoot: value.pluginRoot,\n safeMode: value.safeMode,\n }\n}\n","/**\n * The cordis service contract this package exposes to sibling client plugins\n * under the name `'pluginManager'`. The browser half builds one dual-channel\n * face (official /plugin-installer + /plugin-control RPC channels when\n * available, else this package's loopback HTTP gateway) and provides it via\n * `ctx.provide('pluginManager', face)`; consumers resolve it with\n * `ctx.inject(['pluginManager'], cb)` and read `ctx.pluginManager`.\n *\n * The interface is intentionally narrower than the face the Plugin manager\n * tab receives (`PluginManagerFace` in the client half): it is the stable\n * cross-plugin surface, so it only carries the operations a sibling plugin\n * needs to observe and drive the installed-plugin set.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\nimport type { InstallProgressItem, InstalledPluginItem, PluginFailuresSnapshot } from './protocol.ts'\n\n/** The cordis service name the browser half provides the face under. */\nexport const PLUGIN_MANAGER_SERVICE = 'pluginManager'\n\n/**\n * The dual-channel plugin-management face, shared between the Plugin manager\n * tab and sibling client plugins.\n */\nexport interface PluginManagerService {\n /** Whether this browser has loopback authority to use the host routes. */\n readonly isLoopback: boolean\n /** Read the installed snapshot. */\n list(): Promise<InstalledPluginItem[]>\n /** Install one plugin from an npm spec or git URL. */\n install(spec: string): Promise<InstalledPluginItem>\n /** Remove one plugin. */\n uninstall(id: string): Promise<InstalledPluginItem[]>\n /** Read the current install/update progress. */\n status(): Promise<InstallProgressItem>\n /**\n * Read the recorded plugin boot-failure ring (plugin id, message, stack,\n * install path). On runtimes without a failure ring the host answers an\n * empty snapshot.\n */\n failures(): Promise<PluginFailuresSnapshot>\n /**\n * Flip one plugin's next-start enablement through the active channel (the\n * official installer RPC when available, else the loopback gateway's patch\n * `disabled` override row). The change takes effect after the host restart;\n * a running plugin is not stopped.\n */\n setEnabled(id: string, enabled: boolean): Promise<InstalledPluginItem>\n /**\n * Subscribe to successful mutations: the callback runs after install(),\n * update(), uninstall(), or setEnabled() resolves. One listener throwing\n * never breaks the others. Returns the unsubscribe function.\n */\n onChange(cb: () => void): () => void\n}\n\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n /** The plugin-manager face (provided by the dsh-plugin-manager client half). */\n pluginManager: PluginManagerService\n }\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/telemetry.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Anonymous install telemetry shared by the DSH Web UI family plugins.\n *\n * Once per UTC day per browser, each wired plugin sends one heartbeat to\n * the dsh-market edge API listing its package name (and version when known).\n * The payload carries no conversation data and no identifiers beyond a random\n * UUID generated in localStorage; the server hashes it with a deployment salt\n * before storage and never persists IP addresses. Sends are fire-and-forget:\n * failures stay silent and simply retry on a later mount or day. The system\n * is documented in docs/telemetry.md.\n */\n\nexport type TelemetryChannel = 'market' | 'npm' | 'unknown'\n\nexport interface TelemetryItem {\n /** npm package name or asset id, e.g. \"@linxin666/dsh-pet\" or \"skin:harbor\". */\n name: string\n /** Installed version when known; omitted otherwise. */\n version?: string\n /** Install channel when determinable (market = Workshop install). */\n channel?: TelemetryChannel\n}\n\nconst VISITOR_KEY = 'dsh-web-ui-telemetry-visitor'\nconst DAY_KEY_PREFIX = 'dsh-web-ui-telemetry-day:'\nconst ENDPOINT = 'https://dsh-market.com/api/telemetry/event'\n\n// Baked into each client bundle by shared/tsdown.client.ts (the package's own\n// package.json version at build time). Undefined in dev/test builds.\ndeclare const __DSH_PKG_VERSION__: string | undefined\n\n/** The building package's version, when the bundle carries it. */\nfunction bakedVersion(): string | undefined {\n try {\n return typeof __DSH_PKG_VERSION__ === 'string' && __DSH_PKG_VERSION__ !== ''\n ? __DSH_PKG_VERSION__\n : undefined\n } catch {\n return undefined\n }\n}\n\n/** Read or lazily create the anonymous visitor id; null when storage is unavailable. */\nfunction visitorId(): string | null {\n try {\n const existing = localStorage.getItem(VISITOR_KEY)\n if (existing && /^[A-Za-z0-9_-]{16,64}$/.test(existing)) return existing\n const fresh = crypto.randomUUID().replaceAll('-', '')\n localStorage.setItem(VISITOR_KEY, fresh)\n return fresh\n } catch {\n // Storage unavailable (privacy mode, sandboxed frame): report nothing.\n return null\n }\n}\n\n/** Drop stale per-day dedup keys so localStorage does not grow forever. */\nfunction pruneDayKeys(today: string): void {\n try {\n for (let index = localStorage.length - 1; index >= 0; index -= 1) {\n const key = localStorage.key(index)\n if (key !== null && key.startsWith(DAY_KEY_PREFIX) && key !== DAY_KEY_PREFIX + today) {\n localStorage.removeItem(key)\n }\n }\n } catch { /* best effort */ }\n}\n\n/**\n * Fire the daily heartbeat for the given items at most once per UTC day per\n * browser. Never throws and never blocks the caller. Items without an explicit\n * version inherit the bundle's baked build version.\n */\nexport function reportDailyHeartbeat(items: readonly TelemetryItem[]): void {\n try {\n if (items.length === 0) return\n const today = new Date().toISOString().slice(0, 10)\n // Automation contexts (CDP-driven QA browsers, fresh isolated profiles)\n // mint a new visitor id per run and would inflate instance counts.\n if (navigator.webdriver) return\n if (localStorage.getItem(DAY_KEY_PREFIX + today) !== null) return\n const visitor = visitorId()\n if (visitor === null) return\n pruneDayKeys(today)\n const payloadItems = items.map((item) => {\n const out: Record<string, string> = { name: item.name }\n const version = item.version ?? bakedVersion()\n if (version !== undefined) out.version = version\n if (item.channel !== undefined) out.channel = item.channel\n return out\n })\n const body = JSON.stringify({ kind: 'heartbeat', visitor, items: payloadItems })\n void fetch(ENDPOINT, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body,\n keepalive: true,\n }).then((response) => {\n // Mark the day only after an accepted send, so offline browsers retry\n // on a later mount instead of going dark until tomorrow.\n if (response.ok) localStorage.setItem(DAY_KEY_PREFIX + today, '1')\n }).catch(() => { /* unreachable endpoint: stay silent */ })\n } catch { /* never break the host UI over telemetry */ }\n}\n","/**\n * Plugin-manager browser half: contributes the family plugin-manager tab to\n * the official Plugins settings section (`settings.plugins.tab` slot) and\n * provides the same dual-channel face as the `'pluginManager'` cordis\n * service for sibling client plugins. It is dual-channel: on runtimes with\n * the official installer services (DSHCode, the 1.0.4 checkout web) every\n * operation rides the official `/plugin-installer` and `/plugin-control`\n * loopback RPC channels (the single writer); on the npm-published web runtime\n * those channels do not exist, so the same face falls back to this package's\n * own loopback HTTP gateway, which spawns the official CLI for writes.\n * Neither the tab nor service consumers know which mode the face runs in.\n * @module @linxin666/dsh-client-ui-plugin-manager/client\n */\n\n// Type-only: pulls the locale plugin's Context merge (ctx.locale).\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the settings surface's slot contracts (settings.plugins.tab).\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\n// Type-only: pulls the client runtime Context merge (ctx.workspaces, ctx.sessions).\nimport type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-client-connection/client'\nimport { PluginManagerTab, type PluginManagerTabInjected } from './PluginManagerTab.tsx'\nimport { en, zh, type PluginManagerKey } from './locales.ts'\nimport {\n parseFailuresSnapshot,\n parseInstallStatus,\n parseInstalledPlugin,\n parsePluginControlSnapshot,\n parsePluginList,\n parseUpdateList,\n type InstalledPluginItem,\n type InstallProgressItem,\n type PluginControlItem,\n type PluginFailuresSnapshot,\n type PluginUpdateItem,\n} from '../core/protocol.ts'\nimport { PLUGIN_MANAGER_SERVICE, type PluginManagerService } from '../core/service.ts'\nimport type { ControlChange } from '../core/conflict.ts'\nimport { reportDailyHeartbeat } from './telemetry.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Copy for the family plugin-manager tab. */\n 'settings.pluginManager': PluginManagerKey\n }\n}\n\nconst NS = 'settings.pluginManager'\nconst CHANNEL = '/plugin-installer'\nconst CONTROL_CHANNEL = '/plugin-control'\nconst LIST_ENDPOINT = 'list'\nconst INSTALL_ENDPOINT = 'install'\nconst UPDATE_ENDPOINT = 'update'\nconst UNINSTALL_ENDPOINT = 'uninstall'\nconst SET_ENABLED_ENDPOINT = 'set-enabled'\nconst CHECK_UPDATES_ENDPOINT = 'check-updates'\nconst STATUS_ENDPOINT = 'status'\nconst FAILURES_ENDPOINT = 'failures'\nconst SET_SAFE_MODE_ENDPOINT = 'set-safe-mode'\n\nconst GATEWAY_PREFIX = '/api/plugin-manager'\n/** Gateway job polling cadence. */\nconst JOB_POLL_MS = 500\n/** Gateway job wait ceiling (the host add deadline is six minutes). */\nconst JOB_WAIT_MS = 7 * 60_000\n\n/** Services required by the slot registration and both channels. */\nexport const inject = ['slots', 'locale', 'connection', 'workspaces', 'sessions']\n\n/** The gateway job wire shape served by /status. */\ninterface GatewayJobWire {\n phase: 'running' | 'done' | 'error'\n plugin?: unknown\n conflicts?: unknown\n error?: string\n}\n\n/**\n * The face the Plugin manager tab and the `'pluginManager'` cordis service\n * share: the full tab surface plus the cross-plugin service contract.\n */\nexport type PluginManagerFace = PluginManagerTabInjected & PluginManagerService\n\n/**\n * Build the dual-channel face once: official-channel and gateway-channel\n * implementations, the mode detection that picks between them, the repair\n * handoff, and the change-notification listener set. The returned face is\n * both the tab's injected props and the value provided as the\n * `'pluginManager'` cordis service.\n * @param ctx - the client context (connection, workspaces, sessions).\n * @returns the shared face.\n */\nexport function createPluginManagerFace(ctx: ClientContext): PluginManagerFace {\n const connection = ctx.get('connection') as ConnectionHandle\n\n // ── official channel implementations ──────────────────────────────────────\n\n const call = async (endpoint: string, payload: unknown): Promise<unknown> => {\n const result = await connection.rpc.call(CHANNEL, endpoint, payload)\n if (!result.ok) {\n throw new Error(`plugin-installer ${endpoint} failed: ${result.error.code}: ${result.error.message}`)\n }\n return result.value\n }\n const official = {\n list: async (): Promise<InstalledPluginItem[]> => parsePluginList(await call(LIST_ENDPOINT, {})),\n install: async (spec: string): Promise<InstalledPluginItem> => parseInstalledPlugin(await call(INSTALL_ENDPOINT, { spec })),\n update: async (id: string): Promise<InstalledPluginItem> => parseInstalledPlugin(await call(UPDATE_ENDPOINT, { id })),\n uninstall: async (id: string): Promise<InstalledPluginItem[]> => parsePluginList(await call(UNINSTALL_ENDPOINT, { id })),\n setEnabled: async (id: string, enabled: boolean): Promise<InstalledPluginItem> =>\n parseInstalledPlugin(await call(SET_ENABLED_ENDPOINT, { id, enabled })),\n checkUpdates: async (): Promise<PluginUpdateItem[]> => parseUpdateList(await call(CHECK_UPDATES_ENDPOINT, {})),\n status: async (): Promise<InstallProgressItem> => parseInstallStatus(await call(STATUS_ENDPOINT, {})),\n failures: async (): Promise<PluginFailuresSnapshot> => parseFailuresSnapshot(await call(FAILURES_ENDPOINT, {})),\n setSafeMode: async (enabled: boolean): Promise<void> => {\n await call(SET_SAFE_MODE_ENDPOINT, { enabled })\n },\n controlsList: async (): Promise<PluginControlItem[]> =>\n parsePluginControlSnapshot(await connection.rpc.call(CONTROL_CHANNEL, 'list', {}).then(result => {\n if (!result.ok) throw new Error(`plugin-control list failed: ${result.error.code}: ${result.error.message}`)\n return result.value\n })),\n controlsSetEnabled: async (pluginId: string, enabled: boolean): Promise<PluginControlItem[]> =>\n parsePluginControlSnapshot(await connection.rpc.call(CONTROL_CHANNEL, 'set-enabled', { pluginId, enabled }).then(result => {\n if (!result.ok) throw new Error(`plugin-control set-enabled failed: ${result.error.code}: ${result.error.message}`)\n return result.value\n })),\n }\n\n // ── gateway channel implementations ──────────────────────────────────────\n\n const gatewayJson = async (path: string, init?: RequestInit): Promise<unknown> => {\n const response = await fetch(path, {\n ...init,\n headers: { 'content-type': 'application/json', ...init?.headers },\n })\n if (response.status === 403) {\n throw new Error('plugin-manager: plugin management is only available from a local browser')\n }\n if (!response.ok) {\n const body = await response.json().catch(() => ({})) as { error?: string }\n throw new Error(body.error ?? `plugin-manager: gateway ${path} failed: HTTP ${String(response.status)}`)\n }\n return response.json()\n }\n\n /** Wait for one gateway job to settle, returning its wire state. */\n const waitJob = async (jobId: string): Promise<GatewayJobWire> => {\n const deadline = Date.now() + JOB_WAIT_MS\n for (;;) {\n const body = await gatewayJson(`${GATEWAY_PREFIX}/status?job=${encodeURIComponent(jobId)}`) as { job?: GatewayJobWire }\n const job = body.job\n if (job === undefined) throw new Error('plugin-manager: gateway job vanished')\n if (job.phase === 'done') return job\n if (job.phase === 'error') throw new Error(job.error ?? 'plugin-manager: gateway job failed')\n if (Date.now() > deadline) throw new Error('plugin-manager: gateway job timed out')\n await new Promise(resolve => { setTimeout(resolve, JOB_POLL_MS) })\n }\n }\n\n /** The conflict ledger of the last settled gateway install. */\n let lastInstallConflicts: ControlChange[] = []\n /** Whether a gateway install/remove is in flight (drives the progress row). */\n let gatewayInflight = false\n\n const gateway = {\n list: async (): Promise<InstalledPluginItem[]> =>\n parsePluginList(await gatewayJson(`${GATEWAY_PREFIX}/list`)),\n install: async (spec: string): Promise<InstalledPluginItem> => {\n gatewayInflight = true\n try {\n const started = await gatewayJson(`${GATEWAY_PREFIX}/install`, {\n method: 'POST',\n body: JSON.stringify({ spec }),\n }) as { jobId?: string }\n if (started.jobId === undefined) throw new Error('plugin-manager: gateway install returned no job')\n const job = await waitJob(started.jobId)\n lastInstallConflicts = Array.isArray(job.conflicts) ? job.conflicts as ControlChange[] : []\n return parseInstalledPlugin({ plugin: job.plugin })\n } finally {\n gatewayInflight = false\n }\n },\n update: async (id: string): Promise<InstalledPluginItem> => {\n gatewayInflight = true\n try {\n const started = await gatewayJson(`${GATEWAY_PREFIX}/update`, {\n method: 'POST',\n body: JSON.stringify({ id }),\n }) as { jobId?: string }\n if (started.jobId === undefined) throw new Error('plugin-manager: gateway update returned no job')\n const job = await waitJob(started.jobId)\n lastInstallConflicts = Array.isArray(job.conflicts) ? job.conflicts as ControlChange[] : []\n return parseInstalledPlugin({ plugin: job.plugin })\n } finally {\n gatewayInflight = false\n }\n },\n uninstall: async (id: string): Promise<InstalledPluginItem[]> => {\n gatewayInflight = true\n try {\n const started = await gatewayJson(`${GATEWAY_PREFIX}/remove`, {\n method: 'POST',\n body: JSON.stringify({ id }),\n }) as { jobId?: string }\n if (started.jobId === undefined) throw new Error('plugin-manager: gateway remove returned no job')\n await waitJob(started.jobId)\n return gateway.list()\n } finally {\n gatewayInflight = false\n }\n },\n setEnabled: async (id: string, enabled: boolean): Promise<InstalledPluginItem> =>\n parseInstalledPlugin(await gatewayJson(`${GATEWAY_PREFIX}/set-enabled`, {\n method: 'POST',\n body: JSON.stringify({ id, enabled }),\n })),\n checkUpdates: async (): Promise<PluginUpdateItem[]> =>\n parseUpdateList(await gatewayJson(`${GATEWAY_PREFIX}/check-updates`)),\n status: async (): Promise<InstallProgressItem> =>\n gatewayInflight ? { kind: 'install', stage: 'download' } : { kind: 'idle', stage: 'fetch' },\n failures: async (): Promise<PluginFailuresSnapshot> =>\n parseFailuresSnapshot(await gatewayJson(`${GATEWAY_PREFIX}/failures`)),\n setSafeMode: async (): Promise<void> => {\n throw new Error('plugin-manager: safe mode is unavailable in this runtime')\n },\n controlsList: async (): Promise<PluginControlItem[]> => [],\n controlsSetEnabled: async (pluginId: string, enabled: boolean): Promise<PluginControlItem[]> => {\n await gateway.setEnabled(pluginId, enabled)\n return []\n },\n }\n\n // ── mode selection ────────────────────────────────────────────────────────\n\n let modePromise: Promise<'official' | 'gateway'> | undefined\n const ensureMode = (): Promise<'official' | 'gateway'> => {\n if (modePromise === undefined) {\n modePromise = (async () => {\n // Prefer the host verdict: the gateway's /mode route reports whether\n // the official installer channels exist, so the direct channel probe\n // below (which 405s into the browser console on the npm web runtime)\n // only runs when the host half is absent or explicitly returns null\n // for a desktop runtime whose services are registered in-process.\n try {\n const mode = await gatewayJson(`${GATEWAY_PREFIX}/mode`) as { official?: boolean | null }\n if (mode.official === true) return 'official' as const\n if (mode.official === false) return 'gateway' as const\n } catch {\n // Host half absent (an official runtime without a boot profile):\n // fall back to the direct channel probe.\n }\n try {\n const result = await connection.rpc.call(CHANNEL, LIST_ENDPOINT, {})\n return result.ok ? 'official' as const : 'gateway' as const\n } catch {\n return 'gateway' as const\n }\n })()\n }\n return modePromise\n }\n\n /**\n * Start a repair conversation for a failed plugin: resolve a workspace over\n * the plugin install root (created once, reused after), open a fresh\n * session there, and seed its first prompt with the failure details. The\n * session's workspace is the plugin home so the agent's file tools reach\n * the plugin code without leaving the workspace boundary.\n * @param pluginRoot - absolute plugin install root.\n * @param message - the seeded first user message.\n * @returns resolution after the prompt is accepted and the session opens.\n */\n const repairPlugin = async (pluginRoot: string, message: string): Promise<void> => {\n const workspace = await ctx.workspaces.create({ path: pluginRoot })\n const sessionId = await ctx.workspaces.connectWorkspace(workspace.workspaceId)\n const binding = ctx.sessions.binding(sessionId)\n if (binding === undefined) throw new Error(`plugin-manager: repair session ${sessionId} is unavailable`)\n const result = await binding.session.prompt([{ type: 'text', text: message }], 'queue')\n if (!result.ok) throw new Error(`plugin-manager: repair prompt failed: ${result.error.code}: ${result.error.message}`)\n ctx.sessions.open(sessionId)\n }\n\n // ── change notification ───────────────────────────────────────────────────\n\n /** Listeners subscribed through onChange; fired after successful mutations. */\n const listeners = new Set<() => void>()\n /** Notify every listener; one listener throwing never breaks the others. */\n const notifyChange = (): void => {\n for (const listener of [...listeners]) {\n try {\n listener()\n } catch {\n // A consumer's listener failure is its own; keep notifying the rest.\n }\n }\n }\n\n // ── the shared face ───────────────────────────────────────────────────────\n\n return {\n isLoopback: connection.isLoopback,\n list: async () => (await ensureMode()) === 'official' ? official.list() : gateway.list(),\n install: async spec => {\n const item = await ((await ensureMode()) === 'official' ? official.install(spec) : gateway.install(spec))\n notifyChange()\n return item\n },\n update: async id => {\n const item = await ((await ensureMode()) === 'official' ? official.update(id) : gateway.update(id))\n notifyChange()\n return item\n },\n uninstall: async id => {\n const rows = await ((await ensureMode()) === 'official' ? official.uninstall(id) : gateway.uninstall(id))\n notifyChange()\n return rows\n },\n setEnabled: async (id, enabled) => {\n const item = await ((await ensureMode()) === 'official' ? official.setEnabled(id, enabled) : gateway.setEnabled(id, enabled))\n notifyChange()\n return item\n },\n checkUpdates: async () => (await ensureMode()) === 'official' ? official.checkUpdates() : gateway.checkUpdates(),\n status: async () => (await ensureMode()) === 'official' ? official.status() : gateway.status(),\n failures: async () => (await ensureMode()) === 'official' ? official.failures() : gateway.failures(),\n setSafeMode: async enabled => (await ensureMode()) === 'official' ? official.setSafeMode(enabled) : gateway.setSafeMode(),\n repairPlugin,\n controlsList: async () => (await ensureMode()) === 'official' ? official.controlsList() : gateway.controlsList(),\n controlsSetEnabled: async (id, enabled) => (await ensureMode()) === 'official' ? official.controlsSetEnabled(id, enabled) : gateway.controlsSetEnabled(id, enabled),\n lastInstallConflicts: () => lastInstallConflicts,\n onChange: cb => {\n listeners.add(cb)\n return () => { listeners.delete(cb) }\n },\n }\n}\n\n/** Contribute the family plugin-manager tab and provide the shared face. */\nexport function apply(ctx: ClientContext): void {\n // Anonymous install heartbeat (docs/telemetry.md): one beat per browser per\n // UTC day, package name only, silent failure.\n reportDailyHeartbeat([{ name: '@linxin666/dsh-client-ui-plugin-manager' }])\n\n ctx.effect(() => {\n try {\n return ctx.locale.register(NS, { zh, en })\n } catch {\n return () => {}\n }\n }, 'plugin-manager: dictionaries')\n\n // Built once: the tab and the 'pluginManager' cordis service share one\n // face, so consumers observe exactly the mutations the tab performs.\n const face = createPluginManagerFace(ctx)\n try {\n if (!ctx.get(PLUGIN_MANAGER_SERVICE)) {\n ctx.provide(PLUGIN_MANAGER_SERVICE, face)\n }\n } catch {\n // ignore duplicate provide\n }\n\n ctx.slots.inject('settings.plugins.tab', () => {\n try {\n return ctx.slots.register({\n name: 'settings.plugins.tab',\n id: 'family-plugins',\n order: 20,\n label: () => ctx.locale.bind(NS)('tab'),\n locale: NS,\n inject: () => face,\n }, PluginMan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,WAAW,MAAO,aAAa,SAAS,aAAa,IAAI,QAAQ,aAAa;IAC/G,oBAAoB,OAAO,IAAI,YAAa,MAAM,WAAW,MAAO,aAAa,SAAS,mBAAmB,IAAI,OAAO,IAAI,QAAQ,mBAAmB,IAAI,OAAO;IAClK,4BAA4B;IAC5B,WAAU,OAAM;KACd,UAAU,IAAI,EAAE;KAChB,aAAa;MAAE,UAAU,OAAO,EAAE;KAAE;IACtC;GACF;EACF;;EAGA,SAAgB,MAAM,KAA0B;GAG9C,qBAAqB,CAAC,EAAE,MAAM,0CAA0C,CAAC,CAAC;GAE1E,IAAI,aAAa;IACf,IAAI;KACF,OAAO,IAAI,OAAO,SAAS,IAAI;MAAE;MAAI;KAAG,CAAC;IAC3C,QAAQ;KACN,aAAa,CAAC;IAChB;GACF,GAAG,8BAA8B;GAIjC,MAAM,OAAO,wBAAwB,GAAG;GACxC,IAAI;IACF,IAAI,CAAC,IAAI,IAAA,eAA0B,GACjC,IAAI,QAAQ,wBAAwB,IAAI;GAE5C,QAAQ,CAER;GAEA,IAAI,MAAM,OAAO,8BAA8B;IAC7C,IAAI;KACF,OAAO,IAAI,MAAM,SAAS;MACxB,MAAM;MACN,IAAI;MACJ,OAAO;MACP,aAAa,IAAI,OAAO,KAAK,EAAE,CAAC,CAAC,KAAK;MACtC,QAAQ;MACR,cAAc;KAChB,GAAG,gBAAgB;IACrB,QAAQ;KACN,aAAa,CAAC;IAChB;GACF,CAAC;EACH"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["css","Button","Modal"],"sources":["../../../packages/dsh-plugin-manager/src/core/conflict.ts","../../../packages/dsh-plugin-manager/src/core/repair.ts","../../../packages/dsh-plugin-manager/src/core/version.ts","../../../packages/dsh-plugin-manager/src/client/PluginManagerTab.tsx","../../../packages/dsh-plugin-manager/src/client/locales.ts","../../../packages/dsh-plugin-manager/src/core/protocol.ts","../../../packages/dsh-plugin-manager/src/core/service.ts","../../../packages/dsh-plugin-manager/src/client/telemetry.ts","../../../packages/dsh-plugin-manager/src/client/index.ts"],"sourcesContent":["/**\n * Conflict-ledger diffing. The official host applies structural conflict\n * rules at install time (disableControlsOnInstall: installing the dsh-web\n * family disables the built-in web-ui product rows so the two never\n * double-mount), but no UI surfaces what the rules just did. This module\n * diffs the plugin-control snapshots taken before and after an install and\n * classifies every state change so the tab can render it as a reversible,\n * attributable conflict notice.\n *\n * The install-time authority ends here: duplicate insert-id claims between\n * two user plugins carry no at-install signal through the RPC channels (the\n * Loader only re-reads the composition at the next start), so that failure\n * shape is left to the boot-failure ring — the real start is the authoritative\n * conflict detector.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\nimport type { PluginControlItem } from './protocol.ts'\n\n/** One observed product-control state change between two snapshots. */\nexport interface ControlChange {\n id: string\n name: string\n from: PluginControlItem['state']\n to: PluginControlItem['state']\n}\n\n/** Meaningful change kinds a conflict notice distinguishes. */\nexport type ControlChangeKind = 'rule-disabled' | 'rule-enabled' | 'state-change'\n\n/**\n * Diff two plugin-control snapshots by id. Only entries present in both\n * snapshots with a changed state are reported; entries appearing or\n * disappearing are ordinary install/uninstall outcomes, not conflicts.\n * @param before - snapshot taken before the install.\n * @param after - snapshot taken after the install.\n * @returns one change per id whose state moved, in id order.\n */\nexport function diffControls(before: readonly PluginControlItem[], after: readonly PluginControlItem[]): ControlChange[] {\n const afterById = new Map(after.map(item => [item.id, item]))\n const changes: ControlChange[] = []\n for (const item of before) {\n const current = afterById.get(item.id)\n if (current === undefined || current.state === item.state) continue\n changes.push({ id: item.id, name: item.name, from: item.state, to: current.state })\n }\n return changes\n}\n\n/**\n * Classify one control-state change for messaging. A change into `disabled`\n * is the conflict rule's action (reversible by re-enabling); a change out of\n * `disabled` is a manual undo; anything else is reported neutrally.\n * @param change - one diff entry.\n * @returns the message kind.\n */\nexport function classifyChange(change: ControlChange): ControlChangeKind {\n if (change.to === 'disabled') return 'rule-disabled'\n if (change.from === 'disabled') return 'rule-enabled'\n return 'state-change'\n}\n","/**\n * Repair-conversation seed text. Two failure surfaces hand off to the agent\n * through the same shape: a failed install (target spec + install error) and\n * a recorded boot failure (the failure-ring row). The seeded message must be\n * self-contained — the repair session's workspace is the plugin install root,\n * so the agent's file tools reach the plugin code without leaving the\n * workspace boundary.\n *\n * Secret discipline: the seed carries only the spec, the host's truncated\n * failure message/stack, and paths. Callers must never append credentials,\n * tokens, or environment contents; the failure ring is the host's bounded,\n * pruned record and nothing else is added.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\nimport type { PluginFailureItem } from './protocol.ts'\nimport type { LayerState } from './patch-diff.ts'\n\n/** Localized fragments the builders assemble. */\nexport interface RepairCopy {\n installTitle: string\n installSpecLabel: string\n installErrorLabel: string\n installAsk: string\n failureTitle: string\n failurePluginLabel: string\n failureKindLabel: string\n failureAtLabel: string\n failureMessageLabel: string\n failureStackLabel: string\n failurePathLabel: string\n failureAsk: string\n conflictTitle: string\n conflictPluginLabel: string\n conflictChangeLabel: string\n conflictAsk: string\n /** Localized names of the failure kinds. */\n kindNames: Record<PluginFailureItem['kind'], string>\n /** Localized names of the layer states a conflict change traverses. */\n stateNames: Record<LayerState, string>\n}\n\n/** Default copy (zh): the package's zh dictionary keys map onto these strings. */\nexport const DEFAULT_REPAIR_COPY: RepairCopy = {\n installTitle: '正在修复插件安装失败',\n installSpecLabel: '安装目标',\n installErrorLabel: '安装错误',\n installAsk: '请在插件安装根目录内检查插件包或依赖并修复,然后重试安装。',\n failureTitle: '正在修复插件启动失败',\n failurePluginLabel: '插件',\n failureKindLabel: '失败类型',\n failureAtLabel: '时间',\n failureMessageLabel: '错误信息',\n failureStackLabel: '堆栈',\n failurePathLabel: '安装路径',\n failureAsk: '请修复插件后重新启用并重启 dsh web。',\n conflictTitle: '正在处理插件安装冲突',\n conflictPluginLabel: '冲突条目',\n conflictChangeLabel: '状态变化',\n conflictAsk: '请检查冲突双方的入口行 id 与挂载方式,消除重复挂载后告诉我如何重新启用。',\n kindNames: {\n 'load-failure': '加载失败',\n hang: '启动挂起',\n 'late-rejection': '迟到拒绝',\n },\n stateNames: {\n enabled: '已开启',\n disabled: '已关闭',\n uninstalled: '已卸载',\n },\n}\n\n/**\n * Seed text for a failed install: the target and the rendered error,\n * self-contained for the agent.\n * @param spec - the install target (npm spec or git URL) that failed.\n * @param error - the rendered install error text.\n * @param copy - localized fragments.\n * @returns the repair prompt text.\n */\nexport function installRepairMessage(spec: string, error: string, copy: RepairCopy = DEFAULT_REPAIR_COPY): string {\n return [\n copy.installTitle,\n `${copy.installSpecLabel}: ${spec}`,\n `${copy.installErrorLabel}:\\n${error}`,\n copy.installAsk,\n ].join('\\n\\n')\n}\n\n/**\n * Seed text for one boot-failure ring row: the failure record, so the agent\n * can attribute and fix it in place.\n * @param failure - the recorded failure row.\n * @param copy - localized fragments.\n * @returns the repair prompt text.\n */\nexport function failureRepairMessage(failure: PluginFailureItem, copy: RepairCopy = DEFAULT_REPAIR_COPY): string {\n const parts = [\n copy.failureTitle,\n `${copy.failurePluginLabel}: ${failure.pluginId || '-'}`,\n `${copy.failureKindLabel}: ${copy.kindNames[failure.kind] ?? failure.kind}`,\n `${copy.failureAtLabel}: ${failure.at}`,\n `${copy.failureMessageLabel}:\\n${failure.message}`,\n ]\n if (failure.stack !== '') parts.push(`${copy.failureStackLabel}:\\n${failure.stack}`)\n if (failure.installPath !== '') parts.push(`${copy.failurePathLabel}: ${failure.installPath}`)\n parts.push(copy.failureAsk)\n return parts.join('\\n\\n')\n}\n\n/**\n * Seed text for one install-conflict notice: the entry and its state change,\n * so the agent can attribute the conflict and resolve the double mount.\n * @param change - the conflict change (id, display name, from/to states).\n * @param copy - localized fragments.\n * @returns the repair prompt text.\n */\nexport function conflictRepairMessage(\n change: { id: string; name: string; from: LayerState; to: LayerState },\n copy: RepairCopy = DEFAULT_REPAIR_COPY,\n): string {\n return [\n copy.conflictTitle,\n `${copy.conflictPluginLabel}: ${change.name} (${change.id})`,\n `${copy.conflictChangeLabel}: ${copy.stateNames[change.from] ?? change.from} -> ${copy.stateNames[change.to] ?? change.to}`,\n copy.conflictAsk,\n ].join('\\n\\n')\n}\n","/**\n * DSH host version parsing and comparison for the update compatibility\n * check. The declared minimum lives in the published package manifest under\n * `dsh.engines.dsh`, falling back to the top-level `engines.dsh`; the only\n * supported form is `>=X.Y.Z[-prerelease]`.\n *\n * Comparison deliberately uses plain semver ordering instead of\n * `semver.satisfies`: npm's prerelease rule only allows a prerelease version\n * to satisfy a comparator set carrying a prerelease on the same\n * major.minor.patch tuple, which would reject a newer host line (0.1.1-rc.2)\n * against a declared `>=0.1.0-rc.8` — exactly the cross-cohort upgrade path\n * this check must allow. Everything here is pure and tolerant of untrusted\n * input: a malformed value means \"cannot verify\", which the callers treat as\n * a fail-closed verdict when a requirement was declared (issue #754).\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\n/** One parsed DSH host or package version. */\nexport interface DshVersion {\n major: number\n minor: number\n patch: number\n /** Prerelease identifiers, numeric identifiers kept as numbers (semver order). */\n prerelease: readonly (number | string)[]\n}\n\nconst VERSION_PATTERN = /^v?(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z.-]+))?$/\n\n/**\n * Parse a DSH host or package version string.\n * @param value - e.g. `0.1.0-rc.8`, `v1.2.3`.\n * @returns the parsed version, or undefined when malformed.\n */\nexport function parseDshVersion(value: string): DshVersion | undefined {\n const match = VERSION_PATTERN.exec(value.trim())\n if (match === null) return undefined\n const prereleaseParts = match[4] === undefined ? [] : match[4].split('.')\n if (prereleaseParts.some(part => part === '')) return undefined\n return {\n major: Number(match[1]),\n minor: Number(match[2]),\n patch: Number(match[3]),\n prerelease: prereleaseParts.map(part => /^\\d+$/.test(part) ? Number(part) : part),\n }\n}\n\n/**\n * Compare two version strings by semver order (a release is newer than any\n * prerelease of the same tuple).\n * @returns -1 / 0 / 1, or undefined when either side is malformed.\n */\nexport function compareVersions(left: string, right: string): number | undefined {\n const a = parseDshVersion(left)\n const b = parseDshVersion(right)\n if (a === undefined || b === undefined) return undefined\n for (const key of ['major', 'minor', 'patch'] as const) {\n if (a[key] !== b[key]) return a[key] < b[key] ? -1 : 1\n }\n return comparePrerelease(a.prerelease, b.prerelease)\n}\n\n/**\n * Semver prerelease ordering: numeric identifiers compare numerically,\n * numeric identifiers rank below alphanumeric ones, alphanumeric identifiers\n * compare lexically, and a longer list wins when the shared prefix is equal.\n */\nfunction comparePrerelease(left: readonly (number | string)[], right: readonly (number | string)[]): number {\n if (left.length === 0 && right.length === 0) return 0\n if (left.length === 0) return 1\n if (right.length === 0) return -1\n const length = Math.max(left.length, right.length)\n for (let index = 0; index < length; index += 1) {\n const a = left[index]\n const b = right[index]\n if (a === undefined) return -1\n if (b === undefined) return 1\n if (typeof a === 'number' && typeof b === 'number') {\n if (a !== b) return a < b ? -1 : 1\n } else if (typeof a === 'number') {\n return -1\n } else if (typeof b === 'number') {\n return 1\n } else if (a !== b) {\n return a < b ? -1 : 1\n }\n }\n return 0\n}\n\nconst MINIMUM_RANGE_PATTERN = /^>=\\s*(v?\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?)$/\n\n/**\n * Whether a host version satisfies a declared `>=X.Y.Z[-prerelease]` minimum.\n * @param host - the running DSH host version.\n * @param minimum - the declared minimum; any form other than `>=<semver>`\n * (plain semver, `^`, `~`, multi-comparator ranges, empty) returns undefined.\n * @returns true / false, or undefined when the host version is malformed or\n * the minimum uses an unsupported form — callers treat undefined as\n * \"cannot verify\" and fail closed for declared requirements.\n */\nexport function meetsMinimumDsh(host: string, minimum: string): boolean | undefined {\n const match = MINIMUM_RANGE_PATTERN.exec(minimum.trim())\n if (match === null) return undefined\n const compared = compareVersions(host, match[1])\n if (compared === undefined) return undefined\n return compared >= 0\n}\n\n/**\n * The bare minimum version for display: strips the `>=` operator (and an\n * optional leading `v`) from a declared requirement so UI copy that already\n * contains the comparison operator renders `0.1.1-rc.1` instead of\n * `>= >=0.1.1-rc.1`. Unsupported range forms render unchanged.\n * @param minimum - the declared minimum range.\n * @returns the version portion for display.\n */\nexport function displayMinimumVersion(minimum: string): string {\n const match = MINIMUM_RANGE_PATTERN.exec(minimum.trim())\n return match === null ? minimum.trim() : match[1].replace(/^v/, '')\n}\n\n/**\n * Read the declared DSH minimum from a published registry manifest:\n * `dsh.engines.dsh` first, top-level `engines.dsh` as the fallback.\n * Defensive against malformed or untrusted metadata: anything that is not a\n * non-empty string reads as absent.\n * @param manifest - the decoded registry version manifest.\n * @returns the declared minimum, or undefined when not declared.\n */\nexport function dshRequirementOf(manifest: { dsh?: unknown; engines?: unknown }): string | undefined {\n const dshEngines = (manifest.dsh as { engines?: unknown } | undefined)?.engines as { dsh?: unknown } | undefined\n const engines = (manifest.engines as { dsh?: unknown } | undefined)?.dsh\n const value = dshEngines?.dsh ?? engines\n return typeof value === 'string' && value.trim() !== '' ? value.trim() : undefined\n}\n","/**\n * The plugin-manager tab: an install box, one row per installed user plugin\n * (next-start enablement switch, source badge, update availability, update and\n * uninstall actions, per-plugin boot-failure block), the built-in product\n * switches, an install-conflict notice (the diff of the plugin-control\n * snapshot around each install, reversible through the product switch), and\n * the failure-repair affordances. Enablement switches and installs persist\n * through the official host channels and apply at the next restart; the web\n * build shows a restart hint instead of an in-place restart.\n *\n * This tab registers into the official Plugins settings section\n * (`settings.plugins.tab` slot) next to the official installer tab; its added\n * value over that tab is the conflict ledger, the bilingual repair seeds, and\n * the family card vocabulary.\n */\nimport { useEffect, useRef, useState } from 'react'\nimport { Button, Modal } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport { classifyChange, diffControls, type ControlChange } from '../core/conflict.ts'\nimport type {\n InstallProgressItem,\n InstalledPluginItem,\n PluginControlItem,\n PluginFailureItem,\n PluginFailuresSnapshot,\n PluginUpdateItem,\n} from '../core/protocol.ts'\nimport { conflictRepairMessage, failureRepairMessage, installRepairMessage, type RepairCopy } from '../core/repair.ts'\nimport { displayMinimumVersion } from '../core/version.ts'\nimport css from './plugin-manager.module.css'\n\n/** Registration-side wire face used by the tab. */\nexport interface PluginManagerTabInjected {\n /** Whether this browser has loopback authority to use the host routes. */\n isLoopback: boolean\n /** Read the installed snapshot. */\n list: () => Promise<InstalledPluginItem[]>\n /** Install one plugin from an npm spec or git URL. */\n install: (spec: string) => Promise<InstalledPluginItem>\n /** Re-install one plugin from its recorded source. */\n update: (id: string) => Promise<InstalledPluginItem>\n /** Remove one plugin. */\n uninstall: (id: string) => Promise<InstalledPluginItem[]>\n /** Persist one user plugin's next-start enablement. */\n setEnabled: (id: string, enabled: boolean) => Promise<InstalledPluginItem>\n /** Compare installed versions against their sources. */\n checkUpdates: () => Promise<PluginUpdateItem[]>\n /** Read the current install/update progress. */\n status: () => Promise<InstallProgressItem>\n /** Read the recorded boot failures, plugin root, and safe-mode state. */\n failures: () => Promise<PluginFailuresSnapshot>\n /** Persist the safe-mode marker (web: applied at the next manual restart). */\n setSafeMode: (enabled: boolean) => Promise<void>\n /** Start a repair conversation over the plugin install root. */\n repairPlugin: (pluginRoot: string, message: string) => Promise<void>\n /** Read the deployment-configured built-in product switches. */\n controlsList: () => Promise<PluginControlItem[]>\n /** Persist one product's next-start enablement. */\n controlsSetEnabled: (pluginId: string, enabled: boolean) => Promise<PluginControlItem[]>\n /** Conflicts the gateway host computed around the last install (gateway mode only). */\n lastInstallConflicts?: () => readonly ControlChange[]\n}\n\n/** Full component props assembled by the Settings slot renderer. */\nexport type PluginManagerTabProps =\n PropsRuntime<'settings.plugins.tab'>\n & PropsLocale<'settings.pluginManager'>\n & InjectFace<PluginManagerTabInjected>\n\ntype ViewState =\n | { readonly status: 'loading' }\n | { readonly status: 'error' }\n | {\n readonly status: 'ready'\n readonly plugins: readonly InstalledPluginItem[]\n readonly controls: readonly PluginControlItem[]\n readonly failures: PluginFailuresSnapshot\n }\n\n/** One row operation in flight. */\ntype BusyAction = { readonly kind: 'install' | 'update' | 'uninstall' | 'check'; readonly id?: string }\n\n/** One enablement switch in flight: a user plugin or a built-in product. */\ntype ToggleBusy = { readonly kind: 'user' | 'product'; readonly id: string }\n\n/** One uninstall target awaiting confirmation. */\ninterface UninstallTarget {\n readonly id: string\n readonly name: string\n}\n\n/** Error text for a caught request or lifecycle failure. */\nfunction messageOf(error: unknown): string {\n if (error instanceof AggregateError) {\n const details = error.errors.map(messageOf).join('; ')\n return details === '' ? error.message : `${error.message}: ${details}`\n }\n return error instanceof Error ? error.message : String(error)\n}\n\n/** Localized fragments for the repair seed builders, read from the tab's dictionaries. */\nfunction repairCopy(t: PluginManagerTabProps['t']): RepairCopy {\n return {\n installTitle: t('repairInstallTitle'),\n installSpecLabel: t('repairInstallSpecLabel'),\n installErrorLabel: t('repairInstallErrorLabel'),\n installAsk: t('repairInstallAsk'),\n failureTitle: t('repairFailureTitle'),\n failurePluginLabel: t('repairFailurePluginLabel'),\n failureKindLabel: t('repairFailureKindLabel'),\n failureAtLabel: t('repairFailureAtLabel'),\n failureMessageLabel: t('repairFailureMessageLabel'),\n failureStackLabel: t('repairFailureStackLabel'),\n failurePathLabel: t('repairFailurePathLabel'),\n failureAsk: t('repairFailureAsk'),\n kindNames: {\n 'load-failure': t('repairKindLoad'),\n hang: t('repairKindHang'),\n 'late-rejection': t('repairKindLate'),\n },\n conflictTitle: t('repairConflictTitle'),\n conflictPluginLabel: t('repairConflictPluginLabel'),\n conflictChangeLabel: t('repairConflictChangeLabel'),\n conflictAsk: t('repairConflictAsk'),\n stateNames: {\n enabled: t('repairStateEnabled'),\n disabled: t('repairStateDisabled'),\n uninstalled: t('repairStateUninstalled'),\n },\n }\n}\n\n/** Localized label for one install phase, with percent when the download has one. */\nfunction progressLabel(progress: InstallProgressItem, t: PluginManagerTabProps['t']): string {\n if (progress.stage === 'fetch') return t('fetching')\n if (progress.stage === 'extract') return t('extracting')\n if (progress.stage === 'write') return t('writing')\n return progress.percent === undefined ? t('downloading') : t('downloadingPercent', { percent: String(progress.percent) })\n}\n\n/** The plugin-manager settings tab. */\nexport function PluginManagerTab(props: PluginManagerTabProps) {\n const {\n t,\n isLoopback,\n list,\n install,\n update,\n uninstall,\n setEnabled,\n checkUpdates,\n status,\n failures,\n setSafeMode,\n repairPlugin,\n controlsList,\n controlsSetEnabled,\n lastInstallConflicts,\n } = props\n\n const [view, setView] = useState<ViewState>({ status: 'loading' })\n const [busy, setBusy] = useState<BusyAction | undefined>(undefined)\n const [toggleBusy, setToggleBusy] = useState<ToggleBusy | undefined>(undefined)\n const [error, setError] = useState<string | undefined>(undefined)\n const [failedSpec, setFailedSpec] = useState<string | undefined>(undefined)\n const [installError, setInstallError] = useState<string | undefined>(undefined)\n const [spec, setSpec] = useState('')\n const [dirty, setDirty] = useState(false)\n const [repairing, setRepairing] = useState<string | undefined>(undefined)\n const [copied, setCopied] = useState<string | undefined>(undefined)\n const [updates, setUpdates] = useState<ReadonlyMap<string, PluginUpdateItem>>(new Map())\n const [uninstallTarget, setUninstallTarget] = useState<UninstallTarget | undefined>(undefined)\n const [conflicts, setConflicts] = useState<readonly ControlChange[]>([])\n const [progress, setProgress] = useState<InstallProgressItem>({ kind: 'idle', stage: 'fetch' })\n /** Synchronous in-flight mirror of `busy`: the render-time guard alone lets a\n * click and an Enter land in the same frame and double-fire. */\n const busyRef = useRef(false)\n\n /** Reload every snapshot into the ready view. */\n const reload = async (): Promise<void> => {\n const [plugins, controls, failureSnapshot] = await Promise.all([list(), controlsList(), failures()])\n setView({ status: 'ready', plugins, controls, failures: failureSnapshot })\n }\n\n useEffect(() => {\n let cancelled = false\n void reload().catch(() => {\n if (!cancelled) setView({ status: 'error' })\n })\n return () => { cancelled = true }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n /** One row/form operation: busy state, error row, dirty flag on success. */\n const run = async (action: BusyAction, body: () => Promise<void>): Promise<void> => {\n if (busyRef.current) return\n busyRef.current = true\n setBusy(action)\n setError(undefined)\n try {\n await body()\n setDirty(true)\n } catch (reason) {\n setError(t('failed', { reason: messageOf(reason) }))\n } finally {\n busyRef.current = false\n setBusy(undefined)\n }\n }\n\n /** Install one spec, then diff the product snapshot into a conflict notice. */\n const onInstall = (): void => {\n const target = spec.trim()\n if (target === '' || busy !== undefined || busyRef.current) return\n void (async () => {\n busyRef.current = true\n const before = view.status === 'ready' ? view.controls : await controlsList().catch(() => [])\n setBusy({ kind: 'install' })\n setError(undefined)\n setFailedSpec(undefined)\n setInstallError(undefined)\n try {\n await install(target)\n setSpec('')\n setDirty(true)\n const after = await controlsList().catch(() => [] as readonly PluginControlItem[])\n setConflicts(lastInstallConflicts !== undefined ? lastInstallConflicts() : diffControls(before, after))\n await reload()\n } catch (reason) {\n const reasonText = messageOf(reason)\n setFailedSpec(target)\n setInstallError(reasonText)\n setError(t('failed', { reason: reasonText }))\n } finally {\n busyRef.current = false\n setBusy(undefined)\n }\n })()\n }\n\n /** Poll install/update progress while such an operation is in flight. */\n useEffect(() => {\n if (busy === undefined || (busy.kind !== 'install' && busy.kind !== 'update')) {\n setProgress({ kind: 'idle', stage: 'fetch' })\n return\n }\n let stopped = false\n let timer: ReturnType<typeof setTimeout> | undefined\n const tick = (delay: number): void => {\n timer = setTimeout(() => {\n void status().then(next => {\n if (!stopped && next !== undefined) {\n setProgress(next)\n tick(400)\n }\n }).catch(() => { /* status polling fails silently; the operation itself owns the error row */ })\n }, delay)\n }\n tick(100)\n return () => {\n stopped = true\n if (timer !== undefined) clearTimeout(timer)\n }\n }, [busy, status])\n\n const toggleDisabled = busy !== undefined || toggleBusy !== undefined\n || (view.status === 'ready' && view.failures.safeMode)\n\n const onUserToggle = (id: string, enabled: boolean): void => {\n setToggleBusy({ kind: 'user', id })\n setError(undefined)\n void setEnabled(id, enabled).then(plugin => {\n setView(current => current.status === 'ready'\n ? { ...current, plugins: current.plugins.map(item => item.id === id ? plugin : item) }\n : current)\n setDirty(true)\n setToggleBusy(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setToggleBusy(undefined)\n })\n }\n\n const onProductToggle = (id: string, enabled: boolean): void => {\n setToggleBusy({ kind: 'product', id })\n setError(undefined)\n void controlsSetEnabled(id, enabled).then(controls => {\n setView(current => current.status === 'ready' ? { ...current, controls } : current)\n setConflicts(previous => previous.filter(change => change.id !== id))\n setDirty(true)\n setToggleBusy(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setToggleBusy(undefined)\n })\n }\n\n const onCheck = (): void => {\n void run({ kind: 'check' }, async () => {\n const found = await checkUpdates()\n setUpdates(new Map(found.map(item => [item.id, item])))\n })\n }\n\n const onUpdate = (id: string): void => {\n void run({ kind: 'update', id }, async () => {\n await update(id)\n setUpdates(previous => {\n const next = new Map(previous)\n next.delete(id)\n return next\n })\n await reload()\n })\n }\n\n const onUninstall = (): void => {\n const target = uninstallTarget\n if (target === undefined) return\n void run({ kind: 'uninstall', id: target.id }, async () => {\n await uninstall(target.id)\n setUninstallTarget(undefined)\n await reload()\n })\n }\n\n /** Open a repair conversation seeded with one boot-failure record. `token`\n * identifies the row for the in-flight label (plugin id, or a row key for\n * unattributable failures). */\n const onRepair = (failure: PluginFailureItem, token: string): void => {\n if (view.status !== 'ready' || busy !== undefined || repairing !== undefined) return\n setError(undefined)\n setRepairing(token)\n void repairPlugin(view.failures.pluginRoot, failureRepairMessage(failure, repairCopy(t))).then(() => {\n setRepairing(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setRepairing(undefined)\n })\n }\n\n /** Hand the latest failed install off to a repair conversation over the\n * install root. The seed carries the install's own error (installError), not\n * whatever error the row currently shows. */\n const onRepairInstall = (): void => {\n if (view.status !== 'ready' || repairing !== undefined) return\n setError(undefined)\n setRepairing('install')\n void repairPlugin(view.failures.pluginRoot, installRepairMessage(failedSpec ?? '', installError ?? '', repairCopy(t))).then(() => {\n setError(undefined)\n setFailedSpec(undefined)\n setInstallError(undefined)\n setRepairing(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setRepairing(undefined)\n })\n }\n\n /** Copy a boot failure's message and stack for a manual repair conversation. */\n const onCopy = (failure: PluginFailureItem, token: string): void => {\n void navigator.clipboard.writeText(`${failure.message}\\n\\n${failure.stack}`).then(() => {\n setCopied(token)\n }).catch(() => {\n setError(t('failed', { reason: 'clipboard unavailable' }))\n })\n }\n\n const onExitSafeMode = (): void => {\n if (busy !== undefined) return\n setError(undefined)\n void setSafeMode(false).then(() => {\n setDirty(true)\n void reload().catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n })\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n })\n }\n\n /** Undo one conflict action by flipping the product switch back. */\n const onUndoConflict = (change: ControlChange): void => {\n if (change.to !== 'disabled') return\n onProductToggle(change.id, true)\n }\n\n /** Hand one conflict notice off to a repair conversation over the plugin root. */\n const onRepairConflict = (change: ControlChange): void => {\n if (view.status !== 'ready' || busy !== undefined || repairing !== undefined) return\n setError(undefined)\n const token = `conflict:${change.id}`\n setRepairing(token)\n void repairPlugin(view.failures.pluginRoot, conflictRepairMessage({\n id: change.id,\n name: change.name,\n from: change.from === 'enabled' || change.from === 'disabled' ? change.from : 'uninstalled',\n to: change.to === 'enabled' || change.to === 'disabled' ? change.to : 'uninstalled',\n }, repairCopy(t))).then(() => {\n setRepairing(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setRepairing(undefined)\n })\n }\n\n if (!isLoopback) {\n return (\n <div className={css.notice}>\n <strong>{t('localOnlyTitle')}</strong>\n <p>{t('localOnlyBody')}</p>\n </div>\n )\n }\n if (view.status === 'loading') return <div className={css.state}>{t('loading')}</div>\n if (view.status === 'error') return <div className={css.state}>{t('failed', { reason: 'load' })}</div>\n\n const attributable = new Map(view.failures.items.filter(item => item.pluginId !== '').map(item => [item.pluginId, item]))\n const unattributable = view.failures.items.filter(item => item.pluginId === '')\n\n return (\n <div className={css.section} aria-busy={busy !== undefined || toggleBusy !== undefined}>\n {view.failures.safeMode && (\n <div className={css.safeModeBanner} data-safe-mode>\n <p>{t('safeModeBanner')}</p>\n <Button variant=\"primary\" disabled={busy !== undefined} onClick={onExitSafeMode}>\n {t('exitSafeMode')}\n </Button>\n </div>\n )}\n\n <div className={css.installRow}>\n <input\n className={css.spec}\n type=\"text\"\n value={spec}\n placeholder={t('installPlaceholder')}\n disabled={busy !== undefined}\n onChange={event => { setSpec(event.target.value) }}\n onKeyDown={event => {\n if (event.key === 'Enter' && spec.trim() !== '' && busy === undefined) onInstall()\n }}\n />\n <Button\n variant=\"primary\"\n disabled={spec.trim() === '' || busy !== undefined}\n onClick={onInstall}\n >\n {busy !== undefined && busy.kind === 'install' ? t('installing') : t('install')}\n </Button>\n </div>\n <p className={css.hint}>{t('installHint')}</p>\n\n {(busy?.kind === 'install' || busy?.kind === 'update') && (\n <div className={css.progressRow} role=\"status\">\n <div className={css.progressTrack}>\n <div\n className={css.progressBar}\n style={progress.percent === undefined ? undefined : { width: `${progress.percent}%` }}\n data-indeterminate={progress.percent === undefined ? 'true' : undefined}\n />\n </div>\n <p className={css.progressLabel}>{progressLabel(progress, t)}</p>\n </div>\n )}\n\n {error !== undefined && (\n <div className={css.errorRow}>\n <span className={css.error}>{error}</span>\n {failedSpec !== undefined && (\n <Button variant=\"outline\" disabled={repairing !== undefined} onClick={onRepairInstall}>\n {repairing === 'install' ? t('repairing') : t('repair')}\n </Button>\n )}\n </div>\n )}\n\n {conflicts.length > 0 && (\n <div className={css.conflicts}>\n <h3 className={css.sectionTitle}>{t('conflictTitle')}</h3>\n <ul className={css.list}>\n {conflicts.map(change => (\n <li key={change.id} className={css.row} data-conflict={change.id}>\n <div className={css.meta}>\n <span className={css.name}>{change.name}</span>\n <span className={css.sub}>\n {classifyChange(change) === 'rule-disabled'\n ? t('conflictDisabled', { name: change.name })\n : classifyChange(change) === 'rule-enabled'\n ? t('conflictEnabled', { name: change.name })\n : t('conflictChanged', { name: change.name })}\n </span>\n </div>\n <div className={css.actions}>\n {change.to === 'disabled' && (\n <Button\n variant=\"outline\"\n disabled={toggleDisabled}\n onClick={() => { onUndoConflict(change) }}\n >\n {t('undoConflict')}\n </Button>\n )}\n <Button\n variant=\"outline\"\n disabled={busy !== undefined || repairing !== undefined}\n onClick={() => { onRepairConflict(change) }}\n >\n {repairing === `conflict:${change.id}` ? t('repairing') : t('repair')}\n </Button>\n </div>\n </li>\n ))}\n </ul>\n <p className={css.hint}>{t('conflictHint')}</p>\n </div>\n )}\n\n <div className={css.group}>\n <h3 className={css.sectionTitle}>{t('userPlugins')}</h3>\n {view.plugins.length === 0\n ? <p className={css.empty}>{t('empty')}</p>\n : (\n <ul className={css.list}>\n {view.plugins.map(plugin => {\n const updateItem = updates.get(plugin.id)\n const latest = updateItem?.latest\n const dshRequirement = updateItem?.requiresDsh\n const failure = attributable.get(plugin.id)\n return (\n <li key={plugin.id} className={css.row} data-plugin-id={plugin.id}>\n <div className={css.meta}>\n <span className={css.name}>{plugin.name}</span>\n <span className={css.sub}>\n <span className={css.version}>{t('version', { version: plugin.version })}</span>\n <span className={css.sourceBadge} data-source={plugin.source.kind}>\n {plugin.source.kind === 'npm' ? t('npmSource') : t('gitSource')}\n </span>\n <span className={css.specText} title={plugin.source.spec}>{plugin.source.spec}</span>\n </span>\n {latest !== undefined && <span className={css.latest}>{t('latest', { version: latest })}</span>}\n {updateItem !== undefined && dshRequirement !== undefined && (\n <span className={updateItem.compatible === false ? css.compatBlocked : css.compatHint}>\n {updateItem.compatible === false\n ? t('updateBlockedDsh', { min: displayMinimumVersion(dshRequirement) })\n : t('updateRequiresDsh', { min: displayMinimumVersion(dshRequirement) })}\n </span>\n )}\n {failure !== undefined && (\n <div className={css.failure} data-plugin-failure={plugin.id}>\n <span className={css.badge}>{t('failureBadge')}</span>\n <span className={css.failureMessage} title={failure.message}>{failure.message}</span>\n <div className={css.failureActions}>\n <Button\n variant=\"primary\"\n disabled={busy !== undefined || repairing !== undefined}\n onClick={() => { onRepair(failure, plugin.id) }}\n >\n {repairing === plugin.id ? t('repairing') : t('repair')}\n </Button>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={() => { onCopy(failure, plugin.id) }}>\n {copied === plugin.id ? t('copied') : t('copyError')}\n </Button>\n </div>\n </div>\n )}\n </div>\n <div className={css.actions}>\n <span className={css.stateLabel} data-state={plugin.enabled ? 'enabled' : 'disabled'}>\n {plugin.enabled ? t('enabled') : t('disabled')}\n </span>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={plugin.enabled}\n aria-label={plugin.enabled ? t('disableSwitch', { name: plugin.name }) : t('enableSwitch', { name: plugin.name })}\n className={css.switch}\n disabled={toggleDisabled}\n onClick={() => { onUserToggle(plugin.id, !plugin.enabled) }}\n />\n {latest !== undefined && (\n <Button\n variant=\"outline\"\n disabled={busy !== undefined || updateItem?.compatible === false}\n onClick={() => { onUpdate(plugin.id) }}\n >\n {busy?.kind === 'update' && busy.id === plugin.id ? t('updating') : t('update')}\n </Button>\n )}\n <Button\n variant=\"outline\"\n disabled={busy !== undefined}\n onClick={() => { setUninstallTarget({ id: plugin.id, name: plugin.name }) }}\n >\n {t('uninstall')}\n </Button>\n </div>\n </li>\n )\n })}\n </ul>\n )}\n </div>\n\n {view.controls.length > 0 && (\n <div className={css.group}>\n <h3 className={css.sectionTitle}>{t('products')}</h3>\n <ul className={css.list}>\n {view.controls.map(control => (\n <li key={control.id} className={css.row} data-product-id={control.id}>\n <div className={css.meta}>\n <span className={css.name}>{control.name}</span>\n <span className={css.sub}>\n <a className={css.link} href={control.repository} target=\"_blank\" rel=\"noreferrer\">{t('source')}</a>\n </span>\n </div>\n <div className={css.actions}>\n <span className={css.stateLabel} data-state={control.state}>\n {t(control.state)}\n </span>\n {control.state === 'enabled' || control.state === 'disabled'\n ? (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={control.state === 'enabled'}\n aria-label={control.state === 'enabled'\n ? t('disableSwitch', { name: control.name })\n : t('enableSwitch', { name: control.name })}\n className={css.switch}\n disabled={toggleDisabled}\n onClick={() => { onProductToggle(control.id, control.state !== 'enabled') }}\n />\n )\n : null}\n </div>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {unattributable.length > 0 && (\n <div className={css.group}>\n <h3 className={css.sectionTitle}>{t('failureGroupTitle')}</h3>\n <ul className={css.list}>\n {unattributable.map((failure, index) => {\n const token = `other:${index}`\n return (\n <li key={`${failure.at}-${index}`} className={css.row} data-plugin-failure=\"other\">\n <div className={css.meta}>\n <span className={css.badge}>{t('failureBadge')}</span>\n <span className={css.failureMessage} title={failure.message}>{failure.message}</span>\n <div className={css.failureActions}>\n <Button\n variant=\"primary\"\n disabled={busy !== undefined || repairing !== undefined}\n onClick={() => { onRepair(failure, token) }}\n >\n {repairing === token ? t('repairing') : t('repair')}\n </Button>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={() => { onCopy(failure, token) }}>\n {copied === token ? t('copied') : t('copyError')}\n </Button>\n </div>\n </div>\n </li>\n )\n })}\n </ul>\n </div>\n )}\n\n <div className={css.actionsRow}>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={onCheck}>\n {busy?.kind === 'check' ? t('checking') : t('checkUpdates')}\n </Button>\n {updates.size === 0 && busy === undefined && view.plugins.length > 0 && (\n <p className={css.ok}>{t('noUpdates')}</p>\n )}\n </div>\n\n {toggleBusy !== undefined && <p className={css.applying} aria-live=\"polite\">{t('applying')}</p>}\n\n {dirty && (\n <div className={css.restartRow}>\n <p>{t('restartHint')}</p>\n </div>\n )}\n\n <Modal\n title={t('uninstallConfirmTitle')}\n open={uninstallTarget !== undefined}\n onClose={() => { setUninstallTarget(undefined) }}\n closeLabel={t('cancel')}\n >\n <p className={css.confirmBody}>{t('uninstallConfirmBody', { name: uninstallTarget?.name ?? '' })}</p>\n <div className={css.modalActions}>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={() => { setUninstallTarget(undefined) }}>\n {t('cancel')}\n </Button>\n <Button variant=\"primary\" className={css.dangerButton} disabled={busy !== undefined} onClick={onUninstall}>\n {t('confirm')}\n </Button>\n </div>\n </Modal>\n </div>\n )\n}\n","/**\n * Locale dictionaries for the plugin-manager tab. The zh dictionary is the\n * key source; the en dictionary mirrors the exact key set.\n * @module @linxin666/dsh-client-ui-plugin-manager/client\n */\n\n/** Simplified Chinese copy (the key-set source of truth). */\nconst STATIC_ZH = {\n tab: '插件管理',\n loading: '正在读取插件…',\n empty: '尚未安装任何用户插件。',\n userPlugins: '用户插件',\n products: '内置产品',\n conflictTitle: '安装冲突',\n conflictDisabled: '已自动禁用 {name},避免重复挂载。',\n conflictEnabled: '已重新启用 {name}。',\n conflictChanged: '{name} 的状态已变更。',\n undoConflict: '撤销',\n conflictHint: '冲突动作在安装时自动执行,撤销会写回开关并在重启后生效。',\n installPlaceholder: 'npm 包名(如 @scope/name)或 git 仓库 URL',\n install: '安装',\n installing: '安装中…',\n installHint: '在 GitHub 或 npm 找到插件后,粘贴其 npm 包名或仓库地址安装;应用重启后插件生效。',\n version: '已安装 {version}',\n latest: '最新 {version}',\n update: '更新',\n updating: '更新中…',\n checkUpdates: '检查更新',\n checking: '检查中…',\n noUpdates: '所有插件都是最新版本。',\n updateRequiresDsh: '需要 DSH ≥ {min}',\n updateBlockedDsh: '需要 DSH ≥ {min},请先升级 DSH 再更新',\n uninstall: '卸载',\n uninstallConfirmTitle: '卸载插件',\n uninstallConfirmBody: '将删除 {name} 的安装目录与配置行,并在重启后生效。',\n confirm: '确认卸载',\n cancel: '取消',\n restartHint: '插件变更将在重启应用后生效。',\n failed: '操作失败:{reason}',\n enabled: '已开启',\n disabled: '已关闭',\n mixed: '部分开启',\n unavailable: '不可用',\n uninstalled: '已卸载',\n source: '查看源码',\n applying: '正在应用更改…',\n fetching: '正在获取插件信息…',\n downloading: '正在下载…',\n downloadingPercent: '正在下载 {percent}%',\n extracting: '正在解压…',\n writing: '正在写入配置…',\n localOnlyTitle: '仅限本机操作',\n localOnlyBody: '为了保护主机配置,插件管理只能从本机打开。',\n failureBadge: '启动失败',\n failureGroupTitle: '其他启动失败',\n repair: '让 Agent 修复',\n repairing: '正在创建修复对话…',\n copyError: '复制错误',\n copied: '已复制',\n safeModeBanner: '安全模式:用户插件配置已跳过,插件开关不可用。',\n exitSafeMode: '恢复正常模式并重启',\n npmSource: 'npm',\n gitSource: 'git',\n enableSwitch: '开启 {name}',\n disableSwitch: '关闭 {name}',\n repairInstallTitle: '插件安装失败,请帮我诊断并修复。',\n repairInstallSpecLabel: '安装目标',\n repairInstallErrorLabel: '错误信息',\n repairInstallAsk: '请检查该插件并重新安装;完成后告诉我结果。',\n repairFailureTitle: '插件上次启动失败。请修复它。',\n repairFailurePluginLabel: '插件',\n repairFailureKindLabel: '失败类型',\n repairFailureAtLabel: '时间',\n repairFailureMessageLabel: '失败详情',\n repairFailureStackLabel: '原始堆栈',\n repairFailurePathLabel: '插件安装目录',\n repairFailureAsk: '请检查并修复该插件;修复完成后告诉我如何重新启用。',\n repairKindLoad: '加载失败',\n repairKindHang: '启动挂起',\n repairKindLate: '迟到拒绝',\n repairConflictTitle: '正在处理插件安装冲突',\n repairConflictPluginLabel: '冲突条目',\n repairConflictChangeLabel: '状态变化',\n repairConflictAsk: '请检查冲突双方的入口行 id 与挂载方式,消除重复挂载后告诉我如何重新启用。',\n repairStateEnabled: '已开启',\n repairStateDisabled: '已关闭',\n repairStateUninstalled: '已卸载',\n} satisfies Record<string, string>\n\n/** English copy, checked complete against the zh key set. */\nconst STATIC_EN = {\n tab: 'Plugin manager',\n loading: 'Reading plugins…',\n empty: 'No user plugins installed yet.',\n userPlugins: 'User plugins',\n products: 'Built-in products',\n conflictTitle: 'Install conflicts',\n conflictDisabled: 'Automatically disabled {name} to avoid double mounting.',\n conflictEnabled: 'Re-enabled {name}.',\n conflictChanged: 'The state of {name} changed.',\n undoConflict: 'Undo',\n conflictHint: 'Conflict actions run automatically at install time; undoing writes the switch back and applies after a restart.',\n installPlaceholder: 'npm package (e.g. @scope/name) or git repository URL',\n install: 'Install',\n installing: 'Installing…',\n installHint: 'Find a plugin on GitHub or npm, then paste its npm package name or repository URL; plugins load after a restart.',\n version: 'Installed {version}',\n latest: 'Latest {version}',\n update: 'Update',\n updating: 'Updating…',\n checkUpdates: 'Check for updates',\n checking: 'Checking…',\n noUpdates: 'All plugins are up to date.',\n updateRequiresDsh: 'Requires DSH >= {min}',\n updateBlockedDsh: 'Requires DSH >= {min}; upgrade DSH before updating',\n uninstall: 'Uninstall',\n uninstallConfirmTitle: 'Uninstall plugin',\n uninstallConfirmBody: '{name} and its configuration row will be removed; the change applies after a restart.',\n confirm: 'Uninstall',\n cancel: 'Cancel',\n restartHint: 'Plugin changes take effect after restarting the application.',\n failed: 'Operation failed: {reason}',\n enabled: 'On',\n disabled: 'Off',\n mixed: 'Partially on',\n unavailable: 'Unavailable',\n uninstalled: 'Uninstalled',\n source: 'View source',\n applying: 'Applying change…',\n fetching: 'Fetching plugin metadata…',\n downloading: 'Downloading…',\n downloadingPercent: 'Downloading {percent}%',\n extracting: 'Extracting…',\n writing: 'Writing configuration…',\n localOnlyTitle: 'Available on this computer only',\n localOnlyBody: 'To protect host configuration, plugin management is only available from a local browser.',\n failureBadge: 'Startup failure',\n failureGroupTitle: 'Other startup failures',\n repair: 'Ask the agent to fix',\n repairing: 'Opening repair conversation…',\n copyError: 'Copy error',\n copied: 'Copied',\n safeModeBanner: 'Safe mode: user plugin configuration is skipped; plugin switches are disabled.',\n exitSafeMode: 'Restore normal mode and restart',\n npmSource: 'npm',\n gitSource: 'git',\n enableSwitch: 'Turn on {name}',\n disableSwitch: 'Turn off {name}',\n repairInstallTitle: 'The plugin installation failed. Please diagnose and fix it.',\n repairInstallSpecLabel: 'Install target',\n repairInstallErrorLabel: 'Error message',\n repairInstallAsk: 'Please inspect the plugin and reinstall it; tell me when it is done.',\n repairFailureTitle: 'A plugin failed to start last time. Please fix it.',\n repairFailurePluginLabel: 'Plugin',\n repairFailureKindLabel: 'Failure kind',\n repairFailureAtLabel: 'At',\n repairFailureMessageLabel: 'Failure details',\n repairFailureStackLabel: 'Original stack',\n repairFailurePathLabel: 'Plugin install directory',\n repairFailureAsk: 'Please inspect and fix the plugin; tell me how to re-enable it afterwards.',\n repairKindLoad: 'Load failure',\n repairKindHang: 'Startup hang',\n repairKindLate: 'Late rejection',\n repairConflictTitle: 'Handling a plugin install conflict',\n repairConflictPluginLabel: 'Conflicting entry',\n repairConflictChangeLabel: 'State change',\n repairConflictAsk: 'Inspect the entry ids and mounting of both sides, resolve the double mount, and tell me how to re-enable.',\n repairStateEnabled: 'On',\n repairStateDisabled: 'Off',\n repairStateUninstalled: 'Uninstalled',\n} satisfies Record<keyof typeof STATIC_ZH, string>\n\nexport const zh = STATIC_ZH\nexport const en = STATIC_EN\nexport type PluginManagerKey = keyof typeof STATIC_ZH\n","/**\n * Wire parsing for the official plugin-installer / plugin-control RPC\n * channels. This package is a browser-side consumer of those channels: every\n * response is decoded but untrusted, so each parser validates the shape it\n * needs and throws a typed error on mismatch. Callers treat a parse failure\n * as \"channel unavailable or drifted\" and degrade to command hints.\n *\n * The shapes mirror the official web installer tab's wire protocol (see the\n * DSH checkout's packages/client/ui-settings-plugin-installer/src/client/\n * protocol.ts); they are a contract observation, not an import.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\n/** One installed user-plugin row served by `/plugin-installer list`. */\nexport interface InstalledPluginItem {\n id: string\n name: string\n version: string\n source: { kind: 'npm' | 'git'; spec: string }\n installedAt: string\n /** Saved next-start enablement from the managed profile patch row. */\n enabled: boolean\n commit?: string\n}\n\n/** Point-in-time install/update progress reported by the host. */\nexport interface InstallProgressItem {\n kind: 'idle' | 'install' | 'update'\n stage: 'fetch' | 'download' | 'extract' | 'write'\n percent?: number\n}\n\n/** Whether an update row is a normal same-name update or a legacy package migration. */\nexport type PluginUpdateKind = 'update' | 'migrate'\n\n/** One plugin with a newer version available. */\nexport interface PluginUpdateItem {\n id: string\n current: string\n latest: string\n /** Normal same-name update or legacy aggregate migration. Defaults to update. */\n kind?: PluginUpdateKind\n /** Target package name when kind is migrate. */\n target?: string\n /** Exact target package version when kind is migrate. */\n targetVersion?: string\n /** Declared DSH minimum the update needs (package manifest's `dsh.engines.dsh`). */\n requiresDsh?: string\n /** Whether the running DSH host satisfies requiresDsh; absent when unknown. */\n compatible?: boolean\n}\n\n/** One recorded plugin boot failure served by the host. */\nexport interface PluginFailureItem {\n /** Installed plugin id (package name); empty for unattributable failures. */\n pluginId: string\n kind: 'load-failure' | 'hang' | 'late-rejection'\n message: string\n stack: string\n installPath: string\n at: string\n}\n\n/** Recovery facts served by the host: the failure ring, the plugin root, and safe mode. */\nexport interface PluginFailuresSnapshot {\n items: PluginFailureItem[]\n /** Absolute plugin install root — the repair conversation's workspace. */\n pluginRoot: string\n /** Whether the host is running in safe mode (user plugins skipped). */\n safeMode: boolean\n}\n\n/** One deployment-configured logical product switch. */\nexport interface PluginControlItem {\n id: string\n name: string\n repository: string\n state: 'enabled' | 'disabled' | 'mixed' | 'unavailable' | 'uninstalled'\n}\n\n/** Whether a decoded value is a non-array object. */\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\n/** Whether a decoded value is a string. */\nfunction isString(value: unknown): value is string {\n return typeof value === 'string'\n}\n\n/** Validate one installed-plugin row. */\nfunction parsePlugin(value: unknown, index: number): InstalledPluginItem {\n if (!isRecord(value) || !isString(value.id) || !isString(value.name)\n || !isString(value.version) || !isString(value.installedAt)\n || typeof value.enabled !== 'boolean'\n || !isRecord(value.source) || (value.source.kind !== 'npm' && value.source.kind !== 'git')\n || !isString(value.source.spec)) {\n throw new Error(`plugin-manager: plugin row ${String(index)} is invalid`)\n }\n return {\n id: value.id,\n name: value.name,\n version: value.version,\n source: { kind: value.source.kind, spec: value.source.spec },\n installedAt: value.installedAt,\n enabled: value.enabled,\n ...isString(value.commit) ? { commit: value.commit } : {},\n }\n}\n\n/**\n * Validate and normalize a `list` / `uninstall` response value.\n * @param value - decoded but untrusted response value.\n * @returns typed installed-plugin rows.\n */\nexport function parsePluginList(value: unknown): InstalledPluginItem[] {\n if (!isRecord(value) || !Array.isArray(value.plugins)) {\n throw new Error('plugin-manager: response must contain a plugins array')\n }\n return value.plugins.map((plugin, index) => parsePlugin(plugin, index))\n}\n\n/**\n * Validate and normalize an `install` / `update` / `set-enabled` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed installed-plugin row.\n */\nexport function parseInstalledPlugin(value: unknown): InstalledPluginItem {\n if (!isRecord(value) || value.plugin === undefined) {\n throw new Error('plugin-manager: response must contain a plugin row')\n }\n return parsePlugin(value.plugin, 0)\n}\n\n/**\n * Validate and normalize a plugin-control `list` / `set-enabled` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed control items.\n */\nexport function parsePluginControlSnapshot(value: unknown): PluginControlItem[] {\n if (!isRecord(value) || !Array.isArray(value.controls)) {\n throw new Error('plugin-manager: response must contain a controls array')\n }\n return value.controls.map((control, index) => {\n if (!isRecord(control) || !isString(control.id) || !isString(control.name)\n || !isString(control.repository)\n || (control.state !== 'enabled' && control.state !== 'disabled'\n && control.state !== 'mixed' && control.state !== 'unavailable'\n && control.state !== 'uninstalled')) {\n throw new Error(`plugin-manager: control row ${String(index)} is invalid`)\n }\n return {\n id: control.id,\n name: control.name,\n repository: control.repository,\n state: control.state,\n }\n })\n}\n\n/**\n * Validate and normalize a `status` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed progress state.\n */\nexport function parseInstallStatus(value: unknown): InstallProgressItem {\n if (!isRecord(value) || !isRecord(value.progress)\n || (value.progress.kind !== 'idle' && value.progress.kind !== 'install' && value.progress.kind !== 'update')\n || (value.progress.stage !== 'fetch' && value.progress.stage !== 'download'\n && value.progress.stage !== 'extract' && value.progress.stage !== 'write')\n || (value.progress.percent !== undefined\n && (typeof value.progress.percent !== 'number' || !Number.isFinite(value.progress.percent)))) {\n throw new Error('plugin-manager: response must contain a valid progress state')\n }\n return {\n kind: value.progress.kind,\n stage: value.progress.stage,\n ...typeof value.progress.percent === 'number' ? { percent: value.progress.percent } : {},\n }\n}\n\n/**\n * Validate and normalize a `check-updates` response value.\n * @param value - decoded but untrusted response value.\n * @returns typed update rows.\n */\nexport function parseUpdateList(value: unknown): PluginUpdateItem[] {\n if (!isRecord(value) || !Array.isArray(value.updates)) {\n throw new Error('plugin-manager: response must contain an updates array')\n }\n return value.updates.map((update, index) => {\n if (!isRecord(update) || !isString(update.id) || !isString(update.current) || !isString(update.latest)) {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n const kind = update.kind === undefined ? 'update' : update.kind\n if (kind !== 'update' && kind !== 'migrate') {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n const row: PluginUpdateItem = { id: update.id, current: update.current, latest: update.latest }\n if (kind === 'migrate') {\n if (!isString(update.target) || !isString(update.targetVersion)) {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n row.kind = 'migrate'\n row.target = update.target\n row.targetVersion = update.targetVersion\n }\n if (update.requiresDsh !== undefined) {\n if (!isString(update.requiresDsh)) {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n row.requiresDsh = update.requiresDsh\n }\n if (update.compatible !== undefined) {\n if (typeof update.compatible !== 'boolean') {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n row.compatible = update.compatible\n }\n return row\n })\n}\n\n/**\n * Validate and normalize a `failures` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed failures snapshot.\n */\nexport function parseFailuresSnapshot(value: unknown): PluginFailuresSnapshot {\n if (!isRecord(value) || !Array.isArray(value.items)\n || !isString(value.pluginRoot) || typeof value.safeMode !== 'boolean') {\n throw new Error('plugin-manager: response must contain a failures snapshot')\n }\n return {\n items: value.items.map((item, index) => {\n if (!isRecord(item) || !isString(item.pluginId)\n || (item.kind !== 'load-failure' && item.kind !== 'hang' && item.kind !== 'late-rejection')\n || !isString(item.message) || !isString(item.stack)\n || !isString(item.installPath) || !isString(item.at)) {\n throw new Error(`plugin-manager: failure row ${String(index)} is invalid`)\n }\n return {\n pluginId: item.pluginId,\n kind: item.kind,\n message: item.message,\n stack: item.stack,\n installPath: item.installPath,\n at: item.at,\n }\n }),\n pluginRoot: value.pluginRoot,\n safeMode: value.safeMode,\n }\n}\n","/**\n * The cordis service contract this package exposes to sibling client plugins\n * under the name `'pluginManager'`. The browser half builds one dual-channel\n * face (official /plugin-installer + /plugin-control RPC channels when\n * available, else this package's loopback HTTP gateway) and provides it via\n * `ctx.provide('pluginManager', face)`; consumers resolve it with\n * `ctx.inject(['pluginManager'], cb)` and read `ctx.pluginManager`.\n *\n * The interface is intentionally narrower than the face the Plugin manager\n * tab receives (`PluginManagerFace` in the client half): it is the stable\n * cross-plugin surface, so it only carries the operations a sibling plugin\n * needs to observe and drive the installed-plugin set.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\nimport type { InstallProgressItem, InstalledPluginItem, PluginFailuresSnapshot } from './protocol.ts'\n\n/** The cordis service name the browser half provides the face under. */\nexport const PLUGIN_MANAGER_SERVICE = 'pluginManager'\n\n/**\n * The dual-channel plugin-management face, shared between the Plugin manager\n * tab and sibling client plugins.\n */\nexport interface PluginManagerService {\n /** Whether this browser has loopback authority to use the host routes. */\n readonly isLoopback: boolean\n /** Read the installed snapshot. */\n list(): Promise<InstalledPluginItem[]>\n /** Install one plugin from an npm spec or git URL. */\n install(spec: string): Promise<InstalledPluginItem>\n /** Remove one plugin. */\n uninstall(id: string): Promise<InstalledPluginItem[]>\n /** Read the current install/update progress. */\n status(): Promise<InstallProgressItem>\n /**\n * Read the recorded plugin boot-failure ring (plugin id, message, stack,\n * install path). On runtimes without a failure ring the host answers an\n * empty snapshot.\n */\n failures(): Promise<PluginFailuresSnapshot>\n /**\n * Flip one plugin's next-start enablement through the active channel (the\n * official installer RPC when available, else the loopback gateway's patch\n * `disabled` override row). The change takes effect after the host restart;\n * a running plugin is not stopped.\n */\n setEnabled(id: string, enabled: boolean): Promise<InstalledPluginItem>\n /**\n * Subscribe to successful mutations: the callback runs after install(),\n * update(), uninstall(), or setEnabled() resolves. One listener throwing\n * never breaks the others. Returns the unsubscribe function.\n */\n onChange(cb: () => void): () => void\n}\n\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n /** The plugin-manager face (provided by the dsh-plugin-manager client half). */\n pluginManager: PluginManagerService\n }\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/telemetry.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Anonymous install telemetry shared by the DSH Web UI family plugins.\n *\n * Once per UTC day per browser, each wired plugin sends one heartbeat to\n * the dsh-market edge API listing its package name (and version when known).\n * The payload carries no conversation data and no identifiers beyond a random\n * UUID generated in localStorage; the server hashes it with a deployment salt\n * before storage and never persists IP addresses. Sends are fire-and-forget:\n * failures stay silent and simply retry on a later mount or day. The system\n * is documented in docs/telemetry.md.\n */\n\nexport type TelemetryChannel = 'market' | 'npm' | 'unknown'\n\nexport interface TelemetryItem {\n /** npm package name or asset id, e.g. \"@linxin666/dsh-pet\" or \"skin:harbor\". */\n name: string\n /** Installed version when known; omitted otherwise. */\n version?: string\n /** Install channel when determinable (market = Workshop install). */\n channel?: TelemetryChannel\n}\n\nconst VISITOR_KEY = 'dsh-web-ui-telemetry-visitor'\nconst DAY_KEY_PREFIX = 'dsh-web-ui-telemetry-day:'\nconst ENDPOINT = 'https://dsh-market.com/api/telemetry/event'\n\n// Baked into each client bundle by shared/tsdown.client.ts (the package's own\n// package.json version at build time). Undefined in dev/test builds.\ndeclare const __DSH_PKG_VERSION__: string | undefined\n\n/** The building package's version, when the bundle carries it. */\nfunction bakedVersion(): string | undefined {\n try {\n return typeof __DSH_PKG_VERSION__ === 'string' && __DSH_PKG_VERSION__ !== ''\n ? __DSH_PKG_VERSION__\n : undefined\n } catch {\n return undefined\n }\n}\n\n/** Read or lazily create the anonymous visitor id; null when storage is unavailable. */\nfunction visitorId(): string | null {\n try {\n const existing = localStorage.getItem(VISITOR_KEY)\n if (existing && /^[A-Za-z0-9_-]{16,64}$/.test(existing)) return existing\n const fresh = crypto.randomUUID().replaceAll('-', '')\n localStorage.setItem(VISITOR_KEY, fresh)\n return fresh\n } catch {\n // Storage unavailable (privacy mode, sandboxed frame): report nothing.\n return null\n }\n}\n\n/** Drop stale per-day dedup keys so localStorage does not grow forever. */\nfunction pruneDayKeys(today: string): void {\n try {\n for (let index = localStorage.length - 1; index >= 0; index -= 1) {\n const key = localStorage.key(index)\n if (key !== null && key.startsWith(DAY_KEY_PREFIX) && key !== DAY_KEY_PREFIX + today) {\n localStorage.removeItem(key)\n }\n }\n } catch { /* best effort */ }\n}\n\n/**\n * Fire the daily heartbeat for the given items at most once per UTC day per\n * browser. Never throws and never blocks the caller. Items without an explicit\n * version inherit the bundle's baked build version.\n */\nexport function reportDailyHeartbeat(items: readonly TelemetryItem[]): void {\n try {\n if (items.length === 0) return\n const today = new Date().toISOString().slice(0, 10)\n // Automation contexts (CDP-driven QA browsers, fresh isolated profiles)\n // mint a new visitor id per run and would inflate instance counts.\n if (navigator.webdriver) return\n if (localStorage.getItem(DAY_KEY_PREFIX + today) !== null) return\n const visitor = visitorId()\n if (visitor === null) return\n pruneDayKeys(today)\n const payloadItems = items.map((item) => {\n const out: Record<string, string> = { name: item.name }\n const version = item.version ?? bakedVersion()\n if (version !== undefined) out.version = version\n if (item.channel !== undefined) out.channel = item.channel\n return out\n })\n const body = JSON.stringify({ kind: 'heartbeat', visitor, items: payloadItems })\n void fetch(ENDPOINT, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body,\n keepalive: true,\n }).then((response) => {\n // Mark the day only after an accepted send, so offline browsers retry\n // on a later mount instead of going dark until tomorrow.\n if (response.ok) localStorage.setItem(DAY_KEY_PREFIX + today, '1')\n }).catch(() => { /* unreachable endpoint: stay silent */ })\n } catch { /* never break the host UI over telemetry */ }\n}\n","/**\n * Plugin-manager browser half: contributes the family plugin-manager tab to\n * the official Plugins settings section (`settings.plugins.tab` slot) and\n * provides the same dual-channel face as the `'pluginManager'` cordis\n * service for sibling client plugins. It is dual-channel: on runtimes with\n * the official installer services (DSHCode, the 1.0.4 checkout web) every\n * operation rides the official `/plugin-installer` and `/plugin-control`\n * loopback RPC channels (the single writer); on the npm-published web runtime\n * those channels do not exist, so the same face falls back to this package's\n * own loopback HTTP gateway, which spawns the official CLI for writes.\n * Neither the tab nor service consumers know which mode the face runs in.\n * @module @linxin666/dsh-client-ui-plugin-manager/client\n */\n\n// Type-only: pulls the locale plugin's Context merge (ctx.locale).\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the settings surface's slot contracts (settings.plugins.tab).\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\n// Type-only: pulls the client runtime Context merge (ctx.workspaces, ctx.sessions).\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-api-session-controller/client'\nimport type {} from '@deepseek-ai/dsh-api-workspace-controller/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-client-connection/client'\nimport { PluginManagerTab, type PluginManagerTabInjected } from './PluginManagerTab.tsx'\nimport { en, zh, type PluginManagerKey } from './locales.ts'\nimport {\n parseFailuresSnapshot,\n parseInstallStatus,\n parseInstalledPlugin,\n parsePluginControlSnapshot,\n parsePluginList,\n parseUpdateList,\n type InstalledPluginItem,\n type InstallProgressItem,\n type PluginControlItem,\n type PluginFailuresSnapshot,\n type PluginUpdateItem,\n} from '../core/protocol.ts'\nimport { PLUGIN_MANAGER_SERVICE, type PluginManagerService } from '../core/service.ts'\nimport type { ControlChange } from '../core/conflict.ts'\nimport { reportDailyHeartbeat } from './telemetry.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Copy for the family plugin-manager tab. */\n 'settings.pluginManager': PluginManagerKey\n }\n}\n\nconst NS = 'settings.pluginManager'\nconst CHANNEL = '/plugin-installer'\nconst CONTROL_CHANNEL = '/plugin-control'\nconst LIST_ENDPOINT = 'list'\nconst INSTALL_ENDPOINT = 'install'\nconst UPDATE_ENDPOINT = 'update'\nconst UNINSTALL_ENDPOINT = 'uninstall'\nconst SET_ENABLED_ENDPOINT = 'set-enabled'\nconst CHECK_UPDATES_ENDPOINT = 'check-updates'\nconst STATUS_ENDPOINT = 'status'\nconst FAILURES_ENDPOINT = 'failures'\nconst SET_SAFE_MODE_ENDPOINT = 'set-safe-mode'\n\nconst GATEWAY_PREFIX = '/api/plugin-manager'\n/** Gateway job polling cadence. */\nconst JOB_POLL_MS = 500\n/** Gateway job wait ceiling (the host add deadline is six minutes). */\nconst JOB_WAIT_MS = 7 * 60_000\n\n/** Services required by the slot registration and both channels. */\nexport const inject = ['slots', 'locale', 'connection', 'workspaces', 'sessions']\n\n/** The gateway job wire shape served by /status. */\ninterface GatewayJobWire {\n phase: 'running' | 'done' | 'error'\n plugin?: unknown\n conflicts?: unknown\n error?: string\n}\n\n/**\n * The face the Plugin manager tab and the `'pluginManager'` cordis service\n * share: the full tab surface plus the cross-plugin service contract.\n */\nexport type PluginManagerFace = PluginManagerTabInjected & PluginManagerService\n\n/**\n * Build the dual-channel face once: official-channel and gateway-channel\n * implementations, the mode detection that picks between them, the repair\n * handoff, and the change-notification listener set. The returned face is\n * both the tab's injected props and the value provided as the\n * `'pluginManager'` cordis service.\n * @param ctx - the client context (connection, workspaces, sessions).\n * @returns the shared face.\n */\nexport function createPluginManagerFace(ctx: ClientContext): PluginManagerFace {\n const connection = ctx.get('connection') as ConnectionHandle\n\n // ── official channel implementations ──────────────────────────────────────\n\n const call = async (endpoint: string, payload: unknown): Promise<unknown> => {\n const result = await connection.rpc.call(CHANNEL, endpoint, payload)\n if (!result.ok) {\n throw new Error(`plugin-installer ${endpoint} failed: ${result.error.code}: ${result.error.message}`)\n }\n return result.value\n }\n const official = {\n list: async (): Promise<InstalledPluginItem[]> => parsePluginList(await call(LIST_ENDPOINT, {})),\n install: async (spec: string): Promise<InstalledPluginItem> => parseInstalledPlugin(await call(INSTALL_ENDPOINT, { spec })),\n update: async (id: string): Promise<InstalledPluginItem> => parseInstalledPlugin(await call(UPDATE_ENDPOINT, { id })),\n uninstall: async (id: string): Promise<InstalledPluginItem[]> => parsePluginList(await call(UNINSTALL_ENDPOINT, { id })),\n setEnabled: async (id: string, enabled: boolean): Promise<InstalledPluginItem> =>\n parseInstalledPlugin(await call(SET_ENABLED_ENDPOINT, { id, enabled })),\n checkUpdates: async (): Promise<PluginUpdateItem[]> => parseUpdateList(await call(CHECK_UPDATES_ENDPOINT, {})),\n status: async (): Promise<InstallProgressItem> => parseInstallStatus(await call(STATUS_ENDPOINT, {})),\n failures: async (): Promise<PluginFailuresSnapshot> => parseFailuresSnapshot(await call(FAILURES_ENDPOINT, {})),\n setSafeMode: async (enabled: boolean): Promise<void> => {\n await call(SET_SAFE_MODE_ENDPOINT, { enabled })\n },\n controlsList: async (): Promise<PluginControlItem[]> =>\n parsePluginControlSnapshot(await connection.rpc.call(CONTROL_CHANNEL, 'list', {}).then(result => {\n if (!result.ok) throw new Error(`plugin-control list failed: ${result.error.code}: ${result.error.message}`)\n return result.value\n })),\n controlsSetEnabled: async (pluginId: string, enabled: boolean): Promise<PluginControlItem[]> =>\n parsePluginControlSnapshot(await connection.rpc.call(CONTROL_CHANNEL, 'set-enabled', { pluginId, enabled }).then(result => {\n if (!result.ok) throw new Error(`plugin-control set-enabled failed: ${result.error.code}: ${result.error.message}`)\n return result.value\n })),\n }\n\n // ── gateway channel implementations ──────────────────────────────────────\n\n const gatewayJson = async (path: string, init?: RequestInit): Promise<unknown> => {\n const response = await fetch(path, {\n ...init,\n headers: { 'content-type': 'application/json', ...init?.headers },\n })\n if (response.status === 403) {\n throw new Error('plugin-manager: plugin management is only available from a local browser')\n }\n if (!response.ok) {\n const body = await response.json().catch(() => ({})) as { error?: string }\n throw new Error(body.error ?? `plugin-manager: gateway ${path} failed: HTTP ${String(response.status)}`)\n }\n return response.json()\n }\n\n /** Wait for one gateway job to settle, returning its wire state. */\n const waitJob = async (jobId: string): Promise<GatewayJobWire> => {\n const deadline = Date.now() + JOB_WAIT_MS\n for (;;) {\n const body = await gatewayJson(`${GATEWAY_PREFIX}/status?job=${encodeURIComponent(jobId)}`) as { job?: GatewayJobWire }\n const job = body.job\n if (job === undefined) throw new Error('plugin-manager: gateway job vanished')\n if (job.phase === 'done') return job\n if (job.phase === 'error') throw new Error(job.error ?? 'plugin-manager: gateway job failed')\n if (Date.now() > deadline) throw new Error('plugin-manager: gateway job timed out')\n await new Promise(resolve => { setTimeout(resolve, JOB_POLL_MS) })\n }\n }\n\n /** The conflict ledger of the last settled gateway install. */\n let lastInstallConflicts: ControlChange[] = []\n /** Whether a gateway install/remove is in flight (drives the progress row). */\n let gatewayInflight = false\n\n const gateway = {\n list: async (): Promise<InstalledPluginItem[]> =>\n parsePluginList(await gatewayJson(`${GATEWAY_PREFIX}/list`)),\n install: async (spec: string): Promise<InstalledPluginItem> => {\n gatewayInflight = true\n try {\n const started = await gatewayJson(`${GATEWAY_PREFIX}/install`, {\n method: 'POST',\n body: JSON.stringify({ spec }),\n }) as { jobId?: string }\n if (started.jobId === undefined) throw new Error('plugin-manager: gateway install returned no job')\n const job = await waitJob(started.jobId)\n lastInstallConflicts = Array.isArray(job.conflicts) ? job.conflicts as ControlChange[] : []\n return parseInstalledPlugin({ plugin: job.plugin })\n } finally {\n gatewayInflight = false\n }\n },\n update: async (id: string): Promise<InstalledPluginItem> => {\n gatewayInflight = true\n try {\n const started = await gatewayJson(`${GATEWAY_PREFIX}/update`, {\n method: 'POST',\n body: JSON.stringify({ id }),\n }) as { jobId?: string }\n if (started.jobId === undefined) throw new Error('plugin-manager: gateway update returned no job')\n const job = await waitJob(started.jobId)\n lastInstallConflicts = Array.isArray(job.conflicts) ? job.conflicts as ControlChange[] : []\n return parseInstalledPlugin({ plugin: job.plugin })\n } finally {\n gatewayInflight = false\n }\n },\n uninstall: async (id: string): Promise<InstalledPluginItem[]> => {\n gatewayInflight = true\n try {\n const started = await gatewayJson(`${GATEWAY_PREFIX}/remove`, {\n method: 'POST',\n body: JSON.stringify({ id }),\n }) as { jobId?: string }\n if (started.jobId === undefined) throw new Error('plugin-manager: gateway remove returned no job')\n await waitJob(started.jobId)\n return gateway.list()\n } finally {\n gatewayInflight = false\n }\n },\n setEnabled: async (id: string, enabled: boolean): Promise<InstalledPluginItem> =>\n parseInstalledPlugin(await gatewayJson(`${GATEWAY_PREFIX}/set-enabled`, {\n method: 'POST',\n body: JSON.stringify({ id, enabled }),\n })),\n checkUpdates: async (): Promise<PluginUpdateItem[]> =>\n parseUpdateList(await gatewayJson(`${GATEWAY_PREFIX}/check-updates`)),\n status: async (): Promise<InstallProgressItem> =>\n gatewayInflight ? { kind: 'install', stage: 'download' } : { kind: 'idle', stage: 'fetch' },\n failures: async (): Promise<PluginFailuresSnapshot> =>\n parseFailuresSnapshot(await gatewayJson(`${GATEWAY_PREFIX}/failures`)),\n setSafeMode: async (): Promise<void> => {\n throw new Error('plugin-manager: safe mode is unavailable in this runtime')\n },\n controlsList: async (): Promise<PluginControlItem[]> => [],\n controlsSetEnabled: async (pluginId: string, enabled: boolean): Promise<PluginControlItem[]> => {\n await gateway.setEnabled(pluginId, enabled)\n return []\n },\n }\n\n // ── mode selection ────────────────────────────────────────────────────────\n\n let modePromise: Promise<'official' | 'gateway'> | undefined\n const ensureMode = (): Promise<'official' | 'gateway'> => {\n if (modePromise === undefined) {\n modePromise = (async () => {\n // Prefer the host verdict: the gateway's /mode route reports whether\n // the official installer channels exist, so the direct channel probe\n // below (which 405s into the browser console on the npm web runtime)\n // only runs when the host half is absent or explicitly returns null\n // for a desktop runtime whose services are registered in-process.\n try {\n const mode = await gatewayJson(`${GATEWAY_PREFIX}/mode`) as { official?: boolean | null }\n if (mode.official === true) return 'official' as const\n if (mode.official === false) return 'gateway' as const\n } catch {\n // Host half absent (an official runtime without a boot profile):\n // fall back to the direct channel probe.\n }\n try {\n const result = await connection.rpc.call(CHANNEL, LIST_ENDPOINT, {})\n return result.ok ? 'official' as const : 'gateway' as const\n } catch {\n return 'gateway' as const\n }\n })()\n }\n return modePromise\n }\n\n /**\n * Start a repair conversation for a failed plugin: resolve a workspace over\n * the plugin install root (created once, reused after), open a fresh\n * session there, and seed its first prompt with the failure details. The\n * session's workspace is the plugin home so the agent's file tools reach\n * the plugin code without leaving the workspace boundary.\n * @param pluginRoot - absolute plugin install root.\n * @param message - the seeded first user message.\n * @returns resolution after the prompt is accepted and the session opens.\n */\n const repairPlugin = async (pluginRoot: string, message: string): Promise<void> => {\n const workspace = await ctx.workspaces.create({ path: pluginRoot })\n const sessionId = await ctx.sessions.create({ workspaceId: workspace.workspaceId })\n const binding = ctx.sessions.binding(sessionId)\n if (binding === undefined) throw new Error(`plugin-manager: repair session ${sessionId} is unavailable`)\n const result = await binding.session.prompt([{ type: 'text', text: message }], 'queue')\n if (!result.ok) throw new Error(`plugin-manager: repair prompt failed: ${result.error.code}: ${result.error.message}`)\n ctx.sessions.open(sessionId)\n }\n\n // ── change notification ───────────────────────────────────────────────────\n\n /** Listeners subscribed through onChange; fired after successful mutations. */\n const listeners = new Set<() => void>()\n /** Notify every listener; one listener throwing never breaks the others. */\n const notifyChange = (): void => {\n for (const listener of [...listeners]) {\n try {\n listener()\n } catch {\n // A consumer's listener failure is its own; keep notifying the rest.\n }\n }\n }\n\n // ── the shared face ───────────────────────────────────────────────────────\n\n return {\n isLoopback: connection.isLoopback,\n list: async () => (await ensureMode()) === 'official' ? official.list() : gateway.list(),\n install: async spec => {\n const item = await ((await ensureMode()) === 'official' ? official.install(spec) : gateway.install(spec))\n notifyChange()\n return item\n },\n update: async id => {\n const item = await ((await ensureMode()) === 'official' ? official.update(id) : gateway.update(id))\n notifyChange()\n return item\n },\n uninstall: async id => {\n const rows = await ((await ensureMode()) === 'official' ? official.uninstall(id) : gateway.uninstall(id))\n notifyChange()\n return rows\n },\n setEnabled: async (id, enabled) => {\n const item = await ((await ensureMode()) === 'official' ? official.setEnabled(id, enabled) : gateway.setEnabled(id, enabled))\n notifyChange()\n return item\n },\n checkUpdates: async () => (await ensureMode()) === 'official' ? official.checkUpdates() : gateway.checkUpdates(),\n status: async () => (await ensureMode()) === 'official' ? official.status() : gateway.status(),\n failures: async () => (await ensureMode()) === 'official' ? official.failures() : gateway.failures(),\n setSafeMode: async enabled => (await ensureMode()) === 'official' ? official.setSafeMode(enabled) : gateway.setSafeMode(),\n repairPlugin,\n controlsList: async () => (await ensureMode()) === 'official' ? official.controlsList() : gateway.controlsList(),\n controlsSetEnabled: async (id, enabled) => (await ensureMode()) === 'official' ? official.controlsSetEnabled(id, enabled) : gateway.controlsSetEnabled(id, enabled),\n lastInstallConflicts: () => lastInstallConflicts,\n onChange: cb => {\n listeners.add(cb)\n return () => { listeners.delete(cb) }\n },\n }\n}\n\n/** Contribute the family plugin-manager tab and provide the shared face. */\nexport function apply(ctx: ClientContext): void {\n // Anonymous install heartbeat (docs/telemetry.md): one beat per browser per\n // UTC day, package name only, silent failure.\n reportDailyHeartbeat([{ name: '@linxin666/dsh-client-ui-plugin-manager' }])\n\n ctx.effect(() => {\n try {\n return ctx.locale.register(NS, { zh, en })\n } catch {\n return () => {}\n }\n }, 'plugin-manager: dictionaries')\n\n // Built once: the tab and the 'pluginManager' cordis service share one\n // face, so consumers observe exactly the mutations the tab performs.\n const face = createPluginManagerFace(ctx)\n try {\n if (!ctx.get(PLUGIN_MANAGER_SERVICE)) {\n ctx.provide(PLUGIN_MANAGER_SERVICE, face)\n }\n } catch {\n // ignore duplicate provide\n }\n\n ctx.slots.inject('settings.plugins.tab', () => {\n try {\n return ctx.slots.register({\n name: 'settings.plugins.tab',\n id: 'family-plugins',\n order: 20,\n label: () => ctx.locale.bind(NS)('tab'),\n locale: NS,\n inject: () => face,\n }, PluginManagerTab)\n } catch {\n return () => {}\n }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;EAsCA,SAAgB,aAAa,QAAsC,OAAsD;GACvH,MAAM,YAAY,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YAAa,MAAM,WAAW,MAAO,aAAa,SAAS,mBAAmB,IAAI,OAAO,IAAI,QAAQ,mBAAmB,IAAI,OAAO;IAClK,4BAA4B;IAC5B,WAAU,OAAM;KACd,UAAU,IAAI,EAAE;KAChB,aAAa;MAAE,UAAU,OAAO,EAAE;KAAE;IACtC;GACF;EACF;;EAGA,SAAgB,MAAM,KAA0B;GAG9C,qBAAqB,CAAC,EAAE,MAAM,0CAA0C,CAAC,CAAC;GAE1E,IAAI,aAAa;IACf,IAAI;KACF,OAAO,IAAI,OAAO,SAAS,IAAI;MAAE;MAAI;KAAG,CAAC;IAC3C,QAAQ;KACN,aAAa,CAAC;IAChB;GACF,GAAG,8BAA8B;GAIjC,MAAM,OAAO,wBAAwB,GAAG;GACxC,IAAI;IACF,IAAI,CAAC,IAAI,IAAA,eAA0B,GACjC,IAAI,QAAQ,wBAAwB,IAAI;GAE5C,QAAQ,CAER;GAEA,IAAI,MAAM,OAAO,8BAA8B;IAC7C,IAAI;KACF,OAAO,IAAI,MAAM,SAAS;MACxB,MAAM;MACN,IAAI;MACJ,OAAO;MACP,aAAa,IAAI,OAAO,KAAK,EAAE,CAAC,CAAC,KAAK;MACtC,QAAQ;MACR,cAAc;KAChB,GAAG,gBAAgB;IACrB,QAAQ;KACN,aAAa,CAAC;IAChB;GACF,CAAC;EACH"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Neither the tab nor service consumers know which mode the face runs in.
|
|
12
12
|
* @module @linxin666/dsh-client-ui-plugin-manager/client
|
|
13
13
|
*/
|
|
14
|
-
import type { ClientContext } from '@deepseek-ai/
|
|
14
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
15
15
|
import { type PluginManagerTabInjected } from './PluginManagerTab.tsx';
|
|
16
16
|
import { type PluginManagerKey } from './locales.ts';
|
|
17
17
|
import { type PluginManagerService } from '../core/service.ts';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linxin666/dsh-client-ui-plugin-manager",
|
|
3
3
|
"description": "Plugin manager tab for the dsh web GUI Plugins settings section: installs plugins from npm or git through the official host channels, lists installed plugins with next-start enablement switches, surfaces install-time conflict actions with undo, and hands failures off to repair conversations.",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.10",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/types/index.d.ts",
|
|
@@ -19,15 +19,17 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dsh": {
|
|
21
21
|
"engines": {
|
|
22
|
-
"dsh": ">=0.1.
|
|
22
|
+
"dsh": ">=0.1.2-alpha.1"
|
|
23
23
|
},
|
|
24
24
|
"bundle": {
|
|
25
25
|
"patch": "./cordis.patch.yml"
|
|
26
26
|
},
|
|
27
27
|
"client": {
|
|
28
28
|
"inject": [
|
|
29
|
-
"@deepseek-ai/dsh-
|
|
29
|
+
"@deepseek-ai/dsh-api-session-controller",
|
|
30
|
+
"@deepseek-ai/dsh-api-workspace-controller",
|
|
30
31
|
"@deepseek-ai/dsh-client-connection",
|
|
32
|
+
"@deepseek-ai/dsh-client-ui-renderer",
|
|
31
33
|
"@deepseek-ai/dsh-client-ui-settings"
|
|
32
34
|
],
|
|
33
35
|
"platform": "web"
|
|
@@ -37,13 +39,16 @@
|
|
|
37
39
|
"react": "^18.2.0"
|
|
38
40
|
},
|
|
39
41
|
"devDependencies": {
|
|
40
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
41
|
-
"@deepseek-ai/dsh-
|
|
42
|
-
"@deepseek-ai/dsh-
|
|
43
|
-
"@deepseek-ai/dsh-client-
|
|
44
|
-
"@deepseek-ai/dsh-client-
|
|
45
|
-
"@deepseek-ai/dsh-client-ui-
|
|
46
|
-
"@deepseek-ai/dsh-client-ui-
|
|
42
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
43
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.1.2-alpha.2",
|
|
44
|
+
"@deepseek-ai/dsh-api-workspace-controller": "^0.1.2-alpha.2",
|
|
45
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.2-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.2-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.2-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-alpha.2",
|
|
49
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.2-alpha.2",
|
|
50
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.2-alpha.2",
|
|
51
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.2-alpha.2",
|
|
47
52
|
"@testing-library/react": "^16.1.0",
|
|
48
53
|
"@types/node": "^22.20.0",
|
|
49
54
|
"@types/react": "~18.3.1",
|
|
@@ -53,8 +58,7 @@
|
|
|
53
58
|
"react-dom": "^18.3.1",
|
|
54
59
|
"tsdown": "0.22.2",
|
|
55
60
|
"typescript": "~5.7.2",
|
|
56
|
-
"vitest": "^4.1.1"
|
|
57
|
-
"@deepseek-ai/dsh-host-webserver": "^0.1.1-rc.2"
|
|
61
|
+
"vitest": "^4.1.1"
|
|
58
62
|
},
|
|
59
63
|
"files": [
|
|
60
64
|
"lib",
|