tf-types 0.1.8

Core semantic types, traits, and schemas powering the TrustForge protocol.
Documentation
// GENERATED by `tf-schema codegen --target rust` — DO NOT EDIT BY HAND.

#![allow(unused_imports, non_camel_case_types, non_snake_case, clippy::all)]

use serde::{Deserialize, Serialize};
use super::*;

/// Definition of a single named action.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ActionDef {
    /// Dotted action name this library defines.
    pub name: ActionName,
    /// Default risk class when no policy overrides it.
    pub default_risk: RiskClass,
    /// Default proof level when no policy overrides it.
    pub default_proof: ProofLevel,
    /// Default approval requirement when no policy overrides it.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub approval_default: Option<ApprovalRequirement>,
    /// Human-readable description of what the action does.
    pub description: String,
    /// Parameters schema for the action (opaque JSON Schema fragment).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub parameters: Option<serde_json::Value>,
    /// Flagged as dangerous; policies SHOULD require explicit approval.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub dangerous: Option<bool>,
    /// Whether the action can be undone by its inverse.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub reversible: Option<bool>,
}

/// Catalog of action definitions referenced by TF-0006 agent contracts.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Actions {
    /// Version of the actions-library manifest schema itself.
    pub actions_library_version: Actions_ActionsLibraryVersion,
    /// Library identifier, e.g. tf-actions-std.
    pub library_id: String,
    /// Action definitions this library publishes.
    pub actions: Vec<ActionDef>,
}

/// Version of the actions-library manifest schema itself.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum Actions_ActionsLibraryVersion {
    #[serde(rename = "1")]
    V1,
}