signal

package
v0.27.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package signal is the gateway's Signal channel adapter. It talks to a signal-cli daemon running in native HTTP mode (`signal-cli daemon --http`): inbound messages arrive over the daemon's SSE event stream, replies go out as JSON-RPC `send` calls. Nobody embeds libsignal — both Hermes and OpenClaw require the same companion daemon; we spawn nothing and just connect to it (SIGNAL_CLI_URL, default http://127.0.0.1:8080). The account is a LINKED DEVICE (`signal-cli link`) — use a dedicated number, not your main one.

Attachments: the daemon writes them to its own data directory; the adapter reads them from there (attachmentsDir) and copies them into the media spool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

Channel is a connection to a signal-cli HTTP daemon.

func New

func New(baseURL, account, attachmentsDir, mediaDir string) *Channel

New builds a Signal channel. baseURL "" uses the local daemon default.

func (*Channel) Name

func (c *Channel) Name() string

Name returns the adapter identifier.

func (*Channel) Send

func (c *Channel) Send(ctx context.Context, conversation string, msg channels.Outbound) error

Send posts a reply — to a peer (DM) or a group — as JSON-RPC send calls, split with the shared chunker. A synthesized voice note (VoicePath) rides the first part as an attachment path; the daemon runs on the same machine, so the spool path is directly readable.

func (*Channel) Start

func (c *Channel) Start(ctx context.Context, sink channels.Sink) error

Start consumes the daemon's SSE event stream until ctx is cancelled, reconnecting with jittered backoff on any error. Delivery is best-effort like Discord's websocket: the daemon has no per-message replay, so a failed durable record can't be re-driven from the provider side.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL