@axiom-lattice/core 2.1.93 → 2.1.95

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
@@ -8,7 +8,7 @@ import { BaseLanguageModelInput, LanguageModelLike, BaseLanguageModel } from '@l
8
8
  import { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';
9
9
  import { ChatResult } from '@langchain/core/outputs';
10
10
  import * as _axiom_lattice_protocols from '@axiom-lattice/protocols';
11
- import { LLMConfig, SemanticMetricsServerConfig, MetricMeta, MetricQueryResult, DataSource, SemanticMetricsQueryRequest, SemanticMetricsQueryResponse, TableQueryRequest, TableQueryResponse, ExecuteSqlQueryRequest, ExecuteSqlQueryResponse, MetricsServerType, MetricsServerConfig, ToolConfig, ToolExecutor, AgentConfig, MiddlewareType, GraphBuildOptions, MessageChunk, MessageChunkType, QueueLatticeProtocol, QueueConfig, QueueClient, QueueResult, ScheduleLatticeProtocol, ScheduleConfig, ScheduleClient, ScheduleStorage, TaskHandler, ScheduleOnceOptions, ScheduleCronOptions, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, ThreadStore, AssistantStore, SkillStore, WorkspaceStore, ProjectStore, DatabaseConfigStore, MetricsServerConfigStore, McpServerConfigStore, UserStore, TenantStore, UserTenantLinkStore, WorkflowTrackingStore, EvalStore, ChannelInstallationStore, BindingRegistry, MenuRegistry, A2AApiKeyStore, TaskStore, SharedResourceStore, Thread, CreateThreadRequest, Assistant, CreateAssistantRequest, Skill, CreateSkillRequest, SkillStoreContext, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, User, CreateUserRequest, UpdateUserRequest, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, Binding, CreateBindingInput, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, LoggerLatticeProtocol, LoggerConfig, LoggerClient, LoggerContext, SkillConfig, SkillClient, ResourceResolver, ResourceAddress, ShareVisibility, CreateShareRequest, ChannelAdapter, InternalStateField, InternalInput, InternalNode, InternalAgentNode, InternalMapNode, InternalDSL } from '@axiom-lattice/protocols';
11
+ import { LLMConfig, SemanticMetricsServerConfig, MetricMeta, MetricQueryResult, DataSource, SemanticMetricsQueryRequest, SemanticMetricsQueryResponse, TableQueryRequest, TableQueryResponse, ExecuteSqlQueryRequest, ExecuteSqlQueryResponse, MetricsServerType, MetricsServerConfig, ToolConfig, ToolExecutor, AgentConfig, MiddlewareType, GraphBuildOptions, MessageChunk, MessageChunkType, QueueLatticeProtocol, QueueConfig, QueueClient, QueueResult, ScheduleLatticeProtocol, ScheduleConfig, ScheduleClient, ScheduleStorage, TaskHandler, ScheduleOnceOptions, ScheduleCronOptions, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, ThreadStore, AssistantStore, SkillStore, CollectionStore, WorkspaceStore, ProjectStore, DatabaseConfigStore, MetricsServerConfigStore, McpServerConfigStore, UserStore, TenantStore, UserTenantLinkStore, WorkflowTrackingStore, EvalStore, ChannelInstallationStore, BindingRegistry, MenuRegistry, A2AApiKeyStore, TaskStore, SharedResourceStore, VectorStoreProvider, Thread, CreateThreadRequest, Assistant, CreateAssistantRequest, Skill, CreateSkillRequest, SkillStoreContext, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, User, CreateUserRequest, UpdateUserRequest, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, Binding, CreateBindingInput, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest, Collection, CreateCollectionRequest, UpdateCollectionRequest, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, LoggerLatticeProtocol, LoggerConfig, LoggerClient, LoggerContext, SkillConfig, SkillClient, McpTool, ResourceResolver, ResourceAddress, ShareVisibility, CreateShareRequest, ChannelAdapter, InternalStateField, InternalInput, InternalNode, InternalAgentNode, InternalMapNode, InternalDSL } from '@axiom-lattice/protocols';
12
12
  export { _axiom_lattice_protocols as Protocols };
13
13
  export { AgentConfig, AgentType, GraphBuildOptions, MemoryType } from '@axiom-lattice/protocols';
14
14
  import * as langchain from 'langchain';
@@ -16,12 +16,13 @@ import { ReactAgent, AgentMiddleware, StructuredTool as StructuredTool$1, Interr
16
16
  import z, { z as z$1 } from 'zod';
17
17
  import { BaseStore, BaseCheckpointSaver } from '@langchain/langgraph-checkpoint';
18
18
  import * as _langchain_core_tools from '@langchain/core/tools';
19
- import { StructuredTool } from '@langchain/core/tools';
19
+ import { StructuredTool, DynamicStructuredTool } from '@langchain/core/tools';
20
20
  import * as _langchain_langgraph from '@langchain/langgraph';
21
21
  import { CompiledStateGraph, CommandParams, AnnotationRoot } from '@langchain/langgraph';
22
22
  import { ReplaySubject } from 'rxjs';
23
23
  import { Embeddings } from '@langchain/core/embeddings';
24
24
  import { VectorStore } from '@langchain/core/vectorstores';
25
+ import { DocumentInterface } from '@langchain/core/documents';
25
26
  import { Connection, MultiServerMCPClient } from '@langchain/mcp-adapters';
26
27
  import { SandboxClient } from '@agent-infra/sandbox';
27
28
  import { Sandbox } from 'e2b';
@@ -905,68 +906,57 @@ declare class CustomMetricsClient implements IMetricsServerClient {
905
906
  */
906
907
  declare class MetricsServerManager {
907
908
  private static instance;
908
- private clients;
909
909
  private configs;
910
910
  private defaultServerKeys;
911
- private _loadingPromise;
912
911
  private constructor();
913
912
  /**
914
913
  * Get the singleton instance
915
914
  */
916
915
  static getInstance(): MetricsServerManager;
917
916
  /**
918
- * Ensure configurations are loaded from the store lattice.
919
- * Uses a promise-lock to prevent concurrent loads.
917
+ * Get or create tenant configs map
920
918
  */
921
- private _ensureLoaded;
919
+ private getTenantConfigs;
922
920
  /**
923
- * Get or create tenant clients map
921
+ * Create a metrics client from config.
922
+ * Clients are stateless HTTP wrappers — cheap to create on every call.
924
923
  */
925
- private getTenantClients;
924
+ private _createClient;
926
925
  /**
927
- * Get or create tenant configs map
926
+ * Resolve a server config for a tenant. Queries the store for freshness.
927
+ * When store has no data, falls back to in-memory cache.
928
928
  */
929
- private getTenantConfigs;
929
+ private _resolveConfig;
930
930
  /**
931
- * Register a metrics server for a tenant
932
- * @param tenantId - Tenant identifier
933
- * @param key - Unique identifier for the server
934
- * @param config - Metrics server configuration
931
+ * Register a metrics server for a tenant. Stores config in memory
932
+ * for fallback / programmatic registration use.
935
933
  */
936
934
  registerServer(tenantId: string, key: string, config: MetricsServerConfig): void;
937
935
  /**
938
936
  * Set the default metrics server for a tenant
939
- * @param tenantId - Tenant identifier
940
- * @param key - Server key to set as default
941
937
  */
942
938
  setDefaultServer(tenantId: string, key: string): void;
943
939
  /**
944
- * Get a metrics server client by key for a specific tenant
945
- * @param tenantId - Tenant identifier
946
- * @param key - Server key (optional, uses default if not provided)
940
+ * Get a metrics server client for a tenant.
941
+ * Always queries the store for the latest config, creates a fresh client.
942
+ * Falls back to in-memory cache when store is unavailable.
947
943
  */
948
944
  getClient(tenantId: string, key?: string): Promise<IMetricsServerClient>;
949
945
  /**
950
- * Get metrics server configuration by key for a specific tenant
951
- * @param tenantId - Tenant identifier
952
- * @param key - Server key (optional, uses default if not provided)
946
+ * Get metrics server configuration for a tenant.
947
+ * Always queries the store for freshness.
948
+ * Falls back to in-memory cache when store is unavailable.
953
949
  */
954
950
  getConfig(tenantId: string, key?: string): Promise<MetricsServerConfig>;
955
951
  /**
956
- * Ensure server configs are loaded from the store.
957
- * Public wrapper around the internal lazy-loading mechanism.
958
- * Safe to call multiple times — loading happens at most once.
959
- */
960
- ensureLoaded(): Promise<void>;
961
- /**
962
- * Check if a metrics server is registered for a tenant
963
- * @param tenantId - Tenant identifier
964
- * @param key - Server key
952
+ * Check if a metrics server exists in the in-memory cache.
953
+ * For store-backed existence checks, use getClient() or getConfig().
965
954
  */
966
955
  hasServer(tenantId: string, key: string): boolean;
967
956
  /**
968
- * Get all registered metrics server keys with their types for a tenant
969
- * @param tenantId - Tenant identifier
957
+ * Get all registered metrics server keys for a tenant.
958
+ * Queries the store directly. Falls back to in-memory cache
959
+ * when the store has no data for this tenant.
970
960
  */
971
961
  getServerKeys(tenantId: string): Promise<{
972
962
  key: string;
@@ -975,13 +965,10 @@ declare class MetricsServerManager {
975
965
  }[]>;
976
966
  /**
977
967
  * Remove a metrics server for a tenant
978
- * @param tenantId - Tenant identifier
979
- * @param key - Server key
980
968
  */
981
969
  removeServer(tenantId: string, key: string): void;
982
970
  /**
983
971
  * Clear all metrics servers for a tenant
984
- * @param tenantId - Tenant identifier (optional, clears all if not provided)
985
972
  */
986
973
  clear(tenantId?: string): void;
987
974
  /**
@@ -2707,6 +2694,7 @@ type StoreTypeMap = {
2707
2694
  thread: ThreadStore;
2708
2695
  assistant: AssistantStore;
2709
2696
  skill: SkillStore;
2697
+ collection: CollectionStore;
2710
2698
  workspace: WorkspaceStore;
2711
2699
  project: ProjectStore;
2712
2700
  database: DatabaseConfigStore;
@@ -2826,6 +2814,7 @@ type Store = Partial<{
2826
2814
  }> & {
2827
2815
  schedule?: object;
2828
2816
  checkpoint?: object;
2817
+ vectorStoreProvider?: VectorStoreProvider;
2829
2818
  };
2830
2819
  /**
2831
2820
  * Replace stores in the "default" lattice with the given implementations.
@@ -3540,6 +3529,44 @@ declare class InMemoryTaskStore implements TaskStore {
3540
3529
  clear(tenantId?: string): void;
3541
3530
  }
3542
3531
 
3532
+ /**
3533
+ * InMemoryCollectionStore
3534
+ *
3535
+ * In-memory implementation of CollectionStore
3536
+ * Provides CRUD operations for collection metadata stored in memory
3537
+ */
3538
+
3539
+ /**
3540
+ * In-memory implementation of CollectionStore with tenant isolation
3541
+ */
3542
+ declare class InMemoryCollectionStore implements CollectionStore {
3543
+ private collections;
3544
+ /**
3545
+ * Get all collections for a tenant
3546
+ */
3547
+ getAllCollections(tenantId: string): Promise<Collection[]>;
3548
+ /**
3549
+ * Get collection by name
3550
+ */
3551
+ getCollectionByName(tenantId: string, name: string): Promise<Collection | null>;
3552
+ /**
3553
+ * Create a new collection
3554
+ */
3555
+ createCollection(tenantId: string, data: CreateCollectionRequest): Promise<Collection>;
3556
+ /**
3557
+ * Update an existing collection
3558
+ */
3559
+ updateCollection(tenantId: string, name: string, updates: UpdateCollectionRequest): Promise<Collection | null>;
3560
+ /**
3561
+ * Delete a collection by name
3562
+ */
3563
+ deleteCollection(tenantId: string, name: string): Promise<boolean>;
3564
+ /**
3565
+ * Clear all collections for a tenant (useful for testing)
3566
+ */
3567
+ clear(tenantId?: string): void;
3568
+ }
3569
+
3543
3570
  declare class InMemoryMenuStore implements MenuRegistry {
3544
3571
  private items;
3545
3572
  list(params: {
@@ -3562,6 +3589,11 @@ declare class InMemoryMenuStore implements MenuRegistry {
3562
3589
  interface EmbeddingsLatticeInterface {
3563
3590
  key: string;
3564
3591
  client: Embeddings;
3592
+ label: string;
3593
+ }
3594
+ interface EmbeddingsInfo {
3595
+ key: string;
3596
+ label: string;
3565
3597
  }
3566
3598
  /**
3567
3599
  * EmbeddingsLatticeManager - Singleton embeddings Lattice manager
@@ -3581,8 +3613,13 @@ declare class EmbeddingsLatticeManager extends BaseLatticeManager<EmbeddingsLatt
3581
3613
  * Register embeddings Lattice
3582
3614
  * @param key Lattice key name
3583
3615
  * @param embeddings Embeddings instance
3616
+ * @param label Optional display label (auto-derived if not provided)
3617
+ */
3618
+ registerLattice(key: string, embeddings: Embeddings, label?: string): void;
3619
+ /**
3620
+ * Get all registered embeddings as { key, label } info list
3584
3621
  */
3585
- registerLattice(key: string, embeddings: Embeddings): void;
3622
+ getAllEmbeddingsInfo(): EmbeddingsInfo[];
3586
3623
  /**
3587
3624
  * Get EmbeddingsLattice
3588
3625
  * @param key Lattice key name
@@ -3621,7 +3658,7 @@ declare class EmbeddingsLatticeManager extends BaseLatticeManager<EmbeddingsLatt
3621
3658
  getEmbeddingsClient(key: string): Embeddings;
3622
3659
  }
3623
3660
  declare const embeddingsLatticeManager: EmbeddingsLatticeManager;
3624
- declare const registerEmbeddingsLattice: (key: string, embeddings: Embeddings) => void;
3661
+ declare const registerEmbeddingsLattice: (key: string, embeddings: Embeddings, label?: string) => void;
3625
3662
  declare const getEmbeddingsLattice: (key: string) => EmbeddingsLatticeInterface;
3626
3663
  declare const getEmbeddingsClient: (key: string) => Embeddings<number[]>;
3627
3664
 
@@ -3695,6 +3732,64 @@ declare const registerVectorStoreLattice: (key: string, vectorStore: VectorStore
3695
3732
  declare const getVectorStoreLattice: (key: string) => VectorStoreLatticeInterface;
3696
3733
  declare const getVectorStoreClient: (key: string) => VectorStore;
3697
3734
 
3735
+ /**
3736
+ * VectorStoreProviderManager
3737
+ *
3738
+ * Singleton registry for VectorStoreProvider instances.
3739
+ * Each provider key maps to a backend (memory, pgvector, chroma, etc.).
3740
+ * Follows the same pattern as EmbeddingsLatticeManager.
3741
+ */
3742
+
3743
+ /**
3744
+ * VectorStoreProvider Lattice Interface
3745
+ */
3746
+ interface VectorStoreProviderLattice {
3747
+ key: string;
3748
+ provider: VectorStoreProvider;
3749
+ }
3750
+ /**
3751
+ * VectorStoreProviderManager - Singleton provider Lattice manager
3752
+ * Responsible for registering and managing VectorStoreProvider backends
3753
+ */
3754
+ declare class VectorStoreProviderManager extends BaseLatticeManager<VectorStoreProviderLattice> {
3755
+ private static _instance;
3756
+ /**
3757
+ * Get VectorStoreProviderManager singleton instance
3758
+ */
3759
+ static getInstance(): VectorStoreProviderManager;
3760
+ /**
3761
+ * Get Lattice type prefix
3762
+ */
3763
+ protected getLatticeType(): string;
3764
+ /**
3765
+ * Register a VectorStore provider
3766
+ * @param key Provider key name
3767
+ * @param provider VectorStoreProvider implementation
3768
+ */
3769
+ registerProvider(key: string, provider: VectorStoreProvider): void;
3770
+ /**
3771
+ * Get a VectorStore provider by key
3772
+ * @param key Provider key name
3773
+ * @returns VectorStoreProvider instance
3774
+ */
3775
+ getProvider(key: string): VectorStoreProvider;
3776
+ /**
3777
+ * Get all registered providers
3778
+ */
3779
+ getAllProviders(): VectorStoreProviderLattice[];
3780
+ /**
3781
+ * Check if provider exists
3782
+ */
3783
+ hasProvider(key: string): boolean;
3784
+ /**
3785
+ * Remove a provider
3786
+ */
3787
+ removeProvider(key: string): boolean;
3788
+ }
3789
+ declare const vectorStoreProviderManager: VectorStoreProviderManager;
3790
+ declare const registerVectorStoreProvider: (key: string, provider: VectorStoreProvider) => void;
3791
+ declare const getVectorStoreProvider: (key: string) => VectorStoreProvider;
3792
+
3698
3793
  /**
3699
3794
  * LoggerLatticeManager
3700
3795
  *
@@ -4080,11 +4175,106 @@ declare function getBuiltInSkillNames(): string[];
4080
4175
  */
4081
4176
  declare function isBuiltInSkill(name: string): boolean;
4082
4177
 
4178
+ /**
4179
+ * CollectionLatticeManager
4180
+ *
4181
+ * Pure store facade for collection metadata management.
4182
+ * All reads go directly to the configured CollectionStore — no in-memory cache.
4183
+ * VectorStore lifecycle (create/destroy) is handled by the gateway service layer.
4184
+ */
4185
+
4186
+ /**
4187
+ * CollectionLatticeManager - Singleton manager for collection metadata.
4188
+ * Every operation reads/writes the configured CollectionStore from StoreLatticeManager.
4189
+ * No in-memory cache — data always comes from the store.
4190
+ */
4191
+ declare class CollectionLatticeManager {
4192
+ private static _instance;
4193
+ static getInstance(): CollectionLatticeManager;
4194
+ private getStore;
4195
+ registerCollection(tenantId: string, data: CreateCollectionRequest): Promise<Collection>;
4196
+ getCollection(tenantId: string, name: string): Promise<Collection | null>;
4197
+ getAllCollections(tenantId: string): Promise<Collection[]>;
4198
+ removeCollection(tenantId: string, name: string): Promise<boolean>;
4199
+ updateCollection(tenantId: string, name: string, updates: UpdateCollectionRequest): Promise<Collection | null>;
4200
+ }
4201
+ declare const collectionLatticeManager: CollectionLatticeManager;
4202
+
4203
+ /**
4204
+ * CollectionVectorStoreHelper
4205
+ *
4206
+ * Provides helpers for managing tenant-isolated VectorStore instances per collection.
4207
+ * Delegates creation to the registered VectorStoreProvider.
4208
+ *
4209
+ * Key format: "{tenantId}:{collectionName}"
4210
+ * Table format: "tenant_{tenantId}_{collectionName}"
4211
+ */
4212
+
4213
+ declare function buildTableName(tenantId: string, name: string): string;
4214
+ /**
4215
+ * Get or create a tenant-isolated VectorStore for a collection.
4216
+ */
4217
+ declare function getOrCreateCollectionVectorStore(name: string, embeddingKey: string, tenantId: string, providerKey?: string): Promise<any>;
4218
+ /**
4219
+ * Get entry count for a collection.
4220
+ * Tries vector store's native method first, falls back to provider.
4221
+ */
4222
+ declare function getCollectionEntryCount(name: string, embeddingKey: string, tenantId: string): Promise<number>;
4223
+ /**
4224
+ * List all entries in a collection.
4225
+ * Tries vector store's native method first, falls back to provider.
4226
+ */
4227
+ declare function listCollectionEntries(name: string, embeddingKey: string, tenantId: string): Promise<DocumentInterface[]>;
4228
+ /**
4229
+ * Remove a tenant-isolated vector store registration and drop the underlying table.
4230
+ */
4231
+ declare function removeCollectionVectorStore(name: string, tenantId: string): Promise<void>;
4232
+
4233
+ /**
4234
+ * SimpleMemoryVectorStore
4235
+ *
4236
+ * Minimal in-memory VectorStore implementation that satisfies the LangChain
4237
+ * VectorStore interface. Used as the default backend when no external vector
4238
+ * store (PGVector, Chroma, etc.) is registered.
4239
+ */
4240
+
4241
+ declare class SimpleMemoryVectorStore extends VectorStore {
4242
+ _vectorstoreType(): string;
4243
+ private vectors;
4244
+ constructor(embeddings: Embeddings);
4245
+ /**
4246
+ * Add pre-computed vectors with their documents.
4247
+ */
4248
+ addVectors(vectors: number[][], documents: DocumentInterface[], _options?: Record<string, unknown>): Promise<string[]>;
4249
+ /**
4250
+ * Add documents (will be embedded automatically by the VectorStore base class).
4251
+ */
4252
+ addDocuments(documents: DocumentInterface[], _options?: Record<string, unknown>): Promise<string[]>;
4253
+ /**
4254
+ * Delete documents by filter.
4255
+ */
4256
+ delete(params?: Record<string, unknown>): Promise<void>;
4257
+ /**
4258
+ * Similarity search with vector and scores.
4259
+ */
4260
+ similaritySearchVectorWithScore(query: number[], k: number, filter?: this["FilterType"]): Promise<[DocumentInterface, number][]>;
4261
+ /**
4262
+ * Get all stored documents (non-standard, used for listing entries).
4263
+ */
4264
+ getAllDocuments(): DocumentInterface[];
4265
+ /**
4266
+ * Get document count.
4267
+ */
4268
+ getDocumentCount(): number;
4269
+ }
4270
+
4083
4271
  /**
4084
4272
  * McpLatticeManager
4085
4273
  *
4086
- * MCP Lattice Manager - Manages MCP client connections using MultiServerMCPClient
4087
- * Follows the singleton pattern for global access
4274
+ * MCP Lattice Manager - Manages MCP client connections.
4275
+ * Each MCP server gets its own independent MultiServerMCPClient instance,
4276
+ * so adding/removing servers never affects other servers' connections or tools.
4277
+ * Follows the singleton pattern for global access.
4088
4278
  */
4089
4279
 
4090
4280
  interface McpServerInfo {
@@ -4097,24 +4287,71 @@ interface McpLatticeInterface {
4097
4287
  }
4098
4288
  declare class McpLatticeManager extends BaseLatticeManager<McpLatticeInterface> {
4099
4289
  private static _instance;
4100
- private client;
4290
+ /** One MultiServerMCPClient per server, keyed by server name */
4291
+ private clients;
4292
+ /** Server connection configs, keyed by server name */
4101
4293
  private servers;
4294
+ /** Track registered tool keys per server for cleanup */
4295
+ private registeredToolKeys;
4102
4296
  static getInstance(): McpLatticeManager;
4103
4297
  protected getLatticeType(): string;
4104
4298
  registerServers(servers: McpServerInfo[]): void;
4105
4299
  addServer(name: string, connection: Connection): void;
4106
- removeServer(name: string): boolean;
4300
+ /**
4301
+ * Remove a server. Closes its client and unregisters its tools.
4302
+ */
4303
+ removeServer(name: string): Promise<boolean>;
4304
+ /**
4305
+ * Connect all registered servers that are not yet connected.
4306
+ * Each server gets its own MultiServerMCPClient instance.
4307
+ * Existing connections are not affected.
4308
+ */
4107
4309
  connect(): Promise<void>;
4310
+ /**
4311
+ * Reconnect a single server: close old client, create new one, re-register tools.
4312
+ */
4313
+ reconnectServer(name: string): Promise<void>;
4108
4314
  disconnect(): Promise<void>;
4109
4315
  isConnected(): boolean;
4110
- getAllTools(): Promise<any[]>;
4316
+ isServerConnected(name: string): boolean;
4317
+ /**
4318
+ * Get tools from a specific server using raw MCP protocol.
4319
+ * Returns native JSON schema tools — suitable for API responses.
4320
+ */
4321
+ getServerTools(serverName: string): Promise<McpTool[]>;
4322
+ /**
4323
+ * Get all tools from all servers as McpTool[] (API format).
4324
+ */
4325
+ getAllTools(): Promise<McpTool[]>;
4326
+ /**
4327
+ * Get raw LangChain DynamicStructuredTool objects for ToolLattice registration.
4328
+ * Optionally filtered by server name.
4329
+ */
4330
+ getRawTools(serverName?: string): Promise<DynamicStructuredTool[]>;
4111
4331
  getServerNames(): string[];
4112
4332
  hasServer(name: string): boolean;
4113
4333
  /**
4114
- * MCP 工具注册到 Tool Lattice
4115
- * @param prefix 工具键名前缀,用于区分不同服务器的工具
4334
+ * Build the tool lattice key for an MCP tool.
4335
+ */
4336
+ static buildToolKey(serverName: string, toolName: string): string;
4337
+ /**
4338
+ * Unregister all tools for a specific server from ToolLattice.
4339
+ */
4340
+ unregisterServerTools(serverName: string): void;
4341
+ /**
4342
+ * Register MCP tools from a specific server to Tool Lattice.
4343
+ * Tools are registered with key pattern: mcp:{serverName}:{toolName}
4344
+ * Only registers tools whose names are in selectedTools (if provided).
4345
+ */
4346
+ registerToolsToToolLattice(serverName: string, selectedTools?: string[]): Promise<void>;
4347
+ /**
4348
+ * Test a single MCP server connection using a standalone client.
4349
+ * Does not affect the global mcpManager state.
4116
4350
  */
4117
- registerToolsToToolLattice(prefix?: string): Promise<void>;
4351
+ static testConnection(serverName: string, connection: Connection): Promise<{
4352
+ tools: McpTool[];
4353
+ latency: number;
4354
+ }>;
4118
4355
  }
4119
4356
  declare const mcpManager: McpLatticeManager;
4120
4357
 
@@ -6964,4 +7201,4 @@ declare class PersonalAssistantConfig {
6964
7201
  static render(config: AgentConfig, name: string, personality: string): void;
6965
7202
  }
6966
7203
 
6967
- export { AGENT_TASK_EVENT, type AddMessageParams, Agent, type AgentClient, type AgentExecutor, AgentInstanceManager, type AgentLattice, AgentLatticeManager, type AgentLifecycleEventName, AgentManager, type AgentStreamExecutor, type AgentThreadInterface, BUILTIN_SKILLS, type BackendFactory, type BackendProtocol, type BufferStats, type CacheEntry, type Chunk, ChunkBuffer, ChunkBufferLatticeManager, type ColumnInfo, CompositeBackend, type ConnectAllChannelsOptions, ConsoleLoggerClient, type CreateProcessingAgentParams, type CreateSandboxProviderConfig, type CronFields, CustomMetricsClient, type CustomMiddlewareFactory, CustomMiddlewareRegistry, type DatabaseConfig, type DatabaseType, DaytonaInstance, DaytonaProvider, type DaytonaProviderConfig, DefaultScheduleClient, E2BInstance, E2BProvider, type E2BProviderConfig, EMPTY_CONTENT_WARNING, type EditResult, type EmbeddingsLatticeInterface, EmbeddingsLatticeManager, type EnsureMicrosandboxInput, type FileData, type FileInfo, FileSystemSkillStore, type FileSystemSkillStoreOptions, FilesystemBackend, type FsEntry, type GrepMatch, type IMessageQueueStore, type IMetricsServerClient, type ISqlDatabase, InMemoryA2AApiKeyStore, InMemoryAssistantStore, InMemoryBindingStore, InMemoryChannelInstallationStore, InMemoryChunkBuffer, InMemoryDatabaseConfigStore, InMemoryMailboxStore, InMemoryMenuStore, InMemoryTaskListStore, InMemoryTaskStore, InMemoryTenantStore, InMemoryThreadMessageQueueStore, InMemoryThreadStore, InMemoryUserStore, InMemoryUserTenantLinkStore, LINE_NUMBER_WIDTH, type LangGraphStateChecker, LocalSandboxInstance, LocalSandboxProvider, type LocalSandboxProviderConfig, 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, MicrosandboxRemoteInstance, MicrosandboxRemoteProvider, type MicrosandboxRemoteProviderClient, type MicrosandboxRemoteProviderConfig, MicrosandboxServiceClient, type MicrosandboxServiceClientConfig, type MicrosandboxShellExecInput, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, MysqlDatabase, type PendingMessage, PersonalAssistantConfig, PinoLoggerClient, PostgresDatabase, PrometheusClient, type QueryResult, type QueueLattice, QueueLatticeManager, QueueMode, type QueuePendingEvent, RemoteSandboxInstance, RemoteSandboxProvider, type RemoteSandboxProviderConfig, type ResolveAgentFn, type RunSandboxConfig, type RuntimeModelConfig, type SandboxFileInfo, type SandboxFileService, SandboxFilesystem, type SandboxInstance, type SandboxIsolationLevel, SandboxLatticeManager, type SandboxManagerProtocol, type SandboxProvider, type SandboxShellService, SandboxSkillStore, type SandboxSkillStoreOptions, type SandboxVolumeDefinition, type ScheduleLattice, ScheduleLatticeManager, type SchedulerMiddlewareOptions, SemanticMetricsClient, type SharePayload, type SkillLattice, SkillLatticeManager, type SkillMeta, 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, TokenCache, type ToolDefinition, type ToolLattice, ToolLatticeManager, type TopologyEdge, type UnknownToolHandlerConfig, type VectorStoreLatticeInterface, VectorStoreLatticeManager, VolumeFilesystem, type VolumeFsClient, type WorkflowValidationError, type WriteResult, agentInstanceManager, agentLatticeManager, buildGrepResultsDict, buildInput, buildNamedVolumeName, buildSandboxMetadataEnv, buildSkillFile, buildStateAnnotation, checkEmptyContent, clearEncryptionKeyCache, compileInternal, compileWorkflow, computeSandboxName, configureStores, connectAllChannels, createAgentNode, createAgentTeam, createExecuteSqlQueryTool, createFileData, createInfoSqlTool, createListMetricsDataSourcesTool, createListMetricsServersTool, createListTablesSqlTool, createMapNode, createModelSelectorMiddleware, createNodeHandler, createProcessingAgent, createQueryCheckerSqlTool, createQueryMetricDefinitionTool, createQueryMetricsListTool, createQuerySemanticMetricDataTool, createQuerySqlTool, createQueryTableDefinitionTool, createQueryTablesListTool, createResourceAddress, createSandboxProvider, createSchedulerMiddleware, createSharePayload, createTaskMiddleware, createTeamMiddleware, createTeammateTools, createUnknownToolHandlerMiddleware, createWidgetMiddleware, decrypt, describeCronExpression, embeddingsLatticeManager, encrypt, ensureBuiltinAgentsForTenant, eventBus, eventBus as eventBusDefault, extractFetcherError, extractOutput, fileDataToString, formatContentWithLineNumbers, formatGrepMatches, formatGrepResults, formatReadResponse, generateToken, getAgentClient, getAgentConfig, getAllAgentConfigs, getAllBuiltInSkillMetas, getAllToolDefinitions, getBindingRegistry, getBuiltInSkillContent, getBuiltInSkillMeta, getBuiltInSkillNames, getCheckpointSaver, getChunkBuffer, getEmbeddingsClient, getEmbeddingsLattice, getEncryptionKey, getLoggerLattice, getMenuRegistry, getModelLattice, getNextCronTime, getQueueLattice, getSandBoxManager, getScheduleLattice, getStoreLattice, getToolClient, getToolDefinition, getToolLattice, getVectorStoreClient, getVectorStoreLattice, globSearchFiles, grepMatchesFromFiles, grepSearchFiles, hasChunkBuffer, invokeWithRetry, isBuiltInSkill, isUsingDefaultKey, isValidCronExpression, isValidSandboxName, isValidSkillName, loggerLatticeManager, mcpManager, metricsServerManager, modelLatticeManager, normalizeSandboxName, parallelLimit, parseCronExpression, parseSkillFrontmatter, parseYaml, performStringReplacement, queueLatticeManager, registerAgentLattice, registerAgentLatticeWithTenant, registerAgentLattices, registerCheckpointSaver, registerChunkBuffer, registerEmbeddingsLattice, registerExistingTool, registerLoggerLattice, registerModelLattice, registerQueueLattice, registerScheduleLattice, registerStoreLattice, registerTeammateAgent, registerToolLattice, registerVectorStoreLattice, renderTemplate, resolvePath, sandboxLatticeManager, sanitizeToolCallId, scheduleLatticeManager, setBindingRegistry, setMenuRegistry, skillLatticeManager, sqlDatabaseManager, storeLatticeManager, toJsonSchema, toSafeStateExpr, toolLatticeManager, truncateIfTooLong, unregisterTeammateAgent, updateFileData, validateAgentInput, validateDSL, validateEncryptionKey, validatePath, validateSkillName, validateToolInput, vectorStoreLatticeManager };
7204
+ export { AGENT_TASK_EVENT, type AddMessageParams, Agent, type AgentClient, type AgentExecutor, AgentInstanceManager, type AgentLattice, AgentLatticeManager, type AgentLifecycleEventName, AgentManager, type AgentStreamExecutor, type AgentThreadInterface, BUILTIN_SKILLS, type BackendFactory, type BackendProtocol, type BufferStats, type CacheEntry, type Chunk, ChunkBuffer, ChunkBufferLatticeManager, CollectionLatticeManager, type ColumnInfo, CompositeBackend, type ConnectAllChannelsOptions, ConsoleLoggerClient, type CreateProcessingAgentParams, type CreateSandboxProviderConfig, type CronFields, CustomMetricsClient, type CustomMiddlewareFactory, CustomMiddlewareRegistry, type DatabaseConfig, type DatabaseType, DaytonaInstance, DaytonaProvider, type DaytonaProviderConfig, DefaultScheduleClient, E2BInstance, E2BProvider, type E2BProviderConfig, EMPTY_CONTENT_WARNING, type EditResult, type EmbeddingsInfo, type EmbeddingsLatticeInterface, EmbeddingsLatticeManager, type EnsureMicrosandboxInput, type FileData, type FileInfo, FileSystemSkillStore, type FileSystemSkillStoreOptions, FilesystemBackend, type FsEntry, type GrepMatch, type IMessageQueueStore, type IMetricsServerClient, type ISqlDatabase, InMemoryA2AApiKeyStore, InMemoryAssistantStore, InMemoryBindingStore, InMemoryChannelInstallationStore, InMemoryChunkBuffer, InMemoryCollectionStore, InMemoryDatabaseConfigStore, InMemoryMailboxStore, InMemoryMenuStore, InMemoryTaskListStore, InMemoryTaskStore, InMemoryTenantStore, InMemoryThreadMessageQueueStore, InMemoryThreadStore, InMemoryUserStore, InMemoryUserTenantLinkStore, LINE_NUMBER_WIDTH, type LangGraphStateChecker, LocalSandboxInstance, LocalSandboxProvider, type LocalSandboxProviderConfig, 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, MicrosandboxRemoteInstance, MicrosandboxRemoteProvider, type MicrosandboxRemoteProviderClient, type MicrosandboxRemoteProviderConfig, MicrosandboxServiceClient, type MicrosandboxServiceClientConfig, type MicrosandboxShellExecInput, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, MysqlDatabase, type PendingMessage, PersonalAssistantConfig, PinoLoggerClient, PostgresDatabase, PrometheusClient, type QueryResult, type QueueLattice, QueueLatticeManager, QueueMode, type QueuePendingEvent, RemoteSandboxInstance, RemoteSandboxProvider, type RemoteSandboxProviderConfig, type ResolveAgentFn, type RunSandboxConfig, type RuntimeModelConfig, type SandboxFileInfo, type SandboxFileService, SandboxFilesystem, type SandboxInstance, type SandboxIsolationLevel, SandboxLatticeManager, type SandboxManagerProtocol, type SandboxProvider, type SandboxShellService, SandboxSkillStore, type SandboxSkillStoreOptions, type SandboxVolumeDefinition, type ScheduleLattice, ScheduleLatticeManager, type SchedulerMiddlewareOptions, SemanticMetricsClient, type SharePayload, SimpleMemoryVectorStore, type SkillLattice, SkillLatticeManager, type SkillMeta, 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, TokenCache, type ToolDefinition, type ToolLattice, ToolLatticeManager, type TopologyEdge, type UnknownToolHandlerConfig, type VectorStoreLatticeInterface, VectorStoreLatticeManager, type VectorStoreProviderLattice, VectorStoreProviderManager, VolumeFilesystem, type VolumeFsClient, type WorkflowValidationError, type WriteResult, agentInstanceManager, agentLatticeManager, buildGrepResultsDict, buildInput, buildNamedVolumeName, buildSandboxMetadataEnv, buildSkillFile, buildStateAnnotation, buildTableName, checkEmptyContent, clearEncryptionKeyCache, collectionLatticeManager, compileInternal, compileWorkflow, computeSandboxName, configureStores, connectAllChannels, createAgentNode, createAgentTeam, createExecuteSqlQueryTool, createFileData, createInfoSqlTool, createListMetricsDataSourcesTool, createListMetricsServersTool, createListTablesSqlTool, createMapNode, createModelSelectorMiddleware, createNodeHandler, createProcessingAgent, createQueryCheckerSqlTool, createQueryMetricDefinitionTool, createQueryMetricsListTool, createQuerySemanticMetricDataTool, createQuerySqlTool, createQueryTableDefinitionTool, createQueryTablesListTool, createResourceAddress, createSandboxProvider, createSchedulerMiddleware, createSharePayload, createTaskMiddleware, createTeamMiddleware, createTeammateTools, createUnknownToolHandlerMiddleware, createWidgetMiddleware, decrypt, describeCronExpression, embeddingsLatticeManager, encrypt, ensureBuiltinAgentsForTenant, eventBus, eventBus as eventBusDefault, extractFetcherError, extractOutput, fileDataToString, formatContentWithLineNumbers, formatGrepMatches, formatGrepResults, formatReadResponse, generateToken, getAgentClient, getAgentConfig, getAllAgentConfigs, getAllBuiltInSkillMetas, getAllToolDefinitions, getBindingRegistry, getBuiltInSkillContent, getBuiltInSkillMeta, getBuiltInSkillNames, getCheckpointSaver, getChunkBuffer, getCollectionEntryCount, getEmbeddingsClient, getEmbeddingsLattice, getEncryptionKey, getLoggerLattice, getMenuRegistry, getModelLattice, getNextCronTime, getOrCreateCollectionVectorStore, getQueueLattice, getSandBoxManager, getScheduleLattice, getStoreLattice, getToolClient, getToolDefinition, getToolLattice, getVectorStoreClient, getVectorStoreLattice, getVectorStoreProvider, globSearchFiles, grepMatchesFromFiles, grepSearchFiles, hasChunkBuffer, invokeWithRetry, isBuiltInSkill, isUsingDefaultKey, isValidCronExpression, isValidSandboxName, isValidSkillName, listCollectionEntries, loggerLatticeManager, mcpManager, metricsServerManager, modelLatticeManager, normalizeSandboxName, parallelLimit, parseCronExpression, parseSkillFrontmatter, parseYaml, performStringReplacement, queueLatticeManager, registerAgentLattice, registerAgentLatticeWithTenant, registerAgentLattices, registerCheckpointSaver, registerChunkBuffer, registerEmbeddingsLattice, registerExistingTool, registerLoggerLattice, registerModelLattice, registerQueueLattice, registerScheduleLattice, registerStoreLattice, registerTeammateAgent, registerToolLattice, registerVectorStoreLattice, registerVectorStoreProvider, removeCollectionVectorStore, renderTemplate, resolvePath, sandboxLatticeManager, sanitizeToolCallId, scheduleLatticeManager, setBindingRegistry, setMenuRegistry, skillLatticeManager, sqlDatabaseManager, storeLatticeManager, toJsonSchema, toSafeStateExpr, toolLatticeManager, truncateIfTooLong, unregisterTeammateAgent, updateFileData, validateAgentInput, validateDSL, validateEncryptionKey, validatePath, validateSkillName, validateToolInput, vectorStoreLatticeManager, vectorStoreProviderManager };