Expand description
klasp-core — public traits, types, and protocol for klasp.
This crate is the v0.3 plugin-API contract surface. The trait shapes, type signatures, and constants exposed here are committed at v0.1; v0.2 and v0.3 add capabilities by introducing new impls, not by mutating these definitions.
See docs/design.md
§3 for the rationale behind each abstraction.
Re-exports§
pub use config::discover_config_for_path;pub use config::load_config_for_path;pub use config::CheckConfig;pub use config::CheckSourceConfig;pub use config::ConfigV1;pub use config::GateConfig;pub use config::TriggerConfig;pub use config::CLAUDE_PROJECT_DIR_ENV;pub use config::CONFIG_VERSION;pub use error::KlaspError;pub use error::Result;pub use plugin::plugin_error_warn;pub use plugin::PluginConfig;pub use plugin::PluginDescribe;pub use plugin::PluginFinding;pub use plugin::PluginGateInput;pub use plugin::PluginGateOutput;pub use plugin::PluginSupports;pub use plugin::PluginTrigger;pub use plugin::PluginTriggerKind;pub use plugin::PluginVerdict;pub use plugin::KLASP_PLUGIN_BIN_PREFIX;pub use plugin::KLASP_PLUGIN_RULE;pub use plugin_disable::add as plugin_disable_add;pub use plugin_disable::load as plugin_disable_load;pub use plugin_disable::resolve_disable_list_path;pub use plugin_disable::validate_plugin_name;pub use plugin_disable::KLASP_DISABLED_PLUGINS_FILE_ENV;pub use protocol::GateError;pub use protocol::GateInput;pub use protocol::GateProtocol;pub use protocol::ToolInput;pub use protocol::GATE_SCHEMA_VERSION;pub use protocol::KLASP_OUTPUT_SCHEMA;pub use protocol::PLUGIN_PROTOCOL_VERSION;pub use source::CheckResult;pub use source::CheckSource;pub use source::CheckSourceError;pub use source::RepoState;pub use surface::AgentSurface;pub use surface::InstallContext;pub use surface::InstallError;pub use surface::InstallReport;pub use trigger::GitEvent;pub use trigger::Trigger;pub use trigger_config::validate_user_triggers;pub use trigger_config::UserTrigger;pub use trigger_config::UserTriggerConfig;pub use verdict::Finding;pub use verdict::Severity;pub use verdict::Verdict;pub use verdict::VerdictPolicy;
Modules§
- config
klasp.tomlconfig —version = 1schema.- error
KlaspError— typed error hierarchy for the core crate.- plugin
- Plugin subprocess protocol types — v0.3 experimental.
- plugin_
disable - Per-user plugin disable list for klasp.
- protocol
- Gate wire protocol — versioned, env-var-keyed.
- source
CheckSource— abstraction over a runnable check.- surface
AgentSurface— abstraction over an AI-agent integration surface.- trigger
- Trigger pattern matching for git commit/push.
- trigger_
config - User-configurable
[[trigger]]blocks parsed fromklasp.toml. - verdict
Verdict— three-tier outcome of a check run, plus aggregation policies.