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
TelescopeWatcher for Magic's cache facade.
MagicEventWatcher
TelescopeWatcher for 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
TelescopeWatcher for magic's gate-result event. Subscribes to the canonical GateAccessChecked (covers both allow and deny outcomes via allowed: bool); the convenience GateAccessDenied event is NOT subscribed to because it would double-record every denial.
MagicHttpFacadeAdapter
TelescopeHttpAdapter that captures every request flowing through Magic's network driver and feeds TelescopeStore.recordHttp.
MagicModelWatcher
TelescopeWatcher that subscribes to ModelCreated, ModelSaved, ModelDeleted and feeds TelescopeStore.recordMagicModel.
MagicQueryWatcher
TelescopeWatcher for magic's QueryExecuted event (dispatched by QueryBuilder after every SQL run). Captures sql + bindings + timeMs + connection into a QueryRecord; surfaces via telescope:queries CLI / telescope_queries MCP tool.
MagicTelescopeIntegration
Glues magic's Http / Model / Cache facades into the fluttersdk_telescope store.