1 import Base 2 # One nominal ordinary schema declaration shared by component grants and gates. 3 # No storage/runtime imports and no user debug metadata adapter. 4 # Schema-scoped component declaration binding a key to payload type P. 5 # This Data value owns no component instance; keys must remain collision-free 6 # within a validated schema. It is not a runtime entity/world authority. 7 type Declaration<-S:Data,-P:Type> is Data: 8 Declaration{key:String} 9 # Declare a component key for payload P in schema S. Does not create storage, 10 # spawn entities or validate collisions; compose and validate the schema before 11 # attaching an App. Example: examples/scheduled-health/registration.bend identities. 12 def component(~S:Data,~P:Type,key:String) -> Declaration: 13 Declaration{key} 14 # Return the authored component key without accessing any world or payload. 15 def key(~S:Data,~P:Type,declaration:Declaration) -> String: 16 match declaration: 17 case Declaration{key}:key