pub struct SkillDocument {Show 13 fields
pub path: PathBuf,
pub name: String,
pub extension_kind: AgentExtensionKind,
pub identity_source: ArtifactIdentitySource,
pub structural_validity: StructuralValidity,
pub classification: ArtifactClassification,
pub structural_signals: StructuralSignals,
pub decode_warning: bool,
pub parse_warning: bool,
pub binary_disguise_kind: Option<String>,
pub sections: Vec<Section>,
pub raw_content: String,
pub referenced_files: Vec<PathBuf>,
}Fields§
§path: PathBuf§name: String§extension_kind: AgentExtensionKind§identity_source: ArtifactIdentitySource§structural_validity: StructuralValidity§classification: ArtifactClassification§structural_signals: StructuralSignals§decode_warning: bool§parse_warning: bool§binary_disguise_kind: Option<String>Some(kind) when the artifact carries a markdown extension but the
raw bytes start with binary magic for kind (e.g. "ZIP",
"ELF"). Detected before the lossy UTF-8 decode runs so we can
flag content-obfuscation cases like the 01d1232c ZIP-as-md
sample. #[serde(default)] keeps cached documents from older
versions deserializable.
sections: Vec<Section>§raw_content: String§referenced_files: Vec<PathBuf>Implementations§
Source§impl SkillDocument
impl SkillDocument
pub fn from_file_with_provider<P: MarkdownParser, F: FileSystemProvider>( path: impl AsRef<Path>, parser: &P, fs_provider: &F, ) -> Result<Self, AnalyzerError>
pub fn parse_with_parser<P: MarkdownParser + ?Sized>( path: PathBuf, content: String, parser: &P, ) -> Result<Self, AnalyzerError>
pub fn get_section(&self, name: &str) -> Option<&Section>
pub fn all_code_blocks(&self) -> Vec<&CodeBlock>
Sourcepub fn has_code_language(&self, lang: &str) -> bool
pub fn has_code_language(&self, lang: &str) -> bool
Whether any code block in this document declares a fence language
equal to lang.
Comparison is exact-match on lowercase strings. The parser
normalizes fence languages to ASCII lowercase at parse time (see
adapters/pulldown_parser.rs — the Fenced(lang) branch in the
code-block handler), so callers MUST pass lang in lowercase.
kind: code_language rule conditions in YAML rule packs use
lowercase tokens by convention, matching this contract.
Trait Implementations§
Source§impl Clone for SkillDocument
impl Clone for SkillDocument
Source§fn clone(&self) -> SkillDocument
fn clone(&self) -> SkillDocument
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more