art-framework 0.4.3 → 0.4.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/dist/index.d.cts CHANGED
@@ -4562,6 +4562,87 @@ declare class OllamaAdapter implements ProviderAdapter {
4562
4562
  shutdown(): Promise<void>;
4563
4563
  }
4564
4564
 
4565
+ /**
4566
+ * Configuration options required for the `GroqAdapter`.
4567
+ */
4568
+ interface GroqAdapterOptions {
4569
+ /** Your Groq API key. Handle securely. */
4570
+ apiKey: string;
4571
+ /** The default Groq model ID to use (e.g., 'llama-3.3-70b-versatile', 'mixtral-8x7b-32768'). */
4572
+ model?: string;
4573
+ /** Optional: Override the base URL for the Groq API. */
4574
+ apiBaseUrl?: string;
4575
+ /** Optional: Default maximum tokens for responses. */
4576
+ defaultMaxTokens?: number;
4577
+ /** Optional: Default temperature for responses. */
4578
+ defaultTemperature?: number;
4579
+ }
4580
+ /**
4581
+ * Implements the `ProviderAdapter` interface for interacting with Groq's
4582
+ * ultra-fast inference API using the official Groq SDK.
4583
+ *
4584
+ * Groq provides an OpenAI-compatible API, making this adapter similar in structure
4585
+ * to the OpenAI adapter but optimized for Groq's specific features and models.
4586
+ *
4587
+ * Handles formatting requests, parsing responses, streaming, and tool use.
4588
+ *
4589
+ * @see {@link ProviderAdapter} for the interface definition.
4590
+ * @see {@link GroqAdapterOptions} for configuration options.
4591
+ */
4592
+ declare class GroqAdapter implements ProviderAdapter {
4593
+ readonly providerName = "groq";
4594
+ private client;
4595
+ private defaultModel;
4596
+ private defaultMaxTokens;
4597
+ private defaultTemperature;
4598
+ /**
4599
+ * Creates an instance of the GroqAdapter.
4600
+ * @param options - Configuration options including the API key and optional model/baseURL/defaults.
4601
+ * @throws {ARTError} If the API key is missing.
4602
+ */
4603
+ constructor(options: GroqAdapterOptions);
4604
+ /**
4605
+ * Sends a request to the Groq Chat Completions API.
4606
+ * Translates `ArtStandardPrompt` to the Groq/OpenAI format and handles streaming and tool use.
4607
+ *
4608
+ * @param {ArtStandardPrompt} prompt - The standardized prompt messages.
4609
+ * @param {CallOptions} options - Call options, including streaming, model parameters, and tools.
4610
+ * @returns {Promise<AsyncIterable<StreamEvent>>} A promise resolving to an AsyncIterable of StreamEvent objects.
4611
+ */
4612
+ call(prompt: ArtStandardPrompt, options: CallOptions): Promise<AsyncIterable<StreamEvent>>;
4613
+ /**
4614
+ * Optional: Method for graceful shutdown
4615
+ */
4616
+ shutdown(): Promise<void>;
4617
+ /**
4618
+ * Translates the provider-agnostic `ArtStandardPrompt` into the Groq/OpenAI message format.
4619
+ *
4620
+ * @private
4621
+ * @param {ArtStandardPrompt} artPrompt - The input `ArtStandardPrompt` array.
4622
+ * @returns {ChatCompletionMessageParam[]} Array of Groq-formatted messages.
4623
+ * @throws {ARTError} If translation encounters an issue.
4624
+ */
4625
+ private translateToGroq;
4626
+ /**
4627
+ * Maps a single `ArtStandardMessage` to Groq/OpenAI message format.
4628
+ *
4629
+ * @private
4630
+ * @param {ArtStandardMessage} artMsg - The ART standard message to map.
4631
+ * @returns {ChatCompletionMessageParam | null} The translated message, or null if should be skipped.
4632
+ * @throws {ARTError} If tool call arguments are not valid JSON.
4633
+ */
4634
+ private mapArtMessageToGroq;
4635
+ /**
4636
+ * Translates an array of `ToolSchema` from the ART framework format to Groq's tool format.
4637
+ *
4638
+ * @private
4639
+ * @param {ToolSchema[]} artTools - An array of ART tool schemas.
4640
+ * @returns {ChatCompletionTool[]} An array of tools formatted for the Groq API.
4641
+ * @throws {ARTError} If a tool's `inputSchema` is invalid.
4642
+ */
4643
+ private translateArtToolsToGroq;
4644
+ }
4645
+
4565
4646
  /**
4566
4647
  * An ART Framework tool that safely evaluates mathematical expressions using the mathjs library.
4567
4648
  * It supports basic arithmetic, variables via a scope, complex numbers, and a predefined list of safe functions.
@@ -5265,6 +5346,6 @@ declare const generateUUID: () => string;
5265
5346
  /**
5266
5347
  * The current version of the ART Framework package.
5267
5348
  */
5268
- declare const VERSION = "0.3.8";
5349
+ declare const VERSION = "0.4.5";
5269
5350
 
5270
- export { type A2AAgentInfo, type A2ATask, type A2ATaskEvent, type A2ATaskFilter, type A2ATaskMetadata, A2ATaskPriority, type A2ATaskResult, A2ATaskSocket, A2ATaskStatus, ARTError, AdapterInstantiationError, type AgentDiscoveryConfig, AgentDiscoveryService, AgentFactory, type AgentFinalResponse, type AgentOptions, type AgentPersona, type AgentProps, type AgentState, AnthropicAdapter, type AnthropicAdapterOptions, ApiKeyStrategy, ApiQueueTimeoutError, type ArtInstance, type ArtInstanceConfig, type ArtStandardMessage, type ArtStandardMessageRole, ArtStandardMessageSchema, type ArtStandardPrompt, ArtStandardPromptSchema, AuthManager, type AvailableProviderEntry, CalculatorTool, type CallOptions, type ConversationManager, type ConversationMessage, ConversationSocket, type CreateA2ATaskRequest, DeepSeekAdapter, type DeepSeekAdapterOptions, ErrorCode, type ExecutionContext, type ExecutionMetadata, type ExecutionOutput, type FilterOptions, type FormattedPrompt, GeminiAdapter, type GeminiAdapterOptions, GenericOAuthStrategy, type IA2ATaskRepository, type IAgentCore, type IAuthStrategy, type IConversationRepository, type IObservationRepository, type IProviderManager, type IStateRepository, type IToolExecutor, type ITypedSocket, InMemoryStorageAdapter, IndexedDBStorageAdapter, type JsonObjectSchema, type JsonSchema, type LLMMetadata, LLMStreamSocket, LocalInstanceBusyError, LocalProviderConflictError, LogLevel, Logger, type LoggerConfig, type ManagedAdapterAccessor, McpClientController, McpManager, type McpManagerConfig, McpProxyTool, type McpResource, type McpResourceTemplate, type McpServerConfig, type McpServerStatus, type McpToolDefinition, type MessageOptions, MessageRole, ModelCapability, type OAuthConfig, type Observation, type ObservationFilter, type ObservationManager, ObservationSocket, ObservationType, OllamaAdapter, type OllamaAdapterOptions, OpenAIAdapter, type OpenAIAdapterOptions, OpenRouterAdapter, type OpenRouterAdapterOptions, type OutputParser, PESAgent, type PESAgentStateData, type PKCEOAuthConfig, PKCEOAuthStrategy, type ParsedToolCall, type PromptBlueprint, type PromptContext, type ProviderAdapter, type ProviderManagerConfig, ProviderManagerImpl, type ReasoningEngine, type RuntimeProviderConfig, type StageSpecificPrompts, StateManager, type StateSavingStrategy, type StorageAdapter, type StreamEvent, type StreamEventTypeFilter, SupabaseStorageAdapter, type SystemPromptMergeStrategy, type SystemPromptOverride, type SystemPromptResolver, type SystemPromptSpec, type SystemPromptsRegistry, type TaskDelegationConfig, TaskDelegationService, type TaskStatusResponse, type ThreadConfig, type ThreadContext, type TodoItem, TodoItemStatus, ToolRegistry, type ToolResult, type ToolSchema, type ToolSystem, TypedSocket, UISystem, UnknownProviderError, type UnsubscribeFunction, type UpdateA2ATaskRequest, VERSION, type ZyntopiaOAuthConfig, ZyntopiaOAuthStrategy, createArtInstance, generateUUID };
5351
+ export { type A2AAgentInfo, type A2ATask, type A2ATaskEvent, type A2ATaskFilter, type A2ATaskMetadata, A2ATaskPriority, type A2ATaskResult, A2ATaskSocket, A2ATaskStatus, ARTError, AdapterInstantiationError, type AgentDiscoveryConfig, AgentDiscoveryService, AgentFactory, type AgentFinalResponse, type AgentOptions, type AgentPersona, type AgentProps, type AgentState, AnthropicAdapter, type AnthropicAdapterOptions, ApiKeyStrategy, ApiQueueTimeoutError, type ArtInstance, type ArtInstanceConfig, type ArtStandardMessage, type ArtStandardMessageRole, ArtStandardMessageSchema, type ArtStandardPrompt, ArtStandardPromptSchema, AuthManager, type AvailableProviderEntry, CalculatorTool, type CallOptions, type ConversationManager, type ConversationMessage, ConversationSocket, type CreateA2ATaskRequest, DeepSeekAdapter, type DeepSeekAdapterOptions, ErrorCode, type ExecutionContext, type ExecutionMetadata, type ExecutionOutput, type FilterOptions, type FormattedPrompt, GeminiAdapter, type GeminiAdapterOptions, GenericOAuthStrategy, GroqAdapter, type GroqAdapterOptions, type IA2ATaskRepository, type IAgentCore, type IAuthStrategy, type IConversationRepository, type IObservationRepository, type IProviderManager, type IStateRepository, type IToolExecutor, type ITypedSocket, InMemoryStorageAdapter, IndexedDBStorageAdapter, type JsonObjectSchema, type JsonSchema, type LLMMetadata, LLMStreamSocket, LocalInstanceBusyError, LocalProviderConflictError, LogLevel, Logger, type LoggerConfig, type ManagedAdapterAccessor, McpClientController, McpManager, type McpManagerConfig, McpProxyTool, type McpResource, type McpResourceTemplate, type McpServerConfig, type McpServerStatus, type McpToolDefinition, type MessageOptions, MessageRole, ModelCapability, type OAuthConfig, type Observation, type ObservationFilter, type ObservationManager, ObservationSocket, ObservationType, OllamaAdapter, type OllamaAdapterOptions, OpenAIAdapter, type OpenAIAdapterOptions, OpenRouterAdapter, type OpenRouterAdapterOptions, type OutputParser, PESAgent, type PESAgentStateData, type PKCEOAuthConfig, PKCEOAuthStrategy, type ParsedToolCall, type PromptBlueprint, type PromptContext, type ProviderAdapter, type ProviderManagerConfig, ProviderManagerImpl, type ReasoningEngine, type RuntimeProviderConfig, type StageSpecificPrompts, StateManager, type StateSavingStrategy, type StorageAdapter, type StreamEvent, type StreamEventTypeFilter, SupabaseStorageAdapter, type SystemPromptMergeStrategy, type SystemPromptOverride, type SystemPromptResolver, type SystemPromptSpec, type SystemPromptsRegistry, type TaskDelegationConfig, TaskDelegationService, type TaskStatusResponse, type ThreadConfig, type ThreadContext, type TodoItem, TodoItemStatus, ToolRegistry, type ToolResult, type ToolSchema, type ToolSystem, TypedSocket, UISystem, UnknownProviderError, type UnsubscribeFunction, type UpdateA2ATaskRequest, VERSION, type ZyntopiaOAuthConfig, ZyntopiaOAuthStrategy, createArtInstance, generateUUID };
package/dist/index.d.ts CHANGED
@@ -4562,6 +4562,87 @@ declare class OllamaAdapter implements ProviderAdapter {
4562
4562
  shutdown(): Promise<void>;
4563
4563
  }
4564
4564
 
4565
+ /**
4566
+ * Configuration options required for the `GroqAdapter`.
4567
+ */
4568
+ interface GroqAdapterOptions {
4569
+ /** Your Groq API key. Handle securely. */
4570
+ apiKey: string;
4571
+ /** The default Groq model ID to use (e.g., 'llama-3.3-70b-versatile', 'mixtral-8x7b-32768'). */
4572
+ model?: string;
4573
+ /** Optional: Override the base URL for the Groq API. */
4574
+ apiBaseUrl?: string;
4575
+ /** Optional: Default maximum tokens for responses. */
4576
+ defaultMaxTokens?: number;
4577
+ /** Optional: Default temperature for responses. */
4578
+ defaultTemperature?: number;
4579
+ }
4580
+ /**
4581
+ * Implements the `ProviderAdapter` interface for interacting with Groq's
4582
+ * ultra-fast inference API using the official Groq SDK.
4583
+ *
4584
+ * Groq provides an OpenAI-compatible API, making this adapter similar in structure
4585
+ * to the OpenAI adapter but optimized for Groq's specific features and models.
4586
+ *
4587
+ * Handles formatting requests, parsing responses, streaming, and tool use.
4588
+ *
4589
+ * @see {@link ProviderAdapter} for the interface definition.
4590
+ * @see {@link GroqAdapterOptions} for configuration options.
4591
+ */
4592
+ declare class GroqAdapter implements ProviderAdapter {
4593
+ readonly providerName = "groq";
4594
+ private client;
4595
+ private defaultModel;
4596
+ private defaultMaxTokens;
4597
+ private defaultTemperature;
4598
+ /**
4599
+ * Creates an instance of the GroqAdapter.
4600
+ * @param options - Configuration options including the API key and optional model/baseURL/defaults.
4601
+ * @throws {ARTError} If the API key is missing.
4602
+ */
4603
+ constructor(options: GroqAdapterOptions);
4604
+ /**
4605
+ * Sends a request to the Groq Chat Completions API.
4606
+ * Translates `ArtStandardPrompt` to the Groq/OpenAI format and handles streaming and tool use.
4607
+ *
4608
+ * @param {ArtStandardPrompt} prompt - The standardized prompt messages.
4609
+ * @param {CallOptions} options - Call options, including streaming, model parameters, and tools.
4610
+ * @returns {Promise<AsyncIterable<StreamEvent>>} A promise resolving to an AsyncIterable of StreamEvent objects.
4611
+ */
4612
+ call(prompt: ArtStandardPrompt, options: CallOptions): Promise<AsyncIterable<StreamEvent>>;
4613
+ /**
4614
+ * Optional: Method for graceful shutdown
4615
+ */
4616
+ shutdown(): Promise<void>;
4617
+ /**
4618
+ * Translates the provider-agnostic `ArtStandardPrompt` into the Groq/OpenAI message format.
4619
+ *
4620
+ * @private
4621
+ * @param {ArtStandardPrompt} artPrompt - The input `ArtStandardPrompt` array.
4622
+ * @returns {ChatCompletionMessageParam[]} Array of Groq-formatted messages.
4623
+ * @throws {ARTError} If translation encounters an issue.
4624
+ */
4625
+ private translateToGroq;
4626
+ /**
4627
+ * Maps a single `ArtStandardMessage` to Groq/OpenAI message format.
4628
+ *
4629
+ * @private
4630
+ * @param {ArtStandardMessage} artMsg - The ART standard message to map.
4631
+ * @returns {ChatCompletionMessageParam | null} The translated message, or null if should be skipped.
4632
+ * @throws {ARTError} If tool call arguments are not valid JSON.
4633
+ */
4634
+ private mapArtMessageToGroq;
4635
+ /**
4636
+ * Translates an array of `ToolSchema` from the ART framework format to Groq's tool format.
4637
+ *
4638
+ * @private
4639
+ * @param {ToolSchema[]} artTools - An array of ART tool schemas.
4640
+ * @returns {ChatCompletionTool[]} An array of tools formatted for the Groq API.
4641
+ * @throws {ARTError} If a tool's `inputSchema` is invalid.
4642
+ */
4643
+ private translateArtToolsToGroq;
4644
+ }
4645
+
4565
4646
  /**
4566
4647
  * An ART Framework tool that safely evaluates mathematical expressions using the mathjs library.
4567
4648
  * It supports basic arithmetic, variables via a scope, complex numbers, and a predefined list of safe functions.
@@ -5265,6 +5346,6 @@ declare const generateUUID: () => string;
5265
5346
  /**
5266
5347
  * The current version of the ART Framework package.
5267
5348
  */
5268
- declare const VERSION = "0.3.8";
5349
+ declare const VERSION = "0.4.5";
5269
5350
 
5270
- export { type A2AAgentInfo, type A2ATask, type A2ATaskEvent, type A2ATaskFilter, type A2ATaskMetadata, A2ATaskPriority, type A2ATaskResult, A2ATaskSocket, A2ATaskStatus, ARTError, AdapterInstantiationError, type AgentDiscoveryConfig, AgentDiscoveryService, AgentFactory, type AgentFinalResponse, type AgentOptions, type AgentPersona, type AgentProps, type AgentState, AnthropicAdapter, type AnthropicAdapterOptions, ApiKeyStrategy, ApiQueueTimeoutError, type ArtInstance, type ArtInstanceConfig, type ArtStandardMessage, type ArtStandardMessageRole, ArtStandardMessageSchema, type ArtStandardPrompt, ArtStandardPromptSchema, AuthManager, type AvailableProviderEntry, CalculatorTool, type CallOptions, type ConversationManager, type ConversationMessage, ConversationSocket, type CreateA2ATaskRequest, DeepSeekAdapter, type DeepSeekAdapterOptions, ErrorCode, type ExecutionContext, type ExecutionMetadata, type ExecutionOutput, type FilterOptions, type FormattedPrompt, GeminiAdapter, type GeminiAdapterOptions, GenericOAuthStrategy, type IA2ATaskRepository, type IAgentCore, type IAuthStrategy, type IConversationRepository, type IObservationRepository, type IProviderManager, type IStateRepository, type IToolExecutor, type ITypedSocket, InMemoryStorageAdapter, IndexedDBStorageAdapter, type JsonObjectSchema, type JsonSchema, type LLMMetadata, LLMStreamSocket, LocalInstanceBusyError, LocalProviderConflictError, LogLevel, Logger, type LoggerConfig, type ManagedAdapterAccessor, McpClientController, McpManager, type McpManagerConfig, McpProxyTool, type McpResource, type McpResourceTemplate, type McpServerConfig, type McpServerStatus, type McpToolDefinition, type MessageOptions, MessageRole, ModelCapability, type OAuthConfig, type Observation, type ObservationFilter, type ObservationManager, ObservationSocket, ObservationType, OllamaAdapter, type OllamaAdapterOptions, OpenAIAdapter, type OpenAIAdapterOptions, OpenRouterAdapter, type OpenRouterAdapterOptions, type OutputParser, PESAgent, type PESAgentStateData, type PKCEOAuthConfig, PKCEOAuthStrategy, type ParsedToolCall, type PromptBlueprint, type PromptContext, type ProviderAdapter, type ProviderManagerConfig, ProviderManagerImpl, type ReasoningEngine, type RuntimeProviderConfig, type StageSpecificPrompts, StateManager, type StateSavingStrategy, type StorageAdapter, type StreamEvent, type StreamEventTypeFilter, SupabaseStorageAdapter, type SystemPromptMergeStrategy, type SystemPromptOverride, type SystemPromptResolver, type SystemPromptSpec, type SystemPromptsRegistry, type TaskDelegationConfig, TaskDelegationService, type TaskStatusResponse, type ThreadConfig, type ThreadContext, type TodoItem, TodoItemStatus, ToolRegistry, type ToolResult, type ToolSchema, type ToolSystem, TypedSocket, UISystem, UnknownProviderError, type UnsubscribeFunction, type UpdateA2ATaskRequest, VERSION, type ZyntopiaOAuthConfig, ZyntopiaOAuthStrategy, createArtInstance, generateUUID };
5351
+ export { type A2AAgentInfo, type A2ATask, type A2ATaskEvent, type A2ATaskFilter, type A2ATaskMetadata, A2ATaskPriority, type A2ATaskResult, A2ATaskSocket, A2ATaskStatus, ARTError, AdapterInstantiationError, type AgentDiscoveryConfig, AgentDiscoveryService, AgentFactory, type AgentFinalResponse, type AgentOptions, type AgentPersona, type AgentProps, type AgentState, AnthropicAdapter, type AnthropicAdapterOptions, ApiKeyStrategy, ApiQueueTimeoutError, type ArtInstance, type ArtInstanceConfig, type ArtStandardMessage, type ArtStandardMessageRole, ArtStandardMessageSchema, type ArtStandardPrompt, ArtStandardPromptSchema, AuthManager, type AvailableProviderEntry, CalculatorTool, type CallOptions, type ConversationManager, type ConversationMessage, ConversationSocket, type CreateA2ATaskRequest, DeepSeekAdapter, type DeepSeekAdapterOptions, ErrorCode, type ExecutionContext, type ExecutionMetadata, type ExecutionOutput, type FilterOptions, type FormattedPrompt, GeminiAdapter, type GeminiAdapterOptions, GenericOAuthStrategy, GroqAdapter, type GroqAdapterOptions, type IA2ATaskRepository, type IAgentCore, type IAuthStrategy, type IConversationRepository, type IObservationRepository, type IProviderManager, type IStateRepository, type IToolExecutor, type ITypedSocket, InMemoryStorageAdapter, IndexedDBStorageAdapter, type JsonObjectSchema, type JsonSchema, type LLMMetadata, LLMStreamSocket, LocalInstanceBusyError, LocalProviderConflictError, LogLevel, Logger, type LoggerConfig, type ManagedAdapterAccessor, McpClientController, McpManager, type McpManagerConfig, McpProxyTool, type McpResource, type McpResourceTemplate, type McpServerConfig, type McpServerStatus, type McpToolDefinition, type MessageOptions, MessageRole, ModelCapability, type OAuthConfig, type Observation, type ObservationFilter, type ObservationManager, ObservationSocket, ObservationType, OllamaAdapter, type OllamaAdapterOptions, OpenAIAdapter, type OpenAIAdapterOptions, OpenRouterAdapter, type OpenRouterAdapterOptions, type OutputParser, PESAgent, type PESAgentStateData, type PKCEOAuthConfig, PKCEOAuthStrategy, type ParsedToolCall, type PromptBlueprint, type PromptContext, type ProviderAdapter, type ProviderManagerConfig, ProviderManagerImpl, type ReasoningEngine, type RuntimeProviderConfig, type StageSpecificPrompts, StateManager, type StateSavingStrategy, type StorageAdapter, type StreamEvent, type StreamEventTypeFilter, SupabaseStorageAdapter, type SystemPromptMergeStrategy, type SystemPromptOverride, type SystemPromptResolver, type SystemPromptSpec, type SystemPromptsRegistry, type TaskDelegationConfig, TaskDelegationService, type TaskStatusResponse, type ThreadConfig, type ThreadContext, type TodoItem, TodoItemStatus, ToolRegistry, type ToolResult, type ToolSchema, type ToolSystem, TypedSocket, UISystem, UnknownProviderError, type UnsubscribeFunction, type UpdateA2ATaskRequest, VERSION, type ZyntopiaOAuthConfig, ZyntopiaOAuthStrategy, createArtInstance, generateUUID };