universal-plugin-hub 1.0.6 → 1.0.25

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.
Files changed (65) hide show
  1. package/README.md +41 -5
  2. package/README.zh.md +41 -5
  3. package/assets/Add-plugin-source.png +0 -0
  4. package/assets/MCP.png +0 -0
  5. package/assets/Plugin-management.png +0 -0
  6. package/assets/Plugins-official.png +0 -0
  7. package/assets/Skills.png +0 -0
  8. package/assets/fluent-3d/balance_scale_3d.png +0 -0
  9. package/assets/fluent-3d/bar_chart_3d.png +0 -0
  10. package/assets/fluent-3d/books_3d.png +0 -0
  11. package/assets/fluent-3d/brain_3d.png +0 -0
  12. package/assets/fluent-3d/briefcase_3d.png +0 -0
  13. package/assets/fluent-3d/card_file_box_3d.png +0 -0
  14. package/assets/fluent-3d/chart_increasing_3d.png +0 -0
  15. package/assets/fluent-3d/clapper_board_3d.png +0 -0
  16. package/assets/fluent-3d/clipboard_3d.png +0 -0
  17. package/assets/fluent-3d/cloud_3d.png +0 -0
  18. package/assets/fluent-3d/compass_3d.png +0 -0
  19. package/assets/fluent-3d/control_knobs_3d.png +0 -0
  20. package/assets/fluent-3d/desktop_computer_3d.png +0 -0
  21. package/assets/fluent-3d/framed_picture_3d.png +0 -0
  22. package/assets/fluent-3d/gear_3d.png +0 -0
  23. package/assets/fluent-3d/globe_with_meridians_3d.png +0 -0
  24. package/assets/fluent-3d/graduation_cap_3d.png +0 -0
  25. package/assets/fluent-3d/handshake_3d.png +0 -0
  26. package/assets/fluent-3d/identification_card_3d.png +0 -0
  27. package/assets/fluent-3d/input_latin_letters_3d.png +0 -0
  28. package/assets/fluent-3d/lady_beetle_3d.png +0 -0
  29. package/assets/fluent-3d/laptop_3d.png +0 -0
  30. package/assets/fluent-3d/link_3d.png +0 -0
  31. package/assets/fluent-3d/locked_3d.png +0 -0
  32. package/assets/fluent-3d/magnifying_glass_tilted_left_3d.png +0 -0
  33. package/assets/fluent-3d/manifest.json +221 -0
  34. package/assets/fluent-3d/memo_3d.png +0 -0
  35. package/assets/fluent-3d/microscope_3d.png +0 -0
  36. package/assets/fluent-3d/money_bag_3d.png +0 -0
  37. package/assets/fluent-3d/musical_notes_3d.png +0 -0
  38. package/assets/fluent-3d/notebook_3d.png +0 -0
  39. package/assets/fluent-3d/open_book_3d.png +0 -0
  40. package/assets/fluent-3d/puzzle_piece_3d.png +0 -0
  41. package/assets/fluent-3d/red_question_mark_3d.png +0 -0
  42. package/assets/fluent-3d/robot_3d.png +0 -0
  43. package/assets/fluent-3d/shield_3d.png +0 -0
  44. package/assets/fluent-3d/shopping_bags_3d.png +0 -0
  45. package/assets/fluent-3d/sparkles_3d.png +0 -0
  46. package/assets/fluent-3d/speech_balloon_3d.png +0 -0
  47. package/assets/fluent-3d/spiral_calendar_3d.png +0 -0
  48. package/assets/fluent-3d/ticket_3d.png +0 -0
  49. package/assets/fluent-3d/triangular_ruler_3d.png +0 -0
  50. package/assets/fluent-3d/world_map_3d.png +0 -0
  51. package/assets/licenses/fluent-emoji.txt +21 -0
  52. package/client/client.js +910 -1240
  53. package/package.json +20 -4
  54. package/screenshots.json +7 -0
  55. package/src/icons.js +5 -1
  56. package/src/index.js +30 -2
  57. package/src/install.js +191 -37
  58. package/src/oauth-bridge.js +270 -0
  59. package/src/oauth-config.js +48 -0
  60. package/src/oauth-store.js +86 -0
  61. package/src/oauth.js +165 -0
  62. package/src/parser.js +25 -3
  63. package/src/routes.js +112 -10
  64. package/src/skills.js +365 -0
  65. package/assets/hero.png +0 -0
package/client/client.js CHANGED
@@ -6,7 +6,188 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
6
6
 
7
7
  const React = require("react");
8
8
  const { createElement: h, useState, useEffect, useCallback, useMemo, useRef, useLayoutEffect } = React;
9
+ const SKILL_MARKDOWN_LABELS = { code: { copyLabel: "复制", copiedLabel: "已复制", toolbarLabels: { codeLabel: "代码", wrapLabel: "自动换行", unwrapLabel: "不换行" } }, footnotes: "注释" };
10
+ // The host's own Markdown and path primitives are the preferred renderer
11
+ // for a skill body, but they are an internal DSH package with no
12
+ // compatibility promise: requiring it unguarded would take the whole
13
+ // panel down on a host that renames or drops it. Fall back to this
14
+ // plugin's own Markdown renderer and a plain path label instead.
15
+ const NativeUI = (() => {
16
+ try { return require("@deepseek-ai/dsh-client-ui-primitives") || {}; } catch { return {}; }
17
+ })();
18
+ const NativeMarkdownText = NativeUI.MarkdownText || (({ text }) => h("div", { className: "cpm-skill-content-native" }, h(SmartMarkdown, { text: String(text ?? "") })));
19
+ const NativePathLabel = NativeUI.PathLabel || (({ path }) => h("span", { "data-path-label": true }, path));
20
+ // Manifests spell a remote transport three ways (`http`, `sse`,
21
+ // `streamable-http`). The editor only has two modes; anything unrecognised
22
+ // used to fall through to the stdio form and show an empty local command
23
+ // for a connector that is actually a remote URL.
24
+ function isRemoteTransport(transport) {
25
+ return transport === "http" || transport === "sse" || transport === "streamable-http" || transport === "streamableHttp";
26
+ }
27
+
28
+ function cleanMcpErrorText(err) {
29
+ if (!err) return "操作失败";
30
+ const msg = String(err.message || err).replace(/^Error:\s*/i, "").trim();
31
+ return msg.length > 50 ? msg.slice(0, 48) + "…" : msg;
32
+ }
33
+
34
+ // Inline progress card shown while a browser sign-in is in flight. Rendered
35
+ // as part of the dialog body (not a labelled grid row) so it reads as one
36
+ // object with its own title, message and actions, using the same tokens as
37
+ // the rest of the dialog.
38
+ function OauthPendingCard({ pending, onCancel }) {
39
+ return h("div", { className: "cpm-oauth-pending", role: "status", "aria-live": "polite" },
40
+ h("span", { className: "cpm-spin-ring", style: { width: 15, height: 15, borderWidth: 2, flexShrink: 0, marginTop: 1 } }),
41
+ h("div", { className: "cpm-oauth-pending-body" },
42
+ h("div", { className: "cpm-oauth-pending-title" }, "等待浏览器授权"),
43
+ h("div", { className: "cpm-oauth-pending-text" }, (pending && pending.message) || "正在准备 OAuth 授权…"),
44
+ h("div", { className: "cpm-oauth-pending-actions" },
45
+ pending && pending.authorizationUrl && h("a", {
46
+ className: "cpm-oauth-link",
47
+ href: pending.authorizationUrl,
48
+ target: "_blank",
49
+ rel: "noopener noreferrer",
50
+ }, h(IconLink, { size: 12 }), "重新打开授权页"),
51
+ h("button", { type: "button", className: "cpm-btn-ghost cpm-oauth-cancel", onClick: onCancel }, "取消"),
52
+ ),
53
+ ),
54
+ );
55
+ }
56
+
57
+ function OauthFields({ form, onChange, idPrefix }) {
58
+ if (form.oauth !== "custom") return null;
59
+ const update = (patch) => onChange({ ...form, ...patch, status: "untested" });
60
+ const input = (label, key, placeholder, type = "text") => h("div", { className: "cpm-mcp-row" },
61
+ h("label", { className: "cpm-mcp-label", htmlFor: `${idPrefix}-${key}` }, label),
62
+ h("div", { className: "cpm-mcp-control" }, h("input", {
63
+ id: `${idPrefix}-${key}`, className: "cpm-mcp-input", type,
64
+ value: form[key] || "", placeholder, autoComplete: "off",
65
+ onChange: (event) => update({ [key]: event.target.value }),
66
+ })),
67
+ );
68
+ return h(React.Fragment, null,
69
+ input("Client ID", "oauthClientId", "OAuth client ID"),
70
+ input("Client Secret", "oauthClientSecret", form.oauthHasClientSecret ? "已保存,留空保持不变" : "Public client 可留空", "password"),
71
+ input("Callback port", "oauthCallbackPort", "留空则随机;固定端口需与注册 URI 一致", "number"),
72
+ input("Scope", "oauthScope", "可选,默认由服务发现"),
73
+ );
74
+ }
75
+
76
+ function useOauthVerification({ form, verifyPath, userMcp, onFinished, onCancel, onError }) {
77
+ const [pending, setPending] = useState(null);
78
+ const pendingRef = useRef(null);
79
+ const startingRef = useRef(false);
80
+ const startControllerRef = useRef(null);
81
+ const operationRef = useRef(0);
82
+ const latestForm = useRef(form);
83
+ latestForm.current = form;
84
+ const callbacks = useRef({ onFinished, onCancel, onError });
85
+ callbacks.current = { onFinished, onCancel, onError };
86
+ const cancelPending = useCallback(async (notify = true) => {
87
+ operationRef.current += 1;
88
+ startingRef.current = false;
89
+ const controller = startControllerRef.current;
90
+ startControllerRef.current = null;
91
+ const session = pendingRef.current;
92
+ pendingRef.current = null;
93
+ setPending(null);
94
+ const path = userMcp ? "/mcps/oauth-status" : verifyPath.replace(/\/verify$/, "/oauth-status");
95
+ try {
96
+ const response = await window.fetch("/universal-plugin-hub/api" + path, {
97
+ method: "POST", headers: { "Content-Type": "application/json" },
98
+ body: JSON.stringify({ sessionId: session?.sessionId || "" }), keepalive: true,
99
+ });
100
+ if (!session && response.ok && (await response.json()).found === false) controller?.abort();
101
+ } catch { controller?.abort(); }
102
+ if (notify) callbacks.current.onCancel?.();
103
+ }, [userMcp, verifyPath]);
104
+ const cancel = useCallback(() => cancelPending(true), [cancelPending]);
105
+ const formFingerprint = JSON.stringify(form, (key, value) => ["testing", "saving", "status", "statusMessage", "lastResult", "oauthSessionId", "diagHover"].includes(key) ? undefined : value);
106
+ useEffect(() => {
107
+ if (pendingRef.current || startingRef.current) void cancelPending(false);
108
+ }, [formFingerprint, cancelPending]);
109
+ useEffect(() => () => { void cancelPending(false); }, [cancelPending]);
110
+ useEffect(() => {
111
+ if (!pending) return;
112
+ let stopped = false;
113
+ let timer;
114
+ const poll = async () => {
115
+ let final = null;
116
+ try {
117
+ const path = userMcp ? "/mcps/oauth-status" : pending.statusPath;
118
+ const response = await window.fetch(`/universal-plugin-hub/api${path}?sessionId=${encodeURIComponent(pending.sessionId)}`);
119
+ const result = await response.json();
120
+ if (!response.ok) throw new Error(result.error || `HTTP ${response.status}`);
121
+ if (stopped || pendingRef.current?.sessionId !== pending.sessionId) return;
122
+ if (result.pending) {
123
+ setPending((previous) => previous?.sessionId === pending.sessionId ? { ...previous, status: result.status, message: result.message, authorizationUrl: result.authorizationUrl } : previous);
124
+ timer = window.setTimeout(poll, 350);
125
+ return;
126
+ }
127
+ final = result;
128
+ } catch (error) {
129
+ if (stopped || pendingRef.current?.sessionId !== pending.sessionId) return;
130
+ pendingRef.current = null;
131
+ setPending(null);
132
+ callbacks.current.onError?.(error);
133
+ return;
134
+ }
135
+ pendingRef.current = null;
136
+ setPending(null);
137
+ // Outside the try: the caller's onFinished may itself reject (saving
138
+ // the verified configuration can fail), and that is a save problem,
139
+ // not a failed verification.
140
+ try {
141
+ await callbacks.current.onFinished?.(final);
142
+ } catch (error) {
143
+ callbacks.current.onError?.(error);
144
+ }
145
+ };
146
+ timer = window.setTimeout(poll, 100);
147
+ return () => { stopped = true; window.clearTimeout(timer); };
148
+ }, [pending?.sessionId, userMcp]);
149
+ const start = async (payload) => {
150
+ if (startingRef.current || pendingRef.current) return;
151
+ startingRef.current = true;
152
+ const operation = ++operationRef.current;
153
+ const controller = new AbortController();
154
+ startControllerRef.current = controller;
155
+ try {
156
+ const response = await window.fetch("/universal-plugin-hub/api" + verifyPath, {
157
+ method: "POST", headers: { "Content-Type": "application/json" },
158
+ body: JSON.stringify(payload || latestForm.current), signal: controller.signal,
159
+ });
160
+ const result = await response.json();
161
+ if (operation !== operationRef.current) {
162
+ if (result.sessionId) {
163
+ const path = userMcp ? "/mcps/oauth-status" : verifyPath.replace(/\/verify$/, "/oauth-status");
164
+ void window.fetch("/universal-plugin-hub/api" + path, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ sessionId: result.sessionId }), keepalive: true }).catch(() => {});
165
+ }
166
+ return;
167
+ }
168
+ if (!response.ok) throw new Error(result.error || `HTTP ${response.status}`);
169
+ if (result.pending) {
170
+ const session = { ...result, statusPath: verifyPath.replace(/\/verify$/, "/oauth-status") };
171
+ pendingRef.current = session;
172
+ setPending(session);
173
+ return;
174
+ }
175
+ await callbacks.current.onFinished?.(result);
176
+ } catch (error) {
177
+ if (operation === operationRef.current && error.name !== "AbortError") callbacks.current.onError?.(error);
178
+ } finally {
179
+ if (operation === operationRef.current) {
180
+ startingRef.current = false;
181
+ startControllerRef.current = null;
182
+ }
183
+ }
184
+ };
185
+ return { pending, start, cancel };
186
+ }
9
187
  const useSafeLayoutEffect = typeof useLayoutEffect === "function" ? useLayoutEffect : useEffect;
188
+ // Two 476px columns plus the 48px gap. The grid stops growing here even in
189
+ // a wider panel; keep it in one place so the search row can match it.
190
+ const GRID_COLUMNS_MAX = 2 * 476 + 48;
10
191
 
11
192
  // ────────────────────────────── Styles ──────────────────────────────
12
193
  const CSS = `
@@ -135,9 +316,14 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
135
316
  flex-direction: column;
136
317
  align-items: center;
137
318
  gap: 12px;
319
+ /* 24px inset, matching the list's own padding. The search row's width is
320
+ then pinned to the columns' measured span (--cpm-column-span), so it
321
+ lines up with them whatever the platform's scrollbar width is — an
322
+ arithmetic guess at the gutter kept coming up short. */
138
323
  padding: 14px 24px 10px 24px;
139
324
  background: var(--cpm-bg);
140
325
  width: 100%;
326
+ box-sizing: border-box;
141
327
  }
142
328
  .cpm-topbar::after {
143
329
  content: "";
@@ -151,7 +337,10 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
151
337
  display: flex;
152
338
  align-items: center;
153
339
  width: 100%;
154
- max-width: 1000px;
340
+ /* The measured span of the two list columns, so the search box ends where
341
+ they do instead of where an arithmetic guess about the scrollbar says.
342
+ Falls back to the shared 1000px baseline before the first measurement. */
343
+ max-width: var(--cpm-column-span, 1000px);
155
344
  }
156
345
  .cpm-search {
157
346
  flex: 1;
@@ -538,10 +727,22 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
538
727
  .cpm-grid, .cpm-grid-container {
539
728
  flex: 1;
540
729
  overflow-y: auto;
541
- padding: 16px 24px 28px 24px;
730
+ /* The top bar's last row already ends ~10px above the 1010px rule, so the
731
+ full 16px grid inset left the first card floating well clear of it. */
732
+ padding: 10px 24px 28px 24px;
542
733
  transition: mask-image 0.2s ease, -webkit-mask-image 0.2s ease;
543
734
  box-sizing: border-box;
544
735
  width: 100%;
736
+ /* Reserve the scrollbar track on every list surface. Centered columns are
737
+ laid out inside the content box, so without this a source whose list is
738
+ short enough to be scrollbar-free sits a scrollbar-width to the right of
739
+ the others and every tab switch shifts the whole grid sideways.
740
+ "both-edges" is required, not cosmetic: a one-sided stable gutter is
741
+ taken from the inline-end edge only, which pushes the centered columns
742
+ half a scrollbar left of the top bar's 1000px baseline (and of the 1010px
743
+ rule under it). Reserving both edges keeps the content box symmetric and
744
+ the columns back on that same axis. */
745
+ scrollbar-gutter: stable both-edges;
545
746
  }
546
747
  .cpm-grid {
547
748
  display: grid;
@@ -725,6 +926,15 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
725
926
  background: #3f3f46;
726
927
  border-color: rgba(255, 255, 255, 0.3);
727
928
  }
929
+ /* The row's trailing control owns one fixed slot. A two-character pill
930
+ measures ~43px on its own and the row's switch is 50px, so right-aligning
931
+ alone still left the description's ellipsis 7px short on plugin rows. Giving
932
+ both the same width pins every source's text column to one edge. */
933
+ .cpm-card > :last-child {
934
+ flex: 0 0 auto;
935
+ margin-left: auto;
936
+ min-width: 50px;
937
+ }
728
938
  .cpm-card-pill-installed {
729
939
  background: #ffffff;
730
940
  border-color: rgba(16, 185, 129, 0.35);
@@ -773,6 +983,12 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
773
983
  flex-direction: column;
774
984
  align-items: center;
775
985
  box-sizing: border-box;
986
+ /* Reserve the scrollbar track on every detail surface, so the centered
987
+ content column — and the Back link at its left edge — stays put whether
988
+ or not the open page happens to overflow. Both edges, so the column keeps
989
+ the same axis as the list grid and the top bar rather than sitting half a
990
+ scrollbar to the left of them. */
991
+ scrollbar-gutter: stable both-edges;
776
992
  }
777
993
  .cpm-detail > * {
778
994
  width: 100%;
@@ -782,17 +998,20 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
782
998
  mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 60px), rgba(0,0,0,0.98) calc(100% - 50px), rgba(0,0,0,0.92) calc(100% - 40px), rgba(0,0,0,0.76) calc(100% - 30px), rgba(0,0,0,0.52) calc(100% - 20px), rgba(0,0,0,0.28) calc(100% - 12px), rgba(0,0,0,0.12) calc(100% - 6px), rgba(0,0,0,0.03) calc(100% - 2px), transparent 100%);
783
999
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 60px), rgba(0,0,0,0.98) calc(100% - 50px), rgba(0,0,0,0.92) calc(100% - 40px), rgba(0,0,0,0.76) calc(100% - 30px), rgba(0,0,0,0.52) calc(100% - 20px), rgba(0,0,0,0.28) calc(100% - 12px), rgba(0,0,0,0.12) calc(100% - 6px), rgba(0,0,0,0.03) calc(100% - 2px), transparent 100%);
784
1000
  }
1001
+ /* One Back affordance for every detail surface: font, size and rhythm are
1002
+ pinned here so a detail page's own typography cannot restyle it. */
785
1003
  .cpm-back {
786
1004
  color: var(--cpm-muted);
787
1005
  cursor: pointer;
1006
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
788
1007
  font-size: 13.5px;
1008
+ font-weight: 500;
789
1009
  border: none;
790
1010
  background: none;
791
1011
  padding: 0 0 16px 0;
792
1012
  display: inline-flex;
793
1013
  align-items: center;
794
1014
  gap: 4px;
795
- font-weight: 500;
796
1015
  }
797
1016
  .cpm-back:hover { color: var(--cpm-text); }
798
1017
  .cpm-title-row {
@@ -1000,6 +1219,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
1000
1219
  flex-direction: column;
1001
1220
  align-items: center;
1002
1221
  box-sizing: border-box;
1222
+ scrollbar-gutter: stable both-edges;
1003
1223
  }
1004
1224
  .cpm-manage > * {
1005
1225
  width: 100%;
@@ -1040,10 +1260,16 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
1040
1260
  }
1041
1261
  .cpm-meta .v { color: var(--cpm-text); font-weight: 500; }
1042
1262
  .cpm-meta .v a { color: var(--cpm-accent); text-decoration: none; }
1263
+ .cpm-skill-warning { color: #c26a24; font-size: 13px; }
1264
+ .cpm-card-open { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
1043
1265
  .cpm-toggle {
1044
1266
  position: relative;
1045
1267
  width: 40px;
1268
+ flex: 0 0 40px;
1269
+ min-width: 40px;
1046
1270
  height: 22px;
1271
+ padding: 0;
1272
+ box-sizing: border-box;
1047
1273
  border-radius: 999px;
1048
1274
  background: var(--cpm-muted);
1049
1275
  border: none;
@@ -1051,6 +1277,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
1051
1277
  transition: background .15s;
1052
1278
  }
1053
1279
  .cpm-toggle.on { background: var(--cpm-toggle-on); }
1280
+ .cpm-toggle:focus-visible { outline: 2px solid var(--cpm-toggle-on); outline-offset: 3px; }
1054
1281
  .cpm-toggle::after {
1055
1282
  content: "";
1056
1283
  position: absolute;
@@ -1063,6 +1290,19 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
1063
1290
  transition: left .15s;
1064
1291
  }
1065
1292
  .cpm-toggle.on::after { left: 20px; }
1293
+ /* A list row's switch only needs to occupy the same *slot* as the pill it
1294
+ stands in for; blowing the switch itself up to the pill's size made it read
1295
+ as oversized. It keeps its familiar 40x22 proportions and is centred in the
1296
+ 50px slot reserved by the trailing-control rule above. */
1297
+ .cpm-card > .cpm-toggle {
1298
+ width: 40px;
1299
+ flex: 0 0 40px;
1300
+ min-width: 40px;
1301
+ height: 22px;
1302
+ /* 50px slot minus the 40px track, split evenly. */
1303
+ margin-left: auto;
1304
+ margin-right: 5px;
1305
+ }
1066
1306
  .cpm-menu { position: relative; }
1067
1307
  .cpm-menu-pop {
1068
1308
  position: absolute;
@@ -1330,6 +1570,37 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
1330
1570
  border: 1px solid rgba(255, 255, 255, 0.12);
1331
1571
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
1332
1572
  }
1573
+ .cpm-upload-dialog {
1574
+ display: grid;
1575
+ gap: 20px;
1576
+ padding: 26px 24px 22px;
1577
+ box-sizing: border-box;
1578
+ max-height: calc(100dvh - 32px);
1579
+ overflow-y: auto;
1580
+ }
1581
+ .cpm-upload-dialog .cpm-dialog-title,
1582
+ .cpm-upload-dialog .cpm-field,
1583
+ .cpm-upload-dialog .cpm-dialog-actions { margin: 0; }
1584
+ .cpm-upload-dialog .cpm-dropzone {
1585
+ width: 100%;
1586
+ min-width: 0;
1587
+ margin: 0;
1588
+ padding: 24px 16px;
1589
+ gap: 8px;
1590
+ font: inherit;
1591
+ color: inherit;
1592
+ appearance: none;
1593
+ }
1594
+ .cpm-upload-dialog .cpm-dropzone-sub { line-height: 1.6; }
1595
+ .cpm-upload-dialog .cpm-dropzone-icon { margin-bottom: 4px; }
1596
+ .cpm-upload-dialog .cpm-field { min-width: 0; }
1597
+ .cpm-upload-dialog .cpm-field label { margin-bottom: 8px; }
1598
+ .cpm-upload-dialog .cpm-input { box-sizing: border-box; min-width: 0; }
1599
+ .cpm-upload-dialog .cpm-dialog-actions { gap: 10px; padding-top: 4px; }
1600
+ .cpm-upload-dialog :is(.cpm-dropzone, .cpm-input):focus-visible {
1601
+ outline: 2px solid var(--cpm-accent);
1602
+ outline-offset: 3px;
1603
+ }
1333
1604
  .cpm-dropzone {
1334
1605
  display: flex;
1335
1606
  flex-direction: column;
@@ -1892,6 +2163,81 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
1892
2163
  border-color: var(--cpm-accent);
1893
2164
  }
1894
2165
 
2166
+ /* Inline browser sign-in progress, shown inside the connector dialog body. */
2167
+ .cpm-oauth-pending {
2168
+ display: flex;
2169
+ align-items: flex-start;
2170
+ gap: 11px;
2171
+ padding: 12px 14px;
2172
+ border-radius: 12px;
2173
+ background: rgba(0, 0, 0, 0.032);
2174
+ border: 1px solid rgba(0, 0, 0, 0.07);
2175
+ animation: cpm-oauth-card-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
2176
+ }
2177
+ .cpm-dark .cpm-oauth-pending {
2178
+ background: rgba(255, 255, 255, 0.05);
2179
+ border: 1px solid rgba(255, 255, 255, 0.09);
2180
+ }
2181
+ @keyframes cpm-oauth-card-in {
2182
+ from { opacity: 0; transform: translateY(-3px); }
2183
+ to { opacity: 1; transform: none; }
2184
+ }
2185
+ .cpm-oauth-pending-body {
2186
+ min-width: 0;
2187
+ flex: 1;
2188
+ display: flex;
2189
+ flex-direction: column;
2190
+ gap: 3px;
2191
+ }
2192
+ .cpm-oauth-pending-title {
2193
+ font-size: 13px;
2194
+ font-weight: 600;
2195
+ line-height: 1.35;
2196
+ color: var(--cpm-text);
2197
+ }
2198
+ .cpm-oauth-pending-text {
2199
+ font-size: 12.5px;
2200
+ line-height: 1.45;
2201
+ color: var(--cpm-muted);
2202
+ word-break: break-word;
2203
+ }
2204
+ .cpm-oauth-pending-actions {
2205
+ display: flex;
2206
+ align-items: center;
2207
+ gap: 10px;
2208
+ margin-top: 6px;
2209
+ }
2210
+ .cpm-oauth-link {
2211
+ display: inline-flex;
2212
+ align-items: center;
2213
+ gap: 5px;
2214
+ font-size: 12.5px;
2215
+ font-weight: 500;
2216
+ color: var(--cpm-accent);
2217
+ text-decoration: none;
2218
+ border-radius: 6px;
2219
+ padding: 3px 6px;
2220
+ margin-left: -6px;
2221
+ transition: background 0.15s ease;
2222
+ }
2223
+ .cpm-oauth-link:hover {
2224
+ background: var(--cpm-tab-hover);
2225
+ text-decoration: underline;
2226
+ }
2227
+ /* Two classes so it outranks the later cpm-btn-ghost rule for the sizing. */
2228
+ .cpm-oauth-pending .cpm-oauth-cancel {
2229
+ height: 26px;
2230
+ padding: 0 8px;
2231
+ font-size: 12.5px;
2232
+ color: var(--cpm-muted);
2233
+ }
2234
+ .cpm-dark .cpm-oauth-link {
2235
+ color: #60a5fa;
2236
+ }
2237
+ @media (prefers-reduced-motion: reduce) {
2238
+ .cpm-oauth-pending { animation: none; }
2239
+ }
2240
+
1895
2241
  /* Custom Dropdown Styles */
1896
2242
  .cpm-custom-select {
1897
2243
  position: relative;
@@ -2639,6 +2985,66 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
2639
2985
  opacity: 0.75;
2640
2986
  font-weight: 400;
2641
2987
  }
2988
+ /* Skill detail is a reading surface; compact popover Markdown stays unchanged. */
2989
+ .cpm-skill-detail {
2990
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
2991
+ font-size: 1rem;
2992
+ padding: 16px 24px 56px;
2993
+ }
2994
+ .cpm-skill-detail > * { flex-shrink: 0; }
2995
+ .cpm-skill-detail > .cpm-back:focus-visible { outline: 2px solid var(--cpm-toggle-on); outline-offset: 2px; }
2996
+ .cpm-skill-header { container-type: inline-size; container-name: cpm-skill-header; padding: .75rem 0 1.5rem; border-bottom: 1px solid var(--cpm-border); }
2997
+ .cpm-skill-identity { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; }
2998
+ .cpm-skill-identity > .cpm-toggle { grid-column: 2; grid-row: 1; justify-self: end; }
2999
+ .cpm-skill-identity > .cpm-card-icon { width: 3.5rem; height: 3.5rem; border-radius: .875rem; }
3000
+ .cpm-skill-title {
3001
+ grid-column: 1 / -1; grid-row: 2; min-width: 0; margin: 0; color: var(--cpm-text);
3002
+ font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2rem); font-weight: 650;
3003
+ line-height: 1.2; letter-spacing: -.025em; overflow-wrap: anywhere; text-wrap: balance;
3004
+ }
3005
+ @container cpm-skill-header (min-width: 28rem) {
3006
+ .cpm-skill-identity { grid-template-columns: auto minmax(0, 1fr) auto; }
3007
+ .cpm-skill-title, .cpm-skill-identity > .cpm-toggle { grid-column: auto; grid-row: auto; }
3008
+ }
3009
+ .cpm-skill-summary {
3010
+ margin: 1.25rem 0 0; color: var(--cpm-text-sub); font-size: .9375rem;
3011
+ line-height: 1.8; overflow-wrap: anywhere; text-wrap: pretty;
3012
+ }
3013
+ .cpm-skill-location {
3014
+ display: flex; align-items: center; gap: .625rem; margin-top: 1.125rem;
3015
+ min-width: 0; color: var(--cpm-muted); font-size: .75rem; line-height: 1.6;
3016
+ }
3017
+ .cpm-skill-location-label { flex-shrink: 0; padding: .125rem .5rem; background: var(--cpm-card-hover); border-radius: .375rem; }
3018
+ .cpm-skill-location [data-path-label] { min-width: 0; max-width: 100%; font-family: var(--cpm-mono, ui-monospace, monospace); user-select: text; }
3019
+ .cpm-skill-content { padding-top: 2rem; min-width: 0; }
3020
+ .cpm-root .cpm-skill-content > div {
3021
+ font-size: .9375rem; line-height: 1.85; color: var(--cpm-text-sub);
3022
+ word-break: normal; overflow-wrap: anywhere;
3023
+ }
3024
+ .cpm-root .cpm-skill-content p { margin: 0 0 1.1em; line-height: inherit; text-wrap: pretty; }
3025
+ .cpm-root .cpm-skill-content :is(h1, h2, h3, h4, h5, h6) {
3026
+ margin: 1.75em 0 .75em; color: var(--cpm-text); font-size: 1rem; font-weight: 650; line-height: 1.4; letter-spacing: -.015em;
3027
+ }
3028
+ .cpm-root .cpm-skill-content h1 { font-size: 1.5rem; }
3029
+ .cpm-root .cpm-skill-content h2 { font-size: 1.25rem; }
3030
+ .cpm-root .cpm-skill-content h3 { font-size: 1.0625rem; }
3031
+ .cpm-root .cpm-skill-content > div > :first-child { margin-top: 0; }
3032
+ .cpm-root .cpm-skill-content :is(ul, ol) { margin: .5em 0 1.25em; padding-inline-start: 1.5em; }
3033
+ .cpm-root .cpm-skill-content li { margin-bottom: .5em; padding-inline-start: .2em; line-height: inherit; }
3034
+ .cpm-root .cpm-skill-content li::marker { color: var(--cpm-muted); }
3035
+ .cpm-root .cpm-skill-content blockquote { margin: 1.25em 0; padding: .75em 1.1em; border-inline-start-color: var(--cpm-border); background: var(--cpm-card-hover); border-radius: 0 .625rem .625rem 0; }
3036
+ .cpm-root .cpm-skill-content blockquote > :last-child { margin-bottom: 0; }
3037
+ .cpm-root .cpm-skill-content pre { font-size: .8125rem; line-height: 1.65; }
3038
+ .cpm-root .cpm-skill-content hr { margin: 2rem 0; border-color: var(--cpm-border); }
3039
+ .cpm-root .cpm-skill-content div:has(> table) { max-width: 100%; margin-block: 1.5rem; border: 1px solid var(--cpm-border); border-radius: .75rem; }
3040
+ .cpm-root .cpm-skill-content table { border-collapse: separate; border-spacing: 0; font-size: .875rem; line-height: 1.7; }
3041
+ .cpm-root .cpm-skill-content :is(th, td) { padding: .75rem 1rem; border: 0; border-bottom: 1px solid var(--cpm-border); vertical-align: top; font-size: .875rem; line-height: 1.7; overflow-wrap: anywhere; }
3042
+ .cpm-root .cpm-skill-content td code { font-size: .8125rem; }
3043
+ .cpm-root .cpm-skill-content th { color: var(--cpm-text); font-weight: 600; background: var(--cpm-card-hover); }
3044
+ .cpm-root .cpm-skill-content tbody tr:last-child td { border-bottom: 0; }
3045
+ .cpm-root .cpm-skill-content .md-table-wide:focus-visible { outline: 2px solid var(--cpm-toggle-on); outline-offset: 3px; }
3046
+ .cpm-skill-detail .cpm-skill-warning { margin: 1.5rem 0 0; font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
3047
+ .cpm-skill-loading { margin: 2rem 0; color: var(--cpm-muted); font-size: .875rem; }
2642
3048
  .cpm-mcp-tool-popover-params {
2643
3049
  display: flex;
2644
3050
  flex-wrap: wrap;
@@ -3241,932 +3647,113 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
3241
3647
  );
3242
3648
  }
3243
3649
 
3244
- // ────────────────────────────── Official Lucide Vector Library (64 Multi-Domain Themes) ──────────────────────────────
3245
- const LUCIDE_BADGES = [
3246
- // 0. Terminal (Emerald / Code & CLI)
3247
- {
3248
- color: "#10b981",
3249
- bgLight: "linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%)",
3250
- borderLight: "#a7f3d0",
3251
- bgDark: "linear-gradient(135deg, #064e3b 0%, #022c22 100%)",
3252
- borderDark: "#047857",
3253
- render: () => [
3254
- h("polyline", { key: "p", points: "4 17 10 11 4 5", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3255
- h("line", { key: "l", x1: 12, y1: 19, x2: 20, y2: 19, stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3256
- ],
3257
- },
3258
- // 1. Code (Cyan / Software & Syntax)
3259
- {
3260
- color: "#06b6d4",
3261
- bgLight: "linear-gradient(135deg, #ecfeff 0%, #cffafe 100%)",
3262
- borderLight: "#a5f3fc",
3263
- bgDark: "linear-gradient(135deg, #164e63 0%, #0d313f 100%)",
3264
- borderDark: "#155e75",
3265
- render: () => [
3266
- h("polyline", { key: "p1", points: "16 18 22 12 16 6", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3267
- h("polyline", { key: "p2", points: "8 6 2 12 8 18", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3268
- ],
3269
- },
3270
- // 2. Video (Red / Video & Cinema)
3271
- {
3272
- color: "#ef4444",
3273
- bgLight: "linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%)",
3274
- borderLight: "#fecaca",
3275
- bgDark: "linear-gradient(135deg, #450a0a 0%, #2b0606 100%)",
3276
- borderDark: "#991b1b",
3277
- render: () => [
3278
- h("rect", { key: "r", x: "2", y: "6", width: "14", height: "12", rx: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3279
- h("polygon", { key: "p", points: "22 8 16 12 22 16 22 8", stroke: "currentColor", strokeWidth: 2, fill: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }),
3280
- ],
3281
- },
3282
- // 3. Film (Rose / Motion & Reels)
3283
- {
3284
- color: "#f43f5e",
3285
- bgLight: "linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%)",
3286
- borderLight: "#fecdd3",
3287
- bgDark: "linear-gradient(135deg, #4c0519 0%, #2e030f 100%)",
3288
- borderDark: "#9f1239",
3289
- render: () => [
3290
- h("rect", { key: "r", x: "3", y: "3", width: "18", height: "18", rx: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3291
- h("line", { key: "l1", x1: "7", y1: "3", x2: "7", y2: "21", stroke: "currentColor", strokeWidth: 2 }),
3292
- h("line", { key: "l2", x1: "17", y1: "3", x2: "17", y2: "21", stroke: "currentColor", strokeWidth: 2 }),
3293
- h("line", { key: "l3", x1: "3", y1: "12", x2: "21", y2: "12", stroke: "currentColor", strokeWidth: 2 }),
3294
- ],
3295
- },
3296
- // 4. Scissors (Pink / Video Cut & Editing)
3297
- {
3298
- color: "#ec4899",
3299
- bgLight: "linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%)",
3300
- borderLight: "#fbcfe8",
3301
- bgDark: "linear-gradient(135deg, #831843 0%, #500724 100%)",
3302
- borderDark: "#be185d",
3303
- render: () => [
3304
- h("circle", { key: "c1", cx: "6", cy: "6", r: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3305
- h("circle", { key: "c2", cx: "6", cy: "18", r: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3306
- h("line", { key: "l1", x1: "20", y1: "4", x2: "8.12", y2: "15.88", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3307
- h("line", { key: "l2", x1: "14.47", y1: "14.48", x2: "20", y2: "20", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3308
- h("line", { key: "l3", x1: "8.12", y1: "8.12", x2: "12", y2: "12", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3309
- ],
3310
- },
3311
- // 5. Wand (Fuchsia / Magic & VFX)
3312
- {
3313
- color: "#d946ef",
3314
- bgLight: "linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%)",
3315
- borderLight: "#f5d0fe",
3316
- bgDark: "linear-gradient(135deg, #4a044e 0%, #2e0231 100%)",
3317
- borderDark: "#701a75",
3318
- render: () => [
3319
- h("path", { key: "p1", d: "M15 4V2M15 16v-2M8 9h2M20 9h2M17.8 11.8 19 13M12.2 6.2 11 5", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3320
- h("path", { key: "p2", d: "M7 2a5 5 0 0 0-5 5c0 2 1.5 3.5 3 5l12 12a1.4 1.4 0 0 0 2 0l2-2a1.4 1.4 0 0 0 0-2L9 8c-1.5-1.5-2-3-2-6Z", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3321
- ],
3322
- },
3323
- // 6. Play (Orange / Action & Streaming)
3324
- {
3325
- color: "#f97316",
3326
- bgLight: "linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%)",
3327
- borderLight: "#fed7aa",
3328
- bgDark: "linear-gradient(135deg, #431407 0%, #270b04 100%)",
3329
- borderDark: "#c2410c",
3330
- render: () => [
3331
- h("polygon", { key: "p", points: "6 4 20 12 6 20 6 4", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3332
- ],
3333
- },
3334
- // 7. Mic (Violet / Voice & Speech)
3335
- {
3336
- color: "#8b5cf6",
3337
- bgLight: "linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%)",
3338
- borderLight: "#ddd6fe",
3339
- bgDark: "linear-gradient(135deg, #2e1065 0%, #1c0a3d 100%)",
3340
- borderDark: "#4c1d95",
3341
- render: () => [
3342
- h("rect", { key: "r", x: "9", y: "2", width: "6", height: "12", rx: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3343
- h("path", { key: "p1", d: "M5 10v2a7 7 0 0 0 14 0v-2", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3344
- h("line", { key: "l1", x1: "12", y1: "19", x2: "12", y2: "22", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3345
- ],
3346
- },
3347
- // 8. Headphones (Indigo / Audio & Music)
3348
- {
3349
- color: "#6366f1",
3350
- bgLight: "linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%)",
3351
- borderLight: "#c7d2fe",
3352
- bgDark: "linear-gradient(135deg, #1e1b4b 0%, #131131 100%)",
3353
- borderDark: "#3730a3",
3354
- render: () => [
3355
- h("path", { key: "p", d: "M3 18v-6a9 9 0 0 1 18 0v6", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3356
- h("rect", { key: "r1", x: "17", y: "14", width: "4", height: "7", rx: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3357
- h("rect", { key: "r2", x: "3", y: "14", width: "4", height: "7", rx: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3358
- ],
3359
- },
3360
- // 9. Music (Purple / Melodies & Audio Tracks)
3361
- {
3362
- color: "#a855f7",
3363
- bgLight: "linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%)",
3364
- borderLight: "#e9d5ff",
3365
- bgDark: "linear-gradient(135deg, #3b0764 0%, #240340 100%)",
3366
- borderDark: "#6b21a8",
3367
- render: () => [
3368
- h("path", { key: "p", d: "M9 18V5l12-2v13", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3369
- h("circle", { key: "c1", cx: "6", cy: "18", r: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3370
- h("circle", { key: "c2", cx: "18", cy: "16", r: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3371
- ],
3372
- },
3373
- // 10. Volume (Blue / Sound Synthesizer)
3374
- {
3375
- color: "#3b82f6",
3376
- bgLight: "linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%)",
3377
- borderLight: "#bfdbfe",
3378
- bgDark: "linear-gradient(135deg, #1e3a8a 0%, #112240 100%)",
3379
- borderDark: "#1d4ed8",
3380
- render: () => [
3381
- h("polygon", { key: "p", points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3382
- h("path", { key: "w1", d: "M15.54 8.46a5 5 0 0 1 0 7.07", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3383
- h("path", { key: "w2", d: "M19.07 4.93a10 10 0 0 1 0 14.14", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3384
- ],
3385
- },
3386
- // 11. Bug (Red / Debugger & Troubleshooting)
3387
- {
3388
- color: "#ef4444",
3389
- bgLight: "linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%)",
3390
- borderLight: "#fecaca",
3391
- bgDark: "linear-gradient(135deg, #450a0a 0%, #2b0606 100%)",
3392
- borderDark: "#991b1b",
3393
- render: () => [
3394
- h("rect", { key: "r", width: "8", height: "14", x: "8", y: "6", rx: "4", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3395
- h("path", { key: "p", d: "m19 7-3 2M5 7l3 2M19 19l-3-2M5 19l3-2M20 13h-4M4 13h4M10 4l1 2M14 4l-1 2", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3396
- ],
3397
- },
3398
- // 12. GitBranch (Amber / Branching & Flow)
3399
- {
3400
- color: "#f59e0b",
3401
- bgLight: "linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%)",
3402
- borderLight: "#fde68a",
3403
- bgDark: "linear-gradient(135deg, #451a03 0%, #291002 100%)",
3404
- borderDark: "#78350f",
3405
- render: () => [
3406
- h("line", { key: "l", x1: "6", x2: "6", y1: "3", y2: "15", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3407
- h("circle", { key: "c1", cx: "18", cy: "6", r: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3408
- h("circle", { key: "c2", cx: "6", cy: "18", r: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3409
- h("path", { key: "p", d: "M18 9a9 9 0 0 1-9 9", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3410
- ],
3411
- },
3412
- // 13. GitPullRequest (Rose / PRs & Review)
3413
- {
3414
- color: "#e11d48",
3415
- bgLight: "linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%)",
3416
- borderLight: "#fecdd3",
3417
- bgDark: "linear-gradient(135deg, #4c0519 0%, #2e030f 100%)",
3418
- borderDark: "#881337",
3419
- render: () => [
3420
- h("circle", { key: "c1", cx: "18", cy: "18", r: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3421
- h("circle", { key: "c2", cx: "6", cy: "6", r: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3422
- h("path", { key: "p", d: "M13 6h3a2 2 0 0 1 2 2v7", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3423
- h("line", { key: "l", x1: "6", x2: "6", y1: "9", y2: "21", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3424
- ],
3425
- },
3426
- // 14. Cpu (Indigo / Processor & Architecture)
3427
- {
3428
- color: "#6366f1",
3429
- bgLight: "linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%)",
3430
- borderLight: "#c7d2fe",
3431
- bgDark: "linear-gradient(135deg, #1e1b4b 0%, #131131 100%)",
3432
- borderDark: "#3730a3",
3433
- render: () => [
3434
- h("rect", { key: "r1", width: "16", height: "16", x: "4", y: "4", rx: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3435
- h("rect", { key: "r2", width: "6", height: "6", x: "9", y: "9", rx: "1", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3436
- h("path", { key: "p", d: "M15 2v2M15 20v2M2 15h2M2 9h2M20 15h2M20 9h2M9 2v2M9 20v2", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3437
- ],
3438
- },
3439
- // 15. Braces (Teal / AST, JSON & Linters)
3440
- {
3441
- color: "#14b8a6",
3442
- bgLight: "linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%)",
3443
- borderLight: "#99f6e4",
3444
- bgDark: "linear-gradient(135deg, #134e4a 0%, #0c3330 100%)",
3445
- borderDark: "#0f766e",
3446
- render: () => [
3447
- h("path", { key: "p1", d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5a2 2 0 0 0 2 2h1", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3448
- h("path", { key: "p2", d: "M16 3h1a2 2 0 0 1 2 2v5a2 2 0 0 0 2 2 2 2 0 0 0-2 2v5a2 2 0 0 1-2 2h-1", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3449
- ],
3450
- },
3451
- // 16. Database (Cyan / SQL, Tables & Storage)
3452
- {
3453
- color: "#06b6d4",
3454
- bgLight: "linear-gradient(135deg, #ecfeff 0%, #cffafe 100%)",
3455
- borderLight: "#a5f3fc",
3456
- bgDark: "linear-gradient(135deg, #164e63 0%, #0d313f 100%)",
3457
- borderDark: "#155e75",
3458
- render: () => [
3459
- h("ellipse", { key: "e", cx: "12", cy: "5", rx: "9", ry: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3460
- h("path", { key: "p1", d: "M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3461
- h("path", { key: "p2", d: "M3 12c0 1.66 4 3 9 3s9-1.34 9-3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3462
- ],
3463
- },
3464
- // 17. Server (Sky Blue / Cloud Backend & Node)
3465
- {
3466
- color: "#0284c7",
3467
- bgLight: "linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%)",
3468
- borderLight: "#bae6fd",
3469
- bgDark: "linear-gradient(135deg, #0c4a6e 0%, #082f46 100%)",
3470
- borderDark: "#0369a1",
3471
- render: () => [
3472
- h("rect", { key: "r1", width: "20", height: "8", x: "2", y: "2", rx: "2", ry: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3473
- h("rect", { key: "r2", width: "20", height: "8", x: "2", y: "14", rx: "2", ry: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3474
- h("line", { key: "l1", x1: "6", x2: "6.01", y1: "6", y2: "6", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3475
- h("line", { key: "l2", x1: "6", x2: "6.01", y1: "18", y2: "18", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3476
- ],
3477
- },
3478
- // 18. Container (Sky / Docker & Microservices)
3479
- {
3480
- color: "#0ea5e9",
3481
- bgLight: "linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%)",
3482
- borderLight: "#bae6fd",
3483
- bgDark: "linear-gradient(135deg, #075985 0%, #032b42 100%)",
3484
- borderDark: "#0284c7",
3485
- render: () => [
3486
- h("path", { key: "p1", d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3487
- h("path", { key: "p2", d: "m3.3 7 8.7 5 8.7-5M12 22V12", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3488
- ],
3489
- },
3490
- // 19. Brain (Violet / Neural & AI Models)
3491
- {
3492
- color: "#8b5cf6",
3493
- bgLight: "linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%)",
3494
- borderLight: "#ddd6fe",
3495
- bgDark: "linear-gradient(135deg, #2e1065 0%, #1c0a3d 100%)",
3496
- borderDark: "#4c1d95",
3497
- render: () => [
3498
- h("path", { key: "p1", d: "M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3499
- h("path", { key: "p2", d: "M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3500
- h("path", { key: "p3", d: "M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3501
- ],
3502
- },
3503
- // 20. Bot (Emerald / Autonomous Agents)
3504
- {
3505
- color: "#10b981",
3506
- bgLight: "linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%)",
3507
- borderLight: "#a7f3d0",
3508
- bgDark: "linear-gradient(135deg, #064e3b 0%, #022c22 100%)",
3509
- borderDark: "#047857",
3510
- render: () => [
3511
- h("path", { key: "p1", d: "M12 8V4H8", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3512
- h("rect", { key: "r", width: "16", height: "12", x: "4", y: "8", rx: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3513
- h("path", { key: "p2", d: "M2 14h2M20 14h2M15 13v2M9 13v2", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3514
- ],
3515
- },
3516
- // 21. Sparkles (Amber / Generation & Prompts)
3517
- {
3518
- color: "#f59e0b",
3519
- bgLight: "linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%)",
3520
- borderLight: "#fde68a",
3521
- bgDark: "linear-gradient(135deg, #451a03 0%, #291002 100%)",
3522
- borderDark: "#78350f",
3523
- render: () => [
3524
- h("path", { key: "s1", d: "m12 3-1.9 5.8a2 2 0 0 1-1.3 1.3L3 12l5.8 1.9a2 2 0 0 1 1.3 1.3L12 21l1.9-5.8a2 2 0 0 1 1.3-1.3L21 12l-5.8-1.9a2 2 0 0 1-1.3-1.3L12 3Z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3525
- h("path", { key: "s2", d: "M5 3v4M3 5h4M19 17v4M17 19h4", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3526
- ],
3527
- },
3528
- // 22. ScanFace (Cyan / Vision, CV & OCR)
3529
- {
3530
- color: "#06b6d4",
3531
- bgLight: "linear-gradient(135deg, #ecfeff 0%, #cffafe 100%)",
3532
- borderLight: "#a5f3fc",
3533
- bgDark: "linear-gradient(135deg, #164e63 0%, #0d313f 100%)",
3534
- borderDark: "#155e75",
3535
- render: () => [
3536
- h("path", { key: "p1", d: "M3 7V5a2 2 0 0 1 2-2h2M17 3h2a2 2 0 0 1 2 2v2M21 17v2a2 2 0 0 1-2 2h-2M7 21H5a2 2 0 0 1-2-2v-2", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3537
- h("circle", { key: "c1", cx: "9", cy: "10", r: "1", fill: "currentColor" }),
3538
- h("circle", { key: "c2", cx: "15", cy: "10", r: "1", fill: "currentColor" }),
3539
- h("path", { key: "p2", d: "M10 15a3 3 0 0 0 4 0", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3540
- ],
3541
- },
3542
- // 23. Activity (Emerald / Monitoring & Metrics)
3543
- {
3544
- color: "#10b981",
3545
- bgLight: "linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%)",
3546
- borderLight: "#a7f3d0",
3547
- bgDark: "linear-gradient(135deg, #064e3b 0%, #022c22 100%)",
3548
- borderDark: "#047857",
3549
- render: () => [
3550
- h("path", { key: "a", d: "M22 12h-4l-3 9L9 3l-3 9H2", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3551
- ],
3552
- },
3553
- // 24. PenTool (Purple / Copywriting & Content Creation)
3554
- {
3555
- color: "#a855f7",
3556
- bgLight: "linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%)",
3557
- borderLight: "#e9d5ff",
3558
- bgDark: "linear-gradient(135deg, #3b0764 0%, #240340 100%)",
3559
- borderDark: "#6b21a8",
3560
- render: () => [
3561
- h("path", { key: "p1", d: "m12 19 7-7 3 3-7 7-3-3z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3562
- h("path", { key: "p2", d: "m18 13-1.5-7.5L2 2l3.5 14.5L13 18l5-5z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3563
- h("circle", { key: "c", cx: "11", cy: "11", r: "2", fill: "currentColor" }),
3564
- ],
3565
- },
3566
- // 25. FileText (Blue / Specs, Summaries & Docs)
3567
- {
3568
- color: "#3b82f6",
3569
- bgLight: "linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%)",
3570
- borderLight: "#bfdbfe",
3571
- bgDark: "linear-gradient(135deg, #1e3a8a 0%, #112240 100%)",
3572
- borderDark: "#1d4ed8",
3573
- render: () => [
3574
- h("path", { key: "p1", d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3575
- h("path", { key: "p2", d: "M14 2v4a2 2 0 0 0 2 2h4", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3576
- h("path", { key: "p3", d: "M10 9H8M16 13H8M16 17H8", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3577
- ],
3578
- },
3579
- // 26. BookOpen (Indigo / Knowledge Base & Wiki)
3580
- {
3581
- color: "#6366f1",
3582
- bgLight: "linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%)",
3583
- borderLight: "#c7d2fe",
3584
- bgDark: "linear-gradient(135deg, #1e1b4b 0%, #131131 100%)",
3585
- borderDark: "#3730a3",
3586
- render: () => [
3587
- h("path", { key: "p1", d: "M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3588
- h("path", { key: "p2", d: "M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3589
- ],
3590
- },
3591
- // 27. Feather (Pink / Stories & Essays)
3592
- {
3593
- color: "#ec4899",
3594
- bgLight: "linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%)",
3595
- borderLight: "#fbcfe8",
3596
- bgDark: "linear-gradient(135deg, #831843 0%, #500724 100%)",
3597
- borderDark: "#be185d",
3598
- render: () => [
3599
- h("path", { key: "p", d: "M20.24 12.24a6 6 0 0 0-8.49-8.49L5 10.5V19h8.5z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3600
- h("line", { key: "l1", x1: "16", y1: "8", x2: "2", y2: "22", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3601
- h("line", { key: "l2", x1: "17.5", y1: "15", x2: "9", y2: "15", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3602
- ],
3603
- },
3604
- // 28. Type (Fuchsia / Headlines & Typography)
3605
- {
3606
- color: "#d946ef",
3607
- bgLight: "linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%)",
3608
- borderLight: "#f5d0fe",
3609
- bgDark: "linear-gradient(135deg, #4a044e 0%, #2e0231 100%)",
3610
- borderDark: "#701a75",
3611
- render: () => [
3612
- h("polyline", { key: "p", points: "4 7 4 4 20 4 20 7", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3613
- h("line", { key: "l1", x1: "9", y1: "20", x2: "15", y2: "20", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3614
- h("line", { key: "l2", x1: "12", y1: "4", x2: "12", y2: "20", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3615
- ],
3616
- },
3617
- // 29. Newspaper (Sky Blue / Feeds & RSS)
3618
- {
3619
- color: "#0284c7",
3620
- bgLight: "linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%)",
3621
- borderLight: "#bae6fd",
3622
- bgDark: "linear-gradient(135deg, #0c4a6e 0%, #082f46 100%)",
3623
- borderDark: "#0369a1",
3624
- render: () => [
3625
- h("path", { key: "p1", d: "M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3626
- h("path", { key: "p2", d: "M18 14h-8M15 18h-5M10 6h8v4h-8V6Z", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }),
3627
- ],
3628
- },
3629
- // 30. Share (Emerald / Social Distribution)
3630
- {
3631
- color: "#10b981",
3632
- bgLight: "linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%)",
3633
- borderLight: "#a7f3d0",
3634
- bgDark: "linear-gradient(135deg, #064e3b 0%, #022c22 100%)",
3635
- borderDark: "#047857",
3636
- render: () => [
3637
- h("circle", { key: "c1", cx: "18", cy: "5", r: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3638
- h("circle", { key: "c2", cx: "6", cy: "12", r: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3639
- h("circle", { key: "c3", cx: "18", cy: "19", r: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3640
- h("line", { key: "l1", x1: "8.59", x2: "15.42", y1: "13.51", y2: "17.49", stroke: "currentColor", strokeWidth: 2 }),
3641
- h("line", { key: "l2", x1: "15.41", x2: "8.59", y1: "6.51", y2: "10.49", stroke: "currentColor", strokeWidth: 2 }),
3642
- ],
3643
- },
3644
- // 31. Palette (Rose / Art & Graphic Design)
3645
- {
3646
- color: "#f43f5e",
3647
- bgLight: "linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%)",
3648
- borderLight: "#fecdd3",
3649
- bgDark: "linear-gradient(135deg, #4c0519 0%, #2e030f 100%)",
3650
- borderDark: "#9f1239",
3651
- render: () => [
3652
- h("circle", { key: "c1", cx: "13.5", cy: "6.5", r: "1", fill: "currentColor" }),
3653
- h("circle", { key: "c2", cx: "17.5", cy: "10.5", r: "1", fill: "currentColor" }),
3654
- h("circle", { key: "c3", cx: "8.5", cy: "7.5", r: "1", fill: "currentColor" }),
3655
- h("circle", { key: "c4", cx: "6.5", cy: "12.5", r: "1", fill: "currentColor" }),
3656
- h("path", { key: "p", d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.9 0 1.6-.7 1.6-1.7 0-.4-.2-.8-.4-1.1-.3-.3-.4-.7-.4-1.1a1.6 1.6 0 0 1 1.7-1.7h2c3 0 5.5-2.5 5.5-5.5C21.9 6 17.5 2 12 2z", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3657
- ],
3658
- },
3659
- // 32. Layout (Sky / Dashboard & Wireframes)
3660
- {
3661
- color: "#0ea5e9",
3662
- bgLight: "linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%)",
3663
- borderLight: "#bae6fd",
3664
- bgDark: "linear-gradient(135deg, #075985 0%, #032b42 100%)",
3665
- borderDark: "#0284c7",
3666
- render: () => [
3667
- h("rect", { key: "r", width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3668
- h("line", { key: "l1", x1: "3", y1: "9", x2: "21", y2: "9", stroke: "currentColor", strokeWidth: 2 }),
3669
- h("line", { key: "l2", x1: "9", y1: "21", x2: "9", y2: "9", stroke: "currentColor", strokeWidth: 2 }),
3670
- ],
3671
- },
3672
- // 33. Image (Purple / Photos & Midjourney)
3673
- {
3674
- color: "#a855f7",
3675
- bgLight: "linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%)",
3676
- borderLight: "#e9d5ff",
3677
- bgDark: "linear-gradient(135deg, #3b0764 0%, #240340 100%)",
3678
- borderDark: "#6b21a8",
3679
- render: () => [
3680
- h("rect", { key: "r", width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3681
- h("circle", { key: "c", cx: "9", cy: "9", r: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3682
- h("path", { key: "p", d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3683
- ],
3684
- },
3685
- // 34. Eye (Cyan / Visual Inspector & A11y)
3686
- {
3687
- color: "#06b6d4",
3688
- bgLight: "linear-gradient(135deg, #ecfeff 0%, #cffafe 100%)",
3689
- borderLight: "#a5f3fc",
3690
- bgDark: "linear-gradient(135deg, #164e63 0%, #0d313f 100%)",
3691
- borderDark: "#155e75",
3692
- render: () => [
3693
- h("path", { key: "p", d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3694
- h("circle", { key: "c", cx: "12", cy: "12", r: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3695
- ],
3696
- },
3697
- // 35. Layers (Teal / Architecture & Stacks)
3698
- {
3699
- color: "#14b8a6",
3700
- bgLight: "linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%)",
3701
- borderLight: "#99f6e4",
3702
- bgDark: "linear-gradient(135deg, #134e4a 0%, #0c3330 100%)",
3703
- borderDark: "#0f766e",
3704
- render: () => [
3705
- h("path", { key: "l1", d: "m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3706
- h("path", { key: "l2", d: "m2 12 8.58 3.91a2 2 0 0 0 1.66 0L22 12", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3707
- h("path", { key: "l3", d: "m2 17 8.58 3.91a2 2 0 0 0 1.66 0L22 17", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3708
- ],
3709
- },
3710
- // 36. Compass (Lime / Discovery & Navigation)
3711
- {
3712
- color: "#84cc16",
3713
- bgLight: "linear-gradient(135deg, #f7fee7 0%, #ecfccb 100%)",
3714
- borderLight: "#d9f99d",
3715
- bgDark: "linear-gradient(135deg, #365314 0%, #20310c 100%)",
3716
- borderDark: "#4d7c0f",
3717
- render: () => [
3718
- h("circle", { key: "c", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3719
- h("polygon", { key: "p", points: "16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3720
- ],
3721
- },
3722
- // 37. Search (Blue / RAG & Query Retrieval)
3723
- {
3724
- color: "#3b82f6",
3725
- bgLight: "linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%)",
3726
- borderLight: "#bfdbfe",
3727
- bgDark: "linear-gradient(135deg, #1e3a8a 0%, #112240 100%)",
3728
- borderDark: "#1d4ed8",
3729
- render: () => [
3730
- h("circle", { key: "c", cx: "11", cy: "11", r: "8", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3731
- h("line", { key: "l", x1: "21", y1: "21", x2: "16.65", y2: "16.65", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3732
- ],
3733
- },
3734
- // 38. Globe (Sky / Internet & Web Crawling)
3735
- {
3736
- color: "#0284c7",
3737
- bgLight: "linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%)",
3738
- borderLight: "#bae6fd",
3739
- bgDark: "linear-gradient(135deg, #0c4a6e 0%, #082f46 100%)",
3740
- borderDark: "#0369a1",
3741
- render: () => [
3742
- h("circle", { key: "g1", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3743
- h("line", { key: "g2", x1: "2", x2: "22", y1: "12", y2: "12", stroke: "currentColor", strokeWidth: 2 }),
3744
- h("path", { key: "g3", d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3745
- ],
3746
- },
3747
- // 39. Link (Teal / Bridge & Connectors)
3748
- {
3749
- color: "#14b8a6",
3750
- bgLight: "linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%)",
3751
- borderLight: "#99f6e4",
3752
- bgDark: "linear-gradient(135deg, #134e4a 0%, #0c3330 100%)",
3753
- borderDark: "#0f766e",
3754
- render: () => [
3755
- h("path", { key: "p1", d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3756
- h("path", { key: "p2", d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3757
- ],
3758
- },
3759
- // 40. Anchor (Cyan / Hooks & Interceptors)
3760
- {
3761
- color: "#06b6d4",
3762
- bgLight: "linear-gradient(135deg, #ecfeff 0%, #cffafe 100%)",
3763
- borderLight: "#a5f3fc",
3764
- bgDark: "linear-gradient(135deg, #164e63 0%, #0d313f 100%)",
3765
- borderDark: "#155e75",
3766
- render: () => [
3767
- h("circle", { key: "c", cx: "12", cy: "5", r: "3", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3768
- h("line", { key: "l", x1: "12", x2: "12", y1: "22", y2: "8", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3769
- h("path", { key: "p", d: "M5 12H2a10 10 0 0 0 20 0h-3", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3770
- ],
3771
- },
3772
- // 41. ShieldCheck (Emerald / Verified Protection)
3773
- {
3774
- color: "#10b981",
3775
- bgLight: "linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%)",
3776
- borderLight: "#a7f3d0",
3777
- bgDark: "linear-gradient(135deg, #064e3b 0%, #022c22 100%)",
3778
- borderDark: "#047857",
3779
- render: () => [
3780
- h("path", { key: "s", d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3781
- h("path", { key: "c", d: "m9 12 2 2 4-4", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3782
- ],
3783
- },
3784
- // 42. ShieldAlert (Red / Risk Control & Security Auditing)
3785
- {
3786
- color: "#ef4444",
3787
- bgLight: "linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%)",
3788
- borderLight: "#fecaca",
3789
- bgDark: "linear-gradient(135deg, #450a0a 0%, #2b0606 100%)",
3790
- borderDark: "#991b1b",
3791
- render: () => [
3792
- h("path", { key: "s", d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3793
- h("line", { key: "l1", x1: "12", y1: "8", x2: "12", y2: "12", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3794
- h("line", { key: "l2", x1: "12", y1: "16", x2: "12.01", y2: "16", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3795
- ],
3796
- },
3797
- // 43. Lock (Amber / Privacy & Encryption)
3798
- {
3799
- color: "#f59e0b",
3800
- bgLight: "linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%)",
3801
- borderLight: "#fde68a",
3802
- bgDark: "linear-gradient(135deg, #451a03 0%, #291002 100%)",
3803
- borderDark: "#78350f",
3804
- render: () => [
3805
- h("rect", { key: "r", width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3806
- h("path", { key: "p", d: "M7 11V7a5 5 0 0 1 10 0v4", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3807
- ],
3808
- },
3809
- // 44. Key (Amber / OAuth Keys & Auth)
3810
- {
3811
- color: "#f59e0b",
3812
- bgLight: "linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%)",
3813
- borderLight: "#fde68a",
3814
- bgDark: "linear-gradient(135deg, #451a03 0%, #291002 100%)",
3815
- borderDark: "#78350f",
3816
- render: () => [
3817
- h("circle", { key: "c", cx: "7.5", cy: "15.5", r: "5.5", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3818
- h("path", { key: "p", d: "m21 2-2 2m-1.5 1.5L19 7l-3 3-2-2-3 3", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3819
- ],
3820
- },
3821
- // 45. CreditCard (Indigo / Payments & Billing)
3822
- {
3823
- color: "#6366f1",
3824
- bgLight: "linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%)",
3825
- borderLight: "#c7d2fe",
3826
- bgDark: "linear-gradient(135deg, #1e1b4b 0%, #131131 100%)",
3827
- borderDark: "#3730a3",
3828
- render: () => [
3829
- h("rect", { key: "r", width: "20", height: "14", x: "2", y: "5", rx: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3830
- h("line", { key: "l", x1: "2", x2: "22", y1: "10", y2: "10", stroke: "currentColor", strokeWidth: 2 }),
3831
- ],
3832
- },
3833
- // 46. Coins (Yellow / Finance & Commercial)
3834
- {
3835
- color: "#eab308",
3836
- bgLight: "linear-gradient(135deg, #fefce8 0%, #fef9c3 100%)",
3837
- borderLight: "#fef08a",
3838
- bgDark: "linear-gradient(135deg, #422006 0%, #271304 100%)",
3839
- borderDark: "#854d0e",
3840
- render: () => [
3841
- h("circle", { key: "c1", cx: "8", cy: "8", r: "6", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3842
- h("path", { key: "p1", d: "M18.09 10.37A6 6 0 1 1 10.34 18", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3843
- h("path", { key: "p2", d: "M7 6h1v4M17 14h.01", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3844
- ],
3845
- },
3846
- // 47. ShoppingCart (Orange / E-Commerce & Stores)
3847
- {
3848
- color: "#f97316",
3849
- bgLight: "linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%)",
3850
- borderLight: "#fed7aa",
3851
- bgDark: "linear-gradient(135deg, #431407 0%, #270b04 100%)",
3852
- borderDark: "#c2410c",
3853
- render: () => [
3854
- h("circle", { key: "c1", cx: "8", cy: "21", r: "1", fill: "currentColor" }),
3855
- h("circle", { key: "c2", cx: "19", cy: "21", r: "1", fill: "currentColor" }),
3856
- h("path", { key: "p", d: "M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3857
- ],
3858
- },
3859
- // 48. TrendingUp (Emerald / Growth & Performance Benchmark)
3860
- {
3861
- color: "#10b981",
3862
- bgLight: "linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%)",
3863
- borderLight: "#a7f3d0",
3864
- bgDark: "linear-gradient(135deg, #064e3b 0%, #022c22 100%)",
3865
- borderDark: "#047857",
3866
- render: () => [
3867
- h("polyline", { key: "p1", points: "22 7 13.5 15.5 8.5 10.5 2 17", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3868
- h("polyline", { key: "p2", points: "16 7 22 7 22 13", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3869
- ],
3870
- },
3871
- // 49. PieChart (Violet / Data Analytics & BI)
3872
- {
3873
- color: "#8b5cf6",
3874
- bgLight: "linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%)",
3875
- borderLight: "#ddd6fe",
3876
- bgDark: "linear-gradient(135deg, #2e1065 0%, #1c0a3d 100%)",
3877
- borderDark: "#4c1d95",
3878
- render: () => [
3879
- h("path", { key: "p1", d: "M21.21 15.89A10 10 0 1 1 8 2.83", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3880
- h("path", { key: "p2", d: "M22 12A10 10 0 0 0 12 2v10z", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3881
- ],
3882
- },
3883
- // 50. MessageSquare (Blue / Chat & Messaging)
3884
- {
3885
- color: "#3b82f6",
3886
- bgLight: "linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%)",
3887
- borderLight: "#bfdbfe",
3888
- bgDark: "linear-gradient(135deg, #1e3a8a 0%, #112240 100%)",
3889
- borderDark: "#1d4ed8",
3890
- render: () => [
3891
- h("path", { key: "m", d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3892
- ],
3893
- },
3894
- // 51. MessagesSquare (Pink / Chatrooms & Group Discussions)
3895
- {
3896
- color: "#ec4899",
3897
- bgLight: "linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%)",
3898
- borderLight: "#fbcfe8",
3899
- bgDark: "linear-gradient(135deg, #831843 0%, #500724 100%)",
3900
- borderDark: "#be185d",
3901
- render: () => [
3902
- h("path", { key: "p1", d: "M14 9a2 2 0 0 1-2 2H6l-4 4V4c0-1.1.9-2 2-2h8a2 2 0 0 1 2 2v5Z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3903
- h("path", { key: "p2", d: "M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3904
- ],
3905
- },
3906
- // 52. Mail (Sky / Email Newsletters)
3907
- {
3908
- color: "#0284c7",
3909
- bgLight: "linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%)",
3910
- borderLight: "#bae6fd",
3911
- bgDark: "linear-gradient(135deg, #0c4a6e 0%, #082f46 100%)",
3912
- borderDark: "#0369a1",
3913
- render: () => [
3914
- h("rect", { key: "r", width: "20", height: "16", x: "2", y: "4", rx: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3915
- h("path", { key: "p", d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3916
- ],
3917
- },
3918
- // 53. Users (Indigo / Community & Team Members)
3919
- {
3920
- color: "#6366f1",
3921
- bgLight: "linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%)",
3922
- borderLight: "#c7d2fe",
3923
- bgDark: "linear-gradient(135deg, #1e1b4b 0%, #131131 100%)",
3924
- borderDark: "#3730a3",
3925
- render: () => [
3926
- h("path", { key: "p1", d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3927
- h("circle", { key: "c1", cx: "9", cy: "7", r: "4", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3928
- h("path", { key: "p2", d: "M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3929
- ],
3930
- },
3931
- // 54. Wrench (Sky / Diagnosis & Doctor Repair)
3932
- {
3933
- color: "#0284c7",
3934
- bgLight: "linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%)",
3935
- borderLight: "#bae6fd",
3936
- bgDark: "linear-gradient(135deg, #0c4a6e 0%, #082f46 100%)",
3937
- borderDark: "#0369a1",
3938
- render: () => [
3939
- h("path", { key: "w", d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3940
- ],
3941
- },
3942
- // 55. Gauge (Amber / Speedometer & Latency)
3943
- {
3944
- color: "#f59e0b",
3945
- bgLight: "linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%)",
3946
- borderLight: "#fde68a",
3947
- bgDark: "linear-gradient(135deg, #451a03 0%, #291002 100%)",
3948
- borderDark: "#78350f",
3949
- render: () => [
3950
- h("path", { key: "g1", d: "m12 14 4-4", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
3951
- h("path", { key: "g2", d: "M3.34 19a10 10 0 1 1 17.32 0", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3952
- ],
3953
- },
3954
- // 56. CheckCircle (Emerald / Quality QA & Compliance Standards)
3955
- {
3956
- color: "#10b981",
3957
- bgLight: "linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%)",
3958
- borderLight: "#a7f3d0",
3959
- bgDark: "linear-gradient(135deg, #064e3b 0%, #022c22 100%)",
3960
- borderDark: "#047857",
3961
- render: () => [
3962
- h("path", { key: "p1", d: "M22 11.08V12a10 10 0 1 1-5.93-9.14", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3963
- h("polyline", { key: "p2", points: "22 4 12 14.01 9 11.01", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3964
- ],
3965
- },
3966
- // 57. Flame (Rose / Power Boost & Turbo)
3967
- {
3968
- color: "#f43f5e",
3969
- bgLight: "linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%)",
3970
- borderLight: "#fecdd3",
3971
- bgDark: "linear-gradient(135deg, #4c0519 0%, #2e030f 100%)",
3972
- borderDark: "#9f1239",
3973
- render: () => [
3974
- h("path", { key: "f", d: "M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3975
- ],
3976
- },
3977
- // 58. Zap (Yellow / Superpowers & Speed)
3978
- {
3979
- color: "#eab308",
3980
- bgLight: "linear-gradient(135deg, #fefce8 0%, #fef9c3 100%)",
3981
- borderLight: "#fef08a",
3982
- bgDark: "linear-gradient(135deg, #422006 0%, #271304 100%)",
3983
- borderDark: "#854d0e",
3984
- render: () => [
3985
- h("polygon", { key: "z", points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
3986
- ],
3987
- },
3988
- // 59. Truck (Orange / Migration & Asset Transfer)
3989
- {
3990
- color: "#f97316",
3991
- bgLight: "linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%)",
3992
- borderLight: "#fed7aa",
3993
- bgDark: "linear-gradient(135deg, #431407 0%, #270b04 100%)",
3994
- borderDark: "#c2410c",
3995
- render: () => [
3996
- h("path", { key: "p1", d: "M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3997
- h("path", { key: "p2", d: "M15 18H9M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14v10Z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
3998
- h("circle", { key: "c1", cx: "17", cy: "18", r: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
3999
- h("circle", { key: "c2", cx: "7", cy: "18", r: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
4000
- ],
4001
- },
4002
- // 60. RefreshCw (Sky Blue / Sync & Auto-Update)
4003
- {
4004
- color: "#0ea5e9",
4005
- bgLight: "linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%)",
4006
- borderLight: "#bae6fd",
4007
- bgDark: "linear-gradient(135deg, #075985 0%, #032b42 100%)",
4008
- borderDark: "#0284c7",
4009
- render: () => [
4010
- h("path", { key: "p1", d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
4011
- h("path", { key: "p2", d: "M3 3v5h5", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
4012
- h("path", { key: "p3", d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
4013
- h("path", { key: "p4", d: "M16 16h5v5", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
4014
- ],
4015
- },
4016
- // 61. Workflow (Violet / Pipelines & Automation)
4017
- {
4018
- color: "#8b5cf6",
4019
- bgLight: "linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%)",
4020
- borderLight: "#ddd6fe",
4021
- bgDark: "linear-gradient(135deg, #2e1065 0%, #1c0a3d 100%)",
4022
- borderDark: "#4c1d95",
4023
- render: () => [
4024
- h("rect", { key: "r1", width: "8", height: "8", x: "3", y: "3", rx: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
4025
- h("path", { key: "p", d: "M7 11v4a2 2 0 0 0 2 2h4", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round" }),
4026
- h("rect", { key: "r2", width: "8", height: "8", x: "13", y: "13", rx: "2", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
4027
- ],
4028
- },
4029
- // 62. Clock (Slate / Cron & Scheduling)
4030
- {
4031
- color: "#64748b",
4032
- bgLight: "linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%)",
4033
- borderLight: "#cbd5e1",
4034
- bgDark: "linear-gradient(135deg, #1e293b 0%, #0f172a 100%)",
4035
- borderDark: "#334155",
4036
- render: () => [
4037
- h("circle", { key: "c", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: 2, fill: "none" }),
4038
- h("polyline", { key: "p", points: "12 6 12 12 16 14", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
4039
- ],
4040
- },
4041
- // 63. Package (Purple / Tools & Module Library)
4042
- {
4043
- color: "#a855f7",
4044
- bgLight: "linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%)",
4045
- borderLight: "#e9d5ff",
4046
- bgDark: "linear-gradient(135deg, #3b0764 0%, #240340 100%)",
4047
- borderDark: "#6b21a8",
4048
- render: () => [
4049
- h("path", { key: "p1", d: "m7.5 4.27 9 5.15", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round" }),
4050
- h("path", { key: "p2", d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
4051
- h("path", { key: "p3", d: "m3.3 7 8.7 5 8.7-5M12 22V12", stroke: "currentColor", strokeWidth: 2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
4052
- ],
4053
- },
3650
+ // Original Microsoft Fluent Emoji 3D PNGs. MIT; see assets/licenses/fluent-emoji.txt.
3651
+ const FLUENT_3D_ICONS = {
3652
+ "brain": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FBrain%2F3D%2Fbrain_3d.png",
3653
+ "compass-tool": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FCompass%2F3D%2Fcompass_3d.png",
3654
+ "chat-circle-dots": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FSpeech%2520balloon%2F3D%2Fspeech_balloon_3d.png",
3655
+ "microscope": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FMicroscope%2F3D%2Fmicroscope_3d.png",
3656
+ "graduation-cap": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FGraduation%2520cap%2F3D%2Fgraduation_cap_3d.png",
3657
+ "notebook": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FNotebook%2F3D%2Fnotebook_3d.png",
3658
+ "translate": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FInput%2520latin%2520letters%2F3D%2Finput_latin_letters_3d.png",
3659
+ "briefcase": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FBriefcase%2F3D%2Fbriefcase_3d.png",
3660
+ "identification-card": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FIdentification%2520card%2F3D%2Fidentification_card_3d.png",
3661
+ "scales": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FBalance%2520scale%2F3D%2Fbalance_scale_3d.png",
3662
+ "handshake": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FHandshake%2F3D%2Fhandshake_3d.png",
3663
+ "magnifying-glass": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FMagnifying%2520glass%2520tilted%2520left%2F3D%2Fmagnifying_glass_tilted_left_3d.png",
3664
+ "puzzle-piece": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FPuzzle%2520piece%2F3D%2Fpuzzle_piece_3d.png",
3665
+ "presentation-chart": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FBar%2520chart%2F3D%2Fbar_chart_3d.png",
3666
+ "image-square": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FFramed%2520picture%2F3D%2Fframed_picture_3d.png",
3667
+ "pen-nib": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FMemo%2F3D%2Fmemo_3d.png",
3668
+ "code-block": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FLaptop%2F3D%2Flaptop_3d.png",
3669
+ "tree-structure": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FWorld%2520map%2F3D%2Fworld_map_3d.png",
3670
+ "question": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FRed%2520question%2520mark%2F3D%2Fred_question_mark_3d.png",
3671
+ "ticket": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FTicket%2F3D%2Fticket_3d.png",
3672
+ "blueprint": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FTriangular%2520ruler%2F3D%2Ftriangular_ruler_3d.png",
3673
+ "kanban": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FClipboard%2F3D%2Fclipboard_3d.png",
3674
+ "sliders-horizontal": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FControl%2520knobs%2F3D%2Fcontrol_knobs_3d.png",
3675
+ "terminal-window": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FDesktop%2520computer%2F3D%2Fdesktop_computer_3d.png",
3676
+ "database": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FCard%2520file%2520box%2F3D%2Fcard_file_box_3d.png",
3677
+ "cloud": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FCloud%2F3D%2Fcloud_3d.png",
3678
+ "shield-check": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FShield%2F3D%2Fshield_3d.png",
3679
+ "music-notes": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FMusical%2520notes%2F3D%2Fmusical_notes_3d.png",
3680
+ "film-strip": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FClapper%2520board%2F3D%2Fclapper_board_3d.png",
3681
+ "globe": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FGlobe%2520with%2520meridians%2F3D%2Fglobe_with_meridians_3d.png",
3682
+ "robot": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FRobot%2F3D%2Frobot_3d.png",
3683
+ "calendar-blank": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FSpiral%2520calendar%2F3D%2Fspiral_calendar_3d.png",
3684
+ "chart-line-up": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FChart%2520increasing%2F3D%2Fchart_increasing_3d.png",
3685
+ "stack": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FBooks%2F3D%2Fbooks_3d.png",
3686
+ "book-open-text": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FOpen%2520book%2F3D%2Fopen_book_3d.png",
3687
+ "cpu": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FDesktop%2520computer%2F3D%2Fdesktop_computer_3d.png",
3688
+ "bug": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FLady%2520beetle%2F3D%2Flady_beetle_3d.png",
3689
+ "git-branch": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FGear%2F3D%2Fgear_3d.png",
3690
+ "link-simple": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FLink%2F3D%2Flink_3d.png",
3691
+ "lock-key": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FLocked%2F3D%2Flocked_3d.png",
3692
+ "sparkle": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FSparkles%2F3D%2Fsparkles_3d.png",
3693
+ "currency-circle-dollar": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FMoney%2520bag%2F3D%2Fmoney_bag_3d.png",
3694
+ "shopping-bag-open": "/universal-plugin-hub/api/icon?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Ffluentui-emoji%2F1ffb34c752ecf5d402f04cfb4b392c77f57c54bc%2Fassets%2FShopping%2520bags%2F3D%2Fshopping_bags_3d.png",
3695
+ };
3696
+ const FALLBACK_RULES = [
3697
+ [/\b(brainstorm|brainstorming|brain|mind)\b|头脑风暴|大脑/, "brain"],
3698
+ [/\b(first principles|mental models?|reasoning|logic)\b|第一性原理|心智模型|逻辑/, "compass-tool"],
3699
+ [/\b(bq|interview|grill|grilling|conversation|chat|discuss)\b|面试|沟通|讨论/, "chat-circle-dots"],
3700
+ [/\b(resume|cv|profile|identity)\b|简历|档案/, "identification-card"],
3701
+ [/\b(salary|negotiation|negotiate|negotiating)\b|谈薪|谈判/, "handshake"],
3702
+ [/\b(compare|comparison|decision)\b|对比|决策/, "scales"],
3703
+ [/\b(job|career|offer|recruit|hiring|business)\b|求职|招聘|职场/, "briefcase"],
3704
+ [/\b(learn eng|english|translate|translation|language|i18n)\b|英语|翻译|语言/, "translate"],
3705
+ [/\b(memo|memory|memorize|flashcard|flashcards|maimemo)\b|记忆|背单词|墨墨/, "stack"],
3706
+ [/\b(teach|learn|learning|homework|cs61b|education|course|study)\b|教学|学习|课程/, "graduation-cap"],
3707
+ [/\b(research|investigate|science|scientific)\b|研究|科研|调研/, "microscope"],
3708
+ [/\b(note|notes|notebook|obsidian|wiki|knowledge)\b|笔记|知识库/, "notebook"],
3709
+ [/\b(ppt|presentation|presentations|slides|slide|keynote)\b|演示|幻灯片/, "presentation-chart"],
3710
+ [/\b(image|photo|picture|draw|illustration|canvas)\b|图像|图片|插画|海报/, "image-square"],
3711
+ [/\b(humanizer|unslop|write|writing|writer|copywriting|article|text|markdown)\b|润色|写作|文章|文案/, "pen-nib"],
3712
+ [/\b(triage|kanban|project|projects)\b|分诊|看板|项目/, "kanban"],
3713
+ [/\b(ticket|tickets|issue|issues)\b|工单|票据/, "ticket"],
3714
+ [/\b(spec|specification|plan|planning|blueprint)\b|规格|规范|规划/, "blueprint"],
3715
+ [/\b(how|workflow|architecture|orchestration|pipeline|automation)\b|流程|架构|编排/, "tree-structure"],
3716
+ [/\b(why|question|questions|explain)\b|为什么|提问|解释/, "question"],
3717
+ [/\b(setup|config|configuration|settings|controls)\b|配置|设置/, "sliders-horizontal"],
3718
+ [/\b(find|search|discovery|lookup|retrieval|rag)\b|查找|搜索|检索/, "magnifying-glass"],
3719
+ [/\b(reverse engineer|cpu|firmware|binary|kernel|chip)\b|逆向|内核|芯片/, "cpu"],
3720
+ [/\b(karpathy|implement|code|coding|dev|developer|sdk|lsp|compiler|programming)\b|编程|代码|开发/, "code-block"],
3721
+ [/\b(design|ui|ux|frontend|layout|glass|theme|color)\b|设计|界面|布局/, "stack"],
3722
+ [/\b(terminal|cli|shell|bash|console|command)\b|终端|命令行/, "terminal-window"],
3723
+ [/\b(database|sql|postgres|mysql|redis|storage|data)\b|数据库|存储/, "database"],
3724
+ [/\b(security|guard|safety|audit|verify|permission)\b|安全|审计|权限/, "shield-check"],
3725
+ [/\b(lock|encryption|privacy|secret|credential|oauth)\b|加密|隐私|密钥/, "lock-key"],
3726
+ [/\b(video|film|movie|animation|editing)\b|视频|影片|动画/, "film-strip"],
3727
+ [/\b(audio|voice|speech|music|podcast|sound)\b|音乐|语音|音频/, "music-notes"],
3728
+ [/\b(calendar|schedule|cron|time|daily)\b|日历|日程|定时/, "calendar-blank"],
3729
+ [/\b(chart|analytics|statistics|metrics|growth)\b|图表|统计|增长/, "chart-line-up"],
3730
+ [/\b(finance|money|billing|payment|currency)\b|金融|财务|支付/, "currency-circle-dollar"],
3731
+ [/\b(shop|shopping|commerce|store|cart)\b|购物|电商|商店/, "shopping-bag-open"],
3732
+ [/\b(bug|debug|error|test|testing|diagnosis)\b|调试|测试|诊断/, "bug"],
3733
+ [/\b(git|github|branch|commit|repository)\b|分支|提交|仓库/, "git-branch"],
3734
+ [/\b(bridge|gateway|integration|connect|link)\b|网关|桥接|连接/, "link-simple"],
3735
+ [/\b(cloud|server|deploy|container|docker|backend)\b|云端|部署|服务器/, "cloud"],
3736
+ [/\b(web|browser|crawl|scrape|internet)\b|网页|浏览器|网络/, "globe"],
3737
+ [/\b(book|docs|documentation|read|reading)\b|文档|阅读|手册/, "book-open-text"],
3738
+ [/\b(agent|robot|assistant|bot)\b|智能体|助手|机器人/, "robot"],
3739
+ [/\b(ai|llm|prompt|generate|magic)\b|提示词|生成|大模型/, "sparkle"],
3740
+ [/\b(plugin|plugins|package|bundle|toolkit)\b|插件|工具箱/, "puzzle-piece"],
4054
3741
  ];
4055
-
4056
3742
  const BADGE_CACHE = new Map();
4057
3743
  function getPluginBadge(plugin) {
4058
- const rawName = String(plugin?.name || "").toLowerCase();
4059
- const rawDisp = String(plugin?.displayName || "").toLowerCase();
4060
- const rawDesc = String(plugin?.description || "").toLowerCase();
4061
- const author = String(typeof plugin?.author === "string" ? plugin.author : (plugin?.author && plugin.author.name) || "").toLowerCase();
4062
- const cacheKey = `${rawName}::${rawDisp}::${author}`;
4063
-
4064
- if (BADGE_CACHE.has(cacheKey)) {
4065
- return BADGE_CACHE.get(cacheKey);
4066
- }
4067
-
4068
- // Clean common repository prefix
4069
- const cleanName = rawName.replace(/^(dbs|ecc|claude|agent|tool|mcp|plugin|skill)[-_]+/i, "");
4070
- const text = `${cleanName} ${rawDisp} ${rawDesc} ${author}`.toLowerCase();
4071
-
4072
- let badge = null;
4073
-
4074
- // 1. Video / Editing / Animation
4075
- if (/\b(video|film|movie|clip|screen|record|obs|ffmpeg|render|capcut|premiere|vfx|motion|animation|reels|subtitle|caption)\b|视频|剪辑|影视|动画|录屏|特效|字幕/.test(text)) {
4076
- if (text.includes("cut") || text.includes("scissors") || text.includes("剪")) badge = LUCIDE_BADGES[4]; // Scissors
4077
- else if (text.includes("film") || text.includes("movie") || text.includes("影")) badge = LUCIDE_BADGES[3]; // Film
4078
- else if (text.includes("wand") || text.includes("effect") || text.includes("特效")) badge = LUCIDE_BADGES[5]; // Wand
4079
- else badge = LUCIDE_BADGES[2]; // Video
4080
- }
4081
-
4082
- // 2. Audio / Voice / Music / Podcast
4083
- else if (/\b(audio|voice|speech|tts|whisper|sound|music|podcast|mic|vocal|listen|track|song|acoustic|elevenlabs)\b|音频|语音|配音|音乐|播客|声音/.test(text)) {
4084
- if (text.includes("music") || text.includes("song") || text.includes("曲") || text.includes("乐")) badge = LUCIDE_BADGES[9]; // Music
4085
- else if (text.includes("headphone") || text.includes("listen") || text.includes("听")) badge = LUCIDE_BADGES[8]; // Headphones
4086
- else if (text.includes("volume") || text.includes("speaker") || text.includes("声")) badge = LUCIDE_BADGES[10]; // Volume
4087
- else badge = LUCIDE_BADGES[7]; // Mic
4088
- }
4089
-
4090
- // 3. Testing / QA / Standards / Diagnosis / Wrench
4091
- else if (/\b(diagnos|doctor|repair|fix|troubleshoot|healthcheck)\b|诊断|体检|排错|修复/.test(text)) badge = LUCIDE_BADGES[54]; // Wrench
4092
- else if (/\b(benchmark|standard|answer|compliant|quality|assert|eval|grading|audit)\b|对标|标准|答案|基准|质检|评估/.test(text)) badge = LUCIDE_BADGES[56]; // CheckCircle
4093
- else if (/\b(risk|vulnerabilit|guard|auth|safe|protect|firewall|exploit|penetrat|cve|owasp)\b|风控|安全|漏洞|防护|鉴权/.test(text)) badge = LUCIDE_BADGES[42]; // ShieldAlert
4094
- else if (/\b(security|safe|verify|certified|cert)\b|认证|合规/.test(text)) badge = LUCIDE_BADGES[41]; // ShieldCheck
4095
-
4096
- // 4. Update / Sync / Bridge / Migration / Workflow / Hook
4097
- else if (/\b(update|refresh|renew|upgrade)\b|更新|刷新|升级/.test(text)) badge = LUCIDE_BADGES[60]; // RefreshCw
4098
- else if (/\b(migration|migrate|transfer|import|export|move|shift|relocat)\b|迁移|导入|导出|搬迁/.test(text)) badge = LUCIDE_BADGES[59]; // Truck
4099
- else if (/\b(bridge|gateway|adapter|connect|router|tunnel)\b|桥接|网关|连接|适配/.test(text)) badge = LUCIDE_BADGES[39]; // Link
4100
- else if (/\b(hook|interceptor|event|listener|signal)\b|钩子|拦截|触发器/.test(text)) badge = LUCIDE_BADGES[40]; // Anchor
4101
- else if (/\b(workflow|pipeline|orchestrat|dag|automat|flow)\b|工作流|流水线|编排|自动化/.test(text)) badge = LUCIDE_BADGES[61]; // Workflow
4102
- else if (/\b(schedule|cron|timer|clock|daily|interval)\b|定时|调度|周期|日历/.test(text)) badge = LUCIDE_BADGES[62]; // Clock
4103
-
4104
- // 5. Writing / Content / Copywriting / Typography / Knowledge
4105
- else if (/\b(title|headline|xhs|typography|font)\b|标题|小红书|排版|字体|文案标题/.test(text)) badge = LUCIDE_BADGES[28]; // Type
4106
- else if (/\b(content|copywriting|writer|article|essay|story|draft)\b|写作|文案|内容|文章|创作/.test(text)) badge = LUCIDE_BADGES[24]; // PenTool
4107
- else if (/\b(knowledge|wiki|docs?|book|study|learn|manual|research)\b|知识|知识库|文档|百科|手册|研报/.test(text)) badge = LUCIDE_BADGES[26]; // BookOpen
4108
- else if (/\b(news|newsletter|rss|feed|press|bulletin)\b|新闻|快讯|简报|早报/.test(text)) badge = LUCIDE_BADGES[29]; // Newspaper
4109
- else if (/\b(social|share|wechat|weibo|twitter|discord|outreach)\b|微信|社交|分发|分享/.test(text)) badge = LUCIDE_BADGES[30]; // Share
4110
- else if (/\b(blog|post|feather|author)\b|博客|帖子/.test(text)) badge = LUCIDE_BADGES[27]; // Feather
4111
- else if (/\b(doc|file|summary|spec|resume)\b|总结|摘要|报告|文档/.test(text)) badge = LUCIDE_BADGES[25]; // FileText
4112
-
4113
- // 6. Communication / Chat / Message
4114
- else if (/\b(chatroom|conversation|forum|discuss)\b|聊天室|群聊|讨论/.test(text)) badge = LUCIDE_BADGES[51]; // MessagesSquare
4115
- else if (/\b(chat|message|dialog|talk|im|room)\b|聊天|对话|会话|留言/.test(text)) badge = LUCIDE_BADGES[50]; // MessageSquare
4116
- else if (/\b(mail|email|inbox|smtp|sendgrid)\b|邮件|邮箱|信件/.test(text)) badge = LUCIDE_BADGES[52]; // Mail
4117
- else if (/\b(users|team|member|community|group)\b|团队|社区|成员|用户/.test(text)) badge = LUCIDE_BADGES[53]; // Users
4118
-
4119
- // 7. Design / UI / UX / Graphics
4120
- else if (/\b(palette|paint|art|color|theme)\b|画板|艺术|色彩|配色/.test(text)) badge = LUCIDE_BADGES[31]; // Palette
4121
- else if (/\b(layout|dashboard|ui|ux|frontend|wireframe)\b|布局|仪表盘|界面|前端/.test(text)) badge = LUCIDE_BADGES[32]; // Layout
4122
- else if (/\b(image|photo|midjourney|dalle|draw|canvas)\b|图像|图片|海报|插画|照片/.test(text)) badge = LUCIDE_BADGES[33]; // Image
4123
- else if (/\b(eye|inspector|visual|preview|look)\b|检查|预览|视图/.test(text)) badge = LUCIDE_BADGES[34]; // Eye
4124
- else if (/\b(layer|stack|hierarchy|structure)\b|图层|分层|结构|架构/.test(text)) badge = LUCIDE_BADGES[35]; // Layers
4125
-
4126
- // 8. Finance / Business / E-Commerce / Data
4127
- else if (/\b(finance|money|cash|invoice|billing|accounting|ledger|coin|crypto|tax)\b|金融|财务|商业|变现|发票|账单|货币/.test(text)) badge = LUCIDE_BADGES[46]; // Coins
4128
- else if (/\b(pay|stripe|payment|checkout|card)\b|支付|刷卡|结算/.test(text)) badge = LUCIDE_BADGES[45]; // CreditCard
4129
- else if (/\b(shop|store|cart|commerce|product|catalog)\b|电商|商店|购物|商品/.test(text)) badge = LUCIDE_BADGES[47]; // ShoppingCart
4130
- else if (/\b(growth|trend|metric|analytics|stats|bi)\b|增长|统计|分析|度量|行情/.test(text)) badge = LUCIDE_BADGES[48]; // TrendingUp
4131
- else if (/\b(chart|report|pie|dashboard)\b|图表|报表/.test(text)) badge = LUCIDE_BADGES[49]; // PieChart
4132
-
4133
- // 9. Coding / Dev / Languages / Infrastructure
4134
- else if (/\b(database|sql|postgres|mysql|sqlite|mongo|redis|prisma|orm|airtable|snowflake|db)\b|数据库|数据表|存储/.test(text)) badge = LUCIDE_BADGES[16]; // Database
4135
- else if (/\b(server|host|backend|deploy|node|cluster)\b|服务器|后端|主机|集群/.test(text)) badge = LUCIDE_BADGES[17]; // Server
4136
- else if (/\b(container|docker|k8s|kubernetes|pod)\b|容器|镜像/.test(text)) badge = LUCIDE_BADGES[18]; // Container
4137
- else if (/\b(cpu|kernel|chip|processor|engine)\b|内核|处理器|核心|引擎/.test(text)) badge = LUCIDE_BADGES[14]; // Cpu
4138
- else if (/\b(bug|debug|trace|error|profiler|leak)\b|调试|修复|报错|异常/.test(text)) badge = LUCIDE_BADGES[11]; // Bug
4139
- else if (/\b(git|branch|pr|commit|repo)\b|仓库|分支|提交/.test(text)) badge = LUCIDE_BADGES[12]; // GitBranch
4140
- else if (/\b(json|ast|parse|syntax|braces|yaml|toml)\b|解析|语法|树/.test(text)) badge = LUCIDE_BADGES[15]; // Braces
4141
- else if (/\b(terminal|cli|shell|bash|cmd|console|command)\b|终端|控制台|命令行/.test(text)) badge = LUCIDE_BADGES[0]; // Terminal
4142
- else if (/\b(code|coding|dev|lsp|sdk|compiler|typescript|javascript|python|rust|golang|java|cpp|html|css)\b|代码|编程|开发|脚本/.test(text)) badge = LUCIDE_BADGES[1]; // Code
4143
-
4144
- // 10. AI / LLM / Agents / Speed / Discovery
4145
- else if (/\b(brain|neural|cognitive|deeplearning|mind)\b|大脑|神经|深度学习/.test(text)) badge = LUCIDE_BADGES[19]; // Brain
4146
- else if (/\b(bot|agent|assistant|robot|automaton)\b|智能体|机器人|助手|助理/.test(text)) badge = LUCIDE_BADGES[20]; // Bot
4147
- else if (/\b(sparkles|magic|generate|prompt|ai|llm|gpt|claude)\b|智能|生成|大模型|提示词/.test(text)) badge = LUCIDE_BADGES[21]; // Sparkles
4148
- else if (/\b(vision|ocr|face|cv|detect)\b|视觉|识图|检测/.test(text)) badge = LUCIDE_BADGES[22]; // ScanFace
4149
- else if (/\b(speed|fast|superpower|turbo|accelerat|boost|quick)\b|快|加速|极速|超能|快速/.test(text)) badge = LUCIDE_BADGES[58]; // Zap
4150
- else if (/\b(flame|hot|power|fire|blazing)\b|火|强大|威力/.test(text)) badge = LUCIDE_BADGES[57]; // Flame
4151
- else if (/\b(search|find|query|lookup|retriev|rag)\b|搜索|查找|检索|查询/.test(text)) badge = LUCIDE_BADGES[37]; // Search
4152
- else if (/\b(explore|discover|compass|navigate|map)\b|探索|发现|指南|导航/.test(text)) badge = LUCIDE_BADGES[36]; // Compass
4153
- else if (/\b(globe|web|internet|browser|crawl|scrape|http|net)\b|网页|网络|抓取|浏览器|互联网/.test(text)) badge = LUCIDE_BADGES[38]; // Globe
4154
- else if (/\b(lock|crypto|encrypt|token|privacy|vault)\b|加密|隐私|保险库/.test(text)) badge = LUCIDE_BADGES[43]; // Lock
4155
- else if (/\b(key|secret|passkey|oauth|access)\b|密钥|凭证|钥匙/.test(text)) badge = LUCIDE_BADGES[44]; // Key
4156
- else if (/\b(package|module|bundle|lib|box|plugin)\b|插件|包|模块|工具箱/.test(text)) badge = LUCIDE_BADGES[63]; // Package
4157
-
4158
- if (!badge) {
4159
- // 11. Deterministic FNV-1a Hash on clean name
4160
- let hash = 2166136261;
4161
- for (let i = 0; i < cleanName.length; i++) {
4162
- hash ^= cleanName.charCodeAt(i);
4163
- hash = Math.imul(hash, 16777619);
4164
- }
4165
- const idx = Math.abs(hash) % LUCIDE_BADGES.length;
4166
- badge = LUCIDE_BADGES[idx];
4167
- }
4168
-
4169
- BADGE_CACHE.set(cacheKey, badge);
3744
+ const name = String(plugin?.name || "").toLowerCase().replace(/[^a-z0-9\u3400-\u9fff]+/g, " ");
3745
+ const display = String(plugin?.displayName || "").toLowerCase().replace(/[^a-z0-9\u3400-\u9fff]+/g, " ");
3746
+ const description = String(plugin?.description || "").toLowerCase();
3747
+ const key = JSON.stringify([name, display, description]);
3748
+ if (BADGE_CACHE.has(key)) return BADGE_CACHE.get(key);
3749
+ // Names are the strongest signal; incidental words in long descriptions
3750
+ // must not turn a writing skill into an audio or transport icon.
3751
+ const rule = FALLBACK_RULES.find(([match]) => match.test(name + " " + display))
3752
+ || FALLBACK_RULES.find(([match]) => match.test(description));
3753
+ const icon = rule?.[1] || "puzzle-piece";
3754
+ const badge = { icon, src: FLUENT_3D_ICONS[icon] };
3755
+ if (BADGE_CACHE.size >= 1024) BADGE_CACHE.delete(BADGE_CACHE.keys().next().value);
3756
+ BADGE_CACHE.set(key, badge);
4170
3757
  return badge;
4171
3758
  }
4172
3759
 
@@ -4174,7 +3761,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
4174
3761
  const FAILED_ICON_URLS = new Map();
4175
3762
  function trackLoadedAvatar(url) {
4176
3763
  if (!url || url.startsWith("data:")) return;
4177
- if (LOADED_AVATARS.size > 300) LOADED_AVATARS.clear();
3764
+ if (LOADED_AVATARS.size >= 2048 && !LOADED_AVATARS.has(url)) LOADED_AVATARS.delete(LOADED_AVATARS.values().next().value);
4178
3765
  LOADED_AVATARS.add(url);
4179
3766
  }
4180
3767
 
@@ -4192,10 +3779,11 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
4192
3779
  const imgLoaded = avatarUrl && (avatarUrl.startsWith("data:") || LOADED_AVATARS.has(avatarUrl) || loaded === avatarUrl);
4193
3780
  return h("div", { className: "cpm-card-icon", style: { position: "relative", overflow: "hidden" } },
4194
3781
  h("div", { className: "cpm-icon-underlay", "aria-hidden": true, style: { position: "absolute", inset: 0, opacity: imgLoaded ? 0 : 1 } }, fallback),
4195
- avatarUrl && h("img", { key: avatarUrl, src: avatarUrl, alt: plugin?.displayName || plugin?.name || "", width: 38, height: 38, decoding: "async", loading: eager ? "eager" : "lazy",
3782
+ avatarUrl && h("img", { key: avatarUrl, src: avatarUrl, alt: plugin?.displayName || plugin?.name || "", width: 38, height: 38, decoding: LOADED_AVATARS.has(avatarUrl) ? "sync" : "async", loading: eager ? "eager" : "lazy",
4196
3783
  style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "contain", borderRadius: "inherit", opacity: imgLoaded ? 1 : 0 },
4197
3784
  onLoad: () => { trackLoadedAvatar(avatarUrl); setLoaded(avatarUrl); },
4198
3785
  onError: () => {
3786
+ LOADED_AVATARS.delete(avatarUrl);
4199
3787
  if (FAILED_ICON_URLS.size >= 512) FAILED_ICON_URLS.delete(FAILED_ICON_URLS.keys().next().value);
4200
3788
  FAILED_ICON_URLS.set(avatarUrl, Date.now() + 60_000);
4201
3789
  setLoaded("");
@@ -4240,27 +3828,17 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
4240
3828
  return h(AnthropicIcon, { isDark });
4241
3829
  }
4242
3830
 
4243
- // 4. Universal 64-Theme Vector Icon Badge
3831
+ // Use the upstream 3D PNG unchanged; declared logos retain priority.
4244
3832
  return h("div", {
4245
- className: "cpm-card-icon",
3833
+ className: "cpm-card-icon cpm-fallback-icon",
3834
+ "aria-hidden": true,
4246
3835
  style: {
4247
- color: badge.color,
4248
- background: isDark ? badge.bgDark : badge.bgLight,
4249
- borderColor: isDark ? badge.borderDark : badge.borderLight,
3836
+ background: isDark ? "#2b2b31" : "#fff",
3837
+ borderColor: isDark ? "rgba(255,255,255,.1)" : "rgba(34,37,58,.09)",
3838
+ boxShadow: isDark ? "inset 0 1px 0 rgba(255,255,255,.04)" : "inset 0 1px 0 #fff, 0 1px 2px rgba(27,31,49,.06)",
4250
3839
  },
4251
3840
  },
4252
- h("svg", {
4253
- width: 20,
4254
- height: 20,
4255
- viewBox: "0 0 24 24",
4256
- fill: "none",
4257
- stroke: badge.color,
4258
- strokeWidth: 2,
4259
- strokeLinecap: "round",
4260
- strokeLinejoin: "round",
4261
- },
4262
- badge.render(),
4263
- ),
3841
+ h("img", { src: badge.src, alt: "", width: 34, height: 34, loading: "lazy", decoding: "async", style: { objectFit: "contain" } }),
4264
3842
  );
4265
3843
  }
4266
3844
 
@@ -4274,6 +3852,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
4274
3852
  onClick,
4275
3853
  onManage,
4276
3854
  onInstall,
3855
+ action,
4277
3856
  }) {
4278
3857
  return h("div", {
4279
3858
  className: "cpm-card",
@@ -4282,13 +3861,14 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
4282
3861
  onClick,
4283
3862
  },
4284
3863
  h(PluginIcon, { plugin, isDark, eager: eagerIcon }),
4285
- h("div", { className: "cpm-card-body" },
3864
+ h(action ? "button" : "div", { className: "cpm-card-body" + (action ? " cpm-card-open" : ""), type: action ? "button" : undefined,
3865
+ onClick: action ? (e) => { e.stopPropagation(); onClick?.(e); } : undefined },
4286
3866
  h("div", { className: "cpm-card-name" },
4287
3867
  h("span", { className: "cpm-card-name-text" }, plugin.displayName || plugin.name),
4288
3868
  ),
4289
3869
  h("div", { className: "cpm-card-desc" }, plugin.description || (plugin.author ? `by ${plugin.author}` : "")),
4290
3870
  ),
4291
- installed
3871
+ action || (installed
4292
3872
  ? h("button", {
4293
3873
  className: "cpm-card-pill cpm-card-pill-installed",
4294
3874
  onClick: onManage,
@@ -4296,10 +3876,67 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
4296
3876
  : h("button", {
4297
3877
  className: "cpm-card-pill",
4298
3878
  onClick: onInstall,
4299
- }, "安装"),
3879
+ }, "安装")),
4300
3880
  );
4301
3881
  }
4302
3882
 
3883
+ function SkillSwitch({ skill, busy, onToggle }) {
3884
+ return h("input", { type: "checkbox", switch: "", className: "cpm-toggle" + (skill.enabled ? " on" : ""), role: "switch", checked: !!skill.enabled,
3885
+ "aria-label": `启用 ${skill.name}`, style: { appearance: "none", margin: 0 },
3886
+ disabled: busy || !skill.available || !!skill.error,
3887
+ onClick: e => e.stopPropagation(), onChange: e => onToggle(skill, e.currentTarget.checked) });
3888
+ }
3889
+
3890
+ function useDetailScrollMask(identity, containerRef, content) {
3891
+ const localRef = useRef(null);
3892
+ const detailRef = containerRef || localRef;
3893
+ const [maskClass, setMaskClass] = useState(" mask-bottom");
3894
+ const updateMask = useCallback(() => {
3895
+ const el = detailRef.current;
3896
+ if (!el) return;
3897
+ setMaskClass(el.scrollHeight - el.clientHeight > 4 && el.scrollTop < el.scrollHeight - el.clientHeight - 4 ? " mask-bottom" : "");
3898
+ }, [detailRef]);
3899
+ useLayoutEffect(() => {
3900
+ if (detailRef.current) detailRef.current.scrollTop = 0;
3901
+ updateMask();
3902
+ }, [identity, detailRef, updateMask]);
3903
+ useLayoutEffect(() => {
3904
+ updateMask();
3905
+ const el = detailRef.current;
3906
+ const observer = el && typeof ResizeObserver === "function" ? new ResizeObserver(updateMask) : null;
3907
+ if (observer) { observer.observe(el); Array.from(el.children).forEach(child => observer.observe(child)); }
3908
+ if (typeof window !== "undefined") window.addEventListener("resize", updateMask);
3909
+ return () => { observer?.disconnect(); if (typeof window !== "undefined") window.removeEventListener("resize", updateMask); };
3910
+ }, [content, detailRef, updateMask]);
3911
+ return { detailRef, maskClass, updateMask };
3912
+ }
3913
+
3914
+ function SkillDetail({ skill, onBack, onToggle, busy, isDark, containerRef }) {
3915
+ const [detail, setDetail] = useState(null);
3916
+ const [error, setError] = useState("");
3917
+ const { detailRef, maskClass, updateMask } = useDetailScrollMask(skill.id, containerRef, detail || error);
3918
+ useEffect(() => {
3919
+ let live = true;
3920
+ setDetail(null); setError("");
3921
+ api("/skills/detail?id=" + encodeURIComponent(skill.id)).then(body => { if (live) setDetail(body.skill); }).catch(e => { if (live) setError(e.message); });
3922
+ return () => { live = false; };
3923
+ }, [skill.id]);
3924
+ return h("div", { ref: detailRef, onScroll: updateMask, className: "cpm-detail cpm-skill-detail" + maskClass },
3925
+ h("button", { className: "cpm-back", onClick: onBack }, h(IconChevronLeft), "Back"),
3926
+ h("header", { className: "cpm-skill-header" },
3927
+ h("div", { className: "cpm-skill-identity" }, h(PluginIcon, { plugin: skill, isDark }),
3928
+ h("h1", { className: "cpm-skill-title" }, skill.displayName || skill.name),
3929
+ h(SkillSwitch, { skill, busy, onToggle })),
3930
+ skill.description && h("p", { className: "cpm-skill-summary" }, skill.description),
3931
+ (skill.activePath || skill.path) && h("div", { className: "cpm-skill-location" },
3932
+ h("span", { className: "cpm-skill-location-label" }, "本地文件"),
3933
+ h(NativePathLabel, { path: skill.activePath || skill.path }))),
3934
+ (skill.statusMessage || skill.error || error) && h("p", { className: "cpm-skill-warning", role: "alert" }, error || skill.statusMessage || skill.error),
3935
+ detail ? h("article", { className: "cpm-skill-content", "aria-label": skill.displayName || skill.name },
3936
+ h(NativeMarkdownText, { text: detail.content, labels: SKILL_MARKDOWN_LABELS }))
3937
+ : !error && h("p", { className: "cpm-skill-loading", role: "status" }, "正在加载…"));
3938
+ }
3939
+
4303
3940
  // ────────────────────────────── Modern Vector SVG Icons ──────────────────────────────
4304
3941
  const IconSearch = ({ size = 14, color = "var(--cpm-muted)" }) =>
4305
3942
  h("svg", {
@@ -4672,6 +4309,10 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
4672
4309
  }
4673
4310
 
4674
4311
  let currentScrollTopAnim = null;
4312
+ function stopScrollTopAnim() {
4313
+ if (currentScrollTopAnim) cancelAnimationFrame(currentScrollTopAnim);
4314
+ currentScrollTopAnim = null;
4315
+ }
4675
4316
  function smoothScrollToTop(container, duration = 280, onUpdate) {
4676
4317
  if (!container) return;
4677
4318
  if (currentScrollTopAnim) {
@@ -4777,12 +4418,6 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
4777
4418
  // empty first render after Back dropped it for a frame and Anthropic
4778
4419
  // took the leftmost slot, producing a visible tab-bar jump.
4779
4420
  mcps: null,
4780
- // Per-source "installed-first" sort snapshots. Kept on SESSION_STORE
4781
- // (module-level, not a component ref) so they survive the BrowseView
4782
- // unmount that happens when the manage page opens — returning from
4783
- // manage must keep both scroll position AND plugin ordering where they
4784
- // were, including a plugin installed right before opening manage.
4785
- installedSnapshots: {},
4786
4421
  };
4787
4422
 
4788
4423
  // ────────────────────────────── Root App ──────────────────────────────
@@ -4990,6 +4625,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
4990
4625
  let isMounted = true;
4991
4626
  (async () => {
4992
4627
  await Promise.allSettled(state.sources.map(async (s) => {
4628
+ if (s.virtual) return;
4993
4629
  try {
4994
4630
  const res = await api("/market?sourceId=" + encodeURIComponent(s.id));
4995
4631
  if (isMounted && Array.isArray(res?.plugins)) setRows((prev) => ({ ...(prev || {}), [s.id]: res.plugins }));
@@ -4997,7 +4633,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
4997
4633
  }));
4998
4634
  for (const s of state.sources) {
4999
4635
  if (!isMounted) break;
5000
- if (s.id === "local") continue;
4636
+ if (s.id === "local" || s.virtual) continue;
5001
4637
  try {
5002
4638
  const res = await api("/market/refresh", {
5003
4639
  method: "POST",
@@ -5025,10 +4661,6 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
5025
4661
  useEffect(() => {
5026
4662
  return () => {
5027
4663
  if (SESSION_STORE.scrollTops) SESSION_STORE.scrollTops = {};
5028
- // Panel close also resets sort snapshots, so a fresh open
5029
- // re-evaluates the "installed-first" default sort from the
5030
- // current plugin list.
5031
- if (SESSION_STORE.installedSnapshots) SESSION_STORE.installedSnapshots = {};
5032
4664
  // Closing the panel is a fresh start: reopen on the plugin list,
5033
4665
  // not on whichever MCP tab happened to be active.
5034
4666
  SESSION_STORE.mcpsOpen = false;
@@ -5386,7 +5018,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
5386
5018
  return blocks;
5387
5019
  }
5388
5020
 
5389
- function SmartMarkdown({ text, className }) {
5021
+ function SmartMarkdown({ text, className }) {
5390
5022
  if (!text) return null;
5391
5023
  const blocks = parseSmartBlocks(text);
5392
5024
 
@@ -5406,7 +5038,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
5406
5038
  return h("hr", { key: idx, className: "cpm-md-hr" });
5407
5039
  }
5408
5040
  if (b.type === "heading") {
5409
- return h("div", { key: idx, className: `cpm-md-heading cpm-md-h${b.level}` }, renderInlineMarkdownNodes(b.text));
5041
+ return h("div", { key: idx, className: `cpm-md-heading cpm-md-h${b.level}` }, renderInlineMarkdownNodes(b.text));
5410
5042
  }
5411
5043
  if (b.type === "list") {
5412
5044
  const Tag = b.ordered ? "ol" : "ul";
@@ -5712,6 +5344,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
5712
5344
  const [showSort, setShowSort] = useState(false);
5713
5345
  const [busy, setBusy] = useState(null);
5714
5346
  const [isRefreshing, setIsRefreshing] = useState(false);
5347
+ const [skillBusy, setSkillBusy] = useState(null);
5715
5348
  const [loadingSourceId, setLoadingSourceId] = useState(null);
5716
5349
  const [addDialog, setAddDialog] = useState(false);
5717
5350
  const [showAddMenu, setShowAddMenu] = useState(false);
@@ -5960,70 +5593,41 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
5960
5593
  const gridRef = useRef(null);
5961
5594
  const detailContainerRef = useRef(null);
5962
5595
  const tabsRef = useRef(null);
5596
+ // The width the two list columns actually occupy. `clientWidth` is the
5597
+ // grid's content box — padding and the reserved scrollbar gutter are
5598
+ // already excluded — but on a wide panel that box is wider than the
5599
+ // columns themselves, which stop at two 476px tracks plus their 48px
5600
+ // gap. Clamping to that 1000px is what keeps the search box from being
5601
+ // measured against empty space beside the columns.
5602
+ const [columnSpan, setColumnSpan] = useState(0);
5603
+ useSafeLayoutEffect(() => {
5604
+ const measure = () => {
5605
+ const grid = gridRef.current;
5606
+ if (!grid) return;
5607
+ const style = getComputedStyle(grid);
5608
+ const content = grid.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);
5609
+ const span = Math.round(Math.min(content, GRID_COLUMNS_MAX));
5610
+ if (!(span > 0)) return;
5611
+ setColumnSpan((current) => (current === span ? current : span));
5612
+ };
5613
+ measure();
5614
+ // The grid can mount after this effect (it is absent while the MCP
5615
+ // page or a detail page is open), and a source switch swaps its
5616
+ // content, so re-measure on the next frame as well as on resize.
5617
+ const frame = requestAnimationFrame(measure);
5618
+ window.addEventListener("resize", measure);
5619
+ return () => { cancelAnimationFrame(frame); window.removeEventListener("resize", measure); };
5620
+ }, [activeSourceId, mcpsOpen, filter, rows]);
5963
5621
  const tabRefs = useRef({});
5964
5622
  const [tabsMaskClass, setTabsMaskClass] = useState("");
5965
5623
  const [gridMaskClass, setGridMaskClass] = useState("");
5966
- // Per-source snapshot of installed plugin names used by the default
5967
- // "installed-first" sort. Lives on module-level SESSION_STORE, not a
5968
- // component ref or state: it must survive the BrowseView unmount that
5969
- // happens when the manage page opens, and it must NOT re-run against
5970
- // live `state.plugins` on every re-render (which is what kept a
5971
- // freshly installed plugin in its alphabetical slot after install).
5972
- // A source's snapshot is built on its first visit this session, then
5973
- // stays sticky across the session UNLESS the actual installed set
5974
- // for the source changes (install / uninstall) — the useEffect below
5975
- // detects that and refreshes. Explicit re-sort (clicking the current
5976
- // tab, picking a filter/sort menu item, or market refresh) still goes
5977
- // through `refreshInstalledSnapshot` to promote plugins installed
5978
- // since the last visit even before the next state refresh lands.
5979
- const installedSnapshots = SESSION_STORE.installedSnapshots || (SESSION_STORE.installedSnapshots = {});
5980
- const sortInstalledSnapshot = installedSnapshots[activeSourceId] || new Set();
5981
-
5982
- // Bumped whenever the user explicitly re-selects a filter/sort menu
5983
- // item (even when the value didn't change, e.g. picking "全部插件"
5984
- // while already in "all"). Forces the `visible` memo to recompute so
5985
- // the "installed-first" sort picks up plugins installed since the
5986
- // snapshot was last refreshed.
5987
- const [sortTick, setSortTick] = useState(0);
5988
-
5989
- // Explicitly rebuild the installed-snapshot for a source. Called when the
5990
- // user explicitly re-sorts: clicking the current source's own tab,
5991
- // picking a filter/sort menu item, or market refresh. This is the ONLY
5992
- // writer that promotes plugins installed since the last visit into the
5993
- // "installed-first" group (scroll-to-top and re-sort are bound — a
5994
- // programmatic scroll-to-top re-sorts; manual wheel scrolling does not).
5995
- const refreshInstalledSnapshot = useCallback((sourceId) => {
5996
- const sid = sourceId || activeSourceId;
5997
- if (!sid) return;
5998
- const snapshots = SESSION_STORE.installedSnapshots || (SESSION_STORE.installedSnapshots = {});
5999
- snapshots[sid] = new Set(
6000
- (state.plugins || []).filter((p) => p.sourceId === sid).map((p) => p.name)
6001
- );
6002
- }, [activeSourceId, state.plugins]);
6003
-
6004
- // Sync the installed-snapshot for the active source whenever the actual
6005
- // installed set for that source changes (install / uninstall). The
6006
- // `existing.size === current.size` + `every` check avoids touching the
6007
- // snapshot on renders that don't change the set, so the "installed-first"
6008
- // order stays stable for the user as they scroll/type/browse.
6009
- useEffect(() => {
6010
- if (!activeSourceId) return;
6011
- const snapshots = SESSION_STORE.installedSnapshots || (SESSION_STORE.installedSnapshots = {});
6012
- const current = new Set(
6013
- (state.plugins || []).filter((p) => p.sourceId === activeSourceId).map((p) => p.name)
6014
- );
6015
- const existing = snapshots[activeSourceId];
6016
- const sameMembers = existing && existing.size === current.size && [...existing].every((n) => current.has(n));
6017
- if (!sameMembers) snapshots[activeSourceId] = current;
6018
- }, [activeSourceId, state.plugins]);
6019
-
6020
5624
  // Detail View Data Fetching & LRU Cache
6021
5625
  const [detail, setDetail] = useState(null);
6022
5626
  const detailCacheRef = useRef({});
6023
5627
  const gridMaskRafRef = useRef(null);
6024
5628
 
6025
5629
  const prefetchDetail = useCallback((sourceId, pluginName) => {
6026
- if (!sourceId || !pluginName) return;
5630
+ if (!sourceId || !pluginName || sourceId === "skills-local") return;
6027
5631
  const cacheKey = `${sourceId}:${pluginName}`;
6028
5632
  if (!detailCacheRef.current[cacheKey]) {
6029
5633
  api("/plugins/" + encodeURIComponent(sourceId) + "/" + encodeURIComponent(pluginName))
@@ -6710,17 +6314,10 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
6710
6314
  }
6711
6315
  setActiveSourceId(s.id, targetFilter);
6712
6316
  } else {
6713
- // Clicking the current source's own tab: this is the
6714
- // "scroll back to top" gesture. The scroll resets to top,
6715
- // and in lockstep the default sort re-runs so a plugin
6716
- // installed since the last refresh is promoted into the
6717
- // "installed-first" group at the top. (Only programmatic
6718
- // scroll-to-top re-sorts; manual wheel-scrolling never does.)
6317
+ // Clicking the current source's tab scrolls its list back to the top.
6719
6318
  scrollActiveTabIntoView(s.id, true);
6720
6319
  if (!SESSION_STORE.scrollTops) SESSION_STORE.scrollTops = {};
6721
6320
  SESSION_STORE.scrollTops[s.id] = 0;
6722
- refreshInstalledSnapshot(s.id);
6723
- setSortTick((t) => t + 1);
6724
6321
  scrollContentToTop();
6725
6322
  }
6726
6323
  }
@@ -6892,6 +6489,14 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
6892
6489
  const target = pending.type === "restore"
6893
6490
  ? ((SESSION_STORE.scrollTops && SESSION_STORE.scrollTops[activeSourceId]) || 0)
6894
6491
  : 0;
6492
+ // A scroll-to-top still animating from the source we are leaving
6493
+ // writes this shared container's scrollTop on every frame. It used
6494
+ // to stop itself by detecting that its container had been detached
6495
+ // — but the container now survives a source switch, so it would
6496
+ // keep dragging the new source to the old one's top (and each
6497
+ // intermediate value lands in that source's stored scrollTop).
6498
+ // Cancel it before restoring this source's own position.
6499
+ stopScrollTopAnim();
6895
6500
  // Capture sourceId so the follow-up rAF can re-validate against
6896
6501
  // this source's store value instead of a stale closure.
6897
6502
  appliedScrollTopRef.current = { sourceId: activeSourceId, target };
@@ -6938,13 +6543,14 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
6938
6543
  }, [showFilter, showSort, showAddMenu]);
6939
6544
 
6940
6545
  const loadMarket = useCallback(async (sourceId, force = false) => {
6546
+ if (!sourceId) return;
6941
6547
  if (!force && rows && rows[sourceId]) {
6942
6548
  return;
6943
6549
  }
6944
6550
  setLoadingSourceId(sourceId);
6945
6551
  try {
6946
- const body = await api("/market?sourceId=" + encodeURIComponent(sourceId));
6947
- setRows((prev) => ({ ...(prev || {}), [sourceId]: body.plugins || [] }));
6552
+ const body = await api(sourceId === "skills-local" ? "/skills" : "/market?sourceId=" + encodeURIComponent(sourceId));
6553
+ setRows((prev) => ({ ...(prev || {}), [sourceId]: sourceId === "skills-local" ? (body.skills || []) : (body.plugins || []) }));
6948
6554
  } catch (e) {
6949
6555
  showToast("加载失败", e.message, { restart: false });
6950
6556
  setRows((prev) => ({ ...(prev || {}), [sourceId]: [] }));
@@ -6958,6 +6564,12 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
6958
6564
  loadMarket(activeSourceId);
6959
6565
  }
6960
6566
  }, [activeSourceId, loadMarket, rows]);
6567
+ useEffect(() => {
6568
+ if (activeSourceId !== "skills-local") return;
6569
+ let active = true;
6570
+ api("/skills").then(body => { if (active) setRows(prev => ({ ...(prev || {}), "skills-local": body.skills || [] })); }).catch(e => { if (active) showToast("加载 Skills 失败", e.message, { restart: false }); });
6571
+ return () => { active = false; };
6572
+ }, [activeSourceId, setRows, showToast]);
6961
6573
 
6962
6574
  const currentSourceInstalledNames = useMemo(() => new Set((state.plugins || []).filter((p) => p.sourceId === activeSourceId).map((p) => p.name)), [state.plugins, activeSourceId]);
6963
6575
  const installedNames = useMemo(() => new Set(state.plugins.map((p) => p.name)), [state.plugins]);
@@ -7112,32 +6724,34 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7112
6724
  } else if (sortBy === "name-desc") {
7113
6725
  list = [...list].sort((a, b) => (b.displayName || b.name).localeCompare(a.displayName || a.name));
7114
6726
  } else if (!query.trim()) {
7115
- // Default sort: Installed plugins (snapshot) first, then strictly alphabetical A-Z
6727
+ // Use the same installed set for sorting and card actions on the first render.
7116
6728
  list = [...list].sort((a, b) => {
7117
- const instA = sortInstalledSnapshot.has(a.name) ? 1 : 0;
7118
- const instB = sortInstalledSnapshot.has(b.name) ? 1 : 0;
6729
+ const instA = currentSourceInstalledNames.has(a.name) ? 1 : 0;
6730
+ const instB = currentSourceInstalledNames.has(b.name) ? 1 : 0;
7119
6731
  if (instB !== instA) return instB - instA;
7120
6732
  return (a.displayName || a.name).localeCompare(b.displayName || b.name);
7121
6733
  });
7122
6734
  }
7123
6735
 
7124
6736
  return list;
7125
- }, [currentSourcePlugins, query, sortBy, sortInstalledSnapshot, sortTick]);
6737
+ }, [currentSourcePlugins, query, sortBy, currentSourceInstalledNames]);
7126
6738
 
7127
6739
  const refresh = async () => {
7128
6740
  setIsRefreshing(true);
7129
6741
  if (detailCacheRef.current) detailCacheRef.current = {};
7130
6742
  try {
6743
+ if (activeSourceId === "skills-local") {
6744
+ const body = await api("/skills/refresh", { method: "POST" });
6745
+ setRows(prev => ({ ...(prev || {}), "skills-local": body.skills || [] }));
6746
+ await refreshState();
6747
+ showToast("已刷新", "Skills 列表已更新", { restart: false });
6748
+ return;
6749
+ }
7131
6750
  const body = await api("/market/refresh", {
7132
6751
  method: "POST",
7133
6752
  body: JSON.stringify({ sourceId: activeSourceId }),
7134
6753
  });
7135
6754
  setRows((prev) => ({ ...(prev || {}), [activeSourceId]: body.plugins || [] }));
7136
- // Market refresh is an explicit re-sort of the current source:
7137
- // rebuild the snapshot so freshly-installed plugins land in the
7138
- // "installed-first" group, and bump sortTick to recompute.
7139
- refreshInstalledSnapshot(activeSourceId);
7140
- setSortTick((t) => t + 1);
7141
6755
  showToast("已刷新", "市场清单已更新", { restart: false });
7142
6756
  } catch (e) {
7143
6757
  showToast("刷新失败", e.message, { restart: false });
@@ -7146,6 +6760,17 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7146
6760
  }
7147
6761
  };
7148
6762
 
6763
+ const toggleSkill = async (skill, enabled) => {
6764
+ if (skillBusy) return;
6765
+ setSkillBusy(skill.id);
6766
+ try {
6767
+ const body = await api("/skills/toggle", { method: "POST", body: JSON.stringify({ id: skill.id, enabled }) });
6768
+ setRows(prev => ({ ...(prev || {}), "skills-local": body.skills || [] }));
6769
+ showToast(enabled ? "Skill 已开启" : "Skill 已关闭", skill.name, { restart: false });
6770
+ } catch (e) { showToast("操作失败", e.message, { restart: false }); }
6771
+ finally { setSkillBusy(null); }
6772
+ };
6773
+
7149
6774
  const doInstall = async () => {
7150
6775
  try {
7151
6776
  const result = await api("/plugins/install", {
@@ -7174,7 +6799,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7174
6799
 
7175
6800
  return h("div", { className: "cpm-main" },
7176
6801
  // Top bar matching Claude official: Row 1 (Full width search) & Row 2 (Tabs on Left + Filter & Sort on Right)
7177
- h("div", { className: "cpm-topbar" },
6802
+ h("div", { className: "cpm-topbar", style: columnSpan ? { "--cpm-column-span": columnSpan + "px" } : undefined },
7178
6803
  h("div", { className: "cpm-topbar-row1" },
7179
6804
  h("div", { className: "cpm-search" },
7180
6805
  h(IconSearch),
@@ -7248,7 +6873,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7248
6873
  onClick: () => setMcpsOpen(false),
7249
6874
  },
7250
6875
  h("span", null, s.name),
7251
- !s.builtin && h("span", {
6876
+ !s.builtin && !s.virtual && h("span", {
7252
6877
  className: "cpm-tab-del-zone",
7253
6878
  onPointerDown: (e) => e.stopPropagation(),
7254
6879
  onClick: (e) => {
@@ -7277,7 +6902,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7277
6902
  ),
7278
6903
  h("div", { className: "cpm-topbar-right" },
7279
6904
  h("button", { className: "cpm-icon-btn" + (isRefreshing ? " is-refreshing" : ""), onClick: refresh, disabled: isRefreshing }, h(IconRefresh)),
7280
- h("div", { style: { position: "relative" } },
6905
+ activeSourceId !== "skills-local" && h("div", { style: { position: "relative" } },
7281
6906
  h("button", { className: "cpm-filter" + (showFilter ? " open" : ""), onClick: () => { setShowFilter(!showFilter); setShowSort(false); } },
7282
6907
  h("span", null, filter === "installed" ? "已安装" : (filter === "all" ? "全部插件" : "Filter by")),
7283
6908
  h("span", { className: "cpm-filter-chevron" }, h(IconArrow)),
@@ -7286,8 +6911,6 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7286
6911
  h("div", { className: "cpm-menu-item", onClick: () => {
7287
6912
  setFilter("all");
7288
6913
  setShowFilter(false);
7289
- refreshInstalledSnapshot(activeSourceId);
7290
- setSortTick((t) => t + 1);
7291
6914
  if (!SESSION_STORE.scrollTops) SESSION_STORE.scrollTops = {};
7292
6915
  SESSION_STORE.scrollTops[activeSourceId] = 0;
7293
6916
  scrollContentToTop();
@@ -7295,8 +6918,6 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7295
6918
  h("div", { className: "cpm-menu-item", onClick: () => {
7296
6919
  setFilter("installed");
7297
6920
  setShowFilter(false);
7298
- refreshInstalledSnapshot(activeSourceId);
7299
- setSortTick((t) => t + 1);
7300
6921
  if (!SESSION_STORE.scrollTops) SESSION_STORE.scrollTops = {};
7301
6922
  SESSION_STORE.scrollTops[activeSourceId] = 0;
7302
6923
  scrollContentToTop();
@@ -7312,8 +6933,6 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7312
6933
  h("div", { className: "cpm-menu-item", onClick: () => {
7313
6934
  setSortBy("default");
7314
6935
  setShowSort(false);
7315
- refreshInstalledSnapshot(activeSourceId);
7316
- setSortTick((t) => t + 1);
7317
6936
  if (!SESSION_STORE.scrollTops) SESSION_STORE.scrollTops = {};
7318
6937
  SESSION_STORE.scrollTops[activeSourceId] = 0;
7319
6938
  scrollContentToTop();
@@ -7321,8 +6940,6 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7321
6940
  h("div", { className: "cpm-menu-item", onClick: () => {
7322
6941
  setSortBy("name-asc");
7323
6942
  setShowSort(false);
7324
- refreshInstalledSnapshot(activeSourceId);
7325
- setSortTick((t) => t + 1);
7326
6943
  if (!SESSION_STORE.scrollTops) SESSION_STORE.scrollTops = {};
7327
6944
  SESSION_STORE.scrollTops[activeSourceId] = 0;
7328
6945
  scrollContentToTop();
@@ -7330,8 +6947,6 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7330
6947
  h("div", { className: "cpm-menu-item", onClick: () => {
7331
6948
  setSortBy("name-desc");
7332
6949
  setShowSort(false);
7333
- refreshInstalledSnapshot(activeSourceId);
7334
- setSortTick((t) => t + 1);
7335
6950
  if (!SESSION_STORE.scrollTops) SESSION_STORE.scrollTops = {};
7336
6951
  SESSION_STORE.scrollTops[activeSourceId] = 0;
7337
6952
  scrollContentToTop();
@@ -7357,6 +6972,11 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7357
6972
  ),
7358
6973
  ),
7359
6974
 
6975
+ view.type === "skill-detail" && (() => {
6976
+ const selected = ((rows && rows["skills-local"]) || []).find(s => s.id === view.skill.id) || view.skill;
6977
+ return h(SkillDetail, { skill: selected, isDark, containerRef: detailContainerRef, busy: skillBusy === selected.id, onToggle: toggleSkill, onBack: () => setView({ type: "browse", sourceId: "skills-local" }) });
6978
+ })(),
6979
+
7360
6980
  // Detail view — 0ms instant transition without intermediate loading screen
7361
6981
  view.type === "detail" && currentDetailPlugin && h(DetailView, {
7362
6982
  plugin: {
@@ -7381,7 +7001,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7381
7001
  }),
7382
7002
 
7383
7003
  // Browse View — Mode A: Grouped Installed across all sources (Selected active tab source displayed first)
7384
- isBrowse && filter === "installed" && !mcpsOpen && h("div", {
7004
+ isBrowse && activeSourceId !== "skills-local" && filter === "installed" && !mcpsOpen && h("div", {
7385
7005
  ref: gridRef,
7386
7006
  onWheel: onGridWheel,
7387
7007
  onScroll: onGridScroll,
@@ -7436,49 +7056,72 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7436
7056
  ),
7437
7057
 
7438
7058
  // Browse View — Mode B: Normal Source Browser Grid
7439
- isBrowse && filter !== "installed" && !mcpsOpen && h("div", {
7059
+ //
7060
+ // Skills share this very element instead of rendering a second grid.
7061
+ // Two sibling `.cpm-grid` blocks meant React unmounted the plugin
7062
+ // grid and mounted a fresh one on every switch to or from Skills:
7063
+ // a new scroll container and a full set of re-created cards, which
7064
+ // read as a flash. One element keeps the container, its scroll
7065
+ // position and the card nodes alive across sources — only the rows
7066
+ // change, exactly like switching between two plugin sources.
7067
+ isBrowse && (activeSourceId === "skills-local" || filter !== "installed") && !mcpsOpen && h("div", {
7440
7068
  ref: gridRef,
7441
7069
  onWheel: onGridWheel,
7442
7070
  onScroll: onGridScroll,
7443
7071
  className: "cpm-grid" + gridMaskClass,
7444
7072
  },
7445
- visible.length === 0 && h("div", { className: "cpm-empty", style: { gridColumn: "1 / -1", textAlign: "center", padding: "30px" } },
7446
- loadingSourceId === activeSourceId ? "正在加载插件…" : (query.trim() ? "没有找到匹配的插件" : "该插件源暂无插件")
7447
- ),
7448
- visible.map((p, index) => {
7449
- const installed = currentSourceInstalledNames.has(p.name);
7450
- return h(PluginCard, {
7451
- key: p.id,
7452
- plugin: p,
7453
- eagerIcon: index < 12,
7454
- installed,
7455
- isDark,
7456
- onMouseEnter: (e) => handleCardMouseEnter(p, e.currentTarget, { x: e.clientX, y: e.clientY, buttons: e.buttons }),
7457
- onMouseLeave: () => handleCardMouseLeave(p),
7458
- onClick: () => {
7459
- closePluginHover();
7460
- if (gridRef.current) {
7461
- if (!SESSION_STORE.scrollTops) SESSION_STORE.scrollTops = {};
7462
- SESSION_STORE.scrollTops[activeSourceId] = gridRef.current.scrollTop;
7463
- }
7464
- setView({ type: "detail", sourceId: activeSourceId, plugin: p });
7465
- },
7466
- onManage: (e) => {
7467
- e.stopPropagation();
7468
- closePluginHover();
7469
- if (gridRef.current) {
7470
- if (!SESSION_STORE.scrollTops) SESSION_STORE.scrollTops = {};
7471
- SESSION_STORE.scrollTops[activeSourceId] = gridRef.current.scrollTop;
7472
- }
7473
- openManage(state.plugins.find((r) => r.name === p.name && (r.sourceId === activeSourceId || r.sourceId === p.sourceId)) || state.plugins.find((r) => r.name === p.name), { type: "browse" });
7474
- },
7475
- onInstall: (e) => {
7476
- e.stopPropagation();
7477
- closePluginHover();
7478
- setInstallFor(p);
7479
- },
7480
- });
7481
- }),
7073
+ activeSourceId === "skills-local"
7074
+ ? [
7075
+ visible.length === 0 && h("div", { key: "empty", className: "cpm-empty", style: { gridColumn: "1 / -1", textAlign: "center", padding: 30 } },
7076
+ loadingSourceId === activeSourceId ? "正在加载 Skills…" : "没有找到匹配的 Skills"),
7077
+ // A skill's identity is its file path, a plugin's its name; the
7078
+ // `skill:` prefix keeps the two from ever colliding while they
7079
+ // share one grid.
7080
+ visible.map((skill, index) => h(PluginCard, { key: "skill:" + skill.id, plugin: skill, isDark, eagerIcon: index < 12,
7081
+ onMouseEnter: (e) => handleCardMouseEnter(skill, e.currentTarget, { x: e.clientX, y: e.clientY, buttons: e.buttons }),
7082
+ onMouseLeave: () => handleCardMouseLeave(skill),
7083
+ onClick: () => { closePluginHover(); setView({ type: "skill-detail", sourceId: "skills-local", skill }); },
7084
+ action: h(SkillSwitch, { skill, busy: skillBusy === skill.id, onToggle: toggleSkill }) })),
7085
+ ]
7086
+ : [
7087
+ visible.length === 0 && h("div", { key: "empty", className: "cpm-empty", style: { gridColumn: "1 / -1", textAlign: "center", padding: "30px" } },
7088
+ loadingSourceId === activeSourceId ? "正在加载插件…" : (query.trim() ? "没有找到匹配的插件" : "该插件源暂无插件")
7089
+ ),
7090
+ visible.map((p, index) => {
7091
+ const installed = currentSourceInstalledNames.has(p.name);
7092
+ return h(PluginCard, {
7093
+ key: "plugin:" + p.id,
7094
+ plugin: p,
7095
+ eagerIcon: index < 12,
7096
+ installed,
7097
+ isDark,
7098
+ onMouseEnter: (e) => handleCardMouseEnter(p, e.currentTarget, { x: e.clientX, y: e.clientY, buttons: e.buttons }),
7099
+ onMouseLeave: () => handleCardMouseLeave(p),
7100
+ onClick: () => {
7101
+ closePluginHover();
7102
+ if (gridRef.current) {
7103
+ if (!SESSION_STORE.scrollTops) SESSION_STORE.scrollTops = {};
7104
+ SESSION_STORE.scrollTops[activeSourceId] = gridRef.current.scrollTop;
7105
+ }
7106
+ setView({ type: "detail", sourceId: activeSourceId, plugin: p });
7107
+ },
7108
+ onManage: (e) => {
7109
+ e.stopPropagation();
7110
+ closePluginHover();
7111
+ if (gridRef.current) {
7112
+ if (!SESSION_STORE.scrollTops) SESSION_STORE.scrollTops = {};
7113
+ SESSION_STORE.scrollTops[activeSourceId] = gridRef.current.scrollTop;
7114
+ }
7115
+ openManage(state.plugins.find((r) => r.name === p.name && (r.sourceId === activeSourceId || r.sourceId === p.sourceId)) || state.plugins.find((r) => r.name === p.name), { type: "browse" });
7116
+ },
7117
+ onInstall: (e) => {
7118
+ e.stopPropagation();
7119
+ closePluginHover();
7120
+ setInstallFor(p);
7121
+ },
7122
+ });
7123
+ }),
7124
+ ],
7482
7125
  ),
7483
7126
 
7484
7127
  isBrowse && mcpsOpen && h("div", {
@@ -7586,7 +7229,6 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7586
7229
  showToast("插件源已删除", `已移除分类「${toRemove.name}」`, { restart: false });
7587
7230
  if (SESSION_STORE.sourceViews) delete SESSION_STORE.sourceViews[toRemove.id];
7588
7231
  if (SESSION_STORE.scrollTops) delete SESSION_STORE.scrollTops[toRemove.id];
7589
- if (SESSION_STORE.installedSnapshots) delete SESSION_STORE.installedSnapshots[toRemove.id];
7590
7232
  savedTabScrolls.delete(toRemove.id);
7591
7233
  if (activeSourceId === toRemove.id) {
7592
7234
  setActiveSourceId("anthropic");
@@ -7913,7 +7555,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7913
7555
  role: "dialog",
7914
7556
  "aria-modal": "true",
7915
7557
  "aria-labelledby": "cpm-dialog-title",
7916
- className: "cpm-dialog-box cpm-source-dialog-box" + (isDragging ? " is-dragging" : ""),
7558
+ className: "cpm-dialog-box cpm-source-dialog-box" + (phase === "upload" ? " cpm-upload-dialog" : "") + (isDragging ? " is-dragging" : ""),
7917
7559
  style: { position: "relative" },
7918
7560
  onClick: (e) => e.stopPropagation(),
7919
7561
  onDragOver: (e) => { e.preventDefault(); setIsDragging(true); },
@@ -7948,15 +7590,17 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
7948
7590
  ),
7949
7591
  phase === "upload" && [
7950
7592
  h("div", { className: "cpm-dialog-title", id: "cpm-dialog-title", key: "title" }, "上传插件 / Skills"),
7951
- h("div", {
7593
+ h("button", {
7952
7594
  className: "cpm-dropzone",
7595
+ type: "button",
7953
7596
  key: "dz",
7954
7597
  style: { cursor: "pointer" },
7955
7598
  onClick: () => uploadInputRef.current && uploadInputRef.current.click(),
7956
7599
  },
7957
- h("div", { className: "cpm-dropzone-icon" }, h(UploadDropIcon)),
7958
- h("div", { className: "cpm-dropzone-title" }, "拖入插件 / Skills,或点击上传"),
7959
- h("div", { className: "cpm-dropzone-sub" }, "支持 Claude / Codex 插件及市场、Skills;.zip / .tgz / .tar.gz / SKILL.md,上限 22MB"),
7600
+ h("span", { className: "cpm-dropzone-icon", "aria-hidden": "true" }, h(UploadDropIcon)),
7601
+ h("span", { className: "cpm-dropzone-title" }, "拖入插件 / Skills,或点击上传"),
7602
+ h("span", { className: "cpm-dropzone-sub" }, "支持 Claude / Codex 插件、插件市场和 Skills",
7603
+ h("br"), ".zip / .tgz / .tar.gz / SKILL.md · 上限 22MB"),
7960
7604
  ),
7961
7605
  h("input", {
7962
7606
  key: "file",
@@ -8222,14 +7866,19 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
8222
7866
  function AddMcpDialog({ onCancel, onSaved, showToast, initial, owner }) {
8223
7867
  const [form, setForm] = useState(() => initial ? {
8224
7868
  name: initial.name || "",
8225
- transport: initial.transport === "http" ? "http" : "stdio",
7869
+ transport: isRemoteTransport(initial.transport) ? "http" : "stdio",
8226
7870
  url: initial.url || "",
8227
7871
  oauth: initial.oauth || "none",
7872
+ oauthClientId: initial.oauthClientId || "",
7873
+ oauthClientSecret: "",
7874
+ oauthHasClientSecret: initial.oauthHasClientSecret === true,
7875
+ oauthCallbackPort: initial.oauthCallbackPort || "",
7876
+ oauthScope: initial.oauthScope || "",
8228
7877
  command: initial.command || "",
8229
7878
  args: Array.isArray(initial.args) ? JSON.stringify(initial.args) : (initial.args || ""),
8230
7879
  headersList: Object.entries(initial.headers || {}).map(([k, v], i) => ({ _id: `hi_${i}`, key: k, value: String(v), isSecret: true })),
8231
7880
  envList: Object.entries(initial.env || {}).map(([k, v], i) => ({ _id: `ei_${i}`, key: k, value: String(v), isSecret: true })),
8232
- } : { name: "", transport: "stdio", url: "", oauth: "none", command: "", args: "", headersList: [], envList: [] });
7881
+ } : { name: "", transport: "stdio", url: "", oauth: "none", oauthClientId: "", oauthClientSecret: "", oauthHasClientSecret: false, oauthCallbackPort: "", oauthScope: "", command: "", args: "", headersList: [], envList: [] });
8233
7882
  const [testing, setTesting] = useState(false);
8234
7883
  const [saving, setSaving] = useState(false);
8235
7884
  const upd = (patch) => setForm((prev) => ({ ...prev, ...patch }));
@@ -8275,65 +7924,79 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
8275
7924
  command: form.transport === "stdio" ? (form.command.trim() || null) : null,
8276
7925
  headers,
8277
7926
  oauth: form.transport === "http" ? form.oauth : "none",
7927
+ oauthClientId: form.oauthClientId,
7928
+ oauthClientSecret: form.oauthClientSecret,
7929
+ oauthCallbackPort: form.oauthCallbackPort,
7930
+ oauthScope: form.oauthScope,
8278
7931
  args,
8279
7932
  env,
8280
7933
  };
8281
7934
  };
8282
7935
 
8283
- const cleanMcpError = (err) => {
8284
- if (!err) return "操作失败";
8285
- let msg = String(err.message || err).replace(/^Error:\s*/i, "").trim();
8286
- return msg.length > 50 ? msg.slice(0, 48) + "…" : msg;
8287
- };
8288
-
7936
+ const cleanMcpError = (err) => cleanMcpErrorText(err);
7937
+ // The payload that was actually sent for verification. A finished OAuth
7938
+ // handshake must save exactly that configuration, not whatever the form
7939
+ // holds by the time the browser comes back.
7940
+ const verifiedPayloadRef = useRef(null);
7941
+ const oauthFlow = useOauthVerification({
7942
+ form,
7943
+ verifyPath: owner ? `/plugins/${encodeURIComponent(owner)}/connectors/${encodeURIComponent(form.name.trim())}/verify` : "/mcps/verify",
7944
+ userMcp: !owner,
7945
+ onFinished: async (res) => {
7946
+ showToast(res.ok ? "验证成功" : "验证失败", res.message || (res.ok ? "MCP 服务连接正常" : "请检查配置后重试"), { restart: false });
7947
+ // A finished sign-in is the whole point of the OAuth mode, so
7948
+ // register the connector now. Otherwise the dialog reopens on
7949
+ // `None` and the user has to save a second time.
7950
+ if (res.ok) await save(verifiedPayloadRef.current);
7951
+ },
7952
+ onError: (err) => showToast("验证失败", cleanMcpError(err), { restart: false }),
7953
+ });
8289
7954
  const test = async () => {
8290
7955
  if (!form.name.trim()) {
8291
7956
  showToast("请输入名称", "为这个 MCP 服务起一个名字,如 github、notion", { restart: false });
8292
7957
  return;
8293
7958
  }
7959
+ const payload = buildPayload();
7960
+ verifiedPayloadRef.current = payload;
8294
7961
  setTesting(true);
8295
7962
  try {
8296
- const verifyUrl = owner
8297
- ? `/plugins/${encodeURIComponent(owner)}/connectors/${encodeURIComponent(form.name.trim())}/verify`
8298
- : "/mcps/verify";
8299
- const res = await api(verifyUrl, { method: "POST", body: JSON.stringify(buildPayload()) });
8300
- showToast(res.ok ? "验证成功" : "验证失败", res.message || (res.ok ? "MCP 服务连接正常" : "请检查配置后重试"), { restart: false });
8301
- } catch (err) {
8302
- showToast("验证失败", cleanMcpError(err), { restart: false });
7963
+ await oauthFlow.start(payload);
8303
7964
  } finally {
8304
7965
  setTesting(false);
8305
7966
  }
8306
7967
  };
8307
7968
 
8308
- const save = async () => {
8309
- if (!form.name.trim()) {
7969
+ const save = async (payload, quiet = false) => {
7970
+ const data = payload || buildPayload();
7971
+ if (!data.name) {
8310
7972
  showToast("请输入名称", "为这个 MCP 服务起一个名字,如 github、notion", { restart: false });
8311
7973
  return;
8312
7974
  }
8313
- if (form.transport === "http" && !form.url.trim()) {
7975
+ if (data.transport === "http" && !String(data.url || "").trim()) {
8314
7976
  showToast("请输入服务 URL", "HTTP 连接需要有效的 MCP 服务地址,如 https://mcp.notion.com/mcp", { restart: false });
8315
7977
  return;
8316
7978
  }
8317
- if (form.transport === "stdio" && !form.command.trim()) {
7979
+ if (data.transport === "stdio" && !data.command) {
8318
7980
  showToast("请输入启动命令", "stdio 连接需要本地启动命令,如 npx、node 或 uvx", { restart: false });
8319
7981
  return;
8320
7982
  }
8321
7983
  setSaving(true);
8322
7984
  try {
8323
7985
  const saveUrl = owner
8324
- ? `/plugins/${encodeURIComponent(owner)}/connectors/${encodeURIComponent(form.name.trim())}/auth`
7986
+ ? `/plugins/${encodeURIComponent(owner)}/connectors/${encodeURIComponent(data.name)}/auth`
8325
7987
  : (initial ? "/mcps/update" : "/mcps");
8326
- const res = await api(saveUrl, { method: "POST", body: JSON.stringify(buildPayload()) });
7988
+ const res = await api(saveUrl, { method: "POST", body: JSON.stringify(data) });
8327
7989
  if (res && res.ok === false) {
8328
7990
  showToast("保存失败", res.error || "配置校验未通过,请检查填写内容", { restart: false });
8329
7991
  setSaving(false);
8330
7992
  return;
8331
7993
  }
8332
- showToast(initial ? "MCP 已更新" : "MCP 已添加", `「${form.name.trim()}」已${initial ? "更新" : "注册为可用 MCP 服务"}`, { restart: false });
7994
+ showToast(initial ? "MCP 已更新" : "MCP 已添加", `「${data.name}」已${initial ? "更新" : "注册为可用 MCP 服务"}`, { restart: false });
8333
7995
  await onSaved();
8334
7996
  } catch (err) {
8335
7997
  showToast("保存失败", cleanMcpError(err), { restart: false });
8336
7998
  setSaving(false);
7999
+ throw err;
8337
8000
  }
8338
8001
  };
8339
8002
 
@@ -8448,6 +8111,8 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
8448
8111
  }),
8449
8112
  ),
8450
8113
  ),
8114
+ h(OauthFields, { form, onChange: upd, idPrefix: "add-mcp" }),
8115
+ oauthFlow.pending && h(OauthPendingCard, { pending: oauthFlow.pending, onCancel: oauthFlow.cancel }),
8451
8116
  form.transport === "stdio" && h("div", { className: "cpm-mcp-row" },
8452
8117
  h("div", { className: "cpm-mcp-label" }, "Command"),
8453
8118
  h("div", { className: "cpm-mcp-control" },
@@ -8545,11 +8210,13 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
8545
8210
  className: "cpm-btn cpm-btn-secondary",
8546
8211
  disabled: testing || saving || (form.transport === "stdio" && !!argsError),
8547
8212
  onClick: test,
8548
- }, testing ? "测试中…" : "测试连接"),
8213
+ }, testing ? "测试中…" : (oauthFlow.pending ? "等待授权…" : (
8214
+ form.transport === "http" && form.oauth !== "none" ? "登录并连接" : "测试连接"
8215
+ ))),
8549
8216
  h("button", {
8550
8217
  className: "cpm-btn cpm-btn-primary",
8551
- disabled: testing || saving || (form.transport === "stdio" && !!argsError),
8552
- onClick: save,
8218
+ disabled: testing || saving || !!oauthFlow.pending || (form.transport === "stdio" && !!argsError),
8219
+ onClick: () => save(),
8553
8220
  }, saving ? "保存中…" : "保存并启用"),
8554
8221
  ),
8555
8222
  ),
@@ -8678,35 +8345,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
8678
8345
  const [busy, setBusy] = useState(false);
8679
8346
  const [confirmRemove, setConfirmRemove] = useState(false);
8680
8347
  const [toggling, setToggling] = useState(false);
8681
- const localDetailRef = useRef(null);
8682
- const detailRef = containerRef || localDetailRef;
8683
- const [detailMaskClass, setDetailMaskClass] = useState(" mask-bottom");
8684
-
8685
- const updateDetailMask = useCallback(() => {
8686
- const el = detailRef.current;
8687
- if (!el) return;
8688
- const { scrollTop, scrollHeight, clientHeight } = el;
8689
- const maxScroll = scrollHeight - clientHeight;
8690
- if (maxScroll <= 4) {
8691
- setDetailMaskClass("");
8692
- return;
8693
- }
8694
- const canScrollDown = scrollTop < maxScroll - 4;
8695
- setDetailMaskClass(canScrollDown ? " mask-bottom" : "");
8696
- }, []);
8697
-
8698
- useLayoutEffect(() => {
8699
- if (detailRef.current) {
8700
- detailRef.current.scrollTop = 0;
8701
- }
8702
- updateDetailMask();
8703
- }, [plugin?.name, updateDetailMask]);
8704
-
8705
- useEffect(() => {
8706
- const handleResize = () => updateDetailMask();
8707
- window.addEventListener("resize", handleResize);
8708
- return () => window.removeEventListener("resize", handleResize);
8709
- }, [updateDetailMask]);
8348
+ const { detailRef, maskClass: detailMaskClass, updateMask: updateDetailMask } = useDetailScrollMask(plugin?.name, containerRef, plugin);
8710
8349
 
8711
8350
  if (!plugin) return null;
8712
8351
 
@@ -9108,7 +8747,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
9108
8747
  const [hoveredTool, closeToolHover, toolHover] = useHoverPreview();
9109
8748
  useEffect(() => { closeToolHover(); }, [record?.name, closeToolHover]);
9110
8749
 
9111
- const loadConnectorTools = useCallback(async (connectorName) => {
8750
+ const loadConnectorTools = useCallback(async (connectorName, forceFresh = false) => {
9112
8751
  const key = `${record.name}::${connectorName}`;
9113
8752
  const cached = GLOBAL_MCP_TOOLS_CACHE[key];
9114
8753
  const hasCachedTools = Array.isArray(cached?.tools) && cached.tools.length > 0;
@@ -9122,7 +8761,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
9122
8761
  }
9123
8762
 
9124
8763
  try {
9125
- const res = await api(`/plugins/${encodeURIComponent(record.name)}/connectors/${encodeURIComponent(connectorName)}/tools`);
8764
+ const res = await api(`/plugins/${encodeURIComponent(record.name)}/connectors/${encodeURIComponent(connectorName)}/tools${forceFresh ? "?fresh=1" : ""}`);
9126
8765
  const tools = Array.isArray(res.tools) ? res.tools : [];
9127
8766
  const disabledTools = Array.isArray(res.disabledTools) ? res.disabledTools : [];
9128
8767
 
@@ -9154,7 +8793,103 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
9154
8793
  }
9155
8794
  }, [record?.name]);
9156
8795
 
9157
- // Pre-fetch tools in background as soon as ManagePage opens for connected connectors
8796
+ const buildAuthPayload = () => {
8797
+ const headers = {};
8798
+ for (const item of authDialog?.headersList || []) {
8799
+ const value = (item.value || "").trim();
8800
+ if (value) headers[(item.key || "").trim() || "Authorization"] = value;
8801
+ }
8802
+ return {
8803
+ transport: authDialog.transport, url: authDialog.url, headers,
8804
+ oauth: authDialog.oauth, oauthClientId: authDialog.oauthClientId,
8805
+ oauthClientSecret: authDialog.oauthClientSecret,
8806
+ oauthCallbackPort: authDialog.oauthCallbackPort, oauthScope: authDialog.oauthScope,
8807
+ };
8808
+ };
8809
+ // Persist the dialog's configuration. Signing in is only half of an OAuth
8810
+ // connector: the tokens live in the credential store, but the connector
8811
+ // itself is not registered until this writes the bridge entry. Without it
8812
+ // the dialog reopened on whatever was saved before — usually `None`.
8813
+ const persistAuthDialog = async (payload) => {
8814
+ const data = payload || buildAuthPayload();
8815
+ const headers = { ...(data.headers || {}) };
8816
+ let parsedArgs = [];
8817
+ if (data.transport === "stdio" && authDialog.args.trim()) {
8818
+ try {
8819
+ const parsed = JSON.parse(authDialog.args);
8820
+ parsedArgs = Array.isArray(parsed) ? parsed : [String(parsed)];
8821
+ } catch {
8822
+ parsedArgs = [];
8823
+ }
8824
+ }
8825
+ const envMap = {};
8826
+ if (data.transport === "stdio") {
8827
+ for (const eItem of authDialog.envList) {
8828
+ if (eItem.key.trim()) envMap[eItem.key.trim()] = eItem.value;
8829
+ }
8830
+ }
8831
+ return api(`/plugins/${encodeURIComponent(record.name)}/connectors/${encodeURIComponent(authDialog.connectorName)}/auth`, {
8832
+ method: "POST",
8833
+ body: JSON.stringify({
8834
+ transport: data.transport,
8835
+ url: data.url,
8836
+ headers,
8837
+ oauth: data.oauth,
8838
+ oauthClientId: data.oauthClientId,
8839
+ oauthClientSecret: data.oauthClientSecret,
8840
+ oauthCallbackPort: data.oauthCallbackPort,
8841
+ oauthScope: data.oauthScope,
8842
+ args: parsedArgs,
8843
+ env: envMap,
8844
+ }),
8845
+ });
8846
+ };
8847
+ const setAuthError = (message) => setAuthDialog((prev) => prev ? {
8848
+ ...prev, testing: false, status: "error", statusMessage: message,
8849
+ lastResult: { ok: false, message, status: 500, server: prev.connectorName, transport: prev.transport, endpoint: prev.url, errorDetails: message },
8850
+ } : null);
8851
+ const oauthFlow = useOauthVerification({
8852
+ form: authDialog,
8853
+ verifyPath: `/plugins/${encodeURIComponent(record.name)}/connectors/${encodeURIComponent(authDialog?.connectorName || "")}/verify`,
8854
+ onFinished: async (res) => {
8855
+ setAuthDialog((prev) => prev ? { ...prev, testing: false, status: res.ok ? "success" : "error", statusMessage: res.message || (res.ok ? "验证成功" : "验证失败"), lastResult: res } : null);
8856
+ // A successful sign-in is also the moment the connector becomes
8857
+ // usable, so register it right away. Leaving that to the Save
8858
+ // button is what made a completed sign-in reopen as `None`.
8859
+ // A failure here is a save problem and must not read as a failed
8860
+ // verification, so it stays out of the polling error path.
8861
+ if (res.ok) {
8862
+ try {
8863
+ const saved = await persistAuthDialog(verifiedPayloadRef.current);
8864
+ if (saved && saved.ok === false) {
8865
+ showToast("保存失败", saved.error || "配置校验未通过,请检查填写内容", { restart: false });
8866
+ }
8867
+ } catch (error) {
8868
+ showToast("保存失败", cleanMcpError(error), { restart: false });
8869
+ }
8870
+ }
8871
+ await refreshState();
8872
+ if (res.ok && res.server) await loadConnectorTools(res.server, true);
8873
+ },
8874
+ onCancel: () => setAuthDialog((prev) => prev ? { ...prev, testing: false, status: "untested", statusMessage: "" } : null),
8875
+ onError: (error) => setAuthError(error.message),
8876
+ });
8877
+ const closeAuthDialog = useCallback(() => {
8878
+ setAuthDialog(null);
8879
+ void oauthFlow.cancel();
8880
+ }, [oauthFlow.cancel]);
8881
+ // Which configuration the running verification was started with. The
8882
+ // dialog can be edited while the browser is open, so the auto-save after
8883
+ // a finished sign-in must persist the verified one, not the latest form.
8884
+ const verifiedPayloadRef = useRef(null);
8885
+ const runAuthTest = async () => {
8886
+ if (!authDialog) return;
8887
+ const payload = buildAuthPayload();
8888
+ verifiedPayloadRef.current = payload;
8889
+ setAuthDialog((prev) => prev ? { ...prev, testing: true, status: "testing", statusMessage: "" } : null);
8890
+ await oauthFlow.start(payload);
8891
+ };
8892
+
9158
8893
  useEffect(() => {
9159
8894
  if (record && Array.isArray(record.connectors)) {
9160
8895
  record.connectors.forEach((c) => {
@@ -9512,10 +9247,10 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
9512
9247
  isSecret: true,
9513
9248
  }));
9514
9249
 
9515
- const isHttpOnly = !!(connObj && (connObj.url || connObj.type === "http" || connObj.type === "sse") && !connObj.command);
9250
+ const isHttpOnly = !!(connObj && (connObj.url || isRemoteTransport(connObj.type)) && !connObj.command);
9516
9251
  const isStdioOnly = !!(connObj && (connObj.command || connObj.type === "stdio") && !connObj.url);
9517
9252
  const allowedTransports = isHttpOnly ? ["http"] : (isStdioOnly ? ["stdio"] : ["http", "stdio"]);
9518
- const initialTransport = isHttpOnly ? "http" : (isStdioOnly ? "stdio" : ((connObj && connObj.type === "stdio") ? "stdio" : "http"));
9253
+ const initialTransport = isHttpOnly ? "http" : (isStdioOnly ? "stdio" : (connObj && connObj.type === "stdio" ? "stdio" : "http"));
9519
9254
 
9520
9255
  let rawArgs = "";
9521
9256
  if (connObj && connObj.args) {
@@ -9536,6 +9271,11 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
9536
9271
  args: rawArgs,
9537
9272
  envList: envEntries,
9538
9273
  oauth: (connObj && connObj.oauth) || "none",
9274
+ oauthClientId: (connObj && connObj.oauthClientId) || "",
9275
+ oauthClientSecret: "",
9276
+ oauthHasClientSecret: (connObj && connObj.oauthHasClientSecret) === true,
9277
+ oauthCallbackPort: (connObj && connObj.oauthCallbackPort) || "",
9278
+ oauthScope: (connObj && connObj.oauthScope) || "",
9539
9279
  testing: false,
9540
9280
  saving: false,
9541
9281
  status: "untested",
@@ -9561,7 +9301,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
9561
9301
  if (!authDialog && !confirmRemove) return;
9562
9302
  const onKey = (e) => {
9563
9303
  if (e.key === "Escape") {
9564
- if (authDialog) setAuthDialog(null);
9304
+ if (authDialog) closeAuthDialog();
9565
9305
  if (confirmRemove) setConfirmRemove(false);
9566
9306
  }
9567
9307
  };
@@ -9880,9 +9620,11 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
9880
9620
  const needsAuth = typeof c === "object" ? (c.needsAuth === true) : false;
9881
9621
  const isAuthenticated = typeof c === "object" ? (c.authenticated === true) : true;
9882
9622
  const isConnected = typeof c === "object" ? (c.connected === true) : false;
9623
+ const isEnabled = typeof c === "object" ? (c.enabled === true) : isConnected;
9883
9624
  const transport = typeof c === "object" ? (c.type || (c.url ? "HTTP" : "stdio")) : "MCP";
9884
9625
  const endpoint = typeof c === "object" ? (c.url || (c.command ? `${c.command} ${(c.args || []).join(" ")}` : "")) : "";
9885
- const isPendingVerify = needsAuth && !isAuthenticated;
9626
+ const isRemote = transport !== "stdio";
9627
+ const isPendingVerify = isRemote ? !isConnected : (needsAuth && !isAuthenticated);
9886
9628
  const isExpanded = !!expandedConnectors[cName];
9887
9629
  const toolsInfo = connectorToolsData[cName];
9888
9630
  const toolsList = toolsInfo?.tools || [];
@@ -9958,13 +9700,14 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
9958
9700
  onClick: () => openAuthDialog(cName, c),
9959
9701
  }, h(IconSettings, { size: 14 })),
9960
9702
  h("button", {
9961
- className: "cpm-toggle" + (isConnected ? " on" : ""),
9703
+ className: "cpm-toggle" + (isEnabled ? " on" : ""),
9704
+ "aria-label": isEnabled ? "停用" : "启用",
9962
9705
  disabled: togglingConn === cName || busy,
9963
9706
  onClick: () => {
9964
- if (needsAuth && !isAuthenticated && !isConnected) {
9707
+ if (!isEnabled && ((isRemote && !isConnected) || (needsAuth && !isAuthenticated))) {
9965
9708
  openAuthDialog(cName, c);
9966
9709
  } else {
9967
- toggleConn(cName, isConnected);
9710
+ toggleConn(cName, isEnabled);
9968
9711
  }
9969
9712
  },
9970
9713
  }),
@@ -9988,11 +9731,11 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
9988
9731
  ),
9989
9732
  ),
9990
9733
 
9991
- authDialog && h("div", { className: "cpm-dialog", onClick: () => setAuthDialog(null) },
9734
+ authDialog && h("div", { className: "cpm-dialog", onClick: closeAuthDialog },
9992
9735
  h("div", { className: "cpm-mcp-modal", onClick: (e) => e.stopPropagation() },
9993
9736
  h("button", {
9994
9737
  className: "cpm-mcp-close-top",
9995
- onClick: () => setAuthDialog(null),
9738
+ onClick: closeAuthDialog,
9996
9739
  }, h(IconClose, { size: 14 })),
9997
9740
 
9998
9741
  h("div", { className: "cpm-mcp-body" },
@@ -10192,6 +9935,8 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
10192
9935
  }),
10193
9936
  ),
10194
9937
  ),
9938
+ h(OauthFields, { form: authDialog, onChange: setAuthDialog, idPrefix: "edit-mcp" }),
9939
+ oauthFlow.pending && h(OauthPendingCard, { pending: oauthFlow.pending, onCancel: oauthFlow.cancel }),
10195
9940
  ),
10196
9941
 
10197
9942
  h("div", { className: "cpm-mcp-footer" },
@@ -10293,54 +10038,11 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
10293
10038
  h("button", {
10294
10039
  className: "cpm-btn cpm-btn-secondary",
10295
10040
  disabled: authDialog.testing || authDialog.saving || (authDialog.transport === "stdio" && !!getArgsJsonError(authDialog.args)),
10296
- onClick: async () => {
10297
- const computedHeaders = {};
10298
- for (const hItem of authDialog.headersList) {
10299
- const v = (hItem.value || "").trim();
10300
- if (!v) continue;
10301
- const k = (hItem.key || "").trim() || "Authorization";
10302
- computedHeaders[k] = v;
10303
- }
10304
- setAuthDialog((prev) => prev ? { ...prev, testing: true, status: "testing", statusMessage: "" } : null);
10305
- try {
10306
- const res = await api(`/plugins/${record.name}/connectors/${authDialog.connectorName}/verify`, {
10307
- method: "POST",
10308
- body: JSON.stringify({
10309
- transport: authDialog.transport,
10310
- url: authDialog.url,
10311
- headers: computedHeaders,
10312
- oauth: authDialog.oauth,
10313
- }),
10314
- });
10315
- setAuthDialog((prev) => prev ? {
10316
- ...prev,
10317
- testing: false,
10318
- status: res.ok ? "success" : "error",
10319
- statusMessage: res.message || (res.ok ? "验证成功" : "验证失败"),
10320
- lastResult: res,
10321
- } : null);
10322
- } catch (err) {
10323
- setAuthDialog((prev) => prev ? {
10324
- ...prev,
10325
- testing: false,
10326
- status: "error",
10327
- statusMessage: err.message,
10328
- lastResult: {
10329
- ok: false,
10330
- message: err.message,
10331
- status: 500,
10332
- server: prev.connectorName,
10333
- transport: prev.transport,
10334
- endpoint: prev.url,
10335
- errorDetails: err.message,
10336
- },
10337
- } : null);
10338
- }
10339
- },
10340
- }, authDialog.testing ? "测试中…" : (
10041
+ onClick: runAuthTest,
10042
+ }, authDialog.testing ? (authDialog.oauth !== "none" ? "等待授权…" : "测试中…") : (
10341
10043
  authDialog.transport === "stdio" ? "测试连接" : (
10342
- (authDialog.oauth && authDialog.oauth !== "none") ? "Sign in & test" : (
10343
- (authDialog.headersList && authDialog.headersList.some(h => (h.value || '').trim())) ? "验证并测试" : "测试连接"
10044
+ (authDialog.oauth && authDialog.oauth !== "none") ? "登录并连接" : (
10045
+ (authDialog.headersList && authDialog.headersList.some(h => (h.value || '').trim())) ? "验证并连接" : "测试连接"
10344
10046
  )
10345
10047
  )
10346
10048
  )),
@@ -10349,41 +10051,9 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
10349
10051
  className: "cpm-btn cpm-btn-primary",
10350
10052
  disabled: authDialog.saving || authDialog.testing || (authDialog.transport === "stdio" && !!getArgsJsonError(authDialog.args)),
10351
10053
  onClick: async () => {
10352
- const computedHeaders = {};
10353
- for (const hItem of authDialog.headersList) {
10354
- const v = (hItem.value || "").trim();
10355
- if (!v) continue;
10356
- const k = (hItem.key || "").trim() || "Authorization";
10357
- computedHeaders[k] = v;
10358
- }
10359
10054
  setAuthDialog((prev) => prev ? { ...prev, saving: true } : null);
10360
10055
  try {
10361
- let parsedArgs = [];
10362
- if (authDialog.transport === "stdio" && authDialog.args.trim()) {
10363
- try {
10364
- const parsed = JSON.parse(authDialog.args);
10365
- parsedArgs = Array.isArray(parsed) ? parsed : [String(parsed)];
10366
- } catch {
10367
- parsedArgs = [];
10368
- }
10369
- }
10370
- const envMap = {};
10371
- if (authDialog.transport === "stdio") {
10372
- for (const eItem of authDialog.envList) {
10373
- if (eItem.key.trim()) envMap[eItem.key.trim()] = eItem.value;
10374
- }
10375
- }
10376
- const res = await api(`/plugins/${record.name}/connectors/${authDialog.connectorName}/auth`, {
10377
- method: "POST",
10378
- body: JSON.stringify({
10379
- transport: authDialog.transport,
10380
- url: authDialog.url,
10381
- headers: computedHeaders,
10382
- oauth: authDialog.oauth,
10383
- args: parsedArgs,
10384
- env: envMap,
10385
- }),
10386
- });
10056
+ const res = await persistAuthDialog();
10387
10057
  if (res && res.ok === false) {
10388
10058
  showToast("保存失败", res.error || "配置校验未通过,请检查填写内容", { restart: false });
10389
10059
  setAuthDialog((prev) => prev ? { ...prev, saving: false } : null);
@@ -10391,7 +10061,7 @@ window.__ModuleLoader__.load({ id: "universal-plugin-hub", factory: (require) =>
10391
10061
  }
10392
10062
  await refreshState();
10393
10063
  showToast("配置成功", `已成功保存 ${authDialog.connectorName} 认证信息并注册为可用 MCP 服务`, { restart: false });
10394
- setAuthDialog(null);
10064
+ closeAuthDialog();
10395
10065
  } catch (err) {
10396
10066
  showToast("保存失败", err.message);
10397
10067
  setAuthDialog((prev) => prev ? { ...prev, saving: false, status: "error", statusMessage: err.message } : null);