dsh-tool-vision 0.3.9 → 0.3.10

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.
Files changed (2) hide show
  1. package/client.js +34 -14
  2. package/package.json +4 -4
package/client.js CHANGED
@@ -56,6 +56,16 @@ window.__ModuleLoader__.load({
56
56
  bridgeTextOnly: "图片桥接(文本模型贴图自动转 inspect_image 指引)",
57
57
  bridgeExportDir: "桥接图片导出目录(空 = 系统临时目录)",
58
58
  multimodalModels: "多模态白名单(逗号分隔,这些模型直收图片块)",
59
+ fieldBaseUrl: "API Base URL",
60
+ fieldApiKey: "API Key",
61
+ fieldApiKeyEnv: "API Key 环境变量(apiKey 为空时读取)",
62
+ fieldModel: "视觉模型",
63
+ fieldMaxTokens: "最大输出 Tokens",
64
+ fieldTimeoutMs: "请求超时(毫秒)",
65
+ fieldMaxImageBytes: "图片大小上限(字节)",
66
+ fieldBridgeTextOnly: "图片桥接开关",
67
+ fieldBridgeExportDir: "桥接导出目录",
68
+ fieldMultimodalModels: "多模态白名单(逗号分隔)",
59
69
  save: "保存",
60
70
  reset: "恢复默认",
61
71
  saved: "已保存",
@@ -75,6 +85,16 @@ window.__ModuleLoader__.load({
75
85
  bridgeTextOnly: "Image bridge (pasted images on text-only models become inspect_image hints)",
76
86
  bridgeExportDir: "Bridge export dir (empty = system temp)",
77
87
  multimodalModels: "Multimodal whitelist (comma-separated; these models receive image blocks directly)",
88
+ fieldBaseUrl: "API Base URL",
89
+ fieldApiKey: "API Key",
90
+ fieldApiKeyEnv: "API key env var (read when apiKey is empty)",
91
+ fieldModel: "Vision model",
92
+ fieldMaxTokens: "Max output tokens",
93
+ fieldTimeoutMs: "Request timeout (ms)",
94
+ fieldMaxImageBytes: "Max image size (bytes)",
95
+ fieldBridgeTextOnly: "Image bridge",
96
+ fieldBridgeExportDir: "Bridge export dir",
97
+ fieldMultimodalModels: "Multimodal whitelist (comma-separated)",
78
98
  save: "Save",
79
99
  reset: "Reset",
80
100
  saved: "Saved",
@@ -87,16 +107,16 @@ window.__ModuleLoader__.load({
87
107
 
88
108
  // ── field spec ────────────────────────────────────────────────────────
89
109
  var FIELDS = [
90
- { key: "baseURL", label: "API Base URL", type: "text", placeholder: "https://api.openai.com/v1" },
91
- { key: "apiKey", label: "API Key", type: "password", secret: true },
92
- { key: "apiKeyEnv", label: "API Key 环境变量(apiKey 为空时读取)", type: "text" },
93
- { key: "model", label: "视觉模型", type: "text", placeholder: "gpt-4o-mini" },
94
- { key: "maxTokens", label: "最大输出 Tokens", type: "number" },
95
- { key: "timeoutMs", label: "请求超时(毫秒)", type: "number" },
96
- { key: "maxImageBytes", label: "图片大小上限(字节)", type: "number" },
97
- { key: "bridgeTextOnly", label: "图片桥接开关", type: "checkbox" },
98
- { key: "bridgeExportDir", label: "桥接导出目录", type: "text" },
99
- { key: "multimodalModels", label: "多模态白名单(逗号分隔)", type: "csv" }
110
+ { key: "baseURL", label: "fieldBaseUrl", type: "text", placeholder: "https://api.openai.com/v1" },
111
+ { key: "apiKey", label: "fieldApiKey", type: "password", secret: true },
112
+ { key: "apiKeyEnv", label: "fieldApiKeyEnv", type: "text" },
113
+ { key: "model", label: "fieldModel", type: "text", placeholder: "gpt-4o-mini" },
114
+ { key: "maxTokens", label: "fieldMaxTokens", type: "number" },
115
+ { key: "timeoutMs", label: "fieldTimeoutMs", type: "number" },
116
+ { key: "maxImageBytes", label: "fieldMaxImageBytes", type: "number" },
117
+ { key: "bridgeTextOnly", label: "fieldBridgeTextOnly", type: "checkbox" },
118
+ { key: "bridgeExportDir", label: "fieldBridgeExportDir", type: "text" },
119
+ { key: "multimodalModels", label: "fieldMultimodalModels", type: "csv" }
100
120
  ];
101
121
  var ZH_HINTS = {
102
122
  apiKey: "apiKeyHint",
@@ -108,8 +128,8 @@ window.__ModuleLoader__.load({
108
128
  multimodalModels: "multimodalModels"
109
129
  };
110
130
 
111
- function labelOf(f) {
112
- return f.label;
131
+ function labelOf(f, t) {
132
+ return t(f.label);
113
133
  }
114
134
 
115
135
  // ── component ─────────────────────────────────────────────────────────
@@ -228,7 +248,7 @@ window.__ModuleLoader__.load({
228
248
  return h("label", { key: f.key, className: "__tv_field" },
229
249
  h("span", { className: "__tv_row" },
230
250
  h("input", { className: "__tv_check", type: "checkbox", checked: Boolean(fieldDraft(f)), onChange: function (e) { setField(f, e.target.checked); } }),
231
- h("span", { className: "__tv_label" }, labelOf(f)),
251
+ h("span", { className: "__tv_label" }, labelOf(f, t)),
232
252
  overridden ? h("span", { className: "__tv_override" }, t("overridden")) : null
233
253
  ),
234
254
  f.key in ZH_HINTS ? h("span", { className: "__tv_hint" }, t(ZH_HINTS[f.key])) : null
@@ -236,7 +256,7 @@ window.__ModuleLoader__.load({
236
256
  }
237
257
  return h("label", { key: f.key, className: "__tv_field" },
238
258
  h("span", { className: "__tv_label" },
239
- labelOf(f),
259
+ labelOf(f, t),
240
260
  overridden ? h("span", { className: "__tv_override" }, t("overridden")) : null
241
261
  ),
242
262
  h("input", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tool-vision",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
4
4
  "description": "DeepSeek Harness 外置视觉模型插件:inspect_image 把本地图片或 http(s) 图片 URL 发给任意 OpenAI 兼容端点,视觉模型看图的文字回答直接带回对话;附 Web UI 设置栏。",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -11,8 +11,8 @@
11
11
  },
12
12
  "dsh": {
13
13
  "bundle": {
14
- "patch": "./cordis.patch.yml"
15
- },
14
+ "patch": "./cordis.patch.yml"
15
+ },
16
16
  "client": {
17
17
  "platform": "web"
18
18
  }
@@ -58,4 +58,4 @@
58
58
  "@deepseek-ai/dsh-settings": "^0.1.0-rc.6",
59
59
  "@deepseek-ai/dsh-tools": "^0.1.0-rc.6"
60
60
  }
61
- }
61
+ }