Wardrik.Workspaces (wardrik v0.1.0-rc.1)

Copy Markdown

Gives agents files: a tree of their own, shared trees, and files read into every turn.

In a definition, files in tools adds the file tools, context lists files to read into every turn, and workspace.shared mounts shared trees:

tools: [files]
context: [MEMORY.md]
workspace:
  shared:
    team: acme
    runbooks: {tree: acme/runbooks, mode: read}

Trees are named org, org/name or org/@user/name. The owner the name starts with can mount it: acme's agents can mount acme and acme/runbooks, and jon's can mount acme/@jon/notes.

Other agents can only mount a tree that Wardrik's :workspace option shares, by resource pattern:

workspace: [shared: %{"acme/runbooks" => [read: ["acme/*"], write: ["acme/agent/ops", "acme/agent/ops/*"]]}]

An agent's conversations share its tree.

Context

context lists at most 20 files. As a map, it takes files and max_bytes, from 1024 to

  1. max_bytes is 16384 unless set.

Summary

Functions

Returns the capabilities and middleware for the agent id's workspace.

Returns the :workspace option as each shared tree's read and write patterns.

Returns the agent id's own tree. A conversation uses its agent's.

Functions

resolve(wardrik, id, definition, files?)

@spec resolve(Wardrik.t(), String.t(), map(), boolean()) ::
  {:ok, capabilities: list(), middleware: list()} | {:error, Wardrik.Error.t()}

Returns the capabilities and middleware for the agent id's workspace.

Capabilities hold the file tools if files? is true. Middleware reads context into every turn. Returns an invalid_request error if the workspace or context is invalid.

settings(opts)

@spec settings(keyword() | nil) :: %{
  required(String.t()) => %{read: [String.t()], write: [String.t()]}
}

Returns the :workspace option as each shared tree's read and write patterns.

tree(id)

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

Returns the agent id's own tree. A conversation uses its agent's.