WardrikDaemon.Config.Orgs (wardrik_daemon v0.1.0-rc.1)

Copy Markdown

Reads config.yaml's orgs: the orgs beside the deployment's own.

orgs:
  "*":
    mcp: [search]
    policy: base
  payments:
    mcp: [stripe, github]
    channels: [payments-slack]
    notify: [audit]
    policy: payments-strict

Keys

  • mcp, channels, notify - the servers, channels and targets the org's agents use, by the names their sections give them.
  • policy - the policy in policies/ the org's agents are held to.

"*" is every org: what it lists, every org uses, and its policy holds every org.

A server, channel or target no entry lists is the deployment's own org's. A channel serves one org, or every org if "*" lists it.

Summary

Functions

Returns each org's entry, "*"'s too.

Returns the orgs whose agents use the kind of thing called name.

Types

entry()

@type entry() :: %{
  mcp: [String.t()],
  channels: [String.t()],
  notify: [String.t()],
  policy: String.t() | nil
}

Functions

read(section, defined)

@spec read(map() | nil, %{required(String.t()) => [String.t()]}) ::
  {:ok, %{required(String.t()) => entry()}} | {:error, String.t()}

Returns each org's entry, "*"'s too.

defined holds the names mcp, channels and notify define, which entries may list.

using(orgs, kind, name, org)

@spec using(%{required(String.t()) => entry()}, atom(), String.t(), String.t()) ::
  :all | [String.t()]

Returns the orgs whose agents use the kind of thing called name.

Returns :all if "*" lists it, the orgs whose entries list it, or [org] if none does.