@makerbi/remodex 2.5.6 → 3.1.0

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": "@makerbi/remodex",
3
- "version": "2.5.6",
3
+ "version": "3.1.0",
4
4
  "description": "Local bridge between Codex and the Remodex mobile app. Run `remodex up` to start.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -443,7 +443,8 @@ function createDesktopIpcActionFollower({
443
443
  // stays idle after opening never delivers them.
444
444
  emitNormalizedReviewOverlays(
445
445
  threadId,
446
- normalizedLiveIndexesByThreadId.get(threadId)
446
+ normalizedLiveIndexesByThreadId.get(threadId),
447
+ liveState
447
448
  );
448
449
  const output = conversationProjector.project(threadId, liveState, {
449
450
  includeAllActiveTurns: true,
@@ -1516,7 +1517,8 @@ function createDesktopIpcActionFollower({
1516
1517
  }));
1517
1518
  emitNormalizedReviewOverlays(
1518
1519
  threadId,
1519
- normalizedLiveIndexesByThreadId.get(threadId)
1520
+ normalizedLiveIndexesByThreadId.get(threadId),
1521
+ liveState
1520
1522
  );
1521
1523
  emitDesktopSnapshotLifecycleTransition(threadId, liveState);
1522
1524
  for (const notification of bootstrapOutput.notifications || []) {
@@ -1535,7 +1537,8 @@ function createDesktopIpcActionFollower({
1535
1537
  emitDesktopSnapshotLifecycleTransition(threadId, liveState);
1536
1538
  emitNormalizedReviewOverlays(
1537
1539
  threadId,
1538
- normalizedLiveIndexesByThreadId.get(threadId)
1540
+ normalizedLiveIndexesByThreadId.get(threadId),
1541
+ liveState
1539
1542
  );
1540
1543
  conversationProjector.seed(threadId, liveState);
1541
1544
  rememberDesktopLiveProjection(threadId, liveState);
@@ -1548,7 +1551,8 @@ function createDesktopIpcActionFollower({
1548
1551
  }
1549
1552
  emitNormalizedReviewOverlays(
1550
1553
  threadId,
1551
- normalizedLiveIndexesByThreadId.get(threadId)
1554
+ normalizedLiveIndexesByThreadId.get(threadId),
1555
+ liveState
1552
1556
  );
1553
1557
  const output = conversationProjector.project(threadId, liveState);
1554
1558
  if (resumedAfterStaleYield || output.type === "fullReplace" || output.type === "baseline") {
@@ -1605,11 +1609,16 @@ function createDesktopIpcActionFollower({
1605
1609
  rememberDesktopLiveProjection(threadId, liveState);
1606
1610
  }
1607
1611
 
1608
- function emitNormalizedReviewOverlays(threadId, index) {
1612
+ function emitNormalizedReviewOverlays(threadId, index, projectedState) {
1609
1613
  if (!index || !Array.isArray(index.pendingReviewOverlays)) {
1610
1614
  return;
1611
1615
  }
1612
1616
  const overlays = index.pendingReviewOverlays.splice(0);
1617
+ const projectedTurnIds = new Set(
1618
+ (Array.isArray(projectedState?.turns) ? projectedState.turns : [])
1619
+ .map(turnIdOf)
1620
+ .filter(Boolean)
1621
+ );
1613
1622
  const fingerprints = normalizedReviewFingerprintsByThreadId.get(threadId) || new Map();
1614
1623
  for (const overlay of overlays) {
1615
1624
  // Reviews on turns in the projected live tail may also be emitted by
@@ -1626,6 +1635,16 @@ function createDesktopIpcActionFollower({
1626
1635
  if (!reviewId || !status || !item?.action) {
1627
1636
  continue;
1628
1637
  }
1638
+ // Completed approved reviews are ordinary tool history. Replaying every
1639
+ // normalized-history review after a bounded canonical read appends old
1640
+ // rows at the phone's live tail, detached from their original disclosure.
1641
+ // The projected tail still emits its approvals so they reconcile in the
1642
+ // owning turn; non-approved outcomes remain global because they may need
1643
+ // the user's attention.
1644
+ if (normalizeToken(status) === "approved"
1645
+ && !projectedTurnIds.has(readString(overlay.turnId))) {
1646
+ continue;
1647
+ }
1629
1648
  const fingerprint = createHash("sha256")
1630
1649
  .update(JSON.stringify({ status, item }))
1631
1650
  .digest("hex");
@@ -1476,6 +1476,8 @@ function toolStartNotifications(state, payload) {
1476
1476
  threadId: state.threadId,
1477
1477
  turnId: state.activeTurnId,
1478
1478
  call_id: callId,
1479
+ itemId: callId,
1480
+ status: "inProgress",
1479
1481
  message: activityMessage,
1480
1482
  }),
1481
1483
  ];
@@ -1536,6 +1538,10 @@ function customToolStartNotifications(state, payload) {
1536
1538
  threadId: state.threadId,
1537
1539
  turnId: state.activeTurnId,
1538
1540
  call_id: callId,
1541
+ ...(!state.applyPatchCalls.has(callId) ? {
1542
+ itemId: callId,
1543
+ status: "inProgress",
1544
+ } : {}),
1539
1545
  message: activityMessage,
1540
1546
  }),
1541
1547
  ];
@@ -1641,6 +1647,8 @@ function toolOutputNotifications(state, payload) {
1641
1647
  threadId: state.threadId,
1642
1648
  turnId: state.activeTurnId,
1643
1649
  call_id: callId,
1650
+ itemId: callId,
1651
+ status: "completed",
1644
1652
  message: genericToolCompletionMessage(toolCall.toolName),
1645
1653
  }));
1646
1654
  state.commandCalls.delete(callId);