Skip to content

Releases: manelsen/dusk

v0.3.0 - Valhalla: Voice Engine

Pre-release

Choose a tag to compare

@manelsen manelsen released this 25 Feb 00:54

Discord Voice Engine

Release v0.3.0 implements the full Discord Voice Gateway and audio pipeline for Dusk, developed strictly following the Asgard Protocol (10 Stage-Gates, Fail-First testing).

New Modules

Module Responsibility
Dusk::Voice::Gateway Voice WebSocket handshake (OP 0→2→3→4→5→6), heartbeat, SELECT_PROTOCOL
Dusk::Voice::UDP 74-byte IP Discovery, public IP/port parsing, RTP frame dispatch
Dusk::Voice::Audio PCM→Opus pipeline via ffmpeg (Proc::Async), 20ms Supply of Buf frames
Dusk::Voice::Crypto xsalsa20_poly1305 encryption via libsodium (NativeCall), correct RTP header
Dusk::Voice::Client Full facade: connect(), play(Str), stop(), disconnect()

New Error Types

  • Dusk::Error::LibsodiumNotFound — with apt install libsodium-dev hint
  • Dusk::Error::FfmpegNotFound — with apt install ffmpeg hint
  • Dusk::Error::VoiceUDPDiscoveryFailed — UDP timeout with clear message
  • Dusk::Error::VoiceSessionTimeout — Voice WS session expired (codes 4006/4014)

Tests (Asgard Gate 05 — Fail-First)

  • t/14-voice-gateway.t — 6 subtests (OP sequence, heartbeat, error handling)
  • t/15-voice-udp.t — 5 subtests (IP Discovery packet structure, timeout)
  • t/16-voice-audio.t — 5 subtests, ffmpeg-guarded (skips gracefully if absent)
  • t/17-voice-crypto.t — 6 subtests, libsodium-guarded (RTP header, encryption)

System Requirements

# Debian/Ubuntu
apt install libsodium-dev ffmpeg

# macOS
brew install libsodium ffmpeg

Quick Start

use Dusk::Voice::Client;

my $voice = Dusk::Voice::Client.new(
    guild-id   => $guild-id,
    channel-id => $channel-id,
    user-id    => $bot-user-id,
    session-id => $state.session-id,
    token      => $server.token,
    endpoint   => $server.endpoint,
);

await $voice.connect();
await $voice.play('/path/to/audio.mp3');
$voice.disconnect();

v0.2.7 — Voice Gateway Bridge (OP 4)

Choose a tag to compare

@manelsen manelsen released this 24 Feb 23:30

The Gateway Bridge

The final piece needed before the Voice Engine can begin: OP 4 Voice State Update is now fully wired into Dusk!

What's New

`Dusk::Gateway::Connection`

  • `join-voice-channel(guild-id, channel-id, :mute, :deaf)` — sends OP 4 to request joining a voice channel. Pass an empty string to leave.

`Dusk::Event::Events`

  • `VoiceStateUpdate` — emitted when bot/user voice state changes; provides `session_id` (critical for Voice Gateway handshake).
  • `VoiceServerUpdate` — emitted after OP 4 is sent; provides the `token` and `endpoint` for the Voice WebSocket connection in v0.3.x.

`Dusk::Gateway::Dispatcher`

  • `on-voice-state-update()` — strongly-typed Supply for VoiceStateUpdate events.
  • `on-voice-server-update()` — strongly-typed Supply for VoiceServerUpdate events.

Testing

  • `t/13-voice-gateway-bridge.t` — 18 assertions verifying OP 4 payload construction, VOICE_STATE_UPDATE routing, and VOICE_SERVER_UPDATE routing.

v0.2.6 — Documentação Pod6 Nativa

Pre-release

Choose a tag to compare

@manelsen manelsen released this 24 Feb 22:53

O Padrão Ouro de Documentação

Todas as fundações do Dusk agora são autoriais e 100% autodocumentadas utilizando a robusta linguagem demarcadora nativa do Raku (Pod6).

Com as classes base contendo blocos declarativos (#|) acoplados ao AST, qualquer ferramenta de CLI ou Metaprogramação Raku consegue inspecionar detalhes cruciais das Intents, propriedades dos Conectores REST e exceções assíncronas de Rate Limit sem olhar o código fonte.

Componentes Documentados

  • Dusk::Gateway::Connection (Mecânica Heartbeat / Lifecycle Sync)
  • Dusk::Gateway::Dispatcher (Mapeamento on-event e tipagem)
  • Dusk::REST::Client (Assinatura de exceção 401, 403, 404)
  • Dusk::Event::Events (Contextos do Evento Emitido)
  • Dusk::Model::Message (Ancoramento Exemplo de Model)

v0.2.5 — Cache Agressivo (Rakutastic)

Pre-release

Choose a tag to compare

@manelsen manelsen released this 24 Feb 22:32

Cache Agressivo (Rakutastic)

O v0.2.5 reescreve arquitetura de Cache do Dusk baseada em extensos benchmarks Multi-Thread. O novo modelo adota uma postura híbrida em Thread-Safety e proteção Out-Of-Memory (OOM).

Funcionalidades

  • Locks Nativos: Estados como %!guilds, %!channels e %!users agora são protegidos por instâncias atômicas de Lock.
  • LRU Bounded Arrays: O gargalo infinito em botões grandes (a recepção incessante de mensagens em Memória) agora usa um Array circular por debaixo dos panos que poda automaticamente as mensagens mais velhas. Padrão suporta até 10_000.
  • Desligamento Granular: Você pode poupar ainda mais RAM dizendo ao Cache exatamente o que você NÃO quer guardar.

Uso

my $cache = Dusk::Cache.new(
    max-messages => 5000, 
    disable     => <presences message-content>
);

Instalação

zef install Dusk

v0.2.4 — Gateway Event Models

Pre-release

Choose a tag to compare

@manelsen manelsen released this 24 Feb 22:19

Gateway Event Models

Completing the final coverage items for v0.2.x, Dusk now officially emits strongly-typed Event objects for all major Gateway events!

Features

  • Dusk::Event abstract role.
  • 15 new typed objects in Dusk::Event::Events (e.g., MessageCreate, GuildCreate, InteractionCreate).
  • Dispatcher now automatically maps raw WSS payloads to these native objects before emitting them through the events Supply.
  • You can still access the raw JSON via the .raw property.
  • Fixed Raku compilation ambiguities surrounding Cache deletion (.DELETE-KEY).

Asgard Compliance

  • Formalized RF-04 in SPECS and Matrix.

Tests

  • Total tests: 263. 100% Passing.

Install

zef install Dusk

v0.2.3 — Cache and Voice Stub

Pre-release

Choose a tag to compare

@manelsen manelsen released this 24 Feb 22:00

Cache and Voice Stub

In-memory caching with Gateway event invalidation and experimental Voice stub.

New Modules

  • Dusk::Cache — In-memory store for guilds, channels, and users. Includes listen(Dusk::Gateway::Dispatcher) to automatically populate and invalidate records based on GUILD_CREATE, CHANNEL_DELETE, MESSAGE_CREATE, etc.
  • Dusk::Voice::Client — Experimental stub for Voice Gateway (v0.3.x).

Tests

  • 5 new tests covering Cache CRUD, Gateway event invalidation logic, and Voice stub errors.
  • Total tests: 258.

Asgard Protocol

  • Note: This release completes the foundational architecture following the Asgard protocol guidelines (formerly known as CUEP).

Install

zef install Dusk

v0.2.2 — Interactions & UI Components

Pre-release

Choose a tag to compare

@manelsen manelsen released this 24 Feb 21:52

Interactions & UI Components

Slash command builders, interaction responses, and message components.

New Modules

  • Dusk::Interaction::Command — Fluent builder for slash commands with option types (STRING, INTEGER, BOOLEAN, USER, CHANNEL, ROLE) and sub-commands
  • Dusk::Interaction::Response — Response builders: reply, ephemeral, defer, update, modal
  • Dusk::Component — Buttons (primary/secondary/success/danger/link), String/User/Role/Channel selects, Text inputs, Action rows

Tests

  • 5 new interaction tests covering builders, serialization, and fixture parsing
  • Interaction fixture validated (/ping, /pingephemeral)

Install

zef install Dusk

v0.2.1 — Gateway Core

Pre-release

Choose a tag to compare

@manelsen manelsen released this 24 Feb 21:38

Gateway Core

Discord WebSocket Gateway support with full lifecycle management.

New Modules

  • Dusk::Gateway::Connection — WebSocket state machine: connect → Hello → Identify → Ready → dispatch loop, with resume and reconnect support
  • Dusk::Gateway::Dispatcher — Routes events to typed Supply streams (15 convenience methods)
  • Dusk::Gateway::Heartbeat — Periodic heartbeat with ACK tracking and zombie connection detection
  • Dusk::Gateway::Payload — Parsed gateway frame with opcode constants and predicates
  • Dusk::Gateway::Intents — All Discord v10 Gateway Intent bit flags with presets

New Dependency

  • Cro::WebSocket for WebSocket client

Tests

  • 10 new gateway tests against real Discord fixtures
  • Payload parsing, dispatcher routing, intent calculations all verified

Install

zef install Dusk

v0.2.0 — First Public Release

Pre-release

Choose a tag to compare

@manelsen manelsen released this 24 Feb 21:12

What's New

Highlights

  • 219 REST endpoints mapped to typed Route objects
  • 5 typed exceptions: Unauthorized, Forbidden, NotFound, APIError, RateLimit
  • Rate limit handling with automatic retry on HTTP 429
  • Performance: Avg 3.90ms overhead (budget < 25ms) ✅
  • 233 tests across 7 test files
  • Pod6 inline docs on all Model classes
  • Defensive parsing with explicit Str/Int/Bool coercion

Library Profile

  • README.md with quickstart and architecture overview
  • CHANGELOG.md tracking all versions
  • 3 executable examples (get_channel, send_message, list_commands)
  • Consumer troubleshooting guide in RUNBOOK.md

Install

zef install Dusk