Skip to main content

Crate turul_a2a_patterns

Crate turul_a2a_patterns 

Source
Expand description

turul-a2a-patterns defines reusable abstractions for A2A skill authoring — the SkillHandler trait, SkillRegistry, SkillCard (SKILL.md) helpers, and the SkillProgressSink trait. It depends only on turul-a2a-proto and turul-a2a-types, never on the server runtime. It does NOT change the A2A wire contract; profile/extension machinery lives elsewhere.

Public surface (all re-exported from the crate root):

Internal modules (error, sink, handler, gate, hook, manifest, template, schema, registry) are implementation detail; use the flat re-exports above.

Structs§

ExecutionHints
Provider-neutral execution hints.
GateContext
What a gate sees: the skill id, the invocation params and the output the handler produced.
GatedHandler
A SkillHandler that runs its gates on the inner handler’s output.
InMemorySkillRegistry
Default in-memory SkillRegistry.
SkillCard
The A2A view of an Agent Skills SKILL.md.
SkillDescriptor
Returned by SkillRegistry::describe.

Enums§

ManifestError
Structured manifest parse error.
ProgressState
Non-terminal task states a skill may emit during execution. Terminal states are framework-owned; not constructible here.
RenderError
Structured template render error.
SinkError
Sink-side error variants.
SkillError
Skill error surface. Exactly three variants; richer error shapes are the adopter’s concern at the call site.
SkillOutcome
Outcome of a skill execution observed by a terminal hook.
ValidationError
Structured I/O schema validation error.

Traits§

PreTerminalGate
A check that can veto a successful skill output.
SkillHandler
A handler that runs when a skill is invoked.
SkillProgressSink
Object-safe progress emission trait used by SkillHandler::run.
SkillRegistry
Registry mapping AgentSkill.id to a registered SkillHandler.
TerminalHook
Post-execution hook fired after SkillHandler::run returns.

Functions§

validate_json
Validate instance against schema (JSON Schema 2020-12).