@dudko.dev/agent 0.0.55 → 0.0.56

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/README.md CHANGED
@@ -1306,7 +1306,7 @@ const agent = await createAgent({
1306
1306
 
1307
1307
  | `search` field | |
1308
1308
  |---|---|
1309
- | `engine` | Your own `(query, { maxResults, freshness, signal }) => Promise<{ title, url, snippet, date? }[]>` - any search API, or an index of yours. Its requests are yours, like a tool you pass; its results get the same cleaning, caps and filter. Exactly one of `engine` / `provider`. |
1309
+ | `engine` | Your own `(query, { maxResults, freshness, signal }) => Promise<{ title, url, snippet, date? }[]>` - any search API, or an index of yours. Its requests are yours, like a tool you pass; its results get the same cleaning, caps and filter. A search that runs a model (a provider's server-side search tool) may answer `{ results, usage?, summary?, note? }` instead: `usage` (`{ inputTokens, outputTokens, reasoningTokens? }`, whole counts) is a `usage` event of phase `'search'` - in `result.usage`, `agent.usage` and against `limits`, like the google provider's -, `summary` (the model's answer) reaches the model when no result has a snippet, and `note` (one line on what the results are, 300 characters at most) goes with every result list. Exactly one of `engine` / `provider`. |
1310
1310
  | `provider` | `'google'`: the built-in provider, see below. The only value. |
1311
1311
  | `apiKey` | `provider` only: a Gemini (Google AI Studio) API key. Sent in the `x-goog-api-key` header to that API only. |
1312
1312
  | `model` | `provider` only: the Gemini model that makes the grounding call. Default `'gemini-2.5-flash-lite'`. |
@@ -1409,7 +1409,7 @@ The engine's host does not go into `egress.allow`: the function's requests are y
1409
1409
 
1410
1410
  **Approval.** `web_fetch` is read-only only when the policy names the hosts, because an open GET can carry data anywhere. A search reaches exactly one host and you named it, so by the same rule it is **read-only** (`ask-writes` and `read-only` let it run). That host still *sees the query*: a model that was talked into it could put private data into one. If queries must not leave unreviewed, set `search: { ..., readOnly: false }` (it then asks like a write) or a rule: `toolApproval: { rules: { web_search: 'ask' } }`. It is an ordinary tool otherwise: `maxToolCalls`, the tool-output cap, `excludedTools` and tool search all apply, and a tool of your own named `web_search` wins.
1411
1411
 
1412
- **Events.** The provider's request emits the same `egress.request` as `web_fetch` (`url` is the API's origin and path - never the query string; `allowed`, `status` / `reason`), and its tokens a `usage` event of phase `'search'`. The query itself is in the ordinary `tool.call` event. A function `engine` makes its own requests and emits neither.
1412
+ **Events.** The provider's request emits the same `egress.request` as `web_fetch` (`url` is the API's origin and path - never the query string; `allowed`, `status` / `reason`), and its tokens a `usage` event of phase `'search'`. The query itself is in the ordinary `tool.call` event. A function `engine` makes its own requests: no `egress.request`, and a `usage` event of phase `'search'` only when it answered `usage`.
1413
1413
 
1414
1414
  What it is not: the providers' server-side search tools (Anthropic, OpenAI, Google). Those run inside the provider's API call, outside this policy; they are not wired here.
1415
1415