mslxdff 0.1.170 → 0.1.172
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/bin/mslxdff.js +3 -3
- package/docs/cli_help_mini.md +143 -0
- package/package.json +1 -1
- package/src/anthropic/count-tokens.js +39 -0
- package/src/anthropic/translate.js +20 -41
- package/src/auto.js +254 -254
- package/src/bench/cline-bench.js +42 -42
- package/src/bench/probe.js +70 -70
- package/src/bench/report.js +162 -162
- package/src/bench/runner.js +77 -77
- package/src/bench/via-probe.js +124 -124
- package/src/bench/via-routes.js +87 -87
- package/src/bench/workbuddy-bench.js +54 -54
- package/src/chat/engine.js +160 -160
- package/src/chat/gateway.js +163 -163
- package/src/chat/orchestrator.js +234 -234
- package/src/chat/prompt.js +70 -70
- package/src/chat/repl.js +88 -88
- package/src/chat/terminal.js +135 -135
- package/src/chat/tools.js +306 -306
- package/src/chat-pipeline/index.js +131 -131
- package/src/chat-pipeline/policy.js +76 -76
- package/src/cli/commands/group.js +249 -249
- package/src/cli/commands/model/picks.js +50 -50
- package/src/cli/commands/provider/bench-via.js +247 -247
- package/src/cli/commands/provider/bench.js +141 -141
- package/src/cli/commands/provider/index.js +133 -133
- package/src/cli/commands/provider/models.js +145 -145
- package/src/cli/commands/provider/qwenwork-login.js +119 -119
- package/src/cli/commands/sync.js +310 -310
- package/src/cli/status.js +279 -279
- package/src/daemon.js +112 -112
- package/src/model-capabilities/context-lookup.js +65 -0
- package/src/model-capabilities/enrich.js +86 -86
- package/src/model-capabilities/index.js +183 -183
- package/src/model-capabilities/merge.js +50 -35
- package/src/model-capabilities/parse.js +70 -70
- package/src/models.js +225 -225
- package/src/providers/AGENTS.md +49 -0
- package/src/providers/cline/auth.js +228 -228
- package/src/providers/cline/chat.js +307 -307
- package/src/providers/cline.js +2 -2
- package/src/providers/codearts/concurrency.js +34 -0
- package/src/providers/codearts/index.js +11 -3
- package/src/providers/globalqwenwork/cosy.js +123 -123
- package/src/providers/globalqwenwork/crypto.js +218 -218
- package/src/providers/globalqwenwork/http.js +20 -20
- package/src/providers/globalqwenwork/payload.js +4 -2
- package/src/providers/globalqwenwork/rsa.js +54 -54
- package/src/providers/globalqwenwork/sse.js +268 -268
- package/src/providers/globalqwenwork/stream.js +130 -130
- package/src/providers/globalqwenwork/upstream.js +122 -122
- package/src/providers/keyring.js +60 -60
- package/src/providers/qoder/chat.js +203 -200
- package/src/providers/qoder/index.js +249 -249
- package/src/providers/qoder/sse.js +145 -145
- package/src/providers/qwenwork/account-store.js +133 -133
- package/src/providers/qwenwork/constants.js +67 -67
- package/src/providers/qwenwork/cosy.js +120 -120
- package/src/providers/qwenwork/crypto.js +218 -218
- package/src/providers/qwenwork/http.js +20 -20
- package/src/providers/qwenwork/index.js +327 -327
- package/src/providers/qwenwork/payload.js +144 -142
- package/src/providers/qwenwork/rsa.js +54 -54
- package/src/providers/qwenwork/sse.js +268 -268
- package/src/providers/qwenwork/stream.js +130 -130
- package/src/providers/qwenwork/upstream.js +120 -120
- package/src/providers/qwenwork.js +1 -1
- package/src/providers/raccoon/chat.js +10 -5
- package/src/providers/raccoon/const.js +4 -4
- package/src/providers/registry.js +79 -79
- package/src/providers/traework/models.js +4 -3
- package/src/providers/workbuddy/chat.js +248 -248
- package/src/providers/workbuddy/payload.js +16 -7
- package/src/providers/workbuddy/reshape.js +152 -152
- package/src/providers/workbuddy.js +2 -2
- package/src/providers/zcode/chat.js +7 -0
- package/src/reasoning.js +32 -32
- package/src/responses/translate.js +4 -0
- package/src/routes/AGENTS.md +37 -0
- package/src/routes/chat/exhausted-handler.js +5 -0
- package/src/routes/chat/gateway.js +46 -46
- package/src/routes/chat/relay-pipeline.js +294 -291
- package/src/routes/chat/via-route-handler.js +146 -146
- package/src/routes/hedge.js +255 -255
- package/src/routes/messages-route.js +1 -1
- package/src/routes/models-route.js +167 -167
- package/src/routes/peers.js +273 -273
- package/src/routes/stream-scan.js +47 -21
- package/src/routes/stream.js +385 -385
- package/src/runtime/bootstrap.js +50 -50
- package/src/runtime/provider-gate.js +36 -36
- package/src/runtime/providers-setup.js +165 -165
- package/src/server.js +69 -69
- package/src/state/schemas/allowlist.js +92 -92
- package/src/sync-opencode.js +280 -280
- package/src/talk-full.js +1 -0
- package/src/talk-log.js +3 -2
- package/src/thinking-effort.js +67 -0
- package/src/transport/index.js +244 -244
- package/src/transport/pool.js +56 -56
- package/src/transport/retry.js +24 -24
- package/src/transport/sse.js +93 -93
- package/src/upstream-engine/sdk/convert.js +6 -0
- package/src/upstream-probe/display.js +52 -52
- package/src/upstream-probe/probe.js +49 -49
- package/src/upstream-probe/rotate.js +110 -110
- package/src/upstream-probe/start.js +45 -45
- package/src/upstream-responses.js +5 -0
- package/src/upstream.js +289 -289
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 可扩展供应商注册表:新增特殊供应商时,仅在此文件注册 + 新增对应 provider 文件即可
|
|
3
|
-
* 每个条目:{ id, match(id, baseUrl) => bool, load() => Promise<factory> }
|
|
4
|
-
* 匹配优先级:按数组顺序,首个命中即用;未命中走通用 generic
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export const customProviders = [
|
|
8
|
-
{
|
|
9
|
-
id: "workbuddy",
|
|
10
|
-
match: (id, baseUrl) => id === "workbuddy" || String(baseUrl).includes("copilot.tencent"),
|
|
11
|
-
load: () => import("./workbuddy.js").then((m) => m.createWorkbuddyProvider),
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
id: "traework",
|
|
15
|
-
match: (id, baseUrl) => id === "traework" || String(baseUrl).includes("trae"),
|
|
16
|
-
load: () => import("./traework.js").then((m) => m.createTraeworkProvider),
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
id: "cline",
|
|
20
|
-
match: (id, baseUrl) => id === "cline" || String(baseUrl).includes("cline.bot"),
|
|
21
|
-
load: () => import("./cline.js").then((m) => m.createClineProvider),
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: "codearts",
|
|
25
|
-
match: (id, baseUrl) => id === "codearts" || String(baseUrl).includes("myhuaweicloud.com"),
|
|
26
|
-
load: () => import("./codearts.js").then((m) => m.createCodeartsProvider),
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: "qoder",
|
|
30
|
-
match: (id, baseUrl) => id === "qoder" || String(baseUrl).includes("qoder"),
|
|
31
|
-
load: () => import("./qoder/index.js").then((m) => m.createQoderProvider),
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
// ⚠ 必须排在 qwenwork 之前:qwenwork 的 match 用 `includes("qwenwork")`,
|
|
35
|
-
// 而 "globalqwenwork" 与 "gateway.qwenwork.ai"/"globalqwenwork://native" 都含该子串,
|
|
36
|
-
// 若后置会被 cn 条目抢先命中(first-match-wins),把国际站 token 打到 cn 网关。
|
|
37
|
-
id: "globalqwenwork",
|
|
38
|
-
match: (id, baseUrl) => id === "globalqwenwork" || String(baseUrl).includes("qwenwork.ai"),
|
|
39
|
-
load: () => import("./globalqwenwork/index.js").then((m) => m.createGlobalQwenworkProvider),
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
id: "qwenwork",
|
|
43
|
-
match: (id, baseUrl) => id === "qwenwork" || String(baseUrl).includes("qwenwork"),
|
|
44
|
-
load: () => import("./qwenwork/index.js").then((m) => m.createQwenworkProvider),
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: "zcode",
|
|
48
|
-
match: (id, baseUrl) => id === "zcode" || String(baseUrl).includes("zcode.z.ai"),
|
|
49
|
-
load: () => import("./zcode/index.js").then((m) => m.createZcodeProvider),
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
id: "raccoon",
|
|
53
|
-
match: (id, baseUrl) => id === "raccoon" || String(baseUrl).includes("xiaohuanxiong.com"),
|
|
54
|
-
load: () => import("./raccoon/index.js").then((m) => m.createRaccoonProvider),
|
|
55
|
-
},
|
|
56
|
-
];
|
|
57
|
-
|
|
58
|
-
// 供 bench/probe 等需要定制化解析模型列表的场景
|
|
59
|
-
export const customNormalizers = [
|
|
60
|
-
{
|
|
61
|
-
id: "cline",
|
|
62
|
-
match: (baseUrl) => String(baseUrl).includes("cline.bot"),
|
|
63
|
-
normalize: (json) => Array.isArray(json?.free) ? json.free : null,
|
|
64
|
-
},
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
export async function getCustomProviderFactory(id, baseUrl) {
|
|
68
|
-
for (const entry of customProviders) {
|
|
69
|
-
try { if (entry.match(id, baseUrl)) return await entry.load(); } catch {}
|
|
70
|
-
}
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function getCustomNormalizer(baseUrl) {
|
|
75
|
-
for (const entry of customNormalizers) {
|
|
76
|
-
try { if (entry.match(baseUrl)) return entry.normalize; } catch {}
|
|
77
|
-
}
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 可扩展供应商注册表:新增特殊供应商时,仅在此文件注册 + 新增对应 provider 文件即可
|
|
3
|
+
* 每个条目:{ id, match(id, baseUrl) => bool, load() => Promise<factory> }
|
|
4
|
+
* 匹配优先级:按数组顺序,首个命中即用;未命中走通用 generic
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const customProviders = [
|
|
8
|
+
{
|
|
9
|
+
id: "workbuddy",
|
|
10
|
+
match: (id, baseUrl) => id === "workbuddy" || String(baseUrl).includes("copilot.tencent"),
|
|
11
|
+
load: () => import("./workbuddy.js").then((m) => m.createWorkbuddyProvider),
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: "traework",
|
|
15
|
+
match: (id, baseUrl) => id === "traework" || String(baseUrl).includes("trae"),
|
|
16
|
+
load: () => import("./traework.js").then((m) => m.createTraeworkProvider),
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "cline",
|
|
20
|
+
match: (id, baseUrl) => id === "cline" || String(baseUrl).includes("cline.bot"),
|
|
21
|
+
load: () => import("./cline.js").then((m) => m.createClineProvider),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "codearts",
|
|
25
|
+
match: (id, baseUrl) => id === "codearts" || String(baseUrl).includes("myhuaweicloud.com"),
|
|
26
|
+
load: () => import("./codearts.js").then((m) => m.createCodeartsProvider),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "qoder",
|
|
30
|
+
match: (id, baseUrl) => id === "qoder" || String(baseUrl).includes("qoder"),
|
|
31
|
+
load: () => import("./qoder/index.js").then((m) => m.createQoderProvider),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
// ⚠ 必须排在 qwenwork 之前:qwenwork 的 match 用 `includes("qwenwork")`,
|
|
35
|
+
// 而 "globalqwenwork" 与 "gateway.qwenwork.ai"/"globalqwenwork://native" 都含该子串,
|
|
36
|
+
// 若后置会被 cn 条目抢先命中(first-match-wins),把国际站 token 打到 cn 网关。
|
|
37
|
+
id: "globalqwenwork",
|
|
38
|
+
match: (id, baseUrl) => id === "globalqwenwork" || String(baseUrl).includes("qwenwork.ai"),
|
|
39
|
+
load: () => import("./globalqwenwork/index.js").then((m) => m.createGlobalQwenworkProvider),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "qwenwork",
|
|
43
|
+
match: (id, baseUrl) => id === "qwenwork" || String(baseUrl).includes("qwenwork"),
|
|
44
|
+
load: () => import("./qwenwork/index.js").then((m) => m.createQwenworkProvider),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: "zcode",
|
|
48
|
+
match: (id, baseUrl) => id === "zcode" || String(baseUrl).includes("zcode.z.ai"),
|
|
49
|
+
load: () => import("./zcode/index.js").then((m) => m.createZcodeProvider),
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "raccoon",
|
|
53
|
+
match: (id, baseUrl) => id === "raccoon" || String(baseUrl).includes("xiaohuanxiong.com"),
|
|
54
|
+
load: () => import("./raccoon/index.js").then((m) => m.createRaccoonProvider),
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
// 供 bench/probe 等需要定制化解析模型列表的场景
|
|
59
|
+
export const customNormalizers = [
|
|
60
|
+
{
|
|
61
|
+
id: "cline",
|
|
62
|
+
match: (baseUrl) => String(baseUrl).includes("cline.bot"),
|
|
63
|
+
normalize: (json) => Array.isArray(json?.free) ? json.free : null,
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
export async function getCustomProviderFactory(id, baseUrl) {
|
|
68
|
+
for (const entry of customProviders) {
|
|
69
|
+
try { if (entry.match(id, baseUrl)) return await entry.load(); } catch {}
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function getCustomNormalizer(baseUrl) {
|
|
75
|
+
for (const entry of customNormalizers) {
|
|
76
|
+
try { if (entry.match(baseUrl)) return entry.normalize; } catch {}
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
@@ -3,7 +3,8 @@ import { AGENT_HOST, EP_MODELS, FUNCTION, DEFAULT_MODEL } from "./constants.js";
|
|
|
3
3
|
import { soloHeaders } from "./headers.js";
|
|
4
4
|
import { joinModelId } from "../model-id.js";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// 窗口自报已删(ADR-0054):此前对所有模型硬编码 context_length=131072,无任何依据;
|
|
7
|
+
// 现交由 /v1/models 富化的四级解析统一裁决——本 provider 不自报,未知落 1M 兜底。
|
|
7
8
|
const CREATED = 1753600000;
|
|
8
9
|
const OWNER = "trae-solo";
|
|
9
10
|
|
|
@@ -19,7 +20,7 @@ export const STATIC_MODEL_IDS = [
|
|
|
19
20
|
];
|
|
20
21
|
|
|
21
22
|
export function staticModels(id = "traework") {
|
|
22
|
-
return STATIC_MODEL_IDS.map((m) => ({ id: joinModelId(id, m), object: "model", created: CREATED, owned_by: OWNER
|
|
23
|
+
return STATIC_MODEL_IDS.map((m) => ({ id: joinModelId(id, m), object: "model", created: CREATED, owned_by: OWNER }));
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export function normalizeModelName(s) {
|
|
@@ -78,7 +79,7 @@ export function createModelsService({
|
|
|
78
79
|
if (cache && now - fetchedAt < CACHE_TTL_MS) return cache;
|
|
79
80
|
try {
|
|
80
81
|
const dyn = await fetchDynamic();
|
|
81
|
-
cache = dyn.map((m) => ({ id: joinModelId(id, m.id), object: "model", created: CREATED, owned_by: OWNER,
|
|
82
|
+
cache = dyn.map((m) => ({ id: joinModelId(id, m.id), object: "model", created: CREATED, owned_by: OWNER, name: m.name }));
|
|
82
83
|
fetchedAt = now;
|
|
83
84
|
return cache;
|
|
84
85
|
} catch {
|