mslxdff 0.1.186 → 0.1.188

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 (119) hide show
  1. package/bin/mslxdff.js +3 -3
  2. package/docs/cli_help_mini.md +145 -0
  3. package/package.json +1 -1
  4. package/src/auto.js +254 -254
  5. package/src/autostart.js +5 -2
  6. package/src/bench/cline-bench.js +42 -42
  7. package/src/bench/probe.js +70 -70
  8. package/src/bench/report.js +162 -162
  9. package/src/bench/runner.js +77 -77
  10. package/src/bench/via-probe.js +124 -124
  11. package/src/bench/via-routes.js +87 -87
  12. package/src/bench/workbuddy-bench.js +54 -54
  13. package/src/chat/engine.js +160 -160
  14. package/src/chat/gateway.js +163 -163
  15. package/src/chat/orchestrator.js +234 -234
  16. package/src/chat/prompt.js +70 -70
  17. package/src/chat/repl.js +88 -88
  18. package/src/chat/terminal.js +135 -135
  19. package/src/chat/tools.js +306 -306
  20. package/src/chat-pipeline/index.js +173 -131
  21. package/src/chat-pipeline/policy.js +84 -84
  22. package/src/chat-pipeline/serial-trial.js +6 -3
  23. package/src/chat-pipeline/terminal-verdict.js +29 -0
  24. package/src/cli/commands/daemon.js +55 -18
  25. package/src/cli/commands/group.js +249 -249
  26. package/src/cli/commands/model/picks.js +50 -50
  27. package/src/cli/commands/provider/bench-via.js +247 -247
  28. package/src/cli/commands/provider/bench.js +141 -141
  29. package/src/cli/commands/provider/index.js +136 -136
  30. package/src/cli/commands/provider/models.js +145 -145
  31. package/src/cli/commands/provider/qwenwork-login.js +119 -119
  32. package/src/cli/commands/sync.js +310 -310
  33. package/src/cli/commands/system.js +23 -7
  34. package/src/cli/join-wizard.js +8 -4
  35. package/src/cli/policy.js +14 -2
  36. package/src/cli/status.js +279 -279
  37. package/src/daemon.js +232 -195
  38. package/src/logs.js +27 -11
  39. package/src/model-capabilities/enrich.js +86 -86
  40. package/src/model-capabilities/index.js +183 -183
  41. package/src/model-capabilities/parse.js +70 -70
  42. package/src/model-trace.js +35 -4
  43. package/src/models.js +225 -225
  44. package/src/peers.js +20 -1
  45. package/src/providers/AGENTS.md +49 -0
  46. package/src/providers/cline/auth.js +228 -228
  47. package/src/providers/cline/chat.js +307 -307
  48. package/src/providers/cline.js +2 -2
  49. package/src/providers/codearts/chat.js +182 -182
  50. package/src/providers/globalqwenwork/cosy.js +123 -123
  51. package/src/providers/globalqwenwork/crypto.js +218 -218
  52. package/src/providers/globalqwenwork/http.js +20 -20
  53. package/src/providers/globalqwenwork/rsa.js +54 -54
  54. package/src/providers/globalqwenwork/sse.js +268 -268
  55. package/src/providers/globalqwenwork/stream.js +130 -130
  56. package/src/providers/globalqwenwork/upstream.js +122 -122
  57. package/src/providers/keyring.js +60 -60
  58. package/src/providers/qoder/chat.js +203 -203
  59. package/src/providers/qoder/index.js +249 -249
  60. package/src/providers/qoder/sse.js +145 -145
  61. package/src/providers/qwenwork/account-store.js +133 -133
  62. package/src/providers/qwenwork/constants.js +67 -67
  63. package/src/providers/qwenwork/cosy.js +120 -120
  64. package/src/providers/qwenwork/crypto.js +218 -218
  65. package/src/providers/qwenwork/http.js +20 -20
  66. package/src/providers/qwenwork/index.js +337 -327
  67. package/src/providers/qwenwork/payload.js +144 -144
  68. package/src/providers/qwenwork/rsa.js +54 -54
  69. package/src/providers/qwenwork/sse.js +268 -268
  70. package/src/providers/qwenwork/stream.js +130 -130
  71. package/src/providers/qwenwork/upstream.js +120 -120
  72. package/src/providers/qwenwork.js +1 -1
  73. package/src/providers/registry.js +79 -79
  74. package/src/providers/traework/chat.js +7 -1
  75. package/src/providers/workbuddy/chat.js +248 -248
  76. package/src/providers/workbuddy/reshape.js +152 -152
  77. package/src/providers/workbuddy.js +2 -2
  78. package/src/reasoning.js +32 -32
  79. package/src/routes/AGENTS.md +37 -0
  80. package/src/routes/chat/empty-turn-report.js +31 -0
  81. package/src/routes/chat/gateway.js +46 -46
  82. package/src/routes/chat/peer-handler.js +3 -2
  83. package/src/routes/chat/relay-pipeline.js +282 -294
  84. package/src/routes/chat/via-route-handler.js +146 -146
  85. package/src/routes/hedge.js +253 -255
  86. package/src/routes/index.js +14 -6
  87. package/src/routes/models-route.js +167 -167
  88. package/src/routes/peers.js +335 -273
  89. package/src/routes/responses-route.js +44 -2
  90. package/src/routes/stream-body.js +84 -0
  91. package/src/routes/stream-hold.js +152 -4
  92. package/src/routes/stream-scan.js +27 -2
  93. package/src/routes/stream.js +343 -385
  94. package/src/runtime/bootstrap.js +67 -67
  95. package/src/runtime/group-sync.js +70 -17
  96. package/src/runtime/provider-gate.js +36 -36
  97. package/src/runtime/providers-setup.js +168 -168
  98. package/src/runtime/server-lifecycle.js +1 -1
  99. package/src/server.js +78 -78
  100. package/src/state/schemas/allowlist.js +92 -92
  101. package/src/sync-opencode.js +280 -280
  102. package/src/transport/index.js +244 -244
  103. package/src/transport/pool.js +56 -56
  104. package/src/transport/retry.js +24 -24
  105. package/src/transport/sse.js +93 -93
  106. package/src/upstream-engine/sdk/attempt.js +9 -1
  107. package/src/upstream-probe/display.js +52 -52
  108. package/src/upstream-probe/probe.js +49 -49
  109. package/src/upstream-probe/rotate.js +110 -110
  110. package/src/upstream-probe/start.js +45 -45
  111. package/src/upstream.js +293 -293
  112. package/src/v6pool/claim.js +157 -0
  113. package/src/v6pool/config.js +65 -0
  114. package/src/v6pool/detect.js +130 -0
  115. package/src/v6pool/index.js +152 -0
  116. package/src/v6pool/prefix.js +140 -0
  117. package/src/v6pool/probe.js +40 -0
  118. package/src/v6pool/report.js +104 -0
  119. package/src/v6pool/rotate.js +239 -0
@@ -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
+ }