ai-registry 0.1.0

AI Registry on Solana - On-chain agent identity and knowledge management
Documentation
// Agent Registry handlers
mod close_agent;
mod configure_knowledge;
mod create_agent;
mod finalize_knowledge;
mod set_active_state;
mod transfer_controller;
mod update_identity_profile;

use close_agent::*;
use configure_knowledge::*;
use create_agent::*;
use finalize_knowledge::*;
use set_active_state::*;
use transfer_controller::*;
use update_identity_profile::*;

use ai_registry_api::instruction::AgentInstruction;
use steel::*;

pub fn process_instruction(
    program_id: &Pubkey,
    accounts: &[AccountInfo],
    data: &[u8],
) -> ProgramResult {
    let (ix, data) = parse_instruction::<AgentInstruction>(&ai_registry_api::ID, program_id, data)?;

    // Handle Agent instructions
    let agent_ix = AgentInstruction::try_from(ix as u8)
        .map_err(|_| ProgramError::InvalidInstructionData)?;

    match agent_ix {
        AgentInstruction::CreateAgent => process_create_agent(accounts, data),
        AgentInstruction::UpdateIdentityProfile => process_update_identity_profile(accounts, data),
        AgentInstruction::ConfigureKnowledge => process_configure_knowledge(accounts, data),
        AgentInstruction::FinalizeKnowledge => process_finalize_knowledge(accounts, data),
        AgentInstruction::SetActiveState => process_set_active_state(accounts, data),
        AgentInstruction::TransferController => process_transfer_controller(accounts, data),
        AgentInstruction::CloseAgent => process_close_agent(accounts, data),
    }
}

entrypoint!(process_instruction);