@alexpeng/dsh-custom-plugin 0.1.0 → 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/LICENSE +1 -1
- package/README.i18n.yaml +2 -2
- package/README.md +43 -5
- package/README.zh.md +43 -5
- package/cordis.patch.yml +2 -2
- package/lib/client.js +364 -22
- package/lib/client.js.map +1 -1
- package/lib/index.js +85 -4977
- package/lib/types/client/api.d.ts +2 -2
- package/lib/types/client/index.d.ts +2 -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 +19 -7
- package/lib/types/protocol.d.ts +0 -5
- package/lib/types/usage.d.ts +4 -4
- package/package.json +19 -10
|
@@ -41,8 +41,8 @@ export declare function apiStateSave(edit: StateEdit): Promise<{
|
|
|
41
41
|
ok: false;
|
|
42
42
|
error?: string;
|
|
43
43
|
}>;
|
|
44
|
-
/** Timeline nodes for one session. */
|
|
45
|
-
export declare function apiTimelineGet(sessionId: string
|
|
44
|
+
/** Timeline nodes for one session (tail-capped by the host). */
|
|
45
|
+
export declare function apiTimelineGet(sessionId: string): Promise<{
|
|
46
46
|
ok: true;
|
|
47
47
|
sessionId: string;
|
|
48
48
|
items: TimelineItem[];
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Browser-half entry for dsh-custom-plugin.
|
|
3
3
|
*
|
|
4
4
|
* Mounts the Custom UI surfaces (overlay, timeline, folders, prompts,
|
|
5
|
-
* balance, quote reply) through
|
|
5
|
+
* balance, quote reply) through eight injections into seven official slots.
|
|
6
|
+
* The slots ledger is
|
|
6
7
|
* the only coupling point: the declarations are provided by the web shell
|
|
7
8
|
* itself, so this plugin needs no family-side integration to work. All
|
|
8
9
|
* surfaces ship plain Chinese copy, with no i18n registration and no polling
|
|
@@ -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 }";
|
|
@@ -4,12 +4,10 @@
|
|
|
4
4
|
* The routes in `routes.ts` are a thin HTTP fence over this class.
|
|
5
5
|
* @module @alexpeng/dsh-custom-plugin/host-service
|
|
6
6
|
*/
|
|
7
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
8
7
|
import type { AttachmentStore } from '@deepseek-ai/dsh-attachment';
|
|
9
8
|
import type { SessionQueryEngine } from '@deepseek-ai/dsh-session-query';
|
|
10
9
|
import type { BalanceInfo, CustomPluginState, TimelineItem } from './protocol.ts';
|
|
11
10
|
import { type UsageRecord } from './usage.ts';
|
|
12
|
-
export type { BalanceInfo, TimelineItem };
|
|
13
11
|
/** Options the loader entry supplies to the host service. */
|
|
14
12
|
export interface CustomPluginHostOptions {
|
|
15
13
|
sessionQuery: SessionQueryEngine;
|
|
@@ -25,6 +23,8 @@ export interface CustomPluginHostOptions {
|
|
|
25
23
|
diagReports: string[];
|
|
26
24
|
/** Optional attachment store used to embed images into PDF exports. */
|
|
27
25
|
attachments?: AttachmentStore | undefined;
|
|
26
|
+
/** Test seam: return the local mermaid engine file path (or null). */
|
|
27
|
+
localMermaidPath?: () => string | null;
|
|
28
28
|
}
|
|
29
29
|
/** Host capabilities behind the routes and the agent tool. */
|
|
30
30
|
export declare class CustomPluginHost {
|
|
@@ -35,10 +35,11 @@ export declare class CustomPluginHost {
|
|
|
35
35
|
private readonly diagReports;
|
|
36
36
|
private readonly attachments;
|
|
37
37
|
private readonly sessionModel;
|
|
38
|
-
private readonly timelineCache;
|
|
39
38
|
private mermaidBytesValue;
|
|
40
39
|
private mermaidJs;
|
|
41
|
-
|
|
40
|
+
private mermaidSource;
|
|
41
|
+
private localMermaidPath;
|
|
42
|
+
constructor(options: CustomPluginHostOptions);
|
|
42
43
|
/** Persist the state document (debounced by the loader entry). */
|
|
43
44
|
persist(): Promise<void>;
|
|
44
45
|
/** Record a bounded client diagnostic line. */
|
|
@@ -59,8 +60,10 @@ export declare class CustomPluginHost {
|
|
|
59
60
|
stars?: CustomPluginState['stars'];
|
|
60
61
|
apiKey?: string;
|
|
61
62
|
}): void;
|
|
62
|
-
/** Timeline nodes for one session,
|
|
63
|
-
|
|
63
|
+
/** Timeline nodes for one session, capped to the 400-node tail. The tail cap
|
|
64
|
+
* bounds the payload (each item carries up to 4k of preview text); 400 keeps
|
|
65
|
+
* dots available when the GUI deep-loads history. */
|
|
66
|
+
timelineGet(sessionId: string): Promise<{
|
|
64
67
|
ok: true;
|
|
65
68
|
sessionId: string;
|
|
66
69
|
items: TimelineItem[];
|
|
@@ -101,7 +104,9 @@ export declare class CustomPluginHost {
|
|
|
101
104
|
ok: false;
|
|
102
105
|
error: string;
|
|
103
106
|
}>;
|
|
104
|
-
/**
|
|
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). */
|
|
105
110
|
mermaidFetch(): Promise<{
|
|
106
111
|
ok: true;
|
|
107
112
|
bytes: number;
|
|
@@ -113,6 +118,8 @@ export declare class CustomPluginHost {
|
|
|
113
118
|
mermaidScript(): string;
|
|
114
119
|
/** Mermaid engine byte count for diagnostics. */
|
|
115
120
|
mermaidBytes(): number;
|
|
121
|
+
/** Where the engine came from: 'local', 'cdn', or '' while unloaded. */
|
|
122
|
+
mermaidLoadedSource(): string;
|
|
116
123
|
/** Whether any DeepSeek key source resolves (state, environment, credential
|
|
117
124
|
* file) — the honest answer behind the panel's "key configured" badge. */
|
|
118
125
|
hasApiKey(): Promise<boolean>;
|
|
@@ -122,9 +129,14 @@ export declare class CustomPluginHost {
|
|
|
122
129
|
today: string;
|
|
123
130
|
usageToday: unknown;
|
|
124
131
|
mermaidBytes: number;
|
|
132
|
+
mermaidSource: string;
|
|
125
133
|
apiKeySet: boolean;
|
|
126
134
|
diagReports: string[];
|
|
127
135
|
}>;
|
|
128
136
|
private httpText;
|
|
129
137
|
private httpJson;
|
|
130
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/lib/types/protocol.d.ts
CHANGED
package/lib/types/usage.d.ts
CHANGED
|
@@ -12,11 +12,11 @@ export interface UsageRecord {
|
|
|
12
12
|
cacheWriteTokens?: number;
|
|
13
13
|
reasoningTokens?: number;
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
15
|
+
/** Beijing-time (UTC+8) day key `YYYY-MM-DD`. */
|
|
16
16
|
export declare function dayKey(time?: number): string;
|
|
17
|
-
/** DeepSeek peak billing window: 09:00-12:00 / 14:00-18:00, off-peak is
|
|
18
|
-
* remainder at half price.
|
|
19
|
-
*
|
|
17
|
+
/** DeepSeek peak billing window: Beijing 09:00-12:00 / 14:00-18:00, off-peak is
|
|
18
|
+
* the remainder at half price. Evaluated on China Standard Time so the split
|
|
19
|
+
* matches the published schedule on any host timezone. */
|
|
20
20
|
export declare function isPeakHour(time: number): boolean;
|
|
21
21
|
/** Fold one usage record into a ledger row, tracking the peak-hour portion. */
|
|
22
22
|
export declare function foldUsageRecord(row: UsageRow, usage: UsageRecord, peak: boolean): void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexpeng/dsh-custom-plugin",
|
|
3
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.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/types/index.d.ts",
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
"types": "./lib/types/client/index.d.ts",
|
|
15
15
|
"default": "./lib/client.js"
|
|
16
16
|
},
|
|
17
|
-
"./src/*": "./src/*",
|
|
18
17
|
"./package.json": "./package.json"
|
|
19
18
|
},
|
|
20
19
|
"dsh": {
|
|
@@ -31,37 +30,47 @@
|
|
|
31
30
|
"publishConfig": {
|
|
32
31
|
"access": "public"
|
|
33
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
|
+
},
|
|
34
43
|
"scripts": {
|
|
35
44
|
"build": "tsc -p tsconfig.build.json && tsdown",
|
|
36
45
|
"bundle": "tsdown",
|
|
37
46
|
"watch": "tsdown --watch",
|
|
38
47
|
"typecheck": "tsc --noEmit",
|
|
39
48
|
"test": "vitest run",
|
|
40
|
-
"test:watch": "vitest"
|
|
49
|
+
"test:watch": "vitest",
|
|
50
|
+
"prepare": "pnpm build",
|
|
51
|
+
"prepublishOnly": "pnpm typecheck && pnpm test"
|
|
41
52
|
},
|
|
42
53
|
"peerDependencies": {
|
|
43
|
-
"@deepseek-ai/cordis": "^4.0.1"
|
|
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"
|
|
44
59
|
},
|
|
45
|
-
"dependencies": {},
|
|
46
60
|
"devDependencies": {
|
|
47
61
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
48
62
|
"@deepseek-ai/dsh-attachment": "^0.1.1-rc.1",
|
|
49
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.1-rc.1",
|
|
50
63
|
"@deepseek-ai/dsh-client-runtime": "^0.1.1-rc.1",
|
|
51
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.1-rc.1",
|
|
52
64
|
"@deepseek-ai/dsh-client-ui-slots": "^0.1.1-rc.1",
|
|
53
65
|
"@deepseek-ai/dsh-client-ui-theme": "^0.1.1-rc.1",
|
|
54
66
|
"@deepseek-ai/dsh-host-webserver": "^0.1.1-rc.1",
|
|
55
67
|
"@deepseek-ai/dsh-llm": "^0.1.1-rc.1",
|
|
56
68
|
"@deepseek-ai/dsh-session": "^0.1.1-rc.1",
|
|
57
69
|
"@deepseek-ai/dsh-session-query": "^0.1.1-rc.1",
|
|
58
|
-
"@deepseek-ai/dsh-settings": "^0.1.1-rc.1",
|
|
59
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.1",
|
|
60
70
|
"@deepseek-ai/dsh-tools": "^0.1.1-rc.1",
|
|
61
71
|
"@types/node": "^22.20.0",
|
|
62
72
|
"@types/react": "~18.3.1",
|
|
63
73
|
"@types/react-dom": "^18.3.5",
|
|
64
|
-
"jsdom": "^25.0.0",
|
|
65
74
|
"react": "^18.3.1",
|
|
66
75
|
"react-dom": "^18.3.1",
|
|
67
76
|
"tsdown": "0.22.2",
|