@standardagents/builder 0.41.12 → 0.41.13

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/runtime.js CHANGED
@@ -30545,11 +30545,19 @@ var UserStateImpl = class {
30545
30545
  const { entries, total } = await this.host.listUserValues(this.userId, options);
30546
30546
  return { entries, total };
30547
30547
  }
30548
+ /** User-account value first, then the instance's (Users §2.3). */
30548
30549
  async env(name) {
30549
- const values = await this.singleton().getUserEnv(this.userId);
30550
- const value = values[name];
30551
- if (value === void 0) throw new Error(`Environment variable not found: ${name}`);
30552
- return value;
30550
+ const singleton = this.singleton();
30551
+ const userValues = await singleton.getUserEnv(this.userId);
30552
+ if (userValues[name] !== void 0) return userValues[name];
30553
+ const instanceValues = await singleton.getInstanceEnv();
30554
+ if (instanceValues[name] !== void 0) return instanceValues[name];
30555
+ throw new Error(`Environment variable not found: ${name}`);
30556
+ }
30557
+ /** The instance's value only, for trust anchors (Users §2.3). */
30558
+ async instanceEnv(name) {
30559
+ const values = await this.singleton().getInstanceEnv();
30560
+ return values[name];
30553
30561
  }
30554
30562
  emit(event, data) {
30555
30563
  this.host.broadcastUserEvent(this.userId, event, data);