v0.0.29 - Update README: current status, runtime context model, project structure, HTTP admin API section, model tools, roadmap checkboxes

This commit is contained in:
Your Name
2026-03-03 05:54:50 -04:00
parent 29b4289217
commit 947e0b2f1e
2 changed files with 55 additions and 22 deletions

View File

@@ -51,11 +51,11 @@ Agents learn capabilities through skills — Nostr events that any agent can di
Didactyl will support local inference, which is very privacy preserving. Remote inference does however have it's advantages, and in those cases Didactyl supports using Bitcoin Lightning and eCash inference providers.
## Current Status — v0.0.28
## Current Status — v0.0.29
**Active build — this project is barely working. Experiment at your own risk.**
> Last release update: v0.0.28Add prompt template system: soul-embedded ---template--- parser, variable resolver, provider overrides, section-named context parts; enable HTTP API by default; fix Makefile to not rebuild nostr_core_lib unconditionally; log API endpoint URL at startup
> Last release update: v0.0.29Update README: current status, runtime context model, project structure, HTTP admin API section, model tools, roadmap checkboxes
- Connects to configured relays with auto-reconnect and relay state transition logging
- Publishes configured startup events per relay as each relay becomes connected
@@ -63,10 +63,13 @@ Didactyl will support local inference, which is very privacy preserving. Remote
- Verifies Nostr event signatures before processing inbound messages
- Applies privilege tiers: ADMIN (tools), WoT (chat-only), STRANGER (configurable canned reply or ignore)
- Subscribes to admin context kinds (`0`,`3`,`10002`,`1`) for WoT + contextual awareness
- Builds LLM context from system prompt + admin identity (kind 0/10002) + startup events + admin DM history + admin recent notes
- Builds LLM context from soul template (`---template---` section in kind `31120`) with named sections, variable resolution, and per-provider content overrides; falls back to hardcoded assembly if no template present
- Adopted skills injected into context automatically from the agent's `10123` adoption list
- Supports tool-calling loop with configurable max turns and local safety limits
- Triggered skills — Nostr event filters that fire skill execution automatically
- Deduplicates inbound messages via event-ID cache and FNV-1a fingerprint debounce window
- Appends every outbound LLM context payload to [`context.log`](context.log)
- Localhost HTTP admin API on port `8484` — inspect context, run prompts, compare variants, change model at runtime
## Quick Start
@@ -274,13 +277,12 @@ On boot, Didactyl attempts startup publishes to each relay as that relay transit
Didactyl builds tier-aware context:
- **ADMIN** request context order:
1. Soul message from kind `31120` (or fallback default)
2. Admin identity context — admin pubkey hex, kind `0` profile, kind `10002` relay list
3. Startup events memory block (`kinds/content/tags` snapshot)
4. Last 12 decrypted DM turns between admin and agent
5. Recent admin kind `1` notes (from configured admin-context subscription)
6. Current user message
- **ADMIN** request context — assembled from the soul's `---template---` section (if present), otherwise hardcoded order:
1. Soul personality (everything above `---template---` in kind `31120`)
2. Named template sections in order — e.g. `admin_identity`, `admin_profile`, `admin_relay_list`, `startup_events`, `adopted_skills`, `dm_history` (expand), `admin_notes`
3. Each section resolves `{{variable}}` placeholders from live data at call time
4. Provider-specific content overrides per section (e.g. XML tags for Anthropic)
5. Section names are used in `context.log` headers and `/api/context/parts` response
- **WoT** request context: Soul + WoT chat-only instruction + current user message (no tools)
- **STRANGER**: no LLM call when configured to reply statically
@@ -323,9 +325,31 @@ Current tool schema exposed to the LLM in [`tools_build_openai_schema_json()`](s
- `http_fetch`
- Agent metadata:
- `my_version`
- Model management:
- `model_get`
- `model_set`
- `model_list`
Execution entrypoint: [`tools_execute()`](src/tools.c:3765).
## HTTP Admin API
A localhost-only HTTP API on port `8484` (configurable) for agent inspection and prompt crafting. Enable with `"api": {"enabled": true}` in config.
| Endpoint | Purpose |
|---|---|
| `GET /api/status` | Agent name, version, pubkey, relay count, trigger count |
| `GET /api/context/current` | Full LLM context messages array |
| `GET /api/context/parts` | Context broken into named parts with token estimates |
| `POST /api/prompt/run-simple` | Run a simple system+user prompt, no tools |
| `POST /api/prompt/run` | Run a full messages array with tools enabled |
| `POST /api/prompt/compare` | A/B compare two prompt variants |
| `GET /api/model` | Current LLM model config |
| `PUT /api/model` | Change model at runtime (persists to config.json) |
| `GET /api/models` | List available models from provider |
Full reference: [`docs/API.md`](docs/API.md). Frontend brief: [`plans/admin_web_frontend.md`](plans/admin_web_frontend.md).
## Project Structure
```
@@ -335,18 +359,22 @@ Execution entrypoint: [`tools_execute()`](src/tools.c:3765).
├── Makefile # Build system
├── build_static.sh # Preferred final build validation
├── src/
│ ├── main.c / .h # Entry point, args (--config/--debug), lifecycle, version
│ ├── config.c / .h # JSON config parsing, key decode, startup events
│ ├── context.c / .h # File loader utility (reads file into malloc'd string)
│ ├── agent.c / .h # Context assembly, tool loop, DM response flow
│ ├── tools.c / .h # LLM tool schema and tool execution
│ ├── llm.c / .h # LLM HTTP API client (OpenAI-compatible)
│ ├── main.c / .h # Entry point, args (--config/--debug), lifecycle, version
│ ├── config.c / .h # JSON config parsing, key decode, startup events
│ ├── context.c / .h # File loader utility (reads file into malloc'd string)
│ ├── agent.c / .h # Context assembly, tool loop, DM response flow
│ ├── prompt_template.c / .h # Soul template parser, variable resolver, context builder
│ ├── tools.c / .h # LLM tool schema and tool execution
│ ├── llm.c / .h # LLM HTTP API client (OpenAI-compatible)
│ ├── nostr_handler.c / .h # Relay pool, subscriptions, publish, startup reconcile
── debug.c / .h # Runtime log levels/macros
── trigger_manager.c / .h # Nostr event trigger subscriptions and skill execution
│ ├── http_api.c / .h # Localhost HTTP admin API (mongoose-based)
│ ├── mongoose.c / .h # Embedded HTTP server (mongoose)
│ └── debug.c / .h # Runtime log levels/macros
├── docs/
│ ├── API.md # HTTP admin API endpoint reference
│ └── TOOLS_AND_SKILLS.md # Tool and skill system documentation
├── plans/ # Architecture and planning documents
│ ├── didactyl_mvp.md
│ ├── didactyl_agentic.md
│ └── security_and_admin_context.md
└── README.md
```
@@ -377,6 +405,11 @@ All dependencies are statically linked into the binary at build time. No system
- [x] Privilege tiers — ADMIN (tools), WoT (chat-only), STRANGER (canned reply/ignore)
- [x] Admin context subscription (kind 0, 3, 10002, 1) with WoT contact extraction
- [x] Message deduplication (event-ID cache + FNV-1a fingerprint debounce)
- [x] Adopted skills injected into LLM context automatically
- [x] Triggered skills — Nostr event filters that fire skill execution automatically
- [x] Localhost HTTP admin API — context inspection, prompt crafting, A/B comparison
- [x] Runtime model switching via `model_set` tool (persists to config.json)
- [x] Soul-embedded prompt templates (`---template---`) — configurable context order, variable resolution, provider overrides
- [ ] Runtime skill loading from adopted `31123` events on relays
- [ ] Skill discovery CLI/tool (query WoT adoption lists)
- [ ] Upgrade to NIP-17 gift-wrapped DMs

View File

@@ -12,8 +12,8 @@
// Using DIDACTYL_ prefix to avoid conflicts with nostr_core_lib VERSION macros
#define DIDACTYL_VERSION_MAJOR 0
#define DIDACTYL_VERSION_MINOR 0
#define DIDACTYL_VERSION_PATCH 28
#define DIDACTYL_VERSION "v0.0.28"
#define DIDACTYL_VERSION_PATCH 29
#define DIDACTYL_VERSION "v0.0.29"
// Agent metadata
#define DIDACTYL_NAME "Didactyl"