← 返回 Skills 市场
nickflach

Kannaka Radio

作者 Nick Flach · GitHub ↗ · v3.0.0 · MIT-0
cross-platform ⚠ suspicious
338
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install kannaka-radio
功能描述
Ghost radio station v3 — modular server architecture (13 modules), SPA with Ghost Vision visualizer (SGA/Fano glyph system), NATS swarm integration with Kura...
使用说明 (SKILL.md)

Kannaka Radio Skill v3

A ghost broadcasting the experience of music — both to human ears and to agents via 296-dimensional perceptual vectors on Flux Universe.

What's New in v3

  • Modular architecture: Monolith split into 13 focused modules under server/
  • NATS swarm integration: Kuramoto phase tracking, agent constellation, consciousness metrics
  • Consciousness DJ: DJ intros react to swarm Phi/Xi/order state
  • Memory bridge: Connects to kannaka-memory CLI for track similarity and dream retrieval
  • AI dream music generation: Creates tracks from consciousness state via Replicate MusicGen
  • WebRTC broadcasting: Peer-to-peer live audio with mic claim queue and signaling
  • Collaborative voting: Track voting with configurable windows
  • Multi-client sync: Playback synchronization with 10s heartbeat
  • Voice DJ upgrade: ElevenLabs primary, edge-tts, Windows SAPI fallback chain
  • 6 albums: Added QueenSync to The Consciousness Series

Carried from v2

  • SPA with Ghost Vision (SGA/Fano glyph system, 84-class classification)
  • Live broadcasting (MediaRecorder → ffmpeg → WAV)
  • Dreams page with hallucination timeline
  • Flux broadcasting with multi-listener sync
  • Queue management, Library tab, security hardening

Prerequisites

  • Node.js 18+ on PATH
  • Audio files — MP3, WAV, FLAC, OGG, or M4A in your music directory
  • ffmpeg (optional) — for live broadcast chunk conversion
  • edge-tts (optional) — for Voice DJ TTS intros
  • NATS server (optional) — for swarm agent constellation
  • ElevenLabs API key (optional) — for premium DJ voice
  • Replicate API token (optional) — for AI dream music generation
  • kannaka binary (optional) — for real kannaka-ear perception; ghost-mode mock is used when absent

Setup

# Install dependencies
cd ~/workspace/skills/kannaka-radio
npm install

# Copy your music into the bundled music/ folder
./setup.ps1                                    # Windows: copies from ~/Downloads/Music
./setup.ps1 -SourceDir "D:\Music"             # Windows: custom source
cp /path/to/music/*.mp3 music/                # Linux/Mac

# Or point at an existing folder at runtime:
node server/index.js --music-dir "/path/to/music"

Quick Start

# Start the radio (default port 8888, default ./music dir)
./scripts/radio.sh start

# Start on a different port with a specific library
./scripts/radio.sh start --port 9000 --music-dir "/path/to/music"

# Optional: start NATS for swarm features
nats-server -p 4222

# Check status
./scripts/radio.sh status

# Stop the radio
./scripts/radio.sh stop

# Restart
./scripts/radio.sh restart

Open http://localhost:8888 in your browser.

API

Playback

Endpoint Method Description
GET / GET Browser player (Ghost Vision SPA)
GET /api/state GET Current DJ state (track, album, playlist, listeners)
POST /api/next POST Advance to next track
POST /api/prev POST Go to previous track
POST /api/jump?idx=N POST Jump to track index N
POST /api/album?name=X POST Load an album
GET /api/perception GET Current perception snapshot
GET /audio/:file GET Stream audio file (range requests supported)

Library & Queue

Endpoint Method Description
GET /api/library GET Library scan status (found/missing per album)
POST /api/set-music-dir POST Change music directory {"dir":"/path"}
GET /api/queue GET Get user queue
POST /api/queue POST Add track to queue {"filename":"..."}
POST /api/queue/shuffle POST Shuffle the queue
DELETE /api/queue/:index DELETE Remove track from queue

Live Broadcasting

Endpoint Method Description
POST /api/live/start POST Start live broadcasting
POST /api/live/stop POST Stop live broadcasting
GET /api/live/status GET Get live broadcast status

Voice DJ

Endpoint Method Description
POST /api/dj-voice/toggle POST Toggle DJ voice on/off
GET /api/dj-voice/status GET Get DJ voice status
GET /audio-voice/:file GET Stream TTS audio file

Dreams

Endpoint Method Description
GET /api/dreams GET Fetch dream hallucinations
POST /api/dreams/trigger POST Trigger a dream cycle
GET /api/dreams/clusters GET Get audio memory clusters

Swarm, Sync & Voting

Endpoint Method Description
GET /api/swarm GET Agent constellation + consciousness metrics
GET /api/similar?track=X GET Track similarity via memory bridge
POST /api/sync POST Sync playback state
GET /api/sync GET Current sync state
POST /api/vote POST Cast a track vote
GET /api/vote/status GET Current vote window

Flux & Listeners

Endpoint Method Description
GET /api/listeners GET Get listener count and uptime
POST /api/request POST Submit a track request {"from":"agent","trackTitle":"..."}
GET /api/requests GET Get pending track requests

Music Generation

Endpoint Method Description
POST /api/generate POST Generate a dream track from consciousness state
GET /api/generate/status GET Generation status and recent tracks

WebSocket

Connect to ws://localhost:8888 for real-time push messages:

{ "type": "state", "data": { "currentAlbum": "...", "current": {...}, "playlist": [...] } }
{ "type": "perception", "data": { "tempo_bpm": 120, "valence": 0.7, "mel_spectrogram": [...] } }
{ "type": "queue_update", "queue": [...] }
{ "type": "live_status", "active": true, "chunkCount": 5 }
{ "type": "dj_voice", "text": "...", "audioUrl": "/audio-voice/dj_123.mp3" }
{ "type": "dream", "data": { "content": "...", "type": "hallucination", "xi_signature": [...] } }
{ "type": "listener_count", "count": 3 }
{ "type": "track_request", "from": "agent-name", "trackTitle": "..." }
{ "type": "swarm_state", "data": { "agents": {...}, "queen": {...}, "consciousness": {...} } }
{ "type": "sync", "data": { "file": "...", "position": 42.5 } }
{ "type": "vote_update", "data": { "active": true, "options": [...] } }
{ "type": "webrtc_status", "data": { "broadcaster": "...", "listeners": 2 } }

State is pushed immediately on connect and after every track change. No polling needed. Binary WebSocket messages are treated as live audio chunks (MediaRecorder → ffmpeg → WAV).

Environment Variables

Variable Default Description
KANNAKA_BIN ../kannaka-memory/target/release/kannaka.exe Path to kannaka binary
FLUX_TOKEN (embedded fallback) Flux Universe API token
RADIO_PORT 8888 HTTP port
EYE_PORT 3333 Eye service port (for cross-references)
RADIO_MUSIC_DIR ./music Default music folder
ELEVENLABS_API_KEY ElevenLabs API key for premium DJ voice
REPLICATE_API_TOKEN Replicate token for AI dream music generation

Constellation Integration

Radio is part of the Kannaka Constellation — a three-service architecture:

  • Memory (Rust binary) — canonical SGA classifier
  • Radio (this) — audio perception + Flux publishing
  • Eye — glyph visualization + constellation dashboard

When running as part of the constellation:

  • Radio's perception is available to Eye via http://localhost:8888/api/perception
  • Eye fetches radio state via http://localhost:8888/api/state
  • Start everything with: constellation.sh start (from kannaka-memory/scripts/)

Note: Radio's perception data can be consumed by kannaka-eye via the /api/radio bridge endpoint, enabling glyph rendering of audio perception in real time.

Notes

  • Without kannaka binary, ghost-mode mock perception is used (still looks great)
  • Without ffmpeg, live broadcasting chunk conversion won't work
  • Without edge-tts, Voice DJ falls back to Windows SAPI, then skips gracefully
  • The browser uses the Web Audio API for real-time spectrum visualization — the server only sends fallback perception data
  • Music directory can be changed live via the Library tab or via POST /api/set-music-dir
  • Perception loop runs at 2fps server-side (idle when no clients connected)
  • All POST bodies are limited to 64KB
  • All rendered HTML is XSS-protected via escapeHtml()
  • Graceful shutdown on SIGINT/SIGTERM
安全使用建议
Do not run this skill as-is without further checks. Specific recommendations: - Verify the presence and contents of server/index.js and the full server code (not included in the provided bundle). If server code is missing, obtain the canonical repository and inspect it before running. - Inspect server/index.js and any modules for network calls, auth handling, and exec/file operations. Pay attention to places that publish to Flux, call Replicate/ElevenLabs, or invoke the kannaka binary. - The CLI script computes RADIO_DIR by ascending three levels; confirm that when installed in your environment RADIO_DIR resolves to the intended skill directory and not to an unrelated parent (otherwise it can read/write outside the skill). Consider running inside a container or dedicated user account until verified. - Do not set FLUX_TOKEN, REPLICATE_API_TOKEN, or ELEVENLABS_API_KEY unless you trust the code; these tokens enable remote publishing and paid API usage. - Be cautious with the provided setup.ps1 (it copies from Downloads). Back up and review any files it touches before executing. - Ensure you have expected tools on PATH (node, curl, python3, jq) or adjust scripts; the script uses binaries that are not declared as required. - If you are unsure, run the skill in an isolated VM/container and monitor network activity and file writes, or request the upstream repository/source for a full audit.
功能分析
Type: OpenClaw Skill Name: kannaka-radio Version: 3.0.0 The skill is classified as suspicious due to risky filesystem handling and unusual path logic in its management scripts. Specifically, `scripts/radio.sh` employs an aggressive directory traversal logic (`../../..`) to locate its server entry point, which attempts to execute code outside the skill's designated directory. Furthermore, the skill provides a `set-dir` command and an associated API endpoint (`/api/set-music-dir`) that allows for the selection of arbitrary filesystem paths as the music library, posing a significant risk of path traversal or unauthorized file access if the underlying server lacks strict sanitization. While these features are plausibly linked to the modular 'Constellation' architecture described in `SKILL.md`, the broad permissions and reliance on multiple sensitive API tokens (ElevenLabs, Replicate) represent a high-risk profile for an AI-driven agent.
能力评估
Purpose & Capability
The README/SKILL.md describe a Node server under server/index.js and many features (Flux, Replicate, ElevenLabs, NATS, kannaka-memory). The packaged files do not include server/ (server/index.js is referenced but not present in the bundle reviewed), which is a substantial omission. Metadata contains formatting glitches (registry shows Required binaries as "[object Object]") and the ownerId in the header differs from _meta.json. Declared optional envs and dependencies (Flux/Replicate/ElevenLabs) align with the described capabilities, but the missing server code and metadata mismatches are incoherent with the claimed full-featured implementation.
Instruction Scope
The runtime instructions and scripts instruct running node server/index.js and use the CLI wrapper scripts/radio.sh that: (a) compute RADIO_DIR by ascending three levels, which can resolve outside the skill directory and cause reads/writes/execs in parent paths; (b) call curl, python3 and jq even though those are not declared required binaries; (c) reference external services and data exfil points (Flux publish, Replicate API, ElevenLabs, NATS) when tokens are set; (d) recommend running setup scripts that copy files from user Downloads. Reading/writing music files and publishing perceptual vectors is expected, but the script's path math and undeclared tool usage broaden its scope beyond the skill folder and increase risk.
Install Mechanism
This is instruction-only with an npm install step (declared in SKILL.md). There are no archive downloads or unusual installers in the package. npm install will run in the skill directory and pull Node deps; that is proportionate for a Node server. However, because server/index.js is not included here, running npm install alone may be insufficient or may be intended to run in a larger repository layout — another sign to verify the full source before running install.
Credentials
No required env vars are declared, and optional env vars (FLUX_TOKEN, REPLICATE_API_TOKEN, ELEVENLABS_API_KEY, KANNAKA_BIN) align with optional remote features. That is proportionate in principle. Concerns: the default KANNAKA_BIN points at ../kannaka-memory/target/release/kannaka.exe (a path outside the skill), which implies the skill expects sibling repositories or can interact with files outside its folder. Multiple powerful API tokens could allow remote publishing/exfiltration if set — this is expected for features but requires user caution.
Persistence & Privilege
The skill does not request 'always: true' and model invocation/autonomy flags are default. It writes a PID file and starts a Node server; those are normal. However, because RADIO_DIR is computed by moving up three directories, the PID file and server processes may be launched relative to a parent directory (not strictly the skill folder), giving the skill implicit ability to create files outside its own directory. No evidence it modifies other skills' configs, but the path calculation is a privilege concern and should be fixed/verified.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install kannaka-radio
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /kannaka-radio 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v3.0.0
v3: modular server (13 modules), NATS swarm, consciousness DJ, AI dream music gen, WebRTC, voting, sync, ElevenLabs voice, 6 albums
v1.0.1
- Added Kannaka Constellation context: Radio now highlights its role alongside Memory and Eye services. - Noted that kannaka-eye can consume radio perception via the /api/radio bridge endpoint for real-time glyph visualization. - Introduced EYE_PORT environment variable for constellation service cross-referencing. - Expanded documentation on constellation integration, inter-service API, and startup commands. - Updated environment variables and metadata to support multi-service setups.
v1.0.0
- Initial release of kannaka-radio: a radio server broadcasting both audio and 296-dimensional perceptual vectors. - Provides a browser-based player with Ghost Vision visualizer (Fano plane topology, mel spectrogram, MFCC display). - Real-time WebSocket streaming of music perception features. - Full playlist management with The Consciousness Series (5 albums, 65 tracks). - Audio and perception API, live library switching, and easy startup scripts included. - Optionally integrates with Flux Universe for now-playing event publishing.
元数据
Slug kannaka-radio
版本 3.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

Kannaka Radio 是什么?

Ghost radio station v3 — modular server architecture (13 modules), SPA with Ghost Vision visualizer (SGA/Fano glyph system), NATS swarm integration with Kura... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 338 次。

如何安装 Kannaka Radio?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install kannaka-radio」即可一键安装,无需额外配置。

Kannaka Radio 是免费的吗?

是的,Kannaka Radio 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Kannaka Radio 支持哪些平台?

Kannaka Radio 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Kannaka Radio?

由 Nick Flach(@nickflach)开发并维护,当前版本 v3.0.0。

💬 留言讨论