SEA Core
Rust core library implementing the SEA DSL (Strategic Entity Architecture) primitives and validation engine. Part of the DomainForge ecosystem.
Features
- 🏗️ Domain Primitives — Entities, Resources, Flows, Roles, Relations
- 📐 Unit System — First-class dimensional analysis with 100+ built-in units
- ✅ Policy Engine — Constraint validation with three-valued logic
- 🔄 Round-trip Parsing — Parse SEA DSL to AST/Graph, format back to source
- 🌐 Multi-target — Compile to Rust, Python (PyO3), TypeScript (N-API), WASM
Installation
Add to your Cargo.toml:
[]
= "0.6"
Or install the CLI:
Quick Start
use parse_to_graph;
Feature Flags
| Feature | Description | Default |
|---|---|---|
cli |
Command-line interface (sea binary) |
❌ |
python |
Python bindings via PyO3 | ❌ |
typescript |
TypeScript/Node.js bindings via N-API | ❌ |
wasm |
WebAssembly target support | ❌ |
shacl |
SHACL/RDF knowledge graph export | ❌ |
formatting |
ICU-based number formatting | ❌ |
three_valued_logic |
Three-valued logic for policy evaluation | ❌ |
Enable features:
# CLI binary
= { = "0.6", = ["cli"] }
# Python bindings (for maturin builds)
= { = "0.6", = ["python"] }
# WASM target
= { = "0.6", = ["wasm"] }
CLI Usage
# Validate a SEA file
# Format SEA source
# Export to CALM JSON
# Show version and help
API Overview
Parsing
use ;
// Simple parsing
let graph = parse_to_graph?;
// With options
let options = ParseOptions ;
let graph = parse_to_graph_with_options?;
Querying the Graph
// Get all entities
for entity in graph.all_entities
// Get resource by name
if let Some = graph.resource_by_name
// Get flows for a resource
let flows = graph.flows_for_resource;
Validation
use validate_graph;
let violations = validate_graph;
for violation in violations
Documentation
- 📖 API Reference — Full Rust API documentation
- 📚 SEA DSL Guide — Language specification
- 🏗️ Architecture — Design overview
Building from Source
# Clone the repository
# Build the library
# Run tests
# Build with CLI
# Build documentation
Minimum Supported Rust Version
This crate requires Rust 1.77.0 or later.
Related Crates
| Crate | Description |
|---|---|
sea-core |
Core library (this crate) |
sea_dsl |
Python bindings |
@domainforge/sea-core |
TypeScript/Node.js bindings |
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
Licensed under the Apache License, Version 2.0.
Part of the DomainForge project.