| Crates.io | sea-core |
| lib.rs | sea-core |
| version | 0.10.0 |
| created_at | 2025-12-07 03:24:28.265796+00 |
| updated_at | 2026-01-14 01:02:28.280628+00 |
| description | Rust core library implementing the SEA DSL primitives and validation engine. |
| homepage | https://github.com/GodSpeedAI/DomainForge |
| repository | https://github.com/GodSpeedAI/DomainForge |
| max_upload_size | |
| id | 1971096 |
| size | 1,494,458 |
Rust core library implementing the SEA DSL (Semantic Enterprise Architecture) primitives and validation engine. Part of the DomainForge ecosystem.
Add to your Cargo.toml:
[dependencies]
sea-core = "0.6"
Or install the CLI:
cargo install sea-core --features cli
use sea_core::parser::parse_to_graph;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let source = r#"
@namespace "finance"
Entity "Customer"
Entity "Vendor"
Resource "Payment" USD in transactions
Flow "Payment" from "Customer" to "Vendor"
"#;
let graph = parse_to_graph(source)?;
println!("Entities: {:?}", graph.all_entities().len());
println!("Resources: {:?}", graph.all_resources().len());
println!("Flows: {:?}", graph.all_flows().len());
Ok(())
}
| 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 | ❌ |
# CLI binary
sea-core = { version = "0.6", features = ["cli"] }
# Python bindings (for maturin builds)
sea-core = { version = "0.6", features = ["python"] }
# WASM target
sea-core = { version = "0.6", features = ["wasm"] }
# Validate a SEA file
sea validate domain.sea
# Format SEA source
sea format domain.sea
# Export to CALM JSON
sea project --format calm domain.sea output.json
# Show version and help
sea --version
sea --help
use sea_core::parser::{parse_to_graph, parse_to_graph_with_options, ParseOptions};
// Simple parsing
let graph = parse_to_graph(source)?;
// With options
let options = ParseOptions {
default_namespace: Some("my_namespace".into()),
..Default::default()
};
let graph = parse_to_graph_with_options(source, &options)?;
// Get all entities
for entity in graph.all_entities() {
println!("{}: {:?}", entity.name(), entity.namespace());
}
// Get resource by name
if let Some(resource) = graph.resource_by_name("Payment") {
println!("Unit: {}", resource.unit_symbol());
}
// Get flows for a resource
let flows = graph.flows_for_resource(&resource_id);
use sea_core::validation::validate_graph;
let violations = validate_graph(&graph);
for violation in violations {
eprintln!("[{}] {}", violation.severity, violation.message);
}
# Clone the repository
git clone https://github.com/GodSpeedAI/DomainForge.git
cd DomainForge
# Build the library
cargo build -p sea-core
# Run tests
cargo test -p sea-core
# Build with CLI
cargo build -p sea-core --features cli
# Build documentation
cargo doc -p sea-core --no-deps --open
This crate requires Rust 1.77.0 or later.
| Crate | Description |
|---|---|
sea-core |
Core library (this crate) |
sea_dsl |
Python bindings |
@domainforge/sea-core |
TypeScript/Node.js bindings |
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Licensed under the Apache License, Version 2.0.
Part of the DomainForge project.