velxio/backend/app/api/routes
David Montero 0b3e165784 feat(intellisense): answer from the local sketchbook, not only the cache
The symbol server assumed one library layout: the content-addressed cache,
where an entry dir name IS its content hash. A host without that cache --
Velxio Desktop's sidecar, and any self-host -- has its libraries where
arduino-cli put them, under plain folder names with the version inside
library.properties, and got a 404 for every request. The editor there falls
back to the engine's embedded catalog, so `client.` on a library the user
installed himself resolves to nothing.

Both layouts are now sources, tried best-first. The only real difference is
mutability: `lib upgrade` rewrites a sketchbook folder in place and keeps its
name, so a scan cannot be keyed by that name. Sketchbook entries are keyed by
a cheap stat-only stamp (file count, total size, newest mtime) in the same
`<norm_name>@<norm_version>-<12 hex>` shape, which makes the disk cache exact
rather than merely long-lived. Cache entries keep their existing keys, so no
deployed scan is invalidated.

Where the sketchbook is: an explicit override, then the sketchbook env vars,
then arduino-cli itself (`config get directories.user`, probed once and
remembered) -- guessing ~/Arduino is wrong on the platforms whose default is
~/Documents/Arduino. A sketchbook that resolves to the cache is dropped: the
pro overlay points arduino-cli at a symlink to the cache root, and scanning
it twice under two shapes buys nothing.

Scans for a sketchbook are written to `<sketchbook>/.velxio-symbols/`, beside
`libraries/` and never inside it, so nothing Velxio writes shows up in
`arduino-cli lib list`.

The type index now keys on a fingerprint of the source's entry keys instead
of the entry count, which is exact for both layouts (an in-place upgrade
changes no count). Deployed indexes rebuild once, ~1s from the cached scans.
2026-08-25 00:06:10 +02:00
..
__init__.py
…
compile.py perf(compile): stop three sources of per-request stall 2026-08-20 06:14:21 +02:00
compile_chip.py
…
compile_rom.py
…
flash.py
…
intellisense.py feat(intellisense): answer from the local sketchbook, not only the cache 2026-08-25 00:06:10 +02:00
iot_gateway.py fix(gateway): keep in-browser WiFi boards reachable through the IoT gateway 2026-08-14 19:45:39 +02:00
libraries.py
…
micropython_libs.py feat(micropython): install libraries from the micropython-lib index (#214) 2026-08-18 21:50:10 +02:00
news.py feat(news): rich media in posts - inline images/GIFs + YouTube click-to-play previews 2026-08-05 16:25:08 +02:00
simulation.py feat(pi): techo de capacidad para los guests QEMU (multiusuario) 2026-07-29 21:15:04 +02:00