dsh-model-extension 1.2.1 → 1.2.3-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # dsh-model-extension
2
2
  > 基于 deepseek-harness 的模型扩展插件
3
3
 
4
- [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) [![npm](https://img.shields.io/npm/v/dsh-model-extension.svg?label=npm&labelColor=000000&color=ff4b01)](https://www.npmjs.com/package/dsh-model-extension) [![DeepSeek Harness:0.1.5-rc.2](https://img.shields.io/badge/DeepSeek%20Harness-0.1.5--rc.2-success.svg?labelColor=4D6BFE)](https://github.com/deepseek-ai/deepseek-harness)
4
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) [![npm](https://img.shields.io/npm/v/dsh-model-extension.svg?label=npm&labelColor=000000&color=ff4b01)](https://www.npmjs.com/package/dsh-model-extension) [![DeepSeek Harness:0.1.7-alpha.1](https://img.shields.io/badge/DeepSeek%20Harness-0.1.7--alpha.1-success.svg?labelColor=4D6BFE)](https://github.com/deepseek-ai/deepseek-harness)
5
5
 
6
6
  | 供应商 | 模型 |
7
7
  | --- | --- |
@@ -48,6 +48,11 @@ npm run build
48
48
 
49
49
  ## 版本历史
50
50
 
51
+ - **1.2.3**
52
+ - **1.2.3-alpha.2**
53
+ - 💪适配deepseek harness 0.1.7-alpha.1
54
+ - **1.2.3-alpha.1**
55
+ - 🐛修复 llm-deepseek 获取模型错误的问题
51
56
  - **1.2.1**
52
57
  - 🐛修复非 openai-completions API 协议网关保存报错
53
58
  - 💪快速装入 model id 显示对应的API协议
package/lib/client.js CHANGED
@@ -2145,7 +2145,7 @@ if (typeof document !== 'undefined' && document.querySelector('style[data-plugin
2145
2145
  disabled,
2146
2146
  onClick: props.onReset,
2147
2147
  children: "恢复默认模型"
2148
- }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2148
+ }) : null, props.hideFetch === true ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2149
2149
  type: "button",
2150
2150
  className: models_plus_module_default["linkButton"],
2151
2151
  disabled: disabled || busy || !askable || props.probeBlocked !== void 0,
@@ -2357,8 +2357,14 @@ if (typeof document !== 'undefined' && document.querySelector('style[data-plugin
2357
2357
  * write — the draft comes from the user layer, so a wholesale replace can
2358
2358
  * never delete fields outside the card.
2359
2359
  */
2360
- /** The public DeepSeek endpoint shown as the deepseek base-URL placeholder. */
2361
- const DEEPSEEK_PUBLIC_BASE_URL = "https://api.deepseek.com";
2360
+ /** The official DeepSeek roots, chosen by the profile's resolved protocol.
2361
+ * Host @ 0.1.6-alpha.2 kept both keys (deepSeekChatBaseUrl / deepSeekMessagesBaseUrl)
2362
+ * with Messages as the default; @ 0.1.7-alpha.1 it collapsed to a single
2363
+ * deepSeekBaseUrl (https://api.deepseek.com/anthropic) with an Anthropic-only
2364
+ * hint. We keep the protocol-aware pair so a chat-protocol route still prefills
2365
+ * the bare root — prefill only, the saved draft is whatever the user set. */
2366
+ const DEEPSEEK_CHAT_BASE_URL = "https://api.deepseek.com";
2367
+ const DEEPSEEK_MESSAGES_BASE_URL = "https://api.deepseek.com/anthropic";
2362
2368
  /** The editor layout the owning namespace selects. */
2363
2369
  function layoutOf(ns) {
2364
2370
  if (ns === "llm-deepseek") return "deepseek";
@@ -2631,20 +2637,27 @@ if (typeof document !== 'undefined' && document.querySelector('style[data-plugin
2631
2637
  }),
2632
2638
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2633
2639
  className: models_plus_module_default["field"],
2634
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
2635
- className: models_plus_module_default["fieldLabel"],
2636
- children: "API 地址"
2637
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
2638
- className: models_plus_module_default["input"],
2639
- type: "text",
2640
- value: stringAt(draft, "baseURL") ?? "",
2641
- placeholder: layout === "deepseek" ? DEEPSEEK_PUBLIC_BASE_URL : stringAt(fallback, "baseURL") ?? "提供方默认",
2642
- "aria-label": "API 地址",
2643
- disabled,
2644
- onChange: (event) => {
2645
- setField("baseURL", event.target.value === "" ? void 0 : event.target.value);
2646
- }
2647
- })]
2640
+ children: [
2641
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
2642
+ className: models_plus_module_default["fieldLabel"],
2643
+ children: "API 地址"
2644
+ }),
2645
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
2646
+ className: models_plus_module_default["input"],
2647
+ type: "text",
2648
+ value: stringAt(draft, "baseURL") ?? "",
2649
+ placeholder: layout === "deepseek" ? stringAt(fallback, "protocol") === "messages" ? DEEPSEEK_MESSAGES_BASE_URL : DEEPSEEK_CHAT_BASE_URL : stringAt(fallback, "baseURL") ?? "提供方默认",
2650
+ "aria-label": "API 地址",
2651
+ disabled,
2652
+ onChange: (event) => {
2653
+ setField("baseURL", event.target.value === "" ? void 0 : event.target.value);
2654
+ }
2655
+ }),
2656
+ layout === "deepseek" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2657
+ className: models_plus_module_default["advancedHint"],
2658
+ children: "请填写与当前连接配置兼容的 API 地址。"
2659
+ }) : null
2660
+ ]
2648
2661
  }),
2649
2662
  layout === "pi-ai" && props.declared === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2650
2663
  className: models_plus_module_default["field"],
@@ -2682,6 +2695,7 @@ if (typeof document !== 'undefined' && document.querySelector('style[data-plugin
2682
2695
  defaultMaxTokens: typeof defaultMaxTokens === "number" ? defaultMaxTokens : void 0,
2683
2696
  probe,
2684
2697
  probeBlocked: keyFailure,
2698
+ hideFetch: layout === "deepseek",
2685
2699
  operations,
2686
2700
  disabled,
2687
2701
  onChange: (rows) => {
@@ -3510,7 +3524,7 @@ if (typeof document !== 'undefined' && document.querySelector('style[data-plugin
3510
3524
  //#region src/client/index-extension.ts
3511
3525
  /** Cordis service name (distinct from the npm package name). */
3512
3526
  const name = "model-extension-client";
3513
- /** Required services — mirrors the upstream Models section registration @ 0.1.5-rc.1. */
3527
+ /** Required services — mirrors the upstream Models section registration @ 0.1.7-alpha.1. */
3514
3528
  const inject = [
3515
3529
  "slots",
3516
3530
  "locale",
@@ -3518,7 +3532,7 @@ if (typeof document !== 'undefined' && document.querySelector('style[data-plugin
3518
3532
  "remote.credentials",
3519
3533
  "remote.llm",
3520
3534
  "remote.settings",
3521
- "settingsScope",
3535
+ "configForms",
3522
3536
  "settingsSchema"
3523
3537
  ];
3524
3538
  /** Refetch the page snapshot only after its first load (upstream helper, inlined). */
@@ -3538,7 +3552,7 @@ if (typeof document !== 'undefined' && document.querySelector('style[data-plugin
3538
3552
  }), "dsh-model-extension: copy dictionaries");
3539
3553
  const schema = createSettingsSchemaOperations(ctx.settingsSchema);
3540
3554
  const operations = createModelsOperations(ctx);
3541
- const controller = new ModelsSettingsStore(ctx, schema, ctx.settingsScope.describe());
3555
+ const controller = new ModelsSettingsStore(ctx, schema, ctx.configForms.describe());
3542
3556
  const t = ctx.locale.bind(NS);
3543
3557
  const injected = () => ({
3544
3558
  controller,