Skip to main content

Crate kaptein_viewmodel

Crate kaptein_viewmodel 

Source
Expand description

Kaptein view-model: the renderer-agnostic domain layer (the product).

This crate owns all semantics — columns, sorting, filtering, status inference, permission decisions, and action graphs. The frontends (TUI, GUI, headless, serve) consume the render contract defined here and own only geometry.

See ADR-0005 (docs/adr/0005-render-intent-three-layers.md) for the three-layer model this crate implements.

Re-exports§

pub use audit::Actor;
pub use audit::ActorKind;
pub use audit::AuditEvent;
pub use audit::Operation;
pub use audit::Outcome;
pub use audit::ResourceRef;
pub use audit::Source;
pub use diff::DiffLine;
pub use diff::UnifiedDiff;
pub use diff::render_unified;
pub use diff::unified_diff;
pub use error::Error;
pub use fuzzy::FuzzyMatch;
pub use fuzzy::fuzzy_jump;
pub use logparse::LogCell;
pub use logparse::ParsedLogLine;
pub use logparse::infer_columns;
pub use logparse::parse_json_line;
pub use logparse::parse_log_stream;
pub use render::Cell;
pub use render::DataPlane;
pub use render::Filter;
pub use render::Page;
pub use render::Query;
pub use render::Revision;
pub use render::Row;
pub use render::RowId;
pub use render::RowPatch;
pub use render::SortSpec;
pub use render::StatusLevel;
pub use semantic::Action;
pub use semantic::ActionState;
pub use semantic::Status;
pub use sink::AuditConfig;
pub use sink::AuditSink;
pub use surface::Column;
pub use surface::ColumnKind;
pub use surface::EditorMode;
pub use surface::Field;
pub use surface::FieldKind;
pub use surface::Projection;
pub use surface::SupportLevel;
pub use surface::Surface;
pub use surface::SurfaceKind;
pub use surface::support_level;

Modules§

audit
The single write-audit record: one format, two consumers.
diff
Unified diff — “diff before apply” (M1.3).
error
The unified error enum for the view-model.
fuzzy
Fuzzy matching — the “fuzzy jump” semantic (M1.2).
logparse
Log-line parsing — “JSON → columns” (M1.2).
render
Layer 1 — the data plane.
semantic
Layer 2 — the semantic layer.
sink
The optional audit sink.
surface
Layer 3 — surface kinds.