@kontsedal/olas-core 0.0.5 → 0.0.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.
@@ -3457,6 +3457,18 @@ var ControllerInstance = class ControllerInstance {
3457
3457
  childCounter = 0;
3458
3458
  /** Scope values provided on this instance, keyed by `Scope.__id`. */
3459
3459
  scopes = null;
3460
+ /**
3461
+ * Pre-seed scopes from outside the factory — used by `createRoot`'s
3462
+ * `scopes:` option so an adapter (e.g. `@kontsedal/olas-router-tanstack`)
3463
+ * can publish cross-cutting values without forcing the user to call
3464
+ * `ctx.provide(...)` in their root controller. Idempotent per scope id:
3465
+ * later calls override.
3466
+ */
3467
+ seedScopes(bindings) {
3468
+ if (bindings.length === 0) return;
3469
+ if (this.scopes === null) this.scopes = /* @__PURE__ */ new Map();
3470
+ for (const [scope, value] of bindings) this.scopes.set(scope.__id, value);
3471
+ }
3460
3472
  constructor(parent, rootShared, pathSegment, deps) {
3461
3473
  this.parent = parent;
3462
3474
  this.rootShared = rootShared;
@@ -4168,6 +4180,7 @@ function createRootWithProps(def, props, options) {
4168
4180
  onError: options.onError,
4169
4181
  queryClient
4170
4182
  }, "root", options.deps);
4183
+ if (options.scopes !== void 0 && options.scopes.length > 0) instance.seedScopes(options.scopes);
4171
4184
  let api;
4172
4185
  try {
4173
4186
  api = instance.construct(getFactory(def), props);
@@ -4356,4 +4369,4 @@ Object.defineProperty(exports, "untracked", {
4356
4369
  }
4357
4370
  });
4358
4371
 
4359
- //# sourceMappingURL=root-lBp7qziQ.cjs.map
4372
+ //# sourceMappingURL=root-CFgYhBd-.cjs.map