dsh-xdpool 2.4.6 → 2.5.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 +124 -0
- package/README.en.md +11 -2
- package/README.md +12 -3
- package/assets/community-qr.png +0 -0
- package/cordis.patch.yml +17 -41
- package/lib/bin.js +218 -21
- package/lib/client.js +277 -624
- package/lib/index.d.ts +54 -82
- package/lib/index.js +299 -386
- package/package.json +1 -4
- package/vendor/channel-pack/pack.js +27 -5
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dsh-xdpool",
|
|
3
3
|
"displayName": "DSH XD Pool",
|
|
4
4
|
"description": "One DSH model pool for every free quota you have: merge all locally signed-in WorkBuddy accounts with auto-failover, sign in to 13 vendors by QR/web, aggregate 76 vendors' free tiers, plus a usage dashboard, model routing, a local OpenAI-compatible gateway and a points-automation suite.",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.5.1",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "XDTrees",
|
|
8
8
|
"homepage": "https://github.com/XDTrees/dsh-xdpool#readme",
|
|
@@ -75,9 +75,6 @@
|
|
|
75
75
|
"platform": "web"
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
"optionalDependencies": {
|
|
79
|
-
"billion-context": "^0.1.197"
|
|
80
|
-
},
|
|
81
78
|
"devDependencies": {
|
|
82
79
|
"@deepseek-ai/cordis": "4.0.2",
|
|
83
80
|
"@deepseek-ai/dsh-client-locale": "0.1.5-rc.2",
|
|
@@ -32970,6 +32970,13 @@ var DsmlContentExtractor = class {
|
|
|
32970
32970
|
return { text: remaining, reasoning: "" };
|
|
32971
32971
|
}
|
|
32972
32972
|
};
|
|
32973
|
+
// CodeArts rejects an oversized max_tokens with an HTTP-200 SSE error frame
|
|
32974
|
+
// (`InferHub.4001.200 The request param is invalid`) rather than a 4xx, so it
|
|
32975
|
+
// surfaces to the user as an opaque INVALID_REQUEST. 65536 is the measured
|
|
32976
|
+
// ceiling; 131072 already produces an empty stream. Keep the advertised default
|
|
32977
|
+
// and the final wire request on that same ceiling - TRAE and Cline do the same
|
|
32978
|
+
// with clampTraeMaxTokens / clampClineMaxTokens.
|
|
32979
|
+
var CODEARTS_MAX_OUTPUT_TOKENS = 65536;
|
|
32973
32980
|
var CodeArtsAdapter = class extends LlmAdapter {
|
|
32974
32981
|
constructor(options) {
|
|
32975
32982
|
super();
|
|
@@ -33043,6 +33050,7 @@ var CodeArtsAdapter = class extends LlmAdapter {
|
|
|
33043
33050
|
id: m.id,
|
|
33044
33051
|
name: m.name,
|
|
33045
33052
|
inputModalities: modalitiesFor(m.id),
|
|
33053
|
+
maxTokens: CODEARTS_MAX_OUTPUT_TOKENS,
|
|
33046
33054
|
...contextWindow === void 0 ? {} : { contextWindow }
|
|
33047
33055
|
};
|
|
33048
33056
|
});
|
|
@@ -33052,7 +33060,15 @@ var CodeArtsAdapter = class extends LlmAdapter {
|
|
|
33052
33060
|
const remoteModel = this.remoteModels?.find((m) => m.id === model);
|
|
33053
33061
|
const name2 = remoteModel?.name ?? model;
|
|
33054
33062
|
const contextWindow = contextWindowFor(model);
|
|
33055
|
-
const resolved = {
|
|
33063
|
+
const resolved = {
|
|
33064
|
+
provider,
|
|
33065
|
+
id: model,
|
|
33066
|
+
name: name2,
|
|
33067
|
+
inputModalities: modalitiesFor(model),
|
|
33068
|
+
// catalogFactsFor() forwards this as fact.maxTokens; without it the host
|
|
33069
|
+
// has no way to learn the ceiling and passes its own catalog value through.
|
|
33070
|
+
defaultMaxTokens: CODEARTS_MAX_OUTPUT_TOKENS
|
|
33071
|
+
};
|
|
33056
33072
|
if (contextWindow !== void 0) resolved.context = { contextWindow };
|
|
33057
33073
|
resolved.reasoning = {
|
|
33058
33074
|
efforts: [
|
|
@@ -33134,9 +33150,11 @@ var CodeArtsAdapter = class extends LlmAdapter {
|
|
|
33134
33150
|
// 大文件 write 工具参数(如 1000-2000+ 行文档)需要数万 token 的生成空间,
|
|
33135
33151
|
// 若沿用后端默认输出上限,参数 JSON 会在中途被截断成非法 JSON,harness
|
|
33136
33152
|
// 工具校验报 `invalid arguments: "arguments" must be an object`。
|
|
33137
|
-
// 参考实现 e2e 实测:65536 可用,131072
|
|
33138
|
-
//
|
|
33139
|
-
|
|
33153
|
+
// 参考实现 e2e 实测:65536 可用,131072 反而触发空流被后端拒绝。
|
|
33154
|
+
// 因此这是上限而不只是默认值:调用方传来的更大值(宿主模型目录里别的
|
|
33155
|
+
// provider 带 384000)会被原样发出并触发 INVALID_REQUEST,必须收回;
|
|
33156
|
+
// 调用方主动设的较小值保留。
|
|
33157
|
+
max_tokens: Math.min(options.maxTokens ?? CODEARTS_MAX_OUTPUT_TOKENS, CODEARTS_MAX_OUTPUT_TOKENS),
|
|
33140
33158
|
...wireTools !== void 0 && wireTools.length > 0 ? { tools: wireTools } : {}
|
|
33141
33159
|
});
|
|
33142
33160
|
const url = `${CHAT_API_BASE}/chat/completions`;
|
|
@@ -35326,9 +35344,13 @@ var BuddyAdapter = class _BuddyAdapter extends LlmAdapter2 {
|
|
|
35326
35344
|
// pair (measured on a live account 2026-10-21; the pool's own copy of this
|
|
35327
35345
|
// list is BANNED_SYSTEM_PHRASES in src/upstream.ts). Runs AFTER the prepend
|
|
35328
35346
|
// above, because that is where the host's system text lands.
|
|
35347
|
+
// The third entry is the file-reference guidance DSH adds whenever the
|
|
35348
|
+
// agent has a `read` tool: the "Relative paths…" half is the substring the
|
|
35349
|
+
// gateway lists, and the sentence names no product, so it is rewritten for
|
|
35350
|
+
// its text rather than for claiming another client (measured 2026-10-28).
|
|
35329
35351
|
for (const message of messages) {
|
|
35330
35352
|
if ((message.role === "system" || message.role === "assistant") && typeof message.content === "string") {
|
|
35331
|
-
message.content = message.content.replace(/powered by DeepSeek Harness/gi, "running on DeepSeek Harness").replace(/DeepSeek Harness Web GUI/gi, "DeepSeek Harness web interface");
|
|
35353
|
+
message.content = message.content.replace(/powered by DeepSeek Harness/gi, "running on DeepSeek Harness").replace(/DeepSeek Harness Web GUI/gi, "DeepSeek Harness web interface").replace(/Relative paths resolve from the workspace root/gi, "Relative paths are resolved against the workspace root");
|
|
35332
35354
|
}
|
|
35333
35355
|
}
|
|
35334
35356
|
const tools = options.tools?.map((tool) => ({
|