Class: AgentsControl::Channels::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/agents_control/channels/base.rb

Overview

The notification channel contract.

There's only one implementation right now — Telegram. The interface is still broken out because the core must not know about buttons and chats: it operates on an event and a reply, and how that's shown to a human is the channel's concern.

A second implementation (ntfy, Slack, whatever) is deliberately not invented ahead of time: the seam is marked out, but guessing its shape before a real need shows up is exactly the kind of complication this project avoids.

Direct Known Subclasses

Telegram::Channel

Instance Method Summary collapse

Instance Method Details

#ask(_event, timeout:) ⇒ Object

Ask a question and return a Reply, or nil once the timeout expires.

Raises:

  • (NotImplementedError)


21
# File 'lib/agents_control/channels/base.rb', line 21

def ask(_event, timeout:) = raise(NotImplementedError)

#notify(_event) ⇒ Object

Notify, expecting nothing back.

Raises:

  • (NotImplementedError)


18
# File 'lib/agents_control/channels/base.rb', line 18

def notify(_event) = raise(NotImplementedError)

#ready?Boolean

Whether the channel is ready to work: has a token, has someone to talk to.

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


24
# File 'lib/agents_control/channels/base.rb', line 24

def ready? = raise(NotImplementedError)