import type { SchemaRegistryClient } from "@confluentinc/schemaregistry"; import type { MessageOptions, SchemaCheckResult } from "../../../../confluent/schema-registry-helper.js"; import type { CallToolResult } from "../../../../confluent/schema.js"; import type { ToolConfig } from "../../../../confluent/tools/base-tools.js"; import { BaseToolHandler, ToolCategory } from "../../../../confluent/tools/base-tools.js"; import type { ServerRuntime } from "../../../../server-runtime.js"; /** * Handler for producing messages to a Kafka topic, with support for Confluent Schema Registry serialization (AVRO, JSON, PROTOBUF) for both key and value. * * - If schema registry is enabled, `schemaType` is required and the handler checks if a schema is already registered for the topic's key/value subject. * - If a schema is provided, it is registered before serialization. * - If no schema is provided and one is already registered, the serializer uses the latest registered version. * - If no schema is provided and none is registered, it returns an error. * - Serialization is performed using the appropriate serializer for the schema type. * - Produces the message to the specified Kafka topic, handling both key and value serialization as needed. */ export declare class ProduceKafkaMessageHandler extends BaseToolHandler { /** * Handles the result of a schema check, returning a CallToolResult if a schema issue is found, or null otherwise. * @param result - The schema check result to handle * @returns A CallToolResult if a schema issue is found, or null otherwise */ handleSchemaCheckResult(result: SchemaCheckResult): CallToolResult | null; /** * Run the pre-serialization schema check for both sides. Returns an error * CallToolResult when either side needs a registered schema that isn't there * (and none was provided to register), or null when both sides are ready. */ checkSchemasReady(topicName: string, value: MessageOptions, key: MessageOptions | undefined, registry: SchemaRegistryClient | undefined): Promise; /** * Main handler for producing a message to a Kafka topic, including schema registry logic and serialization. * Handles both value and key, and returns a CallToolResult with the outcome. * @param clientManager - The client manager for Kafka and registry clients * @param toolArguments - The arguments for the tool, including topic, value, and key * @returns A CallToolResult describing the outcome of the produce operation */ handle(runtime: ServerRuntime, toolArguments: Record): Promise; /** * Returns the tool configuration including name, description, and input schema. * @returns The tool configuration */ getToolConfig(): ToolConfig; readonly category = ToolCategory.Kafka; readonly predicate: import("../../../../confluent/tools/connection-predicates.js").ConnectionPredicate; } //# sourceMappingURL=produce-kafka-message-handler.d.ts.map