@contextvm/ctxcn
Version:
A command-line utility inspired by shadcn that streamlines the integration of ContextVM (CVM) servers into your TypeScript projects
149 lines • 5.36 kB
TypeScript
import { type NostrTransportOptions } from "@contextvm/sdk";
export type Test = {
echo: (message: string) => Promise<{
[k: string]: unknown;
}>;
add: (a: number, b: number) => Promise<{
[k: string]: unknown;
}>;
longRunningOperation: (duration?: number, steps?: number) => Promise<{
[k: string]: unknown;
}>;
printEnv: (args: {}) => Promise<{
[k: string]: unknown;
}>;
sampleLLM: (prompt: string, maxTokens?: number) => Promise<{
[k: string]: unknown;
}>;
getTinyImage: (args: {}) => Promise<{
[k: string]: unknown;
}>;
annotatedMessage: (messageType: string, includeImage?: boolean) => Promise<{
[k: string]: unknown;
}>;
getResourceReference: (resourceId: number) => Promise<{
[k: string]: unknown;
}>;
getResourceLinks: (count?: number) => Promise<{
[k: string]: unknown;
}>;
structuredContent: (location: string) => Promise<{
/**
* Temperature in celsius
*/
temperature: number;
/**
* Weather conditions description
*/
conditions: string;
/**
* Humidity percentage
*/
humidity: number;
}>;
};
export declare class TestClient implements Test {
static readonly SERVER_PUBKEY = "e6bc4af0a6434e2486d382810d31092f27f616f08d76283f4c6017357f1b09f6";
private client;
private transport;
constructor(options?: Partial<NostrTransportOptions> & {
privateKey?: string;
relays?: string[];
});
disconnect(): Promise<void>;
private call;
/**
* Echoes back the input
* @param {string} message Message to echo
* @returns {Promise<{ [k: string]: unknown; }>} The result of the echo operation
*/
echo(message: string): Promise<{
[k: string]: unknown;
}>;
/**
* Adds two numbers
* @param {number} a First number
* @param {number} b Second number
* @returns {Promise<{ [k: string]: unknown; }>} The result of the add operation
*/
add(a: number, b: number): Promise<{
[k: string]: unknown;
}>;
/**
* Demonstrates a long running operation with progress updates
* @param {number} duration [optional] Duration of the operation in seconds
* @param {number} steps [optional] Number of steps in the operation
* @returns {Promise<{ [k: string]: unknown; }>} The result of the longRunningOperation operation
*/
longRunningOperation(duration?: number, steps?: number): Promise<{
[k: string]: unknown;
}>;
/**
* Prints all environment variables, helpful for debugging MCP server configuration
* @returns {Promise<{ [k: string]: unknown; }>} The result of the printEnv operation
*/
printEnv(args: {}): Promise<{
[k: string]: unknown;
}>;
/**
* Samples from an LLM using MCP's sampling feature
* @param {string} prompt The prompt to send to the LLM
* @param {number} maxTokens [optional] Maximum number of tokens to generate
* @returns {Promise<{ [k: string]: unknown; }>} The result of the sampleLLM operation
*/
sampleLLM(prompt: string, maxTokens?: number): Promise<{
[k: string]: unknown;
}>;
/**
* Returns the MCP_TINY_IMAGE
* @returns {Promise<{ [k: string]: unknown; }>} The result of the getTinyImage operation
*/
getTinyImage(args: {}): Promise<{
[k: string]: unknown;
}>;
/**
* Demonstrates how annotations can be used to provide metadata about content
* @param {string} messageType Type of message to demonstrate different annotation patterns
* @param {boolean} includeImage [optional] Whether to include an example image
* @returns {Promise<{ [k: string]: unknown; }>} The result of the annotatedMessage operation
*/
annotatedMessage(messageType: string, includeImage?: boolean): Promise<{
[k: string]: unknown;
}>;
/**
* Returns a resource reference that can be used by MCP clients
* @param {number} resourceId ID of the resource to reference (1-100)
* @returns {Promise<{ [k: string]: unknown; }>} The result of the getResourceReference operation
*/
getResourceReference(resourceId: number): Promise<{
[k: string]: unknown;
}>;
/**
* Returns multiple resource links that reference different types of resources
* @param {number} count [optional] Number of resource links to return (1-10)
* @returns {Promise<{ [k: string]: unknown; }>} The result of the getResourceLinks operation
*/
getResourceLinks(count?: number): Promise<{
[k: string]: unknown;
}>;
/**
* Returns structured content along with an output schema for client data validation
* @param {string} location City name or zip code
* @returns {Promise<{ temperature: number; conditions: string; humidity: number; }>} The result of the structuredContent operation
*/
structuredContent(location: string): Promise<{
/**
* Temperature in celsius
*/
temperature: number;
/**
* Weather conditions description
*/
conditions: string;
/**
* Humidity percentage
*/
humidity: number;
}>;
}
//# sourceMappingURL=TestClient.d.ts.map