Tracks parsing and loading warnings for skill diagnostics.
Diagnostics capture non-fatal issues encountered during skill loading, including:
- Parent directory name mismatches
- Cosmetic naming violations
- Truncated fields
- Missing optional metadata
Diagnostics enable tooling to display warnings to users without blocking skill functionality.
Usage
# Create fresh diagnostics
diagnostics = Diagnostics.new()
# Add a warning
diagnostics = Diagnostics.add_warning(diagnostics, Diagnostics.Warning.new(:name_mismatch, "..."))
# Check for issues
Diagnostics.has_warnings?(diagnostics)
Diagnostics.has_errors?(diagnostics)
# Convert to map for storage
Diagnostics.to_map(diagnostics)
Summary
Functions
Adds an error to the diagnostics (non-fatal in lenient mode).
Adds a warning to the diagnostics.
Returns the count of errors.
Formats diagnostics for display in logs or tooling.
Returns true if there are any errors.
Returns true if there are any warnings or errors.
Returns true if there are any warnings.
Creates a new empty diagnostics struct.
Converts diagnostics to a plain map for storage in metadata.
Returns the count of warnings.
Types
@type t() :: %Jido.AI.Skill.Diagnostics{ errors: [map()], timestamp: DateTime.t() | nil, warnings: [Jido.AI.Skill.Diagnostics.Warning.t()] }
Functions
Adds an error to the diagnostics (non-fatal in lenient mode).
@spec add_warning(t(), Jido.AI.Skill.Diagnostics.Warning.t()) :: t()
Adds a warning to the diagnostics.
@spec error_count(t()) :: non_neg_integer()
Returns the count of errors.
Formats diagnostics for display in logs or tooling.
Returns true if there are any errors.
Returns true if there are any warnings or errors.
Returns true if there are any warnings.
@spec new() :: t()
Creates a new empty diagnostics struct.
Converts diagnostics to a plain map for storage in metadata.
@spec warning_count(t()) :: non_neg_integer()
Returns the count of warnings.