1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// SPDX-FileCopyrightText: 2026 Blackcat Informatics Inc.
// SPDX-License-Identifier: MIT OR Apache-2.0 OR MulanPSL-2.0
//! Intent-aware assistance for imperfect AI output.
/// Compiled schema validation and recovery entry point.
pub use Schema;
/// Effort, resource, and invention policy for JSON recovery.
pub use RecoveryRequest;
/// Pure first-party assistance engines and contracts.
pub use *;
/// Isolated grammar parsing and validated code edits.
pub use purrassist_syntax as syntax;
/// The core crate under a name the derive macros can reach through
/// `::purrassist`. Generated code uses `::purrassist::__core` paths; it is not
/// public API and carries no compatibility promise.
pub use purrassist_core as __core;
/// Derives `ToolArguments`, `ToolParameter`, `ToolItem` and `FromNode` for a
/// struct of named fields, so the struct is its own tool definition and its own
/// typed arguments. Unlike `purrassist_derive::ToolDefinition`, the generated
/// code reaches the engine through `::purrassist`, so a crate needs only the
/// `purrassist` dependency (no `crate =` attribute, no direct core
/// dependency).
///
/// The derive macro `purrassist::ToolDefinition` and the type
/// [`tool_call::ToolDefinition`] are
/// distinct items; the type is not re-exported at the crate root. The
/// attributes, naming, and errors are those of `purrassist_derive::ToolDefinition`.
///
/// ```
/// use purrassist::json;
/// use purrassist::tool_call::{FromNode, ToolArguments, ToolSet};
/// use purrassist::Budget;
///
/// /// Reads a file.
/// #[derive(purrassist::ToolDefinition, Debug, PartialEq)]
/// struct ReadFile {
/// path: String,
/// limit: Option<u32>,
/// }
///
/// let tools = ToolSet::compile([ReadFile::tool_definition()], Budget::default()).unwrap();
/// assert!(tools.tool("read_file").is_some());
/// let node = json::parse(r#"{"path":"a.txt","limit":3}"#).unwrap();
/// assert_eq!(
/// ReadFile::from_node(&node),
/// Ok(ReadFile { path: "a.txt".into(), limit: Some(3) })
/// );
/// ```
pub use FacadeToolDefinition as ToolDefinition;
/// Derives `ToolParameter`, `ToolItem` and `FromNode` for an enum of unit
/// variants (a string enumeration), generating paths through `::purrassist`.
/// See [`ToolDefinition`](macro@ToolDefinition) for the facade rationale and
/// `purrassist_derive::ToolEnum` for the attributes and errors.
///
/// ```
/// use purrassist::json;
/// use purrassist::tool_call::{FromNode, Param, ToolParameter};
///
/// #[derive(purrassist::ToolEnum, Debug, PartialEq)]
/// enum Mode {
/// Fast,
/// #[param(name = "careful")]
/// Careful,
/// }
///
/// assert_eq!(Mode::parameter(), Param::enumeration(&["Fast", "careful"]));
/// assert_eq!(Mode::from_node(&json::parse(r#""careful""#).unwrap()), Ok(Mode::Careful));
/// ```
pub use FacadeToolEnum as ToolEnum;