@dsh-plus/llm-pi 0.1.19 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +82 -38
- package/lib/index.js +3 -3
- package/lib/style.css +72 -72
- package/package.json +29 -29
- package/src/catalog/models-dev.ts +1 -1
- package/src/service.ts +2 -2
package/lib/client.js
CHANGED
|
@@ -18000,16 +18000,16 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
18000
18000
|
init_shellscript();
|
|
18001
18001
|
init_json();
|
|
18002
18002
|
var DiffBlock_module_default = {
|
|
18003
|
-
"add": "
|
|
18004
|
-
"block": "
|
|
18005
|
-
"body": "
|
|
18006
|
-
"copyButton": "
|
|
18007
|
-
"del": "
|
|
18008
|
-
"expand": "
|
|
18009
|
-
"footer": "
|
|
18010
|
-
"gap": "
|
|
18011
|
-
"line": "
|
|
18012
|
-
"path": "
|
|
18003
|
+
"add": "nVxsMW_add",
|
|
18004
|
+
"block": "nVxsMW_block",
|
|
18005
|
+
"body": "nVxsMW_body",
|
|
18006
|
+
"copyButton": "nVxsMW_copyButton",
|
|
18007
|
+
"del": "nVxsMW_del",
|
|
18008
|
+
"expand": "nVxsMW_expand",
|
|
18009
|
+
"footer": "nVxsMW_footer",
|
|
18010
|
+
"gap": "nVxsMW_gap",
|
|
18011
|
+
"line": "nVxsMW_line",
|
|
18012
|
+
"path": "nVxsMW_path"
|
|
18013
18013
|
};
|
|
18014
18014
|
//#endregion
|
|
18015
18015
|
//#region ../../node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.js
|
|
@@ -59244,27 +59244,27 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
59244
59244
|
chunkString: "chunkString"
|
|
59245
59245
|
};
|
|
59246
59246
|
//#endregion
|
|
59247
|
-
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-client-ui-primitives@0.1.
|
|
59247
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-client-ui-primitives@0.1.5-alpha.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/markdown/CodeBlock.module.css
|
|
59248
59248
|
var CodeBlock_module_default = {
|
|
59249
|
-
"action": "
|
|
59250
|
-
"banner": "
|
|
59251
|
-
"bannerWrap": "
|
|
59252
|
-
"block": "
|
|
59253
|
-
"copyButton": "
|
|
59254
|
-
"infostring": "
|
|
59255
|
-
"plain": "
|
|
59256
|
-
"shiki": "
|
|
59249
|
+
"action": "Hbqh2W_action",
|
|
59250
|
+
"banner": "Hbqh2W_banner",
|
|
59251
|
+
"bannerWrap": "Hbqh2W_bannerWrap",
|
|
59252
|
+
"block": "Hbqh2W_block",
|
|
59253
|
+
"copyButton": "Hbqh2W_copyButton",
|
|
59254
|
+
"infostring": "Hbqh2W_infostring",
|
|
59255
|
+
"plain": "Hbqh2W_plain",
|
|
59256
|
+
"shiki": "Hbqh2W_shiki"
|
|
59257
59257
|
};
|
|
59258
59258
|
//#endregion
|
|
59259
|
-
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-client-ui-primitives@0.1.
|
|
59259
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-client-ui-primitives@0.1.5-alpha.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/markdown/MarkdownText.module.css
|
|
59260
59260
|
var MarkdownText_module_default = {
|
|
59261
|
-
"fileMention": "
|
|
59262
|
-
"image": "
|
|
59263
|
-
"imageAlt": "
|
|
59264
|
-
"linkIcon": "
|
|
59265
|
-
"markdown": "
|
|
59266
|
-
"tableFill": "
|
|
59267
|
-
"tableScroll": "
|
|
59261
|
+
"fileMention": "BL43XG_fileMention",
|
|
59262
|
+
"image": "BL43XG_image",
|
|
59263
|
+
"imageAlt": "BL43XG_imageAlt",
|
|
59264
|
+
"linkIcon": "BL43XG_linkIcon",
|
|
59265
|
+
"markdown": "BL43XG_markdown",
|
|
59266
|
+
"tableFill": "BL43XG_tableFill",
|
|
59267
|
+
"tableScroll": "BL43XG_tableScroll"
|
|
59268
59268
|
};
|
|
59269
59269
|
//#endregion
|
|
59270
59270
|
//#region ../../node_modules/.pnpm/@shikijs+langs@4.4.3/node_modules/@shikijs/langs/dist/python.mjs
|
|
@@ -59584,7 +59584,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
59584
59584
|
less_default = [lang];
|
|
59585
59585
|
}));
|
|
59586
59586
|
//#endregion
|
|
59587
|
-
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-client-ui-primitives@0.1.
|
|
59587
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-client-ui-primitives@0.1.5-alpha.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/index.js
|
|
59588
59588
|
init_typescript();
|
|
59589
59589
|
init_shellscript();
|
|
59590
59590
|
init_json();
|
|
@@ -61284,6 +61284,30 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
61284
61284
|
return;
|
|
61285
61285
|
}
|
|
61286
61286
|
}
|
|
61287
|
+
/** Protocols a vocabulary-rewritten image destination may carry. */
|
|
61288
|
+
function vocabularyImageUrl(url) {
|
|
61289
|
+
try {
|
|
61290
|
+
const protocol = new URL(url).protocol;
|
|
61291
|
+
return protocol === "http:" || protocol === "https:" || protocol === "blob:" || protocol === "data:" ? url : void 0;
|
|
61292
|
+
} catch {
|
|
61293
|
+
return;
|
|
61294
|
+
}
|
|
61295
|
+
}
|
|
61296
|
+
/**
|
|
61297
|
+
* The displayable source for one image destination: absolute HTTP(S) as
|
|
61298
|
+
* authored, otherwise the context's local-path vocabulary when it vouches for
|
|
61299
|
+
* the destination. Either miss leaves the authored fallback (alt text) to the
|
|
61300
|
+
* caller.
|
|
61301
|
+
* @param url - The authored markdown destination.
|
|
61302
|
+
* @param pathImages - Rewriting vocabulary, when the render pass has one.
|
|
61303
|
+
* @returns The displayable image URL, or undefined.
|
|
61304
|
+
*/
|
|
61305
|
+
function imageSource(url, pathImages) {
|
|
61306
|
+
const remote = remoteImageUrl(sanitizeUrl(normalizeUri(url)));
|
|
61307
|
+
if (remote !== void 0) return remote;
|
|
61308
|
+
const rewritten = pathImages?.resolve(url);
|
|
61309
|
+
return rewritten === void 0 ? void 0 : vocabularyImageUrl(rewritten);
|
|
61310
|
+
}
|
|
61287
61311
|
/**
|
|
61288
61312
|
* Create an empty {@link ReferenceTargets}.
|
|
61289
61313
|
* @returns Fresh empty maps.
|
|
@@ -61398,7 +61422,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
61398
61422
|
inLink: true
|
|
61399
61423
|
}), key, !anchorWrapsOnlyImages(node.children));
|
|
61400
61424
|
case "linkReference": return renderLinkReference(node, key, context);
|
|
61401
|
-
case "image": return renderImage(node.url, node.alt ?? "", key);
|
|
61425
|
+
case "image": return renderImage(node.url, node.alt ?? "", key, context);
|
|
61402
61426
|
case "imageReference": return renderImageReference(node, key, context);
|
|
61403
61427
|
case "footnoteReference": return renderFootnoteReference(node, key, context);
|
|
61404
61428
|
case "definition":
|
|
@@ -61532,20 +61556,36 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
61532
61556
|
return;
|
|
61533
61557
|
}
|
|
61534
61558
|
}
|
|
61535
|
-
function renderImage(url, alt, key) {
|
|
61536
|
-
const imageSrc =
|
|
61559
|
+
function renderImage(url, alt, key, context) {
|
|
61560
|
+
const imageSrc = imageSource(url, context.pathImages);
|
|
61537
61561
|
if (imageSrc === void 0) return (0, react_jsx_runtime.jsx)("span", {
|
|
61538
61562
|
className: MarkdownText_module_default.imageAlt,
|
|
61539
61563
|
children: alt
|
|
61540
61564
|
}, key);
|
|
61565
|
+
return (0, react_jsx_runtime.jsx)(MarkdownImage, {
|
|
61566
|
+
src: imageSrc,
|
|
61567
|
+
alt,
|
|
61568
|
+
destination: url
|
|
61569
|
+
}, `${key}:${imageSrc}`);
|
|
61570
|
+
}
|
|
61571
|
+
/** Failed loads retain the authored alt or destination; a new source remounts the image. */
|
|
61572
|
+
function MarkdownImage({ src, alt, destination }) {
|
|
61573
|
+
const [failed, setFailed] = (0, react.useState)(false);
|
|
61574
|
+
if (failed) return (0, react_jsx_runtime.jsx)("span", {
|
|
61575
|
+
className: MarkdownText_module_default.imageAlt,
|
|
61576
|
+
children: alt || destination
|
|
61577
|
+
});
|
|
61541
61578
|
return (0, react_jsx_runtime.jsx)("img", {
|
|
61542
61579
|
className: MarkdownText_module_default.image,
|
|
61543
|
-
src
|
|
61580
|
+
src,
|
|
61544
61581
|
alt,
|
|
61582
|
+
onError: () => {
|
|
61583
|
+
setFailed(true);
|
|
61584
|
+
},
|
|
61545
61585
|
loading: "lazy",
|
|
61546
61586
|
decoding: "async",
|
|
61547
61587
|
referrerPolicy: "no-referrer"
|
|
61548
|
-
}
|
|
61588
|
+
});
|
|
61549
61589
|
}
|
|
61550
61590
|
/** The bracketed source text a reference reverts to when its definition is missing. */
|
|
61551
61591
|
function referenceSuffix(node) {
|
|
@@ -61569,7 +61609,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
61569
61609
|
function renderImageReference(node, key, context) {
|
|
61570
61610
|
const definition = context.targets.definitions.get(node.identifier.toUpperCase());
|
|
61571
61611
|
if (definition === void 0) return `![${node.alt ?? ""}${referenceSuffix(node)}`;
|
|
61572
|
-
return renderImage(definition.url, node.alt ?? "", key);
|
|
61612
|
+
return renderImage(definition.url, node.alt ?? "", key, context);
|
|
61573
61613
|
}
|
|
61574
61614
|
function renderFootnoteReference(node, key, context) {
|
|
61575
61615
|
const id = node.identifier.toUpperCase();
|
|
@@ -61630,7 +61670,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
61630
61670
|
* full parse self-heals it.
|
|
61631
61671
|
*/
|
|
61632
61672
|
/** One settled full render: parse with math, resolve references, append the footnote section. */
|
|
61633
|
-
function renderSettled(text, labels, fileMentions) {
|
|
61673
|
+
function renderSettled(text, labels, fileMentions, pathImages) {
|
|
61634
61674
|
const root = parseGfmWithMath(text);
|
|
61635
61675
|
const targets = createReferenceTargets();
|
|
61636
61676
|
collectReferenceTargets(root.children, targets);
|
|
@@ -61638,6 +61678,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
61638
61678
|
streaming: false,
|
|
61639
61679
|
labels,
|
|
61640
61680
|
fileMentions,
|
|
61681
|
+
pathImages,
|
|
61641
61682
|
targets,
|
|
61642
61683
|
footnoteOrder: [],
|
|
61643
61684
|
footnoteCounts: /* @__PURE__ */ new Map()
|
|
@@ -61704,6 +61745,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
61704
61745
|
streaming: true,
|
|
61705
61746
|
labels: this.labels,
|
|
61706
61747
|
fileMentions: void 0,
|
|
61748
|
+
pathImages: void 0,
|
|
61707
61749
|
targets: frameTargets,
|
|
61708
61750
|
footnoteOrder: this.frozenFootnoteOrder,
|
|
61709
61751
|
footnoteCounts: this.frozenFootnoteCounts
|
|
@@ -61720,6 +61762,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
61720
61762
|
streaming: true,
|
|
61721
61763
|
labels: this.labels,
|
|
61722
61764
|
fileMentions: void 0,
|
|
61765
|
+
pathImages: void 0,
|
|
61723
61766
|
targets: frameTargets,
|
|
61724
61767
|
footnoteOrder: [...this.frozenFootnoteOrder],
|
|
61725
61768
|
footnoteCounts: new Map(this.frozenFootnoteCounts)
|
|
@@ -61736,13 +61779,13 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
61736
61779
|
return this.lastRendered;
|
|
61737
61780
|
}
|
|
61738
61781
|
};
|
|
61739
|
-
(0, react.memo)(function MarkdownText({ text, streaming = false, labels, fileMentions }) {
|
|
61782
|
+
(0, react.memo)(function MarkdownText({ text, streaming = false, labels, fileMentions, pathImages }) {
|
|
61740
61783
|
const streamRef = (0, react.useRef)(null);
|
|
61741
61784
|
const streamLabelsRef = (0, react.useRef)(labels);
|
|
61742
61785
|
const children = (0, react.useMemo)(() => {
|
|
61743
61786
|
if (!streaming) {
|
|
61744
61787
|
streamRef.current = null;
|
|
61745
|
-
return renderSettled(text, labels, fileMentions);
|
|
61788
|
+
return renderSettled(text, labels, fileMentions, pathImages);
|
|
61746
61789
|
}
|
|
61747
61790
|
if (streamRef.current === null || streamLabelsRef.current !== labels) {
|
|
61748
61791
|
streamRef.current = new StreamingRenderer(labels);
|
|
@@ -61753,7 +61796,8 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
61753
61796
|
text,
|
|
61754
61797
|
streaming,
|
|
61755
61798
|
labels,
|
|
61756
|
-
fileMentions
|
|
61799
|
+
fileMentions,
|
|
61800
|
+
pathImages
|
|
61757
61801
|
]);
|
|
61758
61802
|
return (0, react_jsx_runtime.jsx)("div", {
|
|
61759
61803
|
className: MarkdownText_module_default.markdown,
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import z from "@deepseek-ai/schemastery";
|
|
2
|
-
import { dshHomePath } from "@deepseek-ai/dsh-home-paths";
|
|
3
2
|
import { launchEnvironmentOf } from "@deepseek-ai/dsh-launch-environment";
|
|
4
3
|
import { deepEqualJson } from "@deepseek-ai/dsh-util-values";
|
|
4
|
+
import { pluginDataPath } from "@dsh-plus/shared";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, realpathSync, renameSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { request } from "node:http";
|
|
7
7
|
import { request as request$1 } from "node:https";
|
|
@@ -255,7 +255,7 @@ function registerCatalogApi(ctx, runtime) {
|
|
|
255
255
|
* - 配置 catalogRefreshHours > 0:启动/过期后后台自动刷新;
|
|
256
256
|
* - 配置卡片「手动拉取」或 POST /catalog/refresh:立即拉取。
|
|
257
257
|
* 拉取可经 catalogProxy 代理(HTTP 代理,如 http://127.0.0.1:7890)。
|
|
258
|
-
*
|
|
258
|
+
* 成功落盘缓存($DSH_HOME/dsh-plus/llm-pi/models-dev.json);任何失败都退化为
|
|
259
259
|
* "仅内置目录",绝不阻塞 route 注册。
|
|
260
260
|
*
|
|
261
261
|
* 保守原则:models.dev 数据未经 pi 官方校正(无 compat/thinkingLevelMap),
|
|
@@ -1918,7 +1918,7 @@ async function startRuntime(ctx, rawConfig) {
|
|
|
1918
1918
|
const { kit, diagnostics } = await resolveDshKit();
|
|
1919
1919
|
for (const line of diagnostics) logger.warn(line);
|
|
1920
1920
|
logger.info(`运行时套件来源:${kit.source}`);
|
|
1921
|
-
const modelsDev = new ModelsDevSource(
|
|
1921
|
+
const modelsDev = new ModelsDevSource(pluginDataPath("llm-pi", "models-dev.json"), config.catalogUrl, config.catalogRefreshHours, (message) => logger.warn(message), config.catalogProxy ?? "");
|
|
1922
1922
|
modelsDev.ensureLoaded();
|
|
1923
1923
|
let current = () => config;
|
|
1924
1924
|
let lastRaw;
|
package/lib/style.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
1
|
+
.nVxsMW_block {
|
|
2
2
|
--dsl-diff-radius: 12px;
|
|
3
3
|
--dsl-diff-line-height: 22px;
|
|
4
4
|
color: var(--dsw-alias-label-primary);
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
position: relative;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.
|
|
11
|
+
.nVxsMW_copyButton {
|
|
12
12
|
z-index: 1;
|
|
13
13
|
color: var(--dsw-alias-label-secondary);
|
|
14
14
|
cursor: pointer;
|
|
@@ -22,46 +22,46 @@
|
|
|
22
22
|
right: 12px;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
.
|
|
25
|
+
.nVxsMW_body {
|
|
26
26
|
font: var(--dsw-font-markdown-code-block);
|
|
27
27
|
padding: 12px 14px;
|
|
28
28
|
overflow: auto hidden;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.
|
|
31
|
+
.nVxsMW_line {
|
|
32
32
|
min-height: var(--dsl-diff-line-height);
|
|
33
33
|
white-space: pre;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
.
|
|
36
|
+
.nVxsMW_path {
|
|
37
37
|
color: var(--dsw-alias-label-primary);
|
|
38
38
|
padding-right: 56px;
|
|
39
39
|
font-weight: 600;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.
|
|
42
|
+
.nVxsMW_gap {
|
|
43
43
|
color: var(--dsw-alias-label-tertiary);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.
|
|
46
|
+
.nVxsMW_del:before {
|
|
47
47
|
content: "- ";
|
|
48
48
|
color: var(--dsw-alias-state-error-primary);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
.
|
|
51
|
+
.nVxsMW_del {
|
|
52
52
|
color: var(--dsw-alias-state-error-primary);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.
|
|
55
|
+
.nVxsMW_add:before {
|
|
56
56
|
content: "+ ";
|
|
57
57
|
color: var(--dsw-alias-state-success-primary);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
.
|
|
60
|
+
.nVxsMW_add {
|
|
61
61
|
color: var(--dsw-alias-state-success-primary);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
.
|
|
64
|
+
.nVxsMW_expand {
|
|
65
65
|
width: 100%;
|
|
66
66
|
color: var(--dsw-alias-label-tertiary);
|
|
67
67
|
cursor: pointer;
|
|
@@ -73,16 +73,16 @@
|
|
|
73
73
|
display: block;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
.
|
|
76
|
+
.nVxsMW_expand:hover {
|
|
77
77
|
color: var(--dsw-alias-label-secondary);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
.
|
|
80
|
+
.nVxsMW_footer {
|
|
81
81
|
font: var(--dsw-font-markdown-code-block);
|
|
82
82
|
color: var(--dsw-alias-label-tertiary);
|
|
83
83
|
padding: 0 14px 12px;
|
|
84
84
|
}
|
|
85
|
-
.
|
|
85
|
+
.Hbqh2W_block {
|
|
86
86
|
--dsl-code-block-banner-background-color: var(--dsw-alias-markdown-code-block-banner);
|
|
87
87
|
--dsl-code-block-border-radius: 12px;
|
|
88
88
|
--dsl-code-block-banner-font: 11px/18px var(--dsw-font-family);
|
|
@@ -94,11 +94,11 @@
|
|
|
94
94
|
position: relative;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
.
|
|
97
|
+
.Hbqh2W_block:not(:last-child) {
|
|
98
98
|
margin-bottom: 11px;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
.
|
|
101
|
+
.Hbqh2W_bannerWrap {
|
|
102
102
|
z-index: 6;
|
|
103
103
|
background-color: var(--dsw-alias-bg-base);
|
|
104
104
|
border-top-left-radius: var(--dsl-code-block-border-radius);
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
top: 0;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
.
|
|
110
|
+
.Hbqh2W_banner {
|
|
111
111
|
background: var(--dsl-code-block-banner-background-color);
|
|
112
112
|
font: var(--dsl-code-block-banner-font);
|
|
113
113
|
border-top-left-radius: var(--dsl-code-block-border-radius);
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
display: flex;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
.
|
|
122
|
+
.Hbqh2W_infostring {
|
|
123
123
|
color: var(--dsw-alias-label-primary);
|
|
124
124
|
font-family: var(--ds-font-family-code);
|
|
125
125
|
text-overflow: ellipsis;
|
|
@@ -130,13 +130,13 @@
|
|
|
130
130
|
overflow: hidden;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
.
|
|
133
|
+
.Hbqh2W_action {
|
|
134
134
|
flex-shrink: 0;
|
|
135
135
|
align-items: center;
|
|
136
136
|
display: flex;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
.
|
|
139
|
+
.Hbqh2W_copyButton {
|
|
140
140
|
color: inherit;
|
|
141
141
|
cursor: pointer;
|
|
142
142
|
font: inherit;
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
padding: 0;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
.
|
|
149
|
+
.Hbqh2W_block :where(pre) {
|
|
150
150
|
font: var(--dsl-code-block-content-font);
|
|
151
151
|
white-space: pre-wrap;
|
|
152
152
|
word-break: break-all;
|
|
@@ -158,72 +158,72 @@
|
|
|
158
158
|
margin: 0 !important;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
.
|
|
161
|
+
.Hbqh2W_block :where(pre.Hbqh2W_shiki) {
|
|
162
162
|
background: var(--dsw-alias-markdown-code-block) !important;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
.
|
|
165
|
+
.Hbqh2W_block :where(pre) code {
|
|
166
166
|
font: inherit;
|
|
167
167
|
background: none;
|
|
168
168
|
padding: 0;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
.
|
|
171
|
+
.Hbqh2W_plain {
|
|
172
172
|
color: var(--dsw-alias-label-primary);
|
|
173
173
|
}
|
|
174
|
-
.
|
|
174
|
+
.BL43XG_markdown {
|
|
175
175
|
overflow-wrap: anywhere;
|
|
176
176
|
min-width: 0;
|
|
177
177
|
font: var(--dsw-font-markdown-base);
|
|
178
178
|
color: var(--dsw-alias-label-primary);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
.
|
|
181
|
+
.BL43XG_markdown strong {
|
|
182
182
|
font-weight: 600;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
.
|
|
185
|
+
.BL43XG_markdown h1 {
|
|
186
186
|
font: var(--dsw-font-markdown-h1);
|
|
187
187
|
margin: 32px 0 16px;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
.
|
|
190
|
+
.BL43XG_markdown h2 {
|
|
191
191
|
font: var(--dsw-font-markdown-h2);
|
|
192
192
|
margin: 32px 0 16px;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
.
|
|
195
|
+
.BL43XG_markdown h3 {
|
|
196
196
|
font: var(--dsw-font-markdown-h3);
|
|
197
197
|
margin: 32px 0 16px;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
.
|
|
200
|
+
.BL43XG_markdown h4 {
|
|
201
201
|
font: var(--dsw-font-markdown-h4);
|
|
202
202
|
margin: 16px 0;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
.
|
|
205
|
+
.BL43XG_markdown :where(h5, h6) {
|
|
206
206
|
font: var(--dsw-font-markdown-base-strong);
|
|
207
207
|
margin: 16px 0;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
.
|
|
210
|
+
.BL43XG_markdown :where(h1, h2, h3, h4, h5, h6) strong {
|
|
211
211
|
font-weight: inherit;
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
.
|
|
214
|
+
.BL43XG_markdown p {
|
|
215
215
|
margin: 16px 0;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
.
|
|
218
|
+
.BL43XG_markdown :where(h4, h5, h6) + :where(ul, ol) {
|
|
219
219
|
margin-top: 8px;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
.
|
|
222
|
+
.BL43XG_markdown :where(h4, h5, h6):has( + :where(ul, ol)) {
|
|
223
223
|
margin-bottom: 8px;
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
.
|
|
226
|
+
.BL43XG_markdown a {
|
|
227
227
|
color: var(--dsw-alias-link);
|
|
228
228
|
transition: box-shadow var(--ds-transition-duration) var(--ds-ease-in-out);
|
|
229
229
|
border: 2px solid #fff0;
|
|
@@ -235,17 +235,17 @@
|
|
|
235
235
|
position: relative;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
.
|
|
238
|
+
.BL43XG_markdown a:hover, .BL43XG_markdown a:focus {
|
|
239
239
|
text-decoration: underline dotted var(--dsw-alias-link);
|
|
240
240
|
text-underline-offset: 3px;
|
|
241
241
|
outline: none;
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
.
|
|
244
|
+
.BL43XG_markdown a:focus-visible {
|
|
245
245
|
box-shadow: 0 0 0 2px var(--dsw-alias-state-business-primary);
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
.
|
|
248
|
+
.BL43XG_linkIcon {
|
|
249
249
|
vertical-align: -.25em;
|
|
250
250
|
flex: none;
|
|
251
251
|
width: 1.1em;
|
|
@@ -253,46 +253,46 @@
|
|
|
253
253
|
margin-right: 5px;
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
.
|
|
256
|
+
.BL43XG_markdown :where(ul, ol) {
|
|
257
257
|
margin: 16px 0;
|
|
258
258
|
padding-left: 18px;
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
.
|
|
261
|
+
.BL43XG_markdown li:not(:first-child) {
|
|
262
262
|
margin-top: 6px;
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
.
|
|
265
|
+
.BL43XG_markdown li > :where(ul, ol) {
|
|
266
266
|
margin-top: 4px;
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
.
|
|
269
|
+
.BL43XG_markdown li::marker {
|
|
270
270
|
color: var(--dsw-alias-label-secondary);
|
|
271
271
|
line-height: 24px;
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
.
|
|
274
|
+
.BL43XG_markdown :where(ul, ol) ol {
|
|
275
275
|
padding-left: 0;
|
|
276
276
|
list-style-position: inside;
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
-
.
|
|
279
|
+
.BL43XG_markdown :where(ul, ol) ol li p {
|
|
280
280
|
display: inline;
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
.
|
|
283
|
+
.BL43XG_markdown li > p {
|
|
284
284
|
margin: 8px 0;
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
.
|
|
287
|
+
.BL43XG_markdown li > :first-child {
|
|
288
288
|
margin-top: 0;
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
.
|
|
291
|
+
.BL43XG_markdown li > :last-child:not(.md-code-block) {
|
|
292
292
|
margin-bottom: 0;
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
.
|
|
295
|
+
.BL43XG_markdown hr {
|
|
296
296
|
background: var(--dsw-alias-border-l2);
|
|
297
297
|
border: none;
|
|
298
298
|
height: .5px;
|
|
@@ -300,19 +300,19 @@
|
|
|
300
300
|
display: block;
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
.
|
|
303
|
+
.BL43XG_markdown blockquote {
|
|
304
304
|
border-left: 2px solid var(--dsw-alias-label-caption);
|
|
305
305
|
margin: 16px 0 0;
|
|
306
306
|
padding-left: 14px;
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
.
|
|
309
|
+
.BL43XG_markdown pre {
|
|
310
310
|
font-family: var(--ds-font-family-code);
|
|
311
311
|
margin: 16px 0;
|
|
312
312
|
overflow: auto;
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
-
.
|
|
315
|
+
.BL43XG_markdown :not(pre) > code {
|
|
316
316
|
box-sizing: border-box;
|
|
317
317
|
font: var(--dsw-font-markdown-code);
|
|
318
318
|
font-family: var(--ds-font-family-code);
|
|
@@ -325,54 +325,54 @@
|
|
|
325
325
|
font-size: .875em !important;
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
.
|
|
328
|
+
.BL43XG_markdown :where(h1, h2, h3, h4, h5, h6) code {
|
|
329
329
|
font: inherit;
|
|
330
330
|
font-family: var(--ds-font-family-code);
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
.
|
|
333
|
+
.BL43XG_markdown .katex-display {
|
|
334
334
|
max-width: 100%;
|
|
335
335
|
overflow: auto hidden;
|
|
336
336
|
}
|
|
337
337
|
|
|
338
|
-
.
|
|
338
|
+
.BL43XG_markdown input[type="checkbox"] {
|
|
339
339
|
accent-color: var(--dsw-alias-label-secondary);
|
|
340
340
|
margin: 0 8px 0 0;
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
-
.
|
|
343
|
+
.BL43XG_tableScroll {
|
|
344
344
|
overscroll-behavior-x: contain;
|
|
345
345
|
max-width: 100%;
|
|
346
346
|
overflow-x: auto;
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
-
.
|
|
349
|
+
.BL43XG_tableScroll.md-table-wide {
|
|
350
350
|
padding-bottom: var(--dsh-scrollbar-width, 8px);
|
|
351
351
|
overflow-x: hidden;
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
-
.
|
|
354
|
+
.BL43XG_tableScroll.md-table-wide:hover, .BL43XG_tableScroll.md-table-wide:focus-visible {
|
|
355
355
|
padding-bottom: 0;
|
|
356
356
|
overflow-x: auto;
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
.
|
|
359
|
+
.BL43XG_tableScroll:focus-visible {
|
|
360
360
|
box-shadow: 0 0 0 2px var(--dsw-alias-state-business-primary);
|
|
361
361
|
outline: none;
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
.
|
|
364
|
+
.BL43XG_tableScroll table {
|
|
365
365
|
border-collapse: collapse;
|
|
366
366
|
width: max-content;
|
|
367
367
|
max-width: max-content;
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
-
.
|
|
370
|
+
.BL43XG_tableFill table {
|
|
371
371
|
width: 100%;
|
|
372
372
|
max-width: none;
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
-
.
|
|
375
|
+
.BL43XG_tableScroll th {
|
|
376
376
|
text-align: start;
|
|
377
377
|
border-bottom: .5px solid var(--dsw-alias-border-l3);
|
|
378
378
|
font: var(--dsw-font-markdown-table-head);
|
|
@@ -382,7 +382,7 @@
|
|
|
382
382
|
padding: 10px 16px;
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
.
|
|
385
|
+
.BL43XG_tableScroll td {
|
|
386
386
|
border-bottom: .5px solid var(--dsw-alias-border-l2);
|
|
387
387
|
font: var(--dsw-font-markdown-table);
|
|
388
388
|
min-width: 100px;
|
|
@@ -390,32 +390,32 @@
|
|
|
390
390
|
padding: 10px 16px;
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
-
.
|
|
393
|
+
.BL43XG_tableScroll th:first-child, .BL43XG_tableScroll td:first-child {
|
|
394
394
|
padding-left: 0;
|
|
395
395
|
}
|
|
396
396
|
|
|
397
|
-
.
|
|
397
|
+
.BL43XG_tableScroll td:last-child {
|
|
398
398
|
padding-right: 0;
|
|
399
399
|
}
|
|
400
400
|
|
|
401
|
-
.
|
|
401
|
+
.BL43XG_tableScroll table code {
|
|
402
402
|
font-size: 11px;
|
|
403
403
|
}
|
|
404
404
|
|
|
405
|
-
.
|
|
405
|
+
.BL43XG_markdown > :first-child, .BL43XG_markdown p:first-child {
|
|
406
406
|
margin-top: 0 !important;
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
-
.
|
|
409
|
+
.BL43XG_markdown > :last-child, .BL43XG_markdown p:last-child {
|
|
410
410
|
margin-bottom: 0 !important;
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
.
|
|
413
|
+
.BL43XG_imageAlt {
|
|
414
414
|
color: var(--dsw-alias-label-tertiary);
|
|
415
415
|
font-style: italic;
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
-
.
|
|
418
|
+
.BL43XG_image {
|
|
419
419
|
background: var(--dsw-alias-bg-base);
|
|
420
420
|
object-fit: contain;
|
|
421
421
|
border-radius: 8px;
|
|
@@ -426,7 +426,7 @@
|
|
|
426
426
|
display: block;
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
-
.
|
|
429
|
+
.BL43XG_fileMention {
|
|
430
430
|
font: inherit;
|
|
431
431
|
color: var(--dsw-alias-link);
|
|
432
432
|
cursor: pointer;
|
|
@@ -438,7 +438,7 @@
|
|
|
438
438
|
text-decoration: none;
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
-
.
|
|
441
|
+
.BL43XG_fileMention:hover, .BL43XG_fileMention:focus {
|
|
442
442
|
text-decoration: underline dotted var(--dsw-alias-link);
|
|
443
443
|
text-underline-offset: 3px;
|
|
444
444
|
outline: none;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-plus/llm-pi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"description": "dsh-plus service+ui plugin: 基于 PiAiAdapter 的自定义 LLM 路由(全量 compat、模型继承、models.dev 目录兜底)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -32,40 +32,40 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"https-proxy-agent": "^9.1.0",
|
|
35
|
-
"@dsh-plus/shared": "0.1.
|
|
35
|
+
"@dsh-plus/shared": "0.1.11"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
39
|
-
"@deepseek-ai/dsh-anonymous-user-id": "
|
|
40
|
-
"@deepseek-ai/dsh-credentials": "
|
|
41
|
-
"@deepseek-ai/dsh-home-paths": "
|
|
42
|
-
"@deepseek-ai/dsh-host-webserver": "
|
|
43
|
-
"@deepseek-ai/dsh-launch-environment": "
|
|
44
|
-
"@deepseek-ai/dsh-llm": "
|
|
45
|
-
"@deepseek-ai/dsh-llm-deepseek": "
|
|
46
|
-
"@deepseek-ai/dsh-llm-pi-ai": "
|
|
47
|
-
"@deepseek-ai/dsh-settings": "
|
|
48
|
-
"@deepseek-ai/dsh-util-values": "
|
|
49
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
38
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
39
|
+
"@deepseek-ai/dsh-anonymous-user-id": "*",
|
|
40
|
+
"@deepseek-ai/dsh-credentials": "*",
|
|
41
|
+
"@deepseek-ai/dsh-home-paths": "*",
|
|
42
|
+
"@deepseek-ai/dsh-host-webserver": "*",
|
|
43
|
+
"@deepseek-ai/dsh-launch-environment": "*",
|
|
44
|
+
"@deepseek-ai/dsh-llm": "*",
|
|
45
|
+
"@deepseek-ai/dsh-llm-deepseek": "*",
|
|
46
|
+
"@deepseek-ai/dsh-llm-pi-ai": "*",
|
|
47
|
+
"@deepseek-ai/dsh-settings": "*",
|
|
48
|
+
"@deepseek-ai/dsh-util-values": "*",
|
|
49
|
+
"@deepseek-ai/schemastery": "^3.18.2",
|
|
50
50
|
"@earendil-works/pi-ai": "^0.84.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@deepseek-ai/cordis": "4.0.2",
|
|
54
|
-
"@deepseek-ai/dsh-anonymous-user-id": "0.1.
|
|
55
|
-
"@deepseek-ai/dsh-atomic-write": "0.1.
|
|
56
|
-
"@deepseek-ai/dsh-attachment": "0.1.
|
|
57
|
-
"@deepseek-ai/dsh-credentials": "0.1.
|
|
58
|
-
"@deepseek-ai/dsh-home-paths": "0.1.
|
|
59
|
-
"@deepseek-ai/dsh-host-webserver": "0.1.
|
|
60
|
-
"@deepseek-ai/dsh-launch-environment": "0.1.
|
|
61
|
-
"@deepseek-ai/dsh-llm": "0.1.
|
|
62
|
-
"@deepseek-ai/dsh-llm-deepseek": "0.1.
|
|
63
|
-
"@deepseek-ai/dsh-llm-pi-ai": "0.1.
|
|
64
|
-
"@deepseek-ai/dsh-settings": "0.1.
|
|
65
|
-
"@deepseek-ai/dsh-timeout": "0.1.
|
|
66
|
-
"@deepseek-ai/dsh-typert-protocol": "0.1.
|
|
67
|
-
"@deepseek-ai/dsh-util-crypto": "0.1.
|
|
68
|
-
"@deepseek-ai/dsh-util-values": "0.1.
|
|
54
|
+
"@deepseek-ai/dsh-anonymous-user-id": "0.1.5-alpha.1",
|
|
55
|
+
"@deepseek-ai/dsh-atomic-write": "0.1.5-alpha.1",
|
|
56
|
+
"@deepseek-ai/dsh-attachment": "0.1.5-alpha.1",
|
|
57
|
+
"@deepseek-ai/dsh-credentials": "0.1.5-alpha.1",
|
|
58
|
+
"@deepseek-ai/dsh-home-paths": "0.1.5-alpha.1",
|
|
59
|
+
"@deepseek-ai/dsh-host-webserver": "0.1.5-alpha.1",
|
|
60
|
+
"@deepseek-ai/dsh-launch-environment": "0.1.5-alpha.1",
|
|
61
|
+
"@deepseek-ai/dsh-llm": "0.1.5-alpha.1",
|
|
62
|
+
"@deepseek-ai/dsh-llm-deepseek": "0.1.5-alpha.1",
|
|
63
|
+
"@deepseek-ai/dsh-llm-pi-ai": "0.1.5-alpha.1",
|
|
64
|
+
"@deepseek-ai/dsh-settings": "0.1.5-alpha.1",
|
|
65
|
+
"@deepseek-ai/dsh-timeout": "0.1.5-alpha.1",
|
|
66
|
+
"@deepseek-ai/dsh-typert-protocol": "0.1.5-alpha.1",
|
|
67
|
+
"@deepseek-ai/dsh-util-crypto": "0.1.5-alpha.1",
|
|
68
|
+
"@deepseek-ai/dsh-util-values": "0.1.5-alpha.1",
|
|
69
69
|
"@deepseek-ai/schemastery": "3.18.2",
|
|
70
70
|
"@earendil-works/pi-ai": "0.84.4",
|
|
71
71
|
"@types/react": "~18.3.31",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - 配置 catalogRefreshHours > 0:启动/过期后后台自动刷新;
|
|
8
8
|
* - 配置卡片「手动拉取」或 POST /catalog/refresh:立即拉取。
|
|
9
9
|
* 拉取可经 catalogProxy 代理(HTTP 代理,如 http://127.0.0.1:7890)。
|
|
10
|
-
*
|
|
10
|
+
* 成功落盘缓存($DSH_HOME/dsh-plus/llm-pi/models-dev.json);任何失败都退化为
|
|
11
11
|
* "仅内置目录",绝不阻塞 route 注册。
|
|
12
12
|
*
|
|
13
13
|
* 保守原则:models.dev 数据未经 pi 官方校正(无 compat/thinkingLevelMap),
|
package/src/service.ts
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { Context } from '@deepseek-ai/cordis'
|
|
13
13
|
import type { CredentialRef } from '@deepseek-ai/dsh-credentials'
|
|
14
|
-
import { dshHomePath } from '@deepseek-ai/dsh-home-paths'
|
|
15
14
|
import { launchEnvironmentOf } from '@deepseek-ai/dsh-launch-environment'
|
|
16
15
|
import type { ResolvedPiAiProviderProfile } from '@deepseek-ai/dsh-llm-pi-ai'
|
|
17
16
|
import type {} from '@deepseek-ai/dsh-settings'
|
|
18
17
|
import { deepEqualJson } from '@deepseek-ai/dsh-util-values'
|
|
18
|
+
import { pluginDataPath } from '@dsh-plus/shared'
|
|
19
19
|
|
|
20
20
|
import { ModelsDevSource } from './catalog/models-dev.ts'
|
|
21
21
|
import { Config, type LlmPiConfig, SETTINGS_NS } from './config.ts'
|
|
@@ -81,7 +81,7 @@ export async function startRuntime(ctx: Context, rawConfig: LlmPiConfig): Promis
|
|
|
81
81
|
logger.info(`运行时套件来源:${kit.source}`)
|
|
82
82
|
|
|
83
83
|
const modelsDev = new ModelsDevSource(
|
|
84
|
-
|
|
84
|
+
pluginDataPath('llm-pi', 'models-dev.json'),
|
|
85
85
|
config.catalogUrl,
|
|
86
86
|
config.catalogRefreshHours,
|
|
87
87
|
(message) => logger.warn(message),
|