dsh-qoder-connect 0.2.5 → 0.2.6

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/lib/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { D as QoderCatalogStore, O as qoderCatalogPath, U as qoderCredentialIdentity, V as QoderCredentialStore, b as createQoderTransport, f as QODER_CONNECT_VERSION, i as variantFor, k as FALLBACK_QODER_MODELS, l as qoderHostHeartbeatPath, m as QoderUpstreamClient, r as QODER_VARIANTS, s as isHeartbeatProcessAlive, t as CHINA_VARIANT, u as readHostHeartbeat, y as validateApiKey } from "./variants-Dus_Yq3R.js";
2
+ import { D as QoderCatalogStore, O as qoderCatalogPath, U as qoderCredentialIdentity, V as QoderCredentialStore, b as createQoderTransport, f as QODER_CONNECT_VERSION, i as variantFor, k as FALLBACK_QODER_MODELS, l as qoderHostHeartbeatPath, m as QoderUpstreamClient, r as QODER_VARIANTS, s as isHeartbeatProcessAlive, t as CHINA_VARIANT, u as readHostHeartbeat, y as validateApiKey } from "./variants-COxX6r1j.js";
3
3
  import { readFile } from "node:fs/promises";
4
4
  import { realpathSync } from "node:fs";
5
5
  import { fileURLToPath } from "node:url";
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as QoderCatalog, B as QODER_PAT_ENV_GLOBAL, C as getMachineId, D as QoderCatalogStore, E as randomSentinel, F as QODER_PROBE_PATH, G as QODER_DATA_DIR_ENV, H as patTail, I as QODER_SETTINGS_FACE_PATH, J as qoderMachineIdPath, K as QODER_DATA_DIR_NAME, L as QODER_STATUS_PATH, M as QODER_GLOBAL_AUTH_PATH, N as QODER_GLOBAL_PROBE_PATH, O as qoderCatalogPath, P as QODER_GLOBAL_STATUS_PATH, R as QODER_AUTH_FILENAME, S as utc8WallClock, T as probeModel, U as qoderCredentialIdentity, V as QoderCredentialStore, W as qoderOwnAuthPath, X as qoderStateDir, Y as qoderPluginDataDir, _ as modelInfoOf, a as QODER_HOST_HEARTBEAT_FILENAME, b as createQoderTransport, c as processStartTimeMs, d as writeHostHeartbeat, f as QODER_CONNECT_VERSION, g as kindFromQoderFailure, h as classifyUpstreamError, i as variantFor, j as QODER_AUTH_PATH, k as FALLBACK_QODER_MODELS, l as qoderHostHeartbeatPath, m as QoderUpstreamClient, n as GLOBAL_VARIANT, o as clearHostHeartbeat, p as KIND_STATUS, q as configurePluginPaths, r as QODER_VARIANTS, s as isHeartbeatProcessAlive, t as CHINA_VARIANT, u as readHostHeartbeat, v as normalizeCredits, w as PROBE_EFFORT_CANDIDATES, x as formatUtc8Date, y as validateApiKey, z as QODER_PAT_ENV_CN } from "./variants-Dus_Yq3R.js";
1
+ import { A as QoderCatalog, B as QODER_PAT_ENV_GLOBAL, C as getMachineId, D as QoderCatalogStore, E as randomSentinel, F as QODER_PROBE_PATH, G as QODER_DATA_DIR_ENV, H as patTail, I as QODER_SETTINGS_FACE_PATH, J as qoderMachineIdPath, K as QODER_DATA_DIR_NAME, L as QODER_STATUS_PATH, M as QODER_GLOBAL_AUTH_PATH, N as QODER_GLOBAL_PROBE_PATH, O as qoderCatalogPath, P as QODER_GLOBAL_STATUS_PATH, R as QODER_AUTH_FILENAME, S as utc8WallClock, T as probeModel, U as qoderCredentialIdentity, V as QoderCredentialStore, W as qoderOwnAuthPath, X as qoderStateDir, Y as qoderPluginDataDir, _ as modelInfoOf, a as QODER_HOST_HEARTBEAT_FILENAME, b as createQoderTransport, c as processStartTimeMs, d as writeHostHeartbeat, f as QODER_CONNECT_VERSION, g as kindFromQoderFailure, h as classifyUpstreamError, i as variantFor, j as QODER_AUTH_PATH, k as FALLBACK_QODER_MODELS, l as qoderHostHeartbeatPath, m as QoderUpstreamClient, n as GLOBAL_VARIANT, o as clearHostHeartbeat, p as KIND_STATUS, q as configurePluginPaths, r as QODER_VARIANTS, s as isHeartbeatProcessAlive, t as CHINA_VARIANT, u as readHostHeartbeat, v as normalizeCredits, w as PROBE_EFFORT_CANDIDATES, x as formatUtc8Date, y as validateApiKey, z as QODER_PAT_ENV_CN } from "./variants-COxX6r1j.js";
2
2
  import z from "@deepseek-ai/schemastery";
3
3
  import { createHash, randomBytes, timingSafeEqual } from "node:crypto";
4
4
  import { dirname, join, resolve } from "node:path";
@@ -7,6 +7,7 @@ import { createProvider } from "@earendil-works/pi-ai";
7
7
  import { openAICompletionsApi } from "@earendil-works/pi-ai/api/openai-completions.lazy";
8
8
  import { resolveRetryPolicy } from "@deepseek-ai/dsh-llm";
9
9
  import { PiAiAdapter } from "@deepseek-ai/dsh-llm-pi-ai";
10
+ import { requestImageDimensions } from "@deepseek-ai/dsh-attachment";
10
11
  import { createServer } from "node:http";
11
12
  import { Readable } from "node:stream";
12
13
  //#region src/loopback.ts
@@ -441,7 +442,7 @@ function createQoderAdapter(options) {
441
442
  * than being dropped: catalog membership is advisory, and the seam tolerates
442
443
  * serving an unlisted id.
443
444
  */
444
- var QoderPiAiAdapter = class extends PiAiAdapter {
445
+ var QoderPiAiAdapter = class QoderPiAiAdapter extends PiAiAdapter {
445
446
  catalog;
446
447
  constructor(catalog, options) {
447
448
  super(options);
@@ -470,6 +471,30 @@ var QoderPiAiAdapter = class extends PiAiAdapter {
470
471
  name: withCatalogDisplay(resolved.name, info)
471
472
  };
472
473
  }
474
+ /**
475
+ * Resolve the request-image projection target for one route.
476
+ *
477
+ * `dsh-llm` 0.2.1 added `LlmAdapter.imageRequestTarget()` and its runtime calls
478
+ * it unconditionally (`this.registration(provider).adapter.imageRequestTarget(...)`,
479
+ * no optional chaining, no typeof guard). This plugin resolves its harness peers
480
+ * from its own pnpm store (0.1.7-rc.2), whose `PiAiAdapter` predates the method,
481
+ * so an inherited implementation is absent and that call would throw
482
+ * `TypeError: ....imageRequestTarget is not a function`.
483
+ *
484
+ * Derive the same target from the profile budgets this route already declares.
485
+ * When a host does provide the base implementation (a newer peer resolution),
486
+ * prefer it so this override never drifts from upstream behavior.
487
+ */
488
+ imageRequestTarget(provider, model, image) {
489
+ const inherited = Object.getPrototypeOf(QoderPiAiAdapter.prototype).imageRequestTarget;
490
+ if (typeof inherited === "function") return inherited.call(this, provider, model, image);
491
+ const { width, height } = requestImageDimensions(image.width, image.height, REQUEST_IMAGE_BUDGETS.requestImagePixelBudget);
492
+ return {
493
+ width,
494
+ height,
495
+ maxBytes: REQUEST_IMAGE_BUDGETS.requestImageMaxBytes
496
+ };
497
+ }
473
498
  };
474
499
  //#endregion
475
500
  //#region src/shim.ts
@@ -6,9 +6,9 @@ import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSy
6
6
  import { fileURLToPath } from "node:url";
7
7
  import { resolveDshHome } from "@deepseek-ai/dsh-home-paths";
8
8
  import { EMPTY_RESPONSE_CODE, LlmError, ProviderRequestId, ReasoningEffortId, ToolCallId, attributionHeaders, contentHasImage, createAssistantMessage, createToolResultMessage, createUserMessage } from "@deepseek-ai/dsh-llm";
9
+ import { requestImageDimensions } from "@deepseek-ai/dsh-attachment";
9
10
  import { homedir } from "node:os";
10
11
  import { brotliDecompressSync, gunzipSync, inflateSync } from "node:zlib";
11
- import { requestImageDimensions } from "@deepseek-ai/dsh-attachment";
12
12
  import { execFileSync } from "node:child_process";
13
13
  //#region src/paths.ts
14
14
  /**
@@ -4824,7 +4824,7 @@ const DEFAULT_MAX_TOKENS = 32768;
4824
4824
  const DEFAULT_CONTEXT_WINDOW = 18e4;
4825
4825
  //#endregion
4826
4826
  //#region src/version.ts
4827
- const QODER_CONNECT_VERSION = "0.2.5";
4827
+ const QODER_CONNECT_VERSION = "0.2.6";
4828
4828
  //#endregion
4829
4829
  //#region src/host-heartbeat.ts
4830
4830
  /**
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "dsh-qoder-connect",
3
3
  "displayName": "DSH Qoder Connect",
4
4
  "description": "将 Qoder(国内版 / 国际版)的模型接入 DeepSeek Harness — bring Qoder (CN & international) models into DeepSeek Harness.",
5
- "version": "0.2.5",
5
+ "version": "0.2.6",
6
6
  "author": "corrinehu",
7
7
  "keywords": [
8
8
  "dsh-plugin",
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "type": "module",
15
15
  "engines": {
16
- "dsh": ">=0.1.7-rc.1",
16
+ "dsh": ">=0.2.1-rc.1",
17
17
  "node": "^22.19.0 || >=24.0.0"
18
18
  },
19
19
  "main": "lib/index.js",
@@ -76,37 +76,37 @@
76
76
  },
77
77
  "peerDependencies": {
78
78
  "@deepseek-ai/cordis": "^4.0.2",
79
- "@deepseek-ai/dsh-atomic-write": ">=0.1.7-rc.1",
80
- "@deepseek-ai/dsh-attachment": ">=0.1.7-rc.1",
81
- "@deepseek-ai/dsh-home-paths": ">=0.1.7-rc.1",
82
- "@deepseek-ai/dsh-host-webserver": ">=0.1.7-rc.1",
83
- "@deepseek-ai/dsh-llm": ">=0.1.7-rc.1",
84
- "@deepseek-ai/dsh-llm-pi-ai": ">=0.1.7-rc.1",
85
- "@deepseek-ai/dsh-settings": ">=0.1.7-rc.1",
79
+ "@deepseek-ai/dsh-atomic-write": ">=0.2.1-rc.1",
80
+ "@deepseek-ai/dsh-attachment": ">=0.2.1-rc.1",
81
+ "@deepseek-ai/dsh-home-paths": ">=0.2.1-rc.1",
82
+ "@deepseek-ai/dsh-host-webserver": ">=0.2.1-rc.1",
83
+ "@deepseek-ai/dsh-llm": ">=0.2.1-rc.1",
84
+ "@deepseek-ai/dsh-llm-pi-ai": ">=0.2.1-rc.1",
85
+ "@deepseek-ai/dsh-settings": ">=0.2.1-rc.1",
86
86
  "@deepseek-ai/schemastery": "^3.18.2",
87
- "@earendil-works/pi-ai": ">=0.85.1",
87
+ "@earendil-works/pi-ai": "^1.1.0",
88
88
  "react": "^18.2.0"
89
89
  },
90
90
  "devDependencies": {
91
91
  "@deepseek-ai/cordis": "^4.0.2",
92
- "@deepseek-ai/dsh-atomic-write": ">=0.1.7-rc.1",
93
- "@deepseek-ai/dsh-attachment": ">=0.1.7-rc.1",
94
- "@deepseek-ai/dsh-client-locale": ">=0.1.7-rc.1",
95
- "@deepseek-ai/dsh-client-ui-conversation": ">=0.1.7-rc.1",
96
- "@deepseek-ai/dsh-client-ui-model-selection": ">=0.1.7-rc.1",
97
- "@deepseek-ai/dsh-client-ui-renderer": ">=0.1.7-rc.1",
98
- "@deepseek-ai/dsh-client-ui-settings": ">=0.1.7-rc.1",
99
- "@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.7-rc.1",
100
- "@deepseek-ai/dsh-client-ui-sidebar": ">=0.1.7-rc.1",
101
- "@deepseek-ai/dsh-client-ui-slots": ">=0.1.7-rc.1",
102
- "@deepseek-ai/dsh-credentials": ">=0.1.7-rc.1",
103
- "@deepseek-ai/dsh-home-paths": ">=0.1.7-rc.1",
104
- "@deepseek-ai/dsh-host-webserver": ">=0.1.7-rc.1",
105
- "@deepseek-ai/dsh-llm": ">=0.1.7-rc.1",
106
- "@deepseek-ai/dsh-llm-pi-ai": ">=0.1.7-rc.1",
107
- "@deepseek-ai/dsh-settings": ">=0.1.7-rc.1",
92
+ "@deepseek-ai/dsh-atomic-write": ">=0.2.1-rc.1",
93
+ "@deepseek-ai/dsh-attachment": ">=0.2.1-rc.1",
94
+ "@deepseek-ai/dsh-client-locale": ">=0.2.1-rc.1",
95
+ "@deepseek-ai/dsh-client-ui-conversation": ">=0.2.1-rc.1",
96
+ "@deepseek-ai/dsh-client-ui-model-selection": ">=0.2.1-rc.1",
97
+ "@deepseek-ai/dsh-client-ui-renderer": ">=0.2.1-rc.1",
98
+ "@deepseek-ai/dsh-client-ui-settings": ">=0.2.1-rc.1",
99
+ "@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.2.1-rc.1",
100
+ "@deepseek-ai/dsh-client-ui-sidebar": ">=0.2.1-rc.1",
101
+ "@deepseek-ai/dsh-client-ui-slots": ">=0.2.1-rc.1",
102
+ "@deepseek-ai/dsh-credentials": ">=0.2.1-rc.1",
103
+ "@deepseek-ai/dsh-home-paths": ">=0.2.1-rc.1",
104
+ "@deepseek-ai/dsh-host-webserver": ">=0.2.1-rc.1",
105
+ "@deepseek-ai/dsh-llm": ">=0.2.1-rc.1",
106
+ "@deepseek-ai/dsh-llm-pi-ai": ">=0.2.1-rc.1",
107
+ "@deepseek-ai/dsh-settings": ">=0.2.1-rc.1",
108
108
  "@deepseek-ai/schemastery": "^3.18.2",
109
- "@earendil-works/pi-ai": ">=0.85.1",
109
+ "@earendil-works/pi-ai": "^1.1.0",
110
110
  "@types/node": "^22.20.0",
111
111
  "@types/react": "~18.3.1",
112
112
  "@types/react-test-renderer": "^18.3.1",