dsh-opencode-go 0.1.3 → 0.1.4

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
@@ -89,7 +89,9 @@ Web 用户可直接在 **设置 → OpenCode Go** 中修改配置。启用开关
89
89
 
90
90
  网关和在线配置已收录、且使用 Anthropic Messages、OpenAI Chat Completions 或 OpenAI Responses 协议的新模型,在下次读取或刷新列表时即可使用。刷新会绕过已有会话的目录缓存;直接请求尚未缓存的新模型也会立即重新同步。设置页显示完整模型列表。
91
91
 
92
- 网关已公布 ID 但尚无有效协议/能力配置的模型仍会显示,并标注配置暂不可用;调用时会说明原因。仅凭模型 ID 无法可靠推断调用方式。上游新增全新协议或协议特例时,仍可能需要适配。
92
+ 网关已公布 ID 但尚无有效协议/能力配置的模型会在设置页的发现结果中标注配置暂不可用,暂不进入对话模型选择器,避免一个未配置的模型阻断整个列表;直接调用时会说明原因。配置补齐后,刷新列表即可使用。仅凭模型 ID 无法可靠推断调用方式。上游新增全新协议或协议特例时,仍可能需要适配。
93
+
94
+ 模型具有推理能力但没有可调节的推理档位时(如 `union-alpha`),仍可正常选择和使用,只是不显示推理强度选项。
93
95
 
94
96
  在线配置暂时不可达时,优先复用本次运行中成功获取的配置,以 pi-ai 内置配置作为备用。网关目录不可达时,已有请求可以使用上次目录;设置页刷新会显示失败,避免把旧目录误认为最新结果。`refreshMinutes` 只控制已有模型请求的缓存时长,不阻止主动读取列表获取新模型。
95
97
 
package/lib/client.js CHANGED
@@ -40,7 +40,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id) + "]")
40
40
  style.textContent = ".BtKYva_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.BtKYva_field+.BtKYva_field{border-top:.5px solid var(--dsw-alias-border-l2)}.BtKYva_head{align-items:center;gap:8px;display:flex}.BtKYva_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.BtKYva_badges{align-items:center;gap:8px;display:inline-flex}.BtKYva_reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.BtKYva_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.BtKYva_reset:disabled{cursor:default}.BtKYva_input{border:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}.BtKYva_input:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}.BtKYva_input:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.BtKYva_inputInvalid{border-color:var(--dsw-alias-label-error);}.BtKYva_invalid{color:var(--dsw-alias-label-error);margin:0;font-size:12px;line-height:1.5}.BtKYva_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:1.5}.BtKYva_intro{color:var(--dsw-alias-label-secondary);margin:0 0 8px;font-size:13px;line-height:1.5}.BtKYva_disclosure{font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;align-items:center;gap:8px;margin:0;padding:0;display:flex}.BtKYva_disclosure:hover .BtKYva_label{color:var(--dsw-alias-brand-primary)}.BtKYva_chevron,.BtKYva_chevronOpen{color:var(--dsw-alias-label-tertiary);flex:none}.BtKYva_chevron{transform:rotate(-90deg)}.BtKYva_advanced{flex-direction:column;gap:4px;padding:4px 0 0 22px;display:flex}.BtKYva_advanced .BtKYva_field+.BtKYva_field{border-top:none}.BtKYva_chips{flex-wrap:wrap;gap:6px;display:flex}.BtKYva_actions{align-items:center;gap:8px;padding-top:12px;display:flex}.BtKYva_failedNote{color:var(--dsw-alias-label-error);margin:0;font-size:12px;line-height:1.5}";
41
41
  document.head.appendChild(style);
42
42
  }
43
- var Section_default = { "badges": "BtKYva_badges", "field": "BtKYva_field", "inputInvalid": "BtKYva_inputInvalid", "input": "BtKYva_input", "hint": "BtKYva_hint", "actions": "BtKYva_actions", "label": "BtKYva_label", "invalid": "BtKYva_invalid", "reset": "BtKYva_reset", "intro": "BtKYva_intro", "disclosure": "BtKYva_disclosure", "head": "BtKYva_head", "chevronOpen": "BtKYva_chevronOpen", "chips": "BtKYva_chips", "failedNote": "BtKYva_failedNote", "chevron": "BtKYva_chevron", "advanced": "BtKYva_advanced" };
43
+ var Section_default = { "intro": "BtKYva_intro", "head": "BtKYva_head", "label": "BtKYva_label", "invalid": "BtKYva_invalid", "hint": "BtKYva_hint", "chevron": "BtKYva_chevron", "chips": "BtKYva_chips", "failedNote": "BtKYva_failedNote", "advanced": "BtKYva_advanced", "input": "BtKYva_input", "reset": "BtKYva_reset", "badges": "BtKYva_badges", "actions": "BtKYva_actions", "inputInvalid": "BtKYva_inputInvalid", "disclosure": "BtKYva_disclosure", "chevronOpen": "BtKYva_chevronOpen", "field": "BtKYva_field" };
44
44
 
45
45
  // src/client/Section.tsx
46
46
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -885,7 +885,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id2) + "]"
885
885
  style.textContent = ".dmPm3q_root{min-width:0;display:inline-flex;position:relative}.dmPm3q_trigger{color:inherit;opacity:.75;font:inherit;cursor:pointer;white-space:nowrap;background:0 0;border:0;border-radius:6px;padding:4px 6px;font-size:12px}.dmPm3q_trigger:hover,.dmPm3q_trigger:focus-visible{opacity:1;background:color-mix(in srgb, currentColor 8%, transparent)}.dmPm3q_panel{z-index:100;border:1px solid color-mix(in srgb, currentColor 18%, transparent);width:280px;max-width:calc(100vw - 32px);color:var(--dsw-alias-label-primary,CanvasText);background:var(--dsw-specific-menu,Canvas);border-radius:12px;padding:16px;font-size:12px;position:absolute;bottom:calc(100% + 12px);right:0;box-shadow:0 8px 30px #0002}.dmPm3q_hint{opacity:.65;font-size:11px;line-height:1.6}.dmPm3q_window{margin-top:14px}.dmPm3q_row{justify-content:space-between;margin-bottom:5px;display:flex}.dmPm3q_window progress{accent-color:#39a878;width:100%;height:5px;margin-bottom:5px;display:block}.dmPm3q_window progress::-webkit-progress-bar{background:color-mix(in srgb, currentColor 15%, transparent);border-radius:4px}.dmPm3q_window progress::-webkit-progress-value{background:#39a878;border-radius:4px}.dmPm3q_window progress::-moz-progress-bar{background:#39a878;border-radius:4px}";
886
886
  document.head.appendChild(style);
887
887
  }
888
- var UsagePill_default = { "hint": "dmPm3q_hint", "row": "dmPm3q_row", "window": "dmPm3q_window", "root": "dmPm3q_root", "trigger": "dmPm3q_trigger", "panel": "dmPm3q_panel" };
888
+ var UsagePill_default = { "panel": "dmPm3q_panel", "trigger": "dmPm3q_trigger", "hint": "dmPm3q_hint", "root": "dmPm3q_root", "window": "dmPm3q_window", "row": "dmPm3q_row" };
889
889
 
890
890
  // src/client/UsagePill.tsx
891
891
  var import_jsx_runtime2 = require("react/jsx-runtime");
package/lib/index.js CHANGED
@@ -995,17 +995,12 @@ var OpencodeGoAdapter = class extends LlmAdapter {
995
995
  }
996
996
  async listModels(_provider) {
997
997
  const snapshot = await this.catalogOf(this.options.config()).snapshot(true);
998
- return [...[...snapshot.models.values()].map((model) => ({
998
+ return [...snapshot.models.values()].map((model) => ({
999
999
  provider: PROVIDER_ID,
1000
1000
  id: model.id,
1001
1001
  name: model.name,
1002
1002
  inputModalities: [...model.input]
1003
- })), ...[...snapshot.unavailable].map(([id, reason]) => ({
1004
- provider: PROVIDER_ID,
1005
- id,
1006
- name: id,
1007
- description: `Metadata unavailable: ${reason}`
1008
- }))];
1003
+ }));
1009
1004
  }
1010
1005
  async resolveModel(_provider, model, _signal) {
1011
1006
  const snapshot = await this.catalogOf(this.options.config()).forModel(model);
@@ -1018,9 +1013,10 @@ var OpencodeGoAdapter = class extends LlmAdapter {
1018
1013
  /** Describe one model: capacities plus the reasoning levels it actually offers. */
1019
1014
  modelInfo(model) {
1020
1015
  const reasoning = {};
1021
- if (model.reasoning) {
1016
+ const levels = model.reasoning ? getSupportedThinkingLevels(model) : [];
1017
+ if (levels.length > 0) {
1022
1018
  reasoning.reasoning = {
1023
- efforts: getSupportedThinkingLevels(model).map((level) => ({
1019
+ efforts: levels.map((level) => ({
1024
1020
  id: ReasoningEffortId(level),
1025
1021
  name: `${level.charAt(0).toUpperCase()}${level.slice(1)}`
1026
1022
  }))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-opencode-go",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "OpenCode Go model provider and settings UI for DeepSeek Harness",
5
5
  "type": "module",
6
6
  "license": "MIT",