@oobe-protocol-labs/synapse-sap-sdk 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +986 -0
- package/dist/cjs/client.js +30 -13
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/constants/addresses.js +143 -0
- package/dist/cjs/constants/addresses.js.map +1 -0
- package/dist/cjs/constants/index.js +64 -0
- package/dist/cjs/constants/index.js.map +1 -0
- package/dist/cjs/constants/limits.js +161 -0
- package/dist/cjs/constants/limits.js.map +1 -0
- package/dist/cjs/constants/network.js +81 -0
- package/dist/cjs/constants/network.js.map +1 -0
- package/dist/cjs/constants/payments.js +137 -0
- package/dist/cjs/constants/payments.js.map +1 -0
- package/dist/cjs/constants/programs.js +78 -0
- package/dist/cjs/constants/programs.js.map +1 -0
- package/dist/cjs/constants/seeds.js +76 -0
- package/dist/cjs/constants/seeds.js.map +1 -0
- package/dist/cjs/constants.js +39 -32
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/core/client.js +546 -0
- package/dist/cjs/core/client.js.map +1 -0
- package/dist/cjs/core/connection.js +350 -0
- package/dist/cjs/core/connection.js.map +1 -0
- package/dist/cjs/core/index.js +25 -0
- package/dist/cjs/core/index.js.map +1 -0
- package/dist/cjs/errors/index.js +334 -0
- package/dist/cjs/errors/index.js.map +1 -0
- package/dist/cjs/errors.js +15 -5
- package/dist/cjs/errors.js.map +1 -1
- package/dist/cjs/events/geyser.js +295 -0
- package/dist/cjs/events/geyser.js.map +1 -0
- package/dist/cjs/events/index.js +32 -26
- package/dist/cjs/events/index.js.map +1 -1
- package/dist/cjs/idl/index.js +63 -0
- package/dist/cjs/idl/index.js.map +1 -0
- package/dist/cjs/idl/synapse_agent_sap.json +14595 -0
- package/dist/cjs/instructions/agent.js +1 -0
- package/dist/cjs/instructions/agent.js.map +1 -1
- package/dist/cjs/instructions/attestation.js +1 -0
- package/dist/cjs/instructions/attestation.js.map +1 -1
- package/dist/cjs/instructions/digest.js +1 -0
- package/dist/cjs/instructions/digest.js.map +1 -1
- package/dist/cjs/instructions/dispute.js +1 -0
- package/dist/cjs/instructions/dispute.js.map +1 -1
- package/dist/cjs/instructions/escrow.js +1 -0
- package/dist/cjs/instructions/escrow.js.map +1 -1
- package/dist/cjs/instructions/global.js +1 -0
- package/dist/cjs/instructions/global.js.map +1 -1
- package/dist/cjs/instructions/indexing.js +1 -0
- package/dist/cjs/instructions/indexing.js.map +1 -1
- package/dist/cjs/instructions/misc.js +1 -0
- package/dist/cjs/instructions/misc.js.map +1 -1
- package/dist/cjs/instructions/session.js +1 -0
- package/dist/cjs/instructions/session.js.map +1 -1
- package/dist/cjs/instructions/staking.js +1 -0
- package/dist/cjs/instructions/staking.js.map +1 -1
- package/dist/cjs/instructions/subscription.js +1 -0
- package/dist/cjs/instructions/subscription.js.map +1 -1
- package/dist/cjs/instructions/tools.js +1 -0
- package/dist/cjs/instructions/tools.js.map +1 -1
- package/dist/cjs/instructions/vault.js +1 -0
- package/dist/cjs/instructions/vault.js.map +1 -1
- package/dist/cjs/modules/agent.js +272 -0
- package/dist/cjs/modules/agent.js.map +1 -0
- package/dist/cjs/modules/attestation.js +147 -0
- package/dist/cjs/modules/attestation.js.map +1 -0
- package/dist/cjs/modules/base.js +189 -0
- package/dist/cjs/modules/base.js.map +1 -0
- package/dist/cjs/modules/escrow-v2.js +607 -0
- package/dist/cjs/modules/escrow-v2.js.map +1 -0
- package/dist/cjs/modules/escrow.js +336 -0
- package/dist/cjs/modules/escrow.js.map +1 -0
- package/dist/cjs/modules/feedback.js +166 -0
- package/dist/cjs/modules/feedback.js.map +1 -0
- package/dist/cjs/modules/index.js +43 -0
- package/dist/cjs/modules/index.js.map +1 -0
- package/dist/cjs/modules/indexing.js +375 -0
- package/dist/cjs/modules/indexing.js.map +1 -0
- package/dist/cjs/modules/ledger.js +234 -0
- package/dist/cjs/modules/ledger.js.map +1 -0
- package/dist/cjs/modules/receipt.js +148 -0
- package/dist/cjs/modules/receipt.js.map +1 -0
- package/dist/cjs/modules/staking.js +159 -0
- package/dist/cjs/modules/staking.js.map +1 -0
- package/dist/cjs/modules/subscription.js +96 -0
- package/dist/cjs/modules/subscription.js.map +1 -0
- package/dist/cjs/modules/tools.js +345 -0
- package/dist/cjs/modules/tools.js.map +1 -0
- package/dist/cjs/modules/vault.js +427 -0
- package/dist/cjs/modules/vault.js.map +1 -0
- package/dist/cjs/parser/client.js +146 -0
- package/dist/cjs/parser/client.js.map +1 -0
- package/dist/cjs/parser/complete.js +177 -0
- package/dist/cjs/parser/complete.js.map +1 -0
- package/dist/cjs/parser/index.js +57 -0
- package/dist/cjs/parser/index.js.map +1 -0
- package/dist/cjs/parser/inner.js +185 -0
- package/dist/cjs/parser/inner.js.map +1 -0
- package/dist/cjs/parser/instructions.js +114 -0
- package/dist/cjs/parser/instructions.js.map +1 -0
- package/dist/cjs/parser/transaction.js +153 -0
- package/dist/cjs/parser/transaction.js.map +1 -0
- package/dist/cjs/parser/types.js +14 -0
- package/dist/cjs/parser/types.js.map +1 -0
- package/dist/cjs/pda/index.js +672 -0
- package/dist/cjs/pda/index.js.map +1 -0
- package/dist/cjs/plugin/index.js +952 -0
- package/dist/cjs/plugin/index.js.map +1 -0
- package/dist/cjs/plugin/protocols.js +282 -0
- package/dist/cjs/plugin/protocols.js.map +1 -0
- package/dist/cjs/plugin/schemas.js +863 -0
- package/dist/cjs/plugin/schemas.js.map +1 -0
- package/dist/cjs/postgres/adapter.js +715 -0
- package/dist/cjs/postgres/adapter.js.map +1 -0
- package/dist/cjs/postgres/index.js +50 -0
- package/dist/cjs/postgres/index.js.map +1 -0
- package/dist/cjs/postgres/serializers.js +381 -0
- package/dist/cjs/postgres/serializers.js.map +1 -0
- package/dist/cjs/postgres/sync.js +289 -0
- package/dist/cjs/postgres/sync.js.map +1 -0
- package/dist/cjs/postgres/types.js +44 -0
- package/dist/cjs/postgres/types.js.map +1 -0
- package/dist/cjs/registries/builder.js +414 -0
- package/dist/cjs/registries/builder.js.map +1 -0
- package/dist/cjs/registries/discovery.js +362 -0
- package/dist/cjs/registries/discovery.js.map +1 -0
- package/dist/cjs/registries/fairscale.js +639 -0
- package/dist/cjs/registries/fairscale.js.map +1 -0
- package/dist/cjs/registries/index.js +58 -0
- package/dist/cjs/registries/index.js.map +1 -0
- package/dist/cjs/registries/metaplex-bridge.js +743 -0
- package/dist/cjs/registries/metaplex-bridge.js.map +1 -0
- package/dist/cjs/registries/session.js +433 -0
- package/dist/cjs/registries/session.js.map +1 -0
- package/dist/cjs/registries/x402.js +668 -0
- package/dist/cjs/registries/x402.js.map +1 -0
- package/dist/cjs/types/accounts.js +13 -0
- package/dist/cjs/types/accounts.js.map +1 -0
- package/dist/cjs/types/common.js +13 -0
- package/dist/cjs/types/common.js.map +1 -0
- package/dist/cjs/types/endpoint.js +15 -0
- package/dist/cjs/types/endpoint.js.map +1 -0
- package/dist/cjs/types/enums.js +269 -0
- package/dist/cjs/types/enums.js.map +1 -0
- package/dist/cjs/types/index.js +41 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/types/instructions.js +92 -0
- package/dist/cjs/types/instructions.js.map +1 -0
- package/dist/cjs/types.js +4 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/utils/anchor-errors.js +453 -0
- package/dist/cjs/utils/anchor-errors.js.map +1 -0
- package/dist/cjs/utils/endpoint-validator.js +232 -0
- package/dist/cjs/utils/endpoint-validator.js.map +1 -0
- package/dist/cjs/utils/escrow-validation.js +219 -0
- package/dist/cjs/utils/escrow-validation.js.map +1 -0
- package/dist/cjs/utils/hash.js +109 -0
- package/dist/cjs/utils/hash.js.map +1 -0
- package/dist/cjs/utils/index.js +10 -4
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/merchant-validator.js +246 -0
- package/dist/cjs/utils/merchant-validator.js.map +1 -0
- package/dist/cjs/utils/network-normalizer.js +236 -0
- package/dist/cjs/utils/network-normalizer.js.map +1 -0
- package/dist/cjs/utils/priority-fee.js +215 -0
- package/dist/cjs/utils/priority-fee.js.map +1 -0
- package/dist/cjs/utils/rpc-strategy.js +239 -0
- package/dist/cjs/utils/rpc-strategy.js.map +1 -0
- package/dist/cjs/utils/schemas.js +331 -0
- package/dist/cjs/utils/schemas.js.map +1 -0
- package/dist/cjs/utils/serialization.js +105 -0
- package/dist/cjs/utils/serialization.js.map +1 -0
- package/dist/cjs/utils/validate.js +1 -1
- package/dist/cjs/utils/validate.js.map +1 -1
- package/dist/cjs/utils/validation.js +36 -0
- package/dist/cjs/utils/validation.js.map +1 -0
- package/dist/cjs/utils/volume-curve.js +117 -0
- package/dist/cjs/utils/volume-curve.js.map +1 -0
- package/dist/cjs/utils/x402-direct.js +231 -0
- package/dist/cjs/utils/x402-direct.js.map +1 -0
- package/dist/esm/client.js +30 -13
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/constants/addresses.d.ts +117 -0
- package/dist/esm/constants/addresses.d.ts.map +1 -0
- package/dist/esm/constants/addresses.js +140 -0
- package/dist/esm/constants/addresses.js.map +1 -0
- package/dist/esm/constants/index.d.ts +31 -0
- package/dist/esm/constants/index.d.ts.map +1 -0
- package/dist/esm/constants/index.js +35 -0
- package/dist/esm/constants/index.js.map +1 -0
- package/dist/esm/constants/limits.d.ts +149 -0
- package/dist/esm/constants/limits.d.ts.map +1 -0
- package/dist/esm/constants/limits.js +158 -0
- package/dist/esm/constants/limits.js.map +1 -0
- package/dist/esm/constants/network.d.ts +81 -0
- package/dist/esm/constants/network.d.ts.map +1 -0
- package/dist/esm/constants/network.js +78 -0
- package/dist/esm/constants/network.js.map +1 -0
- package/dist/esm/constants/payments.d.ts +121 -0
- package/dist/esm/constants/payments.d.ts.map +1 -0
- package/dist/esm/constants/payments.js +131 -0
- package/dist/esm/constants/payments.js.map +1 -0
- package/dist/esm/constants/programs.d.ts +69 -0
- package/dist/esm/constants/programs.d.ts.map +1 -0
- package/dist/esm/constants/programs.js +75 -0
- package/dist/esm/constants/programs.js.map +1 -0
- package/dist/esm/constants/seeds.d.ts +80 -0
- package/dist/esm/constants/seeds.d.ts.map +1 -0
- package/dist/esm/constants/seeds.js +73 -0
- package/dist/esm/constants/seeds.js.map +1 -0
- package/dist/esm/constants.d.ts +14 -27
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/constants.js +16 -31
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/core/client.d.ts +452 -0
- package/dist/esm/core/client.d.ts.map +1 -0
- package/dist/esm/core/client.js +539 -0
- package/dist/esm/core/client.js.map +1 -0
- package/dist/esm/core/connection.d.ts +305 -0
- package/dist/esm/core/connection.d.ts.map +1 -0
- package/dist/esm/core/connection.js +345 -0
- package/dist/esm/core/connection.js.map +1 -0
- package/dist/esm/core/index.d.ts +20 -0
- package/dist/esm/core/index.d.ts.map +1 -0
- package/dist/esm/core/index.js +19 -0
- package/dist/esm/core/index.js.map +1 -0
- package/dist/esm/errors/index.d.ts +276 -0
- package/dist/esm/errors/index.d.ts.map +1 -0
- package/dist/esm/errors/index.js +325 -0
- package/dist/esm/errors/index.js.map +1 -0
- package/dist/esm/errors.d.ts +8 -0
- package/dist/esm/errors.d.ts.map +1 -1
- package/dist/esm/errors.js +8 -0
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/events/geyser.d.ts +150 -0
- package/dist/esm/events/geyser.d.ts.map +1 -0
- package/dist/esm/events/geyser.js +258 -0
- package/dist/esm/events/geyser.js.map +1 -0
- package/dist/esm/events/index.d.ts +11 -7
- package/dist/esm/events/index.d.ts.map +1 -1
- package/dist/esm/events/index.js +30 -26
- package/dist/esm/events/index.js.map +1 -1
- package/dist/esm/idl/index.d.ts +70 -0
- package/dist/esm/idl/index.d.ts.map +1 -0
- package/dist/esm/idl/index.js +57 -0
- package/dist/esm/idl/index.js.map +1 -0
- package/dist/esm/idl/synapse_agent_sap.json +14595 -0
- package/dist/esm/instructions/agent.js +1 -0
- package/dist/esm/instructions/agent.js.map +1 -1
- package/dist/esm/instructions/attestation.js +1 -0
- package/dist/esm/instructions/attestation.js.map +1 -1
- package/dist/esm/instructions/digest.js +1 -0
- package/dist/esm/instructions/digest.js.map +1 -1
- package/dist/esm/instructions/dispute.js +1 -0
- package/dist/esm/instructions/dispute.js.map +1 -1
- package/dist/esm/instructions/escrow.js +1 -0
- package/dist/esm/instructions/escrow.js.map +1 -1
- package/dist/esm/instructions/global.js +1 -0
- package/dist/esm/instructions/global.js.map +1 -1
- package/dist/esm/instructions/indexing.js +1 -0
- package/dist/esm/instructions/indexing.js.map +1 -1
- package/dist/esm/instructions/misc.js +1 -0
- package/dist/esm/instructions/misc.js.map +1 -1
- package/dist/esm/instructions/session.js +1 -0
- package/dist/esm/instructions/session.js.map +1 -1
- package/dist/esm/instructions/staking.js +1 -0
- package/dist/esm/instructions/staking.js.map +1 -1
- package/dist/esm/instructions/subscription.js +1 -0
- package/dist/esm/instructions/subscription.js.map +1 -1
- package/dist/esm/instructions/tools.js +1 -0
- package/dist/esm/instructions/tools.js.map +1 -1
- package/dist/esm/instructions/vault.js +1 -0
- package/dist/esm/instructions/vault.js.map +1 -1
- package/dist/esm/modules/agent.d.ts +166 -0
- package/dist/esm/modules/agent.d.ts.map +1 -0
- package/dist/esm/modules/agent.js +268 -0
- package/dist/esm/modules/agent.js.map +1 -0
- package/dist/esm/modules/attestation.d.ts +96 -0
- package/dist/esm/modules/attestation.d.ts.map +1 -0
- package/dist/esm/modules/attestation.js +143 -0
- package/dist/esm/modules/attestation.js.map +1 -0
- package/dist/esm/modules/base.d.ts +161 -0
- package/dist/esm/modules/base.d.ts.map +1 -0
- package/dist/esm/modules/base.js +185 -0
- package/dist/esm/modules/base.js.map +1 -0
- package/dist/esm/modules/escrow-v2.d.ts +169 -0
- package/dist/esm/modules/escrow-v2.d.ts.map +1 -0
- package/dist/esm/modules/escrow-v2.js +603 -0
- package/dist/esm/modules/escrow-v2.js.map +1 -0
- package/dist/esm/modules/escrow.d.ts +168 -0
- package/dist/esm/modules/escrow.d.ts.map +1 -0
- package/dist/esm/modules/escrow.js +332 -0
- package/dist/esm/modules/escrow.js.map +1 -0
- package/dist/esm/modules/feedback.d.ts +105 -0
- package/dist/esm/modules/feedback.d.ts.map +1 -0
- package/dist/esm/modules/feedback.js +162 -0
- package/dist/esm/modules/feedback.js.map +1 -0
- package/dist/esm/modules/index.d.ts +28 -0
- package/dist/esm/modules/index.d.ts.map +1 -0
- package/dist/esm/modules/index.js +27 -0
- package/dist/esm/modules/index.js.map +1 -0
- package/dist/esm/modules/indexing.d.ts +200 -0
- package/dist/esm/modules/indexing.d.ts.map +1 -0
- package/dist/esm/modules/indexing.js +371 -0
- package/dist/esm/modules/indexing.js.map +1 -0
- package/dist/esm/modules/ledger.d.ts +150 -0
- package/dist/esm/modules/ledger.d.ts.map +1 -0
- package/dist/esm/modules/ledger.js +230 -0
- package/dist/esm/modules/ledger.js.map +1 -0
- package/dist/esm/modules/receipt.d.ts +77 -0
- package/dist/esm/modules/receipt.d.ts.map +1 -0
- package/dist/esm/modules/receipt.js +144 -0
- package/dist/esm/modules/receipt.js.map +1 -0
- package/dist/esm/modules/staking.d.ts +51 -0
- package/dist/esm/modules/staking.d.ts.map +1 -0
- package/dist/esm/modules/staking.js +155 -0
- package/dist/esm/modules/staking.js.map +1 -0
- package/dist/esm/modules/subscription.d.ts +33 -0
- package/dist/esm/modules/subscription.d.ts.map +1 -0
- package/dist/esm/modules/subscription.js +92 -0
- package/dist/esm/modules/subscription.js.map +1 -0
- package/dist/esm/modules/tools.d.ts +182 -0
- package/dist/esm/modules/tools.d.ts.map +1 -0
- package/dist/esm/modules/tools.js +341 -0
- package/dist/esm/modules/tools.js.map +1 -0
- package/dist/esm/modules/vault.d.ts +240 -0
- package/dist/esm/modules/vault.d.ts.map +1 -0
- package/dist/esm/modules/vault.js +423 -0
- package/dist/esm/modules/vault.js.map +1 -0
- package/dist/esm/parser/client.d.ts +123 -0
- package/dist/esm/parser/client.d.ts.map +1 -0
- package/dist/esm/parser/client.js +142 -0
- package/dist/esm/parser/client.js.map +1 -0
- package/dist/esm/parser/complete.d.ts +90 -0
- package/dist/esm/parser/complete.d.ts.map +1 -0
- package/dist/esm/parser/complete.js +173 -0
- package/dist/esm/parser/complete.js.map +1 -0
- package/dist/esm/parser/index.d.ts +40 -0
- package/dist/esm/parser/index.d.ts.map +1 -0
- package/dist/esm/parser/index.js +43 -0
- package/dist/esm/parser/index.js.map +1 -0
- package/dist/esm/parser/inner.d.ts +114 -0
- package/dist/esm/parser/inner.d.ts.map +1 -0
- package/dist/esm/parser/inner.js +180 -0
- package/dist/esm/parser/inner.js.map +1 -0
- package/dist/esm/parser/instructions.d.ts +76 -0
- package/dist/esm/parser/instructions.d.ts.map +1 -0
- package/dist/esm/parser/instructions.js +109 -0
- package/dist/esm/parser/instructions.js.map +1 -0
- package/dist/esm/parser/transaction.d.ts +77 -0
- package/dist/esm/parser/transaction.d.ts.map +1 -0
- package/dist/esm/parser/transaction.js +149 -0
- package/dist/esm/parser/transaction.js.map +1 -0
- package/dist/esm/parser/types.d.ts +154 -0
- package/dist/esm/parser/types.d.ts.map +1 -0
- package/dist/esm/parser/types.js +13 -0
- package/dist/esm/parser/types.js.map +1 -0
- package/dist/esm/pda/index.d.ts +510 -0
- package/dist/esm/pda/index.d.ts.map +1 -0
- package/dist/esm/pda/index.js +638 -0
- package/dist/esm/pda/index.js.map +1 -0
- package/dist/esm/plugin/index.d.ts +171 -0
- package/dist/esm/plugin/index.d.ts.map +1 -0
- package/dist/esm/plugin/index.js +945 -0
- package/dist/esm/plugin/index.js.map +1 -0
- package/dist/esm/plugin/protocols.d.ts +152 -0
- package/dist/esm/plugin/protocols.d.ts.map +1 -0
- package/dist/esm/plugin/protocols.js +279 -0
- package/dist/esm/plugin/protocols.js.map +1 -0
- package/dist/esm/plugin/schemas.d.ts +829 -0
- package/dist/esm/plugin/schemas.d.ts.map +1 -0
- package/dist/esm/plugin/schemas.js +860 -0
- package/dist/esm/plugin/schemas.js.map +1 -0
- package/dist/esm/postgres/adapter.d.ts +355 -0
- package/dist/esm/postgres/adapter.d.ts.map +1 -0
- package/dist/esm/postgres/adapter.js +678 -0
- package/dist/esm/postgres/adapter.js.map +1 -0
- package/dist/esm/postgres/index.d.ts +24 -0
- package/dist/esm/postgres/index.d.ts.map +1 -0
- package/dist/esm/postgres/index.js +27 -0
- package/dist/esm/postgres/index.js.map +1 -0
- package/dist/esm/postgres/serializers.d.ts +30 -0
- package/dist/esm/postgres/serializers.d.ts.map +1 -0
- package/dist/esm/postgres/serializers.js +362 -0
- package/dist/esm/postgres/serializers.js.map +1 -0
- package/dist/esm/postgres/sync.d.ts +156 -0
- package/dist/esm/postgres/sync.d.ts.map +1 -0
- package/dist/esm/postgres/sync.js +285 -0
- package/dist/esm/postgres/sync.js.map +1 -0
- package/dist/esm/postgres/types.d.ts +167 -0
- package/dist/esm/postgres/types.d.ts.map +1 -0
- package/dist/esm/postgres/types.js +41 -0
- package/dist/esm/postgres/types.js.map +1 -0
- package/dist/esm/registries/builder.d.ts +340 -0
- package/dist/esm/registries/builder.d.ts.map +1 -0
- package/dist/esm/registries/builder.js +410 -0
- package/dist/esm/registries/builder.js.map +1 -0
- package/dist/esm/registries/discovery.d.ts +333 -0
- package/dist/esm/registries/discovery.d.ts.map +1 -0
- package/dist/esm/registries/discovery.js +358 -0
- package/dist/esm/registries/discovery.js.map +1 -0
- package/dist/esm/registries/fairscale.d.ts +680 -0
- package/dist/esm/registries/fairscale.d.ts.map +1 -0
- package/dist/esm/registries/fairscale.js +633 -0
- package/dist/esm/registries/fairscale.js.map +1 -0
- package/dist/esm/registries/index.d.ts +52 -0
- package/dist/esm/registries/index.d.ts.map +1 -0
- package/dist/esm/registries/index.js +46 -0
- package/dist/esm/registries/index.js.map +1 -0
- package/dist/esm/registries/metaplex-bridge.d.ts +489 -0
- package/dist/esm/registries/metaplex-bridge.d.ts.map +1 -0
- package/dist/esm/registries/metaplex-bridge.js +706 -0
- package/dist/esm/registries/metaplex-bridge.js.map +1 -0
- package/dist/esm/registries/session.d.ts +323 -0
- package/dist/esm/registries/session.d.ts.map +1 -0
- package/dist/esm/registries/session.js +429 -0
- package/dist/esm/registries/session.js.map +1 -0
- package/dist/esm/registries/x402.d.ts +530 -0
- package/dist/esm/registries/x402.d.ts.map +1 -0
- package/dist/esm/registries/x402.js +664 -0
- package/dist/esm/registries/x402.js.map +1 -0
- package/dist/esm/types/accounts.d.ts +765 -0
- package/dist/esm/types/accounts.d.ts.map +1 -0
- package/dist/esm/types/accounts.js +12 -0
- package/dist/esm/types/accounts.js.map +1 -0
- package/dist/esm/types/common.d.ts +166 -0
- package/dist/esm/types/common.d.ts.map +1 -0
- package/dist/esm/types/common.js +12 -0
- package/dist/esm/types/common.js.map +1 -0
- package/dist/esm/types/endpoint.d.ts +161 -0
- package/dist/esm/types/endpoint.d.ts.map +1 -0
- package/dist/esm/types/endpoint.js +14 -0
- package/dist/esm/types/endpoint.js.map +1 -0
- package/dist/esm/types/enums.d.ts +353 -0
- package/dist/esm/types/enums.d.ts.map +1 -0
- package/dist/esm/types/enums.js +266 -0
- package/dist/esm/types/enums.js.map +1 -0
- package/dist/esm/types/index.d.ts +29 -0
- package/dist/esm/types/index.d.ts.map +1 -0
- package/dist/esm/types/index.js +25 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/instructions.d.ts +400 -0
- package/dist/esm/types/instructions.d.ts.map +1 -0
- package/dist/esm/types/instructions.js +89 -0
- package/dist/esm/types/instructions.js.map +1 -0
- package/dist/esm/types.d.ts +28 -0
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/types.js +1 -0
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/anchor-errors.d.ts +61 -0
- package/dist/esm/utils/anchor-errors.d.ts.map +1 -0
- package/dist/esm/utils/anchor-errors.js +447 -0
- package/dist/esm/utils/anchor-errors.js.map +1 -0
- package/dist/esm/utils/endpoint-validator.d.ts +110 -0
- package/dist/esm/utils/endpoint-validator.d.ts.map +1 -0
- package/dist/esm/utils/endpoint-validator.js +226 -0
- package/dist/esm/utils/endpoint-validator.js.map +1 -0
- package/dist/esm/utils/escrow-validation.d.ts +145 -0
- package/dist/esm/utils/escrow-validation.d.ts.map +1 -0
- package/dist/esm/utils/escrow-validation.js +212 -0
- package/dist/esm/utils/escrow-validation.js.map +1 -0
- package/dist/esm/utils/hash.d.ts +75 -0
- package/dist/esm/utils/hash.d.ts.map +1 -0
- package/dist/esm/utils/hash.js +103 -0
- package/dist/esm/utils/hash.js.map +1 -0
- package/dist/esm/utils/index.d.ts +3 -1
- package/dist/esm/utils/index.d.ts.map +1 -1
- package/dist/esm/utils/index.js +6 -3
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/merchant-validator.d.ts +176 -0
- package/dist/esm/utils/merchant-validator.d.ts.map +1 -0
- package/dist/esm/utils/merchant-validator.js +241 -0
- package/dist/esm/utils/merchant-validator.js.map +1 -0
- package/dist/esm/utils/network-normalizer.d.ts +120 -0
- package/dist/esm/utils/network-normalizer.d.ts.map +1 -0
- package/dist/esm/utils/network-normalizer.js +229 -0
- package/dist/esm/utils/network-normalizer.js.map +1 -0
- package/dist/esm/utils/priority-fee.d.ts +205 -0
- package/dist/esm/utils/priority-fee.d.ts.map +1 -0
- package/dist/esm/utils/priority-fee.js +209 -0
- package/dist/esm/utils/priority-fee.js.map +1 -0
- package/dist/esm/utils/rpc-strategy.d.ts +172 -0
- package/dist/esm/utils/rpc-strategy.d.ts.map +1 -0
- package/dist/esm/utils/rpc-strategy.js +231 -0
- package/dist/esm/utils/rpc-strategy.js.map +1 -0
- package/dist/esm/utils/schemas.d.ts +351 -0
- package/dist/esm/utils/schemas.d.ts.map +1 -0
- package/dist/esm/utils/schemas.js +320 -0
- package/dist/esm/utils/schemas.js.map +1 -0
- package/dist/esm/utils/serialization.d.ts +69 -0
- package/dist/esm/utils/serialization.d.ts.map +1 -0
- package/dist/esm/utils/serialization.js +98 -0
- package/dist/esm/utils/serialization.js.map +1 -0
- package/dist/esm/utils/validate.js +1 -1
- package/dist/esm/utils/validate.js.map +1 -1
- package/dist/esm/utils/validation.d.ts +29 -0
- package/dist/esm/utils/validation.d.ts.map +1 -0
- package/dist/esm/utils/validation.js +33 -0
- package/dist/esm/utils/validation.js.map +1 -0
- package/dist/esm/utils/volume-curve.d.ts +60 -0
- package/dist/esm/utils/volume-curve.d.ts.map +1 -0
- package/dist/esm/utils/volume-curve.js +114 -0
- package/dist/esm/utils/volume-curve.js.map +1 -0
- package/dist/esm/utils/x402-direct.d.ts +114 -0
- package/dist/esm/utils/x402-direct.d.ts.map +1 -0
- package/dist/esm/utils/x402-direct.js +228 -0
- package/dist/esm/utils/x402-direct.js.map +1 -0
- package/dist/types/constants/addresses.d.ts +117 -0
- package/dist/types/constants/addresses.d.ts.map +1 -0
- package/dist/types/constants/index.d.ts +31 -0
- package/dist/types/constants/index.d.ts.map +1 -0
- package/dist/types/constants/limits.d.ts +149 -0
- package/dist/types/constants/limits.d.ts.map +1 -0
- package/dist/types/constants/network.d.ts +81 -0
- package/dist/types/constants/network.d.ts.map +1 -0
- package/dist/types/constants/payments.d.ts +121 -0
- package/dist/types/constants/payments.d.ts.map +1 -0
- package/dist/types/constants/programs.d.ts +69 -0
- package/dist/types/constants/programs.d.ts.map +1 -0
- package/dist/types/constants/seeds.d.ts +82 -0
- package/dist/types/constants/seeds.d.ts.map +1 -0
- package/dist/types/core/client.d.ts +467 -0
- package/dist/types/core/client.d.ts.map +1 -0
- package/dist/types/core/connection.d.ts +305 -0
- package/dist/types/core/connection.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +20 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/errors/index.d.ts +335 -0
- package/dist/types/errors/index.d.ts.map +1 -0
- package/dist/types/events/geyser.d.ts +150 -0
- package/dist/types/events/geyser.d.ts.map +1 -0
- package/dist/types/events/index.d.ts +248 -0
- package/dist/types/events/index.d.ts.map +1 -0
- package/dist/types/idl/index.d.ts +70 -0
- package/dist/types/idl/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +86 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/modules/agent.d.ts +156 -0
- package/dist/types/modules/agent.d.ts.map +1 -0
- package/dist/types/modules/attestation.d.ts +96 -0
- package/dist/types/modules/attestation.d.ts.map +1 -0
- package/dist/types/modules/base.d.ts +215 -0
- package/dist/types/modules/base.d.ts.map +1 -0
- package/dist/types/modules/escrow-v2.d.ts +285 -0
- package/dist/types/modules/escrow-v2.d.ts.map +1 -0
- package/dist/types/modules/feedback.d.ts +105 -0
- package/dist/types/modules/feedback.d.ts.map +1 -0
- package/dist/types/modules/index.d.ts +27 -0
- package/dist/types/modules/index.d.ts.map +1 -0
- package/dist/types/modules/indexing.d.ts +200 -0
- package/dist/types/modules/indexing.d.ts.map +1 -0
- package/dist/types/modules/ledger.d.ts +150 -0
- package/dist/types/modules/ledger.d.ts.map +1 -0
- package/dist/types/modules/receipt.d.ts +91 -0
- package/dist/types/modules/receipt.d.ts.map +1 -0
- package/dist/types/modules/staking.d.ts +51 -0
- package/dist/types/modules/staking.d.ts.map +1 -0
- package/dist/types/modules/subscription.d.ts +33 -0
- package/dist/types/modules/subscription.d.ts.map +1 -0
- package/dist/types/modules/tools.d.ts +172 -0
- package/dist/types/modules/tools.d.ts.map +1 -0
- package/dist/types/modules/vault.d.ts +240 -0
- package/dist/types/modules/vault.d.ts.map +1 -0
- package/dist/types/parser/client.d.ts +123 -0
- package/dist/types/parser/client.d.ts.map +1 -0
- package/dist/types/parser/complete.d.ts +90 -0
- package/dist/types/parser/complete.d.ts.map +1 -0
- package/dist/types/parser/index.d.ts +40 -0
- package/dist/types/parser/index.d.ts.map +1 -0
- package/dist/types/parser/inner.d.ts +114 -0
- package/dist/types/parser/inner.d.ts.map +1 -0
- package/dist/types/parser/instructions.d.ts +76 -0
- package/dist/types/parser/instructions.d.ts.map +1 -0
- package/dist/types/parser/transaction.d.ts +77 -0
- package/dist/types/parser/transaction.d.ts.map +1 -0
- package/dist/types/parser/types.d.ts +154 -0
- package/dist/types/parser/types.d.ts.map +1 -0
- package/dist/types/pda/index.d.ts +527 -0
- package/dist/types/pda/index.d.ts.map +1 -0
- package/dist/types/plugin/index.d.ts +171 -0
- package/dist/types/plugin/index.d.ts.map +1 -0
- package/dist/types/plugin/protocols.d.ts +152 -0
- package/dist/types/plugin/protocols.d.ts.map +1 -0
- package/dist/types/plugin/schemas.d.ts +829 -0
- package/dist/types/plugin/schemas.d.ts.map +1 -0
- package/dist/types/postgres/adapter.d.ts +355 -0
- package/dist/types/postgres/adapter.d.ts.map +1 -0
- package/dist/types/postgres/index.d.ts +24 -0
- package/dist/types/postgres/index.d.ts.map +1 -0
- package/dist/types/postgres/serializers.d.ts +30 -0
- package/dist/types/postgres/serializers.d.ts.map +1 -0
- package/dist/types/postgres/sync.d.ts +156 -0
- package/dist/types/postgres/sync.d.ts.map +1 -0
- package/dist/types/postgres/types.d.ts +167 -0
- package/dist/types/postgres/types.d.ts.map +1 -0
- package/dist/types/registries/builder.d.ts +333 -0
- package/dist/types/registries/builder.d.ts.map +1 -0
- package/dist/types/registries/discovery.d.ts +333 -0
- package/dist/types/registries/discovery.d.ts.map +1 -0
- package/dist/types/registries/fairscale.d.ts +680 -0
- package/dist/types/registries/fairscale.d.ts.map +1 -0
- package/dist/types/registries/index.d.ts +52 -0
- package/dist/types/registries/index.d.ts.map +1 -0
- package/dist/types/registries/metaplex-bridge.d.ts +488 -0
- package/dist/types/registries/metaplex-bridge.d.ts.map +1 -0
- package/dist/types/registries/session.d.ts +317 -0
- package/dist/types/registries/session.d.ts.map +1 -0
- package/dist/types/registries/x402.d.ts +523 -0
- package/dist/types/registries/x402.d.ts.map +1 -0
- package/dist/types/types/accounts.d.ts +817 -0
- package/dist/types/types/accounts.d.ts.map +1 -0
- package/dist/types/types/common.d.ts +166 -0
- package/dist/types/types/common.d.ts.map +1 -0
- package/dist/types/types/endpoint.d.ts +161 -0
- package/dist/types/types/endpoint.d.ts.map +1 -0
- package/dist/types/types/enums.d.ts +353 -0
- package/dist/types/types/enums.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +29 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/instructions.d.ts +400 -0
- package/dist/types/types/instructions.d.ts.map +1 -0
- package/dist/types/utils/anchor-errors.d.ts +61 -0
- package/dist/types/utils/anchor-errors.d.ts.map +1 -0
- package/dist/types/utils/endpoint-validator.d.ts +110 -0
- package/dist/types/utils/endpoint-validator.d.ts.map +1 -0
- package/dist/types/utils/escrow-validation.d.ts +145 -0
- package/dist/types/utils/escrow-validation.d.ts.map +1 -0
- package/dist/types/utils/hash.d.ts +75 -0
- package/dist/types/utils/hash.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +36 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/merchant-validator.d.ts +176 -0
- package/dist/types/utils/merchant-validator.d.ts.map +1 -0
- package/dist/types/utils/network-normalizer.d.ts +120 -0
- package/dist/types/utils/network-normalizer.d.ts.map +1 -0
- package/dist/types/utils/priority-fee.d.ts +205 -0
- package/dist/types/utils/priority-fee.d.ts.map +1 -0
- package/dist/types/utils/rpc-strategy.d.ts +179 -0
- package/dist/types/utils/rpc-strategy.d.ts.map +1 -0
- package/dist/types/utils/schemas.d.ts +351 -0
- package/dist/types/utils/schemas.d.ts.map +1 -0
- package/dist/types/utils/serialization.d.ts +69 -0
- package/dist/types/utils/serialization.d.ts.map +1 -0
- package/dist/types/utils/validation.d.ts +29 -0
- package/dist/types/utils/validation.d.ts.map +1 -0
- package/dist/types/utils/volume-curve.d.ts +60 -0
- package/dist/types/utils/volume-curve.d.ts.map +1 -0
- package/dist/types/utils/x402-direct.d.ts +114 -0
- package/dist/types/utils/x402-direct.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,863 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module plugin/schemas
|
|
4
|
+
* @description Zod schemas for every SAP v2 plugin tool.
|
|
5
|
+
*
|
|
6
|
+
* Each schema is an `{ input, output }` pair that drives:
|
|
7
|
+
* 1. Runtime validation (LLM → tool call)
|
|
8
|
+
* 2. LangChain StructuredTool generation
|
|
9
|
+
* 3. MCP/Vercel AI tool descriptors
|
|
10
|
+
*
|
|
11
|
+
* Conventions:
|
|
12
|
+
* - Solana public keys → `z.string().describe('Base58 public key …')`
|
|
13
|
+
* - BN/bigint amounts → `z.string().describe('Amount in lamports …')`
|
|
14
|
+
* - Hashes ([u8;32]) → `z.array(z.number()).length(32)`
|
|
15
|
+
* - Tool outputs always include `txSignature` for write ops
|
|
16
|
+
*
|
|
17
|
+
* @category Plugin
|
|
18
|
+
* @since v0.1.0
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.ledgerSchemas = exports.indexingSchemas = exports.vaultSchemas = exports.toolsSchemas = exports.escrowSchemas = exports.attestationSchemas = exports.feedbackSchemas = exports.agentSchemas = void 0;
|
|
22
|
+
const zod_1 = require("zod");
|
|
23
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
24
|
+
// Shared Primitives
|
|
25
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
26
|
+
/** Base58-encoded Solana public key (32–44 chars). */
|
|
27
|
+
const pubkey = zod_1.z
|
|
28
|
+
.string()
|
|
29
|
+
.min(32)
|
|
30
|
+
.max(44)
|
|
31
|
+
.describe("Solana public key (base58)");
|
|
32
|
+
/** Base58-encoded transaction signature. */
|
|
33
|
+
const txSig = zod_1.z.string().describe("Transaction signature (base58)");
|
|
34
|
+
/** 32-byte SHA-256 hash represented as a fixed-length integer array. */
|
|
35
|
+
const hash32 = zod_1.z.array(zod_1.z.number().int().min(0).max(255)).length(32);
|
|
36
|
+
/** Token amount in the smallest unit, serialized as a string for BN safety. */
|
|
37
|
+
const lamports = zod_1.z.string().describe("Amount in smallest token unit (string)");
|
|
38
|
+
/** Optional public key (nullable). */
|
|
39
|
+
const optPubkey = pubkey.nullish();
|
|
40
|
+
/** Standard write-operation output containing the transaction signature. */
|
|
41
|
+
const writeOutput = zod_1.z.object({ txSignature: txSig });
|
|
42
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
43
|
+
// Nested Sub-schemas
|
|
44
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
45
|
+
/** Reusable schema for an agent capability entry. */
|
|
46
|
+
const capabilitySchema = zod_1.z.object({
|
|
47
|
+
id: zod_1.z.string().describe("Capability identifier (e.g. 'jupiter:swap')"),
|
|
48
|
+
description: zod_1.z.string().nullish().describe("Human-readable description"),
|
|
49
|
+
protocolId: zod_1.z.string().nullish().describe("Protocol namespace"),
|
|
50
|
+
version: zod_1.z.string().nullish().describe("Semver version"),
|
|
51
|
+
});
|
|
52
|
+
/** Reusable schema for a volume curve breakpoint (tiered pricing). */
|
|
53
|
+
const volumeBreakpointSchema = zod_1.z.object({
|
|
54
|
+
afterCalls: zod_1.z.number().int().describe("Call threshold for this tier"),
|
|
55
|
+
pricePerCall: lamports.describe("Price per call after threshold"),
|
|
56
|
+
});
|
|
57
|
+
/** Reusable schema for a pricing tier with token, settlement, and volume curve config. */
|
|
58
|
+
const pricingTierSchema = zod_1.z.object({
|
|
59
|
+
tierId: zod_1.z.string().describe("Pricing tier ID (e.g. 'standard')"),
|
|
60
|
+
pricePerCall: lamports,
|
|
61
|
+
minPricePerCall: lamports.nullish().describe("Price floor"),
|
|
62
|
+
maxPricePerCall: lamports.nullish().describe("Price ceiling"),
|
|
63
|
+
rateLimit: zod_1.z.number().int().describe("Calls per second"),
|
|
64
|
+
maxCallsPerSession: zod_1.z.number().int().describe("0 = unlimited"),
|
|
65
|
+
burstLimit: zod_1.z.number().int().nullish(),
|
|
66
|
+
tokenType: zod_1.z
|
|
67
|
+
.enum(["sol", "usdc", "spl"])
|
|
68
|
+
.describe("Payment token type"),
|
|
69
|
+
tokenMint: optPubkey.describe("SPL token mint address (when tokenType=spl)"),
|
|
70
|
+
tokenDecimals: zod_1.z.number().int().nullish(),
|
|
71
|
+
settlementMode: zod_1.z
|
|
72
|
+
.enum(["instant", "escrow", "batched", "x402"])
|
|
73
|
+
.nullish()
|
|
74
|
+
.describe("Settlement mode"),
|
|
75
|
+
minEscrowDeposit: lamports.nullish(),
|
|
76
|
+
batchIntervalSec: zod_1.z.number().int().nullish(),
|
|
77
|
+
volumeCurve: zod_1.z.array(volumeBreakpointSchema).nullish(),
|
|
78
|
+
});
|
|
79
|
+
/** Reusable schema for a settlement entry (calls + service hash). */
|
|
80
|
+
const settlementSchema = zod_1.z.object({
|
|
81
|
+
callsToSettle: zod_1.z.string().describe("Number of calls to settle"),
|
|
82
|
+
serviceHash: hash32.describe("SHA-256 hash of the service rendered"),
|
|
83
|
+
});
|
|
84
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
85
|
+
// Agent Schemas
|
|
86
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
87
|
+
/**
|
|
88
|
+
* Zod input/output schemas for the **sap-agent** protocol (8 tools).
|
|
89
|
+
*
|
|
90
|
+
* @name agentSchemas
|
|
91
|
+
* @description Covers agent registration, updates, activation lifecycle,
|
|
92
|
+
* call reporting, reputation metrics, and on-chain data fetching.
|
|
93
|
+
* @category Plugin
|
|
94
|
+
* @since v0.1.0
|
|
95
|
+
*/
|
|
96
|
+
exports.agentSchemas = {
|
|
97
|
+
registerAgent: {
|
|
98
|
+
input: zod_1.z.object({
|
|
99
|
+
name: zod_1.z.string().max(64).describe("Agent display name (max 64 chars)"),
|
|
100
|
+
description: zod_1.z
|
|
101
|
+
.string()
|
|
102
|
+
.max(512)
|
|
103
|
+
.describe("Agent description (max 512 chars)"),
|
|
104
|
+
capabilities: zod_1.z
|
|
105
|
+
.array(capabilitySchema)
|
|
106
|
+
.describe("List of capabilities this agent offers"),
|
|
107
|
+
pricing: zod_1.z
|
|
108
|
+
.array(pricingTierSchema)
|
|
109
|
+
.describe("Pricing tiers for agent services"),
|
|
110
|
+
protocols: zod_1.z
|
|
111
|
+
.array(zod_1.z.string())
|
|
112
|
+
.describe("Protocol IDs this agent supports"),
|
|
113
|
+
agentId: zod_1.z.string().nullish().describe("Optional DID-style agent ID"),
|
|
114
|
+
agentUri: zod_1.z
|
|
115
|
+
.string()
|
|
116
|
+
.url()
|
|
117
|
+
.nullish()
|
|
118
|
+
.describe("Optional agent metadata URI"),
|
|
119
|
+
x402Endpoint: zod_1.z
|
|
120
|
+
.string()
|
|
121
|
+
.url()
|
|
122
|
+
.nullish()
|
|
123
|
+
.describe("x402 payment endpoint URL"),
|
|
124
|
+
}),
|
|
125
|
+
output: writeOutput,
|
|
126
|
+
},
|
|
127
|
+
updateAgent: {
|
|
128
|
+
input: zod_1.z.object({
|
|
129
|
+
name: zod_1.z.string().max(64).nullish(),
|
|
130
|
+
description: zod_1.z.string().max(512).nullish(),
|
|
131
|
+
capabilities: zod_1.z.array(capabilitySchema).nullish(),
|
|
132
|
+
pricing: zod_1.z.array(pricingTierSchema).nullish(),
|
|
133
|
+
protocols: zod_1.z.array(zod_1.z.string()).nullish(),
|
|
134
|
+
agentId: zod_1.z.string().nullish(),
|
|
135
|
+
agentUri: zod_1.z.string().url().nullish(),
|
|
136
|
+
x402Endpoint: zod_1.z.string().url().nullish(),
|
|
137
|
+
}),
|
|
138
|
+
output: writeOutput,
|
|
139
|
+
},
|
|
140
|
+
deactivateAgent: {
|
|
141
|
+
input: zod_1.z.object({}),
|
|
142
|
+
output: writeOutput,
|
|
143
|
+
},
|
|
144
|
+
reactivateAgent: {
|
|
145
|
+
input: zod_1.z.object({}),
|
|
146
|
+
output: writeOutput,
|
|
147
|
+
},
|
|
148
|
+
reportCalls: {
|
|
149
|
+
input: zod_1.z.object({
|
|
150
|
+
callsServed: zod_1.z.number().int().positive().describe("Number of calls served"),
|
|
151
|
+
}),
|
|
152
|
+
output: writeOutput,
|
|
153
|
+
},
|
|
154
|
+
updateReputation: {
|
|
155
|
+
input: zod_1.z.object({
|
|
156
|
+
avgLatencyMs: zod_1.z.number().int().min(0).describe("Average latency in ms"),
|
|
157
|
+
uptimePercent: zod_1.z
|
|
158
|
+
.number()
|
|
159
|
+
.int()
|
|
160
|
+
.min(0)
|
|
161
|
+
.max(100)
|
|
162
|
+
.describe("Uptime percentage (0-100)"),
|
|
163
|
+
}),
|
|
164
|
+
output: writeOutput,
|
|
165
|
+
},
|
|
166
|
+
fetchAgent: {
|
|
167
|
+
input: zod_1.z.object({
|
|
168
|
+
wallet: pubkey.nullish().describe("Agent wallet (defaults to caller)"),
|
|
169
|
+
}),
|
|
170
|
+
output: zod_1.z.object({
|
|
171
|
+
name: zod_1.z.string(),
|
|
172
|
+
description: zod_1.z.string(),
|
|
173
|
+
isActive: zod_1.z.boolean(),
|
|
174
|
+
reputationScore: zod_1.z.number(),
|
|
175
|
+
totalCallsServed: zod_1.z.string(),
|
|
176
|
+
totalFeedbacks: zod_1.z.number(),
|
|
177
|
+
avgLatencyMs: zod_1.z.number(),
|
|
178
|
+
uptimePercent: zod_1.z.number(),
|
|
179
|
+
wallet: pubkey,
|
|
180
|
+
agentId: zod_1.z.string().nullish(),
|
|
181
|
+
x402Endpoint: zod_1.z.string().nullish(),
|
|
182
|
+
capabilities: zod_1.z.array(capabilitySchema),
|
|
183
|
+
pricing: zod_1.z.array(pricingTierSchema),
|
|
184
|
+
protocols: zod_1.z.array(zod_1.z.string()),
|
|
185
|
+
}),
|
|
186
|
+
},
|
|
187
|
+
fetchGlobalRegistry: {
|
|
188
|
+
input: zod_1.z.object({}),
|
|
189
|
+
output: zod_1.z.object({
|
|
190
|
+
totalAgents: zod_1.z.string(),
|
|
191
|
+
activeAgents: zod_1.z.string(),
|
|
192
|
+
totalFeedbacks: zod_1.z.string(),
|
|
193
|
+
totalCapabilities: zod_1.z.number(),
|
|
194
|
+
totalProtocols: zod_1.z.number(),
|
|
195
|
+
totalTools: zod_1.z.number(),
|
|
196
|
+
totalVaults: zod_1.z.number(),
|
|
197
|
+
totalEscrows: zod_1.z.number(),
|
|
198
|
+
totalAttestations: zod_1.z.number(),
|
|
199
|
+
authority: pubkey,
|
|
200
|
+
}),
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
204
|
+
// Feedback Schemas
|
|
205
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
206
|
+
/**
|
|
207
|
+
* Zod input/output schemas for the **sap-feedback** protocol (4 tools).
|
|
208
|
+
*
|
|
209
|
+
* @name feedbackSchemas
|
|
210
|
+
* @description Covers giving, updating, revoking, and fetching on-chain
|
|
211
|
+
* feedback entries tied to agent identity PDAs.
|
|
212
|
+
* @category Plugin
|
|
213
|
+
* @since v0.1.0
|
|
214
|
+
*/
|
|
215
|
+
exports.feedbackSchemas = {
|
|
216
|
+
giveFeedback: {
|
|
217
|
+
input: zod_1.z.object({
|
|
218
|
+
agentWallet: pubkey.describe("Wallet of the agent to review"),
|
|
219
|
+
score: zod_1.z
|
|
220
|
+
.number()
|
|
221
|
+
.int()
|
|
222
|
+
.min(1)
|
|
223
|
+
.max(5)
|
|
224
|
+
.describe("Feedback score (1-5)"),
|
|
225
|
+
tag: zod_1.z
|
|
226
|
+
.string()
|
|
227
|
+
.max(32)
|
|
228
|
+
.describe("Short tag (e.g. 'reliable', 'fast', 'accurate')"),
|
|
229
|
+
commentHash: hash32
|
|
230
|
+
.nullish()
|
|
231
|
+
.describe("Optional SHA-256 hash of off-chain comment"),
|
|
232
|
+
}),
|
|
233
|
+
output: writeOutput,
|
|
234
|
+
},
|
|
235
|
+
updateFeedback: {
|
|
236
|
+
input: zod_1.z.object({
|
|
237
|
+
agentWallet: pubkey.describe("Wallet of the reviewed agent"),
|
|
238
|
+
newScore: zod_1.z.number().int().min(1).max(5).describe("Updated score (1-5)"),
|
|
239
|
+
newTag: zod_1.z.string().max(32).nullish().describe("Updated tag"),
|
|
240
|
+
commentHash: hash32.nullish(),
|
|
241
|
+
}),
|
|
242
|
+
output: writeOutput,
|
|
243
|
+
},
|
|
244
|
+
revokeFeedback: {
|
|
245
|
+
input: zod_1.z.object({
|
|
246
|
+
agentWallet: pubkey.describe("Wallet of the reviewed agent"),
|
|
247
|
+
}),
|
|
248
|
+
output: writeOutput,
|
|
249
|
+
},
|
|
250
|
+
fetchFeedback: {
|
|
251
|
+
input: zod_1.z.object({
|
|
252
|
+
agentWallet: pubkey.describe("Wallet of the reviewed agent"),
|
|
253
|
+
reviewer: pubkey.nullish().describe("Reviewer wallet (defaults to caller)"),
|
|
254
|
+
}),
|
|
255
|
+
output: zod_1.z.object({
|
|
256
|
+
agent: pubkey,
|
|
257
|
+
reviewer: pubkey,
|
|
258
|
+
score: zod_1.z.number(),
|
|
259
|
+
tag: zod_1.z.string(),
|
|
260
|
+
isRevoked: zod_1.z.boolean(),
|
|
261
|
+
createdAt: zod_1.z.string(),
|
|
262
|
+
updatedAt: zod_1.z.string(),
|
|
263
|
+
}),
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
267
|
+
// Attestation Schemas
|
|
268
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
269
|
+
/**
|
|
270
|
+
* Zod input/output schemas for the **sap-attestation** protocol (3 tools).
|
|
271
|
+
*
|
|
272
|
+
* @name attestationSchemas
|
|
273
|
+
* @description Covers creating, revoking, and fetching on-chain attestations
|
|
274
|
+
* between agents in the SAP Web of Trust.
|
|
275
|
+
* @category Plugin
|
|
276
|
+
* @since v0.1.0
|
|
277
|
+
*/
|
|
278
|
+
exports.attestationSchemas = {
|
|
279
|
+
createAttestation: {
|
|
280
|
+
input: zod_1.z.object({
|
|
281
|
+
agentWallet: pubkey.describe("Wallet of the agent to attest"),
|
|
282
|
+
attestationType: zod_1.z
|
|
283
|
+
.string()
|
|
284
|
+
.max(32)
|
|
285
|
+
.describe("Type of attestation (e.g. 'identity', 'capability', 'compliance')"),
|
|
286
|
+
metadataHash: hash32.describe("SHA-256 hash of attestation metadata"),
|
|
287
|
+
expiresAt: zod_1.z
|
|
288
|
+
.string()
|
|
289
|
+
.describe("Unix timestamp (seconds) when attestation expires"),
|
|
290
|
+
}),
|
|
291
|
+
output: writeOutput,
|
|
292
|
+
},
|
|
293
|
+
revokeAttestation: {
|
|
294
|
+
input: zod_1.z.object({
|
|
295
|
+
agentWallet: pubkey.describe("Wallet of the attested agent"),
|
|
296
|
+
}),
|
|
297
|
+
output: writeOutput,
|
|
298
|
+
},
|
|
299
|
+
fetchAttestation: {
|
|
300
|
+
input: zod_1.z.object({
|
|
301
|
+
agentWallet: pubkey.describe("Wallet of the attested agent"),
|
|
302
|
+
attester: pubkey
|
|
303
|
+
.nullish()
|
|
304
|
+
.describe("Attester wallet (defaults to caller)"),
|
|
305
|
+
}),
|
|
306
|
+
output: zod_1.z.object({
|
|
307
|
+
agent: pubkey,
|
|
308
|
+
attester: pubkey,
|
|
309
|
+
attestationType: zod_1.z.string(),
|
|
310
|
+
isActive: zod_1.z.boolean(),
|
|
311
|
+
expiresAt: zod_1.z.string(),
|
|
312
|
+
createdAt: zod_1.z.string(),
|
|
313
|
+
}),
|
|
314
|
+
},
|
|
315
|
+
};
|
|
316
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
317
|
+
// Escrow Schemas
|
|
318
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
319
|
+
/**
|
|
320
|
+
* Zod input/output schemas for the **sap-escrow** protocol (6 tools).
|
|
321
|
+
*
|
|
322
|
+
* @name escrowSchemas
|
|
323
|
+
* @description Covers escrow creation, deposits, settlement (single and batch),
|
|
324
|
+
* withdrawal, and account data fetching for x402 micropayments.
|
|
325
|
+
* @category Plugin
|
|
326
|
+
* @since v0.1.0
|
|
327
|
+
*/
|
|
328
|
+
exports.escrowSchemas = {
|
|
329
|
+
createEscrow: {
|
|
330
|
+
input: zod_1.z.object({
|
|
331
|
+
agentWallet: pubkey.describe("Agent wallet to deposit escrow for"),
|
|
332
|
+
pricePerCall: lamports.describe("Base price per call"),
|
|
333
|
+
maxCalls: zod_1.z.string().describe("Maximum calls allowed"),
|
|
334
|
+
initialDeposit: lamports.describe("Initial deposit amount"),
|
|
335
|
+
expiresAt: zod_1.z.string().describe("Expiry timestamp (unix seconds)"),
|
|
336
|
+
volumeCurve: zod_1.z.array(volumeBreakpointSchema).default([]),
|
|
337
|
+
tokenMint: optPubkey.describe("SPL token mint (null = native SOL)"),
|
|
338
|
+
tokenDecimals: zod_1.z
|
|
339
|
+
.number()
|
|
340
|
+
.int()
|
|
341
|
+
.default(9)
|
|
342
|
+
.describe("Token decimals (9=SOL, 6=USDC)"),
|
|
343
|
+
}),
|
|
344
|
+
output: writeOutput,
|
|
345
|
+
},
|
|
346
|
+
depositEscrow: {
|
|
347
|
+
input: zod_1.z.object({
|
|
348
|
+
agentWallet: pubkey.describe("Agent wallet of the escrow"),
|
|
349
|
+
amount: lamports.describe("Additional deposit amount"),
|
|
350
|
+
}),
|
|
351
|
+
output: writeOutput,
|
|
352
|
+
},
|
|
353
|
+
settleEscrow: {
|
|
354
|
+
input: zod_1.z.object({
|
|
355
|
+
depositorWallet: pubkey.describe("Depositor (client) wallet"),
|
|
356
|
+
callsToSettle: zod_1.z.string().describe("Number of calls to settle"),
|
|
357
|
+
serviceHash: hash32.describe("SHA-256 hash of the service rendered"),
|
|
358
|
+
priorityFeeMicroLamports: zod_1.z
|
|
359
|
+
.number()
|
|
360
|
+
.int()
|
|
361
|
+
.min(0)
|
|
362
|
+
.nullish()
|
|
363
|
+
.describe("Priority fee in microlamports per CU (0 = none, 5000 = recommended)"),
|
|
364
|
+
computeUnits: zod_1.z
|
|
365
|
+
.number()
|
|
366
|
+
.int()
|
|
367
|
+
.min(0)
|
|
368
|
+
.nullish()
|
|
369
|
+
.describe("Compute unit limit (default 200k, recommended 100k for settle)"),
|
|
370
|
+
skipPreflight: zod_1.z
|
|
371
|
+
.boolean()
|
|
372
|
+
.nullish()
|
|
373
|
+
.describe("Skip Solana simulation before submitting (saves ~400ms)"),
|
|
374
|
+
}),
|
|
375
|
+
output: writeOutput,
|
|
376
|
+
},
|
|
377
|
+
withdrawEscrow: {
|
|
378
|
+
input: zod_1.z.object({
|
|
379
|
+
agentWallet: pubkey.describe("Agent wallet of the escrow"),
|
|
380
|
+
amount: lamports.describe("Amount to withdraw"),
|
|
381
|
+
}),
|
|
382
|
+
output: writeOutput,
|
|
383
|
+
},
|
|
384
|
+
batchSettle: {
|
|
385
|
+
input: zod_1.z.object({
|
|
386
|
+
depositorWallet: pubkey.describe("Depositor (client) wallet"),
|
|
387
|
+
settlements: zod_1.z
|
|
388
|
+
.array(settlementSchema)
|
|
389
|
+
.min(1)
|
|
390
|
+
.max(10)
|
|
391
|
+
.describe("Up to 10 settlement entries"),
|
|
392
|
+
priorityFeeMicroLamports: zod_1.z
|
|
393
|
+
.number()
|
|
394
|
+
.int()
|
|
395
|
+
.min(0)
|
|
396
|
+
.nullish()
|
|
397
|
+
.describe("Priority fee in microlamports per CU (0 = none, 5000 = recommended)"),
|
|
398
|
+
computeUnits: zod_1.z
|
|
399
|
+
.number()
|
|
400
|
+
.int()
|
|
401
|
+
.min(0)
|
|
402
|
+
.nullish()
|
|
403
|
+
.describe("Compute unit limit (default 200k, recommended 300k for batch)"),
|
|
404
|
+
skipPreflight: zod_1.z
|
|
405
|
+
.boolean()
|
|
406
|
+
.nullish()
|
|
407
|
+
.describe("Skip Solana simulation before submitting (saves ~400ms)"),
|
|
408
|
+
}),
|
|
409
|
+
output: writeOutput,
|
|
410
|
+
},
|
|
411
|
+
fetchEscrow: {
|
|
412
|
+
input: zod_1.z.object({
|
|
413
|
+
agentWallet: pubkey.describe("Agent wallet"),
|
|
414
|
+
depositor: pubkey.nullish().describe("Depositor wallet (defaults to caller)"),
|
|
415
|
+
}),
|
|
416
|
+
output: zod_1.z.object({
|
|
417
|
+
agent: pubkey,
|
|
418
|
+
depositor: pubkey,
|
|
419
|
+
agentWallet: pubkey,
|
|
420
|
+
balance: zod_1.z.string(),
|
|
421
|
+
totalDeposited: zod_1.z.string(),
|
|
422
|
+
totalSettled: zod_1.z.string(),
|
|
423
|
+
totalCallsSettled: zod_1.z.string(),
|
|
424
|
+
pricePerCall: zod_1.z.string(),
|
|
425
|
+
maxCalls: zod_1.z.string(),
|
|
426
|
+
expiresAt: zod_1.z.string(),
|
|
427
|
+
tokenDecimals: zod_1.z.number(),
|
|
428
|
+
tokenMint: zod_1.z.string().nullish(),
|
|
429
|
+
}),
|
|
430
|
+
},
|
|
431
|
+
};
|
|
432
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
433
|
+
// Tools Schemas
|
|
434
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
435
|
+
/**
|
|
436
|
+
* Zod input/output schemas for the **sap-tools** protocol (7 tools).
|
|
437
|
+
*
|
|
438
|
+
* @name toolsSchemas
|
|
439
|
+
* @description Covers tool publishing, schema inscription, updates,
|
|
440
|
+
* activation lifecycle, invocation reporting, and descriptor fetching.
|
|
441
|
+
* @category Plugin
|
|
442
|
+
* @since v0.1.0
|
|
443
|
+
*/
|
|
444
|
+
exports.toolsSchemas = {
|
|
445
|
+
publishToolByName: {
|
|
446
|
+
input: zod_1.z.object({
|
|
447
|
+
toolName: zod_1.z.string().max(64).describe("Tool name (e.g. 'swap')"),
|
|
448
|
+
protocolId: zod_1.z.string().describe("Protocol ID (e.g. 'jupiter')"),
|
|
449
|
+
description: zod_1.z
|
|
450
|
+
.string()
|
|
451
|
+
.max(256)
|
|
452
|
+
.describe("Tool description for LLM consumption"),
|
|
453
|
+
inputSchema: zod_1.z
|
|
454
|
+
.string()
|
|
455
|
+
.describe("JSON schema string for tool input"),
|
|
456
|
+
outputSchema: zod_1.z
|
|
457
|
+
.string()
|
|
458
|
+
.describe("JSON schema string for tool output"),
|
|
459
|
+
httpMethod: zod_1.z
|
|
460
|
+
.enum(["get", "post", "put", "delete", "compound"])
|
|
461
|
+
.describe("HTTP method"),
|
|
462
|
+
category: zod_1.z
|
|
463
|
+
.enum([
|
|
464
|
+
"swap",
|
|
465
|
+
"lend",
|
|
466
|
+
"stake",
|
|
467
|
+
"nft",
|
|
468
|
+
"payment",
|
|
469
|
+
"data",
|
|
470
|
+
"governance",
|
|
471
|
+
"bridge",
|
|
472
|
+
"analytics",
|
|
473
|
+
"custom",
|
|
474
|
+
])
|
|
475
|
+
.describe("Tool category for discovery"),
|
|
476
|
+
paramsCount: zod_1.z.number().int().describe("Total parameter count"),
|
|
477
|
+
requiredParams: zod_1.z.number().int().describe("Required parameter count"),
|
|
478
|
+
isCompound: zod_1.z
|
|
479
|
+
.boolean()
|
|
480
|
+
.default(false)
|
|
481
|
+
.describe("Whether tool chains multiple actions"),
|
|
482
|
+
}),
|
|
483
|
+
output: writeOutput,
|
|
484
|
+
},
|
|
485
|
+
inscribeToolSchema: {
|
|
486
|
+
input: zod_1.z.object({
|
|
487
|
+
toolName: zod_1.z.string().describe("Tool name"),
|
|
488
|
+
schemaType: zod_1.z
|
|
489
|
+
.enum(["input", "output", "description"])
|
|
490
|
+
.describe("Schema type to inscribe"),
|
|
491
|
+
schemaData: zod_1.z.string().describe("Schema content (JSON string)"),
|
|
492
|
+
compression: zod_1.z
|
|
493
|
+
.enum(["none", "deflate", "gzip", "brotli"])
|
|
494
|
+
.default("none")
|
|
495
|
+
.describe("Compression algorithm"),
|
|
496
|
+
}),
|
|
497
|
+
output: writeOutput,
|
|
498
|
+
},
|
|
499
|
+
updateTool: {
|
|
500
|
+
input: zod_1.z.object({
|
|
501
|
+
toolName: zod_1.z.string().describe("Tool name to update"),
|
|
502
|
+
httpMethod: zod_1.z
|
|
503
|
+
.enum(["get", "post", "put", "delete", "compound"])
|
|
504
|
+
.nullish(),
|
|
505
|
+
category: zod_1.z
|
|
506
|
+
.enum([
|
|
507
|
+
"swap",
|
|
508
|
+
"lend",
|
|
509
|
+
"stake",
|
|
510
|
+
"nft",
|
|
511
|
+
"payment",
|
|
512
|
+
"data",
|
|
513
|
+
"governance",
|
|
514
|
+
"bridge",
|
|
515
|
+
"analytics",
|
|
516
|
+
"custom",
|
|
517
|
+
])
|
|
518
|
+
.nullish(),
|
|
519
|
+
paramsCount: zod_1.z.number().int().nullish(),
|
|
520
|
+
requiredParams: zod_1.z.number().int().nullish(),
|
|
521
|
+
}),
|
|
522
|
+
output: writeOutput,
|
|
523
|
+
},
|
|
524
|
+
deactivateTool: {
|
|
525
|
+
input: zod_1.z.object({
|
|
526
|
+
toolName: zod_1.z.string().describe("Tool name to deactivate"),
|
|
527
|
+
}),
|
|
528
|
+
output: writeOutput,
|
|
529
|
+
},
|
|
530
|
+
reactivateTool: {
|
|
531
|
+
input: zod_1.z.object({
|
|
532
|
+
toolName: zod_1.z.string().describe("Tool name to reactivate"),
|
|
533
|
+
}),
|
|
534
|
+
output: writeOutput,
|
|
535
|
+
},
|
|
536
|
+
reportInvocations: {
|
|
537
|
+
input: zod_1.z.object({
|
|
538
|
+
toolName: zod_1.z.string().describe("Tool name"),
|
|
539
|
+
invocations: zod_1.z
|
|
540
|
+
.number()
|
|
541
|
+
.int()
|
|
542
|
+
.positive()
|
|
543
|
+
.describe("Number of invocations to report"),
|
|
544
|
+
}),
|
|
545
|
+
output: writeOutput,
|
|
546
|
+
},
|
|
547
|
+
fetchTool: {
|
|
548
|
+
input: zod_1.z.object({
|
|
549
|
+
agentWallet: pubkey.describe("Agent wallet that published the tool"),
|
|
550
|
+
toolName: zod_1.z.string().describe("Tool name"),
|
|
551
|
+
}),
|
|
552
|
+
output: zod_1.z.object({
|
|
553
|
+
toolName: zod_1.z.string(),
|
|
554
|
+
version: zod_1.z.number(),
|
|
555
|
+
isActive: zod_1.z.boolean(),
|
|
556
|
+
totalInvocations: zod_1.z.string(),
|
|
557
|
+
paramsCount: zod_1.z.number(),
|
|
558
|
+
requiredParams: zod_1.z.number(),
|
|
559
|
+
isCompound: zod_1.z.boolean(),
|
|
560
|
+
agent: pubkey,
|
|
561
|
+
createdAt: zod_1.z.string(),
|
|
562
|
+
updatedAt: zod_1.z.string(),
|
|
563
|
+
}),
|
|
564
|
+
},
|
|
565
|
+
};
|
|
566
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
567
|
+
// Vault Schemas
|
|
568
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
569
|
+
/**
|
|
570
|
+
* Zod input/output schemas for the **sap-vault** protocol (10 tools).
|
|
571
|
+
*
|
|
572
|
+
* @name vaultSchemas
|
|
573
|
+
* @description Covers vault initialization, session management, encrypted
|
|
574
|
+
* memory inscription, nonce rotation, delegate authorization, and
|
|
575
|
+
* vault/session data fetching.
|
|
576
|
+
* @category Plugin
|
|
577
|
+
* @since v0.1.0
|
|
578
|
+
*/
|
|
579
|
+
exports.vaultSchemas = {
|
|
580
|
+
initVault: {
|
|
581
|
+
input: zod_1.z.object({
|
|
582
|
+
vaultNonce: hash32.describe("32-byte encryption nonce for vault initialization"),
|
|
583
|
+
}),
|
|
584
|
+
output: writeOutput,
|
|
585
|
+
},
|
|
586
|
+
openSession: {
|
|
587
|
+
input: zod_1.z.object({
|
|
588
|
+
sessionHash: hash32.describe("32-byte session identifier hash"),
|
|
589
|
+
}),
|
|
590
|
+
output: writeOutput,
|
|
591
|
+
},
|
|
592
|
+
inscribeMemory: {
|
|
593
|
+
input: zod_1.z.object({
|
|
594
|
+
sessionHash: zod_1.z
|
|
595
|
+
.string()
|
|
596
|
+
.describe("Hex-encoded session hash for PDA derivation"),
|
|
597
|
+
sequence: zod_1.z.number().int().describe("Sequence number within session"),
|
|
598
|
+
encryptedData: zod_1.z
|
|
599
|
+
.string()
|
|
600
|
+
.describe("Hex-encoded encrypted payload"),
|
|
601
|
+
nonce: zod_1.z
|
|
602
|
+
.array(zod_1.z.number().int().min(0).max(255))
|
|
603
|
+
.length(12)
|
|
604
|
+
.describe("12-byte AES-GCM nonce"),
|
|
605
|
+
contentHash: hash32.describe("SHA-256 of plaintext content"),
|
|
606
|
+
totalFragments: zod_1.z
|
|
607
|
+
.number()
|
|
608
|
+
.int()
|
|
609
|
+
.min(1)
|
|
610
|
+
.default(1)
|
|
611
|
+
.describe("Total fragments (1 = single)"),
|
|
612
|
+
fragmentIndex: zod_1.z.number().int().default(0).describe("Fragment index"),
|
|
613
|
+
compression: zod_1.z
|
|
614
|
+
.number()
|
|
615
|
+
.int()
|
|
616
|
+
.default(0)
|
|
617
|
+
.describe("Compression type (0=none, 1=deflate, 2=gzip, 3=brotli)"),
|
|
618
|
+
epochIndex: zod_1.z.number().int().default(0).describe("Epoch page index"),
|
|
619
|
+
}),
|
|
620
|
+
output: writeOutput,
|
|
621
|
+
},
|
|
622
|
+
closeSession: {
|
|
623
|
+
input: zod_1.z.object({
|
|
624
|
+
sessionHash: zod_1.z
|
|
625
|
+
.string()
|
|
626
|
+
.describe("Hex-encoded session hash for PDA derivation"),
|
|
627
|
+
}),
|
|
628
|
+
output: writeOutput,
|
|
629
|
+
},
|
|
630
|
+
closeVault: {
|
|
631
|
+
input: zod_1.z.object({}),
|
|
632
|
+
output: writeOutput,
|
|
633
|
+
},
|
|
634
|
+
rotateNonce: {
|
|
635
|
+
input: zod_1.z.object({
|
|
636
|
+
newNonce: hash32.describe("New 32-byte encryption nonce"),
|
|
637
|
+
}),
|
|
638
|
+
output: writeOutput,
|
|
639
|
+
},
|
|
640
|
+
addDelegate: {
|
|
641
|
+
input: zod_1.z.object({
|
|
642
|
+
delegatePubkey: pubkey.describe("Wallet to authorize as delegate"),
|
|
643
|
+
permissions: zod_1.z
|
|
644
|
+
.number()
|
|
645
|
+
.int()
|
|
646
|
+
.min(1)
|
|
647
|
+
.max(7)
|
|
648
|
+
.describe("Permission bitmask (1=inscribe, 2=closeSession, 4=openSession, 7=all)"),
|
|
649
|
+
expiresAt: zod_1.z
|
|
650
|
+
.string()
|
|
651
|
+
.describe("Delegation expiry (unix timestamp seconds)"),
|
|
652
|
+
}),
|
|
653
|
+
output: writeOutput,
|
|
654
|
+
},
|
|
655
|
+
revokeDelegate: {
|
|
656
|
+
input: zod_1.z.object({
|
|
657
|
+
delegatePubkey: pubkey.describe("Delegate wallet to revoke"),
|
|
658
|
+
}),
|
|
659
|
+
output: writeOutput,
|
|
660
|
+
},
|
|
661
|
+
fetchVault: {
|
|
662
|
+
input: zod_1.z.object({
|
|
663
|
+
agentWallet: pubkey
|
|
664
|
+
.nullish()
|
|
665
|
+
.describe("Agent wallet (defaults to caller)"),
|
|
666
|
+
}),
|
|
667
|
+
output: zod_1.z.object({
|
|
668
|
+
agent: pubkey,
|
|
669
|
+
wallet: pubkey,
|
|
670
|
+
totalSessions: zod_1.z.number(),
|
|
671
|
+
totalInscriptions: zod_1.z.string(),
|
|
672
|
+
totalBytesInscribed: zod_1.z.string(),
|
|
673
|
+
protocolVersion: zod_1.z.number(),
|
|
674
|
+
nonceVersion: zod_1.z.number(),
|
|
675
|
+
createdAt: zod_1.z.string(),
|
|
676
|
+
}),
|
|
677
|
+
},
|
|
678
|
+
fetchSession: {
|
|
679
|
+
input: zod_1.z.object({
|
|
680
|
+
agentWallet: pubkey.describe("Agent wallet"),
|
|
681
|
+
sessionHash: zod_1.z
|
|
682
|
+
.string()
|
|
683
|
+
.describe("Hex-encoded session hash"),
|
|
684
|
+
}),
|
|
685
|
+
output: zod_1.z.object({
|
|
686
|
+
vault: pubkey,
|
|
687
|
+
sequenceCounter: zod_1.z.number(),
|
|
688
|
+
totalBytes: zod_1.z.string(),
|
|
689
|
+
currentEpoch: zod_1.z.number(),
|
|
690
|
+
totalEpochs: zod_1.z.number(),
|
|
691
|
+
isClosed: zod_1.z.boolean(),
|
|
692
|
+
createdAt: zod_1.z.string(),
|
|
693
|
+
lastInscribedAt: zod_1.z.string(),
|
|
694
|
+
}),
|
|
695
|
+
},
|
|
696
|
+
};
|
|
697
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
698
|
+
// Indexing Schemas
|
|
699
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
700
|
+
/**
|
|
701
|
+
* Zod input/output schemas for the **sap-indexing** protocol (8 tools).
|
|
702
|
+
*
|
|
703
|
+
* @name indexingSchemas
|
|
704
|
+
* @description Covers capability and protocol index creation, agent
|
|
705
|
+
* registration/removal within indexes, and index data fetching.
|
|
706
|
+
* @category Plugin
|
|
707
|
+
* @since v0.1.0
|
|
708
|
+
*/
|
|
709
|
+
exports.indexingSchemas = {
|
|
710
|
+
initCapabilityIndex: {
|
|
711
|
+
input: zod_1.z.object({
|
|
712
|
+
capabilityId: zod_1.z
|
|
713
|
+
.string()
|
|
714
|
+
.describe("Capability ID to index (e.g. 'jupiter:swap')"),
|
|
715
|
+
}),
|
|
716
|
+
output: writeOutput,
|
|
717
|
+
},
|
|
718
|
+
addToCapabilityIndex: {
|
|
719
|
+
input: zod_1.z.object({
|
|
720
|
+
capabilityId: zod_1.z.string().describe("Capability ID"),
|
|
721
|
+
}),
|
|
722
|
+
output: writeOutput,
|
|
723
|
+
},
|
|
724
|
+
removeFromCapabilityIndex: {
|
|
725
|
+
input: zod_1.z.object({
|
|
726
|
+
capabilityId: zod_1.z.string().describe("Capability ID"),
|
|
727
|
+
}),
|
|
728
|
+
output: writeOutput,
|
|
729
|
+
},
|
|
730
|
+
initProtocolIndex: {
|
|
731
|
+
input: zod_1.z.object({
|
|
732
|
+
protocolId: zod_1.z
|
|
733
|
+
.string()
|
|
734
|
+
.describe("Protocol ID to index (e.g. 'jupiter')"),
|
|
735
|
+
}),
|
|
736
|
+
output: writeOutput,
|
|
737
|
+
},
|
|
738
|
+
addToProtocolIndex: {
|
|
739
|
+
input: zod_1.z.object({
|
|
740
|
+
protocolId: zod_1.z.string().describe("Protocol ID"),
|
|
741
|
+
}),
|
|
742
|
+
output: writeOutput,
|
|
743
|
+
},
|
|
744
|
+
removeFromProtocolIndex: {
|
|
745
|
+
input: zod_1.z.object({
|
|
746
|
+
protocolId: zod_1.z.string().describe("Protocol ID"),
|
|
747
|
+
}),
|
|
748
|
+
output: writeOutput,
|
|
749
|
+
},
|
|
750
|
+
fetchCapabilityIndex: {
|
|
751
|
+
input: zod_1.z.object({
|
|
752
|
+
capabilityId: zod_1.z.string().describe("Capability ID to look up"),
|
|
753
|
+
}),
|
|
754
|
+
output: zod_1.z.object({
|
|
755
|
+
capabilityId: zod_1.z.string(),
|
|
756
|
+
agents: zod_1.z.array(pubkey).describe("Agents registered for this capability"),
|
|
757
|
+
totalPages: zod_1.z.number(),
|
|
758
|
+
lastUpdated: zod_1.z.string(),
|
|
759
|
+
}),
|
|
760
|
+
},
|
|
761
|
+
fetchProtocolIndex: {
|
|
762
|
+
input: zod_1.z.object({
|
|
763
|
+
protocolId: zod_1.z.string().describe("Protocol ID to look up"),
|
|
764
|
+
}),
|
|
765
|
+
output: zod_1.z.object({
|
|
766
|
+
protocolId: zod_1.z.string(),
|
|
767
|
+
agents: zod_1.z.array(pubkey).describe("Agents registered for this protocol"),
|
|
768
|
+
totalPages: zod_1.z.number(),
|
|
769
|
+
lastUpdated: zod_1.z.string(),
|
|
770
|
+
}),
|
|
771
|
+
},
|
|
772
|
+
};
|
|
773
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
774
|
+
// Ledger Schemas
|
|
775
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
776
|
+
/**
|
|
777
|
+
* Zod input/output schemas for the **sap-ledger** protocol (6 tools).
|
|
778
|
+
*
|
|
779
|
+
* @name ledgerSchemas
|
|
780
|
+
* @description Covers ledger initialization, ring-buffer writes, sealing
|
|
781
|
+
* to permanent pages, ledger closure, and metadata/page fetching.
|
|
782
|
+
* @category Plugin
|
|
783
|
+
* @since v0.1.0
|
|
784
|
+
*/
|
|
785
|
+
exports.ledgerSchemas = {
|
|
786
|
+
initLedger: {
|
|
787
|
+
input: zod_1.z.object({
|
|
788
|
+
sessionHash: zod_1.z
|
|
789
|
+
.string()
|
|
790
|
+
.describe("Hex-encoded session hash (the session must exist)"),
|
|
791
|
+
agentWallet: pubkey
|
|
792
|
+
.nullish()
|
|
793
|
+
.describe("Agent wallet (defaults to caller)"),
|
|
794
|
+
}),
|
|
795
|
+
output: writeOutput,
|
|
796
|
+
},
|
|
797
|
+
writeLedger: {
|
|
798
|
+
input: zod_1.z.object({
|
|
799
|
+
sessionHash: zod_1.z.string().describe("Hex-encoded session hash"),
|
|
800
|
+
agentWallet: pubkey
|
|
801
|
+
.nullish()
|
|
802
|
+
.describe("Agent wallet (defaults to caller)"),
|
|
803
|
+
data: zod_1.z
|
|
804
|
+
.string()
|
|
805
|
+
.describe("Hex-encoded data to write to ring buffer"),
|
|
806
|
+
contentHash: hash32.describe("SHA-256 of the plaintext data"),
|
|
807
|
+
}),
|
|
808
|
+
output: writeOutput,
|
|
809
|
+
},
|
|
810
|
+
sealLedger: {
|
|
811
|
+
input: zod_1.z.object({
|
|
812
|
+
sessionHash: zod_1.z.string().describe("Hex-encoded session hash"),
|
|
813
|
+
agentWallet: pubkey
|
|
814
|
+
.nullish()
|
|
815
|
+
.describe("Agent wallet (defaults to caller)"),
|
|
816
|
+
}),
|
|
817
|
+
output: writeOutput,
|
|
818
|
+
},
|
|
819
|
+
closeLedger: {
|
|
820
|
+
input: zod_1.z.object({
|
|
821
|
+
sessionHash: zod_1.z.string().describe("Hex-encoded session hash"),
|
|
822
|
+
agentWallet: pubkey
|
|
823
|
+
.nullish()
|
|
824
|
+
.describe("Agent wallet (defaults to caller)"),
|
|
825
|
+
}),
|
|
826
|
+
output: writeOutput,
|
|
827
|
+
},
|
|
828
|
+
fetchLedger: {
|
|
829
|
+
input: zod_1.z.object({
|
|
830
|
+
sessionHash: zod_1.z.string().describe("Hex-encoded session hash"),
|
|
831
|
+
agentWallet: pubkey
|
|
832
|
+
.nullish()
|
|
833
|
+
.describe("Agent wallet (defaults to caller)"),
|
|
834
|
+
}),
|
|
835
|
+
output: zod_1.z.object({
|
|
836
|
+
session: pubkey,
|
|
837
|
+
authority: pubkey,
|
|
838
|
+
numEntries: zod_1.z.number(),
|
|
839
|
+
totalDataSize: zod_1.z.string(),
|
|
840
|
+
numPages: zod_1.z.number(),
|
|
841
|
+
createdAt: zod_1.z.string(),
|
|
842
|
+
updatedAt: zod_1.z.string(),
|
|
843
|
+
}),
|
|
844
|
+
},
|
|
845
|
+
fetchLedgerPage: {
|
|
846
|
+
input: zod_1.z.object({
|
|
847
|
+
sessionHash: zod_1.z.string().describe("Hex-encoded session hash"),
|
|
848
|
+
agentWallet: pubkey
|
|
849
|
+
.nullish()
|
|
850
|
+
.describe("Agent wallet (defaults to caller)"),
|
|
851
|
+
pageIndex: zod_1.z.number().int().describe("Page index"),
|
|
852
|
+
}),
|
|
853
|
+
output: zod_1.z.object({
|
|
854
|
+
ledger: pubkey,
|
|
855
|
+
pageIndex: zod_1.z.number(),
|
|
856
|
+
sealedAt: zod_1.z.string(),
|
|
857
|
+
entriesInPage: zod_1.z.number(),
|
|
858
|
+
dataSize: zod_1.z.number(),
|
|
859
|
+
data: zod_1.z.array(zod_1.z.number()).describe("Raw page data bytes"),
|
|
860
|
+
}),
|
|
861
|
+
},
|
|
862
|
+
};
|
|
863
|
+
//# sourceMappingURL=schemas.js.map
|