@flutchai/flutch-sdk 0.1.19 → 0.1.20

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
@@ -177,8 +177,8 @@ function findCallbackMethod(target, handler) {
177
177
  var CALLBACK_METADATA_KEY, CALLBACK_CLASS_METADATA_KEY;
178
178
  var init_callback_decorators = __esm({
179
179
  "src/callbacks/callback.decorators.ts"() {
180
- CALLBACK_METADATA_KEY = Symbol("callbacks");
181
- CALLBACK_CLASS_METADATA_KEY = Symbol("callback_class");
180
+ CALLBACK_METADATA_KEY = /* @__PURE__ */ Symbol("callbacks");
181
+ CALLBACK_CLASS_METADATA_KEY = /* @__PURE__ */ Symbol("callback_class");
182
182
  }
183
183
  });
184
184
  exports.EndpointRegistry = void 0;
@@ -450,8 +450,8 @@ exports.ENDPOINT_METADATA_KEY = void 0; var UI_ENDPOINT_CLASS_METADATA_KEY, UI_E
450
450
  var init_endpoint_decorators = __esm({
451
451
  "src/agent-ui/endpoint.decorators.ts"() {
452
452
  exports.ENDPOINT_METADATA_KEY = "graph:endpoints";
453
- UI_ENDPOINT_CLASS_METADATA_KEY = Symbol("ui_endpoint_class");
454
- UI_ENDPOINT_METHOD_METADATA_KEY = Symbol("ui_endpoint_methods");
453
+ UI_ENDPOINT_CLASS_METADATA_KEY = /* @__PURE__ */ Symbol("ui_endpoint_class");
454
+ UI_ENDPOINT_METHOD_METADATA_KEY = /* @__PURE__ */ Symbol("ui_endpoint_methods");
455
455
  }
456
456
  });
457
457
  exports.UIEndpointsDiscoveryService = void 0;
@@ -5513,12 +5513,22 @@ ${paramDescriptions.join("\n")}`;
5513
5513
  name: mcpTool.name,
5514
5514
  description: enhancedDescription,
5515
5515
  schema,
5516
- func: async (input) => {
5516
+ func: async (input, _runManager, config) => {
5517
5517
  logger2.log(`\u{1F527} [${mcpTool.name}] LLM INPUT: ${JSON.stringify(input)}`);
5518
+ const configurable = config?.configurable;
5519
+ const context = {
5520
+ agentId: configurable?.agentId,
5521
+ userId: configurable?.userId,
5522
+ threadId: configurable?.thread_id
5523
+ };
5524
+ logger2.debug(
5525
+ `\u{1F527} [${mcpTool.name}] Execution context: ${JSON.stringify(context)}`
5526
+ );
5518
5527
  try {
5519
5528
  const request = {
5520
5529
  name: mcpTool.name,
5521
- arguments: input ?? {}
5530
+ arguments: input ?? {},
5531
+ context
5522
5532
  };
5523
5533
  logger2.log(`\u{1F527} [${mcpTool.name}] Calling MCP Runtime...`);
5524
5534
  const response = await axios2__default.default.post(
@@ -5639,13 +5649,14 @@ var McpToolFilter = class _McpToolFilter {
5639
5649
  );
5640
5650
  const mcpClient = {
5641
5651
  getTools: async () => dynamicTools,
5642
- executeTool: async (name, args) => {
5652
+ executeTool: async (name, args, context) => {
5643
5653
  this.logger.debug(`[DEBUG] Executing tool ${name} with args:`, args);
5644
5654
  const response2 = await axios2__default.default.post(
5645
5655
  `${this.mcpRuntimeUrl}/tools/execute`,
5646
5656
  {
5647
5657
  name,
5648
- arguments: args || {}
5658
+ arguments: args || {},
5659
+ context
5649
5660
  }
5650
5661
  );
5651
5662
  return response2.data;
@@ -5688,12 +5699,13 @@ var McpToolFilter = class _McpToolFilter {
5688
5699
  this.logger.debug(`Retrieved ${allTools.length} total MCP tools`);
5689
5700
  const mcpClient = {
5690
5701
  getTools: async () => allTools,
5691
- executeTool: async (name, args) => {
5702
+ executeTool: async (name, args, context) => {
5692
5703
  const response2 = await axios2__default.default.post(
5693
5704
  `${this.mcpRuntimeUrl}/tools/execute`,
5694
5705
  {
5695
5706
  name,
5696
- arguments: args || {}
5707
+ arguments: args || {},
5708
+ context
5697
5709
  }
5698
5710
  );
5699
5711
  return response2.data;