@yzdys/dsh-connect-madao 0.12.0 → 0.12.1
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 +10 -0
- package/lib/bin.js +17 -3
- package/lib/client.js +1 -1
- package/lib/index.js +20 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## 0.12.1 — 2026-11-28
|
|
6
|
+
|
|
7
|
+
修一个只在 scoped 包名下出现的回归:设置页左侧的「码道连接器」入口不见了,
|
|
8
|
+
模型页里那张卡片却还在。原因是客户端 bundle 的
|
|
9
|
+
`window.__ModuleLoader__.load({ id })` 被硬编码成 `dsh-connect-madao`,而 DSH
|
|
10
|
+
的客户端加载器用 **npm 包名**定位并应用模块;包名改成
|
|
11
|
+
`@yzdys/dsh-connect-madao` 后 id 对不上,客户端插件就被跳过了。
|
|
12
|
+
|
|
13
|
+
现在 id 从 `package.json` 的 `name` 读取,换 scope 不用再改构建脚本。
|
|
14
|
+
|
|
5
15
|
## 0.12.0 — 2026-11-27
|
|
6
16
|
|
|
7
17
|
码道的 provider 改由插件**自带 adapter** 注册,不再复用 `llm-pi-ai` 的
|
package/lib/bin.js
CHANGED
|
@@ -1457,8 +1457,8 @@ init_client();
|
|
|
1457
1457
|
init_sts_provider();
|
|
1458
1458
|
import { createHash as createHash5 } from "node:crypto";
|
|
1459
1459
|
import { createServer } from "node:http";
|
|
1460
|
-
import { writeFileSync } from "node:fs";
|
|
1461
|
-
import { join as
|
|
1460
|
+
import { writeFileSync as writeFileSync2 } from "node:fs";
|
|
1461
|
+
import { join as join6 } from "node:path";
|
|
1462
1462
|
|
|
1463
1463
|
// src/protocol/body.ts
|
|
1464
1464
|
var DEFAULT_MAX_TOKENS = 65536;
|
|
@@ -2003,6 +2003,20 @@ async function patchSettings(patch, env = process.env) {
|
|
|
2003
2003
|
}
|
|
2004
2004
|
|
|
2005
2005
|
// src/host-patch.ts
|
|
2006
|
+
import { readFileSync as readFileSync2, writeFileSync, existsSync as existsSync2 } from "node:fs";
|
|
2007
|
+
import { join as join5 } from "node:path";
|
|
2008
|
+
import { fileURLToPath } from "node:url";
|
|
2009
|
+
var PACKAGE_NAME = (function readPackageName() {
|
|
2010
|
+
const here = fileURLToPath(new URL(".", import.meta.url));
|
|
2011
|
+
for (const candidate of [join5(here, "package.json"), join5(here, "..", "package.json")]) {
|
|
2012
|
+
try {
|
|
2013
|
+
const parsed = JSON.parse(readFileSync2(candidate, "utf8"));
|
|
2014
|
+
if (parsed && typeof parsed.name === "string" && parsed.name !== "") return parsed.name;
|
|
2015
|
+
} catch {
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
throw new Error("dsh-connect-madao: cannot locate package.json to resolve the package name");
|
|
2019
|
+
})();
|
|
2006
2020
|
function displayName(m) {
|
|
2007
2021
|
return m.ratio ? `${m.name} \xB7 ${m.ratio}` : m.name;
|
|
2008
2022
|
}
|
|
@@ -2572,7 +2586,7 @@ async function chatCompletion(res, client, rawBody, ctxModels) {
|
|
|
2572
2586
|
`chat REJECT context ${estTokens} (msgs ${estMessages} + tools ${estTools}/${toolCount}) > ${limit} for ${model}`
|
|
2573
2587
|
);
|
|
2574
2588
|
try {
|
|
2575
|
-
|
|
2589
|
+
writeFileSync2(join6(logDir(), "last-rejected.json"), JSON.stringify(rawBody), "utf8");
|
|
2576
2590
|
chatLog("chat REJECT \u8BF7\u6C42\u4F53\u5DF2\u5B58\u81F3 ~/.dsh-connect-madao/last-rejected.json");
|
|
2577
2591
|
} catch {
|
|
2578
2592
|
}
|
package/lib/client.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -84,8 +84,8 @@ var init_models = __esm({
|
|
|
84
84
|
// src/server.ts
|
|
85
85
|
import { createHash as createHash5 } from "node:crypto";
|
|
86
86
|
import { createServer } from "node:http";
|
|
87
|
-
import { writeFileSync } from "node:fs";
|
|
88
|
-
import { join as
|
|
87
|
+
import { writeFileSync as writeFileSync2 } from "node:fs";
|
|
88
|
+
import { join as join6 } from "node:path";
|
|
89
89
|
|
|
90
90
|
// src/client.ts
|
|
91
91
|
import { createHash as createHash3, randomUUID } from "node:crypto";
|
|
@@ -1923,6 +1923,20 @@ async function patchSettings(patch, env = process.env) {
|
|
|
1923
1923
|
}
|
|
1924
1924
|
|
|
1925
1925
|
// src/host-patch.ts
|
|
1926
|
+
import { readFileSync as readFileSync2, writeFileSync, existsSync as existsSync2 } from "node:fs";
|
|
1927
|
+
import { join as join5 } from "node:path";
|
|
1928
|
+
import { fileURLToPath } from "node:url";
|
|
1929
|
+
var PACKAGE_NAME = (function readPackageName() {
|
|
1930
|
+
const here = fileURLToPath(new URL(".", import.meta.url));
|
|
1931
|
+
for (const candidate of [join5(here, "package.json"), join5(here, "..", "package.json")]) {
|
|
1932
|
+
try {
|
|
1933
|
+
const parsed = JSON.parse(readFileSync2(candidate, "utf8"));
|
|
1934
|
+
if (parsed && typeof parsed.name === "string" && parsed.name !== "") return parsed.name;
|
|
1935
|
+
} catch {
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
throw new Error("dsh-connect-madao: cannot locate package.json to resolve the package name");
|
|
1939
|
+
})();
|
|
1926
1940
|
function displayName(m) {
|
|
1927
1941
|
return m.ratio ? `${m.name} \xB7 ${m.ratio}` : m.name;
|
|
1928
1942
|
}
|
|
@@ -2526,7 +2540,7 @@ async function chatCompletion(res, client, rawBody, ctxModels) {
|
|
|
2526
2540
|
`chat REJECT context ${estTokens} (msgs ${estMessages} + tools ${estTools}/${toolCount}) > ${limit} for ${model}`
|
|
2527
2541
|
);
|
|
2528
2542
|
try {
|
|
2529
|
-
|
|
2543
|
+
writeFileSync2(join6(logDir(), "last-rejected.json"), JSON.stringify(rawBody), "utf8");
|
|
2530
2544
|
chatLog("chat REJECT \u8BF7\u6C42\u4F53\u5DF2\u5B58\u81F3 ~/.dsh-connect-madao/last-rejected.json");
|
|
2531
2545
|
} catch {
|
|
2532
2546
|
}
|
|
@@ -3162,7 +3176,7 @@ async function registerNativeProvider(ctx, options) {
|
|
|
3162
3176
|
|
|
3163
3177
|
// src/index.ts
|
|
3164
3178
|
import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
3165
|
-
import { join as
|
|
3179
|
+
import { join as join7 } from "node:path";
|
|
3166
3180
|
import { homedir as homedir5 } from "node:os";
|
|
3167
3181
|
|
|
3168
3182
|
// node_modules/@deepseek-ai/cosmokit/lib/index.js
|
|
@@ -4037,10 +4051,10 @@ var inject = ["llm"];
|
|
|
4037
4051
|
var PROVIDER = "madao";
|
|
4038
4052
|
var NATIVE_PROVIDER_ID = "madao";
|
|
4039
4053
|
function diag(line) {
|
|
4040
|
-
const dir =
|
|
4054
|
+
const dir = join7(homedir5(), ".dsh-connect-madao");
|
|
4041
4055
|
try {
|
|
4042
4056
|
mkdirSync2(dir, { recursive: true });
|
|
4043
|
-
appendFileSync2(
|
|
4057
|
+
appendFileSync2(join7(dir, "host.log"), `${(/* @__PURE__ */ new Date()).toISOString()} ${line}
|
|
4044
4058
|
`, "utf8");
|
|
4045
4059
|
} catch {
|
|
4046
4060
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@yzdys/dsh-connect-madao",
|
|
3
3
|
"displayName": "DSH Connect 码道",
|
|
4
4
|
"description": "把华为云码道(CodeArts Agent)的模型接入 DeepSeek Harness:自签 SDK-HMAC-SHA256、P-256 密钥协商与 SM4-GCM 载荷加密,对外提供 OpenAI 兼容接口,并带设置面板与状态胶囊。",
|
|
5
|
-
"version": "0.12.
|
|
5
|
+
"version": "0.12.1",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"engines": {
|