@flutchai/flutch-sdk 0.1.27 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { JSONSchema7 } from 'json-schema';
2
2
  import * as _nestjs_common from '@nestjs/common';
3
- import { OnModuleInit, Logger, Type, CanActivate, ExecutionContext, DynamicModule } from '@nestjs/common';
3
+ import { OnModuleInit, Logger, CanActivate, ExecutionContext, Type, DynamicModule } from '@nestjs/common';
4
4
  import { ConfigService } from '@nestjs/config';
5
5
  import { HumanMessage, AIMessage, AIMessageChunk } from '@langchain/core/messages';
6
6
  import { BaseChannel, CompiledStateGraph, LangGraphRunnableConfig } from '@langchain/langgraph';
@@ -506,132 +506,6 @@ declare class GraphManifestValidator {
506
506
  static validateOrThrow(manifest: any): void;
507
507
  }
508
508
 
509
- interface IGraphTraceEvent {
510
- type: string;
511
- name?: string;
512
- channel?: string;
513
- nodeName?: string;
514
- timestamp: number;
515
- metadata?: Record<string, unknown>;
516
- data?: Record<string, unknown>;
517
- }
518
-
519
- interface VersionRoute {
520
- version: string;
521
- builderClass: Type<AbstractGraphBuilder<any>>;
522
- isDefault?: boolean;
523
- }
524
- interface VersioningConfig {
525
- baseGraphType: string;
526
- versions: VersionRoute[];
527
- defaultVersionStrategy?: "latest" | "explicit";
528
- }
529
- interface VersionResolution {
530
- version: string;
531
- builderClass: Type<AbstractGraphBuilder<any>>;
532
- fullGraphType: string;
533
- }
534
- interface VersionResolutionOptions {
535
- requestedVersion?: string;
536
- strict?: boolean;
537
- }
538
-
539
- declare class VersionedGraphService {
540
- private readonly logger;
541
- private readonly versionConfigs;
542
- constructor();
543
- registerVersioning(config: VersioningConfig): void;
544
- resolveVersion(graphType: string, options?: VersionResolutionOptions): Promise<VersionResolution>;
545
- createVersionedBuilder(graphType: string, moduleRef?: ModuleRef, options?: VersionResolutionOptions): Promise<AbstractGraphBuilder<any>>;
546
- getAvailableVersions(baseGraphType: string): string[];
547
- isVersionSupported(graphType: string, options?: VersionResolutionOptions): boolean;
548
- private findBestVersionRoute;
549
- private isVersionCompatible;
550
- getVersioningInfo(baseGraphType: string): VersioningConfig | null;
551
- }
552
-
553
- interface IGraphTracer {
554
- log(data: any): void;
555
- error(data: any): void;
556
- }
557
- interface IUsageRecorder {
558
- recordModelExecution(record: any): void;
559
- }
560
-
561
- type MappedChannels<T> = {
562
- [K in keyof T]: BaseChannel<T[K], T[K]>;
563
- };
564
- declare global {
565
- namespace GraphTypes {
566
- interface Registry {
567
- }
568
- }
569
- }
570
- type IGraphTypeRegistry = GraphTypes.Registry;
571
- interface IGenericGraphType {
572
- Params: any;
573
- State: any;
574
- Config: any;
575
- Input: any;
576
- Definition: any;
577
- ConfigDefinition: any;
578
- InputDefinition: any;
579
- StateValues: any;
580
- ConfigValues: any;
581
- InputValues: any;
582
- OutputValues: any;
583
- }
584
- type CompiledGraphFor<T extends string> = T extends keyof IGraphTypeRegistry ? CompiledStateGraph<IGraphTypeRegistry[T]["State"], IGraphTypeRegistry[T]["State"], string, IGraphTypeRegistry[T]["Input"], IGraphTypeRegistry[T]["State"], IGraphTypeRegistry[T]["Config"]> : CompiledStateGraph<any, any, string, any, any, any>;
585
- interface IGraphBuilder<T extends string> {
586
- buildGraph(config?: any): Promise<CompiledGraphFor<T>>;
587
- }
588
- interface IGraphCompiler {
589
- getConfiguredGraph<T extends string>(type: T, thread?: any): Promise<CompiledGraphFor<T>>;
590
- }
591
- type BaseGraphState = {};
592
- interface IGraphMetadata {
593
- workflowType: string;
594
- version: string;
595
- }
596
- interface IGraphConfigurable<TGraphSettings = any> {
597
- thread_id?: string;
598
- metadata?: IGraphMetadata;
599
- graphSettings: TGraphSettings;
600
- userId?: string;
601
- agentId?: string;
602
- }
603
- type IGraphRunnableConfig<TGraphSettings = any> = LangGraphRunnableConfig<IGraphConfigurable<TGraphSettings>> & {
604
- configurable: IGraphConfigurable<TGraphSettings>;
605
- };
606
- type StrictGraphRunnableConfig<TGraphSettings = any> = LangGraphRunnableConfig<TGraphSettings> & {
607
- configurable: IGraphConfigurable<TGraphSettings>;
608
- };
609
- interface LLMConfig {
610
- modelId: string;
611
- temperature?: number;
612
- maxTokens?: number;
613
- prompt?: string;
614
- }
615
- interface IGraphTypeMetadata {
616
- type: string;
617
- metadata: {
618
- title: string;
619
- description: string;
620
- detailedDescription: string;
621
- icon?: string;
622
- recommendations?: string[];
623
- tags?: string[];
624
- category?: string;
625
- };
626
- schema: {
627
- properties: Record<string, any>;
628
- required: string[];
629
- };
630
- defaultSettings: any;
631
- formFields?: any[];
632
- }
633
- type IGraphMetadataRegistry = Record<string, IGraphTypeMetadata>;
634
-
635
509
  declare class CallbackStore {
636
510
  private readonly redis;
637
511
  private readonly isProduction;
@@ -957,6 +831,141 @@ declare class CallbackController {
957
831
  handleCallback(req: CallbackRequest): Promise<CallbackResult>;
958
832
  }
959
833
 
834
+ declare abstract class ExternalGraphBuilder<V extends string = string> extends AbstractGraphBuilder<V> {
835
+ protected callbackRegistry: CallbackRegistry;
836
+ protected endpointRegistry: EndpointRegistry;
837
+ constructor();
838
+ protected registerCallbacks(): Promise<void>;
839
+ protected registerEndpoints(): Promise<void>;
840
+ protected registerEndpointsManually(endpoints: EndpointDescriptor[]): void;
841
+ }
842
+
843
+ interface IGraphTraceEvent {
844
+ type: string;
845
+ name?: string;
846
+ channel?: string;
847
+ nodeName?: string;
848
+ timestamp: number;
849
+ metadata?: Record<string, unknown>;
850
+ data?: Record<string, unknown>;
851
+ }
852
+
853
+ interface VersionRoute {
854
+ version: string;
855
+ builderClass: Type<AbstractGraphBuilder<any>>;
856
+ isDefault?: boolean;
857
+ }
858
+ interface VersioningConfig {
859
+ baseGraphType: string;
860
+ versions: VersionRoute[];
861
+ defaultVersionStrategy?: "latest" | "explicit";
862
+ }
863
+ interface VersionResolution {
864
+ version: string;
865
+ builderClass: Type<AbstractGraphBuilder<any>>;
866
+ fullGraphType: string;
867
+ }
868
+ interface VersionResolutionOptions {
869
+ requestedVersion?: string;
870
+ strict?: boolean;
871
+ }
872
+
873
+ declare class VersionedGraphService {
874
+ private readonly logger;
875
+ private readonly versionConfigs;
876
+ constructor();
877
+ registerVersioning(config: VersioningConfig): void;
878
+ resolveVersion(graphType: string, options?: VersionResolutionOptions): Promise<VersionResolution>;
879
+ createVersionedBuilder(graphType: string, moduleRef?: ModuleRef, options?: VersionResolutionOptions): Promise<AbstractGraphBuilder<any>>;
880
+ getAvailableVersions(baseGraphType: string): string[];
881
+ isVersionSupported(graphType: string, options?: VersionResolutionOptions): boolean;
882
+ private findBestVersionRoute;
883
+ private isVersionCompatible;
884
+ getVersioningInfo(baseGraphType: string): VersioningConfig | null;
885
+ }
886
+
887
+ interface IGraphTracer {
888
+ log(data: any): void;
889
+ error(data: any): void;
890
+ }
891
+ interface IUsageRecorder {
892
+ recordModelExecution(record: any): void;
893
+ }
894
+
895
+ type MappedChannels<T> = {
896
+ [K in keyof T]: BaseChannel<T[K], T[K]>;
897
+ };
898
+ declare global {
899
+ namespace GraphTypes {
900
+ interface Registry {
901
+ }
902
+ }
903
+ }
904
+ type IGraphTypeRegistry = GraphTypes.Registry;
905
+ interface IGenericGraphType {
906
+ Params: any;
907
+ State: any;
908
+ Config: any;
909
+ Input: any;
910
+ Definition: any;
911
+ ConfigDefinition: any;
912
+ InputDefinition: any;
913
+ StateValues: any;
914
+ ConfigValues: any;
915
+ InputValues: any;
916
+ OutputValues: any;
917
+ }
918
+ type CompiledGraphFor<T extends string> = T extends keyof IGraphTypeRegistry ? CompiledStateGraph<IGraphTypeRegistry[T]["State"], IGraphTypeRegistry[T]["State"], string, IGraphTypeRegistry[T]["Input"], IGraphTypeRegistry[T]["State"], IGraphTypeRegistry[T]["Config"]> : CompiledStateGraph<any, any, string, any, any, any>;
919
+ interface IGraphBuilder<T extends string> {
920
+ buildGraph(config?: any): Promise<CompiledGraphFor<T>>;
921
+ }
922
+ interface IGraphCompiler {
923
+ getConfiguredGraph<T extends string>(type: T, thread?: any): Promise<CompiledGraphFor<T>>;
924
+ }
925
+ type BaseGraphState = {};
926
+ interface IGraphMetadata {
927
+ workflowType: string;
928
+ version: string;
929
+ }
930
+ interface IGraphConfigurable<TGraphSettings = any> {
931
+ thread_id?: string;
932
+ metadata?: IGraphMetadata;
933
+ graphSettings: TGraphSettings;
934
+ userId?: string;
935
+ agentId?: string;
936
+ }
937
+ type IGraphRunnableConfig<TGraphSettings = any> = LangGraphRunnableConfig<IGraphConfigurable<TGraphSettings>> & {
938
+ configurable: IGraphConfigurable<TGraphSettings>;
939
+ };
940
+ type StrictGraphRunnableConfig<TGraphSettings = any> = LangGraphRunnableConfig<TGraphSettings> & {
941
+ configurable: IGraphConfigurable<TGraphSettings>;
942
+ };
943
+ interface LLMConfig {
944
+ modelId: string;
945
+ temperature?: number;
946
+ maxTokens?: number;
947
+ prompt?: string;
948
+ }
949
+ interface IGraphTypeMetadata {
950
+ type: string;
951
+ metadata: {
952
+ title: string;
953
+ description: string;
954
+ detailedDescription: string;
955
+ icon?: string;
956
+ recommendations?: string[];
957
+ tags?: string[];
958
+ category?: string;
959
+ };
960
+ schema: {
961
+ properties: Record<string, any>;
962
+ required: string[];
963
+ };
964
+ defaultSettings: any;
965
+ formFields?: any[];
966
+ }
967
+ type IGraphMetadataRegistry = Record<string, IGraphTypeMetadata>;
968
+
960
969
  interface BaseGraphContext {
961
970
  messageId?: string;
962
971
  threadId: string;
@@ -1016,8 +1025,6 @@ interface IGraphManifest {
1016
1025
  declare abstract class AbstractGraphBuilder<V extends string = string> {
1017
1026
  abstract readonly version: V;
1018
1027
  protected logger: Logger;
1019
- protected callbackRegistry: CallbackRegistry;
1020
- protected endpointRegistry: EndpointRegistry;
1021
1028
  get graphType(): string;
1022
1029
  protected manifestPath: string;
1023
1030
  protected manifest?: IGraphManifest;
@@ -1059,9 +1066,6 @@ declare abstract class AbstractGraphBuilder<V extends string = string> {
1059
1066
  }>;
1060
1067
  getFullGraphType(baseGraphType: string): string;
1061
1068
  validateVersion(): boolean;
1062
- protected registerCallbacks(): Promise<void>;
1063
- protected registerEndpoints(): Promise<void>;
1064
- protected registerEndpointsManually(endpoints: EndpointDescriptor[]): void;
1065
1069
  }
1066
1070
  interface IGraphEngine {
1067
1071
  invokeGraph(graph: any, config: any, signal?: AbortSignal): Promise<any>;
@@ -1608,4 +1612,4 @@ declare class StaticDiscovery implements ServiceDiscoveryProvider {
1608
1612
  }>>;
1609
1613
  }
1610
1614
 
1611
- export { type ACLValidationResult, AbstractGraphBuilder, type ApiCallTracerOptions, AttachmentType, type AuditEntry, type BaseGraphConfig, type BaseGraphContext, GraphController as BaseGraphServiceController, UniversalGraphModule as BaseGraphServiceModule, type BaseGraphState, BuilderRegistryService, Callback, CallbackACL, CallbackAuditAction, CallbackAuditor, type CallbackContext, CallbackController, type CallbackEntry, type CallbackHandler, type CallbackMetadata, CallbackMetrics, type CallbackPatch, type CallbackPatchHandler, CallbackPatchService, CallbackRateLimiter, type CallbackRecord, CallbackRegistry, type CallbackRequest, type CallbackResult, CallbackStore, CallbackTokenGuard, type CallbackUser, type ChannelState, type ChartType, ChatFeature, type ChatModelCreator, type ChatModelOrRunnable, type ChatModelWithTools, type CitationValue, type CompiledGraphFor, type ConcreteModels, type CustomDocument, DEFAULT_TRACER_OPTIONS, type DataEnvelope, ENDPOINT_METADATA_KEY, type EmbeddingModelCreator, Endpoint, type EndpointDescriptor, type EndpointHandler, type EndpointMetadata, type EndpointOptions, EndpointRegistry, EventProcessor, type ExtendedCallbackContext, type ExtendedCallbackHandler, FileBasedDiscovery, GraphController, GraphEngineFactory, GraphEngineType, GraphManifestSchema, GraphManifestValidator, GraphServiceTokens, GraphTypeUtils, type IAgentToolConfig, type IAgentToolConfiguration, type IAttachment, type IBaseEntity, type IChartDataPoint, type IChartDataset, type IChartValue, type IContentBlock, type IContentChain, type IDeletionInfo, type IGenericGraphType, type IGraphAttachment, type IGraphBuilder, type IGraphCompiler, type IGraphConfigurable, type IGraphEngine, type IGraphManifest, type IGraphMetadata, type IGraphMetadataRegistry, type IGraphRequestPayload, type IGraphResponsePayload, type IGraphRunnableConfig, type IGraphService, type IGraphServiceRegistry, type IGraphSettingsRepository, type IGraphTraceEvent, type IGraphTracer, type IGraphTypeMetadata, type IGraphTypeRegistry, type IModelInitializer, type IReasoningChain, type IReasoningStep, type IStoredMessageContent, type ISystemToolCredentials, type IToolCall, type IToolCatalog, type IToolConfigOption, type IToolExecutionContext, type ITracingEvent, type IUsageMetrics, type IUsageRecorder, type IdempotencyConfig, type IdempotencyEntry, IdempotencyManager, IdempotencyStatus, type KnowledgeBaseInfo, type LLMCallRecord, type LLMConfig, type LLModel, LangGraphEngine, type MappedChannels, McpConverter, type McpRuntimeClient, McpRuntimeHttpClient, type McpTool, McpToolFilter, type Model, type ModelByIdConfig, type ModelByIdWithTypeConfig, type ModelConfig, type ModelConfigFetcher, type ModelConfigWithToken, type ModelConfigWithTokenAndType, type ModelCreator, type ModelCreators, ModelInitializer, ModelProvider, ModelType, type MongoDBConfig, type RateLimitConfig, type RateLimitResult, type RequestContext, type RerankModelCreator, type RetrieveQueryOptions, type RetrieverConfig, RetrieverSearchType, RetrieverService, type RouterConfig, type ServiceDiscoveryProvider, SmartCallbackRouter, StaticDiscovery, type StreamAccumulator, StreamChannel, type StrictGraphRunnableConfig, TelegramPatchHandler, type ToolExecutionResult, type TraceApiCallResult, type TracingLevel, UIDispatchController, type UIDispatchDto, UIEndpoint, type UIEndpointClassMetadata, type UIEndpointMethodMetadata, UIEndpointsDiscoveryService, UniversalCallbackService, UniversalGraphModule, type UniversalGraphModuleOptions, UniversalGraphService, type VersionResolution, type VersionResolutionOptions, type VersionRoute, VersionedGraphService, type VersioningConfig, VoyageAIRerank, type VoyageAIRerankConfig, WebPatchHandler, WithCallbacks, WithEndpoints, WithUIEndpoints, bootstrap, createEndpointDescriptors, createGraphAttachment, createMongoClientAdapter, createStaticMessage, findCallbackMethod, findEndpointMethod, generateAttachmentSummary, getCallbackMetadata, getEndpointMetadata, getUIEndpointClassMetadata, getUIEndpointMethodsMetadata, hasCallbacks, hasUIEndpoints, registerFinanceExampleCallback, registerUIEndpointsFromClass, sanitizeTraceData, traceApiCall };
1615
+ export { type ACLValidationResult, AbstractGraphBuilder, type ApiCallTracerOptions, AttachmentType, type AuditEntry, type BaseGraphConfig, type BaseGraphContext, GraphController as BaseGraphServiceController, UniversalGraphModule as BaseGraphServiceModule, type BaseGraphState, BuilderRegistryService, Callback, CallbackACL, CallbackAuditAction, CallbackAuditor, type CallbackContext, CallbackController, type CallbackEntry, type CallbackHandler, type CallbackMetadata, CallbackMetrics, type CallbackPatch, type CallbackPatchHandler, CallbackPatchService, CallbackRateLimiter, type CallbackRecord, CallbackRegistry, type CallbackRequest, type CallbackResult, CallbackStore, CallbackTokenGuard, type CallbackUser, type ChannelState, type ChartType, ChatFeature, type ChatModelCreator, type ChatModelOrRunnable, type ChatModelWithTools, type CitationValue, type CompiledGraphFor, type ConcreteModels, type CustomDocument, DEFAULT_TRACER_OPTIONS, type DataEnvelope, ENDPOINT_METADATA_KEY, type EmbeddingModelCreator, Endpoint, type EndpointDescriptor, type EndpointHandler, type EndpointMetadata, type EndpointOptions, EndpointRegistry, EventProcessor, type ExtendedCallbackContext, type ExtendedCallbackHandler, ExternalGraphBuilder, FileBasedDiscovery, GraphController, GraphEngineFactory, GraphEngineType, GraphManifestSchema, GraphManifestValidator, GraphServiceTokens, GraphTypeUtils, type IAgentToolConfig, type IAgentToolConfiguration, type IAttachment, type IBaseEntity, type IChartDataPoint, type IChartDataset, type IChartValue, type IContentBlock, type IContentChain, type IDeletionInfo, type IGenericGraphType, type IGraphAttachment, type IGraphBuilder, type IGraphCompiler, type IGraphConfigurable, type IGraphEngine, type IGraphManifest, type IGraphMetadata, type IGraphMetadataRegistry, type IGraphRequestPayload, type IGraphResponsePayload, type IGraphRunnableConfig, type IGraphService, type IGraphServiceRegistry, type IGraphSettingsRepository, type IGraphTraceEvent, type IGraphTracer, type IGraphTypeMetadata, type IGraphTypeRegistry, type IModelInitializer, type IReasoningChain, type IReasoningStep, type IStoredMessageContent, type ISystemToolCredentials, type IToolCall, type IToolCatalog, type IToolConfigOption, type IToolExecutionContext, type ITracingEvent, type IUsageMetrics, type IUsageRecorder, type IdempotencyConfig, type IdempotencyEntry, IdempotencyManager, IdempotencyStatus, type KnowledgeBaseInfo, type LLMCallRecord, type LLMConfig, type LLModel, LangGraphEngine, type MappedChannels, McpConverter, type McpRuntimeClient, McpRuntimeHttpClient, type McpTool, McpToolFilter, type Model, type ModelByIdConfig, type ModelByIdWithTypeConfig, type ModelConfig, type ModelConfigFetcher, type ModelConfigWithToken, type ModelConfigWithTokenAndType, type ModelCreator, type ModelCreators, ModelInitializer, ModelProvider, ModelType, type MongoDBConfig, type RateLimitConfig, type RateLimitResult, type RequestContext, type RerankModelCreator, type RetrieveQueryOptions, type RetrieverConfig, RetrieverSearchType, RetrieverService, type RouterConfig, type ServiceDiscoveryProvider, SmartCallbackRouter, StaticDiscovery, type StreamAccumulator, StreamChannel, type StrictGraphRunnableConfig, TelegramPatchHandler, type ToolExecutionResult, type TraceApiCallResult, type TracingLevel, UIDispatchController, type UIDispatchDto, UIEndpoint, type UIEndpointClassMetadata, type UIEndpointMethodMetadata, UIEndpointsDiscoveryService, UniversalCallbackService, UniversalGraphModule, type UniversalGraphModuleOptions, UniversalGraphService, type VersionResolution, type VersionResolutionOptions, type VersionRoute, VersionedGraphService, type VersioningConfig, VoyageAIRerank, type VoyageAIRerankConfig, WebPatchHandler, WithCallbacks, WithEndpoints, WithUIEndpoints, bootstrap, createEndpointDescriptors, createGraphAttachment, createMongoClientAdapter, createStaticMessage, findCallbackMethod, findEndpointMethod, generateAttachmentSummary, getCallbackMetadata, getEndpointMetadata, getUIEndpointClassMetadata, getUIEndpointMethodsMetadata, hasCallbacks, hasUIEndpoints, registerFinanceExampleCallback, registerUIEndpointsFromClass, sanitizeTraceData, traceApiCall };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { JSONSchema7 } from 'json-schema';
2
2
  import * as _nestjs_common from '@nestjs/common';
3
- import { OnModuleInit, Logger, Type, CanActivate, ExecutionContext, DynamicModule } from '@nestjs/common';
3
+ import { OnModuleInit, Logger, CanActivate, ExecutionContext, Type, DynamicModule } from '@nestjs/common';
4
4
  import { ConfigService } from '@nestjs/config';
5
5
  import { HumanMessage, AIMessage, AIMessageChunk } from '@langchain/core/messages';
6
6
  import { BaseChannel, CompiledStateGraph, LangGraphRunnableConfig } from '@langchain/langgraph';
@@ -506,132 +506,6 @@ declare class GraphManifestValidator {
506
506
  static validateOrThrow(manifest: any): void;
507
507
  }
508
508
 
509
- interface IGraphTraceEvent {
510
- type: string;
511
- name?: string;
512
- channel?: string;
513
- nodeName?: string;
514
- timestamp: number;
515
- metadata?: Record<string, unknown>;
516
- data?: Record<string, unknown>;
517
- }
518
-
519
- interface VersionRoute {
520
- version: string;
521
- builderClass: Type<AbstractGraphBuilder<any>>;
522
- isDefault?: boolean;
523
- }
524
- interface VersioningConfig {
525
- baseGraphType: string;
526
- versions: VersionRoute[];
527
- defaultVersionStrategy?: "latest" | "explicit";
528
- }
529
- interface VersionResolution {
530
- version: string;
531
- builderClass: Type<AbstractGraphBuilder<any>>;
532
- fullGraphType: string;
533
- }
534
- interface VersionResolutionOptions {
535
- requestedVersion?: string;
536
- strict?: boolean;
537
- }
538
-
539
- declare class VersionedGraphService {
540
- private readonly logger;
541
- private readonly versionConfigs;
542
- constructor();
543
- registerVersioning(config: VersioningConfig): void;
544
- resolveVersion(graphType: string, options?: VersionResolutionOptions): Promise<VersionResolution>;
545
- createVersionedBuilder(graphType: string, moduleRef?: ModuleRef, options?: VersionResolutionOptions): Promise<AbstractGraphBuilder<any>>;
546
- getAvailableVersions(baseGraphType: string): string[];
547
- isVersionSupported(graphType: string, options?: VersionResolutionOptions): boolean;
548
- private findBestVersionRoute;
549
- private isVersionCompatible;
550
- getVersioningInfo(baseGraphType: string): VersioningConfig | null;
551
- }
552
-
553
- interface IGraphTracer {
554
- log(data: any): void;
555
- error(data: any): void;
556
- }
557
- interface IUsageRecorder {
558
- recordModelExecution(record: any): void;
559
- }
560
-
561
- type MappedChannels<T> = {
562
- [K in keyof T]: BaseChannel<T[K], T[K]>;
563
- };
564
- declare global {
565
- namespace GraphTypes {
566
- interface Registry {
567
- }
568
- }
569
- }
570
- type IGraphTypeRegistry = GraphTypes.Registry;
571
- interface IGenericGraphType {
572
- Params: any;
573
- State: any;
574
- Config: any;
575
- Input: any;
576
- Definition: any;
577
- ConfigDefinition: any;
578
- InputDefinition: any;
579
- StateValues: any;
580
- ConfigValues: any;
581
- InputValues: any;
582
- OutputValues: any;
583
- }
584
- type CompiledGraphFor<T extends string> = T extends keyof IGraphTypeRegistry ? CompiledStateGraph<IGraphTypeRegistry[T]["State"], IGraphTypeRegistry[T]["State"], string, IGraphTypeRegistry[T]["Input"], IGraphTypeRegistry[T]["State"], IGraphTypeRegistry[T]["Config"]> : CompiledStateGraph<any, any, string, any, any, any>;
585
- interface IGraphBuilder<T extends string> {
586
- buildGraph(config?: any): Promise<CompiledGraphFor<T>>;
587
- }
588
- interface IGraphCompiler {
589
- getConfiguredGraph<T extends string>(type: T, thread?: any): Promise<CompiledGraphFor<T>>;
590
- }
591
- type BaseGraphState = {};
592
- interface IGraphMetadata {
593
- workflowType: string;
594
- version: string;
595
- }
596
- interface IGraphConfigurable<TGraphSettings = any> {
597
- thread_id?: string;
598
- metadata?: IGraphMetadata;
599
- graphSettings: TGraphSettings;
600
- userId?: string;
601
- agentId?: string;
602
- }
603
- type IGraphRunnableConfig<TGraphSettings = any> = LangGraphRunnableConfig<IGraphConfigurable<TGraphSettings>> & {
604
- configurable: IGraphConfigurable<TGraphSettings>;
605
- };
606
- type StrictGraphRunnableConfig<TGraphSettings = any> = LangGraphRunnableConfig<TGraphSettings> & {
607
- configurable: IGraphConfigurable<TGraphSettings>;
608
- };
609
- interface LLMConfig {
610
- modelId: string;
611
- temperature?: number;
612
- maxTokens?: number;
613
- prompt?: string;
614
- }
615
- interface IGraphTypeMetadata {
616
- type: string;
617
- metadata: {
618
- title: string;
619
- description: string;
620
- detailedDescription: string;
621
- icon?: string;
622
- recommendations?: string[];
623
- tags?: string[];
624
- category?: string;
625
- };
626
- schema: {
627
- properties: Record<string, any>;
628
- required: string[];
629
- };
630
- defaultSettings: any;
631
- formFields?: any[];
632
- }
633
- type IGraphMetadataRegistry = Record<string, IGraphTypeMetadata>;
634
-
635
509
  declare class CallbackStore {
636
510
  private readonly redis;
637
511
  private readonly isProduction;
@@ -957,6 +831,141 @@ declare class CallbackController {
957
831
  handleCallback(req: CallbackRequest): Promise<CallbackResult>;
958
832
  }
959
833
 
834
+ declare abstract class ExternalGraphBuilder<V extends string = string> extends AbstractGraphBuilder<V> {
835
+ protected callbackRegistry: CallbackRegistry;
836
+ protected endpointRegistry: EndpointRegistry;
837
+ constructor();
838
+ protected registerCallbacks(): Promise<void>;
839
+ protected registerEndpoints(): Promise<void>;
840
+ protected registerEndpointsManually(endpoints: EndpointDescriptor[]): void;
841
+ }
842
+
843
+ interface IGraphTraceEvent {
844
+ type: string;
845
+ name?: string;
846
+ channel?: string;
847
+ nodeName?: string;
848
+ timestamp: number;
849
+ metadata?: Record<string, unknown>;
850
+ data?: Record<string, unknown>;
851
+ }
852
+
853
+ interface VersionRoute {
854
+ version: string;
855
+ builderClass: Type<AbstractGraphBuilder<any>>;
856
+ isDefault?: boolean;
857
+ }
858
+ interface VersioningConfig {
859
+ baseGraphType: string;
860
+ versions: VersionRoute[];
861
+ defaultVersionStrategy?: "latest" | "explicit";
862
+ }
863
+ interface VersionResolution {
864
+ version: string;
865
+ builderClass: Type<AbstractGraphBuilder<any>>;
866
+ fullGraphType: string;
867
+ }
868
+ interface VersionResolutionOptions {
869
+ requestedVersion?: string;
870
+ strict?: boolean;
871
+ }
872
+
873
+ declare class VersionedGraphService {
874
+ private readonly logger;
875
+ private readonly versionConfigs;
876
+ constructor();
877
+ registerVersioning(config: VersioningConfig): void;
878
+ resolveVersion(graphType: string, options?: VersionResolutionOptions): Promise<VersionResolution>;
879
+ createVersionedBuilder(graphType: string, moduleRef?: ModuleRef, options?: VersionResolutionOptions): Promise<AbstractGraphBuilder<any>>;
880
+ getAvailableVersions(baseGraphType: string): string[];
881
+ isVersionSupported(graphType: string, options?: VersionResolutionOptions): boolean;
882
+ private findBestVersionRoute;
883
+ private isVersionCompatible;
884
+ getVersioningInfo(baseGraphType: string): VersioningConfig | null;
885
+ }
886
+
887
+ interface IGraphTracer {
888
+ log(data: any): void;
889
+ error(data: any): void;
890
+ }
891
+ interface IUsageRecorder {
892
+ recordModelExecution(record: any): void;
893
+ }
894
+
895
+ type MappedChannels<T> = {
896
+ [K in keyof T]: BaseChannel<T[K], T[K]>;
897
+ };
898
+ declare global {
899
+ namespace GraphTypes {
900
+ interface Registry {
901
+ }
902
+ }
903
+ }
904
+ type IGraphTypeRegistry = GraphTypes.Registry;
905
+ interface IGenericGraphType {
906
+ Params: any;
907
+ State: any;
908
+ Config: any;
909
+ Input: any;
910
+ Definition: any;
911
+ ConfigDefinition: any;
912
+ InputDefinition: any;
913
+ StateValues: any;
914
+ ConfigValues: any;
915
+ InputValues: any;
916
+ OutputValues: any;
917
+ }
918
+ type CompiledGraphFor<T extends string> = T extends keyof IGraphTypeRegistry ? CompiledStateGraph<IGraphTypeRegistry[T]["State"], IGraphTypeRegistry[T]["State"], string, IGraphTypeRegistry[T]["Input"], IGraphTypeRegistry[T]["State"], IGraphTypeRegistry[T]["Config"]> : CompiledStateGraph<any, any, string, any, any, any>;
919
+ interface IGraphBuilder<T extends string> {
920
+ buildGraph(config?: any): Promise<CompiledGraphFor<T>>;
921
+ }
922
+ interface IGraphCompiler {
923
+ getConfiguredGraph<T extends string>(type: T, thread?: any): Promise<CompiledGraphFor<T>>;
924
+ }
925
+ type BaseGraphState = {};
926
+ interface IGraphMetadata {
927
+ workflowType: string;
928
+ version: string;
929
+ }
930
+ interface IGraphConfigurable<TGraphSettings = any> {
931
+ thread_id?: string;
932
+ metadata?: IGraphMetadata;
933
+ graphSettings: TGraphSettings;
934
+ userId?: string;
935
+ agentId?: string;
936
+ }
937
+ type IGraphRunnableConfig<TGraphSettings = any> = LangGraphRunnableConfig<IGraphConfigurable<TGraphSettings>> & {
938
+ configurable: IGraphConfigurable<TGraphSettings>;
939
+ };
940
+ type StrictGraphRunnableConfig<TGraphSettings = any> = LangGraphRunnableConfig<TGraphSettings> & {
941
+ configurable: IGraphConfigurable<TGraphSettings>;
942
+ };
943
+ interface LLMConfig {
944
+ modelId: string;
945
+ temperature?: number;
946
+ maxTokens?: number;
947
+ prompt?: string;
948
+ }
949
+ interface IGraphTypeMetadata {
950
+ type: string;
951
+ metadata: {
952
+ title: string;
953
+ description: string;
954
+ detailedDescription: string;
955
+ icon?: string;
956
+ recommendations?: string[];
957
+ tags?: string[];
958
+ category?: string;
959
+ };
960
+ schema: {
961
+ properties: Record<string, any>;
962
+ required: string[];
963
+ };
964
+ defaultSettings: any;
965
+ formFields?: any[];
966
+ }
967
+ type IGraphMetadataRegistry = Record<string, IGraphTypeMetadata>;
968
+
960
969
  interface BaseGraphContext {
961
970
  messageId?: string;
962
971
  threadId: string;
@@ -1016,8 +1025,6 @@ interface IGraphManifest {
1016
1025
  declare abstract class AbstractGraphBuilder<V extends string = string> {
1017
1026
  abstract readonly version: V;
1018
1027
  protected logger: Logger;
1019
- protected callbackRegistry: CallbackRegistry;
1020
- protected endpointRegistry: EndpointRegistry;
1021
1028
  get graphType(): string;
1022
1029
  protected manifestPath: string;
1023
1030
  protected manifest?: IGraphManifest;
@@ -1059,9 +1066,6 @@ declare abstract class AbstractGraphBuilder<V extends string = string> {
1059
1066
  }>;
1060
1067
  getFullGraphType(baseGraphType: string): string;
1061
1068
  validateVersion(): boolean;
1062
- protected registerCallbacks(): Promise<void>;
1063
- protected registerEndpoints(): Promise<void>;
1064
- protected registerEndpointsManually(endpoints: EndpointDescriptor[]): void;
1065
1069
  }
1066
1070
  interface IGraphEngine {
1067
1071
  invokeGraph(graph: any, config: any, signal?: AbortSignal): Promise<any>;
@@ -1608,4 +1612,4 @@ declare class StaticDiscovery implements ServiceDiscoveryProvider {
1608
1612
  }>>;
1609
1613
  }
1610
1614
 
1611
- export { type ACLValidationResult, AbstractGraphBuilder, type ApiCallTracerOptions, AttachmentType, type AuditEntry, type BaseGraphConfig, type BaseGraphContext, GraphController as BaseGraphServiceController, UniversalGraphModule as BaseGraphServiceModule, type BaseGraphState, BuilderRegistryService, Callback, CallbackACL, CallbackAuditAction, CallbackAuditor, type CallbackContext, CallbackController, type CallbackEntry, type CallbackHandler, type CallbackMetadata, CallbackMetrics, type CallbackPatch, type CallbackPatchHandler, CallbackPatchService, CallbackRateLimiter, type CallbackRecord, CallbackRegistry, type CallbackRequest, type CallbackResult, CallbackStore, CallbackTokenGuard, type CallbackUser, type ChannelState, type ChartType, ChatFeature, type ChatModelCreator, type ChatModelOrRunnable, type ChatModelWithTools, type CitationValue, type CompiledGraphFor, type ConcreteModels, type CustomDocument, DEFAULT_TRACER_OPTIONS, type DataEnvelope, ENDPOINT_METADATA_KEY, type EmbeddingModelCreator, Endpoint, type EndpointDescriptor, type EndpointHandler, type EndpointMetadata, type EndpointOptions, EndpointRegistry, EventProcessor, type ExtendedCallbackContext, type ExtendedCallbackHandler, FileBasedDiscovery, GraphController, GraphEngineFactory, GraphEngineType, GraphManifestSchema, GraphManifestValidator, GraphServiceTokens, GraphTypeUtils, type IAgentToolConfig, type IAgentToolConfiguration, type IAttachment, type IBaseEntity, type IChartDataPoint, type IChartDataset, type IChartValue, type IContentBlock, type IContentChain, type IDeletionInfo, type IGenericGraphType, type IGraphAttachment, type IGraphBuilder, type IGraphCompiler, type IGraphConfigurable, type IGraphEngine, type IGraphManifest, type IGraphMetadata, type IGraphMetadataRegistry, type IGraphRequestPayload, type IGraphResponsePayload, type IGraphRunnableConfig, type IGraphService, type IGraphServiceRegistry, type IGraphSettingsRepository, type IGraphTraceEvent, type IGraphTracer, type IGraphTypeMetadata, type IGraphTypeRegistry, type IModelInitializer, type IReasoningChain, type IReasoningStep, type IStoredMessageContent, type ISystemToolCredentials, type IToolCall, type IToolCatalog, type IToolConfigOption, type IToolExecutionContext, type ITracingEvent, type IUsageMetrics, type IUsageRecorder, type IdempotencyConfig, type IdempotencyEntry, IdempotencyManager, IdempotencyStatus, type KnowledgeBaseInfo, type LLMCallRecord, type LLMConfig, type LLModel, LangGraphEngine, type MappedChannels, McpConverter, type McpRuntimeClient, McpRuntimeHttpClient, type McpTool, McpToolFilter, type Model, type ModelByIdConfig, type ModelByIdWithTypeConfig, type ModelConfig, type ModelConfigFetcher, type ModelConfigWithToken, type ModelConfigWithTokenAndType, type ModelCreator, type ModelCreators, ModelInitializer, ModelProvider, ModelType, type MongoDBConfig, type RateLimitConfig, type RateLimitResult, type RequestContext, type RerankModelCreator, type RetrieveQueryOptions, type RetrieverConfig, RetrieverSearchType, RetrieverService, type RouterConfig, type ServiceDiscoveryProvider, SmartCallbackRouter, StaticDiscovery, type StreamAccumulator, StreamChannel, type StrictGraphRunnableConfig, TelegramPatchHandler, type ToolExecutionResult, type TraceApiCallResult, type TracingLevel, UIDispatchController, type UIDispatchDto, UIEndpoint, type UIEndpointClassMetadata, type UIEndpointMethodMetadata, UIEndpointsDiscoveryService, UniversalCallbackService, UniversalGraphModule, type UniversalGraphModuleOptions, UniversalGraphService, type VersionResolution, type VersionResolutionOptions, type VersionRoute, VersionedGraphService, type VersioningConfig, VoyageAIRerank, type VoyageAIRerankConfig, WebPatchHandler, WithCallbacks, WithEndpoints, WithUIEndpoints, bootstrap, createEndpointDescriptors, createGraphAttachment, createMongoClientAdapter, createStaticMessage, findCallbackMethod, findEndpointMethod, generateAttachmentSummary, getCallbackMetadata, getEndpointMetadata, getUIEndpointClassMetadata, getUIEndpointMethodsMetadata, hasCallbacks, hasUIEndpoints, registerFinanceExampleCallback, registerUIEndpointsFromClass, sanitizeTraceData, traceApiCall };
1615
+ export { type ACLValidationResult, AbstractGraphBuilder, type ApiCallTracerOptions, AttachmentType, type AuditEntry, type BaseGraphConfig, type BaseGraphContext, GraphController as BaseGraphServiceController, UniversalGraphModule as BaseGraphServiceModule, type BaseGraphState, BuilderRegistryService, Callback, CallbackACL, CallbackAuditAction, CallbackAuditor, type CallbackContext, CallbackController, type CallbackEntry, type CallbackHandler, type CallbackMetadata, CallbackMetrics, type CallbackPatch, type CallbackPatchHandler, CallbackPatchService, CallbackRateLimiter, type CallbackRecord, CallbackRegistry, type CallbackRequest, type CallbackResult, CallbackStore, CallbackTokenGuard, type CallbackUser, type ChannelState, type ChartType, ChatFeature, type ChatModelCreator, type ChatModelOrRunnable, type ChatModelWithTools, type CitationValue, type CompiledGraphFor, type ConcreteModels, type CustomDocument, DEFAULT_TRACER_OPTIONS, type DataEnvelope, ENDPOINT_METADATA_KEY, type EmbeddingModelCreator, Endpoint, type EndpointDescriptor, type EndpointHandler, type EndpointMetadata, type EndpointOptions, EndpointRegistry, EventProcessor, type ExtendedCallbackContext, type ExtendedCallbackHandler, ExternalGraphBuilder, FileBasedDiscovery, GraphController, GraphEngineFactory, GraphEngineType, GraphManifestSchema, GraphManifestValidator, GraphServiceTokens, GraphTypeUtils, type IAgentToolConfig, type IAgentToolConfiguration, type IAttachment, type IBaseEntity, type IChartDataPoint, type IChartDataset, type IChartValue, type IContentBlock, type IContentChain, type IDeletionInfo, type IGenericGraphType, type IGraphAttachment, type IGraphBuilder, type IGraphCompiler, type IGraphConfigurable, type IGraphEngine, type IGraphManifest, type IGraphMetadata, type IGraphMetadataRegistry, type IGraphRequestPayload, type IGraphResponsePayload, type IGraphRunnableConfig, type IGraphService, type IGraphServiceRegistry, type IGraphSettingsRepository, type IGraphTraceEvent, type IGraphTracer, type IGraphTypeMetadata, type IGraphTypeRegistry, type IModelInitializer, type IReasoningChain, type IReasoningStep, type IStoredMessageContent, type ISystemToolCredentials, type IToolCall, type IToolCatalog, type IToolConfigOption, type IToolExecutionContext, type ITracingEvent, type IUsageMetrics, type IUsageRecorder, type IdempotencyConfig, type IdempotencyEntry, IdempotencyManager, IdempotencyStatus, type KnowledgeBaseInfo, type LLMCallRecord, type LLMConfig, type LLModel, LangGraphEngine, type MappedChannels, McpConverter, type McpRuntimeClient, McpRuntimeHttpClient, type McpTool, McpToolFilter, type Model, type ModelByIdConfig, type ModelByIdWithTypeConfig, type ModelConfig, type ModelConfigFetcher, type ModelConfigWithToken, type ModelConfigWithTokenAndType, type ModelCreator, type ModelCreators, ModelInitializer, ModelProvider, ModelType, type MongoDBConfig, type RateLimitConfig, type RateLimitResult, type RequestContext, type RerankModelCreator, type RetrieveQueryOptions, type RetrieverConfig, RetrieverSearchType, RetrieverService, type RouterConfig, type ServiceDiscoveryProvider, SmartCallbackRouter, StaticDiscovery, type StreamAccumulator, StreamChannel, type StrictGraphRunnableConfig, TelegramPatchHandler, type ToolExecutionResult, type TraceApiCallResult, type TracingLevel, UIDispatchController, type UIDispatchDto, UIEndpoint, type UIEndpointClassMetadata, type UIEndpointMethodMetadata, UIEndpointsDiscoveryService, UniversalCallbackService, UniversalGraphModule, type UniversalGraphModuleOptions, UniversalGraphService, type VersionResolution, type VersionResolutionOptions, type VersionRoute, VersionedGraphService, type VersioningConfig, VoyageAIRerank, type VoyageAIRerankConfig, WebPatchHandler, WithCallbacks, WithEndpoints, WithUIEndpoints, bootstrap, createEndpointDescriptors, createGraphAttachment, createMongoClientAdapter, createStaticMessage, findCallbackMethod, findEndpointMethod, generateAttachmentSummary, getCallbackMetadata, getEndpointMetadata, getUIEndpointClassMetadata, getUIEndpointMethodsMetadata, hasCallbacks, hasUIEndpoints, registerFinanceExampleCallback, registerUIEndpointsFromClass, sanitizeTraceData, traceApiCall };