dsh-edge 0.10.0 → 0.11.0
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/README.i18n.yaml +2 -2
- package/README.md +7 -1
- package/README.zh.md +7 -1
- package/THIRD_PARTY_NOTICES.md +3 -1
- package/dist/index.html +1 -1
- package/dist/plugins/@deepseek-ai/dsh-client-ui-directory-picker-browse/client.js +1045 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-plan/client.js +140 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-reference/client.js +252 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/client.js +658 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-plugins/client.js +1827 -0
- package/dist/plugins/dsh-edge-client-ui/client.js +57 -218
- package/package.json +10 -1
- package/worker/direct/index.js +1353 -956
- package/worker/isolated/index.js +983 -586
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: "@deepseek-ai/dsh-client-ui-settings-plugin-inventory",
|
|
3
|
+
factory: (require) => {
|
|
4
|
+
var module = { exports: {} };
|
|
5
|
+
var exports = module.exports;
|
|
6
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
10
|
+
//#region ../../preset/agent-presets/src/display.ts
|
|
11
|
+
const BUILT_IN_PRESET_KEYS = {
|
|
12
|
+
standard: {
|
|
13
|
+
name: "presetStandardName",
|
|
14
|
+
description: "presetStandardDescription"
|
|
15
|
+
},
|
|
16
|
+
ptc: {
|
|
17
|
+
name: "presetPtcName",
|
|
18
|
+
description: "presetPtcDescription"
|
|
19
|
+
},
|
|
20
|
+
minimal: {
|
|
21
|
+
name: "presetMinimalName",
|
|
22
|
+
description: "presetMinimalDescription"
|
|
23
|
+
},
|
|
24
|
+
cordis: {
|
|
25
|
+
name: "presetCordisName",
|
|
26
|
+
description: "presetCordisDescription"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Resolve preset display copy without making user-authored metadata translatable.
|
|
31
|
+
* @param preset - roster row whose copy is being rendered.
|
|
32
|
+
* @param t - active locale lookup covering {@link BuiltInPresetCopyKey}.
|
|
33
|
+
* @returns localized copy for a known shipped preset, otherwise file metadata.
|
|
34
|
+
*/
|
|
35
|
+
function presetDisplayText(preset, t) {
|
|
36
|
+
const keys = preset.trust === "system" ? BUILT_IN_PRESET_KEYS[preset.id] : void 0;
|
|
37
|
+
if (keys !== void 0) return {
|
|
38
|
+
name: t(keys.name),
|
|
39
|
+
description: t(keys.description)
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
name: preset.name ?? preset.id,
|
|
43
|
+
...preset.description === void 0 ? {} : { description: preset.description }
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-settings-plugin-inventory/src/client/PluginInventorySettingsTab.module.css.mjs
|
|
48
|
+
const css = ".qSYn7G_section{width:100%;max-width:760px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:14px;display:flex}.qSYn7G_catalogHeading h3,.qSYn7G_status,.qSYn7G_failure p{margin:0}.qSYn7G_status,.qSYn7G_failure{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:20px}.qSYn7G_failure{color:var(--dsw-alias-state-error-primary);align-items:center;gap:10px;display:flex}.qSYn7G_failure button{border:.5px solid var(--dsw-alias-border-l3);color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:4px 10px}.qSYn7G_catalog{flex-direction:column;gap:12px;display:flex}.qSYn7G_search{width:100%;color:var(--dsw-alias-label-tertiary);align-items:center;display:flex;position:relative}.qSYn7G_search>svg{pointer-events:none;position:absolute;left:12px}.qSYn7G_search input{border:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-1);width:100%;height:36px;color:var(--dsw-alias-label-primary);font:inherit;border-radius:10px;outline:none;padding:0 34px 0 36px;font-size:13px}.qSYn7G_search input::placeholder{color:var(--dsw-alias-label-tertiary)}.qSYn7G_search input:focus-visible{border-color:var(--dsw-alias-state-business-primary);box-shadow:0 0 0 2px color-mix(in srgb, var(--dsw-alias-state-business-primary) 18%, transparent)}.qSYn7G_catalogHeading{align-items:baseline;gap:7px;padding:0 2px;display:flex}.qSYn7G_catalogHeading h3{font-size:13px;font-weight:600;line-height:20px}.qSYn7G_catalogHeading span{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;line-height:18px}.qSYn7G_cards{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:10px;margin:0;padding:0;list-style:none;display:grid}.qSYn7G_card{min-width:0;box-shadow:var(--dsw-elevation-stroke);background:var(--dsw-alias-bg-layer-3);border:0;border-radius:14px;overflow:hidden}.qSYn7G_card[data-open=true]{--dsw-elevation-stroke-color:var(--dsw-alias-border-l1);box-shadow:var(--dsw-elevation-panel)}.qSYn7G_cardContent{box-sizing:border-box;width:100%;min-height:52px;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.qSYn7G_cardContent:hover,.qSYn7G_card[data-open=true]>.qSYn7G_cardContent{background:var(--dsw-alias-interactive-bg-hover)}.qSYn7G_cardContent:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}.qSYn7G_cardTitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:14px;font-weight:600;line-height:20px;overflow:hidden}.qSYn7G_cardTrailing{color:var(--dsw-alias-label-tertiary);flex:none;align-items:center;gap:7px;display:inline-flex}.qSYn7G_statusDot{corner-shape:round;background:var(--dsw-alias-label-tertiary);border-radius:999px;flex:none;width:7px;height:7px;display:inline-block}.qSYn7G_statusDot[data-phase=active]{background:var(--dsw-alias-state-success-primary)}.qSYn7G_statusDot[data-phase=failed]{background:var(--dsw-alias-state-error-primary)}.qSYn7G_statusDot[data-phase=loading]{background:var(--dsw-alias-state-business-primary)}.qSYn7G_configTag{background:var(--dsw-alias-bg-layer-1);min-height:20px;color:var(--dsw-alias-label-secondary);white-space:nowrap;border-radius:5px;align-items:center;padding:1px 6px;font-size:11px;line-height:16px;display:inline-flex}.qSYn7G_configTag[data-kind=enabled]{background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 10%, transparent);color:var(--dsw-alias-state-success-primary)}.qSYn7G_configTag[data-kind=preset]{background:color-mix(in srgb, var(--dsw-alias-state-business-primary) 10%, transparent);color:var(--dsw-alias-state-business-primary)}.qSYn7G_configTag[data-kind=conditional]{background:color-mix(in srgb, var(--dsw-alias-state-warning-primary,#b45309) 12%, transparent);color:var(--dsw-alias-state-warning-primary,#b45309)}.qSYn7G_configTag[data-kind=failed]{background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent);color:var(--dsw-alias-state-error-primary)}.qSYn7G_group{flex-direction:column;gap:10px;display:flex}.qSYn7G_groupTitleRow{align-items:center;gap:8px;min-height:32px;display:flex}.qSYn7G_group+.qSYn7G_group{border-top:.5px solid var(--dsw-alias-border-l2);padding-top:14px}.qSYn7G_headerEnd{margin-left:auto}.qSYn7G_groupToggle{color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;flex:none;align-items:center;gap:8px;padding:0;display:flex}.qSYn7G_groupToggle:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.qSYn7G_groupToggle>.qSYn7G_chevron{transform:rotate(-90deg)}.qSYn7G_groupToggle[aria-expanded=true]>.qSYn7G_chevron{transform:none}.qSYn7G_groupTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:400;line-height:22px}.qSYn7G_groupSub{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex-wrap:wrap;gap:4px 8px;margin:-6px 0 0 20px;font-size:12px;line-height:18px;display:flex}.qSYn7G_failedCount{color:var(--dsw-alias-state-error-primary)}.qSYn7G_switcher{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);height:36px;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;border:none;border-radius:18px;flex:none;align-items:center;gap:12px;padding:0 14px;font-size:14px;line-height:22px;display:inline-flex}.qSYn7G_switcher:hover{background:var(--dsw-alias-interactive-bg-hover)}.qSYn7G_switcher:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.qSYn7G_switcher>.qSYn7G_chevron{flex:none}.qSYn7G_switcherLabel{text-overflow:ellipsis;max-width:240px;overflow:hidden}.qSYn7G_groupBody{flex-direction:column;gap:10px;display:flex}.qSYn7G_brokenNote{background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 8%, transparent);color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere;white-space:pre-line;border-radius:8px;margin:0;padding:8px 10px;font-size:12.5px;line-height:18px}.qSYn7G_hint{color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;align-items:baseline;gap:4px 8px;margin:0;font-size:12.5px;line-height:18px;display:flex}.qSYn7G_jumpLink{color:var(--dsw-alias-state-business-primary);font:inherit;cursor:pointer;background:0 0;border:0;padding:0;font-size:12.5px}.qSYn7G_enabledIn{flex-wrap:wrap;align-items:baseline;gap:4px 10px;display:flex}.qSYn7G_card[data-failed=true]{border-color:color-mix(in srgb, var(--dsw-alias-state-error-primary) 45%, transparent)}.qSYn7G_chevron{color:var(--dsw-alias-label-tertiary);flex:none}.qSYn7G_card[data-open=true] .qSYn7G_chevron{transform:rotate(180deg)}.qSYn7G_cardDetails{border-top:.5px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);padding:10px 14px 12px}.qSYn7G_entryValue{overflow-wrap:anywhere;color:var(--dsw-alias-label-primary);font-family:var(--ds-font-family-code);font-size:12px;line-height:18px;display:block}.qSYn7G_details{grid-template-columns:76px minmax(0,1fr);gap:6px 10px;margin:8px 0 0;display:grid}.qSYn7G_details div{display:contents}.qSYn7G_details dt{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:17px}.qSYn7G_details dd{overflow-wrap:anywhere;min-width:0;color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:17px}.qSYn7G_visuallyHidden{clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media (prefers-reduced-motion:no-preference){.qSYn7G_chevron{transition:transform .14s var(--ds-ease-in-out)}}@media (width<=680px){.qSYn7G_cards{grid-template-columns:minmax(0,1fr)}}";
|
|
49
|
+
const tagId = "@deepseek-ai/dsh-client-ui-settings-plugin-inventory/PluginInventorySettingsTab.module.css";
|
|
50
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
51
|
+
const tag = document.createElement("style");
|
|
52
|
+
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-settings-plugin-inventory";
|
|
53
|
+
tag.dataset.pluginCss = tagId;
|
|
54
|
+
tag.textContent = css;
|
|
55
|
+
document.head.appendChild(tag);
|
|
56
|
+
}
|
|
57
|
+
var PluginInventorySettingsTab_module_css_default = {
|
|
58
|
+
"brokenNote": "qSYn7G_brokenNote",
|
|
59
|
+
"card": "qSYn7G_card",
|
|
60
|
+
"cardContent": "qSYn7G_cardContent",
|
|
61
|
+
"cardDetails": "qSYn7G_cardDetails",
|
|
62
|
+
"cardTitle": "qSYn7G_cardTitle",
|
|
63
|
+
"cardTrailing": "qSYn7G_cardTrailing",
|
|
64
|
+
"cards": "qSYn7G_cards",
|
|
65
|
+
"catalog": "qSYn7G_catalog",
|
|
66
|
+
"catalogHeading": "qSYn7G_catalogHeading",
|
|
67
|
+
"chevron": "qSYn7G_chevron",
|
|
68
|
+
"configTag": "qSYn7G_configTag",
|
|
69
|
+
"details": "qSYn7G_details",
|
|
70
|
+
"enabledIn": "qSYn7G_enabledIn",
|
|
71
|
+
"entryValue": "qSYn7G_entryValue",
|
|
72
|
+
"failedCount": "qSYn7G_failedCount",
|
|
73
|
+
"failure": "qSYn7G_failure",
|
|
74
|
+
"group": "qSYn7G_group",
|
|
75
|
+
"groupBody": "qSYn7G_groupBody",
|
|
76
|
+
"groupSub": "qSYn7G_groupSub",
|
|
77
|
+
"groupTitle": "qSYn7G_groupTitle",
|
|
78
|
+
"groupTitleRow": "qSYn7G_groupTitleRow",
|
|
79
|
+
"groupToggle": "qSYn7G_groupToggle",
|
|
80
|
+
"headerEnd": "qSYn7G_headerEnd",
|
|
81
|
+
"hint": "qSYn7G_hint",
|
|
82
|
+
"jumpLink": "qSYn7G_jumpLink",
|
|
83
|
+
"search": "qSYn7G_search",
|
|
84
|
+
"section": "qSYn7G_section",
|
|
85
|
+
"status": "qSYn7G_status",
|
|
86
|
+
"statusDot": "qSYn7G_statusDot",
|
|
87
|
+
"switcher": "qSYn7G_switcher",
|
|
88
|
+
"switcherLabel": "qSYn7G_switcherLabel",
|
|
89
|
+
"visuallyHidden": "qSYn7G_visuallyHidden"
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region lib/types/client/PluginInventorySettingsTab.js
|
|
93
|
+
const PHASE_KEYS = {
|
|
94
|
+
pending: "pending",
|
|
95
|
+
loading: "loadingPhase",
|
|
96
|
+
active: "active",
|
|
97
|
+
failed: "failed",
|
|
98
|
+
unloading: "unloading"
|
|
99
|
+
};
|
|
100
|
+
/** Localized accessible label for one root Fiber phase. */
|
|
101
|
+
function phaseLabel(phase, t) {
|
|
102
|
+
return phase === null ? t("unobserved") : t(PHASE_KEYS[phase]);
|
|
103
|
+
}
|
|
104
|
+
/** Compact a module specifier without guessing whether its Loader id was generated. */
|
|
105
|
+
function moduleShortName(moduleName) {
|
|
106
|
+
return (moduleName.startsWith("@") ? moduleName.slice(moduleName.indexOf("/") + 1) : moduleName).replace(/^cordis:/, "").replace(/^cordis-plugin-/, "").replace(/^dsh-(?:host-|client-)?/, "");
|
|
107
|
+
}
|
|
108
|
+
/** Whether one row's module name or entry id matches the catalog query. */
|
|
109
|
+
function matches(moduleName, entryId, normalizedQuery) {
|
|
110
|
+
if (normalizedQuery.length === 0) return true;
|
|
111
|
+
return [moduleName, ...entryId === null ? [] : [entryId]].some((value) => value.toLocaleLowerCase().includes(normalizedQuery));
|
|
112
|
+
}
|
|
113
|
+
/** The roster row shown when the preset switcher has no explicit choice. */
|
|
114
|
+
function fallbackPreset(presets) {
|
|
115
|
+
return presets.find((preset) => preset.isDefault) ?? presets[0];
|
|
116
|
+
}
|
|
117
|
+
/** The switcher's display label for one preset. */
|
|
118
|
+
function presetLabel(preset, t, presetName) {
|
|
119
|
+
const name = presetName(preset);
|
|
120
|
+
if (preset.broken !== void 0) return t("presetOptionBroken", { name });
|
|
121
|
+
if (preset.isDefault) return t("presetOptionDefault", { name });
|
|
122
|
+
return name;
|
|
123
|
+
}
|
|
124
|
+
/** One expandable plugin card; the caller owns the trailing status content. */
|
|
125
|
+
function PluginCard({ rowKey, moduleName, entryId, trailing, ariaLabel, failed, expanded, onToggle, children }) {
|
|
126
|
+
const open = expanded === rowKey;
|
|
127
|
+
const detailId = `plugin-details-${encodeURIComponent(rowKey)}`;
|
|
128
|
+
return (0, react_jsx_runtime.jsxs)("li", {
|
|
129
|
+
className: PluginInventorySettingsTab_module_css_default.card,
|
|
130
|
+
"data-plugin-entry": entryId ?? void 0,
|
|
131
|
+
"data-plugin-module": moduleName,
|
|
132
|
+
"data-failed": failed ? "true" : void 0,
|
|
133
|
+
"data-open": open ? "true" : void 0,
|
|
134
|
+
children: [(0, react_jsx_runtime.jsxs)("button", {
|
|
135
|
+
className: PluginInventorySettingsTab_module_css_default.cardContent,
|
|
136
|
+
type: "button",
|
|
137
|
+
"aria-expanded": open,
|
|
138
|
+
"aria-controls": detailId,
|
|
139
|
+
"aria-label": ariaLabel,
|
|
140
|
+
onClick: () => {
|
|
141
|
+
onToggle(rowKey);
|
|
142
|
+
},
|
|
143
|
+
children: [(0, react_jsx_runtime.jsx)("strong", {
|
|
144
|
+
className: PluginInventorySettingsTab_module_css_default.cardTitle,
|
|
145
|
+
title: moduleName,
|
|
146
|
+
children: moduleShortName(moduleName)
|
|
147
|
+
}), (0, react_jsx_runtime.jsxs)("span", {
|
|
148
|
+
className: PluginInventorySettingsTab_module_css_default.cardTrailing,
|
|
149
|
+
children: [trailing, (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {
|
|
150
|
+
className: PluginInventorySettingsTab_module_css_default.chevron,
|
|
151
|
+
size: 12,
|
|
152
|
+
"aria-hidden": "true"
|
|
153
|
+
})]
|
|
154
|
+
})]
|
|
155
|
+
}), open ? (0, react_jsx_runtime.jsx)("div", {
|
|
156
|
+
className: PluginInventorySettingsTab_module_css_default.cardDetails,
|
|
157
|
+
id: detailId,
|
|
158
|
+
children
|
|
159
|
+
}) : null]
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/** Detail rows shared by every card: the Loader identity, then labeled facts. */
|
|
163
|
+
function CardFacts({ moduleName, moduleLabel, entryId, facts }) {
|
|
164
|
+
return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [entryId === null ? null : (0, react_jsx_runtime.jsx)("code", {
|
|
165
|
+
className: PluginInventorySettingsTab_module_css_default.entryValue,
|
|
166
|
+
"data-loader-entry": true,
|
|
167
|
+
children: entryId
|
|
168
|
+
}), (0, react_jsx_runtime.jsxs)("dl", {
|
|
169
|
+
className: PluginInventorySettingsTab_module_css_default.details,
|
|
170
|
+
children: [(0, react_jsx_runtime.jsxs)("div", { children: [(0, react_jsx_runtime.jsx)("dt", { children: moduleLabel }), (0, react_jsx_runtime.jsx)("dd", { children: moduleName })] }), facts.map(([label, value]) => (0, react_jsx_runtime.jsxs)("div", { children: [(0, react_jsx_runtime.jsx)("dt", { children: label }), (0, react_jsx_runtime.jsx)("dd", { children: value })] }, label))]
|
|
171
|
+
})] });
|
|
172
|
+
}
|
|
173
|
+
/** Status dot naming a live root-fiber phase; rows with no live fiber show none. */
|
|
174
|
+
function PhaseDot({ phase, t }) {
|
|
175
|
+
const status = phaseLabel(phase, t);
|
|
176
|
+
return (0, react_jsx_runtime.jsx)("span", {
|
|
177
|
+
className: PluginInventorySettingsTab_module_css_default.statusDot,
|
|
178
|
+
"data-phase": phase,
|
|
179
|
+
role: "img",
|
|
180
|
+
"aria-label": status,
|
|
181
|
+
title: status
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
/** Enablement tag; `kind` selects the palette. */
|
|
185
|
+
function StateTag({ kind, label }) {
|
|
186
|
+
return (0, react_jsx_runtime.jsx)("span", {
|
|
187
|
+
className: PluginInventorySettingsTab_module_css_default.configTag,
|
|
188
|
+
"data-kind": kind,
|
|
189
|
+
children: label
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/** Render the read-only plugin inventory: agent presets first, then the global plane. */
|
|
193
|
+
function PluginInventorySettingsTab({ list, presetName, t }) {
|
|
194
|
+
const sectionId = (0, react.useId)();
|
|
195
|
+
const [request, setRequest] = (0, react.useState)(0);
|
|
196
|
+
const [query, setQuery] = (0, react.useState)("");
|
|
197
|
+
const [expanded, setExpanded] = (0, react.useState)(null);
|
|
198
|
+
const [chosenPreset, setChosenPreset] = (0, react.useState)(null);
|
|
199
|
+
const [switcherOpen, setSwitcherOpen] = (0, react.useState)(false);
|
|
200
|
+
const [presetOpen, setPresetOpen] = (0, react.useState)(null);
|
|
201
|
+
const [globalOpen, setGlobalOpen] = (0, react.useState)(null);
|
|
202
|
+
const [state, setState] = (0, react.useState)({ status: "loading" });
|
|
203
|
+
(0, react.useEffect)(() => {
|
|
204
|
+
let current = true;
|
|
205
|
+
Promise.resolve().then(() => list()).then((snapshot) => {
|
|
206
|
+
if (current) setState({
|
|
207
|
+
status: "ready",
|
|
208
|
+
snapshot
|
|
209
|
+
});
|
|
210
|
+
}, () => {
|
|
211
|
+
if (current) setState({ status: "error" });
|
|
212
|
+
});
|
|
213
|
+
return () => {
|
|
214
|
+
current = false;
|
|
215
|
+
};
|
|
216
|
+
}, [list, request]);
|
|
217
|
+
const normalizedQuery = query.trim().toLocaleLowerCase();
|
|
218
|
+
const searching = normalizedQuery.length > 0;
|
|
219
|
+
const snapshot = state.status === "ready" ? state.snapshot : void 0;
|
|
220
|
+
const presets = snapshot?.agentPresets ?? [];
|
|
221
|
+
const selected = presets.find((preset) => preset.id === chosenPreset) ?? fallbackPreset(presets);
|
|
222
|
+
/** Presets that actually enable a module, keyed by module name. */
|
|
223
|
+
const enabledIn = (0, react.useMemo)(() => {
|
|
224
|
+
const found = /* @__PURE__ */ new Map();
|
|
225
|
+
for (const preset of presets) for (const row of preset.rows) {
|
|
226
|
+
if (row.enabled !== true) continue;
|
|
227
|
+
const groups = found.get(row.moduleName);
|
|
228
|
+
if (groups === void 0) found.set(row.moduleName, [preset]);
|
|
229
|
+
else if (!groups.includes(preset)) groups.push(preset);
|
|
230
|
+
}
|
|
231
|
+
return found;
|
|
232
|
+
}, [presets]);
|
|
233
|
+
const entries = snapshot?.entries ?? [];
|
|
234
|
+
const failedEntries = [];
|
|
235
|
+
const regularEntries = [];
|
|
236
|
+
for (const entry of entries) if (entry.fiberPhase === "failed") failedEntries.push(entry);
|
|
237
|
+
else regularEntries.push(entry);
|
|
238
|
+
const entryMatch = (entry) => matches(entry.moduleName, entry.entryId, normalizedQuery);
|
|
239
|
+
const rowMatch = (row) => matches(row.moduleName, row.entryId, normalizedQuery);
|
|
240
|
+
const filteredFailed = failedEntries.filter(entryMatch);
|
|
241
|
+
const filteredRegular = regularEntries.filter(entryMatch);
|
|
242
|
+
const globalCount = filteredFailed.length + filteredRegular.length;
|
|
243
|
+
const selectedRows = selected === void 0 ? [] : selected.rows.filter(rowMatch);
|
|
244
|
+
const otherPresetMatches = searching ? presets.filter((preset) => preset !== selected && preset.rows.some(rowMatch)) : [];
|
|
245
|
+
const otherMatchCount = otherPresetMatches.reduce((total, preset) => total + preset.rows.filter(rowMatch).length, 0);
|
|
246
|
+
const presetEffectiveOpen = searching || (presetOpen ?? true);
|
|
247
|
+
const globalEffectiveOpen = searching || (globalOpen ?? presets.length === 0);
|
|
248
|
+
const nothingMatches = searching && globalCount === 0 && selectedRows.length === 0 && otherPresetMatches.length === 0;
|
|
249
|
+
const retry = () => {
|
|
250
|
+
setState({ status: "loading" });
|
|
251
|
+
setRequest((value) => value + 1);
|
|
252
|
+
};
|
|
253
|
+
const toggleRow = (key) => {
|
|
254
|
+
setExpanded((current) => current === key ? null : key);
|
|
255
|
+
};
|
|
256
|
+
/** Trailing status and detail facts for one row of the selected preset. */
|
|
257
|
+
const presetRowCard = (preset, row, index) => {
|
|
258
|
+
const key = `preset:${preset.id}:${String(index)}`;
|
|
259
|
+
const title = moduleShortName(row.moduleName);
|
|
260
|
+
const failed = row.fiberPhase === "failed";
|
|
261
|
+
const stateText = failed ? t("failedTag") : row.enabled === true ? t("enabledTag") : row.enabled === false ? t("disabledTag") : t("conditionalTag");
|
|
262
|
+
const kind = failed ? "failed" : row.enabled === true ? "enabled" : row.enabled === false ? "disabled" : "conditional";
|
|
263
|
+
return (0, react_jsx_runtime.jsx)(PluginCard, {
|
|
264
|
+
rowKey: key,
|
|
265
|
+
moduleName: row.moduleName,
|
|
266
|
+
entryId: row.entryId,
|
|
267
|
+
failed,
|
|
268
|
+
expanded,
|
|
269
|
+
onToggle: toggleRow,
|
|
270
|
+
ariaLabel: `${title}, ${stateText}`,
|
|
271
|
+
trailing: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [row.enabled === true && !failed && row.fiberPhase !== null ? (0, react_jsx_runtime.jsx)(PhaseDot, {
|
|
272
|
+
phase: row.fiberPhase,
|
|
273
|
+
t
|
|
274
|
+
}) : null, (0, react_jsx_runtime.jsx)(StateTag, {
|
|
275
|
+
kind,
|
|
276
|
+
label: stateText
|
|
277
|
+
})] }),
|
|
278
|
+
children: (0, react_jsx_runtime.jsx)(CardFacts, {
|
|
279
|
+
moduleName: row.moduleName,
|
|
280
|
+
moduleLabel: t("moduleLabel"),
|
|
281
|
+
entryId: row.entryId,
|
|
282
|
+
facts: [
|
|
283
|
+
[t("fromPreset"), presetName(preset)],
|
|
284
|
+
[t("configuration"), stateText],
|
|
285
|
+
...row.fiberPhase === null ? [] : [[t("runtime"), phaseLabel(row.fiberPhase, t)]],
|
|
286
|
+
...row.condition === void 0 ? [] : [[t("condition"), (0, react_jsx_runtime.jsx)("code", { children: row.condition }, "condition")]]
|
|
287
|
+
]
|
|
288
|
+
})
|
|
289
|
+
}, key);
|
|
290
|
+
};
|
|
291
|
+
/** One global-plane row; a preset-provided row carries the presets that enable it. */
|
|
292
|
+
const globalRowCard = (entry, providers) => {
|
|
293
|
+
const key = `global:${entry.entryId}`;
|
|
294
|
+
const title = moduleShortName(entry.moduleName);
|
|
295
|
+
const failed = entry.fiberPhase === "failed";
|
|
296
|
+
const stateText = failed ? t("failedTag") : providers !== void 0 ? t("presetEnabledTag") : t(entry.enabled ? "enabledTag" : "disabledTag");
|
|
297
|
+
const kind = failed ? "failed" : providers !== void 0 ? "preset" : entry.enabled ? "enabled" : "disabled";
|
|
298
|
+
return (0, react_jsx_runtime.jsx)(PluginCard, {
|
|
299
|
+
rowKey: key,
|
|
300
|
+
moduleName: entry.moduleName,
|
|
301
|
+
entryId: entry.entryId,
|
|
302
|
+
failed,
|
|
303
|
+
expanded,
|
|
304
|
+
onToggle: toggleRow,
|
|
305
|
+
ariaLabel: `${title}, ${stateText}`,
|
|
306
|
+
trailing: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [entry.enabled && !failed && entry.fiberPhase !== null ? (0, react_jsx_runtime.jsx)(PhaseDot, {
|
|
307
|
+
phase: entry.fiberPhase,
|
|
308
|
+
t
|
|
309
|
+
}) : null, (0, react_jsx_runtime.jsx)(StateTag, {
|
|
310
|
+
kind,
|
|
311
|
+
label: stateText
|
|
312
|
+
})] }),
|
|
313
|
+
children: (0, react_jsx_runtime.jsx)(CardFacts, {
|
|
314
|
+
moduleName: entry.moduleName,
|
|
315
|
+
moduleLabel: t("moduleLabel"),
|
|
316
|
+
entryId: entry.entryId,
|
|
317
|
+
facts: providers !== void 0 ? [[t("configuration"), t("presetProvidedDetail")], [t("enabledIn"), (0, react_jsx_runtime.jsxs)("span", {
|
|
318
|
+
className: PluginInventorySettingsTab_module_css_default.enabledIn,
|
|
319
|
+
children: [(0, react_jsx_runtime.jsx)("span", { children: providers.map((preset) => presetName(preset)).join(" · ") }), (0, react_jsx_runtime.jsx)("button", {
|
|
320
|
+
type: "button",
|
|
321
|
+
className: PluginInventorySettingsTab_module_css_default.jumpLink,
|
|
322
|
+
onClick: () => {
|
|
323
|
+
setChosenPreset(providers[0].id);
|
|
324
|
+
},
|
|
325
|
+
children: t("viewInPreset")
|
|
326
|
+
})]
|
|
327
|
+
})]] : [[t("configuration"), t(entry.enabled ? "enabledTag" : "disabledTag")], ...entry.enabled ? [[t("runtime"), phaseLabel(entry.fiberPhase, t)]] : []]
|
|
328
|
+
})
|
|
329
|
+
}, key);
|
|
330
|
+
};
|
|
331
|
+
return (0, react_jsx_runtime.jsxs)("div", {
|
|
332
|
+
className: PluginInventorySettingsTab_module_css_default.section,
|
|
333
|
+
"aria-busy": state.status === "loading",
|
|
334
|
+
children: [
|
|
335
|
+
state.status === "loading" ? (0, react_jsx_runtime.jsx)("p", {
|
|
336
|
+
className: PluginInventorySettingsTab_module_css_default.status,
|
|
337
|
+
children: t("loading")
|
|
338
|
+
}) : null,
|
|
339
|
+
state.status === "error" ? (0, react_jsx_runtime.jsxs)("div", {
|
|
340
|
+
className: PluginInventorySettingsTab_module_css_default.failure,
|
|
341
|
+
children: [(0, react_jsx_runtime.jsx)("p", {
|
|
342
|
+
role: "alert",
|
|
343
|
+
children: t("error")
|
|
344
|
+
}), (0, react_jsx_runtime.jsx)("button", {
|
|
345
|
+
type: "button",
|
|
346
|
+
onClick: retry,
|
|
347
|
+
children: t("retry")
|
|
348
|
+
})]
|
|
349
|
+
}) : null,
|
|
350
|
+
snapshot !== void 0 ? (0, react_jsx_runtime.jsxs)("div", {
|
|
351
|
+
className: PluginInventorySettingsTab_module_css_default.catalog,
|
|
352
|
+
children: [
|
|
353
|
+
(0, react_jsx_runtime.jsxs)("label", {
|
|
354
|
+
className: PluginInventorySettingsTab_module_css_default.search,
|
|
355
|
+
children: [
|
|
356
|
+
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSearchOutline16, { "aria-hidden": "true" }),
|
|
357
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
358
|
+
className: PluginInventorySettingsTab_module_css_default.visuallyHidden,
|
|
359
|
+
children: t("search")
|
|
360
|
+
}),
|
|
361
|
+
(0, react_jsx_runtime.jsx)("input", {
|
|
362
|
+
type: "search",
|
|
363
|
+
value: query,
|
|
364
|
+
placeholder: t("search"),
|
|
365
|
+
"aria-label": t("search"),
|
|
366
|
+
onChange: (event) => {
|
|
367
|
+
setQuery(event.currentTarget.value);
|
|
368
|
+
}
|
|
369
|
+
})
|
|
370
|
+
]
|
|
371
|
+
}),
|
|
372
|
+
entries.length === 0 && presets.length === 0 ? (0, react_jsx_runtime.jsx)("p", {
|
|
373
|
+
className: PluginInventorySettingsTab_module_css_default.status,
|
|
374
|
+
children: t("empty")
|
|
375
|
+
}) : null,
|
|
376
|
+
nothingMatches ? (0, react_jsx_runtime.jsx)("p", {
|
|
377
|
+
className: PluginInventorySettingsTab_module_css_default.status,
|
|
378
|
+
children: t("emptySearch")
|
|
379
|
+
}) : null,
|
|
380
|
+
selected !== void 0 ? (0, react_jsx_runtime.jsxs)("section", {
|
|
381
|
+
className: PluginInventorySettingsTab_module_css_default.group,
|
|
382
|
+
"data-plugin-scope": "preset",
|
|
383
|
+
"data-preset-id": selected.id,
|
|
384
|
+
children: [
|
|
385
|
+
(0, react_jsx_runtime.jsxs)("div", {
|
|
386
|
+
className: PluginInventorySettingsTab_module_css_default.groupTitleRow,
|
|
387
|
+
children: [(0, react_jsx_runtime.jsxs)("button", {
|
|
388
|
+
type: "button",
|
|
389
|
+
className: PluginInventorySettingsTab_module_css_default.groupToggle,
|
|
390
|
+
"aria-expanded": presetEffectiveOpen,
|
|
391
|
+
"aria-controls": `${sectionId}-preset`,
|
|
392
|
+
onClick: () => {
|
|
393
|
+
setPresetOpen(!presetEffectiveOpen);
|
|
394
|
+
},
|
|
395
|
+
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {
|
|
396
|
+
className: PluginInventorySettingsTab_module_css_default.chevron,
|
|
397
|
+
size: 12,
|
|
398
|
+
"aria-hidden": "true"
|
|
399
|
+
}), (0, react_jsx_runtime.jsx)("span", {
|
|
400
|
+
className: PluginInventorySettingsTab_module_css_default.groupTitle,
|
|
401
|
+
children: t("presetTitle")
|
|
402
|
+
})]
|
|
403
|
+
}), (0, react_jsx_runtime.jsx)("div", {
|
|
404
|
+
className: PluginInventorySettingsTab_module_css_default.headerEnd,
|
|
405
|
+
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
|
|
406
|
+
open: switcherOpen,
|
|
407
|
+
onClose: () => {
|
|
408
|
+
setSwitcherOpen(false);
|
|
409
|
+
},
|
|
410
|
+
items: presets.map((preset) => ({
|
|
411
|
+
id: preset.id,
|
|
412
|
+
label: presetLabel(preset, t, presetName)
|
|
413
|
+
})),
|
|
414
|
+
selectedId: selected.id,
|
|
415
|
+
onSelect: (id) => {
|
|
416
|
+
setSwitcherOpen(false);
|
|
417
|
+
setChosenPreset(id);
|
|
418
|
+
},
|
|
419
|
+
align: "end",
|
|
420
|
+
portal: true,
|
|
421
|
+
anchor: (0, react_jsx_runtime.jsxs)("button", {
|
|
422
|
+
type: "button",
|
|
423
|
+
className: PluginInventorySettingsTab_module_css_default.switcher,
|
|
424
|
+
"aria-haspopup": "menu",
|
|
425
|
+
"aria-expanded": switcherOpen,
|
|
426
|
+
"aria-label": t("switcherLabel"),
|
|
427
|
+
onClick: () => {
|
|
428
|
+
setSwitcherOpen((value) => !value);
|
|
429
|
+
},
|
|
430
|
+
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
431
|
+
className: PluginInventorySettingsTab_module_css_default.switcherLabel,
|
|
432
|
+
children: presetLabel(selected, t, presetName)
|
|
433
|
+
}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {
|
|
434
|
+
className: PluginInventorySettingsTab_module_css_default.chevron,
|
|
435
|
+
"aria-hidden": "true"
|
|
436
|
+
})]
|
|
437
|
+
})
|
|
438
|
+
})
|
|
439
|
+
})]
|
|
440
|
+
}),
|
|
441
|
+
(0, react_jsx_runtime.jsxs)("p", {
|
|
442
|
+
className: PluginInventorySettingsTab_module_css_default.groupSub,
|
|
443
|
+
children: [t("presetSubtitle"), (0, react_jsx_runtime.jsx)("span", {
|
|
444
|
+
"data-preset-plugin-count": selectedRows.length,
|
|
445
|
+
children: ` · ${String(selectedRows.length)} ${t("countUnit")}`
|
|
446
|
+
})]
|
|
447
|
+
}),
|
|
448
|
+
presetEffectiveOpen ? (0, react_jsx_runtime.jsxs)("div", {
|
|
449
|
+
id: `${sectionId}-preset`,
|
|
450
|
+
className: PluginInventorySettingsTab_module_css_default.groupBody,
|
|
451
|
+
children: [
|
|
452
|
+
selected.broken !== void 0 ? (0, react_jsx_runtime.jsx)("p", {
|
|
453
|
+
className: PluginInventorySettingsTab_module_css_default.brokenNote,
|
|
454
|
+
role: "alert",
|
|
455
|
+
children: selected.broken
|
|
456
|
+
}) : null,
|
|
457
|
+
selectedRows.length > 0 ? (0, react_jsx_runtime.jsx)("ul", {
|
|
458
|
+
className: PluginInventorySettingsTab_module_css_default.cards,
|
|
459
|
+
children: selectedRows.map((row, index) => presetRowCard(selected, row, index))
|
|
460
|
+
}) : null,
|
|
461
|
+
otherMatchCount > 0 ? (0, react_jsx_runtime.jsxs)("p", {
|
|
462
|
+
className: PluginInventorySettingsTab_module_css_default.hint,
|
|
463
|
+
children: [t("matchesInOtherPresets", { count: String(otherMatchCount) }), otherPresetMatches.map((preset) => (0, react_jsx_runtime.jsx)("button", {
|
|
464
|
+
type: "button",
|
|
465
|
+
className: PluginInventorySettingsTab_module_css_default.jumpLink,
|
|
466
|
+
onClick: () => {
|
|
467
|
+
setChosenPreset(preset.id);
|
|
468
|
+
},
|
|
469
|
+
children: presetName(preset)
|
|
470
|
+
}, preset.id))]
|
|
471
|
+
}) : null
|
|
472
|
+
]
|
|
473
|
+
}) : null
|
|
474
|
+
]
|
|
475
|
+
}) : null,
|
|
476
|
+
entries.length > 0 ? (0, react_jsx_runtime.jsxs)("section", {
|
|
477
|
+
className: PluginInventorySettingsTab_module_css_default.group,
|
|
478
|
+
"data-plugin-scope": "global",
|
|
479
|
+
children: [
|
|
480
|
+
(0, react_jsx_runtime.jsx)("div", {
|
|
481
|
+
className: PluginInventorySettingsTab_module_css_default.groupTitleRow,
|
|
482
|
+
children: (0, react_jsx_runtime.jsxs)("button", {
|
|
483
|
+
type: "button",
|
|
484
|
+
className: PluginInventorySettingsTab_module_css_default.groupToggle,
|
|
485
|
+
"aria-expanded": globalEffectiveOpen,
|
|
486
|
+
"aria-controls": `${sectionId}-global`,
|
|
487
|
+
onClick: () => {
|
|
488
|
+
setGlobalOpen(!globalEffectiveOpen);
|
|
489
|
+
},
|
|
490
|
+
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {
|
|
491
|
+
className: PluginInventorySettingsTab_module_css_default.chevron,
|
|
492
|
+
size: 12,
|
|
493
|
+
"aria-hidden": "true"
|
|
494
|
+
}), (0, react_jsx_runtime.jsx)("span", {
|
|
495
|
+
className: PluginInventorySettingsTab_module_css_default.groupTitle,
|
|
496
|
+
children: t("globalTitle")
|
|
497
|
+
})]
|
|
498
|
+
})
|
|
499
|
+
}),
|
|
500
|
+
(0, react_jsx_runtime.jsxs)("p", {
|
|
501
|
+
className: PluginInventorySettingsTab_module_css_default.groupSub,
|
|
502
|
+
children: [
|
|
503
|
+
t("globalSubtitle"),
|
|
504
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
505
|
+
"data-plugin-count": globalCount,
|
|
506
|
+
children: ` · ${String(globalCount)} ${t("countUnit")}`
|
|
507
|
+
}),
|
|
508
|
+
filteredFailed.length > 0 ? (0, react_jsx_runtime.jsxs)("span", {
|
|
509
|
+
className: PluginInventorySettingsTab_module_css_default.failedCount,
|
|
510
|
+
children: [
|
|
511
|
+
filteredFailed.length,
|
|
512
|
+
" ",
|
|
513
|
+
t("failedCountLabel")
|
|
514
|
+
]
|
|
515
|
+
}) : null
|
|
516
|
+
]
|
|
517
|
+
}),
|
|
518
|
+
globalEffectiveOpen && globalCount > 0 ? (0, react_jsx_runtime.jsxs)("ul", {
|
|
519
|
+
className: PluginInventorySettingsTab_module_css_default.cards,
|
|
520
|
+
id: `${sectionId}-global`,
|
|
521
|
+
children: [filteredFailed.map((entry) => globalRowCard(entry)), filteredRegular.map((entry) => globalRowCard(entry, entry.enabled ? void 0 : enabledIn.get(entry.moduleName)))]
|
|
522
|
+
}) : null
|
|
523
|
+
]
|
|
524
|
+
}) : null
|
|
525
|
+
]
|
|
526
|
+
}) : null
|
|
527
|
+
]
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
//#endregion
|
|
531
|
+
//#region lib/types/client/locales.js
|
|
532
|
+
/** Copy dictionaries for the plugin inventory Settings section. */
|
|
533
|
+
/** Simplified Chinese dictionary and key source of truth. */
|
|
534
|
+
const zh = {
|
|
535
|
+
tab: "插件列表",
|
|
536
|
+
loading: "正在读取插件…",
|
|
537
|
+
error: "暂时无法读取插件。",
|
|
538
|
+
retry: "重试",
|
|
539
|
+
search: "搜索插件",
|
|
540
|
+
empty: "暂无插件。",
|
|
541
|
+
emptySearch: "没有匹配的插件。",
|
|
542
|
+
presetTitle: "会话插件",
|
|
543
|
+
presetSubtitle: "由 Agent 预设按会话组成",
|
|
544
|
+
countUnit: "个",
|
|
545
|
+
switcherLabel: "选择要查看的 Agent 预设",
|
|
546
|
+
presetOptionDefault: "{name}(默认)",
|
|
547
|
+
presetOptionBroken: "{name}(加载失败)",
|
|
548
|
+
globalTitle: "全局插件",
|
|
549
|
+
globalSubtitle: "系统与所有会话共用",
|
|
550
|
+
presetProvidedDetail: "全局已停用,由 Agent 预设按会话提供",
|
|
551
|
+
enabledIn: "启用于",
|
|
552
|
+
viewInPreset: "去预设分组查看",
|
|
553
|
+
matchesInOtherPresets: "其他预设中还有 {count} 个匹配:",
|
|
554
|
+
failedCountLabel: "个失败",
|
|
555
|
+
enabledTag: "已启用",
|
|
556
|
+
disabledTag: "已停用",
|
|
557
|
+
conditionalTag: "条件启用",
|
|
558
|
+
presetEnabledTag: "预设中启用",
|
|
559
|
+
failedTag: "启动失败",
|
|
560
|
+
moduleLabel: "完整名称",
|
|
561
|
+
fromPreset: "来自",
|
|
562
|
+
condition: "禁用条件",
|
|
563
|
+
configuration: "配置状态",
|
|
564
|
+
runtime: "运行状态",
|
|
565
|
+
unobserved: "未运行",
|
|
566
|
+
pending: "等待依赖",
|
|
567
|
+
loadingPhase: "加载中",
|
|
568
|
+
active: "运行中",
|
|
569
|
+
failed: "启动失败",
|
|
570
|
+
unloading: "卸载中"
|
|
571
|
+
};
|
|
572
|
+
/** English dictionary checked against the Chinese key set. */
|
|
573
|
+
const en = {
|
|
574
|
+
tab: "Plugin list",
|
|
575
|
+
loading: "Reading plugins…",
|
|
576
|
+
error: "Plugins are temporarily unavailable.",
|
|
577
|
+
retry: "Retry",
|
|
578
|
+
search: "Search plugins",
|
|
579
|
+
empty: "No plugins are available.",
|
|
580
|
+
emptySearch: "No matching plugins.",
|
|
581
|
+
presetTitle: "Session plugins",
|
|
582
|
+
presetSubtitle: "Composed per session by agent presets",
|
|
583
|
+
countUnit: "plugins",
|
|
584
|
+
switcherLabel: "Choose the agent preset to inspect",
|
|
585
|
+
presetOptionDefault: "{name} (default)",
|
|
586
|
+
presetOptionBroken: "{name} (failed to load)",
|
|
587
|
+
globalTitle: "Global plugins",
|
|
588
|
+
globalSubtitle: "Shared by the system and every session",
|
|
589
|
+
presetProvidedDetail: "Disabled globally; agent presets provide it per session",
|
|
590
|
+
enabledIn: "Enabled in",
|
|
591
|
+
viewInPreset: "View in the preset group",
|
|
592
|
+
matchesInOtherPresets: "{count} more matches in other presets: ",
|
|
593
|
+
failedCountLabel: "failed",
|
|
594
|
+
enabledTag: "Enabled",
|
|
595
|
+
disabledTag: "Disabled",
|
|
596
|
+
conditionalTag: "Conditional",
|
|
597
|
+
presetEnabledTag: "Enabled via presets",
|
|
598
|
+
failedTag: "Failed",
|
|
599
|
+
moduleLabel: "Module",
|
|
600
|
+
fromPreset: "From",
|
|
601
|
+
condition: "Disabled when",
|
|
602
|
+
configuration: "Configuration",
|
|
603
|
+
runtime: "Status",
|
|
604
|
+
unobserved: "Not running",
|
|
605
|
+
pending: "Waiting for dependencies",
|
|
606
|
+
loadingPhase: "Loading",
|
|
607
|
+
active: "Running",
|
|
608
|
+
failed: "Failed to start",
|
|
609
|
+
unloading: "Unloading"
|
|
610
|
+
};
|
|
611
|
+
//#endregion
|
|
612
|
+
//#region lib/types/client/index.js
|
|
613
|
+
/** Read-only Host plugin inventory registered into Web Settings. */
|
|
614
|
+
/** Dictionary namespace owned by this plugin. */
|
|
615
|
+
const NS = "settings.pluginInventory";
|
|
616
|
+
/** Services required by the Settings registration and generated Remote face. */
|
|
617
|
+
const inject = [
|
|
618
|
+
"slots",
|
|
619
|
+
"locale",
|
|
620
|
+
"remote",
|
|
621
|
+
"remote.pluginInventory"
|
|
622
|
+
];
|
|
623
|
+
/** Contribute the lazy inventory tab to the Plugins settings section. */
|
|
624
|
+
function apply(ctx) {
|
|
625
|
+
ctx.effect(() => ctx.locale.register(NS, {
|
|
626
|
+
zh,
|
|
627
|
+
en
|
|
628
|
+
}), "ui-settings-plugin-inventory: dictionaries");
|
|
629
|
+
const t = ctx.locale.bind(NS);
|
|
630
|
+
const list = async () => {
|
|
631
|
+
const result = await ctx.remote.pluginInventory.list();
|
|
632
|
+
if (!result.ok) throw new Error(`pluginInventory.list failed: ${result.error.code}: ${result.error.message}`);
|
|
633
|
+
return result.value;
|
|
634
|
+
};
|
|
635
|
+
const agentPresetCopy = ctx.locale.bind("settings.agentPreset");
|
|
636
|
+
const presetName = (preset) => presetDisplayText(preset, agentPresetCopy).name;
|
|
637
|
+
const injected = () => ({
|
|
638
|
+
list,
|
|
639
|
+
presetName
|
|
640
|
+
});
|
|
641
|
+
ctx.slots.inject("settings.plugins.tab", () => ctx.slots.register({
|
|
642
|
+
name: "settings.plugins.tab",
|
|
643
|
+
id: "all",
|
|
644
|
+
order: 10,
|
|
645
|
+
label: () => t("tab"),
|
|
646
|
+
locale: NS,
|
|
647
|
+
inject: injected
|
|
648
|
+
}, PluginInventorySettingsTab));
|
|
649
|
+
}
|
|
650
|
+
//#endregion
|
|
651
|
+
exports.NS = NS;
|
|
652
|
+
exports.apply = apply;
|
|
653
|
+
exports.inject = inject;
|
|
654
|
+
return module.exports;
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
//# sourceMappingURL=client.js.map
|