Skip to main content

klasp_core/
lib.rs

1//! `klasp-core` — public traits, types, and protocol for klasp.
2//!
3//! This crate is the v0.3 plugin-API contract surface. The trait shapes,
4//! type signatures, and constants exposed here are committed at v0.1; v0.2
5//! and v0.3 add capabilities by introducing new impls, not by mutating
6//! these definitions.
7//!
8//! See [`docs/design.md`](https://github.com/klasp-dev/klasp/blob/main/docs/design.md)
9//! §3 for the rationale behind each abstraction.
10
11pub mod config;
12pub mod error;
13pub mod fs;
14pub mod plugin;
15pub mod plugin_disable;
16pub mod protocol;
17pub mod source;
18pub mod surface;
19pub mod text;
20pub mod trigger;
21pub mod trigger_config;
22pub mod verdict;
23
24pub use config::{
25    discover_config_for_path, load_config_for_path, CheckConfig, CheckSourceConfig, ConfigV1,
26    GateConfig, TriggerConfig, CLAUDE_PROJECT_DIR_ENV, CONFIG_VERSION,
27};
28pub use error::{KlaspError, Result};
29pub use plugin::{
30    plugin_error_warn, PluginConfig, PluginDescribe, PluginFinding, PluginGateInput,
31    PluginGateOutput, PluginSupports, PluginTrigger, PluginTriggerKind, PluginVerdict,
32    KLASP_PLUGIN_BIN_PREFIX, KLASP_PLUGIN_RULE,
33};
34pub use plugin_disable::{
35    add as plugin_disable_add, load as plugin_disable_load, resolve_disable_list_path,
36    validate_plugin_name, KLASP_DISABLED_PLUGINS_FILE_ENV,
37};
38pub use protocol::{
39    GateError, GateInput, GateProtocol, ToolInput, GATE_SCHEMA_VERSION, KLASP_OUTPUT_SCHEMA,
40    PLUGIN_PROTOCOL_VERSION,
41};
42pub use source::{CheckResult, CheckSource, CheckSourceError, RepoState};
43pub use surface::{
44    AgentSurface, DoctorFinding, InstallContext, InstallError, InstallReport, SurfaceWarning,
45};
46pub use trigger::{GitEvent, Trigger};
47pub use trigger_config::{validate_user_triggers, UserTrigger, UserTriggerConfig};
48pub use verdict::{Finding, Severity, Verdict, VerdictPolicy};