# kcode-kennedy-session-objects 0.1.0
Object resolution, authoritative staged descriptors, media requirements, Telegram media deduplication, and delivery attachment construction for Kennedy sessions.
## Public API
```rust
pub struct ResolvedObject {
pub object_id: String,
pub bytes: Vec<u8>,
pub file_name: String,
pub media_type: String,
pub transport_kind: Option<String>,
}
pub struct StagedDescriptor {
pub pending_id: String,
pub file_name: String,
pub media_type: String,
pub size_bytes: u64,
pub transport_kind: Option<String>,
}
impl StagedDescriptor {
pub fn apply_to(&self, descriptor: &mut serde_json::Value);
}
pub struct StagedTelegramMedia {
pub descriptor: StagedDescriptor,
pub kind: String,
pub reused: bool,
}
pub struct TelegramStageRequest {
pub chat_id: i64,
pub message_id: i64,
pub maximum_bytes: u64,
pub transport_metadata: serde_json::Value,
pub recorded_at: String,
}
pub fn resolve_object(
journal: &mut kcode_session_history::Session,
object_id: &str,
read_canonical: impl FnOnce(&str) -> anyhow::Result<kcode_server_object_envelopes::StoredFile>,
) -> anyhow::Result<ResolvedObject>;
pub fn resolve_media_object(
journal: &mut kcode_session_history::Session,
object_id: &str,
maximum_bytes: u64,
read_canonical: impl FnOnce(&str) -> anyhow::Result<kcode_server_object_envelopes::StoredFile>,
) -> anyhow::Result<ResolvedObject>;
pub fn staged_descriptor(
journal: &kcode_session_history::Session,
pending_id: &kcode_session_history::chatend::PendingId,
) -> anyhow::Result<StagedDescriptor>;
pub fn stage_telegram_group_media(
journal: &mut kcode_session_history::Session,
request: TelegramStageRequest,
download: impl FnOnce() -> anyhow::Result<(Vec<u8>, String)>,
file_name_for_media_type: impl FnOnce(&str) -> String,
) -> anyhow::Result<StagedTelegramMedia>;
pub fn delivery_attachments(
journal: &mut kcode_session_history::Session,
requests: Vec<kcode_telegram_session_coordinator::AttachmentRequest>,
read_canonical: impl FnMut(&str) -> anyhow::Result<kcode_server_object_envelopes::StoredFile>,
) -> anyhow::Result<Vec<kcode_telegram_session_coordinator::Attachment>>;
```
Pending IDs resolve only against the supplied journal; canonical IDs resolve only through the caller's read closure. Returned filenames and object metadata are authoritative. Media resolution normalizes MIME type parameters and rejects empty or oversized payloads.
Telegram staging reuses only an object whose transport metadata exactly matches the Telegram-group source, chat ID, and message ID. Otherwise it downloads and stages once, preserving journal partial-write behavior. Delivery construction resolves all requested objects but performs no transport send.
The nine public types/operations exceed the preferred five because the parent and ingress callers need separate resolution, authoritative descriptor, deduplication, request correlation, and transport-neutral attachment boundaries without combining effects or weakening types.