Constants§
- ENTITY_
COMPONENT_ TABLES - List of 1:1 component table names that should be cascade-deleted when an entity is removed.
- MAX_
ID_ LEN - Maximum length for entity/topology ID strings.
- MAX_
INFERENCE_ CONTENT_ LEN - Maximum length for inference message content.
- MAX_
JSON_ LEN - Maximum length for JSON payload fields.
- MAX_
NOTES_ LEN - Maximum length for notes/description fields.
- MAX_
STRING_ LEN - Maximum length for general string fields.
Functions§
- sanitize_
inference_ input - Sanitize inference input: reject if over max length, strip control chars.
- validate_
entity_ id - Validate an entity ID string: non-empty, max 128 chars, alphanumeric + underscore + hyphen.
- validate_
non_ empty - Validate a string field is non-empty.
- validate_
range_ i32 - Validate an i32 value is within an inclusive range.
- validate_
range_ i64 - Validate a numeric value is within an inclusive range.
- validate_
range_ u64 - Validate a u64 value is within an inclusive range.
- validate_
scope_ key - Validate a scope key string.
- validate_
string_ len - Validate a string field does not exceed the given max length.
- validate_
topology_ chain - Validate topology hierarchy: verify that area belongs to region and region belongs to world. Returns Ok if all IDs are valid format. Actual DB lookups must be done in the reducer.
- validate_
topology_ id - Validate a topology ID string (area_id, region_id, world_id): same rules as entity ID.