Skip to main content

xz_skill/types/
output.rs

1use serde::{Deserialize, Serialize};
2
3/// Output of a skill execution.
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct SkillOutput {
6    pub content: String,
7    pub tool_calls: Vec<ToolCallRecord>,
8    pub token_usage: TokenUsage,
9    pub duration_ms: u64,
10}
11
12/// Record of a single tool invocation during execution.
13#[derive(Debug, Clone, Serialize, Deserialize)]
14pub struct ToolCallRecord {
15    pub tool_name: String,
16    pub args: serde_json::Value,
17    pub result: Option<serde_json::Value>,
18    pub error: Option<String>,
19    pub duration_ms: u64,
20}
21
22/// Token usage summary.
23#[derive(Debug, Clone, Serialize, Deserialize, Default)]
24pub struct TokenUsage {
25    pub prompt_tokens: usize,
26    pub completion_tokens: usize,
27    pub total_tokens: usize,
28}
29
30/// Lightweight skill summary for list/search results.
31#[derive(Debug, Clone, Serialize, Deserialize)]
32pub struct SkillSummary {
33    pub id: String,
34    pub name: String,
35    pub version: String,
36    pub description: String,
37    pub author: String,
38    pub enabled: bool,
39    pub tool_count: usize,
40}