@platless/axom-cli 0.5.9 → 0.6.36

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 (163) hide show
  1. package/README.md +18 -5
  2. package/dist/axom-patch/cli/README.md +100 -12
  3. package/dist/axom-patch/cli/account-limits/generate.py +15 -12
  4. package/dist/axom-patch/cli/account-limits/kimi-proxy.mjs +20 -3
  5. package/dist/axom-patch/cli/claude-account-limits.json +9 -9
  6. package/dist/axom-patch/cli/codex-account-limits.json +11 -11
  7. package/dist/axom-patch/cli/codex-terminal-output.json +16 -0
  8. package/dist/axom-patch/cli/commandcode-account-limits.json +9 -9
  9. package/dist/axom-patch/cli/kimi-quota.mjs +12 -0
  10. package/dist/axom-patch/cli/kimi-subagents.mjs +173 -0
  11. package/dist/axom-patch/cli/nightly-task.md +55 -13
  12. package/dist/axom-patch/cli/probes/codex-terminal-output.mjs +33 -0
  13. package/dist/axom-patch/cli/probes/kimi-subagent-subwork.mjs +82 -0
  14. package/dist/axom-patch/cli/qoder/dist/axom-acp-compat.mjs +1591 -0
  15. package/dist/axom-patch/cli/qoder/releases/1.1.75.json +360 -0
  16. package/dist/axom-patch/cli/qoder-background-terminal.md +13 -6
  17. package/dist/axom-patch/cli/qoder-foreground-output.md +14 -8
  18. package/dist/axom-patch/cli/qoder-native-acp.json +227 -0
  19. package/dist/axom-patch/cli/qoder-steering.md +20 -25
  20. package/dist/axom-patch/cli/qoder-subagent-subwork.md +17 -68
  21. package/dist/axom-patch/cli/runtime.json +16 -18
  22. package/dist/axom-patch/cli/zcode-account-limits.json +10 -11
  23. package/dist/axom-patch/cli/zcode-models.json +1 -2
  24. package/dist/axom-patch/cli/zcode-subagent-subwork.json +9 -10
  25. package/dist/cli.js +4 -36
  26. package/dist/commands/knowledge.js +47 -0
  27. package/dist/commands/update.js +65 -3
  28. package/dist/commands/workstation.js +73 -7
  29. package/dist/install/claude/commands.js +13 -13
  30. package/dist/mcp.js +1 -1
  31. package/dist/native/darwin-arm64/axom-quic +0 -0
  32. package/dist/workstation/acp/acpAgents.js +102 -98
  33. package/dist/workstation/acp/acpClient.js +26 -0
  34. package/dist/workstation/acp/builds/install/npm.js +99 -10
  35. package/dist/workstation/acp/initializeResponse.js +6 -1
  36. package/dist/workstation/acp/managedPatches.js +189 -25
  37. package/dist/workstation/acp/managedRuntime.js +314 -0
  38. package/dist/workstation/acp/patchAssets.js +40 -0
  39. package/dist/workstation/acp/processor/checkpoint.js +25 -34
  40. package/dist/workstation/acp/processor/control.js +5 -78
  41. package/dist/workstation/acp/processor/runtime.js +5 -81
  42. package/dist/workstation/acp/processor/session.js +51 -80
  43. package/dist/workstation/acp/processor/state.js +6 -13
  44. package/dist/workstation/acp/processor/step.js +3 -20
  45. package/dist/workstation/acp/processor/test/fixtureLog.js +9 -16
  46. package/dist/workstation/acp/processor/updates.js +131 -105
  47. package/dist/workstation/acp/processorSession.js +8 -172
  48. package/dist/workstation/acp/registry/catalog.js +65 -39
  49. package/dist/workstation/acp/registry/launch.js +16 -1
  50. package/dist/workstation/acp/switching.js +0 -3
  51. package/dist/workstation/acp/test/fakeAgent.js +13 -0
  52. package/dist/workstation/acp/test/keeperWorld.js +28 -0
  53. package/dist/workstation/acp/test/raw/sources.js +16 -130
  54. package/dist/workstation/acp/test/realAdapter.js +1 -47
  55. package/dist/workstation/acp/test/scriptAgent.js +11 -3
  56. package/dist/workstation/agentFlow.js +1 -1
  57. package/dist/workstation/agentSessions.js +38 -143
  58. package/dist/workstation/channels/management.js +95 -11
  59. package/dist/workstation/channels/url.js +1 -1
  60. package/dist/workstation/config.js +16 -4
  61. package/dist/workstation/connection/encryptedChannel.js +4 -1
  62. package/dist/workstation/control/bindingStore.js +200 -0
  63. package/dist/workstation/control/commands.js +124 -0
  64. package/dist/workstation/control/daemonIdentity.js +53 -0
  65. package/dist/workstation/control/enrollment.js +106 -0
  66. package/dist/workstation/control/inspect.js +71 -0
  67. package/dist/workstation/control/locks.js +63 -0
  68. package/dist/workstation/control/protocol.js +40 -0
  69. package/dist/workstation/control/restartGuard.js +46 -0
  70. package/dist/workstation/control/runtimeClient.js +97 -0
  71. package/dist/workstation/control/runtimeHost.js +148 -0
  72. package/dist/workstation/control/serverIdentity.js +35 -0
  73. package/dist/workstation/daemon.js +106 -6
  74. package/dist/workstation/daemonctl.js +77 -14
  75. package/dist/workstation/desktopControl/audio.js +99 -0
  76. package/dist/workstation/desktopControl/capabilities.js +92 -0
  77. package/dist/workstation/desktopControl/captureModes.js +9 -0
  78. package/dist/workstation/desktopControl/captureTargetLabel.js +9 -0
  79. package/dist/workstation/desktopControl/deviceSockets.js +246 -0
  80. package/dist/workstation/desktopControl/helperProcess.js +353 -0
  81. package/dist/workstation/desktopControl/lobby.js +129 -0
  82. package/dist/workstation/desktopControl/macProvider.js +155 -0
  83. package/dist/workstation/desktopControl/media.js +331 -0
  84. package/dist/workstation/desktopControl/nativeProvider.js +1018 -0
  85. package/dist/workstation/desktopControl/networkEvidence.js +43 -0
  86. package/dist/workstation/desktopControl/overview.js +58 -0
  87. package/dist/workstation/desktopControl/protocol.js +302 -0
  88. package/dist/workstation/desktopControl/quicMedia.js +240 -0
  89. package/dist/workstation/desktopControl/rateController.js +226 -0
  90. package/dist/workstation/desktopControl/supervisor.js +1681 -0
  91. package/dist/workstation/desktopControl/transport.js +27 -0
  92. package/dist/workstation/desktopControl/wallpaper.js +78 -0
  93. package/dist/workstation/files/credentials.js +142 -0
  94. package/dist/workstation/files/text.js +42 -8
  95. package/dist/workstation/keepers/kit/bundle.js +21 -17
  96. package/dist/workstation/keepers/kit/launcher.js +47 -7
  97. package/dist/workstation/keepers/kit/paths.js +2 -1
  98. package/dist/workstation/managedInstall.js +57 -0
  99. package/dist/workstation/protocol/agent.js +2 -15
  100. package/dist/workstation/protocol/management.js +93 -4
  101. package/dist/workstation/protocol/runtimeDiagnostics.js +15 -0
  102. package/dist/workstation/rd/artifact.js +119 -0
  103. package/dist/workstation/rd/control.js +119 -0
  104. package/dist/workstation/rd/display.js +29 -0
  105. package/dist/workstation/rd/provider.js +222 -0
  106. package/dist/workstation/rd/sessions.js +391 -0
  107. package/dist/workstation/rd/state.js +45 -0
  108. package/dist/workstation/rd/update.js +171 -0
  109. package/dist/workstation/rd/upkeep.js +38 -0
  110. package/dist/workstation/register.js +27 -37
  111. package/dist/workstation/service/installer.js +104 -13
  112. package/dist/workstation/service/launchd.js +1 -0
  113. package/dist/workstation/storageMetrics.js +118 -0
  114. package/dist/workstation/systemMetrics.js +44 -92
  115. package/dist/workstation/toolchain.js +94 -0
  116. package/dist/workstation/tools/browser.js +28 -4
  117. package/dist/workstation/update/artifact.js +2 -1
  118. package/dist/workstation/update/globalInstall.js +116 -0
  119. package/dist/workstation/update/npmInstaller.js +49 -23
  120. package/dist/workstation/update/rdRollback.js +145 -0
  121. package/dist/workstation/update/runUpdate.js +3 -2
  122. package/dist/workstation/update/watchdog.js +16790 -334
  123. package/package.json +5 -5
  124. package/skills/axom/SKILL.md +11 -11
  125. package/skills/axom-definition/SKILL.md +3 -3
  126. package/skills/axom-platform/SKILL.md +3 -3
  127. package/dist/axom-patch/cli/probes/qoder-steering.mjs +0 -89
  128. package/dist/axom-patch/cli/probes/qoder-subagent-origin.mjs +0 -61
  129. package/dist/axom-patch/cli/qoder-steering.json +0 -52
  130. package/dist/axom-patch/cli/qoder-subagent-origin.json +0 -73
  131. package/dist/commands/guide.js +0 -38
  132. package/dist/runtime-deps/qoder-sdk/package-lock.json +0 -1189
  133. package/dist/runtime-deps/qoder-sdk/package.json +0 -8
  134. package/dist/workstation/acp/delegationMcp.js +0 -24
  135. package/dist/workstation/acp/processor/sideChannel.js +0 -80
  136. package/dist/workstation/acp/qoderStartup.js +0 -45
  137. package/dist/workstation/acp/test/raw/qoderCaptures.js +0 -125
  138. package/dist/workstation/qoderAdapter/backgroundProcess.js +0 -118
  139. package/dist/workstation/qoderAdapter/backgroundTerminal.js +0 -193
  140. package/dist/workstation/qoderAdapter/backgroundTerminalFold.js +0 -372
  141. package/dist/workstation/qoderAdapter/callbackContext.js +0 -76
  142. package/dist/workstation/qoderAdapter/completedContinuation.js +0 -139
  143. package/dist/workstation/qoderAdapter/contract.js +0 -78
  144. package/dist/workstation/qoderAdapter/foregroundOutput.js +0 -36
  145. package/dist/workstation/qoderAdapter/history.js +0 -85
  146. package/dist/workstation/qoderAdapter/identityIndex.js +0 -191
  147. package/dist/workstation/qoderAdapter/inputQueue.js +0 -42
  148. package/dist/workstation/qoderAdapter/main.js +0 -95
  149. package/dist/workstation/qoderAdapter/mapper.js +0 -117
  150. package/dist/workstation/qoderAdapter/observerPlugin.js +0 -245
  151. package/dist/workstation/qoderAdapter/observerReceiver.js +0 -187
  152. package/dist/workstation/qoderAdapter/permissions.js +0 -61
  153. package/dist/workstation/qoderAdapter/profile.js +0 -93
  154. package/dist/workstation/qoderAdapter/sdkDriver.js +0 -48
  155. package/dist/workstation/qoderAdapter/sdkRuntime.js +0 -93
  156. package/dist/workstation/qoderAdapter/sdkRuntimeInstall.js +0 -145
  157. package/dist/workstation/qoderAdapter/session.js +0 -319
  158. package/dist/workstation/qoderAdapter/subagentMeta.js +0 -28
  159. package/dist/workstation/qoderAdapter/subwork.js +0 -85
  160. package/dist/workstation/qoderAdapter/taskControl.js +0 -38
  161. package/dist/workstation/qoderAdapter/taskLedger.js +0 -163
  162. package/dist/workstation/qoderAdapter/usage.js +0 -37
  163. /package/dist/workstation/{qoderAdapter/types.js → desktopControl/provider.js} +0 -0
@@ -0,0 +1,226 @@
1
+ import { DesktopNetworkEvidence } from './networkEvidence.js';
2
+ export class DesktopRateController {
3
+ min;
4
+ max;
5
+ maxFps;
6
+ networkEvidence = new DesktopNetworkEvidence();
7
+ target;
8
+ fps;
9
+ lastNow = -Infinity;
10
+ lastWindow = -Infinity;
11
+ lastRateChange = -Infinity;
12
+ lastFpsChange = -Infinity;
13
+ lastReopen = -Infinity;
14
+ cooldown = -Infinity;
15
+ reopens = [];
16
+ networkPressure = 0;
17
+ processingPressure = 0;
18
+ networkHealthy = 0;
19
+ headroom = 0;
20
+ recoveryWindows = 0;
21
+ recoveryFps;
22
+ fpsTrialUntil = -Infinity;
23
+ fpsRecoveryAfter = -Infinity;
24
+ paused = false;
25
+ demandBps = 0;
26
+ demandKnown = false;
27
+ windowHadActivity = false;
28
+ windowHadProgress = false;
29
+ windowHadProbeEvidence = false;
30
+ processingSamples = [];
31
+ encodeSamples = [];
32
+ lastEncodeObservation = -Infinity;
33
+ lastDecodeObservation = -Infinity;
34
+ lastNetworkPolicySample;
35
+ lastPath;
36
+ snapshot = { networkState: 'unknown',
37
+ networkQueueMs: 0, observedPayloadBps: 0, processingP95Ms: 0, encodeP95Ms: 0, receiverBudgetMs: 0, reasons: [] };
38
+ constructor(options = {}) {
39
+ const min = options.minBps ?? 500_000, max = options.maxBps ?? 20_000_000;
40
+ if (![min, max, options.targetBps ?? 4_000_000].every(Number.isFinite) || min < 500_000 || max > 20_000_000)
41
+ throw new Error('invalid rate bounds');
42
+ this.min = Math.ceil(min / 4000) * 4000;
43
+ this.max = Math.floor(max / 4000) * 4000;
44
+ if (this.min > this.max)
45
+ throw new Error('unrepresentable rate bounds');
46
+ this.target = this.quantize(options.targetBps ?? 4_000_000);
47
+ this.maxFps = options.maxFps ?? options.fpsCeiling ?? 60;
48
+ this.fps = options.fpsCeiling ?? this.maxFps;
49
+ this.recoveryFps = this.fps;
50
+ if (![15, 30, 60].includes(this.fps) || ![15, 30, 60].includes(this.maxFps) || this.fps > this.maxFps)
51
+ throw new Error('invalid fps bounds');
52
+ }
53
+ get diagnostics() { return { ...this.snapshot, reasons: [...this.snapshot.reasons] }; }
54
+ quantize(rate) {
55
+ return Math.max(this.min, Math.min(this.max, Math.floor(rate / 4000) * 4000));
56
+ }
57
+ sample(s, runtimeRateReconfigure = false) {
58
+ const optional = [s.rttBaselineMs, s.deliveryDelayMs, s.deliveryObservedAtMs, s.encodeObservedAtMs, s.decodeObservedAtMs];
59
+ if (![s.nowMs, s.activeBytes, s.excessRttMs, s.queueAgeMs, s.queuedSendMs, s.encodeMs, s.decodeMs]
60
+ .every(value => Number.isFinite(value) && value >= 0) ||
61
+ optional.some(value => value !== undefined && (!Number.isFinite(value) || value < 0)) ||
62
+ s.nowMs < this.lastNow)
63
+ throw new Error('invalid rate sample');
64
+ const elapsed = Number.isFinite(this.lastNow) ? s.nowMs - this.lastNow : 1000;
65
+ if (elapsed > 0) {
66
+ const observed = Math.min(this.max * 4, s.activeBytes * 8000 / elapsed);
67
+ const weight = -Math.expm1(-elapsed / 1000);
68
+ this.demandBps = this.demandKnown ? this.demandBps + (observed - this.demandBps) * weight : observed;
69
+ this.demandKnown = true;
70
+ }
71
+ this.lastNow = s.nowMs;
72
+ const window = Math.floor(s.nowMs / 1000);
73
+ const contiguous = window === this.lastWindow + 1;
74
+ const activeWindow = s.activeBytes > 0 || (contiguous && this.windowHadActivity);
75
+ const freshnessMs = Math.max(1500, (s.rttBaselineMs ?? 0) * 3);
76
+ const progress = s.deliveryObservedAtMs !== undefined
77
+ ? s.deliveryObservedAtMs <= s.nowMs && s.nowMs - s.deliveryObservedAtMs <= freshnessMs
78
+ : s.deliveryDelayMs !== undefined && s.deliveryDelayMs <= 40;
79
+ const progressWindow = progress || contiguous && this.windowHadProgress;
80
+ this.windowHadActivity = window === this.lastWindow ? this.windowHadActivity || s.activeBytes > 0 : s.activeBytes > 0;
81
+ this.windowHadProgress = window === this.lastWindow ? this.windowHadProgress || progress : progress;
82
+ if (s.queuedSendMs > 100)
83
+ this.paused = true;
84
+ else if (s.queuedSendMs === 0)
85
+ this.paused = false;
86
+ const evidence = this.networkEvidence.sample(s.nowMs, s.network, this.demandBps);
87
+ const probeEvidence = progress && (evidence.state === 'usable' || evidence.state === 'unknown' &&
88
+ s.deliveryDelayMs !== undefined && s.deliveryDelayMs <= 40);
89
+ const probeWindow = probeEvidence || contiguous && this.windowHadProbeEvidence;
90
+ this.windowHadProbeEvidence = window === this.lastWindow ? this.windowHadProbeEvidence || probeEvidence : probeEvidence;
91
+ const path = s.network ? `${s.network.id}:${s.network.pathGeneration}` : undefined;
92
+ if (path !== this.lastPath) {
93
+ this.networkPressure = this.networkHealthy = 0;
94
+ this.lastNetworkPolicySample = undefined;
95
+ this.lastPath = path;
96
+ }
97
+ const sampleKey = s.network ? `${path}:${s.network.sequence}` : undefined;
98
+ const freshNetworkWindow = sampleKey !== undefined && sampleKey !== this.lastNetworkPolicySample;
99
+ if (window !== this.lastWindow && !contiguous) {
100
+ this.processingSamples = [];
101
+ this.encodeSamples = [];
102
+ }
103
+ const encodeAt = s.encodeObservedAtMs ?? (s.encodeMs > 0 ? s.nowMs : undefined);
104
+ const decodeAt = s.decodeObservedAtMs ?? (s.decodeMs > 0 ? s.nowMs : undefined);
105
+ const costs = [];
106
+ if (encodeAt !== undefined && encodeAt > this.lastEncodeObservation && encodeAt <= s.nowMs && s.nowMs - encodeAt <= freshnessMs) {
107
+ this.lastEncodeObservation = encodeAt;
108
+ costs.push(s.encodeMs);
109
+ this.encodeSamples.push(s.encodeMs);
110
+ }
111
+ if (decodeAt !== undefined && decodeAt > this.lastDecodeObservation && decodeAt <= s.nowMs && s.nowMs - decodeAt <= freshnessMs) {
112
+ this.lastDecodeObservation = decodeAt;
113
+ costs.push(s.decodeMs);
114
+ }
115
+ if (costs.length)
116
+ this.processingSamples.push(Math.max(...costs));
117
+ if (this.processingSamples.length > 128)
118
+ this.processingSamples.shift();
119
+ if (this.encodeSamples.length > 128)
120
+ this.encodeSamples.shift();
121
+ this.snapshot = { ...this.snapshot, networkState: evidence.state, networkQueueMs: evidence.queueMs,
122
+ observedPayloadBps: Math.round(this.demandBps), reasons: this.paused ? ['sender-backpressure'] : [] };
123
+ const decision = (reopenEpoch = false) => ({ targetBps: this.target,
124
+ fpsCeiling: this.fps, pauseCapture: this.paused, reopenEpoch });
125
+ if (window === this.lastWindow)
126
+ return decision();
127
+ this.lastWindow = window;
128
+ if (!contiguous)
129
+ this.networkPressure = this.processingPressure = this.networkHealthy = this.headroom = this.recoveryWindows = 0;
130
+ const costsInWindow = this.processingSamples.sort((left, right) => left - right);
131
+ this.processingSamples = [];
132
+ const cost = costsInWindow[Math.max(0, Math.ceil(costsInWindow.length * 0.95) - 1)] ?? 0;
133
+ this.snapshot.processingP95Ms = cost;
134
+ const encodeCosts = this.encodeSamples.sort((left, right) => left - right);
135
+ this.encodeSamples = [];
136
+ const encodeCost = encodeCosts[Math.max(0, Math.ceil(encodeCosts.length * 0.95) - 1)] ?? 0;
137
+ const receiverBudget = Math.max(80, 3000 / this.fps);
138
+ this.snapshot.encodeP95Ms = encodeCost;
139
+ this.snapshot.receiverBudgetMs = receiverBudget;
140
+ if (!activeWindow) {
141
+ this.networkPressure = this.processingPressure = this.networkHealthy = this.headroom = this.recoveryWindows = 0;
142
+ this.snapshot.reasons.push('content-idle');
143
+ return decision();
144
+ }
145
+ const net = evidence.state === 'congested' && freshNetworkWindow;
146
+ this.lastNetworkPolicySample = sampleKey;
147
+ const receiverPressure = costsInWindow.length > 0 && cost > 0.8 * 1000 / this.fps && s.queueAgeMs > receiverBudget;
148
+ const sourcePressure = encodeCosts.length > 0 && encodeCost > 0.8 * 1000 / this.fps;
149
+ const processing = sourcePressure || receiverPressure;
150
+ this.networkPressure = net ? this.networkPressure + 1 : 0;
151
+ this.processingPressure = processing ? this.processingPressure + 1 : 0;
152
+ this.networkHealthy = !net && probeWindow && progressWindow && !this.paused ? this.networkHealthy + 1 : 0;
153
+ const nextFps = Math.min(this.maxFps, this.fps === 15 ? 30 : 60);
154
+ this.headroom = encodeCosts.length > 0 && !processing && s.queueAgeMs <= 40 && !this.paused &&
155
+ encodeCost < 0.6 * 1000 / nextFps ? this.headroom + 1 : 0;
156
+ this.recoveryWindows = nextFps > this.fps && nextFps <= this.recoveryFps && encodeCosts.length > 0 &&
157
+ progressWindow && !net && s.queueAgeMs <= 40 && !this.paused && encodeCost < 0.8 * 1000 / nextFps
158
+ ? this.recoveryWindows + 1 : 0;
159
+ if (net)
160
+ this.snapshot.reasons.push('sender-path-congestion');
161
+ if (processing)
162
+ this.snapshot.reasons.push('processing-pressure');
163
+ if (sourcePressure)
164
+ this.snapshot.reasons.push('source-encode-pressure');
165
+ if (receiverPressure)
166
+ this.snapshot.reasons.push('receiver-backlog');
167
+ if (evidence.state === 'unknown')
168
+ this.snapshot.reasons.push('network-unknown');
169
+ if (this.fps < this.recoveryFps && s.nowMs < this.fpsRecoveryAfter)
170
+ this.snapshot.reasons.push('fps-recovery-backoff');
171
+ if (s.nowMs < this.cooldown)
172
+ return decision();
173
+ let target = this.target, fps = this.fps;
174
+ if (this.networkPressure >= 2 && s.nowMs - this.lastRateChange >= 2000) {
175
+ target = this.quantize(Math.min(target * 0.85, evidence.bandwidthBps ? evidence.bandwidthBps * 0.9 : target));
176
+ }
177
+ else if (this.networkHealthy >= 3 && s.nowMs - this.lastRateChange >= (runtimeRateReconfigure ? 2000 : 10000) &&
178
+ this.demandBps >= target * 0.25) {
179
+ target = this.quantize(target * (runtimeRateReconfigure ? evidence.state === 'usable' ? 1.5 : 1.2 : 1.1));
180
+ if (target > this.target)
181
+ this.snapshot.reasons.push('bandwidth-probe');
182
+ }
183
+ if (this.processingPressure >= 2 && s.nowMs - this.lastFpsChange >= 2000)
184
+ fps = fps === 60 ? 30 : 15;
185
+ else if ((this.headroom >= 3 || this.recoveryWindows >= 5) && s.nowMs >= this.fpsRecoveryAfter &&
186
+ s.nowMs - this.lastFpsChange >= (runtimeRateReconfigure ? 2000 : 10000)) {
187
+ fps = nextFps;
188
+ if (fps > this.fps && this.headroom < 3)
189
+ this.snapshot.reasons.push('fps-recovery-probe');
190
+ }
191
+ if (target === this.max)
192
+ this.snapshot.reasons.push('policy-limit');
193
+ if (target === this.target && fps === this.fps)
194
+ return decision();
195
+ if (!runtimeRateReconfigure && s.nowMs - this.lastReopen < 2000)
196
+ return decision();
197
+ this.reopens = this.reopens.filter(at => s.nowMs - at < 10000);
198
+ if (!runtimeRateReconfigure && this.reopens.length === 2) {
199
+ fps = 15;
200
+ this.cooldown = s.nowMs + 10000;
201
+ }
202
+ if (target !== this.target) {
203
+ this.lastRateChange = s.nowMs;
204
+ this.networkPressure = this.networkHealthy = 0;
205
+ }
206
+ if (fps !== this.fps) {
207
+ if (fps < this.fps) {
208
+ this.recoveryFps = Math.max(this.recoveryFps, this.fps);
209
+ if (s.nowMs <= this.fpsTrialUntil)
210
+ this.fpsRecoveryAfter = s.nowMs + 30000;
211
+ this.fpsTrialUntil = -Infinity;
212
+ }
213
+ else
214
+ this.fpsTrialUntil = s.nowMs + 10000;
215
+ this.lastFpsChange = s.nowMs;
216
+ this.processingPressure = this.headroom = this.recoveryWindows = 0;
217
+ }
218
+ this.target = target;
219
+ this.fps = fps;
220
+ if (!runtimeRateReconfigure) {
221
+ this.reopens.push(s.nowMs);
222
+ this.lastReopen = s.nowMs;
223
+ }
224
+ return decision(!runtimeRateReconfigure);
225
+ }
226
+ }