#pragma once

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
    UI_APPROVAL_DENY = 0,
    UI_APPROVAL_ONCE = 1,
    UI_APPROVAL_ALWAYS = 2,
    UI_APPROVAL_TIMEOUT = 3,
} ui_approval_decision_t;

int ui_run_until_working(char out_mnemonic[256]);
int ui_init_runtime(void);
void ui_pump(void);

void ui_show_approval_prompt(const char *caller_pubkey_hex, int kind, const char *content, uint32_t timeout_ms);
ui_approval_decision_t ui_wait_for_approval(uint32_t timeout_ms);
void ui_show_idle(const char *npub_full, const char *mnemonic_full, const char *version_text);
void ui_add_event(const char *action, const char *caller_pubkey_hex, const char *extra);

#ifdef __cplusplus
}
#endif
