Skip to main content

rightkit_agent_engine_protocol/
refs.rs

1use serde::{Deserialize, Serialize};
2
3pub const TOOL_OUTPUT_INTERNAL_KIND: &str = "tool_output_internal";
4
5/// A reference to a (possibly large) stored output kept out of the transcript so context stays bounded.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct OutputRef {
9    pub id: String,
10    /// e.g. "tool_output", "file", "shell_stdout"
11    pub kind: String,
12    pub size_bytes: i64,
13    pub content_hash: Option<String>,
14    pub preview: Option<String>,
15    /// MIME type of the output envelope, independent of whether it is inline
16    /// or externalized.
17    #[serde(default = "default_output_media_type")]
18    pub media_type: String,
19    /// True when `preview` omits any part of the original output.
20    #[serde(default)]
21    pub truncated: bool,
22    /// True only when `id` can be resolved through the authenticated output
23    /// retrieval surface.
24    #[serde(default)]
25    pub retrievable: bool,
26}
27
28fn default_output_media_type() -> String {
29    "text/plain; charset=utf-8".to_string()
30}
31
32/// Inert in P0/P1. A shell reference to a reviewable artifact for transcript display only.
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(rename_all = "camelCase")]
35pub struct ArtifactRef {
36    pub id: String,
37    /// e.g. "plan" | "diff" | "test_report" | "screenshot" | "cost_report"
38    pub kind: String,
39    pub title: Option<String>,
40    pub content_hash: Option<String>,
41}