@axiom-lattice/core 2.1.45 → 2.1.47

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.mts CHANGED
@@ -1744,6 +1744,10 @@ declare abstract class ChunkBuffer {
1744
1744
  * Chunks are appended in order
1745
1745
  */
1746
1746
  abstract addChunk(threadId: string, content: MessageChunk): Promise<void>;
1747
+ /**
1748
+ * Ensure a thread buffer exists before any chunks are emitted.
1749
+ */
1750
+ abstract ensureThread(threadId: string): Promise<void>;
1747
1751
  /**
1748
1752
  * Mark thread as completed (explicit call)
1749
1753
  */
@@ -1829,6 +1833,7 @@ declare class InMemoryChunkBuffer extends ChunkBuffer {
1829
1833
  private getOrCreateBuffer;
1830
1834
  addChunk(threadId: string, messageId: string, content: string): Promise<void>;
1831
1835
  addChunk(threadId: string, content: MessageChunk): Promise<void>;
1836
+ ensureThread(threadId: string): Promise<void>;
1832
1837
  completeThread(threadId: string): Promise<void>;
1833
1838
  abortThread(threadId: string): Promise<void>;
1834
1839
  isThreadActive(threadId: string): Promise<boolean>;
@@ -4234,6 +4239,7 @@ interface StateAndStore {
4234
4239
  store?: BaseStore;
4235
4240
  /** Optional assistant ID for per-assistant isolation in store */
4236
4241
  assistantId?: string;
4242
+ assistant_id?: string;
4237
4243
  threadId?: string;
4238
4244
  tenantId?: string;
4239
4245
  workspaceId?: string;
@@ -5105,8 +5111,9 @@ declare class Agent {
5105
5111
  /**
5106
5112
  * Abort the current agent execution
5107
5113
  * This will cancel any ongoing invoke or stream operations
5114
+ * and clear all queued messages (pending + processing)
5108
5115
  */
5109
- abort(): void;
5116
+ abort(): Promise<void>;
5110
5117
  /**
5111
5118
  * Check if the agent is currently being aborted
5112
5119
  */
@@ -5263,4 +5270,53 @@ interface RuntimeModelConfig {
5263
5270
  */
5264
5271
  declare function createModelSelectorMiddleware(): AgentMiddleware;
5265
5272
 
5266
- export { AGENT_TASK_EVENT, type AddMessageParams, Agent, type AgentClient, type AgentExecutor, AgentInstanceManager, type AgentLattice, AgentLatticeManager, type AgentLifecycleEventName, AgentManager, type AgentStreamExecutor, type AgentThreadInterface, type BackendFactory, type BackendProtocol, type BufferStats, type Chunk, ChunkBuffer, ChunkBufferLatticeManager, type ColumnInfo, CompositeBackend, ConsoleLoggerClient, type CronFields, CustomMetricsClient, type DatabaseConfig, type DatabaseType, DefaultScheduleClient, EMPTY_CONTENT_WARNING, type EditResult, type EmbeddingsLatticeInterface, EmbeddingsLatticeManager, type FileData, type FileInfo, FileSystemSkillStore, type FileSystemSkillStoreOptions, FilesystemBackend, type GrepMatch, type IMessageQueueStore, type IMetricsServerClient, type ISqlDatabase, InMemoryAssistantStore, InMemoryChunkBuffer, InMemoryDatabaseConfigStore, InMemoryMailboxStore, InMemoryTaskListStore, InMemoryTenantStore, InMemoryThreadMessageQueueStore, InMemoryThreadStore, InMemoryUserStore, InMemoryUserTenantLinkStore, type IsolatedLevel, LINE_NUMBER_WIDTH, type LangGraphStateChecker, type LoggerLattice, LoggerLatticeManager, MAX_LINE_LENGTH, type MailboxMessage, type MailboxStore, type McpLatticeInterface, McpLatticeManager, type McpServerInfo, MemoryBackend, MemoryLatticeManager, MemoryQueueClient, MemoryScheduleStorage, type MessageCompletedEvent, type MessageFailedEvent, type MessageStartedEvent, MessageType, MetricsServerManager, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, type PendingMessage, PinoLoggerClient, PostgresDatabase, PrometheusClient, type QueryResult, type QueueLattice, QueueLatticeManager, QueueMode, type QueuePendingEvent, type RunSandboxConfig, type RuntimeModelConfig, SandboxFilesystem, SandboxLatticeManager, type SandboxManagerProtocol, SandboxSkillStore, type SandboxSkillStoreOptions, type ScheduleLattice, ScheduleLatticeManager, SemanticMetricsClient, type SkillLattice, SkillLatticeManager, type SkillResource, SqlDatabaseManager, type StateAndStore, StateBackend, StoreBackend, type StoreLattice, StoreLatticeManager, type StoreType, type StoreTypeMap, TOOL_RESULT_TOKEN_LIMIT, TRUNCATION_GUIDANCE, type TableInfo, type TableSchema, type TaskEvent, type TaskListStore, type TaskSpec, TaskStatus, type TaskUpdatable, TeamAgentGraphBuilder, type TeamConfig, type TeamMiddlewareOptions, type TeamTask, type TeammateSpec, type TeammateToolsOptions, type ThreadBuffer, type ThreadBufferConfig, type ThreadBusyEvent, type ThreadIdleEvent, type ThreadInfo, type ThreadQueueConfig, type ThreadState, ThreadStatus, type ThreadStatusChangedEvent, type ToolDefinition, type ToolLattice, ToolLatticeManager, type VectorStoreLatticeInterface, VectorStoreLatticeManager, type WriteResult, agentInstanceManager, agentLatticeManager, buildGrepResultsDict, checkEmptyContent, clearEncryptionKeyCache, createAgentTeam, createExecuteSqlQueryTool, createFileData, createInfoSqlTool, createListMetricsDataSourcesTool, createListMetricsServersTool, createListTablesSqlTool, createModelSelectorMiddleware, createQueryCheckerSqlTool, createQueryMetricDefinitionTool, createQueryMetricsListTool, createQuerySemanticMetricDataTool, createQuerySqlTool, createQueryTableDefinitionTool, createQueryTablesListTool, createTeamMiddleware, createTeammateTools, createWidgetMiddleware, decrypt, describeCronExpression, embeddingsLatticeManager, encrypt, eventBus, eventBus as eventBusDefault, fileDataToString, formatContentWithLineNumbers, formatGrepMatches, formatGrepResults, formatReadResponse, getAgentClient, getAgentConfig, getAllAgentConfigs, getAllToolDefinitions, getCheckpointSaver, getChunkBuffer, getEmbeddingsClient, getEmbeddingsLattice, getEncryptionKey, getLoggerLattice, getModelLattice, getNextCronTime, getQueueLattice, getSandBoxManager, getScheduleLattice, getStoreLattice, getToolClient, getToolDefinition, getToolLattice, getVectorStoreClient, getVectorStoreLattice, globSearchFiles, grepMatchesFromFiles, grepSearchFiles, hasChunkBuffer, isUsingDefaultKey, isValidCronExpression, isValidSandboxName, isValidSkillName, loggerLatticeManager, mcpManager, metricsServerManager, modelLatticeManager, normalizeSandboxName, parseCronExpression, performStringReplacement, queueLatticeManager, registerAgentLattice, registerAgentLatticeWithTenant, registerAgentLattices, registerCheckpointSaver, registerChunkBuffer, registerEmbeddingsLattice, registerExistingTool, registerLoggerLattice, registerModelLattice, registerQueueLattice, registerScheduleLattice, registerStoreLattice, registerTeammateAgent, registerToolLattice, registerVectorStoreLattice, sandboxLatticeManager, sanitizeToolCallId, scheduleLatticeManager, skillLatticeManager, sqlDatabaseManager, storeLatticeManager, toolLatticeManager, truncateIfTooLong, unregisterTeammateAgent, updateFileData, validateAgentInput, validateEncryptionKey, validatePath, validateSkillName, validateToolInput, vectorStoreLatticeManager };
5273
+ /**
5274
+ * Unknown Tool Handler Middleware
5275
+ *
5276
+ * Intercepts unknown tools selected by the model and returns error feedback
5277
+ * instead of throwing exceptions.
5278
+ *
5279
+ * Implementation: Uses wrapModelCall to get available tools, then afterModel
5280
+ * to generate error ToolMessages and jump back to the model.
5281
+ *
5282
+ * Key Design Principles:
5283
+ * 1. Preserve all tool_calls in AIMessage (keep model's original intent)
5284
+ * 2. Generate error ToolMessages for unknown tools (preserve tool_call_id mapping)
5285
+ * 3. Use jumpTo to loop back to model node (required for agent loop)
5286
+ * 4. ToolNode will skip tool calls that already have ToolMessages
5287
+ *
5288
+ * Architecture:
5289
+ * - Positioned first in middleware chain (before HITL)
5290
+ * - Shared across all agent types (ReAct, DeepAgent, TeamAgent)
5291
+ * - Injected via createCommonMiddlewares
5292
+ *
5293
+ * @example
5294
+ * ```typescript
5295
+ * middlewares.push(createUnknownToolHandlerMiddleware());
5296
+ * ```
5297
+ */
5298
+
5299
+ interface UnknownToolHandlerConfig {
5300
+ /**
5301
+ * Strategy when encountering unknown tools
5302
+ * - 'error': Return error message to model (default)
5303
+ * - 'strict': Throw exception and terminate
5304
+ */
5305
+ strategy?: 'error' | 'strict';
5306
+ /**
5307
+ * Custom error message template
5308
+ * @param toolName - The unknown tool name requested
5309
+ * @param availableTools - List of currently available tool names
5310
+ * @returns Error message content
5311
+ */
5312
+ errorMessageTemplate?: (toolName: string, availableTools: string[]) => string;
5313
+ }
5314
+ /**
5315
+ * Create unknown tool handler middleware
5316
+ *
5317
+ * @param config - Configuration options
5318
+ * @returns AgentMiddleware instance
5319
+ */
5320
+ declare function createUnknownToolHandlerMiddleware(config?: UnknownToolHandlerConfig): AgentMiddleware;
5321
+
5322
+ export { AGENT_TASK_EVENT, type AddMessageParams, Agent, type AgentClient, type AgentExecutor, AgentInstanceManager, type AgentLattice, AgentLatticeManager, type AgentLifecycleEventName, AgentManager, type AgentStreamExecutor, type AgentThreadInterface, type BackendFactory, type BackendProtocol, type BufferStats, type Chunk, ChunkBuffer, ChunkBufferLatticeManager, type ColumnInfo, CompositeBackend, ConsoleLoggerClient, type CronFields, CustomMetricsClient, type DatabaseConfig, type DatabaseType, DefaultScheduleClient, EMPTY_CONTENT_WARNING, type EditResult, type EmbeddingsLatticeInterface, EmbeddingsLatticeManager, type FileData, type FileInfo, FileSystemSkillStore, type FileSystemSkillStoreOptions, FilesystemBackend, type GrepMatch, type IMessageQueueStore, type IMetricsServerClient, type ISqlDatabase, InMemoryAssistantStore, InMemoryChunkBuffer, InMemoryDatabaseConfigStore, InMemoryMailboxStore, InMemoryTaskListStore, InMemoryTenantStore, InMemoryThreadMessageQueueStore, InMemoryThreadStore, InMemoryUserStore, InMemoryUserTenantLinkStore, type IsolatedLevel, LINE_NUMBER_WIDTH, type LangGraphStateChecker, type LoggerLattice, LoggerLatticeManager, MAX_LINE_LENGTH, type MailboxMessage, type MailboxStore, type McpLatticeInterface, McpLatticeManager, type McpServerInfo, MemoryBackend, MemoryLatticeManager, MemoryQueueClient, MemoryScheduleStorage, type MessageCompletedEvent, type MessageFailedEvent, type MessageStartedEvent, MessageType, MetricsServerManager, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, type PendingMessage, PinoLoggerClient, PostgresDatabase, PrometheusClient, type QueryResult, type QueueLattice, QueueLatticeManager, QueueMode, type QueuePendingEvent, type RunSandboxConfig, type RuntimeModelConfig, SandboxFilesystem, SandboxLatticeManager, type SandboxManagerProtocol, SandboxSkillStore, type SandboxSkillStoreOptions, type ScheduleLattice, ScheduleLatticeManager, SemanticMetricsClient, type SkillLattice, SkillLatticeManager, type SkillResource, SqlDatabaseManager, type StateAndStore, StateBackend, StoreBackend, type StoreLattice, StoreLatticeManager, type StoreType, type StoreTypeMap, TOOL_RESULT_TOKEN_LIMIT, TRUNCATION_GUIDANCE, type TableInfo, type TableSchema, type TaskEvent, type TaskListStore, type TaskSpec, TaskStatus, type TaskUpdatable, TeamAgentGraphBuilder, type TeamConfig, type TeamMiddlewareOptions, type TeamTask, type TeammateSpec, type TeammateToolsOptions, type ThreadBuffer, type ThreadBufferConfig, type ThreadBusyEvent, type ThreadIdleEvent, type ThreadInfo, type ThreadQueueConfig, type ThreadState, ThreadStatus, type ThreadStatusChangedEvent, type ToolDefinition, type ToolLattice, ToolLatticeManager, type UnknownToolHandlerConfig, type VectorStoreLatticeInterface, VectorStoreLatticeManager, type WriteResult, agentInstanceManager, agentLatticeManager, buildGrepResultsDict, checkEmptyContent, clearEncryptionKeyCache, createAgentTeam, createExecuteSqlQueryTool, createFileData, createInfoSqlTool, createListMetricsDataSourcesTool, createListMetricsServersTool, createListTablesSqlTool, createModelSelectorMiddleware, createQueryCheckerSqlTool, createQueryMetricDefinitionTool, createQueryMetricsListTool, createQuerySemanticMetricDataTool, createQuerySqlTool, createQueryTableDefinitionTool, createQueryTablesListTool, createTeamMiddleware, createTeammateTools, createUnknownToolHandlerMiddleware, createWidgetMiddleware, decrypt, describeCronExpression, embeddingsLatticeManager, encrypt, eventBus, eventBus as eventBusDefault, fileDataToString, formatContentWithLineNumbers, formatGrepMatches, formatGrepResults, formatReadResponse, getAgentClient, getAgentConfig, getAllAgentConfigs, getAllToolDefinitions, getCheckpointSaver, getChunkBuffer, getEmbeddingsClient, getEmbeddingsLattice, getEncryptionKey, getLoggerLattice, getModelLattice, getNextCronTime, getQueueLattice, getSandBoxManager, getScheduleLattice, getStoreLattice, getToolClient, getToolDefinition, getToolLattice, getVectorStoreClient, getVectorStoreLattice, globSearchFiles, grepMatchesFromFiles, grepSearchFiles, hasChunkBuffer, isUsingDefaultKey, isValidCronExpression, isValidSandboxName, isValidSkillName, loggerLatticeManager, mcpManager, metricsServerManager, modelLatticeManager, normalizeSandboxName, parseCronExpression, performStringReplacement, queueLatticeManager, registerAgentLattice, registerAgentLatticeWithTenant, registerAgentLattices, registerCheckpointSaver, registerChunkBuffer, registerEmbeddingsLattice, registerExistingTool, registerLoggerLattice, registerModelLattice, registerQueueLattice, registerScheduleLattice, registerStoreLattice, registerTeammateAgent, registerToolLattice, registerVectorStoreLattice, sandboxLatticeManager, sanitizeToolCallId, scheduleLatticeManager, skillLatticeManager, sqlDatabaseManager, storeLatticeManager, toolLatticeManager, truncateIfTooLong, unregisterTeammateAgent, updateFileData, validateAgentInput, validateEncryptionKey, validatePath, validateSkillName, validateToolInput, vectorStoreLatticeManager };
package/dist/index.d.ts CHANGED
@@ -1744,6 +1744,10 @@ declare abstract class ChunkBuffer {
1744
1744
  * Chunks are appended in order
1745
1745
  */
1746
1746
  abstract addChunk(threadId: string, content: MessageChunk): Promise<void>;
1747
+ /**
1748
+ * Ensure a thread buffer exists before any chunks are emitted.
1749
+ */
1750
+ abstract ensureThread(threadId: string): Promise<void>;
1747
1751
  /**
1748
1752
  * Mark thread as completed (explicit call)
1749
1753
  */
@@ -1829,6 +1833,7 @@ declare class InMemoryChunkBuffer extends ChunkBuffer {
1829
1833
  private getOrCreateBuffer;
1830
1834
  addChunk(threadId: string, messageId: string, content: string): Promise<void>;
1831
1835
  addChunk(threadId: string, content: MessageChunk): Promise<void>;
1836
+ ensureThread(threadId: string): Promise<void>;
1832
1837
  completeThread(threadId: string): Promise<void>;
1833
1838
  abortThread(threadId: string): Promise<void>;
1834
1839
  isThreadActive(threadId: string): Promise<boolean>;
@@ -4234,6 +4239,7 @@ interface StateAndStore {
4234
4239
  store?: BaseStore;
4235
4240
  /** Optional assistant ID for per-assistant isolation in store */
4236
4241
  assistantId?: string;
4242
+ assistant_id?: string;
4237
4243
  threadId?: string;
4238
4244
  tenantId?: string;
4239
4245
  workspaceId?: string;
@@ -5105,8 +5111,9 @@ declare class Agent {
5105
5111
  /**
5106
5112
  * Abort the current agent execution
5107
5113
  * This will cancel any ongoing invoke or stream operations
5114
+ * and clear all queued messages (pending + processing)
5108
5115
  */
5109
- abort(): void;
5116
+ abort(): Promise<void>;
5110
5117
  /**
5111
5118
  * Check if the agent is currently being aborted
5112
5119
  */
@@ -5263,4 +5270,53 @@ interface RuntimeModelConfig {
5263
5270
  */
5264
5271
  declare function createModelSelectorMiddleware(): AgentMiddleware;
5265
5272
 
5266
- export { AGENT_TASK_EVENT, type AddMessageParams, Agent, type AgentClient, type AgentExecutor, AgentInstanceManager, type AgentLattice, AgentLatticeManager, type AgentLifecycleEventName, AgentManager, type AgentStreamExecutor, type AgentThreadInterface, type BackendFactory, type BackendProtocol, type BufferStats, type Chunk, ChunkBuffer, ChunkBufferLatticeManager, type ColumnInfo, CompositeBackend, ConsoleLoggerClient, type CronFields, CustomMetricsClient, type DatabaseConfig, type DatabaseType, DefaultScheduleClient, EMPTY_CONTENT_WARNING, type EditResult, type EmbeddingsLatticeInterface, EmbeddingsLatticeManager, type FileData, type FileInfo, FileSystemSkillStore, type FileSystemSkillStoreOptions, FilesystemBackend, type GrepMatch, type IMessageQueueStore, type IMetricsServerClient, type ISqlDatabase, InMemoryAssistantStore, InMemoryChunkBuffer, InMemoryDatabaseConfigStore, InMemoryMailboxStore, InMemoryTaskListStore, InMemoryTenantStore, InMemoryThreadMessageQueueStore, InMemoryThreadStore, InMemoryUserStore, InMemoryUserTenantLinkStore, type IsolatedLevel, LINE_NUMBER_WIDTH, type LangGraphStateChecker, type LoggerLattice, LoggerLatticeManager, MAX_LINE_LENGTH, type MailboxMessage, type MailboxStore, type McpLatticeInterface, McpLatticeManager, type McpServerInfo, MemoryBackend, MemoryLatticeManager, MemoryQueueClient, MemoryScheduleStorage, type MessageCompletedEvent, type MessageFailedEvent, type MessageStartedEvent, MessageType, MetricsServerManager, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, type PendingMessage, PinoLoggerClient, PostgresDatabase, PrometheusClient, type QueryResult, type QueueLattice, QueueLatticeManager, QueueMode, type QueuePendingEvent, type RunSandboxConfig, type RuntimeModelConfig, SandboxFilesystem, SandboxLatticeManager, type SandboxManagerProtocol, SandboxSkillStore, type SandboxSkillStoreOptions, type ScheduleLattice, ScheduleLatticeManager, SemanticMetricsClient, type SkillLattice, SkillLatticeManager, type SkillResource, SqlDatabaseManager, type StateAndStore, StateBackend, StoreBackend, type StoreLattice, StoreLatticeManager, type StoreType, type StoreTypeMap, TOOL_RESULT_TOKEN_LIMIT, TRUNCATION_GUIDANCE, type TableInfo, type TableSchema, type TaskEvent, type TaskListStore, type TaskSpec, TaskStatus, type TaskUpdatable, TeamAgentGraphBuilder, type TeamConfig, type TeamMiddlewareOptions, type TeamTask, type TeammateSpec, type TeammateToolsOptions, type ThreadBuffer, type ThreadBufferConfig, type ThreadBusyEvent, type ThreadIdleEvent, type ThreadInfo, type ThreadQueueConfig, type ThreadState, ThreadStatus, type ThreadStatusChangedEvent, type ToolDefinition, type ToolLattice, ToolLatticeManager, type VectorStoreLatticeInterface, VectorStoreLatticeManager, type WriteResult, agentInstanceManager, agentLatticeManager, buildGrepResultsDict, checkEmptyContent, clearEncryptionKeyCache, createAgentTeam, createExecuteSqlQueryTool, createFileData, createInfoSqlTool, createListMetricsDataSourcesTool, createListMetricsServersTool, createListTablesSqlTool, createModelSelectorMiddleware, createQueryCheckerSqlTool, createQueryMetricDefinitionTool, createQueryMetricsListTool, createQuerySemanticMetricDataTool, createQuerySqlTool, createQueryTableDefinitionTool, createQueryTablesListTool, createTeamMiddleware, createTeammateTools, createWidgetMiddleware, decrypt, describeCronExpression, embeddingsLatticeManager, encrypt, eventBus, eventBus as eventBusDefault, fileDataToString, formatContentWithLineNumbers, formatGrepMatches, formatGrepResults, formatReadResponse, getAgentClient, getAgentConfig, getAllAgentConfigs, getAllToolDefinitions, getCheckpointSaver, getChunkBuffer, getEmbeddingsClient, getEmbeddingsLattice, getEncryptionKey, getLoggerLattice, getModelLattice, getNextCronTime, getQueueLattice, getSandBoxManager, getScheduleLattice, getStoreLattice, getToolClient, getToolDefinition, getToolLattice, getVectorStoreClient, getVectorStoreLattice, globSearchFiles, grepMatchesFromFiles, grepSearchFiles, hasChunkBuffer, isUsingDefaultKey, isValidCronExpression, isValidSandboxName, isValidSkillName, loggerLatticeManager, mcpManager, metricsServerManager, modelLatticeManager, normalizeSandboxName, parseCronExpression, performStringReplacement, queueLatticeManager, registerAgentLattice, registerAgentLatticeWithTenant, registerAgentLattices, registerCheckpointSaver, registerChunkBuffer, registerEmbeddingsLattice, registerExistingTool, registerLoggerLattice, registerModelLattice, registerQueueLattice, registerScheduleLattice, registerStoreLattice, registerTeammateAgent, registerToolLattice, registerVectorStoreLattice, sandboxLatticeManager, sanitizeToolCallId, scheduleLatticeManager, skillLatticeManager, sqlDatabaseManager, storeLatticeManager, toolLatticeManager, truncateIfTooLong, unregisterTeammateAgent, updateFileData, validateAgentInput, validateEncryptionKey, validatePath, validateSkillName, validateToolInput, vectorStoreLatticeManager };
5273
+ /**
5274
+ * Unknown Tool Handler Middleware
5275
+ *
5276
+ * Intercepts unknown tools selected by the model and returns error feedback
5277
+ * instead of throwing exceptions.
5278
+ *
5279
+ * Implementation: Uses wrapModelCall to get available tools, then afterModel
5280
+ * to generate error ToolMessages and jump back to the model.
5281
+ *
5282
+ * Key Design Principles:
5283
+ * 1. Preserve all tool_calls in AIMessage (keep model's original intent)
5284
+ * 2. Generate error ToolMessages for unknown tools (preserve tool_call_id mapping)
5285
+ * 3. Use jumpTo to loop back to model node (required for agent loop)
5286
+ * 4. ToolNode will skip tool calls that already have ToolMessages
5287
+ *
5288
+ * Architecture:
5289
+ * - Positioned first in middleware chain (before HITL)
5290
+ * - Shared across all agent types (ReAct, DeepAgent, TeamAgent)
5291
+ * - Injected via createCommonMiddlewares
5292
+ *
5293
+ * @example
5294
+ * ```typescript
5295
+ * middlewares.push(createUnknownToolHandlerMiddleware());
5296
+ * ```
5297
+ */
5298
+
5299
+ interface UnknownToolHandlerConfig {
5300
+ /**
5301
+ * Strategy when encountering unknown tools
5302
+ * - 'error': Return error message to model (default)
5303
+ * - 'strict': Throw exception and terminate
5304
+ */
5305
+ strategy?: 'error' | 'strict';
5306
+ /**
5307
+ * Custom error message template
5308
+ * @param toolName - The unknown tool name requested
5309
+ * @param availableTools - List of currently available tool names
5310
+ * @returns Error message content
5311
+ */
5312
+ errorMessageTemplate?: (toolName: string, availableTools: string[]) => string;
5313
+ }
5314
+ /**
5315
+ * Create unknown tool handler middleware
5316
+ *
5317
+ * @param config - Configuration options
5318
+ * @returns AgentMiddleware instance
5319
+ */
5320
+ declare function createUnknownToolHandlerMiddleware(config?: UnknownToolHandlerConfig): AgentMiddleware;
5321
+
5322
+ export { AGENT_TASK_EVENT, type AddMessageParams, Agent, type AgentClient, type AgentExecutor, AgentInstanceManager, type AgentLattice, AgentLatticeManager, type AgentLifecycleEventName, AgentManager, type AgentStreamExecutor, type AgentThreadInterface, type BackendFactory, type BackendProtocol, type BufferStats, type Chunk, ChunkBuffer, ChunkBufferLatticeManager, type ColumnInfo, CompositeBackend, ConsoleLoggerClient, type CronFields, CustomMetricsClient, type DatabaseConfig, type DatabaseType, DefaultScheduleClient, EMPTY_CONTENT_WARNING, type EditResult, type EmbeddingsLatticeInterface, EmbeddingsLatticeManager, type FileData, type FileInfo, FileSystemSkillStore, type FileSystemSkillStoreOptions, FilesystemBackend, type GrepMatch, type IMessageQueueStore, type IMetricsServerClient, type ISqlDatabase, InMemoryAssistantStore, InMemoryChunkBuffer, InMemoryDatabaseConfigStore, InMemoryMailboxStore, InMemoryTaskListStore, InMemoryTenantStore, InMemoryThreadMessageQueueStore, InMemoryThreadStore, InMemoryUserStore, InMemoryUserTenantLinkStore, type IsolatedLevel, LINE_NUMBER_WIDTH, type LangGraphStateChecker, type LoggerLattice, LoggerLatticeManager, MAX_LINE_LENGTH, type MailboxMessage, type MailboxStore, type McpLatticeInterface, McpLatticeManager, type McpServerInfo, MemoryBackend, MemoryLatticeManager, MemoryQueueClient, MemoryScheduleStorage, type MessageCompletedEvent, type MessageFailedEvent, type MessageStartedEvent, MessageType, MetricsServerManager, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, type PendingMessage, PinoLoggerClient, PostgresDatabase, PrometheusClient, type QueryResult, type QueueLattice, QueueLatticeManager, QueueMode, type QueuePendingEvent, type RunSandboxConfig, type RuntimeModelConfig, SandboxFilesystem, SandboxLatticeManager, type SandboxManagerProtocol, SandboxSkillStore, type SandboxSkillStoreOptions, type ScheduleLattice, ScheduleLatticeManager, SemanticMetricsClient, type SkillLattice, SkillLatticeManager, type SkillResource, SqlDatabaseManager, type StateAndStore, StateBackend, StoreBackend, type StoreLattice, StoreLatticeManager, type StoreType, type StoreTypeMap, TOOL_RESULT_TOKEN_LIMIT, TRUNCATION_GUIDANCE, type TableInfo, type TableSchema, type TaskEvent, type TaskListStore, type TaskSpec, TaskStatus, type TaskUpdatable, TeamAgentGraphBuilder, type TeamConfig, type TeamMiddlewareOptions, type TeamTask, type TeammateSpec, type TeammateToolsOptions, type ThreadBuffer, type ThreadBufferConfig, type ThreadBusyEvent, type ThreadIdleEvent, type ThreadInfo, type ThreadQueueConfig, type ThreadState, ThreadStatus, type ThreadStatusChangedEvent, type ToolDefinition, type ToolLattice, ToolLatticeManager, type UnknownToolHandlerConfig, type VectorStoreLatticeInterface, VectorStoreLatticeManager, type WriteResult, agentInstanceManager, agentLatticeManager, buildGrepResultsDict, checkEmptyContent, clearEncryptionKeyCache, createAgentTeam, createExecuteSqlQueryTool, createFileData, createInfoSqlTool, createListMetricsDataSourcesTool, createListMetricsServersTool, createListTablesSqlTool, createModelSelectorMiddleware, createQueryCheckerSqlTool, createQueryMetricDefinitionTool, createQueryMetricsListTool, createQuerySemanticMetricDataTool, createQuerySqlTool, createQueryTableDefinitionTool, createQueryTablesListTool, createTeamMiddleware, createTeammateTools, createUnknownToolHandlerMiddleware, createWidgetMiddleware, decrypt, describeCronExpression, embeddingsLatticeManager, encrypt, eventBus, eventBus as eventBusDefault, fileDataToString, formatContentWithLineNumbers, formatGrepMatches, formatGrepResults, formatReadResponse, getAgentClient, getAgentConfig, getAllAgentConfigs, getAllToolDefinitions, getCheckpointSaver, getChunkBuffer, getEmbeddingsClient, getEmbeddingsLattice, getEncryptionKey, getLoggerLattice, getModelLattice, getNextCronTime, getQueueLattice, getSandBoxManager, getScheduleLattice, getStoreLattice, getToolClient, getToolDefinition, getToolLattice, getVectorStoreClient, getVectorStoreLattice, globSearchFiles, grepMatchesFromFiles, grepSearchFiles, hasChunkBuffer, isUsingDefaultKey, isValidCronExpression, isValidSandboxName, isValidSkillName, loggerLatticeManager, mcpManager, metricsServerManager, modelLatticeManager, normalizeSandboxName, parseCronExpression, performStringReplacement, queueLatticeManager, registerAgentLattice, registerAgentLatticeWithTenant, registerAgentLattices, registerCheckpointSaver, registerChunkBuffer, registerEmbeddingsLattice, registerExistingTool, registerLoggerLattice, registerModelLattice, registerQueueLattice, registerScheduleLattice, registerStoreLattice, registerTeammateAgent, registerToolLattice, registerVectorStoreLattice, sandboxLatticeManager, sanitizeToolCallId, scheduleLatticeManager, skillLatticeManager, sqlDatabaseManager, storeLatticeManager, toolLatticeManager, truncateIfTooLong, unregisterTeammateAgent, updateFileData, validateAgentInput, validateEncryptionKey, validatePath, validateSkillName, validateToolInput, vectorStoreLatticeManager };