← All components
Published module

D4rt

D4rt runs Dart source at runtime in a permission-guarded sandbox. It is the dynamic-execution engine that lets Tom's AI scripting and flow layers generate and run code safely.

13 modules
1.3M loc · 12.8k tests · 3.2M test LOC
0 released 9 published 4 in works 0 not started

D4rt is a family of Dart interpreters that execute Dart source at runtime without compilation, inside a permission-guarded sandbox. It is the layer that lets `tom_brain` and `tom_flow` run AI-generated and scripted code, and lets agentic UI render in a Flutter client.

Two parallel interpreter lines share one bridge API. `tom_d4rt` is the analyzer-based reference implementation. The analyzer-free line — `tom_ast_model`, `tom_d4rt_ast`, `tom_ast_generator`, `tom_d4rt_exec` — parses on a build machine and interprets on-device, so the heavyweight analyzer never ships inside an app.

Around the interpreters sit code generators (`tom_d4rt_generator` bridges native APIs), Flutter bridges (`tom_d4rt_flutter`, `tom_d4rt_flutter_ast`) for over-the-air UI, and DCli-equipped REPLs (`tom_d4rt_dcli`, `tom_dcli_exec`). D4rt underpins Tom's creation flow and the agentic-app line.

The d4rt family

flowchart TB API["Shared bridge API"] subgraph WF["Analyzer-based"] d4["tom_d4rt · released (analyzer-based)"] --> API gen["tom_d4rt_generator"] --> API end subgraph AF["Analyzer-free · parse on build, run on device"] am["tom_ast_model"] --> ag["tom_ast_generator"] --> de["tom_d4rt_exec"] am --> da["tom_d4rt_ast"] --> de["tom_d4rt_exec"] end da --> API de --> API API --> fl["tom_d4rt_flutter / _flutter_ast"] API --> repl["tom_d4rt_dcli / tom_dcli_exec"]
Foundation — non-web platforms

tom_d4rt Published

tom_d4rt · v1.8.21
38.9k loc · 2.0k tests · 32.8k test LOC
Executes Dart source at runtime without compilation, with bridging and a permission sandbox. The reference implementation of the D4rt runtime that the rest of the family tracks.
Published

tom_d4rt role: foundation

tom_d4rt · v1.8.21

`tom_d4rt` runs Dart source at runtime by walking the analyzer's parse tree in two passes — declaration, then interpretation — and calling the target entry point. It supports full-script `execute()` and REPL-style `eval()`. Scripts run inside an isolated scope chain. Sensitive operations — `dart:io`, isolates, process and network access — are blocked by default, and the host grants fine-grained permissions through a `grant()` API. This is what lets AI-generated code execute safely. It is the stable reference all existing projects depend on. Its bridge API is kept in 1:1 lockstep with the analyzer-free successor line (`tom_d4rt_ast`), so generated bridges run against either interpreter unchanged.

LOC
38.9k
Tests
2.0k
Test LOC
32.8k
9 docs · 1 API

tom_d4rt_flutter In the works

tom_d4rt_flutter · v1.0.0+1
546.4k loc · 2.3k tests · 17.0k test LOC
Wraps `tom_d4rt` with the complete generated Flutter Material bridge surface, turning interpreted Dart source into live widgets. The source-based Flutter runner.
In the works

tom_d4rt_flutter role: extension

tom_d4rt_flutter · v1.0.0+1

`tom_d4rt_flutter` is the reusable library at the centre of the source-based Flutter-facing stack. It exposes `SourceFlutterD4rt`: a `tom_d4rt` interpreter pre-loaded with the full generated Flutter Material bridge surface plus hand-written runtime registrations and override bridges. Feed it raw Dart source and it returns a live `Widget` rendered against real Flutter widgets, with single-file and multi-file sample loading. It is the analyzer-based sibling of `tom_d4rt_flutter_ast`, which runs the same Flutter bridge on the analyzer-free path for embeddable, over-the-air UI. This one keeps the analyzer for full source fidelity in development and testing.

LOC
546.4k
Tests
2.3k
Test LOC
17.0k
9 docs · 0 API

tom_d4rt_test Published

tom_d4rt_test · v1.0.0
11 loc · 0 tests · 0 test LOC
Test suite for tom_d4rt.
Published

tom_d4rt_test role: extension

tom_d4rt_test · v1.0.0

Test suite for tom_d4rt.

LOC
11
Tests
0
Test LOC
0
1 docs · 1 API
Generator
Applications
AST-based alternatives — web-capable

tom_ast_model Published

tom_ast_model · v0.1.1
8.7k loc · 0 tests · 0 test LOC
A complete mirror of the Dart analyzer's node hierarchy with JSON round-tripping and no analyzer dependency. The shared data contract under the analyzer-free interpreter line.
Published

tom_ast_model role: foundation

tom_ast_model · v0.1.1

`tom_ast_model` is a self-contained representation of the Dart AST that deliberately carries no dependency on the `analyzer` package. Every analyzer node has a direct `S`-prefixed counterpart with `toJson()`/`fromJson()`, source positions, and a double-dispatch visitor. The motivation is on-device interpretation: the analyzer is too large to ship inside a Flutter app. Separating the pure data model from parsing lets a source file be parsed once on a build machine, serialized, bundled, and later evaluated at runtime with no analyzer present. Extracted from `tom_d4rt_ast`, it versions the AST contract independently of any execution engine, so `tom_ast_generator`, `tom_d4rt_ast`, and `tom_d4rt_exec` all agree on one node format.

LOC
8.7k
Tests
0
Test LOC
0
4 docs · 1 API

tom_ast_generator Published

tom_ast_generator · v0.1.1
2.7k loc · 536 tests · 8.0k test LOC
Walks an analyzer compilation unit and emits a structurally identical `SAstNode` tree, then bundles it for analyzer-free execution. The build-time half of the on-device interpreter line.
Published

tom_ast_generator role: extension

tom_ast_generator · v0.1.1

`tom_ast_generator` sits at the boundary between the Dart `analyzer` and the analyzer-free runtime. It converts each analyzer node into the matching `SAstNode` from `tom_ast_model`, losing no structure. Once converted, the mirror tree carries no analyzer dependency. It serializes to JSON or YAML, bundles alongside app assets, and runs later on `tom_d4rt_exec` or `tom_d4rt_ast` with the analyzer absent — the key to shipping Dart scripting into a Flutter app. The `astgen` CLI automates conversion across a whole workspace from `buildkit.yaml` configuration. It is the parse-once step feeding the on-device execution line.

LOC
2.7k
Tests
536
Test LOC
8.0k
6 docs · 0 API

tom_d4rt_ast Published

tom_d4rt_ast · v0.1.5
39.3k loc · 162 tests · 2.6k test LOC
Executes pre-parsed `SAstNode` trees with full bridging, sandboxing, and standard library, with no analyzer dependency. The analyzer-free counterpart to `tom_d4rt`.
⇄ alternative implementation
Published

tom_d4rt_ast role: alternative

tom_d4rt_ast · v0.1.5

`tom_d4rt_ast` is the pure-runtime half of the interpreter ecosystem. It accepts pre-parsed `SAstNode` trees from `tom_ast_model` and executes them directly, with no `analyzer` package required at runtime. Because the analyzer cannot ship inside a Flutter app, this package breaks that dependency: parsing happens at build time in `tom_ast_generator`, producing a compact bundle that downloads or ships as an asset and runs on-device — new script logic without an app-store update. It carries the same `InterpreterVisitor`, environment, bridging, and standard library as `tom_d4rt`, kept in strict 1:1 sync; only the AST source differs. Choose it over `tom_d4rt` when analyzer weight is unacceptable.

LOC
39.3k
Tests
162
Test LOC
2.6k
10 docs · 1 API

tom_d4rt_exec Published

tom_d4rt_exec · v1.8.3
2.3k loc · 2.5k tests · 39.8k test LOC
Parses Dart source via the generator, then executes on `tom_d4rt_ast` with no analyzer at runtime. The migration target replacing `tom_d4rt` for Flutter and server use.
Published

tom_d4rt_exec role: extension

tom_d4rt_exec · v1.8.3

`tom_d4rt_exec` is the embedding and CLI entry point of the analyzer-free line. It separates parsing from execution: source is parsed by the analyzer and mirrored into the `tom_d4rt_ast` tree via `tom_ast_generator`, then handed to the `tom_d4rt_ast` interpreter. The split means downstream packages — `tom_dcli_exec`, Flutter apps, servers — embed the interpreter and run scripts without a compile-time or tree-shake dependency on the analyzer; the analyzer step happens only here. It offers fresh, continued, REPL, file, and pre-bundled execution modes, and is the designated migration target away from `tom_d4rt` for all Flutter and server use.

LOC
2.3k
Tests
2.5k
Test LOC
39.8k
8 docs · 1 API

tom_dcli_exec Published

tom_dcli_exec · v1.1.2
33.2k loc · 412 tests · 6.1k test LOC
Layers full DCli shell-scripting bridges and a production REPL on `tom_d4rt_exec`. The preferred analyzer-free base for fast-starting D4rt command-line tools.
Published

tom_dcli_exec role: extension

tom_dcli_exec · v1.1.2

`tom_dcli_exec` is the DCli-equipped tier of the analyzer-free interpreter stack. It sits on `tom_d4rt_exec` and adds generated DCli shell bridges, a `cli` global for programmatic REPL access, VS Code scripting integration, and a Telegram/chat bot mode. Downstream tools subclass its `D4rtReplBase` to add their own bridge sets and commands. It is the analyzer-free counterpart of `tom_d4rt_dcli`: same REPL surface, but it carries the analyzer only to drive source-to-AST conversion, never loading it at runtime. This is the preferred base for new tools needing fast startup and minimal dependencies.

LOC
33.2k
Tests
412
Test LOC
6.1k
5 docs · 0 API

tom_d4rt_flutter_ast In the works

tom_d4rt_flutter_ast · v0.1.0
545.5k loc · 3.0k tests · 3.1M test LOC
Runs D4rt scripts that import `flutter/material.dart` and return real widget trees, on the analyzer-free path. The strategic building block for over-the-air UI in shipping apps.
In the works

tom_d4rt_flutter_ast role: extension

tom_d4rt_flutter_ast · v0.1.0

`tom_d4rt_flutter_ast` connects the sandboxed interpreter to the full Flutter-Material widget library. A script can import `package:flutter/material.dart`, build any widget tree, and return it as a real `Widget` that Flutter renders natively. It runs entirely on the analyzer-free path (`tom_d4rt_ast` + `tom_d4rt_exec`), so it embeds in a shipping Flutter app with no analyzer dependency. Ship widget code in an `AstBundle`, execute it at runtime, render the result — no app-store cycle. The bridge layer spans `dart:ui` and the Flutter painting, rendering, widgets, material, and cupertino barrels. It is the analyzer-free counterpart to `tom_d4rt_flutter` and the client side of Tom's agentic-app line.

LOC
545.5k
Tests
3.0k
Test LOC
3.1M
24 docs · 0 API

tom_d4rt_flutter_ast_test In the works

tom_d4rt_flutter_ast_test · v1.0.0+1
348 loc · 1 tests · 22 test LOC
Test suite for tom_d4rt_flutter_ast.
In the works

tom_d4rt_flutter_ast_test role: extension

tom_d4rt_flutter_ast_test · v1.0.0+1

Test suite for tom_d4rt_flutter_ast.

LOC
348
Tests
1
Test LOC
22
2 docs · 0 API
License
# License

See each folder/package for its specific license.