agent-context-contract 0.2.1

Transport-neutral contracts for Agent Infra context APIs
Documentation
use agent_context_contract::*;

#[test]
fn context_window_paths_replace_snapshot_routes() {
    assert_eq!(WINDOWS_PATH, "/internal/v1/context/windows");
    assert_eq!(WINDOW_GET_PATH, "/internal/v1/context/windows/get");
}

#[test]
fn context_window_json_uses_window_id_fields() {
    let request = GetContextWindowRequest {
        window_id: "win-1".into(),
    };
    let value = serde_json::to_value(&request).expect("serialize");
    assert_eq!(value["windowId"], "win-1");
    assert!(value.get("snapshotId").is_none());

    let derivation = CreateContextDerivationRequest {
        id: "der-1".into(),
        source_window_id: "win-src".into(),
        target_window_id: "win-dst".into(),
        kind: ContextDerivationKind::Compress,
        strategy: "summary".into(),
        strategy_version: "v1".into(),
        input_token_count: 1,
        output_token_count: 1,
        input_item_count: 1,
        output_item_count: 1,
        metadata: serde_json::Value::Null,
    };
    let value = serde_json::to_value(&derivation).expect("serialize");
    assert_eq!(value["sourceWindowId"], "win-src");
    assert_eq!(value["targetWindowId"], "win-dst");
}