@remcp/remcp 0.2.230 → 0.2.231

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remcp/remcp",
3
- "version": "0.2.230",
3
+ "version": "0.2.231",
4
4
  "description": "ReMCP device client: pair a computer with ReMCP and run the outbound-only agent that hosts the local MCP runtime.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -15,7 +15,7 @@ const POST_CONNECT_UPDATE_RECHECK_DELAYS_MS = Object.freeze([60_000, 5 * 60_000,
15
15
  const POST_CONNECT_UPDATE_RECHECK_JITTER_MS = 30_000;
16
16
  const UPDATE_RETRY_COOLDOWN_MS = 30 * 60 * 1000;
17
17
 
18
- export function createAgentUpdateMonitor({ options, serverUrl, queueEvent, getRuntimeState, onStopRequested, restartRuntime, isStopping, stop }) {
18
+ export function createAgentUpdateMonitor({ options, serverUrl, queueEvent, getRuntimeState, onStopRequested, restartRuntime, isStopping, stop, resolveCli = globalCliEntry }) {
19
19
  const postConnectUpdateRecheckDelaysMs = (Array.isArray(options.updateRecheckDelaysMs)
20
20
  ? options.updateRecheckDelaysMs : POST_CONNECT_UPDATE_RECHECK_DELAYS_MS)
21
21
  .map(Number).filter(delay => Number.isFinite(delay) && delay >= 0 && delay < UPDATE_CHECK_INTERVAL_MS).slice(0, 3);
@@ -37,6 +37,8 @@ export function createAgentUpdateMonitor({ options, serverUrl, queueEvent, getRu
37
37
  let lastUpdateCheckError = '';
38
38
  let lastUpdateCheckErrorAt = 0;
39
39
  let lastDiscoveryAt = 0;
40
+ let lastAnnouncedVersion = '';
41
+ let lastAnnouncedAt = 0;
40
42
 
41
43
  function clearPostConnectUpdateChecks() {
42
44
  for (const timer of postConnectUpdateTimers) clearTimeout(timer);
@@ -86,10 +88,20 @@ export function createAgentUpdateMonitor({ options, serverUrl, queueEvent, getRu
86
88
  const decision = updateDecision({ advertised, cliVersion: VERSION, runtimeVersion, runtimePackageName: options.runtime?.packageName, runtimeDown });
87
89
  if (!decision.needed) return;
88
90
  const target = decision.target;
89
- queueEvent({ event: 'agent_update', at: Date.now(), reason: `${decision.reason}:${target}`.slice(0, 32), success: true });
90
- const cli = globalCliEntry();
91
+ const availabilityKey = `${target}|${decision.runtime}`;
92
+ const observedAt = Date.now();
93
+ const announce = availabilityKey !== lastAnnouncedVersion ||
94
+ observedAt - lastAnnouncedAt >= UPDATE_RETRY_COOLDOWN_MS;
95
+ if (announce) {
96
+ lastAnnouncedVersion = availabilityKey;
97
+ lastAnnouncedAt = observedAt;
98
+ // Version discovery is not installation success. The running version
99
+ // proves convergence only after the replacement agent reconnects.
100
+ queueEvent({ event: 'agent_update_available', at: observedAt, reason: decision.reason.slice(0, 32) });
101
+ }
102
+ const cli = resolveCli();
91
103
  if (!cli || !existsSync(cli)) {
92
- console.error(`ReMCP ${target} is available; run: remcp update`);
104
+ if (announce) console.error(`ReMCP ${target} is available; run: remcp update`);
93
105
  return;
94
106
  }
95
107
  // A version that already failed to install is retried only after a cooldown, so a broken