replicas-computer 0.3.24 → 0.3.26

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/dist/index.js CHANGED
@@ -3069,7 +3069,7 @@ async function computerStatusCommand() {
3069
3069
  }
3070
3070
 
3071
3071
  // src/version.ts
3072
- var COMPUTER_USE_VERSION = "0.3.23";
3072
+ var COMPUTER_USE_VERSION = "0.3.26";
3073
3073
  var COMPUTER_USE_PROTOCOL_VERSION = 1;
3074
3074
 
3075
3075
  // src/program.ts
@@ -962,6 +962,7 @@ var setStandby = (next) => {
962
962
  clearTimeout(standbyTimer);
963
963
  if (next === standby) return;
964
964
  standby = next;
965
+ if (!standby) lastFrameAt = performance.now();
965
966
  note(standby ? "standby" : "active");
966
967
  sendSocket({ type: "standby", standby });
967
968
  if (!standby && !audioPrompt.hidden) unlockAudio();
@@ -1030,9 +1031,8 @@ var updateDiagnostics = (stats) => {
1030
1031
  viewerEvents.length ? `viewer events: ${describeEvents(viewerEvents.slice(-5))}` : ""
1031
1032
  ].filter(Boolean).join("\n");
1032
1033
  };
1033
- var sampleConnection = (stats, current, now) => {
1034
+ var sampleConnection = (stats, current, now, shown) => {
1034
1035
  const totals = connectionTotals;
1035
- const shown = !standby && document.visibilityState === "visible" && qualityUnseen.samples < 4;
1036
1036
  if (shown && totals.sampledAt) {
1037
1037
  totals.shownSince ??= totals.sampledAt;
1038
1038
  totals.shownMs += now - totals.sampledAt;
@@ -1062,8 +1062,9 @@ var reportQuality = (stats) => {
1062
1062
  const current = qualityWindow ??= { at: now, presented: presentedFrames, freezes: inbound?.freezeCount ?? 0, longestGapMs: 0 };
1063
1063
  const decoded = transport === "webrtc" ? inbound?.framesDecoded ?? 0 : socketDecodedFrames;
1064
1064
  qualityUnseen = { decoded, presented: presentedFrames, samples: decoded > qualityUnseen.decoded && presentedFrames === qualityUnseen.presented ? qualityUnseen.samples + 1 : 0 };
1065
- if (qualityUnseen.samples >= 4) current.unseen = true;
1066
- sampleConnection(stats, telemetry, now);
1065
+ const shown = !standby && document.visibilityState === "visible" && qualityUnseen.samples < 4;
1066
+ if (!shown) current.unseen = true;
1067
+ sampleConnection(stats, telemetry, now, shown);
1067
1068
  qualitySamples.push({ stats, telemetry });
1068
1069
  const windowMs = now - current.at;
1069
1070
  if (windowMs < qualityWindowMs) return;
@@ -1200,7 +1201,7 @@ var reportWebRtcStats = async (pc, stats) => {
1200
1201
  state.framesDropped = video?.framesDropped;
1201
1202
  };
1202
1203
  setInterval(() => {
1203
- if (transport !== "webrtc") return;
1204
+ if (transport !== "webrtc" || standby) return;
1204
1205
  if (screen.paused && screen.srcObject instanceof MediaStream && screen.srcObject.getVideoTracks().some((track) => track.readyState === "live")) return;
1205
1206
  const now = performance.now();
1206
1207
  if (now - lastFrameAt >= webrtcFrameTimeoutMs) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-computer",
3
- "version": "0.3.24",
3
+ "version": "0.3.26",
4
4
  "description": "Replicas workspace computer-use runtime",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",