@beastmode-develeap/beastmode 0.1.65 → 0.1.67

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
@@ -4890,24 +4890,41 @@ function getBoardRoutes(factoryDir) {
4890
4890
  }
4891
4891
  }
4892
4892
  let busySlots = 0;
4893
- let totalSlots = 2;
4894
- try {
4895
- const poll = await proxyToBoard(boardUrl, "GET", "/api/poll");
4896
- const workingItems = poll["working_on_it"];
4897
- if (Array.isArray(workingItems)) {
4898
- busySlots = workingItems.length;
4893
+ let totalSlots = 3;
4894
+ const slotsPath = join13(factoryDir, "daemon", "logs", ".slots.json");
4895
+ let usedDaemonSlotsFile = false;
4896
+ if (existsSync15(slotsPath)) {
4897
+ try {
4898
+ const slots = JSON.parse(readFileSync12(slotsPath, "utf-8"));
4899
+ if (typeof slots.busy === "number" && typeof slots.total === "number") {
4900
+ busySlots = slots.busy;
4901
+ totalSlots = slots.total;
4902
+ usedDaemonSlotsFile = true;
4903
+ }
4904
+ } catch {
4899
4905
  }
4900
- } catch {
4901
4906
  }
4902
- const configPath = join13(factoryDir, ".beastmode", "config.json");
4903
- if (existsSync15(configPath)) {
4907
+ if (!usedDaemonSlotsFile) {
4904
4908
  try {
4905
- const config = JSON.parse(readFileSync12(configPath, "utf-8"));
4906
- if (typeof config.max_slots === "number") {
4907
- totalSlots = config.max_slots;
4909
+ const poll = await proxyToBoard(boardUrl, "GET", "/api/poll");
4910
+ const workingItems = poll["working_on_it"];
4911
+ if (Array.isArray(workingItems)) {
4912
+ busySlots = workingItems.length;
4908
4913
  }
4909
4914
  } catch {
4910
4915
  }
4916
+ for (const name of ["beastmode.docker.json", "beastmode.daemon.json"]) {
4917
+ const configPath = join13(factoryDir, "config", name);
4918
+ if (!existsSync15(configPath)) continue;
4919
+ try {
4920
+ const config = JSON.parse(readFileSync12(configPath, "utf-8"));
4921
+ if (typeof config.max_slots === "number") {
4922
+ totalSlots = config.max_slots;
4923
+ break;
4924
+ }
4925
+ } catch {
4926
+ }
4927
+ }
4911
4928
  }
4912
4929
  const alertsPath = join13(factoryDir, "daemon", "logs", ".alerts.json");
4913
4930
  let alerts = [];
@@ -5619,9 +5636,6 @@ Path: ${projConfig.path}
5619
5636
  handler: () => {
5620
5637
  const configPath = join13(factoryDir, ".beastmode", "config.json");
5621
5638
  const raw = existsSync15(configPath) ? JSON.parse(readFileSync12(configPath, "utf-8")) : generateDefaults();
5622
- if (raw.pipeline && typeof raw.pipeline === "object") {
5623
- delete raw.pipeline.parallel_coders;
5624
- }
5625
5639
  return raw;
5626
5640
  }
5627
5641
  },
@@ -5671,9 +5685,6 @@ Path: ${projConfig.path}
5671
5685
  }
5672
5686
  }
5673
5687
  const merged = deepMerge2(current, updatesClean);
5674
- if (merged.pipeline && typeof merged.pipeline === "object") {
5675
- delete merged.pipeline.parallel_coders;
5676
- }
5677
5688
  writeFileSync12(configPath, JSON.stringify(merged, null, 2) + "\n", "utf-8");
5678
5689
  const daemonConfigPaths = [
5679
5690
  join13(factoryDir, "config", "beastmode.daemon.json"),