Files
VoelinClient/crates/tsc-query/src/lib.rs
T
Claude a8a03661b9 M3: tsc-query and tsc-observer (invisible presence, relay chat)
- tsc-query: ServerQuery codec (escaping, rows, errors, notifications,
  command builder/parser), line client for raw TCP and SSH (russh) with
  events, flood-limit token bucket and keepalive, HTTP WebQuery client.
- tsc-model: Presence (snapshot/delta/diff), ChannelInfo, ClientInfo,
  ChatMessage, relay formatting and message splitting.
- tsc-observer: Observer (snapshot, events or polling, resync,
  reconnect) and RelayPool (one query session per channel, reads channel
  chat and posts as [Nick] text, unique nicknames, polite quit).
- tsctl query/observe/relay; smoke test covers presence and relay on
  TS3 (raw) and TS6 (SSH). Dev servers enable all query interfaces with
  a fixed dev password.
- docs: query clients are hidden by clients, not the server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-25 14:15:29 +00:00

51 lines
1.4 KiB
Rust

//! TeamSpeak ServerQuery client.
//!
//! ServerQuery is the admin/bot interface of TeamSpeak servers. Query clients
//! are invisible to normal users, which is what makes invisible presence and
//! channel-chat relays possible.
//!
//! Transports:
//! - raw TCP (TeamSpeak 3, port 10011) and SSH (both, port 10022): line based,
//! with asynchronous `notify*` events ([`LineClient`])
//! - HTTP WebQuery (TeamSpeak 6 and 3.12+, port 10080): request/response only,
//! authenticated with an API key ([`HttpClient`])
//!
//! [`QueryClient`] hides the difference for code that only sends commands.
mod client;
mod codec;
mod http;
mod line;
mod ssh;
pub use client::{Connect, QueryClient, Transport};
pub use codec::{
Command, Line, Notification, QueryError, Row, escape, parse_line, parse_rows, unescape,
};
pub use http::HttpClient;
pub use line::{LineClient, LineOptions};
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("io: {0}")]
Io(#[from] std::io::Error),
#[error("ssh: {0}")]
Ssh(#[from] russh::Error),
#[error("ssh authentication failed")]
SshAuth,
#[error("http: {0}")]
Http(#[from] reqwest::Error),
#[error("server error {0}")]
Query(#[from] QueryError),
#[error("protocol: {0}")]
Protocol(String),
#[error("connection closed")]
Closed,
#[error("timed out")]
Timeout,
#[error("not supported by this transport: {0}")]
Unsupported(&'static str),
}
pub type Result<T> = std::result::Result<T, Error>;