Wardrik.Resource (wardrik_protocol v0.1.0-rc.1)

Copy Markdown

Names what an action acts on, as IAM resources do.

ResourceNames
acme/agent/triagethe agent acme/triage
acme/@jon/agent/triagethe agent acme/@jon/triage
acme/mcp_server/linearthe org's MCP server linear
acme/@jon/connection/githubJon's GitHub account
deploymentthe deployment

Summary

Functions

Returns the resource for the agent id, or :error if it isn't an agent ID.

Returns the deployment's resource.

Returns the resource for something owner holds: every item of kind, or the one named.

Functions

agent(id)

@spec agent(String.t()) :: {:ok, String.t()} | :error

Returns the resource for the agent id, or :error if it isn't an agent ID.

Wardrik.Resource.agent("acme/triage")
#=> {:ok, "acme/agent/triage"}

Wardrik.Resource.agent("acme/triage/C1-1696.1234")
#=> {:ok, "acme/agent/triage/conversation/C1-1696.1234"}

deployment()

@spec deployment() :: String.t()

Returns the deployment's resource.

owned(owner, kind, name)

@spec owned(String.t(), String.t(), String.t() | nil) :: String.t()

Returns the resource for something owner holds: every item of kind, or the one named.

Wardrik.Resource.owned("acme", "mcp_server", "linear")
#=> "acme/mcp_server/linear"