dsh-plugin-core-demo 0.35.14 → 0.35.16
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/dist/client.js +120 -24
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -4295,7 +4295,10 @@ function OverlayHead(props) {
|
|
|
4295
4295
|
|
|
4296
4296
|
// dist/ui/inputs/picker-css.generated.js
|
|
4297
4297
|
var PICKER_CSS = `
|
|
4298
|
-
|
|
4298
|
+
/* min-width:0 \u662F\u7ED9\u300C\u4F5C\u4E3A flex item\u300D\u51C6\u5907\u7684\uFF1A\u9ED8\u8BA4 min-width:auto \u4F1A\u88AB\u9009\u4E2D\u6587\u672C\u7684 min-content
|
|
4299
|
+
\u6491\u4F4F\uFF0C\u957F\u6A21\u578B\u540D\u5C31\u628A\u540C\u4E00\u884C\u7684\u5176\u5B83\u63A7\u4EF6\u5F80\u5DE6\u9876\uFF082026-11-10 \u7528\u6237\u771F\u673A\u622A\u56FE\uFF1A\u4E09\u4E2A\u8F93\u5165\u6846\u6574\u4F53\u5DE6\u79FB\uFF09\u3002
|
|
4300
|
+
\u7ED9 0 \u540E\u53EF\u6536\u7F29\uFF0C\u6587\u5B57\u7531 __label \u7684\u7701\u7565\u53F7\u63A5\u4F4F\u3002 */
|
|
4301
|
+
.dshpc-picker{position:relative;display:inline-block;max-width:100%;min-width:0;font-size:13px;line-height:20px}
|
|
4299
4302
|
.dshpc-picker__trigger{
|
|
4300
4303
|
display:inline-flex;align-items:center;justify-content:space-between;gap:6px;
|
|
4301
4304
|
min-width:120px;max-width:100%;height:28px;padding:0 8px;
|
|
@@ -4339,28 +4342,43 @@ var PICKER_CSS = `
|
|
|
4339
4342
|
.dshpc-picker__group-label{
|
|
4340
4343
|
padding:6px 8px 2px;color:var(--dshpc-fg-3);font-size:11px;
|
|
4341
4344
|
}
|
|
4345
|
+
/* \u5706\u89D2\u53EA\u8DDF\u5168\u7AD9\u300C\u6846 / \u884C\u300D\u90A3\u4E00\u6863\u8D70\uFF1A--dshpc-radius-md\u3002
|
|
4346
|
+
\u771F\u6E90\u662F Surface\uFF08surface.css:4-5\u300C\u5BB9\u5668\u6863 = --dshpc-radius-md\uFF0C\u4E0E Button / Input \u540C\u6863\u300D\uFF09\uFF0CListRow \u7684\u884C
|
|
4347
|
+
\u5706\u89D2\u4E5F\u662F\u4ECE Surface \u7EE7\u627F\u7684 \u2014\u2014 \u6240\u4EE5\u8FD9\u91CC\u4E0D\u80FD\u81EA\u5DF1\u6311 xs/sm \u4E4B\u7C7B\u66F4\u5C0F\u7684\u6863\u30022026-11-10 \u7528\u6237\u771F\u673A\u622A\u56FE\uFF1A
|
|
4348
|
+
\u641C\u7D22\u6846\uFF08md\uFF09\u4E0E\u88AB\u9009\u4E2D\u7684\u84DD\u884C\uFF08xs\uFF09\u5706\u89D2\u660E\u663E\u4E0D\u9F50\uFF0C\u540C\u5728\u4E00\u4E2A\u9762\u677F\u91CC\u50CF\u4E24\u5957\u63A7\u4EF6\u3002
|
|
4349
|
+
\u5927\u5706\u89D2\u4ECD\u7136\u53EA\u5F52\u5916\u5C42\u83DC\u5355\uFF08panel.css \u7684 menu \u6863 + overflow:hidden\uFF09\u3002 */
|
|
4342
4350
|
.dshpc-picker__option{
|
|
4343
|
-
display:flex;align-items:center;gap:6px;padding:6px 8px;border-radius:var(--dshpc-radius-
|
|
4351
|
+
display:flex;align-items:center;gap:6px;padding:6px 8px;border-radius:var(--dshpc-radius-md);cursor:pointer;
|
|
4344
4352
|
color:var(--dshpc-fg);white-space:nowrap;
|
|
4345
4353
|
}
|
|
4346
|
-
|
|
4347
|
-
|
|
4354
|
+
/* \u884C\u4E0E\u884C\u4E4B\u95F4\u7559\u4E00\u6863\u95F4\u8DDD\uFF084px\uFF09\uFF1Amd \u5706\u89D2\u7684\u4E24\u884C\u5E95\u8272\u76F4\u63A5\u76F8\u63A5\u4F1A\u8FDE\u6210\u4E00\u6839\u80F6\u56CA\uFF0C\u591A\u9009\u8FDE\u9009\u4E24\u9879\u65F6
|
|
4355
|
+
\u770B\u4E0D\u51FA\u662F\u4E24\u6761\uFF082026-11-10 \u7528\u6237\u622A\u56FE\uFF09\u3002\u53EA\u7528\u95F4\u8DDD\u56DB\u62CD\u91CC\u6700\u5C0F\u6863\uFF0C\u4E0D\u5199\u9B54\u6CD5\u6570\u3002 */
|
|
4356
|
+
.dshpc-picker__option + .dshpc-picker__option{margin-top:var(--dshpc-space-1)}
|
|
4357
|
+
/* hover / \u9009\u4E2D\u76F4\u63A5\u501F ListRow \u7684\u4E24\u6761 token \u2014\u2014 \u540C\u4E00\u4E2A\u300C\u884C\u300D\u8BED\u4E49\uFF0C\u4E0E\u5217\u8868\u6761\u76EE\u5BF9\u9F50\u3002
|
|
4358
|
+
\u9009\u4E2D\u4E0D\u67D3\u6587\u5B57\u8272\uFF1A\u84DD\u5B57\u662F\u300C\u94FE\u63A5\u300D\u8BED\u4E49\uFF0C\u884C\u9009\u4E2D\u53EA\u6362\u5E95\uFF08list-row.css:44-47 \u7684\u53E3\u5F84\uFF09\u3002
|
|
4359
|
+
2026-11-10 \u7528\u6237\uFF1A\u539F\u6765\u84DD\u5E95\u84DD\u5B57 + \u4EAE\u4E00\u70B9\u7684\u7070\uFF0C\u548C ListRow \u5B8C\u5168\u4E0D\u662F\u4E00\u5957\u3002 */
|
|
4360
|
+
.dshpc-picker__option:hover{background:var(--dshpc-listrow-hover-bg)}
|
|
4361
|
+
.dshpc-picker__option--active{background:var(--dshpc-listrow-selected-bg);color:var(--dshpc-fg)}
|
|
4348
4362
|
.dshpc-picker__option--disabled{color:var(--dshpc-fg-dim);cursor:not-allowed}
|
|
4349
4363
|
/* \u9009\u9879\u6587\u5B57\u5403\u6389\u5269\u4F59\u5BBD\u5EA6\uFF1A\u8D85\u957F\u7701\u7565\u53F7\uFF08\u914D\u5408 MarqueeText hover \u8DD1\u9A6C\u706F\uFF09\uFF0C\u4E0D\u6491\u5BBD\u83DC\u5355\u3002 */
|
|
4350
4364
|
.dshpc-picker__option-label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
4351
4365
|
.dshpc-picker__tick{width:12px;color:var(--dshpc-business)}
|
|
4352
4366
|
.dshpc-picker__empty{padding:8px;color:var(--dshpc-fg-3);text-align:center}
|
|
4367
|
+
/* \u63D0\u793A\u6761\uFF08\u5019\u9009\u4E0D\u5B8C\u6574 / \u5DF2\u5230\u4E0A\u9650\uFF09\u4E0E\u5217\u8868\u884C\u540C\u4E00\u5957\u300C\u5757\u300D\uFF1Amd \u5706\u89D2 + \u884C\u5185\u8DDD\uFF0C\u5DE6\u53F3\u5BF9\u9F50\u641C\u7D22\u6846\u4E0E\u9009\u9879
|
|
4368
|
+
\uFF08\u4E0D\u518D\u9760\u8D1F margin \u4F38\u5230\u83DC\u5355\u5185\u58C1\uFF09\uFF0C\u53EA\u662F\u914D\u8272\u6362\u6210\u63D0\u793A\u9EC4\u30022026-11-10 \u7528\u6237\uFF1A\u90A3\u6761\u901A\u680F\u592A\u96BE\u770B\u4E86\uFF0C
|
|
4369
|
+
\u8981\u505A\u6210\u4E0B\u9762\u9009\u4E2D\u884C\u90A3\u79CD\u6846\u3001\u7528\u63D0\u793A\u8272\u3002 */
|
|
4353
4370
|
.dshpc-picker__degraded{
|
|
4354
|
-
padding:6px 8px;margin
|
|
4371
|
+
padding:6px 8px;margin:0 0 4px;border-radius:var(--dshpc-radius-md);
|
|
4355
4372
|
color:var(--dshpc-warning-label);background:color-mix(in srgb,var(--dshpc-warning) 12%,transparent);
|
|
4356
4373
|
font-size:11px;
|
|
4357
4374
|
}
|
|
4358
4375
|
.dshpc-picker__row{display:flex;align-items:center;gap:8px}
|
|
4359
|
-
/* \u300C\u663E\u793A\u66F4\u591A\u300D\u8DDF\u5728\u6700\u540E\u4E00\u6761\u540E\u9762\u3001\u957F\u5F97\u50CF\u591A\u4E00\u6761\u9009\u9879\uFF082026-11-06 \u7528\u6237\uFF1A\u7FFB\u5230\u5E95\u53D1\u73B0\u4E0D\u5168\u624D\u4F1A\u627E\u5B83\uFF09\u3002
|
|
4376
|
+
/* \u300C\u663E\u793A\u66F4\u591A\u300D\u8DDF\u5728\u6700\u540E\u4E00\u6761\u540E\u9762\u3001\u957F\u5F97\u50CF\u591A\u4E00\u6761\u9009\u9879\uFF082026-11-06 \u7528\u6237\uFF1A\u7FFB\u5230\u5E95\u53D1\u73B0\u4E0D\u5168\u624D\u4F1A\u627E\u5B83\uFF09\u3002
|
|
4377
|
+
\u5706\u89D2\u540C\u6837\u8D70 md\uFF1A\u5B83\u89C6\u89C9\u4E0A\u5C31\u662F\u5217\u8868\u91CC\u591A\u51FA\u6765\u7684\u4E00\u884C\uFF0C\u6863\u4F4D\u4E0E\u9009\u9879\u4E00\u81F4\uFF0C\u522B\u518D\u5355\u72EC\u6311\u4E00\u4E2A\u3002 */
|
|
4360
4378
|
.dshpc-picker__more{
|
|
4361
|
-
display:block;width:100%;margin-top:
|
|
4379
|
+
display:block;width:100%;margin-top:var(--dshpc-space-1);padding:6px 8px;
|
|
4362
4380
|
color:var(--dshpc-business);background:none;
|
|
4363
|
-
border:0;border-radius:var(--dshpc-radius-
|
|
4381
|
+
border:0;border-radius:var(--dshpc-radius-md);cursor:pointer;
|
|
4364
4382
|
font-size:12px;line-height:20px;text-align:center;
|
|
4365
4383
|
}
|
|
4366
4384
|
.dshpc-picker__more:hover{background:var(--dshpc-surface-sunken)}
|
|
@@ -4388,7 +4406,13 @@ function Picker(props) {
|
|
|
4388
4406
|
props.onChange?.(mode === "single" ? next[0] ?? "" : next);
|
|
4389
4407
|
};
|
|
4390
4408
|
const limit = props.limit ?? 0;
|
|
4391
|
-
const [open,
|
|
4409
|
+
const [open, setOpenState] = (0, import_react9.useState)(false);
|
|
4410
|
+
const onOpenChangeRef = (0, import_react9.useRef)(props.onOpenChange);
|
|
4411
|
+
onOpenChangeRef.current = props.onOpenChange;
|
|
4412
|
+
const setOpen = (0, import_react9.useCallback)((next) => {
|
|
4413
|
+
setOpenState(next);
|
|
4414
|
+
onOpenChangeRef.current?.(next);
|
|
4415
|
+
}, []);
|
|
4392
4416
|
const [query, setQuery] = (0, import_react9.useState)("");
|
|
4393
4417
|
const [active, setActive2] = (0, import_react9.useState)(-1);
|
|
4394
4418
|
const [visible, setVisible] = (0, import_react9.useState)(limit);
|
|
@@ -4401,7 +4425,8 @@ function Picker(props) {
|
|
|
4401
4425
|
middleware: [
|
|
4402
4426
|
offset3(4),
|
|
4403
4427
|
flip3(),
|
|
4404
|
-
|
|
4428
|
+
// 左右各留 12:菜单比触发器宽是常态,贴到视口边上会显得在「硬挤」(2026-11-10 用户)。
|
|
4429
|
+
shift3({ padding: { top: 8, bottom: 8, left: 12, right: 12 } }),
|
|
4405
4430
|
size3({
|
|
4406
4431
|
apply({ elements, rects, availableWidth, availableHeight }) {
|
|
4407
4432
|
const menu = resolveMenuSizing(rects.reference.width, availableWidth, props.searchSizing);
|
|
@@ -5646,22 +5671,72 @@ var workspaceList = new WorkspaceListStore();
|
|
|
5646
5671
|
var workspaceFiles;
|
|
5647
5672
|
var boundModelsPath;
|
|
5648
5673
|
var catalogInFlight;
|
|
5649
|
-
|
|
5674
|
+
var lastAttemptAt = 0;
|
|
5675
|
+
var retryIndex = 0;
|
|
5676
|
+
var retryTimer;
|
|
5677
|
+
var RETRY_DELAYS_MS = [1e3, 2e3, 4e3];
|
|
5678
|
+
var REVALIDATE_AFTER_MS = 3e4;
|
|
5679
|
+
function isRetryable(error) {
|
|
5680
|
+
const matched = /HTTP (\d{3})/.exec(String(error));
|
|
5681
|
+
if (matched === null)
|
|
5682
|
+
return true;
|
|
5683
|
+
const status = Number(matched[1]);
|
|
5684
|
+
return status >= 500 || status === 429;
|
|
5685
|
+
}
|
|
5686
|
+
function scheduleRetry(path, delay) {
|
|
5687
|
+
if (retryTimer !== void 0)
|
|
5688
|
+
clearTimeout(retryTimer);
|
|
5689
|
+
const timer = setTimeout(() => {
|
|
5690
|
+
retryTimer = void 0;
|
|
5691
|
+
void loadModelCatalog(path);
|
|
5692
|
+
}, delay);
|
|
5693
|
+
timer.unref?.();
|
|
5694
|
+
retryTimer = timer;
|
|
5695
|
+
}
|
|
5696
|
+
function loadModelCatalog(path, retryOnFailure = true) {
|
|
5650
5697
|
if (catalogInFlight !== void 0)
|
|
5651
5698
|
return catalogInFlight;
|
|
5699
|
+
lastAttemptAt = Date.now();
|
|
5652
5700
|
const job = fetch(path, { cache: "no-store" }).then((response) => response.ok ? response.json() : Promise.reject(new Error(`HTTP ${response.status}`))).then((data2) => {
|
|
5653
5701
|
const routes = data2?.routes;
|
|
5654
5702
|
if (!Array.isArray(routes))
|
|
5655
5703
|
throw new Error("\u6A21\u578B\u76EE\u5F55\u54CD\u5E94\u7F3A\u5C11 routes");
|
|
5704
|
+
retryIndex = 0;
|
|
5656
5705
|
modelCatalog.setRoutes(routes);
|
|
5657
5706
|
}).catch((error) => {
|
|
5658
5707
|
modelCatalog.setUnavailable(String(error));
|
|
5708
|
+
if (!retryOnFailure || !isRetryable(error))
|
|
5709
|
+
return;
|
|
5710
|
+
const delay = RETRY_DELAYS_MS[retryIndex];
|
|
5711
|
+
if (delay === void 0)
|
|
5712
|
+
return;
|
|
5713
|
+
retryIndex += 1;
|
|
5714
|
+
scheduleRetry(path, delay);
|
|
5659
5715
|
}).finally(() => {
|
|
5660
5716
|
catalogInFlight = void 0;
|
|
5661
5717
|
});
|
|
5662
5718
|
catalogInFlight = job;
|
|
5663
5719
|
return job;
|
|
5664
5720
|
}
|
|
5721
|
+
function revalidateModelCatalog() {
|
|
5722
|
+
if (boundModelsPath === void 0 || catalogInFlight !== void 0)
|
|
5723
|
+
return;
|
|
5724
|
+
if (Date.now() - lastAttemptAt < REVALIDATE_AFTER_MS)
|
|
5725
|
+
return;
|
|
5726
|
+
void loadModelCatalog(boundModelsPath, false);
|
|
5727
|
+
}
|
|
5728
|
+
var visibilityBound = false;
|
|
5729
|
+
function bindVisibilityRevalidate() {
|
|
5730
|
+
if (visibilityBound)
|
|
5731
|
+
return;
|
|
5732
|
+
if (typeof document === "undefined")
|
|
5733
|
+
return;
|
|
5734
|
+
visibilityBound = true;
|
|
5735
|
+
document.addEventListener("visibilitychange", () => {
|
|
5736
|
+
if (document.visibilityState === "visible")
|
|
5737
|
+
revalidateModelCatalog();
|
|
5738
|
+
});
|
|
5739
|
+
}
|
|
5665
5740
|
function isWorkspaceSource(value) {
|
|
5666
5741
|
if (value === null || typeof value !== "object")
|
|
5667
5742
|
return false;
|
|
@@ -5685,6 +5760,7 @@ function connectHost(ctx, options = {}) {
|
|
|
5685
5760
|
if (modelsPath === void 0)
|
|
5686
5761
|
return;
|
|
5687
5762
|
boundModelsPath = modelsPath;
|
|
5763
|
+
bindVisibilityRevalidate();
|
|
5688
5764
|
void loadModelCatalog(modelsPath);
|
|
5689
5765
|
}
|
|
5690
5766
|
|
|
@@ -5760,6 +5836,11 @@ function ModelPicker(props) {
|
|
|
5760
5836
|
size: props.size,
|
|
5761
5837
|
placement: props.placement,
|
|
5762
5838
|
className: props.className,
|
|
5839
|
+
// 打开下拉就补拉目录(核心内部 30s 节流,快速开关不会连发):供应商 / 模型增减靠它感知。
|
|
5840
|
+
onOpenChange: (open) => {
|
|
5841
|
+
if (open)
|
|
5842
|
+
revalidateModelCatalog();
|
|
5843
|
+
},
|
|
5763
5844
|
translate: props.translate,
|
|
5764
5845
|
onChange: emitModel
|
|
5765
5846
|
});
|
|
@@ -5782,6 +5863,11 @@ function ModelPicker(props) {
|
|
|
5782
5863
|
size: props.size,
|
|
5783
5864
|
placement: props.placement,
|
|
5784
5865
|
className: props.className,
|
|
5866
|
+
// 打开下拉就补拉目录(核心内部 30s 节流,快速开关不会连发):供应商 / 模型增减靠它感知。
|
|
5867
|
+
onOpenChange: (open) => {
|
|
5868
|
+
if (open)
|
|
5869
|
+
revalidateModelCatalog();
|
|
5870
|
+
},
|
|
5785
5871
|
translate: props.translate,
|
|
5786
5872
|
onChange: emitModel
|
|
5787
5873
|
});
|
|
@@ -5801,6 +5887,11 @@ function ModelPicker(props) {
|
|
|
5801
5887
|
size: props.size,
|
|
5802
5888
|
placement: props.placement,
|
|
5803
5889
|
className: props.providerClassName,
|
|
5890
|
+
// 打开下拉就补拉目录(核心内部 30s 节流,快速开关不会连发):供应商 / 模型增减靠它感知。
|
|
5891
|
+
onOpenChange: (open) => {
|
|
5892
|
+
if (open)
|
|
5893
|
+
revalidateModelCatalog();
|
|
5894
|
+
},
|
|
5804
5895
|
translate: props.translate,
|
|
5805
5896
|
onChange: (v) => {
|
|
5806
5897
|
setPickedProvider(typeof v === "string" ? v : v[0] ?? "");
|
|
@@ -5822,6 +5913,11 @@ function ModelPicker(props) {
|
|
|
5822
5913
|
size: props.size,
|
|
5823
5914
|
placement: props.placement,
|
|
5824
5915
|
className: props.modelClassName,
|
|
5916
|
+
// 打开下拉就补拉目录(核心内部 30s 节流,快速开关不会连发):供应商 / 模型增减靠它感知。
|
|
5917
|
+
onOpenChange: (open) => {
|
|
5918
|
+
if (open)
|
|
5919
|
+
revalidateModelCatalog();
|
|
5920
|
+
},
|
|
5825
5921
|
translate: props.translate,
|
|
5826
5922
|
onChange: emitModel
|
|
5827
5923
|
}));
|
|
@@ -8969,7 +9065,7 @@ var onVisibilityChange = () => {
|
|
|
8969
9065
|
for (const l of [...tickerListeners])
|
|
8970
9066
|
l();
|
|
8971
9067
|
};
|
|
8972
|
-
var
|
|
9068
|
+
var visibilityBound2 = false;
|
|
8973
9069
|
function subscribeTicker(cb) {
|
|
8974
9070
|
tickerListeners.add(cb);
|
|
8975
9071
|
if (tickerTimer === null) {
|
|
@@ -8977,9 +9073,9 @@ function subscribeTicker(cb) {
|
|
|
8977
9073
|
for (const l of [...tickerListeners])
|
|
8978
9074
|
l();
|
|
8979
9075
|
}, 1e3);
|
|
8980
|
-
if (!
|
|
9076
|
+
if (!visibilityBound2 && typeof document !== "undefined") {
|
|
8981
9077
|
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
8982
|
-
|
|
9078
|
+
visibilityBound2 = true;
|
|
8983
9079
|
}
|
|
8984
9080
|
}
|
|
8985
9081
|
return () => {
|
|
@@ -63905,8 +64001,8 @@ var docData = {
|
|
|
63905
64001
|
"en": "\xA72 Use a control: a generic `Picker` takes its options from the caller (`priorities` in the example, not a model catalog)."
|
|
63906
64002
|
},
|
|
63907
64003
|
{
|
|
63908
|
-
"zh": "\xA72 \u9644\uFF1A\u9009\u6A21\u578B\u4E0D\u8981\u624B\u6413\u6570\u7EC4 \u2014\u2014 \u5BBF\u4E3B `serveModelCatalog(ctx, { path })` \u6CE8\u518C\u53EA\u8BFB\u76EE\u5F55\u8DEF\u7531\uFF0Cclient `connectHost(ctx, { modelsPath: path })` \u7528\u540C\u4E00\u4E2A path \u5E38\u91CF\u63A5\u4E0A\uFF0C\u518D\u6E32\u67D3 `ModelPicker`\uFF1B\u4F9B\u5E94\u5546 / \u6A21\u578B\u6709\u589E\u51CF\u8C03 `await refreshModelCatalog()
|
|
63909
|
-
"en": "\xA72a Model selection: never hand-roll a models array. Register `serveModelCatalog(ctx, { path })` on the host, call `connectHost(ctx, { modelsPath: path })` on the client with the same path constant, then render `ModelPicker`. `await refreshModelCatalog()`
|
|
64004
|
+
"zh": "\xA72 \u9644\uFF1A\u9009\u6A21\u578B\u4E0D\u8981\u624B\u6413\u6570\u7EC4 \u2014\u2014 \u5BBF\u4E3B `serveModelCatalog(ctx, { path })` \u6CE8\u518C\u53EA\u8BFB\u76EE\u5F55\u8DEF\u7531\uFF0Cclient `connectHost(ctx, { modelsPath: path })` \u7528\u540C\u4E00\u4E2A path \u5E38\u91CF\u63A5\u4E0A\uFF0C\u518D\u6E32\u67D3 `ModelPicker`\uFF1B\u9996\u62C9\u5931\u8D25\u6838\u5FC3\u4F1A\u9000\u907F\u91CD\u8BD5 3 \u6B21\uFF0C\u4F9B\u5E94\u5546 / \u6A21\u578B\u6709\u589E\u51CF\u65F6\u6253\u5F00\u9009\u62E9\u5668\u6216\u5207\u56DE\u9875\u9762\u4F1A\u81EA\u52A8\u8865\u62C9\uFF0830s \u8282\u6D41\uFF09\uFF0C\u8981\u7ACB\u523B\u5237\u65B0\u518D\u8C03 `await refreshModelCatalog()`\u3002\u6F0F\u4E86 `modelsPath` \u5C31\u662F\u7A7A\u76EE\u5F55\uFF0C\u4E14\u4E0D\u4F1A\u6709\u62A5\u9519\u3002",
|
|
64005
|
+
"en": "\xA72a Model selection: never hand-roll a models array. Register `serveModelCatalog(ctx, { path })` on the host, call `connectHost(ctx, { modelsPath: path })` on the client with the same path constant, then render `ModelPicker`. The first load retries 3 times with backoff; opening the picker or returning to the page re-pulls when providers change (throttled to once per 30s), and `await refreshModelCatalog()` forces an immediate refresh. Omitting `modelsPath` leaves the catalog empty, silently."
|
|
63910
64006
|
},
|
|
63911
64007
|
{
|
|
63912
64008
|
"zh": "\xA73 \u7528\u901A\u7528\u65B9\u6CD5",
|
|
@@ -64355,8 +64451,8 @@ var docData = {
|
|
|
64355
64451
|
"en": "WorkspacePicker: a domain picker that brings its own data. Call `connectHost(ctx)` once in the plugin apply and it subscribes to the official `workspaces` snapshot. Unwired = empty state, never fabricated data. Trigger and search-box sizing (`width` / `minWidth` / `maxWidth` / `searchSizing`) matches Picker; `translate` overrides all built-in copy in the component and its dropdown."
|
|
64356
64452
|
},
|
|
64357
64453
|
{
|
|
64358
|
-
"zh": "ModelPicker\uFF1A\u9009\u62E9\u6A21\u578B\u7684\u5B8C\u6574\u5C01\u88C5\uFF0C\u4E09\u79CD\u5F62\u6001\u5171\u7528\u540C\u4E00\u4EFD\u5BBF\u4E3B\u76EE\u5F55\uFF0C`onChange` \u4E00\u5F8B\u53D1 `provider/id`\uFF1A`grouped`\uFF08\u9ED8\u8BA4\uFF09= \u4E00\u4E2A\u4E0B\u62C9\u3001\u4F9B\u5E94\u5546\u505A\u7EC4\u5934\uFF1B`flat` = \u4E00\u4E2A\u4E0B\u62C9\u3001\u5168\u90E8\u6A21\u578B\u5E73\u94FA\u6210\u300C\u5382\u5546-\u6A21\u578B\u300D\u5E76\u5E26\u641C\u7D22\uFF0C\u641C\u5382\u5546\u540D\u5373\u53EF\u7B5B\uFF1B`cascade` = \u4E24\u4E2A\u4E0B\u62C9\u8054\u52A8\uFF0C\u5382\u5546\u6846\u4E0E\u6A21\u578B\u6846\u90FD\u5E26\u641C\u7D22\uFF0C\u6362\u5382\u5546\u6E05\u7A7A\u6A21\u578B\u3002**\u63A5\u7EBF\u662F\u4E24\u6BB5\u5F0F**\uFF1A\u5BBF\u4E3B `serveModelCatalog(ctx, { path })` + client `connectHost(ctx, { modelsPath: path })` \u7528\u540C\u4E00\u4E2A path \u5E38\u91CF\uFF0C\u6F0F\u4E86 `modelsPath` \u76EE\u5F55\u6C38\u8FDC\u505C\u5728 loading\uFF1B\u4F9B\u5E94\u5546 / \u6A21\u578B\u6709\u589E\u51CF\u65F6 `await refreshModelCatalog()` \u91CD\u62C9\u3002`width` / `minWidth` / `maxWidth` \u7BA1\u89E6\u53D1\u5668\uFF0C`searchSizing` \u7BA1\u6240\u6709\u641C\u7D22\u6846\uFF0C`providerSizing` / `modelSizing` \u8BA9\u8054\u52A8\u6001\u4E24\u4E2A\u6846\u5206\u522B\u8BBE\u5BBD\u3002\u65E7\u503C\u5DF2\u4E0D\u5728\u76EE\u5F55\u91CC\u65F6\u6309\u771F\u5B9E\u503C\u4FDD\u7559\u4E00\u9879\u5E76\u5982\u5B9E\u63D0\u793A\u300C\u5019\u9009\u53EF\u80FD\u4E0D\u5B8C\u6574\u300D\uFF0C\u4E0D\u9759\u9ED8\u4E22\u5F03\u3002\u5BBF\u4E3B\u4FA7 `serveModelCatalog` \u7684 `getLlm` \u53EA\u662F\u53EF\u9009\u53D6\u503C\u8986\u76D6\uFF0C\u4E0D\u4F20\u65F6\u6838\u5FC3\u81EA\u884C\u6536\u53E3\uFF08ctx \u5931\u6D3B\u6309\u4E0D\u53EF\u7528\u56DE 503\uFF09\uFF0C\u6D88\u8D39\u65B9\u4E0D\u5FC5\u5404\u81EA\u9632\u3002",
|
|
64359
|
-
"en": 'ModelPicker: the complete model selector. Three variants share one host catalog and always emit `provider/id`: `grouped` (default) groups models under provider headers in one dropdown; `flat` lists every model as `vendor-model` in one searchable dropdown; `cascade` links two searchable dropdowns (provider then model). **Wiring is two-sided**: `serveModelCatalog(ctx, { path })` on the host and `connectHost(ctx, { modelsPath: path })` on the client with the same path constant \u2014 without `modelsPath` the catalog stays `loading` forever; `await refreshModelCatalog()` re-pulls it when providers change. `width`/`minWidth`/`maxWidth` size triggers, `searchSizing` sizes every search box, and `providerSizing`/`modelSizing` size the two cascade boxes separately. A controlled value no longer present in the catalog is retained as-is with an honest "candidates may be incomplete" hint instead of being silently dropped. The host-side `getLlm` on `serveModelCatalog` is only an optional override \u2014 the core handles a disposed ctx itself and answers 503, so consumers need not guard it.'
|
|
64454
|
+
"zh": "ModelPicker\uFF1A\u9009\u62E9\u6A21\u578B\u7684\u5B8C\u6574\u5C01\u88C5\uFF0C\u4E09\u79CD\u5F62\u6001\u5171\u7528\u540C\u4E00\u4EFD\u5BBF\u4E3B\u76EE\u5F55\uFF0C`onChange` \u4E00\u5F8B\u53D1 `provider/id`\uFF1A`grouped`\uFF08\u9ED8\u8BA4\uFF09= \u4E00\u4E2A\u4E0B\u62C9\u3001\u4F9B\u5E94\u5546\u505A\u7EC4\u5934\uFF1B`flat` = \u4E00\u4E2A\u4E0B\u62C9\u3001\u5168\u90E8\u6A21\u578B\u5E73\u94FA\u6210\u300C\u5382\u5546-\u6A21\u578B\u300D\u5E76\u5E26\u641C\u7D22\uFF0C\u641C\u5382\u5546\u540D\u5373\u53EF\u7B5B\uFF1B`cascade` = \u4E24\u4E2A\u4E0B\u62C9\u8054\u52A8\uFF0C\u5382\u5546\u6846\u4E0E\u6A21\u578B\u6846\u90FD\u5E26\u641C\u7D22\uFF0C\u6362\u5382\u5546\u6E05\u7A7A\u6A21\u578B\u3002**\u63A5\u7EBF\u662F\u4E24\u6BB5\u5F0F**\uFF1A\u5BBF\u4E3B `serveModelCatalog(ctx, { path })` + client `connectHost(ctx, { modelsPath: path })` \u7528\u540C\u4E00\u4E2A path \u5E38\u91CF\uFF0C\u6F0F\u4E86 `modelsPath` \u76EE\u5F55\u6C38\u8FDC\u505C\u5728 loading\uFF1B\u4F9B\u5E94\u5546 / \u6A21\u578B\u6709\u589E\u51CF\u65F6 `await refreshModelCatalog()` \u91CD\u62C9\u3002`width` / `minWidth` / `maxWidth` \u7BA1\u89E6\u53D1\u5668\uFF0C`searchSizing` \u7BA1\u6240\u6709\u641C\u7D22\u6846\uFF0C`providerSizing` / `modelSizing` \u8BA9\u8054\u52A8\u6001\u4E24\u4E2A\u6846\u5206\u522B\u8BBE\u5BBD\u3002\u65E7\u503C\u5DF2\u4E0D\u5728\u76EE\u5F55\u91CC\u65F6\u6309\u771F\u5B9E\u503C\u4FDD\u7559\u4E00\u9879\u5E76\u5982\u5B9E\u63D0\u793A\u300C\u5019\u9009\u53EF\u80FD\u4E0D\u5B8C\u6574\u300D\uFF0C\u4E0D\u9759\u9ED8\u4E22\u5F03\u3002\u5BBF\u4E3B\u4FA7 `serveModelCatalog` \u7684 `getLlm` \u53EA\u662F\u53EF\u9009\u53D6\u503C\u8986\u76D6\uFF0C\u4E0D\u4F20\u65F6\u6838\u5FC3\u81EA\u884C\u6536\u53E3\uFF08ctx \u5931\u6D3B\u6309\u4E0D\u53EF\u7528\u56DE 503\uFF09\uFF0C\u6D88\u8D39\u65B9\u4E0D\u5FC5\u5404\u81EA\u9632\u3002\u9996\u62C9\u5931\u8D25\u6838\u5FC3\u4F1A\u9000\u907F\u91CD\u8BD5 3 \u6B21\uFF085xx / 429 / \u7F51\u7EDC\u9519\u8BEF\uFF1B403\u3001404 \u4E0D\u91CD\u8BD5\uFF09\uFF0C\u4E09\u6B21\u90FD\u5931\u8D25\u5C31\u505C\u5728\u964D\u7EA7\u6001\uFF1B\u6253\u5F00\u9009\u62E9\u5668 / \u5207\u56DE\u9875\u9762\u65F6\u6309 30s \u8282\u6D41\u81EA\u52A8\u8865\u62C9\uFF0C\u4E0D\u9700\u8981\u81EA\u5DF1\u8F6E\u8BE2\u3002",
|
|
64455
|
+
"en": 'ModelPicker: the complete model selector. Three variants share one host catalog and always emit `provider/id`: `grouped` (default) groups models under provider headers in one dropdown; `flat` lists every model as `vendor-model` in one searchable dropdown; `cascade` links two searchable dropdowns (provider then model). **Wiring is two-sided**: `serveModelCatalog(ctx, { path })` on the host and `connectHost(ctx, { modelsPath: path })` on the client with the same path constant \u2014 without `modelsPath` the catalog stays `loading` forever; `await refreshModelCatalog()` re-pulls it when providers change. `width`/`minWidth`/`maxWidth` size triggers, `searchSizing` sizes every search box, and `providerSizing`/`modelSizing` size the two cascade boxes separately. A controlled value no longer present in the catalog is retained as-is with an honest "candidates may be incomplete" hint instead of being silently dropped. The host-side `getLlm` on `serveModelCatalog` is only an optional override \u2014 the core handles a disposed ctx itself and answers 503, so consumers need not guard it. The first load retries up to 3 times with backoff (5xx / 429 / network only; 403 and 404 stop immediately) and then stays degraded; opening the picker or returning to the page re-pulls at most once per 30s, so no polling is needed.'
|
|
64360
64456
|
}
|
|
64361
64457
|
],
|
|
64362
64458
|
"api": [
|
|
@@ -71344,9 +71440,9 @@ function ReferencePage() {
|
|
|
71344
71440
|
"tbody",
|
|
71345
71441
|
null,
|
|
71346
71442
|
[
|
|
71347
|
-
[t3("buildCore"), `v${"0.35.
|
|
71348
|
-
[t3("buildDemo"), `v${"0.35.
|
|
71349
|
-
[t3("buildStamp"), "261110-
|
|
71443
|
+
[t3("buildCore"), `v${"0.35.16"}`],
|
|
71444
|
+
[t3("buildDemo"), `v${"0.35.16"}`],
|
|
71445
|
+
[t3("buildStamp"), "261110-091810-517"]
|
|
71350
71446
|
].map(
|
|
71351
71447
|
([label, value]) => (0, import_react98.createElement)(
|
|
71352
71448
|
"tr",
|
|
@@ -71662,9 +71758,9 @@ function DemoPage() {
|
|
|
71662
71758
|
lineHeight: "14px"
|
|
71663
71759
|
}
|
|
71664
71760
|
},
|
|
71665
|
-
(0, import_react100.createElement)("span", null, `core v${"0.35.
|
|
71666
|
-
(0, import_react100.createElement)("span", null, `demo v${"0.35.
|
|
71667
|
-
(0, import_react100.createElement)("span", { style: { marginTop: "4px", fontSize: "9px" } }, "261110-
|
|
71761
|
+
(0, import_react100.createElement)("span", null, `core v${"0.35.16"}`),
|
|
71762
|
+
(0, import_react100.createElement)("span", null, `demo v${"0.35.16"}`),
|
|
71763
|
+
(0, import_react100.createElement)("span", { style: { marginTop: "4px", fontSize: "9px" } }, "261110-091810-517")
|
|
71668
71764
|
)
|
|
71669
71765
|
)
|
|
71670
71766
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-core-demo",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.16",
|
|
4
4
|
"description": "The shared UI foundation for DSH plugins, with a live component preview: design tokens, common controls, workspace browsing and notifications maintained in one place — install it to preview every component in a real host.",
|
|
5
5
|
"icon": "./assets/icon-components.svg",
|
|
6
6
|
"keywords": [
|