loom.ai.describe¶
Public projection of compiled agents (US7).
The AI pillar’s contribution to
describe_app(): it turns each compiled
AgentPlan into the subset of itself that is
safe to publish.
The projection is an explicit allow-list per capability kind, not a dump of the compiled struct. A grant carries the resolved handle next to the public name — the SQL connection config next to its name, the MCP URL next to its server — so publishing “everything but a deny-list” would leak the moment a new field appears. A kind with no registered projection is therefore an error, never a guess.
Excluded at agent level (FR-054): instructions, the resolved
inference target, the built output.decoder and the author’s free-form
metadata.
Module Attributes
Section the agent descriptions appear under in the application document. |
|
|
Functions
|
|
|
Convert the read-only mappings a compiled schema carries into plain dicts. |
|
|
|
Project |
|
|
|
Publish the provider tool granted, which is the whole of the grant. |
|
|
|
|
|
|
|
|
|
Project one compiled plan into its public description. |
|
Describe a sequence of compiled plans, as the AI pillar's contribution. |
Classes
|
One granted capability, reduced to its publishable settings. |
|
Public description of one compiled agent. |
- loom.ai.describe.AGENTS_SECTION = 'agents'¶
Section the agent descriptions appear under in the application document.
- loom.ai.describe.AGENTS_CONTRIBUTOR = 'loom.ai.describe:describe_agents'¶
module:callablereference resolving todescribe_agents().
- class loom.ai.describe.AgentCapabilityDescription(*, kind, settings)[source]¶
Bases:
LoomFrozenStructOne granted capability, reduced to its publishable settings.
- settings¶
Allow-listed settings of that kind; never a resolved handle.
- Type:
collections.abc.Mapping[str, Any]
- class loom.ai.describe.AgentDescription(*, name, description, spec_version, output_schema, capabilities, policies, source_path)[source]¶
Bases:
LoomFrozenStructPublic description of one compiled agent.
- Parameters:
- output_schema¶
JSON Schema of the agent’s structured answer.
- Type:
collections.abc.Mapping[str, Any]
- capabilities¶
Described grants, in the order the plan carries them.
- policies¶
Validated execution limits. An absent optional cap (FR-042) is published as
None.max_usdis published as a JSON number, matching the published schema’s ownpolicies.max_usd(type: number) — never as the string msgspec would otherwise encode aDecimalto.- Type:
collections.abc.Mapping[str, int | float | str | None]
- loom.ai.describe.describe_agent(plan)[source]¶
Project one compiled plan into its public description.
- Parameters:
plan (AgentPlan) – Compiled agent to describe.
- Returns:
The publishable subset of the plan.
- Raises:
IntrospectionError – When the plan grants a capability kind with no registered projection.
- Return type:
Example:
describe_agent(plan).capabilities[0].kind # 'usecase'
- loom.ai.describe.describe_agents(subject, /)[source]¶
Describe a sequence of compiled plans, as the AI pillar’s contribution.
This is the callable
describe_app()resolvesAGENTS_CONTRIBUTORto.- Parameters:
subject (Any) – Compiled plans, in the order they were compiled.
- Returns:
One JSON-encodable mapping per plan, in that same order.
- Raises:
IntrospectionError – When a plan grants a capability kind with no registered projection.
- Return type:
Example:
describe_agents(plans)[0]["name"] # 'triage'