Skip to content

environment

Class info

Classes

Name Children Inherits
EnvironmentDescriptor
pyt3client.models.environment
`GET /.well-known/t3/environment`.
    EnvironmentPlatform
    pyt3client.models.environment
    Upstream `ExecutionEnvironmentPlatform` (packages/contracts/src/environment.ts).

      🛈 DocStrings

      The public descriptor every T3 Code environment serves without authentication.

      EnvironmentDescriptor

      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
      

      EnvironmentPlatform

      Bases: BaseModel

      Upstream ExecutionEnvironmentPlatform (packages/contracts/src/environment.ts).

      Source code in src/pyt3client/models/environment.py
       8
       9
      10
      11
      12
      13
      14
      15
      16
      class EnvironmentPlatform(BaseModel):
          """Upstream `ExecutionEnvironmentPlatform` (packages/contracts/src/environment.ts)."""
      
          model_config = ConfigDict(extra="allow")
      
          os: str
          arch: str
          machine: str | None = None
          """Forward compatible upstream (`EnvironmentMachineKind`), so typed as `str`."""
      

      machine class-attribute instance-attribute

      machine: str | None = None
      

      Forward compatible upstream (EnvironmentMachineKind), so typed as str.