← Reference

Reference

Decorators

Decorators add metadata that cannot be inferred safely from field defaults: interfaces, relationships, tenant scope, sensitive fields, reports, and other package behavior.

@smrt()

Marks a model for scanning and declares which actions appear in REST, MCP, WebMCP definitions, and CLI. Use include, exclude, and writable lists instead of exposing every method by accident.

Relationships

Use foreignKey for a same-package relationship and crossPackageRef when the target comes from another package. The manifest records the target and the collection can batch-load named relationships.

Tenant scope

TenantScoped selects required, optional, or global behavior. The tenantId field decorator records the storage field used by automatic query interceptors.

Report fields

smrt-reports adds group, time bucket, and measure decorators so aggregate specifications remain beside the report model.