/** * Handlers for MCP tools. */ import type { ReplicateClient } from "../replicate_client.js"; import type { Model } from "../models/model.js"; import type { ModelIO, Prediction } from "../models/prediction.js"; import { PredictionStatus } from "../models/prediction.js"; import type { Collection } from "../models/collection.js"; /** * Cache for models, predictions, and collections. */ interface Cache { modelCache: Map; predictionCache: Map; collectionCache: Map; predictionStatus: Map; } /** * Handle the search_models tool. */ export declare function handleSearchModels(client: ReplicateClient, cache: Cache, args: { query: string; }): Promise<{ content: { type: string; text: string; }[]; isError?: undefined; } | { isError: boolean; content: { type: string; text: string; }[]; }>; /** * Handle the list_models tool. */ export declare function handleListModels(client: ReplicateClient, cache: Cache, args: { owner?: string; cursor?: string; }): Promise<{ content: ({ type: string; text: string; } | null)[]; isError?: undefined; } | { isError: boolean; content: { type: string; text: string; }[]; }>; /** * Handle the list_collections tool. */ export declare function handleListCollections(client: ReplicateClient, cache: Cache, args: { cursor?: string; }): Promise<{ content: ({ type: string; text: string; } | null)[]; isError?: undefined; } | { isError: boolean; content: { type: string; text: string; }[]; }>; /** * Handle the get_collection tool. */ export declare function handleGetCollection(client: ReplicateClient, cache: Cache, args: { slug: string; }): Promise<{ content: ({ type: string; text: string; } | null)[]; isError?: undefined; } | { isError: boolean; content: { type: string; text: string; }[]; }>; /** * Handle the create_prediction tool. */ export declare function handleCreatePrediction(client: ReplicateClient, cache: Cache, args: { version: string | undefined; model: string | undefined; input: ModelIO | string; webhook?: string; }): Promise<{ content: { type: string; text: string; }[]; isError?: undefined; } | { isError: boolean; content: { type: string; text: string; }[]; }>; /** * Handle the cancel_prediction tool. */ export declare function handleCancelPrediction(client: ReplicateClient, cache: Cache, args: { prediction_id: string; }): Promise<{ content: { type: string; text: string; }[]; isError?: undefined; } | { isError: boolean; content: { type: string; text: string; }[]; }>; /** * Handle the get_model tool. */ export declare function handleGetModel(client: ReplicateClient, cache: Cache, args: { owner: string; name: string; }): Promise<{ content: ({ type: string; text: string; } | null)[]; isError?: undefined; } | { isError: boolean; content: { type: string; text: string; }[]; }>; /** * Handle the get_prediction tool. */ export declare function handleGetPrediction(client: ReplicateClient, cache: Cache, args: { prediction_id: string; }): Promise<{ content: ({ type: string; text: string; } | null)[]; isError?: undefined; } | { isError: boolean; content: { type: string; text: string; }[]; }>; export declare function handleListPredictions(client: ReplicateClient, cache: Cache, args: { limit?: number; cursor?: string; }): Promise<{ content: { type: string; text: string; }[]; isError?: undefined; } | { isError: boolean; content: { type: string; text: string; }[]; }>; export {};