Skip to main content

agent_sdk_toolkit/discovery/
types.rs

1//! Tool discovery helpers for optional toolkit capabilities. Use these modules to
2//! index hidden candidates, return model-facing discovery results, and construct
3//! package deltas for host-approved activation. Searching is data-only; package
4//! mutation happens only when a delta is applied. This file contains the types
5//! portion of that contract.
6//!
7use serde::{Deserialize, Serialize};
8
9#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
10/// Discovery tool discovery request request or result value.
11/// Creating the value does not register tools; discovery executors document catalog and package-bundle effects.
12pub struct ToolDiscoveryRequest {
13    /// Search query supplied by the caller.
14    pub query: String,
15}
16
17#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
18/// Discovery tool discovery output request or result value.
19/// Creating the value does not register tools; discovery executors document catalog and package-bundle effects.
20pub struct ToolDiscoveryOutput {
21    /// Search query supplied by the caller.
22    pub query: String,
23    /// Candidate capabilities, tools, resources, or package entries exposed
24    /// for host-approved selection.
25    pub candidates: Vec<ToolDiscoveryCandidate>,
26    /// Whether activation must be applied as a package delta before use.
27    pub package_delta_required: bool,
28}
29
30#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
31/// Discovery tool discovery candidate request or result value.
32/// Creating the value does not register tools; discovery executors document catalog and package-bundle effects.
33pub struct ToolDiscoveryCandidate {
34    /// Stable pack id used for typed lineage, lookup, or dedupe.
35    pub pack_id: String,
36    /// Tool names exposed in a discovery result.
37    pub tool_names: Vec<String>,
38    /// Whether activation must be applied as a package delta before use.
39    pub package_delta_required: bool,
40}