No description
  • Rust 96.8%
  • JavaScript 2.2%
  • HTML 0.4%
  • Shell 0.3%
  • CSS 0.3%
Find a file
zaelgohary 7689104ac3
Some checks failed
Build Linux / build-linux (x86_64-unknown-linux-musl, false, x86_64-unknown-linux-musl) (push) Failing after 3s
Build and Test / build (push) Failing after 17s
fix: migrate /css/:file and /js/:file to axum 0.8 capture syntax
2026-05-10 16:27:43 +02:00
.forgejo/workflows ci(build.yaml): update release-bin assertion hero_osis_ui → hero_osis_admin (#50) 2026-05-09 12:07:49 +00:00
.hero feat: add --info/--help startup banner, switch RPC responses to JSON, add hero_builder artifacts 2026-05-10 14:16:38 +02:00
crates fix: migrate /css/:file and /js/:file to axum 0.8 capture syntax 2026-05-10 16:27:43 +02:00
data feat(projects): shrink ProjectStatus to todo|in_progress|done 2026-04-20 18:34:01 +02:00
docs Consolidate hero_osis into a single binary (#23) 2026-04-14 15:44:41 +00:00
examples feat: add --info/--help startup banner, switch RPC responses to JSON, add hero_builder artifacts 2026-05-10 14:16:38 +02:00
schemas feat(projects): shrink ProjectStatus to todo|in_progress|done 2026-04-20 18:34:01 +02:00
scripts fix: rename hero_osis_ui binary to hero_osis_admin, fix socket/log compliance 2026-05-07 22:42:48 +02:00
sdk/js chore: remove stale sdk/rust — replaced by crates/hero_osis_sdk 2026-04-14 23:08:28 +02:00
static feat: socket-per-context, hero_osis_ui crate, restructure plan 2026-02-23 18:55:08 +01:00
tests Consolidate hero_osis into a single binary (#23) 2026-04-14 15:44:41 +00:00
.gitignore feat: change default context from hero_osis to root 2026-02-05 09:24:08 +01:00
Cargo.lock chore: migrate to hero_admin_lib shared assets 2026-05-10 16:19:58 +02:00
Cargo.toml chore: migrate to hero_admin_lib shared assets 2026-05-10 16:19:58 +02:00
Dockerfile fix: healthcheck uses /api instead of / (root returns 404) 2026-02-09 10:26:50 -05:00
Dockerfile.build Session 9: fix 5 TODOs + AI assistant enhancements 2026-03-17 12:48:00 -04:00
GETTING_STARTED.md docs: add getting started guide, working examples, and architecture docs 2026-03-21 01:12:01 +01:00
LICENSE Initial commit: Hero Osis OpenRPC Server 2026-02-04 20:23:30 +01:00
PURPOSE.md fix: logging compliance, socket naming, add PURPOSE.md 2026-05-07 12:19:01 +02:00
README.md fix: logging compliance, socket naming, add PURPOSE.md 2026-05-07 12:19:01 +02:00
rust-toolchain.toml chore: upgrade askama 0.12→0.16, switch to rustls-native-certs, update Rust to 1.95.0 2026-05-08 17:17:43 +02:00

HeroOsis

A human-centric backend server entirely generated from schema definitions using OSIS (Object Storage with SmartID).

Quick Start

Use the nushell service command (recommended):

service osis start --update --reset   # install, update, and start
service osis start                    # start existing install
service osis stop                     # stop the service
service osis status                   # check status

Or build manually:

make install  # Build and install to ~/hero/bin
make run      # Start server + UI via hero_proc
make dev      # Run server with debug logging (no hero_proc)
make help     # Show all available commands

Architecture

crates/
  hero_osis/          — Core types and domain handlers (library)
  hero_osis_server/   — JSON-RPC server over Unix sockets (binary)
  hero_osis_sdk/      — SDK client library (library)
  hero_osis_ui/       — Admin panel + /rpc proxy (binary)
  hero_osis_examples/ — Example programs and integration tests

Sockets

All services bind exclusively to Unix domain sockets:

Service Socket
Server ~/hero/var/sockets/{context}/hero_osis_server.sock
UI ~/hero/var/sockets/hero_osis_ui.sock

No service opens a TCP port. Access via hero_proxy for HTTP.

How It Works

HeroOsis is built on a schema-first architecture. All types, storage, RPC handlers, and documentation are auto-generated from .oschema files in schemas/.

schemas/{domain}/*.oschema  →  build.rs  →  Generated Code
                                    ↓
               ┌────────────────────┼────────────────────┐
               ↓                    ↓                    ↓
       crates/hero_osis/     crates/hero_osis_sdk/  docs/schemas/
       - types_generated.rs  - client code          - API docs
       - rpc_generated.rs
       - osis_server.rs

The herolib-osis crate handles:

  • OSchema parsing - Schema language for defining types
  • Code generation - Rust structs, builders, CRUD methods
  • Storage - Filesystem-based with SmartID identifiers
  • Full-text search - Tantivy-powered indexing
  • RPC server - JSON-RPC endpoints per domain

Example Schema

# schemas/business/company.oschema
Company = {
    sid: sid                    # SmartID (auto-generated)
    name: str [rootobject]      # Marks as storable type, indexed
    description?: str [index]   # Optional, full-text indexed
    website?: str
    country?: str
    active: bool
    tags: [str]
}

Running cargo build generates:

  • Company struct with all fields
  • OsisBusiness handler with CRUD methods
  • JSON-RPC methods for the domain
  • SDK client code

Domains

Domains are logical groupings of related types. Each domain compiles independently via feature flags.

Domain Description
calendar Events, planning, scheduling
files Documents, folders, sharing
finance Money, payments, transactions
communication Messages, channels, notifications
identity Profiles, sessions, contacts
projects Tasks, issues, requirements
code Source code, changes, releases
business CRM, deals, contracts
network Network nodes, marketplace
settings User preferences
base Base types and utilities
ledger Ledger, KVS, DNS, groups
media Photos, songs, media management
ai AI agents, bots, chat services
flow Workflow DAGs for agent intelligence
job Distributed job execution

Environment Variables

Variable Default Description
HERO_OSIS_DATA_DIR ~/hero/var/hero_osis/data Data directory
HERO_OSIS_SEED_DIR - Seed directory for auto-seeding
HERO_CONTEXTS root Contexts to register (comma-separated)

Seeding Data

make seed    # Seed from ./data/mock

Seed files are TOML with a _type field:

_type = "Company"
name = "ACME Corporation"
country = "US"
active = true

Important: For types with nested objects (like Theme), all top-level fields must come BEFORE [section] headers. See Seeding Documentation for details and common pitfalls.

Adding a New Domain

  1. Create schemas in schemas/{domain}/*.oschema
  2. Add feature flag to Cargo.toml
  3. Register domain in build.rs
  4. Add handler in server main.rs
  5. Run cargo build

Resources

License

Apache-2.0