WardrikWorkspace.Spec (wardrik_workspace v0.1.0-rc.1)

Copy Markdown

What an agent's file tools reach.

Summary

Functions

Returns every mount the spec reaches, its own first.

Builds a spec from WardrikWorkspace's options: :store, :tree and :shared.

Returns the mount path is in and the path within its tree, or {:error, reason}.

Returns path as the agent sees it, prefixed with shared/<name>/ for a shared mount.

Types

t()

@type t() :: %WardrikWorkspace.Spec{
  own: WardrikWorkspace.Mount.t(),
  shared: [WardrikWorkspace.Mount.t()],
  store: WardrikStore.t()
}

Functions

mounts(spec)

@spec mounts(t()) :: [WardrikWorkspace.Mount.t()]

Returns every mount the spec reaches, its own first.

new(opts)

@spec new(keyword()) :: t()

Builds a spec from WardrikWorkspace's options: :store, :tree and :shared.

resolve(spec, path)

@spec resolve(t(), term()) ::
  {:ok, WardrikWorkspace.Mount.t(), String.t()} | {:error, String.t()}

Returns the mount path is in and the path within its tree, or {:error, reason}.

shown(mount, path)

@spec shown(WardrikWorkspace.Mount.t(), String.t()) :: String.t()

Returns path as the agent sees it, prefixed with shared/<name>/ for a shared mount.