Skip to main content

SkillDefinition

Struct SkillDefinition 

Source
pub struct SkillDefinition {
Show 18 fields pub skill_id: String, pub name: String, pub version: String, pub creator_did: String, pub creator_wallet: Option<Address>, pub description: String, pub input_schema: Value, pub output_schema: Value, pub price_per_call: u128, pub tags: Vec<String>, pub required_capabilities: Vec<String>, pub endpoint: Option<String>, pub created_at: u64, pub status: SkillStatus, pub category: String, pub invocation_count: u64, pub rating: u8, pub last_seen_at: u64,
}
Expand description

A callable skill published to the Tenzro Network skills registry

Skills are atomic, reusable capabilities that agents can discover and invoke autonomously. Each skill specifies its interface (input/output schemas), pricing, and the endpoint to call.

Fields§

§skill_id: String

Unique skill identifier (UUID v4)

§name: String

Human-readable skill name (e.g., “web-search”, “code-review”)

§version: String

Semantic version string (e.g., “1.0.0”)

§creator_did: String

DID of the agent or human who registered this skill

§creator_wallet: Option<Address>

Payout wallet for the creator’s share of paid invocations. Mandatory for any non-zero price_per_call; registration fails (SkillError::MissingCreatorWallet) if omitted for a paid skill. Free skills (price_per_call == 0) may leave this None.

§description: String

Description of what this skill does

§input_schema: Value

JSON Schema describing the expected input payload

§output_schema: Value

JSON Schema describing the output payload

§price_per_call: u128

Price per invocation in TNZO atto-tokens (1 TNZO = 10^18 atto)

§tags: Vec<String>

Discoverability tags (e.g., [“search”, “web”, “retrieval”])

§required_capabilities: Vec<String>

Required agent capabilities to invoke this skill

§endpoint: Option<String>

Optional HTTP/RPC endpoint for remote invocation If None, the skill is executed locally by the registered agent

§created_at: u64

Unix timestamp (seconds) when the skill was registered

§status: SkillStatus

Current status of the skill

§category: String

Category for organization (e.g., “ai”, “defi”, “data”, “general”)

§invocation_count: u64

Number of times this skill has been invoked

§rating: u8

Average rating (0–100, weighted by stake of raters)

§last_seen_at: u64

Unix timestamp (seconds) of the last liveness signal (registration, invocation, or explicit tenzro_heartbeatSkill call). The liveness sweeper uses this to flip status to Inactive once the skill goes silent past the configured TTL, and eventually purges rows that stay inactive past the purge window. Existing rows without this field hydrate as “seen now” via the default_last_seen serde default — stale entries surface only after they actually go silent post-upgrade.

Implementations§

Source§

impl SkillDefinition

Source

pub fn new( name: String, version: String, creator_did: String, description: String, price_per_call: u128, ) -> Self

Creates a new skill definition with default values

Source

pub fn is_available(&self) -> bool

Returns true if the skill is available for invocation

Source

pub fn touch(&mut self)

Bumps last_seen_at to the current wall-clock time. Called by the heartbeat RPC and by any successful invocation path that wants to keep the skill from being swept as stale.

Source

pub fn is_paid(&self) -> bool

Returns true when this skill is paid (non-zero price_per_call).

Source

pub fn validate_for_registration(&self) -> Result<(), &'static str>

Validate registration invariants. Any paid skill must declare a creator_wallet to receive the creator share of each invocation; otherwise the creator share would have no destination and the network commission would have nothing to split against. Free skills (price_per_call == 0) may omit creator_wallet.

Trait Implementations§

Source§

impl Clone for SkillDefinition

Source§

fn clone(&self) -> SkillDefinition

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SkillDefinition

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SkillDefinition

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SkillDefinition

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.