livekit-protocol 0.8.2

Livekit protocol and utilities for the Rust SDK
Documentation
// Copyright 2025 LiveKit, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(non_snake_case)]
#![allow(clippy::large_enum_variant)]

include!("livekit.rs");

/// The `livekit.agent` protobuf package: `AgentSessionEvent`, `SessionRequest` and the agent
/// worker/inference messages. Generated by `generate_proto.sh`; a new package needs its own
/// `include!` or the types exist on disk and are reachable from nowhere.
pub mod agent {
    include!("livekit.agent.rs");

    /// The newest conversation schema a thread's database can hold (protocol's
    /// `livekit/agent/thread_schema.go`).
    pub const THREAD_SCHEMA_VERSION: i64 = 1;

    /// Version 1 of the conversation schema inside a thread's database, one statement per `;`
    /// (comments hold none).
    pub const THREAD_SCHEMA_V1: &str =
        include_str!("../protocol/livekit/agent/thread_schema_v1.sql");

    #[cfg(test)]
    mod tests {
        use super::*;

        #[test]
        fn the_thread_schema_matches_protocol() {
            let go = include_str!("../protocol/livekit/agent/thread_schema.go");
            assert!(go.contains(&format!("const ThreadSchemaVersion = {THREAD_SCHEMA_VERSION}")));
            assert!(THREAD_SCHEMA_V1.contains("CREATE TABLE schema_version"));
        }
    }
}

/// The `logger` protobuf package: the `Sensitivity` field annotation enum.
pub mod logger {
    include!("logger.rs");
}