Skip to content

EnvironmentDescriptor

Base classes

Name Children Inherits
BaseModel
pydantic.main
!!! abstract "Usage Documentation"

⋔ Inheritance diagram

graph TD
  106982419431264["environment.EnvironmentDescriptor"]
  106982291377056["main.BaseModel"]
  129768776280576["builtins.object"]
  106982291377056 --> 106982419431264
  129768776280576 --> 106982291377056

🛈 DocStrings

Bases: BaseModel

GET /.well-known/t3/environment.

Upstream ExecutionEnvironmentDescriptor in packages/contracts/src/environment.ts. Clients read it before sending any credential: an address only gets a token when it reports the expected environment_id.

Source code in src/pyt3client/models/environment.py
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class EnvironmentDescriptor(BaseModel):
    """`GET /.well-known/t3/environment`.

    Upstream `ExecutionEnvironmentDescriptor` in packages/contracts/src/environment.ts.
    Clients read it before sending any credential: an address only gets a token
    when it reports the expected `environment_id`.
    """

    model_config = ConfigDict(extra="allow", populate_by_name=True)

    environment_id: str = Field(alias="environmentId")
    """Stable across restarts and address changes; identifies the environment."""
    label: str
    platform: EnvironmentPlatform
    server_version: str = Field(alias="serverVersion")
    orchestration_protocol_version: int | None = Field(None, alias="orchestrationProtocolVersion")
    """Version of the native WebSocket RPC protocol (`ORCHESTRATION_PROTOCOL_VERSION`)."""
    database_migration: int | None = Field(None, alias="databaseMigration")
    capabilities: dict[str, JsonValue]
    """Feature flags (upstream `ExecutionEnvironmentCapabilities`).

    Dozens of mostly-boolean flags that grow with every release, so kept as a
    mapping; use `supports()` to check one.
    """

    def supports(self, capability: str) -> bool:
        """Whether the server advertises `capability` as enabled.

        Args:
            capability: Flag name as sent by the server, such as `mcpApprovalCodes`.
        """
        return self.capabilities.get(capability) is True

capabilities instance-attribute

capabilities: dict[str, JsonValue]

Feature flags (upstream ExecutionEnvironmentCapabilities).

Dozens of mostly-boolean flags that grow with every release, so kept as a mapping; use supports() to check one.

environment_id class-attribute instance-attribute

environment_id: str = Field(alias='environmentId')

Stable across restarts and address changes; identifies the environment.

orchestration_protocol_version class-attribute instance-attribute

orchestration_protocol_version: int | None = Field(None, alias='orchestrationProtocolVersion')

Version of the native WebSocket RPC protocol (ORCHESTRATION_PROTOCOL_VERSION).

supports

supports(capability: str) -> bool

Whether the server advertises capability as enabled.

Parameters:

Name Type Description Default
capability str

Flag name as sent by the server, such as mcpApprovalCodes.

required
Source code in src/pyt3client/models/environment.py
44
45
46
47
48
49
50
def supports(self, capability: str) -> bool:
    """Whether the server advertises `capability` as enabled.

    Args:
        capability: Flag name as sent by the server, such as `mcpApprovalCodes`.
    """
    return self.capabilities.get(capability) is True

:fa-brands-github: Show source on GitHub