@flutchai/flutch-sdk 0.1.11 → 0.1.12

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.js CHANGED
@@ -3880,6 +3880,9 @@ var GraphServiceTokens = {
3880
3880
  CLIENT: "GRAPH_SERVICE_CLIENT",
3881
3881
  SETTINGS_REPOSITORY: "GRAPH_SERVICE_SETTINGS_REPOSITORY"
3882
3882
  };
3883
+
3884
+ // src/graph/graph.controller.ts
3885
+ init_builder_registry_service();
3883
3886
  var GraphController = class {
3884
3887
  constructor(graphService, builderRegistry) {
3885
3888
  this.graphService = graphService;
@@ -4042,7 +4045,8 @@ __decorateClass([
4042
4045
  GraphController = __decorateClass([
4043
4046
  ApiTags("Graphs"),
4044
4047
  Controller(),
4045
- __decorateParam(0, Inject("GRAPH_SERVICE"))
4048
+ __decorateParam(0, Inject("GRAPH_SERVICE")),
4049
+ __decorateParam(1, Inject(BuilderRegistryService))
4046
4050
  ], GraphController);
4047
4051
 
4048
4052
  // src/graph/graph-manifest.schema.ts
@@ -4678,17 +4682,22 @@ var EventProcessor = class {
4678
4682
  durationMs: Math.max(0, completedAt - startedAt),
4679
4683
  totalEvents: acc.traceEvents.length
4680
4684
  } : null;
4685
+ const textChain = allChains.find((c) => c.channel === "text");
4686
+ const text = textChain ? textChain.steps.filter((step) => step.type === "text").map((step) => step.text || "").join("") : "";
4681
4687
  this.logger.log("\u{1F4CA} [EventProcessor] Final result assembled", {
4682
4688
  totalChains: allChains.length,
4683
4689
  textChains: allChains.filter((c) => c.channel === "text").length,
4684
4690
  processingChains: allChains.filter((c) => c.channel === "processing").length,
4685
- totalSteps: allChains.reduce((sum, c) => sum + c.steps.length, 0)
4691
+ totalSteps: allChains.reduce((sum, c) => sum + c.steps.length, 0),
4692
+ textLength: text.length
4686
4693
  });
4687
4694
  return {
4688
4695
  content: {
4689
4696
  contentChains: allChains.length > 0 ? allChains : void 0,
4690
4697
  attachments: acc.attachments,
4691
- metadata: acc.metadata
4698
+ metadata: acc.metadata,
4699
+ text
4700
+ // Add extracted text for backwards compatibility
4692
4701
  },
4693
4702
  trace
4694
4703
  };
@@ -6423,12 +6432,18 @@ var ModelInitializer = class _ModelInitializer {
6423
6432
  metadataKeys: Object.keys(model.metadata || {}),
6424
6433
  hasModelId: !!model.metadata?.modelId
6425
6434
  });
6426
- this.logger.debug(`[TOOLS CHECK] toolsConfig exists: ${!!config.toolsConfig}, customTools exists: ${!!config.customTools}`);
6435
+ this.logger.debug(
6436
+ `[TOOLS CHECK] toolsConfig exists: ${!!config.toolsConfig}, customTools exists: ${!!config.customTools}`
6437
+ );
6427
6438
  if (config.toolsConfig) {
6428
- this.logger.debug(`[TOOLS CHECK] toolsConfig length: ${config.toolsConfig.length}, content: ${JSON.stringify(config.toolsConfig)}`);
6439
+ this.logger.debug(
6440
+ `[TOOLS CHECK] toolsConfig length: ${config.toolsConfig.length}, content: ${JSON.stringify(config.toolsConfig)}`
6441
+ );
6429
6442
  }
6430
6443
  if (config.toolsConfig || config.customTools) {
6431
- this.logger.debug(`[TOOLS] Calling bindToolsToModel with toolsConfig: ${JSON.stringify(config.toolsConfig)}`);
6444
+ this.logger.debug(
6445
+ `[TOOLS] Calling bindToolsToModel with toolsConfig: ${JSON.stringify(config.toolsConfig)}`
6446
+ );
6432
6447
  const boundModel = await this.bindToolsToModel(
6433
6448
  model,
6434
6449
  config.toolsConfig,
@@ -6454,15 +6469,15 @@ var ModelInitializer = class _ModelInitializer {
6454
6469
  const allTools = [];
6455
6470
  if (toolsConfig && toolsConfig.length > 0) {
6456
6471
  try {
6457
- const enabledToolsConfig = toolsConfig.filter((tc) => tc.enabled !== false);
6472
+ const enabledToolsConfig = toolsConfig.filter(
6473
+ (tc) => tc.enabled !== false
6474
+ );
6458
6475
  if (enabledToolsConfig.length > 0) {
6459
6476
  this.logger.debug(
6460
6477
  `Fetching ${enabledToolsConfig.length} tools with dynamic schemas from MCP Runtime: ${enabledToolsConfig.map((tc) => tc.toolName).join(", ")}`
6461
6478
  );
6462
6479
  const mcpToolFilter = new McpToolFilter();
6463
- const mcpTools = await mcpToolFilter.getFilteredTools(
6464
- enabledToolsConfig
6465
- );
6480
+ const mcpTools = await mcpToolFilter.getFilteredTools(enabledToolsConfig);
6466
6481
  this.logger.debug(
6467
6482
  `Successfully fetched ${mcpTools.length} tools with dynamic schemas from MCP Runtime`
6468
6483
  );