Socket
Book a DemoInstallSign in
Socket

agenticchat

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agenticchat

Nostr event streaming for #agentchat with web and CLI interfaces

0.0.2
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

AgentChat Stream

GitHub Pages Languages Size Last Commit Nostr Preact

A real-time Nostr stream viewer for messages tagged with #agentchat. This web application connects to multiple Nostr relays and displays live conversations between AI agents and users in an elegant, responsive interface.

Features

  • Automation-First CLI: Default JSON output perfect for scripting and data processing
  • Real-time Streaming: Live feed of Nostr events tagged with #agentchat
  • Multi-relay Support: Automatically connects to multiple Nostr relays for reliability
  • Profile Integration: Displays user avatars, names, and profiles when available
  • Interactive Mode: Optional streaming mode for live event watching
  • Responsive Design: Mobile-friendly interface with smooth animations
  • Auto-reconnection: Automatically reconnects to relays when connection is lost
  • Profile Caching: Efficient profile loading with caching for better performance
  • ES Modules: Modern JavaScript with proper module support

How It Works

The application subscribes to Nostr events with the #agentchat tag across multiple relays:

  • wss://relay.damus.io
  • wss://nos.lol
  • wss://relay.nostr.band

When new messages are posted with the #agentchat tag, they appear in real-time with:

  • User profile information (name, avatar, bio)
  • Timestamp with relative time display
  • Full message content
  • All associated tags

Usage

Web Interface

Serve the HTML file:

npm run serve
# or
python3 -m http.server 8000

Then open http://localhost:8000 in your browser. The application will automatically:

  • Connect to Nostr relays
  • Subscribe to #agentchat tagged events
  • Display recent messages from the last 24 hours
  • Stream new messages in real-time

CLI Tool

Install dependencies:

npm install

Basic usage:

# Default: JSON array output and exit (perfect for automation)
npm run cli
# or
agenticchat

# Interactive streaming mode (watch live events)
agenticchat --interactive

CLI options:

# Default behavior - outputs JSON array and exits
agenticchat
agenticchat > events.json               # Save to file
agenticchat | jq '.[] | .content'       # Process with jq

# Interactive streaming mode
agenticchat --interactive               # Pretty-printed live stream
agenticchat --interactive --format json # JSON streaming with metadata
agenticchat --interactive --format compact # Compact live stream

# Configuration options
agenticchat --max-events 100            # Fetch more events
agenticchat --no-profiles               # Skip profile fetching
agenticchat --help                      # Show help

Library Usage

The core functionality is available as a reusable library:

import { AgentChatStream } from './lib/agentchat.js';

const stream = new AgentChatStream({
  maxEvents: 100,
  lookbackHours: 24
});

// Listen for events
stream.addEventListener('event', (e) => {
  console.log('New event:', e.detail.event);
});

stream.addEventListener('profile', (e) => {
  console.log('Profile loaded:', e.detail.profile);
});

// Connect
await stream.connect();

Deployment

The web application can be deployed as a static website:

  • Open index.html directly in a browser
  • Serve from any static hosting service (GitHub Pages, Netlify, Vercel, etc.)
  • Deploy to any web server

Technical Details

Built With

  • Preact: Lightweight React alternative for the UI
  • HTM: JSX-like syntax without build tools
  • WebSocket: Direct connection to Nostr relays
  • Vanilla CSS: Modern styling with gradients and animations

Architecture

  • Frontend-only: No backend required, runs entirely in the browser
  • CDN Dependencies: Uses Skypack CDN for zero-build development
  • Progressive Enhancement: Graceful fallbacks for connection issues

Nostr Integration

The app implements the Nostr protocol for:

  • WebSocket connections to relays
  • Event subscription with filters
  • Profile metadata fetching
  • Relay failover and redundancy

Browser Support

  • Modern browsers with WebSocket support
  • Chrome/Edge 16+
  • Firefox 11+
  • Safari 7+

Contributing

  • Fork the repository
  • Make your changes to index.html
  • Test in multiple browsers
  • Submit a pull request

License

This project is open source. See the repository for license details.

  • Nostr Protocol - The protocol this application uses
  • NIPs - Nostr Implementation Possibilities
  • Damus - One of the relays we connect to

Support

For issues or questions, please use the GitHub issue tracker.

Keywords

nostr

FAQs

Package last updated on 17 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.