Documentation Index
Fetch the complete documentation index at: https://grantmaster.dev/llms.txt
Use this file to discover all available pages before exploring further.
Canonical Events API
Reference for the canonical event/status APIs insrc/shared/events.
Overview
Canonical events normalize cross-feature state into one status model:pendingprogressblockedcompletedfailed
Main Exports
Source:src/shared/events/index.ts
Contracts
CanonicalStatusCanonicalStatusDomainCanonicalStatusProjectionCanonicalEventEnvelopeCanonicalEntityTypeCanonicalStatusSummaryCanonicalConsumerCanonicalProjectionFreshness
Event Mapping and Validation
toCanonicalEventEnvelope(event: SystemEvent): CanonicalEventEnvelope | nullgetCanonicalMappedEventTypes(): SystemEventType[]getCriticalCanonicalEventTypes(): SystemEventType[]canonicalEventEnvelopeSchemagetCanonicalSchemaVersion(): stringgetCanonicalMinSupportedSchemaVersion(): stringisSupportedCanonicalSchemaVersion(version: string): boolean
Projection APIs
canonicalStatusProjectionService.ingestSystemEvent(event)canonicalStatusProjectionService.getStatus(organizationId, entityType, entityId)canonicalStatusProjectionService.listByOrganization(organizationId)canonicalStatusProjectionService.subscribe(listener)summarizeCanonicalStatuses(projections, filters?)selectCanonicalSummaryForConsumer(consumer, projections, entityIds?)selectCanonicalFreshnessForConsumer(consumer, projections, { entityIds?, now? })
React Hooks
useCanonicalStatus(organizationId, entityType, entityId)useCanonicalStatuses(organizationId)useCanonicalProjectionHealth(organizationId)
Extension Consumer APIs
createExtensionEventBus(extensionId).getCanonicalStatus(organizationId, entityType, entityId)createExtensionEventBus(extensionId).listCanonicalStatuses(organizationId)createExtensionEventBus(extensionId).getCanonicalFreshness(organizationId, consumer?)createExtensionEventBus(extensionId).isCanonicalFresh(organizationId, consumer?)
Projection Health Utility
computeCanonicalProjectionHealth(projections, stats, now?)
Producer Helper
emitCanonicalSystemEvent({ eventBus, type, organizationId, userId, severity, payload, source, correlationId? })
Canonical Domains
grant_lifecycleexpense_auditagent_runbillingcomplianceprojectextension
Canonical Consumers
grantsprojectscompliancebillingextensionsagents
Fast Usage Examples
Producer
Consumer (React)
Consumer (Summary)
Consumer (Coordinated Feature Summary)
Related Docs
docs/engineering/architecture/canonical-event-contract.mddocs/engineering/architecture/event-catalog.mddocs/engineering/testing/canonical-events-testing.md