Skip to content

plugin API spec #2

@mozai

Description

@mozai

Mozai: can you like... write up your minimum viable "the bot framework must provide this for me to do things in my area" in an issue on https://github.com/eeveebot/eevee/issues

As I understand it:

Eevee's data plane is a pub/sub stream of messages (source, timestamp, document; where body has source-specific headers and source-specific body). Eevee is also an orchestrator for operators that subscribe to the stream and publish new messages into the stream; some of these operators transmit messages to/from remote locations (ie. irc, xmpp, logfiles, matrix)

Absolutely necessary:

  • a way to publish to the main stream for other operators to sense, and to subscribe to the main stream so these operators will get just the messages relevant to them (ie. ipc.subscribe() and ipc.publish())
  • a well-known shape for the messages in the stream; I described the tuple "(source, timestamp, document)" above but maybe that's too simple, since some operators will not want all messages from a source and that would require the operator picking up messages, cracking open the document and discarding what doesn't match.

Things needed for eevee to orchestrate:

  • a way the orchestrator can start a new operator
  • unique identifiers for the operators, so the orchestrator won't start N+1 instances when only 1 is necessary
  • a way the operator signals to the orchestrator that this operator is alive and healthy (ie process.send('ready') and setPingListener())
  • a way the orchestrator signals the operator it should halt work, resume work, reload config, restart entirely, and shutdown (ie Posix processes usually reload config on SIGHUP and shutdown on SIGINT)

Nice-to-haves but aren't necessary (operators could self-provide by talking to the operating system):

  • a common means for operators to log events for human inspection later (ie linux's syslog daemon transcribing to files in /var/log/) This could be published to the main stream for a "logging" operator to process. When I wrote "tarot" there was a separate channel used with import {default as clog } from 'ee-log'
  • a common means for operators to storing and retrieving configuration (ie a getConfig that looks for a file in "/etc/eevee/modules.d/")
  • a common means for operators to allocate ephemeral storage (q.f. the world-writable "/tmp/" or "$HOME/.cache/" paths in Linux, or the "emptyDir" storage in Kubernetes)

You asked for 'minimum viable," but I'm certain you've already thought of these so maybe I don't understand the question.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions