@iqai/adk 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/index.d.mts +74 -8
- package/dist/index.d.ts +74 -8
- package/dist/index.js +93 -13
- package/dist/index.mjs +88 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @iqai/adk
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9c8441c: Enhanced CoinGecko MCP server support with remote endpoints
|
|
8
|
+
|
|
9
|
+
- **Enhanced createMcpConfig function**: Now automatically detects URLs and uses `mcp-remote` for remote MCP endpoints while maintaining backward compatibility with npm packages
|
|
10
|
+
- **Updated McpCoinGecko**: Now uses the remote CoinGecko MCP API endpoint (`https://mcp.api.coingecko.com/mcp`) instead of the npm package
|
|
11
|
+
- **Added McpCoinGeckoPro**: New function for accessing the professional CoinGecko MCP API endpoint (`https://mcp.pro-api.coingecko.com/mcp`) with enhanced features and higher rate limits
|
|
12
|
+
- **Improved code maintainability**: Refactored both CoinGecko functions to use the enhanced `createMcpConfig`, eliminating code duplication
|
|
13
|
+
- **Added documentation**: Updated module documentation with examples showing how to use both CoinGecko functions
|
|
14
|
+
|
|
15
|
+
This change enables seamless integration with CoinGecko's remote MCP endpoints while providing a cleaner, more maintainable codebase for future remote endpoint integrations.
|
|
16
|
+
|
|
3
17
|
## 0.4.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -674,6 +674,18 @@ declare class ReadonlyContext {
|
|
|
674
674
|
* The name of the agent that is currently running.
|
|
675
675
|
*/
|
|
676
676
|
get agentName(): string;
|
|
677
|
+
/**
|
|
678
|
+
* The application name for this invocation. READONLY field.
|
|
679
|
+
*/
|
|
680
|
+
get appName(): string;
|
|
681
|
+
/**
|
|
682
|
+
* The user ID for this invocation. READONLY field.
|
|
683
|
+
*/
|
|
684
|
+
get userId(): string;
|
|
685
|
+
/**
|
|
686
|
+
* The session ID for this invocation. READONLY field.
|
|
687
|
+
*/
|
|
688
|
+
get sessionId(): string;
|
|
677
689
|
/**
|
|
678
690
|
* The state of the current session. READONLY field.
|
|
679
691
|
*/
|
|
@@ -1255,7 +1267,7 @@ type ToolUnion = BaseTool | ((...args: any[]) => any);
|
|
|
1255
1267
|
type SingleBeforeModelCallback = (args: {
|
|
1256
1268
|
callbackContext: CallbackContext;
|
|
1257
1269
|
llmRequest: LlmRequest;
|
|
1258
|
-
}) => LlmResponse | null | Promise<LlmResponse | null>;
|
|
1270
|
+
}) => LlmResponse | null | undefined | Promise<LlmResponse | null | undefined>;
|
|
1259
1271
|
/**
|
|
1260
1272
|
* Before model callback type (single or array)
|
|
1261
1273
|
*/
|
|
@@ -1266,7 +1278,7 @@ type BeforeModelCallback = SingleBeforeModelCallback | SingleBeforeModelCallback
|
|
|
1266
1278
|
type SingleAfterModelCallback = (args: {
|
|
1267
1279
|
callbackContext: CallbackContext;
|
|
1268
1280
|
llmResponse: LlmResponse;
|
|
1269
|
-
}) => LlmResponse | null | Promise<LlmResponse | null>;
|
|
1281
|
+
}) => LlmResponse | null | undefined | Promise<LlmResponse | null | undefined>;
|
|
1270
1282
|
/**
|
|
1271
1283
|
* After model callback type (single or array)
|
|
1272
1284
|
*/
|
|
@@ -1274,7 +1286,7 @@ type AfterModelCallback = SingleAfterModelCallback | SingleAfterModelCallback[];
|
|
|
1274
1286
|
/**
|
|
1275
1287
|
* Single before tool callback type
|
|
1276
1288
|
*/
|
|
1277
|
-
type SingleBeforeToolCallback = (tool: BaseTool, args: Record<string, any>, toolContext: ToolContext) => Record<string, any> | null | Promise<Record<string, any> | null>;
|
|
1289
|
+
type SingleBeforeToolCallback = (tool: BaseTool, args: Record<string, any>, toolContext: ToolContext) => Record<string, any> | null | undefined | Promise<Record<string, any> | null | undefined>;
|
|
1278
1290
|
/**
|
|
1279
1291
|
* Before tool callback type (single or array)
|
|
1280
1292
|
*/
|
|
@@ -1282,7 +1294,7 @@ type BeforeToolCallback = SingleBeforeToolCallback | SingleBeforeToolCallback[];
|
|
|
1282
1294
|
/**
|
|
1283
1295
|
* Single after tool callback type
|
|
1284
1296
|
*/
|
|
1285
|
-
type SingleAfterToolCallback = (tool: BaseTool, args: Record<string, any>, toolContext: ToolContext, toolResponse: Record<string, any>) => Record<string, any> | null | Promise<Record<string, any> | null>;
|
|
1297
|
+
type SingleAfterToolCallback = (tool: BaseTool, args: Record<string, any>, toolContext: ToolContext, toolResponse: Record<string, any>) => Record<string, any> | null | undefined | Promise<Record<string, any> | null | undefined>;
|
|
1286
1298
|
/**
|
|
1287
1299
|
* After tool callback type (single or array)
|
|
1288
1300
|
*/
|
|
@@ -2275,6 +2287,24 @@ declare function createSamplingHandler(handler: SamplingHandler): SamplingHandle
|
|
|
2275
2287
|
*
|
|
2276
2288
|
* @example
|
|
2277
2289
|
* ```typescript
|
|
2290
|
+
* // Using remote MCP endpoints (CoinGecko):
|
|
2291
|
+
* const coinGeckoTools = await McpCoinGecko().getTools();
|
|
2292
|
+
*
|
|
2293
|
+
* const coinGeckoProTools = await McpCoinGeckoPro({
|
|
2294
|
+
* env: {
|
|
2295
|
+
* COINGECKO_PRO_API_KEY: env.COINGECKO_PRO_API_KEY
|
|
2296
|
+
* }
|
|
2297
|
+
* }).getTools();
|
|
2298
|
+
*
|
|
2299
|
+
* const cryptoAgent = new LlmAgent({
|
|
2300
|
+
* name: "crypto_assistant",
|
|
2301
|
+
* model: "gemini-2.5-flash",
|
|
2302
|
+
* tools: [...coinGeckoTools, ...coinGeckoProTools],
|
|
2303
|
+
* });
|
|
2304
|
+
* ```
|
|
2305
|
+
*
|
|
2306
|
+
* @example
|
|
2307
|
+
* ```typescript
|
|
2278
2308
|
* // Using MCP servers with sampling handlers:
|
|
2279
2309
|
* import { createSamplingHandler, LlmResponse } from "@iqai/adk";
|
|
2280
2310
|
*
|
|
@@ -2388,11 +2418,18 @@ declare function McpTelegram(config?: McpServerConfig): McpToolset;
|
|
|
2388
2418
|
*/
|
|
2389
2419
|
declare function McpDiscord(config?: McpServerConfig): McpToolset;
|
|
2390
2420
|
/**
|
|
2391
|
-
* MCP CoinGecko - Access cryptocurrency market data and analytics
|
|
2421
|
+
* MCP CoinGecko - Access cryptocurrency market data and analytics via remote endpoint
|
|
2392
2422
|
*
|
|
2393
|
-
*
|
|
2423
|
+
* Uses the public CoinGecko MCP API endpoint. No API key required for basic functionality.
|
|
2394
2424
|
*/
|
|
2395
2425
|
declare function McpCoinGecko(config?: McpServerConfig): McpToolset;
|
|
2426
|
+
/**
|
|
2427
|
+
* MCP CoinGecko Pro - Access premium cryptocurrency market data and analytics via remote endpoint
|
|
2428
|
+
*
|
|
2429
|
+
* Uses the professional CoinGecko MCP API endpoint with enhanced features and higher rate limits.
|
|
2430
|
+
* Requires a CoinGecko Pro API subscription.
|
|
2431
|
+
*/
|
|
2432
|
+
declare function McpCoinGeckoPro(config?: McpServerConfig): McpToolset;
|
|
2396
2433
|
/**
|
|
2397
2434
|
* MCP Upbit - Interact with the Upbit cryptocurrency exchange
|
|
2398
2435
|
*
|
|
@@ -2528,6 +2565,7 @@ declare const index$7_McpAbi: typeof McpAbi;
|
|
|
2528
2565
|
declare const index$7_McpAtp: typeof McpAtp;
|
|
2529
2566
|
declare const index$7_McpBamm: typeof McpBamm;
|
|
2530
2567
|
declare const index$7_McpCoinGecko: typeof McpCoinGecko;
|
|
2568
|
+
declare const index$7_McpCoinGeckoPro: typeof McpCoinGeckoPro;
|
|
2531
2569
|
type index$7_McpConfig = McpConfig;
|
|
2532
2570
|
declare const index$7_McpDiscord: typeof McpDiscord;
|
|
2533
2571
|
type index$7_McpError = McpError;
|
|
@@ -2571,7 +2609,7 @@ declare const index$7_jsonSchemaToDeclaration: typeof jsonSchemaToDeclaration;
|
|
|
2571
2609
|
declare const index$7_mcpSchemaToParameters: typeof mcpSchemaToParameters;
|
|
2572
2610
|
declare const index$7_normalizeJsonSchema: typeof normalizeJsonSchema;
|
|
2573
2611
|
declare namespace index$7 {
|
|
2574
|
-
export { index$7_AgentTool as AgentTool, type index$7_AgentToolConfig as AgentToolConfig, type index$7_BaseAgentType as BaseAgentType, index$7_BaseTool as BaseTool, type index$7_BuildFunctionDeclarationOptions as BuildFunctionDeclarationOptions, type index$7_CreateToolConfig as CreateToolConfig, type index$7_CreateToolConfigWithSchema as CreateToolConfigWithSchema, type index$7_CreateToolConfigWithoutSchema as CreateToolConfigWithoutSchema, index$7_ExitLoopTool as ExitLoopTool, index$7_FileOperationsTool as FileOperationsTool, index$7_FunctionTool as FunctionTool, index$7_GetUserChoiceTool as GetUserChoiceTool, index$7_GoogleSearch as GoogleSearch, index$7_HttpRequestTool as HttpRequestTool, index$7_LoadArtifactsTool as LoadArtifactsTool, index$7_LoadMemoryTool as LoadMemoryTool, index$7_McpAbi as McpAbi, index$7_McpAtp as McpAtp, index$7_McpBamm as McpBamm, index$7_McpCoinGecko as McpCoinGecko, type index$7_McpConfig as McpConfig, index$7_McpDiscord as McpDiscord, index$7_McpError as McpError, index$7_McpErrorType as McpErrorType, index$7_McpFilesystem as McpFilesystem, index$7_McpFraxlend as McpFraxlend, index$7_McpGeneric as McpGeneric, index$7_McpIqWiki as McpIqWiki, index$7_McpMemory as McpMemory, index$7_McpNearAgent as McpNearAgent, index$7_McpNearIntents as McpNearIntents, index$7_McpOdos as McpOdos, index$7_McpSamplingHandler as McpSamplingHandler, type index$7_McpSamplingRequest as McpSamplingRequest, type index$7_McpSamplingResponse as McpSamplingResponse, type index$7_McpServerConfig as McpServerConfig, index$7_McpTelegram as McpTelegram, index$7_McpToolset as McpToolset, type index$7_McpTransportType as McpTransportType, index$7_McpUpbit as McpUpbit, type index$7_SamplingHandler as SamplingHandler, type index$7_ToolConfig as ToolConfig, index$7_ToolContext as ToolContext, index$7_TransferToAgentTool as TransferToAgentTool, index$7_UserInteractionTool as UserInteractionTool, index$7_adkToMcpToolType as adkToMcpToolType, index$7_buildFunctionDeclaration as buildFunctionDeclaration, index$7_convertMcpToolToBaseTool as convertMcpToolToBaseTool, index$7_createFunctionTool as createFunctionTool, index$7_createSamplingHandler as createSamplingHandler, index$7_createTool as createTool, index$7_getMcpTools as getMcpTools, index$7_jsonSchemaToDeclaration as jsonSchemaToDeclaration, index$7_mcpSchemaToParameters as mcpSchemaToParameters, index$7_normalizeJsonSchema as normalizeJsonSchema };
|
|
2612
|
+
export { index$7_AgentTool as AgentTool, type index$7_AgentToolConfig as AgentToolConfig, type index$7_BaseAgentType as BaseAgentType, index$7_BaseTool as BaseTool, type index$7_BuildFunctionDeclarationOptions as BuildFunctionDeclarationOptions, type index$7_CreateToolConfig as CreateToolConfig, type index$7_CreateToolConfigWithSchema as CreateToolConfigWithSchema, type index$7_CreateToolConfigWithoutSchema as CreateToolConfigWithoutSchema, index$7_ExitLoopTool as ExitLoopTool, index$7_FileOperationsTool as FileOperationsTool, index$7_FunctionTool as FunctionTool, index$7_GetUserChoiceTool as GetUserChoiceTool, index$7_GoogleSearch as GoogleSearch, index$7_HttpRequestTool as HttpRequestTool, index$7_LoadArtifactsTool as LoadArtifactsTool, index$7_LoadMemoryTool as LoadMemoryTool, index$7_McpAbi as McpAbi, index$7_McpAtp as McpAtp, index$7_McpBamm as McpBamm, index$7_McpCoinGecko as McpCoinGecko, index$7_McpCoinGeckoPro as McpCoinGeckoPro, type index$7_McpConfig as McpConfig, index$7_McpDiscord as McpDiscord, index$7_McpError as McpError, index$7_McpErrorType as McpErrorType, index$7_McpFilesystem as McpFilesystem, index$7_McpFraxlend as McpFraxlend, index$7_McpGeneric as McpGeneric, index$7_McpIqWiki as McpIqWiki, index$7_McpMemory as McpMemory, index$7_McpNearAgent as McpNearAgent, index$7_McpNearIntents as McpNearIntents, index$7_McpOdos as McpOdos, index$7_McpSamplingHandler as McpSamplingHandler, type index$7_McpSamplingRequest as McpSamplingRequest, type index$7_McpSamplingResponse as McpSamplingResponse, type index$7_McpServerConfig as McpServerConfig, index$7_McpTelegram as McpTelegram, index$7_McpToolset as McpToolset, type index$7_McpTransportType as McpTransportType, index$7_McpUpbit as McpUpbit, type index$7_SamplingHandler as SamplingHandler, type index$7_ToolConfig as ToolConfig, index$7_ToolContext as ToolContext, index$7_TransferToAgentTool as TransferToAgentTool, index$7_UserInteractionTool as UserInteractionTool, index$7_adkToMcpToolType as adkToMcpToolType, index$7_buildFunctionDeclaration as buildFunctionDeclaration, index$7_convertMcpToolToBaseTool as convertMcpToolToBaseTool, index$7_createFunctionTool as createFunctionTool, index$7_createSamplingHandler as createSamplingHandler, index$7_createTool as createTool, index$7_getMcpTools as getMcpTools, index$7_jsonSchemaToDeclaration as jsonSchemaToDeclaration, index$7_mcpSchemaToParameters as mcpSchemaToParameters, index$7_normalizeJsonSchema as normalizeJsonSchema };
|
|
2575
2613
|
}
|
|
2576
2614
|
|
|
2577
2615
|
/**
|
|
@@ -3997,6 +4035,10 @@ interface AgentBuilderConfig {
|
|
|
3997
4035
|
subAgents?: BaseAgent[];
|
|
3998
4036
|
beforeAgentCallback?: BeforeAgentCallback;
|
|
3999
4037
|
afterAgentCallback?: AfterAgentCallback;
|
|
4038
|
+
beforeModelCallback?: BeforeModelCallback;
|
|
4039
|
+
afterModelCallback?: AfterModelCallback;
|
|
4040
|
+
beforeToolCallback?: BeforeToolCallback;
|
|
4041
|
+
afterToolCallback?: AfterToolCallback;
|
|
4000
4042
|
maxIterations?: number;
|
|
4001
4043
|
nodes?: LangGraphNode[];
|
|
4002
4044
|
rootNode?: string;
|
|
@@ -4207,6 +4249,30 @@ declare class AgentBuilder<TOut = string, TMulti extends boolean = false> {
|
|
|
4207
4249
|
* @returns This builder instance for chaining
|
|
4208
4250
|
*/
|
|
4209
4251
|
withAfterAgentCallback(callback: AfterAgentCallback): this;
|
|
4252
|
+
/**
|
|
4253
|
+
* Set the before model callback for LLM interaction
|
|
4254
|
+
* @param callback Callback to invoke before calling the LLM
|
|
4255
|
+
* @returns This builder instance for chaining
|
|
4256
|
+
*/
|
|
4257
|
+
withBeforeModelCallback(callback: BeforeModelCallback): this;
|
|
4258
|
+
/**
|
|
4259
|
+
* Set the after model callback for LLM interaction
|
|
4260
|
+
* @param callback Callback to invoke after receiving LLM response
|
|
4261
|
+
* @returns This builder instance for chaining
|
|
4262
|
+
*/
|
|
4263
|
+
withAfterModelCallback(callback: AfterModelCallback): this;
|
|
4264
|
+
/**
|
|
4265
|
+
* Set the before tool callback for tool execution
|
|
4266
|
+
* @param callback Callback to invoke before running a tool
|
|
4267
|
+
* @returns This builder instance for chaining
|
|
4268
|
+
*/
|
|
4269
|
+
withBeforeToolCallback(callback: BeforeToolCallback): this;
|
|
4270
|
+
/**
|
|
4271
|
+
* Set the after tool callback for tool execution
|
|
4272
|
+
* @param callback Callback to invoke after running a tool
|
|
4273
|
+
* @returns This builder instance for chaining
|
|
4274
|
+
*/
|
|
4275
|
+
withAfterToolCallback(callback: AfterToolCallback): this;
|
|
4210
4276
|
/**
|
|
4211
4277
|
* Provide an already constructed agent instance. Further definition-mutating calls
|
|
4212
4278
|
* (model/tools/instruction/etc.) will be ignored with a dev warning.
|
|
@@ -5607,4 +5673,4 @@ declare const traceLlmCall: (invocationContext: InvocationContext, eventId: stri
|
|
|
5607
5673
|
|
|
5608
5674
|
declare const VERSION = "0.1.0";
|
|
5609
5675
|
|
|
5610
|
-
export { AF_FUNCTION_CALL_ID_PREFIX, type AfterAgentCallback, type AfterModelCallback, type AfterToolCallback, LlmAgent as Agent, AgentBuilder, type AgentBuilderConfig, type AgentBuilderWithSchema, AgentEvaluator, AgentTool, type AgentToolConfig, type AgentType, index$5 as Agents, AiSdkLlm, AnthropicLlm, ApiKeyCredential, ApiKeyScheme, AuthConfig, AuthCredential, AuthCredentialType, AuthHandler, AuthScheme, AuthSchemeType, AuthTool, type AuthToolArguments, AutoFlow, BaseAgent, type BaseAgentType, BaseCodeExecutor, type BaseCodeExecutorConfig, BaseLLMConnection, BaseLlm, BaseLlmFlow, BaseLlmRequestProcessor, BaseLlmResponseProcessor, type BaseMemoryService, BasePlanner, BaseSessionService, BaseTool, BasicAuthCredential, BearerTokenCredential, type BeforeAgentCallback, type BeforeModelCallback, type BeforeToolCallback, type BuildFunctionDeclarationOptions, type BuiltAgent, BuiltInCodeExecutor, BuiltInPlanner, CallbackContext, type CodeExecutionInput, type CodeExecutionResult, CodeExecutionUtils, CodeExecutorContext, type CreateToolConfig, type CreateToolConfigWithSchema, type CreateToolConfigWithoutSchema, DatabaseSessionService, EnhancedAuthConfig, type EnhancedRunner, type EvalCase, type EvalCaseResult, type EvalMetric, type EvalMetricResult, type EvalMetricResultPerInvocation, EvalResult, type EvalSet, type EvalSetResult, EvalStatus, type EvaluateConfig, index as Evaluation, type EvaluationResult, Evaluator, Event, EventActions, index$2 as Events, ExitLoopTool, type File, FileOperationsTool, FinalResponseMatchV2Evaluator, index$1 as Flows, type FullMessage, FunctionTool, GcsArtifactService, type GetSessionConfig, GetUserChoiceTool, GoogleLlm, GoogleSearch, HttpRequestTool, HttpScheme, InMemoryArtifactService, InMemoryMemoryService, InMemoryRunner, InMemorySessionService, type InstructionProvider, type IntermediateData, type Interval, type Invocation, InvocationContext, type JudgeModelOptions, LLMRegistry, LangGraphAgent, type LangGraphAgentConfig, type LangGraphNode, type ListSessionsResponse, LlmAgent, type LlmAgentConfig, LlmCallsLimitExceededError, type LlmModel, type LlmModelConfig, LlmRequest, LlmResponse, LoadArtifactsTool, LoadMemoryTool, LocalEvalService, LoopAgent, type LoopAgentConfig, McpAbi, McpAtp, McpBamm, McpCoinGecko, type McpConfig, McpDiscord, McpError, McpErrorType, McpFilesystem, McpFraxlend, McpGeneric, McpIqWiki, McpMemory, McpNearAgent, McpNearIntents, McpOdos, McpSamplingHandler, type McpSamplingRequest, type McpSamplingResponse, type McpServerConfig, McpTelegram, McpToolset, type McpTransportType, McpUpbit, index$4 as Memory, type MessagePart, type MetricInfo, type MetricValueInfo, index$6 as Models, type MultiAgentResponse, OAuth2Credential, OAuth2Scheme, type OAuthFlow, type OAuthFlows, OpenAiLlm, OpenIdConnectScheme, ParallelAgent, type ParallelAgentConfig, type PerInvocationResult, PlanReActPlanner, PrebuiltMetrics, REQUEST_EUC_FUNCTION_CALL_NAME, ReadonlyContext, RougeEvaluator, RunConfig, Runner, type RunnerAskReturn, SafetyEvaluatorV1, type SamplingHandler, type SearchMemoryResponse, SequentialAgent, type SequentialAgentConfig, type Session, type SessionInput, type SessionOptions, index$3 as Sessions, type SingleAfterModelCallback, type SingleAfterToolCallback, type SingleAgentCallback, type SingleBeforeModelCallback, type SingleBeforeToolCallback, SingleFlow, State, StreamingMode, type TelemetryConfig, TelemetryService, type ThinkingConfig, type ToolConfig, ToolContext, type ToolUnion, index$7 as Tools, TrajectoryEvaluator, TransferToAgentTool, UserInteractionTool, VERSION, VertexAiRagMemoryService, VertexAiSessionService, _findFunctionCallEventIfLastEventIsFunctionResponse, adkToMcpToolType, requestProcessor$2 as agentTransferRequestProcessor, requestProcessor$6 as basicRequestProcessor, buildFunctionDeclaration, requestProcessor as codeExecutionRequestProcessor, responseProcessor as codeExecutionResponseProcessor, requestProcessor$3 as contentRequestProcessor, convertMcpToolToBaseTool, createAuthToolArguments, createBranchContextForSubAgent, createDatabaseSessionService, createFunctionTool, createMysqlSessionService, createPostgresSessionService, createSamplingHandler, createSqliteSessionService, createTool, generateAuthEvent, generateClientFunctionCallId, getLongRunningFunctionCalls, getMcpTools, handleFunctionCallsAsync, handleFunctionCallsLive, requestProcessor$5 as identityRequestProcessor, initializeTelemetry, injectSessionState, requestProcessor$4 as instructionsRequestProcessor, isEnhancedAuthConfig, jsonSchemaToDeclaration, mcpSchemaToParameters, mergeAgentRun, mergeParallelFunctionResponseEvents, newInvocationContextId, requestProcessor$1 as nlPlanningRequestProcessor, responseProcessor$1 as nlPlanningResponseProcessor, normalizeJsonSchema, populateClientFunctionCallId, registerProviders, removeClientFunctionCallId, requestProcessor$7 as requestProcessor, shutdownTelemetry, telemetryService, traceLlmCall, traceToolCall, tracer };
|
|
5676
|
+
export { AF_FUNCTION_CALL_ID_PREFIX, type AfterAgentCallback, type AfterModelCallback, type AfterToolCallback, LlmAgent as Agent, AgentBuilder, type AgentBuilderConfig, type AgentBuilderWithSchema, AgentEvaluator, AgentTool, type AgentToolConfig, type AgentType, index$5 as Agents, AiSdkLlm, AnthropicLlm, ApiKeyCredential, ApiKeyScheme, AuthConfig, AuthCredential, AuthCredentialType, AuthHandler, AuthScheme, AuthSchemeType, AuthTool, type AuthToolArguments, AutoFlow, BaseAgent, type BaseAgentType, BaseCodeExecutor, type BaseCodeExecutorConfig, BaseLLMConnection, BaseLlm, BaseLlmFlow, BaseLlmRequestProcessor, BaseLlmResponseProcessor, type BaseMemoryService, BasePlanner, BaseSessionService, BaseTool, BasicAuthCredential, BearerTokenCredential, type BeforeAgentCallback, type BeforeModelCallback, type BeforeToolCallback, type BuildFunctionDeclarationOptions, type BuiltAgent, BuiltInCodeExecutor, BuiltInPlanner, CallbackContext, type CodeExecutionInput, type CodeExecutionResult, CodeExecutionUtils, CodeExecutorContext, type CreateToolConfig, type CreateToolConfigWithSchema, type CreateToolConfigWithoutSchema, DatabaseSessionService, EnhancedAuthConfig, type EnhancedRunner, type EvalCase, type EvalCaseResult, type EvalMetric, type EvalMetricResult, type EvalMetricResultPerInvocation, EvalResult, type EvalSet, type EvalSetResult, EvalStatus, type EvaluateConfig, index as Evaluation, type EvaluationResult, Evaluator, Event, EventActions, index$2 as Events, ExitLoopTool, type File, FileOperationsTool, FinalResponseMatchV2Evaluator, index$1 as Flows, type FullMessage, FunctionTool, GcsArtifactService, type GetSessionConfig, GetUserChoiceTool, GoogleLlm, GoogleSearch, HttpRequestTool, HttpScheme, InMemoryArtifactService, InMemoryMemoryService, InMemoryRunner, InMemorySessionService, type InstructionProvider, type IntermediateData, type Interval, type Invocation, InvocationContext, type JudgeModelOptions, LLMRegistry, LangGraphAgent, type LangGraphAgentConfig, type LangGraphNode, type ListSessionsResponse, LlmAgent, type LlmAgentConfig, LlmCallsLimitExceededError, type LlmModel, type LlmModelConfig, LlmRequest, LlmResponse, LoadArtifactsTool, LoadMemoryTool, LocalEvalService, LoopAgent, type LoopAgentConfig, McpAbi, McpAtp, McpBamm, McpCoinGecko, McpCoinGeckoPro, type McpConfig, McpDiscord, McpError, McpErrorType, McpFilesystem, McpFraxlend, McpGeneric, McpIqWiki, McpMemory, McpNearAgent, McpNearIntents, McpOdos, McpSamplingHandler, type McpSamplingRequest, type McpSamplingResponse, type McpServerConfig, McpTelegram, McpToolset, type McpTransportType, McpUpbit, index$4 as Memory, type MessagePart, type MetricInfo, type MetricValueInfo, index$6 as Models, type MultiAgentResponse, OAuth2Credential, OAuth2Scheme, type OAuthFlow, type OAuthFlows, OpenAiLlm, OpenIdConnectScheme, ParallelAgent, type ParallelAgentConfig, type PerInvocationResult, PlanReActPlanner, PrebuiltMetrics, REQUEST_EUC_FUNCTION_CALL_NAME, ReadonlyContext, RougeEvaluator, RunConfig, Runner, type RunnerAskReturn, SafetyEvaluatorV1, type SamplingHandler, type SearchMemoryResponse, SequentialAgent, type SequentialAgentConfig, type Session, type SessionInput, type SessionOptions, index$3 as Sessions, type SingleAfterModelCallback, type SingleAfterToolCallback, type SingleAgentCallback, type SingleBeforeModelCallback, type SingleBeforeToolCallback, SingleFlow, State, StreamingMode, type TelemetryConfig, TelemetryService, type ThinkingConfig, type ToolConfig, ToolContext, type ToolUnion, index$7 as Tools, TrajectoryEvaluator, TransferToAgentTool, UserInteractionTool, VERSION, VertexAiRagMemoryService, VertexAiSessionService, _findFunctionCallEventIfLastEventIsFunctionResponse, adkToMcpToolType, requestProcessor$2 as agentTransferRequestProcessor, requestProcessor$6 as basicRequestProcessor, buildFunctionDeclaration, requestProcessor as codeExecutionRequestProcessor, responseProcessor as codeExecutionResponseProcessor, requestProcessor$3 as contentRequestProcessor, convertMcpToolToBaseTool, createAuthToolArguments, createBranchContextForSubAgent, createDatabaseSessionService, createFunctionTool, createMysqlSessionService, createPostgresSessionService, createSamplingHandler, createSqliteSessionService, createTool, generateAuthEvent, generateClientFunctionCallId, getLongRunningFunctionCalls, getMcpTools, handleFunctionCallsAsync, handleFunctionCallsLive, requestProcessor$5 as identityRequestProcessor, initializeTelemetry, injectSessionState, requestProcessor$4 as instructionsRequestProcessor, isEnhancedAuthConfig, jsonSchemaToDeclaration, mcpSchemaToParameters, mergeAgentRun, mergeParallelFunctionResponseEvents, newInvocationContextId, requestProcessor$1 as nlPlanningRequestProcessor, responseProcessor$1 as nlPlanningResponseProcessor, normalizeJsonSchema, populateClientFunctionCallId, registerProviders, removeClientFunctionCallId, requestProcessor$7 as requestProcessor, shutdownTelemetry, telemetryService, traceLlmCall, traceToolCall, tracer };
|
package/dist/index.d.ts
CHANGED
|
@@ -674,6 +674,18 @@ declare class ReadonlyContext {
|
|
|
674
674
|
* The name of the agent that is currently running.
|
|
675
675
|
*/
|
|
676
676
|
get agentName(): string;
|
|
677
|
+
/**
|
|
678
|
+
* The application name for this invocation. READONLY field.
|
|
679
|
+
*/
|
|
680
|
+
get appName(): string;
|
|
681
|
+
/**
|
|
682
|
+
* The user ID for this invocation. READONLY field.
|
|
683
|
+
*/
|
|
684
|
+
get userId(): string;
|
|
685
|
+
/**
|
|
686
|
+
* The session ID for this invocation. READONLY field.
|
|
687
|
+
*/
|
|
688
|
+
get sessionId(): string;
|
|
677
689
|
/**
|
|
678
690
|
* The state of the current session. READONLY field.
|
|
679
691
|
*/
|
|
@@ -1255,7 +1267,7 @@ type ToolUnion = BaseTool | ((...args: any[]) => any);
|
|
|
1255
1267
|
type SingleBeforeModelCallback = (args: {
|
|
1256
1268
|
callbackContext: CallbackContext;
|
|
1257
1269
|
llmRequest: LlmRequest;
|
|
1258
|
-
}) => LlmResponse | null | Promise<LlmResponse | null>;
|
|
1270
|
+
}) => LlmResponse | null | undefined | Promise<LlmResponse | null | undefined>;
|
|
1259
1271
|
/**
|
|
1260
1272
|
* Before model callback type (single or array)
|
|
1261
1273
|
*/
|
|
@@ -1266,7 +1278,7 @@ type BeforeModelCallback = SingleBeforeModelCallback | SingleBeforeModelCallback
|
|
|
1266
1278
|
type SingleAfterModelCallback = (args: {
|
|
1267
1279
|
callbackContext: CallbackContext;
|
|
1268
1280
|
llmResponse: LlmResponse;
|
|
1269
|
-
}) => LlmResponse | null | Promise<LlmResponse | null>;
|
|
1281
|
+
}) => LlmResponse | null | undefined | Promise<LlmResponse | null | undefined>;
|
|
1270
1282
|
/**
|
|
1271
1283
|
* After model callback type (single or array)
|
|
1272
1284
|
*/
|
|
@@ -1274,7 +1286,7 @@ type AfterModelCallback = SingleAfterModelCallback | SingleAfterModelCallback[];
|
|
|
1274
1286
|
/**
|
|
1275
1287
|
* Single before tool callback type
|
|
1276
1288
|
*/
|
|
1277
|
-
type SingleBeforeToolCallback = (tool: BaseTool, args: Record<string, any>, toolContext: ToolContext) => Record<string, any> | null | Promise<Record<string, any> | null>;
|
|
1289
|
+
type SingleBeforeToolCallback = (tool: BaseTool, args: Record<string, any>, toolContext: ToolContext) => Record<string, any> | null | undefined | Promise<Record<string, any> | null | undefined>;
|
|
1278
1290
|
/**
|
|
1279
1291
|
* Before tool callback type (single or array)
|
|
1280
1292
|
*/
|
|
@@ -1282,7 +1294,7 @@ type BeforeToolCallback = SingleBeforeToolCallback | SingleBeforeToolCallback[];
|
|
|
1282
1294
|
/**
|
|
1283
1295
|
* Single after tool callback type
|
|
1284
1296
|
*/
|
|
1285
|
-
type SingleAfterToolCallback = (tool: BaseTool, args: Record<string, any>, toolContext: ToolContext, toolResponse: Record<string, any>) => Record<string, any> | null | Promise<Record<string, any> | null>;
|
|
1297
|
+
type SingleAfterToolCallback = (tool: BaseTool, args: Record<string, any>, toolContext: ToolContext, toolResponse: Record<string, any>) => Record<string, any> | null | undefined | Promise<Record<string, any> | null | undefined>;
|
|
1286
1298
|
/**
|
|
1287
1299
|
* After tool callback type (single or array)
|
|
1288
1300
|
*/
|
|
@@ -2275,6 +2287,24 @@ declare function createSamplingHandler(handler: SamplingHandler): SamplingHandle
|
|
|
2275
2287
|
*
|
|
2276
2288
|
* @example
|
|
2277
2289
|
* ```typescript
|
|
2290
|
+
* // Using remote MCP endpoints (CoinGecko):
|
|
2291
|
+
* const coinGeckoTools = await McpCoinGecko().getTools();
|
|
2292
|
+
*
|
|
2293
|
+
* const coinGeckoProTools = await McpCoinGeckoPro({
|
|
2294
|
+
* env: {
|
|
2295
|
+
* COINGECKO_PRO_API_KEY: env.COINGECKO_PRO_API_KEY
|
|
2296
|
+
* }
|
|
2297
|
+
* }).getTools();
|
|
2298
|
+
*
|
|
2299
|
+
* const cryptoAgent = new LlmAgent({
|
|
2300
|
+
* name: "crypto_assistant",
|
|
2301
|
+
* model: "gemini-2.5-flash",
|
|
2302
|
+
* tools: [...coinGeckoTools, ...coinGeckoProTools],
|
|
2303
|
+
* });
|
|
2304
|
+
* ```
|
|
2305
|
+
*
|
|
2306
|
+
* @example
|
|
2307
|
+
* ```typescript
|
|
2278
2308
|
* // Using MCP servers with sampling handlers:
|
|
2279
2309
|
* import { createSamplingHandler, LlmResponse } from "@iqai/adk";
|
|
2280
2310
|
*
|
|
@@ -2388,11 +2418,18 @@ declare function McpTelegram(config?: McpServerConfig): McpToolset;
|
|
|
2388
2418
|
*/
|
|
2389
2419
|
declare function McpDiscord(config?: McpServerConfig): McpToolset;
|
|
2390
2420
|
/**
|
|
2391
|
-
* MCP CoinGecko - Access cryptocurrency market data and analytics
|
|
2421
|
+
* MCP CoinGecko - Access cryptocurrency market data and analytics via remote endpoint
|
|
2392
2422
|
*
|
|
2393
|
-
*
|
|
2423
|
+
* Uses the public CoinGecko MCP API endpoint. No API key required for basic functionality.
|
|
2394
2424
|
*/
|
|
2395
2425
|
declare function McpCoinGecko(config?: McpServerConfig): McpToolset;
|
|
2426
|
+
/**
|
|
2427
|
+
* MCP CoinGecko Pro - Access premium cryptocurrency market data and analytics via remote endpoint
|
|
2428
|
+
*
|
|
2429
|
+
* Uses the professional CoinGecko MCP API endpoint with enhanced features and higher rate limits.
|
|
2430
|
+
* Requires a CoinGecko Pro API subscription.
|
|
2431
|
+
*/
|
|
2432
|
+
declare function McpCoinGeckoPro(config?: McpServerConfig): McpToolset;
|
|
2396
2433
|
/**
|
|
2397
2434
|
* MCP Upbit - Interact with the Upbit cryptocurrency exchange
|
|
2398
2435
|
*
|
|
@@ -2528,6 +2565,7 @@ declare const index$7_McpAbi: typeof McpAbi;
|
|
|
2528
2565
|
declare const index$7_McpAtp: typeof McpAtp;
|
|
2529
2566
|
declare const index$7_McpBamm: typeof McpBamm;
|
|
2530
2567
|
declare const index$7_McpCoinGecko: typeof McpCoinGecko;
|
|
2568
|
+
declare const index$7_McpCoinGeckoPro: typeof McpCoinGeckoPro;
|
|
2531
2569
|
type index$7_McpConfig = McpConfig;
|
|
2532
2570
|
declare const index$7_McpDiscord: typeof McpDiscord;
|
|
2533
2571
|
type index$7_McpError = McpError;
|
|
@@ -2571,7 +2609,7 @@ declare const index$7_jsonSchemaToDeclaration: typeof jsonSchemaToDeclaration;
|
|
|
2571
2609
|
declare const index$7_mcpSchemaToParameters: typeof mcpSchemaToParameters;
|
|
2572
2610
|
declare const index$7_normalizeJsonSchema: typeof normalizeJsonSchema;
|
|
2573
2611
|
declare namespace index$7 {
|
|
2574
|
-
export { index$7_AgentTool as AgentTool, type index$7_AgentToolConfig as AgentToolConfig, type index$7_BaseAgentType as BaseAgentType, index$7_BaseTool as BaseTool, type index$7_BuildFunctionDeclarationOptions as BuildFunctionDeclarationOptions, type index$7_CreateToolConfig as CreateToolConfig, type index$7_CreateToolConfigWithSchema as CreateToolConfigWithSchema, type index$7_CreateToolConfigWithoutSchema as CreateToolConfigWithoutSchema, index$7_ExitLoopTool as ExitLoopTool, index$7_FileOperationsTool as FileOperationsTool, index$7_FunctionTool as FunctionTool, index$7_GetUserChoiceTool as GetUserChoiceTool, index$7_GoogleSearch as GoogleSearch, index$7_HttpRequestTool as HttpRequestTool, index$7_LoadArtifactsTool as LoadArtifactsTool, index$7_LoadMemoryTool as LoadMemoryTool, index$7_McpAbi as McpAbi, index$7_McpAtp as McpAtp, index$7_McpBamm as McpBamm, index$7_McpCoinGecko as McpCoinGecko, type index$7_McpConfig as McpConfig, index$7_McpDiscord as McpDiscord, index$7_McpError as McpError, index$7_McpErrorType as McpErrorType, index$7_McpFilesystem as McpFilesystem, index$7_McpFraxlend as McpFraxlend, index$7_McpGeneric as McpGeneric, index$7_McpIqWiki as McpIqWiki, index$7_McpMemory as McpMemory, index$7_McpNearAgent as McpNearAgent, index$7_McpNearIntents as McpNearIntents, index$7_McpOdos as McpOdos, index$7_McpSamplingHandler as McpSamplingHandler, type index$7_McpSamplingRequest as McpSamplingRequest, type index$7_McpSamplingResponse as McpSamplingResponse, type index$7_McpServerConfig as McpServerConfig, index$7_McpTelegram as McpTelegram, index$7_McpToolset as McpToolset, type index$7_McpTransportType as McpTransportType, index$7_McpUpbit as McpUpbit, type index$7_SamplingHandler as SamplingHandler, type index$7_ToolConfig as ToolConfig, index$7_ToolContext as ToolContext, index$7_TransferToAgentTool as TransferToAgentTool, index$7_UserInteractionTool as UserInteractionTool, index$7_adkToMcpToolType as adkToMcpToolType, index$7_buildFunctionDeclaration as buildFunctionDeclaration, index$7_convertMcpToolToBaseTool as convertMcpToolToBaseTool, index$7_createFunctionTool as createFunctionTool, index$7_createSamplingHandler as createSamplingHandler, index$7_createTool as createTool, index$7_getMcpTools as getMcpTools, index$7_jsonSchemaToDeclaration as jsonSchemaToDeclaration, index$7_mcpSchemaToParameters as mcpSchemaToParameters, index$7_normalizeJsonSchema as normalizeJsonSchema };
|
|
2612
|
+
export { index$7_AgentTool as AgentTool, type index$7_AgentToolConfig as AgentToolConfig, type index$7_BaseAgentType as BaseAgentType, index$7_BaseTool as BaseTool, type index$7_BuildFunctionDeclarationOptions as BuildFunctionDeclarationOptions, type index$7_CreateToolConfig as CreateToolConfig, type index$7_CreateToolConfigWithSchema as CreateToolConfigWithSchema, type index$7_CreateToolConfigWithoutSchema as CreateToolConfigWithoutSchema, index$7_ExitLoopTool as ExitLoopTool, index$7_FileOperationsTool as FileOperationsTool, index$7_FunctionTool as FunctionTool, index$7_GetUserChoiceTool as GetUserChoiceTool, index$7_GoogleSearch as GoogleSearch, index$7_HttpRequestTool as HttpRequestTool, index$7_LoadArtifactsTool as LoadArtifactsTool, index$7_LoadMemoryTool as LoadMemoryTool, index$7_McpAbi as McpAbi, index$7_McpAtp as McpAtp, index$7_McpBamm as McpBamm, index$7_McpCoinGecko as McpCoinGecko, index$7_McpCoinGeckoPro as McpCoinGeckoPro, type index$7_McpConfig as McpConfig, index$7_McpDiscord as McpDiscord, index$7_McpError as McpError, index$7_McpErrorType as McpErrorType, index$7_McpFilesystem as McpFilesystem, index$7_McpFraxlend as McpFraxlend, index$7_McpGeneric as McpGeneric, index$7_McpIqWiki as McpIqWiki, index$7_McpMemory as McpMemory, index$7_McpNearAgent as McpNearAgent, index$7_McpNearIntents as McpNearIntents, index$7_McpOdos as McpOdos, index$7_McpSamplingHandler as McpSamplingHandler, type index$7_McpSamplingRequest as McpSamplingRequest, type index$7_McpSamplingResponse as McpSamplingResponse, type index$7_McpServerConfig as McpServerConfig, index$7_McpTelegram as McpTelegram, index$7_McpToolset as McpToolset, type index$7_McpTransportType as McpTransportType, index$7_McpUpbit as McpUpbit, type index$7_SamplingHandler as SamplingHandler, type index$7_ToolConfig as ToolConfig, index$7_ToolContext as ToolContext, index$7_TransferToAgentTool as TransferToAgentTool, index$7_UserInteractionTool as UserInteractionTool, index$7_adkToMcpToolType as adkToMcpToolType, index$7_buildFunctionDeclaration as buildFunctionDeclaration, index$7_convertMcpToolToBaseTool as convertMcpToolToBaseTool, index$7_createFunctionTool as createFunctionTool, index$7_createSamplingHandler as createSamplingHandler, index$7_createTool as createTool, index$7_getMcpTools as getMcpTools, index$7_jsonSchemaToDeclaration as jsonSchemaToDeclaration, index$7_mcpSchemaToParameters as mcpSchemaToParameters, index$7_normalizeJsonSchema as normalizeJsonSchema };
|
|
2575
2613
|
}
|
|
2576
2614
|
|
|
2577
2615
|
/**
|
|
@@ -3997,6 +4035,10 @@ interface AgentBuilderConfig {
|
|
|
3997
4035
|
subAgents?: BaseAgent[];
|
|
3998
4036
|
beforeAgentCallback?: BeforeAgentCallback;
|
|
3999
4037
|
afterAgentCallback?: AfterAgentCallback;
|
|
4038
|
+
beforeModelCallback?: BeforeModelCallback;
|
|
4039
|
+
afterModelCallback?: AfterModelCallback;
|
|
4040
|
+
beforeToolCallback?: BeforeToolCallback;
|
|
4041
|
+
afterToolCallback?: AfterToolCallback;
|
|
4000
4042
|
maxIterations?: number;
|
|
4001
4043
|
nodes?: LangGraphNode[];
|
|
4002
4044
|
rootNode?: string;
|
|
@@ -4207,6 +4249,30 @@ declare class AgentBuilder<TOut = string, TMulti extends boolean = false> {
|
|
|
4207
4249
|
* @returns This builder instance for chaining
|
|
4208
4250
|
*/
|
|
4209
4251
|
withAfterAgentCallback(callback: AfterAgentCallback): this;
|
|
4252
|
+
/**
|
|
4253
|
+
* Set the before model callback for LLM interaction
|
|
4254
|
+
* @param callback Callback to invoke before calling the LLM
|
|
4255
|
+
* @returns This builder instance for chaining
|
|
4256
|
+
*/
|
|
4257
|
+
withBeforeModelCallback(callback: BeforeModelCallback): this;
|
|
4258
|
+
/**
|
|
4259
|
+
* Set the after model callback for LLM interaction
|
|
4260
|
+
* @param callback Callback to invoke after receiving LLM response
|
|
4261
|
+
* @returns This builder instance for chaining
|
|
4262
|
+
*/
|
|
4263
|
+
withAfterModelCallback(callback: AfterModelCallback): this;
|
|
4264
|
+
/**
|
|
4265
|
+
* Set the before tool callback for tool execution
|
|
4266
|
+
* @param callback Callback to invoke before running a tool
|
|
4267
|
+
* @returns This builder instance for chaining
|
|
4268
|
+
*/
|
|
4269
|
+
withBeforeToolCallback(callback: BeforeToolCallback): this;
|
|
4270
|
+
/**
|
|
4271
|
+
* Set the after tool callback for tool execution
|
|
4272
|
+
* @param callback Callback to invoke after running a tool
|
|
4273
|
+
* @returns This builder instance for chaining
|
|
4274
|
+
*/
|
|
4275
|
+
withAfterToolCallback(callback: AfterToolCallback): this;
|
|
4210
4276
|
/**
|
|
4211
4277
|
* Provide an already constructed agent instance. Further definition-mutating calls
|
|
4212
4278
|
* (model/tools/instruction/etc.) will be ignored with a dev warning.
|
|
@@ -5607,4 +5673,4 @@ declare const traceLlmCall: (invocationContext: InvocationContext, eventId: stri
|
|
|
5607
5673
|
|
|
5608
5674
|
declare const VERSION = "0.1.0";
|
|
5609
5675
|
|
|
5610
|
-
export { AF_FUNCTION_CALL_ID_PREFIX, type AfterAgentCallback, type AfterModelCallback, type AfterToolCallback, LlmAgent as Agent, AgentBuilder, type AgentBuilderConfig, type AgentBuilderWithSchema, AgentEvaluator, AgentTool, type AgentToolConfig, type AgentType, index$5 as Agents, AiSdkLlm, AnthropicLlm, ApiKeyCredential, ApiKeyScheme, AuthConfig, AuthCredential, AuthCredentialType, AuthHandler, AuthScheme, AuthSchemeType, AuthTool, type AuthToolArguments, AutoFlow, BaseAgent, type BaseAgentType, BaseCodeExecutor, type BaseCodeExecutorConfig, BaseLLMConnection, BaseLlm, BaseLlmFlow, BaseLlmRequestProcessor, BaseLlmResponseProcessor, type BaseMemoryService, BasePlanner, BaseSessionService, BaseTool, BasicAuthCredential, BearerTokenCredential, type BeforeAgentCallback, type BeforeModelCallback, type BeforeToolCallback, type BuildFunctionDeclarationOptions, type BuiltAgent, BuiltInCodeExecutor, BuiltInPlanner, CallbackContext, type CodeExecutionInput, type CodeExecutionResult, CodeExecutionUtils, CodeExecutorContext, type CreateToolConfig, type CreateToolConfigWithSchema, type CreateToolConfigWithoutSchema, DatabaseSessionService, EnhancedAuthConfig, type EnhancedRunner, type EvalCase, type EvalCaseResult, type EvalMetric, type EvalMetricResult, type EvalMetricResultPerInvocation, EvalResult, type EvalSet, type EvalSetResult, EvalStatus, type EvaluateConfig, index as Evaluation, type EvaluationResult, Evaluator, Event, EventActions, index$2 as Events, ExitLoopTool, type File, FileOperationsTool, FinalResponseMatchV2Evaluator, index$1 as Flows, type FullMessage, FunctionTool, GcsArtifactService, type GetSessionConfig, GetUserChoiceTool, GoogleLlm, GoogleSearch, HttpRequestTool, HttpScheme, InMemoryArtifactService, InMemoryMemoryService, InMemoryRunner, InMemorySessionService, type InstructionProvider, type IntermediateData, type Interval, type Invocation, InvocationContext, type JudgeModelOptions, LLMRegistry, LangGraphAgent, type LangGraphAgentConfig, type LangGraphNode, type ListSessionsResponse, LlmAgent, type LlmAgentConfig, LlmCallsLimitExceededError, type LlmModel, type LlmModelConfig, LlmRequest, LlmResponse, LoadArtifactsTool, LoadMemoryTool, LocalEvalService, LoopAgent, type LoopAgentConfig, McpAbi, McpAtp, McpBamm, McpCoinGecko, type McpConfig, McpDiscord, McpError, McpErrorType, McpFilesystem, McpFraxlend, McpGeneric, McpIqWiki, McpMemory, McpNearAgent, McpNearIntents, McpOdos, McpSamplingHandler, type McpSamplingRequest, type McpSamplingResponse, type McpServerConfig, McpTelegram, McpToolset, type McpTransportType, McpUpbit, index$4 as Memory, type MessagePart, type MetricInfo, type MetricValueInfo, index$6 as Models, type MultiAgentResponse, OAuth2Credential, OAuth2Scheme, type OAuthFlow, type OAuthFlows, OpenAiLlm, OpenIdConnectScheme, ParallelAgent, type ParallelAgentConfig, type PerInvocationResult, PlanReActPlanner, PrebuiltMetrics, REQUEST_EUC_FUNCTION_CALL_NAME, ReadonlyContext, RougeEvaluator, RunConfig, Runner, type RunnerAskReturn, SafetyEvaluatorV1, type SamplingHandler, type SearchMemoryResponse, SequentialAgent, type SequentialAgentConfig, type Session, type SessionInput, type SessionOptions, index$3 as Sessions, type SingleAfterModelCallback, type SingleAfterToolCallback, type SingleAgentCallback, type SingleBeforeModelCallback, type SingleBeforeToolCallback, SingleFlow, State, StreamingMode, type TelemetryConfig, TelemetryService, type ThinkingConfig, type ToolConfig, ToolContext, type ToolUnion, index$7 as Tools, TrajectoryEvaluator, TransferToAgentTool, UserInteractionTool, VERSION, VertexAiRagMemoryService, VertexAiSessionService, _findFunctionCallEventIfLastEventIsFunctionResponse, adkToMcpToolType, requestProcessor$2 as agentTransferRequestProcessor, requestProcessor$6 as basicRequestProcessor, buildFunctionDeclaration, requestProcessor as codeExecutionRequestProcessor, responseProcessor as codeExecutionResponseProcessor, requestProcessor$3 as contentRequestProcessor, convertMcpToolToBaseTool, createAuthToolArguments, createBranchContextForSubAgent, createDatabaseSessionService, createFunctionTool, createMysqlSessionService, createPostgresSessionService, createSamplingHandler, createSqliteSessionService, createTool, generateAuthEvent, generateClientFunctionCallId, getLongRunningFunctionCalls, getMcpTools, handleFunctionCallsAsync, handleFunctionCallsLive, requestProcessor$5 as identityRequestProcessor, initializeTelemetry, injectSessionState, requestProcessor$4 as instructionsRequestProcessor, isEnhancedAuthConfig, jsonSchemaToDeclaration, mcpSchemaToParameters, mergeAgentRun, mergeParallelFunctionResponseEvents, newInvocationContextId, requestProcessor$1 as nlPlanningRequestProcessor, responseProcessor$1 as nlPlanningResponseProcessor, normalizeJsonSchema, populateClientFunctionCallId, registerProviders, removeClientFunctionCallId, requestProcessor$7 as requestProcessor, shutdownTelemetry, telemetryService, traceLlmCall, traceToolCall, tracer };
|
|
5676
|
+
export { AF_FUNCTION_CALL_ID_PREFIX, type AfterAgentCallback, type AfterModelCallback, type AfterToolCallback, LlmAgent as Agent, AgentBuilder, type AgentBuilderConfig, type AgentBuilderWithSchema, AgentEvaluator, AgentTool, type AgentToolConfig, type AgentType, index$5 as Agents, AiSdkLlm, AnthropicLlm, ApiKeyCredential, ApiKeyScheme, AuthConfig, AuthCredential, AuthCredentialType, AuthHandler, AuthScheme, AuthSchemeType, AuthTool, type AuthToolArguments, AutoFlow, BaseAgent, type BaseAgentType, BaseCodeExecutor, type BaseCodeExecutorConfig, BaseLLMConnection, BaseLlm, BaseLlmFlow, BaseLlmRequestProcessor, BaseLlmResponseProcessor, type BaseMemoryService, BasePlanner, BaseSessionService, BaseTool, BasicAuthCredential, BearerTokenCredential, type BeforeAgentCallback, type BeforeModelCallback, type BeforeToolCallback, type BuildFunctionDeclarationOptions, type BuiltAgent, BuiltInCodeExecutor, BuiltInPlanner, CallbackContext, type CodeExecutionInput, type CodeExecutionResult, CodeExecutionUtils, CodeExecutorContext, type CreateToolConfig, type CreateToolConfigWithSchema, type CreateToolConfigWithoutSchema, DatabaseSessionService, EnhancedAuthConfig, type EnhancedRunner, type EvalCase, type EvalCaseResult, type EvalMetric, type EvalMetricResult, type EvalMetricResultPerInvocation, EvalResult, type EvalSet, type EvalSetResult, EvalStatus, type EvaluateConfig, index as Evaluation, type EvaluationResult, Evaluator, Event, EventActions, index$2 as Events, ExitLoopTool, type File, FileOperationsTool, FinalResponseMatchV2Evaluator, index$1 as Flows, type FullMessage, FunctionTool, GcsArtifactService, type GetSessionConfig, GetUserChoiceTool, GoogleLlm, GoogleSearch, HttpRequestTool, HttpScheme, InMemoryArtifactService, InMemoryMemoryService, InMemoryRunner, InMemorySessionService, type InstructionProvider, type IntermediateData, type Interval, type Invocation, InvocationContext, type JudgeModelOptions, LLMRegistry, LangGraphAgent, type LangGraphAgentConfig, type LangGraphNode, type ListSessionsResponse, LlmAgent, type LlmAgentConfig, LlmCallsLimitExceededError, type LlmModel, type LlmModelConfig, LlmRequest, LlmResponse, LoadArtifactsTool, LoadMemoryTool, LocalEvalService, LoopAgent, type LoopAgentConfig, McpAbi, McpAtp, McpBamm, McpCoinGecko, McpCoinGeckoPro, type McpConfig, McpDiscord, McpError, McpErrorType, McpFilesystem, McpFraxlend, McpGeneric, McpIqWiki, McpMemory, McpNearAgent, McpNearIntents, McpOdos, McpSamplingHandler, type McpSamplingRequest, type McpSamplingResponse, type McpServerConfig, McpTelegram, McpToolset, type McpTransportType, McpUpbit, index$4 as Memory, type MessagePart, type MetricInfo, type MetricValueInfo, index$6 as Models, type MultiAgentResponse, OAuth2Credential, OAuth2Scheme, type OAuthFlow, type OAuthFlows, OpenAiLlm, OpenIdConnectScheme, ParallelAgent, type ParallelAgentConfig, type PerInvocationResult, PlanReActPlanner, PrebuiltMetrics, REQUEST_EUC_FUNCTION_CALL_NAME, ReadonlyContext, RougeEvaluator, RunConfig, Runner, type RunnerAskReturn, SafetyEvaluatorV1, type SamplingHandler, type SearchMemoryResponse, SequentialAgent, type SequentialAgentConfig, type Session, type SessionInput, type SessionOptions, index$3 as Sessions, type SingleAfterModelCallback, type SingleAfterToolCallback, type SingleAgentCallback, type SingleBeforeModelCallback, type SingleBeforeToolCallback, SingleFlow, State, StreamingMode, type TelemetryConfig, TelemetryService, type ThinkingConfig, type ToolConfig, ToolContext, type ToolUnion, index$7 as Tools, TrajectoryEvaluator, TransferToAgentTool, UserInteractionTool, VERSION, VertexAiRagMemoryService, VertexAiSessionService, _findFunctionCallEventIfLastEventIsFunctionResponse, adkToMcpToolType, requestProcessor$2 as agentTransferRequestProcessor, requestProcessor$6 as basicRequestProcessor, buildFunctionDeclaration, requestProcessor as codeExecutionRequestProcessor, responseProcessor as codeExecutionResponseProcessor, requestProcessor$3 as contentRequestProcessor, convertMcpToolToBaseTool, createAuthToolArguments, createBranchContextForSubAgent, createDatabaseSessionService, createFunctionTool, createMysqlSessionService, createPostgresSessionService, createSamplingHandler, createSqliteSessionService, createTool, generateAuthEvent, generateClientFunctionCallId, getLongRunningFunctionCalls, getMcpTools, handleFunctionCallsAsync, handleFunctionCallsLive, requestProcessor$5 as identityRequestProcessor, initializeTelemetry, injectSessionState, requestProcessor$4 as instructionsRequestProcessor, isEnhancedAuthConfig, jsonSchemaToDeclaration, mcpSchemaToParameters, mergeAgentRun, mergeParallelFunctionResponseEvents, newInvocationContextId, requestProcessor$1 as nlPlanningRequestProcessor, responseProcessor$1 as nlPlanningResponseProcessor, normalizeJsonSchema, populateClientFunctionCallId, registerProviders, removeClientFunctionCallId, requestProcessor$7 as requestProcessor, shutdownTelemetry, telemetryService, traceLlmCall, traceToolCall, tracer };
|
package/dist/index.js
CHANGED
|
@@ -3521,6 +3521,24 @@ var ReadonlyContext = class {
|
|
|
3521
3521
|
get agentName() {
|
|
3522
3522
|
return this._invocationContext.agent.name;
|
|
3523
3523
|
}
|
|
3524
|
+
/**
|
|
3525
|
+
* The application name for this invocation. READONLY field.
|
|
3526
|
+
*/
|
|
3527
|
+
get appName() {
|
|
3528
|
+
return this._invocationContext.appName;
|
|
3529
|
+
}
|
|
3530
|
+
/**
|
|
3531
|
+
* The user ID for this invocation. READONLY field.
|
|
3532
|
+
*/
|
|
3533
|
+
get userId() {
|
|
3534
|
+
return this._invocationContext.userId;
|
|
3535
|
+
}
|
|
3536
|
+
/**
|
|
3537
|
+
* The session ID for this invocation. READONLY field.
|
|
3538
|
+
*/
|
|
3539
|
+
get sessionId() {
|
|
3540
|
+
return this._invocationContext.session.id;
|
|
3541
|
+
}
|
|
3524
3542
|
/**
|
|
3525
3543
|
* The state of the current session. READONLY field.
|
|
3526
3544
|
*/
|
|
@@ -4079,6 +4097,7 @@ __export(tools_exports, {
|
|
|
4079
4097
|
McpAtp: () => McpAtp,
|
|
4080
4098
|
McpBamm: () => McpBamm,
|
|
4081
4099
|
McpCoinGecko: () => McpCoinGecko,
|
|
4100
|
+
McpCoinGeckoPro: () => McpCoinGeckoPro,
|
|
4082
4101
|
McpDiscord: () => McpDiscord,
|
|
4083
4102
|
McpError: () => McpError,
|
|
4084
4103
|
McpErrorType: () => McpErrorType,
|
|
@@ -6123,7 +6142,7 @@ var McpToolAdapter = (_class23 = class extends BaseTool {
|
|
|
6123
6142
|
}, _class23);
|
|
6124
6143
|
|
|
6125
6144
|
// src/tools/mcp/servers.ts
|
|
6126
|
-
function createMcpConfig(name,
|
|
6145
|
+
function createMcpConfig(name, packageNameOrUrl, config = {}) {
|
|
6127
6146
|
const {
|
|
6128
6147
|
debug,
|
|
6129
6148
|
description,
|
|
@@ -6140,17 +6159,25 @@ function createMcpConfig(name, packageName, config = {}) {
|
|
|
6140
6159
|
if (!env.PATH) {
|
|
6141
6160
|
env.PATH = process.env.PATH || "";
|
|
6142
6161
|
}
|
|
6162
|
+
let isUrl;
|
|
6163
|
+
try {
|
|
6164
|
+
const url = new URL(packageNameOrUrl);
|
|
6165
|
+
isUrl = url.protocol === "http:" || url.protocol === "https:";
|
|
6166
|
+
} catch (e5) {
|
|
6167
|
+
isUrl = false;
|
|
6168
|
+
}
|
|
6169
|
+
const transport = {
|
|
6170
|
+
mode: "stdio",
|
|
6171
|
+
command: "npx",
|
|
6172
|
+
args: isUrl ? ["-y", "mcp-remote@latest", packageNameOrUrl] : ["-y", packageNameOrUrl],
|
|
6173
|
+
env
|
|
6174
|
+
};
|
|
6143
6175
|
return {
|
|
6144
6176
|
name,
|
|
6145
6177
|
description: description || `Client for ${name}`,
|
|
6146
6178
|
debug: debug || false,
|
|
6147
6179
|
retryOptions: retryOptions || { maxRetries: 2, initialDelay: 200 },
|
|
6148
|
-
transport
|
|
6149
|
-
mode: "stdio",
|
|
6150
|
-
command: "npx",
|
|
6151
|
-
args: ["-y", packageName],
|
|
6152
|
-
env
|
|
6153
|
-
},
|
|
6180
|
+
transport,
|
|
6154
6181
|
samplingHandler
|
|
6155
6182
|
};
|
|
6156
6183
|
}
|
|
@@ -6229,7 +6256,15 @@ function McpDiscord(config = {}) {
|
|
|
6229
6256
|
function McpCoinGecko(config = {}) {
|
|
6230
6257
|
const mcpConfig = createMcpConfig(
|
|
6231
6258
|
"CoinGecko MCP Client",
|
|
6232
|
-
"
|
|
6259
|
+
"https://mcp.api.coingecko.com/mcp",
|
|
6260
|
+
config
|
|
6261
|
+
);
|
|
6262
|
+
return new McpToolset(mcpConfig);
|
|
6263
|
+
}
|
|
6264
|
+
function McpCoinGeckoPro(config = {}) {
|
|
6265
|
+
const mcpConfig = createMcpConfig(
|
|
6266
|
+
"CoinGecko Pro MCP Client",
|
|
6267
|
+
"https://mcp.pro-api.coingecko.com/mcp",
|
|
6233
6268
|
config
|
|
6234
6269
|
);
|
|
6235
6270
|
return new McpToolset(mcpConfig);
|
|
@@ -7480,7 +7515,7 @@ var CodeExecutionUtils = class _CodeExecutionUtils {
|
|
|
7480
7515
|
static isBase64Encoded(str) {
|
|
7481
7516
|
try {
|
|
7482
7517
|
return btoa(atob(str)) === str;
|
|
7483
|
-
} catch (
|
|
7518
|
+
} catch (e6) {
|
|
7484
7519
|
return false;
|
|
7485
7520
|
}
|
|
7486
7521
|
}
|
|
@@ -8520,7 +8555,7 @@ var InstructionsLlmRequestProcessor = class extends BaseLlmRequestProcessor {
|
|
|
8520
8555
|
llmRequest.appendInstructions([
|
|
8521
8556
|
'IMPORTANT: After any tool calls, function calls, or agent transfers have completed, produce ONE final assistant message whose entire content is ONLY the JSON object that conforms to the schema provided above. Do NOT include any explanatory text, markdown, or additional messages. Do NOT wrap the JSON in code fences (for example, do NOT use ```json or ```). If you cannot produce valid JSON that matches the schema, return a JSON object with an "error" field describing the problem.'
|
|
8522
8557
|
]);
|
|
8523
|
-
} catch (
|
|
8558
|
+
} catch (e7) {
|
|
8524
8559
|
}
|
|
8525
8560
|
}
|
|
8526
8561
|
for await (const _ of []) {
|
|
@@ -10860,6 +10895,46 @@ var AgentBuilder = (_class33 = class _AgentBuilder {
|
|
|
10860
10895
|
this.config.afterAgentCallback = callback;
|
|
10861
10896
|
return this;
|
|
10862
10897
|
}
|
|
10898
|
+
/**
|
|
10899
|
+
* Set the before model callback for LLM interaction
|
|
10900
|
+
* @param callback Callback to invoke before calling the LLM
|
|
10901
|
+
* @returns This builder instance for chaining
|
|
10902
|
+
*/
|
|
10903
|
+
withBeforeModelCallback(callback) {
|
|
10904
|
+
this.warnIfLocked("withBeforeModelCallback");
|
|
10905
|
+
this.config.beforeModelCallback = callback;
|
|
10906
|
+
return this;
|
|
10907
|
+
}
|
|
10908
|
+
/**
|
|
10909
|
+
* Set the after model callback for LLM interaction
|
|
10910
|
+
* @param callback Callback to invoke after receiving LLM response
|
|
10911
|
+
* @returns This builder instance for chaining
|
|
10912
|
+
*/
|
|
10913
|
+
withAfterModelCallback(callback) {
|
|
10914
|
+
this.warnIfLocked("withAfterModelCallback");
|
|
10915
|
+
this.config.afterModelCallback = callback;
|
|
10916
|
+
return this;
|
|
10917
|
+
}
|
|
10918
|
+
/**
|
|
10919
|
+
* Set the before tool callback for tool execution
|
|
10920
|
+
* @param callback Callback to invoke before running a tool
|
|
10921
|
+
* @returns This builder instance for chaining
|
|
10922
|
+
*/
|
|
10923
|
+
withBeforeToolCallback(callback) {
|
|
10924
|
+
this.warnIfLocked("withBeforeToolCallback");
|
|
10925
|
+
this.config.beforeToolCallback = callback;
|
|
10926
|
+
return this;
|
|
10927
|
+
}
|
|
10928
|
+
/**
|
|
10929
|
+
* Set the after tool callback for tool execution
|
|
10930
|
+
* @param callback Callback to invoke after running a tool
|
|
10931
|
+
* @returns This builder instance for chaining
|
|
10932
|
+
*/
|
|
10933
|
+
withAfterToolCallback(callback) {
|
|
10934
|
+
this.warnIfLocked("withAfterToolCallback");
|
|
10935
|
+
this.config.afterToolCallback = callback;
|
|
10936
|
+
return this;
|
|
10937
|
+
}
|
|
10863
10938
|
/**
|
|
10864
10939
|
* Provide an already constructed agent instance. Further definition-mutating calls
|
|
10865
10940
|
* (model/tools/instruction/etc.) will be ignored with a dev warning.
|
|
@@ -11133,6 +11208,10 @@ var AgentBuilder = (_class33 = class _AgentBuilder {
|
|
|
11133
11208
|
subAgents: this.config.subAgents,
|
|
11134
11209
|
beforeAgentCallback: this.config.beforeAgentCallback,
|
|
11135
11210
|
afterAgentCallback: this.config.afterAgentCallback,
|
|
11211
|
+
beforeModelCallback: this.config.beforeModelCallback,
|
|
11212
|
+
afterModelCallback: this.config.afterModelCallback,
|
|
11213
|
+
beforeToolCallback: this.config.beforeToolCallback,
|
|
11214
|
+
afterToolCallback: this.config.afterToolCallback,
|
|
11136
11215
|
memoryService: this.memoryService,
|
|
11137
11216
|
artifactService: this.artifactService,
|
|
11138
11217
|
outputKey: this.config.outputKey,
|
|
@@ -11445,7 +11524,7 @@ var VertexAiRagMemoryService = class {
|
|
|
11445
11524
|
content
|
|
11446
11525
|
};
|
|
11447
11526
|
events.push(event);
|
|
11448
|
-
} catch (
|
|
11527
|
+
} catch (e8) {
|
|
11449
11528
|
}
|
|
11450
11529
|
}
|
|
11451
11530
|
}
|
|
@@ -11877,7 +11956,7 @@ var DatabaseSessionService = (_class34 = class extends BaseSessionService {
|
|
|
11877
11956
|
if (!jsonString) return defaultValue;
|
|
11878
11957
|
try {
|
|
11879
11958
|
return JSON.parse(jsonString);
|
|
11880
|
-
} catch (
|
|
11959
|
+
} catch (e9) {
|
|
11881
11960
|
return defaultValue;
|
|
11882
11961
|
}
|
|
11883
11962
|
}
|
|
@@ -13904,4 +13983,5 @@ var VERSION = "0.1.0";
|
|
|
13904
13983
|
|
|
13905
13984
|
|
|
13906
13985
|
|
|
13907
|
-
|
|
13986
|
+
|
|
13987
|
+
exports.AF_FUNCTION_CALL_ID_PREFIX = AF_FUNCTION_CALL_ID_PREFIX; exports.Agent = LlmAgent; exports.AgentBuilder = AgentBuilder; exports.AgentEvaluator = AgentEvaluator; exports.AgentTool = AgentTool; exports.Agents = agents_exports; exports.AiSdkLlm = AiSdkLlm; exports.AnthropicLlm = AnthropicLlm; exports.ApiKeyCredential = ApiKeyCredential; exports.ApiKeyScheme = ApiKeyScheme; exports.AuthConfig = AuthConfig; exports.AuthCredential = AuthCredential; exports.AuthCredentialType = AuthCredentialType; exports.AuthHandler = AuthHandler; exports.AuthScheme = AuthScheme; exports.AuthSchemeType = AuthSchemeType; exports.AuthTool = AuthTool; exports.AutoFlow = AutoFlow; exports.BaseAgent = BaseAgent; exports.BaseCodeExecutor = BaseCodeExecutor; exports.BaseLLMConnection = BaseLLMConnection; exports.BaseLlm = BaseLlm; exports.BaseLlmFlow = BaseLlmFlow; exports.BaseLlmRequestProcessor = BaseLlmRequestProcessor; exports.BaseLlmResponseProcessor = BaseLlmResponseProcessor; exports.BasePlanner = BasePlanner; exports.BaseSessionService = BaseSessionService; exports.BaseTool = BaseTool; exports.BasicAuthCredential = BasicAuthCredential; exports.BearerTokenCredential = BearerTokenCredential; exports.BuiltInCodeExecutor = BuiltInCodeExecutor; exports.BuiltInPlanner = BuiltInPlanner; exports.CallbackContext = CallbackContext; exports.CodeExecutionUtils = CodeExecutionUtils; exports.CodeExecutorContext = CodeExecutorContext; exports.DatabaseSessionService = DatabaseSessionService; exports.EnhancedAuthConfig = EnhancedAuthConfig; exports.EvalResult = EvalResult; exports.EvalStatus = EvalStatus; exports.Evaluation = evaluation_exports; exports.Evaluator = Evaluator; exports.Event = Event; exports.EventActions = EventActions; exports.Events = events_exports; exports.ExitLoopTool = ExitLoopTool; exports.FileOperationsTool = FileOperationsTool; exports.FinalResponseMatchV2Evaluator = FinalResponseMatchV2Evaluator; exports.Flows = flows_exports; exports.FunctionTool = FunctionTool; exports.GcsArtifactService = GcsArtifactService; exports.GetUserChoiceTool = GetUserChoiceTool; exports.GoogleLlm = GoogleLlm; exports.GoogleSearch = GoogleSearch; exports.HttpRequestTool = HttpRequestTool; exports.HttpScheme = HttpScheme; exports.InMemoryArtifactService = InMemoryArtifactService; exports.InMemoryMemoryService = InMemoryMemoryService; exports.InMemoryRunner = InMemoryRunner; exports.InMemorySessionService = InMemorySessionService; exports.InvocationContext = InvocationContext; exports.LLMRegistry = LLMRegistry; exports.LangGraphAgent = LangGraphAgent; exports.LlmAgent = LlmAgent; exports.LlmCallsLimitExceededError = LlmCallsLimitExceededError; exports.LlmRequest = LlmRequest; exports.LlmResponse = LlmResponse; exports.LoadArtifactsTool = LoadArtifactsTool; exports.LoadMemoryTool = LoadMemoryTool; exports.LocalEvalService = LocalEvalService; exports.LoopAgent = LoopAgent; exports.McpAbi = McpAbi; exports.McpAtp = McpAtp; exports.McpBamm = McpBamm; exports.McpCoinGecko = McpCoinGecko; exports.McpCoinGeckoPro = McpCoinGeckoPro; exports.McpDiscord = McpDiscord; exports.McpError = McpError; exports.McpErrorType = McpErrorType; exports.McpFilesystem = McpFilesystem; exports.McpFraxlend = McpFraxlend; exports.McpGeneric = McpGeneric; exports.McpIqWiki = McpIqWiki; exports.McpMemory = McpMemory; exports.McpNearAgent = McpNearAgent; exports.McpNearIntents = McpNearIntents; exports.McpOdos = McpOdos; exports.McpSamplingHandler = McpSamplingHandler; exports.McpTelegram = McpTelegram; exports.McpToolset = McpToolset; exports.McpUpbit = McpUpbit; exports.Memory = memory_exports; exports.Models = models_exports; exports.OAuth2Credential = OAuth2Credential; exports.OAuth2Scheme = OAuth2Scheme; exports.OpenAiLlm = OpenAiLlm; exports.OpenIdConnectScheme = OpenIdConnectScheme; exports.ParallelAgent = ParallelAgent; exports.PlanReActPlanner = PlanReActPlanner; exports.PrebuiltMetrics = PrebuiltMetrics; exports.REQUEST_EUC_FUNCTION_CALL_NAME = REQUEST_EUC_FUNCTION_CALL_NAME; exports.ReadonlyContext = ReadonlyContext; exports.RougeEvaluator = RougeEvaluator; exports.RunConfig = RunConfig; exports.Runner = Runner; exports.SafetyEvaluatorV1 = SafetyEvaluatorV1; exports.SequentialAgent = SequentialAgent; exports.Sessions = sessions_exports; exports.SingleFlow = SingleFlow; exports.State = State; exports.StreamingMode = StreamingMode; exports.TelemetryService = TelemetryService; exports.ToolContext = ToolContext; exports.Tools = tools_exports; exports.TrajectoryEvaluator = TrajectoryEvaluator; exports.TransferToAgentTool = TransferToAgentTool; exports.UserInteractionTool = UserInteractionTool; exports.VERSION = VERSION; exports.VertexAiRagMemoryService = VertexAiRagMemoryService; exports.VertexAiSessionService = VertexAiSessionService; exports._findFunctionCallEventIfLastEventIsFunctionResponse = _findFunctionCallEventIfLastEventIsFunctionResponse; exports.adkToMcpToolType = adkToMcpToolType; exports.agentTransferRequestProcessor = requestProcessor8; exports.basicRequestProcessor = requestProcessor2; exports.buildFunctionDeclaration = buildFunctionDeclaration; exports.codeExecutionRequestProcessor = requestProcessor3; exports.codeExecutionResponseProcessor = responseProcessor; exports.contentRequestProcessor = requestProcessor4; exports.convertMcpToolToBaseTool = convertMcpToolToBaseTool; exports.createAuthToolArguments = createAuthToolArguments; exports.createBranchContextForSubAgent = createBranchContextForSubAgent; exports.createDatabaseSessionService = createDatabaseSessionService; exports.createFunctionTool = createFunctionTool; exports.createMysqlSessionService = createMysqlSessionService; exports.createPostgresSessionService = createPostgresSessionService; exports.createSamplingHandler = createSamplingHandler; exports.createSqliteSessionService = createSqliteSessionService; exports.createTool = createTool; exports.generateAuthEvent = generateAuthEvent; exports.generateClientFunctionCallId = generateClientFunctionCallId; exports.getLongRunningFunctionCalls = getLongRunningFunctionCalls; exports.getMcpTools = getMcpTools; exports.handleFunctionCallsAsync = handleFunctionCallsAsync; exports.handleFunctionCallsLive = handleFunctionCallsLive; exports.identityRequestProcessor = requestProcessor5; exports.initializeTelemetry = initializeTelemetry; exports.injectSessionState = injectSessionState; exports.instructionsRequestProcessor = requestProcessor6; exports.isEnhancedAuthConfig = isEnhancedAuthConfig; exports.jsonSchemaToDeclaration = jsonSchemaToDeclaration; exports.mcpSchemaToParameters = mcpSchemaToParameters; exports.mergeAgentRun = mergeAgentRun; exports.mergeParallelFunctionResponseEvents = mergeParallelFunctionResponseEvents; exports.newInvocationContextId = newInvocationContextId; exports.nlPlanningRequestProcessor = requestProcessor7; exports.nlPlanningResponseProcessor = responseProcessor2; exports.normalizeJsonSchema = normalizeJsonSchema; exports.populateClientFunctionCallId = populateClientFunctionCallId; exports.registerProviders = registerProviders; exports.removeClientFunctionCallId = removeClientFunctionCallId; exports.requestProcessor = requestProcessor; exports.shutdownTelemetry = shutdownTelemetry; exports.telemetryService = telemetryService; exports.traceLlmCall = traceLlmCall; exports.traceToolCall = traceToolCall; exports.tracer = tracer;
|
package/dist/index.mjs
CHANGED
|
@@ -3521,6 +3521,24 @@ var ReadonlyContext = class {
|
|
|
3521
3521
|
get agentName() {
|
|
3522
3522
|
return this._invocationContext.agent.name;
|
|
3523
3523
|
}
|
|
3524
|
+
/**
|
|
3525
|
+
* The application name for this invocation. READONLY field.
|
|
3526
|
+
*/
|
|
3527
|
+
get appName() {
|
|
3528
|
+
return this._invocationContext.appName;
|
|
3529
|
+
}
|
|
3530
|
+
/**
|
|
3531
|
+
* The user ID for this invocation. READONLY field.
|
|
3532
|
+
*/
|
|
3533
|
+
get userId() {
|
|
3534
|
+
return this._invocationContext.userId;
|
|
3535
|
+
}
|
|
3536
|
+
/**
|
|
3537
|
+
* The session ID for this invocation. READONLY field.
|
|
3538
|
+
*/
|
|
3539
|
+
get sessionId() {
|
|
3540
|
+
return this._invocationContext.session.id;
|
|
3541
|
+
}
|
|
3524
3542
|
/**
|
|
3525
3543
|
* The state of the current session. READONLY field.
|
|
3526
3544
|
*/
|
|
@@ -4079,6 +4097,7 @@ __export(tools_exports, {
|
|
|
4079
4097
|
McpAtp: () => McpAtp,
|
|
4080
4098
|
McpBamm: () => McpBamm,
|
|
4081
4099
|
McpCoinGecko: () => McpCoinGecko,
|
|
4100
|
+
McpCoinGeckoPro: () => McpCoinGeckoPro,
|
|
4082
4101
|
McpDiscord: () => McpDiscord,
|
|
4083
4102
|
McpError: () => McpError,
|
|
4084
4103
|
McpErrorType: () => McpErrorType,
|
|
@@ -6123,7 +6142,7 @@ var McpToolAdapter = class extends BaseTool {
|
|
|
6123
6142
|
};
|
|
6124
6143
|
|
|
6125
6144
|
// src/tools/mcp/servers.ts
|
|
6126
|
-
function createMcpConfig(name,
|
|
6145
|
+
function createMcpConfig(name, packageNameOrUrl, config = {}) {
|
|
6127
6146
|
const {
|
|
6128
6147
|
debug,
|
|
6129
6148
|
description,
|
|
@@ -6140,17 +6159,25 @@ function createMcpConfig(name, packageName, config = {}) {
|
|
|
6140
6159
|
if (!env.PATH) {
|
|
6141
6160
|
env.PATH = process.env.PATH || "";
|
|
6142
6161
|
}
|
|
6162
|
+
let isUrl;
|
|
6163
|
+
try {
|
|
6164
|
+
const url = new URL(packageNameOrUrl);
|
|
6165
|
+
isUrl = url.protocol === "http:" || url.protocol === "https:";
|
|
6166
|
+
} catch {
|
|
6167
|
+
isUrl = false;
|
|
6168
|
+
}
|
|
6169
|
+
const transport = {
|
|
6170
|
+
mode: "stdio",
|
|
6171
|
+
command: "npx",
|
|
6172
|
+
args: isUrl ? ["-y", "mcp-remote@latest", packageNameOrUrl] : ["-y", packageNameOrUrl],
|
|
6173
|
+
env
|
|
6174
|
+
};
|
|
6143
6175
|
return {
|
|
6144
6176
|
name,
|
|
6145
6177
|
description: description || `Client for ${name}`,
|
|
6146
6178
|
debug: debug || false,
|
|
6147
6179
|
retryOptions: retryOptions || { maxRetries: 2, initialDelay: 200 },
|
|
6148
|
-
transport
|
|
6149
|
-
mode: "stdio",
|
|
6150
|
-
command: "npx",
|
|
6151
|
-
args: ["-y", packageName],
|
|
6152
|
-
env
|
|
6153
|
-
},
|
|
6180
|
+
transport,
|
|
6154
6181
|
samplingHandler
|
|
6155
6182
|
};
|
|
6156
6183
|
}
|
|
@@ -6229,7 +6256,15 @@ function McpDiscord(config = {}) {
|
|
|
6229
6256
|
function McpCoinGecko(config = {}) {
|
|
6230
6257
|
const mcpConfig = createMcpConfig(
|
|
6231
6258
|
"CoinGecko MCP Client",
|
|
6232
|
-
"
|
|
6259
|
+
"https://mcp.api.coingecko.com/mcp",
|
|
6260
|
+
config
|
|
6261
|
+
);
|
|
6262
|
+
return new McpToolset(mcpConfig);
|
|
6263
|
+
}
|
|
6264
|
+
function McpCoinGeckoPro(config = {}) {
|
|
6265
|
+
const mcpConfig = createMcpConfig(
|
|
6266
|
+
"CoinGecko Pro MCP Client",
|
|
6267
|
+
"https://mcp.pro-api.coingecko.com/mcp",
|
|
6233
6268
|
config
|
|
6234
6269
|
);
|
|
6235
6270
|
return new McpToolset(mcpConfig);
|
|
@@ -10860,6 +10895,46 @@ var AgentBuilder = class _AgentBuilder {
|
|
|
10860
10895
|
this.config.afterAgentCallback = callback;
|
|
10861
10896
|
return this;
|
|
10862
10897
|
}
|
|
10898
|
+
/**
|
|
10899
|
+
* Set the before model callback for LLM interaction
|
|
10900
|
+
* @param callback Callback to invoke before calling the LLM
|
|
10901
|
+
* @returns This builder instance for chaining
|
|
10902
|
+
*/
|
|
10903
|
+
withBeforeModelCallback(callback) {
|
|
10904
|
+
this.warnIfLocked("withBeforeModelCallback");
|
|
10905
|
+
this.config.beforeModelCallback = callback;
|
|
10906
|
+
return this;
|
|
10907
|
+
}
|
|
10908
|
+
/**
|
|
10909
|
+
* Set the after model callback for LLM interaction
|
|
10910
|
+
* @param callback Callback to invoke after receiving LLM response
|
|
10911
|
+
* @returns This builder instance for chaining
|
|
10912
|
+
*/
|
|
10913
|
+
withAfterModelCallback(callback) {
|
|
10914
|
+
this.warnIfLocked("withAfterModelCallback");
|
|
10915
|
+
this.config.afterModelCallback = callback;
|
|
10916
|
+
return this;
|
|
10917
|
+
}
|
|
10918
|
+
/**
|
|
10919
|
+
* Set the before tool callback for tool execution
|
|
10920
|
+
* @param callback Callback to invoke before running a tool
|
|
10921
|
+
* @returns This builder instance for chaining
|
|
10922
|
+
*/
|
|
10923
|
+
withBeforeToolCallback(callback) {
|
|
10924
|
+
this.warnIfLocked("withBeforeToolCallback");
|
|
10925
|
+
this.config.beforeToolCallback = callback;
|
|
10926
|
+
return this;
|
|
10927
|
+
}
|
|
10928
|
+
/**
|
|
10929
|
+
* Set the after tool callback for tool execution
|
|
10930
|
+
* @param callback Callback to invoke after running a tool
|
|
10931
|
+
* @returns This builder instance for chaining
|
|
10932
|
+
*/
|
|
10933
|
+
withAfterToolCallback(callback) {
|
|
10934
|
+
this.warnIfLocked("withAfterToolCallback");
|
|
10935
|
+
this.config.afterToolCallback = callback;
|
|
10936
|
+
return this;
|
|
10937
|
+
}
|
|
10863
10938
|
/**
|
|
10864
10939
|
* Provide an already constructed agent instance. Further definition-mutating calls
|
|
10865
10940
|
* (model/tools/instruction/etc.) will be ignored with a dev warning.
|
|
@@ -11133,6 +11208,10 @@ var AgentBuilder = class _AgentBuilder {
|
|
|
11133
11208
|
subAgents: this.config.subAgents,
|
|
11134
11209
|
beforeAgentCallback: this.config.beforeAgentCallback,
|
|
11135
11210
|
afterAgentCallback: this.config.afterAgentCallback,
|
|
11211
|
+
beforeModelCallback: this.config.beforeModelCallback,
|
|
11212
|
+
afterModelCallback: this.config.afterModelCallback,
|
|
11213
|
+
beforeToolCallback: this.config.beforeToolCallback,
|
|
11214
|
+
afterToolCallback: this.config.afterToolCallback,
|
|
11136
11215
|
memoryService: this.memoryService,
|
|
11137
11216
|
artifactService: this.artifactService,
|
|
11138
11217
|
outputKey: this.config.outputKey,
|
|
@@ -13814,6 +13893,7 @@ export {
|
|
|
13814
13893
|
McpAtp,
|
|
13815
13894
|
McpBamm,
|
|
13816
13895
|
McpCoinGecko,
|
|
13896
|
+
McpCoinGeckoPro,
|
|
13817
13897
|
McpDiscord,
|
|
13818
13898
|
McpError,
|
|
13819
13899
|
McpErrorType,
|