Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ecb58b7e11 | ||
|
|
c3645e6af5 |
@@ -51,11 +51,11 @@ Agents learn capabilities through skills — Nostr events that any agent can di
|
||||
|
||||
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.31
|
||||
## Current Status — v0.0.33
|
||||
|
||||
**Active build — this project is barely working. Experiment at your own risk.**
|
||||
|
||||
> Last release update: v0.0.31 — Fix NIP-17 DM receive by using separate kind4/kind1059 subscriptions and 2-day lookback for gift wraps
|
||||
> Last release update: v0.0.33 — Skip self-sent NIP-17 sender-copy DMs to prevent self-reply loops
|
||||
|
||||
- Connects to configured relays with auto-reconnect and relay state transition logging
|
||||
- Publishes configured startup events per relay as each relay becomes connected
|
||||
|
||||
+6856
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -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 31
|
||||
#define DIDACTYL_VERSION "v0.0.31"
|
||||
#define DIDACTYL_VERSION_PATCH 33
|
||||
#define DIDACTYL_VERSION "v0.0.33"
|
||||
|
||||
// Agent metadata
|
||||
#define DIDACTYL_NAME "Didactyl"
|
||||
|
||||
+21
-6
@@ -628,14 +628,25 @@ static void on_event(cJSON* event, const char* relay_url, void* user_data) {
|
||||
cJSON* rumor_kind = cJSON_GetObjectItemCaseSensitive(rumor, "kind");
|
||||
cJSON* rumor_pubkey = cJSON_GetObjectItemCaseSensitive(rumor, "pubkey");
|
||||
cJSON* rumor_content = cJSON_GetObjectItemCaseSensitive(rumor, "content");
|
||||
cJSON* rumor_created_at = cJSON_GetObjectItemCaseSensitive(rumor, "created_at");
|
||||
|
||||
if (!rumor_kind || !rumor_pubkey || !rumor_content ||
|
||||
if (!rumor_kind || !rumor_pubkey || !rumor_content || !rumor_created_at ||
|
||||
!cJSON_IsNumber(rumor_kind) || !cJSON_IsString(rumor_pubkey) || !cJSON_IsString(rumor_content) ||
|
||||
!cJSON_IsNumber(rumor_created_at) ||
|
||||
!rumor_pubkey->valuestring || strlen(rumor_pubkey->valuestring) != 64U) {
|
||||
cJSON_Delete(rumor);
|
||||
return;
|
||||
}
|
||||
|
||||
time_t rumor_created_at_ts = (time_t)rumor_created_at->valuedouble;
|
||||
if (rumor_created_at_ts < g_start_time) {
|
||||
DEBUG_TRACE("[didactyl] DEBUG on_event: skipping old NIP-17 rumor created_at=%ld start=%ld",
|
||||
(long)rumor_created_at_ts,
|
||||
(long)g_start_time);
|
||||
cJSON_Delete(rumor);
|
||||
return;
|
||||
}
|
||||
|
||||
int rumor_kind_val = (int)rumor_kind->valuedouble;
|
||||
if (rumor_kind_val != 14 && rumor_kind_val != 15 && rumor_kind_val != 7) {
|
||||
DEBUG_TRACE("[didactyl] DEBUG on_event: ignoring NIP-17 rumor kind=%d", rumor_kind_val);
|
||||
@@ -670,6 +681,14 @@ static void on_event(cJSON* event, const char* relay_url, void* user_data) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(sender_pubkey_hex, g_cfg->keys.public_key_hex) == 0) {
|
||||
DEBUG_TRACE("[didactyl] DEBUG on_event: ignoring self-sent DM %.16s... via %s",
|
||||
sender_pubkey_hex,
|
||||
relay_url ? relay_url : "unknown relay");
|
||||
free(decrypted);
|
||||
return;
|
||||
}
|
||||
|
||||
didactyl_sender_tier_t tier = sender_tier_from_pubkey(sender_pubkey_hex);
|
||||
|
||||
DEBUG_TRACE("[didactyl] DEBUG on_event: sender=%.16s... tier=%d (admin=%.16s...)",
|
||||
@@ -1136,11 +1155,7 @@ int nostr_handler_subscribe_dms(dm_callback_t callback, void* user_data) {
|
||||
}
|
||||
|
||||
if (need_kind1059) {
|
||||
const time_t lookback_secs = 2 * 24 * 60 * 60;
|
||||
time_t since_1059 = g_start_time - lookback_secs;
|
||||
if (since_1059 < 0) {
|
||||
since_1059 = 0;
|
||||
}
|
||||
time_t since_1059 = g_start_time;
|
||||
|
||||
cJSON* filter1059 = cJSON_CreateObject();
|
||||
cJSON* kinds1059 = cJSON_CreateArray();
|
||||
|
||||
Reference in New Issue
Block a user