1# llimphi-module-selector23An "open/save" abstraction portable between the host (filesystem paths) and wawa
4(khipus by hash).
56## Why78A tawasuyu app that only knows paths (`PathBuf`) breaks on wawa, where storage is
9content-addressed (BLAKE3 + DAG) and there is no such thing as a
10"/home/user" folder. But most apps do not need to know the difference: they only
11want to ask "which item does the user want to open" or "where do I save this
12blob".
1314This crate exposes:
1516- The `Selector` trait with two methods: `list_candidates()` (to build the
17 picker's UI) and `realize(handle)` (to resolve the chosen item to bytes).
18- An opaque `ItemHandle` — the app must not inspect it, only hand it back to the
19 selector.
20- `HostSelector` with a root path and an extension filter (the real impl).
21- `WawaSelector` as a **placeholder** with the API defined — the real integration
22 with `akasha` / `wawa-kernel` happens when the suite starts running in-cage.
23 For now it exports the types and panics if invoked, which is fine: the code
24 that builds it stays compilable and apps can type against the trait.
2526## Minimal API2728```ignore29use llimphi_module_selector::{HostSelector, Selector};
3031let sel = HostSelector::new("/home/usr/docs", &[".pluma", ".khipu"]);
32let items = sel.list_candidates()?;
33// (the app shows `items.iter().map(|i| &i.display_name)` in its picker)
34// the user picks index N:
35let bytes = sel.realize(&items[N].handle)?;
36```3738---
3940Part of **llimphi** — see [llimphi](../../README.md).
README.md
llimphi-module-selector
An "open/save" abstraction portable between the host (filesystem paths) and wawa
(khipus by hash).
Why
A tawasuyu app that only knows paths (PathBuf) breaks on wawa, where storage is
content-addressed (BLAKE3 + DAG) and there is no such thing as a
"/home/user" folder. But most apps do not need to know the difference: they only
want to ask "which item does the user want to open" or "where do I save this
blob".
This crate exposes:
The Selector trait with two methods: list_candidates() (to build the
picker's UI) and realize(handle) (to resolve the chosen item to bytes).
An opaque ItemHandle — the app must not inspect it, only hand it back to the
selector.
HostSelector with a root path and an extension filter (the real impl).
WawaSelector as a placeholder with the API defined — the real integration
with akasha / wawa-kernel happens when the suite starts running in-cage.
For now it exports the types and panics if invoked, which is fine: the code
that builds it stays compilable and apps can type against the trait.
Minimal API
use llimphi_module_selector::{HostSelector, Selector};
let sel = HostSelector::new("/home/usr/docs", &[".pluma", ".khipu"]);
let items = sel.list_candidates()?;
// (the app shows `items.iter().map(|i| &i.display_name)` in its picker)
// the user picks index N:
let bytes = sel.realize(&items[N].handle)?;