Package Catalog
The detailed map behind the compact table in Agent Guidelines: what each sub-package declared in the root dub.sdl is, and where its modules live. The authoritative list is the subPackage entries in dub.sdl; per-library docs live under docs/libs/<name>/ and specs under docs/specs/.
Sub-packages
ci(apps/ci) — Repository CI helper: runs/verifies markdown examples, standalone examples, sub-package tests, and markdown link maintenanceshader-compile(apps/shader-compile) — TheEFX20pipeline: compiles a dub package's single-source D shaders — the@computemodules of itsshadersconfiguration (forsparkles:ui:libs/ui/shaders/effects.d+sparkles.ui.effect_shadersoversparkles:shaders) — with the dcompute-enabled LDC (ldc2-vulkan: dlang.nix'sldc-vulkan, thesparkles/vulkan-shadersbranch; in the dev shell, andnix run .#shader-compilewraps it) to SPIR-V, validates and optimises it, cross-compiles every@fragmententry point with spirv-cross to GLSL 330 and ES 100, proves each with glslang, and writes*.fragto--out. Runs assparkles:ui'sgpu-effectspre-generate step (--if-stale: a stamp of input hashes, so a fresh build needs no compiler) into the git-ignoredlibs/ui/generated/shaders/; nothing generated is committed, and Nix builds it once (.#ui-shaders). Phobos-only on purpose:core-clidepends onsparkles:uirelease(apps/release) — Release automation: scans tags as SemVer, summarizes commits, suggests a bump, gathers notes ($EDITOR or a CLI LLM agent), tags and publisheshue(apps/hue) — Interactive syntax-highlighting file viewer / live theme previewer oversparkles:syntaxwith subcommands (view,diff,pr,gallery,theme,overlay,config) powered bysparkles:core-cli(ANSI + HTML, plus an optional raylib--guibackend behind theguibuild config, onsparkles:raylib-text;--guialso renders a render-markdown.nvim-style markdown preview — heading icons, callouts, task lists, box-bordered aligned tables viasparkles:core-cli— and native ANSI in```ansifences via an off-screensparkles:ghosttyVT). Also ships as an Android NativeActivity APK (nix build .#hue-apk, dev shellnix develop .#android— both x86_64-linux only, since the NDK/SDK ship prebuilt for that host; seedocs/specs/hue/android.md)nix-eval(apps/nix-eval) — Demo CLI forsparkles:nix: evaluates a Nix expression or flake output and pretty-prints the valueterminal(apps/terminal) — Minimal raylib-based terminal emulator built onsparkles:ghosttyandsparkles:raylib-textterminal-benchmark(apps/terminal-benchmark) — Render-CPU benchmark harness for theterminalemulator (/procCPU sampling; idle/render/churn scenarios)twoslash-extract(apps/twoslash-extract) — Batch D twoslash extractor: runs thesparkles:twoslash-dpipeline over an annotated D sample (or a directory, one child process per file) and writes the.twoslash.jsonpayloadhue --twoslashrenders;--verifyguards the golden fixturesui-gallery(apps/ui-gallery) — A browsable catalog of thesparkles:uitoolkit — widget kinds, layout, the 36 themes, the component set and the interaction machines — written as asparkles:ui-appcomponent, so oneviewserves both the terminal and the window. Also the host contract's first real consumer, andsparkles:terminal-view's embedding proof (TVW7): the Terminal page runs real shells in VSCode-style tabs, terminal-in-terminal included.--render/--render-plainpaint one frame with no backend at alldiagram(apps/diagram) — A draw.io-style diagram board onsparkles:ui-app— an infinite world with a camera, a dense entity store, orthogonal connectors, groups, labels and a configurable Cartesian grid backdrop (--config-file, plus a modalPropertyTreesettings pane over the live config —,or the context menu). It exists to stress the host abstraction from a direction hue and terminal cannot: neither has a camera, a world coordinate space, or a surface larger than its viewport. Its central claim is checkable by grep — no backend name appears anywhere underapps/diagram/(DIA1/DIA2), and--tuiand--guiare the sameviewsparkles:android(libs/android) — NativeActivity glue for the Android apps (hue, the terminal): the activity handle, data dirs and content rect, the logcat sink, the APK asset bundle (manifest-driven extraction keyed bybundle-hash, streaming asset copies), and JNI bridges into framework classes — clipboard, typed text (KeyCharacterMap, IME commits), the soft keyboard, HTTP(S) downloads (HttpURLConnection),ACTION_VIEWintents, a wake lock, runtime permissions. Short JNI calls run on one attached worker thread (withJni), sincesparkles:ui-appframes run on fibers ART refuses to attach. Everything platform-bound isversion (Android); on a host the package is its pure helpers (bundle.d), so any library can depend on it unconditionallysparkles:base(libs/base) — Allocation-conscious foundation utilities:Buffer(four storage policies), lifetime helpers,@nogctext readers/writers, terminal styling, terminal capability probing (term_caps— size/tty/colors/unicode, the single place that decision is made), hardware parallelism (hw_caps— CPU quota/affinity plus memory/load/swap so a pool is not wider than the host can usefully run), styled IES, logging, the shared I/O error vocabulary (io.errors), and the capability VFS (vfs— directory handles with compile-time rights, the component walk, tree removal, atomic write, and the in-memoryMemVfs; spec:docs/specs/base/vfs/)sparkles:build-primitives(libs/build-primitives) — Build-system and VCS primitives:.gitignoreparsing/matching (nested + ancestor scopes), a DbI-hook directory walker (walkGitRepository), andgit_env— the scrubbed environment (runGit) a git child needs, so an inheritedGIT_DIRcannot redirect a call that names its own repositorysparkles:code-instrumentation(libs/code-instrumentation) — Code coverage ingestion library: universal coverage data model (LineCoverage,FileCoverage,CoverageReport), multi-format parsers over a shared record scanner (DMD.lst, GCCgcov, LCOV.info, V8 AST byte-range blocks, llvm-cov JSON) reporting failures asParseExpected, anchored format auto-detection, and overlay planning (CoveragePlan)sparkles:core-cli(libs/core-cli) — CLI argument parsing, help formatting, interactive prompts, process utilities, ANSI unstyle helpers. The UI components moved tosparkles:ui(sparkles.ui.components.*)sparkles:diff(libs/diff) — Text diff engine behind hue's diff & PR viewer (specDVM*): a backend-neutral diff document model (files → hunks → rows with pairing + intra-line emphasis), Myers line diff with scale guards, similarity alignment pairing (linematch-style DP), guarded word-level refinement (over its own token classes, or over boundaries a caller supplies viarefinePairTokens— which is how hue's grammar-aware structural view reuses the LCS without the engine learning about tree-sitter), and a unified-patch parser/emitter (ParseExpectederrors, output-range emit).@safe pure nothrow @nogcthroughout: a flat arena of plain-data elements owned bySharedBuffer(CoW), texts borrowed as spans. Tree-sitter-free by design —sparkles:baseis its only dependencysparkles:dmd-fmt(libs/dmd-fmt) — D formatter being built on the DMD-lexer token spine perdocs/research/code-formatting/dmd-fmt-proposal.md(M0–M8 delivered — decisions, spike evidence and milestone table indocs/specs/dmd-fmt/; v1 policy: author's-breaks + structural reindent, magic trailing comma,.editorconfig/dfmt-key discovery,dmd-fmtCLI via theclidub configuration):spine.dlexes withcommentToken+whitespaceToken, records exact byte spans, surfaces silently-consumed bytes (#line, shebang) as explicit directive entries, and proves byte-for-byte reconstruction plus token-equality against a plain lex and doc-lex offset correspondence;oracle.dreduces a parse-only AST walk to sorted offset arrays (dfmt'sASTInformationshape);groups.dproves S2 — nested group trees reconstructed from the spine plus those arrays alone (bracket matching + markers + bounded lookahead), degrading to bracket-only structure on unparseable input;cases.dis the markdown case runner (a fixture is a documentation page: a::: code-groupunder an<!-- fmt id=P19 -->directive, first fence in / later fences out,SPARKLES_UPDATE_GOLDENS=1to bless — seedocs/specs/dmd-fmt/testing.md);verify.dis the M1 verifier —verifyFormat(tier-3 token equality modulo whitespace + the separate DDoc-attachment check via the doc-lex, catching whitespace-only trailing-///reattachment) andcheckConvergence(bounded idempotence harness with per-step verification). DMD's frontend globals are not thread-safe, so all lexing/parsing serializes on a module locksparkles:dmd-lsp(libs/dmd-lsp) — DMD-frontend-as-a-library semantic core (ported from VisualDdmdserver, Boost-1.0): one-pass in-memory analysis with structured diagnostics, thesemvisitortype oracle (tipAtresolved types + ddoc,identifierSpansclassification,definitionAt), on the pinneddmdserver-dubLanguageServer fork (dub git dep; runtime sources via$SPARKLES_DMD_IMPORT_PATH); target profiles analyze as LDC too, and@computeshader modules as the dcompute LDC's device build ($SPARKLES_LDC_IMPORT_PATH, the package's dub device configuration, LDC's device-code rules) — seedocs/specs/dmd-lsp/sparkles:doc-view(libs/doc-view) — The document viewer extracted from hue (specUIA14, docs):DocumentPipeline(read → detect → highlight → parse a file into aDocument— code, markdown, DSV, diff, twoslash),ViewerModel(the laid-out widget tree and display list, views, wrapping, folding, search, theNAV5scroll anchor), the markdown/DSV/diff models, VitePress@includeresolution (VIW5/VIW7), andDocViewPane— the viewer as an embeddablesparkles:ui-raylibpane with its own keys, reload-on-change and image display, whichsparkles:terminalopens files in (TDV). Raylib-free except the pane and ghostty-free except the ansi-fence decoder, each compiled where the consumer links that backend (Have_*)sparkles:docs(libs/docs) — Markdown-based static documentation-site (SSG) library, extracted from hue's gallery: the content-fragment builders (plain + twoslash, oversparkles:syntax/sparkles:twoslash), the page shell with theme-derived chrome, appearance toggle and breadcrumbs, the mirrored site tree with per-directory indexes, shared stylesheet assets, the recursive document set (oversparkles:build-primitives' glob walk), and the docs-site sidebar/srcExcludedata schema (sparkles:wired) thatci --check-docs-sidebar/--audit-fencesconsume. hue'sgallerysubcommand is its first consumer; the plannedhue site+ API doc generator build on it (spec:docs/specs/hue/gallery.mdGAL*)sparkles:dql(libs/dql) — D Query Language engine: path-based aggregate addressing, typed constraint evaluation, fuzzy matching viasparkles:fuzzy, zero-allocation predicate filtering, and schema introspection (spec:docs/specs/dql/SPEC.md)sparkles:dsv(libs/dsv) — Delimiter-Separated Values engine behind hue's DSV preview / data browser (specDS*): dialect detection (delimiter/quote/header sniffing over a bounded sample, incl. the semicolon-CSV case), a tolerant RFC 4180 parser with a raw-byte-span identity channel per cell (ragged rows degrade, never error), and sampled typed columns. Offsets-not-copies over borrowed sources;@safe pure nothrow @nogcthroughout;sparkles:baseis its only dependencysparkles:event-horizon(libs/event-horizon) — Completion-first (io_uring/kqueue/IOCP) event loop with a native algebraic-effect layer (three API tiers: callback, direct-style fibers,Effect!T)sparkles:event-horizon-sys(libs/event-horizon-sys) — The loop-free system-call layer ofsparkles:event-horizon:BlockingVfs, the capability VFS's blocking backend (the*atfamily on POSIX, withopenat2on Linux andO_NOFOLLOW_ANYon macOS as kernel resolvers, and search-only opens for intermediate directories); the descriptor ownership types (OwnedFd,BorrowedFd,isFdBorrowable); and the native error-code tables (errnoKind,win32Kind). It depends onsparkles:basealone, so code that must not pull in the event loop, such as test fixtures, can use it (spec:docs/specs/base/vfs/backends.md)sparkles:font(libs/font) — Font files parsed in D over borrowed bytes, with no C library: faces and collections, the table directory with checksums, typed views ofhead/hhea/maxp/OS/2/post/hmtx/fvar/avar/STAT, character maps chosen in HarfBuzz's order with lenient checks and coverage ranges,namerecords decoded through base's codecs, and glyph names frompostand theCFFcharset. Milestone M1 ofdocs/specs/font; malformed data returns aFontError, nothing allocatessparkles:font-oracle(libs/font-oracle) — Test-only: checkssparkles:fontagainst HarfBuzz, through hand-declared prototypes, over every bundled font ($SPARKLES_FONTS_PATH), so thatsparkles:fontitself links no C librarysparkles:fuzzy(libs/fuzzy) — Bounded allocation-free fuzzy search core: Unicode-aware query/constraint parsing, Thompson-NFA globs, exact needle-deletion witnesses with source-byte positions, affine-gap ranking with a deterministic fallback, composite scoring and global top-K, fixed-point frecency/combo history, and generation-bound chunked search. Depends only onsparkles:baseandexpected; hue owns clocks, jobs, snapshots, and persistence (spec:docs/specs/fuzzy/)sparkles:ghostty(libs/ghostty) — D bindings + ImportC integration layer forlibghostty-vt(Ghostty's terminal VT engine)sparkles:http(libs/http) — HTTP/1.1 building blocks (request parser + minimal server API) oversparkles:event-horizonsparkles:input(libs/input) — Abstract, capability-tiered input vocabulary shared by everysparkles:uitarget: events as Regular values (a sum type over key/pointer/wheel/focus/resize, positions in the toolkit's 0-based cells) plus the tier-0/1/2 interaction ladder;sparkles:tuidecodes its wire formats directly into it (design:docs/specs/ui/input.md)sparkles:math(libs/math) — Small math primitives for games/graphics (early stage)sparkles:metadata(libs/metadata) — Dependency-free passive UDA vocabulary (WireName,WireCase,WireReprand the format tags,CaseStyle,Aliases,Label,Description,Range) shared without coupling foundational libraries to CLI, serialization, UI, or query-engine policysparkles:nix(libs/nix) — D bindings for the Nix C API (libnix{util,store,expr,fetchers,flake,main}-c) — ImportC raw layer + high-level RAII/Expectedwrappers (eval, store, flakes)sparkles:reflection(libs/reflection) — Dependency-free structural reflection kernel: one closedtypeKindOfclassification and indexed field/property primitives (the field spine, public getter discovery incl. const-readability, the value-like wrapper rule, CTFE helpers) that consumers build their own walks from; the property tree, text writers, and query schemas all dispatch on it — structure here, policy (and each traversal) in the consumers (docs)sparkles:raylib-text(libs/raylib-text) — Reusable raylib text-rendering core shared byapps/terminalandhue --gui: a multi-faceFontSet(real bold/italic variants, on-demand atlas growth,--font-codepoint-maprouting),drawGrapheme/drawSolid+ a per-rundrawText, and procedural box-drawing (drawBox, so─│┼╭…connect across cells instead of using gappy font glyphs)sparkles:shaders(libs/shaders) — Single-source shader vocabulary: GLSL-shapedvec2/vec3/vec4(native__vectors under LDC where the size is a power of two, a lookalike struct otherwise), thev2/v3/v4constructors, UFCS component reads, and the GLSL built-ins (floor,mod,dot,clamp,mix, …) with the specification's semantics on the CPU. In a dcompute build (-mdcompute-targets, which predefinesLDC_DCompute) its@compute/@fragment/@input/@uniform/Sampler2Dare LDC's realldc.dcomputesymbols; otherwise inert stand-ins, so an ordinary build sees plain D. Dependency-freesparkles:source-view(libs/source-view) — Source viewing and markdown rendering components oversparkles:ui(sparkles.source_view.code,sparkles.source_view.markdown): maps syntax-highlighted code and structural markdown ASTs intosparkles:uiWidgetTreenodes for backend-neutral GUI/TUI rendering parity, with fence scrolling, foldable sections, callouts, task lists, and box-bordered aligned tablessparkles:syntax(libs/syntax) — Syntax highlighting: engine-agnostic highlight-event stream, scope-compatible label vocabulary, theme layer, ANSI + HTML renderers, tree-sitter precise-mode engine (design:docs/specs/syntax/), plus a structural markdown model (md/model.d,extractMarkdown) with anMdDoc → HTMLemitter (md/render_html.d) for preview/doc rendererssparkles:terminal-view(libs/terminal-view) — The terminal core as an embeddable component, extracted fromapps/terminal(spec:docs/specs/ui-app/terminal-view.md,TVW):TerminalView— the whole emulator as arunAppcomponent (libghostty screen, per-cell raylib renderer, pty lifecycle, the byte-oracle-pinned key encoding seam, OSC color-query replies) — plus the embedding surface (frameat a pane size,paintPane, and the host-freepump/decideRedraw/sendKey/notifyFocus/resize/openCore) andcell_paint.d, which renders the VT screen through anyisCanvastarget so a pane works fontless in a terminal. Embedded byapps/ui-gallery's Terminal page (TVW7)sparkles:test-runner(libs/test-runner) — General-purposeunittestrunner (silly successor): parallel runtime tests plus@ctfe,@betterC,@wasm,@benchmark, and@workloadmodessparkles:test-utils(libs/test-utils) — Testing helpers: diff tools, temp-filesystem helpers, string helperssparkles:tree-sitter(libs/tree-sitter) — D bindings for the tree-sitter C runtime: ImportC surface, RAII wrappers withTsErrorreporting, grammar dlopen (grammars supplied by the nixts-grammarsbundle via$SPARKLES_TS_GRAMMAR_PATH; all come from nixpkgs except SDLang — in-house atPetarKirov/tree-sitter-sdl,nix/packages/tree-sitter-sdl.nix— and D, pinned toPetarKirov/tree-sitter-dfor DUB single-file recipe injections,nix/packages/tree-sitter-d.nix)sparkles:tui(libs/tui) — Full-screen interactive terminal substrate: a 2-D cell grid with a compact packed cell (GridT), a retained diff compositor (Screen), terminal lifecycle (raw mode / alt screen / mouse), SGR-1006 input decoding, an event loop, and the terminal geometry vocabulary (TermPosition). Rendering core chosen by measurement — seedocs/specs/tui/sparkles:twoslash(libs/twoslash) — Twoslash render overlay onsparkles:syntax: the TypeScript-twoslashnode model as opaque data (JSON viasparkles:wired) rendered as type-annotation overlays in HTML (the.twoslash-*contract + CSS), ANSI meta-lines, and thehue --guiraylib backend;render_widgets.dmaps the node model to asparkles:uiWidgetTreefor backend-neutral GUI/TUI paritysparkles:twoslash-d(libs/twoslash-d) — The D twoslash analyzer: notation parser (^?,---cut---family,@errors:/@dflags:/@import:, custom tags), node assembly oversparkles:dmd-lsp(hover-per-identifier + ddoc, queries, error nodes, two-phase cut/position resolution), and the.twoslash.jsonemitter with the D producer contract (language/offsetEncoding)sparkles:twoslash-protocol(libs/twoslash-protocol) — The twoslash node model (Node/TwoslashReturn) + wired JSON ingest, extracted fromsparkles:twoslashso producers (sparkles:twoslash-d) consume it without the render lib'ssourceLibraryclosure; owns thelanguage/offsetEncodingpayload declaration and the legacy UTF-16 offset normalizationsparkles:ui(libs/ui) — Canvas-first three-level UI toolkit (state-machines / layout / widgets) — the repository's single UI stack: a DbIisCanvas!Tbackend seam, a semanticSlot/Palettestyle layer, a unifiedTheme(syntax rules + slots + metrics + glyphs, runtime-swappable), a flat-arena widget model, box-flow layout, theview→layout→buildDisplayList→paintpipeline,components/— the terminal component set (box/table/tree/meter/tasklist/live/…) moved here fromcore-cli— and the keymap/lantern layer (keymap.d/lantern.d/components/lantern_view.d: bindings-as-data over app-supplied command/scope enums plus the which-key-style guide, extracted from hue; spec:docs/specs/ui/keymap.md). The built-in effects run as tier-0 CPU transforms by default, and gain their generated GPU halves only in the opt-ingpu-effectsconfiguration (selected beside everyui-raylibdependency, and which needsldc2-vulkan). GL-free; geometry specializessparkles:math'sVectorsparkles:ui-app(libs/ui-app) — The application host forsparkles:ui: backend selection (--gui/--tui/--html, display probing, the Android answer), the shared window/font CLI and its setup order, and the frame/event loop — so an application never names a canvas. Ships three configurations (tui/gui/full) and a headless recording target that makes an app's own frame loop testable (design:docs/specs/ui-app/)sparkles:ui-raylib(libs/ui-raylib) —sparkles:ui's GPU backend adapter:RaylibCanvasscales the toolkit's cell-space display list to pixels over the sharedsparkles:raylib-textFontSet, andRaylibEventssynthesizessparkles:inputevents from raylib's polled state (press/release edges, drag, wheel, typed characters, focus/resize)sparkles:ui-tui(libs/ui-tui) —sparkles:ui's terminal backend adapter:GridCanvaspaints the toolkit's display list into asparkles:tuicell grid (compositing fills, box-drawing borders, undercurl squiggles, clip stack), which the tuiScreencell-diffs to a minimal byte streamsparkles:versions(libs/versions) — Design-by-Introspection versioning library (SemVer, DMD, CalVer, PyPI, Maven, Deb, …) with VERS/pURL interopsparkles:vulkan(libs/vulkan) — Vulkan bindings over the target's real headers: loader discovery, branded handles, typed results, compile-timesType, bounded enumeration, extension/flag/name helpers and per-instance/device dispatch; Linux surface ABI comes from target-gated ImportC headers while the minimal Win32/Metal surface fragments avoid importing SDK inline bodies, and all ownership/policy stays in consumers such assparkles:vulkan-wsisparkles:vulkan-wsi(libs/vulkan-wsi) — Renderer bridge above native WSI: validates typed native handle pairs, enables the matching target-gated Vulkan surface extension, owns instance/surface/device/graphics+present queue selection, and brackets Wayland ICD calls with the WSI native-I/O borrow so Mesa cannot deadlock against Event Horizon's prepared read; it also owns the backend-neutral command pool, frame synchronization, swapchain decisions and deferred retirement thatsparkles:ui-sdl3consumes through compatibility re-exports; the native triangle followsdocs/specs/window-system-integration/sparkles:wsi(libs/wsi) — Dependency-light native desktop window-system integration: unit-explicit geometry, generation-safe ids, typed errors/raw handles, lossless Regular events and a deterministic recording backend; native Wayland, X11, Win32 and AppKit lifecycle adapters share Event Horizon's only wait (Wayland/XCB over uring, User32/IOCP and CFRunLoop/kqueue), with immediate Wayland configure ack, a renderer native-I/O borrow, and IMM32 text input on Win32; XIM and remaining features followdocs/specs/window-system-integration/sparkles:wired(libs/wired) — Serialization: a compile-time-reflected wire format with a JSON surface (fromJSON/toJSON), used for opaque payload ingest (e.g. the twoslash node model)sparkles:ui-sdl3(libs/ui-sdl3) — SDL3 window system forsparkles:ui: window, input source, and the Vulkan surface (frame machinery fromsparkles:vulkan-wsi)sparkles:test-runner-impl(libs/test-runner-impl) — internal: the prebuilt implementation library behind thesparkles:test-runnershim
Module map
sparkles/
├── flake.nix # Nix flake (devshell, `ci` package, checks)
├── dub.sdl # Root package; declares every sub-package
├── apps/
│ ├── ci/ # `ci` helper (executable sub-package)
│ │ ├── src/app.d # Markdown example runner / verifier, link maintenance
│ │ ├── src/dub_deps.d # In-tree dependency rewriting helpers
│ │ ├── dub.sdl
│ │ └── dub.selections.json
│ ├── diagram/ # draw.io-style board on `sparkles:ui-app` (executable)
│ │ ├── src/app.d # CLI (`--config-file`) + runApp; the only untested line
│ │ ├── src/diagram_app.d # the component: view/handle/paint; heap-only via `create`
│ │ ├── src/world.d # dense entity columns, flat groups, cascading edges
│ │ ├── src/camera.d # world ⇄ screen, the zoom exponent, floor-to-−∞ rounding
│ │ ├── src/keymap.d, lantern.d # the binding table, and the guide bound to it
│ │ ├── src/grid_file.d # `--config-file`: grid JSON, fail-closed both ways
│ │ ├── src/settings.d # the pane's subject: the live GridConfig + board prefs
│ │ ├── src/settings_pane.d # the modal `PropertyTree` over it (`SET`)
│ │ └── src/systems/*.d # input.d (tools/capture/pan/zoom), render.d (op streams)
│ ├── nix-eval/ # `sparkles:nix` demo (executable)
│ │ └── src/app.d # Eval an expr/flake output, recursively render the Value
│ ├── shader-compile/ # D shaders -> SPIR-V (custom LDC) -> GLSL (spirv-cross), stamped
│ │ └── src/app.d # dub describe -> the `@compute` unit, the pipeline, the --if-stale stamp
│ ├── release/ # release automation helper (executable)
│ │ ├── src/app.d # CLI + orchestration (stats → bump → notes → stages)
│ │ ├── src/git.d # git/gh porcelain wrappers
│ │ ├── src/conventional.d # conventional-commit parsing; bump.d/stages.d policy
│ │ ├── src/agents.d # CLI LLM-agent registry (PATH-filtered)
│ │ └── src/notes.d # $EDITOR seeding / comment stripping
│ ├── terminal/ # raylib-based terminal emulator (executable)
│ │ ├── src/app.d # Window/render loop, font + PTY setup
│ │ └── src/input.d # Keyboard/mouse → libghostty-vt encoding
│ ├── terminal-benchmark/ # render-CPU benchmark harness (executable)
│ │ ├── src/app.d # scenario runner + /proc CPU sampling
│ │ └── src/bench.d # testable bench logic
│ └── ui-gallery/ # the sparkles:ui catalog (executable)
│ ├── src/app.d # CLI + runApp; --render paints one frame headless
│ ├── src/gallery.d # the component: view/handle member templates
│ ├── src/registry.d # the Page table + the catalog-wide test sweep
│ ├── src/state.d # GalleryState: every machine the shell owns
│ ├── src/kit.d, render.d # the page view vocabulary; frame → ANSI/glyphs
│ └── src/pages/*.d # one module per catalog entry
├── libs/
│ ├── base/src/sparkles/base/
│ │ ├── lifetime.d # recycledInstance / recycledErrorInstance (@nogc throwing)
│ │ ├── logger.d # CoreLogger, DeltaTimeLogger, Sparkles logging wrappers
│ │ ├── prettyprint.d # Colorized pretty-printing
│ │ ├── buffer.d # Buffer + Storage policies, checkToString/checkWriter helpers
│ │ ├── source_uri.d # OSC 8 source-URI hooks (editor links)
│ │ ├── styled_template.d # IES-based styled text processing
│ │ ├── term_caps.d # Terminal capability probing (size, tty, colors, unicode)
│ │ ├── hw_caps.d # Hardware parallelism (CPU quota/affinity, RAM, load, swap)
│ │ ├── term_style.d # Terminal styling/colors
│ │ └── text/ # @nogc text package: readers.d, writers.d, errors.d, package.d
│ ├── build-primitives/src/sparkles/build_primitives/
│ │ ├── gitignore.d # .gitignore rule parsing/matching + GitIgnoreStack (nested/ancestor scopes)
│ │ ├── dir_walk.d # DbI-hook directory walker; walkGitRepository / GitRepositoryFilter
│ │ ├── glob_walk.d # include/exclude globs over the gitignore walk (GitGlobFilter)
│ │ └── git_env.d # runGit / gitChildEnvironment: a git child never inherits GIT_DIR
│ ├── code-instrumentation/src/sparkles/code_instrumentation/
│ │ └── coverage/ # models, record scanner, formats (dmd, gcov, lcov, v8, llvm), ingest, overlay
│ ├── docs/src/sparkles/docs/ # SSG doc-site library: fragment.d, options.d, page_shell.d,
│ │ # site_tree.d, breadcrumbs.d, assets.d, source_set.d, sidebar.d
│ ├── core-cli/src/sparkles/core_cli/
│ │ ├── args.d # CLI argument parsing (@CliOption, parseCliArgs)
│ │ ├── common_dirs.d # XDG / standard directory lookup
│ │ ├── help_formatting.d # --help output formatting
│ │ ├── prompts.d # Interactive prompts (select/confirm/textInput + PromptPolicy)
│ │ ├── process_utils.d # Process execution + RSS/CPU monitoring
│ │ ├── term_unstyle.d # Strip ANSI escapes
│ │ └── key_input.d # Raw-key session helpers (the UI components moved to sparkles:ui)
│ ├── shader/src/sparkles/shaders/ # attributes.d (device symbols or stand-ins), types.d (vec2/3/4, v2/v3/v4),
│ │ # math.d (GLSL built-ins), testing.d (the tests, host-only), compute_mode.d (the `@compute` scanner)
│ ├── ui/shaders/ # effects.d: the @fragment entry points (device-only, outside sourcePaths);
│ │ └── (../generated/shaders/) # the GLSL the `gpu-effects` build derives from them — git-ignored
│ ├── versions/src/sparkles/versions/
│ ├── ui/src/sparkles/ui/ # canvas-first toolkit: geometry + style (Slot/Palette) + theme (one design language) + canvas (isCanvas!T) + widget + layout + state + display_list + interp/{immediate,cells,html}
│ │ └── components/ # box, header, table, live, tasklist, progress, meter, tree, layout, theme, osc_link, demo (moved from core-cli)
│ ├── ui-app/src/sparkles/ui_app/ # the application host: backend.d (pick) + gui_options.d/gui_setup.d (window+font CLI) + host.d/run.d (the loop) + tui_loop.d/gui_loop.d (arms) + record.d (headless target)
│ ├── twoslash/src/sparkles/twoslash/ # protocol (node model) + ingest (wired JSON) + overlay planner + render_html/render_ansi/render_widgets (sparkles:ui view) + style
│ │ ├── schemes/ # semver.d, dmd.d, calver_*.d, pypi.d, maven.d, deb.d, … + registry.d
│ │ ├── operations.d, ranges.d, parsing.d, traits.d, any.d
│ │ ├── purl.d, vers.d # pURL / VERS interop
│ │ └── testing.d # checkRoundTrip / checkRejects / checkAscending
│ ├── test-runner/src/sparkles/test_runner/ # the shim (sourceLibrary, compiled into consumers)
│ │ ├── attributes.d # @betterC / @ctfe / @wasm / @benchmark marker UDAs
│ │ ├── discovery.d # compile-time unittest discovery → Test[]
│ │ └── register.d # extendedModuleUnitTester hook + extern(C) seam
│ ├── test-runner-impl/src/sparkles/test_runner/ # prebuilt impl library (internal)
│ │ ├── runner_impl.d # extern(C) entry, CLI, mode dispatch
│ │ ├── model.d, filter.d # Test/TestResult data model; regex include/exclude
│ │ ├── execution.d, reporting.d # parallel execution; styled result rendering
│ │ ├── bench.d # benchIter/blackBox, auto-scaling measurement
│ │ ├── extract.d, driver.d # unittest-body extraction; -betterC/wasm drivers
│ │ └── ctfe_trace.d # -ftime-trace CTFE cost attribution
│ ├── test-utils/src/sparkles/test_utils/
│ │ └── diff_tools.d, tmpfs.d, string.d, package.d
│ ├── input/src/sparkles/input/ # events.d (sum-type Event + Key/Mods/Point vocabulary), tier.d (tier-0/1/2 ladder)
│ ├── math/src/sparkles/math/ # vector.d, package.d
│ ├── font/src/sparkles/font/ # face.d (open, directory), tables.d, cmap.d, names.d, glyph_names.d, errors.d; test/ fixtures + mutation corpus
│ ├── font-oracle/ # test-only: HarfBuzz differential over the bundled fonts
│ ├── raylib-text/src/sparkles/raylib_text/ # multi-face FontSet (on-demand atlas, real bold/italic) + drawGrapheme/drawSolid/drawText (shared by terminal + hue --gui)
│ ├── ghostty/src/sparkles/ghostty/
│ │ ├── c.c # ImportC shim: #include <ghostty/vt.h>
│ │ └── package.d # public import sparkles.ghostty.c
│ └── nix/src/sparkles/nix/
│ ├── c.c # ImportC shim: #include <nix_api_*.h> (whole Nix C API)
│ ├── error.d, strings.d # NixError/NixResult/NixContext/checkCall; string-sink bridge
│ ├── library.d, value.d # initNix/settings; Value handle + ValueType
│ ├── store.d, eval.d # Store/StorePath; EvalState + value extraction/construction
│ └── flake.d, session.d # flake settings/ref/lock/outputs; NixSession facade
├── docs/
│ ├── guidelines/ # Cross-cutting agent/style guides (this file lives here)
│ ├── libs/<name>/ # Per-library Diátaxis docs
│ ├── research/ # Background research notes
│ ├── specs/ # Design specs
│ └── overview.md, index.md
└── nix/
├── dub-lock.json # Nix-format lockfile shared by `ci` + examples (one
│ # registry-fetch derivation serves every consumer)
├── packages/
│ ├── android/ # The Android cross build (x86_64-linux only): SDK/NDK
│ │ # tables, raylib/tree-sitter/libghostty-vt/grammar cross
│ │ # builds, libhue.so, and the nix-native APK assembler
│ │ # (aapt2 + zipalign + apksigner; no Gradle)
│ ├── dub-builder/ # Vendored `buildDubPackage` (crane-style): normalises the
│ │ # build path and dub's mtimes so a `buildDubDeps` bundle of
│ │ # compiled dependencies transfers between derivations —
│ │ # the ~35 example builds share one closure per lib
│ ├── fonts.nix # `maple-mono` + the `sparkles-fonts` bundle (all platforms)
│ └── maple-mono/ # Maple Mono with frozen OpenType features (vendored patcher)
├── shells/android.nix # Android dev shell: adb/aapt2 + hue-emulator/-adb-install/-logcat
└── shells/default.nix # Nix dev shell