diff --git a/README.md b/README.md index e8baa1c..d23953d 100644 --- a/README.md +++ b/README.md @@ -55,11 +55,11 @@ Skills compose by adoption-list order (`10123`) and trigger tags carry runtime e Didactyl will support local inference, which is very privacy preserving. Remote inference does however have it's advantages, and in those cases Didactyl supports using Bitcoin Lightning and eCash inference providers. -## Current Status — v0.0.85 +## Current Status — v0.0.86 **Active build — this project is barely working. Experiment at your own risk.** -> Last release update: v0.0.85 — Skip llm_config republish on startup when config was recalled from Nostr +> Last release update: v0.0.86 — Return masked api_key field in model_get/model_set responses - Connects to configured relays with auto-reconnect and relay state transition logging - Publishes configured startup events per relay as each relay becomes connected diff --git a/src/agent.c b/src/agent.c index ec211c0..be7362b 100644 --- a/src/agent.c +++ b/src/agent.c @@ -741,8 +741,11 @@ static int handle_slash_command(const char* sender_pubkey_hex, const char* messa result_json = strdup("{\"success\":false,\"error\":\"direct tool execution failed\"}"); } - char* markdown_result = format_result_markdown_local(result_json); - const char* dm_payload = markdown_result ? markdown_result : result_json; + size_t tool_name_len = strlen(tool_name); + int send_raw_json = (tool_name_len >= 4U && strcmp(tool_name + tool_name_len - 4U, "_get") == 0); + + char* markdown_result = send_raw_json ? NULL : format_result_markdown_local(result_json); + const char* dm_payload = send_raw_json ? result_json : (markdown_result ? markdown_result : result_json); size_t log_cap = strlen(message) + strlen(result_json ? result_json : "") + strlen(dm_payload ? dm_payload : "") + 192U; char* log_payload = (char*)malloc(log_cap); diff --git a/src/main.h b/src/main.h index 3babd58..550e082 100644 --- a/src/main.h +++ b/src/main.h @@ -12,8 +12,8 @@ // Using DIDACTYL_ prefix to avoid conflicts with nostr_core_lib VERSION macros #define DIDACTYL_VERSION_MAJOR 0 #define DIDACTYL_VERSION_MINOR 0 -#define DIDACTYL_VERSION_PATCH 85 -#define DIDACTYL_VERSION "v0.0.85" +#define DIDACTYL_VERSION_PATCH 86 +#define DIDACTYL_VERSION "v0.0.86" // Agent metadata #define DIDACTYL_NAME "Didactyl" diff --git a/src/tools/tool_model.c b/src/tools/tool_model.c index c5aeaca..f06ca9f 100644 --- a/src/tools/tool_model.c +++ b/src/tools/tool_model.c @@ -147,7 +147,7 @@ char* execute_model_get(const char* args_json) { cJSON_AddStringToObject(out, "provider", cfg.provider); cJSON_AddStringToObject(out, "model", cfg.model); cJSON_AddStringToObject(out, "base_url", cfg.base_url); - cJSON_AddStringToObject(out, "api_key_masked", api_key_masked); + cJSON_AddStringToObject(out, "api_key", api_key_masked); cJSON_AddNumberToObject(out, "max_tokens", cfg.max_tokens); cJSON_AddNumberToObject(out, "temperature", cfg.temperature); @@ -220,10 +220,14 @@ char* execute_model_set(tools_context_t* ctx, const char* args_json) { cJSON* out = cJSON_CreateObject(); if (!out) return NULL; + char api_key_masked[64] = {0}; + mask_api_key_local(cfg.api_key, api_key_masked, sizeof(api_key_masked)); + cJSON_AddBoolToObject(out, "success", 1); cJSON_AddStringToObject(out, "provider", cfg.provider); cJSON_AddStringToObject(out, "model", cfg.model); cJSON_AddStringToObject(out, "base_url", cfg.base_url); + cJSON_AddStringToObject(out, "api_key", api_key_masked); cJSON_AddNumberToObject(out, "max_tokens", cfg.max_tokens); cJSON_AddNumberToObject(out, "temperature", cfg.temperature); cJSON_AddBoolToObject(out, "persisted", persisted ? 1 : 0);