WardrikChannel.Workspace (wardrik_channel v0.1.0-rc.1)

Copy Markdown

A channel in one place it's added to, such as one Slack workspace.

Adapters get one for each request with WardrikChannel.workspace/2.

People in the workspace act in Wardrik as themselves:

  • Everyone may read and message the installation owner's agents.
  • Approvers may also decide what those agents wait on. The adapter is asked whether someone is an approver only when they decide.

The workspace offers the owner's agents whose definitions list the channel in channels.

Summary

Functions

Returns whether member is one of the installation's approvers.

Returns the ID of the conversation agent holds for thread of room, as acme/triage/slack.T0123.C024BE91L.1696.1234.

Returns the scope member decides calls in.

Returns a pattern matching the logs of every conversation in room, for any agent.

Returns member's scope. They may read and message the owner's agents.

Returns the channel in workspace id, or :error if it isn't added there.

Returns the agents that may answer in the workspace's rooms, sorted by ID.

Returns who member is to Wardrik, as slack:T0123/U024BE7LH.

Returns the channel's own scope. It may read the owner's agents.

Returns the thread of room that conversation holds.

Types

t()

@type t() :: %WardrikChannel.Workspace{
  channel: WardrikChannel.Channel.t(),
  installation: Wardrik.Channel.Installation.t()
}

Functions

approver?(workspace, member)

@spec approver?(t(), WardrikChannel.Member.t()) :: boolean()

Returns whether member is one of the installation's approvers.

conversation(workspace, agent, room, thread)

@spec conversation(t(), String.t(), String.t(), String.t()) :: String.t()

Returns the ID of the conversation agent holds for thread of room, as acme/triage/slack.T0123.C024BE91L.1696.1234.

deciding_scope(workspace, member, conversation, asked_by)

@spec deciding_scope(t(), WardrikChannel.Member.t(), String.t(), String.t() | nil) ::
  Wardrik.Scope.t()

Returns the scope member decides calls in.

  • An approver may decide what any of the owner's agents wait on.
  • Whoever asked_by names may decide what conversation waits on.
  • Anyone else gets member_scope/2, and may decide nothing.

logs(workspace, room)

@spec logs(t(), String.t()) :: String.t()

Returns a pattern matching the logs of every conversation in room, for any agent.

member_scope(workspace, member)

@spec member_scope(t(), WardrikChannel.Member.t()) :: Wardrik.Scope.t()

Returns member's scope. They may read and message the owner's agents.

new(channel, id)

@spec new(WardrikChannel.Channel.t(), String.t()) :: {:ok, t()} | :error

Returns the channel in workspace id, or :error if it isn't added there.

offered(workspace)

@spec offered(t()) :: [WardrikChannel.Offer.t()]

Returns the agents that may answer in the workspace's rooms, sorted by ID.

principal(workspace, member)

Returns who member is to Wardrik, as slack:T0123/U024BE7LH.

scope(workspace)

@spec scope(t()) :: Wardrik.Scope.t()

Returns the channel's own scope. It may read the owner's agents.

thread(workspace, room, conversation)

@spec thread(t(), String.t(), String.t()) :: String.t()

Returns the thread of room that conversation holds.