@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.cjs CHANGED
@@ -3909,6 +3909,9 @@ var GraphServiceTokens = {
3909
3909
  CLIENT: "GRAPH_SERVICE_CLIENT",
3910
3910
  SETTINGS_REPOSITORY: "GRAPH_SERVICE_SETTINGS_REPOSITORY"
3911
3911
  };
3912
+
3913
+ // src/graph/graph.controller.ts
3914
+ init_builder_registry_service();
3912
3915
  exports.GraphController = class GraphController {
3913
3916
  constructor(graphService, builderRegistry) {
3914
3917
  this.graphService = graphService;
@@ -4071,7 +4074,8 @@ __decorateClass([
4071
4074
  exports.GraphController = __decorateClass([
4072
4075
  swagger.ApiTags("Graphs"),
4073
4076
  common.Controller(),
4074
- __decorateParam(0, common.Inject("GRAPH_SERVICE"))
4077
+ __decorateParam(0, common.Inject("GRAPH_SERVICE")),
4078
+ __decorateParam(1, common.Inject(exports.BuilderRegistryService))
4075
4079
  ], exports.GraphController);
4076
4080
 
4077
4081
  // src/graph/graph-manifest.schema.ts
@@ -4707,17 +4711,22 @@ exports.EventProcessor = class EventProcessor {
4707
4711
  durationMs: Math.max(0, completedAt - startedAt),
4708
4712
  totalEvents: acc.traceEvents.length
4709
4713
  } : null;
4714
+ const textChain = allChains.find((c) => c.channel === "text");
4715
+ const text = textChain ? textChain.steps.filter((step) => step.type === "text").map((step) => step.text || "").join("") : "";
4710
4716
  this.logger.log("\u{1F4CA} [EventProcessor] Final result assembled", {
4711
4717
  totalChains: allChains.length,
4712
4718
  textChains: allChains.filter((c) => c.channel === "text").length,
4713
4719
  processingChains: allChains.filter((c) => c.channel === "processing").length,
4714
- totalSteps: allChains.reduce((sum, c) => sum + c.steps.length, 0)
4720
+ totalSteps: allChains.reduce((sum, c) => sum + c.steps.length, 0),
4721
+ textLength: text.length
4715
4722
  });
4716
4723
  return {
4717
4724
  content: {
4718
4725
  contentChains: allChains.length > 0 ? allChains : void 0,
4719
4726
  attachments: acc.attachments,
4720
- metadata: acc.metadata
4727
+ metadata: acc.metadata,
4728
+ text
4729
+ // Add extracted text for backwards compatibility
4721
4730
  },
4722
4731
  trace
4723
4732
  };
@@ -6452,12 +6461,18 @@ var ModelInitializer = class _ModelInitializer {
6452
6461
  metadataKeys: Object.keys(model.metadata || {}),
6453
6462
  hasModelId: !!model.metadata?.modelId
6454
6463
  });
6455
- this.logger.debug(`[TOOLS CHECK] toolsConfig exists: ${!!config.toolsConfig}, customTools exists: ${!!config.customTools}`);
6464
+ this.logger.debug(
6465
+ `[TOOLS CHECK] toolsConfig exists: ${!!config.toolsConfig}, customTools exists: ${!!config.customTools}`
6466
+ );
6456
6467
  if (config.toolsConfig) {
6457
- this.logger.debug(`[TOOLS CHECK] toolsConfig length: ${config.toolsConfig.length}, content: ${JSON.stringify(config.toolsConfig)}`);
6468
+ this.logger.debug(
6469
+ `[TOOLS CHECK] toolsConfig length: ${config.toolsConfig.length}, content: ${JSON.stringify(config.toolsConfig)}`
6470
+ );
6458
6471
  }
6459
6472
  if (config.toolsConfig || config.customTools) {
6460
- this.logger.debug(`[TOOLS] Calling bindToolsToModel with toolsConfig: ${JSON.stringify(config.toolsConfig)}`);
6473
+ this.logger.debug(
6474
+ `[TOOLS] Calling bindToolsToModel with toolsConfig: ${JSON.stringify(config.toolsConfig)}`
6475
+ );
6461
6476
  const boundModel = await this.bindToolsToModel(
6462
6477
  model,
6463
6478
  config.toolsConfig,
@@ -6483,15 +6498,15 @@ var ModelInitializer = class _ModelInitializer {
6483
6498
  const allTools = [];
6484
6499
  if (toolsConfig && toolsConfig.length > 0) {
6485
6500
  try {
6486
- const enabledToolsConfig = toolsConfig.filter((tc) => tc.enabled !== false);
6501
+ const enabledToolsConfig = toolsConfig.filter(
6502
+ (tc) => tc.enabled !== false
6503
+ );
6487
6504
  if (enabledToolsConfig.length > 0) {
6488
6505
  this.logger.debug(
6489
6506
  `Fetching ${enabledToolsConfig.length} tools with dynamic schemas from MCP Runtime: ${enabledToolsConfig.map((tc) => tc.toolName).join(", ")}`
6490
6507
  );
6491
6508
  const mcpToolFilter = new McpToolFilter();
6492
- const mcpTools = await mcpToolFilter.getFilteredTools(
6493
- enabledToolsConfig
6494
- );
6509
+ const mcpTools = await mcpToolFilter.getFilteredTools(enabledToolsConfig);
6495
6510
  this.logger.debug(
6496
6511
  `Successfully fetched ${mcpTools.length} tools with dynamic schemas from MCP Runtime`
6497
6512
  );