chatroom-cli 1.98.4 → 1.98.5

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
@@ -108647,12 +108647,17 @@ function handleRefreshCapabilitiesEffect(event, tracker) {
108647
108647
  })));
108648
108648
  });
108649
108649
  }
108650
- async function handleInboundCommandEvent(commandId, tracker, effectContext2, session2) {
108651
- const result = await session2.backend.query(api.machines.getCommandEvents, {
108652
- sessionId: session2.sessionId,
108653
- machineId: session2.machineId
108654
- });
108655
- const event = result?.events?.find((e) => e._id.toString() === commandId);
108650
+ async function handleInboundCommandEvent(commandId, tracker, effectContext2, session2, commandEvent) {
108651
+ let event;
108652
+ if (commandEvent?._id.toString() === commandId) {
108653
+ event = commandEvent;
108654
+ } else {
108655
+ const result = await session2.backend.query(api.machines.getCommandEvents, {
108656
+ sessionId: session2.sessionId,
108657
+ machineId: session2.machineId
108658
+ });
108659
+ event = result?.events?.find((e) => e._id.toString() === commandId);
108660
+ }
108656
108661
  if (!event)
108657
108662
  return;
108658
108663
  await exports_Effect.runPromise(dispatchCommandEventEffect(event, tracker).pipe(exports_Effect.provide(effectContext2)));
@@ -116741,7 +116746,7 @@ Listening for commands...`);
116741
116746
  registerCommandInboundHandler(async (event) => {
116742
116747
  evictStaleDedupEntries(dedupTracker);
116743
116748
  if (event.type === "command.received") {
116744
- await handleInboundCommandEvent(event.commandId, dedupTracker, effectContext2, session2);
116749
+ await handleInboundCommandEvent(event.commandId, dedupTracker, effectContext2, session2, event.commandEvent);
116745
116750
  } else {
116746
116751
  await drainActionableCommandRuns(session2, commandRunRuntime);
116747
116752
  }
@@ -117898,7 +117903,11 @@ function startCommandEventsSubscriber(deps, onEvent) {
117898
117903
  if (seen.has(event._id))
117899
117904
  continue;
117900
117905
  seen.add(event._id);
117901
- onEvent({ type: "command.received", commandId: event._id });
117906
+ onEvent({
117907
+ type: "command.received",
117908
+ commandId: event._id,
117909
+ commandEvent: event
117910
+ });
117902
117911
  }
117903
117912
  }, (err) => {
117904
117913
  console.warn(`[daemon] command-events subscriber error: ${err instanceof Error ? err.message : String(err)}`);
@@ -134124,4 +134133,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
134124
134133
  });
134125
134134
  program2.parse();
134126
134135
 
134127
- //# debugId=6381A1F83F16A2C964756E2164756E21
134136
+ //# debugId=D41963016C23E20F64756E2164756E21