@standardagents/spec 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.
package/dist/index.d.ts CHANGED
@@ -800,10 +800,25 @@ interface UserState {
800
800
  total: number;
801
801
  }>;
802
802
  /**
803
- * Resolve a user-scoped environment property. Rejects when the property is
804
- * not defined for this user.
803
+ * Resolve an environment property for this user: the user-account value
804
+ * first, then the runtime instance value (the instance's configured value,
805
+ * then the deployment's environment variable of that name). Rejects when
806
+ * none defines it.
807
+ * This is the tail of the thread resolution order (`ThreadState.env`), so
808
+ * a value configured once for the instance is visible to user endpoints
809
+ * and user hooks as it is to threads, and a user-account value overrides
810
+ * it for that user.
805
811
  */
806
812
  env(name: string): Promise<string>;
813
+ /**
814
+ * Optionally resolve only the runtime-instance value, never a user-account
815
+ * value, for trust anchors such as a service endpoint and the credential
816
+ * sent to it. Resolves `undefined` when the instance does not configure the
817
+ * key and rejects when the runtime cannot read its instance environment.
818
+ * Consumers that require this boundary must feature-detect the method and
819
+ * fail closed when it is absent.
820
+ */
821
+ instanceEnv?(name: string): Promise<string | undefined>;
807
822
  /**
808
823
  * Broadcast an event to every socket attached to this user's event stream
809
824
  * (`{runtime_prefix}/users/me/stream`) and to every room socket. Delivery