diff --git a/README.md b/README.md index e2ff71c..f7403b3 100644 --- a/README.md +++ b/README.md @@ -55,11 +55,11 @@ Skills support context modes (`inject`, `full`, `override`) and per-skill LLM fa 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.67 +## Current Status — v0.0.68 **Active build — this project is barely working. Experiment at your own risk.** -> Last release update: v0.0.67 — Add agent self-context subscriptions, tools, aliases, and prompt template sections +> Last release update: v0.0.68 — Update SKILLS.md with seed determinism fields and private kind 31124 NIP-44 encrypted payload spec - 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/docs/SKILLS.md b/docs/SKILLS.md index d7dddac..8292b96 100644 --- a/docs/SKILLS.md +++ b/docs/SKILLS.md @@ -36,6 +36,7 @@ The skill event's `content` field is a JSON object that defines the complete exe "tools": false, "max_tokens": 2000, "temperature": 0.1, + "seed": 42, "template": "system:\nYou are a spelling and grammar checker.\n\nRules:\n- Fix spelling errors\n- Fix grammar errors\n- Preserve original formatting\n- Ignore: API, JSON, HTTP, nostr, pubkey, npub, nsec, NIP\n- Canadian English preferred\n- Return ONLY the corrected text, no explanations\n\nuser:\n{{message}}" }, "tags": [ @@ -58,9 +59,61 @@ The skill event's `content` field is a JSON object that defines the complete exe | `soul` | bool | `true` | Whether to include the agent's soul in context | | `max_tokens` | int | — | Override max tokens for this skill | | `temperature` | float | — | Override temperature for this skill | +| `seed` | int | — | Optional deterministic seed (effective only on providers/engines that support seeded sampling) | + +### Determinism Controls + +For reproducible outputs, set `temperature` low (typically `0`) and also set `seed` when the selected model backend supports it. If a provider ignores seeds, `temperature` still applies but deterministic replay is not guaranteed. --- +## Private Skill Encoding (`31124`) + +Private skills use NIP-44 encryption on the event `content` field. + +Rules for kind `31124`: + +- Keep `d` tag exposed so the event remains addressable/replaceable. +- Move all other skill metadata (including non-`d` tags) into the plaintext payload before encryption. +- Encrypt the full payload with NIP-44 and store the ciphertext in event `content`. +- On receive: resolve by `d`, decrypt `content`, then read both content variables and tag values from decrypted payload. + +### Private Skill Event (on relay) + +```json +{ + "kind": 31124, + "content": "", + "tags": [ + ["d", "mention-monitor"] + ] +} +``` + +### Decrypted Private Payload (application-level JSON) + +```json +{ + "content": { + "description": "Monitor mentions and DM summaries", + "context_mode": "inject", + "llm": "openai/gpt-4o-mini, fast", + "tools": ["nostr_query", "nostr_dm"], + "temperature": 0, + "seed": 42, + "template": "When {{triggering_event}} includes Bitcoin or Lightning, summarize and DM admin." + }, + "private_tags": [ + ["scope", "private"], + ["trigger", "nostr-subscription"], + ["filter", "{\"#p\":[\"\"],\"kinds\":[1]}"], + ["enabled", "true"] + ] +} +``` + +This mirrors the DM-style encrypted payload pattern (historically associated with NIP-04), but private skills should use NIP-44 ciphertext encoding. + ## Context Modes Skills control how the LLM context window is assembled using the `context_mode` field: @@ -182,7 +235,7 @@ This is the same execution model as DM-invoked skills — the only difference is ```json { - "kind": 31124, + "kind": 31123, "content": "You monitor Nostr mentions. When the triggering event mentions Bitcoin or Lightning, summarize it and DM the admin. Otherwise, ignore silently.", "tags": [ ["d", "mention-monitor"], @@ -197,7 +250,7 @@ A cron-triggered skill: ```json { - "kind": 31124, + "kind": 31123, "content": "DM the admin a short heartbeat status message with the current time.", "tags": [ ["d", "heartbeat"], diff --git a/src/main.h b/src/main.h index 15d8459..8db7d08 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 67 -#define DIDACTYL_VERSION "v0.0.67" +#define DIDACTYL_VERSION_PATCH 68 +#define DIDACTYL_VERSION "v0.0.68" // Agent metadata #define DIDACTYL_NAME "Didactyl"