@viyrockan/fedlearn-ui
v0.1.2
Published
FedLearn persistent terminal dashboard UI
Readme
@viyrockan/fedlearn-ui
Persistent terminal dashboard UI for FedLearn.
Usage
npx @viyrockan/fedlearn-uiRun once:
npx @viyrockan/fedlearn-ui --onceUse the same logical user as your app or CLI:
npx @viyrockan/fedlearn-ui --user-id check-fiveWhy the panel might not change after “a few chats”
The dashboard only reflects data that FedLearn persisted for that user: LocalAdapter.load(userId) reads sessionCount, budget, etc. Typical reasons it stays flat:
- Cursor (or any chat UI) is not wired to
LocalAdapter. Having a conversation here does not callbeginSession/learn/apply, so nothing updates. - Wrong user id. The default CLI user is
cli-dashboard(override withFEDLEARN_USER_ID). The UI defaults tofedlearn-ui-dashboardunless you pass--user-id. Use the same id everywhere you want one dashboard. - Different save location between runs. Under Node, adapters are stored in
./.fedlearn-local-adapters.jsonrelative to each process current working directory, or whereverFEDLEARN_LOCAL_STOREpoints. Run the UI and writers from the same folder, or set the sameFEDLEARN_LOCAL_STOREpath explicitly.
Minimal check (from your project folder; use the same user id as the UI):
node --input-type=module -e "
import { LocalAdapter } from \"fedlearn-core\";
const id = \"check-five\";
const adapter = await LocalAdapter.load(id);
const session = adapter.beginSession(\"smoke\");
await session.learn([{ input: \"a\", output: \"b\", loss: 0.1 }]);
await adapter.apply(await session.close());
console.log(\"sessions\", (await LocalAdapter.load(id)).snapshot().sessionCount);
"If that increments sessions, persistence and user id are correct; hook your product’s chat loop the same way.
