外观
environment API
模块说明
text
Connection-local environment evidence, never an inferred world truth.
Read a value only when its field's known flag is true. A zero/false wire value
with known=false is a placeholder, not evidence. Cursor mismatches and gaps
must be handled before comparing revisions or updating a caller's projection.EnvironmentCursor
python
class EnvironmentCursor(TypedDict)字段(包含继承字段):
EnvironmentCursor.connection_id
python
connection_id: str必填;声明于 environment.EnvironmentCursor。
EnvironmentCursor.epoch
python
epoch: str必填;声明于 environment.EnvironmentCursor。
EnvironmentCursor.revision
python
revision: int必填;声明于 environment.EnvironmentCursor。
EnvironmentObserved
python
class EnvironmentObserved(TypedDict)字段(包含继承字段):
EnvironmentObserved.known
python
known: bool必填;声明于 environment.EnvironmentObserved。
EnvironmentObserved.value
python
value: bool | int | float必填;声明于 environment.EnvironmentObserved。
EnvironmentObserved.source
python
source: str必填;声明于 environment.EnvironmentObserved。
EnvironmentObserved.revision
python
revision: int必填;声明于 environment.EnvironmentObserved。
EnvironmentGameRule
python
class EnvironmentGameRule(EnvironmentObserved)字段(包含继承字段):
EnvironmentGameRule.known
python
known: bool必填;声明于 environment.EnvironmentObserved。
EnvironmentGameRule.value
python
value: bool | int | float必填;声明于 environment.EnvironmentObserved。
EnvironmentGameRule.source
python
source: str必填;声明于 environment.EnvironmentObserved。
EnvironmentGameRule.revision
python
revision: int必填;声明于 environment.EnvironmentObserved。
EnvironmentGameRule.type
python
type: str必填;声明于 environment.EnvironmentGameRule。
EnvironmentGameRule.can_be_modified_by_player
python
can_be_modified_by_player: bool必填;声明于 environment.EnvironmentGameRule。
EnvironmentLocalWeather
python
class EnvironmentLocalWeather(TypedDict)字段(包含继承字段):
EnvironmentLocalWeather.source
python
source: str必填;声明于 environment.EnvironmentLocalWeather。
EnvironmentLocalWeather.revision
python
revision: int必填;声明于 environment.EnvironmentLocalWeather。
EnvironmentLocalWeather.rain_level
python
rain_level: float必填;声明于 environment.EnvironmentLocalWeather。
EnvironmentLocalWeather.lightning_level
python
lightning_level: float必填;声明于 environment.EnvironmentLocalWeather。
EnvironmentLocalWeather.rain_time
python
rain_time: int必填;声明于 environment.EnvironmentLocalWeather。
EnvironmentLocalWeather.lightning_time
python
lightning_time: int必填;声明于 environment.EnvironmentLocalWeather。
EnvironmentLocalWeather.is_weather_cycle
python
is_weather_cycle: bool必填;声明于 environment.EnvironmentLocalWeather。
EnvironmentSnapshot
python
class EnvironmentSnapshot(EnvironmentCursor, _EnvironmentReadMetadata)字段(包含继承字段):
EnvironmentSnapshot.connection_id
python
connection_id: str必填;声明于 environment.EnvironmentCursor。
EnvironmentSnapshot.epoch
python
epoch: str必填;声明于 environment.EnvironmentCursor。
EnvironmentSnapshot.revision
python
revision: int必填;声明于 environment.EnvironmentCursor。
EnvironmentSnapshot.source
python
source: str可省略;声明于 environment._EnvironmentReadMetadata。
EnvironmentSnapshot.gap
python
gap: bool可省略;声明于 environment._EnvironmentReadMetadata。
EnvironmentSnapshot.complete_world_coverage
python
complete_world_coverage: bool可省略;声明于 environment._EnvironmentReadMetadata。
EnvironmentSnapshot.connected_at
python
connected_at: str必填;声明于 environment.EnvironmentSnapshot。
EnvironmentSnapshot.time
python
time: EnvironmentObserved必填;声明于 environment.EnvironmentSnapshot。
EnvironmentSnapshot.world_age
python
world_age: EnvironmentObserved必填;声明于 environment.EnvironmentSnapshot。
EnvironmentSnapshot.day_cycle_lock_time
python
day_cycle_lock_time: EnvironmentObserved必填;声明于 environment.EnvironmentSnapshot。
EnvironmentSnapshot.rain_level
python
rain_level: EnvironmentObserved必填;声明于 environment.EnvironmentSnapshot。
EnvironmentSnapshot.lightning_level
python
lightning_level: EnvironmentObserved必填;声明于 environment.EnvironmentSnapshot。
EnvironmentSnapshot.raining
python
raining: EnvironmentObserved必填;声明于 environment.EnvironmentSnapshot。
EnvironmentSnapshot.thundering
python
thundering: EnvironmentObserved必填;声明于 environment.EnvironmentSnapshot。
EnvironmentSnapshot.dimension
python
dimension: EnvironmentObserved必填;声明于 environment.EnvironmentSnapshot。
EnvironmentSnapshot.game_rules
python
game_rules: dict[str, EnvironmentGameRule]必填;声明于 environment.EnvironmentSnapshot。
EnvironmentSnapshot.game_rules_observed
python
game_rules_observed: bool必填;声明于 environment.EnvironmentSnapshot。
EnvironmentSnapshot.dimension_weather
python
dimension_weather: dict[str, EnvironmentLocalWeather]必填;声明于 environment.EnvironmentSnapshot。
EnvironmentSnapshot.gaps
python
gaps: list[str]必填;声明于 environment.EnvironmentSnapshot。
EnvironmentSnapshot.reset_reason
python
reset_reason: str必填;声明于 environment.EnvironmentSnapshot。
EnvironmentEvent
python
class EnvironmentEvent(EnvironmentCursor, _EnvironmentEventDetails)字段(包含继承字段):
EnvironmentEvent.connection_id
python
connection_id: str必填;声明于 environment.EnvironmentCursor。
EnvironmentEvent.epoch
python
epoch: str必填;声明于 environment.EnvironmentCursor。
EnvironmentEvent.revision
python
revision: int必填;声明于 environment.EnvironmentCursor。
EnvironmentEvent.event_type
python
event_type: int可省略;声明于 environment._EnvironmentEventDetails。
EnvironmentEvent.kind
python
kind: str必填;声明于 environment.EnvironmentEvent。
EnvironmentEvent.source
python
source: str必填;声明于 environment.EnvironmentEvent。
EnvironmentEvent.event_data
python
event_data: int必填;声明于 environment.EnvironmentEvent。
EnvironmentEvent.gap
python
gap: bool必填;声明于 environment.EnvironmentEvent。
EnvironmentEvent.complete_world_coverage
python
complete_world_coverage: bool必填;声明于 environment.EnvironmentEvent。
EnvironmentEvent.snapshot
python
snapshot: EnvironmentSnapshot必填;声明于 environment.EnvironmentEvent。
Environment
python
class EnvironmentEnvironment.__init__
python
def __init__(self, operations: Operations)Environment.observe
python
def observe(
self,
*,
idempotency_key: str,
deadline: str,
after: EnvironmentCursor | None = None,
) -> OperationIntentSDK 说明:
text
Prepare framework.environment.observe without IO.
The successful result is EnvironmentSnapshot. after requests continuity
diagnostics, not replay. Each fresh read requires a fresh caller-chosen
key; reusing a key returns the previous operation's receipt.Environment.operations
python
self.operations公开实例属性,在 __init__ 中设置。