@flutchai/flutch-sdk 0.2.10 → 0.2.11

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
@@ -1702,6 +1702,23 @@ declare class OAuthTokenManager {
1702
1702
  declare function encryptTokens(tokens: OAuthTokens, key: string): string;
1703
1703
  declare function decryptTokens(encrypted: string, key: string): OAuthTokens;
1704
1704
 
1705
+ interface OAuthProviderDef {
1706
+ name: string;
1707
+ authorizationUrl: string;
1708
+ tokenUrl: string;
1709
+ scopes: string[];
1710
+ clientIdEnvVar: string;
1711
+ clientSecretEnvVar: string;
1712
+ }
1713
+ declare function loadOAuthProviders(providers: Record<string, OAuthProviderDef>): void;
1714
+ declare function getOAuthProvider(provider: string): OAuthProviderDef;
1715
+ declare function getOAuthProviderNames(): string[];
1716
+ declare function resolveOAuthProviderConfig(provider: string): OAuthProviderConfig;
1717
+ declare function buildOAuthAuthorizationUrl(provider: string, params: {
1718
+ redirectUri: string;
1719
+ state: string;
1720
+ }): string;
1721
+
1705
1722
  declare class FileTokenStore implements IOAuthTokenStore {
1706
1723
  private readonly filePath;
1707
1724
  constructor(filePath: string);
@@ -1723,4 +1740,4 @@ declare class MongoTokenStore implements IOAuthTokenStore {
1723
1740
  private ensureIndex;
1724
1741
  }
1725
1742
 
1726
- export { type ACLValidationResult, AbstractGraphBuilder, type ApiCallTracerOptions, type ApiKeyResolver, 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 CustomDocument, DEFAULT_ATTACHMENT_THRESHOLD, DEFAULT_TRACER_OPTIONS, type DataEnvelope, ENDPOINT_METADATA_KEY, type EmbeddingModelCreator, Endpoint, type EndpointDescriptor, type EndpointHandler, type EndpointMetadata, type EndpointOptions, EndpointRegistry, EventProcessor, type ExecuteToolWithAttachmentsParams, type ExecuteToolWithAttachmentsResult, type ExtendedCallbackContext, type ExtendedCallbackHandler, ExternalGraphBuilder, FileBasedDiscovery, FileTokenStore, 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 IGraphLogger, 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 ILangGraphConfig, type IModelInitializer, type IOAuthTokenStore, 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 ModelConfigFetcher, type ModelConfigWithToken, type ModelConfigWithTokenAndType, type ModelCreators, ModelInitializer, ModelProvider, ModelType, type MongoDBConfig, MongoTokenStore, type OAuthProviderConfig, OAuthTokenManager, type OAuthTokenManagerOptions, type OAuthTokens, 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, _internals, bootstrap, clearAttachmentDataStore, createEndpointDescriptors, createGraphAttachment, createMongoClientAdapter, createStaticMessage, decryptTokens, dispatchAttachments, encryptTokens, executeToolWithAttachments, findCallbackMethod, findEndpointMethod, generateAttachmentSummary, getAttachmentData, getCallbackMetadata, getEndpointMetadata, getUIEndpointClassMetadata, getUIEndpointMethodsMetadata, hasCallbacks, hasUIEndpoints, registerFinanceExampleCallback, registerUIEndpointsFromClass, sanitizeTraceData, storeAttachmentData, traceApiCall };
1743
+ export { type ACLValidationResult, AbstractGraphBuilder, type ApiCallTracerOptions, type ApiKeyResolver, 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 CustomDocument, DEFAULT_ATTACHMENT_THRESHOLD, DEFAULT_TRACER_OPTIONS, type DataEnvelope, ENDPOINT_METADATA_KEY, type EmbeddingModelCreator, Endpoint, type EndpointDescriptor, type EndpointHandler, type EndpointMetadata, type EndpointOptions, EndpointRegistry, EventProcessor, type ExecuteToolWithAttachmentsParams, type ExecuteToolWithAttachmentsResult, type ExtendedCallbackContext, type ExtendedCallbackHandler, ExternalGraphBuilder, FileBasedDiscovery, FileTokenStore, 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 IGraphLogger, 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 ILangGraphConfig, type IModelInitializer, type IOAuthTokenStore, 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 ModelConfigFetcher, type ModelConfigWithToken, type ModelConfigWithTokenAndType, type ModelCreators, ModelInitializer, ModelProvider, ModelType, type MongoDBConfig, MongoTokenStore, type OAuthProviderConfig, type OAuthProviderDef, OAuthTokenManager, type OAuthTokenManagerOptions, type OAuthTokens, 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, _internals, bootstrap, buildOAuthAuthorizationUrl, clearAttachmentDataStore, createEndpointDescriptors, createGraphAttachment, createMongoClientAdapter, createStaticMessage, decryptTokens, dispatchAttachments, encryptTokens, executeToolWithAttachments, findCallbackMethod, findEndpointMethod, generateAttachmentSummary, getAttachmentData, getCallbackMetadata, getEndpointMetadata, getOAuthProvider, getOAuthProviderNames, getUIEndpointClassMetadata, getUIEndpointMethodsMetadata, hasCallbacks, hasUIEndpoints, loadOAuthProviders, registerFinanceExampleCallback, registerUIEndpointsFromClass, resolveOAuthProviderConfig, sanitizeTraceData, storeAttachmentData, traceApiCall };
package/dist/index.d.ts CHANGED
@@ -1702,6 +1702,23 @@ declare class OAuthTokenManager {
1702
1702
  declare function encryptTokens(tokens: OAuthTokens, key: string): string;
1703
1703
  declare function decryptTokens(encrypted: string, key: string): OAuthTokens;
1704
1704
 
1705
+ interface OAuthProviderDef {
1706
+ name: string;
1707
+ authorizationUrl: string;
1708
+ tokenUrl: string;
1709
+ scopes: string[];
1710
+ clientIdEnvVar: string;
1711
+ clientSecretEnvVar: string;
1712
+ }
1713
+ declare function loadOAuthProviders(providers: Record<string, OAuthProviderDef>): void;
1714
+ declare function getOAuthProvider(provider: string): OAuthProviderDef;
1715
+ declare function getOAuthProviderNames(): string[];
1716
+ declare function resolveOAuthProviderConfig(provider: string): OAuthProviderConfig;
1717
+ declare function buildOAuthAuthorizationUrl(provider: string, params: {
1718
+ redirectUri: string;
1719
+ state: string;
1720
+ }): string;
1721
+
1705
1722
  declare class FileTokenStore implements IOAuthTokenStore {
1706
1723
  private readonly filePath;
1707
1724
  constructor(filePath: string);
@@ -1723,4 +1740,4 @@ declare class MongoTokenStore implements IOAuthTokenStore {
1723
1740
  private ensureIndex;
1724
1741
  }
1725
1742
 
1726
- export { type ACLValidationResult, AbstractGraphBuilder, type ApiCallTracerOptions, type ApiKeyResolver, 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 CustomDocument, DEFAULT_ATTACHMENT_THRESHOLD, DEFAULT_TRACER_OPTIONS, type DataEnvelope, ENDPOINT_METADATA_KEY, type EmbeddingModelCreator, Endpoint, type EndpointDescriptor, type EndpointHandler, type EndpointMetadata, type EndpointOptions, EndpointRegistry, EventProcessor, type ExecuteToolWithAttachmentsParams, type ExecuteToolWithAttachmentsResult, type ExtendedCallbackContext, type ExtendedCallbackHandler, ExternalGraphBuilder, FileBasedDiscovery, FileTokenStore, 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 IGraphLogger, 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 ILangGraphConfig, type IModelInitializer, type IOAuthTokenStore, 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 ModelConfigFetcher, type ModelConfigWithToken, type ModelConfigWithTokenAndType, type ModelCreators, ModelInitializer, ModelProvider, ModelType, type MongoDBConfig, MongoTokenStore, type OAuthProviderConfig, OAuthTokenManager, type OAuthTokenManagerOptions, type OAuthTokens, 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, _internals, bootstrap, clearAttachmentDataStore, createEndpointDescriptors, createGraphAttachment, createMongoClientAdapter, createStaticMessage, decryptTokens, dispatchAttachments, encryptTokens, executeToolWithAttachments, findCallbackMethod, findEndpointMethod, generateAttachmentSummary, getAttachmentData, getCallbackMetadata, getEndpointMetadata, getUIEndpointClassMetadata, getUIEndpointMethodsMetadata, hasCallbacks, hasUIEndpoints, registerFinanceExampleCallback, registerUIEndpointsFromClass, sanitizeTraceData, storeAttachmentData, traceApiCall };
1743
+ export { type ACLValidationResult, AbstractGraphBuilder, type ApiCallTracerOptions, type ApiKeyResolver, 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 CustomDocument, DEFAULT_ATTACHMENT_THRESHOLD, DEFAULT_TRACER_OPTIONS, type DataEnvelope, ENDPOINT_METADATA_KEY, type EmbeddingModelCreator, Endpoint, type EndpointDescriptor, type EndpointHandler, type EndpointMetadata, type EndpointOptions, EndpointRegistry, EventProcessor, type ExecuteToolWithAttachmentsParams, type ExecuteToolWithAttachmentsResult, type ExtendedCallbackContext, type ExtendedCallbackHandler, ExternalGraphBuilder, FileBasedDiscovery, FileTokenStore, 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 IGraphLogger, 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 ILangGraphConfig, type IModelInitializer, type IOAuthTokenStore, 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 ModelConfigFetcher, type ModelConfigWithToken, type ModelConfigWithTokenAndType, type ModelCreators, ModelInitializer, ModelProvider, ModelType, type MongoDBConfig, MongoTokenStore, type OAuthProviderConfig, type OAuthProviderDef, OAuthTokenManager, type OAuthTokenManagerOptions, type OAuthTokens, 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, _internals, bootstrap, buildOAuthAuthorizationUrl, clearAttachmentDataStore, createEndpointDescriptors, createGraphAttachment, createMongoClientAdapter, createStaticMessage, decryptTokens, dispatchAttachments, encryptTokens, executeToolWithAttachments, findCallbackMethod, findEndpointMethod, generateAttachmentSummary, getAttachmentData, getCallbackMetadata, getEndpointMetadata, getOAuthProvider, getOAuthProviderNames, getUIEndpointClassMetadata, getUIEndpointMethodsMetadata, hasCallbacks, hasUIEndpoints, loadOAuthProviders, registerFinanceExampleCallback, registerUIEndpointsFromClass, resolveOAuthProviderConfig, sanitizeTraceData, storeAttachmentData, traceApiCall };
package/dist/index.js CHANGED
@@ -2818,8 +2818,8 @@ IdempotencyManager = __decorateClass([
2818
2818
 
2819
2819
  // src/callbacks/smart-callback.router.ts
2820
2820
  var SmartCallbackRouter = class {
2821
- constructor(registry, store, acl, auditor, metrics, rateLimiter, idempotencyManager, patchService) {
2822
- this.registry = registry;
2821
+ constructor(registry2, store, acl, auditor, metrics, rateLimiter, idempotencyManager, patchService) {
2822
+ this.registry = registry2;
2823
2823
  this.store = store;
2824
2824
  this.acl = acl;
2825
2825
  this.auditor = auditor;
@@ -3098,8 +3098,8 @@ var UniversalCallbackService = class {
3098
3098
  };
3099
3099
 
3100
3100
  // src/callbacks/example.callback.ts
3101
- function registerFinanceExampleCallback(registry) {
3102
- registry.register(
3101
+ function registerFinanceExampleCallback(registry2) {
3102
+ registry2.register(
3103
3103
  "example",
3104
3104
  async () => ({
3105
3105
  success: true,
@@ -3624,8 +3624,8 @@ var CallbackMetrics = class {
3624
3624
  activeCallbacks;
3625
3625
  pendingCallbacks;
3626
3626
  queueSize;
3627
- constructor(registry) {
3628
- this.registry = registry ?? new Registry();
3627
+ constructor(registry2) {
3628
+ this.registry = registry2 ?? new Registry();
3629
3629
  collectDefaultMetrics({ register: this.registry });
3630
3630
  this.callbacksTotal = new Counter({
3631
3631
  name: "graph_callbacks_total",
@@ -5628,7 +5628,7 @@ var UniversalGraphModule = class {
5628
5628
  },
5629
5629
  {
5630
5630
  provide: CallbackMetrics,
5631
- useFactory: (registry) => new CallbackMetrics(registry),
5631
+ useFactory: (registry2) => new CallbackMetrics(registry2),
5632
5632
  inject: ["PROMETHEUS_REGISTRY"]
5633
5633
  },
5634
5634
  {
@@ -5656,8 +5656,8 @@ var UniversalGraphModule = class {
5656
5656
  },
5657
5657
  {
5658
5658
  provide: SmartCallbackRouter,
5659
- useFactory: (registry, store, acl, auditor, metrics, rateLimiter, idempotencyManager, patchService) => new SmartCallbackRouter(
5660
- registry,
5659
+ useFactory: (registry2, store, acl, auditor, metrics, rateLimiter, idempotencyManager, patchService) => new SmartCallbackRouter(
5660
+ registry2,
5661
5661
  store,
5662
5662
  acl,
5663
5663
  auditor,
@@ -5689,8 +5689,8 @@ var UniversalGraphModule = class {
5689
5689
  },
5690
5690
  {
5691
5691
  provide: "CALLBACK_EXAMPLE_REGISTRATION",
5692
- useFactory: (registry) => {
5693
- registerFinanceExampleCallback(registry);
5692
+ useFactory: (registry2) => {
5693
+ registerFinanceExampleCallback(registry2);
5694
5694
  },
5695
5695
  inject: [CallbackRegistry]
5696
5696
  },
@@ -5753,8 +5753,8 @@ var UniversalGraphModule = class {
5753
5753
  },
5754
5754
  {
5755
5755
  provide: "GRAPH_BUILDERS",
5756
- useFactory: (registry) => {
5757
- return registry.getBuilders();
5756
+ useFactory: (registry2) => {
5757
+ return registry2.getBuilders();
5758
5758
  },
5759
5759
  inject: [BuilderRegistryService]
5760
5760
  },
@@ -7300,11 +7300,7 @@ var ALGORITHM = "aes-256-cbc";
7300
7300
  var IV_LENGTH = 16;
7301
7301
  function encryptTokens(tokens, key) {
7302
7302
  const iv = crypto.randomBytes(IV_LENGTH);
7303
- const cipher = crypto.createCipheriv(
7304
- ALGORITHM,
7305
- Buffer.from(key),
7306
- iv
7307
- );
7303
+ const cipher = crypto.createCipheriv(ALGORITHM, Buffer.from(key), iv);
7308
7304
  const json = JSON.stringify(tokens);
7309
7305
  let encrypted = cipher.update(json, "utf8", "hex");
7310
7306
  encrypted += cipher.final("hex");
@@ -7318,11 +7314,7 @@ function decryptTokens(encrypted, key) {
7318
7314
  const ivHex = encrypted.substring(0, separatorIndex);
7319
7315
  const encryptedData = encrypted.substring(separatorIndex + 1);
7320
7316
  const iv = Buffer.from(ivHex, "hex");
7321
- const decipher = crypto.createDecipheriv(
7322
- ALGORITHM,
7323
- Buffer.from(key),
7324
- iv
7325
- );
7317
+ const decipher = crypto.createDecipheriv(ALGORITHM, Buffer.from(key), iv);
7326
7318
  let decrypted = decipher.update(encryptedData, "hex", "utf8");
7327
7319
  decrypted += decipher.final("utf8");
7328
7320
  return JSON.parse(decrypted);
@@ -7363,7 +7355,10 @@ var OAuthTokenManager = class {
7363
7355
  this.setCache(config.provider, tokens.accessToken, tokens.expiresAt);
7364
7356
  return tokens.accessToken;
7365
7357
  }
7366
- const refreshed = await this.refreshAccessToken(config, tokens.refreshToken);
7358
+ const refreshed = await this.refreshAccessToken(
7359
+ config,
7360
+ tokens.refreshToken
7361
+ );
7367
7362
  await this.persistTokens(config.provider, refreshed);
7368
7363
  return refreshed.accessToken;
7369
7364
  }
@@ -7427,6 +7422,56 @@ var OAuthTokenManager = class {
7427
7422
  this.cache.set(provider, { token, expiresAt });
7428
7423
  }
7429
7424
  };
7425
+
7426
+ // src/oauth/oauth-provider.registry.ts
7427
+ var registry = {};
7428
+ function loadOAuthProviders(providers) {
7429
+ registry = { ...providers };
7430
+ }
7431
+ function getOAuthProvider(provider) {
7432
+ const def = registry[provider];
7433
+ if (!def) {
7434
+ throw new Error(`Unknown OAuth provider: ${provider}`);
7435
+ }
7436
+ return def;
7437
+ }
7438
+ function getOAuthProviderNames() {
7439
+ return Object.keys(registry);
7440
+ }
7441
+ function resolveOAuthProviderConfig(provider) {
7442
+ const def = getOAuthProvider(provider);
7443
+ const clientId = process.env[def.clientIdEnvVar];
7444
+ const clientSecret = process.env[def.clientSecretEnvVar];
7445
+ if (!clientId) {
7446
+ throw new Error(`Missing env var: ${def.clientIdEnvVar}`);
7447
+ }
7448
+ if (!clientSecret) {
7449
+ throw new Error(`Missing env var: ${def.clientSecretEnvVar}`);
7450
+ }
7451
+ return {
7452
+ provider: def.name,
7453
+ tokenUrl: def.tokenUrl,
7454
+ clientId,
7455
+ clientSecret
7456
+ };
7457
+ }
7458
+ function buildOAuthAuthorizationUrl(provider, params) {
7459
+ const def = getOAuthProvider(provider);
7460
+ const clientId = process.env[def.clientIdEnvVar];
7461
+ if (!clientId) {
7462
+ throw new Error(`Missing env var: ${def.clientIdEnvVar}`);
7463
+ }
7464
+ const query = new URLSearchParams({
7465
+ client_id: clientId,
7466
+ redirect_uri: params.redirectUri,
7467
+ response_type: "code",
7468
+ state: params.state
7469
+ });
7470
+ if (def.scopes.length > 0) {
7471
+ query.set("scope", def.scopes.join(" "));
7472
+ }
7473
+ return `${def.authorizationUrl}?${query.toString()}`;
7474
+ }
7430
7475
  var FileTokenStore = class {
7431
7476
  constructor(filePath) {
7432
7477
  this.filePath = filePath;
@@ -7496,6 +7541,6 @@ var MongoTokenStore = class {
7496
7541
  }
7497
7542
  };
7498
7543
 
7499
- export { AbstractGraphBuilder, AttachmentType, GraphController as BaseGraphServiceController, UniversalGraphModule as BaseGraphServiceModule, BuilderRegistryService, Callback, CallbackACL, CallbackAuditAction, CallbackAuditor, CallbackController, CallbackMetrics, CallbackPatchService, CallbackRateLimiter, CallbackRegistry, CallbackStore, CallbackTokenGuard, ChatFeature, DEFAULT_ATTACHMENT_THRESHOLD, DEFAULT_TRACER_OPTIONS, ENDPOINT_METADATA_KEY, Endpoint, EndpointRegistry, EventProcessor, ExternalGraphBuilder, FileBasedDiscovery, FileTokenStore, GraphController, GraphEngineFactory, GraphEngineType, GraphManifestSchema, GraphManifestValidator, GraphServiceTokens, GraphTypeUtils, IdempotencyManager, IdempotencyStatus, LangGraphEngine, McpConverter, McpRuntimeHttpClient, McpToolFilter, ModelInitializer, ModelProvider, ModelType, MongoTokenStore, OAuthTokenManager, RetrieverSearchType, RetrieverService, SmartCallbackRouter, StaticDiscovery, StreamChannel, TelegramPatchHandler, UIDispatchController, UIEndpoint, UIEndpointsDiscoveryService, UniversalCallbackService, UniversalGraphModule, UniversalGraphService, VersionedGraphService, VoyageAIRerank, WebPatchHandler, WithCallbacks, WithEndpoints, WithUIEndpoints, _internals, bootstrap, clearAttachmentDataStore, createEndpointDescriptors, createGraphAttachment, createMongoClientAdapter, createStaticMessage, decryptTokens, dispatchAttachments, encryptTokens, executeToolWithAttachments, findCallbackMethod, findEndpointMethod, generateAttachmentSummary, getAttachmentData, getCallbackMetadata, getEndpointMetadata, getUIEndpointClassMetadata, getUIEndpointMethodsMetadata, hasCallbacks, hasUIEndpoints, registerFinanceExampleCallback, registerUIEndpointsFromClass, sanitizeTraceData, storeAttachmentData, traceApiCall };
7544
+ export { AbstractGraphBuilder, AttachmentType, GraphController as BaseGraphServiceController, UniversalGraphModule as BaseGraphServiceModule, BuilderRegistryService, Callback, CallbackACL, CallbackAuditAction, CallbackAuditor, CallbackController, CallbackMetrics, CallbackPatchService, CallbackRateLimiter, CallbackRegistry, CallbackStore, CallbackTokenGuard, ChatFeature, DEFAULT_ATTACHMENT_THRESHOLD, DEFAULT_TRACER_OPTIONS, ENDPOINT_METADATA_KEY, Endpoint, EndpointRegistry, EventProcessor, ExternalGraphBuilder, FileBasedDiscovery, FileTokenStore, GraphController, GraphEngineFactory, GraphEngineType, GraphManifestSchema, GraphManifestValidator, GraphServiceTokens, GraphTypeUtils, IdempotencyManager, IdempotencyStatus, LangGraphEngine, McpConverter, McpRuntimeHttpClient, McpToolFilter, ModelInitializer, ModelProvider, ModelType, MongoTokenStore, OAuthTokenManager, RetrieverSearchType, RetrieverService, SmartCallbackRouter, StaticDiscovery, StreamChannel, TelegramPatchHandler, UIDispatchController, UIEndpoint, UIEndpointsDiscoveryService, UniversalCallbackService, UniversalGraphModule, UniversalGraphService, VersionedGraphService, VoyageAIRerank, WebPatchHandler, WithCallbacks, WithEndpoints, WithUIEndpoints, _internals, bootstrap, buildOAuthAuthorizationUrl, clearAttachmentDataStore, createEndpointDescriptors, createGraphAttachment, createMongoClientAdapter, createStaticMessage, decryptTokens, dispatchAttachments, encryptTokens, executeToolWithAttachments, findCallbackMethod, findEndpointMethod, generateAttachmentSummary, getAttachmentData, getCallbackMetadata, getEndpointMetadata, getOAuthProvider, getOAuthProviderNames, getUIEndpointClassMetadata, getUIEndpointMethodsMetadata, hasCallbacks, hasUIEndpoints, loadOAuthProviders, registerFinanceExampleCallback, registerUIEndpointsFromClass, resolveOAuthProviderConfig, sanitizeTraceData, storeAttachmentData, traceApiCall };
7500
7545
  //# sourceMappingURL=index.js.map
7501
7546
  //# sourceMappingURL=index.js.map