s-m-r-t

API Reference

Quick reference for SMRT framework APIs. See documentation for detailed usage.

Core Classes

SmrtObject Base class for persistent entities with AI methods
SmrtCollection Collection manager for querying and batch operations
ObjectRegistry Runtime registry for object metadata
DispatchBus Inter-agent asynchronous messaging
MigrationTracker Database migration management

Decorators & Helpers

@smrt() Register a class with the framework
@field() Configure field constraints and validation
@meta() Mark field for STI meta storage
foreignKey() Define many-to-one relationship
oneToMany() Define one-to-many relationship
manyToMany() Define many-to-many relationship

AI Methods

Available on all SmrtObject instances.

is() Evaluate criteria against object, returns boolean
do() Perform action based on instructions, returns string
describe() Generate description of object

Collection Methods

create() Static factory to create collection instance
get() Retrieve single object by ID, slug, or filter
list() Query objects with filtering, sorting, pagination
count() Count objects matching criteria
listByIds() Batch fetch multiple objects by ID
query() Execute raw SQL query
getOrUpsert() Get existing or create new object

DispatchBus Methods

emit() Emit an event to the dispatch queue
subscribe() Create persistent subscription
process() Process pending dispatches for subscriber
retry() Reset failed dispatches for retry
cleanup() Delete old dispatches

Internal Tables

_smrt_migrations Framework schema version tracking
_smrt_schema_migrations User schema migration tracking
_smrt_registry Object metadata persistence
_smrt_contexts Remembered context and learned patterns
_smrt_embeddings Vector embeddings for semantic search
_smrt_dispatch Inter-agent dispatch queue
_smrt_dispatch_subscriptions Persistent dispatch subscriptions
_smrt_signals Signal history audit log

TypeDoc Reference

Full API documentation is generated from source with TypeDoc.

View on GitHub →