@flutchai/flutch-sdk 0.1.3 → 0.1.5

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.
Files changed (194) hide show
  1. package/README.md +2 -2
  2. package/dist/index.cjs +6419 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +1499 -0
  5. package/dist/index.d.ts +1499 -27
  6. package/dist/index.js +6347 -47
  7. package/dist/index.js.map +1 -1
  8. package/package.json +72 -10
  9. package/dist/api/callback-token.guard.d.ts +0 -17
  10. package/dist/api/callback-token.guard.js +0 -80
  11. package/dist/api/callback-token.guard.js.map +0 -1
  12. package/dist/api/callback.controller.d.ts +0 -7
  13. package/dist/api/callback.controller.js +0 -44
  14. package/dist/api/callback.controller.js.map +0 -1
  15. package/dist/api/graph.controller.d.ts +0 -32
  16. package/dist/api/graph.controller.js +0 -187
  17. package/dist/api/graph.controller.js.map +0 -1
  18. package/dist/api/ui-dispatch.controller.d.ts +0 -34
  19. package/dist/api/ui-dispatch.controller.js +0 -178
  20. package/dist/api/ui-dispatch.controller.js.map +0 -1
  21. package/dist/bootstrap.d.ts +0 -4
  22. package/dist/bootstrap.js +0 -99
  23. package/dist/bootstrap.js.map +0 -1
  24. package/dist/callbacks/callback-acl.service.d.ts +0 -24
  25. package/dist/callbacks/callback-acl.service.js +0 -144
  26. package/dist/callbacks/callback-acl.service.js.map +0 -1
  27. package/dist/callbacks/callback-auditor.service.d.ts +0 -47
  28. package/dist/callbacks/callback-auditor.service.js +0 -286
  29. package/dist/callbacks/callback-auditor.service.js.map +0 -1
  30. package/dist/callbacks/callback-metrics.service.d.ts +0 -34
  31. package/dist/callbacks/callback-metrics.service.js +0 -216
  32. package/dist/callbacks/callback-metrics.service.js.map +0 -1
  33. package/dist/callbacks/callback-patch.service.d.ts +0 -13
  34. package/dist/callbacks/callback-patch.service.js +0 -51
  35. package/dist/callbacks/callback-patch.service.js.map +0 -1
  36. package/dist/callbacks/callback-rate-limiter.d.ts +0 -27
  37. package/dist/callbacks/callback-rate-limiter.js +0 -129
  38. package/dist/callbacks/callback-rate-limiter.js.map +0 -1
  39. package/dist/callbacks/callback-registry.d.ts +0 -7
  40. package/dist/callbacks/callback-registry.js +0 -29
  41. package/dist/callbacks/callback-registry.js.map +0 -1
  42. package/dist/callbacks/callback-store.d.ts +0 -19
  43. package/dist/callbacks/callback-store.js +0 -145
  44. package/dist/callbacks/callback-store.js.map +0 -1
  45. package/dist/callbacks/example.callback.d.ts +0 -2
  46. package/dist/callbacks/example.callback.js +0 -10
  47. package/dist/callbacks/example.callback.js.map +0 -1
  48. package/dist/callbacks/idempotency-manager.d.ts +0 -54
  49. package/dist/callbacks/idempotency-manager.js +0 -230
  50. package/dist/callbacks/idempotency-manager.js.map +0 -1
  51. package/dist/callbacks/index.d.ts +0 -13
  52. package/dist/callbacks/index.js +0 -30
  53. package/dist/callbacks/index.js.map +0 -1
  54. package/dist/callbacks/smart-callback.router.d.ts +0 -52
  55. package/dist/callbacks/smart-callback.router.js +0 -213
  56. package/dist/callbacks/smart-callback.router.js.map +0 -1
  57. package/dist/callbacks/telegram-patch.handler.d.ts +0 -6
  58. package/dist/callbacks/telegram-patch.handler.js +0 -24
  59. package/dist/callbacks/telegram-patch.handler.js.map +0 -1
  60. package/dist/callbacks/universal-callback.service.d.ts +0 -14
  61. package/dist/callbacks/universal-callback.service.js +0 -20
  62. package/dist/callbacks/universal-callback.service.js.map +0 -1
  63. package/dist/callbacks/web-patch.handler.d.ts +0 -6
  64. package/dist/callbacks/web-patch.handler.js +0 -24
  65. package/dist/callbacks/web-patch.handler.js.map +0 -1
  66. package/dist/core/abstract-graph.builder.d.ts +0 -128
  67. package/dist/core/abstract-graph.builder.js +0 -488
  68. package/dist/core/abstract-graph.builder.js.map +0 -1
  69. package/dist/core/builder-registry.service.d.ts +0 -6
  70. package/dist/core/builder-registry.service.js +0 -29
  71. package/dist/core/builder-registry.service.js.map +0 -1
  72. package/dist/core/universal-graph.module.d.ts +0 -10
  73. package/dist/core/universal-graph.module.js +0 -294
  74. package/dist/core/universal-graph.module.js.map +0 -1
  75. package/dist/decorators/callback.decorators.d.ts +0 -21
  76. package/dist/decorators/callback.decorators.js +0 -73
  77. package/dist/decorators/callback.decorators.js.map +0 -1
  78. package/dist/endpoint-registry/endpoint.decorators.d.ts +0 -35
  79. package/dist/endpoint-registry/endpoint.decorators.js +0 -115
  80. package/dist/endpoint-registry/endpoint.decorators.js.map +0 -1
  81. package/dist/endpoint-registry/endpoint.registry.d.ts +0 -44
  82. package/dist/endpoint-registry/endpoint.registry.js +0 -90
  83. package/dist/endpoint-registry/endpoint.registry.js.map +0 -1
  84. package/dist/endpoint-registry/index.d.ts +0 -3
  85. package/dist/endpoint-registry/index.js +0 -20
  86. package/dist/endpoint-registry/index.js.map +0 -1
  87. package/dist/endpoint-registry/ui-endpoints.discovery.d.ts +0 -11
  88. package/dist/endpoint-registry/ui-endpoints.discovery.js +0 -72
  89. package/dist/endpoint-registry/ui-endpoints.discovery.js.map +0 -1
  90. package/dist/engine/api-call-tracer.utils.d.ts +0 -8
  91. package/dist/engine/api-call-tracer.utils.js +0 -184
  92. package/dist/engine/api-call-tracer.utils.js.map +0 -1
  93. package/dist/engine/event-processor.utils.d.ts +0 -49
  94. package/dist/engine/event-processor.utils.js +0 -314
  95. package/dist/engine/event-processor.utils.js.map +0 -1
  96. package/dist/engine/graph-engine.factory.d.ts +0 -12
  97. package/dist/engine/graph-engine.factory.js +0 -43
  98. package/dist/engine/graph-engine.factory.js.map +0 -1
  99. package/dist/engine/langgraph-engine.d.ts +0 -14
  100. package/dist/engine/langgraph-engine.js +0 -261
  101. package/dist/engine/langgraph-engine.js.map +0 -1
  102. package/dist/interfaces/callback.interface.d.ts +0 -46
  103. package/dist/interfaces/callback.interface.js +0 -3
  104. package/dist/interfaces/callback.interface.js.map +0 -1
  105. package/dist/interfaces/graph-registry.interface.d.ts +0 -8
  106. package/dist/interfaces/graph-registry.interface.js +0 -3
  107. package/dist/interfaces/graph-registry.interface.js.map +0 -1
  108. package/dist/interfaces/graph-service.interface.d.ts +0 -43
  109. package/dist/interfaces/graph-service.interface.js +0 -9
  110. package/dist/interfaces/graph-service.interface.js.map +0 -1
  111. package/dist/interfaces/index.d.ts +0 -3
  112. package/dist/interfaces/index.js +0 -20
  113. package/dist/interfaces/index.js.map +0 -1
  114. package/dist/llm/index.d.ts +0 -6
  115. package/dist/llm/index.js +0 -23
  116. package/dist/llm/index.js.map +0 -1
  117. package/dist/llm/llm.initializer.d.ts +0 -14
  118. package/dist/llm/llm.initializer.js +0 -167
  119. package/dist/llm/llm.initializer.js.map +0 -1
  120. package/dist/llm/llm.interface.d.ts +0 -6
  121. package/dist/llm/llm.interface.js +0 -3
  122. package/dist/llm/llm.interface.js.map +0 -1
  123. package/dist/llm/llm.types.d.ts +0 -32
  124. package/dist/llm/llm.types.js +0 -3
  125. package/dist/llm/llm.types.js.map +0 -1
  126. package/dist/llm/model.initializer.d.ts +0 -45
  127. package/dist/llm/model.initializer.js +0 -630
  128. package/dist/llm/model.initializer.js.map +0 -1
  129. package/dist/llm/model.interface.d.ts +0 -38
  130. package/dist/llm/model.interface.js +0 -4
  131. package/dist/llm/model.interface.js.map +0 -1
  132. package/dist/llm/rerankers/voyageai-rerank.d.ts +0 -17
  133. package/dist/llm/rerankers/voyageai-rerank.js +0 -56
  134. package/dist/llm/rerankers/voyageai-rerank.js.map +0 -1
  135. package/dist/retriever/database-factory.d.ts +0 -15
  136. package/dist/retriever/database-factory.js +0 -83
  137. package/dist/retriever/database-factory.js.map +0 -1
  138. package/dist/retriever/index.d.ts +0 -2
  139. package/dist/retriever/index.js +0 -19
  140. package/dist/retriever/index.js.map +0 -1
  141. package/dist/retriever/retriever.client.d.ts +0 -28
  142. package/dist/retriever/retriever.client.js +0 -97
  143. package/dist/retriever/retriever.client.js.map +0 -1
  144. package/dist/retriever/retriever.service.d.ts +0 -25
  145. package/dist/retriever/retriever.service.js +0 -265
  146. package/dist/retriever/retriever.service.js.map +0 -1
  147. package/dist/retriever/types.d.ts +0 -22
  148. package/dist/retriever/types.js +0 -3
  149. package/dist/retriever/types.js.map +0 -1
  150. package/dist/schemas/graph-manifest.schema.d.ts +0 -134
  151. package/dist/schemas/graph-manifest.schema.js +0 -180
  152. package/dist/schemas/graph-manifest.schema.js.map +0 -1
  153. package/dist/schemas/index.d.ts +0 -1
  154. package/dist/schemas/index.js +0 -18
  155. package/dist/schemas/index.js.map +0 -1
  156. package/dist/shared-types/index.d.ts +0 -199
  157. package/dist/shared-types/index.js +0 -58
  158. package/dist/shared-types/index.js.map +0 -1
  159. package/dist/tools/index.d.ts +0 -3
  160. package/dist/tools/index.js +0 -20
  161. package/dist/tools/index.js.map +0 -1
  162. package/dist/tools/mcp-converter.d.ts +0 -15
  163. package/dist/tools/mcp-converter.js +0 -133
  164. package/dist/tools/mcp-converter.js.map +0 -1
  165. package/dist/tools/mcp-tool-filter.d.ts +0 -11
  166. package/dist/tools/mcp-tool-filter.js +0 -123
  167. package/dist/tools/mcp-tool-filter.js.map +0 -1
  168. package/dist/tools/mcp.interfaces.d.ts +0 -19
  169. package/dist/tools/mcp.interfaces.js +0 -3
  170. package/dist/tools/mcp.interfaces.js.map +0 -1
  171. package/dist/types/graph-types.d.ts +0 -82
  172. package/dist/types/graph-types.js +0 -6
  173. package/dist/types/graph-types.js.map +0 -1
  174. package/dist/utils/error.utils.d.ts +0 -18
  175. package/dist/utils/error.utils.js +0 -78
  176. package/dist/utils/error.utils.js.map +0 -1
  177. package/dist/utils/graph-type.utils.d.ts +0 -14
  178. package/dist/utils/graph-type.utils.js +0 -71
  179. package/dist/utils/graph-type.utils.js.map +0 -1
  180. package/dist/utils/index.d.ts +0 -1
  181. package/dist/utils/index.js +0 -18
  182. package/dist/utils/index.js.map +0 -1
  183. package/dist/utils/usage-recorder.d.ts +0 -23
  184. package/dist/utils/usage-recorder.js +0 -29
  185. package/dist/utils/usage-recorder.js.map +0 -1
  186. package/dist/versioning/index.d.ts +0 -2
  187. package/dist/versioning/index.js +0 -19
  188. package/dist/versioning/index.js.map +0 -1
  189. package/dist/versioning/versioned-graph.service.d.ts +0 -16
  190. package/dist/versioning/versioned-graph.service.js +0 -132
  191. package/dist/versioning/versioned-graph.service.js.map +0 -1
  192. package/dist/versioning/versioning.types.d.ts +0 -21
  193. package/dist/versioning/versioning.types.js +0 -3
  194. package/dist/versioning/versioning.types.js.map +0 -1
@@ -0,0 +1,1499 @@
1
+ import { JSONSchema7 } from 'json-schema';
2
+ import * as _nestjs_common from '@nestjs/common';
3
+ import { Logger, Type, CanActivate, ExecutionContext, DynamicModule } from '@nestjs/common';
4
+ import { ConfigService } from '@nestjs/config';
5
+ import { HumanMessage } from '@langchain/core/messages';
6
+ import { BaseChannel, CompiledStateGraph, LangGraphRunnableConfig } from '@langchain/langgraph';
7
+ import Redis from 'ioredis';
8
+ import { Registry } from 'prom-client';
9
+ import { Response, Request } from 'express';
10
+ import { DiscoveryService, MetadataScanner, ModuleRef } from '@nestjs/core';
11
+ import { StructuredTool } from '@langchain/core/tools';
12
+ import { ChatAnthropic } from '@langchain/anthropic';
13
+ import { ChatCohere } from '@langchain/cohere';
14
+ import { ChatMistralAI } from '@langchain/mistralai';
15
+ import { ChatOpenAI } from '@langchain/openai';
16
+ import { BaseChatModel } from '@langchain/core/language_models/chat_models';
17
+ import { BaseDocumentCompressor } from '@langchain/core/retrievers/document_compressors';
18
+ import { Embeddings } from '@langchain/core/embeddings';
19
+ import { Document } from '@langchain/core/documents';
20
+
21
+ interface RequestContext {
22
+ userId: string;
23
+ companyId?: string;
24
+ method: "GET" | "POST";
25
+ payload?: any;
26
+ channel: string;
27
+ platform?: string;
28
+ }
29
+ interface DataEnvelope<T = any> {
30
+ schema: string;
31
+ data: T;
32
+ meta?: {
33
+ total?: number;
34
+ page?: number;
35
+ redirect?: string;
36
+ message?: string;
37
+ };
38
+ }
39
+ type EndpointHandler = (ctx: RequestContext) => Promise<DataEnvelope>;
40
+ interface EndpointDescriptor {
41
+ name: string;
42
+ method: "GET" | "POST";
43
+ handler: EndpointHandler;
44
+ schema?: JSONSchema7;
45
+ }
46
+ declare class EndpointRegistry {
47
+ private readonly logger;
48
+ private readonly endpoints;
49
+ register(graphType: string, endpoint: EndpointDescriptor): void;
50
+ registerMultiple(graphType: string, endpoints: EndpointDescriptor[]): void;
51
+ get(graphType: string, endpointName: string): EndpointDescriptor | undefined;
52
+ list(graphType: string): string[];
53
+ listEndpoints(graphType: string): string[];
54
+ listGraphTypes(): string[];
55
+ call(graphType: string, endpointName: string, context: RequestContext): Promise<DataEnvelope>;
56
+ getStats(): {
57
+ totalGraphTypes: number;
58
+ totalEndpoints: number;
59
+ endpointsByGraph: Record<string, number>;
60
+ };
61
+ clear(): void;
62
+ clearGraph(graphType: string): void;
63
+ }
64
+
65
+ declare const ENDPOINT_METADATA_KEY = "graph:endpoints";
66
+ interface EndpointMetadata {
67
+ name: string;
68
+ method: "GET" | "POST";
69
+ methodName: string;
70
+ schema?: JSONSchema7;
71
+ }
72
+ interface EndpointOptions {
73
+ method: "GET" | "POST";
74
+ schema?: JSONSchema7;
75
+ }
76
+ declare function Endpoint(name: string, options: EndpointOptions): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
77
+ declare function WithEndpoints(target: any): void;
78
+ declare function getEndpointMetadata(constructor: any): EndpointMetadata[];
79
+ declare function createEndpointDescriptors(instance: any, metadata: EndpointMetadata[]): EndpointDescriptor[];
80
+ declare function findEndpointMethod(constructor: any, endpointName: string): string | undefined;
81
+ interface UIEndpointClassMetadata {
82
+ graphType: string;
83
+ }
84
+ interface UIEndpointMethodMetadata {
85
+ endpointName: string;
86
+ method: "GET" | "POST";
87
+ methodName: string | symbol;
88
+ }
89
+ declare function WithUIEndpoints(graphType: string): <T extends {
90
+ new (...args: any[]): {};
91
+ }>(constructor: T) => T;
92
+ declare function UIEndpoint(endpointName: string, method?: "GET" | "POST"): (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => PropertyDescriptor;
93
+ declare function getUIEndpointClassMetadata(constructor: any): UIEndpointClassMetadata | null;
94
+ declare function getUIEndpointMethodsMetadata(constructor: any): UIEndpointMethodMetadata[];
95
+ declare function hasUIEndpoints(constructor: any): boolean;
96
+ declare function registerUIEndpointsFromClass(endpointRegistry: any, EndpointClass: any, instance?: any): void;
97
+
98
+ declare class UIEndpointsDiscoveryService {
99
+ private readonly discoveryService;
100
+ private readonly metadataScanner;
101
+ private readonly endpointRegistry;
102
+ private readonly logger;
103
+ constructor(discoveryService: DiscoveryService, metadataScanner: MetadataScanner, endpointRegistry: EndpointRegistry);
104
+ discoverUIEndpoints(): Promise<void>;
105
+ private getUIEndpointMethodsCount;
106
+ }
107
+
108
+ declare class BuilderRegistryService {
109
+ private builders;
110
+ registerBuilder(builder: AbstractGraphBuilder<string>): void;
111
+ getBuilders(): AbstractGraphBuilder<string>[];
112
+ }
113
+
114
+ interface UIDispatchDto {
115
+ graphType: string;
116
+ endpoint: string;
117
+ method: "GET" | "POST";
118
+ data?: any;
119
+ context: {
120
+ userId: string;
121
+ companyId?: string;
122
+ channel?: string;
123
+ platform?: string;
124
+ };
125
+ }
126
+ declare class UIDispatchController {
127
+ private readonly endpointRegistry;
128
+ private readonly builderRegistry;
129
+ private readonly logger;
130
+ constructor(endpointRegistry: EndpointRegistry, builderRegistry: BuilderRegistryService);
131
+ dispatchUIEndpoint(dto: UIDispatchDto): Promise<DataEnvelope>;
132
+ getGraphManifest(graphType: string, userId: string): Promise<any>;
133
+ listEndpoints(graphType: string, userId: string): Promise<string[]>;
134
+ getGraphCatalog(userId: string, companyId?: string): Promise<any[]>;
135
+ }
136
+
137
+ interface CallbackEntry {
138
+ graphType: string;
139
+ handler: string;
140
+ userId: string;
141
+ threadId?: string;
142
+ agentId?: string;
143
+ params: Record<string, any>;
144
+ metadata?: {
145
+ idempotencyKey?: string;
146
+ scopes?: string[];
147
+ ttlSec?: number;
148
+ platform?: string;
149
+ companyId?: string;
150
+ };
151
+ }
152
+ interface CallbackRecord extends CallbackEntry {
153
+ token: string;
154
+ status: "pending" | "processing" | "completed" | "expired" | "failed";
155
+ createdAt: number;
156
+ executedAt?: number;
157
+ retries: number;
158
+ lastError?: string;
159
+ }
160
+ interface CallbackResult {
161
+ success: boolean;
162
+ message?: string;
163
+ attachments?: any[];
164
+ patch?: CallbackPatch;
165
+ error?: string;
166
+ }
167
+ interface CallbackPatch {
168
+ editMessage?: string;
169
+ text?: string;
170
+ keyboard?: any;
171
+ disableButtons?: boolean;
172
+ newButtons?: any[];
173
+ }
174
+ interface CallbackContext {
175
+ userId: string;
176
+ threadId?: string;
177
+ agentId?: string;
178
+ params: Record<string, any>;
179
+ platform?: string;
180
+ metadata?: any;
181
+ }
182
+ type CallbackHandler = (context: CallbackContext) => Promise<CallbackResult>;
183
+
184
+ declare enum AttachmentType {
185
+ IMAGE = "image",
186
+ VOICE = "voice",
187
+ FILE = "file",
188
+ BUTTON = "button",
189
+ CITATION = "citation",
190
+ SUGGESTION = "suggestion",
191
+ WEBAPP = "webapp",
192
+ SOURCE = "source",
193
+ CARD = "card",
194
+ CHART = "chart"
195
+ }
196
+ interface IAttachment {
197
+ type: AttachmentType;
198
+ value: any;
199
+ metadata?: Record<string, any>;
200
+ }
201
+ type CitationValue = {
202
+ source: {
203
+ url: string;
204
+ title: string;
205
+ type: "webpage" | "pdf" | "article";
206
+ articleId?: string;
207
+ knowledgeBaseId?: string;
208
+ };
209
+ };
210
+
211
+ interface IReasoningStep {
212
+ index: number;
213
+ type: "text" | "tool_call" | "tool_result" | "thinking" | "tool_use";
214
+ text?: string;
215
+ metadata?: Record<string, any>;
216
+ }
217
+ interface IReasoningChain {
218
+ steps: IReasoningStep[];
219
+ isComplete: boolean;
220
+ }
221
+
222
+ type TracingLevel = "info" | "warn" | "error" | "debug";
223
+ interface IToolCall {
224
+ name: string;
225
+ id?: string;
226
+ input?: any;
227
+ }
228
+ interface ITracingEvent {
229
+ node: string;
230
+ type: string;
231
+ timestamp: number;
232
+ level: TracingLevel;
233
+ message: string;
234
+ data?: any;
235
+ error?: string;
236
+ }
237
+
238
+ interface IStoredMessageContent {
239
+ text?: string;
240
+ attachments?: IAttachment[];
241
+ metadata?: Record<string, any>;
242
+ tracingEvents?: ITracingEvent[];
243
+ reasoningChains?: IReasoningChain[];
244
+ hasReasoningProcess?: boolean;
245
+ currentToolCall?: IToolCall | null;
246
+ }
247
+
248
+ type ChartType = "line" | "bar" | "pie" | "area";
249
+ interface IChartDataPoint {
250
+ label: string;
251
+ value: number;
252
+ color?: string;
253
+ }
254
+ interface IChartDataset {
255
+ label: string;
256
+ data: IChartDataPoint[];
257
+ color?: string;
258
+ }
259
+ interface IChartValue {
260
+ type: ChartType;
261
+ title: string;
262
+ description?: string;
263
+ datasets: IChartDataset[];
264
+ options?: {
265
+ showLegend?: boolean;
266
+ showGrid?: boolean;
267
+ currency?: boolean;
268
+ percentage?: boolean;
269
+ [key: string]: any;
270
+ };
271
+ }
272
+
273
+ interface IUsageMetrics {
274
+ promptTokens?: number;
275
+ completionTokens?: number;
276
+ totalTokens?: number;
277
+ [key: string]: any;
278
+ }
279
+
280
+ declare enum StreamChannel {
281
+ TEXT = "text",
282
+ PROCESSING = "processing",
283
+ TOOLS = "tools"
284
+ }
285
+
286
+ interface IGraphService {
287
+ healthCheck(): Promise<boolean>;
288
+ getSupportedGraphTypes(): Promise<string[]>;
289
+ generateAnswer(payload: IGraphRequestPayload): Promise<IGraphResponsePayload>;
290
+ streamAnswer(payload: IGraphRequestPayload, onPartial: (chunk: string) => void): Promise<IGraphResponsePayload>;
291
+ cancelGeneration(requestId: string): Promise<void>;
292
+ executeCallback(token: string, platform?: string, platformContext?: any): Promise<CallbackResult>;
293
+ }
294
+ interface IGraphRequestPayload {
295
+ requestId: string;
296
+ threadId: string;
297
+ userId: string;
298
+ agentId: string;
299
+ message: HumanMessage;
300
+ graphType: string;
301
+ graphSettings: any;
302
+ context?: Record<string, any>;
303
+ metadata?: Record<string, any>;
304
+ }
305
+ interface IGraphResponsePayload {
306
+ requestId: string;
307
+ text: string;
308
+ attachments?: IAttachment[];
309
+ reasoningChains?: IReasoningChain[];
310
+ metadata: {
311
+ usageMetrics: IUsageMetrics;
312
+ [key: string]: any;
313
+ };
314
+ }
315
+ declare const GraphServiceTokens: {
316
+ REGISTRY: string;
317
+ CLIENT: string;
318
+ SETTINGS_REPOSITORY: string;
319
+ };
320
+ interface IGraphSettingsRepository {
321
+ getSettings(settingsId: string): Promise<any>;
322
+ getSettingsByAgentAndType(agentId: string, graphType: string): Promise<any>;
323
+ saveSettings(agentId: string, graphType: string, settings: any): Promise<string>;
324
+ }
325
+
326
+ interface IGraphServiceRegistry {
327
+ getService(graphType: string): Promise<IGraphService | null>;
328
+ getAllServices(): Promise<Map<string, IGraphService>>;
329
+ registerService(graphType: string, service: IGraphService): void;
330
+ unregisterService(graphType: string): void;
331
+ refresh(): Promise<void>;
332
+ }
333
+
334
+ declare class GraphController {
335
+ protected readonly graphService: IGraphService;
336
+ private readonly builderRegistry;
337
+ protected readonly logger: Logger;
338
+ constructor(graphService: IGraphService, builderRegistry: BuilderRegistryService);
339
+ healthCheck(): Promise<{
340
+ status: string;
341
+ timestamp: string;
342
+ }>;
343
+ getSupportedGraphTypes(): Promise<string[]>;
344
+ generateAnswer(payload: IGraphRequestPayload): Promise<IGraphResponsePayload>;
345
+ streamAnswer(payload: IGraphRequestPayload, res: Response): Promise<void>;
346
+ cancelGeneration(requestId: string): Promise<{
347
+ message: string;
348
+ }>;
349
+ getRegisteredGraphs(): Promise<{
350
+ total: number;
351
+ graphs: Array<{
352
+ graphType: string;
353
+ builderName: string;
354
+ }>;
355
+ }>;
356
+ getRegistryStats(): Promise<{
357
+ totalBuilders: number;
358
+ graphTypes: string[];
359
+ builderTypes: Record<string, number>;
360
+ }>;
361
+ }
362
+
363
+ declare const GraphManifestSchema: {
364
+ $schema: string;
365
+ type: string;
366
+ title: string;
367
+ description: string;
368
+ properties: {
369
+ graphType: {
370
+ type: string;
371
+ description: string;
372
+ pattern: string;
373
+ };
374
+ title: {
375
+ type: string;
376
+ description: string;
377
+ minLength: number;
378
+ maxLength: number;
379
+ };
380
+ description: {
381
+ type: string;
382
+ description: string;
383
+ minLength: number;
384
+ maxLength: number;
385
+ };
386
+ detailedDescription: {
387
+ type: string;
388
+ description: string;
389
+ minLength: number;
390
+ };
391
+ category: {
392
+ type: string;
393
+ description: string;
394
+ enum: string[];
395
+ };
396
+ tags: {
397
+ type: string;
398
+ description: string;
399
+ items: {
400
+ type: string;
401
+ pattern: string;
402
+ };
403
+ uniqueItems: boolean;
404
+ };
405
+ hue: {
406
+ type: string;
407
+ description: string;
408
+ minimum: number;
409
+ maximum: number;
410
+ };
411
+ visibility: {
412
+ type: string;
413
+ description: string;
414
+ enum: string[];
415
+ default: string;
416
+ };
417
+ isEmbedded: {
418
+ type: string;
419
+ description: string;
420
+ default: boolean;
421
+ };
422
+ isActive: {
423
+ type: string;
424
+ description: string;
425
+ default: boolean;
426
+ };
427
+ schema: {
428
+ type: string;
429
+ description: string;
430
+ properties: {
431
+ type: {
432
+ type: string;
433
+ const: string;
434
+ };
435
+ properties: {
436
+ type: string;
437
+ additionalProperties: {
438
+ type: string;
439
+ properties: {
440
+ type: {
441
+ type: string;
442
+ };
443
+ title: {
444
+ type: string;
445
+ };
446
+ description: {
447
+ type: string;
448
+ };
449
+ default: {};
450
+ minimum: {
451
+ type: string;
452
+ };
453
+ maximum: {
454
+ type: string;
455
+ };
456
+ minLength: {
457
+ type: string;
458
+ };
459
+ maxLength: {
460
+ type: string;
461
+ };
462
+ format: {
463
+ type: string;
464
+ };
465
+ enum: {
466
+ type: string;
467
+ };
468
+ };
469
+ required: string[];
470
+ };
471
+ };
472
+ required: {
473
+ type: string;
474
+ items: {
475
+ type: string;
476
+ };
477
+ };
478
+ };
479
+ required: string[];
480
+ additionalProperties: boolean;
481
+ };
482
+ defaultSettings: {
483
+ type: string;
484
+ description: string;
485
+ };
486
+ };
487
+ required: string[];
488
+ additionalProperties: boolean;
489
+ };
490
+ declare class GraphManifestValidator {
491
+ static validate(manifest: any): {
492
+ isValid: boolean;
493
+ errors: string[];
494
+ };
495
+ static validateOrThrow(manifest: any): void;
496
+ }
497
+
498
+ interface IGraphTraceEvent {
499
+ type: string;
500
+ name?: string;
501
+ channel?: string;
502
+ nodeName?: string;
503
+ timestamp: number;
504
+ metadata?: Record<string, unknown>;
505
+ data?: Record<string, unknown>;
506
+ }
507
+
508
+ interface VersionRoute {
509
+ version: string;
510
+ builderClass: Type<AbstractGraphBuilder<any>>;
511
+ isDefault?: boolean;
512
+ }
513
+ interface VersioningConfig {
514
+ baseGraphType: string;
515
+ versions: VersionRoute[];
516
+ defaultVersionStrategy?: "latest" | "explicit";
517
+ }
518
+ interface VersionResolution {
519
+ version: string;
520
+ builderClass: Type<AbstractGraphBuilder<any>>;
521
+ fullGraphType: string;
522
+ }
523
+ interface VersionResolutionOptions {
524
+ requestedVersion?: string;
525
+ strict?: boolean;
526
+ }
527
+
528
+ declare class VersionedGraphService {
529
+ private readonly logger;
530
+ private readonly versionConfigs;
531
+ constructor();
532
+ registerVersioning(config: VersioningConfig): void;
533
+ resolveVersion(graphType: string, options?: VersionResolutionOptions): Promise<VersionResolution>;
534
+ createVersionedBuilder(graphType: string, moduleRef?: ModuleRef, options?: VersionResolutionOptions): Promise<AbstractGraphBuilder<any>>;
535
+ getAvailableVersions(baseGraphType: string): string[];
536
+ isVersionSupported(graphType: string, options?: VersionResolutionOptions): boolean;
537
+ private findBestVersionRoute;
538
+ private isVersionCompatible;
539
+ getVersioningInfo(baseGraphType: string): VersioningConfig | null;
540
+ }
541
+
542
+ interface IGraphTracer {
543
+ log(data: any): void;
544
+ error(data: any): void;
545
+ }
546
+ interface IUsageRecorder {
547
+ recordModelExecution(record: any): void;
548
+ }
549
+
550
+ type MappedChannels<T> = {
551
+ [K in keyof T]: BaseChannel<T[K], T[K]>;
552
+ };
553
+ declare global {
554
+ namespace GraphTypes {
555
+ interface Registry {
556
+ }
557
+ }
558
+ }
559
+ type IGraphTypeRegistry = GraphTypes.Registry;
560
+ interface IGenericGraphType {
561
+ Params: any;
562
+ State: any;
563
+ Config: any;
564
+ Input: any;
565
+ Definition: any;
566
+ ConfigDefinition: any;
567
+ InputDefinition: any;
568
+ StateValues: any;
569
+ ConfigValues: any;
570
+ InputValues: any;
571
+ OutputValues: any;
572
+ }
573
+ 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>;
574
+ interface IGraphBuilder<T extends string> {
575
+ buildGraph(config?: any): Promise<CompiledGraphFor<T>>;
576
+ }
577
+ interface IGraphCompiler {
578
+ getConfiguredGraph<T extends string>(type: T, thread?: any): Promise<CompiledGraphFor<T>>;
579
+ }
580
+ type BaseGraphState = {};
581
+ interface IGraphMetadata {
582
+ userId: string;
583
+ applicationId: string;
584
+ workflowType: string;
585
+ version: string;
586
+ }
587
+ interface IGraphConfigurable<TGraphSettings = any> {
588
+ thread_id?: string;
589
+ metadata?: IGraphMetadata;
590
+ graphSettings: TGraphSettings;
591
+ }
592
+ type IGraphRunnableConfig<TGraphSettings = any> = LangGraphRunnableConfig<IGraphConfigurable<TGraphSettings>> & {
593
+ configurable: IGraphConfigurable<TGraphSettings>;
594
+ };
595
+ type StrictGraphRunnableConfig<TGraphSettings = any> = LangGraphRunnableConfig<TGraphSettings> & {
596
+ configurable: IGraphConfigurable<TGraphSettings>;
597
+ };
598
+ interface LLMConfig {
599
+ modelId: string;
600
+ temperature?: number;
601
+ maxTokens?: number;
602
+ prompt?: string;
603
+ }
604
+ interface IGraphTypeMetadata {
605
+ type: string;
606
+ metadata: {
607
+ title: string;
608
+ description: string;
609
+ detailedDescription: string;
610
+ icon?: string;
611
+ recommendations?: string[];
612
+ tags?: string[];
613
+ category?: string;
614
+ };
615
+ schema: {
616
+ properties: Record<string, any>;
617
+ required: string[];
618
+ };
619
+ defaultSettings: any;
620
+ formFields?: any[];
621
+ }
622
+ type IGraphMetadataRegistry = Record<string, IGraphTypeMetadata>;
623
+
624
+ declare class CallbackStore {
625
+ private readonly redis;
626
+ private readonly isProduction;
627
+ constructor(redis: Redis);
628
+ private generateToken;
629
+ issue(entry: CallbackEntry): Promise<string>;
630
+ getAndLock(token: string): Promise<CallbackRecord | null>;
631
+ private getAndLockAtomic;
632
+ private getAndLockSimple;
633
+ finalize(token: string): Promise<void>;
634
+ fail(token: string, error: string): Promise<CallbackRecord | null>;
635
+ private failAtomic;
636
+ private failSimple;
637
+ retry(token: string): Promise<CallbackRecord | null>;
638
+ private retryAtomic;
639
+ private retrySimple;
640
+ }
641
+
642
+ declare class CallbackRegistry {
643
+ private handlers;
644
+ register(handler: string, callback: CallbackHandler, graphType?: string): void;
645
+ get(handler: string, graphType?: string): CallbackHandler | undefined;
646
+ listHandlers(): string[];
647
+ }
648
+
649
+ interface CallbackUser {
650
+ userId: string;
651
+ roles?: string[];
652
+ permissions?: string[];
653
+ companyId?: string;
654
+ }
655
+ interface ACLValidationResult {
656
+ allowed: boolean;
657
+ reason?: string;
658
+ requiredScopes?: string[];
659
+ userScopes?: string[];
660
+ }
661
+ declare class CallbackACL {
662
+ private readonly logger;
663
+ validate(user: CallbackUser | undefined, record: CallbackRecord): Promise<ACLValidationResult>;
664
+ private validateScopes;
665
+ private validateGraphTypeAccess;
666
+ private getAllowedGraphNamespaces;
667
+ private validateCompanyAccess;
668
+ private performAdditionalSecurityChecks;
669
+ canRetry(user: CallbackUser, record: CallbackRecord): Promise<boolean>;
670
+ getPermissionDetails(user: CallbackUser, record: CallbackRecord): Record<string, any>;
671
+ }
672
+
673
+ interface AuditEntry {
674
+ id: string;
675
+ correlationId: string;
676
+ timestamp: number;
677
+ action: CallbackAuditAction;
678
+ userId?: string;
679
+ callbackToken: string;
680
+ graphType: string;
681
+ handler: string;
682
+ success: boolean;
683
+ duration?: number;
684
+ error?: string;
685
+ metadata: Record<string, any>;
686
+ ip?: string;
687
+ userAgent?: string;
688
+ }
689
+ declare enum CallbackAuditAction {
690
+ TOKEN_ISSUED = "TOKEN_ISSUED",
691
+ TOKEN_VALIDATED = "TOKEN_VALIDATED",
692
+ TOKEN_LOCKED = "TOKEN_LOCKED",
693
+ EXECUTION_STARTED = "EXECUTION_STARTED",
694
+ EXECUTION_COMPLETED = "EXECUTION_COMPLETED",
695
+ EXECUTION_FAILED = "EXECUTION_FAILED",
696
+ TOKEN_EXPIRED = "TOKEN_EXPIRED",
697
+ ACCESS_DENIED = "ACCESS_DENIED",
698
+ RATE_LIMITED = "RATE_LIMITED",
699
+ RETRY_ATTEMPTED = "RETRY_ATTEMPTED"
700
+ }
701
+ declare class CallbackAuditor {
702
+ private readonly logger;
703
+ private readonly auditStore;
704
+ logTokenIssued(token: string, graphType: string, handler: string, userId: string, metadata?: Record<string, any>): Promise<string>;
705
+ logExecutionStart(record: CallbackRecord, user: CallbackUser | undefined, correlationId?: string): Promise<string>;
706
+ logExecutionSuccess(record: CallbackRecord, user: CallbackUser | undefined, result: CallbackResult, duration: number, correlationId: string): Promise<void>;
707
+ logExecutionFailure(record: CallbackRecord, user: CallbackUser | undefined, error: Error, duration: number, correlationId: string): Promise<void>;
708
+ logAccessDenied(token: string, userId?: string, reason?: string, metadata?: Record<string, any>): Promise<void>;
709
+ logRateLimited(identifier: string, retryAfter: number, metadata?: Record<string, any>): Promise<void>;
710
+ logRetryAttempt(record: CallbackRecord, user: CallbackUser | undefined, attemptNumber: number): Promise<string>;
711
+ getTokenAuditTrail(token: string): Promise<AuditEntry[]>;
712
+ getUserAuditTrail(userId: string, startTime?: number, endTime?: number): Promise<AuditEntry[]>;
713
+ getStatistics(startTime: number, endTime: number): Promise<Record<string, any>>;
714
+ private persist;
715
+ private generateCorrelationId;
716
+ exportAuditLogs(startTime: number, endTime: number, format?: "json" | "csv"): Promise<string>;
717
+ }
718
+
719
+ declare class CallbackMetrics {
720
+ private readonly registry;
721
+ private readonly callbacksTotal;
722
+ private readonly callbacksSuccess;
723
+ private readonly callbacksFailed;
724
+ private readonly callbacksRetried;
725
+ private readonly accessDenied;
726
+ private readonly rateLimited;
727
+ private readonly tokensIssued;
728
+ private readonly tokensExpired;
729
+ private readonly executionDuration;
730
+ private readonly aclValidationDuration;
731
+ private readonly tokenAge;
732
+ private readonly activeCallbacks;
733
+ private readonly pendingCallbacks;
734
+ private readonly queueSize;
735
+ constructor(registry?: Registry);
736
+ recordExecutionStart(graphType: string, handler?: string): void;
737
+ recordExecutionComplete(graphType: string, handler: string, duration: number, success: boolean, error?: string): void;
738
+ recordTokenIssued(graphType: string, handler: string): void;
739
+ recordTokenExpired(graphType: string): void;
740
+ recordTokenAge(graphType: string, ageMs: number): void;
741
+ recordAclValidation(allowed: boolean, durationMs: number): void;
742
+ recordAccessDenied(reason: string): void;
743
+ recordRateLimited(identifierType: "user" | "ip" | "token"): void;
744
+ recordRetry(graphType: string, handler: string): void;
745
+ updateQueueSize(size: number): void;
746
+ getMetrics(): Promise<string>;
747
+ getContentType(): string;
748
+ reset(): void;
749
+ private classifyError;
750
+ getSummary(): Promise<Record<string, any>>;
751
+ }
752
+
753
+ interface RateLimitConfig {
754
+ windowMs: number;
755
+ maxRequests: number;
756
+ keyPrefix?: string;
757
+ skipFailedRequests?: boolean;
758
+ }
759
+ interface RateLimitResult {
760
+ allowed: boolean;
761
+ limit: number;
762
+ remaining: number;
763
+ resetAt: number;
764
+ retryAfter?: number;
765
+ }
766
+ declare class CallbackRateLimiter {
767
+ private readonly redis;
768
+ private readonly logger;
769
+ private readonly defaultConfig;
770
+ constructor(redis: Redis);
771
+ checkLimit(identifier: string, config?: Partial<RateLimitConfig>): Promise<RateLimitResult>;
772
+ checkUserLimit(userId: string, config?: Partial<RateLimitConfig>): Promise<RateLimitResult>;
773
+ checkIpLimit(ip: string, config?: Partial<RateLimitConfig>): Promise<RateLimitResult>;
774
+ checkTokenLimit(identifier: string, config?: Partial<RateLimitConfig>): Promise<RateLimitResult>;
775
+ reset(identifier: string, keyPrefix?: string): Promise<void>;
776
+ getStatus(identifier: string, config?: Partial<RateLimitConfig>): Promise<RateLimitResult>;
777
+ createHeaders(result: RateLimitResult): Record<string, string>;
778
+ }
779
+
780
+ interface IdempotencyConfig {
781
+ ttlSeconds: number;
782
+ keyPrefix: string;
783
+ hashPayload: boolean;
784
+ includeUserId: boolean;
785
+ }
786
+ interface IdempotencyEntry {
787
+ key: string;
788
+ result: CallbackResult;
789
+ createdAt: number;
790
+ executedAt: number;
791
+ expiresAt: number;
792
+ requestHash: string;
793
+ attempts: number;
794
+ }
795
+ declare enum IdempotencyStatus {
796
+ NEW = "NEW",
797
+ IN_PROGRESS = "IN_PROGRESS",
798
+ COMPLETED = "COMPLETED",
799
+ FAILED = "FAILED"
800
+ }
801
+ declare class IdempotencyManager {
802
+ private readonly redis;
803
+ private readonly logger;
804
+ private readonly defaultConfig;
805
+ constructor(redis: Redis);
806
+ checkAndLock(idempotencyKey: string | undefined, requestData: {
807
+ userId?: string;
808
+ graphType: string;
809
+ handler: string;
810
+ params: Record<string, any>;
811
+ }, config?: Partial<IdempotencyConfig>): Promise<{
812
+ status: IdempotencyStatus;
813
+ result?: CallbackResult;
814
+ key: string;
815
+ }>;
816
+ storeResult(key: string, result: CallbackResult, config?: Partial<IdempotencyConfig>): Promise<void>;
817
+ markFailed(key: string, error: string, config?: Partial<IdempotencyConfig>): Promise<void>;
818
+ releaseLock(key: string, config?: Partial<IdempotencyConfig>): Promise<void>;
819
+ private generateKey;
820
+ private acquireLock;
821
+ private deterministicStringify;
822
+ private sortObject;
823
+ cleanup(): Promise<number>;
824
+ getStatistics(): Promise<{
825
+ totalEntries: number;
826
+ completedEntries: number;
827
+ inProgressEntries: number;
828
+ failedEntries: number;
829
+ cacheHitRate: number;
830
+ }>;
831
+ }
832
+
833
+ declare class TelegramPatchHandler implements CallbackPatchHandler {
834
+ private readonly logger;
835
+ apply(patch: CallbackPatch, context?: any): Promise<void>;
836
+ }
837
+
838
+ declare class WebPatchHandler implements CallbackPatchHandler {
839
+ private readonly logger;
840
+ apply(patch: CallbackPatch, context?: any): Promise<void>;
841
+ }
842
+
843
+ interface CallbackPatchHandler {
844
+ apply(patch: CallbackPatch, context?: any): Promise<void>;
845
+ }
846
+ declare class CallbackPatchService {
847
+ private readonly telegram;
848
+ private readonly web;
849
+ private readonly logger;
850
+ constructor(telegram: TelegramPatchHandler, web: WebPatchHandler);
851
+ apply(record: CallbackRecord, patch: CallbackPatch, context?: any): Promise<void>;
852
+ }
853
+
854
+ interface RouterConfig {
855
+ maxRetries?: number;
856
+ retryDelayMs?: number;
857
+ timeoutMs?: number;
858
+ enableCircuitBreaker?: boolean;
859
+ circuitBreakerThreshold?: number;
860
+ circuitBreakerResetMs?: number;
861
+ }
862
+ interface CircuitBreakerState {
863
+ failures: number;
864
+ lastFailure?: number;
865
+ state: "closed" | "open" | "half-open";
866
+ }
867
+ declare class SmartCallbackRouter {
868
+ private readonly registry;
869
+ private readonly store;
870
+ private readonly acl;
871
+ private readonly auditor;
872
+ private readonly metrics;
873
+ private readonly rateLimiter;
874
+ private readonly idempotencyManager;
875
+ private readonly patchService;
876
+ private readonly logger;
877
+ private readonly circuitBreakers;
878
+ private readonly defaultConfig;
879
+ constructor(registry: CallbackRegistry, store: CallbackStore, acl: CallbackACL, auditor: CallbackAuditor, metrics: CallbackMetrics, rateLimiter: CallbackRateLimiter, idempotencyManager: IdempotencyManager, patchService: CallbackPatchService);
880
+ route(record: CallbackRecord, user: CallbackUser | undefined, requestMetadata?: {
881
+ ip?: string;
882
+ userAgent?: string;
883
+ platform?: string;
884
+ platformContext?: any;
885
+ }, config?: RouterConfig): Promise<CallbackResult>;
886
+ private executeWithRetry;
887
+ private executeWithTimeout;
888
+ private checkRateLimits;
889
+ private checkCircuitBreaker;
890
+ private recordCircuitBreakerFailure;
891
+ private resetCircuitBreaker;
892
+ private isNonRetryableError;
893
+ private sleep;
894
+ getCircuitBreakerStatus(): Map<string, CircuitBreakerState>;
895
+ }
896
+
897
+ declare class UniversalCallbackService {
898
+ private readonly store;
899
+ private readonly router;
900
+ constructor(store: CallbackStore, router: SmartCallbackRouter);
901
+ handle(record: CallbackRecord, user?: any, metadata?: {
902
+ ip?: string;
903
+ userAgent?: string;
904
+ platform?: string;
905
+ platformContext?: any;
906
+ }): Promise<CallbackResult>;
907
+ }
908
+
909
+ declare function registerFinanceExampleCallback(registry: CallbackRegistry): void;
910
+
911
+ interface CallbackMetadata {
912
+ handler: string;
913
+ method: string | symbol;
914
+ target: any;
915
+ }
916
+ interface ExtendedCallbackContext extends CallbackContext {
917
+ builder?: any;
918
+ }
919
+
920
+ type ExtendedCallbackHandler = (context: ExtendedCallbackContext) => Promise<CallbackResult>;
921
+ declare function Callback(handler: string): (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => PropertyDescriptor;
922
+ declare function WithCallbacks<T extends {
923
+ new (...args: any[]): {};
924
+ }>(CallbacksClass: T): <U extends {
925
+ new (...args: any[]): {};
926
+ }>(BuilderClass: U) => any;
927
+ declare function getCallbackMetadata(target: any): CallbackMetadata[];
928
+ declare function hasCallbacks(target: any): boolean;
929
+ declare function findCallbackMethod(target: any, handler: string): string | symbol | null;
930
+
931
+ interface CallbackRequest extends Request {
932
+ callbackRecord: CallbackRecord;
933
+ user?: CallbackUser;
934
+ }
935
+ declare class CallbackTokenGuard implements CanActivate {
936
+ private readonly store;
937
+ private readonly acl;
938
+ private readonly logger;
939
+ constructor(store: CallbackStore, acl: CallbackACL);
940
+ canActivate(context: ExecutionContext): Promise<boolean>;
941
+ private extractUser;
942
+ }
943
+
944
+ declare class CallbackController {
945
+ private readonly callbackService;
946
+ constructor(callbackService: UniversalCallbackService);
947
+ handleCallback(req: CallbackRequest): Promise<CallbackResult>;
948
+ }
949
+
950
+ interface IGraphManifest {
951
+ companySlug: string;
952
+ name: string;
953
+ title: string;
954
+ description: string;
955
+ detailedDescription: string;
956
+ category?: string;
957
+ author?: string;
958
+ maintainer?: string;
959
+ repository?: string;
960
+ tags?: string[];
961
+ ui?: {
962
+ enabled: boolean;
963
+ title: string;
964
+ description?: string;
965
+ defaultScreen: string;
966
+ menu: string[];
967
+ screens: Record<string, any>;
968
+ theme?: Record<string, any>;
969
+ permissions?: Record<string, any>;
970
+ };
971
+ versioning: {
972
+ strategy: "semver";
973
+ defaultVersion: string;
974
+ supportedVersions: string[];
975
+ };
976
+ versions: Record<string, {
977
+ status: string;
978
+ releaseDate: string;
979
+ isActive: boolean;
980
+ visibility: "public" | "private";
981
+ configSchemaPath?: string;
982
+ }>;
983
+ }
984
+ declare abstract class AbstractGraphBuilder<V extends string = string> {
985
+ abstract readonly version: V;
986
+ protected logger: Logger;
987
+ protected callbackRegistry: CallbackRegistry;
988
+ protected endpointRegistry: EndpointRegistry;
989
+ get graphType(): string;
990
+ protected manifestPath: string;
991
+ protected manifest?: IGraphManifest;
992
+ constructor();
993
+ abstract buildGraph(config: any): Promise<any>;
994
+ protected createGraphContext(payload: IGraphRequestPayload): {
995
+ messageId?: string;
996
+ threadId: string;
997
+ userId: string;
998
+ agentId: string;
999
+ companyId?: string;
1000
+ };
1001
+ prepareConfig(payload: IGraphRequestPayload): Promise<any>;
1002
+ protected loadManifest(): Promise<IGraphManifest | null>;
1003
+ protected loadManifestSync(): IGraphManifest | null;
1004
+ protected validateManifest(manifest: IGraphManifest): void;
1005
+ getGraphMetadata(): Promise<IGraphManifest | null>;
1006
+ getVersionConfig(): Promise<{
1007
+ configSchema: any;
1008
+ graphType: string;
1009
+ version: V;
1010
+ status: string;
1011
+ releaseDate: string;
1012
+ isActive: boolean;
1013
+ visibility: "public" | "private";
1014
+ configSchemaPath?: string;
1015
+ companySlug: string;
1016
+ name: string;
1017
+ title: string;
1018
+ description: string;
1019
+ detailedDescription: string;
1020
+ category: string;
1021
+ tags: string[];
1022
+ ui: {
1023
+ enabled: boolean;
1024
+ title: string;
1025
+ description?: string;
1026
+ defaultScreen: string;
1027
+ menu: string[];
1028
+ screens: Record<string, any>;
1029
+ theme?: Record<string, any>;
1030
+ permissions?: Record<string, any>;
1031
+ };
1032
+ }>;
1033
+ getFullGraphType(baseGraphType: string): string;
1034
+ validateVersion(): boolean;
1035
+ protected registerCallbacks(): Promise<void>;
1036
+ protected registerEndpoints(): Promise<void>;
1037
+ protected registerEndpointsManually(endpoints: EndpointDescriptor[]): void;
1038
+ }
1039
+ interface IGraphEngine {
1040
+ invokeGraph(graph: any, config: any, signal?: AbortSignal): Promise<any>;
1041
+ streamGraph(graph: any, config: any, onPartial: (chunk: string) => void, signal?: AbortSignal): Promise<any>;
1042
+ }
1043
+ declare class UniversalGraphService implements IGraphService {
1044
+ protected readonly configService: ConfigService;
1045
+ private readonly builders;
1046
+ private readonly engine;
1047
+ private readonly endpointRegistry;
1048
+ readonly logger: Logger;
1049
+ constructor(configService: ConfigService, builders: AbstractGraphBuilder<string>[], engine: IGraphEngine, endpointRegistry: EndpointRegistry);
1050
+ getSupportedGraphTypes(): Promise<string[]>;
1051
+ generateAnswer(payload: IGraphRequestPayload): Promise<IGraphResponsePayload>;
1052
+ streamAnswer(payload: any, onPartial: any): Promise<{
1053
+ requestId: any;
1054
+ text: any;
1055
+ attachments: any;
1056
+ metadata: any;
1057
+ reasoningChains: any;
1058
+ }>;
1059
+ healthCheck(): Promise<boolean>;
1060
+ cancelGeneration(requestId: string): Promise<void>;
1061
+ private readonly activeGenerations;
1062
+ private registerActiveGeneration;
1063
+ private unregisterActiveGeneration;
1064
+ executeCallback(token: string, platform?: string, platformContext?: any): Promise<CallbackResult>;
1065
+ private executeCallbackFromDecorators;
1066
+ private parseCallbackToken;
1067
+ private parseCallbackParams;
1068
+ callEndpoint(graphType: string, endpointName: string, context: RequestContext): Promise<DataEnvelope>;
1069
+ listEndpoints(graphType: string): string[];
1070
+ listGraphTypesWithEndpoints(): string[];
1071
+ private getBuilderForType;
1072
+ }
1073
+
1074
+ interface IDeletionInfo {
1075
+ deletedAt: Date;
1076
+ deletedBy: string;
1077
+ reason?: string;
1078
+ }
1079
+ interface IBaseEntity {
1080
+ id: string;
1081
+ version: number;
1082
+ createdAt?: Date;
1083
+ updatedAt?: Date;
1084
+ deletion?: IDeletionInfo;
1085
+ }
1086
+
1087
+ declare function bootstrap(AppModule: any, options?: {
1088
+ port?: number;
1089
+ globalPrefix?: string;
1090
+ }): Promise<_nestjs_common.INestApplication<any>>;
1091
+
1092
+ interface LLMCallRecord {
1093
+ modelId: string;
1094
+ promptTokens: number;
1095
+ completionTokens: number;
1096
+ totalTokens: number;
1097
+ timestamp: number;
1098
+ nodeName?: string;
1099
+ }
1100
+ interface StreamAccumulator {
1101
+ streamedText: string;
1102
+ reasoningChains: IReasoningChain[];
1103
+ generation: IStoredMessageContent | null;
1104
+ llmCalls: LLMCallRecord[];
1105
+ traceEvents: IGraphTraceEvent[];
1106
+ traceStartedAt: number | null;
1107
+ traceCompletedAt: number | null;
1108
+ }
1109
+ declare class EventProcessor {
1110
+ private readonly logger;
1111
+ createAccumulator(): StreamAccumulator;
1112
+ private normalizeContentBlocks;
1113
+ processEvent(acc: StreamAccumulator, event: any, onPartial?: (chunk: string) => void): void;
1114
+ getResult(acc: StreamAccumulator): {
1115
+ content: IStoredMessageContent;
1116
+ metrics: {
1117
+ modelCalls: Array<{
1118
+ nodeName: string;
1119
+ timestamp: number;
1120
+ modelId: string;
1121
+ promptTokens: number;
1122
+ completionTokens: number;
1123
+ totalTokens: number;
1124
+ latencyMs: number;
1125
+ }>;
1126
+ apiCalls: any[];
1127
+ } | null;
1128
+ trace: {
1129
+ events: IGraphTraceEvent[];
1130
+ startedAt: number;
1131
+ completedAt: number;
1132
+ durationMs: number;
1133
+ totalEvents: number;
1134
+ totalModelCalls: number;
1135
+ } | null;
1136
+ };
1137
+ private captureTraceEvent;
1138
+ private normalizeTraceEvent;
1139
+ }
1140
+
1141
+ declare class LangGraphEngine implements IGraphEngine {
1142
+ private readonly eventProcessor;
1143
+ private readonly configService;
1144
+ private readonly logger;
1145
+ constructor(eventProcessor: EventProcessor, configService: ConfigService);
1146
+ invokeGraph(graph: any, config: any, signal?: AbortSignal): Promise<any>;
1147
+ streamGraph(graph: any, config: any, onPartial: (chunk: string) => void, signal?: AbortSignal): Promise<any>;
1148
+ private sendMetricsWebhook;
1149
+ private sendTraceEventsBatch;
1150
+ private processGraphResult;
1151
+ }
1152
+
1153
+ declare enum GraphEngineType {
1154
+ LANGGRAPH = "langgraph",
1155
+ LANGFLOW = "langflow",
1156
+ FLOWISE = "flowise"
1157
+ }
1158
+ declare class GraphEngineFactory {
1159
+ private readonly langgraph;
1160
+ constructor(langgraph: LangGraphEngine);
1161
+ getEngine(engineType: GraphEngineType): IGraphEngine;
1162
+ }
1163
+
1164
+ interface UniversalGraphModuleOptions {
1165
+ engineType?: GraphEngineType;
1166
+ versioning?: VersioningConfig[];
1167
+ }
1168
+ declare class UniversalGraphModule {
1169
+ static forRoot(options: UniversalGraphModuleOptions): DynamicModule;
1170
+ }
1171
+
1172
+ interface ApiCallTracerOptions {
1173
+ maxStringLength?: number;
1174
+ maxDepth?: number;
1175
+ }
1176
+ declare const DEFAULT_TRACER_OPTIONS: Required<ApiCallTracerOptions>;
1177
+ interface TraceApiCallResult<TResult> {
1178
+ result: TResult;
1179
+ startedAt: number;
1180
+ completedAt: number;
1181
+ durationMs: number;
1182
+ }
1183
+ declare function traceApiCall<TResult>(execute: () => Promise<TResult>, options?: ApiCallTracerOptions): Promise<TraceApiCallResult<TResult>>;
1184
+ declare function sanitizeTraceData(value: unknown, depth?: number, seen?: WeakSet<object>, options?: ApiCallTracerOptions): unknown;
1185
+
1186
+ declare enum ModelProvider {
1187
+ FLUTCH = "flutch",
1188
+ FLUTCH_MISTRAL = "flutch-mistral",
1189
+ FLUTCH_OPENAI = "flutch-openai",
1190
+ FLUTCH_ANTHROPIC = "flutch-anthropic",
1191
+ MISTRAL = "mistral",
1192
+ OPENAI = "openai",
1193
+ ANTHROPIC = "anthropic",
1194
+ AWS = "aws",
1195
+ COHERE = "cohere",
1196
+ VOYAGEAI = "voyageai"
1197
+ }
1198
+ declare enum ModelType {
1199
+ CHAT = "chat",
1200
+ RERANK = "rerank",
1201
+ EMBEDDING = "embedding",
1202
+ IMAGE = "image",
1203
+ SPEECH = "speech"
1204
+ }
1205
+ declare enum ChatFeature {
1206
+ STREAMING = "streaming",
1207
+ TOOLS = "tools",
1208
+ VISION = "vision",
1209
+ FUNCTION_CALLING = "function_calling",
1210
+ JSON_MODE = "json_mode"
1211
+ }
1212
+
1213
+ interface ModelConfig {
1214
+ name: string;
1215
+ modelProvider: ModelProvider;
1216
+ temperature?: number;
1217
+ maxTokens?: number;
1218
+ }
1219
+ interface ModelByIdConfig {
1220
+ modelId: string;
1221
+ temperature?: number;
1222
+ maxTokens?: number;
1223
+ }
1224
+ type ModelConfigFetcher = (modelId: string) => Promise<ModelConfigWithToken>;
1225
+ interface ModelConfigWithToken {
1226
+ modelId: string;
1227
+ modelName: string;
1228
+ provider: ModelProvider;
1229
+ defaultTemperature: number;
1230
+ defaultMaxTokens: number;
1231
+ apiToken?: string;
1232
+ requiresApiKey: boolean;
1233
+ }
1234
+ type LLModel = BaseChatModel;
1235
+ type ConcreteModels = ChatOpenAI | ChatAnthropic | ChatCohere | ChatMistralAI;
1236
+ type ModelCreator = (config: ModelConfig & {
1237
+ customApiToken?: string;
1238
+ }) => LLModel;
1239
+
1240
+ type Model = BaseChatModel | BaseDocumentCompressor | Embeddings;
1241
+ interface ModelByIdWithTypeConfig extends ModelByIdConfig {
1242
+ modelType: ModelType;
1243
+ }
1244
+ interface ModelConfigWithTokenAndType extends ModelConfigWithToken {
1245
+ modelType: ModelType;
1246
+ maxDocuments?: number;
1247
+ dimensions?: number;
1248
+ supportedFormats?: string[];
1249
+ }
1250
+ interface IModelInitializer {
1251
+ createChatModelById(modelId: string): Promise<BaseChatModel>;
1252
+ createRerankModelById(modelId: string): Promise<BaseDocumentCompressor>;
1253
+ createEmbeddingModelById(modelId: string): Promise<Embeddings>;
1254
+ createModelById(modelId: string, expectedType?: ModelType): Promise<Model>;
1255
+ initializeChatModel(config: ModelByIdConfig): Promise<BaseChatModel>;
1256
+ initializeRerankModel(config: ModelByIdConfig): Promise<BaseDocumentCompressor>;
1257
+ initializeEmbeddingModel(config: ModelByIdConfig): Promise<Embeddings>;
1258
+ initializeModelByType(config: ModelByIdWithTypeConfig): Promise<Model>;
1259
+ getModelConfigWithType(modelId: string): Promise<ModelConfigWithTokenAndType>;
1260
+ isModelTypeSupported(modelType: ModelType): boolean;
1261
+ getSupportedModelTypes(): ModelType[];
1262
+ }
1263
+ type ChatModelCreator = (config: ModelConfigWithTokenAndType) => BaseChatModel;
1264
+ type RerankModelCreator = (config: ModelConfigWithTokenAndType) => BaseDocumentCompressor;
1265
+ type EmbeddingModelCreator = (config: ModelConfigWithTokenAndType) => Embeddings;
1266
+ interface ModelCreators {
1267
+ [ModelType.CHAT]: ChatModelCreator;
1268
+ [ModelType.RERANK]: RerankModelCreator;
1269
+ [ModelType.EMBEDDING]: EmbeddingModelCreator;
1270
+ [ModelType.IMAGE]?: never;
1271
+ [ModelType.SPEECH]?: never;
1272
+ }
1273
+
1274
+ declare class ModelInitializer implements IModelInitializer {
1275
+ private configFetcher?;
1276
+ private logger;
1277
+ private modelConfigCache;
1278
+ private modelInstanceCache;
1279
+ constructor(configFetcher?: ModelConfigFetcher, logger?: Logger);
1280
+ private generateModelCacheKey;
1281
+ private requiresMaxCompletionTokens;
1282
+ private readonly chatModelCreators;
1283
+ private readonly rerankModelCreators;
1284
+ private readonly embeddingModelCreators;
1285
+ initializeChatModel(config: ModelByIdConfig): Promise<BaseChatModel>;
1286
+ initializeRerankModel(config: ModelByIdConfig): Promise<BaseDocumentCompressor>;
1287
+ initializeEmbeddingModel(config: ModelByIdConfig): Promise<Embeddings>;
1288
+ createChatModelById(modelId: string): Promise<BaseChatModel>;
1289
+ createRerankModelById(modelId: string): Promise<BaseDocumentCompressor>;
1290
+ createEmbeddingModelById(modelId: string): Promise<Embeddings>;
1291
+ createModelById(modelId: string, expectedType?: ModelType): Promise<Model>;
1292
+ initializeModelByType(config: ModelByIdWithTypeConfig): Promise<Model>;
1293
+ getModelConfigWithType(modelId: string): Promise<ModelConfigWithTokenAndType>;
1294
+ isModelTypeSupported(modelType: ModelType): boolean;
1295
+ getSupportedModelTypes(): ModelType[];
1296
+ clearCache(): void;
1297
+ clearModelCache(modelId: string): void;
1298
+ getCacheStats(): {
1299
+ configCacheSize: number;
1300
+ instanceCacheSize: number;
1301
+ configCacheKeys: string[];
1302
+ instanceCacheKeys: string[];
1303
+ };
1304
+ private fetchFromApi;
1305
+ }
1306
+ declare function prepareModelWithTools(model: BaseChatModel, tools: StructuredTool[], baseConfig?: any): {
1307
+ modelWithTools: any;
1308
+ finalConfig: any;
1309
+ toolsMethod: "bindTools" | "manual" | "none";
1310
+ };
1311
+
1312
+ interface VoyageAIRerankConfig {
1313
+ apiKey?: string;
1314
+ model?: string;
1315
+ topN?: number;
1316
+ truncation?: boolean;
1317
+ }
1318
+ declare class VoyageAIRerank extends BaseDocumentCompressor {
1319
+ private apiKey;
1320
+ private model;
1321
+ private topN;
1322
+ private truncation;
1323
+ private baseUrl;
1324
+ constructor(config: VoyageAIRerankConfig);
1325
+ compressDocuments(documents: Document[], query: string, callbacks?: any): Promise<Document[]>;
1326
+ }
1327
+
1328
+ interface IToolCatalog extends IBaseEntity {
1329
+ toolName: string;
1330
+ title: string;
1331
+ description?: string;
1332
+ category?: string;
1333
+ isActive: boolean;
1334
+ toolVersion?: string;
1335
+ configSchema?: IToolConfigOption[];
1336
+ }
1337
+ interface IToolConfigOption {
1338
+ key: string;
1339
+ name: string;
1340
+ description?: string;
1341
+ type: "string" | "number" | "boolean" | "select" | "kbselect" | "modelSelector" | "text" | "textarea";
1342
+ required?: boolean;
1343
+ defaultValue?: any;
1344
+ options?: Array<{
1345
+ value: string;
1346
+ label: string;
1347
+ }>;
1348
+ params?: {
1349
+ isMulti?: boolean;
1350
+ minimum?: number;
1351
+ maximum?: number;
1352
+ placeholder?: string;
1353
+ maxLength?: number;
1354
+ modelType?: ModelType;
1355
+ provider?: ModelProvider;
1356
+ isActive?: boolean;
1357
+ };
1358
+ }
1359
+
1360
+ interface IAgentToolConfig {
1361
+ toolName: string;
1362
+ enabled: boolean;
1363
+ config?: Record<string, any>;
1364
+ }
1365
+ interface IAgentToolConfiguration {
1366
+ toolName: string;
1367
+ enabled: boolean;
1368
+ config?: Record<string, any>;
1369
+ credentials?: Record<string, string>;
1370
+ useGlobalCredentials?: boolean;
1371
+ }
1372
+ interface ISystemToolCredentials {
1373
+ toolName: string;
1374
+ credentials: Record<string, string>;
1375
+ createdBy: string;
1376
+ createdAt: Date;
1377
+ updatedAt: Date;
1378
+ }
1379
+ interface IToolExecutionContext {
1380
+ toolName: string;
1381
+ config: Record<string, any>;
1382
+ credentials: Record<string, string>;
1383
+ agentId: string;
1384
+ userId: string;
1385
+ }
1386
+
1387
+ interface McpTool {
1388
+ name: string;
1389
+ description: string;
1390
+ inputSchema: {
1391
+ type: "object";
1392
+ properties: Record<string, any>;
1393
+ required?: string[];
1394
+ };
1395
+ }
1396
+ interface ToolExecutionResult {
1397
+ success: boolean;
1398
+ result?: any;
1399
+ error?: string;
1400
+ }
1401
+ interface McpRuntimeClient {
1402
+ getTools(): Promise<McpTool[]>;
1403
+ executeTool(name: string, args: any): Promise<ToolExecutionResult>;
1404
+ isHealthy(): Promise<boolean>;
1405
+ }
1406
+
1407
+ type LangChainStructuredTool = StructuredTool<any, any, any, string>;
1408
+ declare class McpConverter {
1409
+ private readonly logger;
1410
+ private readonly mcpRuntimeUrl;
1411
+ constructor(mcpRuntimeUrl?: string);
1412
+ private jsonSchemaToZod;
1413
+ private mapPrimitiveSchema;
1414
+ convertTool(mcpTool: McpTool): LangChainStructuredTool;
1415
+ convertTools(mcpTools: McpTool[]): Promise<LangChainStructuredTool[]>;
1416
+ fetchAndConvertTools(filter?: string): Promise<LangChainStructuredTool[]>;
1417
+ healthCheck(): Promise<boolean>;
1418
+ }
1419
+
1420
+ declare class McpToolFilter {
1421
+ private readonly mcpRuntimeUrl;
1422
+ private readonly logger;
1423
+ private readonly mcpConverter;
1424
+ constructor(mcpRuntimeUrl?: string);
1425
+ getFilteredTools(enabledTools?: string[]): Promise<StructuredTool[]>;
1426
+ getAllTools(): Promise<StructuredTool[]>;
1427
+ isHealthy(): Promise<boolean>;
1428
+ getAvailableToolNames(): Promise<string[]>;
1429
+ }
1430
+
1431
+ declare enum RetrieverSearchType {
1432
+ Search = "search",
1433
+ MMR = "mmr",
1434
+ Similarity = "similarity"
1435
+ }
1436
+
1437
+ interface CustomDocument {
1438
+ id: string;
1439
+ content: string;
1440
+ metadata: {
1441
+ knowledgeBaseId: string;
1442
+ source?: string;
1443
+ title?: string;
1444
+ url?: string;
1445
+ [key: string]: any;
1446
+ };
1447
+ }
1448
+ interface RetrieveQueryOptions {
1449
+ k?: number;
1450
+ threshold?: number;
1451
+ metadata?: Record<string, any>;
1452
+ }
1453
+ interface KnowledgeBaseInfo {
1454
+ id: string;
1455
+ name: string;
1456
+ documentsCount: number;
1457
+ lastUpdated: string;
1458
+ }
1459
+
1460
+ interface RetrieverConfig {
1461
+ apiUrl?: string;
1462
+ internalToken?: string;
1463
+ timeout?: number;
1464
+ retries?: number;
1465
+ }
1466
+ declare class RetrieverService {
1467
+ private readonly logger;
1468
+ private readonly apiUrl;
1469
+ private readonly internalToken;
1470
+ private readonly timeout;
1471
+ private readonly retries;
1472
+ constructor(config?: RetrieverConfig);
1473
+ private makeRequest;
1474
+ healthCheck(): Promise<boolean>;
1475
+ search(query: string, searchType: RetrieverSearchType, knowledgeBaseIds: string[], options?: RetrieveQueryOptions): Promise<CustomDocument[]>;
1476
+ getDocumentsByIds(ids: string[]): Promise<CustomDocument[]>;
1477
+ knowledgeBaseExists(knowledgeBaseId: string): Promise<boolean>;
1478
+ getKnowledgeBaseInfo(knowledgeBaseId: string): Promise<KnowledgeBaseInfo | null>;
1479
+ textSearch(query: string, knowledgeBaseIds: string[], limit?: number): Promise<CustomDocument[]>;
1480
+ getAvailableKnowledgeBases(): Promise<KnowledgeBaseInfo[]>;
1481
+ check(): string;
1482
+ }
1483
+
1484
+ declare class GraphTypeUtils {
1485
+ static parse(fullType: string): {
1486
+ companyId: string;
1487
+ name: string;
1488
+ version?: string;
1489
+ };
1490
+ static build(companyId: string, name: string, version?: string): string;
1491
+ static normalize(graphType: string): string;
1492
+ static getBaseType(graphType: string): string;
1493
+ static getVersion(graphType: string): string | undefined;
1494
+ static isValidVersion(version: string): boolean;
1495
+ static isSystemGraph(graphType: string): boolean;
1496
+ static compareVersions(a: string, b: string): number;
1497
+ }
1498
+
1499
+ export { type ACLValidationResult, AbstractGraphBuilder, type ApiCallTracerOptions, AttachmentType, type AuditEntry, 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 ChartType, ChatFeature, type ChatModelCreator, 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, GraphController, GraphEngineFactory, GraphEngineType, GraphManifestSchema, GraphManifestValidator, GraphServiceTokens, GraphTypeUtils, type IAgentToolConfig, type IAgentToolConfiguration, type IAttachment, type IBaseEntity, type IChartDataPoint, type IChartDataset, type IChartValue, type IDeletionInfo, type IGenericGraphType, 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, 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 RateLimitConfig, type RateLimitResult, type RequestContext, type RerankModelCreator, type RetrieveQueryOptions, type RetrieverConfig, RetrieverSearchType, RetrieverService, type RouterConfig, SmartCallbackRouter, 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, findCallbackMethod, findEndpointMethod, getCallbackMetadata, getEndpointMetadata, getUIEndpointClassMetadata, getUIEndpointMethodsMetadata, hasCallbacks, hasUIEndpoints, prepareModelWithTools, registerFinanceExampleCallback, registerUIEndpointsFromClass, sanitizeTraceData, traceApiCall };