@iqai/adk 0.5.2 → 0.5.4

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,20 @@
1
1
  # @iqai/adk
2
2
 
3
+ ## 0.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 2167a47: Adds polymarket mcp wrapper
8
+
9
+ ## 0.5.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 1ec769a: fix: improve type safety across cli and adk package
14
+ - 9ba699c: fix: state persistence
15
+ - 4fbb724: Fix: state management
16
+ - edfe628: Add artifact parsing and rewind functionality
17
+
3
18
  ## 0.5.2
4
19
 
5
20
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -101,6 +101,10 @@ declare class EventActions {
101
101
  * a compaction of events within the specified timestamp range.
102
102
  */
103
103
  compaction?: EventCompaction;
104
+ /**
105
+ * The invocation id to rewind to. This is only set for rewind event.
106
+ */
107
+ rewindBeforeInvocationId?: string;
104
108
  /**
105
109
  * Constructor for EventActions
106
110
  */
@@ -112,6 +116,7 @@ declare class EventActions {
112
116
  escalate?: boolean;
113
117
  requestedAuthConfigs?: Record<string, any>;
114
118
  compaction?: EventCompaction;
119
+ rewindBeforeInvocationId?: string;
115
120
  });
116
121
  }
117
122
 
@@ -2455,6 +2460,14 @@ declare function McpCoinGeckoPro(config?: McpServerConfig): McpToolset;
2455
2460
  * - UPBIT_ENABLE_TRADING=true
2456
2461
  */
2457
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;
2458
2471
  /**
2459
2472
  * Popular third-party MCP servers
2460
2473
  * These can be added as we expand support for community MCP servers
@@ -2595,6 +2608,7 @@ declare const index$7_McpMemory: typeof McpMemory;
2595
2608
  declare const index$7_McpNearAgent: typeof McpNearAgent;
2596
2609
  declare const index$7_McpNearIntents: typeof McpNearIntents;
2597
2610
  declare const index$7_McpOdos: typeof McpOdos;
2611
+ declare const index$7_McpPolymarket: typeof McpPolymarket;
2598
2612
  type index$7_McpSamplingHandler = McpSamplingHandler;
2599
2613
  declare const index$7_McpSamplingHandler: typeof McpSamplingHandler;
2600
2614
  type index$7_McpSamplingRequest = McpSamplingRequest;
@@ -2624,7 +2638,7 @@ declare const index$7_jsonSchemaToDeclaration: typeof jsonSchemaToDeclaration;
2624
2638
  declare const index$7_mcpSchemaToParameters: typeof mcpSchemaToParameters;
2625
2639
  declare const index$7_normalizeJsonSchema: typeof normalizeJsonSchema;
2626
2640
  declare namespace index$7 {
2627
- 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 };
2628
2642
  }
2629
2643
 
2630
2644
  /**
@@ -4142,6 +4156,11 @@ interface EnhancedRunner<T = string, M extends boolean = false> {
4142
4156
  newMessage: FullMessage;
4143
4157
  runConfig?: RunConfig;
4144
4158
  }): AsyncIterable<Event>;
4159
+ rewind(params: {
4160
+ userId: string;
4161
+ sessionId: string;
4162
+ rewindBeforeInvocationId: string;
4163
+ }): any;
4145
4164
  __outputSchema?: ZodSchema;
4146
4165
  }
4147
4166
  /**
@@ -4835,6 +4854,23 @@ declare namespace index$3 {
4835
4854
  export { index$3_BaseSessionService as BaseSessionService, index$3_DatabaseSessionService as DatabaseSessionService, type index$3_GetSessionConfig as GetSessionConfig, index$3_InMemorySessionService as InMemorySessionService, type index$3_ListSessionsResponse as ListSessionsResponse, type index$3_Session as Session, index$3_State as State, index$3_VertexAiSessionService as VertexAiSessionService, index$3_createDatabaseSessionService as createDatabaseSessionService, index$3_createMysqlSessionService as createMysqlSessionService, index$3_createPostgresSessionService as createPostgresSessionService, index$3_createSqliteSessionService as createSqliteSessionService };
4836
4855
  }
4837
4856
 
4857
+ interface ParsedArtifactUri {
4858
+ appName: string;
4859
+ userId: string;
4860
+ sessionId?: string;
4861
+ filename: string;
4862
+ version: number;
4863
+ }
4864
+ declare function parseArtifactUri(uri: string): ParsedArtifactUri | null;
4865
+ declare function getArtifactUri(args: {
4866
+ appName: string;
4867
+ userId: string;
4868
+ filename: string;
4869
+ version: number;
4870
+ sessionId?: string;
4871
+ }): string;
4872
+ declare function isArtifactRef(artifact: Part): boolean;
4873
+
4838
4874
  declare class GcsArtifactService implements BaseArtifactService {
4839
4875
  private readonly bucketName;
4840
4876
  private readonly storageClient;
@@ -5709,6 +5745,13 @@ declare class Runner<T extends BaseAgent = BaseAgent> {
5709
5745
  * Gets the configured summarizer or creates a default LLM-based one.
5710
5746
  */
5711
5747
  private _getOrCreateSummarizer;
5748
+ rewind(args: {
5749
+ userId: string;
5750
+ sessionId: string;
5751
+ rewindBeforeInvocationId: string;
5752
+ }): Promise<void>;
5753
+ private _computeStateDeltaForRewind;
5754
+ private _computeArtifactDeltaForRewind;
5712
5755
  }
5713
5756
  /**
5714
5757
  * An in-memory Runner for testing and development.
@@ -5798,4 +5841,4 @@ declare const traceLlmCall: (invocationContext: InvocationContext, eventId: stri
5798
5841
 
5799
5842
  declare const VERSION = "0.1.0";
5800
5843
 
5801
- 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 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, 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
@@ -101,6 +101,10 @@ declare class EventActions {
101
101
  * a compaction of events within the specified timestamp range.
102
102
  */
103
103
  compaction?: EventCompaction;
104
+ /**
105
+ * The invocation id to rewind to. This is only set for rewind event.
106
+ */
107
+ rewindBeforeInvocationId?: string;
104
108
  /**
105
109
  * Constructor for EventActions
106
110
  */
@@ -112,6 +116,7 @@ declare class EventActions {
112
116
  escalate?: boolean;
113
117
  requestedAuthConfigs?: Record<string, any>;
114
118
  compaction?: EventCompaction;
119
+ rewindBeforeInvocationId?: string;
115
120
  });
116
121
  }
117
122
 
@@ -2455,6 +2460,14 @@ declare function McpCoinGeckoPro(config?: McpServerConfig): McpToolset;
2455
2460
  * - UPBIT_ENABLE_TRADING=true
2456
2461
  */
2457
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;
2458
2471
  /**
2459
2472
  * Popular third-party MCP servers
2460
2473
  * These can be added as we expand support for community MCP servers
@@ -2595,6 +2608,7 @@ declare const index$7_McpMemory: typeof McpMemory;
2595
2608
  declare const index$7_McpNearAgent: typeof McpNearAgent;
2596
2609
  declare const index$7_McpNearIntents: typeof McpNearIntents;
2597
2610
  declare const index$7_McpOdos: typeof McpOdos;
2611
+ declare const index$7_McpPolymarket: typeof McpPolymarket;
2598
2612
  type index$7_McpSamplingHandler = McpSamplingHandler;
2599
2613
  declare const index$7_McpSamplingHandler: typeof McpSamplingHandler;
2600
2614
  type index$7_McpSamplingRequest = McpSamplingRequest;
@@ -2624,7 +2638,7 @@ declare const index$7_jsonSchemaToDeclaration: typeof jsonSchemaToDeclaration;
2624
2638
  declare const index$7_mcpSchemaToParameters: typeof mcpSchemaToParameters;
2625
2639
  declare const index$7_normalizeJsonSchema: typeof normalizeJsonSchema;
2626
2640
  declare namespace index$7 {
2627
- 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 };
2628
2642
  }
2629
2643
 
2630
2644
  /**
@@ -4142,6 +4156,11 @@ interface EnhancedRunner<T = string, M extends boolean = false> {
4142
4156
  newMessage: FullMessage;
4143
4157
  runConfig?: RunConfig;
4144
4158
  }): AsyncIterable<Event>;
4159
+ rewind(params: {
4160
+ userId: string;
4161
+ sessionId: string;
4162
+ rewindBeforeInvocationId: string;
4163
+ }): any;
4145
4164
  __outputSchema?: ZodSchema;
4146
4165
  }
4147
4166
  /**
@@ -4835,6 +4854,23 @@ declare namespace index$3 {
4835
4854
  export { index$3_BaseSessionService as BaseSessionService, index$3_DatabaseSessionService as DatabaseSessionService, type index$3_GetSessionConfig as GetSessionConfig, index$3_InMemorySessionService as InMemorySessionService, type index$3_ListSessionsResponse as ListSessionsResponse, type index$3_Session as Session, index$3_State as State, index$3_VertexAiSessionService as VertexAiSessionService, index$3_createDatabaseSessionService as createDatabaseSessionService, index$3_createMysqlSessionService as createMysqlSessionService, index$3_createPostgresSessionService as createPostgresSessionService, index$3_createSqliteSessionService as createSqliteSessionService };
4836
4855
  }
4837
4856
 
4857
+ interface ParsedArtifactUri {
4858
+ appName: string;
4859
+ userId: string;
4860
+ sessionId?: string;
4861
+ filename: string;
4862
+ version: number;
4863
+ }
4864
+ declare function parseArtifactUri(uri: string): ParsedArtifactUri | null;
4865
+ declare function getArtifactUri(args: {
4866
+ appName: string;
4867
+ userId: string;
4868
+ filename: string;
4869
+ version: number;
4870
+ sessionId?: string;
4871
+ }): string;
4872
+ declare function isArtifactRef(artifact: Part): boolean;
4873
+
4838
4874
  declare class GcsArtifactService implements BaseArtifactService {
4839
4875
  private readonly bucketName;
4840
4876
  private readonly storageClient;
@@ -5709,6 +5745,13 @@ declare class Runner<T extends BaseAgent = BaseAgent> {
5709
5745
  * Gets the configured summarizer or creates a default LLM-based one.
5710
5746
  */
5711
5747
  private _getOrCreateSummarizer;
5748
+ rewind(args: {
5749
+ userId: string;
5750
+ sessionId: string;
5751
+ rewindBeforeInvocationId: string;
5752
+ }): Promise<void>;
5753
+ private _computeStateDeltaForRewind;
5754
+ private _computeArtifactDeltaForRewind;
5712
5755
  }
5713
5756
  /**
5714
5757
  * An in-memory Runner for testing and development.
@@ -5798,4 +5841,4 @@ declare const traceLlmCall: (invocationContext: InvocationContext, eventId: stri
5798
5841
 
5799
5842
  declare const VERSION = "0.1.0";
5800
5843
 
5801
- 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 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, 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 };