chatroom-cli 1.107.1 → 1.107.2

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
@@ -117785,6 +117785,18 @@ var init_task_delivery_processor = __esm(() => {
117785
117785
  init_task_delivery_logic();
117786
117786
  });
117787
117787
 
117788
+ // src/daemon/entry/task-inbox-membership-registry.ts
117789
+ function registerTaskInboxRoomMembershipRefresh(refresh) {
117790
+ refreshRoomMembership = refresh;
117791
+ }
117792
+ function unregisterTaskInboxRoomMembershipRefresh() {
117793
+ refreshRoomMembership = null;
117794
+ }
117795
+ async function refreshTaskInboxRoomMembership() {
117796
+ await refreshRoomMembership?.();
117797
+ }
117798
+ var refreshRoomMembership = null;
117799
+
117788
117800
  // src/daemon/infrastructure/agent-operational/operational-signal-contract.ts
117789
117801
  function asChatroomId(chatroomId) {
117790
117802
  return chatroomId;
@@ -118514,6 +118526,32 @@ var NATIVE_DELIVERY_RECONCILE_MS = 1e4, INBOX_RESTART_INITIAL_MS = 1000, INBOX_R
118514
118526
  })();
118515
118527
  return entry.startPromise;
118516
118528
  };
118529
+ const refreshRoomMembership2 = async () => {
118530
+ try {
118531
+ const workspaces = await wsClient2.query(api.workspaces.listWorkspacesForMachine, {
118532
+ sessionId: session2.sessionId,
118533
+ machineId: session2.machineId
118534
+ });
118535
+ if (stopped)
118536
+ return;
118537
+ const chatroomIds = [
118538
+ ...new Set((workspaces ?? []).map((workspace) => workspace.chatroomId))
118539
+ ];
118540
+ const activeChatroomIds = new Set(chatroomIds);
118541
+ for (const [chatroomId, watcher] of roomWatchers) {
118542
+ if (activeChatroomIds.has(chatroomId))
118543
+ continue;
118544
+ watcher.controller.abort();
118545
+ roomWatchers.delete(chatroomId);
118546
+ knownRoomIds.delete(chatroomId);
118547
+ }
118548
+ await Promise.all(chatroomIds.map((chatroomId) => ensureRoomInboxes(chatroomId)));
118549
+ } catch (error51) {
118550
+ console.warn("[TaskInbox] room membership refresh failed:", error51);
118551
+ }
118552
+ };
118553
+ registerTaskInboxRoomMembershipRefresh(refreshRoomMembership2);
118554
+ yield* exports_Effect.promise(refreshRoomMembership2);
118517
118555
  yield* exports_Effect.tryPromise(() => Promise.all([...knownRoomIds].map((chatroomId) => ensureRoomInboxes(chatroomId)))).pipe(exports_Effect.catchAll((error51) => {
118518
118556
  console.warn("[OperationalInbox] initial watcher start failed:", error51);
118519
118557
  return exports_Effect.void;
@@ -118537,17 +118575,6 @@ var NATIVE_DELIVERY_RECONCILE_MS = 1e4, INBOX_RESTART_INITIAL_MS = 1000, INBOX_R
118537
118575
  if (stopped || inboxUpdatesInFlight > 0 || reconcileInFlight)
118538
118576
  return;
118539
118577
  reconcileInFlight = true;
118540
- (async () => {
118541
- try {
118542
- const current = await fetchMachineAgentOperationalStatus(sessionDeps, session2.machineId);
118543
- agentOperationalReadModel.replace(current);
118544
- for (const row of current)
118545
- knownRoomIds.add(row.chatroomId);
118546
- await Promise.all([...new Set(current.map((row) => row.chatroomId))].map((chatroomId) => ensureRoomInboxes(chatroomId)));
118547
- } catch (error51) {
118548
- console.warn("[TaskInbox] room membership refresh failed:", error51);
118549
- }
118550
- })();
118551
118578
  processTasksUpdate(runtime4, effectContext2, cooldown, agentMgr, sessionDeps, session2.machineId, "periodic-reconcile", { snapshots: enrichSnapshotsWithOperational(taskSnapshotState.listAll()) }).catch((error51) => {
118552
118579
  console.warn("[TaskInbox] local delivery reconciliation failed:", error51);
118553
118580
  }).finally(() => {
@@ -118562,6 +118589,7 @@ var NATIVE_DELIVERY_RECONCILE_MS = 1e4, INBOX_RESTART_INITIAL_MS = 1000, INBOX_R
118562
118589
  watcher.controller.abort();
118563
118590
  }
118564
118591
  clearInterval(reconcileTimer);
118592
+ unregisterTaskInboxRoomMembershipRefresh();
118565
118593
  unregisterNativeDeliverySession();
118566
118594
  inboxStore.close();
118567
118595
  }
@@ -120074,6 +120102,7 @@ function startAllSubscribers(deps) {
120074
120102
  if (claimed.type === "daemon.workspaceListChanged") {
120075
120103
  enhancerJob.refreshChatrooms();
120076
120104
  gitRequest.refreshWorkspaces();
120105
+ refreshTaskInboxRoomMembership();
120077
120106
  }
120078
120107
  await dispatchCommandInboundEvent({
120079
120108
  type: "command.received",
@@ -135878,4 +135907,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
135878
135907
  });
135879
135908
  program2.parse();
135880
135909
 
135881
- //# debugId=3C68FDC314358C7A64756E2164756E21
135910
+ //# debugId=FF0641D1EDD955EA64756E2164756E21