@clankie/interactive-environment
Provider-neutral contracts shared by the GBA body, Discord presence, rendered surfaces, and activity observation. The package defines session phases, leases, action results, concrete GBA commands and observations, semantic events, bounded telemetry references, and Discord presence tool exposure.
Semantic event data is a closed, bounded union of state-transition payloads.
Raw ticks, chunks, packets, audio, and video are rejected from the semantic
plane and travel only as bounded EnvironmentTelemetryReferenceSchema artifact
references. Discord presence tool exposure single-writes schema v2 lanes while
dual-reading legacy tui supervision as the v2 operator lane.
Session and lease v2 contracts use strict profile-specific resource bounds. The
gba_emulator profile pins the core, savestate identity, frame/input budgets,
and capabilities. The legacy_v1 profile exists only to read persisted v1
sessions and normalize them to v2; new sessions write v2. Action/result/event
contracts remain v1.
The clankie service remains authoritative. Models receive no credentials, cannot mint leases, and cannot widen the concrete action schemas. Runtime and emulator details stay behind the contracts in this package.
ActivityObservationSnapshotSchema defines present-tense self-observation for
active activities. The first gba_emulator variant separates bounded
selfAuthored objective/intent/commentary from the runnerObserved settled
outcome/effect/progress the service records, and admits only a framebuffer
digest, never frame bytes.
ActivityObservationReadSchema distinguishes a matching snapshot, a live
session whose first turn is still pending, and no live activity. This is a read
contract, not an environment command or capability projection.
RenderedSurfaceStatusSchema is the display-only present-tense counterpart:
its closed thinking/acting phase accompanies rendered media without moving
model text, authority, or raw media into the semantic plane.
RenderedSurfaceFrameSchema and RenderedSurfaceAudioSchema carry bounded PNG
and stereo PCM packets only on that rendered-media plane. Audio is live-only;
consumers drop stale packets instead of retaining or replaying them.
