import { Run, GetRunContext } from './context.js'; import { FrameworkError } from './errors.js'; import { Serializable } from './internals/serializable.js'; import { E as Emitter } from './emitter-l0W9gC1A.js'; import { BaseMemory } from './memory/base.js'; import { OmitEmpty } from './internals/types.js'; import { AnyTool } from './tools/base.js'; /** * 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 AgentMeta { name: string; description: string; extraDescription?: string; tools: AnyTool[]; } type AgentCallbackValue = { data?: never; error: Error; } | { data: unknown; error?: never; } | object; type InternalAgentCallbackValue> = OmitEmpty & E; type PublicAgentCallbackValue = OmitEmpty; type AgentCallback = (value: T) => void; type GetAgentInput = T extends BaseAgent ? X : never; type GetAgentOutput = T extends BaseAgent ? X : never; type AnyAgent = BaseAgent; declare class AgentError extends FrameworkError { } interface BaseAgentRunOptions { signal?: AbortSignal; } declare abstract class BaseAgent extends Serializable { protected isRunning: boolean; abstract readonly emitter: Emitter; run(...[input, options]: Partial extends TOptions ? [input: TInput, options?: TOptions] : [input: TInput, options: TOptions]): Run; protected abstract _run(input: TInput, options: TOptions, run: GetRunContext): Promise; destroy(): void; abstract set memory(memory: BaseMemory); abstract get memory(): BaseMemory; get meta(): AgentMeta; createSnapshot(): { isRunning: boolean; }; loadSnapshot(snapshot: ReturnType): void; } export { AgentError as A, type BaseAgentRunOptions as B, type GetAgentInput as G, type InternalAgentCallbackValue as I, type PublicAgentCallbackValue as P, BaseAgent as a, type AgentMeta as b, type AgentCallbackValue as c, type AgentCallback as d, type GetAgentOutput as e, type AnyAgent as f };