agent.libx.js 0.93.4 → 0.93.8

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
@@ -2897,12 +2897,21 @@ var Agent = class _Agent {
2897
2897
  if (o.timeoutMs && Date.now() - start >= o.timeoutMs) return kill("timeout");
2898
2898
  if (o.maxTokens && usage.totalTokens >= o.maxTokens) return kill("budget");
2899
2899
  steps++;
2900
+ this.options.host?.notify?.({ kind: "turn_start", message: `step ${steps}` });
2900
2901
  let res;
2901
2902
  const sent = this.trimContext();
2902
2903
  const frag = reasoningToChatFragment(o.model, o.reasoning);
2904
+ const isCursorWithTools = o.model.startsWith("cursor/") && wireTools.length > 0;
2905
+ const cursorPo = isCursorWithTools ? {
2906
+ toolExecutor: async (name, args) => {
2907
+ const tc = { id: `cursor-${Date.now()}`, type: "function", function: { name, arguments: JSON.stringify(args) } };
2908
+ const raw = await this.dispatch(tc);
2909
+ return typeof raw === "string" ? raw : raw.text;
2910
+ }
2911
+ } : void 0;
2903
2912
  const reasonOpts = {
2904
2913
  ...frag,
2905
- ...o.providerOptions ? { providerOptions: { ...frag.providerOptions, ...o.providerOptions } } : {}
2914
+ ...o.providerOptions || cursorPo ? { providerOptions: { ...frag.providerOptions, ...o.providerOptions, ...cursorPo } } : {}
2906
2915
  };
2907
2916
  try {
2908
2917
  if (useStream) {