mslxdff 0.1.161 → 0.1.162

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.
Files changed (93) hide show
  1. package/bin/mslxdff.js +4 -4
  2. package/package.json +1 -1
  3. package/src/auto.js +254 -254
  4. package/src/bench/cline-bench.js +42 -42
  5. package/src/bench/probe.js +70 -70
  6. package/src/bench/report.js +162 -162
  7. package/src/bench/runner.js +77 -77
  8. package/src/bench/via-probe.js +124 -124
  9. package/src/bench/via-routes.js +87 -87
  10. package/src/bench/workbuddy-bench.js +54 -54
  11. package/src/chat/engine.js +160 -160
  12. package/src/chat/gateway.js +163 -163
  13. package/src/chat/orchestrator.js +234 -234
  14. package/src/chat/prompt.js +70 -70
  15. package/src/chat/repl.js +88 -88
  16. package/src/chat/terminal.js +135 -135
  17. package/src/chat/tools.js +306 -306
  18. package/src/chat-pipeline/index.js +126 -126
  19. package/src/chat-pipeline/policy.js +76 -76
  20. package/src/cli/commands/group.js +249 -249
  21. package/src/cli/commands/model/picks.js +50 -50
  22. package/src/cli/commands/provider/bench-via.js +247 -247
  23. package/src/cli/commands/provider/bench.js +141 -141
  24. package/src/cli/commands/provider/index.js +126 -126
  25. package/src/cli/commands/provider/models.js +142 -142
  26. package/src/cli/commands/provider/qwenwork-login.js +119 -119
  27. package/src/cli/commands/sync.js +232 -232
  28. package/src/cli/format.js +1 -0
  29. package/src/cli/status.js +279 -279
  30. package/src/daemon.js +101 -101
  31. package/src/model-capabilities/enrich.js +86 -86
  32. package/src/model-capabilities/index.js +183 -183
  33. package/src/model-capabilities/parse.js +70 -70
  34. package/src/model-trace.js +4 -3
  35. package/src/models.js +225 -225
  36. package/src/providers/cline/auth.js +228 -228
  37. package/src/providers/cline/chat.js +307 -307
  38. package/src/providers/cline.js +2 -2
  39. package/src/providers/dispatcher.js +26 -14
  40. package/src/providers/globalqwenwork/cosy.js +123 -123
  41. package/src/providers/globalqwenwork/crypto.js +218 -218
  42. package/src/providers/globalqwenwork/http.js +20 -20
  43. package/src/providers/globalqwenwork/rsa.js +54 -54
  44. package/src/providers/globalqwenwork/sse.js +268 -268
  45. package/src/providers/globalqwenwork/stream.js +130 -130
  46. package/src/providers/globalqwenwork/upstream.js +122 -122
  47. package/src/providers/keyring.js +60 -60
  48. package/src/providers/qoder/chat.js +193 -183
  49. package/src/providers/qoder/index.js +239 -230
  50. package/src/providers/qoder/sse.js +141 -103
  51. package/src/providers/qwenwork/account-store.js +133 -133
  52. package/src/providers/qwenwork/constants.js +67 -67
  53. package/src/providers/qwenwork/cosy.js +120 -120
  54. package/src/providers/qwenwork/crypto.js +218 -218
  55. package/src/providers/qwenwork/http.js +20 -20
  56. package/src/providers/qwenwork/index.js +327 -327
  57. package/src/providers/qwenwork/payload.js +142 -142
  58. package/src/providers/qwenwork/rsa.js +54 -54
  59. package/src/providers/qwenwork/sse.js +268 -268
  60. package/src/providers/qwenwork/stream.js +130 -130
  61. package/src/providers/qwenwork/upstream.js +120 -120
  62. package/src/providers/qwenwork.js +1 -1
  63. package/src/providers/registry.js +74 -74
  64. package/src/providers/workbuddy/chat.js +248 -248
  65. package/src/providers/workbuddy/reshape.js +152 -152
  66. package/src/providers/workbuddy.js +2 -2
  67. package/src/reasoning.js +32 -32
  68. package/src/routes/chat/gateway.js +46 -46
  69. package/src/routes/chat/relay-pipeline.js +276 -276
  70. package/src/routes/chat/via-route-handler.js +146 -146
  71. package/src/routes/hedge.js +255 -255
  72. package/src/routes/models-route.js +167 -167
  73. package/src/routes/peers.js +273 -273
  74. package/src/routes/stream.js +386 -386
  75. package/src/runtime/bootstrap.js +45 -45
  76. package/src/runtime/provider-gate.js +34 -34
  77. package/src/runtime/providers-setup.js +165 -165
  78. package/src/runtime/server-lifecycle.js +5 -6
  79. package/src/server.js +64 -64
  80. package/src/state/schemas/allowlist.js +92 -92
  81. package/src/sync-opencode.js +280 -280
  82. package/src/transport/index.js +244 -244
  83. package/src/transport/pool.js +56 -56
  84. package/src/transport/retry.js +24 -24
  85. package/src/transport/sse.js +93 -93
  86. package/src/upstream-probe/display.js +52 -52
  87. package/src/upstream-probe/probe.js +49 -49
  88. package/src/upstream-probe/rotate.js +110 -110
  89. package/src/upstream-probe/start.js +45 -45
  90. package/src/upstream.js +289 -289
  91. package/docs/cli_help_mini.md +0 -135
  92. package/src/providers/AGENTS.md +0 -46
  93. package/src/routes/AGENTS.md +0 -37
@@ -1,45 +1,45 @@
1
- // ADR-0015 daemon 装配:60s 节拍轮转探针;0=完全关闭
2
- import { probeTargetsFromState, rotateTick, nextCursor } from "./rotate.js";
3
- import { loadProviderConfigs, loadProviderKeys, loadProviderBaseUrl } from "../state.js";
4
- import { loadPeers } from "../state.js";
5
-
6
- export function upstreamProbeIntervalMs() {
7
- const n = Number(process.env.MSLXDFF_UPSTREAM_PROBE_MS);
8
- return Number.isInteger(n) && n >= 0 ? n : 60_000;
9
- }
10
-
11
- export function startUpstreamProbe({ evt = () => {}, peers, file, delayMs } = {}) {
12
- const interval = upstreamProbeIntervalMs();
13
- if (interval === 0) return null;
14
- let cursor = 0;
15
- let busy = false;
16
- const loadTargets = () => {
17
- try {
18
- return probeTargetsFromState({
19
- loadProviderConfigs: () => loadProviderConfigs({}),
20
- loadProviderKeys: (id) => loadProviderKeys(id, {}),
21
- loadProviderBaseUrl: (id) => loadProviderBaseUrl(id, {}),
22
- });
23
- } catch {
24
- return [];
25
- }
26
- };
27
- const tick = async () => {
28
- if (busy) return;
29
- busy = true;
30
- try {
31
- const targets = loadTargets();
32
- if (!targets.length) return;
33
- const out = await rotateTick({ targets, cursor, peers, evt, file, delayMs });
34
- if (out.probed != null) cursor = nextCursor(cursor, targets.length);
35
- } catch {
36
- // 探针永不影响主链路
37
- } finally {
38
- busy = false;
39
- }
40
- };
41
- void tick();
42
- const timer = setInterval(tick, interval);
43
- timer.unref?.();
44
- return { stop: () => clearInterval(timer), interval, tick };
45
- }
1
+ // ADR-0015 daemon 装配:60s 节拍轮转探针;0=完全关闭
2
+ import { probeTargetsFromState, rotateTick, nextCursor } from "./rotate.js";
3
+ import { loadProviderConfigs, loadProviderKeys, loadProviderBaseUrl } from "../state.js";
4
+ import { loadPeers } from "../state.js";
5
+
6
+ export function upstreamProbeIntervalMs() {
7
+ const n = Number(process.env.MSLXDFF_UPSTREAM_PROBE_MS);
8
+ return Number.isInteger(n) && n >= 0 ? n : 60_000;
9
+ }
10
+
11
+ export function startUpstreamProbe({ evt = () => {}, peers, file, delayMs } = {}) {
12
+ const interval = upstreamProbeIntervalMs();
13
+ if (interval === 0) return null;
14
+ let cursor = 0;
15
+ let busy = false;
16
+ const loadTargets = () => {
17
+ try {
18
+ return probeTargetsFromState({
19
+ loadProviderConfigs: () => loadProviderConfigs({}),
20
+ loadProviderKeys: (id) => loadProviderKeys(id, {}),
21
+ loadProviderBaseUrl: (id) => loadProviderBaseUrl(id, {}),
22
+ });
23
+ } catch {
24
+ return [];
25
+ }
26
+ };
27
+ const tick = async () => {
28
+ if (busy) return;
29
+ busy = true;
30
+ try {
31
+ const targets = loadTargets();
32
+ if (!targets.length) return;
33
+ const out = await rotateTick({ targets, cursor, peers, evt, file, delayMs });
34
+ if (out.probed != null) cursor = nextCursor(cursor, targets.length);
35
+ } catch {
36
+ // 探针永不影响主链路
37
+ } finally {
38
+ busy = false;
39
+ }
40
+ };
41
+ void tick();
42
+ const timer = setInterval(tick, interval);
43
+ timer.unref?.();
44
+ return { stop: () => clearInterval(timer), interval, tick };
45
+ }