dhalsim 2.3.0 → 2.3.1

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
@@ -16701,10 +16701,8 @@ var ReportResult = class extends (0, import_llmist15.Gadget)({
16701
16701
  )
16702
16702
  })
16703
16703
  }) {
16704
- result = null;
16705
16704
  execute(params) {
16706
- this.result = params.result;
16707
- return "Result reported successfully.";
16705
+ throw new import_llmist15.TaskCompletionSignal(params.result);
16708
16706
  }
16709
16707
  };
16710
16708
  var Dhalsim = class extends (0, import_llmist15.Gadget)({
@@ -16885,6 +16883,7 @@ Use this for web research, data extraction, form filling, or any web-based task.
16885
16883
  Task: ${task}`);
16886
16884
  logger13?.debug(`[BrowseWeb] Starting agent loop model=${model} maxIterations=${maxIterations}`);
16887
16885
  let finalResult = "";
16886
+ let reportedResult;
16888
16887
  for await (const event of agent.run()) {
16889
16888
  if (ctx?.signal?.aborted) {
16890
16889
  break;
@@ -16895,15 +16894,15 @@ Task: ${task}`);
16895
16894
  collectedMedia.push(media);
16896
16895
  }
16897
16896
  }
16898
- if (reportResult.result !== null) {
16899
- break;
16897
+ if (event.result.gadgetName === "ReportResult" && event.result.breaksLoop) {
16898
+ reportedResult = event.result.result;
16900
16899
  }
16901
16900
  } else if (event.type === "text") {
16902
16901
  finalResult = event.content;
16903
16902
  }
16904
16903
  }
16905
16904
  return {
16906
- result: reportResult.result || finalResult || "Task completed but no result text was generated.",
16905
+ result: reportedResult || finalResult || "Task completed but no result text was generated.",
16907
16906
  media: collectedMedia.length > 0 ? collectedMedia : void 0
16908
16907
  };
16909
16908
  } finally {