tapir library

Magic ↔ tapir integration adapter barrel.

Import this file when your app uses both magic and tapir and wants the MagicTapirIntegration enrichers wired into TapirPlugin. Consumers MUST add magic_devtools as a regular dependency (lib/main.dart imports it under !kReleaseMode, so a dev_dependency would trip depend_on_referenced_packages); it depends on magic and tapir, so transitive resolution does not happen through magic itself.

Host integration (debug-only in lib/main.dart). MagicTapirIntegration MUST run AFTER Magic.init() because its enrichers query Magic.find<X>() for form / nav / controller state. TapirPlugin itself installs BEFORE Magic.init() so the snapshot pipeline is live during Magic boot:

if (!kReleaseMode) {
  TapirPlugin.install();
}
await Magic.init(configFactories: [...]);
if (!kReleaseMode) {
  MagicTapirIntegration.install();
}

See src/tapir_integration.dart for the concrete MagicTapirIntegration class and 14 enrichers.

Classes

MagicTapirIntegration
Glues magic's primitives (MagicForm, MagicRouter, Gate, Auth, Echo) into the tapir snapshot pipeline.

Functions

magicAuthUserEnricher(Element element, RefRegistry refs) → String?
Enricher: emits magicAuthUser: <id>[:<displayName>] for the authenticated user.
magicControllerEnricher(Element element, RefRegistry refs) → String?
Enricher: emits magicControllerState: <ControllerClass>.<rxStatus> for the first MagicStateMixin-bearing controller registered via Magic.put.
magicControllerFlagsEnricher(Element element, RefRegistry refs) → String?
Enricher: emits magicControllerFlags: <Class>.isLoading=<bool>,isSuccess=<bool>,isError=<bool>,isEmpty=<bool> for the first registered MagicStateMixin controller in Magic.controllers.
magicEchoConnectionEnricher(Element element, RefRegistry refs) → String?
Enricher: emits magicEchoConnection: connected|reconnecting|disconnected for the current broadcast connection state.
magicFormEnricher(Element element, RefRegistry refs) → String?
Enricher: emits magicFormField: <name> when element is backed by a TextEditingController owned by a MagicFormData in an ancestor MagicForm.
magicFormErrorsEnricher(Element element, RefRegistry refs) → String?
Enricher: emits magicFormErrors: <field>="<text>",... for elements under a MagicForm whose controller carries server-side ValidatesRequests errors matching the form's own field set.
magicGateResultEnricher(Element element, RefRegistry refs) → String?
Enricher: emits magicGateResult: <ability>.<allowed|denied> for the most recently cached GateResult in Gate.manager.
magicGateResultsAllEnricher(Element element, RefRegistry refs) → String?
Enricher: emits magicGateResultsAll: <ability>=<allowed|denied>,... for up to 5 of the most recently checked Gate abilities.
magicMiddlewareEnricher(Element element, RefRegistry refs) → String?
Enricher: emits magicMiddleware: <name1,name2> for the active route's resolved middleware names.
magicNavigationEnricher(Element element, RefRegistry refs) → String?
Enricher: emits magicRoute: <currentLocation> when the router has a resolved location.
magicRecentExceptionsEnricher(Element element, RefRegistry refs) → String?
Enricher: emits magicRecentExceptions: <Type> at <file.dart>:<line>,... for up to 3 most recent records in CrumbsStore.recentExceptions.
magicRecentHttpEnricher(Element element, RefRegistry refs) → String?
Enricher: emits magicRecentHttp: <METHOD> <url> <status> <durationMs>ms,... for up to 5 most recent records in CrumbsStore.recentHttp.
magicRecentLogsEnricher(Element element, RefRegistry refs) → String?
Enricher: emits magicRecentLogs: [<shortLevel>] <message>,... for up to 3 most recent log records at or above WARNING level in CrumbsStore.recentLogs.
magicRouteParamsEnricher(Element element, RefRegistry refs) → String?
Enricher: emits magicRouteParams: <k>=<v>,... for the active route's path parameters followed by its query parameters.