frizz 0.12.3 → 0.12.4

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 (2) hide show
  1. package/dist/dev-child.js +51 -1
  2. package/package.json +1 -1
package/dist/dev-child.js CHANGED
@@ -24762,8 +24762,44 @@ ${detail2}
24762
24762
  } catch {
24763
24763
  }
24764
24764
  }
24765
+ function relocatedTranscript(state) {
24766
+ const name = `${state.nativeSessionId}.jsonl`;
24767
+ const home = join18(logDir, name);
24768
+ const homeAt = home === state.path ? void 0 : mtimeOfNonEmpty(home);
24769
+ const dir = discoverTranscriptDir(logDir, state.nativeSessionId);
24770
+ const sibling = dir ? join18(dir, name) : void 0;
24771
+ const siblingAt = sibling && sibling !== state.path ? mtimeOfNonEmpty(sibling) : void 0;
24772
+ if (homeAt === void 0) return siblingAt === void 0 ? void 0 : sibling;
24773
+ if (siblingAt === void 0) return home;
24774
+ return siblingAt > homeAt ? sibling : home;
24775
+ }
24765
24776
  function resolveTranscript(state, row, nowMs) {
24766
- if (state.offset > 0) return true;
24777
+ if (state.offset > 0) {
24778
+ if (existsSync5(state.path)) {
24779
+ state.discoverMisses = 0;
24780
+ state.nextDiscoverMs = 0;
24781
+ return true;
24782
+ }
24783
+ if (nowMs < state.nextDiscoverMs) return true;
24784
+ const moved = relocatedTranscript(state);
24785
+ if (!moved) {
24786
+ state.discoverMisses++;
24787
+ state.nextDiscoverMs = nowMs + Math.min(
24788
+ DISCOVER_RETRY_MS * 2 ** (state.discoverMisses - 1),
24789
+ DISCOVER_RETRY_MAX_MS
24790
+ );
24791
+ return true;
24792
+ }
24793
+ state.path = moved;
24794
+ state.offset = 0;
24795
+ state.partial = "";
24796
+ state.primed = false;
24797
+ state.noTranscript = false;
24798
+ state.stallLogged = false;
24799
+ state.discoverMisses = 0;
24800
+ state.nextDiscoverMs = 0;
24801
+ return true;
24802
+ }
24767
24803
  let size = 0;
24768
24804
  try {
24769
24805
  size = statSync8(state.path).size;
@@ -24774,6 +24810,7 @@ ${detail2}
24774
24810
  state.noTranscript = false;
24775
24811
  state.stallLogged = false;
24776
24812
  state.discoverMisses = 0;
24813
+ state.nextDiscoverMs = 0;
24777
24814
  return true;
24778
24815
  }
24779
24816
  const spawnedMs = Date.parse(row.spawned_at);
@@ -24789,6 +24826,7 @@ ${detail2}
24789
24826
  state.noTranscript = false;
24790
24827
  state.stallLogged = false;
24791
24828
  state.discoverMisses = 0;
24829
+ state.nextDiscoverMs = 0;
24792
24830
  return true;
24793
24831
  }
24794
24832
  const found = discoverTranscriptId(logDir, row.session_id, { nowMs, exclude: claimedIds(row.slug) });
@@ -24812,6 +24850,7 @@ ${detail2}
24812
24850
  state.noTranscript = false;
24813
24851
  state.stallLogged = false;
24814
24852
  state.discoverMisses = 0;
24853
+ state.nextDiscoverMs = 0;
24815
24854
  return true;
24816
24855
  }
24817
24856
  state.discoverMisses++;
@@ -24893,6 +24932,7 @@ ${detail2}
24893
24932
  drainUnretiredOps(state, row);
24894
24933
  if (state.offset !== primeOffset) transcriptDirty.push(row.slug);
24895
24934
  state.turn = turnFor(row, state, nowMs);
24935
+ onPrimedAtRest(row, state);
24896
24936
  const pane2 = sniffPane(
24897
24937
  state,
24898
24938
  row,
@@ -25063,6 +25103,16 @@ ${detail2}
25063
25103
  body: state.lastAssistant
25064
25104
  });
25065
25105
  }
25106
+ function onPrimedAtRest(row, state) {
25107
+ if (state.turn !== "idle" || !state.sawRecords) return;
25108
+ const eventAt = state.lastAssistantAt;
25109
+ if (!eventAt) return;
25110
+ const at = Date.parse(eventAt);
25111
+ if (!Number.isFinite(at)) return;
25112
+ const stamped = row.rested_at ? Date.parse(row.rested_at) : NaN;
25113
+ if (Number.isFinite(stamped) && at <= stamped) return;
25114
+ deps.storage.setRestedAtIfCurrent(row.slug, row.session_id, row.runtime_generation ?? 0, eventAt);
25115
+ }
25066
25116
  function onPaneDeath(row) {
25067
25117
  const generation = row.runtime_generation ?? 0;
25068
25118
  const eventAt = new Date(now()).toISOString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frizz",
3
- "version": "0.12.3",
3
+ "version": "0.12.4",
4
4
  "private": false,
5
5
  "description": "A local web UI for running many coding agents at once",
6
6
  "keywords": [