import { CallToolResult } from "../../../../confluent/schema.js"; import { BaseToolHandler, ToolCategory, ToolConfig } from "../../../../confluent/tools/base-tools.js"; import { ServerRuntime } from "../../../../server-runtime.js"; import { z } from "zod"; export declare const getConsumerGroupLagArgs: z.ZodObject<{ groupId: z.ZodString; topics: z.ZodOptional>; cluster_id: z.ZodOptional; environment_id: z.ZodOptional; }, z.core.$strip>; /** * Per-partition lag row as the tool returns it. `committedOffset` / * `highWatermark` are strings to preserve int64 precision past JS's 2^53 * safe-integer boundary; `lag` is a `Number` because the BigInt subtraction * is done server-side and asking an LLM caller to subtract two int64-typed * strings is the wrong ergonomic trade. `null` for both `committedOffset` * and `lag` marks a partition where the lag is unknown — either the group * has never committed (distinct from a zero-lag partition the group is * caught up on) or the broker reported a per-partition error on the * OffsetFetch response (see {@link error}). */ export type ConsumerGroupLagPartition = { partition: number; committedOffset: string | null; highWatermark: string; lag: number | null; metadata: string | null; leaderEpoch: number | null; /** * Set when the broker reported a per-partition error on the * OffsetFetch response (e.g., leader unavailable, partition-level * authorization failure). `committedOffset` and `lag` are `null` in * this case — the broker's `offset` value is not meaningful when an * error is attached — and the partition is excluded from `totalLag`. * Surfacing the `code` and `message` lets the caller act on the * specific failure rather than guessing why the lag is unknown. */ error?: { code: number; message: string; }; }; /** Per-topic group of {@link ConsumerGroupLagPartition} rows. */ export type ConsumerGroupLagTopic = { topic: string; partitions: ConsumerGroupLagPartition[]; }; /** Structured response payload mirrored into `result.structuredContent`. */ export type GetConsumerGroupLagResponse = { groupId: string; topics: ConsumerGroupLagTopic[]; totalLag: number; }; /** * Read-only tool that computes live offset lag for a single Kafka * consumer group, returning per-(topic, partition) {committed, high, lag} * rows and a total lag count. Combines `admin.fetchOffsets({groupId})` * (committed offsets) with the shared `fetchPartitionWatermarks` helper * (high watermarks), then BigInt-subtracts per partition. A partition the * group has never committed to surfaces as {committedOffset: null, * lag: null} and is excluded from the `totalLag` sum. Lag may briefly go * negative during a consumer-group rebalance (committed offset captured * at a different isolation level than the watermark snapshot); the value * is surfaced as-is rather than clamped, since clamping would hide a real * if rare state. */ export declare class GetConsumerGroupLagHandler extends BaseToolHandler { readonly category = ToolCategory.Kafka; readonly predicate: import("../../../../confluent/tools/connection-predicates.js").ConnectionPredicate; getToolConfig(): ToolConfig; handle(runtime: ServerRuntime, toolArguments: Record): Promise; } //# sourceMappingURL=get-consumer-group-lag-handler.d.ts.map