import { McpToolResult, Subscription, McpResourceContent, JsonObject, CvmRegistryCallOptions, CvmRegistryOptions, CvmRegistryEntry, CvmRegistryQuery } from '@napplet/core'; import { c as CvmServerRef, a as CvmRequestOptions, C as CvmDiscoverQuery, b as CvmServer, e as McpResource, f as McpTool, d as McpMessage } from '../cvm-server-types-CMD9X8bD.js'; /** * Napplet NAP cvm sdk entrypoint. * * @module */ /** * @napplet/nap/cvm -- SDK helpers wrapping window.napplet.cvm. * * These convenience functions delegate to `window.napplet.cvm.*` at call time. * The shim must be imported somewhere to install the global. */ /** * Discover public ContextVM servers known to the shell. * * @param query Optional discovery filter * @returns Promise resolving to the discovered servers * * @example * ```ts * import { cvmDiscover } from '@napplet/nap/cvm'; * * const servers = await cvmDiscover({ search: 'relay', limit: 5 }); * ``` */ declare function cvmDiscover(query?: CvmDiscoverQuery): Promise; /** * Send a raw MCP JSON-RPC message to a ContextVM server. * * @param server Target ContextVM server * @param message MCP JSON-RPC message * @param options Optional per-request options * @returns Promise resolving to the MCP response message */ declare function cvmRequest(server: CvmServerRef, message: McpMessage, options?: CvmRequestOptions): Promise; /** * List the tools exposed by a ContextVM server (MCP `tools/list`). * * @param server Target ContextVM server * @param options Optional per-request options * @returns Promise resolving to the server's tool definitions */ declare function cvmListTools(server: CvmServerRef, options?: CvmRequestOptions): Promise; /** * Call a tool on a ContextVM server (MCP `tools/call`). * * @param server Target ContextVM server * @param name Tool name * @param args Tool arguments * @param options Optional per-request options * @returns Promise resolving to the MCP tool result * * @example * ```ts * import { cvmCallTool } from '@napplet/nap/cvm'; * * const result = await cvmCallTool({ pubkey: '65a334...' }, 'get_relay', { * url: 'wss://relay.example.com', * }); * ``` */ declare function cvmCallTool(server: CvmServerRef, name: string, args?: Record, options?: CvmRequestOptions): Promise; /** * List the resources exposed by a ContextVM server (MCP `resources/list`). * * @param server Target ContextVM server * @param options Optional per-request options * @returns Promise resolving to the server's resource descriptors */ declare function cvmListResources(server: CvmServerRef, options?: CvmRequestOptions): Promise; /** * Read a resource from a ContextVM server (MCP `resources/read`). * * @param server Target ContextVM server * @param uri Resource URI * @param options Optional per-request options * @returns Promise resolving to the first resource content entry */ declare function cvmReadResource(server: CvmServerRef, uri: string, options?: CvmRequestOptions): Promise; /** * Close shell-maintained session state for a server. * * @param server Server whose session should be torn down * @returns Promise that resolves once the shell confirms closure */ declare function cvmClose(server: CvmServerRef): Promise; /** * Listen for server-pushed MCP messages (`cvm.event`). * * @param callback Called with `(server, message)` for each server event * @returns A Subscription with `close()` to stop listening */ declare function cvmOnEvent(callback: (server: CvmServerRef, message: McpMessage) => void): Subscription; /** * List shell-curated ContextVM registry families. * * @param query Optional search/family/schema filter * @returns Promise resolving to registry entries */ declare function cvmRegistryList(query?: CvmRegistryQuery): Promise; /** * Test whether the shell can call a ContextVM registry family. * * @param family Registry family name * @param options Optional schema/provider constraints * @returns Promise resolving to availability */ declare function cvmRegistryHas(family: string, options?: CvmRegistryOptions): Promise; /** * Describe a shell-selected ContextVM registry family. * * @param family Registry family name * @param options Optional schema/provider constraints * @returns Promise resolving to the selected registry entry */ declare function cvmRegistryDescribe(family: string, options?: CvmRegistryOptions): Promise; /** * Call a tool on the shell-selected provider for a ContextVM registry family. * * @param family Registry family name * @param tool Tool name inside the family * @param args Optional tool arguments * @param options Optional schema/provider/cache/payment constraints * @returns Promise resolving to the MCP tool result */ declare function cvmRegistryCall(family: string, tool: string, args?: JsonObject, options?: CvmRegistryCallOptions): Promise; export { cvmCallTool, cvmClose, cvmDiscover, cvmListResources, cvmListTools, cvmOnEvent, cvmReadResource, cvmRegistryCall, cvmRegistryDescribe, cvmRegistryHas, cvmRegistryList, cvmRequest };