sidekick-docker 0.2.5 → 0.2.6

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.
@@ -55750,7 +55750,7 @@ var require_DockerClient = __commonJS({
55750
55750
  const streamType = combined[offset];
55751
55751
  const size = combined.readUInt32BE(offset + 4);
55752
55752
  if (offset + 8 + size > combined.length) {
55753
- buffer.push(combined.subarray(offset));
55753
+ buffer.push(Buffer.from(combined.subarray(offset)));
55754
55754
  break;
55755
55755
  }
55756
55756
  const payload = combined.subarray(offset + 8, offset + 8 + size).toString("utf8");
@@ -55763,7 +55763,7 @@ var require_DockerClient = __commonJS({
55763
55763
  offset += 8 + size;
55764
55764
  }
55765
55765
  if (offset < combined.length && buffer.length === 0) {
55766
- buffer.push(combined.subarray(offset));
55766
+ buffer.push(Buffer.from(combined.subarray(offset)));
55767
55767
  }
55768
55768
  }
55769
55769
  } finally {
@@ -56195,10 +56195,13 @@ var require_ComposeClient = __commonJS({
56195
56195
  let stdoutBuffer = "";
56196
56196
  let stderrBuffer = "";
56197
56197
  let done = false;
56198
+ const MAX_QUEUE = 1e3;
56198
56199
  const entries = [];
56199
56200
  let resolve = null;
56200
56201
  const push = (entry) => {
56201
56202
  entries.push(entry);
56203
+ if (entries.length > MAX_QUEUE)
56204
+ entries.shift();
56202
56205
  resolve?.();
56203
56206
  };
56204
56207
  const kill = () => {
@@ -94363,10 +94366,25 @@ var DockerState = class {
94363
94366
  lastRefresh = null;
94364
94367
  daemonConnected = false;
94365
94368
  cachedFileConfig = null;
94369
+ refreshTimer = null;
94366
94370
  constructor(client, cwd2) {
94367
94371
  this.client = client;
94368
94372
  this.cwd = cwd2;
94369
94373
  }
94374
+ /** Debounced refresh — coalesces rapid event-driven refreshes into a single call. */
94375
+ scheduleRefresh() {
94376
+ if (this.refreshTimer) return;
94377
+ this.refreshTimer = setTimeout(() => {
94378
+ this.refreshTimer = null;
94379
+ this.refresh().catch((e) => console.debug("refresh failed:", e));
94380
+ }, 500);
94381
+ }
94382
+ dispose() {
94383
+ if (this.refreshTimer) {
94384
+ clearTimeout(this.refreshTimer);
94385
+ this.refreshTimer = null;
94386
+ }
94387
+ }
94370
94388
  async refresh() {
94371
94389
  try {
94372
94390
  const promises = [
@@ -94410,7 +94428,7 @@ var DockerState = class {
94410
94428
  case "image":
94411
94429
  case "volume":
94412
94430
  case "network":
94413
- this.refresh().catch((e) => console.debug("refresh failed:", e));
94431
+ this.scheduleRefresh();
94414
94432
  break;
94415
94433
  }
94416
94434
  }
@@ -94425,7 +94443,7 @@ var DockerState = class {
94425
94443
  existing.state = "running";
94426
94444
  existing.status = "Up just now";
94427
94445
  }
94428
- this.refresh().catch((e) => console.debug("refresh failed:", e));
94446
+ this.scheduleRefresh();
94429
94447
  break;
94430
94448
  }
94431
94449
  case "stop":
@@ -94451,11 +94469,11 @@ var DockerState = class {
94451
94469
  this.containerChanges.delete(resourceId);
94452
94470
  break;
94453
94471
  case "create":
94454
- this.refresh().catch((e) => console.debug("refresh failed:", e));
94472
+ this.scheduleRefresh();
94455
94473
  break;
94456
94474
  default:
94457
94475
  if (name) {
94458
- this.refresh().catch((e) => console.debug("refresh failed:", e));
94476
+ this.scheduleRefresh();
94459
94477
  }
94460
94478
  break;
94461
94479
  }
@@ -97481,8 +97499,8 @@ function Dashboard({ panels, metrics, onViewStateChange, execTriggerRef, onExecF
97481
97499
  )
97482
97500
  ] })
97483
97501
  ] }),
97484
- state.overlay === "help" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(HelpOverlay, { panels, activePanelIndex: state.activePanelIndex, version: "0.2.5" }),
97485
- state.overlay === "version" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(VersionOverlay, { version: "0.2.5" }),
97502
+ state.overlay === "help" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(HelpOverlay, { panels, activePanelIndex: state.activePanelIndex, version: "0.2.6" }),
97503
+ state.overlay === "version" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(VersionOverlay, { version: "0.2.6" }),
97486
97504
  state.overlay === "exec" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
97487
97505
  ExecOverlay,
97488
97506
  {
@@ -97499,7 +97517,7 @@ function Dashboard({ panels, metrics, onViewStateChange, execTriggerRef, onExecF
97499
97517
  filterString: state.filterString,
97500
97518
  containerCount: metrics.containers.length,
97501
97519
  runningCount,
97502
- version: "0.2.5",
97520
+ version: "0.2.6",
97503
97521
  matchCount: state.filterString ? currentItems.length : void 0,
97504
97522
  totalCount: state.filterString ? totalItemCount : void 0,
97505
97523
  lastRefresh: metrics.lastRefresh,
@@ -97569,6 +97587,7 @@ async function dashboardAction(_opts, cmd) {
97569
97587
  if (renderTimer) return;
97570
97588
  renderTimer = setTimeout(() => {
97571
97589
  renderTimer = null;
97590
+ if (process.stdout.writableLength > process.stdout.writableHighWaterMark) return;
97572
97591
  instance.rerender(
97573
97592
  import_react37.default.createElement(Dashboard, {
97574
97593
  panels,
@@ -97767,9 +97786,13 @@ async function dashboardAction(_opts, cmd) {
97767
97786
  const mem = process.memoryUsage();
97768
97787
  const heapMB = (mem.heapUsed / 1024 / 1024).toFixed(1);
97769
97788
  const rssMB = (mem.rss / 1024 / 1024).toFixed(1);
97789
+ const extMB = (mem.external / 1024 / 1024).toFixed(1);
97790
+ const bufMB = (mem.arrayBuffers / 1024 / 1024).toFixed(1);
97791
+ const stdoutBuf = process.stdout.writableLength;
97792
+ const stdoutHWM = process.stdout.writableHighWaterMark;
97770
97793
  const templateDiag = logManager.getTemplateDiagnostics();
97771
97794
  const secondaryDiag = secondaryLogManager.getTemplateDiagnostics();
97772
- console.debug(`[sidekick-debug] heap=${heapMB}MB rss=${rssMB}MB templates=${JSON.stringify(templateDiag)} secondary=${JSON.stringify(secondaryDiag)}`);
97795
+ console.debug(`[sidekick-debug] heap=${heapMB}MB rss=${rssMB}MB ext=${extMB}MB bufs=${bufMB}MB stdout=${stdoutBuf}/${stdoutHWM} templates=${JSON.stringify(templateDiag)} secondary=${JSON.stringify(secondaryDiag)}`);
97773
97796
  }, 6e4);
97774
97797
  }
97775
97798
  const execTriggerRef = { current: null };
@@ -97879,6 +97902,10 @@ async function dashboardAction(_opts, cmd) {
97879
97902
  watcher.stop();
97880
97903
  } catch {
97881
97904
  }
97905
+ try {
97906
+ state.dispose();
97907
+ } catch {
97908
+ }
97882
97909
  try {
97883
97910
  client.dispose();
97884
97911
  } catch {
@@ -97955,7 +97982,7 @@ async function logsAction(container, opts) {
97955
97982
 
97956
97983
  // src/cli.ts
97957
97984
  var program2 = new Command();
97958
- program2.name("sidekick-docker").description("Docker management TUI dashboard").version("0.2.5").option("--socket <path>", "Docker socket path").action(async (_opts, cmd) => {
97985
+ program2.name("sidekick-docker").description("Docker management TUI dashboard").version("0.2.6").option("--socket <path>", "Docker socket path").action(async (_opts, cmd) => {
97959
97986
  await dashboardAction(_opts, cmd);
97960
97987
  });
97961
97988
  program2.command("ps").description("List containers").option("-a, --all", "Show all containers (default: running only)", false).action(async (opts) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sidekick-docker",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Docker management TUI dashboard",
5
5
  "author": "Cesar Andres Lopez <cesarandreslopez@gmail.com>",
6
6
  "repository": {