Expand description
§ai6-diptel
DipTels: the native and WebAssembly wire contract between a Station, Universal Exports and Outer Office, the operator app. One identity contract and one guatiao frame format carry Run lifecycle events, terminal bytes, terminal geometry and operator controls. See the crate API header.
§Features
- Distinct validated Operation ID, Mission ID and provider ID types.
- Schema-checked guatiao lifecycle, binary terminal, resize and operator control frames.
- Native and
wasm32-unknown-unknownsupport with no unsafe code. - No process-global state or custom wire codec.
FrameReceiver validates gateway frames against their channel schemas and yields
decoded lifecycle events, terminal bytes, resize events, operator controls, gaps or channel closure. Schema announcements
are consumed internally and return None.
§Installation
This crate is part of the AI6 workspace and is not published separately. From the repository root, add it as a path dependency:
cargo add ai6-diptel --path crates/ai6-diptelThere are no Cargo feature flags.
§Quick start
use ai6_diptel::{
LifecycleEvent, MissionId, OperationId, RunId, RunState, lifecycle_frames,
};
let event = LifecycleEvent {
operation_id: OperationId::new("operation-a")?,
mission_id: MissionId::new("mission-17")?,
run_id: RunId::new("provider-run-3")?,
state: RunState::Working,
reason: None,
sequence: 4,
};
let (schema_frame, value_frame) = lifecycle_frames(&event)?;
assert!(!schema_frame.is_empty() && !value_frame.is_empty());A Mission ID identifies one unit of work and may group several Runs. A provider ID identifies one resumable agent operation and stays the same when that operation resumes. An A2A Task ID is external protocol data.
§API overview
| Item | Purpose |
|---|---|
OperationId, MissionId, RunId, ControlId | Validated identities for project, work unit, provider operation and operator control. |
RunSnapshot, LifecycleEvent, RunState | Board state keyed by Operation, Mission and Run. |
TerminalData, TerminalDirection, TerminalResize | Bounded binary input/output and terminal geometry. |
ControlAction, MissionControl | An operator control (cancel, retry, resume, interrupt) for the Station holding a Mission. |
lifecycle_frames, terminal_frames, resize_frames, control_frames | guatiao schema announcement and schema-checked value frames. |
FrameReceiver, IncomingFrame | Schema-checked gateway frame decoding. |
MAX_ID_BYTES, MAX_TERMINAL_BYTES, MAX_CONTROL_MESSAGE_BYTES | Protocol bounds applied by constructors. |
§Development
From the repository root, run:
cargo fmt --all --check
cargo test -p ai6-diptel
cargo clippy -p ai6-diptel --all-targets --all-features -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc -p ai6-diptel --no-deps
cargo check -p ai6-diptel --target wasm32-unknown-unknown§Releasing
ai6-diptel is an internal workspace crate (publish = false). Update
its version with the workspace package when an AI6 release requires it.
§License
MPL-2.0. See LICENSE.
Modules§
- station
- What a Station sends to Universal Exports, each body declared once.
Structs§
- Control
Id - A validated identifier for one operator control request.
- Frame
Decode Error - A malformed or unsupported incoming Universal Exports frame.
- Frame
Receiver - Decodes gateway frames while retaining Guatiao channel schemas.
- Frame
TooLarge - A terminal frame exceeded the protocol limit.
- Invalid
Control - A control field was empty, too long or held control characters.
- Invalid
Gap - No sequence lies between a gap’s two ends.
- Invalid
Identity - An invalid or over-limit protocol identity.
- Invalid
Size - A terminal resize dimension was zero.
- Lifecycle
Event - A lifecycle update for one agent Run.
- Mission
Control - One operator control, as Universal Exports hands it to the Station holding the Mission.
- Mission
Id - A validated Mission identifier grouping one unit of work.
- Operation
Id - A validated Operation identifier. An Operation is a project scope.
- RunId
- A provider-issued identifier for one resumable agent operation.
- RunSnapshot
- A run’s identity and current board state.
- Terminal
Data - Terminal input or output associated with a Run.
- Terminal
Gap - Events of a Run that a viewer cannot have: those after
afterand beforebefore. - Terminal
Resize - A terminal resize request.
Enums§
- Control
Action - What an operator asks of a Mission or of its live Run.
- Incoming
Frame - One validated lifecycle, terminal or control frame received from a gateway.
- RunState
- The lifecycle state shown for an agent Run: the state of the Mission it serves.
- Terminal
Direction - Direction of terminal bytes at the gateway boundary.
Constants§
- MAX_
CONTROL_ MESSAGE_ BYTES - The largest operator message a control carries, in UTF-8 bytes.
- MAX_
ID_ BYTES - The largest accepted identity, in UTF-8 bytes.
- MAX_
REASON_ BYTES - The longest lifecycle reason, in bytes.
- MAX_
TERMINAL_ BYTES - The largest terminal data frame accepted by this protocol.
Functions§
- control_
frames - Creates a guatiao schema announcement and value frame for an operator control.
- gap_
frames - Creates a guatiao schema announcement and value frame for a gap.
- lifecycle_
frames - Creates a guatiao schema announcement and value frame for a lifecycle event.
- resize_
frames - Creates a guatiao schema announcement and value frame for a terminal resize.
- terminal_
frames - Creates a guatiao schema announcement and value frame for terminal bytes.
- valid_
reason - Whether
reasonis a lifecycle reason: 1 toMAX_REASON_BYTESofa-z,0-9,-,_and..