@rulvar/core 1.81.2 → 1.82.0

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.d.ts CHANGED
@@ -5481,7 +5481,14 @@ declare class AdmissionController {
5481
5481
  maxDepth?: number;
5482
5482
  maxChildrenPerNode?: number;
5483
5483
  childBudgetFraction?: number;
5484
- flatReserveUsd?: number; /** Per-orchestrate spawn cap (maxSpawns); engine lifetime cap applies regardless. */
5484
+ flatReserveUsd?: number;
5485
+ /**
5486
+ * Controller-lifetime cap on ADMITTED spawns, enforced at this
5487
+ * controller's own gate with the 'lifetime' reject reason, for
5488
+ * hosts driving an AdmissionController directly. Engine runs do
5489
+ * not wire this option: they cap total spawns through the budget
5490
+ * (`budgetDefaults.lifetimeSpawnCap`, the same 'lifetime' reason).
5491
+ */
5485
5492
  maxTotalSpawns?: number;
5486
5493
  mintId?: () => string;
5487
5494
  /**
package/dist/index.js CHANGED
@@ -3491,6 +3491,7 @@ function mcp(cfg) {
3491
3491
  let clientPromise;
3492
3492
  let cache;
3493
3493
  let generation = 0;
3494
+ let inFlight;
3494
3495
  const connect = async () => {
3495
3496
  const client = new Client({
3496
3497
  name: "rulvar",
@@ -3567,15 +3568,24 @@ function mcp(cfg) {
3567
3568
  id: sourceIdOf(cfg),
3568
3569
  tools: async () => {
3569
3570
  if (cache !== void 0) return cache;
3570
- clientPromise ??= connect();
3571
- const client = await clientPromise;
3572
- const fetchedAt = generation;
3573
- const wireTools = await listAll(client);
3574
- const denySet = new Set(cfg.deny ?? []);
3575
- const allowSet = cfg.allow === void 0 ? void 0 : new Set(cfg.allow);
3576
- const defs = wireTools.filter((wire) => !denySet.has(wire.name) && (allowSet === void 0 || allowSet.has(wire.name))).map((wire) => toDef(client, wire));
3577
- if (generation === fetchedAt) cache = defs;
3578
- return defs;
3571
+ if (inFlight !== void 0) return inFlight;
3572
+ const fetch = (async () => {
3573
+ clientPromise ??= connect();
3574
+ const client = await clientPromise;
3575
+ const fetchedAt = generation;
3576
+ const wireTools = await listAll(client);
3577
+ const denySet = new Set(cfg.deny ?? []);
3578
+ const allowSet = cfg.allow === void 0 ? void 0 : new Set(cfg.allow);
3579
+ const defs = wireTools.filter((wire) => !denySet.has(wire.name) && (allowSet === void 0 || allowSet.has(wire.name))).map((wire) => toDef(client, wire));
3580
+ if (generation === fetchedAt) cache = defs;
3581
+ return defs;
3582
+ })();
3583
+ inFlight = fetch;
3584
+ try {
3585
+ return await fetch;
3586
+ } finally {
3587
+ inFlight = void 0;
3588
+ }
3579
3589
  },
3580
3590
  close: async () => {
3581
3591
  const pending = clientPromise;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/core",
3
- "version": "1.81.2",
3
+ "version": "1.82.0",
4
4
  "description": "Rulvar core: L0 contracts, journal kernel, ctx primitives, agent runtime, model router, tool system, dynamic orchestrator, InMemory and JSONL stores, event stream.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",