From c1bf0b29560be43ee2f59f6df231478323f040a4 Mon Sep 17 00:00:00 2001 From: Didactyl User Date: Sat, 13 Jun 2026 06:56:04 -0400 Subject: [PATCH] v0.2.49 - Add startup-failure DM de-dup with marker, relay-state/needed-event diagnostics, and clear-on-READY rearm --- README.md | 4 +- context.logs/20260428T071923_req0001.json | 1 + context.logs/20260428T071923_res0001.json | 15 + context.logs/20260428T071928_req0002.json | 1 + context.logs/20260428T071928_res0002.json | 31 ++ context.logs/20260428T072036_req0003.json | 1 + context.logs/20260428T072036_res0003.json | 17 + context.logs/20260428T072050_req0001.json | 1 + context.logs/20260428T072050_res0001.json | 13 + context.logs/20260428T072113_req0001.json | 1 + context.logs/20260428T072113_res0001.json | 11 + context.logs/20260428T072117_req0002.json | 1 + context.logs/20260428T072117_res0002.json | 9 + context.logs/20260428T072221_req0003.json | 1 + context.logs/20260428T072221_res0003.json | 13 + context.logs/20260428T072235_req0001.json | 1 + context.logs/20260428T072235_res0001.json | 9 + context.logs/20260428T072238_req0002.json | 1 + context.logs/20260428T072238_res0002.json | 13 + context.logs/20260428T072342_req0003.json | 1 + context.logs/20260428T072342_res0003.json | 7 + context.logs/20260428T072356_req0001.json | 1 + context.logs/20260428T072356_res0001.json | 9 + context.logs/20260428T072358_req0002.json | 1 + context.logs/20260428T072358_res0002.json | 9 + context.logs/20260428T072501_req0003.json | 1 + context.logs/20260428T072501_res0003.json | 9 + context.logs/20260428T072515_req0001.json | 1 + context.logs/20260428T072515_res0001.json | 9 + context.logs/20260428T072518_req0002.json | 1 + context.logs/20260428T072518_res0002.json | 9 + context.logs/20260428T072621_req0003.json | 1 + context.logs/20260428T072621_res0003.json | 9 + context.logs/20260428T072636_req0001.json | 1 + context.logs/20260428T072636_res0001.json | 13 + context.logs/20260428T072640_req0002.json | 1 + context.logs/20260428T072640_res0002.json | 9 + context.logs/20260428T072743_req0003.json | 1 + context.logs/20260428T072743_res0003.json | 7 + context.logs/20260428T072756_req0001.json | 1 + context.logs/20260428T072756_res0001.json | 9 + context.logs/20260428T072759_req0002.json | 1 + context.logs/20260428T072759_res0002.json | 7 + context.logs/20260428T072815_req0003.json | 1 + context.logs/20260428T072815_res0003.json | 11 + context.logs/20260428T072855_req0001.json | 1 + context.logs/20260428T072855_res0001.json | 15 + context.logs/20260428T072900_req0002.json | 1 + context.logs/20260428T072900_res0002.json | 21 + context.logs/20260428T072935_req0003.json | 1 + context.logs/20260428T072935_res0003.json | 21 + context.logs/20260428T072949_req0001.json | 1 + context.logs/20260428T072949_res0001.json | 17 + context.logs/20260428T073009_req0001.json | 1 + context.logs/20260428T073009_res0001.json | 9 + context.logs/20260428T073013_req0002.json | 1 + context.logs/20260428T073013_res0002.json | 23 + context.logs/20260428T073119_req0003.json | 1 + context.logs/20260428T073119_res0003.json | 17 + context.logs/20260428T073133_req0001.json | 1 + context.logs/20260428T073133_res0001.json | 11 + context.logs/20260428T073347_req0001.json | 1 + context.logs/20260428T073347_res0001.json | 19 + context.logs/20260428T073359_req0001.json | 1 + context.logs/20260428T073359_res0001.json | 5 + plans/remove_dead_dm_history_helpers.md | 58 +++ plans/startup_failure_admin_dm.md | 285 ++++++++++++ src/main.c | 203 ++++++++ src/main.h | 4 +- src/nostr_handler.c | 44 ++ src/nostr_handler.h | 1 + .../results/20260428T111750Z/agent_debug.log | 1 + .../runtime_test_genesis.jsonc | 59 +++ .../results/20260428T111840Z/agent_debug.log | 1 + .../runtime_test_genesis.jsonc | 59 +++ .../results/20260428T111920Z/agent_debug.log | 434 ++++++++++++++++++ .../runtime_test_genesis.jsonc | 59 +++ .../results/20260428T112825Z/agent_debug.log | 403 ++++++++++++++++ tests/results/20260428T112825Z/results.json | 67 +++ tests/results/20260428T112825Z/results.txt | 22 + .../runtime_test_genesis.jsonc | 59 +++ .../results/20260428T112851Z/agent_debug.log | 421 +++++++++++++++++ tests/results/20260428T112851Z/results.json | 57 +++ tests/results/20260428T112851Z/results.txt | 22 + .../runtime_test_genesis.jsonc | 59 +++ .../results/20260428T113005Z/agent_debug.log | 420 +++++++++++++++++ tests/results/20260428T113005Z/results.json | 57 +++ tests/results/20260428T113005Z/results.txt | 22 + .../runtime_test_genesis.jsonc | 59 +++ .../results/20260428T113354Z/agent_debug.log | 420 +++++++++++++++++ tests/results/20260428T113354Z/results.json | 100 ++++ tests/results/20260428T113354Z/results.txt | 31 ++ .../runtime_test_genesis.jsonc | 59 +++ .../results/runtime_test_genesis_fixed.jsonc | 59 +++ 94 files changed, 3983 insertions(+), 4 deletions(-) create mode 100644 context.logs/20260428T071923_req0001.json create mode 100644 context.logs/20260428T071923_res0001.json create mode 100644 context.logs/20260428T071928_req0002.json create mode 100644 context.logs/20260428T071928_res0002.json create mode 100644 context.logs/20260428T072036_req0003.json create mode 100644 context.logs/20260428T072036_res0003.json create mode 100644 context.logs/20260428T072050_req0001.json create mode 100644 context.logs/20260428T072050_res0001.json create mode 100644 context.logs/20260428T072113_req0001.json create mode 100644 context.logs/20260428T072113_res0001.json create mode 100644 context.logs/20260428T072117_req0002.json create mode 100644 context.logs/20260428T072117_res0002.json create mode 100644 context.logs/20260428T072221_req0003.json create mode 100644 context.logs/20260428T072221_res0003.json create mode 100644 context.logs/20260428T072235_req0001.json create mode 100644 context.logs/20260428T072235_res0001.json create mode 100644 context.logs/20260428T072238_req0002.json create mode 100644 context.logs/20260428T072238_res0002.json create mode 100644 context.logs/20260428T072342_req0003.json create mode 100644 context.logs/20260428T072342_res0003.json create mode 100644 context.logs/20260428T072356_req0001.json create mode 100644 context.logs/20260428T072356_res0001.json create mode 100644 context.logs/20260428T072358_req0002.json create mode 100644 context.logs/20260428T072358_res0002.json create mode 100644 context.logs/20260428T072501_req0003.json create mode 100644 context.logs/20260428T072501_res0003.json create mode 100644 context.logs/20260428T072515_req0001.json create mode 100644 context.logs/20260428T072515_res0001.json create mode 100644 context.logs/20260428T072518_req0002.json create mode 100644 context.logs/20260428T072518_res0002.json create mode 100644 context.logs/20260428T072621_req0003.json create mode 100644 context.logs/20260428T072621_res0003.json create mode 100644 context.logs/20260428T072636_req0001.json create mode 100644 context.logs/20260428T072636_res0001.json create mode 100644 context.logs/20260428T072640_req0002.json create mode 100644 context.logs/20260428T072640_res0002.json create mode 100644 context.logs/20260428T072743_req0003.json create mode 100644 context.logs/20260428T072743_res0003.json create mode 100644 context.logs/20260428T072756_req0001.json create mode 100644 context.logs/20260428T072756_res0001.json create mode 100644 context.logs/20260428T072759_req0002.json create mode 100644 context.logs/20260428T072759_res0002.json create mode 100644 context.logs/20260428T072815_req0003.json create mode 100644 context.logs/20260428T072815_res0003.json create mode 100644 context.logs/20260428T072855_req0001.json create mode 100644 context.logs/20260428T072855_res0001.json create mode 100644 context.logs/20260428T072900_req0002.json create mode 100644 context.logs/20260428T072900_res0002.json create mode 100644 context.logs/20260428T072935_req0003.json create mode 100644 context.logs/20260428T072935_res0003.json create mode 100644 context.logs/20260428T072949_req0001.json create mode 100644 context.logs/20260428T072949_res0001.json create mode 100644 context.logs/20260428T073009_req0001.json create mode 100644 context.logs/20260428T073009_res0001.json create mode 100644 context.logs/20260428T073013_req0002.json create mode 100644 context.logs/20260428T073013_res0002.json create mode 100644 context.logs/20260428T073119_req0003.json create mode 100644 context.logs/20260428T073119_res0003.json create mode 100644 context.logs/20260428T073133_req0001.json create mode 100644 context.logs/20260428T073133_res0001.json create mode 100644 context.logs/20260428T073347_req0001.json create mode 100644 context.logs/20260428T073347_res0001.json create mode 100644 context.logs/20260428T073359_req0001.json create mode 100644 context.logs/20260428T073359_res0001.json create mode 100644 plans/remove_dead_dm_history_helpers.md create mode 100644 plans/startup_failure_admin_dm.md create mode 100644 tests/results/20260428T111750Z/agent_debug.log create mode 100644 tests/results/20260428T111750Z/runtime_test_genesis.jsonc create mode 100644 tests/results/20260428T111840Z/agent_debug.log create mode 100644 tests/results/20260428T111840Z/runtime_test_genesis.jsonc create mode 100644 tests/results/20260428T111920Z/agent_debug.log create mode 100644 tests/results/20260428T111920Z/runtime_test_genesis.jsonc create mode 100644 tests/results/20260428T112825Z/agent_debug.log create mode 100644 tests/results/20260428T112825Z/results.json create mode 100644 tests/results/20260428T112825Z/results.txt create mode 100644 tests/results/20260428T112825Z/runtime_test_genesis.jsonc create mode 100644 tests/results/20260428T112851Z/agent_debug.log create mode 100644 tests/results/20260428T112851Z/results.json create mode 100644 tests/results/20260428T112851Z/results.txt create mode 100644 tests/results/20260428T112851Z/runtime_test_genesis.jsonc create mode 100644 tests/results/20260428T113005Z/agent_debug.log create mode 100644 tests/results/20260428T113005Z/results.json create mode 100644 tests/results/20260428T113005Z/results.txt create mode 100644 tests/results/20260428T113005Z/runtime_test_genesis.jsonc create mode 100644 tests/results/20260428T113354Z/agent_debug.log create mode 100644 tests/results/20260428T113354Z/results.json create mode 100644 tests/results/20260428T113354Z/results.txt create mode 100644 tests/results/20260428T113354Z/runtime_test_genesis.jsonc create mode 100644 tests/results/runtime_test_genesis_fixed.jsonc diff --git a/README.md b/README.md index 3d2c0f0..a04baca 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,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.2.48 +## Current Status — v0.2.49 **Active build — this project is barely working. Experiment at your own risk.** -> Last release update: v0.2.48 — Remove admin kind 10123 from subscription and upsert, add debug logging +> Last release update: v0.2.49 — Add startup-failure DM de-dup with marker, relay-state/needed-event diagnostics, and clear-on-READY rearm - 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/context.logs/20260428T071923_req0001.json b/context.logs/20260428T071923_req0001.json new file mode 100644 index 0000000..5a8646e --- /dev/null +++ b/context.logs/20260428T071923_req0001.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Hello, what is your name?"},{"role":"user","content":"Hello, what is your name?","_ts":1777375163}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T071923_res0001.json b/context.logs/20260428T071923_res0001.json new file mode 100644 index 0000000..ae6f469 --- /dev/null +++ b/context.logs/20260428T071923_res0001.json @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +{"id":"gen-1777375164-jltZoEFnh01JRUoyFbYw","object":"chat.completion","created":1777375164,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"Hello! I'm a test agent built with Didactyl. I don't have a specific personal name configured, but I'm here to help you with various tasks using the tools available to me.\n\nI can help you with things like:\n- **Nostr interactions** - posting, querying events, managing profiles, sending DMs, etc.\n- **File operations** - reading and writing local files\n- **Shell commands** - executing commands in the system\n- **Skills management** - creating, editing, and running skills\n- **HTTP requests** - fetching web resources\n- **Wallet operations** - managing Cashu ecash wallets\n- **File hosting** - uploading/downloading files via Blossom\n- And more!\n\nIs there anything specific you'd like me to help you with?","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9369,"completion_tokens":178,"total_tokens":9547,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":0,"cache_write_tokens":9366,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0126005,"upstream_inference_prompt_cost":0.0117105,"upstream_inference_completions_cost":0.00089},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T071928_req0002.json b/context.logs/20260428T071928_req0002.json new file mode 100644 index 0000000..296772f --- /dev/null +++ b/context.logs/20260428T071928_req0002.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"What are you? Describe yourself briefly."},{"role":"user","content":"What are you? Describe yourself briefly.","_ts":1777375168}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T071928_res0002.json b/context.logs/20260428T071928_res0002.json new file mode 100644 index 0000000..163868c --- /dev/null +++ b/context.logs/20260428T071928_res0002.json @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{"id":"gen-1777375169-LOcgKM5Oya3Y7QIaAKTG","object":"chat.completion","created":1777375169,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"I'm **Didactyl**, a Nostr-based AI agent. Here's a brief overview of what I am:\n\n**Core Identity:**\n- An autonomous agent running on the Nostr protocol\n- Equipped with a comprehensive toolkit for interacting with Nostr, managing tasks, handling encrypted communications, and more\n- Designed to be extensible through skills and configurable through various settings\n\n**Key Capabilities:**\n- **Nostr Integration**: Post notes, send encrypted DMs (NIP-04 and NIP-17), manage block lists, handle relays, and query events\n- **Skill System**: Create, adopt, and execute skills that extend my functionality with custom behaviors and triggers\n- **Task Management**: Maintain short-term task memory on Nostr for tracking and managing work\n- **Encrypted Memory**: Store and recall encrypted agent memory and configuration\n- **LLM Configuration**: Flexible model selection and parameter tuning\n- **Ecash/Cashu**: Wallet support for privacy-preserving payments\n- **File Management**: Read/write local files and upload/download via Blossom servers\n- **HTTP Requests**: Fetch external resources\n- **Shell Execution**: Run local commands when needed\n\n**Design Philosophy:**\nI'm built to be a helpful, privacy-conscious assistant that respects decentralized principles. I can operate autonomously or collaboratively, respond to various triggers (DMs, cron jobs, webhooks, subscriptions), and maintain context across conversations through encrypted storage.\n\nIs there something specific you'd like me to help you with?","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9373,"completion_tokens":348,"total_tokens":9721,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":338,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0030687,"upstream_inference_prompt_cost":0.0013287,"upstream_inference_completions_cost":0.00174},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072036_req0003.json b/context.logs/20260428T072036_req0003.json new file mode 100644 index 0000000..c9e43c5 --- /dev/null +++ b/context.logs/20260428T072036_req0003.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072036_res0003.json b/context.logs/20260428T072036_res0003.json new file mode 100644 index 0000000..a7ff3ac --- /dev/null +++ b/context.logs/20260428T072036_res0003.json @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + +{"id":"gen-1777375237-UNuX3x5bOLRo3Yf2fhGV","object":"chat.completion","created":1777375237,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"I'm ready to help! I'm a test agent running on the Didactyl platform. I have access to a comprehensive set of tools for:\n\n- **Nostr operations**: posting, querying, reactions, DMs, profiles, relays, encryption\n- **File management**: reading and writing local files\n- **Skills**: creating, managing, and executing skills\n- **LLM configuration**: managing model settings and parameters\n- **Wallet**: Cashu ecash wallet operations\n- **Storage**: Blossom file uploads/downloads\n- **Utilities**: shell execution, HTTP requests, version info\n\nFeel free to ask me to:\n- Post to Nostr\n- Query events or profiles\n- Manage skills and tasks\n- Read/write files\n- Execute shell commands\n- Work with encrypted storage\n- Or anything else you'd like to test!\n\nWhat would you like me to do?","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9354,"completion_tokens":199,"total_tokens":9553,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":0,"cache_write_tokens":9351,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.01268675,"upstream_inference_prompt_cost":0.01169175,"upstream_inference_completions_cost":0.000995},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072050_req0001.json b/context.logs/20260428T072050_req0001.json new file mode 100644 index 0000000..e13cf3e --- /dev/null +++ b/context.logs/20260428T072050_req0001.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","_ts":1777375250}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072050_res0001.json b/context.logs/20260428T072050_res0001.json new file mode 100644 index 0000000..34c1d03 --- /dev/null +++ b/context.logs/20260428T072050_res0001.json @@ -0,0 +1,13 @@ + + + + + + + + + + + + +{"id":"gen-1777375250-jFanwsCICZFqoelE44Pq","object":"chat.completion","created":1777375250,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"I see you've sent a very long string of \"A\" characters. \n\nIs there something specific I can help you with? I'm a test agent with access to various tools for working with Nostr, file operations, HTTP requests, skills, wallets, and more.\n\nFeel free to ask me a question or request something, and I'll do my best to assist you!","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":16024,"completion_tokens":83,"total_tokens":16107,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":6992,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0100582,"upstream_inference_prompt_cost":0.0096432,"upstream_inference_completions_cost":0.000415},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072113_req0001.json b/context.logs/20260428T072113_req0001.json new file mode 100644 index 0000000..c32e208 --- /dev/null +++ b/context.logs/20260428T072113_req0001.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"After restart, say hello."},{"role":"user","content":"After restart, say hello.","_ts":1777375273}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072113_res0001.json b/context.logs/20260428T072113_res0001.json new file mode 100644 index 0000000..5bab940 --- /dev/null +++ b/context.logs/20260428T072113_res0001.json @@ -0,0 +1,11 @@ + + + + + + + + + + +{"id":"gen-1777375274-zsPFOGPaSztcq1eWkJwI","object":"chat.completion","created":1777375274,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"I understand! After the system restarts, I should say hello. \n\nHowever, I should note that I'm currently running and ready to help you. If you're planning to restart the system or agent, just let me know when it comes back up, and I'll greet you with a hello!\n\nIs there anything else you'd like me to help you with in the meantime?","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9367,"completion_tokens":84,"total_tokens":9451,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":332,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0017412,"upstream_inference_prompt_cost":0.0013212,"upstream_inference_completions_cost":0.00042},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072117_req0002.json b/context.logs/20260428T072117_req0002.json new file mode 100644 index 0000000..32dcd83 --- /dev/null +++ b/context.logs/20260428T072117_req0002.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Say hello in one sentence."},{"role":"user","content":"Say hello in one sentence.","_ts":1777375277}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072117_res0002.json b/context.logs/20260428T072117_res0002.json new file mode 100644 index 0000000..96c69c5 --- /dev/null +++ b/context.logs/20260428T072117_res0002.json @@ -0,0 +1,9 @@ + + + + + + + + +{"id":"gen-1777375278-hK1kwZuer9Lsw5MLxeTY","object":"chat.completion","created":1777375278,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"Hello! I'm a test agent ready to help you with whatever you need.","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9367,"completion_tokens":19,"total_tokens":9386,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":332,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0014162,"upstream_inference_prompt_cost":0.0013212,"upstream_inference_completions_cost":0.000095},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072221_req0003.json b/context.logs/20260428T072221_req0003.json new file mode 100644 index 0000000..b364560 --- /dev/null +++ b/context.logs/20260428T072221_req0003.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"List your blossom blobs"},{"role":"user","content":"List your blossom blobs","_ts":1777375281}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072221_res0003.json b/context.logs/20260428T072221_res0003.json new file mode 100644 index 0000000..8cb5501 --- /dev/null +++ b/context.logs/20260428T072221_res0003.json @@ -0,0 +1,13 @@ + + + + + + + + + + + + +{"id":"gen-1777375342-uCRzfhu0bf1KkFyxOXma","object":"chat.completion","created":1777375342,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"tool_calls","native_finish_reason":"tool_use","message":{"role":"assistant","content":"I'll list your Blossom blobs. First, I need to get your pubkey, then I'll need to know which Blossom server to query. Let me start by getting your pubkey:","refusal":null,"reasoning":null,"tool_calls":[{"type":"function","index":0,"id":"toolu_bdrk_01EuoCso6xsH4hg6MtqtEbwB","function":{"name":"nostr_pubkey","arguments":"{}"}}]}}],"usage":{"prompt_tokens":9369,"completion_tokens":84,"total_tokens":9453,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":334,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0017437,"upstream_inference_prompt_cost":0.0013237,"upstream_inference_completions_cost":0.00042},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072235_req0001.json b/context.logs/20260428T072235_req0001.json new file mode 100644 index 0000000..8eb576e --- /dev/null +++ b/context.logs/20260428T072235_req0001.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Check your cashu wallet balance"},{"role":"user","content":"Check your cashu wallet balance","_ts":1777375355}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072235_res0001.json b/context.logs/20260428T072235_res0001.json new file mode 100644 index 0000000..b127236 --- /dev/null +++ b/context.logs/20260428T072235_res0001.json @@ -0,0 +1,9 @@ + + + + + + + + +{"id":"gen-1777375355-ZuuW9IXNHn2xcCnAxE0y","object":"chat.completion","created":1777375355,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"tool_calls","native_finish_reason":"tool_use","message":{"role":"assistant","content":"I'll check your Cashu wallet balance for you.","refusal":null,"reasoning":null,"tool_calls":[{"type":"function","index":0,"id":"toolu_bdrk_01AjyEY1765A49f2DE6Uh3GG","function":{"name":"cashu_wallet_balance","arguments":"{}"}}]}}],"usage":{"prompt_tokens":9368,"completion_tokens":52,"total_tokens":9420,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":332,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0015822,"upstream_inference_prompt_cost":0.0013222,"upstream_inference_completions_cost":0.00026},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072238_req0002.json b/context.logs/20260428T072238_req0002.json new file mode 100644 index 0000000..00bc0d2 --- /dev/null +++ b/context.logs/20260428T072238_req0002.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Check your cashu wallet balance"},{"role":"user","content":"Check your cashu wallet balance","_ts":1777375355},{"role":"assistant","content":"I'll check your Cashu wallet balance for you.","tool_calls":[{"id":"toolu_bdrk_01AjyEY1765A49f2DE6Uh3GG","type":"function","function":{"name":"cashu_wallet_balance","arguments":"{}"}}]},{"role":"tool","tool_call_id":"toolu_bdrk_01AjyEY1765A49f2DE6Uh3GG","content":"{\"success\":true,\"total\":0,\"entries\":[],\"wallet_loaded\":false}"}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072238_res0002.json b/context.logs/20260428T072238_res0002.json new file mode 100644 index 0000000..9083ef4 --- /dev/null +++ b/context.logs/20260428T072238_res0002.json @@ -0,0 +1,13 @@ + + + + + + + + + + + + +{"id":"gen-1777375359-KpRY8FHWdC5j7tFYnf99","object":"chat.completion","created":1777375359,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"Your Cashu wallet is currently **empty** with a balance of **0**. \n\nThe wallet appears to not be loaded yet. This could mean:\n- No mints have been configured\n- No ecash tokens have been received or minted yet\n- The wallet needs to be initialized\n\nWould you like me to help you:\n1. Check wallet mint configuration?\n2. Request a mint quote to add funds?\n3. Configure a mint for your wallet?","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9450,"completion_tokens":103,"total_tokens":9553,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9364,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0015374,"upstream_inference_prompt_cost":0.0010224,"upstream_inference_completions_cost":0.000515},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072342_req0003.json b/context.logs/20260428T072342_req0003.json new file mode 100644 index 0000000..c3a4585 --- /dev/null +++ b/context.logs/20260428T072342_req0003.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"What is your public key in hex?"},{"role":"user","content":"What is your public key in hex?","_ts":1777375362}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072342_res0003.json b/context.logs/20260428T072342_res0003.json new file mode 100644 index 0000000..02ada5e --- /dev/null +++ b/context.logs/20260428T072342_res0003.json @@ -0,0 +1,7 @@ + + + + + + +{"id":"gen-1777375423-T6U7hn04dTKnjjFxe19S","object":"chat.completion","created":1777375423,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"tool_calls","native_finish_reason":"tool_use","message":{"role":"assistant","content":null,"refusal":null,"reasoning":null,"tool_calls":[{"type":"function","index":0,"id":"toolu_bdrk_01RaaLJ4ePRXjbbfg3o6LV73","function":{"name":"nostr_pubkey","arguments":"{}"}}]}}],"usage":{"prompt_tokens":9371,"completion_tokens":39,"total_tokens":9410,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":336,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0015212,"upstream_inference_prompt_cost":0.0013262,"upstream_inference_completions_cost":0.000195},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072356_req0001.json b/context.logs/20260428T072356_req0001.json new file mode 100644 index 0000000..676cbd4 --- /dev/null +++ b/context.logs/20260428T072356_req0001.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"What is your npub?"},{"role":"user","content":"What is your npub?","_ts":1777375436}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072356_res0001.json b/context.logs/20260428T072356_res0001.json new file mode 100644 index 0000000..0aeeec8 --- /dev/null +++ b/context.logs/20260428T072356_res0001.json @@ -0,0 +1,9 @@ + + + + + + + + +{"id":"gen-1777375436-giGLkkFTP46gGTSS9xMv","object":"chat.completion","created":1777375436,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"tool_calls","native_finish_reason":"tool_use","message":{"role":"assistant","content":null,"refusal":null,"reasoning":null,"tool_calls":[{"type":"function","index":0,"id":"toolu_bdrk_01Y23Q4voefWXQYThdYWU2cL","function":{"name":"my_npub","arguments":"{}"}}]}}],"usage":{"prompt_tokens":9367,"completion_tokens":38,"total_tokens":9405,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":332,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0015112,"upstream_inference_prompt_cost":0.0013212,"upstream_inference_completions_cost":0.00019},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072358_req0002.json b/context.logs/20260428T072358_req0002.json new file mode 100644 index 0000000..7ffb237 --- /dev/null +++ b/context.logs/20260428T072358_req0002.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"What is your npub?"},{"role":"user","content":"What is your npub?","_ts":1777375436},{"role":"assistant","content":null,"tool_calls":[{"id":"toolu_bdrk_01Y23Q4voefWXQYThdYWU2cL","type":"function","function":{"name":"my_npub","arguments":"{}"}}]},{"role":"tool","tool_call_id":"toolu_bdrk_01Y23Q4voefWXQYThdYWU2cL","content":"{\"success\":true,\"npub\":\"npub1r6chzymdhvd6d9dj79pfdt073zsls82zyrx86xrtpcfehr8qek7q3rkewf\",\"content\":\"npub1r6chzymdhvd6d9dj79pfdt073zsls82zyrx86xrtpcfehr8qek7q3rkewf\"}"}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072358_res0002.json b/context.logs/20260428T072358_res0002.json new file mode 100644 index 0000000..73d7fcd --- /dev/null +++ b/context.logs/20260428T072358_res0002.json @@ -0,0 +1,9 @@ + + + + + + + + +{"id":"gen-1777375439-LiTUe0VdwVXCM9os7FiY","object":"chat.completion","created":1777375439,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"My npub is: **npub1r6chzymdhvd6d9dj79pfdt073zsls82zyrx86xrtpcfehr8qek7q3rkewf**\n\nThis is my Nostr public key encoded in bech32 format. You can use this to find me on the Nostr network!","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9513,"completion_tokens":83,"total_tokens":9596,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9364,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0015004,"upstream_inference_prompt_cost":0.0010854,"upstream_inference_completions_cost":0.000415},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072501_req0003.json b/context.logs/20260428T072501_req0003.json new file mode 100644 index 0000000..5e2376b --- /dev/null +++ b/context.logs/20260428T072501_req0003.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Tell me about your identity"},{"role":"user","content":"Tell me about your identity","_ts":1777375441}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072501_res0003.json b/context.logs/20260428T072501_res0003.json new file mode 100644 index 0000000..b64acc2 --- /dev/null +++ b/context.logs/20260428T072501_res0003.json @@ -0,0 +1,9 @@ + + + + + + + + +{"id":"gen-1777375502-52pu2oVKedn2eurqBVit","object":"chat.completion","created":1777375502,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"tool_calls","native_finish_reason":"tool_use","message":{"role":"assistant","content":"I'll retrieve my identity information for you.","refusal":null,"reasoning":null,"tool_calls":[{"type":"function","index":0,"id":"toolu_bdrk_01SEn9gQoVzuKX74JfWfVckc","function":{"name":"agent_identity","arguments":"{}"}},{"type":"function","index":1,"id":"toolu_bdrk_018BxAiMzYUvQbWzDQygahVA","function":{"name":"nostr_agent_profile","arguments":"{}"}}]}}],"usage":{"prompt_tokens":9367,"completion_tokens":68,"total_tokens":9435,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":330,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0016607,"upstream_inference_prompt_cost":0.0013207,"upstream_inference_completions_cost":0.00034},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072515_req0001.json b/context.logs/20260428T072515_req0001.json new file mode 100644 index 0000000..9379c44 --- /dev/null +++ b/context.logs/20260428T072515_req0001.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"What version are you?"},{"role":"user","content":"What version are you?","_ts":1777375515}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072515_res0001.json b/context.logs/20260428T072515_res0001.json new file mode 100644 index 0000000..635d890 --- /dev/null +++ b/context.logs/20260428T072515_res0001.json @@ -0,0 +1,9 @@ + + + + + + + + +{"id":"gen-1777375516-xBn93xlI322fzADQ3nPP","object":"chat.completion","created":1777375516,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"tool_calls","native_finish_reason":"tool_use","message":{"role":"assistant","content":"I'll check the agent version for you.","refusal":null,"reasoning":null,"tool_calls":[{"type":"function","index":0,"id":"toolu_bdrk_013wKmxmgG5JTUiyGbohVjAN","function":{"name":"agent_version","arguments":"{}"}}]}}],"usage":{"prompt_tokens":9365,"completion_tokens":46,"total_tokens":9411,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":330,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0015487,"upstream_inference_prompt_cost":0.0013187,"upstream_inference_completions_cost":0.00023},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072518_req0002.json b/context.logs/20260428T072518_req0002.json new file mode 100644 index 0000000..53c2f2c --- /dev/null +++ b/context.logs/20260428T072518_req0002.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"What version are you?"},{"role":"user","content":"What version are you?","_ts":1777375515},{"role":"assistant","content":"I'll check the agent version for you.","tool_calls":[{"id":"toolu_bdrk_013wKmxmgG5JTUiyGbohVjAN","type":"function","function":{"name":"agent_version","arguments":"{}"}}]},{"role":"tool","tool_call_id":"toolu_bdrk_013wKmxmgG5JTUiyGbohVjAN","content":"{\"success\":true,\"name\":\"Didactyl\",\"description\":\"A sovereign AI agent daemon on Nostr\",\"software\":\"https://git.laantungir.net/laantungir/didactyl.git\",\"version\":\"v0.2.48\",\"version_major\":0,\"version_minor\":2,\"version_patch\":48}"}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072518_res0002.json b/context.logs/20260428T072518_res0002.json new file mode 100644 index 0000000..e72ee52 --- /dev/null +++ b/context.logs/20260428T072518_res0002.json @@ -0,0 +1,9 @@ + + + + + + + + +{"id":"gen-1777375519-JJvmXyq4ll76c2D49pEi","object":"chat.completion","created":1777375519,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"I'm **Didactyl v0.2.48**, a sovereign AI agent daemon running on Nostr. \n\nHere are the details:\n- **Name:** Didactyl\n- **Version:** v0.2.48 (Major: 0, Minor: 2, Patch: 48)\n- **Description:** A sovereign AI agent daemon on Nostr\n- **Repository:** https://git.laantungir.net/laantungir/didactyl.git\n\nIs there anything else you'd like to know?","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9497,"completion_tokens":124,"total_tokens":9621,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9362,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0016912,"upstream_inference_prompt_cost":0.0010712,"upstream_inference_completions_cost":0.00062},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072621_req0003.json b/context.logs/20260428T072621_req0003.json new file mode 100644 index 0000000..962f721 --- /dev/null +++ b/context.logs/20260428T072621_req0003.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Who is your administrator?"},{"role":"user","content":"Who is your administrator?","_ts":1777375521}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072621_res0003.json b/context.logs/20260428T072621_res0003.json new file mode 100644 index 0000000..906528f --- /dev/null +++ b/context.logs/20260428T072621_res0003.json @@ -0,0 +1,9 @@ + + + + + + + + +{"id":"gen-1777375582-HLkTRcL7ciicnO3WG706","object":"chat.completion","created":1777375582,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"tool_calls","native_finish_reason":"tool_use","message":{"role":"assistant","content":"I'll fetch information about my administrator for you.","refusal":null,"reasoning":null,"tool_calls":[{"type":"function","index":0,"id":"toolu_bdrk_018YfVsvGA6DtB9CBZH3WFbw","function":{"name":"admin_identity","arguments":"{}"}},{"type":"function","index":1,"id":"toolu_bdrk_01Q35faB3GUEqVgeXcYagANX","function":{"name":"nostr_admin_profile","arguments":"{}"}}]}}],"usage":{"prompt_tokens":9365,"completion_tokens":69,"total_tokens":9434,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":330,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0016637,"upstream_inference_prompt_cost":0.0013187,"upstream_inference_completions_cost":0.000345},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072636_req0001.json b/context.logs/20260428T072636_req0001.json new file mode 100644 index 0000000..47cef15 --- /dev/null +++ b/context.logs/20260428T072636_req0001.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Show me your current task list"},{"role":"user","content":"Show me your current task list","_ts":1777375596}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072636_res0001.json b/context.logs/20260428T072636_res0001.json new file mode 100644 index 0000000..8db5e0d --- /dev/null +++ b/context.logs/20260428T072636_res0001.json @@ -0,0 +1,13 @@ + + + + + + + + + + + + +{"id":"gen-1777375596-rVYt4DZZqybR0cri83ok","object":"chat.completion","created":1777375596,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"tool_calls","native_finish_reason":"tool_use","message":{"role":"assistant","content":"I'll fetch your current task list for you.","refusal":null,"reasoning":null,"tool_calls":[{"type":"function","index":0,"id":"toolu_bdrk_01SkQiJkNcACnKfxoaL8QUHT","function":{"name":"task_list","arguments":"{}"}}]}}],"usage":{"prompt_tokens":9367,"completion_tokens":47,"total_tokens":9414,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":332,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0015562,"upstream_inference_prompt_cost":0.0013212,"upstream_inference_completions_cost":0.000235},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072640_req0002.json b/context.logs/20260428T072640_req0002.json new file mode 100644 index 0000000..851ca19 --- /dev/null +++ b/context.logs/20260428T072640_req0002.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Show me your current task list"},{"role":"user","content":"Show me your current task list","_ts":1777375596},{"role":"assistant","content":"I'll fetch your current task list for you.","tool_calls":[{"id":"toolu_bdrk_01SkQiJkNcACnKfxoaL8QUHT","type":"function","function":{"name":"task_list","arguments":"{}"}}]},{"role":"tool","tool_call_id":"toolu_bdrk_01SkQiJkNcACnKfxoaL8QUHT","content":"{\"success\":true,\"content\":\"## Current Task List\\n\\n### Current Tasks\\n\\nYour active task list - short-term working memory for tracking plan steps.\\n\\n- [ ] No active tasks yet.\\n\",\"tasks\":[]}"}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072640_res0002.json b/context.logs/20260428T072640_res0002.json new file mode 100644 index 0000000..3fa3ff9 --- /dev/null +++ b/context.logs/20260428T072640_res0002.json @@ -0,0 +1,9 @@ + + + + + + + + +{"id":"gen-1777375600-1i2NzbywIG7vr1pbbB7L","object":"chat.completion","created":1777375600,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"Your current task list is empty! You don't have any active tasks yet.\n\nWould you like me to help you:\n- **Add a task** - I can create a new task for you\n- **View completed tasks** - Check what you've already done\n- **Set up a task** - Help you organize something you're working on\n\nJust let me know what you'd like to do, or provide the task details and I can add them for you.","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9480,"completion_tokens":100,"total_tokens":9580,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9364,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0015524,"upstream_inference_prompt_cost":0.0010524,"upstream_inference_completions_cost":0.0005},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072743_req0003.json b/context.logs/20260428T072743_req0003.json new file mode 100644 index 0000000..7f23c11 --- /dev/null +++ b/context.logs/20260428T072743_req0003.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Add a task test harness probe task then remove it"},{"role":"user","content":"Add a task test harness probe task then remove it","_ts":1777375603}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072743_res0003.json b/context.logs/20260428T072743_res0003.json new file mode 100644 index 0000000..c382661 --- /dev/null +++ b/context.logs/20260428T072743_res0003.json @@ -0,0 +1,7 @@ + + + + + + +{"id":"gen-1777375663-e99PoJts5k6BizMUmNhQ","object":"chat.completion","created":1777375663,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"tool_calls","native_finish_reason":"tool_use","message":{"role":"assistant","content":"I'll add a task and then remove it for you.","refusal":null,"reasoning":null,"tool_calls":[{"type":"function","index":0,"id":"toolu_bdrk_017Lhypkwt8Wx9eo9yQS3vmF","function":{"name":"task_manage","arguments":"{\"action\": \"add\", \"text\": \"test harness probe task\", \"status\": \"pending\"}"}}]}}],"usage":{"prompt_tokens":9377,"completion_tokens":104,"total_tokens":9481,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":342,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0018537,"upstream_inference_prompt_cost":0.0013337,"upstream_inference_completions_cost":0.00052},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072756_req0001.json b/context.logs/20260428T072756_req0001.json new file mode 100644 index 0000000..e50d241 --- /dev/null +++ b/context.logs/20260428T072756_req0001.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Save test harness probe to memory, then recall your memory"},{"role":"user","content":"Save test harness probe to memory, then recall your memory","_ts":1777375676}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072756_res0001.json b/context.logs/20260428T072756_res0001.json new file mode 100644 index 0000000..f0fa9c8 --- /dev/null +++ b/context.logs/20260428T072756_res0001.json @@ -0,0 +1,9 @@ + + + + + + + + +{"id":"gen-1777375677-0RglWxj5Ki0dNNPe4Do4","object":"chat.completion","created":1777375677,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"tool_calls","native_finish_reason":"tool_use","message":{"role":"assistant","content":"I'll save a test harness probe to memory and then recall it.","refusal":null,"reasoning":null,"tool_calls":[{"type":"function","index":0,"id":"toolu_bdrk_01GBGt8MaQjzZj4i23ij5caL","function":{"name":"memory_save","arguments":"{\"content\": \"Test harness probe - system verification checkpoint. Agent memory subsystem operational. Timestamp: current session. This entry confirms memory_save and memory_recall functions are working correctly.\"}"}}]}}],"usage":{"prompt_tokens":9380,"completion_tokens":103,"total_tokens":9483,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":344,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0018522,"upstream_inference_prompt_cost":0.0013372,"upstream_inference_completions_cost":0.000515},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072759_req0002.json b/context.logs/20260428T072759_req0002.json new file mode 100644 index 0000000..8a20c4c --- /dev/null +++ b/context.logs/20260428T072759_req0002.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Save test harness probe to memory, then recall your memory"},{"role":"user","content":"Save test harness probe to memory, then recall your memory","_ts":1777375676},{"role":"assistant","content":"I'll save a test harness probe to memory and then recall it.","tool_calls":[{"id":"toolu_bdrk_01GBGt8MaQjzZj4i23ij5caL","type":"function","function":{"name":"memory_save","arguments":"{\"content\": \"Test harness probe - system verification checkpoint. Agent memory subsystem operational. Timestamp: current session. This entry confirms memory_save and memory_recall functions are working correctly.\"}"}}]},{"role":"tool","tool_call_id":"toolu_bdrk_01GBGt8MaQjzZj4i23ij5caL","content":"{\"success\":true,\"d_tag\":\"memory\",\"kind\":30078,\"entry_length\":199,\"truncated\":false,\"event_id\":\"6311c65cf9b52fe1fe9bce8052a09f594d6b3dc1f83f8030f45106b8b3a108e2\"}"}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072759_res0002.json b/context.logs/20260428T072759_res0002.json new file mode 100644 index 0000000..3810fc7 --- /dev/null +++ b/context.logs/20260428T072759_res0002.json @@ -0,0 +1,7 @@ + + + + + + +{"id":"gen-1777375680-CxwbupX8iy37rE7N441O","object":"chat.completion","created":1777375680,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"tool_calls","native_finish_reason":"tool_use","message":{"role":"assistant","content":"Great! Now let me recall the memory:","refusal":null,"reasoning":null,"tool_calls":[{"type":"function","index":0,"id":"toolu_bdrk_01QgBARiRY5FTx8TJH3GhzU6","function":{"name":"memory_recall","arguments":"{}"}}]}}],"usage":{"prompt_tokens":9569,"completion_tokens":46,"total_tokens":9615,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9376,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0013606,"upstream_inference_prompt_cost":0.0011306,"upstream_inference_completions_cost":0.00023},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072815_req0003.json b/context.logs/20260428T072815_req0003.json new file mode 100644 index 0000000..54236cd --- /dev/null +++ b/context.logs/20260428T072815_req0003.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Save test harness probe to memory, then recall your memory"},{"role":"user","content":"Save test harness probe to memory, then recall your memory","_ts":1777375676},{"role":"assistant","content":"I'll save a test harness probe to memory and then recall it.","tool_calls":[{"id":"toolu_bdrk_01GBGt8MaQjzZj4i23ij5caL","type":"function","function":{"name":"memory_save","arguments":"{\"content\": \"Test harness probe - system verification checkpoint. Agent memory subsystem operational. Timestamp: current session. This entry confirms memory_save and memory_recall functions are working correctly.\"}"}}]},{"role":"tool","tool_call_id":"toolu_bdrk_01GBGt8MaQjzZj4i23ij5caL","content":"{\"success\":true,\"d_tag\":\"memory\",\"kind\":30078,\"entry_length\":199,\"truncated\":false,\"event_id\":\"6311c65cf9b52fe1fe9bce8052a09f594d6b3dc1f83f8030f45106b8b3a108e2\"}"},{"role":"assistant","content":"Great! Now let me recall the memory:","tool_calls":[{"id":"toolu_bdrk_01QgBARiRY5FTx8TJH3GhzU6","type":"function","function":{"name":"memory_recall","arguments":"{}"}}]},{"role":"tool","tool_call_id":"toolu_bdrk_01QgBARiRY5FTx8TJH3GhzU6","content":"{\"success\":true,\"content\":\"Test harness probe - system verification checkpoint. Agent memory subsystem operational. Timestamp: current session. This entry confirms memory_save and memory_recall functions are working correctly.\",\"content_length\":199}"}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072815_res0003.json b/context.logs/20260428T072815_res0003.json new file mode 100644 index 0000000..159d686 --- /dev/null +++ b/context.logs/20260428T072815_res0003.json @@ -0,0 +1,11 @@ + + + + + + + + + + +{"id":"gen-1777375696-JOdX4gcv02mKizye0xyb","object":"chat.completion","created":1777375696,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"Perfect! ✅ **Test harness probe successful:**\n\n**Saved to memory:**\n- Content: \"Test harness probe - system verification checkpoint. Agent memory subsystem operational. Timestamp: current session. This entry confirms memory_save and memory_recall functions are working correctly.\"\n- Event ID: `6311c65cf9b52fe1fe9bce8052a09f594d6b3dc1f83f8030f45106b8b3a108e2`\n- Kind: 30078 (encrypted agent config)\n- D-tag: \"memory\"\n\n**Recalled from memory:**\n- Successfully retrieved the exact content that was saved\n- Content length: 199 bytes\n- No truncation occurred\n\nThe memory subsystem is operational and both save/recall functions are working correctly! 🎯","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9676,"completion_tokens":188,"total_tokens":9864,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9376,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0021776,"upstream_inference_prompt_cost":0.0012376,"upstream_inference_completions_cost":0.00094},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072855_req0001.json b/context.logs/20260428T072855_req0001.json new file mode 100644 index 0000000..4cc2083 --- /dev/null +++ b/context.logs/20260428T072855_req0001.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Hello, what is your name?"},{"role":"user","content":"Hello, what is your name?","_ts":1777375735}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072855_res0001.json b/context.logs/20260428T072855_res0001.json new file mode 100644 index 0000000..98cf214 --- /dev/null +++ b/context.logs/20260428T072855_res0001.json @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +{"id":"gen-1777375736-lYPEXYI3bEyeSmVzv9zh","object":"chat.completion","created":1777375736,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"Hello! I'm a Didactyl Agent - a test agent designed to help you with various tasks. I can assist with things like:\n\n- **Nostr protocol operations** (posting, querying events, managing profiles, etc.)\n- **File operations** (reading and writing local files)\n- **Shell commands** (executing system commands)\n- **HTTP requests** (fetching web resources)\n- **Skills management** (creating, running, and managing reusable skills)\n- **Task management** (tracking and managing tasks)\n- **Wallet operations** (Cashu ecash and Lightning)\n- **File storage** (Blossom server uploads/downloads)\n- And more!\n\nI don't have a specific personal name beyond being your Didactyl Agent, but I'm here to help you with whatever you need. What can I assist you with today?","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9369,"completion_tokens":194,"total_tokens":9563,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":334,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0022937,"upstream_inference_prompt_cost":0.0013237,"upstream_inference_completions_cost":0.00097},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072900_req0002.json b/context.logs/20260428T072900_req0002.json new file mode 100644 index 0000000..01e8738 --- /dev/null +++ b/context.logs/20260428T072900_req0002.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"What are you? Describe yourself briefly."},{"role":"user","content":"What are you? Describe yourself briefly.","_ts":1777375740}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072900_res0002.json b/context.logs/20260428T072900_res0002.json new file mode 100644 index 0000000..fa8159b --- /dev/null +++ b/context.logs/20260428T072900_res0002.json @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + +{"id":"gen-1777375740-7wwdu6DnbPK2uHfm9Dhh","object":"chat.completion","created":1777375740,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"I'm **Didactyl**, a Nostr-native AI agent. Here's what I do:\n\n**Core Identity:**\n- I'm an autonomous agent running on the Nostr protocol, designed to interact with decentralized networks and handle both on-chain and off-chain tasks\n- I can publish posts, send encrypted messages, manage lists, and interact with the Nostr ecosystem\n\n**Key Capabilities:**\n- **Nostr Operations**: Post notes, send DMs, manage contacts, verify identities, and query events from relays\n- **Skills System**: I can create, adopt, and run modular skills that extend my functionality\n- **Memory & Tasks**: I maintain encrypted memory and task lists stored on Nostr for persistence\n- **Financial**: I can handle Cashu ecash wallets and payments\n- **File Management**: I can read/write local files and interact with Blossom file servers\n- **LLM Integration**: I'm powered by configurable language models and can execute complex workflows\n- **Automation**: I support triggered skills via webhooks, cron schedules, DMs, and Nostr subscriptions\n\n**How I Work:**\nI'm a test agent in this instance, ready to help you explore what I can do. I combine Nostr's decentralized messaging with AI reasoning to create a flexible, privacy-respecting automation platform.\n\nWhat would you like to do? I can help with Nostr interactions, skill management, file operations, or just about anything else you need!","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9373,"completion_tokens":333,"total_tokens":9706,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":338,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0029937,"upstream_inference_prompt_cost":0.0013287,"upstream_inference_completions_cost":0.001665},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072935_req0003.json b/context.logs/20260428T072935_req0003.json new file mode 100644 index 0000000..c9e43c5 --- /dev/null +++ b/context.logs/20260428T072935_req0003.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072935_res0003.json b/context.logs/20260428T072935_res0003.json new file mode 100644 index 0000000..6c8c477 --- /dev/null +++ b/context.logs/20260428T072935_res0003.json @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + +{"id":"gen-1777375776-aZoApJ1ae9UcNjTPlooQ","object":"chat.completion","created":1777375776,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"# Didactyl Agent\n\nHello! I'm a test agent ready to assist you. I have access to a comprehensive set of tools including:\n\n- **Nostr Protocol**: Publishing events, querying data, managing profiles, DMs, encryption, and more\n- **File Operations**: Reading and writing local files\n- **Shell Execution**: Running commands in the working directory\n- **Skills Management**: Creating, listing, adopting, and running skills\n- **HTTP Requests**: Fetching web resources\n- **LLM Configuration**: Managing model settings\n- **Task & Memory Management**: Storing and recalling agent state\n- **Cashu Wallet**: Managing ecash tokens and mints\n- **Blossom**: File upload/download to Blossom servers\n\nI'm ready to help with any requests. What would you like me to do?","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9354,"completion_tokens":188,"total_tokens":9542,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":0,"cache_write_tokens":9351,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.01263175,"upstream_inference_prompt_cost":0.01169175,"upstream_inference_completions_cost":0.00094},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T072949_req0001.json b/context.logs/20260428T072949_req0001.json new file mode 100644 index 0000000..c27cb5a --- /dev/null +++ b/context.logs/20260428T072949_req0001.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","_ts":1777375789}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T072949_res0001.json b/context.logs/20260428T072949_res0001.json new file mode 100644 index 0000000..dc65cb5 --- /dev/null +++ b/context.logs/20260428T072949_res0001.json @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + +{"id":"gen-1777375790-hGgvQ0etnXavfdB3WnzF","object":"chat.completion","created":1777375790,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"I see you've sent a very long string of the letter \"A\". \n\nI'm here to help! Could you please let me know what you'd actually like me to do? For example, I can:\n\n- Answer questions\n- Help with Nostr-related tasks (posting, querying events, managing profiles, etc.)\n- Execute shell commands\n- Read or write files\n- Manage skills and tasks\n- Work with cryptocurrency wallets (Cashu)\n- Upload/download files (Blossom)\n- And much more\n\nWhat would you like assistance with?","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":16024,"completion_tokens":128,"total_tokens":16152,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":6992,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0102832,"upstream_inference_prompt_cost":0.0096432,"upstream_inference_completions_cost":0.00064},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T073009_req0001.json b/context.logs/20260428T073009_req0001.json new file mode 100644 index 0000000..9819b1b --- /dev/null +++ b/context.logs/20260428T073009_req0001.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Hello, what is your name?"},{"role":"user","content":"Hello, what is your name?","_ts":1777375809}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T073009_res0001.json b/context.logs/20260428T073009_res0001.json new file mode 100644 index 0000000..3833ebf --- /dev/null +++ b/context.logs/20260428T073009_res0001.json @@ -0,0 +1,9 @@ + + + + + + + + +{"id":"gen-1777375810-NHr1i5tqdEPozD3NpLCF","object":"chat.completion","created":1777375810,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"Hello! I'm a test agent powered by Didactyl. I don't have a specific personal name, but you can think of me as your Didactyl assistant. I'm here to help you with various tasks using the tools and capabilities available to me, including Nostr integration, file management, skill management, and more.\n\nIs there anything I can help you with today?","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9369,"completion_tokens":84,"total_tokens":9453,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9366,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0013596,"upstream_inference_prompt_cost":0.0009396,"upstream_inference_completions_cost":0.00042},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T073013_req0002.json b/context.logs/20260428T073013_req0002.json new file mode 100644 index 0000000..00632d8 --- /dev/null +++ b/context.logs/20260428T073013_req0002.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"What are you? Describe yourself briefly."},{"role":"user","content":"What are you? Describe yourself briefly.","_ts":1777375813}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T073013_res0002.json b/context.logs/20260428T073013_res0002.json new file mode 100644 index 0000000..3244609 --- /dev/null +++ b/context.logs/20260428T073013_res0002.json @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + +{"id":"gen-1777375813-DRu7RouOiJlA3MKNwdc3","object":"chat.completion","created":1777375813,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"I'm **Didactyl**, a Nostr-based AI agent. Here's a brief description of what I am:\n\n## Core Identity\n- A decentralized autonomous agent that operates on the Nostr protocol\n- I can publish, query, and interact with Nostr events across multiple relays\n- I have my own pubkey and can act independently or on behalf of an admin user\n\n## Key Capabilities\n- **Nostr Integration**: Publish notes, long-form posts, reactions, and encrypted DMs\n- **Skill System**: I can create, adopt, and execute specialized skills (reusable AI workflows)\n- **Task Management**: Track and manage tasks stored on Nostr\n- **Memory**: I maintain encrypted agent memory for continuity across conversations\n- **LLM Integration**: I'm powered by configurable language models (currently using an OpenAI-compatible backend)\n- **Wallet & Payments**: I can manage Cashu ecash wallets and handle Lightning payments\n- **File Operations**: I can read/write files and interact with Blossom file storage servers\n- **Web Integration**: I can fetch HTTP resources and execute shell commands\n\n## How I Work\nI respond to requests and use tools when needed. I can be triggered by:\n- Direct messages (DMs)\n- Scheduled tasks (cron jobs)\n- Nostr subscriptions\n- Webhooks\n- Skill chains\n\nI'm designed to be privacy-respecting, leveraging Nostr's encryption where appropriate, and can operate autonomously or collaboratively with an admin user.\n\nWhat would you like to know more about, or how can I help you?","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9373,"completion_tokens":365,"total_tokens":9738,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9370,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.002765,"upstream_inference_prompt_cost":0.00094,"upstream_inference_completions_cost":0.001825},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T073119_req0003.json b/context.logs/20260428T073119_req0003.json new file mode 100644 index 0000000..c9e43c5 --- /dev/null +++ b/context.logs/20260428T073119_req0003.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T073119_res0003.json b/context.logs/20260428T073119_res0003.json new file mode 100644 index 0000000..4a711b9 --- /dev/null +++ b/context.logs/20260428T073119_res0003.json @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + +{"id":"gen-1777375880-ECGT0ZdA9f6YOQOw8lM9","object":"chat.completion","created":1777375880,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"I'm ready to help! I'm a Didactyl agent designed to assist you with various tasks using the available tools.\n\nI can help you with:\n\n- **Nostr Operations**: Post notes, query events, manage profiles, send DMs, handle encryption, manage lists and block lists\n- **Skill Management**: Create, edit, list, search, and run skills\n- **Local Operations**: Read/write files, execute shell commands, fetch HTTP resources\n- **Agent Configuration**: Manage LLM settings, model selection, and runtime configuration\n- **Memory & Tasks**: Store and recall agent memory, manage task lists\n- **Wallet Operations**: Check balances, mint/melt ecash, send/receive tokens\n- **File Storage**: Upload/download files via Blossom servers\n- **Relay Management**: Check relay status, fetch relay info, manage subscriptions\n\nWhat would you like me to help you with?","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9354,"completion_tokens":203,"total_tokens":9557,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9351,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0019531,"upstream_inference_prompt_cost":0.0009381,"upstream_inference_completions_cost":0.001015},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T073133_req0001.json b/context.logs/20260428T073133_req0001.json new file mode 100644 index 0000000..d922093 --- /dev/null +++ b/context.logs/20260428T073133_req0001.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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ts":1777375893}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T073133_res0001.json b/context.logs/20260428T073133_res0001.json new file mode 100644 index 0000000..30be165 --- /dev/null +++ b/context.logs/20260428T073133_res0001.json @@ -0,0 +1,11 @@ + + + + + + + + + + +{"id":"gen-1777375894-scuuv4LZNWVF29yV05L7","object":"chat.completion","created":1777375894,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"I see you've sent a very long string of the letter \"A\". \n\nI'm a test agent here to help you with requests and use tools when needed. Is there something specific I can help you with? Feel free to ask me a question or let me know what you'd like to do, and I'll do my best to assist using the available tools.","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":16024,"completion_tokens":78,"total_tokens":16102,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":16024,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0019924,"upstream_inference_prompt_cost":0.0016024,"upstream_inference_completions_cost":0.00039},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T073347_req0001.json b/context.logs/20260428T073347_req0001.json new file mode 100644 index 0000000..d46249e --- /dev/null +++ b/context.logs/20260428T073347_req0001.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Hello from smoke test"},{"role":"user","content":"Hello from smoke test","_ts":1777376027}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T073347_res0001.json b/context.logs/20260428T073347_res0001.json new file mode 100644 index 0000000..5a47625 --- /dev/null +++ b/context.logs/20260428T073347_res0001.json @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + +{"id":"gen-1777376029-xUzuqdFfKe7nM3xi1ooh","object":"chat.completion","created":1777376029,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"Hello! 👋 I'm the Didactyl test agent, and I'm ready to help. I received your message: \"Hello from smoke test\"\n\nI have access to a wide range of tools including:\n\n- **Nostr Protocol Tools** - posting, querying, DMs, profiles, relays, etc.\n- **File Operations** - reading and writing local files\n- **Shell Commands** - executing commands\n- **Skills Management** - creating, editing, and running skills\n- **HTTP Requests** - fetching web resources\n- **Cashu Wallet** - ecash operations\n- **Blossom** - file storage/retrieval\n- **Configuration & Memory** - storing and recalling agent state\n\nWhat would you like me to help you with? Feel free to ask me to:\n- Post to Nostr\n- Query events or profiles\n- Manage files\n- Run commands\n- Create or manage skills\n- Handle any other tasks you need","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9364,"completion_tokens":216,"total_tokens":9580,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":328,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0023972,"upstream_inference_prompt_cost":0.0013172,"upstream_inference_completions_cost":0.00108},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/context.logs/20260428T073359_req0001.json b/context.logs/20260428T073359_req0001.json new file mode 100644 index 0000000..1a82633 --- /dev/null +++ b/context.logs/20260428T073359_req0001.json @@ -0,0 +1 @@ +{"model":"claude-haiku-4.5","max_tokens":10000,"temperature":0.7,"messages":[{"role":"system","content":"# Didactyl Agent\n\n## Test Agent\n\nYou are a test agent. Respond to requests and use tools when needed."},{"role":"user","content":"Say hello in one sentence."},{"role":"user","content":"Say hello in one sentence.","_ts":1777376039}],"tools":[{"type":"function","function":{"name":"nostr_post","description":"Publish a Nostr event to connected relays","parameters":{"type":"object","properties":{"kind":{"type":"integer","description":"Nostr event kind number (for example 1 for note, 7 for reaction, 30023 for longform)"},"content":{"type":"string","description":"Event content/body text to publish"},"tags":{"type":"array","description":"Optional Nostr tags array, e.g. [[\"d\",\"my-skill\"],[\"t\",\"nostr\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["kind","content"]}}},{"type":"function","function":{"name":"nostr_query","description":"Query events from relays using a Nostr filter","parameters":{"type":"object","properties":{"filter":{"type":"object","description":"Nostr filter object (authors, kinds, ids, since, until, limit, and tag filters)"},"timeout_ms":{"type":"integer","description":"Optional query timeout in milliseconds"}},"required":["filter"]}}},{"type":"function","function":{"name":"local_shell_exec","description":"Execute a shell command and return stdout/stderr","parameters":{"type":"object","properties":{"command":{"type":"string","description":"Shell command to execute in the configured working directory"}},"required":["command"]}}},{"type":"function","function":{"name":"local_file_read","description":"Read a local file as text from the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to read (relative to configured working directory)"},"max_bytes":{"type":"integer","description":"Optional maximum bytes to return"}},"required":["path"]}}},{"type":"function","function":{"name":"local_file_write","description":"Write text content to a local file in the configured working directory","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Path to file to write (relative to configured working directory)"},"content":{"type":"string","description":"Text content to write"},"append":{"type":"boolean","description":"When true, append to file instead of overwriting"}},"required":["path","content"]}}},{"type":"function","function":{"name":"nostr_post_readme","description":"Publish README.md as kind 30023 with deterministic d tag readme.md","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"nostr_delete","description":"Request deletion of one or more previously published events (NIP-09 kind 5)","parameters":{"type":"object","properties":{"event_ids":{"type":"array","description":"Event IDs to request deletion for","items":{"type":"string"}},"kinds":{"type":"array","description":"Optional kinds corresponding to event_ids entries","items":{"type":"integer"}},"reason":{"type":"string","description":"Optional human-readable reason"}},"required":["event_ids"]}}},{"type":"function","function":{"name":"nostr_react","description":"React to a Nostr event with like/dislike/emoji (NIP-25 kind 7)","parameters":{"type":"object","properties":{"event_id":{"type":"string","description":"Target event ID to react to"},"event_pubkey":{"type":"string","description":"Author pubkey of target event"},"event_kind":{"type":"integer","description":"Optional kind of target event"},"reaction":{"type":"string","description":"Reaction content such as +, -, ❤️, or emoji"}},"required":["event_id","event_pubkey"]}}},{"type":"function","function":{"name":"nostr_profile_get","description":"Look up a Nostr profile (kind 0 metadata) by pubkey","parameters":{"type":"object","properties":{"pubkey":{"type":"string","description":"Hex pubkey of the profile to fetch"}},"required":["pubkey"]}}},{"type":"function","function":{"name":"nostr_relay_status","description":"Get connection status and statistics for all relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_nip05_lookup","description":"Look up or verify a NIP-05 identifier (user@domain)","parameters":{"type":"object","properties":{"identifier":{"type":"string","description":"NIP-05 identifier in the form user@domain"},"pubkey":{"type":"string","description":"Optional expected pubkey to verify against lookup result"}},"required":["identifier"]}}},{"type":"function","function":{"name":"nostr_encode","description":"Encode a Nostr entity into nostr: URI (npub, note, nprofile, nevent, naddr)","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Encoding target: npub, note, nprofile, nevent, or naddr"},"hex":{"type":"string","description":"Hex pubkey or event id to encode"},"relays":{"type":"array","description":"Optional relay URLs included in nprofile/nevent/naddr encodings","items":{"type":"string"}},"kind":{"type":"integer","description":"Required for naddr: replaceable event kind"},"identifier":{"type":"string","description":"Required for naddr: replaceable event identifier (d tag)"}},"required":["type","hex"]}}},{"type":"function","function":{"name":"nostr_decode","description":"Decode a Nostr bech32/nostr: URI into components","parameters":{"type":"object","properties":{"uri":{"type":"string","description":"nostr: URI or bech32 value to decode"}},"required":["uri"]}}},{"type":"function","function":{"name":"nostr_dm_send","description":"Send a NIP-04 encrypted DM","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Plaintext message to encrypt and send"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_relay_info","description":"Fetch NIP-11 relay information document","parameters":{"type":"object","properties":{"relay_url":{"type":"string","description":"Relay websocket URL (ws:// or wss://)"}},"required":["relay_url"]}}},{"type":"function","function":{"name":"nostr_subscription_status","description":"List currently managed runtime Nostr subscriptions and filters","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_subscription_set","description":"Update one managed runtime subscription by name (toggle enabled and/or replace filter)","parameters":{"type":"object","properties":{"name":{"type":"string","description":"Subscription name (e.g. admin_context_profile, agent_context_notes, dms_kind4)"},"enabled":{"type":"boolean","description":"Optional: enable or disable this subscription"},"filter":{"type":"object","description":"Optional: replacement Nostr filter object"}},"required":["name"]}}},{"type":"function","function":{"name":"nostr_encrypt","description":"Encrypt plaintext using NIP-44 for a recipient","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"plaintext":{"type":"string","description":"Plaintext to encrypt with NIP-44"}},"required":["recipient_pubkey","plaintext"]}}},{"type":"function","function":{"name":"nostr_decrypt","description":"Decrypt NIP-44 ciphertext from a sender","parameters":{"type":"object","properties":{"sender_pubkey":{"type":"string","description":"Sender pubkey in hex"},"ciphertext":{"type":"string","description":"NIP-44 ciphertext payload to decrypt"}},"required":["sender_pubkey","ciphertext"]}}},{"type":"function","function":{"name":"nostr_dm_send_nip17","description":"Send a private DM using NIP-17 gift wrap protocol","parameters":{"type":"object","properties":{"recipient_pubkey":{"type":"string","description":"Recipient pubkey in hex"},"message":{"type":"string","description":"Message body to send in gift-wrap DM"},"subject":{"type":"string","description":"Optional subject label for the message"}},"required":["recipient_pubkey","message"]}}},{"type":"function","function":{"name":"nostr_list_manage","description":"Add/remove tag tuples in replaceable list events (NIP-51 style)","parameters":{"type":"object","properties":{"list_kind":{"type":"integer","description":"Replaceable list kind to edit (for example 10000 mute, 10001 pin, 10002 relay list)"},"action":{"type":"string","description":"Operation to perform: add or remove"},"items":{"type":"array","description":"Tag tuples to add/remove, e.g. [[\"p\",\"\"],[\"e\",\"\"]]","items":{"type":"array","items":{"type":"string"}}}},"required":["list_kind","action","items"]}}},{"type":"function","function":{"name":"nostr_block_list","description":"View blocked pubkeys, event IDs, or hashtags from the local encrypted kind-10000 block list cache","parameters":{"type":"object","properties":{"type":{"type":"string","description":"Optional filter: all, p, e, or t (default all)"}}}}},{"type":"function","function":{"name":"nostr_block_edit","description":"Add or remove blocked tuples in kind-10000 block list; entries are private (encrypted) by default","parameters":{"type":"object","properties":{"action":{"type":"string","description":"add or remove"},"items":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Tag tuples like [[\"e\",\"\"],[\"p\",\"\"],[\"t\",\"spam\"]]"},"public":{"type":"boolean","description":"Optional, default false; when true add to public tags instead of encrypted private content"}},"required":["action","items"]}}},{"type":"function","function":{"name":"agent_version","description":"Return current Didactyl version and metadata from build macros","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"local_http_fetch","description":"Fetch HTTP(S) resources with optional method, headers, timeout, and body","parameters":{"type":"object","properties":{"url":{"type":"string","description":"HTTP(S) URL to request"},"method":{"type":"string","description":"Optional method such as GET, POST, PUT, PATCH, or DELETE (default GET)"},"headers":{"type":"array","description":"Optional headers as [\"Name: value\", ...]","items":{"type":"string"}},"body":{"type":"string","description":"Optional request body for non-GET methods"},"timeout_seconds":{"type":"integer","description":"Optional timeout in seconds"},"max_bytes":{"type":"integer","description":"Optional maximum response bytes to capture"}},"required":["url"]}}},{"type":"function","function":{"name":"skill_create","description":"Create or update a skill definition as kind 31123/31124 and optionally auto-adopt it. Write content as markdown context instructions (no role markers). The runtime owns role packaging and document H1, and will bump skill headings down one level, so prefer ## for top-level sections in skill content. For auto-run behavior, set trigger + filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Markdown template for the skill body. Use plain markdown headings/lists/code fences and template variables like {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, or {{skill_d_tag}} references. Do not author system/user/assistant role markers in skill content; runtime appends trigger payloads as user input and handles role packaging. Runtime prepends document title and bumps headings one level."},"scope":{"type":"string"},"description":{"type":"string"},"auto_adopt":{"type":"boolean"},"trigger":{"type":"string","description":"Optional auto-run trigger. Must be one of: dm, cron, nostr-subscription, webhook, chain. If provided, filter is also required."},"filter":{"type":"string","description":"Trigger-specific filter string. Required when trigger is provided. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d","content"]}}},{"type":"function","function":{"name":"skill_list","description":"List available skills discovered online (agent + admin), with adoption status and optional filters","parameters":{"type":"object","properties":{"scope":{"type":"string"},"adopted":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_get","description":"Get full skill JSON by d tag from local cache; JSON: {\"d\":\"identity_and_rules\"} (slash shorthand also works: /skill_get identity_and_rules)","parameters":{"type":"object","properties":{"d":{"type":"string","description":"Skill d tag (preferred JSON key)"},"input":{"type":"string","description":"Slash shorthand fallback key when args are passed as plain text"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_view","description":"Compatibility alias for skill_get; JSON: {\"d\":\"identity_and_rules\"}","parameters":{"type":"object","properties":{"d":{"type":"string"},"input":{"type":"string"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_set","description":"Set/publish a full skill JSON payload and refresh runtime cache; JSON: {\"skill\":{\"d\":\"identity_and_rules\",\"kind\":31124,\"scope\":\"private\",\"content\":\"...\",\"tags\":[[\"d\",\"identity_and_rules\"],[\"app\",\"didactyl\"],[\"scope\",\"private\"]]}}","parameters":{"type":"object","properties":{"skill":{"type":"object","description":"Full skill object from skill_get output content"},"input":{"type":"string","description":"Raw JSON string for slash shorthand or manual paste"}}}}},{"type":"function","function":{"name":"skill_adopt","description":"Adopt a skill by adding its address to kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["pubkey","d"]}}},{"type":"function","function":{"name":"skill_remove","description":"Remove a skill address from kind 10123 adoption list","parameters":{"type":"object","properties":{"pubkey":{"type":"string"},"d":{"type":"string"},"kind":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_edit","description":"Edit an existing self skill by d tag and republish it as kind 31123/31124. Keep skill content markdown-first (no role markers). Runtime owns role packaging, owns H1, and bumps skill headings down one level. For triggered skills, update trigger and filter together.","parameters":{"type":"object","properties":{"d":{"type":"string"},"content":{"type":"string","description":"Replacement markdown template for this skill. Use markdown structure and template variables such as {{message}}, {{dm_history}}, {{agent_identity}}, {{admin_profile}}, and {{skill_d_tag}} references. Do not include authored system/user/assistant role markers; runtime handles role packaging and user payload injection. If omitted, existing content is retained."},"scope":{"type":"string"},"description":{"type":"string"},"trigger":{"type":"string","description":"Optional trigger update. Valid values: dm, cron, nostr-subscription, webhook, chain. Must be paired with filter update when changing trigger config."},"filter":{"type":"string","description":"Trigger-specific filter update. Use with trigger. Examples: dm=>{\"from\":\"admin\"}, cron=>\"0 12 * * *\", chain=>\"source_d_tag\", webhook=>\"{}\", nostr-subscription=>JSON filter."},"action":{"type":"string"},"enabled":{"type":"boolean"},"llm":{"type":"string","description":"Model to use when this trigger fires (e.g. 'gpt-4o-mini'); overrides the agent default model for this triggered skill execution only."},"tools":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"seed":{"type":"integer"}},"required":["d"]}}},{"type":"function","function":{"name":"skill_refresh","description":"Invalidate adopted skills cache so next context build reloads latest skill events from cache/relays","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"skill_search","description":"Search public skills by query/author and optionally rank by adoption popularity","parameters":{"type":"object","properties":{"query":{"type":"string"},"pubkey":{"type":"string"},"popular":{"type":"boolean"}}}}},{"type":"function","function":{"name":"skill_run","description":"Execute a skill one-shot in an isolated context with optional sandboxing. Use d_tag for own skills or pubkey+d_tag for external skills.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"},"args":{"type":"string","description":"Arguments/context to pass to the skill"},"input":{"type":"string","description":"Slash shorthand fallback for args"},"sandbox":{"type":"boolean","description":"Override sandbox behavior (default on for external skills)"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"skill_load","description":"Load a skill's instructions into the current conversation context.","parameters":{"type":"object","properties":{"d_tag":{"type":"string","description":"Skill d tag identifier"},"d":{"type":"string","description":"Compatibility alias for d_tag"},"pubkey":{"type":"string","description":"Optional author pubkey for external skills"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"trigger_list","description":"List active triggered skills and their runtime status","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_file_md_to_longform_post","description":"Read a markdown file and publish it as kind 30023 longform post; defaults d-tag to lowercase filename","parameters":{"type":"object","properties":{"file":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"summary":{"type":"string"}},"required":["file"]}}},{"type":"function","function":{"name":"tool_list","description":"List available tools with name, description, and JSON parameter schema","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_get","description":"Get current active LLM runtime configuration (excluding API key)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"model_set","description":"Update active LLM configuration and persist it to Nostr kind 30078 (d=llm_config)","parameters":{"type":"object","properties":{"provider":{"type":"string"},"api_key":{"type":"string"},"model":{"type":"string"},"base_url":{"type":"string"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}}}},{"type":"function","function":{"name":"model_list","description":"List available model IDs using provider OpenAI-compatible /models endpoint","parameters":{"type":"object","properties":{"base_url":{"type":"string"}}}}},{"type":"function","function":{"name":"nostr_pubkey","description":"Return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_npub","description":"Return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_pubkey","description":"Alias for nostr_pubkey: return this agent's pubkey in hex format","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_npub","description":"Alias for nostr_npub: return this agent's pubkey encoded as npub bech32","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"admin_identity","description":"Build admin identity context block from cached runtime metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_profile","description":"Build admin profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_contacts","description":"Build admin contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_relays","description":"Build admin relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_admin_notes","description":"Build admin notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_profile","description":"Build agent profile context block from cached kind 0 metadata","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_contacts","description":"Build agent contacts context block from cached kind 3 contact list","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_relays","description":"Build agent relay context block from cached kind 10002 data","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_agent_notes","description":"Build agent notes context block from cached kind 1 notes","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_kind0_profile","description":"Alias for nostr_agent_profile: return this agent's kind 0 profile context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_contacts","description":"Alias for nostr_agent_contacts: return this agent's kind 3 contacts context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_relays","description":"Alias for nostr_agent_relays: return this agent's kind 10002 relay context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"my_notes","description":"Alias for nostr_agent_notes: return this agent's recent kind 1 notes context","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_list","description":"Build current task list context block from agent task memory on Nostr","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"nostr_dm_history","description":"Fetch recent DM history for template/context usage; JSON: {\"limit\":12,\"include_current\":false,\"format\":\"json\"} or with explicit peer {\"peer_pubkey\":\"\",\"limit\":20,\"format\":\"text\"}; template usage: {{nostr_dm_history({\"limit\":12,\"format\":\"text\"})}}","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Max message turns to return (1-200, default 12)"},"include_current":{"type":"boolean","description":"When true, keep a trailing user message that matches the current live message"},"peer_pubkey":{"type":"string","description":"Optional peer pubkey hex (defaults to configured admin pubkey)"},"format":{"type":"string","description":"Output format: 'json' (default) or 'text' (User:/Assistant: lines)"}}}}},{"type":"function","function":{"name":"agent_identity","description":"Build agent identity context block with pubkey and npub","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"task_manage","description":"Manage agent short-term task memory stored on Nostr kind 30078 (d=tasks): list/add/update/remove/clear/replace","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["list","add","update","remove","clear","replace"]},"text":{"type":"string"},"id":{"type":"integer"},"status":{"type":"string","enum":["pending","active","done"]},"tasks":{"type":"array","items":{"type":"string"}}},"required":["action"]}}},{"type":"function","function":{"name":"memory_save","description":"Prepend a new entry to encrypted agent memory (kind 30078, d=memory) and truncate oldest content if needed","parameters":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}},{"type":"function","function":{"name":"memory_recall","description":"Recall encrypted agent memory (kind 30078, d=memory)","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"config_store","description":"Encrypt and publish agent config as kind 30078 for a given d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"},"content":{"description":"Arbitrary JSON value or string to encrypt and store"}},"required":["d_tag","content"]}}},{"type":"function","function":{"name":"config_recall","description":"Fetch and decrypt agent config kind 30078 by d_tag","parameters":{"type":"object","properties":{"d_tag":{"type":"string"}},"required":["d_tag"]}}},{"type":"function","function":{"name":"nostr_my_events","description":"Query recent events authored by this agent and return kind, event_id, timestamp, d_tag, and cache presence","parameters":{"type":"object","properties":{"limit":{"type":"integer","description":"Maximum number of authored events to query (1-2000, default 200)"},"kind":{"type":"integer","description":"Optional specific kind to query; omit for all kinds"},"timeout_ms":{"type":"integer","description":"Query timeout in milliseconds (1000-60000, default 8000)"}}}}},{"type":"function","function":{"name":"cashu_wallet_balance","description":"Return current wallet balances aggregated by mint and unit","parameters":{"type":"object","properties":{}}}},{"type":"function","function":{"name":"cashu_wallet_info","description":"Fetch mint info for a specific mint_url or the default configured mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"}}}}},{"type":"function","function":{"name":"cashu_wallet_mint_quote","description":"Request a mint quote for a target amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Amount to mint in the selected unit"},"mint_url":{"type":"string","description":"Optional mint base URL; uses configured default when omitted"},"unit":{"type":"string","description":"Optional unit, e.g. sat"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_check","description":"Check a previously requested mint quote status","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_mint_claim","description":"Claim minted proofs for a paid quote_id and add them to wallet state","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"},"amount":{"type":"integer","description":"Optional target amount; if omitted wallet attempts best-effort claim"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_quote","description":"Request a melt quote for a Lightning payment request","parameters":{"type":"object","properties":{"payment_request":{"type":"string"},"mint_url":{"type":"string"},"unit":{"type":"string"}},"required":["payment_request"]}}},{"type":"function","function":{"name":"cashu_wallet_melt_pay","description":"Pay a previously quoted melt by quote_id","parameters":{"type":"object","properties":{"quote_id":{"type":"string"},"mint_url":{"type":"string"}},"required":["quote_id"]}}},{"type":"function","function":{"name":"cashu_wallet_check_proofs","description":"Check current wallet proofs state against mint","parameters":{"type":"object","properties":{"mint_url":{"type":"string"}}}}},{"type":"function","function":{"name":"cashu_wallet_receive_token","description":"Receive an ecash token string (cashuA/cashuB), swap to fresh proofs, and store it in wallet state","parameters":{"type":"object","properties":{"token":{"type":"string","description":"Incoming token string beginning with cashuA or cashuB"},"mint_url":{"type":"string","description":"Optional mint URL override; when provided must match token mint"}},"required":["token"]}}},{"type":"function","function":{"name":"cashu_wallet_send_token","description":"Create an outbound ecash token from wallet proofs for an exact amount","parameters":{"type":"object","properties":{"amount":{"type":"integer","description":"Exact amount to send as ecash token"},"mint_url":{"type":"string","description":"Optional mint URL; defaults to configured wallet mint when omitted"},"format":{"type":"string","description":"Optional token format: cashuA or cashuB (default cashuB)"}},"required":["amount"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_set","description":"Set wallet mints (NIP-60), public mints (NIP-61), or both","parameters":{"type":"object","properties":{"target":{"type":"string","description":"Where to apply mint updates: wallet, public, or both"},"wallet_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for wallet event update"},"public_mints":{"type":"array","items":{"type":"string"},"description":"Mint URLs for public nutzap info update"}},"required":["target"]}}},{"type":"function","function":{"name":"cashu_wallet_mints_get","description":"Get currently configured wallet and public mints","parameters":{"type":"object","properties":{},"required":[]}}},{"type":"function","function":{"name":"blossom_upload","description":"Upload a local file to a Blossom server","parameters":{"type":"object","properties":{"server":{"type":"string"},"file_path":{"type":"string"},"content_type":{"type":"string"}},"required":["server","file_path"]}}},{"type":"function","function":{"name":"blossom_download","description":"Download a blob from Blossom to a local file","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"},"output_path":{"type":"string"},"overwrite":{"type":"boolean"}},"required":["server","sha256","output_path"]}}},{"type":"function","function":{"name":"blossom_head","description":"Fetch blob metadata from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_delete","description":"Delete a blob from Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"sha256":{"type":"string"}},"required":["server","sha256"]}}},{"type":"function","function":{"name":"blossom_list","description":"List blobs for a pubkey on Blossom","parameters":{"type":"object","properties":{"server":{"type":"string"},"pubkey":{"type":"string"}},"required":["server"]}}}],"tool_choice":"auto"} \ No newline at end of file diff --git a/context.logs/20260428T073359_res0001.json b/context.logs/20260428T073359_res0001.json new file mode 100644 index 0000000..a76b7db --- /dev/null +++ b/context.logs/20260428T073359_res0001.json @@ -0,0 +1,5 @@ + + + + +{"id":"gen-1777376040-qkXhEUESTodU6M3rpqhw","object":"chat.completion","created":1777376040,"model":"anthropic/claude-4.5-haiku-20251001","provider":"Amazon Bedrock","system_fingerprint":null,"choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"end_turn","message":{"role":"assistant","content":"Hello! I'm ready to help you with any requests you might have.","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":9367,"completion_tokens":18,"total_tokens":9385,"cost":0,"is_byok":true,"prompt_tokens_details":{"cached_tokens":9032,"cache_write_tokens":332,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0014112,"upstream_inference_prompt_cost":0.0013212,"upstream_inference_completions_cost":0.00009},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}} \ No newline at end of file diff --git a/plans/remove_dead_dm_history_helpers.md b/plans/remove_dead_dm_history_helpers.md new file mode 100644 index 0000000..35e5865 --- /dev/null +++ b/plans/remove_dead_dm_history_helpers.md @@ -0,0 +1,58 @@ +# Remove Dead DM-History Helper Functions in `agent.c` + +## Background + +While investigating how Didactyl maintains continuity across a DM "chat session", two functions in [`src/agent.c`](../src/agent.c) were found to be compiled-but-unreferenced, marked with `__attribute__((unused))` to suppress compiler warnings: + +- [`append_recent_admin_dm_history`](../src/agent.c:1065) +- [`build_recent_admin_dm_history_messages`](../src/agent.c:1800) (wraps the above) + +These were part of an older design where the agent automatically injected the last N admin DM turns into every LLM call. The current architecture is **skill-driven**: DM history only reaches the LLM when an adopted, triggered skill explicitly pulls it in via the `{{dm_history}}` / `{{nostr_dm_history(...)}}` template variables or the `nostr_dm_history` tool (see [`tool_agent.c`](../src/tools/tool_agent.c:284) and [`tools_schema.c`](../src/tools/tools_schema.c:1606)). The dead functions are now a source of confusion for anyone reading the code to understand chat-session behavior. + +## Goal + +Remove the dead functions and any symbols used exclusively by them, without changing runtime behavior. + +## Scope Analysis (verified before planning) + +A repo-wide search for each symbol confirmed the following: + +| Symbol | Only callers | Disposition | +|---|---|---| +| [`append_recent_admin_dm_history`](../src/agent.c:1065) | called by `build_recent_admin_dm_history_messages` (also dead) | **delete** | +| [`build_recent_admin_dm_history_messages`](../src/agent.c:1800) | no callers | **delete** | +| [`AGENT_HISTORY_TURNS`](../src/agent.c:38) | referenced only inside the dead `append_recent_admin_dm_history` | **delete** | +| [`AGENT_HISTORY_QUERY_LIMIT`](../src/agent.c:39) | defined but zero references repo-wide | **delete** | +| [`append_simple_message`](../src/agent.c:187) | many live callers throughout `agent.c` | **keep** | +| [`nostr_handler_get_dm_history_json`](../src/nostr_handler.c:4384) | live via [`tool_agent.c`](../src/tools/tool_agent.c:318) | **keep** | + +No non-source references (Makefile, tests, docs) depend on these symbols. + +## Risks + +Very low. Both functions carry `__attribute__((unused))` so they are not linked into any runtime path. The only failure modes are accidental deletion of something still live, which the scope analysis above rules out. + +## Verification Strategy + +1. Clean build with `make` — must succeed with no new warnings. +2. Existing tests under [`tests/`](../tests/) pass (`python tests/run_tests.py` or the project's usual invocation). +3. Manual sanity check: start an agent, send a DM, confirm normal reply — no regression, since the deleted code was never on the hot path. + +## Mermaid: before/after + +```mermaid +flowchart LR + subgraph Before + A1[agent.c dead funcs] -. unused attr .- B1[compiler silences warning] + A1 --> C1[reader assumes auto DM history replay] + C1 --> D1[confusion about session behavior] + end + subgraph After + A2[agent.c clean] --> E2[skill-driven history only] + E2 --> F2[intent matches code] + end +``` + +## Follow-on (out of scope for this change) + +The documentation in [`docs/CONTEXT.md`](../docs/CONTEXT.md) already describes the skill-driven assembly model correctly, but neither that file nor [`docs/SKILLS.md`](../docs/SKILLS.md) explicitly states "DM history is not automatic — it only appears when a skill references it." A brief clarifying paragraph could be added in a separate change. diff --git a/plans/startup_failure_admin_dm.md b/plans/startup_failure_admin_dm.md new file mode 100644 index 0000000..34d708e --- /dev/null +++ b/plans/startup_failure_admin_dm.md @@ -0,0 +1,285 @@ +# Startup Failure Admin DM Notification + +> **STATUS UPDATE (follow-up phase):** The base feature (send a failure DM) is +> implemented and verified on VM410. However, because the failure happens inside the +> systemd `Restart=on-failure` loop (`RestartSec=10`), the admin now receives a *new* +> failure DM roughly every ~25 seconds, indefinitely (observed in the live message box). +> This follow-up adds **throttling/de-duplication** so the failure DM is sent **once per +> failure type until the next successful startup**, and makes the message **more +> descriptive** (per-relay connect state + the event kinds that were needed). +> See the "Follow-up: Throttling + Descriptive Failure DM" section at the end. + +# Startup Failure Admin DM Notification (original plan) + +## Goal + +When the agent fails to start, send a best-effort encrypted DM to the administrator +describing which startup step failed and why, so the operator learns about the failure +without having to SSH in and read `journalctl`. + +This directly addresses the real-world incident on VM410 where both `didactyl.service` +and `simon.service` were stuck restart-looping at startup step 14 +(`Subscribe self-skill cache: failed (no skill events found after EOSE)`) and silently +stopped answering DMs. + +## Background / Code References + +- Startup is a linear checklist in [`main()`](src/main.c:1012). Each step uses helpers: + - [`startup_step_begin()`](src/main.c:303) + - [`startup_step_ok()`](src/main.c:309) + - [`startup_step_fail()`](src/main.c:320) +- On any fatal failure, the current pattern is: + `startup_step_fail(...)` -> `fprintf(stderr, ...)` -> cleanup calls -> `return 1;` + (e.g. the step-14 self-skill abort at [`src/main.c:1520`](src/main.c:1520)). +- The success path already sends an admin "started up" DM at + [`src/main.c:1663`](src/main.c:1663) via + [`nostr_handler_send_dm_auto()`](src/nostr_handler.c:3264). +- DM delivery requires (see [`nostr_handler_send_dm_with_role()`](src/nostr_handler.c:3133)): + - `g_cfg` and `g_pool` set (relay pool initialized), + - at least one **connected** relay (otherwise the kind-4 event is dropped: + "kind 4 event not queued: no connected relays" at [`src/nostr_handler.c:3203`](src/nostr_handler.c:3203)), + - a valid `cfg.admin.pubkey` (validated at step 4, [`src/main.c:1310`](src/main.c:1310)), + - the private key derived (always done before the checklist). + +### Delivery-window reality + +A failure DM is only *deliverable* from roughly step 11 onward (relay pool created + +relays connected + admin known). The step-14 failure we actually hit is inside that +window, so it will be delivered. Earlier failures (bad nsec, missing admin, LLM config, +no relay connection) have no working channel; per decision, those are **logged only** +(best-effort, no blocking retries). + +## Design Decision (confirmed) + +**Best-effort only.** Attempt the failure DM whenever relays + admin are available; if +the relay pool isn't connected or admin pubkey is unknown, skip the DM and rely on +existing stderr/journal logging. No blocking retry loop, no self-healing of the +underlying failure (that can be a separate plan). + +## Approach + +Add a single helper that builds and sends the failure DM, then call it from every fatal +startup-abort site (the points that currently do `startup_step_fail(...) ... return 1;`). + +### 1. New helper in [`src/main.c`](src/main.c) + +Add a static function near the other startup helpers (after +[`startup_step_fail()`](src/main.c:320)): + +```c +static void notify_admin_startup_failure(const didactyl_config_t* cfg, + int step, + const char* label, + const char* detail); +``` + +Behavior: +- Guard clauses (skip + DEBUG_WARN if any precondition is missing): + - `cfg == NULL` or `cfg->admin.pubkey[0] == '\0'` -> log "admin unknown; cannot notify". + - `nostr_handler_connected_relay_count() <= 0` -> log "no connected relay; cannot notify". +- Build a concise human-readable message, e.g.: + ``` + FAILED to start at . + Startup step [14] Subscribe self-skill cache failed: no skill events found after EOSE. + Version . Connected relays: /. The agent is NOT online and will not answer DMs until fixed. + ``` + - Reuse `nostr_handler_get_startup_display_name()` and `DIDACTYL_VERSION` exactly like + the success DM at [`src/main.c:1645`](src/main.c:1645) for naming/version consistency. + - Include `step`, `label`, and `detail` so each failure site is self-describing. +- Send via `nostr_handler_send_dm_auto(cfg->admin.pubkey, msg)`; if it returns non-zero, + `DEBUG_WARN` that the failure DM could not be delivered (do not change the exit code). +- Pump the poll loop briefly after sending so the async publish can flush before process + exit: call `nostr_handler_poll(...)` a few times (e.g. ~300--500 ms total) so the + queued kind-4 event is actually written to the relay sockets before cleanup/`return 1`. + (Without this, async publish may be discarded on immediate exit.) + +### 2. Wire the helper into fatal abort sites + +For each fatal `startup_step_fail(...)` that ends in `return 1;`, insert a call to +`notify_admin_startup_failure(&cfg, , "