import { BaseToolOptions, Tool, JSONToolOutput, ToolEmitter, ToolInput, BaseToolRunOptions } from '../base.js'; import { RunContext } from '../../context.js'; import { z } from 'zod'; import { AnyToolSchemaLike } from '../../internals/helpers/schema.js'; import { ClientOptions, estypes, Client } from '@elastic/elasticsearch'; import 'ajv'; import '../../errors.js'; import '../../internals/types.js'; import '../../internals/helpers/guards.js'; import '../../internals/serializable.js'; import 'promise-based-task'; import '../../cache/base.js'; import '../../emitter-l0W9gC1A.js'; import '../../internals/helpers/promise.js'; import 'zod-to-json-schema'; /** * Copyright 2025 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ interface ElasticSearchToolOptions extends BaseToolOptions { connection: ClientOptions; } type ElasticSearchToolResult = estypes.CatIndicesResponse | estypes.IndicesGetMappingResponse | estypes.SearchResponse; declare const ElasticSearchAction: { readonly ListIndices: "LIST_INDICES"; readonly GetIndexDetails: "GET_INDEX_DETAILS"; readonly Search: "SEARCH"; }; declare class ElasticSearchTool extends Tool, ElasticSearchToolOptions> { name: string; description: string; inputSchema(): z.ZodObject<{ action: z.ZodNativeEnum<{ readonly ListIndices: "LIST_INDICES"; readonly GetIndexDetails: "GET_INDEX_DETAILS"; readonly Search: "SEARCH"; }>; indexName: z.ZodOptional; query: z.ZodOptional; start: z.ZodOptional>; size: z.ZodOptional>; }, "strip", z.ZodTypeAny, { action: "LIST_INDICES" | "GET_INDEX_DETAILS" | "SEARCH"; start?: number | undefined; query?: string | undefined; indexName?: string | undefined; size?: number | undefined; }, { action: "LIST_INDICES" | "GET_INDEX_DETAILS" | "SEARCH"; start?: number | undefined; query?: string | undefined; indexName?: string | undefined; size?: number | undefined; }>; readonly emitter: ToolEmitter, JSONToolOutput>; protected validateInput(schema: AnyToolSchemaLike, input: unknown): asserts input is ToolInput; constructor(options: ElasticSearchToolOptions); protected client(): Promise; protected _run(input: ToolInput, _options: Partial, run: RunContext): Promise>; protected listIndices(signal?: AbortSignal): Promise; protected getIndexDetails(input: ToolInput, signal: AbortSignal): Promise; protected search(input: ToolInput, signal: AbortSignal): Promise; } export { ElasticSearchAction, ElasticSearchTool, type ElasticSearchToolOptions, type ElasticSearchToolResult };