@standardagents/builder 0.41.12 → 0.41.14

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.
@@ -79652,7 +79652,7 @@ var config_get_default = defineController2(async ({ config, env: env2, req }) =>
79652
79652
  });
79653
79653
 
79654
79654
  // src/version.ts
79655
- var BUILDER_VERSION = "0.41.12".length > 0 ? "0.41.12" : "dev";
79655
+ var BUILDER_VERSION = "0.41.14".length > 0 ? "0.41.14" : "dev";
79656
79656
 
79657
79657
  // src/api/diagnostics.get.ts
79658
79658
  init_LLMRequest();
package/dist/index.js CHANGED
@@ -39447,11 +39447,25 @@ var UserStateImpl = class {
39447
39447
  const { entries, total } = await this.host.listUserValues(this.userId, options);
39448
39448
  return { entries, total };
39449
39449
  }
39450
+ /** User-account value first, then the instance's (Users §2.3). */
39450
39451
  async env(name) {
39451
- const values = await this.singleton().getUserEnv(this.userId);
39452
- const value = values[name];
39453
- if (value === void 0) throw new Error(`Environment variable not found: ${name}`);
39454
- return value;
39452
+ const singleton = this.singleton();
39453
+ const userValues = await singleton.getUserEnv(this.userId);
39454
+ if (userValues[name] !== void 0) return userValues[name];
39455
+ const instanceValue = await this.instanceEnv(name);
39456
+ if (instanceValue !== void 0) return instanceValue;
39457
+ throw new Error(`Environment variable not found: ${name}`);
39458
+ }
39459
+ /**
39460
+ * The instance's value only, for trust anchors (Users §2.3): the value set
39461
+ * in the builder, then the deployed Worker's environment variable (the
39462
+ * platform's Environment settings), as a thread's env resolves.
39463
+ */
39464
+ async instanceEnv(name) {
39465
+ const values = await this.singleton().getInstanceEnv();
39466
+ if (values[name] !== void 0) return values[name];
39467
+ const worker = this.host.env[name];
39468
+ return typeof worker === "string" ? worker : void 0;
39455
39469
  }
39456
39470
  emit(event, data) {
39457
39471
  this.host.broadcastUserEvent(this.userId, event, data);