#ifndef OPEN_WING_AGENT_H
#define OPEN_WING_AGENT_H

#include "config.h"
#include "nostr_handler.h"
#include "cjson/cJSON.h"
#include "tools/tools.h"

struct trigger_manager;

int agent_init(didactyl_config_t* config);
void agent_set_trigger_manager(struct trigger_manager* trigger_manager);
void agent_on_trigger(const char* skill_d_tag,
                      const char* skill_content,
                      cJSON* triggering_event,
                      const char* relay_url);
void agent_on_message(const char* sender_pubkey_hex,
                      const char* message,
                      didactyl_sender_tier_t tier,
                      void* user_data);
int agent_build_admin_messages_json(const char* current_user_message,
                                    didactyl_sender_tier_t sender_tier,
                                    char** out_messages_json);
tools_context_t* agent_tools_context(void);
const char* agent_classify_message_part(cJSON* msg, int idx);
void agent_append_context_log(const char* sender_pubkey_hex, const char* phase, const char* context_payload);
void agent_cleanup(void);

#endif