aeat.entrypoints.mcp._resources module

Operating-layer resource templates: pull the harness by aeat:// URI.

ADR R4’s second delivery channel above the tools-only floor: MCP resource templates aeat://skill/{name}, aeat://rule/{name} and aeat://persona/{name} let a resources-capable client enumerate and pull the shipped operating layer verbatim as text/markdown. The concrete resource set and the read resolution are both DERIVED from the shipped aeat/_data/agent/ tree through the aeat.agent package facade (iter_skill_documents, iter_operator_rules, iter_personas), never hand-listed, so a new skill, rule, or persona ships as a new resource with zero registration and the surface cannot drift from the data.

Like _tools / _meta_tools / _prompts, this module is SDK-independent pure functions over typed models: _server adapts HarnessResourceRef to the SDK Resource, HarnessResourceTemplate to ResourceTemplate, and HarnessResourceContent to the read result, so this module imports with or without the aeat-cli[agent] extra and is unit-tested directly.

class HarnessResourceKind(*values)[source]

Bases: StrEnum

The operating-layer resource categories, matching the URI authority.

SKILL / RULE / PERSONA enumerate the shipped agent tree; CORPUS is a template-only category resolving a citation id or corpus_ref to its verbatim bundled legal text (ADR R3).

SKILL
RULE
PERSONA
CORPUS
class HarnessResourceRef(**data)[source]

Bases: BaseModel

A concrete resource row for resources/list - no body text.

Listing advertises the addressable set; the body is fetched separately by resources/read, so a ref carries only the URI, name, kind, and label.

Parameters:
uri: str
name: str
kind: HarnessResourceKind
description: str
mime_type: str
class HarnessResourceTemplate(**data)[source]

Bases: BaseModel

One RFC 6570 resource template for resources/templates/list.

Parameters:
uri_template: str
name: str
kind: HarnessResourceKind
description: str
mime_type: str
class HarnessResourceContent(**data)[source]

Bases: BaseModel

The resolved resources/read payload: a ref plus its verbatim text.

Parameters:
ref: HarnessResourceRef
text: str
exception HarnessResourceNotFoundError[source]

Bases: LookupError

Raised when a resources/read URI does not resolve to a shipped document.

resource_uri(kind, name)[source]

Render the aeat://<kind>/<name> URI for one operating-layer document.

Return type:

str

Parameters:
list_harness_resources()[source]

Return every concrete operating-layer resource, kind-then-name ordered.

One row per shipped skill, operator rule, and persona - the addressable set a resources/list advertises.

Return type:

tuple[HarnessResourceRef, ...]

Returns:

A HarnessResourceRef.

list_harness_resource_templates()[source]

Return the three aeat://<kind>/{name} resource templates.

Return type:

tuple[HarnessResourceTemplate, ...]

Returns:

A HarnessResourceTemplate.

read_harness_resource(uri)[source]

Resolve an aeat://<kind>/<name> URI to its shipped document text.

Raises:

HarnessResourceNotFoundError – The URI is malformed or names a document that is not in the shipped tree.

Return type:

HarnessResourceContent

Returns:

A HarnessResourceContent.

Parameters:

uri (str)