@goodandready/dsh-ollama-cloud-provider 0.1.33 → 0.1.35

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.35 — 2026-11-09
4
+
5
+ - Security: enforce host authentication check (`verifyHost`) across all loopback write routes (`/config`, `/key`), closing unauthenticated mutation bypass on non-desktop browser requests (#111).
6
+ - Security: validate request `Referer` when `Origin` is omitted on GET endpoints to reject cross-origin ambient read requests (#112).
7
+ - Security: validate URL scheme in `OllamaWebFetchProvider.fetch` to reject non-HTTP schemes (`file:`, `ftp:`) and malformed URLs with structured `WebError` (#115).
8
+ - Localization: localized all 11 sampling and generation parameter labels and tokens header in the Chinese dictionary (`const zh`) (#113).
9
+ - Accessibility: added explicit `aria-label` attributes to standalone form controls (model selection checkbox, API key inputs, account credentials, model routing rules, model search) in the settings UI for WCAG 2.1 SC 4.1.2 compliance (#114).
10
+
11
+ ## 0.1.34 — 2026-11-07
12
+
13
+ - Security: patched transient zod memory exhaustion vulnerability (GHSA-mrhx-c7xc-m3w5) in dependencies via package overrides, achieving 0 audit vulnerabilities (#108).
14
+ - Component Testing: added automated test coverage for interactive state loading, failure reporting, and unmounting of `OllamaProviderCard` (#109).
15
+
3
16
  ## 0.1.33 — 2026-11-07
4
17
 
5
18
  - Security: closed fake-cookie verification bypass on write routes (`/config`, `/key`) and sensitive read routes (`/state`, `/analytics`, `/usage`, `/balance`) by requiring an anonymous control probe to fail with 401 or 403, failing closed against public or synthetic hosts (#42, #56).
package/README.md CHANGED
@@ -108,6 +108,12 @@ graph LR
108
108
  - **TUI settings section** for terminal profiles.
109
109
  - **One-click plugin update** in Settings → Ollama Cloud.
110
110
 
111
+ ## Requirements
112
+
113
+ - **DeepSeek Harness**: \0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0\ (desktop and web profiles).
114
+ - **Node.js**: \>=22.0.0\.
115
+ - **Ollama Cloud Account**: one or more active API keys from Ollama Cloud or a compatible proxy endpoint.
116
+
111
117
  ## Install
112
118
 
113
119
  Build and pack first:
@@ -121,17 +127,17 @@ npm pack
121
127
  Install the published package:
122
128
 
123
129
  ```bash
124
- dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.33
130
+ dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.34
125
131
  # DSH Desktop:
126
- dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.33
132
+ dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.34
127
133
  ```
128
134
 
129
135
  Or install the packed tarball into a profile:
130
136
 
131
137
  ```bash
132
- dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.33.tgz
138
+ dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.34.tgz
133
139
  # DSH Desktop:
134
- dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.33.tgz
140
+ dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.34.tgz
135
141
  ```
136
142
 
137
143
  Restart dsh (or DSH Desktop), then pick **Ollama Cloud** in the model picker.
package/README.ru.md CHANGED
@@ -90,6 +90,12 @@ graph LR
90
90
  - **Интеграция с терминалом (TUI)**: специальная секция настроек в терминальном режиме.
91
91
  - **One-Click обновление плагина**: прямая проверка npm registry и кнопка обновления в Web UI.
92
92
 
93
+ ## Requirements / Требования
94
+
95
+ - **DeepSeek Harness**: \0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0\ (профили desktop и web).
96
+ - **Node.js**: \>=22.0.0\.
97
+ - **Аккаунт Ollama Cloud**: один или несколько действующих API-ключей Ollama Cloud или совместимого прокси.
98
+
93
99
  ## Установка
94
100
 
95
101
  Сборка и упаковка из исходного кода:
@@ -103,17 +109,17 @@ npm pack
103
109
  Установка опубликованного пакета из npm:
104
110
 
105
111
  ```bash
106
- dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.33
112
+ dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.34
107
113
  # DSH Desktop:
108
- dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.33
114
+ dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.34
109
115
  ```
110
116
 
111
117
  Либо установка из упакованного tarball:
112
118
 
113
119
  ```bash
114
- dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.33.tgz
120
+ dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.34.tgz
115
121
  # DSH Desktop:
116
- dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.33.tgz
122
+ dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.34.tgz
117
123
  ```
118
124
 
119
125
  После установки перезапустите dsh (или DSH Desktop) и выберите **Ollama Cloud** в списке моделей.
package/README.zh.md CHANGED
@@ -89,6 +89,12 @@ graph LR
89
89
  - **`/ollama` 快捷指令**:快速查询状态、额度、余额、账号列表与执行联通性测试。
90
90
  - **一键热更新**:在 DSH 设置页直接检测 npm 最新版本并快速安装更新。
91
91
 
92
+ ## Requirements / 系统要求
93
+
94
+ - **DeepSeek Harness**: \0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0\(桌面版与 Web 配置文件)。
95
+ - **Node.js**: \>=22.0.0\。
96
+ - **Ollama Cloud 账户**: 一个或多个有效的 Ollama Cloud API Key 或兼容的代理端点。
97
+
92
98
  ## 安装指南
93
99
 
94
100
  从源码构建与打包:
@@ -102,17 +108,17 @@ npm pack
102
108
  从 npm 安装已发布版本:
103
109
 
104
110
  ```bash
105
- dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.33
111
+ dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.34
106
112
  # DSH 桌面端:
107
- dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.33
113
+ dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.34
108
114
  ```
109
115
 
110
116
  或通过打包文件安装:
111
117
 
112
118
  ```bash
113
- dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.33.tgz
119
+ dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.34.tgz
114
120
  # DSH 桌面端:
115
- dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.33.tgz
121
+ dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.34.tgz
116
122
  ```
117
123
 
118
124
  安装完成后重启 dsh 或 DSH 桌面端,在模型列表中选择 **Ollama Cloud** 即可。
package/lib/client.js CHANGED
@@ -292,7 +292,7 @@ window.__ModuleLoader__.load({
292
292
  window: "窗口",
293
293
  requests: "请求",
294
294
  spend: "费用",
295
- tokens: "Token",
295
+ tokens: "Token 数",
296
296
  spend7d: "7 天费用",
297
297
  remaining: "剩余",
298
298
  quotaIncludedCredits: "包含额度",
@@ -424,17 +424,17 @@ window.__ModuleLoader__.load({
424
424
  no: "否",
425
425
  generation: "生成默认值",
426
426
  generationHint: "Ollama 原生默认值;空字段不发送,请求参数优先。",
427
- temperature: "Temperature",
428
- topK: "Top K",
429
- topP: "Top P",
430
- minP: "Min P",
431
- seed: "Seed",
432
- repeatPenalty: "Repeat penalty",
433
- repeatLastN: "Repeat last N",
434
- numCtx: "num_ctx",
435
- keepAlive: "Keep alive",
427
+ temperature: "采样温度 (Temperature)",
428
+ topK: "Top K 采样",
429
+ topP: "Top P 采样",
430
+ minP: "Min P 采样",
431
+ seed: "随机种子 (Seed)",
432
+ repeatPenalty: "重复惩罚 (Repeat penalty)",
433
+ repeatLastN: "重复惩罚窗口 (Repeat last N)",
434
+ numCtx: "上下文大小 (num_ctx)",
435
+ keepAlive: "保活时间 (Keep-alive)",
436
436
  keepAliveHint: "Ollama keep_alive,例如 5m 或 -1。",
437
- stop: "Stop sequences",
437
+ stop: "停止序列 (Stop sequences)",
438
438
  stopHint: "逗号分隔,作为原生 stop 列表发送。",
439
439
  autoRefresh: "自动刷新模型目录",
440
440
  refreshMinutes: "刷新间隔(分钟)",
@@ -2220,6 +2220,7 @@ window.__ModuleLoader__.load({
2220
2220
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
2221
2221
  type: "checkbox",
2222
2222
  checked: visible,
2223
+ "aria-label": `${model.id} ${t("visibility")}`,
2223
2224
  onChange: (event) => onVisible(event.target.checked)
2224
2225
  }),
2225
2226
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
@@ -2550,6 +2551,7 @@ window.__ModuleLoader__.load({
2550
2551
  className: "ocl-input",
2551
2552
  type: "password",
2552
2553
  placeholder: t("pasteKey"),
2554
+ "aria-label": t("pasteKey"),
2553
2555
  value: keyDraft,
2554
2556
  onChange: (event) => setKeyDraft(event.target.value)
2555
2557
  }),
@@ -2753,6 +2755,7 @@ window.__ModuleLoader__.load({
2753
2755
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
2754
2756
  className: "ocl-input",
2755
2757
  placeholder: t("accountLabel"),
2758
+ "aria-label": t("accountLabel"),
2756
2759
  value: account.label,
2757
2760
  onChange: (event) => {
2758
2761
  const accounts = draft.accounts.map((entry, position) => position === index ? {
@@ -2765,6 +2768,7 @@ window.__ModuleLoader__.load({
2765
2768
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
2766
2769
  className: "ocl-input",
2767
2770
  placeholder: t("accountRef"),
2771
+ "aria-label": t("accountRef"),
2768
2772
  value: account.apiKeyEnv,
2769
2773
  onChange: (event) => {
2770
2774
  const accounts = draft.accounts.map((entry, position) => position === index ? {
@@ -2816,6 +2820,7 @@ window.__ModuleLoader__.load({
2816
2820
  className: "ocl-input",
2817
2821
  type: "password",
2818
2822
  placeholder: t("pasteKey"),
2823
+ "aria-label": `${t("pasteKey")} (${account.label})`,
2819
2824
  value: accountKeys[account.label] ?? "",
2820
2825
  onChange: (event) => {
2821
2826
  setAccountKeys((current) => ({
@@ -2918,6 +2923,7 @@ window.__ModuleLoader__.load({
2918
2923
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
2919
2924
  className: "ocl-input",
2920
2925
  placeholder: t("rulePattern"),
2926
+ "aria-label": t("rulePattern"),
2921
2927
  value: rule.pattern,
2922
2928
  onChange: (event) => {
2923
2929
  const rules = draft.modelAccountRules.map((entry, position) => position === index ? {
@@ -2930,6 +2936,7 @@ window.__ModuleLoader__.load({
2930
2936
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
2931
2937
  className: "ocl-input",
2932
2938
  placeholder: t("ruleAccount"),
2939
+ "aria-label": t("ruleAccount"),
2933
2940
  value: rule.account,
2934
2941
  onChange: (event) => {
2935
2942
  const rules = draft.modelAccountRules.map((entry, position) => position === index ? {
@@ -3093,6 +3100,7 @@ window.__ModuleLoader__.load({
3093
3100
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
3094
3101
  className: "ocl-input",
3095
3102
  placeholder: t("modelSearch"),
3103
+ "aria-label": t("modelSearch"),
3096
3104
  value: search,
3097
3105
  onChange: (event) => setSearch(event.target.value)
3098
3106
  }),
package/lib/index.js CHANGED
@@ -123,7 +123,7 @@ const DEFAULT_API_BASE = "https://ollama.com";
123
123
  const DEFAULT_OPENAI_BASE = "https://ollama.com/v1";
124
124
  const DEFAULT_USAGE_URL = "https://ollama.com/api/usage";
125
125
  const DEFAULT_BALANCE_URL = "https://ollama.com/api/balance";
126
- const DEFAULT_USER_AGENT = "dsh-ollama-cloud-provider/0.1.33";
126
+ const DEFAULT_USER_AGENT = "dsh-ollama-cloud-provider/0.1.34";
127
127
  const DEFAULT_CONTEXT_WINDOW = 131072;
128
128
  const DEFAULT_MAX_TOKENS = 32768;
129
129
  const DEFAULT_GENERATE_MAX_TOKENS = 131072;
@@ -4624,10 +4624,10 @@ function writeSourceError(req) {
4624
4624
  return sourceHost(referer) === host ? void 0 : "cross-origin request refused";
4625
4625
  }
4626
4626
  function allowedOrigin(req) {
4627
- const origin = req.headers.origin;
4628
- if (origin === void 0 || origin === "") return true;
4627
+ const source = req.headers.origin ?? req.headers.referer;
4628
+ if (source === void 0 || source === "") return true;
4629
4629
  try {
4630
- const parsed = new URL(origin);
4630
+ const parsed = new URL(source);
4631
4631
  const host = req.headers.host;
4632
4632
  if (host !== void 0 && parsed.host === host) return true;
4633
4633
  return parsed.hostname === "127.0.0.1" || parsed.hostname === "localhost" || parsed.hostname === "::1" || parsed.hostname === "[::1]";
@@ -4664,7 +4664,7 @@ async function readJson(req) {
4664
4664
  if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) throw new Error("body must be a JSON object");
4665
4665
  return parsed;
4666
4666
  }
4667
- async function requirePost(req, res, verifyDesktop) {
4667
+ async function requirePost(req, res, verifyHost) {
4668
4668
  if (req.method !== "POST") {
4669
4669
  json(res, 405, { error: "POST required" });
4670
4670
  return false;
@@ -4678,18 +4678,17 @@ async function requirePost(req, res, verifyDesktop) {
4678
4678
  json(res, 403, { error: "write endpoints are restricted to the local machine" });
4679
4679
  return false;
4680
4680
  }
4681
- if (desktopShellRequest(req)) {
4682
- if (!await verifyDesktop(req)) {
4683
- json(res, 403, { error: "desktop authentication failed" });
4684
- return false;
4685
- }
4686
- } else {
4681
+ if (!desktopShellRequest(req)) {
4687
4682
  const sourceError = writeSourceError(req);
4688
4683
  if (sourceError !== void 0) {
4689
4684
  json(res, 403, { error: sourceError });
4690
4685
  return false;
4691
4686
  }
4692
4687
  }
4688
+ if (!await verifyHost(req)) {
4689
+ json(res, 403, { error: "authentication required" });
4690
+ return false;
4691
+ }
4693
4692
  if (!(req.headers["content-type"] ?? "").includes("application/json")) {
4694
4693
  json(res, 415, { error: "application/json required" });
4695
4694
  return false;
@@ -5816,6 +5815,9 @@ var OllamaWebSearchProvider = class extends OllamaWebEndpoint {
5816
5815
  };
5817
5816
  var OllamaWebFetchProvider = class extends OllamaWebEndpoint {
5818
5817
  async fetch(request, signal) {
5818
+ if (!URL.canParse(request.url)) throw new WebError("invalid web fetch URL", "INVALID_URL");
5819
+ const parsed = new URL(request.url);
5820
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") throw new WebError("only http: and https: protocols are supported for web fetch", "UNSUPPORTED_PROTOCOL");
5819
5821
  const { status, body } = await postJson(this.options, "/api/web_fetch", { url: request.url }, signal);
5820
5822
  const decoded = decodeFetchResponse(body);
5821
5823
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-ollama-cloud-provider",
3
- "version": "0.1.33",
3
+ "version": "0.1.35",
4
4
  "description": "Ollama Cloud LLM provider plugin for DeepSeek Harness (dsh).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -62,12 +62,12 @@
62
62
  "0.2.2-alpha.3": "compatible",
63
63
  "0.2.2-rc.1": "compatible"
64
64
  },
65
- "dsh": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0"
65
+ "dsh": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0"
66
66
  }
67
67
  },
68
68
  "engines": {
69
69
  "node": ">=22",
70
- "dsh": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0"
70
+ "dsh": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0"
71
71
  },
72
72
  "scripts": {
73
73
  "build": "tsdown",
@@ -88,18 +88,18 @@
88
88
  ],
89
89
  "peerDependencies": {
90
90
  "@deepseek-ai/cordis": "~4.0.4 || ~4.0.5 || ~4.0.6-alpha.1 || ~4.1.0",
91
- "@deepseek-ai/dsh-attachment": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0",
92
- "@deepseek-ai/dsh-client-locale": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0",
93
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0",
94
- "@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0",
95
- "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0",
96
- "@deepseek-ai/dsh-commands": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0",
97
- "@deepseek-ai/dsh-credentials": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0",
98
- "@deepseek-ai/dsh-host-webserver": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0",
99
- "@deepseek-ai/dsh-launch-environment": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0",
100
- "@deepseek-ai/dsh-llm": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0",
101
- "@deepseek-ai/dsh-settings": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0",
102
- "@deepseek-ai/dsh-web": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0",
91
+ "@deepseek-ai/dsh-attachment": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0",
92
+ "@deepseek-ai/dsh-client-locale": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0",
93
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0",
94
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0",
95
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0",
96
+ "@deepseek-ai/dsh-commands": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0",
97
+ "@deepseek-ai/dsh-credentials": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0",
98
+ "@deepseek-ai/dsh-host-webserver": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0",
99
+ "@deepseek-ai/dsh-launch-environment": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0",
100
+ "@deepseek-ai/dsh-llm": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0",
101
+ "@deepseek-ai/dsh-settings": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0",
102
+ "@deepseek-ai/dsh-web": "0.2.0-rc.2 || >=0.2.1-rc.2 <0.2.3-0 || >=0.2.2-0 <0.2.3-0",
103
103
  "@deepseek-ai/schemastery": "~3.18.4 || ~3.18.5 || ~3.18.6-alpha.1 || ~3.19.0",
104
104
  "react": "^18.2.0"
105
105
  },
@@ -127,5 +127,8 @@
127
127
  "tsdown": "^0.22.2",
128
128
  "tsx": "^4.23.12",
129
129
  "typescript": "^5.7.2"
130
+ },
131
+ "overrides": {
132
+ "zod": "^4.6.7"
130
133
  }
131
134
  }