Expand description
§Schema Registry & Ontology
Persistent, versioned database schemas for every AI chat provider and format version, plus an ontology layer that makes schemas discoverable by AI agents.
§Architecture
┌─────────────────────────────────────────────────────────────┐
│ Schema Registry │
│ ┌─────────────┐ ┌────────────-─┐ ┌─────────────┐ │
│ │ Copilot v3 │ │ Copilot JSONL│ │ Cursor v1 │ ... │
│ │ (JSON) │ │ (0.37+) │ │ │ │
│ └─────────────┘ └──────────────┘ └─────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ Ontology Layer │
│ • Entity types, relationships, field semantics │
│ • Cross-provider mappings (field A in X ≡ field B in Y) │
│ • Version migration paths │
│ • Machine-readable capability descriptors │
└─────────────────────────────────────────────────────────────┘§Usage
ⓘ
use csm::schema::{SchemaRegistry, SchemaVersion};
let registry = SchemaRegistry::new();
// List all known schemas
for schema in registry.list_schemas() {
println!("{}: {} fields", schema.id(), schema.field_count());
}
// Detect schema for a workspace
let detected = registry.detect_schema("/path/to/workspace")?;
// Query the ontology
let ontology = registry.ontology();
let mappings = ontology.cross_provider_mappings("copilot-jsonl-v1", "cursor-v1");Structs§
- Cross
Provider Mapping - A mapping between fields in two different provider schemas.
- DbKey
Schema - Schema for a key in a SQLite key-value store (like VS Code’s state.vscdb)
- Detected
Schema - Result of schema auto-detection
- Entity
Relationship - A relationship between two entity types
- Field
Schema - Schema for a single field in a session record
- Migration
Path - Describes how to migrate data from one schema version to another.
- Ontology
- The complete ontology over all provider schemas.
- Provider
Schema - Complete schema definition for one provider at one version.
- Schema
Registry - Central registry of all known AI chat provider schemas.
- Schema
Version - Unique identifier for a provider schema version.
- Semantic
Tag - A semantic tag represents a universal concept that may appear under different field names in different providers.
- Session
Format Schema - Schema for the session file/record format
- Storage
Location - Platform-aware storage location descriptor
Enums§
- Data
Type - Supported data types
- Entity
Type - High-level entity types that appear across providers
- Field
Constraint - Constraints on field values
- Field
Transform - Transformation to apply when mapping a field between providers
- Format
Type - Session file format
- Relationship
Kind - Kinds of relationships between entities
- Storage
Type - Where session data is stored
Functions§
- build_
all_ provider_ schemas - Build and return all known provider schemas.
- claude_
code_ v1 - Claude Code CLI session schema.
- codex_
cli_ v1 - OpenAI Codex CLI session schema.
- continue_
dev_ v1 - Continue.dev VS Code extension session schema.
- copilot_
json_ v3 - VS Code Copilot Chat JSON format (extensions 0.25.0 – 0.36.99).
- copilot_
jsonl_ v1 - VS Code Copilot Chat JSONL event-sourced format (extensions 0.37.0+).
- cursor_
v1 - Cursor IDE chat session schema.
- gemini_
cli_ v1 - Google Gemini CLI session schema.
- openai_
api_ v1 - Generic OpenAI API-compatible conversation format.