@iqai/adk 0.5.3 → 0.5.5

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @iqai/adk
2
2
 
3
+ ## 0.5.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 05bb1b8: Fix state variable injection: serialize objects to JSON and parse nested properties
8
+
9
+ ## 0.5.4
10
+
11
+ ### Patch Changes
12
+
13
+ - 2167a47: Adds polymarket mcp wrapper
14
+
3
15
  ## 0.5.3
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -2460,6 +2460,14 @@ declare function McpCoinGeckoPro(config?: McpServerConfig): McpToolset;
2460
2460
  * - UPBIT_ENABLE_TRADING=true
2461
2461
  */
2462
2462
  declare function McpUpbit(config?: McpServerConfig): McpToolset;
2463
+ /**
2464
+ * MCP Polymarket - Interact with the Polymarket prediction market
2465
+ *
2466
+ * Required env vars:
2467
+ * - FUNDER_ADDRESS: Available to copy from the user menu dropdown on the Polymarket website (different from the wallet address used to log in).
2468
+ * - POLYMARKET_PRIVATE_KEY: Private key of the wallet that interacts with Polymarket.
2469
+ */
2470
+ declare function McpPolymarket(config?: McpServerConfig): McpToolset;
2463
2471
  /**
2464
2472
  * Popular third-party MCP servers
2465
2473
  * These can be added as we expand support for community MCP servers
@@ -2600,6 +2608,7 @@ declare const index$7_McpMemory: typeof McpMemory;
2600
2608
  declare const index$7_McpNearAgent: typeof McpNearAgent;
2601
2609
  declare const index$7_McpNearIntents: typeof McpNearIntents;
2602
2610
  declare const index$7_McpOdos: typeof McpOdos;
2611
+ declare const index$7_McpPolymarket: typeof McpPolymarket;
2603
2612
  type index$7_McpSamplingHandler = McpSamplingHandler;
2604
2613
  declare const index$7_McpSamplingHandler: typeof McpSamplingHandler;
2605
2614
  type index$7_McpSamplingRequest = McpSamplingRequest;
@@ -2629,7 +2638,7 @@ declare const index$7_jsonSchemaToDeclaration: typeof jsonSchemaToDeclaration;
2629
2638
  declare const index$7_mcpSchemaToParameters: typeof mcpSchemaToParameters;
2630
2639
  declare const index$7_normalizeJsonSchema: typeof normalizeJsonSchema;
2631
2640
  declare namespace index$7 {
2632
- 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 };
2641
+ 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_McpPolymarket as McpPolymarket, 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 };
2633
2642
  }
2634
2643
 
2635
2644
  /**
@@ -5832,4 +5841,4 @@ declare const traceLlmCall: (invocationContext: InvocationContext, eventId: stri
5832
5841
 
5833
5842
  declare const VERSION = "0.1.0";
5834
5843
 
5835
- 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, type EventCompaction, index$2 as Events, type EventsCompactionConfig, type EventsSummarizer, 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, LlmEventSummarizer, 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 ParsedArtifactUri, 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, getArtifactUri, getLongRunningFunctionCalls, getMcpTools, handleFunctionCallsAsync, handleFunctionCallsLive, requestProcessor$5 as identityRequestProcessor, initializeTelemetry, injectSessionState, requestProcessor$4 as instructionsRequestProcessor, isArtifactRef, isEnhancedAuthConfig, jsonSchemaToDeclaration, mcpSchemaToParameters, mergeAgentRun, mergeParallelFunctionResponseEvents, newInvocationContextId, requestProcessor$1 as nlPlanningRequestProcessor, responseProcessor$1 as nlPlanningResponseProcessor, normalizeJsonSchema, parseArtifactUri, populateClientFunctionCallId, registerProviders, removeClientFunctionCallId, requestProcessor$7 as requestProcessor, runCompactionForSlidingWindow, shutdownTelemetry, telemetryService, traceLlmCall, traceToolCall, tracer };
5844
+ 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, type EventCompaction, index$2 as Events, type EventsCompactionConfig, type EventsSummarizer, 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, LlmEventSummarizer, 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, McpPolymarket, 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 ParsedArtifactUri, 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, getArtifactUri, getLongRunningFunctionCalls, getMcpTools, handleFunctionCallsAsync, handleFunctionCallsLive, requestProcessor$5 as identityRequestProcessor, initializeTelemetry, injectSessionState, requestProcessor$4 as instructionsRequestProcessor, isArtifactRef, isEnhancedAuthConfig, jsonSchemaToDeclaration, mcpSchemaToParameters, mergeAgentRun, mergeParallelFunctionResponseEvents, newInvocationContextId, requestProcessor$1 as nlPlanningRequestProcessor, responseProcessor$1 as nlPlanningResponseProcessor, normalizeJsonSchema, parseArtifactUri, populateClientFunctionCallId, registerProviders, removeClientFunctionCallId, requestProcessor$7 as requestProcessor, runCompactionForSlidingWindow, shutdownTelemetry, telemetryService, traceLlmCall, traceToolCall, tracer };
package/dist/index.d.ts CHANGED
@@ -2460,6 +2460,14 @@ declare function McpCoinGeckoPro(config?: McpServerConfig): McpToolset;
2460
2460
  * - UPBIT_ENABLE_TRADING=true
2461
2461
  */
2462
2462
  declare function McpUpbit(config?: McpServerConfig): McpToolset;
2463
+ /**
2464
+ * MCP Polymarket - Interact with the Polymarket prediction market
2465
+ *
2466
+ * Required env vars:
2467
+ * - FUNDER_ADDRESS: Available to copy from the user menu dropdown on the Polymarket website (different from the wallet address used to log in).
2468
+ * - POLYMARKET_PRIVATE_KEY: Private key of the wallet that interacts with Polymarket.
2469
+ */
2470
+ declare function McpPolymarket(config?: McpServerConfig): McpToolset;
2463
2471
  /**
2464
2472
  * Popular third-party MCP servers
2465
2473
  * These can be added as we expand support for community MCP servers
@@ -2600,6 +2608,7 @@ declare const index$7_McpMemory: typeof McpMemory;
2600
2608
  declare const index$7_McpNearAgent: typeof McpNearAgent;
2601
2609
  declare const index$7_McpNearIntents: typeof McpNearIntents;
2602
2610
  declare const index$7_McpOdos: typeof McpOdos;
2611
+ declare const index$7_McpPolymarket: typeof McpPolymarket;
2603
2612
  type index$7_McpSamplingHandler = McpSamplingHandler;
2604
2613
  declare const index$7_McpSamplingHandler: typeof McpSamplingHandler;
2605
2614
  type index$7_McpSamplingRequest = McpSamplingRequest;
@@ -2629,7 +2638,7 @@ declare const index$7_jsonSchemaToDeclaration: typeof jsonSchemaToDeclaration;
2629
2638
  declare const index$7_mcpSchemaToParameters: typeof mcpSchemaToParameters;
2630
2639
  declare const index$7_normalizeJsonSchema: typeof normalizeJsonSchema;
2631
2640
  declare namespace index$7 {
2632
- 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 };
2641
+ 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_McpPolymarket as McpPolymarket, 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 };
2633
2642
  }
2634
2643
 
2635
2644
  /**
@@ -5832,4 +5841,4 @@ declare const traceLlmCall: (invocationContext: InvocationContext, eventId: stri
5832
5841
 
5833
5842
  declare const VERSION = "0.1.0";
5834
5843
 
5835
- 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, type EventCompaction, index$2 as Events, type EventsCompactionConfig, type EventsSummarizer, 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, LlmEventSummarizer, 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 ParsedArtifactUri, 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, getArtifactUri, getLongRunningFunctionCalls, getMcpTools, handleFunctionCallsAsync, handleFunctionCallsLive, requestProcessor$5 as identityRequestProcessor, initializeTelemetry, injectSessionState, requestProcessor$4 as instructionsRequestProcessor, isArtifactRef, isEnhancedAuthConfig, jsonSchemaToDeclaration, mcpSchemaToParameters, mergeAgentRun, mergeParallelFunctionResponseEvents, newInvocationContextId, requestProcessor$1 as nlPlanningRequestProcessor, responseProcessor$1 as nlPlanningResponseProcessor, normalizeJsonSchema, parseArtifactUri, populateClientFunctionCallId, registerProviders, removeClientFunctionCallId, requestProcessor$7 as requestProcessor, runCompactionForSlidingWindow, shutdownTelemetry, telemetryService, traceLlmCall, traceToolCall, tracer };
5844
+ 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, type EventCompaction, index$2 as Events, type EventsCompactionConfig, type EventsSummarizer, 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, LlmEventSummarizer, 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, McpPolymarket, 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 ParsedArtifactUri, 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, getArtifactUri, getLongRunningFunctionCalls, getMcpTools, handleFunctionCallsAsync, handleFunctionCallsLive, requestProcessor$5 as identityRequestProcessor, initializeTelemetry, injectSessionState, requestProcessor$4 as instructionsRequestProcessor, isArtifactRef, isEnhancedAuthConfig, jsonSchemaToDeclaration, mcpSchemaToParameters, mergeAgentRun, mergeParallelFunctionResponseEvents, newInvocationContextId, requestProcessor$1 as nlPlanningRequestProcessor, responseProcessor$1 as nlPlanningResponseProcessor, normalizeJsonSchema, parseArtifactUri, populateClientFunctionCallId, registerProviders, removeClientFunctionCallId, requestProcessor$7 as requestProcessor, runCompactionForSlidingWindow, shutdownTelemetry, telemetryService, traceLlmCall, traceToolCall, tracer };
package/dist/index.js CHANGED
@@ -4307,6 +4307,7 @@ __export(tools_exports, {
4307
4307
  McpNearAgent: () => McpNearAgent,
4308
4308
  McpNearIntents: () => McpNearIntents,
4309
4309
  McpOdos: () => McpOdos,
4310
+ McpPolymarket: () => McpPolymarket,
4310
4311
  McpSamplingHandler: () => McpSamplingHandler,
4311
4312
  McpTelegram: () => McpTelegram,
4312
4313
  McpToolset: () => McpToolset,
@@ -6475,6 +6476,14 @@ function McpUpbit(config = {}) {
6475
6476
  );
6476
6477
  return new McpToolset(mcpConfig);
6477
6478
  }
6479
+ function McpPolymarket(config = {}) {
6480
+ const mcpConfig = createMcpConfig(
6481
+ "Polymarket MCP Client",
6482
+ "@iqai/mcp-polymarket",
6483
+ config
6484
+ );
6485
+ return new McpToolset(mcpConfig);
6486
+ }
6478
6487
  function McpFilesystem(config = {}) {
6479
6488
  const mcpConfig = createMcpConfig(
6480
6489
  "Filesystem MCP Client",
@@ -8722,17 +8731,27 @@ async function injectSessionState(template, readonlyContext) {
8722
8731
  throw error;
8723
8732
  }
8724
8733
  } else {
8725
- if (!isValidStateName(varName)) {
8734
+ const isNestedAccess = varName.includes(".") || varName.includes("[");
8735
+ const rootProperty = isNestedAccess ? varName.split(/[.[]/)[0] : varName;
8736
+ if (!isValidStateName(rootProperty)) {
8726
8737
  return match[0];
8727
8738
  }
8728
8739
  const sessionState = invocationContext.session.state;
8729
- if (varName in sessionState) {
8730
- return String(sessionState[varName]);
8731
- }
8732
- if (optional) {
8733
- return "";
8740
+ try {
8741
+ const value = isNestedAccess ? getNestedValue(sessionState, varName) : sessionState[varName];
8742
+ if (value === void 0) {
8743
+ if (optional) {
8744
+ return "";
8745
+ }
8746
+ throw new Error(`Context variable not found: \`${varName}\`.`);
8747
+ }
8748
+ return formatValue(value);
8749
+ } catch (error) {
8750
+ if (optional) {
8751
+ return "";
8752
+ }
8753
+ throw error;
8734
8754
  }
8735
- throw new Error(`Context variable not found: \`${varName}\`.`);
8736
8755
  }
8737
8756
  }
8738
8757
  return await asyncReplace(/{[^{}]*}/g, replaceMatch, template);
@@ -8755,6 +8774,66 @@ function isValidIdentifier(name) {
8755
8774
  const identifierRegex = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
8756
8775
  return identifierRegex.test(name);
8757
8776
  }
8777
+ function getNestedValue(obj, path3) {
8778
+ const parts = [];
8779
+ let current = "";
8780
+ let inBrackets = false;
8781
+ let quote = "";
8782
+ for (let i = 0; i < path3.length; i++) {
8783
+ const char = path3[i];
8784
+ if (char === "[" && !quote) {
8785
+ if (current) {
8786
+ parts.push(current);
8787
+ current = "";
8788
+ }
8789
+ inBrackets = true;
8790
+ } else if (char === "]" && inBrackets && !quote) {
8791
+ if (current) {
8792
+ parts.push(current);
8793
+ current = "";
8794
+ }
8795
+ inBrackets = false;
8796
+ } else if ((char === '"' || char === "'") && inBrackets) {
8797
+ if (quote === char) {
8798
+ quote = "";
8799
+ } else if (!quote) {
8800
+ quote = char;
8801
+ } else {
8802
+ current += char;
8803
+ }
8804
+ } else if (char === "." && !inBrackets && !quote) {
8805
+ if (current) {
8806
+ parts.push(current);
8807
+ current = "";
8808
+ }
8809
+ } else {
8810
+ current += char;
8811
+ }
8812
+ }
8813
+ if (current) {
8814
+ parts.push(current);
8815
+ }
8816
+ let result = obj;
8817
+ for (const part of parts) {
8818
+ if (result === null || result === void 0) {
8819
+ return void 0;
8820
+ }
8821
+ result = result[part];
8822
+ }
8823
+ return result;
8824
+ }
8825
+ function formatValue(value) {
8826
+ if (value === null) {
8827
+ return "null";
8828
+ }
8829
+ if (value === void 0) {
8830
+ return "undefined";
8831
+ }
8832
+ if (typeof value === "object") {
8833
+ return JSON.stringify(value, null, 2);
8834
+ }
8835
+ return String(value);
8836
+ }
8758
8837
 
8759
8838
  // src/flows/llm-flows/instructions.ts
8760
8839
  var InstructionsLlmRequestProcessor = class extends BaseLlmRequestProcessor {
@@ -14522,4 +14601,5 @@ var VERSION = "0.1.0";
14522
14601
 
14523
14602
 
14524
14603
 
14525
- 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.LlmEventSummarizer = LlmEventSummarizer; 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.getArtifactUri = getArtifactUri; 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.isArtifactRef = isArtifactRef; 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.parseArtifactUri = parseArtifactUri; exports.populateClientFunctionCallId = populateClientFunctionCallId; exports.registerProviders = registerProviders; exports.removeClientFunctionCallId = removeClientFunctionCallId; exports.requestProcessor = requestProcessor; exports.runCompactionForSlidingWindow = runCompactionForSlidingWindow; exports.shutdownTelemetry = shutdownTelemetry; exports.telemetryService = telemetryService; exports.traceLlmCall = traceLlmCall; exports.traceToolCall = traceToolCall; exports.tracer = tracer;
14604
+
14605
+ 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.LlmEventSummarizer = LlmEventSummarizer; 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.McpPolymarket = McpPolymarket; 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.getArtifactUri = getArtifactUri; 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.isArtifactRef = isArtifactRef; 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.parseArtifactUri = parseArtifactUri; exports.populateClientFunctionCallId = populateClientFunctionCallId; exports.registerProviders = registerProviders; exports.removeClientFunctionCallId = removeClientFunctionCallId; exports.requestProcessor = requestProcessor; exports.runCompactionForSlidingWindow = runCompactionForSlidingWindow; exports.shutdownTelemetry = shutdownTelemetry; exports.telemetryService = telemetryService; exports.traceLlmCall = traceLlmCall; exports.traceToolCall = traceToolCall; exports.tracer = tracer;
package/dist/index.mjs CHANGED
@@ -4307,6 +4307,7 @@ __export(tools_exports, {
4307
4307
  McpNearAgent: () => McpNearAgent,
4308
4308
  McpNearIntents: () => McpNearIntents,
4309
4309
  McpOdos: () => McpOdos,
4310
+ McpPolymarket: () => McpPolymarket,
4310
4311
  McpSamplingHandler: () => McpSamplingHandler,
4311
4312
  McpTelegram: () => McpTelegram,
4312
4313
  McpToolset: () => McpToolset,
@@ -6475,6 +6476,14 @@ function McpUpbit(config = {}) {
6475
6476
  );
6476
6477
  return new McpToolset(mcpConfig);
6477
6478
  }
6479
+ function McpPolymarket(config = {}) {
6480
+ const mcpConfig = createMcpConfig(
6481
+ "Polymarket MCP Client",
6482
+ "@iqai/mcp-polymarket",
6483
+ config
6484
+ );
6485
+ return new McpToolset(mcpConfig);
6486
+ }
6478
6487
  function McpFilesystem(config = {}) {
6479
6488
  const mcpConfig = createMcpConfig(
6480
6489
  "Filesystem MCP Client",
@@ -8722,17 +8731,27 @@ async function injectSessionState(template, readonlyContext) {
8722
8731
  throw error;
8723
8732
  }
8724
8733
  } else {
8725
- if (!isValidStateName(varName)) {
8734
+ const isNestedAccess = varName.includes(".") || varName.includes("[");
8735
+ const rootProperty = isNestedAccess ? varName.split(/[.[]/)[0] : varName;
8736
+ if (!isValidStateName(rootProperty)) {
8726
8737
  return match[0];
8727
8738
  }
8728
8739
  const sessionState = invocationContext.session.state;
8729
- if (varName in sessionState) {
8730
- return String(sessionState[varName]);
8731
- }
8732
- if (optional) {
8733
- return "";
8740
+ try {
8741
+ const value = isNestedAccess ? getNestedValue(sessionState, varName) : sessionState[varName];
8742
+ if (value === void 0) {
8743
+ if (optional) {
8744
+ return "";
8745
+ }
8746
+ throw new Error(`Context variable not found: \`${varName}\`.`);
8747
+ }
8748
+ return formatValue(value);
8749
+ } catch (error) {
8750
+ if (optional) {
8751
+ return "";
8752
+ }
8753
+ throw error;
8734
8754
  }
8735
- throw new Error(`Context variable not found: \`${varName}\`.`);
8736
8755
  }
8737
8756
  }
8738
8757
  return await asyncReplace(/{[^{}]*}/g, replaceMatch, template);
@@ -8755,6 +8774,66 @@ function isValidIdentifier(name) {
8755
8774
  const identifierRegex = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
8756
8775
  return identifierRegex.test(name);
8757
8776
  }
8777
+ function getNestedValue(obj, path3) {
8778
+ const parts = [];
8779
+ let current = "";
8780
+ let inBrackets = false;
8781
+ let quote = "";
8782
+ for (let i = 0; i < path3.length; i++) {
8783
+ const char = path3[i];
8784
+ if (char === "[" && !quote) {
8785
+ if (current) {
8786
+ parts.push(current);
8787
+ current = "";
8788
+ }
8789
+ inBrackets = true;
8790
+ } else if (char === "]" && inBrackets && !quote) {
8791
+ if (current) {
8792
+ parts.push(current);
8793
+ current = "";
8794
+ }
8795
+ inBrackets = false;
8796
+ } else if ((char === '"' || char === "'") && inBrackets) {
8797
+ if (quote === char) {
8798
+ quote = "";
8799
+ } else if (!quote) {
8800
+ quote = char;
8801
+ } else {
8802
+ current += char;
8803
+ }
8804
+ } else if (char === "." && !inBrackets && !quote) {
8805
+ if (current) {
8806
+ parts.push(current);
8807
+ current = "";
8808
+ }
8809
+ } else {
8810
+ current += char;
8811
+ }
8812
+ }
8813
+ if (current) {
8814
+ parts.push(current);
8815
+ }
8816
+ let result = obj;
8817
+ for (const part of parts) {
8818
+ if (result === null || result === void 0) {
8819
+ return void 0;
8820
+ }
8821
+ result = result[part];
8822
+ }
8823
+ return result;
8824
+ }
8825
+ function formatValue(value) {
8826
+ if (value === null) {
8827
+ return "null";
8828
+ }
8829
+ if (value === void 0) {
8830
+ return "undefined";
8831
+ }
8832
+ if (typeof value === "object") {
8833
+ return JSON.stringify(value, null, 2);
8834
+ }
8835
+ return String(value);
8836
+ }
8758
8837
 
8759
8838
  // src/flows/llm-flows/instructions.ts
8760
8839
  var InstructionsLlmRequestProcessor = class extends BaseLlmRequestProcessor {
@@ -14439,6 +14518,7 @@ export {
14439
14518
  McpNearAgent,
14440
14519
  McpNearIntents,
14441
14520
  McpOdos,
14521
+ McpPolymarket,
14442
14522
  McpSamplingHandler,
14443
14523
  McpTelegram,
14444
14524
  McpToolset,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iqai/adk",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "description": "Agent Development Kit for TypeScript with multi-provider LLM support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",