dart_vm_injector 1.0.0
dart_vm_injector: ^1.0.0 copied to clipboard
Ultra-pro Dart package for injecting and evaluating expressions in live Dart VM isolates via VM Service (WebSocket/JSON-RPC), designed for advanced debugging, live inspection, hot-patching, and securi [...]
Changelog #
All notable changes to dart_vm_injector will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 - 2026-05-31 #
Added #
VmInjector— Primary class with both one-shot static API and persistent session API.VmInjector.inject()— One-shot expression injection into an Isolate by number.VmInjector.injectMain()— One-shot injection into the auto-detected main Isolate.VmInjector.connect()— Persistent session factory.VmInjector.connectWithConfig()— Full-config session factory.listIsolates()— Enumerate all user (and optionally system) Isolates.evaluateInIsolate()— Evaluate in root-library scope.evaluateInMainIsolate()— Evaluate in auto-detected main Isolate.evaluateInNamedIsolate()— Evaluate using partial name matching.evaluateInFrame()— Evaluate in a specific call-stack frame (requires paused Isolate).watch()— Continuous pollingStream<WatchEvent>for any expression.stdout/stderr— Live text streams from the VM.vmEvents/isolateEvents/debugEvents/gcEvents— Raw VM event streams.listenToStream()— Subscribe to any VM Service stream by ID.getObject()— Deep heap inspection by instance ID.getInstances()— All live instances of a class.pauseIsolate()/resumeIsolate()— Lifecycle control.stats— Per-sessionVmConnectionStatswith latency and counters.VmConnectionConfig— Typed connection configuration with factory helpers.InjectionResult— Rich result type withunwrap(),valueOrElse().IsolateInfo— Detailed Isolate snapshot withisPaused,numberAsInt.WatchEvent— Watch-stream event with poll index and timestamp.VmConnectionStats— Session uptime, injection counts, average latency.- Exception hierarchy —
VmConnectionException,IsolateNotFoundException,InjectionFailedException,AotModeException,VmTimeoutException. WebSocketHelper— Auto-discovery via/json/info, HTTP→WS conversion, token extraction.StreamListener— Broadcast VM event streams with clean subscription management.ExpressionEvaluator— JIT-aware evaluator with AOT detection andinvokeMethodsupport.IsolateResolver— Multi-strategy Isolate lookup (by number, name, main).ResultParser— TypedInstanceRef→InjectionResultconversion.VmLogger/VmServiceLog— Internal structured logger.- Full example suite —
basic_inject,list_isolates,watch_variable,listen_stdout,advanced_inspect, and a completeserver_example/(target server + injector client). - Test suite — Unit tests for models, exceptions,
ResultParser,WebSocketHelper.
Security #
- Token-based authentication enforced by default.
- Auto-discovery via HTTP
/json/infobefore falling back to token-less path. AotModeExceptionprevents silent failures on AOT binaries.- Comprehensive security documentation in
README.md.