@iqai/adk 0.1.11 → 0.1.12

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,11 @@
1
1
  # @iqai/adk
2
2
 
3
+ ## 0.1.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 1b9f517: - Add support for withMemory and withArtifactService methods to agent builder instead of passing it from withSession
8
+
3
9
  ## 0.1.11
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -3901,14 +3901,11 @@ interface AgentBuilderConfig {
3901
3901
  rootNode?: string;
3902
3902
  }
3903
3903
  /**
3904
- * Session configuration for the AgentBuilder
3904
+ * Session configuration options
3905
3905
  */
3906
- interface SessionConfig {
3907
- service: BaseSessionService;
3908
- userId: string;
3909
- appName: string;
3910
- memoryService?: BaseMemoryService;
3911
- artifactService?: BaseArtifactService;
3906
+ interface SessionOptions {
3907
+ userId?: string;
3908
+ appName?: string;
3912
3909
  }
3913
3910
  /**
3914
3911
  * Message part interface for flexible message input
@@ -3965,6 +3962,15 @@ type AgentType = "llm" | "sequential" | "parallel" | "loop" | "langgraph";
3965
3962
  * .withInstruction("You are a research assistant")
3966
3963
  * .build();
3967
3964
  *
3965
+ * // With memory and artifact services
3966
+ * const { runner } = await AgentBuilder
3967
+ * .create("persistent-agent")
3968
+ * .withModel("gemini-2.5-flash")
3969
+ * .withMemory(new RedisMemoryService())
3970
+ * .withArtifactService(new S3ArtifactService())
3971
+ * .withSession(new DatabaseSessionService(), { userId: "user123", appName: "myapp" })
3972
+ * .build();
3973
+ *
3968
3974
  * // Multi-agent workflow
3969
3975
  * const { runner } = await AgentBuilder
3970
3976
  * .create("workflow")
@@ -3975,6 +3981,8 @@ type AgentType = "llm" | "sequential" | "parallel" | "loop" | "langgraph";
3975
3981
  declare class AgentBuilder {
3976
3982
  private config;
3977
3983
  private sessionConfig?;
3984
+ private memoryService?;
3985
+ private artifactService?;
3978
3986
  private agentType;
3979
3987
  /**
3980
3988
  * Private constructor - use static create() method
@@ -4051,21 +4059,29 @@ declare class AgentBuilder {
4051
4059
  /**
4052
4060
  * Configure session management with optional smart defaults
4053
4061
  * @param service Session service to use
4054
- * @param userId User identifier (optional, defaults to agent-based ID)
4055
- * @param appName Application name (optional, defaults to agent-based name)
4056
- * @param memoryService Optional memory service
4057
- * @param artifactService Optional artifact service
4062
+ * @param options Session configuration options (userId and appName)
4063
+ * @returns This builder instance for chaining
4064
+ */
4065
+ withSession(service: BaseSessionService, options?: SessionOptions): this;
4066
+ /**
4067
+ * Configure memory service for the agent
4068
+ * @param memoryService Memory service to use for conversation history and context
4069
+ * @returns This builder instance for chaining
4070
+ */
4071
+ withMemory(memoryService: BaseMemoryService): this;
4072
+ /**
4073
+ * Configure artifact service for the agent
4074
+ * @param artifactService Artifact service to use for managing generated artifacts
4058
4075
  * @returns This builder instance for chaining
4059
4076
  */
4060
- withSession(service: BaseSessionService, userId?: string, appName?: string, memoryService?: BaseMemoryService, artifactService?: BaseArtifactService): this;
4077
+ withArtifactService(artifactService: BaseArtifactService): this;
4061
4078
  /**
4062
4079
  * Configure with an in-memory session with custom IDs
4063
4080
  * Note: In-memory sessions are created automatically by default, use this only if you need custom appName/userId
4064
- * @param appName Application name (optional, defaults to agent-based name)
4065
- * @param userId User identifier (optional, defaults to agent-based ID)
4081
+ * @param options Session configuration options (userId and appName)
4066
4082
  * @returns This builder instance for chaining
4067
4083
  */
4068
- withQuickSession(appName?: string, userId?: string): this;
4084
+ withQuickSession(options?: SessionOptions): this;
4069
4085
  /**
4070
4086
  * Build the agent and optionally create runner and session
4071
4087
  * @returns Built agent with optional runner and session
@@ -4140,7 +4156,7 @@ declare const index$4_RunConfig: typeof RunConfig;
4140
4156
  type index$4_SequentialAgent = SequentialAgent;
4141
4157
  declare const index$4_SequentialAgent: typeof SequentialAgent;
4142
4158
  type index$4_SequentialAgentConfig = SequentialAgentConfig;
4143
- type index$4_SessionConfig = SessionConfig;
4159
+ type index$4_SessionOptions = SessionOptions;
4144
4160
  type index$4_SingleAgentCallback = SingleAgentCallback;
4145
4161
  type index$4_StreamingMode = StreamingMode;
4146
4162
  declare const index$4_StreamingMode: typeof StreamingMode;
@@ -4149,7 +4165,7 @@ declare const index$4_createBranchContextForSubAgent: typeof createBranchContext
4149
4165
  declare const index$4_mergeAgentRun: typeof mergeAgentRun;
4150
4166
  declare const index$4_newInvocationContextId: typeof newInvocationContextId;
4151
4167
  declare namespace index$4 {
4152
- export { type index$4_AfterAgentCallback as AfterAgentCallback, LlmAgent as Agent, index$4_AgentBuilder as AgentBuilder, type index$4_AgentBuilderConfig as AgentBuilderConfig, type index$4_AgentType as AgentType, index$4_BaseAgent as BaseAgent, type index$4_BeforeAgentCallback as BeforeAgentCallback, type index$4_BuiltAgent as BuiltAgent, index$4_CallbackContext as CallbackContext, type index$4_EnhancedRunner as EnhancedRunner, type index$4_FullMessage as FullMessage, type index$4_InstructionProvider as InstructionProvider, index$4_InvocationContext as InvocationContext, index$4_LangGraphAgent as LangGraphAgent, type index$4_LangGraphAgentConfig as LangGraphAgentConfig, type index$4_LangGraphNode as LangGraphNode, index$4_LlmAgent as LlmAgent, type index$4_LlmAgentConfig as LlmAgentConfig, index$4_LlmCallsLimitExceededError as LlmCallsLimitExceededError, index$4_LoopAgent as LoopAgent, type index$4_LoopAgentConfig as LoopAgentConfig, type index$4_MessagePart as MessagePart, index$4_ParallelAgent as ParallelAgent, type index$4_ParallelAgentConfig as ParallelAgentConfig, index$4_ReadonlyContext as ReadonlyContext, index$4_RunConfig as RunConfig, index$4_SequentialAgent as SequentialAgent, type index$4_SequentialAgentConfig as SequentialAgentConfig, type index$4_SessionConfig as SessionConfig, type index$4_SingleAgentCallback as SingleAgentCallback, index$4_StreamingMode as StreamingMode, type index$4_ToolUnion as ToolUnion, index$4_createBranchContextForSubAgent as createBranchContextForSubAgent, index$4_mergeAgentRun as mergeAgentRun, index$4_newInvocationContextId as newInvocationContextId };
4168
+ export { type index$4_AfterAgentCallback as AfterAgentCallback, LlmAgent as Agent, index$4_AgentBuilder as AgentBuilder, type index$4_AgentBuilderConfig as AgentBuilderConfig, type index$4_AgentType as AgentType, index$4_BaseAgent as BaseAgent, type index$4_BeforeAgentCallback as BeforeAgentCallback, type index$4_BuiltAgent as BuiltAgent, index$4_CallbackContext as CallbackContext, type index$4_EnhancedRunner as EnhancedRunner, type index$4_FullMessage as FullMessage, type index$4_InstructionProvider as InstructionProvider, index$4_InvocationContext as InvocationContext, index$4_LangGraphAgent as LangGraphAgent, type index$4_LangGraphAgentConfig as LangGraphAgentConfig, type index$4_LangGraphNode as LangGraphNode, index$4_LlmAgent as LlmAgent, type index$4_LlmAgentConfig as LlmAgentConfig, index$4_LlmCallsLimitExceededError as LlmCallsLimitExceededError, index$4_LoopAgent as LoopAgent, type index$4_LoopAgentConfig as LoopAgentConfig, type index$4_MessagePart as MessagePart, index$4_ParallelAgent as ParallelAgent, type index$4_ParallelAgentConfig as ParallelAgentConfig, index$4_ReadonlyContext as ReadonlyContext, index$4_RunConfig as RunConfig, index$4_SequentialAgent as SequentialAgent, type index$4_SequentialAgentConfig as SequentialAgentConfig, type index$4_SessionOptions as SessionOptions, type index$4_SingleAgentCallback as SingleAgentCallback, index$4_StreamingMode as StreamingMode, type index$4_ToolUnion as ToolUnion, index$4_createBranchContextForSubAgent as createBranchContextForSubAgent, index$4_mergeAgentRun as mergeAgentRun, index$4_newInvocationContextId as newInvocationContextId };
4153
4169
  }
4154
4170
 
4155
4171
  /**
@@ -5091,4 +5107,4 @@ declare const traceLlmCall: (invocationContext: InvocationContext, eventId: stri
5091
5107
 
5092
5108
  declare const VERSION = "0.1.0";
5093
5109
 
5094
- export { AF_FUNCTION_CALL_ID_PREFIX, type AfterAgentCallback, LlmAgent as Agent, AgentBuilder, type AgentBuilderConfig, type AgentType, index$4 as Agents, AiSdkLlm, AnthropicLlm, ApiKeyCredential, ApiKeyScheme, AuthConfig, AuthCredential, AuthCredentialType, AuthHandler, AuthScheme, AuthSchemeType, AuthTool, type AuthToolArguments, AutoFlow, BaseAgent, BaseCodeExecutor, type BaseCodeExecutorConfig, BaseLLMConnection, BaseLlm, BaseLlmFlow, BaseLlmRequestProcessor, BaseLlmResponseProcessor, type BaseMemoryService, BasePlanner, BaseSessionService, BaseTool, BasicAuthCredential, BearerTokenCredential, type BeforeAgentCallback, type BuildFunctionDeclarationOptions, type BuiltAgent, BuiltInCodeExecutor, BuiltInPlanner, CallbackContext, type CodeExecutionInput, type CodeExecutionResult, CodeExecutionUtils, CodeExecutorContext, type CreateToolConfig, type CreateToolConfigWithSchema, type CreateToolConfigWithoutSchema, DatabaseSessionService, EnhancedAuthConfig, type EnhancedRunner, Event, EventActions, index$1 as Events, ExitLoopTool, type File, FileOperationsTool, index as Flows, type FullMessage, type FunctionDeclaration, FunctionTool, GcsArtifactService, type GetSessionConfig, GetUserChoiceTool, GoogleLlm, GoogleSearch, HttpRequestTool, HttpScheme, InMemoryArtifactService, InMemoryMemoryService, InMemoryRunner, InMemorySessionService, type InstructionProvider, InvocationContext, type JSONSchema, LLMRegistry, LangGraphAgent, type LangGraphAgentConfig, type LangGraphNode, type ListSessionsResponse, LlmAgent, type LlmAgentConfig, LlmCallsLimitExceededError, LlmRequest, LlmResponse, LoadArtifactsTool, LoadMemoryTool, LoopAgent, type LoopAgentConfig, McpAbi, McpAtp, McpBamm, McpCoinGecko, type McpConfig, McpDiscord, McpError, McpErrorType, McpFilesystem, McpFraxlend, McpGeneric, McpIqWiki, McpMemory, McpNearAgent, McpNearIntentSwaps, McpOdos, McpSamplingHandler, type McpSamplingRequest, type McpSamplingResponse, type McpServerConfig, McpTelegram, McpToolset, type McpTransportType, index$3 as Memory, type MessagePart, index$5 as Models, OAuth2Credential, OAuth2Scheme, type OAuthFlow, type OAuthFlows, OpenAiLlm, OpenIdConnectScheme, ParallelAgent, type ParallelAgentConfig, PlanReActPlanner, REQUEST_EUC_FUNCTION_CALL_NAME, ReadonlyContext, RunConfig, Runner, type SamplingHandler, type SearchMemoryResponse, SequentialAgent, type SequentialAgentConfig, type Session, type SessionConfig, index$2 as Sessions, type SingleAgentCallback, SingleFlow, State, StreamingMode, type TelemetryConfig, TelemetryService, type ThinkingConfig, type ToolConfig, ToolContext, type ToolUnion, index$6 as Tools, TransferToAgentTool, UserInteractionTool, VERSION, VertexAiSessionService, _findFunctionCallEventIfLastEventIsFunctionResponse, adkToMcpToolType, requestProcessor$2 as agentTransferRequestProcessor, requestProcessor$6 as basicRequestProcessor, buildFunctionDeclaration, requestProcessor as codeExecutionRequestProcessor, responseProcessor as codeExecutionResponseProcessor, requestProcessor$3 as contentRequestProcessor, createAuthToolArguments, createBranchContextForSubAgent, createDatabaseSessionService, createFunctionTool, createMysqlSessionService, createPostgresSessionService, createSamplingHandler, createSqliteSessionService, createTool, generateAuthEvent, generateClientFunctionCallId, getLongRunningFunctionCalls, getMcpTools, handleFunctionCallsAsync, handleFunctionCallsLive, requestProcessor$5 as identityRequestProcessor, initializeTelemetry, injectSessionState, requestProcessor$4 as instructionsRequestProcessor, isEnhancedAuthConfig, jsonSchemaToDeclaration, mcpSchemaToParameters, mergeAgentRun, mergeParallelFunctionResponseEvents, newInvocationContextId, requestProcessor$1 as nlPlanningRequestProcessor, responseProcessor$1 as nlPlanningResponseProcessor, normalizeJsonSchema, populateClientFunctionCallId, registerProviders, removeClientFunctionCallId, requestProcessor$7 as requestProcessor, shutdownTelemetry, telemetryService, traceLlmCall, traceToolCall, tracer };
5110
+ export { AF_FUNCTION_CALL_ID_PREFIX, type AfterAgentCallback, LlmAgent as Agent, AgentBuilder, type AgentBuilderConfig, type AgentType, index$4 as Agents, AiSdkLlm, AnthropicLlm, ApiKeyCredential, ApiKeyScheme, AuthConfig, AuthCredential, AuthCredentialType, AuthHandler, AuthScheme, AuthSchemeType, AuthTool, type AuthToolArguments, AutoFlow, BaseAgent, BaseCodeExecutor, type BaseCodeExecutorConfig, BaseLLMConnection, BaseLlm, BaseLlmFlow, BaseLlmRequestProcessor, BaseLlmResponseProcessor, type BaseMemoryService, BasePlanner, BaseSessionService, BaseTool, BasicAuthCredential, BearerTokenCredential, type BeforeAgentCallback, type BuildFunctionDeclarationOptions, type BuiltAgent, BuiltInCodeExecutor, BuiltInPlanner, CallbackContext, type CodeExecutionInput, type CodeExecutionResult, CodeExecutionUtils, CodeExecutorContext, type CreateToolConfig, type CreateToolConfigWithSchema, type CreateToolConfigWithoutSchema, DatabaseSessionService, EnhancedAuthConfig, type EnhancedRunner, Event, EventActions, index$1 as Events, ExitLoopTool, type File, FileOperationsTool, index as Flows, type FullMessage, type FunctionDeclaration, FunctionTool, GcsArtifactService, type GetSessionConfig, GetUserChoiceTool, GoogleLlm, GoogleSearch, HttpRequestTool, HttpScheme, InMemoryArtifactService, InMemoryMemoryService, InMemoryRunner, InMemorySessionService, type InstructionProvider, InvocationContext, type JSONSchema, LLMRegistry, LangGraphAgent, type LangGraphAgentConfig, type LangGraphNode, type ListSessionsResponse, LlmAgent, type LlmAgentConfig, LlmCallsLimitExceededError, LlmRequest, LlmResponse, LoadArtifactsTool, LoadMemoryTool, LoopAgent, type LoopAgentConfig, McpAbi, McpAtp, McpBamm, McpCoinGecko, type McpConfig, McpDiscord, McpError, McpErrorType, McpFilesystem, McpFraxlend, McpGeneric, McpIqWiki, McpMemory, McpNearAgent, McpNearIntentSwaps, McpOdos, McpSamplingHandler, type McpSamplingRequest, type McpSamplingResponse, type McpServerConfig, McpTelegram, McpToolset, type McpTransportType, index$3 as Memory, type MessagePart, index$5 as Models, OAuth2Credential, OAuth2Scheme, type OAuthFlow, type OAuthFlows, OpenAiLlm, OpenIdConnectScheme, ParallelAgent, type ParallelAgentConfig, PlanReActPlanner, REQUEST_EUC_FUNCTION_CALL_NAME, ReadonlyContext, RunConfig, Runner, type SamplingHandler, type SearchMemoryResponse, SequentialAgent, type SequentialAgentConfig, type Session, type SessionOptions, index$2 as Sessions, type SingleAgentCallback, SingleFlow, State, StreamingMode, type TelemetryConfig, TelemetryService, type ThinkingConfig, type ToolConfig, ToolContext, type ToolUnion, index$6 as Tools, TransferToAgentTool, UserInteractionTool, VERSION, VertexAiSessionService, _findFunctionCallEventIfLastEventIsFunctionResponse, adkToMcpToolType, requestProcessor$2 as agentTransferRequestProcessor, requestProcessor$6 as basicRequestProcessor, buildFunctionDeclaration, requestProcessor as codeExecutionRequestProcessor, responseProcessor as codeExecutionResponseProcessor, requestProcessor$3 as contentRequestProcessor, createAuthToolArguments, createBranchContextForSubAgent, createDatabaseSessionService, createFunctionTool, createMysqlSessionService, createPostgresSessionService, createSamplingHandler, createSqliteSessionService, createTool, generateAuthEvent, generateClientFunctionCallId, getLongRunningFunctionCalls, getMcpTools, handleFunctionCallsAsync, handleFunctionCallsLive, requestProcessor$5 as identityRequestProcessor, initializeTelemetry, injectSessionState, requestProcessor$4 as instructionsRequestProcessor, isEnhancedAuthConfig, jsonSchemaToDeclaration, mcpSchemaToParameters, mergeAgentRun, mergeParallelFunctionResponseEvents, newInvocationContextId, requestProcessor$1 as nlPlanningRequestProcessor, responseProcessor$1 as nlPlanningResponseProcessor, normalizeJsonSchema, populateClientFunctionCallId, registerProviders, removeClientFunctionCallId, requestProcessor$7 as requestProcessor, shutdownTelemetry, telemetryService, traceLlmCall, traceToolCall, tracer };
package/dist/index.d.ts CHANGED
@@ -3901,14 +3901,11 @@ interface AgentBuilderConfig {
3901
3901
  rootNode?: string;
3902
3902
  }
3903
3903
  /**
3904
- * Session configuration for the AgentBuilder
3904
+ * Session configuration options
3905
3905
  */
3906
- interface SessionConfig {
3907
- service: BaseSessionService;
3908
- userId: string;
3909
- appName: string;
3910
- memoryService?: BaseMemoryService;
3911
- artifactService?: BaseArtifactService;
3906
+ interface SessionOptions {
3907
+ userId?: string;
3908
+ appName?: string;
3912
3909
  }
3913
3910
  /**
3914
3911
  * Message part interface for flexible message input
@@ -3965,6 +3962,15 @@ type AgentType = "llm" | "sequential" | "parallel" | "loop" | "langgraph";
3965
3962
  * .withInstruction("You are a research assistant")
3966
3963
  * .build();
3967
3964
  *
3965
+ * // With memory and artifact services
3966
+ * const { runner } = await AgentBuilder
3967
+ * .create("persistent-agent")
3968
+ * .withModel("gemini-2.5-flash")
3969
+ * .withMemory(new RedisMemoryService())
3970
+ * .withArtifactService(new S3ArtifactService())
3971
+ * .withSession(new DatabaseSessionService(), { userId: "user123", appName: "myapp" })
3972
+ * .build();
3973
+ *
3968
3974
  * // Multi-agent workflow
3969
3975
  * const { runner } = await AgentBuilder
3970
3976
  * .create("workflow")
@@ -3975,6 +3981,8 @@ type AgentType = "llm" | "sequential" | "parallel" | "loop" | "langgraph";
3975
3981
  declare class AgentBuilder {
3976
3982
  private config;
3977
3983
  private sessionConfig?;
3984
+ private memoryService?;
3985
+ private artifactService?;
3978
3986
  private agentType;
3979
3987
  /**
3980
3988
  * Private constructor - use static create() method
@@ -4051,21 +4059,29 @@ declare class AgentBuilder {
4051
4059
  /**
4052
4060
  * Configure session management with optional smart defaults
4053
4061
  * @param service Session service to use
4054
- * @param userId User identifier (optional, defaults to agent-based ID)
4055
- * @param appName Application name (optional, defaults to agent-based name)
4056
- * @param memoryService Optional memory service
4057
- * @param artifactService Optional artifact service
4062
+ * @param options Session configuration options (userId and appName)
4063
+ * @returns This builder instance for chaining
4064
+ */
4065
+ withSession(service: BaseSessionService, options?: SessionOptions): this;
4066
+ /**
4067
+ * Configure memory service for the agent
4068
+ * @param memoryService Memory service to use for conversation history and context
4069
+ * @returns This builder instance for chaining
4070
+ */
4071
+ withMemory(memoryService: BaseMemoryService): this;
4072
+ /**
4073
+ * Configure artifact service for the agent
4074
+ * @param artifactService Artifact service to use for managing generated artifacts
4058
4075
  * @returns This builder instance for chaining
4059
4076
  */
4060
- withSession(service: BaseSessionService, userId?: string, appName?: string, memoryService?: BaseMemoryService, artifactService?: BaseArtifactService): this;
4077
+ withArtifactService(artifactService: BaseArtifactService): this;
4061
4078
  /**
4062
4079
  * Configure with an in-memory session with custom IDs
4063
4080
  * Note: In-memory sessions are created automatically by default, use this only if you need custom appName/userId
4064
- * @param appName Application name (optional, defaults to agent-based name)
4065
- * @param userId User identifier (optional, defaults to agent-based ID)
4081
+ * @param options Session configuration options (userId and appName)
4066
4082
  * @returns This builder instance for chaining
4067
4083
  */
4068
- withQuickSession(appName?: string, userId?: string): this;
4084
+ withQuickSession(options?: SessionOptions): this;
4069
4085
  /**
4070
4086
  * Build the agent and optionally create runner and session
4071
4087
  * @returns Built agent with optional runner and session
@@ -4140,7 +4156,7 @@ declare const index$4_RunConfig: typeof RunConfig;
4140
4156
  type index$4_SequentialAgent = SequentialAgent;
4141
4157
  declare const index$4_SequentialAgent: typeof SequentialAgent;
4142
4158
  type index$4_SequentialAgentConfig = SequentialAgentConfig;
4143
- type index$4_SessionConfig = SessionConfig;
4159
+ type index$4_SessionOptions = SessionOptions;
4144
4160
  type index$4_SingleAgentCallback = SingleAgentCallback;
4145
4161
  type index$4_StreamingMode = StreamingMode;
4146
4162
  declare const index$4_StreamingMode: typeof StreamingMode;
@@ -4149,7 +4165,7 @@ declare const index$4_createBranchContextForSubAgent: typeof createBranchContext
4149
4165
  declare const index$4_mergeAgentRun: typeof mergeAgentRun;
4150
4166
  declare const index$4_newInvocationContextId: typeof newInvocationContextId;
4151
4167
  declare namespace index$4 {
4152
- export { type index$4_AfterAgentCallback as AfterAgentCallback, LlmAgent as Agent, index$4_AgentBuilder as AgentBuilder, type index$4_AgentBuilderConfig as AgentBuilderConfig, type index$4_AgentType as AgentType, index$4_BaseAgent as BaseAgent, type index$4_BeforeAgentCallback as BeforeAgentCallback, type index$4_BuiltAgent as BuiltAgent, index$4_CallbackContext as CallbackContext, type index$4_EnhancedRunner as EnhancedRunner, type index$4_FullMessage as FullMessage, type index$4_InstructionProvider as InstructionProvider, index$4_InvocationContext as InvocationContext, index$4_LangGraphAgent as LangGraphAgent, type index$4_LangGraphAgentConfig as LangGraphAgentConfig, type index$4_LangGraphNode as LangGraphNode, index$4_LlmAgent as LlmAgent, type index$4_LlmAgentConfig as LlmAgentConfig, index$4_LlmCallsLimitExceededError as LlmCallsLimitExceededError, index$4_LoopAgent as LoopAgent, type index$4_LoopAgentConfig as LoopAgentConfig, type index$4_MessagePart as MessagePart, index$4_ParallelAgent as ParallelAgent, type index$4_ParallelAgentConfig as ParallelAgentConfig, index$4_ReadonlyContext as ReadonlyContext, index$4_RunConfig as RunConfig, index$4_SequentialAgent as SequentialAgent, type index$4_SequentialAgentConfig as SequentialAgentConfig, type index$4_SessionConfig as SessionConfig, type index$4_SingleAgentCallback as SingleAgentCallback, index$4_StreamingMode as StreamingMode, type index$4_ToolUnion as ToolUnion, index$4_createBranchContextForSubAgent as createBranchContextForSubAgent, index$4_mergeAgentRun as mergeAgentRun, index$4_newInvocationContextId as newInvocationContextId };
4168
+ export { type index$4_AfterAgentCallback as AfterAgentCallback, LlmAgent as Agent, index$4_AgentBuilder as AgentBuilder, type index$4_AgentBuilderConfig as AgentBuilderConfig, type index$4_AgentType as AgentType, index$4_BaseAgent as BaseAgent, type index$4_BeforeAgentCallback as BeforeAgentCallback, type index$4_BuiltAgent as BuiltAgent, index$4_CallbackContext as CallbackContext, type index$4_EnhancedRunner as EnhancedRunner, type index$4_FullMessage as FullMessage, type index$4_InstructionProvider as InstructionProvider, index$4_InvocationContext as InvocationContext, index$4_LangGraphAgent as LangGraphAgent, type index$4_LangGraphAgentConfig as LangGraphAgentConfig, type index$4_LangGraphNode as LangGraphNode, index$4_LlmAgent as LlmAgent, type index$4_LlmAgentConfig as LlmAgentConfig, index$4_LlmCallsLimitExceededError as LlmCallsLimitExceededError, index$4_LoopAgent as LoopAgent, type index$4_LoopAgentConfig as LoopAgentConfig, type index$4_MessagePart as MessagePart, index$4_ParallelAgent as ParallelAgent, type index$4_ParallelAgentConfig as ParallelAgentConfig, index$4_ReadonlyContext as ReadonlyContext, index$4_RunConfig as RunConfig, index$4_SequentialAgent as SequentialAgent, type index$4_SequentialAgentConfig as SequentialAgentConfig, type index$4_SessionOptions as SessionOptions, type index$4_SingleAgentCallback as SingleAgentCallback, index$4_StreamingMode as StreamingMode, type index$4_ToolUnion as ToolUnion, index$4_createBranchContextForSubAgent as createBranchContextForSubAgent, index$4_mergeAgentRun as mergeAgentRun, index$4_newInvocationContextId as newInvocationContextId };
4153
4169
  }
4154
4170
 
4155
4171
  /**
@@ -5091,4 +5107,4 @@ declare const traceLlmCall: (invocationContext: InvocationContext, eventId: stri
5091
5107
 
5092
5108
  declare const VERSION = "0.1.0";
5093
5109
 
5094
- export { AF_FUNCTION_CALL_ID_PREFIX, type AfterAgentCallback, LlmAgent as Agent, AgentBuilder, type AgentBuilderConfig, type AgentType, index$4 as Agents, AiSdkLlm, AnthropicLlm, ApiKeyCredential, ApiKeyScheme, AuthConfig, AuthCredential, AuthCredentialType, AuthHandler, AuthScheme, AuthSchemeType, AuthTool, type AuthToolArguments, AutoFlow, BaseAgent, BaseCodeExecutor, type BaseCodeExecutorConfig, BaseLLMConnection, BaseLlm, BaseLlmFlow, BaseLlmRequestProcessor, BaseLlmResponseProcessor, type BaseMemoryService, BasePlanner, BaseSessionService, BaseTool, BasicAuthCredential, BearerTokenCredential, type BeforeAgentCallback, type BuildFunctionDeclarationOptions, type BuiltAgent, BuiltInCodeExecutor, BuiltInPlanner, CallbackContext, type CodeExecutionInput, type CodeExecutionResult, CodeExecutionUtils, CodeExecutorContext, type CreateToolConfig, type CreateToolConfigWithSchema, type CreateToolConfigWithoutSchema, DatabaseSessionService, EnhancedAuthConfig, type EnhancedRunner, Event, EventActions, index$1 as Events, ExitLoopTool, type File, FileOperationsTool, index as Flows, type FullMessage, type FunctionDeclaration, FunctionTool, GcsArtifactService, type GetSessionConfig, GetUserChoiceTool, GoogleLlm, GoogleSearch, HttpRequestTool, HttpScheme, InMemoryArtifactService, InMemoryMemoryService, InMemoryRunner, InMemorySessionService, type InstructionProvider, InvocationContext, type JSONSchema, LLMRegistry, LangGraphAgent, type LangGraphAgentConfig, type LangGraphNode, type ListSessionsResponse, LlmAgent, type LlmAgentConfig, LlmCallsLimitExceededError, LlmRequest, LlmResponse, LoadArtifactsTool, LoadMemoryTool, LoopAgent, type LoopAgentConfig, McpAbi, McpAtp, McpBamm, McpCoinGecko, type McpConfig, McpDiscord, McpError, McpErrorType, McpFilesystem, McpFraxlend, McpGeneric, McpIqWiki, McpMemory, McpNearAgent, McpNearIntentSwaps, McpOdos, McpSamplingHandler, type McpSamplingRequest, type McpSamplingResponse, type McpServerConfig, McpTelegram, McpToolset, type McpTransportType, index$3 as Memory, type MessagePart, index$5 as Models, OAuth2Credential, OAuth2Scheme, type OAuthFlow, type OAuthFlows, OpenAiLlm, OpenIdConnectScheme, ParallelAgent, type ParallelAgentConfig, PlanReActPlanner, REQUEST_EUC_FUNCTION_CALL_NAME, ReadonlyContext, RunConfig, Runner, type SamplingHandler, type SearchMemoryResponse, SequentialAgent, type SequentialAgentConfig, type Session, type SessionConfig, index$2 as Sessions, type SingleAgentCallback, SingleFlow, State, StreamingMode, type TelemetryConfig, TelemetryService, type ThinkingConfig, type ToolConfig, ToolContext, type ToolUnion, index$6 as Tools, TransferToAgentTool, UserInteractionTool, VERSION, VertexAiSessionService, _findFunctionCallEventIfLastEventIsFunctionResponse, adkToMcpToolType, requestProcessor$2 as agentTransferRequestProcessor, requestProcessor$6 as basicRequestProcessor, buildFunctionDeclaration, requestProcessor as codeExecutionRequestProcessor, responseProcessor as codeExecutionResponseProcessor, requestProcessor$3 as contentRequestProcessor, createAuthToolArguments, createBranchContextForSubAgent, createDatabaseSessionService, createFunctionTool, createMysqlSessionService, createPostgresSessionService, createSamplingHandler, createSqliteSessionService, createTool, generateAuthEvent, generateClientFunctionCallId, getLongRunningFunctionCalls, getMcpTools, handleFunctionCallsAsync, handleFunctionCallsLive, requestProcessor$5 as identityRequestProcessor, initializeTelemetry, injectSessionState, requestProcessor$4 as instructionsRequestProcessor, isEnhancedAuthConfig, jsonSchemaToDeclaration, mcpSchemaToParameters, mergeAgentRun, mergeParallelFunctionResponseEvents, newInvocationContextId, requestProcessor$1 as nlPlanningRequestProcessor, responseProcessor$1 as nlPlanningResponseProcessor, normalizeJsonSchema, populateClientFunctionCallId, registerProviders, removeClientFunctionCallId, requestProcessor$7 as requestProcessor, shutdownTelemetry, telemetryService, traceLlmCall, traceToolCall, tracer };
5110
+ export { AF_FUNCTION_CALL_ID_PREFIX, type AfterAgentCallback, LlmAgent as Agent, AgentBuilder, type AgentBuilderConfig, type AgentType, index$4 as Agents, AiSdkLlm, AnthropicLlm, ApiKeyCredential, ApiKeyScheme, AuthConfig, AuthCredential, AuthCredentialType, AuthHandler, AuthScheme, AuthSchemeType, AuthTool, type AuthToolArguments, AutoFlow, BaseAgent, BaseCodeExecutor, type BaseCodeExecutorConfig, BaseLLMConnection, BaseLlm, BaseLlmFlow, BaseLlmRequestProcessor, BaseLlmResponseProcessor, type BaseMemoryService, BasePlanner, BaseSessionService, BaseTool, BasicAuthCredential, BearerTokenCredential, type BeforeAgentCallback, type BuildFunctionDeclarationOptions, type BuiltAgent, BuiltInCodeExecutor, BuiltInPlanner, CallbackContext, type CodeExecutionInput, type CodeExecutionResult, CodeExecutionUtils, CodeExecutorContext, type CreateToolConfig, type CreateToolConfigWithSchema, type CreateToolConfigWithoutSchema, DatabaseSessionService, EnhancedAuthConfig, type EnhancedRunner, Event, EventActions, index$1 as Events, ExitLoopTool, type File, FileOperationsTool, index as Flows, type FullMessage, type FunctionDeclaration, FunctionTool, GcsArtifactService, type GetSessionConfig, GetUserChoiceTool, GoogleLlm, GoogleSearch, HttpRequestTool, HttpScheme, InMemoryArtifactService, InMemoryMemoryService, InMemoryRunner, InMemorySessionService, type InstructionProvider, InvocationContext, type JSONSchema, LLMRegistry, LangGraphAgent, type LangGraphAgentConfig, type LangGraphNode, type ListSessionsResponse, LlmAgent, type LlmAgentConfig, LlmCallsLimitExceededError, LlmRequest, LlmResponse, LoadArtifactsTool, LoadMemoryTool, LoopAgent, type LoopAgentConfig, McpAbi, McpAtp, McpBamm, McpCoinGecko, type McpConfig, McpDiscord, McpError, McpErrorType, McpFilesystem, McpFraxlend, McpGeneric, McpIqWiki, McpMemory, McpNearAgent, McpNearIntentSwaps, McpOdos, McpSamplingHandler, type McpSamplingRequest, type McpSamplingResponse, type McpServerConfig, McpTelegram, McpToolset, type McpTransportType, index$3 as Memory, type MessagePart, index$5 as Models, OAuth2Credential, OAuth2Scheme, type OAuthFlow, type OAuthFlows, OpenAiLlm, OpenIdConnectScheme, ParallelAgent, type ParallelAgentConfig, PlanReActPlanner, REQUEST_EUC_FUNCTION_CALL_NAME, ReadonlyContext, RunConfig, Runner, type SamplingHandler, type SearchMemoryResponse, SequentialAgent, type SequentialAgentConfig, type Session, type SessionOptions, index$2 as Sessions, type SingleAgentCallback, SingleFlow, State, StreamingMode, type TelemetryConfig, TelemetryService, type ThinkingConfig, type ToolConfig, ToolContext, type ToolUnion, index$6 as Tools, TransferToAgentTool, UserInteractionTool, VERSION, VertexAiSessionService, _findFunctionCallEventIfLastEventIsFunctionResponse, adkToMcpToolType, requestProcessor$2 as agentTransferRequestProcessor, requestProcessor$6 as basicRequestProcessor, buildFunctionDeclaration, requestProcessor as codeExecutionRequestProcessor, responseProcessor as codeExecutionResponseProcessor, requestProcessor$3 as contentRequestProcessor, createAuthToolArguments, createBranchContextForSubAgent, createDatabaseSessionService, createFunctionTool, createMysqlSessionService, createPostgresSessionService, createSamplingHandler, createSqliteSessionService, createTool, generateAuthEvent, generateClientFunctionCallId, getLongRunningFunctionCalls, getMcpTools, handleFunctionCallsAsync, handleFunctionCallsLive, requestProcessor$5 as identityRequestProcessor, initializeTelemetry, injectSessionState, requestProcessor$4 as instructionsRequestProcessor, isEnhancedAuthConfig, jsonSchemaToDeclaration, mcpSchemaToParameters, mergeAgentRun, mergeParallelFunctionResponseEvents, newInvocationContextId, requestProcessor$1 as nlPlanningRequestProcessor, responseProcessor$1 as nlPlanningResponseProcessor, normalizeJsonSchema, populateClientFunctionCallId, registerProviders, removeClientFunctionCallId, requestProcessor$7 as requestProcessor, shutdownTelemetry, telemetryService, traceLlmCall, traceToolCall, tracer };
package/dist/index.js CHANGED
@@ -9886,6 +9886,8 @@ var InMemoryRunner = class extends Runner {
9886
9886
  var AgentBuilder = (_class31 = class _AgentBuilder {
9887
9887
 
9888
9888
 
9889
+
9890
+
9889
9891
  __init54() {this.agentType = "llm"}
9890
9892
  /**
9891
9893
  * Private constructor - use static create() method
@@ -10001,31 +10003,43 @@ var AgentBuilder = (_class31 = class _AgentBuilder {
10001
10003
  /**
10002
10004
  * Configure session management with optional smart defaults
10003
10005
  * @param service Session service to use
10004
- * @param userId User identifier (optional, defaults to agent-based ID)
10005
- * @param appName Application name (optional, defaults to agent-based name)
10006
- * @param memoryService Optional memory service
10007
- * @param artifactService Optional artifact service
10006
+ * @param options Session configuration options (userId and appName)
10008
10007
  * @returns This builder instance for chaining
10009
10008
  */
10010
- withSession(service, userId, appName, memoryService, artifactService) {
10009
+ withSession(service, options = {}) {
10011
10010
  this.sessionConfig = {
10012
10011
  service,
10013
- userId: userId || this.generateDefaultUserId(),
10014
- appName: appName || this.generateDefaultAppName(),
10015
- memoryService,
10016
- artifactService
10012
+ userId: options.userId || this.generateDefaultUserId(),
10013
+ appName: options.appName || this.generateDefaultAppName()
10017
10014
  };
10018
10015
  return this;
10019
10016
  }
10017
+ /**
10018
+ * Configure memory service for the agent
10019
+ * @param memoryService Memory service to use for conversation history and context
10020
+ * @returns This builder instance for chaining
10021
+ */
10022
+ withMemory(memoryService) {
10023
+ this.memoryService = memoryService;
10024
+ return this;
10025
+ }
10026
+ /**
10027
+ * Configure artifact service for the agent
10028
+ * @param artifactService Artifact service to use for managing generated artifacts
10029
+ * @returns This builder instance for chaining
10030
+ */
10031
+ withArtifactService(artifactService) {
10032
+ this.artifactService = artifactService;
10033
+ return this;
10034
+ }
10020
10035
  /**
10021
10036
  * Configure with an in-memory session with custom IDs
10022
10037
  * Note: In-memory sessions are created automatically by default, use this only if you need custom appName/userId
10023
- * @param appName Application name (optional, defaults to agent-based name)
10024
- * @param userId User identifier (optional, defaults to agent-based ID)
10038
+ * @param options Session configuration options (userId and appName)
10025
10039
  * @returns This builder instance for chaining
10026
10040
  */
10027
- withQuickSession(appName, userId) {
10028
- return this.withSession(new InMemorySessionService(), userId, appName);
10041
+ withQuickSession(options = {}) {
10042
+ return this.withSession(new InMemorySessionService(), options);
10029
10043
  }
10030
10044
  /**
10031
10045
  * Build the agent and optionally create runner and session
@@ -10047,8 +10061,8 @@ var AgentBuilder = (_class31 = class _AgentBuilder {
10047
10061
  appName: this.sessionConfig.appName,
10048
10062
  agent,
10049
10063
  sessionService: this.sessionConfig.service,
10050
- memoryService: this.sessionConfig.memoryService,
10051
- artifactService: this.sessionConfig.artifactService
10064
+ memoryService: this.memoryService,
10065
+ artifactService: this.artifactService
10052
10066
  };
10053
10067
  const baseRunner = new Runner(runnerConfig);
10054
10068
  runner = this.createEnhancedRunner(baseRunner, session);
package/dist/index.mjs CHANGED
@@ -9886,6 +9886,8 @@ var InMemoryRunner = class extends Runner {
9886
9886
  var AgentBuilder = class _AgentBuilder {
9887
9887
  config;
9888
9888
  sessionConfig;
9889
+ memoryService;
9890
+ artifactService;
9889
9891
  agentType = "llm";
9890
9892
  /**
9891
9893
  * Private constructor - use static create() method
@@ -10001,31 +10003,43 @@ var AgentBuilder = class _AgentBuilder {
10001
10003
  /**
10002
10004
  * Configure session management with optional smart defaults
10003
10005
  * @param service Session service to use
10004
- * @param userId User identifier (optional, defaults to agent-based ID)
10005
- * @param appName Application name (optional, defaults to agent-based name)
10006
- * @param memoryService Optional memory service
10007
- * @param artifactService Optional artifact service
10006
+ * @param options Session configuration options (userId and appName)
10008
10007
  * @returns This builder instance for chaining
10009
10008
  */
10010
- withSession(service, userId, appName, memoryService, artifactService) {
10009
+ withSession(service, options = {}) {
10011
10010
  this.sessionConfig = {
10012
10011
  service,
10013
- userId: userId || this.generateDefaultUserId(),
10014
- appName: appName || this.generateDefaultAppName(),
10015
- memoryService,
10016
- artifactService
10012
+ userId: options.userId || this.generateDefaultUserId(),
10013
+ appName: options.appName || this.generateDefaultAppName()
10017
10014
  };
10018
10015
  return this;
10019
10016
  }
10017
+ /**
10018
+ * Configure memory service for the agent
10019
+ * @param memoryService Memory service to use for conversation history and context
10020
+ * @returns This builder instance for chaining
10021
+ */
10022
+ withMemory(memoryService) {
10023
+ this.memoryService = memoryService;
10024
+ return this;
10025
+ }
10026
+ /**
10027
+ * Configure artifact service for the agent
10028
+ * @param artifactService Artifact service to use for managing generated artifacts
10029
+ * @returns This builder instance for chaining
10030
+ */
10031
+ withArtifactService(artifactService) {
10032
+ this.artifactService = artifactService;
10033
+ return this;
10034
+ }
10020
10035
  /**
10021
10036
  * Configure with an in-memory session with custom IDs
10022
10037
  * Note: In-memory sessions are created automatically by default, use this only if you need custom appName/userId
10023
- * @param appName Application name (optional, defaults to agent-based name)
10024
- * @param userId User identifier (optional, defaults to agent-based ID)
10038
+ * @param options Session configuration options (userId and appName)
10025
10039
  * @returns This builder instance for chaining
10026
10040
  */
10027
- withQuickSession(appName, userId) {
10028
- return this.withSession(new InMemorySessionService(), userId, appName);
10041
+ withQuickSession(options = {}) {
10042
+ return this.withSession(new InMemorySessionService(), options);
10029
10043
  }
10030
10044
  /**
10031
10045
  * Build the agent and optionally create runner and session
@@ -10047,8 +10061,8 @@ var AgentBuilder = class _AgentBuilder {
10047
10061
  appName: this.sessionConfig.appName,
10048
10062
  agent,
10049
10063
  sessionService: this.sessionConfig.service,
10050
- memoryService: this.sessionConfig.memoryService,
10051
- artifactService: this.sessionConfig.artifactService
10064
+ memoryService: this.memoryService,
10065
+ artifactService: this.artifactService
10052
10066
  };
10053
10067
  const baseRunner = new Runner(runnerConfig);
10054
10068
  runner = this.createEnhancedRunner(baseRunner, session);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iqai/adk",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
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",