@wrongstack/core 0.8.2 → 0.8.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.
@@ -4242,7 +4242,7 @@ function makeSpawnTool(director, roster) {
4242
4242
  catalog: roster
4243
4243
  });
4244
4244
  const dispatchRole = dispatchResult.role;
4245
- if (roster && roster[dispatchRole]) {
4245
+ if (roster?.[dispatchRole]) {
4246
4246
  cfg = instantiateRosterConfig(dispatchRole, roster[dispatchRole]);
4247
4247
  } else {
4248
4248
  const def = dispatchResult.definition;
@@ -4732,6 +4732,13 @@ var Director = class {
4732
4732
  extendCounts.delete(guardKey);
4733
4733
  return;
4734
4734
  }
4735
+ if (payload.kind === "cost" && this.maxFleetCostUsd < Number.POSITIVE_INFINITY) {
4736
+ const totalCost = this.usage.snapshot().total?.cost ?? 0;
4737
+ if (totalCost >= this.maxFleetCostUsd) {
4738
+ payload.deny();
4739
+ return;
4740
+ }
4741
+ }
4735
4742
  extendCounts.set(guardKey, prior + 1);
4736
4743
  setImmediate(() => {
4737
4744
  const extra = {};