agent.libx.js 0.93.21 → 0.93.23

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.js CHANGED
@@ -3752,6 +3752,7 @@ Today's date: ${(/* @__PURE__ */ new Date()).toDateString()}.`;
3752
3752
  this.turnDispatched = false;
3753
3753
  this.turnBriefs.clear();
3754
3754
  this.spokeThisTurn = false;
3755
+ this.voice.options.toolChoice = void 0;
3755
3756
  }
3756
3757
  /** preToolUse guard on the reflex: once it has dispatched this turn, a dispatch is "said my piece,
3757
3758
  * now wait for the push" (CC's Task model). Block the temptations — TaskStatus polling and identical
@@ -4064,6 +4065,7 @@ Another agent just implemented the above. Independently check the CURRENT state
4064
4065
  run: async ({ brief, label }) => {
4065
4066
  this.turnDispatched = true;
4066
4067
  this.turnBriefs.add(String(brief ?? ""));
4068
+ this.voice.options.toolChoice = "none";
4067
4069
  const id = await this.dispatch(String(brief ?? ""), "act", label ? String(label) : void 0);
4068
4070
  return `Acting on task ${id}. Acknowledge briefly; the result will arrive as a [task ${id} completed] event.`;
4069
4071
  }
@@ -4084,6 +4086,7 @@ Another agent just implemented the above. Independently check the CURRENT state
4084
4086
  run: async ({ brief, label }) => {
4085
4087
  this.turnDispatched = true;
4086
4088
  this.turnBriefs.add(String(brief ?? ""));
4089
+ this.voice.options.toolChoice = "none";
4087
4090
  const id = await this.dispatch(String(brief ?? ""), "think", label ? String(label) : void 0);
4088
4091
  return `Thinking on task ${id}. Acknowledge briefly; the result will arrive as a [task ${id} completed] event.`;
4089
4092
  }
@@ -4129,9 +4132,14 @@ Another agent just implemented the above. Independently check the CURRENT state
4129
4132
  const names = actTools.map((t) => t.name);
4130
4133
  if (!names.length)
4131
4134
  return "Your worker uses Act's default local toolset (reading/editing files, running shell commands). No extra tools (e.g. web/internet) are configured; if a request is not a basic file or shell operation, assume you can't do it and say so.";
4132
- const webish = names.some((n) => /WebFetch|browser/i.test(n));
4133
- const hasSearch = names.some((n) => /search/i.test(n) && !/WebFetch/i.test(n));
4134
- const webNote = webish && !hasSearch ? ` NOTE: WebFetch / browser tools act on a SPECIFIC URL you are given \u2014 they are NOT a search engine. You CANNOT search the web, Google a topic, or look up arbitrary/live info. If asked to "search the web", say plainly you can't \u2014 you can only fetch or open a URL they provide.` : "";
4135
+ const hasFetch = names.some((n) => /WebFetch/i.test(n));
4136
+ const hasBrowser = names.some((n) => /browser.*(navigate|click|page|type)/i.test(n));
4137
+ const hasSearch = names.some((n) => /(^|_)WebSearch$|search/i.test(n) && !/WebFetch|browser/i.test(n));
4138
+ const notes = [];
4139
+ if (hasFetch) notes.push("WebFetch retrieves ONE specific URL you are given \u2014 it is not a search engine.");
4140
+ if (hasBrowser) notes.push("The browser tools drive a real browser: you CAN open a site and, if needed, navigate to a search engine and search there \u2014 but it is manual and takes a moment, not an instant lookup.");
4141
+ else if (!hasSearch && hasFetch) notes.push('You have no general web-search tool, so for an instant "search the web" you can only fetch a URL they provide.');
4142
+ const webNote = notes.length ? " NOTE: " + notes.join(" ") : "";
4135
4143
  return `Tools your background worker (Act) can actually use: ${names.join(", ")}. Read each name literally and match the request to a SPECIFIC tool; if none fits, you do NOT have that ability \u2014 say so honestly.` + webNote;
4136
4144
  }
4137
4145
  case "time":