telescope library
Magic ↔ fluttersdk_telescope integration adapter barrel.
Import this file when your app uses both magic and fluttersdk_telescope and wants the MagicTelescopeIntegration watchers wired into TelescopePlugin. Consumers MUST add magic_devtools as a dev_dependency; it depends on magic and fluttersdk_telescope, so transitive resolution does not happen through magic itself.
Host integration (debug-only in lib/main.dart). MagicTelescopeIntegration
MUST run AFTER Magic.init() because MagicHttpFacadeAdapter resolves
the NetworkDriver via the IoC container. TelescopePlugin itself
installs BEFORE Magic.init() so ExceptionWatcher catches Magic
boot errors:
if (kDebugMode) {
TelescopePlugin.install();
}
await Magic.init(configFactories: [...]);
if (kDebugMode) {
MagicTelescopeIntegration.install();
}
See src/telescope_integration.dart for the concrete
MagicTelescopeIntegration class, 5 watchers, and
MagicHttpFacadeAdapter.
Classes
- MagicCacheWatcher
-
TelescopeWatcherfor Magic's cache facade. - MagicEventWatcher
-
TelescopeWatcherfor magic's app-event surface (auth, db, gate definitions). Excludes model lifecycle events (owned by MagicModelWatcher) and the gate-result event (owned by MagicGateWatcher) to keep each record on a single channel. - MagicGateWatcher
-
TelescopeWatcherfor magic's gate-result event. Subscribes to the canonicalGateAccessChecked(covers both allow and deny outcomes viaallowed: bool); the convenienceGateAccessDeniedevent is NOT subscribed to because it would double-record every denial. - MagicHttpFacadeAdapter
-
TelescopeHttpAdapterthat captures every request flowing through Magic'snetworkdriver and feedsTelescopeStore.recordHttp. - MagicModelWatcher
-
TelescopeWatcherthat subscribes toModelCreated,ModelSaved,ModelDeletedand feedsTelescopeStore.recordMagicModel. - MagicQueryWatcher
-
TelescopeWatcherfor magic'sQueryExecutedevent (dispatched by QueryBuilder after every SQL run). Captures sql + bindings + timeMs + connection into aQueryRecord; surfaces viatelescope:queriesCLI /telescope_queriesMCP tool. - MagicTelescopeIntegration
- Glues magic's Http / Model / Cache facades into the fluttersdk_telescope store.