@axiom-lattice/core 1.0.26 → 1.0.27

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
@@ -5,10 +5,12 @@ import { BaseChatModel, BaseChatModelCallOptions } from '@langchain/core/languag
5
5
  import { BaseLanguageModelInput } from '@langchain/core/language_models/base';
6
6
  import { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';
7
7
  import { ChatResult } from '@langchain/core/outputs';
8
- import { LLMConfig, AgentConfig, GraphBuildOptions } from '@axiom-lattice/protocols';
8
+ import { LLMConfig, ToolConfig, ToolExecutor, AgentConfig, GraphBuildOptions } from '@axiom-lattice/protocols';
9
9
  import * as protocols from '@axiom-lattice/protocols';
10
10
  export { protocols as Protocols };
11
11
  export { AgentConfig, AgentType, GraphBuildOptions, MemoryType } from '@axiom-lattice/protocols';
12
+ import * as _langchain_core_tools from '@langchain/core/tools';
13
+ import { StructuredTool } from '@langchain/core/tools';
12
14
  import { CompiledStateGraph } from '@langchain/langgraph';
13
15
  import { BaseCheckpointSaver } from '@langchain/langgraph-checkpoint';
14
16
 
@@ -200,6 +202,93 @@ declare const modelLatticeManager: ModelLatticeManager;
200
202
  declare const registerModelLattice: (key: string, config: ModelConfig) => void;
201
203
  declare const getModelLattice: (key: string) => ModelLatticeInterface;
202
204
 
205
+ type ToolDefinition = ToolConfig;
206
+ interface ToolLattice {
207
+ key: string;
208
+ config: ToolConfig;
209
+ client: StructuredTool;
210
+ }
211
+ /**
212
+ * ToolLatticeManager - 单例工具Lattice管理器
213
+ * 负责注册、管理各种工具Lattice
214
+ */
215
+ declare class ToolLatticeManager extends BaseLatticeManager<ToolLattice> {
216
+ private static _instance;
217
+ /**
218
+ * 获取ToolLatticeManager单例实例
219
+ */
220
+ static getInstance(): ToolLatticeManager;
221
+ /**
222
+ * 获取Lattice类型前缀
223
+ */
224
+ protected getLatticeType(): string;
225
+ /**
226
+ * 注册工具Lattice
227
+ * @param key Lattice键名
228
+ * @param config 工具配置(定义)
229
+ * @param executor 工具执行函数
230
+ */
231
+ registerLattice<TInput = any, TOutput = any>(key: string, config: ToolConfig, executor: ToolExecutor<TInput, TOutput>): void;
232
+ /**
233
+ * 获取ToolLattice
234
+ * @param key Lattice键名
235
+ */
236
+ getToolLattice(key: string): ToolLattice | undefined;
237
+ /**
238
+ * 获取所有Lattice
239
+ */
240
+ getAllLattices(): ToolLattice[];
241
+ /**
242
+ * 检查Lattice是否存在
243
+ * @param key Lattice键名
244
+ */
245
+ hasLattice(key: string): boolean;
246
+ /**
247
+ * 移除Lattice
248
+ * @param key Lattice键名
249
+ */
250
+ removeLattice(key: string): boolean;
251
+ /**
252
+ * 清空所有Lattice
253
+ */
254
+ clearLattices(): void;
255
+ /**
256
+ * 获取Lattice数量
257
+ */
258
+ getLatticeCount(): number;
259
+ /**
260
+ * 获取Lattice键名列表
261
+ */
262
+ getLatticeKeys(): string[];
263
+ /**
264
+ * 获取工具定义
265
+ * @param key Lattice键名
266
+ */
267
+ getToolDefinition(key: string): ToolDefinition;
268
+ /**
269
+ * 获取工具客户端
270
+ * @param key Lattice键名
271
+ */
272
+ getToolClient(key: string): StructuredTool;
273
+ /**
274
+ * 获取所有工具定义
275
+ */
276
+ getAllToolDefinitions(): ToolDefinition[];
277
+ /**
278
+ * 验证工具输入参数
279
+ * @param key Lattice键名
280
+ * @param input 输入参数
281
+ */
282
+ validateToolInput(key: string, input: any): boolean;
283
+ }
284
+ declare const toolLatticeManager: ToolLatticeManager;
285
+ declare const registerToolLattice: (key: string, config: ToolConfig, executor: ToolExecutor) => void;
286
+ declare const getToolLattice: (key: string) => ToolLattice | undefined;
287
+ declare const getToolDefinition: (key: string) => ToolConfig;
288
+ declare const getToolClient: (key: string) => StructuredTool<_langchain_core_tools.ToolSchemaBase, any, any, any>;
289
+ declare const getAllToolDefinitions: () => ToolConfig[];
290
+ declare const validateToolInput: (key: string, input: any) => boolean;
291
+
203
292
  /**
204
293
  * Agent Lattice 类型定义
205
294
  *
@@ -353,4 +442,4 @@ declare class MemoryLatticeManager extends BaseLatticeManager {
353
442
  declare const getCheckpointSaver: (key: string) => BaseCheckpointSaver<number>;
354
443
  declare const registerCheckpointSaver: (key: string, saver: BaseCheckpointSaver) => void;
355
444
 
356
- export { type AgentClient, type AgentLattice, AgentLatticeManager, MemoryLatticeManager, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, agentLatticeManager, getAgentClient, getAgentConfig, getAgentLattice, getAllAgentConfigs, getCheckpointSaver, getModelLattice, modelLatticeManager, registerAgentLattice, registerAgentLattices, registerCheckpointSaver, registerModelLattice, validateAgentInput };
445
+ export { type AgentClient, type AgentLattice, AgentLatticeManager, MemoryLatticeManager, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, type ToolDefinition, type ToolLattice, ToolLatticeManager, agentLatticeManager, getAgentClient, getAgentConfig, getAgentLattice, getAllAgentConfigs, getAllToolDefinitions, getCheckpointSaver, getModelLattice, getToolClient, getToolDefinition, getToolLattice, modelLatticeManager, registerAgentLattice, registerAgentLattices, registerCheckpointSaver, registerModelLattice, registerToolLattice, toolLatticeManager, validateAgentInput, validateToolInput };
package/dist/index.d.ts CHANGED
@@ -5,10 +5,12 @@ import { BaseChatModel, BaseChatModelCallOptions } from '@langchain/core/languag
5
5
  import { BaseLanguageModelInput } from '@langchain/core/language_models/base';
6
6
  import { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';
7
7
  import { ChatResult } from '@langchain/core/outputs';
8
- import { LLMConfig, AgentConfig, GraphBuildOptions } from '@axiom-lattice/protocols';
8
+ import { LLMConfig, ToolConfig, ToolExecutor, AgentConfig, GraphBuildOptions } from '@axiom-lattice/protocols';
9
9
  import * as protocols from '@axiom-lattice/protocols';
10
10
  export { protocols as Protocols };
11
11
  export { AgentConfig, AgentType, GraphBuildOptions, MemoryType } from '@axiom-lattice/protocols';
12
+ import * as _langchain_core_tools from '@langchain/core/tools';
13
+ import { StructuredTool } from '@langchain/core/tools';
12
14
  import { CompiledStateGraph } from '@langchain/langgraph';
13
15
  import { BaseCheckpointSaver } from '@langchain/langgraph-checkpoint';
14
16
 
@@ -200,6 +202,93 @@ declare const modelLatticeManager: ModelLatticeManager;
200
202
  declare const registerModelLattice: (key: string, config: ModelConfig) => void;
201
203
  declare const getModelLattice: (key: string) => ModelLatticeInterface;
202
204
 
205
+ type ToolDefinition = ToolConfig;
206
+ interface ToolLattice {
207
+ key: string;
208
+ config: ToolConfig;
209
+ client: StructuredTool;
210
+ }
211
+ /**
212
+ * ToolLatticeManager - 单例工具Lattice管理器
213
+ * 负责注册、管理各种工具Lattice
214
+ */
215
+ declare class ToolLatticeManager extends BaseLatticeManager<ToolLattice> {
216
+ private static _instance;
217
+ /**
218
+ * 获取ToolLatticeManager单例实例
219
+ */
220
+ static getInstance(): ToolLatticeManager;
221
+ /**
222
+ * 获取Lattice类型前缀
223
+ */
224
+ protected getLatticeType(): string;
225
+ /**
226
+ * 注册工具Lattice
227
+ * @param key Lattice键名
228
+ * @param config 工具配置(定义)
229
+ * @param executor 工具执行函数
230
+ */
231
+ registerLattice<TInput = any, TOutput = any>(key: string, config: ToolConfig, executor: ToolExecutor<TInput, TOutput>): void;
232
+ /**
233
+ * 获取ToolLattice
234
+ * @param key Lattice键名
235
+ */
236
+ getToolLattice(key: string): ToolLattice | undefined;
237
+ /**
238
+ * 获取所有Lattice
239
+ */
240
+ getAllLattices(): ToolLattice[];
241
+ /**
242
+ * 检查Lattice是否存在
243
+ * @param key Lattice键名
244
+ */
245
+ hasLattice(key: string): boolean;
246
+ /**
247
+ * 移除Lattice
248
+ * @param key Lattice键名
249
+ */
250
+ removeLattice(key: string): boolean;
251
+ /**
252
+ * 清空所有Lattice
253
+ */
254
+ clearLattices(): void;
255
+ /**
256
+ * 获取Lattice数量
257
+ */
258
+ getLatticeCount(): number;
259
+ /**
260
+ * 获取Lattice键名列表
261
+ */
262
+ getLatticeKeys(): string[];
263
+ /**
264
+ * 获取工具定义
265
+ * @param key Lattice键名
266
+ */
267
+ getToolDefinition(key: string): ToolDefinition;
268
+ /**
269
+ * 获取工具客户端
270
+ * @param key Lattice键名
271
+ */
272
+ getToolClient(key: string): StructuredTool;
273
+ /**
274
+ * 获取所有工具定义
275
+ */
276
+ getAllToolDefinitions(): ToolDefinition[];
277
+ /**
278
+ * 验证工具输入参数
279
+ * @param key Lattice键名
280
+ * @param input 输入参数
281
+ */
282
+ validateToolInput(key: string, input: any): boolean;
283
+ }
284
+ declare const toolLatticeManager: ToolLatticeManager;
285
+ declare const registerToolLattice: (key: string, config: ToolConfig, executor: ToolExecutor) => void;
286
+ declare const getToolLattice: (key: string) => ToolLattice | undefined;
287
+ declare const getToolDefinition: (key: string) => ToolConfig;
288
+ declare const getToolClient: (key: string) => StructuredTool<_langchain_core_tools.ToolSchemaBase, any, any, any>;
289
+ declare const getAllToolDefinitions: () => ToolConfig[];
290
+ declare const validateToolInput: (key: string, input: any) => boolean;
291
+
203
292
  /**
204
293
  * Agent Lattice 类型定义
205
294
  *
@@ -353,4 +442,4 @@ declare class MemoryLatticeManager extends BaseLatticeManager {
353
442
  declare const getCheckpointSaver: (key: string) => BaseCheckpointSaver<number>;
354
443
  declare const registerCheckpointSaver: (key: string, saver: BaseCheckpointSaver) => void;
355
444
 
356
- export { type AgentClient, type AgentLattice, AgentLatticeManager, MemoryLatticeManager, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, agentLatticeManager, getAgentClient, getAgentConfig, getAgentLattice, getAllAgentConfigs, getCheckpointSaver, getModelLattice, modelLatticeManager, registerAgentLattice, registerAgentLattices, registerCheckpointSaver, registerModelLattice, validateAgentInput };
445
+ export { type AgentClient, type AgentLattice, AgentLatticeManager, MemoryLatticeManager, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, type ToolDefinition, type ToolLattice, ToolLatticeManager, agentLatticeManager, getAgentClient, getAgentConfig, getAgentLattice, getAllAgentConfigs, getAllToolDefinitions, getCheckpointSaver, getModelLattice, getToolClient, getToolDefinition, getToolLattice, modelLatticeManager, registerAgentLattice, registerAgentLattices, registerCheckpointSaver, registerModelLattice, registerToolLattice, toolLatticeManager, validateAgentInput, validateToolInput };