cai-core
Core types, traits, and utilities for the Coding Agent Insights (CAI) project.
Overview
cai-core provides the foundational data structures and shared utilities used across all CAI crates. It defines the core domain model and error handling.
Key Types
Entry
Represents a single AI coding interaction:
use ;
use Utc;
let entry = Entry ;
Source
Represents the origin system of an entry:
use Source;
let source = Claude;
let custom = Other;
Metadata
Extensible metadata for entries:
use Metadata;
use HashMap;
let mut extra = new;
extra.insert;
let metadata = Metadata ;
Error Handling
use ;
Usage
Add to your Cargo.toml:
[]
= { = "../cai-core" }
Design Decisions
- HashMap for metadata: Allows flexible, extensible metadata without changing the core structure
- DateTime: Consistent timezone handling across the system
- Non-exhaustive enums: Future-proofing for adding new sources
Testing
License
MIT OR Apache-2.0