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 plugin;
14pub mod plugin_disable;
15pub mod protocol;
16pub mod source;
17pub mod surface;
18pub mod trigger;
19pub mod trigger_config;
20pub mod verdict;
21
22pub use config::{
23    discover_config_for_path, load_config_for_path, CheckConfig, CheckSourceConfig, ConfigV1,
24    GateConfig, TriggerConfig, CLAUDE_PROJECT_DIR_ENV, CONFIG_VERSION,
25};
26pub use error::{KlaspError, Result};
27pub use plugin::{
28    plugin_error_warn, PluginConfig, PluginDescribe, PluginFinding, PluginGateInput,
29    PluginGateOutput, PluginSupports, PluginTrigger, PluginTriggerKind, PluginVerdict,
30    KLASP_PLUGIN_BIN_PREFIX, KLASP_PLUGIN_RULE,
31};
32pub use plugin_disable::{
33    add as plugin_disable_add, load as plugin_disable_load, resolve_disable_list_path,
34    validate_plugin_name, KLASP_DISABLED_PLUGINS_FILE_ENV,
35};
36pub use protocol::{
37    GateError, GateInput, GateProtocol, ToolInput, GATE_SCHEMA_VERSION, KLASP_OUTPUT_SCHEMA,
38    PLUGIN_PROTOCOL_VERSION,
39};
40pub use source::{CheckResult, CheckSource, CheckSourceError, RepoState};
41pub use surface::{AgentSurface, InstallContext, InstallError, InstallReport};
42pub use trigger::{GitEvent, Trigger};
43pub use trigger_config::{validate_user_triggers, UserTrigger, UserTriggerConfig};
44pub use verdict::{Finding, Severity, Verdict, VerdictPolicy};