dispatch method
Dispatch a verb invocation. Returns any JSON-serialisable value (or a Future thereof) — the bridge JSON-encodes and hands back to the JS Promise. Throw to reject the promise.
args is the list passed by JS (host.fs.read(path) → [path]).
Atoms validate arity / types and throw ArgumentError for schema
violations so the JS caller gets a clean error message.
Implementation
@override
Future<Object?> dispatch(String verb, List<Object?> args) async {
final b = bridge;
final s = session;
if (b != null && s != null) {
return b.runScoped(s, () => _dispatchInner(verb, args));
}
return _dispatchInner(verb, args);
}