@alexpeng/dsh-custom-plugin 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +32 -3
- package/README.zh.md +32 -3
- package/lib/client.js +343 -6
- package/lib/client.js.map +1 -1
- package/lib/index.js +40 -1
- package/lib/types/client/mermaid-code.d.ts +19 -0
- package/lib/types/client/styles.d.ts +1 -1
- package/lib/types/host-service.d.ts +14 -1
- package/package.json +88 -84
package/lib/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
2
3
|
import { homedir } from "node:os";
|
|
3
4
|
import { dirname, isAbsolute, join } from "node:path";
|
|
4
5
|
import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
6
|
+
import { readFileSync } from "node:fs";
|
|
5
7
|
//#region src/dsh-home.ts
|
|
6
8
|
/**
|
|
7
9
|
* DSH_HOME resolution for the plugin's Host half: the environment override
|
|
@@ -541,6 +543,8 @@ var CustomPluginHost = class {
|
|
|
541
543
|
sessionModel = /* @__PURE__ */ new Map();
|
|
542
544
|
mermaidBytesValue = 0;
|
|
543
545
|
mermaidJs = "";
|
|
546
|
+
mermaidSource = "";
|
|
547
|
+
localMermaidPath;
|
|
544
548
|
constructor(options) {
|
|
545
549
|
this.sessionQuery = options.sessionQuery;
|
|
546
550
|
this.state = options.state;
|
|
@@ -548,6 +552,7 @@ var CustomPluginHost = class {
|
|
|
548
552
|
this.persistNow = options.saveNow;
|
|
549
553
|
this.diagReports = options.diagReports;
|
|
550
554
|
this.attachments = options.attachments;
|
|
555
|
+
this.localMermaidPath = options.localMermaidPath ?? defaultLocalMermaidPath;
|
|
551
556
|
}
|
|
552
557
|
/** Persist the state document (debounced by the loader entry). */
|
|
553
558
|
async persist() {
|
|
@@ -818,12 +823,27 @@ var CustomPluginHost = class {
|
|
|
818
823
|
scannedSessions: scanned
|
|
819
824
|
};
|
|
820
825
|
}
|
|
821
|
-
/**
|
|
826
|
+
/** Resolve the Mermaid engine: the bundled `mermaid` dependency on disk
|
|
827
|
+
* first (no runtime network), CDN mirrors only as a fallback (cached for
|
|
828
|
+
* the host lifetime). */
|
|
822
829
|
async mermaidFetch() {
|
|
823
830
|
if (this.mermaidBytesValue > 0) return {
|
|
824
831
|
ok: true,
|
|
825
832
|
bytes: this.mermaidBytesValue
|
|
826
833
|
};
|
|
834
|
+
const localPath = this.localMermaidPath();
|
|
835
|
+
if (localPath !== null && localPath !== "") try {
|
|
836
|
+
const text = readFileSync(localPath, "utf8");
|
|
837
|
+
if (text.length > 0) {
|
|
838
|
+
this.mermaidJs = text;
|
|
839
|
+
this.mermaidBytesValue = text.length;
|
|
840
|
+
this.mermaidSource = "local";
|
|
841
|
+
return {
|
|
842
|
+
ok: true,
|
|
843
|
+
bytes: text.length
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
} catch {}
|
|
827
847
|
const urls = [
|
|
828
848
|
"https://cdn.jsdelivr.net/npm/mermaid@11.6.0/dist/mermaid.min.js",
|
|
829
849
|
"https://fastly.jsdelivr.net/npm/mermaid@11.6.0/dist/mermaid.min.js",
|
|
@@ -847,6 +867,7 @@ var CustomPluginHost = class {
|
|
|
847
867
|
};
|
|
848
868
|
this.mermaidJs = text;
|
|
849
869
|
this.mermaidBytesValue = text.length;
|
|
870
|
+
this.mermaidSource = "cdn";
|
|
850
871
|
return {
|
|
851
872
|
ok: true,
|
|
852
873
|
bytes: text.length
|
|
@@ -860,6 +881,10 @@ var CustomPluginHost = class {
|
|
|
860
881
|
mermaidBytes() {
|
|
861
882
|
return this.mermaidBytesValue;
|
|
862
883
|
}
|
|
884
|
+
/** Where the engine came from: 'local', 'cdn', or '' while unloaded. */
|
|
885
|
+
mermaidLoadedSource() {
|
|
886
|
+
return this.mermaidSource;
|
|
887
|
+
}
|
|
863
888
|
/** Whether any DeepSeek key source resolves (state, environment, credential
|
|
864
889
|
* file) — the honest answer behind the panel's "key configured" badge. */
|
|
865
890
|
async hasApiKey() {
|
|
@@ -872,6 +897,7 @@ var CustomPluginHost = class {
|
|
|
872
897
|
today: dayKey(),
|
|
873
898
|
usageToday: this.state.usage[dayKey()] ?? {},
|
|
874
899
|
mermaidBytes: this.mermaidBytesValue,
|
|
900
|
+
mermaidSource: this.mermaidSource,
|
|
875
901
|
apiKeySet: await this.hasApiKey(),
|
|
876
902
|
diagReports: [...this.diagReports]
|
|
877
903
|
};
|
|
@@ -939,6 +965,16 @@ var CustomPluginHost = class {
|
|
|
939
965
|
}
|
|
940
966
|
}
|
|
941
967
|
};
|
|
968
|
+
/** Resolve `mermaid/dist/mermaid.min.js` from the package's own dependency
|
|
969
|
+
* tree (works for `link:` checkouts and registry installs alike); null when
|
|
970
|
+
* the dependency is absent, which falls mermaidFetch back to the CDN. */
|
|
971
|
+
function defaultLocalMermaidPath() {
|
|
972
|
+
try {
|
|
973
|
+
return createRequire(import.meta.url).resolve("mermaid/dist/mermaid.min.js");
|
|
974
|
+
} catch {
|
|
975
|
+
return null;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
942
978
|
//#endregion
|
|
943
979
|
//#region src/loopback.ts
|
|
944
980
|
/** IPv4 127/8 predicate (four decimal octets, first == 127). */
|
|
@@ -1251,6 +1287,9 @@ function applyImpl(ctx) {
|
|
|
1251
1287
|
});
|
|
1252
1288
|
const routeDisposers = [];
|
|
1253
1289
|
for (const route of makeCustomPluginRoutes(host)) routeDisposers.push(ctx.webServer.register(route));
|
|
1290
|
+
host.mermaidFetch().then((result) => {
|
|
1291
|
+
reportDiag(result.ok ? `mermaid engine ready (${result.bytes} bytes, ${host.mermaidLoadedSource()})` : `mermaid engine failed: ${result.error}`);
|
|
1292
|
+
});
|
|
1254
1293
|
const disposeTool = ctx.tools.register(defineTool({
|
|
1255
1294
|
name: "custom_plugin_status",
|
|
1256
1295
|
description: "查看 Custom 便利套件(dsh-custom-plugin)运行状态:外观配置、今日 token 用量(按模型)、DeepSeek 余额(如已配置 API Key)、当前会话时间线样本、Mermaid 引擎加载情况、客户端注入诊断。",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure Mermaid code-block detection helpers for the in-place renderer.
|
|
3
|
+
*
|
|
4
|
+
* The GUI renders a settled ```mermaid fence with its language in the code
|
|
5
|
+
* banner, but while the assistant is still streaming the banner is blank and
|
|
6
|
+
* the fence content grows chunk by chunk — detection then has to fall back to
|
|
7
|
+
* content heuristics (keyword prefix + completeness), the same approach the
|
|
8
|
+
* Gemini Voyager extension uses. Everything here is string-in/string-out so
|
|
9
|
+
* the heuristics stay unit-testable without a DOM.
|
|
10
|
+
* @module @alexpeng/dsh-custom-plugin/client/mermaid-code
|
|
11
|
+
*/
|
|
12
|
+
/** A banner label that names a real programming language must not be
|
|
13
|
+
* content-detected (a Python `%%` comment is not a mermaid directive). */
|
|
14
|
+
export declare function isGenericInfostring(label: string | null | undefined): boolean;
|
|
15
|
+
/** Whitespace normalization: web/CJK paste artifacts break the parser. */
|
|
16
|
+
export declare function normalizeMermaidText(code: string): string;
|
|
17
|
+
/** Does this text look like complete mermaid source? Conservative: during
|
|
18
|
+
* streaming we would rather skip a beat than flash a syntax error. */
|
|
19
|
+
export declare function isMermaidCode(code: string): boolean;
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* vx- and must not be scoped by CSS Modules.
|
|
5
5
|
* @module @alexpeng/dsh-custom-plugin/client/styles
|
|
6
6
|
*/
|
|
7
|
-
export declare const STATIC_CSS = "/* dsh-custom-plugin static styles. Every rule is global by design: the UI\n * mounts into product slots and overlays, so class names are prefixed vx-\n * and must not be scoped by CSS Modules. Dynamic rules (body background,\n * aurora gradient, global-glass blur) are managed at runtime by a style\n * element in custom.tsx and do not live here. */\n.vx-root {\n position: fixed;\n inset: 0;\n pointer-events: none;\n z-index: 2147483000;\n font-family: ui-sans-serif, system-ui, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;\n }\n .vx-fx {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n .vx-anchor {\n display: inline-block;\n width: 0;\n height: 1px;\n vertical-align: bottom;\n }\n .vx-turn-actions {\n display: inline-flex;\n gap: 4px;\n margin-left: 10px;\n vertical-align: middle;\n align-items: center;\n }\n .vx-chip {\n pointer-events: auto;\n border: 1px solid rgba(128, 140, 160, .4);\n background: rgba(255, 255, 255, .16);\n color: inherit;\n border-radius: 8px;\n padding: 2px 8px;\n font-size: 11px;\n cursor: pointer;\n backdrop-filter: blur(6px);\n text-decoration: none;\n display: inline-flex;\n align-items: center;\n gap: 3px;\n }\n .vx-chip:hover {\n background: rgba(255, 255, 255, .28);\n }\n .vx-link {\n text-decoration: none;\n }\n .vx-glass {\n border-radius: 16px;\n background: rgba(255, 255, 255, .64);\n -webkit-backdrop-filter: blur(9px) saturate(1.22);\n backdrop-filter: blur(9px) saturate(1.22);\n box-shadow: 0 0 1px 1px rgba(17, 17, 26, .07) inset, 0 1px 2px rgba(17, 17, 26, .05) inset, 0px 4px 16px rgba(17, 17, 26, .05), 0px 8px 24px rgba(17, 17, 26, .05), 0px 16px 56px rgba(17, 17, 26, .05);\n }\n @media (prefers-color-scheme: dark) {\n .vx-glass {\n background: rgba(13, 17, 25, .62);\n color: #eef1f7;\n }\n }\n .vx-liquid .vx-glass {\n background: rgba(255, 255, 255, .06);\n backdrop-filter: url(#vx-lg);\n -webkit-backdrop-filter: url(#vx-lg);\n }\n @media (prefers-color-scheme: dark) {\n .vx-liquid .vx-glass {\n background: rgba(0, 0, 0, .06);\n }\n }\n @supports not (backdrop-filter: url(#vx-lg)) {\n .vx-liquid .vx-glass {\n background: rgba(255, 255, 255, .64);\n backdrop-filter: blur(9px) saturate(1.22);\n -webkit-backdrop-filter: blur(9px) saturate(1.22);\n }\n @media (prefers-color-scheme: dark) {\n .vx-liquid .vx-glass {\n background: rgba(13, 17, 25, .62);\n }\n }\n }\n .vx-liquid .vx-pattern {\n background-image: radial-gradient(rgba(150, 150, 160, .5) 3px, transparent 3px);\n background-size: 24px 24px;\n -webkit-mask-image: radial-gradient(ellipse at top, transparent 20%, black);\n mask-image: radial-gradient(ellipse at top, transparent 20%, black);\n animation: vx-pattern-move 25000ms linear infinite;\n }\n @media (prefers-color-scheme: dark) {\n .vx-liquid .vx-pattern {\n background-image: radial-gradient(rgba(110, 110, 128, .5) 3px, transparent 3px);\n }\n }\n .vx-pattern {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: -1;\n background-image: radial-gradient(rgba(150, 150, 160, .42) 1px, transparent 1px);\n background-size: 24px 24px;\n -webkit-mask-image: radial-gradient(ellipse at center, transparent 30%, black 100%);\n mask-image: radial-gradient(ellipse at center, transparent 30%, black 100%);\n animation: vx-pattern-move 10000ms linear infinite;\n }\n @media (prefers-color-scheme: dark) {\n .vx-pattern {\n background-image: radial-gradient(rgba(100, 100, 116, .5) 1px, transparent 1px);\n }\n }\n @keyframes vx-pattern-move {\n from {\n background-position: 0 0;\n }\n to {\n background-position: 0 24px;\n }\n }\n @keyframes vx-aurora {\n 0% {\n background-position: 0% 50%;\n }\n 50% {\n background-position: 100% 50%;\n }\n 100% {\n background-position: 0% 50%;\n }\n }\n .vx-rail {\n position: absolute;\n width: 12px;\n border-radius: 8px;\n background: rgba(120, 130, 150, .18);\n border: 1px solid rgba(120, 130, 150, .25);\n pointer-events: auto;\n touch-action: none;\n box-sizing: border-box;\n }\n .vx-rail.right {\n right: 4px;\n }\n .vx-rail.left {\n left: 56px;\n }\n /* When the rail is active it substitutes the native scrollbar: the scrollport\n carrying the vx-rail-scroller class (added by the client when it resolves\n the chat scrollport) hides its own bar so only one scroll affordance\n remains. scrollbar-gutter: stable on the shell keeps the layout width. */\n .vx-rail-scroller {\n scrollbar-width: none;\n }\n .vx-rail-scroller::-webkit-scrollbar {\n display: none;\n }\n .vx-thumb {\n position: absolute;\n left: 1px;\n right: 1px;\n border-radius: 8px;\n background: rgba(90, 105, 135, .5);\n border: 1px solid rgba(255, 255, 255, .35);\n box-sizing: border-box;\n }\n .vx-thumb:hover {\n background: rgba(90, 105, 135, .7);\n }\n .vx-dot {\n position: absolute;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background: rgba(70, 85, 110, .92);\n border: 2px solid rgba(255, 255, 255, .92);\n box-shadow: 0 1px 3px rgba(0, 0, 0, .35);\n pointer-events: auto;\n cursor: pointer;\n transition: transform .12s;\n padding: 0;\n }\n .vx-dot:hover {\n transform: translate(-50%, -50%) scale(1.35);\n }\n .vx-dot.star {\n background: #c9a24b;\n border-color: #f3e3bd;\n }\n @media (prefers-color-scheme: dark) {\n .vx-dot {\n background: rgba(205, 215, 230, .95);\n border-color: rgba(28, 34, 46, .9);\n }\n .vx-thumb {\n background: rgba(165, 180, 205, .45);\n }\n }\n .vx-rail-pop {\n position: absolute;\n pointer-events: auto;\n padding: 10px 12px;\n width: 300px;\n font-size: 12px;\n line-height: 1.55;\n z-index: 5;\n }\n /* Class = which side the rail sits on; the card must open toward the page\n content. It is a child of the 12px-wide rail, so right:20px puts it left\n of the rail and left:20px puts it right (20px = rail width + 8px gap). */\n .vx-rail-pop.right {\n right: 20px;\n }\n .vx-rail-pop.left {\n left: 20px;\n }\n .vx-pop-time {\n color: #6d7689;\n font-size: 11px;\n margin-bottom: 4px;\n }\n .vx-pop-text {\n white-space: pre-wrap;\n word-break: break-word;\n max-height: 150px;\n overflow: hidden;\n margin-bottom: 8px;\n }\n .vx-pop-row {\n display: flex;\n gap: 5px;\n flex-wrap: wrap;\n align-items: center;\n }\n .vx-balance-wrap {\n display: inline-flex;\n align-items: center;\n position: relative;\n }\n .vx-balance-text {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 3px 10px;\n border-radius: 8px;\n font-size: 12.5px;\n color: inherit;\n background: rgba(127, 164, 224, .16);\n border: 1px solid rgba(127, 164, 224, .4);\n cursor: default;\n white-space: nowrap;\n }\n .vx-balance-text:hover {\n background: rgba(127, 164, 224, .28);\n }\n .vx-balance-text.vx-balance-pinned {\n background: rgba(127, 164, 224, .36);\n border-color: rgba(127, 164, 224, .8);\n }\n .vx-balance-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n margin-bottom: 8px;\n }\n .vx-balance-today {\n opacity: .75;\n font-size: 11.5px;\n }\n .vx-balance-hover {\n position: absolute;\n top: calc(100% + 8px);\n right: 0;\n z-index: 70;\n width: 360px;\n max-height: 480px;\n overflow: auto;\n padding: 12px;\n color: #20242e;\n font-size: 12px;\n pointer-events: auto;\n }\n @media (prefers-color-scheme: dark) {\n .vx-balance-hover {\n color: #e8ebf2;\n }\n }\n .vx-balance-lines {\n font-size: 13px;\n margin: 6px 0;\n }\n .vx-header-btn {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 4px 10px;\n border-radius: 8px;\n font-size: 12.5px;\n color: inherit;\n background: rgba(127, 164, 224, .16);\n border: 1px solid rgba(127, 164, 224, .4);\n cursor: pointer;\n white-space: nowrap;\n }\n .vx-header-btn:hover {\n background: rgba(127, 164, 224, .3);\n }\n .vx-quote-btn {\n position: absolute;\n transform: translate(-50%, -100%);\n pointer-events: auto;\n background: rgba(40, 48, 64, .96);\n color: #eef1f7;\n border: 1px solid rgba(255, 255, 255, .25);\n padding: 5px 12px;\n border-radius: 9px;\n font-size: 12px;\n cursor: pointer;\n box-shadow: 0 6px 18px rgba(0, 0, 0, .28);\n display: inline-flex;\n align-items: center;\n gap: 5px;\n }\n .vx-panel {\n position: absolute;\n width: 430px;\n max-width: calc(100vw - 40px);\n height: min(660px, calc(100vh - 110px));\n display: flex;\n flex-direction: column;\n overflow: hidden;\n pointer-events: auto;\n color: #20242e;\n }\n @media (prefers-color-scheme: dark) {\n .vx-panel, .vx-modal, .vx-folders {\n color: #e8ebf2;\n }\n }\n .vx-panel-head {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 14px;\n cursor: move;\n user-select: none;\n border-bottom: 1px solid rgba(150, 160, 180, .25);\n position: relative;\n z-index: 1;\n }\n .vx-panel-title {\n font-weight: 600;\n font-size: 13px;\n }\n .vx-panel-sub {\n font-size: 11px;\n opacity: .62;\n white-space: nowrap;\n }\n .vx-tabs {\n display: flex;\n flex-wrap: wrap;\n gap: 2px;\n padding: 8px 10px 4px;\n border-bottom: 1px solid rgba(150, 160, 180, .2);\n position: relative;\n z-index: 1;\n }\n .vx-tab {\n border: none;\n background: transparent;\n color: inherit;\n opacity: .75;\n font-size: 12px;\n padding: 5px 9px;\n border-radius: 8px;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n }\n .vx-tab.on {\n opacity: 1;\n background: rgba(255, 255, 255, .28);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);\n }\n .vx-panel-body {\n flex: 1;\n overflow: auto;\n padding: 12px 14px;\n position: relative;\n z-index: 1;\n }\n .vx-col {\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n .vx-row {\n display: flex;\n gap: 8px;\n align-items: center;\n }\n .vx-row.wrap {\n flex-wrap: wrap;\n }\n .vx-flex1 {\n flex: 1;\n }\n .vx-section-title {\n font-weight: 600;\n font-size: 12.5px;\n margin-top: 4px;\n opacity: .9;\n }\n .vx-swatches {\n display: grid;\n grid-template-columns: repeat(5, 1fr);\n gap: 6px;\n }\n .vx-swatch {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 3px;\n border: none;\n background: transparent;\n color: inherit;\n cursor: pointer;\n padding: 0;\n }\n .vx-swatch-box {\n width: 34px;\n height: 26px;\n border-radius: 8px;\n border: 2px solid rgba(120, 130, 150, .4);\n box-sizing: border-box;\n }\n .vx-swatch.on .vx-swatch-box {\n border-color: #7fa4e0;\n box-shadow: 0 0 0 2px rgba(127, 164, 224, .35);\n }\n .vx-swatch:disabled {\n opacity: .35;\n cursor: not-allowed;\n }\n .vx-swatch-label {\n font-size: 10px;\n opacity: .85;\n }\n .vx-btn {\n pointer-events: auto;\n border: 1px solid rgba(128, 140, 160, .4);\n background: rgba(255, 255, 255, .16);\n color: inherit;\n border-radius: 9px;\n padding: 6px 12px;\n font-size: 12px;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 5px;\n }\n .vx-btn:hover {\n background: rgba(255, 255, 255, .28);\n }\n .vx-btn.on {\n background: rgba(127, 164, 224, .35);\n border-color: rgba(127, 164, 224, .8);\n }\n .vx-btn:disabled {\n opacity: .5;\n cursor: default;\n }\n .vx-btn-sm {\n padding: 2px 8px;\n font-size: 11px;\n }\n .vx-btn-danger {\n background: rgba(214, 88, 88, .22);\n border-color: rgba(214, 88, 88, .55);\n }\n .vx-btn.big {\n padding: 10px 16px;\n font-size: 13px;\n }\n .vx-input {\n flex: 1;\n min-width: 0;\n border: 1px solid rgba(128, 140, 160, .4);\n background: rgba(255, 255, 255, .16);\n color: inherit;\n border-radius: 9px;\n padding: 6px 10px;\n font-size: 12px;\n }\n .vx-textarea {\n border: 1px solid rgba(128, 140, 160, .4);\n background: rgba(255, 255, 255, .16);\n color: inherit;\n border-radius: 9px;\n padding: 6px 10px;\n font-size: 12px;\n resize: vertical;\n font-family: inherit;\n }\n .vx-toggle-row {\n display: flex;\n gap: 8px;\n align-items: center;\n font-size: 12.5px;\n }\n .vx-muted {\n color: rgba(120, 128, 148, .95);\n font-size: 11.5px;\n }\n .vx-error {\n color: #d85858;\n font-size: 12px;\n }\n .vx-pad {\n padding: 12px;\n }\n .vx-pad-sm {\n padding: 6px 2px;\n }\n .vx-list {\n display: flex;\n flex-direction: column;\n gap: 4px;\n max-height: 300px;\n overflow: auto;\n }\n .vx-list-item {\n text-align: left;\n border: none;\n background: rgba(255, 255, 255, .1);\n color: inherit;\n border-radius: 8px;\n padding: 6px 10px;\n font-size: 12px;\n cursor: pointer;\n }\n .vx-list-item:hover {\n background: rgba(255, 255, 255, .22);\n }\n .vx-check-row {\n display: flex;\n gap: 8px;\n align-items: center;\n font-size: 12.5px;\n padding: 4px 2px;\n }\n .vx-check-title {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .vx-badge {\n background: rgba(127, 164, 224, .3);\n border-radius: 8px;\n padding: 0 6px;\n font-size: 10px;\n }\n .vx-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 11.5px;\n }\n .vx-table th, .vx-table td {\n border: 1px solid rgba(128, 140, 160, .3);\n padding: 4px 6px;\n text-align: right;\n }\n .vx-table th:first-child, .vx-table td:first-child {\n text-align: left;\n }\n .vx-folder {\n display: flex;\n flex-direction: column;\n }\n .vx-folder-head {\n display: flex;\n gap: 5px;\n align-items: center;\n padding: 5px 4px;\n border-radius: 9px;\n cursor: grab;\n }\n .vx-folder-head:hover {\n background: rgba(255, 255, 255, .14);\n }\n .vx-folder-head.drop-inside {\n background: rgba(127, 164, 224, .3);\n outline: 1px dashed rgba(127, 164, 224, .8);\n }\n .vx-folder-head.drop-before {\n box-shadow: 0 -2px 0 0 rgba(127, 164, 224, .9);\n }\n .vx-folder-head.drop-after {\n box-shadow: 0 2px 0 0 rgba(127, 164, 224, .9);\n }\n .vx-folder-name {\n font-size: 12.5px;\n font-weight: 600;\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .vx-folder-body {\n border-left: 1px dashed rgba(128, 140, 160, .35);\n margin-left: 14px;\n padding-left: 6px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n .vx-item-row {\n display: flex;\n gap: 5px;\n align-items: center;\n padding: 3px 4px;\n border-radius: 8px;\n }\n .vx-item-row:hover {\n background: rgba(255, 255, 255, .12);\n }\n .vx-item-name {\n flex: 1;\n text-align: left;\n border: none;\n background: transparent;\n color: inherit;\n font-size: 12px;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0;\n }\n .vx-mini {\n border: none;\n background: transparent;\n color: inherit;\n opacity: .75;\n cursor: pointer;\n padding: 2px;\n border-radius: 6px;\n display: inline-flex;\n align-items: center;\n }\n .vx-mini:hover {\n opacity: 1;\n background: rgba(255, 255, 255, .2);\n }\n .vx-form {\n display: flex;\n flex-direction: column;\n gap: 6px;\n border: 1px dashed rgba(128, 140, 160, .4);\n border-radius: 10px;\n padding: 8px;\n }\n .vx-prompt-card {\n border: 1px solid rgba(128, 140, 160, .3);\n background: rgba(255, 255, 255, .1);\n border-radius: 10px;\n padding: 8px 10px;\n }\n .vx-prompt-title {\n font-weight: 600;\n font-size: 12.5px;\n }\n .vx-prompt-body {\n margin-top: 4px;\n font-size: 11.5px;\n opacity: .85;\n white-space: pre-wrap;\n word-break: break-word;\n max-height: 72px;\n overflow: hidden;\n }\n .vx-modal-mask {\n position: absolute;\n inset: 0;\n pointer-events: auto;\n background: rgba(8, 10, 16, .4);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 60;\n }\n .vx-modal {\n position: relative;\n width: min(760px, 92vw);\n max-height: 82vh;\n overflow: auto;\n padding: 16px;\n color: #20242e;\n pointer-events: auto;\n }\n .vx-pop-head {\n display: flex;\n gap: 8px;\n align-items: center;\n margin-bottom: 8px;\n font-weight: 600;\n font-size: 13px;\n }\n .vx-svgbox {\n overflow: auto;\n background: rgba(12, 14, 20, .6);\n border-radius: 12px;\n padding: 14px;\n }\n .vx-svgbox svg {\n max-width: 100%;\n height: auto;\n }\n .vx-pre {\n white-space: pre-wrap;\n word-break: break-all;\n font-size: 10.5px;\n opacity: .85;\n }\n .vx-toasts {\n position: absolute;\n left: 50%;\n bottom: 26px;\n transform: translateX(-50%);\n display: flex;\n flex-direction: column;\n gap: 8px;\n align-items: center;\n pointer-events: auto;\n z-index: 80;\n }\n .vx-toast {\n display: flex;\n gap: 10px;\n align-items: center;\n color: #f2f4f8;\n background: rgba(26, 32, 44, .92);\n border: 1px solid rgba(255, 255, 255, .12);\n padding: 8px 14px;\n border-radius: 12px;\n font-size: 12.5px;\n box-shadow: 0 10px 30px rgba(0, 0, 0, .3);\n max-width: 560px;\n backdrop-filter: blur(9px);\n -webkit-backdrop-filter: blur(9px);\n }\n @media (prefers-color-scheme: dark) {\n .vx-toast {\n background: rgba(18, 22, 30, .94);\n }\n }\n .vx-foot-btn {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n border: 1px solid rgba(127, 164, 224, .4);\n background: rgba(127, 164, 224, .14);\n color: inherit;\n cursor: pointer;\n padding: 4px 10px;\n border-radius: 10px;\n margin: 2px;\n }\n .vx-foot-btn:hover {\n background: rgba(127, 164, 224, .3);\n }\n .vx-foot-label {\n font-size: 12px;\n }\n .vx-folders {\n position: fixed;\n left: 12px;\n bottom: 60px;\n width: 272px;\n max-height: min(560px, calc(100vh - 220px));\n display: flex;\n flex-direction: column;\n overflow: hidden;\n pointer-events: auto;\n color: #20242e;\n z-index: 55;\n }\n /* \u5934\u90E8\u884C\uFF08\u56FE\u6807 + \u6807\u9898 + \u6309\u94AE\uFF09\u4E0B\u79FB\u5E76\u62C9\u5F00\u4E0E\u5BB9\u5668\u8FB9\u7F18\u7684\u95F4\u8DDD */\n .vx-folders .vx-pop-head {\n padding: 14px 14px 0;\n }\n .vx-folders-body {\n flex: 1;\n overflow: auto;\n padding: 4px 14px 12px;\n position: relative;\n z-index: 1;\n }\n .vx-prompt-pop {\n position: fixed;\n width: 320px;\n max-height: 420px;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n pointer-events: auto;\n color: #20242e;\n z-index: 65;\n padding: 10px 12px;\n }\n .vx-settings-page {\n display: flex;\n flex-direction: column;\n gap: 14px;\n max-width: 720px;\n }";
|
|
7
|
+
export declare const STATIC_CSS = "/* dsh-custom-plugin static styles. Every rule is global by design: the UI\n * mounts into product slots and overlays, so class names are prefixed vx-\n * and must not be scoped by CSS Modules. Dynamic rules (body background,\n * aurora gradient, global-glass blur) are managed at runtime by a style\n * element in custom.tsx and do not live here. */\n.vx-root {\n position: fixed;\n inset: 0;\n pointer-events: none;\n z-index: 2147483000;\n font-family: ui-sans-serif, system-ui, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;\n }\n .vx-fx {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n .vx-anchor {\n display: inline-block;\n width: 0;\n height: 1px;\n vertical-align: bottom;\n }\n .vx-turn-actions {\n display: inline-flex;\n gap: 4px;\n margin-left: 10px;\n vertical-align: middle;\n align-items: center;\n }\n .vx-chip {\n pointer-events: auto;\n border: 1px solid rgba(128, 140, 160, .4);\n background: rgba(255, 255, 255, .16);\n color: inherit;\n border-radius: 8px;\n padding: 2px 8px;\n font-size: 11px;\n cursor: pointer;\n backdrop-filter: blur(6px);\n text-decoration: none;\n display: inline-flex;\n align-items: center;\n gap: 3px;\n }\n .vx-chip:hover {\n background: rgba(255, 255, 255, .28);\n }\n .vx-link {\n text-decoration: none;\n }\n .vx-glass {\n border-radius: 16px;\n background: rgba(255, 255, 255, .64);\n -webkit-backdrop-filter: blur(9px) saturate(1.22);\n backdrop-filter: blur(9px) saturate(1.22);\n box-shadow: 0 0 1px 1px rgba(17, 17, 26, .07) inset, 0 1px 2px rgba(17, 17, 26, .05) inset, 0px 4px 16px rgba(17, 17, 26, .05), 0px 8px 24px rgba(17, 17, 26, .05), 0px 16px 56px rgba(17, 17, 26, .05);\n }\n @media (prefers-color-scheme: dark) {\n .vx-glass {\n background: rgba(13, 17, 25, .62);\n color: #eef1f7;\n }\n }\n .vx-liquid .vx-glass {\n background: rgba(255, 255, 255, .06);\n backdrop-filter: url(#vx-lg);\n -webkit-backdrop-filter: url(#vx-lg);\n }\n @media (prefers-color-scheme: dark) {\n .vx-liquid .vx-glass {\n background: rgba(0, 0, 0, .06);\n }\n }\n @supports not (backdrop-filter: url(#vx-lg)) {\n .vx-liquid .vx-glass {\n background: rgba(255, 255, 255, .64);\n backdrop-filter: blur(9px) saturate(1.22);\n -webkit-backdrop-filter: blur(9px) saturate(1.22);\n }\n @media (prefers-color-scheme: dark) {\n .vx-liquid .vx-glass {\n background: rgba(13, 17, 25, .62);\n }\n }\n }\n .vx-liquid .vx-pattern {\n background-image: radial-gradient(rgba(150, 150, 160, .5) 3px, transparent 3px);\n background-size: 24px 24px;\n -webkit-mask-image: radial-gradient(ellipse at top, transparent 20%, black);\n mask-image: radial-gradient(ellipse at top, transparent 20%, black);\n animation: vx-pattern-move 25000ms linear infinite;\n }\n @media (prefers-color-scheme: dark) {\n .vx-liquid .vx-pattern {\n background-image: radial-gradient(rgba(110, 110, 128, .5) 3px, transparent 3px);\n }\n }\n .vx-pattern {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: -1;\n background-image: radial-gradient(rgba(150, 150, 160, .42) 1px, transparent 1px);\n background-size: 24px 24px;\n -webkit-mask-image: radial-gradient(ellipse at center, transparent 30%, black 100%);\n mask-image: radial-gradient(ellipse at center, transparent 30%, black 100%);\n animation: vx-pattern-move 10000ms linear infinite;\n }\n @media (prefers-color-scheme: dark) {\n .vx-pattern {\n background-image: radial-gradient(rgba(100, 100, 116, .5) 1px, transparent 1px);\n }\n }\n @keyframes vx-pattern-move {\n from {\n background-position: 0 0;\n }\n to {\n background-position: 0 24px;\n }\n }\n @keyframes vx-aurora {\n 0% {\n background-position: 0% 50%;\n }\n 50% {\n background-position: 100% 50%;\n }\n 100% {\n background-position: 0% 50%;\n }\n }\n .vx-rail {\n position: absolute;\n width: 12px;\n border-radius: 8px;\n background: rgba(120, 130, 150, .18);\n border: 1px solid rgba(120, 130, 150, .25);\n pointer-events: auto;\n touch-action: none;\n box-sizing: border-box;\n }\n .vx-rail.right {\n right: 4px;\n }\n .vx-rail.left {\n left: 56px;\n }\n /* When the rail is active it substitutes the native scrollbar: the scrollport\n carrying the vx-rail-scroller class (added by the client when it resolves\n the chat scrollport) hides its own bar so only one scroll affordance\n remains. scrollbar-gutter: stable on the shell keeps the layout width. */\n .vx-rail-scroller {\n scrollbar-width: none;\n }\n .vx-rail-scroller::-webkit-scrollbar {\n display: none;\n }\n .vx-thumb {\n position: absolute;\n left: 1px;\n right: 1px;\n border-radius: 8px;\n background: rgba(90, 105, 135, .5);\n border: 1px solid rgba(255, 255, 255, .35);\n box-sizing: border-box;\n }\n .vx-thumb:hover {\n background: rgba(90, 105, 135, .7);\n }\n .vx-dot {\n position: absolute;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background: rgba(70, 85, 110, .92);\n border: 2px solid rgba(255, 255, 255, .92);\n box-shadow: 0 1px 3px rgba(0, 0, 0, .35);\n pointer-events: auto;\n cursor: pointer;\n transition: transform .12s;\n padding: 0;\n }\n .vx-dot:hover {\n transform: translate(-50%, -50%) scale(1.35);\n }\n .vx-dot.star {\n background: #c9a24b;\n border-color: #f3e3bd;\n }\n @media (prefers-color-scheme: dark) {\n .vx-dot {\n background: rgba(205, 215, 230, .95);\n border-color: rgba(28, 34, 46, .9);\n }\n .vx-thumb {\n background: rgba(165, 180, 205, .45);\n }\n }\n .vx-rail-pop {\n position: absolute;\n pointer-events: auto;\n padding: 10px 12px;\n width: 300px;\n font-size: 12px;\n line-height: 1.55;\n z-index: 5;\n }\n /* Class = which side the rail sits on; the card must open toward the page\n content. It is a child of the 12px-wide rail, so right:20px puts it left\n of the rail and left:20px puts it right (20px = rail width + 8px gap). */\n .vx-rail-pop.right {\n right: 20px;\n }\n .vx-rail-pop.left {\n left: 20px;\n }\n .vx-pop-time {\n color: #6d7689;\n font-size: 11px;\n margin-bottom: 4px;\n }\n .vx-pop-text {\n white-space: pre-wrap;\n word-break: break-word;\n max-height: 150px;\n overflow: hidden;\n margin-bottom: 8px;\n }\n .vx-pop-row {\n display: flex;\n gap: 5px;\n flex-wrap: wrap;\n align-items: center;\n }\n .vx-balance-wrap {\n display: inline-flex;\n align-items: center;\n position: relative;\n }\n .vx-balance-text {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 3px 10px;\n border-radius: 8px;\n font-size: 12.5px;\n color: inherit;\n background: rgba(127, 164, 224, .16);\n border: 1px solid rgba(127, 164, 224, .4);\n cursor: default;\n white-space: nowrap;\n }\n .vx-balance-text:hover {\n background: rgba(127, 164, 224, .28);\n }\n .vx-balance-text.vx-balance-pinned {\n background: rgba(127, 164, 224, .36);\n border-color: rgba(127, 164, 224, .8);\n }\n .vx-balance-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n margin-bottom: 8px;\n }\n .vx-balance-today {\n opacity: .75;\n font-size: 11.5px;\n }\n .vx-balance-hover {\n position: absolute;\n top: calc(100% + 8px);\n right: 0;\n z-index: 70;\n width: 360px;\n max-height: 480px;\n overflow: auto;\n padding: 12px;\n color: #20242e;\n font-size: 12px;\n pointer-events: auto;\n }\n @media (prefers-color-scheme: dark) {\n .vx-balance-hover {\n color: #e8ebf2;\n }\n }\n .vx-balance-lines {\n font-size: 13px;\n margin: 6px 0;\n }\n .vx-header-btn {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 4px 10px;\n border-radius: 8px;\n font-size: 12.5px;\n color: inherit;\n background: rgba(127, 164, 224, .16);\n border: 1px solid rgba(127, 164, 224, .4);\n cursor: pointer;\n white-space: nowrap;\n }\n .vx-header-btn:hover {\n background: rgba(127, 164, 224, .3);\n }\n .vx-quote-btn {\n position: absolute;\n transform: translate(-50%, -100%);\n pointer-events: auto;\n background: rgba(40, 48, 64, .96);\n color: #eef1f7;\n border: 1px solid rgba(255, 255, 255, .25);\n padding: 5px 12px;\n border-radius: 9px;\n font-size: 12px;\n cursor: pointer;\n box-shadow: 0 6px 18px rgba(0, 0, 0, .28);\n display: inline-flex;\n align-items: center;\n gap: 5px;\n }\n .vx-panel {\n position: absolute;\n width: 430px;\n max-width: calc(100vw - 40px);\n height: min(660px, calc(100vh - 110px));\n display: flex;\n flex-direction: column;\n overflow: hidden;\n pointer-events: auto;\n color: #20242e;\n }\n @media (prefers-color-scheme: dark) {\n .vx-panel, .vx-modal, .vx-folders {\n color: #e8ebf2;\n }\n }\n .vx-panel-head {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 14px;\n cursor: move;\n user-select: none;\n border-bottom: 1px solid rgba(150, 160, 180, .25);\n position: relative;\n z-index: 1;\n }\n .vx-panel-title {\n font-weight: 600;\n font-size: 13px;\n }\n .vx-panel-sub {\n font-size: 11px;\n opacity: .62;\n white-space: nowrap;\n }\n .vx-tabs {\n display: flex;\n flex-wrap: wrap;\n gap: 2px;\n padding: 8px 10px 4px;\n border-bottom: 1px solid rgba(150, 160, 180, .2);\n position: relative;\n z-index: 1;\n }\n .vx-tab {\n border: none;\n background: transparent;\n color: inherit;\n opacity: .75;\n font-size: 12px;\n padding: 5px 9px;\n border-radius: 8px;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n }\n .vx-tab.on {\n opacity: 1;\n background: rgba(255, 255, 255, .28);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);\n }\n .vx-panel-body {\n flex: 1;\n overflow: auto;\n padding: 12px 14px;\n position: relative;\n z-index: 1;\n }\n .vx-col {\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n .vx-row {\n display: flex;\n gap: 8px;\n align-items: center;\n }\n .vx-row.wrap {\n flex-wrap: wrap;\n }\n .vx-flex1 {\n flex: 1;\n }\n .vx-section-title {\n font-weight: 600;\n font-size: 12.5px;\n margin-top: 4px;\n opacity: .9;\n }\n .vx-swatches {\n display: grid;\n grid-template-columns: repeat(5, 1fr);\n gap: 6px;\n }\n .vx-swatch {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 3px;\n border: none;\n background: transparent;\n color: inherit;\n cursor: pointer;\n padding: 0;\n }\n .vx-swatch-box {\n width: 34px;\n height: 26px;\n border-radius: 8px;\n border: 2px solid rgba(120, 130, 150, .4);\n box-sizing: border-box;\n }\n .vx-swatch.on .vx-swatch-box {\n border-color: #7fa4e0;\n box-shadow: 0 0 0 2px rgba(127, 164, 224, .35);\n }\n .vx-swatch:disabled {\n opacity: .35;\n cursor: not-allowed;\n }\n .vx-swatch-label {\n font-size: 10px;\n opacity: .85;\n }\n .vx-btn {\n pointer-events: auto;\n border: 1px solid rgba(128, 140, 160, .4);\n background: rgba(255, 255, 255, .16);\n color: inherit;\n border-radius: 9px;\n padding: 6px 12px;\n font-size: 12px;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 5px;\n }\n .vx-btn:hover {\n background: rgba(255, 255, 255, .28);\n }\n .vx-btn.on {\n background: rgba(127, 164, 224, .35);\n border-color: rgba(127, 164, 224, .8);\n }\n .vx-btn:disabled {\n opacity: .5;\n cursor: default;\n }\n .vx-btn-sm {\n padding: 2px 8px;\n font-size: 11px;\n }\n .vx-btn-danger {\n background: rgba(214, 88, 88, .22);\n border-color: rgba(214, 88, 88, .55);\n }\n .vx-btn.big {\n padding: 10px 16px;\n font-size: 13px;\n }\n .vx-input {\n flex: 1;\n min-width: 0;\n border: 1px solid rgba(128, 140, 160, .4);\n background: rgba(255, 255, 255, .16);\n color: inherit;\n border-radius: 9px;\n padding: 6px 10px;\n font-size: 12px;\n }\n .vx-textarea {\n border: 1px solid rgba(128, 140, 160, .4);\n background: rgba(255, 255, 255, .16);\n color: inherit;\n border-radius: 9px;\n padding: 6px 10px;\n font-size: 12px;\n resize: vertical;\n font-family: inherit;\n }\n .vx-toggle-row {\n display: flex;\n gap: 8px;\n align-items: center;\n font-size: 12.5px;\n }\n .vx-muted {\n color: rgba(120, 128, 148, .95);\n font-size: 11.5px;\n }\n .vx-error {\n color: #d85858;\n font-size: 12px;\n }\n .vx-pad {\n padding: 12px;\n }\n .vx-pad-sm {\n padding: 6px 2px;\n }\n .vx-list {\n display: flex;\n flex-direction: column;\n gap: 4px;\n max-height: 300px;\n overflow: auto;\n }\n .vx-list-item {\n text-align: left;\n border: none;\n background: rgba(255, 255, 255, .1);\n color: inherit;\n border-radius: 8px;\n padding: 6px 10px;\n font-size: 12px;\n cursor: pointer;\n }\n .vx-list-item:hover {\n background: rgba(255, 255, 255, .22);\n }\n .vx-check-row {\n display: flex;\n gap: 8px;\n align-items: center;\n font-size: 12.5px;\n padding: 4px 2px;\n }\n .vx-check-title {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .vx-badge {\n background: rgba(127, 164, 224, .3);\n border-radius: 8px;\n padding: 0 6px;\n font-size: 10px;\n }\n .vx-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 11.5px;\n }\n .vx-table th, .vx-table td {\n border: 1px solid rgba(128, 140, 160, .3);\n padding: 4px 6px;\n text-align: right;\n }\n .vx-table th:first-child, .vx-table td:first-child {\n text-align: left;\n }\n .vx-folder {\n display: flex;\n flex-direction: column;\n }\n .vx-folder-head {\n display: flex;\n gap: 5px;\n align-items: center;\n padding: 5px 4px;\n border-radius: 9px;\n cursor: grab;\n }\n .vx-folder-head:hover {\n background: rgba(255, 255, 255, .14);\n }\n .vx-folder-head.drop-inside {\n background: rgba(127, 164, 224, .3);\n outline: 1px dashed rgba(127, 164, 224, .8);\n }\n .vx-folder-head.drop-before {\n box-shadow: 0 -2px 0 0 rgba(127, 164, 224, .9);\n }\n .vx-folder-head.drop-after {\n box-shadow: 0 2px 0 0 rgba(127, 164, 224, .9);\n }\n .vx-folder-name {\n font-size: 12.5px;\n font-weight: 600;\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .vx-folder-body {\n border-left: 1px dashed rgba(128, 140, 160, .35);\n margin-left: 14px;\n padding-left: 6px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n .vx-item-row {\n display: flex;\n gap: 5px;\n align-items: center;\n padding: 3px 4px;\n border-radius: 8px;\n }\n .vx-item-row:hover {\n background: rgba(255, 255, 255, .12);\n }\n .vx-item-name {\n flex: 1;\n text-align: left;\n border: none;\n background: transparent;\n color: inherit;\n font-size: 12px;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0;\n }\n .vx-mini {\n border: none;\n background: transparent;\n color: inherit;\n opacity: .75;\n cursor: pointer;\n padding: 2px;\n border-radius: 6px;\n display: inline-flex;\n align-items: center;\n }\n .vx-mini:hover {\n opacity: 1;\n background: rgba(255, 255, 255, .2);\n }\n .vx-form {\n display: flex;\n flex-direction: column;\n gap: 6px;\n border: 1px dashed rgba(128, 140, 160, .4);\n border-radius: 10px;\n padding: 8px;\n }\n .vx-prompt-card {\n border: 1px solid rgba(128, 140, 160, .3);\n background: rgba(255, 255, 255, .1);\n border-radius: 10px;\n padding: 8px 10px;\n }\n .vx-prompt-title {\n font-weight: 600;\n font-size: 12.5px;\n }\n .vx-prompt-body {\n margin-top: 4px;\n font-size: 11.5px;\n opacity: .85;\n white-space: pre-wrap;\n word-break: break-word;\n max-height: 72px;\n overflow: hidden;\n }\n .vx-modal-mask {\n position: absolute;\n inset: 0;\n pointer-events: auto;\n background: rgba(8, 10, 16, .4);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 60;\n }\n .vx-modal {\n position: relative;\n width: min(760px, 92vw);\n max-height: 82vh;\n overflow: auto;\n padding: 16px;\n color: #20242e;\n pointer-events: auto;\n }\n .vx-pop-head {\n display: flex;\n gap: 8px;\n align-items: center;\n margin-bottom: 8px;\n font-weight: 600;\n font-size: 13px;\n }\n .vx-svgbox {\n overflow: auto;\n background: rgba(12, 14, 20, .6);\n border-radius: 12px;\n padding: 14px;\n }\n .vx-svgbox svg {\n max-width: 100%;\n height: auto;\n }\n .vx-pre {\n white-space: pre-wrap;\n word-break: break-all;\n font-size: 10.5px;\n opacity: .85;\n }\n .vx-toasts {\n position: absolute;\n left: 50%;\n bottom: 26px;\n transform: translateX(-50%);\n display: flex;\n flex-direction: column;\n gap: 8px;\n align-items: center;\n pointer-events: auto;\n z-index: 80;\n }\n .vx-toast {\n display: flex;\n gap: 10px;\n align-items: center;\n color: #f2f4f8;\n background: rgba(26, 32, 44, .92);\n border: 1px solid rgba(255, 255, 255, .12);\n padding: 8px 14px;\n border-radius: 12px;\n font-size: 12.5px;\n box-shadow: 0 10px 30px rgba(0, 0, 0, .3);\n max-width: 560px;\n backdrop-filter: blur(9px);\n -webkit-backdrop-filter: blur(9px);\n }\n @media (prefers-color-scheme: dark) {\n .vx-toast {\n background: rgba(18, 22, 30, .94);\n }\n }\n .vx-foot-btn {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n border: 1px solid rgba(127, 164, 224, .4);\n background: rgba(127, 164, 224, .14);\n color: inherit;\n cursor: pointer;\n padding: 4px 10px;\n border-radius: 10px;\n margin: 2px;\n }\n .vx-foot-btn:hover {\n background: rgba(127, 164, 224, .3);\n }\n .vx-foot-label {\n font-size: 12px;\n }\n .vx-folders {\n position: fixed;\n left: 12px;\n bottom: 60px;\n width: 272px;\n max-height: min(560px, calc(100vh - 220px));\n display: flex;\n flex-direction: column;\n overflow: hidden;\n pointer-events: auto;\n color: #20242e;\n z-index: 55;\n }\n /* \u5934\u90E8\u884C\uFF08\u56FE\u6807 + \u6807\u9898 + \u6309\u94AE\uFF09\u4E0B\u79FB\u5E76\u62C9\u5F00\u4E0E\u5BB9\u5668\u8FB9\u7F18\u7684\u95F4\u8DDD */\n .vx-folders .vx-pop-head {\n padding: 14px 14px 0;\n }\n .vx-folders-body {\n flex: 1;\n overflow: auto;\n padding: 4px 14px 12px;\n position: relative;\n z-index: 1;\n }\n .vx-prompt-pop {\n position: fixed;\n width: 320px;\n max-height: 420px;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n pointer-events: auto;\n color: #20242e;\n z-index: 65;\n padding: 10px 12px;\n }\n .vx-settings-page {\n display: flex;\n flex-direction: column;\n gap: 14px;\n max-width: 720px;\n }\n .vx-mmd-wrap {\n position: relative;\n margin: 6px 0;\n border: 1px solid rgba(127, 164, 224, .35);\n border-radius: 12px;\n overflow: hidden;\n background: rgba(127, 164, 224, .05);\n }\n .vx-mmd-bar {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 4px 6px;\n border-bottom: 1px solid rgba(127, 164, 224, .25);\n background: rgba(127, 164, 224, .08);\n }\n .vx-mmd-btn {\n border: none;\n background: transparent;\n color: inherit;\n opacity: .65;\n font-size: 12px;\n padding: 3px 10px;\n border-radius: 8px;\n cursor: pointer;\n }\n .vx-mmd-btn:hover {\n opacity: 1;\n background: rgba(127, 164, 224, .18);\n }\n .vx-mmd-btn.active {\n opacity: 1;\n background: rgba(127, 164, 224, .28);\n font-weight: 600;\n }\n .vx-mmd-live {\n margin-left: auto;\n font-size: 11px;\n opacity: .6;\n color: inherit;\n text-decoration: none;\n padding: 3px 8px;\n }\n .vx-mmd-live:hover {\n opacity: 1;\n }\n .vx-mmd-stage {\n padding: 16px 12px;\n overflow-x: auto;\n text-align: center;\n }\n .vx-mmd-stage svg {\n max-width: 100%;\n height: auto;\n }";
|
|
@@ -23,6 +23,8 @@ export interface CustomPluginHostOptions {
|
|
|
23
23
|
diagReports: string[];
|
|
24
24
|
/** Optional attachment store used to embed images into PDF exports. */
|
|
25
25
|
attachments?: AttachmentStore | undefined;
|
|
26
|
+
/** Test seam: return the local mermaid engine file path (or null). */
|
|
27
|
+
localMermaidPath?: () => string | null;
|
|
26
28
|
}
|
|
27
29
|
/** Host capabilities behind the routes and the agent tool. */
|
|
28
30
|
export declare class CustomPluginHost {
|
|
@@ -35,6 +37,8 @@ export declare class CustomPluginHost {
|
|
|
35
37
|
private readonly sessionModel;
|
|
36
38
|
private mermaidBytesValue;
|
|
37
39
|
private mermaidJs;
|
|
40
|
+
private mermaidSource;
|
|
41
|
+
private localMermaidPath;
|
|
38
42
|
constructor(options: CustomPluginHostOptions);
|
|
39
43
|
/** Persist the state document (debounced by the loader entry). */
|
|
40
44
|
persist(): Promise<void>;
|
|
@@ -100,7 +104,9 @@ export declare class CustomPluginHost {
|
|
|
100
104
|
ok: false;
|
|
101
105
|
error: string;
|
|
102
106
|
}>;
|
|
103
|
-
/**
|
|
107
|
+
/** Resolve the Mermaid engine: the bundled `mermaid` dependency on disk
|
|
108
|
+
* first (no runtime network), CDN mirrors only as a fallback (cached for
|
|
109
|
+
* the host lifetime). */
|
|
104
110
|
mermaidFetch(): Promise<{
|
|
105
111
|
ok: true;
|
|
106
112
|
bytes: number;
|
|
@@ -112,6 +118,8 @@ export declare class CustomPluginHost {
|
|
|
112
118
|
mermaidScript(): string;
|
|
113
119
|
/** Mermaid engine byte count for diagnostics. */
|
|
114
120
|
mermaidBytes(): number;
|
|
121
|
+
/** Where the engine came from: 'local', 'cdn', or '' while unloaded. */
|
|
122
|
+
mermaidLoadedSource(): string;
|
|
115
123
|
/** Whether any DeepSeek key source resolves (state, environment, credential
|
|
116
124
|
* file) — the honest answer behind the panel's "key configured" badge. */
|
|
117
125
|
hasApiKey(): Promise<boolean>;
|
|
@@ -121,9 +129,14 @@ export declare class CustomPluginHost {
|
|
|
121
129
|
today: string;
|
|
122
130
|
usageToday: unknown;
|
|
123
131
|
mermaidBytes: number;
|
|
132
|
+
mermaidSource: string;
|
|
124
133
|
apiKeySet: boolean;
|
|
125
134
|
diagReports: string[];
|
|
126
135
|
}>;
|
|
127
136
|
private httpText;
|
|
128
137
|
private httpJson;
|
|
129
138
|
}
|
|
139
|
+
/** Resolve `mermaid/dist/mermaid.min.js` from the package's own dependency
|
|
140
|
+
* tree (works for `link:` checkouts and registry installs alike); null when
|
|
141
|
+
* the dependency is absent, which falls mermaidFetch back to the CDN. */
|
|
142
|
+
export declare function defaultLocalMermaidPath(): string | null;
|
package/package.json
CHANGED
|
@@ -1,84 +1,88 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@alexpeng/dsh-custom-plugin",
|
|
3
|
-
"description": "Custom convenience suite for the dsh web GUI: background colors with weather FX, liquid glass, a per-user-message timeline rail with stars and branching, multi-level project folders, prompt library, conversation export (JSON / Markdown / PDF-with-images), Mermaid rendering, quote reply, DeepSeek balance and daily token usage; dual-face plugin mounted without dsh source changes.",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "lib/index.js",
|
|
7
|
-
"types": "lib/types/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./lib/types/index.d.ts",
|
|
11
|
-
"default": "./lib/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./client": {
|
|
14
|
-
"types": "./lib/types/client/index.d.ts",
|
|
15
|
-
"default": "./lib/client.js"
|
|
16
|
-
},
|
|
17
|
-
"./package.json": "./package.json"
|
|
18
|
-
},
|
|
19
|
-
"dsh": {
|
|
20
|
-
"bundle": {
|
|
21
|
-
"patch": "./cordis.patch.yml"
|
|
22
|
-
},
|
|
23
|
-
"client": {
|
|
24
|
-
"inject": [
|
|
25
|
-
"@deepseek-ai/dsh-client-runtime"
|
|
26
|
-
],
|
|
27
|
-
"platform": "web"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"publishConfig": {
|
|
31
|
-
"access": "public"
|
|
32
|
-
},
|
|
33
|
-
"repository": {
|
|
34
|
-
"type": "git",
|
|
35
|
-
"url": "git+https://github.com/AlexPeng07/dsh-custom-plugin.git"
|
|
36
|
-
},
|
|
37
|
-
"author": "AlexPeng <alexpeng07@outlook.com>",
|
|
38
|
-
"bugs": "https://github.com/AlexPeng07/dsh-custom-plugin/issues",
|
|
39
|
-
"homepage": "https://github.com/AlexPeng07/dsh-custom-plugin#readme",
|
|
40
|
-
"engines": {
|
|
41
|
-
"node": ">=22"
|
|
42
|
-
},
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"@deepseek-ai/
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"@
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@alexpeng/dsh-custom-plugin",
|
|
3
|
+
"description": "Custom convenience suite for the dsh web GUI: background colors with weather FX, liquid glass, a per-user-message timeline rail with stars and branching, multi-level project folders, prompt library, conversation export (JSON / Markdown / PDF-with-images), Mermaid rendering, quote reply, DeepSeek balance and daily token usage; dual-face plugin mounted without dsh source changes.",
|
|
4
|
+
"version": "0.1.2",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/types/index.d.ts",
|
|
11
|
+
"default": "./lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./client": {
|
|
14
|
+
"types": "./lib/types/client/index.d.ts",
|
|
15
|
+
"default": "./lib/client.js"
|
|
16
|
+
},
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"dsh": {
|
|
20
|
+
"bundle": {
|
|
21
|
+
"patch": "./cordis.patch.yml"
|
|
22
|
+
},
|
|
23
|
+
"client": {
|
|
24
|
+
"inject": [
|
|
25
|
+
"@deepseek-ai/dsh-client-runtime"
|
|
26
|
+
],
|
|
27
|
+
"platform": "web"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/AlexPeng07/dsh-custom-plugin.git"
|
|
36
|
+
},
|
|
37
|
+
"author": "AlexPeng <alexpeng07@outlook.com>",
|
|
38
|
+
"bugs": "https://github.com/AlexPeng07/dsh-custom-plugin/issues",
|
|
39
|
+
"homepage": "https://github.com/AlexPeng07/dsh-custom-plugin#readme",
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=22"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc -p tsconfig.build.json && tsdown",
|
|
45
|
+
"bundle": "tsdown",
|
|
46
|
+
"watch": "tsdown --watch",
|
|
47
|
+
"typecheck": "tsc --noEmit",
|
|
48
|
+
"test": "vitest run",
|
|
49
|
+
"test:watch": "vitest",
|
|
50
|
+
"prepare": "pnpm build",
|
|
51
|
+
"prepublishOnly": "pnpm typecheck && pnpm test"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
55
|
+
"@deepseek-ai/dsh-tools": "^0.1.1-rc.1"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"mermaid": "^11.6.0"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
62
|
+
"@deepseek-ai/dsh-attachment": "^0.1.1-rc.1",
|
|
63
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.1-rc.1",
|
|
64
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.1-rc.1",
|
|
65
|
+
"@deepseek-ai/dsh-client-ui-theme": "^0.1.1-rc.1",
|
|
66
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.1-rc.1",
|
|
67
|
+
"@deepseek-ai/dsh-llm": "^0.1.1-rc.1",
|
|
68
|
+
"@deepseek-ai/dsh-session": "^0.1.1-rc.1",
|
|
69
|
+
"@deepseek-ai/dsh-session-query": "^0.1.1-rc.1",
|
|
70
|
+
"@deepseek-ai/dsh-tools": "^0.1.1-rc.1",
|
|
71
|
+
"@types/node": "^22.20.0",
|
|
72
|
+
"@types/react": "~18.3.1",
|
|
73
|
+
"@types/react-dom": "^18.3.5",
|
|
74
|
+
"react": "^18.3.1",
|
|
75
|
+
"react-dom": "^18.3.1",
|
|
76
|
+
"tsdown": "0.22.2",
|
|
77
|
+
"typescript": "~5.7.2",
|
|
78
|
+
"vitest": "^3.0.0"
|
|
79
|
+
},
|
|
80
|
+
"files": [
|
|
81
|
+
"lib",
|
|
82
|
+
"cordis.patch.yml",
|
|
83
|
+
"README.md",
|
|
84
|
+
"README.zh.md",
|
|
85
|
+
"README.i18n.yaml"
|
|
86
|
+
],
|
|
87
|
+
"license": "Apache-2.0"
|
|
88
|
+
}
|