@utcp/sdk
Version:
Universal Tool Calling Protocol (UTCP) client library for TypeScript
42 lines (41 loc) • 1.65 kB
TypeScript
import { ClientTransportInterface } from '../client-transport-interface';
import { Tool } from '../../shared/tool';
import { ProviderUnion } from '../../shared/provider';
/**
* HTTP transport implementation for UTCP clients
*/
export declare class HttpClientTransport implements ClientTransportInterface {
private _oauthTokens;
private _logger;
/**
* Create a new HTTP transport
* @param logger Optional logger function
*/
constructor(logger?: (message: string, error?: boolean) => void);
/**
* Discover tools from a REST API provider
* @param manual_provider Details of the REST provider
* @returns List of tool declarations, or empty array if discovery fails
*/
register_tool_provider(manual_provider: ProviderUnion): Promise<Tool[]>;
/**
* Deregistering a tool provider is a no-op for the stateless HTTP transport
* @param manual_provider The provider to deregister
*/
deregister_tool_provider(manual_provider: ProviderUnion): Promise<void>;
/**
* Calls a tool on an HTTP provider
* @param tool_name The name of the tool to call
* @param args Arguments to pass to the tool
* @param tool_provider The provider to use
* @returns The result of the tool call
*/
call_tool(tool_name: string, args: Record<string, any>, tool_provider: ProviderUnion): Promise<any>;
/**
* Handles OAuth2 client credentials flow, trying both body and auth header methods
* @param authDetails The OAuth2 authentication details
* @returns The access token
*/
private _handleOAuth2;
private _buildUrlWithPathParams;
}