agent.libx.js 0.93.4 → 0.93.6

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/cli.js CHANGED
@@ -2900,9 +2900,17 @@ var Agent = class _Agent {
2900
2900
  let res;
2901
2901
  const sent = this.trimContext();
2902
2902
  const frag = reasoningToChatFragment(o.model, o.reasoning);
2903
+ const isCursorWithTools = o.model.startsWith("cursor/") && wireTools.length > 0;
2904
+ const cursorPo = isCursorWithTools ? {
2905
+ toolExecutor: async (name, args) => {
2906
+ const tc = { id: `cursor-${Date.now()}`, type: "function", function: { name, arguments: JSON.stringify(args) } };
2907
+ const raw = await this.dispatch(tc);
2908
+ return typeof raw === "string" ? raw : raw.text;
2909
+ }
2910
+ } : void 0;
2903
2911
  const reasonOpts = {
2904
2912
  ...frag,
2905
- ...o.providerOptions ? { providerOptions: { ...frag.providerOptions, ...o.providerOptions } } : {}
2913
+ ...o.providerOptions || cursorPo ? { providerOptions: { ...frag.providerOptions, ...o.providerOptions, ...cursorPo } } : {}
2906
2914
  };
2907
2915
  try {
2908
2916
  if (useStream) {