@axiom-lattice/core 2.1.2 → 2.1.4
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 +161 -2
- package/dist/index.d.ts +161 -2
- package/dist/index.js +433 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +420 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ 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, ToolConfig, ToolExecutor, AgentConfig, GraphBuildOptions, MessageChunk } from '@axiom-lattice/protocols';
|
|
8
|
+
import { LLMConfig, ToolConfig, ToolExecutor, AgentConfig, GraphBuildOptions, MessageChunk, QueueLatticeProtocol, QueueConfig, QueueClient, QueueResult } 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';
|
|
@@ -647,4 +647,163 @@ declare const getChunkBuffer: (key: string) => ChunkBuffer | undefined;
|
|
|
647
647
|
declare const registerChunkBuffer: (key: string, buffer: ChunkBuffer) => void;
|
|
648
648
|
declare const hasChunkBuffer: (key: string) => boolean;
|
|
649
649
|
|
|
650
|
-
|
|
650
|
+
/**
|
|
651
|
+
* QueueLatticeManager
|
|
652
|
+
*
|
|
653
|
+
* Queue Lattice manager for registering and managing queue services
|
|
654
|
+
*/
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* Queue Lattice interface
|
|
658
|
+
*/
|
|
659
|
+
interface QueueLattice extends QueueLatticeProtocol {
|
|
660
|
+
key: string;
|
|
661
|
+
config: QueueConfig;
|
|
662
|
+
client: QueueLatticeProtocol["client"];
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* QueueLatticeManager - Singleton queue Lattice manager
|
|
666
|
+
* Responsible for registering and managing various queue service Lattices
|
|
667
|
+
*/
|
|
668
|
+
declare class QueueLatticeManager extends BaseLatticeManager<QueueLattice> {
|
|
669
|
+
private static _instance;
|
|
670
|
+
/**
|
|
671
|
+
* Get QueueLatticeManager singleton instance
|
|
672
|
+
*/
|
|
673
|
+
static getInstance(): QueueLatticeManager;
|
|
674
|
+
/**
|
|
675
|
+
* Get Lattice type prefix
|
|
676
|
+
*/
|
|
677
|
+
protected getLatticeType(): string;
|
|
678
|
+
/**
|
|
679
|
+
* Register queue Lattice
|
|
680
|
+
* @param key Lattice key name
|
|
681
|
+
* @param config Queue configuration
|
|
682
|
+
* @param client Optional queue client. If not provided, will create based on config type.
|
|
683
|
+
* For REDIS type, client must be provided (use @axiom-lattice/queue-redis).
|
|
684
|
+
*/
|
|
685
|
+
registerLattice(key: string, config: QueueConfig, client?: QueueClient): void;
|
|
686
|
+
/**
|
|
687
|
+
* Get QueueLattice
|
|
688
|
+
* @param key Lattice key name
|
|
689
|
+
*/
|
|
690
|
+
getQueueLattice(key: string): QueueLattice;
|
|
691
|
+
/**
|
|
692
|
+
* Get all Lattices
|
|
693
|
+
*/
|
|
694
|
+
getAllLattices(): QueueLattice[];
|
|
695
|
+
/**
|
|
696
|
+
* Check if Lattice exists
|
|
697
|
+
* @param key Lattice key name
|
|
698
|
+
*/
|
|
699
|
+
hasLattice(key: string): boolean;
|
|
700
|
+
/**
|
|
701
|
+
* Remove Lattice
|
|
702
|
+
* @param key Lattice key name
|
|
703
|
+
*/
|
|
704
|
+
removeLattice(key: string): boolean;
|
|
705
|
+
/**
|
|
706
|
+
* Clear all Lattices
|
|
707
|
+
*/
|
|
708
|
+
clearLattices(): void;
|
|
709
|
+
/**
|
|
710
|
+
* Get Lattice count
|
|
711
|
+
*/
|
|
712
|
+
getLatticeCount(): number;
|
|
713
|
+
/**
|
|
714
|
+
* Get Lattice key list
|
|
715
|
+
*/
|
|
716
|
+
getLatticeKeys(): string[];
|
|
717
|
+
}
|
|
718
|
+
declare const queueLatticeManager: QueueLatticeManager;
|
|
719
|
+
declare const registerQueueLattice: (key: string, config: QueueConfig, client?: QueueClient) => void;
|
|
720
|
+
declare const getQueueLattice: (key: string) => QueueLattice;
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* MemoryQueueClient
|
|
724
|
+
*
|
|
725
|
+
* In-memory queue service implementation
|
|
726
|
+
*/
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Memory-based queue client implementation
|
|
730
|
+
*/
|
|
731
|
+
declare class MemoryQueueClient implements QueueClient {
|
|
732
|
+
private queueName;
|
|
733
|
+
constructor(queueName?: string);
|
|
734
|
+
/**
|
|
735
|
+
* Enqueue message (equivalent to lPush - push to left/beginning)
|
|
736
|
+
*/
|
|
737
|
+
push(item: any): Promise<QueueResult<number>>;
|
|
738
|
+
/**
|
|
739
|
+
* Dequeue message (equivalent to rPop - pop from right/end)
|
|
740
|
+
*/
|
|
741
|
+
pop(): Promise<QueueResult<any>>;
|
|
742
|
+
/**
|
|
743
|
+
* Create queue (initialize in memory)
|
|
744
|
+
*/
|
|
745
|
+
createQueue(): Promise<{
|
|
746
|
+
success: boolean;
|
|
747
|
+
queue_name?: string;
|
|
748
|
+
error?: any;
|
|
749
|
+
}>;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Event bus service
|
|
754
|
+
* Used for event publishing and subscription between internal system components
|
|
755
|
+
*/
|
|
756
|
+
declare class EventBus {
|
|
757
|
+
private emitter;
|
|
758
|
+
private defaultQueueKey;
|
|
759
|
+
constructor();
|
|
760
|
+
/**
|
|
761
|
+
* Set the default queue key for queue operations
|
|
762
|
+
* @param queueKey Queue key name
|
|
763
|
+
*/
|
|
764
|
+
setDefaultQueueKey(queueKey: string): void;
|
|
765
|
+
/**
|
|
766
|
+
* Publish event
|
|
767
|
+
* @param eventName Event name
|
|
768
|
+
* @param data Event data
|
|
769
|
+
* @param useQueue Whether to use queue for publishing
|
|
770
|
+
*/
|
|
771
|
+
publish(eventName: string, data: any, useQueue?: boolean): void;
|
|
772
|
+
/**
|
|
773
|
+
* Subscribe to event
|
|
774
|
+
* @param eventName Event name
|
|
775
|
+
* @param callback Callback function
|
|
776
|
+
*/
|
|
777
|
+
subscribe(eventName: string, callback: (data: any) => void): void;
|
|
778
|
+
/**
|
|
779
|
+
* Unsubscribe from event
|
|
780
|
+
* @param eventName Event name
|
|
781
|
+
* @param callback Callback function
|
|
782
|
+
*/
|
|
783
|
+
unsubscribe(eventName: string, callback: (data: any) => void): void;
|
|
784
|
+
/**
|
|
785
|
+
* Subscribe to event once
|
|
786
|
+
* @param eventName Event name
|
|
787
|
+
* @param callback Callback function
|
|
788
|
+
*/
|
|
789
|
+
subscribeOnce(eventName: string, callback: (data: any) => void): void;
|
|
790
|
+
}
|
|
791
|
+
declare const eventBus: EventBus;
|
|
792
|
+
|
|
793
|
+
declare class AgentManager {
|
|
794
|
+
private static instance;
|
|
795
|
+
private constructor();
|
|
796
|
+
private agents;
|
|
797
|
+
static getInstance(): AgentManager;
|
|
798
|
+
callAgentInQueue(queue: {
|
|
799
|
+
assistant_id: string;
|
|
800
|
+
input?: any;
|
|
801
|
+
thread_id: string;
|
|
802
|
+
command?: any;
|
|
803
|
+
"x-tenant-id"?: string;
|
|
804
|
+
}, return_agent_state?: boolean): Promise<unknown>;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
declare const AGENT_TASK_EVENT = "agent:execute";
|
|
808
|
+
|
|
809
|
+
export { AGENT_TASK_EVENT, type AgentClient, type AgentLattice, AgentLatticeManager, AgentManager, type BufferStats, type Chunk, ChunkBuffer, ChunkBufferLatticeManager, InMemoryChunkBuffer, MemoryLatticeManager, MemoryQueueClient, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, type QueueLattice, QueueLatticeManager, type ThreadBuffer, type ThreadBufferConfig, ThreadStatus, type ToolDefinition, type ToolLattice, ToolLatticeManager, agentLatticeManager, eventBus, eventBus as eventBusDefault, getAgentClient, getAgentConfig, getAgentLattice, getAllAgentConfigs, getAllToolDefinitions, getCheckpointSaver, getChunkBuffer, getModelLattice, getQueueLattice, getToolClient, getToolDefinition, getToolLattice, hasChunkBuffer, modelLatticeManager, queueLatticeManager, registerAgentLattice, registerAgentLattices, registerCheckpointSaver, registerChunkBuffer, registerModelLattice, registerQueueLattice, registerToolLattice, toolLatticeManager, validateAgentInput, validateToolInput };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ 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, ToolConfig, ToolExecutor, AgentConfig, GraphBuildOptions, MessageChunk } from '@axiom-lattice/protocols';
|
|
8
|
+
import { LLMConfig, ToolConfig, ToolExecutor, AgentConfig, GraphBuildOptions, MessageChunk, QueueLatticeProtocol, QueueConfig, QueueClient, QueueResult } 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';
|
|
@@ -647,4 +647,163 @@ declare const getChunkBuffer: (key: string) => ChunkBuffer | undefined;
|
|
|
647
647
|
declare const registerChunkBuffer: (key: string, buffer: ChunkBuffer) => void;
|
|
648
648
|
declare const hasChunkBuffer: (key: string) => boolean;
|
|
649
649
|
|
|
650
|
-
|
|
650
|
+
/**
|
|
651
|
+
* QueueLatticeManager
|
|
652
|
+
*
|
|
653
|
+
* Queue Lattice manager for registering and managing queue services
|
|
654
|
+
*/
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* Queue Lattice interface
|
|
658
|
+
*/
|
|
659
|
+
interface QueueLattice extends QueueLatticeProtocol {
|
|
660
|
+
key: string;
|
|
661
|
+
config: QueueConfig;
|
|
662
|
+
client: QueueLatticeProtocol["client"];
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* QueueLatticeManager - Singleton queue Lattice manager
|
|
666
|
+
* Responsible for registering and managing various queue service Lattices
|
|
667
|
+
*/
|
|
668
|
+
declare class QueueLatticeManager extends BaseLatticeManager<QueueLattice> {
|
|
669
|
+
private static _instance;
|
|
670
|
+
/**
|
|
671
|
+
* Get QueueLatticeManager singleton instance
|
|
672
|
+
*/
|
|
673
|
+
static getInstance(): QueueLatticeManager;
|
|
674
|
+
/**
|
|
675
|
+
* Get Lattice type prefix
|
|
676
|
+
*/
|
|
677
|
+
protected getLatticeType(): string;
|
|
678
|
+
/**
|
|
679
|
+
* Register queue Lattice
|
|
680
|
+
* @param key Lattice key name
|
|
681
|
+
* @param config Queue configuration
|
|
682
|
+
* @param client Optional queue client. If not provided, will create based on config type.
|
|
683
|
+
* For REDIS type, client must be provided (use @axiom-lattice/queue-redis).
|
|
684
|
+
*/
|
|
685
|
+
registerLattice(key: string, config: QueueConfig, client?: QueueClient): void;
|
|
686
|
+
/**
|
|
687
|
+
* Get QueueLattice
|
|
688
|
+
* @param key Lattice key name
|
|
689
|
+
*/
|
|
690
|
+
getQueueLattice(key: string): QueueLattice;
|
|
691
|
+
/**
|
|
692
|
+
* Get all Lattices
|
|
693
|
+
*/
|
|
694
|
+
getAllLattices(): QueueLattice[];
|
|
695
|
+
/**
|
|
696
|
+
* Check if Lattice exists
|
|
697
|
+
* @param key Lattice key name
|
|
698
|
+
*/
|
|
699
|
+
hasLattice(key: string): boolean;
|
|
700
|
+
/**
|
|
701
|
+
* Remove Lattice
|
|
702
|
+
* @param key Lattice key name
|
|
703
|
+
*/
|
|
704
|
+
removeLattice(key: string): boolean;
|
|
705
|
+
/**
|
|
706
|
+
* Clear all Lattices
|
|
707
|
+
*/
|
|
708
|
+
clearLattices(): void;
|
|
709
|
+
/**
|
|
710
|
+
* Get Lattice count
|
|
711
|
+
*/
|
|
712
|
+
getLatticeCount(): number;
|
|
713
|
+
/**
|
|
714
|
+
* Get Lattice key list
|
|
715
|
+
*/
|
|
716
|
+
getLatticeKeys(): string[];
|
|
717
|
+
}
|
|
718
|
+
declare const queueLatticeManager: QueueLatticeManager;
|
|
719
|
+
declare const registerQueueLattice: (key: string, config: QueueConfig, client?: QueueClient) => void;
|
|
720
|
+
declare const getQueueLattice: (key: string) => QueueLattice;
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* MemoryQueueClient
|
|
724
|
+
*
|
|
725
|
+
* In-memory queue service implementation
|
|
726
|
+
*/
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Memory-based queue client implementation
|
|
730
|
+
*/
|
|
731
|
+
declare class MemoryQueueClient implements QueueClient {
|
|
732
|
+
private queueName;
|
|
733
|
+
constructor(queueName?: string);
|
|
734
|
+
/**
|
|
735
|
+
* Enqueue message (equivalent to lPush - push to left/beginning)
|
|
736
|
+
*/
|
|
737
|
+
push(item: any): Promise<QueueResult<number>>;
|
|
738
|
+
/**
|
|
739
|
+
* Dequeue message (equivalent to rPop - pop from right/end)
|
|
740
|
+
*/
|
|
741
|
+
pop(): Promise<QueueResult<any>>;
|
|
742
|
+
/**
|
|
743
|
+
* Create queue (initialize in memory)
|
|
744
|
+
*/
|
|
745
|
+
createQueue(): Promise<{
|
|
746
|
+
success: boolean;
|
|
747
|
+
queue_name?: string;
|
|
748
|
+
error?: any;
|
|
749
|
+
}>;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Event bus service
|
|
754
|
+
* Used for event publishing and subscription between internal system components
|
|
755
|
+
*/
|
|
756
|
+
declare class EventBus {
|
|
757
|
+
private emitter;
|
|
758
|
+
private defaultQueueKey;
|
|
759
|
+
constructor();
|
|
760
|
+
/**
|
|
761
|
+
* Set the default queue key for queue operations
|
|
762
|
+
* @param queueKey Queue key name
|
|
763
|
+
*/
|
|
764
|
+
setDefaultQueueKey(queueKey: string): void;
|
|
765
|
+
/**
|
|
766
|
+
* Publish event
|
|
767
|
+
* @param eventName Event name
|
|
768
|
+
* @param data Event data
|
|
769
|
+
* @param useQueue Whether to use queue for publishing
|
|
770
|
+
*/
|
|
771
|
+
publish(eventName: string, data: any, useQueue?: boolean): void;
|
|
772
|
+
/**
|
|
773
|
+
* Subscribe to event
|
|
774
|
+
* @param eventName Event name
|
|
775
|
+
* @param callback Callback function
|
|
776
|
+
*/
|
|
777
|
+
subscribe(eventName: string, callback: (data: any) => void): void;
|
|
778
|
+
/**
|
|
779
|
+
* Unsubscribe from event
|
|
780
|
+
* @param eventName Event name
|
|
781
|
+
* @param callback Callback function
|
|
782
|
+
*/
|
|
783
|
+
unsubscribe(eventName: string, callback: (data: any) => void): void;
|
|
784
|
+
/**
|
|
785
|
+
* Subscribe to event once
|
|
786
|
+
* @param eventName Event name
|
|
787
|
+
* @param callback Callback function
|
|
788
|
+
*/
|
|
789
|
+
subscribeOnce(eventName: string, callback: (data: any) => void): void;
|
|
790
|
+
}
|
|
791
|
+
declare const eventBus: EventBus;
|
|
792
|
+
|
|
793
|
+
declare class AgentManager {
|
|
794
|
+
private static instance;
|
|
795
|
+
private constructor();
|
|
796
|
+
private agents;
|
|
797
|
+
static getInstance(): AgentManager;
|
|
798
|
+
callAgentInQueue(queue: {
|
|
799
|
+
assistant_id: string;
|
|
800
|
+
input?: any;
|
|
801
|
+
thread_id: string;
|
|
802
|
+
command?: any;
|
|
803
|
+
"x-tenant-id"?: string;
|
|
804
|
+
}, return_agent_state?: boolean): Promise<unknown>;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
declare const AGENT_TASK_EVENT = "agent:execute";
|
|
808
|
+
|
|
809
|
+
export { AGENT_TASK_EVENT, type AgentClient, type AgentLattice, AgentLatticeManager, AgentManager, type BufferStats, type Chunk, ChunkBuffer, ChunkBufferLatticeManager, InMemoryChunkBuffer, MemoryLatticeManager, MemoryQueueClient, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, type QueueLattice, QueueLatticeManager, type ThreadBuffer, type ThreadBufferConfig, ThreadStatus, type ToolDefinition, type ToolLattice, ToolLatticeManager, agentLatticeManager, eventBus, eventBus as eventBusDefault, getAgentClient, getAgentConfig, getAgentLattice, getAllAgentConfigs, getAllToolDefinitions, getCheckpointSaver, getChunkBuffer, getModelLattice, getQueueLattice, getToolClient, getToolDefinition, getToolLattice, hasChunkBuffer, modelLatticeManager, queueLatticeManager, registerAgentLattice, registerAgentLattices, registerCheckpointSaver, registerChunkBuffer, registerModelLattice, registerQueueLattice, registerToolLattice, toolLatticeManager, validateAgentInput, validateToolInput };
|