Skip to content

Add NIP-C1: Agent TUI Messages#2295

Open
lmanchu wants to merge 1 commit intonostr-protocol:masterfrom
lmanchu:sigil/agent-tui-messages
Open

Add NIP-C1: Agent TUI Messages#2295
lmanchu wants to merge 1 commit intonostr-protocol:masterfrom
lmanchu:sigil/agent-tui-messages

Conversation

@lmanchu
Copy link
Copy Markdown

@lmanchu lmanchu commented Mar 29, 2026

Summary

Defines a structured message format for AI agents to send interactive UI elements through Nostr DMs:

  • text — structured text from agents
  • buttons — tappable action buttons with callback protocol
  • card — information cards with optional image and actions
  • table — key-value data display

Complements NIP-AE (Agents) by standardizing the message layer between agents and clients. NIP-AE covers identity and discovery; NIP-C1 covers what agents actually say.

Design Decisions

  • Embedded in DM content: TUI messages live inside NIP-17/NIP-04 encrypted message content as JSON. No new event kinds needed.
  • Graceful degradation: Non-supporting clients see raw JSON. Spec includes plain-text fallback rendering rules.
  • Callback protocol: Simple sigil:callback:<id> string for button responses. No new event kind, just a plain message back.
  • Extensible: New type values can be added without breaking existing clients.

Reference Implementation

  • sigil-core — Rust library with TuiMessage enum
  • sigil-cli — Ratatui terminal rendering
  • Sigil iOS — SwiftUI native component rendering
  • Verified E2E with Damus interop (plain text fallback works)

Relationship to NIP-AE

NIP-AE defines agent definitions (kind 4199), lessons (kind 4129), nudges (kind 4201), and attribution. This NIP is orthogonal — it defines the message format agents use within existing DM infrastructure. An agent defined via NIP-AE would use NIP-C1 messages to communicate with users.

Defines a structured message format for AI agents to send interactive
UI elements (buttons, cards, tables) through Nostr DMs. Complements
NIP-AE (Agents) by standardizing agent-to-user rich messaging.

Includes: text, buttons, card, table types, button callback protocol,
fallback rendering for non-supporting clients, and security guidance.

Reference implementation: github.com/lmanchu/sigil (Rust + Swift)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant