feat(app): add the Nostro app, a window for phones and desktops
Linux phones have no banking apps, and a command line is no answer on a phone. The app does everything the nostro command does and, like it, only talks to nostrod: it holds no key and no token. - Nostro.Ui, a toolkit whose screens are functions that fill a frame, ported from imsd-messages ca5cd72d; Nostro.App, the app's state, forms and screens; Nostro.Ui.Shell, which puts them on a Wayland window with Crafter.Graphics; nostro-app; and Nostro.DebugCommands for the --debug-api build. - Client: every method also in an asynchronous form for an sd-event loop, with DaemonMissing and OutcomeUnknown. - nostrod's Flatpak is net.catcrafts.Nostrod now and the app takes net.catcrafts.Nostro; install.sh moves the state. The app's Flatpak, both Flatpaks cross-built for aarch64, and the licence texts they carry. - nostro-fake-system, a made-up bus and bank with a real nostrod on them, to look at the app against. The README's screenshots are taken on it. - The nostro command: an API key's environment is the key's own to say, so --sandbox is for bunq-oauth alone, and a virtual card is listed as VIRTUAL. The published contract changes in three places, before any release (design rule 10): - Transactions' query takes `stored`: answered from what nostrod has stored, without asking the bank. The app searches with it; before, every search was a call to bunq. - AddBunq's `environment` no longer chooses over what the key says of itself: a key of the other environment is refused. - SetCardStatus refuses to freeze or unfreeze a virtual card. bunq reports one as DEACTIVATED however well it pays, and leaves it as it is when asked, without an error. The app is GPL-3.0-only, the library stays LGPL-3.0-only, and no code moved from one to the other (design rule 13). Transaction's schema is unchanged. Verified: the 17 tests pass with every line, function and region of what they link run, and the five lint runs are clean. Every screen was looked at on the made-up system, at a phone's and a desktop's sizes in the light and the dark look, on Plasma under Wayland. What is said of bunq's cards comes from its sandbox, with throwaway users, and from one real virtual card. Known to have been used against production: connecting, and reading accounts, payments and cards. Not known to have been tried: a payment from the app against bunq, OAuth against bunq, and anything on a phone. Building the app takes --graphics=, a Crafter.Graphics checkout on its branch claude/nostro-app, until that branch is merged and pinned here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
parent
1ea50c50bc
commit
5b4037955b
106 changed files with 17804 additions and 289 deletions
62
interfaces/Nostro.DebugCommands.cppm
Normal file
62
interfaces/Nostro.DebugCommands.cppm
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
export module Nostro.DebugCommands;
|
||||
|
||||
import std;
|
||||
import Crafter.Debug;
|
||||
import Nostro.Ui;
|
||||
import Nostro.Ui.Shell;
|
||||
import Nostro.App;
|
||||
|
||||
// What an agent can call, read and wait for in a build with --debug-api: the window driven by the names of what is on
|
||||
// it, what a screen says as text, and what the app is doing said as it happens. project.cpp builds this module only
|
||||
// then, so no other build has any of it, or of Crafter.Debug.
|
||||
//
|
||||
// A build with it can be driven and read by every program of the user's, and what it is told is kept in a log. It is
|
||||
// for the made-up system (`crafter-build … run fake`) and for bunq's sandbox, never for a real key: a field that hides
|
||||
// what it holds takes only a key of the sandbox's kind through here.
|
||||
|
||||
export namespace Nostro {
|
||||
// What the debugger acts on. All of it outlives the Debugger.
|
||||
struct DebugTargets {
|
||||
Ui::Shell::Loop& loop;
|
||||
Ui::Context& context;
|
||||
// Gone once it was closed while a change was under way.
|
||||
std::optional<Ui::Shell::Window>& window;
|
||||
// Nothing where the toolkit's gallery is shown in the app's place.
|
||||
App::App* app = nullptr;
|
||||
// A directory of the app's own, for a screenshot on its way to whoever asked.
|
||||
std::filesystem::path scratch;
|
||||
// Sets the look: "light", "dark", or "system" for the desktop's.
|
||||
std::function<void(std::string_view scheme)> setTheme;
|
||||
};
|
||||
|
||||
class Debugger {
|
||||
public:
|
||||
// Starts Crafter.Debug's session, and the thread pool its transport runs on, registers the commands and the
|
||||
// watches, and takes the window's and the app's hooks, after whoever had them. Throws what the session does.
|
||||
explicit Debugger(DebugTargets targets);
|
||||
// Hands the hooks back, and ends the session before the pool it runs on.
|
||||
~Debugger();
|
||||
Debugger(const Debugger&) = delete;
|
||||
Debugger& operator=(const Debugger&) = delete;
|
||||
|
||||
private:
|
||||
void Register();
|
||||
// Gives Crafter.Debug the loop's thread, and says what changed since the last time.
|
||||
void Pump();
|
||||
// The screens as they are now, to act on or to read; an error where the window is gone.
|
||||
Crafter::Debug::Result<> Ready();
|
||||
void Drawn();
|
||||
std::vector<std::byte> Capture();
|
||||
|
||||
DebugTargets targets;
|
||||
std::optional<Crafter::Debug::Session> session;
|
||||
Ui::Shell::Timer pump;
|
||||
std::function<void()> frameBefore;
|
||||
std::function<void(std::string_view, bool)> answerBefore;
|
||||
std::string screen; // as it was last said
|
||||
bool changing = false;
|
||||
};
|
||||
}
|
||||
Loading…
Reference in a new issue