@goodandready/dsh-ollama-cloud-provider 0.1.7 → 0.1.9

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,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.9 — 2026-10-28
4
+
5
+ - Support DSH core `0.2.1-rc.4`: `compatibility.dshReleases`, `engines.dsh` and
6
+ every `@deepseek-ai/dsh-*` peer range now include it; devDependencies and the
7
+ lockfile are pinned to rc.4. Verified with `npm run check` (59/59) and an
8
+ isolated rc.4 web profile (activation, settings, catalog and a real request).
9
+
10
+ ## 0.1.8 — 2026-10-26
11
+
12
+ - Support DSH core `0.2.1-rc.3`: `compatibility.dshReleases`, `engines.dsh` and
13
+ every `@deepseek-ai/dsh-*` peer range now include it; devDependencies and the
14
+ lockfile are pinned to rc.3. Verified with `npm run check` (59/59) and three
15
+ concurrent test runs.
16
+
3
17
  ## 0.1.7 — 2026-10-22
4
18
 
5
19
  - Identify the Desktop renderer by the signed host auth cookie plus the desktop
package/README.md CHANGED
@@ -103,22 +103,22 @@ npm pack
103
103
  Install the published package:
104
104
 
105
105
  ```bash
106
- dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.7
106
+ dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.9
107
107
  # DSH Desktop:
108
- dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.7
108
+ dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.9
109
109
  ```
110
110
 
111
111
  Or install the packed tarball into a profile:
112
112
 
113
113
  ```bash
114
- dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.7.tgz
114
+ dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.9.tgz
115
115
  # DSH Desktop:
116
- dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.7.tgz
116
+ dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.9.tgz
117
117
  ```
118
118
 
119
119
  Restart dsh (or DSH Desktop), then pick **Ollama Cloud** in the model picker.
120
120
 
121
- > **Use the tarball, not the directory.** On dsh 0.2.1-rc.2 the Desktop CLI aliases a local
121
+ > **Use the tarball, not the directory.** On dsh 0.2.1-rc.2/rc.3 the Desktop CLI aliases a local
122
122
  > directory passed to `dsh plugin add` and overwrites the target's `package.json`.
123
123
 
124
124
  ## Configure
package/README.ru.md CHANGED
@@ -103,17 +103,17 @@ npm pack
103
103
  Установка опубликованного пакета из npm:
104
104
 
105
105
  ```bash
106
- dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.7
106
+ dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.9
107
107
  # DSH Desktop:
108
- dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.7
108
+ dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.9
109
109
  ```
110
110
 
111
111
  Либо установка из упакованного tarball:
112
112
 
113
113
  ```bash
114
- dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.7.tgz
114
+ dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.9.tgz
115
115
  # DSH Desktop:
116
- dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.7.tgz
116
+ dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.9.tgz
117
117
  ```
118
118
 
119
119
  После установки перезапустите dsh (или DSH Desktop) и выберите **Ollama Cloud** в списке моделей.
package/README.zh.md CHANGED
@@ -102,17 +102,17 @@ npm pack
102
102
  从 npm 安装已发布版本:
103
103
 
104
104
  ```bash
105
- dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.7
105
+ dsh plugin --profile web add @goodandready/dsh-ollama-cloud-provider@0.1.9
106
106
  # DSH 桌面端:
107
- dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.7
107
+ dsh plugin --profile desktop add @goodandready/dsh-ollama-cloud-provider@0.1.9
108
108
  ```
109
109
 
110
110
  或通过打包文件安装:
111
111
 
112
112
  ```bash
113
- dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.7.tgz
113
+ dsh plugin --profile web add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.9.tgz
114
114
  # DSH 桌面端:
115
- dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.7.tgz
115
+ dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-ollama-cloud-provider-0.1.9.tgz
116
116
  ```
117
117
 
118
118
  安装完成后重启 dsh 或 DSH 桌面端,在模型列表中选择 **Ollama Cloud** 即可。
package/lib/client.js CHANGED
@@ -6,7 +6,7 @@ window.__ModuleLoader__.load({
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
7
  let react = require("react");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
- //#region src/client/locales.ts
9
+ // src/client/locales.ts
10
10
  const NS = "settings.ollama";
11
11
  const dictionaries = {
12
12
  en: {
@@ -328,8 +328,7 @@ window.__ModuleLoader__.load({
328
328
  latestVersion: "最新"
329
329
  }
330
330
  };
331
- //#endregion
332
- //#region src/quota-model.ts
331
+ // src/quota-model.ts
333
332
  function bar(key, label, usedPercent, extra = {}) {
334
333
  const used = Math.max(0, Math.min(100, usedPercent));
335
334
  return {
@@ -384,8 +383,7 @@ window.__ModuleLoader__.load({
384
383
  }
385
384
  ].filter((entry) => entry !== void 0);
386
385
  }
387
- //#endregion
388
- //#region src/client/api.ts
386
+ // src/client/api.ts
389
387
  async function call(path, init) {
390
388
  const response = await fetch(path, {
391
389
  credentials: "same-origin",
@@ -458,8 +456,7 @@ window.__ModuleLoader__.load({
458
456
  body: JSON.stringify({ model })
459
457
  });
460
458
  }
461
- //#endregion
462
- //#region src/client/heatmap.tsx
459
+ // src/client/heatmap.tsx
463
460
  const DAYS = [
464
461
  "Mon",
465
462
  "Tue",
@@ -668,11 +665,9 @@ window.__ModuleLoader__.load({
668
665
  ]
669
666
  });
670
667
  }
671
- //#endregion
672
- //#region src/client/events.ts
668
+ // src/client/events.ts
673
669
  const CONFIG_CHANGED_EVENT = "dsh-ollama-config-changed";
674
- //#endregion
675
- //#region src/client/settings-widgets.tsx
670
+ // src/client/settings-widgets.tsx
676
671
  function Field(props) {
677
672
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
678
673
  className: "ocl-field",
@@ -709,8 +704,7 @@ window.__ModuleLoader__.load({
709
704
  if (account.coolingUntil <= 0) return label;
710
705
  return `${label} · ${untilText(account.coolingUntil)}`;
711
706
  }
712
- //#endregion
713
- //#region src/client/usage-analytics.tsx
707
+ // src/client/usage-analytics.tsx
714
708
  function compact(value) {
715
709
  if (!Number.isFinite(value) || value <= 0) return "0";
716
710
  if (value >= 1e6) return `${(value / 1e6).toFixed(1)}M`;
@@ -919,8 +913,7 @@ window.__ModuleLoader__.load({
919
913
  tab === "sessions" ? sessionRows(analytics, t) : null
920
914
  ] });
921
915
  }
922
- //#endregion
923
- //#region src/client/usage-bars.tsx
916
+ // src/client/usage-bars.tsx
924
917
  function percentClass(percent) {
925
918
  if (percent >= 90) return "ocl-bar-fill ocl-bar-fill-bad";
926
919
  if (percent >= 75) return "ocl-bar-fill ocl-bar-fill-warn";
@@ -978,8 +971,7 @@ window.__ModuleLoader__.load({
978
971
  }, entry.key))
979
972
  });
980
973
  }
981
- //#endregion
982
- //#region src/client/quota-card.tsx
974
+ // src/client/quota-card.tsx
983
975
  const PANEL_EVENT = "dsh-ollama-panel-state";
984
976
  function broadcastPanel(open) {
985
977
  window.dispatchEvent(new CustomEvent(PANEL_EVENT, { detail: { open } }));
@@ -1429,8 +1421,7 @@ window.__ModuleLoader__.load({
1429
1421
  ]
1430
1422
  });
1431
1423
  }
1432
- //#endregion
1433
- //#region src/client/settings-draft.ts
1424
+ // src/client/settings-draft.ts
1434
1425
  function draftOf(state) {
1435
1426
  const allIds = state.models.map((model) => model.id);
1436
1427
  return {
@@ -1502,8 +1493,7 @@ window.__ModuleLoader__.load({
1502
1493
  return false;
1503
1494
  }
1504
1495
  }
1505
- //#endregion
1506
- //#region src/client/update-card.tsx
1496
+ // src/client/update-card.tsx
1507
1497
  function PluginUpdateCard(props) {
1508
1498
  const { t } = props;
1509
1499
  const [status, setStatus] = (0, react.useState)(null);
@@ -1586,8 +1576,7 @@ window.__ModuleLoader__.load({
1586
1576
  ]
1587
1577
  });
1588
1578
  }
1589
- //#endregion
1590
- //#region src/client/settings-page.tsx
1579
+ // src/client/settings-page.tsx
1591
1580
  function ModelEntry(props) {
1592
1581
  const { model, visible, transport, onVisible, onTransport, t } = props;
1593
1582
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -2494,8 +2483,7 @@ window.__ModuleLoader__.load({
2494
2483
  ]
2495
2484
  });
2496
2485
  }
2497
- //#endregion
2498
- //#region src/client/styles.ts
2486
+ // src/client/styles.ts
2499
2487
  const CSS_ID = "dsh-ollama-cloud-provider";
2500
2488
  const CSS = `
2501
2489
  :where(.ocl-page, .ocl-panel, .ocl-card, .ocl-foot, .ocl-railButton) {
@@ -2615,8 +2603,7 @@ window.__ModuleLoader__.load({
2615
2603
  .ocl-table th, .ocl-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--ocl-border-soft); vertical-align: top; }
2616
2604
  .ocl-table th { font-weight: 600; opacity: 0.8; }
2617
2605
  `;
2618
- //#endregion
2619
- //#region src/client/index.tsx
2606
+ // src/client/index.tsx
2620
2607
  function injectCss() {
2621
2608
  if (typeof document === "undefined") return () => {};
2622
2609
  if (document.querySelector(`style[data-plugin-css="dsh-ollama-cloud-provider"]`) !== null) return () => {};
@@ -2662,7 +2649,6 @@ window.__ModuleLoader__.load({
2662
2649
  }, QuotaCard));
2663
2650
  });
2664
2651
  }
2665
- //#endregion
2666
2652
  exports.apply = apply;
2667
2653
  exports.inject = inject;
2668
2654
  return module.exports;
package/lib/index.d.ts CHANGED
@@ -3,7 +3,6 @@ import z from "@deepseek-ai/schemastery";
3
3
  import { Context } from "@deepseek-ai/cordis";
4
4
  import { AttachmentStore } from "@deepseek-ai/dsh-attachment";
5
5
  import { WebServer } from "@deepseek-ai/dsh-host-webserver";
6
- //#region src/config.d.ts
7
6
  type TransportId = 'native' | 'openai-chat';
8
7
  interface AccountConfig {
9
8
  label?: string;
@@ -102,8 +101,6 @@ interface ResolvedConfig {
102
101
  }
103
102
  /** Normalize a raw config (possibly bypassing schemastery) into request facts. */
104
103
  declare function resolveConfig(config: Config): ResolvedConfig;
105
- //#endregion
106
- //#region src/credentials.d.ts
107
104
  interface ResolvedKey {
108
105
  readonly key: string;
109
106
  readonly source: string;
@@ -123,8 +120,6 @@ interface KeyPool {
123
120
  declare function createKeyPool(ctx: Context, config: () => ResolvedConfig): KeyPool;
124
121
  /** Backwards-compatible single-key facade over the pool. */
125
122
  declare function createKeyResolver(ctx: Context, config: () => ResolvedConfig): KeyResolver;
126
- //#endregion
127
- //#region src/request-log.d.ts
128
123
  interface RequestOutcome {
129
124
  ok: boolean;
130
125
  latencyMs: number;
@@ -161,8 +156,6 @@ interface RequestHeatmap {
161
156
  models: ModelRequestHeatmap[];
162
157
  accounts: AccountRequestHeatmap[];
163
158
  }
164
- //#endregion
165
- //#region src/adapter.d.ts
166
159
  type RoutingReason = 'rule' | 'sticky' | 'pinned' | 'default' | 'rotation';
167
160
  interface RoutingTraceEntry {
168
161
  readonly at: number;
@@ -235,12 +228,8 @@ declare class OllamaCloudAdapter extends LlmAdapter {
235
228
  private markCooldown;
236
229
  private isTransient;
237
230
  }
238
- //#endregion
239
- //#region src/provider-ids.d.ts
240
231
  /** Provider route owned by this plugin. */
241
232
  declare const PROVIDER = "ollama-cloud";
242
- //#endregion
243
- //#region src/usage.d.ts
244
233
  type UsageRange = '24h' | '7d' | '30d';
245
234
  interface UsageTotals {
246
235
  requests: number;
@@ -299,8 +288,6 @@ declare function normalizeUsage(payload: unknown, range: UsageRange): {
299
288
  };
300
289
  /** Cached reader for Ollama Cloud balance and usage. Fail-open by design. */
301
290
  declare function createUsageReader(config: () => ResolvedConfig, resolveKey: KeyResolver, fetchImpl?: typeof fetch): UsageReader;
302
- //#endregion
303
- //#region src/commands.d.ts
304
291
  interface CommandDeps {
305
292
  readonly config: () => ResolvedConfig;
306
293
  readonly pool: KeyPool;
@@ -308,8 +295,6 @@ interface CommandDeps {
308
295
  readonly adapter: OllamaCloudAdapter;
309
296
  }
310
297
  declare function applyCommands(ctx: Context, deps: CommandDeps): void;
311
- //#endregion
312
- //#region src/analytics.d.ts
313
298
  interface ModelUsageRow {
314
299
  provider: string;
315
300
  model: string;
@@ -385,8 +370,6 @@ interface AnalyticsReport {
385
370
  days: DayUsageRow[];
386
371
  sessions: SessionUsageRow[];
387
372
  }
388
- //#endregion
389
- //#region src/routes.d.ts
390
373
  interface RouteDeps {
391
374
  readonly config: () => ResolvedConfig;
392
375
  readonly adapter: OllamaCloudAdapter;
@@ -398,16 +381,12 @@ interface RouteDeps {
398
381
  }
399
382
  /** Register the Host HTTP surface consumed by the browser settings page. */
400
383
  declare function applyRoutes(ctx: Context, web: WebServer, deps: RouteDeps): void;
401
- //#endregion
402
- //#region src/errors.d.ts
403
384
  /**
404
385
  * Translate an Ollama Cloud HTTP failure into the harness failure taxonomy.
405
386
  * Ollama reports everything as `{"error": "..."}`, so both the status and the
406
387
  * message matter.
407
388
  */
408
389
  declare function classifyResponseError(status: number, text: string, headers: Headers): LlmError;
409
- //#endregion
410
- //#region src/models.generated.d.ts
411
390
  type OllamaCloudTransport = 'native' | 'openai-chat';
412
391
  interface ModelCost {
413
392
  readonly input: number;
@@ -432,16 +411,12 @@ interface OllamaCloudModelMeta {
432
411
  readonly defaultReasoning?: string;
433
412
  readonly cost: ModelCost;
434
413
  }
435
- //#endregion
436
- //#region src/catalog.d.ts
437
414
  declare function clearCatalogCache(): void;
438
415
  interface EffectiveModel extends OllamaCloudModelMeta {
439
416
  readonly transport: TransportId;
440
417
  }
441
418
  declare function effectiveModel(id: string, config: ResolvedConfig): EffectiveModel;
442
419
  declare function describeModel(meta: EffectiveModel, config: ResolvedConfig): string;
443
- //#endregion
444
- //#region src/index.d.ts
445
420
  declare const name = "llm-ollama-cloud";
446
421
  declare const inject: string[];
447
422
  /**
@@ -450,6 +425,5 @@ declare const inject: string[];
450
425
  * without a restart.
451
426
  */
452
427
  declare function apply(ctx: Context, config: Config): void;
453
- //#endregion
454
428
  export { type CommandDeps, Config, type Config as OllamaCloudConfig, OllamaCloudAdapter, type OllamaCloudAdapterDeps, PROVIDER, type ResolvedConfig, type ResolvedKey, type RouteDeps, type TransportId, type UsageReport, type UsageResult, type UsageWindow, apply, applyCommands, applyRoutes, classifyResponseError, clearCatalogCache, createKeyPool, createKeyResolver, createUsageReader, describeModel, effectiveModel, inject, name, normalizeBalance, normalizeUsage, resolveConfig };
455
429
  //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -9,7 +9,7 @@ import { credentialRef } from "@deepseek-ai/dsh-credentials";
9
9
  import { launchEnvironmentOf } from "@deepseek-ai/dsh-launch-environment";
10
10
  import { spawn } from "node:child_process";
11
11
  import { fileURLToPath } from "node:url";
12
- //#region src/account-rules.ts
12
+ // src/account-rules.ts
13
13
  function glob(pattern) {
14
14
  const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
15
15
  return new RegExp(`^${escaped}$`, "i");
@@ -32,8 +32,7 @@ function orderKeysForModel(keys, model, rules) {
32
32
  if (preferred === void 0) return keys;
33
33
  return [preferred, ...keys.filter((entry) => entry !== preferred)];
34
34
  }
35
- //#endregion
36
- //#region src/best-effort.ts
35
+ // src/best-effort.ts
37
36
  let sink;
38
37
  function setBestEffortLogger(logger) {
39
38
  sink = logger;
@@ -43,15 +42,14 @@ function bestEffortFailed(label, error) {
43
42
  sink?.debug?.(`${label}: ${error instanceof Error ? error.message : String(error)}`);
44
43
  } catch {}
45
44
  }
46
- //#endregion
47
- //#region src/config.ts
45
+ // src/config.ts
48
46
  const NS = "llm-ollama-cloud";
49
47
  const DEFAULT_API_KEY_ENV = "OLLAMA_API_KEY";
50
48
  const DEFAULT_API_BASE = "https://ollama.com";
51
49
  const DEFAULT_OPENAI_BASE = "https://ollama.com/v1";
52
50
  const DEFAULT_USAGE_URL = "https://ollama.com/api/usage";
53
51
  const DEFAULT_BALANCE_URL = "https://ollama.com/api/balance";
54
- const DEFAULT_USER_AGENT = "dsh-ollama-cloud-provider/0.1.7";
52
+ const DEFAULT_USER_AGENT = "dsh-ollama-cloud-provider/0.1.9";
55
53
  const DEFAULT_CONTEXT_WINDOW = 131072;
56
54
  const DEFAULT_MAX_TOKENS = 32768;
57
55
  const DEFAULT_GENERATE_MAX_TOKENS = 131072;
@@ -184,8 +182,7 @@ function resolveConfig(config) {
184
182
  userAgent: typeof config.userAgent === "string" && config.userAgent !== "" ? config.userAgent : DEFAULT_USER_AGENT
185
183
  };
186
184
  }
187
- //#endregion
188
- //#region src/models.generated.ts
185
+ // src/models.generated.ts
189
186
  const GENERATED_MODELS = {
190
187
  "beam": {
191
188
  "id": "beam",
@@ -681,8 +678,7 @@ const GENERATED_MODELS = {
681
678
  }
682
679
  }
683
680
  };
684
- //#endregion
685
- //#region src/pricing.ts
681
+ // src/pricing.ts
686
682
  /** `gpt-oss:120b` → `gpt-oss`; used as the second lookup key. */
687
683
  function baseIdOf(id) {
688
684
  const at = id.indexOf(":");
@@ -754,8 +750,7 @@ function formatUsd(value) {
754
750
  if (Math.abs(value) >= .01) return `$${value.toFixed(3)}`;
755
751
  return `$${value.toFixed(4)}`;
756
752
  }
757
- //#endregion
758
- //#region src/routing.ts
753
+ // src/routing.ts
759
754
  function trim(url) {
760
755
  return url.replace(/\/+$/, "");
761
756
  }
@@ -772,8 +767,7 @@ function tagsUrlFor(config) {
772
767
  function endpointFor(transport, config) {
773
768
  return transport === "openai-chat" ? `${trim(config.openAiBase)}/chat/completions` : `${rootFor(config)}/api/chat`;
774
769
  }
775
- //#endregion
776
- //#region src/catalog.ts
770
+ // src/catalog.ts
777
771
  const CATALOG_TTL_MS = 6e5;
778
772
  const CATALOG_TIMEOUT_MS = 15e3;
779
773
  const liveMeta = /* @__PURE__ */ new Map();
@@ -972,8 +966,7 @@ function describeModel(meta, config) {
972
966
  if (meta.reasoning.length > 0) parts.push(`reasoning: ${meta.reasoning.join("/")}`);
973
967
  return parts.join(" · ");
974
968
  }
975
- //#endregion
976
- //#region src/errors.ts
969
+ // src/errors.ts
977
970
  function parseErrorBody(text) {
978
971
  try {
979
972
  const body = JSON.parse(text);
@@ -1037,8 +1030,7 @@ function classifyStreamError(value, status = 200) {
1037
1030
  if (value.error === void 0) return void 0;
1038
1031
  return classifyResponseError(status, JSON.stringify(value), new Headers());
1039
1032
  }
1040
- //#endregion
1041
- //#region src/images.ts
1033
+ // src/images.ts
1042
1034
  const MAX_LONG_EDGE = 1568;
1043
1035
  const MAX_BYTES = 1048576;
1044
1036
  /** Total base64 image budget for one request; leaves room under the gateway cap. */
@@ -1114,8 +1106,7 @@ async function resolveImages(options, store, signal) {
1114
1106
  function offloadPlaceholder(ref) {
1115
1107
  return `[image omitted: ${ref.name ?? ref.attachmentId}]`;
1116
1108
  }
1117
- //#endregion
1118
- //#region src/files.ts
1109
+ // src/files.ts
1119
1110
  /**
1120
1111
  * Model-facing handle for a file when the adapter receives a raw FileBlock.
1121
1112
  * The harness normally projects files to text with an execution-world path
@@ -1125,8 +1116,7 @@ function filePlaceholder(ref) {
1125
1116
  const digest = String(ref.attachmentId).slice(7, 15);
1126
1117
  return `[File ${JSON.stringify(ref.name)} (${ref.bytes} bytes, sha256:${digest}) was uploaded, but the current execution environment cannot access a readable path. Report that limitation if its contents are needed; do not claim to have read it.]`;
1127
1118
  }
1128
- //#endregion
1129
- //#region src/tool-schema.ts
1119
+ // src/tool-schema.ts
1130
1120
  /**
1131
1121
  * Normalize a tool's parameters schema to the object root the gateway
1132
1122
  * validates. Ported behavior from the Command Code provider: pass an object
@@ -1232,8 +1222,7 @@ function normalizeToolParameters(parameters, depth = 0) {
1232
1222
  additionalProperties: true
1233
1223
  };
1234
1224
  }
1235
- //#endregion
1236
- //#region src/messages.ts
1225
+ // src/messages.ts
1237
1226
  function textOnly(content) {
1238
1227
  const parts = [];
1239
1228
  for (const block of content) if (block.type === "text") parts.push(block.text);
@@ -1464,13 +1453,11 @@ function buildChatBody(options, model, config, images) {
1464
1453
  ...options.stop === void 0 || options.stop.length === 0 ? {} : { stop: options.stop }
1465
1454
  };
1466
1455
  }
1467
- //#endregion
1468
- //#region src/provider-ids.ts
1456
+ // src/provider-ids.ts
1469
1457
  /** Provider route owned by this plugin. */
1470
1458
  const PROVIDER = "ollama-cloud";
1471
1459
  const PLUGIN_AND_LEGACY_PROVIDERS = /* @__PURE__ */ new Set([PROVIDER, ...["ollama"]]);
1472
- //#endregion
1473
- //#region src/request-log.ts
1460
+ // src/request-log.ts
1474
1461
  const DAY_MS$1 = 864e5;
1475
1462
  const MAX_LOG_BYTES = 2097152;
1476
1463
  const KEEP_LINES = 5e3;
@@ -1696,8 +1683,7 @@ function limitTools(tools, max = 128) {
1696
1683
  const rest = out.filter((tool) => !CORE_TOOLS.has(tool.name));
1697
1684
  return [...core, ...rest].slice(0, max);
1698
1685
  }
1699
- //#endregion
1700
- //#region src/transports/ndjson.ts
1686
+ // src/transports/ndjson.ts
1701
1687
  async function readWithIdleTimeout$1(reader, idleTimeoutMs, signal) {
1702
1688
  if (signal?.aborted === true) throw signal.reason;
1703
1689
  return await new Promise((resolve, reject) => {
@@ -1754,8 +1740,7 @@ async function* ndjsonObjects(body, idleTimeoutMs, signal) {
1754
1740
  reader.releaseLock();
1755
1741
  }
1756
1742
  }
1757
- //#endregion
1758
- //#region src/transports/native.ts
1743
+ // src/transports/native.ts
1759
1744
  function count$1(value) {
1760
1745
  return typeof value === "number" && Number.isFinite(value) && value >= 0 ? Math.trunc(value) : void 0;
1761
1746
  }
@@ -1903,8 +1888,7 @@ async function* parseNativeStream(response, idleTimeoutMs, signal) {
1903
1888
  }
1904
1889
  if (!sawContent) throw new LlmError("Ollama Cloud returned an empty stream", "EMPTY_RESPONSE");
1905
1890
  }
1906
- //#endregion
1907
- //#region src/transports/sse.ts
1891
+ // src/transports/sse.ts
1908
1892
  async function readWithIdleTimeout(reader, idleTimeoutMs, signal) {
1909
1893
  if (signal?.aborted === true) throw signal.reason;
1910
1894
  return await new Promise((resolve, reject) => {
@@ -1956,8 +1940,7 @@ async function* sseData(body, idleTimeoutMs, signal) {
1956
1940
  reader.releaseLock();
1957
1941
  }
1958
1942
  }
1959
- //#endregion
1960
- //#region src/transports/openai-chat.ts
1943
+ // src/transports/openai-chat.ts
1961
1944
  function mapUsage(usage) {
1962
1945
  const prompt = usage.prompt_tokens ?? 0;
1963
1946
  const cached = usage.prompt_tokens_details?.cached_tokens ?? 0;
@@ -2220,8 +2203,7 @@ async function* parseCompletion(chunk) {
2220
2203
  reason: finishReasonOf(choice?.finish_reason, (message?.tool_calls?.length ?? 0) > 0)
2221
2204
  };
2222
2205
  }
2223
- //#endregion
2224
- //#region src/adapter.ts
2206
+ // src/adapter.ts
2225
2207
  function storagePath(file) {
2226
2208
  const home = process.env.DSH_HOME?.trim() || join(homedir(), ".dsh");
2227
2209
  return join(home, "storages", "dsh-ollama", file);
@@ -2650,8 +2632,7 @@ function offLabel(id, meta) {
2650
2632
  if (id === "high" && meta.reasoningToggle) return "On";
2651
2633
  return effortName(id);
2652
2634
  }
2653
- //#endregion
2654
- //#region src/quota-model.ts
2635
+ // src/quota-model.ts
2655
2636
  function bar$1(key, label, usedPercent, extra = {}) {
2656
2637
  const used = Math.max(0, Math.min(100, usedPercent));
2657
2638
  return {
@@ -2703,8 +2684,7 @@ function windowRows(report) {
2703
2684
  }
2704
2685
  ].filter((entry) => entry !== void 0);
2705
2686
  }
2706
- //#endregion
2707
- //#region src/commands.ts
2687
+ // src/commands.ts
2708
2688
  function bar(percent, width = 10) {
2709
2689
  const clamped = Math.max(0, Math.min(100, percent));
2710
2690
  const filled = Math.round(clamped / 100 * width);
@@ -2878,8 +2858,7 @@ function applyCommands(ctx, deps) {
2878
2858
  }
2879
2859
  });
2880
2860
  }
2881
- //#endregion
2882
- //#region src/credentials.ts
2861
+ // src/credentials.ts
2883
2862
  async function resolveRef(ctx, refName) {
2884
2863
  const credentials = ctx.get("credentials");
2885
2864
  if (credentials !== void 0) try {
@@ -2977,8 +2956,7 @@ function missingKey(config) {
2977
2956
  function createKeyResolver(ctx, config) {
2978
2957
  return createKeyPool(ctx, config).resolve;
2979
2958
  }
2980
- //#endregion
2981
- //#region src/plugin-updater.ts
2959
+ // src/plugin-updater.ts
2982
2960
  const UPDATE_HEADER = "x-dsh-plugin-update";
2983
2961
  const UPDATE_TIMEOUT_MS = 6e5;
2984
2962
  const VERSION_CACHE_MS = 3e5;
@@ -3261,8 +3239,7 @@ function registerPluginUpdater(ctx, options) {
3261
3239
  }
3262
3240
  });
3263
3241
  }
3264
- //#endregion
3265
- //#region src/analytics.ts
3242
+ // src/analytics.ts
3266
3243
  const DAY_MS = 864e5;
3267
3244
  const CACHE_TTL_MS = 6e4;
3268
3245
  const MAX_FILES = 5e3;
@@ -3545,8 +3522,7 @@ async function readModelAnalytics(days = 30, priceOverrides = {}) {
3545
3522
  });
3546
3523
  return report;
3547
3524
  }
3548
- //#endregion
3549
- //#region src/routes-public.ts
3525
+ // src/routes-public.ts
3550
3526
  function publicConfig(config) {
3551
3527
  return {
3552
3528
  apiKeyEnv: config.apiKeyEnv,
@@ -3580,8 +3556,7 @@ function publicConfig(config) {
3580
3556
  userAgent: config.userAgent
3581
3557
  };
3582
3558
  }
3583
- //#endregion
3584
- //#region src/routes-values.ts
3559
+ // src/routes-values.ts
3585
3560
  const TRANSPORTS = /* @__PURE__ */ new Set(["native", "openai-chat"]);
3586
3561
  function cleanAccounts(value) {
3587
3562
  if (!Array.isArray(value)) return [];
@@ -3650,8 +3625,7 @@ function cleanPrices(value) {
3650
3625
  }
3651
3626
  return out;
3652
3627
  }
3653
- //#endregion
3654
- //#region src/routes.ts
3628
+ // src/routes.ts
3655
3629
  const MAX_BODY_BYTES = 262144;
3656
3630
  function json(res, status, value) {
3657
3631
  res.statusCode = status;
@@ -4165,8 +4139,7 @@ function applyRoutes(ctx, web, deps) {
4165
4139
  for (const dispose of disposers.splice(0)) dispose();
4166
4140
  }, "dsh-ollama-cloud-provider: HTTP routes");
4167
4141
  }
4168
- //#endregion
4169
- //#region src/tui-settings.ts
4142
+ // src/tui-settings.ts
4170
4143
  const TUI_ACCOUNT_AUTO = "auto";
4171
4144
  function setOrClear(text) {
4172
4145
  const trimmed = text.trim();
@@ -4407,8 +4380,7 @@ function applyOllamaTuiSettings(ctx, deps) {
4407
4380
  }, "dsh-ollama-cloud-provider: tui settings section");
4408
4381
  return refresh;
4409
4382
  }
4410
- //#endregion
4411
- //#region src/usage.ts
4383
+ // src/usage.ts
4412
4384
  const BALANCE_TTL_MS = 6e4;
4413
4385
  const USAGE_TTL_MS = 12e4;
4414
4386
  const FAILURE_TTL_MS = 3e4;
@@ -4617,8 +4589,7 @@ function createUsageReader(config, resolveKey, fetchImpl = fetch) {
4617
4589
  };
4618
4590
  return reader;
4619
4591
  }
4620
- //#endregion
4621
- //#region src/index.ts
4592
+ // src/index.ts
4622
4593
  const name = "llm-ollama-cloud";
4623
4594
  const inject = ["llm"];
4624
4595
  /**
@@ -4698,7 +4669,6 @@ function apply(ctx, config) {
4698
4669
  }), "dsh-ollama-cloud-provider: plugin updater");
4699
4670
  });
4700
4671
  }
4701
- //#endregion
4702
4672
  export { Config, OllamaCloudAdapter, PROVIDER, apply, applyCommands, applyRoutes, classifyResponseError, clearCatalogCache, createKeyPool, createKeyResolver, createUsageReader, describeModel, effectiveModel, inject, name, normalizeBalance, normalizeUsage, resolveConfig };
4703
4673
 
4704
4674
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-ollama-cloud-provider",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Ollama Cloud LLM provider plugin for DeepSeek Harness (dsh).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -55,14 +55,16 @@
55
55
  "compatibility": {
56
56
  "dshReleases": {
57
57
  "0.2.0-rc.2": "compatible",
58
- "0.2.1-rc.2": "compatible"
58
+ "0.2.1-rc.2": "compatible",
59
+ "0.2.1-rc.3": "compatible",
60
+ "0.2.1-rc.4": "compatible"
59
61
  },
60
- "dsh": "0.2.0-rc.2 || 0.2.1-rc.2"
62
+ "dsh": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4"
61
63
  }
62
64
  },
63
65
  "engines": {
64
66
  "node": ">=22",
65
- "dsh": "0.2.0-rc.2 || 0.2.1-rc.2"
67
+ "dsh": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4"
66
68
  },
67
69
  "scripts": {
68
70
  "build": "tsdown",
@@ -83,33 +85,33 @@
83
85
  ],
84
86
  "peerDependencies": {
85
87
  "@deepseek-ai/cordis": "~4.0.4 || ~4.0.5",
86
- "@deepseek-ai/dsh-attachment": "0.2.0-rc.2 || 0.2.1-rc.2",
87
- "@deepseek-ai/dsh-client-locale": "0.2.0-rc.2 || 0.2.1-rc.2",
88
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.2 || 0.2.1-rc.2",
89
- "@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.2 || 0.2.1-rc.2",
90
- "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2 || 0.2.1-rc.2",
91
- "@deepseek-ai/dsh-commands": "0.2.0-rc.2 || 0.2.1-rc.2",
92
- "@deepseek-ai/dsh-credentials": "0.2.0-rc.2 || 0.2.1-rc.2",
93
- "@deepseek-ai/dsh-host-webserver": "0.2.0-rc.2 || 0.2.1-rc.2",
94
- "@deepseek-ai/dsh-launch-environment": "0.2.0-rc.2 || 0.2.1-rc.2",
95
- "@deepseek-ai/dsh-llm": "0.2.0-rc.2 || 0.2.1-rc.2",
96
- "@deepseek-ai/dsh-settings": "0.2.0-rc.2 || 0.2.1-rc.2",
88
+ "@deepseek-ai/dsh-attachment": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4",
89
+ "@deepseek-ai/dsh-client-locale": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4",
90
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4",
91
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4",
92
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4",
93
+ "@deepseek-ai/dsh-commands": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4",
94
+ "@deepseek-ai/dsh-credentials": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4",
95
+ "@deepseek-ai/dsh-host-webserver": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4",
96
+ "@deepseek-ai/dsh-launch-environment": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4",
97
+ "@deepseek-ai/dsh-llm": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4",
98
+ "@deepseek-ai/dsh-settings": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4",
97
99
  "@deepseek-ai/schemastery": "~3.18.4 || ~3.18.5",
98
100
  "react": "^18.2.0"
99
101
  },
100
102
  "devDependencies": {
101
103
  "@deepseek-ai/cordis": "~4.0.5",
102
- "@deepseek-ai/dsh-attachment": "0.2.1-rc.2",
103
- "@deepseek-ai/dsh-client-locale": "^0.2.1-rc.2",
104
- "@deepseek-ai/dsh-client-ui-renderer": "^0.2.1-rc.2",
105
- "@deepseek-ai/dsh-client-ui-settings": "^0.2.1-rc.2",
106
- "@deepseek-ai/dsh-client-ui-slots": "^0.2.1-rc.2",
107
- "@deepseek-ai/dsh-commands": "0.2.1-rc.2",
108
- "@deepseek-ai/dsh-credentials": "0.2.1-rc.2",
109
- "@deepseek-ai/dsh-host-webserver": "^0.2.1-rc.2",
110
- "@deepseek-ai/dsh-launch-environment": "0.2.1-rc.2",
111
- "@deepseek-ai/dsh-llm": "0.2.1-rc.2",
112
- "@deepseek-ai/dsh-settings": "0.2.1-rc.2",
104
+ "@deepseek-ai/dsh-attachment": "0.2.1-rc.4",
105
+ "@deepseek-ai/dsh-client-locale": "0.2.1-rc.4",
106
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.4",
107
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.4",
108
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.4",
109
+ "@deepseek-ai/dsh-commands": "0.2.1-rc.4",
110
+ "@deepseek-ai/dsh-credentials": "0.2.1-rc.4",
111
+ "@deepseek-ai/dsh-host-webserver": "0.2.1-rc.4",
112
+ "@deepseek-ai/dsh-launch-environment": "0.2.1-rc.4",
113
+ "@deepseek-ai/dsh-llm": "0.2.1-rc.4",
114
+ "@deepseek-ai/dsh-settings": "0.2.1-rc.4",
113
115
  "@deepseek-ai/schemastery": "~3.18.5",
114
116
  "@types/node": "^22.0.0",
115
117
  "@types/react": "^18.3.1",