pub struct AgentTemplate {Show 26 fields
pub template_id: String,
pub name: String,
pub description: String,
pub template_type: AgentTemplateType,
pub creator: Address,
pub creator_did: Option<String>,
pub creator_wallet: Option<Address>,
pub invocation_count: u64,
pub total_revenue: u128,
pub version: String,
pub status: AgentTemplateStatus,
pub created_at: Timestamp,
pub updated_at: Timestamp,
pub capabilities: Vec<AgentCapability>,
pub runtime_requirements: AgentRuntimeRequirements,
pub pricing: AgentPricingModel,
pub system_prompt: String,
pub examples: Vec<AgentExample>,
pub tags: Vec<String>,
pub download_count: u64,
pub rating: u8,
pub content_hash: Option<String>,
pub docs_url: Option<String>,
pub metadata: HashMap<String, String>,
pub execution_spec: Option<ExecutionSpec>,
pub last_seen_at: Timestamp,
}Expand description
An agent template published to the Tenzro Network marketplace
Fields§
§template_id: StringUnique template identifier (UUID v4)
name: StringTemplate name
description: StringDetailed description
template_type: AgentTemplateTypeTemplate type
creator: AddressAddress of the template creator/publisher
creator_did: Option<String>Optional DID binding — when present, the template is attributable to a
Tenzro identity (did:tenzro:human:... or did:tenzro:machine:...).
The DID is bound at registration time and cannot be changed; creators
who prefer wallet-only attribution may omit this.
creator_wallet: Option<Address>Wallet that receives creator payouts for paid invocations.
MUST be Some(_) whenever pricing != Free. For free templates
this may be None and the creator simply publishes under creator.
invocation_count: u64Cumulative count of successful paid invocations against this template.
total_revenue: u128Cumulative gross TNZO revenue (in base units) routed to the creator
across all invocations — this is the amount that landed in
creator_wallet, i.e. the net-of-commission creator share.
version: StringVersion string (semver, e.g., “1.0.0”)
status: AgentTemplateStatusCurrent status
created_at: TimestampWhen the template was first published
updated_at: TimestampWhen the template was last updated
capabilities: Vec<AgentCapability>List of capabilities this agent provides
runtime_requirements: AgentRuntimeRequirementsRuntime requirements for deployment
pricing: AgentPricingModelPricing model
system_prompt: StringSystem prompt / agent instructions
examples: Vec<AgentExample>Example user messages and expected behavior (for documentation)
Tags for discoverability (e.g., [“coding”, “rust”, “debugging”])
download_count: u64Number of times this template has been downloaded/deployed
rating: u8Average rating (0-100, weighted by stake)
content_hash: Option<String>IPFS or content hash of the full template payload
docs_url: Option<String>Link to documentation or repository
metadata: HashMap<String, String>Additional metadata
execution_spec: Option<ExecutionSpec>Optional declarative execution spec consumed by autonomous runtimes
(e.g. tenzro-agent-kit). When present, a runtime can instantiate
the agent end-to-end (identity, wallet, delegation, tools, skills,
execution steps) from the spec alone — no Rust code required.
Templates without this field still deserialize cleanly via
#[serde(default)].
last_seen_at: TimestampUnix timestamp (seconds) of the last liveness signal — registration,
update, invocation, or explicit tenzro_heartbeatTemplate call.
The liveness sweeper flips status to Deprecated once the template
stays silent past the configured TTL (templates are kept on-record
rather than purged — they have audit value as a marketplace history).
Pre-upgrade rows hydrate with the current time (charitable default)
so they only appear stale once they actually go silent.
Implementations§
Source§impl AgentTemplate
impl AgentTemplate
Sourcepub fn new(
name: String,
description: String,
template_type: AgentTemplateType,
creator: Address,
system_prompt: String,
) -> Self
pub fn new( name: String, description: String, template_type: AgentTemplateType, creator: Address, system_prompt: String, ) -> Self
Creates a new agent template
Sourcepub fn touch(&mut self)
pub fn touch(&mut self)
Bumps last_seen_at to the current wall-clock time. Called by the
heartbeat RPC and any successful invocation that should keep the
template from being marked Deprecated by the liveness sweeper.
Sourcepub fn with_creator_did(self, did: impl Into<String>) -> Self
pub fn with_creator_did(self, did: impl Into<String>) -> Self
Attach an optional DID binding for creator attribution.
Sourcepub fn with_creator_wallet(self, wallet: Address) -> Self
pub fn with_creator_wallet(self, wallet: Address) -> Self
Attach a payout wallet — REQUIRED for any non-Free pricing.
Sourcepub fn with_pricing(self, pricing: AgentPricingModel) -> Self
pub fn with_pricing(self, pricing: AgentPricingModel) -> Self
Attach a pricing model.
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Returns true if the template is publicly available
Sourcepub fn validate_marketplace_invariants(&self) -> Result<(), String>
pub fn validate_marketplace_invariants(&self) -> Result<(), String>
Validates publisher-side invariants required before persisting the
template in the marketplace: if pricing != Free then
creator_wallet must be set (so payouts have a destination).
Returns Err(<reason>) when the invariant is violated. Called from
every registerAgentTemplate code path (RPC + MCP).
Sourcepub fn record_invocation(&mut self, creator_share: u128)
pub fn record_invocation(&mut self, creator_share: u128)
Records a successful paid invocation against this template.
creator_share is the net-of-commission amount that was transferred
to creator_wallet.
Trait Implementations§
Source§impl Clone for AgentTemplate
impl Clone for AgentTemplate
Source§fn clone(&self) -> AgentTemplate
fn clone(&self) -> AgentTemplate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AgentTemplate
impl Debug for AgentTemplate
Source§impl<'de> Deserialize<'de> for AgentTemplate
impl<'de> Deserialize<'de> for AgentTemplate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for AgentTemplate
Source§impl PartialEq for AgentTemplate
impl PartialEq for AgentTemplate
Source§fn eq(&self, other: &AgentTemplate) -> bool
fn eq(&self, other: &AgentTemplate) -> bool
self and other values to be equal, and is used by ==.