@buildautomaton/cli 0.1.91 → 0.1.92

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
@@ -20762,6 +20762,7 @@ import os from "node:os";
20762
20762
  var INDEX_WORK_YIELD_EVERY, INDEX_DIR, INDEX_HASH_LEN;
20763
20763
  var init_constants = __esm({
20764
20764
  "../bridge/src/files/index/constants.ts"() {
20765
+ "use strict";
20765
20766
  INDEX_WORK_YIELD_EVERY = 128;
20766
20767
  INDEX_DIR = path3.join(os.homedir(), ".buildautomaton");
20767
20768
  INDEX_HASH_LEN = 16;
@@ -21108,6 +21109,7 @@ var init_idle_yield = __esm({
21108
21109
  // ../bridge/src/files/browser/in-flight.ts
21109
21110
  var init_in_flight = __esm({
21110
21111
  "../bridge/src/files/browser/in-flight.ts"() {
21112
+ "use strict";
21111
21113
  init_activity_shared();
21112
21114
  init_activity_types();
21113
21115
  init_activity_tracker();
@@ -21922,7 +21924,6 @@ function withCodeNavCacheSqliteWorkLock(fn) {
21922
21924
  var chain, workLockDepth;
21923
21925
  var init_code_nav_cache_sqlite_work_lock = __esm({
21924
21926
  "../bridge/src/sqlite/code-nav-cache/code-nav-cache-sqlite-work-lock.ts"() {
21925
- "use strict";
21926
21927
  init_code_nav_cache_paths();
21927
21928
  chain = Promise.resolve();
21928
21929
  workLockDepth = 0;
@@ -26563,6 +26564,7 @@ async function delayMsUnlessShutdownRequested(ms) {
26563
26564
  var cliImmediateShutdownRequested, symbolIndexShutdownPromise;
26564
26565
  var init_cli_process_interrupt = __esm({
26565
26566
  "../bridge/src/cli/teardown/cli-process-interrupt.ts"() {
26567
+ "use strict";
26566
26568
  cliImmediateShutdownRequested = false;
26567
26569
  symbolIndexShutdownPromise = null;
26568
26570
  }
@@ -27576,6 +27578,7 @@ function createWsBridge(options) {
27576
27578
  });
27577
27579
  ws.on("open", () => {
27578
27580
  disposeClientPing();
27581
+ if (isActiveSocket && !isActiveSocket(ws)) return;
27579
27582
  if (clientPingIntervalMs != null && clientPingIntervalMs > 0) {
27580
27583
  clearClientPing = attachWebSocketClientPing(ws, clientPingIntervalMs);
27581
27584
  }
@@ -27595,10 +27598,12 @@ function createWsBridge(options) {
27595
27598
  });
27596
27599
  ws.on("close", (code, reason) => {
27597
27600
  disposeClientPing();
27598
- onClose?.(code, reason.toString());
27601
+ if (isActiveSocket && !isActiveSocket(ws)) return;
27602
+ onClose?.(code, reason.toString(), ws);
27599
27603
  });
27600
27604
  ws.on("error", (err) => {
27601
27605
  disposeClientPing();
27606
+ if (isActiveSocket && !isActiveSocket(ws)) return;
27602
27607
  onError2?.(err);
27603
27608
  });
27604
27609
  return ws;
@@ -27703,7 +27708,7 @@ function formatSpawnError(err, command) {
27703
27708
  }
27704
27709
 
27705
27710
  // ../bridge/src/agents/acp/clients/kill-process-tree.ts
27706
- var import_tree_kill = __toESM(require_tree_kill());
27711
+ var import_tree_kill = __toESM(require_tree_kill(), 1);
27707
27712
  import { promisify } from "node:util";
27708
27713
  var treeKillAsync = promisify(import_tree_kill.default);
27709
27714
  var ACP_PROCESS_TREE_KILL_GRACE_MS = 2500;
@@ -40533,7 +40538,7 @@ function createBridgeHeartbeatController(params) {
40533
40538
  }
40534
40539
 
40535
40540
  // ../bridge/src/cli/cli-version.ts
40536
- var CLI_VERSION = "0.1.91".length > 0 ? "0.1.91" : "0.0.0-dev";
40541
+ var CLI_VERSION = "0.1.92".length > 0 ? "0.1.92" : "0.0.0-dev";
40537
40542
 
40538
40543
  // ../bridge/src/connection/identify/send-bridge-identify.ts
40539
40544
  function sendBridgeIdentify(ws, params) {
@@ -52332,12 +52337,12 @@ function createMainBridgeAuthRefreshHandler(params, connect) {
52332
52337
  // ../bridge/src/connection/ws/main-bridge-ws-close-handler.ts
52333
52338
  function createMainBridgeCloseHandler(params, connect) {
52334
52339
  const { state, logFn, bridgeHeartbeat } = params;
52335
- return (code, reason) => {
52340
+ return (code, reason, closedWs) => {
52341
+ if (state.currentWs !== closedWs) return;
52336
52342
  bridgeHeartbeat?.stop();
52337
52343
  try {
52338
- const was = state.currentWs;
52339
52344
  state.currentWs = null;
52340
- if (was) was.removeAllListeners();
52345
+ closedWs.removeAllListeners();
52341
52346
  const willReconnect = !state.closedByUser;
52342
52347
  if (willReconnect) {
52343
52348
  const duplicateResult = evaluateDuplicateBridgeDisconnect(
@@ -53458,7 +53463,7 @@ function createPendingAuthOnMessage(params) {
53458
53463
  }
53459
53464
 
53460
53465
  // src/cli-version.ts
53461
- var CLI_VERSION2 = "0.1.91".length > 0 ? "0.1.91" : "0.0.0-dev";
53466
+ var CLI_VERSION2 = "0.1.92".length > 0 ? "0.1.92" : "0.0.0-dev";
53462
53467
 
53463
53468
  // src/auth/pending/pending-auth-on-open.ts
53464
53469
  function createPendingAuthOnOpen(params) {