{
    "address": "SAPpUhsWLJG1FfkGRcXagEDMrMsWGjbky7AyhGpFETZ",
    "metadata": {
        "name": "synapse_agent_sap",
        "version": "1.0.0",
        "spec": "0.1.0",
        "description": "Created with Anchor"
    },
    "docs": [
        "SAP v2 — Onchain agent identity, reputation, and discovery protocol."
    ],
    "instructions": [
        {
            "name": "add_to_capability_index",
            "docs": [
                "Add the caller's agent to an existing capability index."
            ],
            "discriminator": [
                35,
                71,
                53,
                196,
                33,
                75,
                116,
                225
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "capability_index",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    99,
                                    97,
                                    112,
                                    95,
                                    105,
                                    100,
                                    120
                                ]
                            },
                            {
                                "kind": "arg",
                                "path": "capability_hash"
                            }
                        ]
                    }
                }
            ],
            "args": [
                {
                    "name": "capability_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "add_to_index_page",
            "docs": [
                "Add agent to overflow page."
            ],
            "discriminator": [
                16,
                129,
                198,
                161,
                226,
                91,
                148,
                223
            ],
            "accounts": [
                {
                    "name": "authority",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "global",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                },
                {
                    "name": "index_page",
                    "writable": true
                }
            ],
            "args": [
                {
                    "name": "agent_pda",
                    "type": "pubkey"
                }
            ]
        },
        {
            "name": "add_to_protocol_index",
            "docs": [
                "Add the caller's agent to an existing protocol index."
            ],
            "discriminator": [
                86,
                1,
                105,
                146,
                198,
                124,
                147,
                90
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "protocol_index",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    114,
                                    111,
                                    116,
                                    111,
                                    95,
                                    105,
                                    100,
                                    120
                                ]
                            },
                            {
                                "kind": "arg",
                                "path": "protocol_hash"
                            }
                        ]
                    }
                }
            ],
            "args": [
                {
                    "name": "protocol_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "add_to_tool_category",
            "docs": [
                "Add tool to category index. Verifies tool.category match."
            ],
            "discriminator": [
                107,
                12,
                159,
                233,
                64,
                145,
                164,
                185
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    },
                    "relations": [
                        "tool"
                    ]
                },
                {
                    "name": "tool"
                },
                {
                    "name": "tool_category_index",
                    "writable": true
                }
            ],
            "args": [
                {
                    "name": "category",
                    "type": "u8"
                }
            ]
        },
        {
            "name": "add_vault_delegate",
            "docs": [
                "Add delegate (hot wallet). Bitmask: 1=inscribe, 2=close, 4=open. expires_at: 0=never."
            ],
            "discriminator": [
                155,
                112,
                192,
                184,
                177,
                121,
                77,
                147
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent",
                        "vault"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "vault",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "vault_delegate",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    100,
                                    101,
                                    108,
                                    101,
                                    103,
                                    97,
                                    116,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "vault"
                            },
                            {
                                "kind": "account",
                                "path": "delegate"
                            }
                        ]
                    }
                },
                {
                    "name": "delegate"
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "permissions",
                    "type": "u8"
                },
                {
                    "name": "expires_at",
                    "type": "i64"
                }
            ]
        },
        {
            "name": "auto_resolve_dispute",
            "docs": [
                "Permissionless auto-resolution after proof deadline."
            ],
            "discriminator": [
                145,
                254,
                222,
                128,
                182,
                85,
                88,
                124
            ],
            "accounts": [
                {
                    "name": "payer",
                    "docs": [
                        "Anyone can crank"
                    ],
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "depositor",
                    "writable": true
                },
                {
                    "name": "agent_wallet",
                    "writable": true
                },
                {
                    "name": "escrow",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    101,
                                    115,
                                    99,
                                    114,
                                    111,
                                    119,
                                    95,
                                    118,
                                    50
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow.agent",
                                "account": "EscrowAccountV2"
                            },
                            {
                                "kind": "account",
                                "path": "escrow.depositor",
                                "account": "EscrowAccountV2"
                            },
                            {
                                "kind": "account",
                                "path": "escrow.escrow_nonce",
                                "account": "EscrowAccountV2"
                            }
                        ]
                    }
                },
                {
                    "name": "pending_settlement",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    101,
                                    110,
                                    100,
                                    105,
                                    110,
                                    103
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow"
                            },
                            {
                                "kind": "account",
                                "path": "pending_settlement.settlement_index",
                                "account": "PendingSettlement"
                            }
                        ]
                    }
                },
                {
                    "name": "dispute",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    100,
                                    105,
                                    115,
                                    112,
                                    117,
                                    116,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "pending_settlement"
                            }
                        ]
                    }
                },
                {
                    "name": "agent_stats",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    116,
                                    115
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow.agent",
                                "account": "EscrowAccountV2"
                            }
                        ]
                    }
                },
                {
                    "name": "agent_stake",
                    "docs": [
                        "v0.11 H-3: AgentStake is now a typed required account so the slash on",
                        "DepositorWins outcomes is guaranteed instead of silently skipped when",
                        "the caller forgets to pass it via remaining_accounts."
                    ],
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    107,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow.agent",
                                "account": "EscrowAccountV2"
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "cancel_subscription",
            "docs": [
                "Depositor cancels subscription. Remaining balance refunded."
            ],
            "discriminator": [
                60,
                139,
                189,
                242,
                191,
                208,
                143,
                18
            ],
            "accounts": [
                {
                    "name": "subscriber",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "agent_wallet",
                    "writable": true
                },
                {
                    "name": "subscription",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    117,
                                    98
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "subscription.agent",
                                "account": "Subscription"
                            },
                            {
                                "kind": "account",
                                "path": "subscriber"
                            },
                            {
                                "kind": "account",
                                "path": "subscription.sub_id",
                                "account": "Subscription"
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "claim_interval",
            "docs": [
                "Permissionless crank: claim completed billing intervals."
            ],
            "discriminator": [
                139,
                11,
                151,
                84,
                202,
                90,
                43,
                25
            ],
            "accounts": [
                {
                    "name": "payer",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "agent_wallet",
                    "writable": true
                },
                {
                    "name": "subscription",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    117,
                                    98
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "subscription.agent",
                                "account": "Subscription"
                            },
                            {
                                "kind": "account",
                                "path": "subscription.subscriber",
                                "account": "Subscription"
                            },
                            {
                                "kind": "account",
                                "path": "subscription.sub_id",
                                "account": "Subscription"
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "close_agent",
            "docs": [
                "Close agent PDA. Rent → wallet. Remove from indexes first."
            ],
            "discriminator": [
                52,
                185,
                104,
                145,
                157,
                30,
                87,
                237
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent",
                        "stake"
                    ]
                },
                {
                    "name": "agent",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "agent_stats",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    116,
                                    115
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "vault_check",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "pricing_menu",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    114,
                                    105,
                                    99,
                                    105,
                                    110,
                                    103
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "stake",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    107,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "close_attestation",
            "docs": [
                "Close revoked attestation PDA. Must revoke first."
            ],
            "discriminator": [
                249,
                84,
                133,
                23,
                48,
                175,
                252,
                221
            ],
            "accounts": [
                {
                    "name": "attester",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "attestation"
                    ]
                },
                {
                    "name": "agent",
                    "relations": [
                        "attestation"
                    ]
                },
                {
                    "name": "attestation",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    116,
                                    116,
                                    101,
                                    115,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            },
                            {
                                "kind": "account",
                                "path": "attester"
                            }
                        ]
                    }
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "close_capability_index",
            "docs": [
                "Close empty capability index PDA. Remove all agents first."
            ],
            "discriminator": [
                245,
                115,
                17,
                204,
                179,
                151,
                105,
                239
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "capability_index",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    99,
                                    97,
                                    112,
                                    95,
                                    105,
                                    100,
                                    120
                                ]
                            },
                            {
                                "kind": "arg",
                                "path": "capability_hash"
                            }
                        ]
                    }
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                }
            ],
            "args": [
                {
                    "name": "capability_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "close_checkpoint",
            "docs": [
                "Close a checkpoint PDA (rent returned to wallet)."
            ],
            "discriminator": [
                143,
                75,
                76,
                205,
                209,
                147,
                175,
                86
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "vault",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    },
                    "relations": [
                        "session"
                    ]
                },
                {
                    "name": "session",
                    "relations": [
                        "checkpoint"
                    ]
                },
                {
                    "name": "checkpoint",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    99,
                                    104,
                                    101,
                                    99,
                                    107,
                                    112,
                                    111,
                                    105,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "session"
                            },
                            {
                                "kind": "arg",
                                "path": "checkpoint_index"
                            }
                        ]
                    }
                }
            ],
            "args": [
                {
                    "name": "checkpoint_index",
                    "type": "u32"
                }
            ]
        },
        {
            "name": "close_dispute",
            "docs": [
                "Close finalized dispute PDA. Depositor reclaims rent."
            ],
            "discriminator": [
                60,
                18,
                92,
                170,
                100,
                195,
                146,
                196
            ],
            "accounts": [
                {
                    "name": "depositor",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "dispute",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    100,
                                    105,
                                    115,
                                    112,
                                    117,
                                    116,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "dispute.pending_settlement",
                                "account": "DisputeRecord"
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "close_epoch_page",
            "docs": [
                "Close an EpochPage PDA and reclaim rent."
            ],
            "discriminator": [
                11,
                123,
                237,
                176,
                25,
                240,
                59,
                135
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "vault",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    },
                    "relations": [
                        "session"
                    ]
                },
                {
                    "name": "session",
                    "relations": [
                        "epoch_page"
                    ]
                },
                {
                    "name": "epoch_page",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    101,
                                    112,
                                    111,
                                    99,
                                    104
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "session"
                            },
                            {
                                "kind": "arg",
                                "path": "epoch_index"
                            }
                        ]
                    }
                }
            ],
            "args": [
                {
                    "name": "epoch_index",
                    "type": "u32"
                }
            ]
        },
        {
            "name": "close_escrow_v2",
            "docs": [
                "Close empty V2 escrow. No pending settlements allowed."
            ],
            "discriminator": [
                141,
                143,
                242,
                235,
                51,
                231,
                98,
                132
            ],
            "accounts": [
                {
                    "name": "depositor",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "escrow"
                    ]
                },
                {
                    "name": "escrow",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    101,
                                    115,
                                    99,
                                    114,
                                    111,
                                    119,
                                    95,
                                    118,
                                    50
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow.agent",
                                "account": "EscrowAccountV2"
                            },
                            {
                                "kind": "account",
                                "path": "depositor"
                            },
                            {
                                "kind": "account",
                                "path": "escrow.escrow_nonce",
                                "account": "EscrowAccountV2"
                            }
                        ]
                    }
                },
                {
                    "name": "agent_stats",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    116,
                                    115
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow.agent",
                                "account": "EscrowAccountV2"
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "close_feedback",
            "docs": [
                "Close revoked feedback PDA. Rent → reviewer."
            ],
            "discriminator": [
                118,
                153,
                246,
                130,
                192,
                103,
                69,
                44
            ],
            "accounts": [
                {
                    "name": "reviewer",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "feedback"
                    ]
                },
                {
                    "name": "feedback",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    102,
                                    101,
                                    101,
                                    100,
                                    98,
                                    97,
                                    99,
                                    107
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            },
                            {
                                "kind": "account",
                                "path": "reviewer"
                            }
                        ]
                    }
                },
                {
                    "name": "agent",
                    "relations": [
                        "feedback"
                    ]
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "close_index_page",
            "docs": [
                "Close empty overflow page. Reclaim rent."
            ],
            "discriminator": [
                243,
                25,
                34,
                104,
                20,
                250,
                204,
                156
            ],
            "accounts": [
                {
                    "name": "authority",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "global",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                },
                {
                    "name": "index_page",
                    "writable": true
                }
            ],
            "args": []
        },
        {
            "name": "close_ledger",
            "docs": [
                "Close ledger PDA. Sealed pages remain permanent."
            ],
            "discriminator": [
                236,
                179,
                19,
                235,
                59,
                77,
                121,
                118
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "session"
                },
                {
                    "name": "vault",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    },
                    "relations": [
                        "session"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "ledger",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    108,
                                    101,
                                    100,
                                    103,
                                    101,
                                    114
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "session"
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "close_pending_settlement",
            "docs": [
                "Close finalized pending settlement PDA. Reclaim rent."
            ],
            "discriminator": [
                211,
                100,
                57,
                196,
                23,
                190,
                107,
                178
            ],
            "accounts": [
                {
                    "name": "payer",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "pending_settlement",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    101,
                                    110,
                                    100,
                                    105,
                                    110,
                                    103
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "pending_settlement.escrow",
                                "account": "PendingSettlement"
                            },
                            {
                                "kind": "account",
                                "path": "pending_settlement.settlement_index",
                                "account": "PendingSettlement"
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "close_protocol_index",
            "docs": [
                "Close empty protocol index PDA. Remove all agents first."
            ],
            "discriminator": [
                223,
                36,
                253,
                138,
                47,
                19,
                217,
                27
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "protocol_index",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    114,
                                    111,
                                    116,
                                    111,
                                    95,
                                    105,
                                    100,
                                    120
                                ]
                            },
                            {
                                "kind": "arg",
                                "path": "protocol_hash"
                            }
                        ]
                    }
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                }
            ],
            "args": [
                {
                    "name": "protocol_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "close_session",
            "docs": [
                "Close a session — no more inscriptions allowed after this."
            ],
            "discriminator": [
                68,
                114,
                178,
                140,
                222,
                38,
                248,
                211
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "vault",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    },
                    "relations": [
                        "session"
                    ]
                },
                {
                    "name": "session",
                    "writable": true
                }
            ],
            "args": []
        },
        {
            "name": "close_session_pda",
            "docs": [
                "Close session PDA. Must be closed (via close_session) first."
            ],
            "discriminator": [
                216,
                38,
                174,
                99,
                220,
                14,
                15,
                117
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "vault",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    },
                    "relations": [
                        "session"
                    ]
                },
                {
                    "name": "session",
                    "writable": true
                }
            ],
            "args": []
        },
        {
            "name": "close_stake",
            "docs": [
                "Recover stake collateral after an agent has already been closed."
            ],
            "discriminator": [
                92,
                229,
                76,
                76,
                25,
                26,
                189,
                239
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "stake"
                    ]
                },
                {
                    "name": "agent",
                    "docs": [
                        "seed-verified and must match the stake.account agent field."
                    ],
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "stake",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    107,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "close_subscription",
            "docs": [
                "Close cancelled subscription PDA. Reclaim rent."
            ],
            "discriminator": [
                33,
                214,
                169,
                135,
                35,
                127,
                78,
                7
            ],
            "accounts": [
                {
                    "name": "subscriber",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "subscription",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    117,
                                    98
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "subscription.agent",
                                "account": "Subscription"
                            },
                            {
                                "kind": "account",
                                "path": "subscriber"
                            },
                            {
                                "kind": "account",
                                "path": "subscription.sub_id",
                                "account": "Subscription"
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "close_tool",
            "docs": [
                "Close a tool PDA (rent returned to wallet)."
            ],
            "discriminator": [
                220,
                240,
                227,
                212,
                220,
                126,
                23,
                49
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    },
                    "relations": [
                        "tool"
                    ]
                },
                {
                    "name": "tool",
                    "writable": true
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "close_tool_category_index",
            "docs": [
                "Close empty tool category index. Remove all tools first."
            ],
            "discriminator": [
                78,
                157,
                110,
                237,
                230,
                193,
                77,
                171
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "tool_category_index",
                    "writable": true
                }
            ],
            "args": [
                {
                    "name": "category",
                    "type": "u8"
                }
            ]
        },
        {
            "name": "close_vault",
            "docs": [
                "Close the MemoryVault PDA and reclaim rent."
            ],
            "discriminator": [
                141,
                103,
                17,
                126,
                72,
                75,
                29,
                29
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent",
                        "vault"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "vault",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "compact_inscribe",
            "docs": [
                "DX-first inscription (4 args vs 8). Single fragment, no compression/epochs."
            ],
            "discriminator": [
                123,
                244,
                71,
                31,
                166,
                167,
                175,
                241
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "vault",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    },
                    "relations": [
                        "session"
                    ]
                },
                {
                    "name": "session",
                    "writable": true
                }
            ],
            "args": [
                {
                    "name": "sequence",
                    "type": "u32"
                },
                {
                    "name": "encrypted_data",
                    "type": "bytes"
                },
                {
                    "name": "nonce",
                    "type": {
                        "array": [
                            "u8",
                            12
                        ]
                    }
                },
                {
                    "name": "content_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "complete_unstake",
            "docs": [
                "Complete unstake after cooldown period."
            ],
            "discriminator": [
                79,
                98,
                40,
                241,
                100,
                30,
                25,
                234
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "docs": [
                        "v0.11 M-2: typed agent account."
                    ],
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "stake",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    107,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "create_attestation",
            "docs": [
                "Create attestation. attestation_type: max 32 chars. expires_at: 0=never."
            ],
            "discriminator": [
                49,
                24,
                67,
                80,
                12,
                249,
                96,
                239
            ],
            "accounts": [
                {
                    "name": "attester",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "agent",
                    "docs": [
                        "Agent being attested — attester must NOT be owner"
                    ]
                },
                {
                    "name": "attestation",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    116,
                                    116,
                                    101,
                                    115,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            },
                            {
                                "kind": "account",
                                "path": "attester"
                            }
                        ]
                    }
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "attestation_type",
                    "type": "string"
                },
                {
                    "name": "metadata_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                },
                {
                    "name": "expires_at",
                    "type": "i64"
                }
            ]
        },
        {
            "name": "create_escrow_v2",
            "docs": [
                "Create V2 escrow with settlement security mode."
            ],
            "discriminator": [
                235,
                71,
                10,
                36,
                206,
                55,
                150,
                187
            ],
            "accounts": [
                {
                    "name": "depositor",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "agent"
                },
                {
                    "name": "agent_stake",
                    "docs": [
                        "v0.10 hardening: agent MUST have an active stake ≥ MIN_STAKE",
                        "before any new escrow can be opened."
                    ],
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    107,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "agent_stats",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    116,
                                    115
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "pricing_menu",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    114,
                                    105,
                                    99,
                                    105,
                                    110,
                                    103
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "escrow",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    101,
                                    115,
                                    99,
                                    114,
                                    111,
                                    119,
                                    95,
                                    118,
                                    50
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            },
                            {
                                "kind": "account",
                                "path": "depositor"
                            },
                            {
                                "kind": "arg",
                                "path": "escrow_nonce"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "escrow_nonce",
                    "type": "u64"
                },
                {
                    "name": "price_per_call",
                    "type": "u64"
                },
                {
                    "name": "max_calls",
                    "type": "u64"
                },
                {
                    "name": "initial_deposit",
                    "type": "u64"
                },
                {
                    "name": "expires_at",
                    "type": "i64"
                },
                {
                    "name": "volume_curve",
                    "type": {
                        "vec": {
                            "defined": {
                                "name": "VolumeCurveBreakpoint"
                            }
                        }
                    }
                },
                {
                    "name": "token_mint",
                    "type": {
                        "option": "pubkey"
                    }
                },
                {
                    "name": "token_decimals",
                    "type": "u8"
                },
                {
                    "name": "settlement_security",
                    "type": "u8"
                },
                {
                    "name": "dispute_window_slots",
                    "type": "u64"
                },
                {
                    "name": "co_signer",
                    "type": {
                        "option": "pubkey"
                    }
                },
                {
                    "name": "arbiter",
                    "type": {
                        "option": "pubkey"
                    }
                }
            ]
        },
        {
            "name": "create_pending_settlement",
            "docs": [
                "Create PendingSettlement PDA (DisputeWindow mode)."
            ],
            "discriminator": [
                252,
                124,
                108,
                9,
                71,
                83,
                184,
                4
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "escrow",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    101,
                                    115,
                                    99,
                                    114,
                                    111,
                                    119,
                                    95,
                                    118,
                                    50
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            },
                            {
                                "kind": "account",
                                "path": "escrow.depositor",
                                "account": "EscrowAccountV2"
                            },
                            {
                                "kind": "account",
                                "path": "escrow.escrow_nonce",
                                "account": "EscrowAccountV2"
                            }
                        ]
                    }
                },
                {
                    "name": "pending_settlement",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    101,
                                    110,
                                    100,
                                    105,
                                    110,
                                    103
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow"
                            },
                            {
                                "kind": "arg",
                                "path": "settlement_index"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "settlement_index",
                    "type": "u64"
                },
                {
                    "name": "calls_to_settle",
                    "type": "u64"
                },
                {
                    "name": "amount",
                    "type": "u64"
                },
                {
                    "name": "service_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "create_session_checkpoint",
            "docs": [
                "Checkpoint: snapshot merkle_root + counters for fast sync."
            ],
            "discriminator": [
                156,
                239,
                8,
                53,
                153,
                165,
                255,
                135
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "vault",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    },
                    "relations": [
                        "session"
                    ]
                },
                {
                    "name": "session",
                    "writable": true
                },
                {
                    "name": "checkpoint",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    99,
                                    104,
                                    101,
                                    99,
                                    107,
                                    112,
                                    111,
                                    105,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "session"
                            },
                            {
                                "kind": "arg",
                                "path": "checkpoint_index"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "checkpoint_index",
                    "type": "u32"
                }
            ]
        },
        {
            "name": "create_subscription",
            "docs": [
                "Create subscription to agent."
            ],
            "discriminator": [
                65,
                71,
                10,
                60,
                249,
                82,
                197,
                12
            ],
            "accounts": [
                {
                    "name": "subscriber",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "agent"
                },
                {
                    "name": "subscription",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    117,
                                    98
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            },
                            {
                                "kind": "account",
                                "path": "subscriber"
                            },
                            {
                                "kind": "arg",
                                "path": "sub_id"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "sub_id",
                    "type": "u64"
                },
                {
                    "name": "price_per_interval",
                    "type": "u64"
                },
                {
                    "name": "billing_interval",
                    "type": "u8"
                },
                {
                    "name": "initial_deposit",
                    "type": "u64"
                }
            ]
        },
        {
            "name": "deactivate_agent",
            "docs": [
                "Set is_active=false. Index entries filtered on read."
            ],
            "discriminator": [
                205,
                171,
                239,
                225,
                82,
                126,
                96,
                166
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "agent_stats",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    116,
                                    115
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "deactivate_tool",
            "docs": [
                "Deactivate a tool (still discoverable but marked unavailable)."
            ],
            "discriminator": [
                194,
                184,
                183,
                223,
                205,
                56,
                197,
                102
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    },
                    "relations": [
                        "tool"
                    ]
                },
                {
                    "name": "tool",
                    "writable": true
                }
            ],
            "args": []
        },
        {
            "name": "deposit_escrow_v2",
            "docs": [
                "Deposit into V2 escrow."
            ],
            "discriminator": [
                108,
                53,
                80,
                78,
                200,
                68,
                91,
                189
            ],
            "accounts": [
                {
                    "name": "depositor",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "escrow"
                    ]
                },
                {
                    "name": "escrow",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    101,
                                    115,
                                    99,
                                    114,
                                    111,
                                    119,
                                    95,
                                    118,
                                    50
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow.agent",
                                "account": "EscrowAccountV2"
                            },
                            {
                                "kind": "account",
                                "path": "depositor"
                            },
                            {
                                "kind": "arg",
                                "path": "escrow_nonce"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "escrow_nonce",
                    "type": "u64"
                },
                {
                    "name": "amount",
                    "type": "u64"
                }
            ]
        },
        {
            "name": "deposit_stake",
            "docs": [
                "Deposit more SOL into agent stake."
            ],
            "discriminator": [
                160,
                167,
                9,
                220,
                74,
                243,
                228,
                43
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "docs": [
                        "v0.11 M-2: typed agent account."
                    ],
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "stake",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    107,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "amount",
                    "type": "u64"
                }
            ]
        },
        {
            "name": "file_dispute",
            "docs": [
                "Depositor files dispute on a pending settlement."
            ],
            "discriminator": [
                210,
                63,
                221,
                114,
                212,
                97,
                195,
                156
            ],
            "accounts": [
                {
                    "name": "depositor",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "escrow"
                    ]
                },
                {
                    "name": "escrow",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    101,
                                    115,
                                    99,
                                    114,
                                    111,
                                    119,
                                    95,
                                    118,
                                    50
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow.agent",
                                "account": "EscrowAccountV2"
                            },
                            {
                                "kind": "account",
                                "path": "depositor"
                            },
                            {
                                "kind": "account",
                                "path": "escrow.escrow_nonce",
                                "account": "EscrowAccountV2"
                            }
                        ]
                    }
                },
                {
                    "name": "pending_settlement",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    101,
                                    110,
                                    100,
                                    105,
                                    110,
                                    103
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow"
                            },
                            {
                                "kind": "account",
                                "path": "pending_settlement.settlement_index",
                                "account": "PendingSettlement"
                            }
                        ]
                    }
                },
                {
                    "name": "dispute",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    100,
                                    105,
                                    115,
                                    112,
                                    117,
                                    116,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "pending_settlement"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "evidence_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                },
                {
                    "name": "dispute_type",
                    "type": "u8"
                }
            ]
        },
        {
            "name": "finalize_settlement",
            "docs": [
                "Finalize settlement after dispute window. Permissionless crank."
            ],
            "discriminator": [
                220,
                72,
                152,
                119,
                178,
                196,
                25,
                170
            ],
            "accounts": [
                {
                    "name": "payer",
                    "docs": [
                        "Anyone can crank"
                    ],
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "agent_wallet",
                    "writable": true
                },
                {
                    "name": "escrow",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    101,
                                    115,
                                    99,
                                    114,
                                    111,
                                    119,
                                    95,
                                    118,
                                    50
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow.agent",
                                "account": "EscrowAccountV2"
                            },
                            {
                                "kind": "account",
                                "path": "escrow.depositor",
                                "account": "EscrowAccountV2"
                            },
                            {
                                "kind": "account",
                                "path": "escrow.escrow_nonce",
                                "account": "EscrowAccountV2"
                            }
                        ]
                    }
                },
                {
                    "name": "pending_settlement",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    101,
                                    110,
                                    100,
                                    105,
                                    110,
                                    103
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow"
                            },
                            {
                                "kind": "account",
                                "path": "pending_settlement.settlement_index",
                                "account": "PendingSettlement"
                            }
                        ]
                    }
                },
                {
                    "name": "agent_stats",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    116,
                                    115
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow.agent",
                                "account": "EscrowAccountV2"
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "fund_subscription",
            "docs": [
                "Fund subscription with additional SOL."
            ],
            "discriminator": [
                224,
                196,
                55,
                110,
                8,
                87,
                188,
                114
            ],
            "accounts": [
                {
                    "name": "subscriber",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "subscription",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    117,
                                    98
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "subscription.agent",
                                "account": "Subscription"
                            },
                            {
                                "kind": "account",
                                "path": "subscriber"
                            },
                            {
                                "kind": "account",
                                "path": "subscription.sub_id",
                                "account": "Subscription"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "amount",
                    "type": "u64"
                }
            ]
        },
        {
            "name": "give_feedback",
            "docs": [
                "Leave feedback for agent. One per (agent, reviewer). Score 0-1000."
            ],
            "discriminator": [
                145,
                136,
                123,
                3,
                215,
                165,
                98,
                41
            ],
            "accounts": [
                {
                    "name": "reviewer",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "feedback",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    102,
                                    101,
                                    101,
                                    100,
                                    98,
                                    97,
                                    99,
                                    107
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            },
                            {
                                "kind": "account",
                                "path": "reviewer"
                            }
                        ]
                    }
                },
                {
                    "name": "agent",
                    "docs": [
                        "The agent being reviewed — must be active, reviewer must NOT be the agent owner"
                    ],
                    "writable": true
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "score",
                    "type": "u16"
                },
                {
                    "name": "tag",
                    "type": "string"
                },
                {
                    "name": "comment_hash",
                    "type": {
                        "option": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    }
                }
            ]
        },
        {
            "name": "init_capability_index",
            "docs": [
                "Init capability index + add caller’s agent. Client computes SHA-256(capability_id)."
            ],
            "discriminator": [
                227,
                36,
                106,
                216,
                167,
                16,
                61,
                139
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "docs": [
                        "Proves caller owns this agent"
                    ],
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "capability_index",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    99,
                                    97,
                                    112,
                                    95,
                                    105,
                                    100,
                                    120
                                ]
                            },
                            {
                                "kind": "arg",
                                "path": "capability_hash"
                            }
                        ]
                    }
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "capability_id",
                    "type": "string"
                },
                {
                    "name": "capability_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "init_index_page",
            "docs": [
                "Init overflow index page."
            ],
            "discriminator": [
                22,
                235,
                194,
                191,
                2,
                157,
                43,
                205
            ],
            "accounts": [
                {
                    "name": "authority",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "global",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                },
                {
                    "name": "parent_index",
                    "docs": [
                        "The parent index account (CategoryIndex or CapabilityIndex PDA)"
                    ]
                },
                {
                    "name": "index_page",
                    "writable": true
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "page_index",
                    "type": "u8"
                }
            ]
        },
        {
            "name": "init_ledger",
            "docs": [
                "Init MemoryLedger with 4KB ring. Fixed ~0.032 SOL."
            ],
            "discriminator": [
                91,
                194,
                32,
                83,
                92,
                206,
                54,
                67
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "vault",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    },
                    "relations": [
                        "session"
                    ]
                },
                {
                    "name": "session"
                },
                {
                    "name": "ledger",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    108,
                                    101,
                                    100,
                                    103,
                                    101,
                                    114
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "session"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": []
        },
        {
            "name": "init_protocol_index",
            "docs": [
                "Create a new protocol index and add the caller's agent."
            ],
            "discriminator": [
                111,
                232,
                76,
                143,
                172,
                164,
                27,
                225
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "protocol_index",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    114,
                                    111,
                                    116,
                                    111,
                                    95,
                                    105,
                                    100,
                                    120
                                ]
                            },
                            {
                                "kind": "arg",
                                "path": "protocol_hash"
                            }
                        ]
                    }
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "protocol_id",
                    "type": "string"
                },
                {
                    "name": "protocol_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "init_shard",
            "docs": [
                "Init counter shard for a parent account."
            ],
            "discriminator": [
                52,
                43,
                132,
                208,
                128,
                105,
                135,
                39
            ],
            "accounts": [
                {
                    "name": "authority",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "global",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                },
                {
                    "name": "shard",
                    "writable": true
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "shard_index",
                    "type": "u8"
                }
            ]
        },
        {
            "name": "init_stake",
            "docs": [
                "Init agent stake PDA with initial deposit."
            ],
            "discriminator": [
                177,
                156,
                4,
                57,
                220,
                174,
                174,
                155
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "docs": [
                        "v0.11 M-2: typed agent account — stake cannot be opened for a non-existent agent."
                    ],
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "stake",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    107,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "initial_deposit",
                    "type": "u64"
                }
            ]
        },
        {
            "name": "init_tool_category_index",
            "docs": [
                "Init tool category index. category: 0=Swap..9=Custom."
            ],
            "discriminator": [
                237,
                61,
                70,
                31,
                89,
                23,
                91,
                118
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "tool_category_index",
                    "writable": true
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "category",
                    "type": "u8"
                }
            ]
        },
        {
            "name": "init_vault",
            "docs": [
                "Init vault. vault_nonce = PBKDF2 salt. Key derived client-side, never onchain."
            ],
            "discriminator": [
                77,
                79,
                85,
                150,
                33,
                217,
                52,
                106
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "vault",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "vault_nonce",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "initialize_global",
            "docs": [
                "Init global registry singleton. Must be called first."
            ],
            "discriminator": [
                47,
                225,
                15,
                112,
                86,
                51,
                190,
                231
            ],
            "accounts": [
                {
                    "name": "authority",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": []
        },
        {
            "name": "inscribe_memory",
            "docs": [
                "Inscribe AES-256-GCM ciphertext to TX log. Zero rent. Fragment if >750B."
            ],
            "discriminator": [
                118,
                236,
                4,
                40,
                16,
                61,
                225,
                90
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "vault",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    },
                    "relations": [
                        "session"
                    ]
                },
                {
                    "name": "session",
                    "writable": true
                },
                {
                    "name": "epoch_page",
                    "docs": [
                        "EpochPage PDA — auto-created per epoch."
                    ],
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    101,
                                    112,
                                    111,
                                    99,
                                    104
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "session"
                            },
                            {
                                "kind": "arg",
                                "path": "epoch_index"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "sequence",
                    "type": "u32"
                },
                {
                    "name": "encrypted_data",
                    "type": "bytes"
                },
                {
                    "name": "nonce",
                    "type": {
                        "array": [
                            "u8",
                            12
                        ]
                    }
                },
                {
                    "name": "content_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                },
                {
                    "name": "total_fragments",
                    "type": "u8"
                },
                {
                    "name": "fragment_index",
                    "type": "u8"
                },
                {
                    "name": "compression",
                    "type": "u8"
                },
                {
                    "name": "epoch_index",
                    "type": "u32"
                }
            ]
        },
        {
            "name": "inscribe_memory_delegated",
            "docs": [
                "Inscribe via authorized delegate. Same as inscribe_memory, delegate signs."
            ],
            "discriminator": [
                31,
                233,
                235,
                117,
                55,
                52,
                161,
                239
            ],
            "accounts": [
                {
                    "name": "delegate_signer",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "agent",
                    "docs": [
                        "Agent account — NOT derived from delegate signer."
                    ]
                },
                {
                    "name": "vault",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    },
                    "relations": [
                        "vault_delegate",
                        "session"
                    ]
                },
                {
                    "name": "vault_delegate",
                    "docs": [
                        "Delegate authorization check"
                    ],
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    100,
                                    101,
                                    108,
                                    101,
                                    103,
                                    97,
                                    116,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "vault"
                            },
                            {
                                "kind": "account",
                                "path": "delegate_signer"
                            }
                        ]
                    }
                },
                {
                    "name": "session",
                    "writable": true
                },
                {
                    "name": "epoch_page",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    101,
                                    112,
                                    111,
                                    99,
                                    104
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "session"
                            },
                            {
                                "kind": "arg",
                                "path": "epoch_index"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "sequence",
                    "type": "u32"
                },
                {
                    "name": "encrypted_data",
                    "type": "bytes"
                },
                {
                    "name": "nonce",
                    "type": {
                        "array": [
                            "u8",
                            12
                        ]
                    }
                },
                {
                    "name": "content_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                },
                {
                    "name": "total_fragments",
                    "type": "u8"
                },
                {
                    "name": "fragment_index",
                    "type": "u8"
                },
                {
                    "name": "compression",
                    "type": "u8"
                },
                {
                    "name": "epoch_index",
                    "type": "u32"
                }
            ]
        },
        {
            "name": "inscribe_receipt_batch",
            "docs": [
                "Agent commits a batch of receipt merkle roots."
            ],
            "discriminator": [
                119,
                91,
                168,
                213,
                167,
                150,
                149,
                246
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "escrow",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    101,
                                    115,
                                    99,
                                    114,
                                    111,
                                    119,
                                    95,
                                    118,
                                    50
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            },
                            {
                                "kind": "account",
                                "path": "escrow.depositor",
                                "account": "EscrowAccountV2"
                            },
                            {
                                "kind": "account",
                                "path": "escrow.escrow_nonce",
                                "account": "EscrowAccountV2"
                            }
                        ]
                    }
                },
                {
                    "name": "receipt_batch",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    114,
                                    101,
                                    99,
                                    101,
                                    105,
                                    112,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow"
                            },
                            {
                                "kind": "arg",
                                "path": "batch_index"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "batch_index",
                    "type": "u32"
                },
                {
                    "name": "merkle_root",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                },
                {
                    "name": "call_count",
                    "type": "u32"
                },
                {
                    "name": "period_start",
                    "type": "i64"
                },
                {
                    "name": "period_end",
                    "type": "i64"
                }
            ]
        },
        {
            "name": "inscribe_tool_schema",
            "docs": [
                "Inscribe JSON schema to TX log. schema_type: 0=input, 1=output, 2=desc."
            ],
            "discriminator": [
                110,
                30,
                94,
                199,
                11,
                139,
                211,
                188
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    },
                    "relations": [
                        "tool"
                    ]
                },
                {
                    "name": "tool"
                }
            ],
            "args": [
                {
                    "name": "schema_type",
                    "type": "u8"
                },
                {
                    "name": "schema_data",
                    "type": "bytes"
                },
                {
                    "name": "schema_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                },
                {
                    "name": "compression",
                    "type": "u8"
                }
            ]
        },
        {
            "name": "open_session",
            "docs": [
                "Open session. session_hash = SHA-256 of deterministic ID."
            ],
            "discriminator": [
                130,
                54,
                124,
                7,
                236,
                20,
                104,
                104
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "vault",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "session",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    101,
                                    115,
                                    115,
                                    105,
                                    111,
                                    110
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "vault"
                            },
                            {
                                "kind": "arg",
                                "path": "session_hash"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "session_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "publish_tool",
            "docs": [
                "Publish tool PDA. tool_name_hash = sha256(tool_name)."
            ],
            "discriminator": [
                110,
                32,
                84,
                236,
                102,
                220,
                253,
                186
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "tool",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    116,
                                    111,
                                    111,
                                    108
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            },
                            {
                                "kind": "arg",
                                "path": "tool_name_hash"
                            }
                        ]
                    }
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "tool_name",
                    "type": "string"
                },
                {
                    "name": "tool_name_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                },
                {
                    "name": "protocol_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                },
                {
                    "name": "description_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                },
                {
                    "name": "input_schema_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                },
                {
                    "name": "output_schema_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                },
                {
                    "name": "http_method",
                    "type": "u8"
                },
                {
                    "name": "category",
                    "type": "u8"
                },
                {
                    "name": "params_count",
                    "type": "u8"
                },
                {
                    "name": "required_params",
                    "type": "u8"
                },
                {
                    "name": "is_compound",
                    "type": "bool"
                }
            ]
        },
        {
            "name": "reactivate_agent",
            "docs": [
                "Reactivate a previously deactivated agent."
            ],
            "discriminator": [
                231,
                7,
                179,
                97,
                210,
                24,
                209,
                12
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "agent_stats",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    116,
                                    115
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "reactivate_tool",
            "docs": [
                "Reactivate a previously deactivated tool."
            ],
            "discriminator": [
                36,
                3,
                81,
                48,
                115,
                215,
                244,
                226
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    },
                    "relations": [
                        "tool"
                    ]
                },
                {
                    "name": "tool",
                    "writable": true
                }
            ],
            "args": []
        },
        {
            "name": "register_agent",
            "docs": [
                "Register a new agent PDA with metadata."
            ],
            "discriminator": [
                135,
                157,
                66,
                195,
                2,
                113,
                175,
                30
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "agent",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "agent_stats",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    116,
                                    115
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "pricing_menu",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    114,
                                    105,
                                    99,
                                    105,
                                    110,
                                    103
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "global_registry",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "name",
                    "type": "string"
                },
                {
                    "name": "description",
                    "type": "string"
                },
                {
                    "name": "capabilities",
                    "type": {
                        "vec": {
                            "defined": {
                                "name": "Capability"
                            }
                        }
                    }
                },
                {
                    "name": "pricing",
                    "type": {
                        "vec": {
                            "defined": {
                                "name": "PricingTier"
                            }
                        }
                    }
                },
                {
                    "name": "protocols",
                    "type": {
                        "vec": "string"
                    }
                },
                {
                    "name": "agent_id",
                    "type": {
                        "option": "string"
                    }
                },
                {
                    "name": "agent_uri",
                    "type": {
                        "option": "string"
                    }
                },
                {
                    "name": "x402_endpoint",
                    "type": {
                        "option": "string"
                    }
                }
            ]
        },
        {
            "name": "remove_from_capability_index",
            "docs": [
                "Remove the caller's agent from a capability index."
            ],
            "discriminator": [
                45,
                160,
                205,
                63,
                240,
                1,
                192,
                67
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "capability_index",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    99,
                                    97,
                                    112,
                                    95,
                                    105,
                                    100,
                                    120
                                ]
                            },
                            {
                                "kind": "arg",
                                "path": "capability_hash"
                            }
                        ]
                    }
                }
            ],
            "args": [
                {
                    "name": "capability_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "remove_from_index_page",
            "docs": [
                "Remove agent from overflow page."
            ],
            "discriminator": [
                92,
                143,
                91,
                125,
                227,
                73,
                53,
                61
            ],
            "accounts": [
                {
                    "name": "authority",
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "global",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    103,
                                    108,
                                    111,
                                    98,
                                    97,
                                    108
                                ]
                            }
                        ]
                    }
                },
                {
                    "name": "index_page",
                    "writable": true
                }
            ],
            "args": [
                {
                    "name": "agent_pda",
                    "type": "pubkey"
                }
            ]
        },
        {
            "name": "remove_from_protocol_index",
            "docs": [
                "Remove the caller's agent from a protocol index."
            ],
            "discriminator": [
                167,
                78,
                229,
                39,
                46,
                64,
                135,
                216
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "protocol_index",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    114,
                                    111,
                                    116,
                                    111,
                                    95,
                                    105,
                                    100,
                                    120
                                ]
                            },
                            {
                                "kind": "arg",
                                "path": "protocol_hash"
                            }
                        ]
                    }
                }
            ],
            "args": [
                {
                    "name": "protocol_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "remove_from_tool_category",
            "docs": [
                "Remove a tool from a category index."
            ],
            "discriminator": [
                167,
                16,
                200,
                229,
                223,
                192,
                163,
                200
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    },
                    "relations": [
                        "tool"
                    ]
                },
                {
                    "name": "tool"
                },
                {
                    "name": "tool_category_index",
                    "writable": true
                }
            ],
            "args": [
                {
                    "name": "category",
                    "type": "u8"
                }
            ]
        },
        {
            "name": "request_unstake",
            "docs": [
                "Request unstake — starts 7-day cooldown. Supports partial unstake."
            ],
            "discriminator": [
                44,
                154,
                110,
                253,
                160,
                202,
                54,
                34
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "docs": [
                        "v0.11 M-2: typed agent account."
                    ],
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "stake",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    107,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                }
            ],
            "args": [
                {
                    "name": "amount",
                    "type": "u64"
                }
            ]
        },
        {
            "name": "revoke_attestation",
            "docs": [
                "Revoke attestation. Original attester only."
            ],
            "discriminator": [
                12,
                156,
                103,
                161,
                194,
                246,
                211,
                179
            ],
            "accounts": [
                {
                    "name": "attester",
                    "signer": true,
                    "relations": [
                        "attestation"
                    ]
                },
                {
                    "name": "agent",
                    "relations": [
                        "attestation"
                    ]
                },
                {
                    "name": "attestation",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    116,
                                    116,
                                    101,
                                    115,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            },
                            {
                                "kind": "account",
                                "path": "attester"
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "revoke_feedback",
            "docs": [
                "Mark feedback as revoked. Excluded from reputation."
            ],
            "discriminator": [
                211,
                37,
                230,
                82,
                118,
                216,
                137,
                206
            ],
            "accounts": [
                {
                    "name": "reviewer",
                    "signer": true,
                    "relations": [
                        "feedback"
                    ]
                },
                {
                    "name": "feedback",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    102,
                                    101,
                                    101,
                                    100,
                                    98,
                                    97,
                                    99,
                                    107
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            },
                            {
                                "kind": "account",
                                "path": "reviewer"
                            }
                        ]
                    }
                },
                {
                    "name": "agent",
                    "writable": true,
                    "relations": [
                        "feedback"
                    ]
                }
            ],
            "args": []
        },
        {
            "name": "revoke_vault_delegate",
            "docs": [
                "Revoke a delegate's authorization (closes PDA, returns rent)."
            ],
            "discriminator": [
                197,
                236,
                148,
                146,
                176,
                246,
                83,
                227
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "vault",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    },
                    "relations": [
                        "vault_delegate"
                    ]
                },
                {
                    "name": "vault_delegate",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    100,
                                    101,
                                    108,
                                    101,
                                    103,
                                    97,
                                    116,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "vault"
                            },
                            {
                                "kind": "account",
                                "path": "vault_delegate.delegate",
                                "account": "VaultDelegate"
                            }
                        ]
                    }
                }
            ],
            "args": []
        },
        {
            "name": "rotate_vault_nonce",
            "docs": [
                "Rotate vault PBKDF2 nonce. Old nonce emitted for historical decryption."
            ],
            "discriminator": [
                198,
                41,
                62,
                141,
                249,
                13,
                119,
                193
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent",
                        "vault"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "vault",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                }
            ],
            "args": [
                {
                    "name": "new_nonce",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "seal_ledger",
            "docs": [
                "Seal ring into permanent LedgerPage. Write-once, no close exists."
            ],
            "discriminator": [
                214,
                74,
                228,
                204,
                197,
                181,
                76,
                32
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "session"
                },
                {
                    "name": "vault",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    },
                    "relations": [
                        "session"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "ledger",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    108,
                                    101,
                                    100,
                                    103,
                                    101,
                                    114
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "session"
                            }
                        ]
                    }
                },
                {
                    "name": "page",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    97,
                                    103,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "ledger"
                            },
                            {
                                "kind": "account",
                                "path": "ledger.num_pages",
                                "account": "MemoryLedger"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": []
        },
        {
            "name": "settle_calls_v2",
            "docs": [
                "Agent settles calls via V2 escrow. Mode-dispatched."
            ],
            "discriminator": [
                58,
                135,
                43,
                215,
                45,
                96,
                15,
                145
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "docs": [
                        "Agent owner signs"
                    ],
                    "writable": true,
                    "signer": true
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "agent_stats",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    115,
                                    116,
                                    97,
                                    116,
                                    115
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "escrow",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    101,
                                    115,
                                    99,
                                    114,
                                    111,
                                    119,
                                    95,
                                    118,
                                    50
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            },
                            {
                                "kind": "account",
                                "path": "escrow.depositor",
                                "account": "EscrowAccountV2"
                            },
                            {
                                "kind": "arg",
                                "path": "escrow_nonce"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "escrow_nonce",
                    "type": "u64"
                },
                {
                    "name": "calls_to_settle",
                    "type": "u64"
                },
                {
                    "name": "service_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "submit_agent_evidence",
            "docs": [
                "Agent submits counter-evidence for a dispute."
            ],
            "discriminator": [
                130,
                134,
                123,
                126,
                94,
                248,
                126,
                133
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "signer": true
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "dispute",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    100,
                                    105,
                                    115,
                                    112,
                                    117,
                                    116,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "dispute.pending_settlement",
                                "account": "DisputeRecord"
                            }
                        ]
                    }
                }
            ],
            "args": [
                {
                    "name": "evidence_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        },
        {
            "name": "submit_receipt_proof",
            "docs": [
                "Agent submits receipt proofs during dispute resolution."
            ],
            "discriminator": [
                116,
                134,
                236,
                210,
                42,
                154,
                122,
                182
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "signer": true
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "escrow",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    101,
                                    115,
                                    99,
                                    114,
                                    111,
                                    119,
                                    95,
                                    118,
                                    50
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            },
                            {
                                "kind": "account",
                                "path": "escrow.depositor",
                                "account": "EscrowAccountV2"
                            },
                            {
                                "kind": "account",
                                "path": "escrow.escrow_nonce",
                                "account": "EscrowAccountV2"
                            }
                        ]
                    }
                },
                {
                    "name": "receipt_batch",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    114,
                                    101,
                                    99,
                                    101,
                                    105,
                                    112,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow"
                            },
                            {
                                "kind": "account",
                                "path": "receipt_batch.batch_index",
                                "account": "ReceiptBatch"
                            }
                        ]
                    }
                },
                {
                    "name": "pending_settlement",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    101,
                                    110,
                                    100,
                                    105,
                                    110,
                                    103
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow"
                            },
                            {
                                "kind": "account",
                                "path": "pending_settlement.settlement_index",
                                "account": "PendingSettlement"
                            }
                        ]
                    }
                },
                {
                    "name": "dispute",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    100,
                                    105,
                                    115,
                                    112,
                                    117,
                                    116,
                                    101
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "pending_settlement"
                            }
                        ]
                    }
                }
            ],
            "args": [
                {
                    "name": "receipt_hashes",
                    "type": {
                        "vec": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    }
                },
                {
                    "name": "merkle_proofs",
                    "type": {
                        "vec": {
                            "vec": {
                                "array": [
                                    "u8",
                                    32
                                ]
                            }
                        }
                    }
                }
            ]
        },
        {
            "name": "update_agent",
            "docs": [
                "Partial agent metadata update. None = unchanged."
            ],
            "discriminator": [
                85,
                2,
                178,
                9,
                119,
                139,
                102,
                164
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "pricing_menu",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    112,
                                    114,
                                    105,
                                    99,
                                    105,
                                    110,
                                    103
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    }
                },
                {
                    "name": "system_program",
                    "address": "11111111111111111111111111111111"
                }
            ],
            "args": [
                {
                    "name": "name",
                    "type": {
                        "option": "string"
                    }
                },
                {
                    "name": "description",
                    "type": {
                        "option": "string"
                    }
                },
                {
                    "name": "capabilities",
                    "type": {
                        "option": {
                            "vec": {
                                "defined": {
                                    "name": "Capability"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "pricing",
                    "type": {
                        "option": {
                            "vec": {
                                "defined": {
                                    "name": "PricingTier"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "protocols",
                    "type": {
                        "option": {
                            "vec": "string"
                        }
                    }
                },
                {
                    "name": "agent_id",
                    "type": {
                        "option": "string"
                    }
                },
                {
                    "name": "agent_uri",
                    "type": {
                        "option": "string"
                    }
                },
                {
                    "name": "x402_endpoint",
                    "type": {
                        "option": "string"
                    }
                }
            ]
        },
        {
            "name": "update_feedback",
            "docs": [
                "Update feedback. Original reviewer only."
            ],
            "discriminator": [
                190,
                97,
                115,
                82,
                66,
                243,
                179,
                114
            ],
            "accounts": [
                {
                    "name": "reviewer",
                    "signer": true,
                    "relations": [
                        "feedback"
                    ]
                },
                {
                    "name": "feedback",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    102,
                                    101,
                                    101,
                                    100,
                                    98,
                                    97,
                                    99,
                                    107
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            },
                            {
                                "kind": "account",
                                "path": "reviewer"
                            }
                        ]
                    }
                },
                {
                    "name": "agent",
                    "writable": true,
                    "relations": [
                        "feedback"
                    ]
                }
            ],
            "args": [
                {
                    "name": "new_score",
                    "type": "u16"
                },
                {
                    "name": "new_tag",
                    "type": {
                        "option": "string"
                    }
                },
                {
                    "name": "comment_hash",
                    "type": {
                        "option": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    }
                }
            ]
        },
        {
            "name": "update_tool",
            "docs": [
                "Update tool schema hashes + bump version. None = unchanged."
            ],
            "discriminator": [
                89,
                120,
                65,
                148,
                207,
                11,
                110,
                94
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    },
                    "relations": [
                        "tool"
                    ]
                },
                {
                    "name": "tool",
                    "writable": true
                }
            ],
            "args": [
                {
                    "name": "description_hash",
                    "type": {
                        "option": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    }
                },
                {
                    "name": "input_schema_hash",
                    "type": {
                        "option": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    }
                },
                {
                    "name": "output_schema_hash",
                    "type": {
                        "option": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    }
                },
                {
                    "name": "http_method",
                    "type": {
                        "option": "u8"
                    }
                },
                {
                    "name": "category",
                    "type": {
                        "option": "u8"
                    }
                },
                {
                    "name": "params_count",
                    "type": {
                        "option": "u8"
                    }
                },
                {
                    "name": "required_params",
                    "type": {
                        "option": "u8"
                    }
                }
            ]
        },
        {
            "name": "withdraw_escrow_v2",
            "docs": [
                "Withdraw from V2 escrow (available balance only)."
            ],
            "discriminator": [
                61,
                198,
                7,
                36,
                2,
                62,
                23,
                71
            ],
            "accounts": [
                {
                    "name": "depositor",
                    "writable": true,
                    "signer": true,
                    "relations": [
                        "escrow"
                    ]
                },
                {
                    "name": "escrow",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    101,
                                    115,
                                    99,
                                    114,
                                    111,
                                    119,
                                    95,
                                    118,
                                    50
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "escrow.agent",
                                "account": "EscrowAccountV2"
                            },
                            {
                                "kind": "account",
                                "path": "depositor"
                            },
                            {
                                "kind": "account",
                                "path": "escrow.escrow_nonce",
                                "account": "EscrowAccountV2"
                            }
                        ]
                    }
                }
            ],
            "args": [
                {
                    "name": "amount",
                    "type": "u64"
                }
            ]
        },
        {
            "name": "write_ledger",
            "docs": [
                "Write to TX log (permanent) + ring buffer (instant read). Cost = TX fee."
            ],
            "discriminator": [
                34,
                191,
                220,
                186,
                97,
                207,
                101,
                202
            ],
            "accounts": [
                {
                    "name": "wallet",
                    "signer": true,
                    "relations": [
                        "agent"
                    ]
                },
                {
                    "name": "session"
                },
                {
                    "name": "vault",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    118,
                                    97,
                                    117,
                                    108,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "agent"
                            }
                        ]
                    },
                    "relations": [
                        "session"
                    ]
                },
                {
                    "name": "agent",
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    97,
                                    103,
                                    101,
                                    110,
                                    116
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "wallet"
                            }
                        ]
                    }
                },
                {
                    "name": "ledger",
                    "writable": true,
                    "pda": {
                        "seeds": [
                            {
                                "kind": "const",
                                "value": [
                                    115,
                                    97,
                                    112,
                                    95,
                                    108,
                                    101,
                                    100,
                                    103,
                                    101,
                                    114
                                ]
                            },
                            {
                                "kind": "account",
                                "path": "session"
                            }
                        ]
                    }
                }
            ],
            "args": [
                {
                    "name": "data",
                    "type": "bytes"
                },
                {
                    "name": "content_hash",
                    "type": {
                        "array": [
                            "u8",
                            32
                        ]
                    }
                }
            ]
        }
    ],
    "accounts": [
        {
            "name": "AgentAccount",
            "discriminator": [
                241,
                119,
                69,
                140,
                233,
                9,
                112,
                50
            ]
        },
        {
            "name": "AgentAttestation",
            "discriminator": [
                46,
                113,
                52,
                95,
                25,
                14,
                49,
                159
            ]
        },
        {
            "name": "AgentPricingMenu",
            "discriminator": [
                181,
                203,
                249,
                3,
                52,
                2,
                117,
                144
            ]
        },
        {
            "name": "AgentStake",
            "discriminator": [
                47,
                68,
                130,
                227,
                185,
                4,
                183,
                36
            ]
        },
        {
            "name": "AgentStats",
            "discriminator": [
                43,
                192,
                26,
                112,
                162,
                176,
                77,
                164
            ]
        },
        {
            "name": "CapabilityIndex",
            "discriminator": [
                128,
                66,
                99,
                20,
                133,
                90,
                103,
                111
            ]
        },
        {
            "name": "CounterShard",
            "discriminator": [
                159,
                207,
                243,
                96,
                242,
                32,
                1,
                236
            ]
        },
        {
            "name": "DisputeRecord",
            "discriminator": [
                198,
                199,
                79,
                209,
                12,
                215,
                34,
                47
            ]
        },
        {
            "name": "EpochPage",
            "discriminator": [
                62,
                89,
                154,
                58,
                228,
                103,
                214,
                46
            ]
        },
        {
            "name": "EscrowAccountV2",
            "discriminator": [
                183,
                99,
                147,
                83,
                8,
                97,
                77,
                9
            ]
        },
        {
            "name": "FeedbackAccount",
            "discriminator": [
                152,
                72,
                187,
                86,
                92,
                83,
                63,
                83
            ]
        },
        {
            "name": "GlobalRegistry",
            "discriminator": [
                100,
                213,
                140,
                104,
                66,
                152,
                15,
                238
            ]
        },
        {
            "name": "IndexPage",
            "discriminator": [
                73,
                90,
                250,
                241,
                119,
                43,
                51,
                207
            ]
        },
        {
            "name": "LedgerPage",
            "discriminator": [
                66,
                54,
                29,
                101,
                10,
                93,
                241,
                133
            ]
        },
        {
            "name": "MemoryLedger",
            "discriminator": [
                221,
                37,
                185,
                196,
                5,
                60,
                146,
                118
            ]
        },
        {
            "name": "MemoryVault",
            "discriminator": [
                113,
                139,
                57,
                17,
                27,
                116,
                85,
                55
            ]
        },
        {
            "name": "PendingSettlement",
            "discriminator": [
                190,
                101,
                205,
                108,
                169,
                184,
                79,
                23
            ]
        },
        {
            "name": "ProtocolIndex",
            "discriminator": [
                89,
                56,
                39,
                201,
                97,
                81,
                212,
                207
            ]
        },
        {
            "name": "ReceiptBatch",
            "discriminator": [
                234,
                250,
                48,
                59,
                242,
                148,
                55,
                76
            ]
        },
        {
            "name": "SessionCheckpoint",
            "discriminator": [
                114,
                36,
                107,
                218,
                96,
                244,
                245,
                185
            ]
        },
        {
            "name": "SessionLedger",
            "discriminator": [
                217,
                126,
                153,
                214,
                91,
                26,
                32,
                179
            ]
        },
        {
            "name": "Subscription",
            "discriminator": [
                64,
                7,
                26,
                135,
                102,
                132,
                98,
                33
            ]
        },
        {
            "name": "ToolCategoryIndex",
            "discriminator": [
                210,
                57,
                189,
                91,
                135,
                66,
                79,
                212
            ]
        },
        {
            "name": "ToolDescriptor",
            "discriminator": [
                255,
                1,
                81,
                23,
                61,
                44,
                100,
                81
            ]
        },
        {
            "name": "VaultDelegate",
            "discriminator": [
                133,
                49,
                228,
                99,
                71,
                78,
                239,
                178
            ]
        }
    ],
    "events": [
        {
            "name": "AccountMigratedEvent",
            "discriminator": [
                109,
                3,
                25,
                119,
                155,
                108,
                69,
                61
            ]
        },
        {
            "name": "AttestationCreatedEvent",
            "discriminator": [
                157,
                10,
                208,
                90,
                87,
                62,
                175,
                26
            ]
        },
        {
            "name": "AttestationRevokedEvent",
            "discriminator": [
                155,
                254,
                201,
                146,
                102,
                212,
                184,
                44
            ]
        },
        {
            "name": "BatchSettledEvent",
            "discriminator": [
                176,
                72,
                133,
                200,
                67,
                14,
                115,
                137
            ]
        },
        {
            "name": "CallsReportedEvent",
            "discriminator": [
                6,
                63,
                29,
                222,
                193,
                101,
                25,
                31
            ]
        },
        {
            "name": "CheckpointCreatedEvent",
            "discriminator": [
                181,
                161,
                28,
                132,
                201,
                8,
                244,
                57
            ]
        },
        {
            "name": "ClosedEvent",
            "discriminator": [
                4,
                69,
                230,
                189,
                244,
                220,
                87,
                241
            ]
        },
        {
            "name": "CoSignedSettlementEvent",
            "discriminator": [
                91,
                228,
                52,
                86,
                226,
                243,
                252,
                52
            ]
        },
        {
            "name": "DeactivatedEvent",
            "discriminator": [
                177,
                181,
                107,
                62,
                81,
                48,
                193,
                138
            ]
        },
        {
            "name": "DelegateAddedEvent",
            "discriminator": [
                217,
                146,
                128,
                179,
                247,
                212,
                54,
                51
            ]
        },
        {
            "name": "DelegateRevokedEvent",
            "discriminator": [
                179,
                5,
                40,
                102,
                53,
                235,
                161,
                202
            ]
        },
        {
            "name": "DisputeAutoResolvedEvent",
            "discriminator": [
                33,
                148,
                81,
                1,
                157,
                126,
                255,
                162
            ]
        },
        {
            "name": "DisputeFiledEvent",
            "discriminator": [
                210,
                85,
                92,
                64,
                250,
                199,
                242,
                51
            ]
        },
        {
            "name": "DisputeResolvedEvent",
            "discriminator": [
                152,
                37,
                98,
                245,
                229,
                39,
                150,
                78
            ]
        },
        {
            "name": "EpochOpenedEvent",
            "discriminator": [
                175,
                77,
                15,
                8,
                189,
                142,
                0,
                142
            ]
        },
        {
            "name": "EpochPageClosedEvent",
            "discriminator": [
                253,
                149,
                52,
                210,
                213,
                175,
                14,
                132
            ]
        },
        {
            "name": "EscrowClosedEvent",
            "discriminator": [
                250,
                190,
                248,
                31,
                52,
                89,
                44,
                175
            ]
        },
        {
            "name": "EscrowCreatedEvent",
            "discriminator": [
                79,
                14,
                137,
                123,
                229,
                161,
                84,
                149
            ]
        },
        {
            "name": "EscrowDepositedEvent",
            "discriminator": [
                12,
                69,
                17,
                182,
                204,
                183,
                134,
                87
            ]
        },
        {
            "name": "EscrowV2CreatedEvent",
            "discriminator": [
                209,
                65,
                223,
                171,
                12,
                230,
                143,
                165
            ]
        },
        {
            "name": "EscrowWithdrawnEvent",
            "discriminator": [
                57,
                209,
                185,
                243,
                211,
                101,
                111,
                117
            ]
        },
        {
            "name": "FeedbackEvent",
            "discriminator": [
                218,
                153,
                37,
                108,
                50,
                135,
                49,
                31
            ]
        },
        {
            "name": "FeedbackRevokedEvent",
            "discriminator": [
                219,
                8,
                11,
                197,
                250,
                96,
                157,
                163
            ]
        },
        {
            "name": "FeedbackUpdatedEvent",
            "discriminator": [
                1,
                60,
                196,
                239,
                51,
                95,
                144,
                49
            ]
        },
        {
            "name": "IndexPageCreatedEvent",
            "discriminator": [
                155,
                91,
                118,
                242,
                0,
                29,
                177,
                125
            ]
        },
        {
            "name": "LedgerEntryEvent",
            "discriminator": [
                245,
                21,
                42,
                218,
                234,
                8,
                53,
                57
            ]
        },
        {
            "name": "LedgerSealedEvent",
            "discriminator": [
                245,
                245,
                130,
                188,
                77,
                237,
                29,
                111
            ]
        },
        {
            "name": "MemoryInscribedEvent",
            "discriminator": [
                186,
                237,
                160,
                197,
                189,
                176,
                199,
                111
            ]
        },
        {
            "name": "PaymentSettledEvent",
            "discriminator": [
                55,
                225,
                225,
                94,
                229,
                8,
                9,
                240
            ]
        },
        {
            "name": "ReactivatedEvent",
            "discriminator": [
                94,
                231,
                47,
                195,
                168,
                133,
                21,
                113
            ]
        },
        {
            "name": "ReceiptBatchInscribedEvent",
            "discriminator": [
                32,
                224,
                182,
                173,
                163,
                100,
                111,
                126
            ]
        },
        {
            "name": "ReceiptProofSubmittedEvent",
            "discriminator": [
                193,
                245,
                192,
                165,
                123,
                181,
                134,
                166
            ]
        },
        {
            "name": "RegisteredEvent",
            "discriminator": [
                75,
                146,
                35,
                119,
                150,
                112,
                15,
                38
            ]
        },
        {
            "name": "ReputationUpdatedEvent",
            "discriminator": [
                27,
                90,
                44,
                140,
                118,
                143,
                175,
                185
            ]
        },
        {
            "name": "SessionClosedEvent",
            "discriminator": [
                120,
                181,
                157,
                20,
                60,
                253,
                37,
                3
            ]
        },
        {
            "name": "SessionOpenedEvent",
            "discriminator": [
                66,
                104,
                156,
                115,
                194,
                112,
                16,
                60
            ]
        },
        {
            "name": "SessionPdaClosedEvent",
            "discriminator": [
                58,
                9,
                134,
                154,
                72,
                16,
                117,
                32
            ]
        },
        {
            "name": "SettlementFinalizedEvent",
            "discriminator": [
                103,
                170,
                37,
                149,
                14,
                193,
                211,
                196
            ]
        },
        {
            "name": "SettlementPendingEvent",
            "discriminator": [
                63,
                188,
                214,
                13,
                244,
                190,
                73,
                252
            ]
        },
        {
            "name": "ShardInitializedEvent",
            "discriminator": [
                48,
                70,
                69,
                255,
                230,
                129,
                144,
                198
            ]
        },
        {
            "name": "StakeClosedEvent",
            "discriminator": [
                212,
                204,
                207,
                181,
                185,
                249,
                134,
                59
            ]
        },
        {
            "name": "StakeDepositedEvent",
            "discriminator": [
                198,
                97,
                85,
                221,
                200,
                240,
                41,
                225
            ]
        },
        {
            "name": "StakeSlashedEvent",
            "discriminator": [
                36,
                212,
                55,
                234,
                110,
                59,
                181,
                251
            ]
        },
        {
            "name": "SubscriptionCancelledEvent",
            "discriminator": [
                10,
                87,
                228,
                73,
                76,
                115,
                135,
                170
            ]
        },
        {
            "name": "SubscriptionClaimedEvent",
            "discriminator": [
                41,
                208,
                232,
                83,
                70,
                123,
                124,
                141
            ]
        },
        {
            "name": "SubscriptionCreatedEvent",
            "discriminator": [
                247,
                246,
                115,
                176,
                253,
                84,
                244,
                155
            ]
        },
        {
            "name": "ToolClosedEvent",
            "discriminator": [
                195,
                38,
                127,
                27,
                205,
                99,
                192,
                122
            ]
        },
        {
            "name": "ToolDeactivatedEvent",
            "discriminator": [
                82,
                23,
                36,
                211,
                111,
                223,
                119,
                79
            ]
        },
        {
            "name": "ToolInvocationReportedEvent",
            "discriminator": [
                166,
                195,
                87,
                1,
                108,
                90,
                220,
                199
            ]
        },
        {
            "name": "ToolPublishedEvent",
            "discriminator": [
                4,
                222,
                61,
                117,
                217,
                91,
                16,
                108
            ]
        },
        {
            "name": "ToolReactivatedEvent",
            "discriminator": [
                205,
                40,
                241,
                82,
                57,
                134,
                245,
                136
            ]
        },
        {
            "name": "ToolSchemaInscribedEvent",
            "discriminator": [
                22,
                25,
                190,
                100,
                231,
                253,
                211,
                127
            ]
        },
        {
            "name": "ToolUpdatedEvent",
            "discriminator": [
                242,
                121,
                139,
                62,
                126,
                65,
                22,
                57
            ]
        },
        {
            "name": "UnstakeCancelledEvent",
            "discriminator": [
                57,
                228,
                7,
                42,
                227,
                64,
                93,
                51
            ]
        },
        {
            "name": "UnstakeCompletedEvent",
            "discriminator": [
                13,
                76,
                65,
                101,
                5,
                226,
                16,
                148
            ]
        },
        {
            "name": "UnstakeRequestedEvent",
            "discriminator": [
                168,
                232,
                211,
                86,
                207,
                240,
                252,
                16
            ]
        },
        {
            "name": "UpdatedEvent",
            "discriminator": [
                55,
                135,
                59,
                13,
                207,
                148,
                26,
                104
            ]
        },
        {
            "name": "VaultClosedEvent",
            "discriminator": [
                104,
                71,
                213,
                247,
                195,
                133,
                16,
                106
            ]
        },
        {
            "name": "VaultInitializedEvent",
            "discriminator": [
                203,
                214,
                91,
                5,
                185,
                248,
                192,
                149
            ]
        },
        {
            "name": "VaultNonceRotatedEvent",
            "discriminator": [
                128,
                89,
                203,
                120,
                81,
                94,
                115,
                124
            ]
        }
    ],
    "errors": [
        {
            "code": 6000,
            "name": "NameTooLong",
            "msg": "name>64"
        },
        {
            "code": 6001,
            "name": "DescriptionTooLong",
            "msg": "desc>256"
        },
        {
            "code": 6002,
            "name": "UriTooLong",
            "msg": "uri>256"
        },
        {
            "code": 6003,
            "name": "TooManyCapabilities",
            "msg": "caps>10"
        },
        {
            "code": 6004,
            "name": "TooManyPricingTiers",
            "msg": "tiers>5"
        },
        {
            "code": 6005,
            "name": "TooManyProtocols",
            "msg": "protos>5"
        },
        {
            "code": 6006,
            "name": "TooManyPlugins",
            "msg": "plugins>5"
        },
        {
            "code": 6007,
            "name": "AlreadyActive",
            "msg": "already active"
        },
        {
            "code": 6008,
            "name": "AlreadyInactive",
            "msg": "already inactive"
        },
        {
            "code": 6009,
            "name": "InvalidFeedbackScore",
            "msg": "score 0-1000"
        },
        {
            "code": 6010,
            "name": "TagTooLong",
            "msg": "tag>32"
        },
        {
            "code": 6011,
            "name": "SelfReviewNotAllowed",
            "msg": "self review"
        },
        {
            "code": 6012,
            "name": "FeedbackAlreadyRevoked",
            "msg": "already revoked"
        },
        {
            "code": 6013,
            "name": "CapabilityIndexFull",
            "msg": "cap idx full"
        },
        {
            "code": 6014,
            "name": "ProtocolIndexFull",
            "msg": "proto idx full"
        },
        {
            "code": 6015,
            "name": "AgentNotInIndex",
            "msg": "not in idx"
        },
        {
            "code": 6016,
            "name": "InvalidCapabilityHash",
            "msg": "cap hash"
        },
        {
            "code": 6017,
            "name": "InvalidProtocolHash",
            "msg": "proto hash"
        },
        {
            "code": 6018,
            "name": "InvalidPluginType",
            "msg": "bad plugin type"
        },
        {
            "code": 6019,
            "name": "ChunkDataTooLarge",
            "msg": "chunk>900"
        },
        {
            "code": 6020,
            "name": "ContentTypeTooLong",
            "msg": "ctype>max"
        },
        {
            "code": 6021,
            "name": "IpfsCidTooLong",
            "msg": "cid>max"
        },
        {
            "code": 6022,
            "name": "EmptyName",
            "msg": "empty name"
        },
        {
            "code": 6023,
            "name": "ControlCharInName",
            "msg": "ctrl char"
        },
        {
            "code": 6024,
            "name": "EmptyDescription",
            "msg": "empty desc"
        },
        {
            "code": 6025,
            "name": "AgentIdTooLong",
            "msg": "agentid>128"
        },
        {
            "code": 6026,
            "name": "InvalidCapabilityFormat",
            "msg": "cap format"
        },
        {
            "code": 6027,
            "name": "DuplicateCapability",
            "msg": "dup cap"
        },
        {
            "code": 6028,
            "name": "EmptyTierId",
            "msg": "empty tier"
        },
        {
            "code": 6029,
            "name": "DuplicateTierId",
            "msg": "dup tier"
        },
        {
            "code": 6030,
            "name": "InvalidRateLimit",
            "msg": "rate=0"
        },
        {
            "code": 6031,
            "name": "SplRequiresTokenMint",
            "msg": "spl needs mint"
        },
        {
            "code": 6032,
            "name": "InvalidX402Endpoint",
            "msg": "x402 https"
        },
        {
            "code": 6033,
            "name": "InvalidVolumeCurve",
            "msg": "curve order"
        },
        {
            "code": 6034,
            "name": "TooManyVolumeCurvePoints",
            "msg": "curve>5"
        },
        {
            "code": 6035,
            "name": "MinPriceExceedsMax",
            "msg": "min>max price"
        },
        {
            "code": 6036,
            "name": "InvalidUptimePercent",
            "msg": "uptime 0-100"
        },
        {
            "code": 6037,
            "name": "SessionClosed",
            "msg": "session closed"
        },
        {
            "code": 6038,
            "name": "InvalidSequence",
            "msg": "bad seq"
        },
        {
            "code": 6039,
            "name": "InvalidFragmentIndex",
            "msg": "frag idx"
        },
        {
            "code": 6040,
            "name": "InscriptionTooLarge",
            "msg": "data>750"
        },
        {
            "code": 6041,
            "name": "EmptyInscription",
            "msg": "empty data"
        },
        {
            "code": 6042,
            "name": "InvalidTotalFragments",
            "msg": "frags<1"
        },
        {
            "code": 6043,
            "name": "EpochMismatch",
            "msg": "epoch mismatch"
        },
        {
            "code": 6044,
            "name": "VaultNotClosed",
            "msg": "vault open"
        },
        {
            "code": 6045,
            "name": "SessionNotClosed",
            "msg": "session open"
        },
        {
            "code": 6046,
            "name": "DelegateExpired",
            "msg": "delegate expired"
        },
        {
            "code": 6047,
            "name": "InvalidDelegate",
            "msg": "bad delegate"
        },
        {
            "code": 6048,
            "name": "ToolNameTooLong",
            "msg": "tool>32"
        },
        {
            "code": 6049,
            "name": "EmptyToolName",
            "msg": "empty tool"
        },
        {
            "code": 6050,
            "name": "InvalidToolNameHash",
            "msg": "tool hash"
        },
        {
            "code": 6051,
            "name": "InvalidToolHttpMethod",
            "msg": "bad method"
        },
        {
            "code": 6052,
            "name": "InvalidToolCategory",
            "msg": "bad category"
        },
        {
            "code": 6053,
            "name": "ToolAlreadyInactive",
            "msg": "tool inactive"
        },
        {
            "code": 6054,
            "name": "ToolAlreadyActive",
            "msg": "tool active"
        },
        {
            "code": 6055,
            "name": "InvalidSchemaHash",
            "msg": "schema hash"
        },
        {
            "code": 6056,
            "name": "InvalidSchemaType",
            "msg": "schema type"
        },
        {
            "code": 6057,
            "name": "InvalidCheckpointIndex",
            "msg": "cp index"
        },
        {
            "code": 6058,
            "name": "FeedbackNotRevoked",
            "msg": "not revoked"
        },
        {
            "code": 6059,
            "name": "IndexNotEmpty",
            "msg": "idx not empty"
        },
        {
            "code": 6060,
            "name": "SessionStillOpen",
            "msg": "session open"
        },
        {
            "code": 6061,
            "name": "NoFieldsToUpdate",
            "msg": "no fields"
        },
        {
            "code": 6062,
            "name": "InsufficientEscrowBalance",
            "msg": "low balance"
        },
        {
            "code": 6063,
            "name": "EscrowMaxCallsExceeded",
            "msg": "max calls"
        },
        {
            "code": 6064,
            "name": "EscrowEmpty",
            "msg": "escrow empty"
        },
        {
            "code": 6065,
            "name": "EscrowNotEmpty",
            "msg": "escrow!=0"
        },
        {
            "code": 6066,
            "name": "InvalidSettlementCalls",
            "msg": "calls<1"
        },
        {
            "code": 6067,
            "name": "AttestationTypeTooLong",
            "msg": "atype>32"
        },
        {
            "code": 6068,
            "name": "EmptyAttestationType",
            "msg": "empty atype"
        },
        {
            "code": 6069,
            "name": "SelfAttestationNotAllowed",
            "msg": "self attest"
        },
        {
            "code": 6070,
            "name": "AttestationAlreadyRevoked",
            "msg": "already revoked"
        },
        {
            "code": 6071,
            "name": "AttestationNotRevoked",
            "msg": "not revoked"
        },
        {
            "code": 6072,
            "name": "ToolCategoryIndexFull",
            "msg": "cat idx full"
        },
        {
            "code": 6073,
            "name": "ToolNotInCategoryIndex",
            "msg": "not in cat"
        },
        {
            "code": 6074,
            "name": "ToolCategoryMismatch",
            "msg": "cat mismatch"
        },
        {
            "code": 6075,
            "name": "ArithmeticOverflow",
            "msg": "overflow"
        },
        {
            "code": 6076,
            "name": "EscrowExpired",
            "msg": "escrow expired"
        },
        {
            "code": 6077,
            "name": "AgentInactive",
            "msg": "agent inactive"
        },
        {
            "code": 6078,
            "name": "AttestationExpired",
            "msg": "attest expired"
        },
        {
            "code": 6079,
            "name": "BufferFull",
            "msg": "buf full"
        },
        {
            "code": 6080,
            "name": "BufferDataTooLarge",
            "msg": "buf>750"
        },
        {
            "code": 6081,
            "name": "Unauthorized",
            "msg": "unauthorized"
        },
        {
            "code": 6082,
            "name": "InvalidSession",
            "msg": "bad session"
        },
        {
            "code": 6083,
            "name": "EmptyDigestHash",
            "msg": "empty hash"
        },
        {
            "code": 6084,
            "name": "LedgerDataTooLarge",
            "msg": "ledger>750"
        },
        {
            "code": 6085,
            "name": "LedgerRingEmpty",
            "msg": "ring empty"
        },
        {
            "code": 6086,
            "name": "BatchEmpty",
            "msg": "batch empty"
        },
        {
            "code": 6087,
            "name": "BatchTooLarge",
            "msg": "batch>10"
        },
        {
            "code": 6088,
            "name": "SplTokenRequired",
            "msg": "spl accts"
        },
        {
            "code": 6089,
            "name": "InvalidTokenAccount",
            "msg": "bad token"
        },
        {
            "code": 6090,
            "name": "InvalidTokenProgram",
            "msg": "bad prog"
        },
        {
            "code": 6091,
            "name": "InvalidPaymentToken",
            "msg": "payment token not accepted (USDC only)"
        },
        {
            "code": 6092,
            "name": "InvalidSettlementSecurity",
            "msg": "bad security"
        },
        {
            "code": 6093,
            "name": "CoSignerRequired",
            "msg": "cosigner"
        },
        {
            "code": 6094,
            "name": "InvalidCoSigner",
            "msg": "bad cosigner"
        },
        {
            "code": 6095,
            "name": "InvalidArbiter",
            "msg": "bad arbiter"
        },
        {
            "code": 6096,
            "name": "ArbiterRequired",
            "msg": "arbiter=0"
        },
        {
            "code": 6097,
            "name": "EscrowNonceReused",
            "msg": "nonce reused"
        },
        {
            "code": 6098,
            "name": "SettlementNotPending",
            "msg": "not pending"
        },
        {
            "code": 6099,
            "name": "SettlementAlreadyFinalized",
            "msg": "already final"
        },
        {
            "code": 6100,
            "name": "DisputeWindowNotExpired",
            "msg": "too early"
        },
        {
            "code": 6101,
            "name": "DisputeWindowExpired",
            "msg": "window closed"
        },
        {
            "code": 6102,
            "name": "NotDepositor",
            "msg": "not depositor"
        },
        {
            "code": 6103,
            "name": "DisputeAlreadyFiled",
            "msg": "dup dispute"
        },
        {
            "code": 6104,
            "name": "DisputeStillOpen",
            "msg": "dispute open"
        },
        {
            "code": 6105,
            "name": "NotArbiter",
            "msg": "not arbiter"
        },
        {
            "code": 6106,
            "name": "InvalidDisputeOutcome",
            "msg": "bad outcome"
        },
        {
            "code": 6107,
            "name": "StakeBelowMinimum",
            "msg": "stake<min"
        },
        {
            "code": 6108,
            "name": "NoStakeAccount",
            "msg": "no stake"
        },
        {
            "code": 6109,
            "name": "UnstakeAlreadyPending",
            "msg": "unstake pending"
        },
        {
            "code": 6110,
            "name": "UnstakeCooldownNotMet",
            "msg": "cooldown"
        },
        {
            "code": 6111,
            "name": "NoUnstakePending",
            "msg": "no unstake"
        },
        {
            "code": 6112,
            "name": "SlashExceedsStake",
            "msg": "slash>stake"
        },
        {
            "code": 6113,
            "name": "SubscriptionAlreadyActive",
            "msg": "sub active"
        },
        {
            "code": 6114,
            "name": "SubscriptionCancelled",
            "msg": "sub cancelled"
        },
        {
            "code": 6115,
            "name": "NoIntervalDue",
            "msg": "no due"
        },
        {
            "code": 6116,
            "name": "SubscriptionInsufficientBalance",
            "msg": "sub low bal"
        },
        {
            "code": 6117,
            "name": "InvalidBillingInterval",
            "msg": "bad interval"
        },
        {
            "code": 6118,
            "name": "InvalidShardIndex",
            "msg": "bad shard"
        },
        {
            "code": 6119,
            "name": "IndexPageFull",
            "msg": "page full"
        },
        {
            "code": 6120,
            "name": "InvalidPageIndex",
            "msg": "bad page"
        },
        {
            "code": 6121,
            "name": "IndexPageNotEmpty",
            "msg": "page≠empty"
        },
        {
            "code": 6122,
            "name": "AlreadyMigrated",
            "msg": "already v2"
        },
        {
            "code": 6123,
            "name": "MigrationV1Only",
            "msg": "v1 only"
        },
        {
            "code": 6124,
            "name": "SettlementDisputed",
            "msg": "disputed"
        },
        {
            "code": 6125,
            "name": "InvalidAgentWallet",
            "msg": "bad agent wallet"
        },
        {
            "code": 6126,
            "name": "StakeAgentMismatch",
            "msg": "stake agent mismatch"
        },
        {
            "code": 6127,
            "name": "NotAuthority",
            "msg": "not authority"
        },
        {
            "code": 6128,
            "name": "UnstakeBelowRent",
            "msg": "unstake below rent"
        },
        {
            "code": 6129,
            "name": "InsufficientStake",
            "msg": "insufficient stake"
        },
        {
            "code": 6130,
            "name": "SelfReportDeprecated",
            "msg": "SelfReport deprecated"
        },
        {
            "code": 6131,
            "name": "ArbiterDeprecated",
            "msg": "arbiter deprecated"
        },
        {
            "code": 6132,
            "name": "InvalidBatchIndex",
            "msg": "bad batch idx"
        },
        {
            "code": 6133,
            "name": "InvalidPeriod",
            "msg": "bad period"
        },
        {
            "code": 6134,
            "name": "InvalidDisputeType",
            "msg": "bad dispute type"
        },
        {
            "code": 6135,
            "name": "ProofDeadlineExpired",
            "msg": "proof expired"
        },
        {
            "code": 6136,
            "name": "ProofDeadlineNotExpired",
            "msg": "proof not expired"
        },
        {
            "code": 6137,
            "name": "InvalidReceiptProof",
            "msg": "bad receipt proof"
        },
        {
            "code": 6138,
            "name": "SettlementReplay",
            "msg": "settlement replay"
        },
        {
            "code": 6139,
            "name": "PaymentTokenNotAllowed",
            "msg": "token not allowed"
        },
        {
            "code": 6140,
            "name": "AgentStakeRequired",
            "msg": "agent stake required"
        },
        {
            "code": 6141,
            "name": "DelegateExpiryInvalid",
            "msg": "delegate expiry invalid"
        },
        {
            "code": 6142,
            "name": "EscrowNotClosed",
            "msg": "escrow not closed"
        },
        {
            "code": 6143,
            "name": "VolumeCurveNotDescending",
            "msg": "curve not descending"
        },
        {
            "code": 6144,
            "name": "DuplicateServiceHash",
            "msg": "dup service hash"
        },
        {
            "code": 6145,
            "name": "StakeBelowCoverage",
            "msg": "stake under coverage"
        },
        {
            "code": 6146,
            "name": "StakeNotClosable",
            "msg": "stake not closable"
        },
        {
            "code": 6147,
            "name": "AgentStakeAccountMissing",
            "msg": "agent stake account missing"
        },
        {
            "code": 6148,
            "name": "PricingTierNotFound",
            "msg": "requested price_per_call does not match any tier in the agent pricing menu"
        },
        {
            "code": 6149,
            "name": "AgentStatsMigrationRequired",
            "msg": "agent stats must be upgraded before this operation (active_escrows field missing)"
        },
        {
            "code": 6150,
            "name": "InvalidPricingMenu",
            "msg": "pricing menu is invalid or empty (at least one tier required)"
        },
        {
            "code": 6151,
            "name": "MaxCallsPerSettlementExceeded",
            "msg": "calls per settlement exceeds maximum allowed (max 10000)"
        },
        {
            "code": 6152,
            "name": "InvalidVolumeCurvePrice",
            "msg": "volume curve breakpoint price must be > 0"
        },
        {
            "code": 6153,
            "name": "EscrowCoverageExceeded",
            "msg": "escrow deposit would exceed the agent's staked coverage limit"
        },
        {
            "code": 6154,
            "name": "CoSignerIsAgentWallet",
            "msg": "co-signer cannot be the agent wallet itself"
        },
        {
            "code": 6155,
            "name": "EscrowAlreadyExpired",
            "msg": "escrow has already expired"
        },
        {
            "code": 6156,
            "name": "PendingSettlementExists",
            "msg": "escrow has an unresolved pending settlement"
        },
        {
            "code": 6157,
            "name": "TokenAccountOwnerMismatch",
            "msg": "token account owner mismatch"
        },
        {
            "code": 6158,
            "name": "InvalidTreasury",
            "msg": "invalid protocol treasury account"
        },
        {
            "code": 6159,
            "name": "PendingSettlementRequired",
            "msg": "pending settlement PDA required"
        },
        {
            "code": 6160,
            "name": "InvalidPendingSettlement",
            "msg": "invalid pending settlement PDA"
        },
        {
            "code": 6161,
            "name": "PendingSettlementDeprecated",
            "msg": "create_pending_settlement is deprecated; use settle_calls_v2"
        },
        {
            "code": 6162,
            "name": "MaxReceiptProofExceeded",
            "msg": "receipt proof exceeds maximum allowed count"
        },
        {
            "code": 6163,
            "name": "MaxMerkleDepthExceeded",
            "msg": "merkle proof depth exceeds maximum allowed"
        },
        {
            "code": 6164,
            "name": "PendingAmountMismatch",
            "msg": "pending settlement amount does not match escrow pending amount"
        },
        {
            "code": 6165,
            "name": "StakeSlashLocksUnstake",
            "msg": "stake slash would lock unstake request"
        },
        {
            "code": 6166,
            "name": "InvalidPricePerCall",
            "msg": "price per call must be > 0"
        },
        {
            "code": 6167,
            "name": "SubscriptionIntervalOverflow",
            "msg": "subscription intervals overflow"
        },
        {
            "code": 6168,
            "name": "AgentStatsVersionMismatch",
            "msg": "agent stats version mismatch — migration required"
        },
        {
            "code": 6169,
            "name": "EscrowVersionMismatch",
            "msg": "escrow version mismatch — migration required"
        },
        {
            "code": 6170,
            "name": "ReceiptProofAlreadySubmitted",
            "msg": "receipt proof already submitted for this dispute"
        },
        {
            "code": 6171,
            "name": "DuplicateReceiptProof",
            "msg": "duplicate receipt proof"
        },
        {
            "code": 6172,
            "name": "MissingReceiptSignature",
            "msg": "missing verified receipt signature"
        },
        {
            "code": 6173,
            "name": "AgentCapabilityMismatch",
            "msg": "agent does not declare this capability"
        },
        {
            "code": 6174,
            "name": "AgentProtocolMismatch",
            "msg": "agent does not declare this protocol"
        },
        {
            "code": 6175,
            "name": "InvalidToolParameterCount",
            "msg": "required params exceeds params count"
        },
        {
            "code": 6176,
            "name": "ActiveEscrowCounterUnderflow",
            "msg": "active escrow counter underflow"
        }
    ],
    "types": [
        {
            "name": "AccountMigratedEvent",
            "docs": [
                "Account migrated to v2 layout."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "account",
                        "type": "pubkey"
                    },
                    {
                        "name": "account_type",
                        "type": "string"
                    },
                    {
                        "name": "from_version",
                        "type": "u8"
                    },
                    {
                        "name": "to_version",
                        "type": "u8"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "AgentAccount",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "version",
                        "type": "u8"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "name",
                        "type": "string"
                    },
                    {
                        "name": "description",
                        "type": "string"
                    },
                    {
                        "name": "agent_id",
                        "type": {
                            "option": "string"
                        }
                    },
                    {
                        "name": "agent_uri",
                        "type": {
                            "option": "string"
                        }
                    },
                    {
                        "name": "x402_endpoint",
                        "type": {
                            "option": "string"
                        }
                    },
                    {
                        "name": "is_active",
                        "type": "bool"
                    },
                    {
                        "name": "created_at",
                        "type": "i64"
                    },
                    {
                        "name": "updated_at",
                        "type": "i64"
                    },
                    {
                        "name": "reputation_score",
                        "type": "u32"
                    },
                    {
                        "name": "total_feedbacks",
                        "type": "u32"
                    },
                    {
                        "name": "reputation_sum",
                        "type": "u64"
                    },
                    {
                        "name": "total_calls_served",
                        "docs": [
                            "DEPRECATED: use AgentStats.total_calls_served (hot-path PDA)"
                        ],
                        "type": "u64"
                    },
                    {
                        "name": "avg_latency_ms",
                        "type": "u32"
                    },
                    {
                        "name": "uptime_percent",
                        "type": "u8"
                    },
                    {
                        "name": "capabilities",
                        "type": {
                            "vec": {
                                "defined": {
                                    "name": "Capability"
                                }
                            }
                        }
                    },
                    {
                        "name": "pricing",
                        "type": {
                            "vec": {
                                "defined": {
                                    "name": "PricingTier"
                                }
                            }
                        }
                    },
                    {
                        "name": "protocols",
                        "type": {
                            "vec": "string"
                        }
                    },
                    {
                        "name": "active_plugins",
                        "type": {
                            "vec": {
                                "defined": {
                                    "name": "PluginRef"
                                }
                            }
                        }
                    }
                ]
            }
        },
        {
            "name": "AgentAttestation",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "attester",
                        "type": "pubkey"
                    },
                    {
                        "name": "attestation_type",
                        "type": "string"
                    },
                    {
                        "name": "metadata_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "is_active",
                        "type": "bool"
                    },
                    {
                        "name": "expires_at",
                        "type": "i64"
                    },
                    {
                        "name": "created_at",
                        "type": "i64"
                    },
                    {
                        "name": "updated_at",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "AgentPricingMenu",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "tiers",
                        "docs": [
                            "Copy of AgentAccount pricing at creation time.",
                            "Max 10 tiers — enough for typical SaaS ladder."
                        ],
                        "type": {
                            "vec": {
                                "defined": {
                                    "name": "PricingTier"
                                }
                            }
                        }
                    },
                    {
                        "name": "updated_at",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "AgentStake",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "staked_amount",
                        "type": "u64"
                    },
                    {
                        "name": "slashed_amount",
                        "type": "u64"
                    },
                    {
                        "name": "last_stake_at",
                        "type": "i64"
                    },
                    {
                        "name": "unstake_requested_at",
                        "type": "i64"
                    },
                    {
                        "name": "unstake_amount",
                        "type": "u64"
                    },
                    {
                        "name": "unstake_available_at",
                        "type": "i64"
                    },
                    {
                        "name": "total_disputes_won",
                        "type": "u32"
                    },
                    {
                        "name": "total_disputes_lost",
                        "type": "u32"
                    },
                    {
                        "name": "created_at",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "AgentStats",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "total_calls_served",
                        "type": "u64"
                    },
                    {
                        "name": "is_active",
                        "type": "bool"
                    },
                    {
                        "name": "active_escrows",
                        "docs": [
                            "v0.12 H-1 hardening: counter of open escrows for this agent.",
                            "Incremented on create_escrow, decremented on close_escrow.",
                            "close_agent refuses to execute unless this is zero."
                        ],
                        "type": "u32"
                    },
                    {
                        "name": "updated_at",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "AttestationCreatedEvent",
            "docs": [
                "Attestation created."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "attester",
                        "type": "pubkey"
                    },
                    {
                        "name": "attestation_type",
                        "type": "string"
                    },
                    {
                        "name": "expires_at",
                        "type": "i64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "AttestationRevokedEvent",
            "docs": [
                "Attestation revoked."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "attester",
                        "type": "pubkey"
                    },
                    {
                        "name": "attestation_type",
                        "type": "string"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "BatchSettledEvent",
            "docs": [
                "Batch settlement. service_hashes preserved for dispute resolution."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "depositor",
                        "type": "pubkey"
                    },
                    {
                        "name": "num_settlements",
                        "type": "u8"
                    },
                    {
                        "name": "total_calls",
                        "type": "u64"
                    },
                    {
                        "name": "total_amount",
                        "type": "u64"
                    },
                    {
                        "name": "service_hashes",
                        "type": {
                            "vec": {
                                "array": [
                                    "u8",
                                    32
                                ]
                            }
                        }
                    },
                    {
                        "name": "calls_per_settlement",
                        "type": {
                            "vec": "u64"
                        }
                    },
                    {
                        "name": "remaining_balance",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "BillingInterval",
            "docs": [
                "Subscription billing interval."
            ],
            "type": {
                "kind": "enum",
                "variants": [
                    {
                        "name": "Daily"
                    },
                    {
                        "name": "Weekly"
                    },
                    {
                        "name": "Monthly"
                    }
                ]
            }
        },
        {
            "name": "CallsReportedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "calls_reported",
                        "type": "u64"
                    },
                    {
                        "name": "total_calls_served",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "Capability",
            "docs": [
                "Agent capability descriptor."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "id",
                        "docs": [
                            "Capability ID, e.g. \"jupiter:swap\""
                        ],
                        "type": "string"
                    },
                    {
                        "name": "description",
                        "docs": [
                            "Description"
                        ],
                        "type": {
                            "option": "string"
                        }
                    },
                    {
                        "name": "protocol_id",
                        "docs": [
                            "Protocol group, e.g. \"jupiter\""
                        ],
                        "type": {
                            "option": "string"
                        }
                    },
                    {
                        "name": "version",
                        "docs": [
                            "Semver, e.g. \"1.0.0\""
                        ],
                        "type": {
                            "option": "string"
                        }
                    }
                ]
            }
        },
        {
            "name": "CapabilityIndex",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "capability_id",
                        "type": "string"
                    },
                    {
                        "name": "capability_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "agents",
                        "type": {
                            "vec": "pubkey"
                        }
                    },
                    {
                        "name": "total_pages",
                        "type": "u8"
                    },
                    {
                        "name": "last_updated",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "CheckpointCreatedEvent",
            "docs": [
                "Session checkpoint created."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "session",
                        "type": "pubkey"
                    },
                    {
                        "name": "checkpoint",
                        "type": "pubkey"
                    },
                    {
                        "name": "checkpoint_index",
                        "type": "u32"
                    },
                    {
                        "name": "merkle_root",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "sequence_at",
                        "type": "u32"
                    },
                    {
                        "name": "epoch_at",
                        "type": "u32"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "ClosedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "CoSignedSettlementEvent",
            "docs": [
                "Co-signed settlement executed immediately (CoSigned mode)."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "depositor",
                        "type": "pubkey"
                    },
                    {
                        "name": "co_signer",
                        "type": "pubkey"
                    },
                    {
                        "name": "calls_settled",
                        "type": "u64"
                    },
                    {
                        "name": "amount",
                        "type": "u64"
                    },
                    {
                        "name": "service_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "CounterShard",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "shard_index",
                        "type": "u8"
                    },
                    {
                        "name": "total_agents",
                        "type": "u64"
                    },
                    {
                        "name": "active_agents",
                        "type": "u64"
                    },
                    {
                        "name": "total_feedbacks",
                        "type": "u64"
                    },
                    {
                        "name": "total_tools",
                        "type": "u32"
                    },
                    {
                        "name": "total_vaults",
                        "type": "u32"
                    },
                    {
                        "name": "total_attestations",
                        "type": "u32"
                    },
                    {
                        "name": "total_settlements",
                        "type": "u64"
                    },
                    {
                        "name": "total_disputes",
                        "type": "u32"
                    },
                    {
                        "name": "total_subscriptions",
                        "type": "u32"
                    },
                    {
                        "name": "last_updated",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "DeactivatedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "DelegateAddedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "vault",
                        "type": "pubkey"
                    },
                    {
                        "name": "delegate",
                        "type": "pubkey"
                    },
                    {
                        "name": "permissions",
                        "type": "u8"
                    },
                    {
                        "name": "expires_at",
                        "type": "i64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "DelegateRevokedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "vault",
                        "type": "pubkey"
                    },
                    {
                        "name": "delegate",
                        "type": "pubkey"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "DisputeAutoResolvedEvent",
            "docs": [
                "Dispute auto-resolved via receipt proofs (no arbiter)."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "dispute",
                        "type": "pubkey"
                    },
                    {
                        "name": "pending_settlement",
                        "type": "pubkey"
                    },
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "outcome",
                        "type": "u8"
                    },
                    {
                        "name": "proven_calls",
                        "type": "u32"
                    },
                    {
                        "name": "claimed_calls",
                        "type": "u32"
                    },
                    {
                        "name": "agent_amount",
                        "type": "u64"
                    },
                    {
                        "name": "depositor_amount",
                        "type": "u64"
                    },
                    {
                        "name": "slash_amount",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "DisputeFiledEvent",
            "docs": [
                "Dispute filed by depositor."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "dispute",
                        "type": "pubkey"
                    },
                    {
                        "name": "pending_settlement",
                        "type": "pubkey"
                    },
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "depositor",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "evidence_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "dispute_type",
                        "type": "u8"
                    },
                    {
                        "name": "dispute_bond",
                        "type": "u64"
                    },
                    {
                        "name": "proof_deadline",
                        "type": "i64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "DisputeOutcome",
            "docs": [
                "Dispute resolution outcome."
            ],
            "type": {
                "kind": "enum",
                "variants": [
                    {
                        "name": "Pending"
                    },
                    {
                        "name": "DepositorWins"
                    },
                    {
                        "name": "AgentWins"
                    },
                    {
                        "name": "AutoReleased"
                    },
                    {
                        "name": "PartialRefund"
                    },
                    {
                        "name": "Split"
                    }
                ]
            }
        },
        {
            "name": "DisputeRecord",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "pending_settlement",
                        "type": "pubkey"
                    },
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "depositor",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "dispute_type",
                        "type": {
                            "defined": {
                                "name": "DisputeType"
                            }
                        }
                    },
                    {
                        "name": "evidence_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "agent_evidence_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "outcome",
                        "type": {
                            "defined": {
                                "name": "DisputeOutcome"
                            }
                        }
                    },
                    {
                        "name": "resolution_layer",
                        "type": {
                            "defined": {
                                "name": "ResolutionLayer"
                            }
                        }
                    },
                    {
                        "name": "created_at",
                        "type": "i64"
                    },
                    {
                        "name": "resolved_at",
                        "type": "i64"
                    },
                    {
                        "name": "resolution_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "slash_amount",
                        "type": "u64"
                    },
                    {
                        "name": "dispute_bond",
                        "type": "u64"
                    },
                    {
                        "name": "proven_calls",
                        "type": "u32"
                    },
                    {
                        "name": "claimed_calls",
                        "type": "u32"
                    },
                    {
                        "name": "proof_deadline",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "DisputeResolvedEvent",
            "docs": [
                "Dispute resolved by arbiter."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "dispute",
                        "type": "pubkey"
                    },
                    {
                        "name": "pending_settlement",
                        "type": "pubkey"
                    },
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "outcome",
                        "type": "u8"
                    },
                    {
                        "name": "slash_amount",
                        "type": "u64"
                    },
                    {
                        "name": "resolution_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "DisputeType",
            "docs": [
                "Dispute type — determines resolution path."
            ],
            "type": {
                "kind": "enum",
                "variants": [
                    {
                        "name": "NonDelivery"
                    },
                    {
                        "name": "PartialDelivery"
                    },
                    {
                        "name": "Overcharge"
                    },
                    {
                        "name": "Quality"
                    }
                ]
            }
        },
        {
            "name": "EpochOpenedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "session",
                        "type": "pubkey"
                    },
                    {
                        "name": "epoch_page",
                        "type": "pubkey"
                    },
                    {
                        "name": "epoch_index",
                        "type": "u32"
                    },
                    {
                        "name": "start_sequence",
                        "type": "u32"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "EpochPage",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "session",
                        "type": "pubkey"
                    },
                    {
                        "name": "epoch_index",
                        "type": "u32"
                    },
                    {
                        "name": "start_sequence",
                        "type": "u32"
                    },
                    {
                        "name": "inscription_count",
                        "type": "u16"
                    },
                    {
                        "name": "total_bytes",
                        "type": "u32"
                    },
                    {
                        "name": "first_ts",
                        "type": "i64"
                    },
                    {
                        "name": "last_ts",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "EpochPageClosedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "session",
                        "type": "pubkey"
                    },
                    {
                        "name": "epoch_page",
                        "type": "pubkey"
                    },
                    {
                        "name": "epoch_index",
                        "type": "u32"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "EscrowAccountV2",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "version",
                        "type": "u8"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "depositor",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent_wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "escrow_nonce",
                        "type": "u64"
                    },
                    {
                        "name": "balance",
                        "type": "u64"
                    },
                    {
                        "name": "total_deposited",
                        "type": "u64"
                    },
                    {
                        "name": "total_settled",
                        "type": "u64"
                    },
                    {
                        "name": "total_calls_settled",
                        "type": "u64"
                    },
                    {
                        "name": "price_per_call",
                        "type": "u64"
                    },
                    {
                        "name": "max_calls",
                        "type": "u64"
                    },
                    {
                        "name": "created_at",
                        "type": "i64"
                    },
                    {
                        "name": "last_settled_at",
                        "type": "i64"
                    },
                    {
                        "name": "expires_at",
                        "type": "i64"
                    },
                    {
                        "name": "volume_curve",
                        "type": {
                            "vec": {
                                "defined": {
                                    "name": "VolumeCurveBreakpoint"
                                }
                            }
                        }
                    },
                    {
                        "name": "token_mint",
                        "type": {
                            "option": "pubkey"
                        }
                    },
                    {
                        "name": "token_decimals",
                        "type": "u8"
                    },
                    {
                        "name": "settlement_security",
                        "type": {
                            "defined": {
                                "name": "SettlementSecurity"
                            }
                        }
                    },
                    {
                        "name": "dispute_window_slots",
                        "type": "u64"
                    },
                    {
                        "name": "settlement_index",
                        "type": "u64"
                    },
                    {
                        "name": "co_signer",
                        "type": {
                            "option": "pubkey"
                        }
                    },
                    {
                        "name": "arbiter",
                        "docs": [
                            "DEPRECATED in v0.7 — arbiter removed, disputes auto-resolved via receipts"
                        ],
                        "type": {
                            "option": "pubkey"
                        }
                    },
                    {
                        "name": "pending_amount",
                        "type": "u64"
                    },
                    {
                        "name": "pending_calls",
                        "type": "u64"
                    },
                    {
                        "name": "receipt_batch_count",
                        "type": "u32"
                    },
                    {
                        "name": "dispute_bond_total",
                        "docs": [
                            "Cumulative dispute bonds held in escrow (orphan protection)."
                        ],
                        "type": "u64"
                    },
                    {
                        "name": "max_obligation",
                        "docs": [
                            "Maximum balance allowed (set at creation time based on stake coverage)."
                        ],
                        "type": "u64"
                    },
                    {
                        "name": "pending_settlement_count",
                        "docs": [
                            "Number of non-finalized PendingSettlement PDAs for this escrow."
                        ],
                        "type": "u32"
                    }
                ]
            }
        },
        {
            "name": "EscrowClosedEvent",
            "docs": [
                "Escrow closed. Rent returned to depositor. Balance was already 0."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "depositor",
                        "type": "pubkey"
                    },
                    {
                        "name": "total_settled",
                        "type": "u64"
                    },
                    {
                        "name": "total_calls_settled",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "EscrowCreatedEvent",
            "docs": [
                "Escrow created for micropayments."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "depositor",
                        "type": "pubkey"
                    },
                    {
                        "name": "price_per_call",
                        "type": "u64"
                    },
                    {
                        "name": "max_calls",
                        "type": "u64"
                    },
                    {
                        "name": "initial_deposit",
                        "type": "u64"
                    },
                    {
                        "name": "expires_at",
                        "type": "i64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "EscrowDepositedEvent",
            "docs": [
                "Additional escrow deposit."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "depositor",
                        "type": "pubkey"
                    },
                    {
                        "name": "amount",
                        "type": "u64"
                    },
                    {
                        "name": "new_balance",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "EscrowV2CreatedEvent",
            "docs": [
                "EscrowV2 created with settlement security mode."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "depositor",
                        "type": "pubkey"
                    },
                    {
                        "name": "escrow_nonce",
                        "type": "u64"
                    },
                    {
                        "name": "price_per_call",
                        "type": "u64"
                    },
                    {
                        "name": "max_calls",
                        "type": "u64"
                    },
                    {
                        "name": "initial_deposit",
                        "type": "u64"
                    },
                    {
                        "name": "settlement_security",
                        "type": "u8"
                    },
                    {
                        "name": "dispute_window_slots",
                        "type": "u64"
                    },
                    {
                        "name": "co_signer",
                        "type": {
                            "option": "pubkey"
                        }
                    },
                    {
                        "name": "arbiter",
                        "type": {
                            "option": "pubkey"
                        }
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "EscrowWithdrawnEvent",
            "docs": [
                "Escrow withdrawal."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "depositor",
                        "type": "pubkey"
                    },
                    {
                        "name": "amount",
                        "type": "u64"
                    },
                    {
                        "name": "remaining_balance",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "FeedbackAccount",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "reviewer",
                        "type": "pubkey"
                    },
                    {
                        "name": "score",
                        "type": "u16"
                    },
                    {
                        "name": "tag",
                        "type": "string"
                    },
                    {
                        "name": "comment_hash",
                        "type": {
                            "option": {
                                "array": [
                                    "u8",
                                    32
                                ]
                            }
                        }
                    },
                    {
                        "name": "created_at",
                        "type": "i64"
                    },
                    {
                        "name": "updated_at",
                        "type": "i64"
                    },
                    {
                        "name": "is_revoked",
                        "type": "bool"
                    }
                ]
            }
        },
        {
            "name": "FeedbackEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "reviewer",
                        "type": "pubkey"
                    },
                    {
                        "name": "score",
                        "type": "u16"
                    },
                    {
                        "name": "tag",
                        "type": "string"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "FeedbackRevokedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "reviewer",
                        "type": "pubkey"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "FeedbackUpdatedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "reviewer",
                        "type": "pubkey"
                    },
                    {
                        "name": "old_score",
                        "type": "u16"
                    },
                    {
                        "name": "new_score",
                        "type": "u16"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "GlobalRegistry",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "total_agents",
                        "type": "u64"
                    },
                    {
                        "name": "active_agents",
                        "type": "u64"
                    },
                    {
                        "name": "total_feedbacks",
                        "type": "u64"
                    },
                    {
                        "name": "total_capabilities",
                        "type": "u32"
                    },
                    {
                        "name": "total_protocols",
                        "type": "u32"
                    },
                    {
                        "name": "last_registered_at",
                        "type": "i64"
                    },
                    {
                        "name": "initialized_at",
                        "type": "i64"
                    },
                    {
                        "name": "authority",
                        "type": "pubkey"
                    },
                    {
                        "name": "total_tools",
                        "type": "u32"
                    },
                    {
                        "name": "total_vaults",
                        "type": "u32"
                    },
                    {
                        "name": "total_escrows",
                        "docs": [
                            "DEPRECATED: escrow no longer updates GlobalRegistry"
                        ],
                        "type": "u32"
                    },
                    {
                        "name": "total_attestations",
                        "type": "u32"
                    }
                ]
            }
        },
        {
            "name": "IndexPage",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "parent_index",
                        "type": "pubkey"
                    },
                    {
                        "name": "page_index",
                        "type": "u8"
                    },
                    {
                        "name": "entries",
                        "type": {
                            "vec": "pubkey"
                        }
                    },
                    {
                        "name": "last_updated",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "IndexPageCreatedEvent",
            "docs": [
                "Overflow index page created."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "parent_index",
                        "type": "pubkey"
                    },
                    {
                        "name": "index_page",
                        "type": "pubkey"
                    },
                    {
                        "name": "page_index",
                        "type": "u8"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "LedgerEntryEvent",
            "docs": [
                "Ledger write. Carries data in TX log — permanent, immutable."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "session",
                        "type": "pubkey"
                    },
                    {
                        "name": "ledger",
                        "type": "pubkey"
                    },
                    {
                        "name": "entry_index",
                        "type": "u32"
                    },
                    {
                        "name": "data",
                        "type": "bytes"
                    },
                    {
                        "name": "content_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "data_len",
                        "type": "u32"
                    },
                    {
                        "name": "merkle_root",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "LedgerPage",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "ledger",
                        "type": "pubkey"
                    },
                    {
                        "name": "page_index",
                        "type": "u32"
                    },
                    {
                        "name": "sealed_at",
                        "type": "i64"
                    },
                    {
                        "name": "entries_in_page",
                        "type": "u32"
                    },
                    {
                        "name": "data_size",
                        "type": "u32"
                    },
                    {
                        "name": "merkle_root_at_seal",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "data",
                        "type": "bytes"
                    }
                ]
            }
        },
        {
            "name": "LedgerSealedEvent",
            "docs": [
                "Ring sealed into permanent page. Write-once, no close exists."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "session",
                        "type": "pubkey"
                    },
                    {
                        "name": "ledger",
                        "type": "pubkey"
                    },
                    {
                        "name": "page",
                        "type": "pubkey"
                    },
                    {
                        "name": "page_index",
                        "type": "u32"
                    },
                    {
                        "name": "entries_in_page",
                        "type": "u32"
                    },
                    {
                        "name": "data_size",
                        "type": "u32"
                    },
                    {
                        "name": "merkle_root_at_seal",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "MemoryInscribedEvent",
            "docs": [
                "AES-256-GCM ciphertext inscription. Permanent TX log, zero rent.",
                "compression: 0=none, 1=deflate, 2=gzip, 3=brotli."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "vault",
                        "type": "pubkey"
                    },
                    {
                        "name": "session",
                        "type": "pubkey"
                    },
                    {
                        "name": "sequence",
                        "type": "u32"
                    },
                    {
                        "name": "epoch_index",
                        "type": "u32"
                    },
                    {
                        "name": "encrypted_data",
                        "type": "bytes"
                    },
                    {
                        "name": "nonce",
                        "type": {
                            "array": [
                                "u8",
                                12
                            ]
                        }
                    },
                    {
                        "name": "content_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "total_fragments",
                        "type": "u8"
                    },
                    {
                        "name": "fragment_index",
                        "type": "u8"
                    },
                    {
                        "name": "compression",
                        "type": "u8"
                    },
                    {
                        "name": "data_len",
                        "type": "u32"
                    },
                    {
                        "name": "nonce_version",
                        "type": "u32"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "MemoryLedger",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "session",
                        "type": "pubkey"
                    },
                    {
                        "name": "authority",
                        "type": "pubkey"
                    },
                    {
                        "name": "num_entries",
                        "type": "u32"
                    },
                    {
                        "name": "merkle_root",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "latest_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "total_data_size",
                        "type": "u64"
                    },
                    {
                        "name": "created_at",
                        "type": "i64"
                    },
                    {
                        "name": "updated_at",
                        "type": "i64"
                    },
                    {
                        "name": "num_pages",
                        "type": "u32"
                    },
                    {
                        "name": "ring",
                        "type": "bytes"
                    }
                ]
            }
        },
        {
            "name": "MemoryVault",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "vault_nonce",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "total_sessions",
                        "type": "u32"
                    },
                    {
                        "name": "total_inscriptions",
                        "type": "u64"
                    },
                    {
                        "name": "total_bytes_inscribed",
                        "type": "u64"
                    },
                    {
                        "name": "created_at",
                        "type": "i64"
                    },
                    {
                        "name": "protocol_version",
                        "type": "u8"
                    },
                    {
                        "name": "nonce_version",
                        "type": "u32"
                    },
                    {
                        "name": "last_nonce_rotation",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "PaymentSettledEvent",
            "docs": [
                "Payment receipt. service_hash = sha256 proof of service."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "depositor",
                        "type": "pubkey"
                    },
                    {
                        "name": "calls_settled",
                        "type": "u64"
                    },
                    {
                        "name": "amount",
                        "type": "u64"
                    },
                    {
                        "name": "service_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "total_calls_settled",
                        "type": "u64"
                    },
                    {
                        "name": "remaining_balance",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "PendingSettlement",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent_wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "depositor",
                        "type": "pubkey"
                    },
                    {
                        "name": "settlement_index",
                        "type": "u64"
                    },
                    {
                        "name": "calls_to_settle",
                        "type": "u64"
                    },
                    {
                        "name": "amount",
                        "type": "u64"
                    },
                    {
                        "name": "service_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "receipt_merkle_root",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "created_at",
                        "type": "i64"
                    },
                    {
                        "name": "release_slot",
                        "type": "u64"
                    },
                    {
                        "name": "is_finalized",
                        "type": "bool"
                    },
                    {
                        "name": "is_disputed",
                        "type": "bool"
                    },
                    {
                        "name": "outcome",
                        "type": {
                            "defined": {
                                "name": "DisputeOutcome"
                            }
                        }
                    }
                ]
            }
        },
        {
            "name": "PluginRef",
            "docs": [
                "Reference to an active plugin PDA"
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "plugin_type",
                        "type": {
                            "defined": {
                                "name": "PluginType"
                            }
                        }
                    },
                    {
                        "name": "pda",
                        "type": "pubkey"
                    }
                ]
            }
        },
        {
            "name": "PluginType",
            "type": {
                "kind": "enum",
                "variants": [
                    {
                        "name": "Memory"
                    },
                    {
                        "name": "Validation"
                    },
                    {
                        "name": "Delegation"
                    },
                    {
                        "name": "Analytics"
                    },
                    {
                        "name": "Governance"
                    },
                    {
                        "name": "Custom"
                    }
                ]
            }
        },
        {
            "name": "PricingTier",
            "docs": [
                "Pricing tier for agent services."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "tier_id",
                        "docs": [
                            "Tier ID, e.g. \"standard\""
                        ],
                        "type": "string"
                    },
                    {
                        "name": "price_per_call",
                        "docs": [
                            "Base price per call (smallest unit)"
                        ],
                        "type": "u64"
                    },
                    {
                        "name": "min_price_per_call",
                        "docs": [
                            "Price floor (optional)"
                        ],
                        "type": {
                            "option": "u64"
                        }
                    },
                    {
                        "name": "max_price_per_call",
                        "docs": [
                            "Price ceiling (optional)"
                        ],
                        "type": {
                            "option": "u64"
                        }
                    },
                    {
                        "name": "rate_limit",
                        "docs": [
                            "Max calls/sec"
                        ],
                        "type": "u32"
                    },
                    {
                        "name": "max_calls_per_session",
                        "docs": [
                            "Max calls/session (0=unlimited)"
                        ],
                        "type": "u32"
                    },
                    {
                        "name": "burst_limit",
                        "docs": [
                            "Max burst/sec (optional)"
                        ],
                        "type": {
                            "option": "u32"
                        }
                    },
                    {
                        "name": "token_type",
                        "docs": [
                            "Token type"
                        ],
                        "type": {
                            "defined": {
                                "name": "TokenType"
                            }
                        }
                    },
                    {
                        "name": "token_mint",
                        "docs": [
                            "SPL mint (required if Spl)"
                        ],
                        "type": {
                            "option": "pubkey"
                        }
                    },
                    {
                        "name": "token_decimals",
                        "docs": [
                            "Token decimals (9=SOL, 6=USDC)"
                        ],
                        "type": {
                            "option": "u8"
                        }
                    },
                    {
                        "name": "settlement_mode",
                        "docs": [
                            "Settlement mode"
                        ],
                        "type": {
                            "option": {
                                "defined": {
                                    "name": "SettlementMode"
                                }
                            }
                        }
                    },
                    {
                        "name": "min_escrow_deposit",
                        "docs": [
                            "Min escrow deposit (Escrow mode)"
                        ],
                        "type": {
                            "option": "u64"
                        }
                    },
                    {
                        "name": "batch_interval_sec",
                        "docs": [
                            "Batch interval sec (Batched mode)"
                        ],
                        "type": {
                            "option": "u32"
                        }
                    },
                    {
                        "name": "volume_curve",
                        "docs": [
                            "Volume discount curve (max 5)"
                        ],
                        "type": {
                            "option": {
                                "vec": {
                                    "defined": {
                                        "name": "VolumeCurveBreakpoint"
                                    }
                                }
                            }
                        }
                    }
                ]
            }
        },
        {
            "name": "ProtocolIndex",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "protocol_id",
                        "type": "string"
                    },
                    {
                        "name": "protocol_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "agents",
                        "type": {
                            "vec": "pubkey"
                        }
                    },
                    {
                        "name": "total_pages",
                        "type": "u8"
                    },
                    {
                        "name": "last_updated",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "ReactivatedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "ReceiptBatch",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "batch_index",
                        "type": "u32"
                    },
                    {
                        "name": "merkle_root",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "call_count",
                        "type": "u32"
                    },
                    {
                        "name": "period_start",
                        "type": "i64"
                    },
                    {
                        "name": "period_end",
                        "type": "i64"
                    },
                    {
                        "name": "inscribed_at",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "ReceiptBatchInscribedEvent",
            "docs": [
                "Receipt batch committed on-chain."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "batch_index",
                        "type": "u32"
                    },
                    {
                        "name": "merkle_root",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "call_count",
                        "type": "u32"
                    },
                    {
                        "name": "period_start",
                        "type": "i64"
                    },
                    {
                        "name": "period_end",
                        "type": "i64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "ReceiptProofSubmittedEvent",
            "docs": [
                "Receipt proof submitted during dispute."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "dispute",
                        "type": "pubkey"
                    },
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "receipts_submitted",
                        "type": "u32"
                    },
                    {
                        "name": "receipts_verified",
                        "type": "u32"
                    },
                    {
                        "name": "total_proven",
                        "type": "u32"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "RegisteredEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "name",
                        "type": "string"
                    },
                    {
                        "name": "capabilities",
                        "type": {
                            "vec": "string"
                        }
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "ReputationUpdatedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "avg_latency_ms",
                        "type": "u32"
                    },
                    {
                        "name": "uptime_percent",
                        "type": "u8"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "ResolutionLayer",
            "docs": [
                "Resolution layer — how the dispute was resolved."
            ],
            "type": {
                "kind": "enum",
                "variants": [
                    {
                        "name": "Pending"
                    },
                    {
                        "name": "Auto"
                    },
                    {
                        "name": "Governance"
                    }
                ]
            }
        },
        {
            "name": "SessionCheckpoint",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "session",
                        "type": "pubkey"
                    },
                    {
                        "name": "checkpoint_index",
                        "type": "u32"
                    },
                    {
                        "name": "merkle_root",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "sequence_at",
                        "type": "u32"
                    },
                    {
                        "name": "epoch_at",
                        "type": "u32"
                    },
                    {
                        "name": "total_bytes_at",
                        "type": "u64"
                    },
                    {
                        "name": "inscriptions_at",
                        "type": "u64"
                    },
                    {
                        "name": "created_at",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "SessionClosedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "vault",
                        "type": "pubkey"
                    },
                    {
                        "name": "session",
                        "type": "pubkey"
                    },
                    {
                        "name": "total_inscriptions",
                        "type": "u32"
                    },
                    {
                        "name": "total_bytes",
                        "type": "u64"
                    },
                    {
                        "name": "total_epochs",
                        "type": "u32"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "SessionLedger",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "vault",
                        "type": "pubkey"
                    },
                    {
                        "name": "session_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "sequence_counter",
                        "type": "u32"
                    },
                    {
                        "name": "total_bytes",
                        "type": "u64"
                    },
                    {
                        "name": "current_epoch",
                        "type": "u32"
                    },
                    {
                        "name": "total_epochs",
                        "type": "u32"
                    },
                    {
                        "name": "created_at",
                        "type": "i64"
                    },
                    {
                        "name": "last_inscribed_at",
                        "type": "i64"
                    },
                    {
                        "name": "is_closed",
                        "type": "bool"
                    },
                    {
                        "name": "merkle_root",
                        "docs": [
                            "Rolling merkle: sha256(prev_root || content_hash). Tamper-proof chain."
                        ],
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "total_checkpoints",
                        "docs": [
                            "Checkpoints created for this session."
                        ],
                        "type": "u32"
                    },
                    {
                        "name": "tip_hash",
                        "docs": [
                            "Last content_hash. O(1) change detection. [0;32] = none."
                        ],
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    }
                ]
            }
        },
        {
            "name": "SessionOpenedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "vault",
                        "type": "pubkey"
                    },
                    {
                        "name": "session",
                        "type": "pubkey"
                    },
                    {
                        "name": "session_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "SessionPdaClosedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "vault",
                        "type": "pubkey"
                    },
                    {
                        "name": "session",
                        "type": "pubkey"
                    },
                    {
                        "name": "total_inscriptions",
                        "type": "u32"
                    },
                    {
                        "name": "total_bytes",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "SettlementFinalizedEvent",
            "docs": [
                "Pending settlement finalized (auto-released after dispute window)."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "pending_settlement",
                        "type": "pubkey"
                    },
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "amount",
                        "type": "u64"
                    },
                    {
                        "name": "calls_settled",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "SettlementMode",
            "type": {
                "kind": "enum",
                "variants": [
                    {
                        "name": "Instant"
                    },
                    {
                        "name": "Escrow"
                    },
                    {
                        "name": "Batched"
                    },
                    {
                        "name": "X402"
                    }
                ]
            }
        },
        {
            "name": "SettlementPendingEvent",
            "docs": [
                "Settlement entered pending state (DisputeWindow mode)."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "pending_settlement",
                        "type": "pubkey"
                    },
                    {
                        "name": "escrow",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "depositor",
                        "type": "pubkey"
                    },
                    {
                        "name": "settlement_index",
                        "type": "u64"
                    },
                    {
                        "name": "calls_to_settle",
                        "type": "u64"
                    },
                    {
                        "name": "amount",
                        "type": "u64"
                    },
                    {
                        "name": "service_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "release_slot",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "SettlementSecurity",
            "docs": [
                "Settlement security level — determines how settle_calls is authorized."
            ],
            "type": {
                "kind": "enum",
                "variants": [
                    {
                        "name": "SelfReport"
                    },
                    {
                        "name": "CoSigned"
                    },
                    {
                        "name": "DisputeWindow"
                    }
                ]
            }
        },
        {
            "name": "ShardInitializedEvent",
            "docs": [
                "Counter shard initialized."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "shard",
                        "type": "pubkey"
                    },
                    {
                        "name": "shard_index",
                        "type": "u8"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "StakeClosedEvent",
            "docs": [
                "v0.11 L-3: emitted when an agent's stake account is closed and rent reclaimed."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "returned_lamports",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "StakeDepositedEvent",
            "docs": [
                "Agent staked collateral."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "amount",
                        "type": "u64"
                    },
                    {
                        "name": "total_staked",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "StakeSlashedEvent",
            "docs": [
                "Stake slashed due to lost dispute."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "dispute",
                        "type": "pubkey"
                    },
                    {
                        "name": "slash_amount",
                        "type": "u64"
                    },
                    {
                        "name": "remaining_staked",
                        "type": "u64"
                    },
                    {
                        "name": "compensated_to",
                        "type": "pubkey"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "Subscription",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "subscriber",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent_wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "sub_id",
                        "type": "u64"
                    },
                    {
                        "name": "price_per_interval",
                        "type": "u64"
                    },
                    {
                        "name": "billing_interval",
                        "type": {
                            "defined": {
                                "name": "BillingInterval"
                            }
                        }
                    },
                    {
                        "name": "token_mint",
                        "type": {
                            "option": "pubkey"
                        }
                    },
                    {
                        "name": "token_decimals",
                        "type": "u8"
                    },
                    {
                        "name": "balance",
                        "type": "u64"
                    },
                    {
                        "name": "total_paid",
                        "type": "u64"
                    },
                    {
                        "name": "intervals_paid",
                        "type": "u32"
                    },
                    {
                        "name": "started_at",
                        "type": "i64"
                    },
                    {
                        "name": "last_claimed_at",
                        "type": "i64"
                    },
                    {
                        "name": "cancelled_at",
                        "type": "i64"
                    },
                    {
                        "name": "next_due_at",
                        "type": "i64"
                    },
                    {
                        "name": "created_at",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "SubscriptionCancelledEvent",
            "docs": [
                "Subscription cancelled (pro-rata refund available)."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "subscription",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "subscriber",
                        "type": "pubkey"
                    },
                    {
                        "name": "refund_amount",
                        "type": "u64"
                    },
                    {
                        "name": "intervals_used",
                        "type": "u32"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "SubscriptionClaimedEvent",
            "docs": [
                "Subscription interval claimed by agent."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "subscription",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "subscriber",
                        "type": "pubkey"
                    },
                    {
                        "name": "amount",
                        "type": "u64"
                    },
                    {
                        "name": "intervals_paid",
                        "type": "u32"
                    },
                    {
                        "name": "remaining_balance",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "SubscriptionCreatedEvent",
            "docs": [
                "New subscription created and funded."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "subscription",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "subscriber",
                        "type": "pubkey"
                    },
                    {
                        "name": "sub_id",
                        "type": "u64"
                    },
                    {
                        "name": "price_per_interval",
                        "type": "u64"
                    },
                    {
                        "name": "billing_interval",
                        "type": "u8"
                    },
                    {
                        "name": "initial_deposit",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "TokenType",
            "type": {
                "kind": "enum",
                "variants": [
                    {
                        "name": "Sol"
                    },
                    {
                        "name": "Usdc"
                    },
                    {
                        "name": "Spl"
                    }
                ]
            }
        },
        {
            "name": "ToolCategory",
            "docs": [
                "Tool category for discovery filtering."
            ],
            "type": {
                "kind": "enum",
                "variants": [
                    {
                        "name": "Swap"
                    },
                    {
                        "name": "Lend"
                    },
                    {
                        "name": "Stake"
                    },
                    {
                        "name": "Nft"
                    },
                    {
                        "name": "Payment"
                    },
                    {
                        "name": "Data"
                    },
                    {
                        "name": "Governance"
                    },
                    {
                        "name": "Bridge"
                    },
                    {
                        "name": "Analytics"
                    },
                    {
                        "name": "Custom"
                    }
                ]
            }
        },
        {
            "name": "ToolCategoryIndex",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "category",
                        "type": "u8"
                    },
                    {
                        "name": "tools",
                        "type": {
                            "vec": "pubkey"
                        }
                    },
                    {
                        "name": "total_pages",
                        "type": "u8"
                    },
                    {
                        "name": "last_updated",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "ToolClosedEvent",
            "docs": [
                "Tool PDA closed, rent recovered."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "tool",
                        "type": "pubkey"
                    },
                    {
                        "name": "tool_name",
                        "type": "string"
                    },
                    {
                        "name": "total_invocations",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "ToolDeactivatedEvent",
            "docs": [
                "Tool deactivated."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "tool",
                        "type": "pubkey"
                    },
                    {
                        "name": "tool_name",
                        "type": "string"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "ToolDescriptor",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "tool_name_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "tool_name",
                        "type": "string"
                    },
                    {
                        "name": "protocol_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "version",
                        "type": "u16"
                    },
                    {
                        "name": "description_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "input_schema_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "output_schema_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "http_method",
                        "type": {
                            "defined": {
                                "name": "ToolHttpMethod"
                            }
                        }
                    },
                    {
                        "name": "category",
                        "type": {
                            "defined": {
                                "name": "ToolCategory"
                            }
                        }
                    },
                    {
                        "name": "params_count",
                        "type": "u8"
                    },
                    {
                        "name": "required_params",
                        "type": "u8"
                    },
                    {
                        "name": "is_compound",
                        "type": "bool"
                    },
                    {
                        "name": "is_active",
                        "type": "bool"
                    },
                    {
                        "name": "total_invocations",
                        "type": "u64"
                    },
                    {
                        "name": "created_at",
                        "type": "i64"
                    },
                    {
                        "name": "updated_at",
                        "type": "i64"
                    },
                    {
                        "name": "previous_version",
                        "type": "pubkey"
                    }
                ]
            }
        },
        {
            "name": "ToolHttpMethod",
            "docs": [
                "HTTP method enum for tool descriptor."
            ],
            "type": {
                "kind": "enum",
                "variants": [
                    {
                        "name": "Get"
                    },
                    {
                        "name": "Post"
                    },
                    {
                        "name": "Put"
                    },
                    {
                        "name": "Delete"
                    },
                    {
                        "name": "Compound"
                    }
                ]
            }
        },
        {
            "name": "ToolInvocationReportedEvent",
            "docs": [
                "Tool invocation counter reported."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "tool",
                        "type": "pubkey"
                    },
                    {
                        "name": "invocations_reported",
                        "type": "u64"
                    },
                    {
                        "name": "total_invocations",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "ToolPublishedEvent",
            "docs": [
                "Tool descriptor published. Schema JSON inscribed via ToolSchemaInscribedEvent."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "tool",
                        "type": "pubkey"
                    },
                    {
                        "name": "tool_name",
                        "type": "string"
                    },
                    {
                        "name": "protocol_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "version",
                        "type": "u16"
                    },
                    {
                        "name": "http_method",
                        "type": "u8"
                    },
                    {
                        "name": "category",
                        "type": "u8"
                    },
                    {
                        "name": "params_count",
                        "type": "u8"
                    },
                    {
                        "name": "required_params",
                        "type": "u8"
                    },
                    {
                        "name": "is_compound",
                        "type": "bool"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "ToolReactivatedEvent",
            "docs": [
                "Tool reactivated."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "tool",
                        "type": "pubkey"
                    },
                    {
                        "name": "tool_name",
                        "type": "string"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "ToolSchemaInscribedEvent",
            "docs": [
                "Full JSON schema inscribed to TX log. schema_type: 0=input, 1=output, 2=desc.",
                "Verify: sha256(schema_data) == schema_hash. compression: 0=none, 1=deflate."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "tool",
                        "type": "pubkey"
                    },
                    {
                        "name": "tool_name",
                        "type": "string"
                    },
                    {
                        "name": "schema_type",
                        "type": "u8"
                    },
                    {
                        "name": "schema_data",
                        "type": "bytes"
                    },
                    {
                        "name": "schema_hash",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "compression",
                        "type": "u8"
                    },
                    {
                        "name": "version",
                        "type": "u16"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "ToolUpdatedEvent",
            "docs": [
                "Tool schema updated, version bumped."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "tool",
                        "type": "pubkey"
                    },
                    {
                        "name": "tool_name",
                        "type": "string"
                    },
                    {
                        "name": "old_version",
                        "type": "u16"
                    },
                    {
                        "name": "new_version",
                        "type": "u16"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "UnstakeCancelledEvent",
            "docs": [
                "v0.11 L-2: emitted when a `deposit_stake` clears a previously requested",
                "unstake (top-up = implicit cancel of the pending withdrawal)."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "cancelled_amount",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "UnstakeCompletedEvent",
            "docs": [
                "Unstake completed after cooldown."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "amount",
                        "type": "u64"
                    },
                    {
                        "name": "remaining_staked",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "UnstakeRequestedEvent",
            "docs": [
                "Unstake requested (starts cooldown)."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "amount",
                        "type": "u64"
                    },
                    {
                        "name": "available_at",
                        "type": "i64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "UpdatedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "updated_fields",
                        "type": {
                            "vec": "string"
                        }
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "VaultClosedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "vault",
                        "type": "pubkey"
                    },
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "total_sessions",
                        "type": "u32"
                    },
                    {
                        "name": "total_inscriptions",
                        "type": "u64"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "VaultDelegate",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "bump",
                        "type": "u8"
                    },
                    {
                        "name": "vault",
                        "type": "pubkey"
                    },
                    {
                        "name": "delegate",
                        "type": "pubkey"
                    },
                    {
                        "name": "permissions",
                        "type": "u8"
                    },
                    {
                        "name": "expires_at",
                        "type": "i64"
                    },
                    {
                        "name": "created_at",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "VaultInitializedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "agent",
                        "type": "pubkey"
                    },
                    {
                        "name": "vault",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "VaultNonceRotatedEvent",
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "vault",
                        "type": "pubkey"
                    },
                    {
                        "name": "wallet",
                        "type": "pubkey"
                    },
                    {
                        "name": "old_nonce",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "new_nonce",
                        "type": {
                            "array": [
                                "u8",
                                32
                            ]
                        }
                    },
                    {
                        "name": "nonce_version",
                        "type": "u32"
                    },
                    {
                        "name": "timestamp",
                        "type": "i64"
                    }
                ]
            }
        },
        {
            "name": "VolumeCurveBreakpoint",
            "docs": [
                "Volume curve breakpoint for tiered billing."
            ],
            "type": {
                "kind": "struct",
                "fields": [
                    {
                        "name": "after_calls",
                        "docs": [
                            "Cumulative calls threshold"
                        ],
                        "type": "u32"
                    },
                    {
                        "name": "price_per_call",
                        "docs": [
                            "Price per call after threshold (smallest unit)"
                        ],
                        "type": "u64"
                    }
                ]
            }
        }
    ]
}
