/** * @module indexing * @description Scalable discovery layer — capability indexes, protocol indexes, * and tool category indexes for the Synapse Agent Protocol. * * Indexes are shared PDA-based registries that map agents and tools to * discovery dimensions, enabling efficient on-chain lookups. * * @category Modules * @since v0.1.0 * @packageDocumentation */ import { type PublicKey, type TransactionSignature } from "@solana/web3.js"; import { BaseModule } from "./base"; import type { CapabilityIndexData, ProtocolIndexData, ToolCategoryIndexData } from "../types"; /** * @name IndexingModule * @description Manages on-chain discovery indexes for the Synapse Agent Protocol. * Provides methods to create, populate, prune, close, and fetch capability * indexes, protocol indexes, and tool category indexes. * * @category Modules * @since v0.1.0 * @extends BaseModule * * @example * ```ts * const sap = new SapClient(provider); * // Create a capability index and add your agent * await sap.indexing.initCapabilityIndex("text-generation"); * // Query agents by capability * const idx = await sap.indexing.fetchCapabilityIndex("text-generation"); * ``` */ export declare class IndexingModule extends BaseModule { /** * @name hash * @description Hash a capability or protocol ID string for use as a PDA seed. * Uses SHA-256 internally. * @param id - The capability or protocol identifier string. * @returns {Uint8Array} The 32-byte SHA-256 hash. * @since v0.1.0 */ hash(id: string): Uint8Array; /** * @name initCapabilityIndex * @description Create a new capability index and register the caller’s agent. * The capability ID is hashed to derive the PDA. * @param capabilityId - Human-readable capability identifier (e.g. `"text-generation"`). * @returns {Promise} The transaction signature. * @since v0.1.0 */ initCapabilityIndex(capabilityId: string): Promise; /** * @name addToCapabilityIndex * @description Add the caller’s agent to an existing capability index. * @param capabilityId - The capability identifier string. * @returns {Promise} The transaction signature. * @since v0.1.0 */ addToCapabilityIndex(capabilityId: string): Promise; /** * @name removeFromCapabilityIndex * @description Remove the caller’s agent from a capability index. * @param capabilityId - The capability identifier string. * @returns {Promise} The transaction signature. * @since v0.1.0 */ removeFromCapabilityIndex(capabilityId: string): Promise; /** * @name closeCapabilityIndex * @description Close an empty capability index PDA and reclaim rent. * @param capabilityId - The capability identifier string. * @returns {Promise} The transaction signature. * @since v0.1.0 */ closeCapabilityIndex(capabilityId: string): Promise; /** * @name initProtocolIndex * @description Create a new protocol index and register the caller’s agent. * The protocol ID is hashed to derive the PDA. * @param protocolId - Human-readable protocol identifier (e.g. `"mcp-v1"`). * @returns {Promise} The transaction signature. * @since v0.1.0 */ initProtocolIndex(protocolId: string): Promise; /** * @name addToProtocolIndex * @description Add the caller’s agent to an existing protocol index. * @param protocolId - The protocol identifier string. * @returns {Promise} The transaction signature. * @since v0.1.0 */ addToProtocolIndex(protocolId: string): Promise; /** * @name removeFromProtocolIndex * @description Remove the caller’s agent from a protocol index. * @param protocolId - The protocol identifier string. * @returns {Promise} The transaction signature. * @since v0.1.0 */ removeFromProtocolIndex(protocolId: string): Promise; /** * @name closeProtocolIndex * @description Close an empty protocol index PDA and reclaim rent. * @param protocolId - The protocol identifier string. * @returns {Promise} The transaction signature. * @since v0.1.0 */ closeProtocolIndex(protocolId: string): Promise; /** * @name initToolCategoryIndex * @description Create a new tool category index PDA. * @param category - Numeric tool category enum value. * @returns {Promise} The transaction signature. * @since v0.1.0 */ initToolCategoryIndex(category: number): Promise; /** * @name addToToolCategory * @description Add a tool to its matching category index. * @param category - Numeric tool category enum value. * @param toolPda - The tool descriptor PDA to add. * @returns {Promise} The transaction signature. * @since v0.1.0 */ addToToolCategory(category: number, toolPda: PublicKey): Promise; /** * @name removeFromToolCategory * @description Remove a tool from a category index. * @param category - Numeric tool category enum value. * @param toolPda - The tool descriptor PDA to remove. * @returns {Promise} The transaction signature. * @since v0.1.0 */ removeFromToolCategory(category: number, toolPda: PublicKey): Promise; /** * @name closeToolCategoryIndex * @description Close an empty tool category index PDA and reclaim rent. * @param category - Numeric tool category enum value. * @returns {Promise} The transaction signature. * @since v0.1.0 */ closeToolCategoryIndex(category: number): Promise; /** * @name fetchCapabilityIndex * @description Fetch a deserialized `CapabilityIndex` account by capability ID. * @param capabilityId - The capability identifier string. * @returns {Promise} The capability index data. * @throws Will throw if the capability index does not exist. * @since v0.1.0 */ fetchCapabilityIndex(capabilityId: string): Promise; /** * @name fetchCapabilityIndexNullable * @description Fetch a deserialized `CapabilityIndex` account, or `null` * if it does not exist on-chain. * @param capabilityId - The capability identifier string. * @returns {Promise} The capability index data or `null`. * @since v0.1.0 */ fetchCapabilityIndexNullable(capabilityId: string): Promise; /** * @name fetchProtocolIndex * @description Fetch a deserialized `ProtocolIndex` account by protocol ID. * @param protocolId - The protocol identifier string. * @returns {Promise} The protocol index data. * @throws Will throw if the protocol index does not exist. * @since v0.1.0 */ fetchProtocolIndex(protocolId: string): Promise; /** * @name fetchProtocolIndexNullable * @description Fetch a deserialized `ProtocolIndex` account, or `null` * if it does not exist on-chain. * @param protocolId - The protocol identifier string. * @returns {Promise} The protocol index data or `null`. * @since v0.1.0 */ fetchProtocolIndexNullable(protocolId: string): Promise; /** * @name fetchToolCategoryIndex * @description Fetch a deserialized `ToolCategoryIndex` account by category number. * @param category - Numeric tool category enum value. * @returns {Promise} The tool category index data. * @throws Will throw if the tool category index does not exist. * @since v0.1.0 */ fetchToolCategoryIndex(category: number): Promise; /** * @name fetchToolCategoryIndexNullable * @description Fetch a deserialized `ToolCategoryIndex` account, or `null` * if it does not exist on-chain. * @param category - Numeric tool category enum value. * @returns {Promise} The tool category index data or `null`. * @since v0.1.0 */ fetchToolCategoryIndexNullable(category: number): Promise; } //# sourceMappingURL=indexing.d.ts.map