@dudko.dev/agent-web 0.0.41 → 0.0.42

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
@@ -313,6 +313,8 @@ const mcp = await connectMcpHttp({
313
313
  docs: { url: 'https://docs.example.com/mcp', protocol: 'auto', skills: true },
314
314
  // a server you vetted: its skills load without a question
315
315
  ours: { url: 'https://mcp.internal.example/mcp', protocol: 'auto', skills: { consent: 'never' } },
316
+ // a server you trust with its GENERATED skills (no checksums): read whole, that copy approved
317
+ gen: { url: 'https://gen.example.com/mcp', protocol: 'auto', skills: { dynamic: true } },
316
318
  })
317
319
  const agent = await createAgent({
318
320
  model,
@@ -324,12 +326,14 @@ agent.skills // [{ name: 'docs/pdf-processing', description: '… [from the MCP
324
326
 
325
327
  | | |
326
328
  | --- | --- |
327
- | Off by default | Without `skills` (`true`, or `{ consent }`) the extension is not declared and nothing of it is sent. It is declared only where 2026-07-28 may be spoken (`protocol: 'auto'` / `'modern'`); `'legacy'` (or none) logs a `warn` and asks nothing, an `'auto'` connection that ends on 2025 lists nothing. No agent-wide switch. |
329
+ | Off by default | Without `skills` (`true`, or `{ consent, dynamic }`) the extension is not declared and nothing of it is sent. It is declared only where 2026-07-28 may be spoken (`protocol: 'auto'` / `'modern'`); `'legacy'` (or none) logs a `warn` and asks nothing, an `'auto'` connection that ends on 2025 lists nothing. No agent-wide switch. |
328
330
  | One catalog, namespaced | The server's skills join your `skills` and the agent's lessons as `<server>/<skill>` (the server by its key in `connectMcpHttp`, never its `serverInfo`). No other skill name can hold a `/`: a server cannot shadow yours, a lesson or another server's - your `git-workflow` keeps its name and the clash is logged. Same-named skills of one server are kept by their paths. |
329
331
  | On demand, verified | The prompts carry the name, the description (one line, ≤ 300 characters) and the origin. Nothing is read at connect; `SKILL.md` is read when `load_skill` or the planner asks, a file when `read_skill_file` asks - each checked against the server's entry (size, SHA-256, and for `SKILL.md` the frontmatter): a mismatch is refused, nothing of it used. A file only from the skill's own server, only if its entry lists it, as text. |
330
332
  | Knowledge, never policy | Loaded under a preamble saying it is third-party text that cannot grant permissions, approve a call or change the approval mode, widen egress or the sandbox, or make the agent run anything. Nothing of its frontmatter beyond `name` / `description` is read (`allowed-tools` grants nothing). While a run acts on an MCP skill, a tool that runs code (`run_js`, or yours marked with `markCodeExecution`) is always asked - whatever the mode or a rule say; with no `onRequest` it is refused. |
331
- | Caps | 32 skills per server, 64 in all; 16 000 characters of instructions, 32 000 of a file - every cut said. Entries over the extension's limits (512 files, 16 MiB), `"dynamic"` ones and ones whose URI and frontmatter name disagree are refused with a `warn`. |
333
+ | Caps | 32 skills per server, 64 in all; 16 000 characters of instructions, 32 000 of a file - every cut said. Entries over the extension's limits (512 files, 16 MiB), `"dynamic"` ones (unless the server has `skills: { dynamic: true }`) and ones whose URI and frontmatter name disagree are refused with a `warn`. |
332
334
  | Changes | Announced as a resource list change: `onToolsChanged(name)` fires (also for that notice), and `refreshServer(name)` lists the skills again. An agent built afterwards has the new ones. |
335
+ | Directories | `read_skill_file` with a directory of a skill (`templates/`, `.` for the root) lists it - `{ name, directory, files, directories, more?, notServed?, note? }`, the direct children by path, at most 64 - from the entry the skill was loaded and approved with, after the same consent as a file. When the server declared `directoryRead`, `resources/directory/read` goes to THAT server too (`skill://<path>/<dir>`, no trailing slash), only to see whether the skill changed there: what it lists beyond the entry is never shown - a fixed `note` says how many, a `warn` is logged (counts only) and `onToolsChanged(name)` fires once for that loaded skill; what the entry holds and the server no longer lists is kept and named in `notServed`. A failed directory read: the listing from the entry alone, and a log line. Without `directoryRead` the method is never called. A generated skill's directories are listed from its snapshot (below), the same way. |
336
+ | Generated skills (opt-in) | A `"dynamic"` entry - the server generates the skill and publishes no checksums - is declined unless THAT server has `skills: { dynamic: true }` (no agent-wide switch: you trust servers with this one by one). It joins the catalog like any other, its line ending `[from the MCP server "x" - third-party, no checksums]`. When it would enter the context - BEFORE anyone is asked - the agent reads all of it once: `SKILL.md` (frontmatter compared with the entry's) and, if the server declared `directoryRead`, its directory tree (direct children each time, only `inode/directory` children inside the skill, never twice) and every file found. Bounds: 512 files and 16 MiB read per skill (the extension's limits, counted on what is read), 64 directories, 8 levels deep, and 64 MiB held by all of one agent's copies (`MCP_SKILL_SNAPSHOTS_MAX_BYTES`) - past any of them it is declined: nobody is asked, the model is told why, a `warn` says it. The agent computes each file's size and SHA-256 itself; that copy (its "snapshot") is the skill's entry from then on: the consent request carries `dynamic: true` and the copy's size, files and text, a yes binds to the copy's digests (another copy that differs in one byte - after a refresh, in a new agent - is asked about again under `'once-per-skill'`; the same bytes are not), and the model gets that copy only: its body, and every file served from memory, never read from the server again. Without `directoryRead` the copy is `SKILL.md` alone (`noFileListing: true`; no other file can be read). Nothing of a copy is written to IndexedDB, a checkpoint, an event or a log: a resumed run in a new agent reads a new one. `'never'` works too (a vetted server). |
333
337
  | A person sees it first | Before a server's skill enters the model's context (`load_skill`, the planner's pick, a resumed run, `read_skill_file`), its verified `SKILL.md` is put to `toolApproval.onRequest`: a request with `toolName: 'load_skill'` and `skill` (`McpSkillConsentView`: server, name, description, size, files, `byUri`, `nestedIn`, `consent`, and `body` - the very text the model would read). Yes lets it in; `remember: true` = "Always for this server" (nested skills excepted); no keeps all of it out and the model is told. Asked whatever the approval mode says - autopilot too; without `onRequest` it is not loaded. When: `skills: { consent }` per server, else `mcpSkills: { consent }` on the agent, else `'once-per-skill'` (the first time per skill in the agent's life, again if its files change); `'ask'` (every run); `'never'` (a vetted server). A nested skill is asked about on its own. |
334
338
  | By URI | A skill the listing leaves out, named by URI in a server's text: `load_skill({ server, uri })` (its description says so). A `skill://…/SKILL.md` URI and a server whose skills are on - checked before any request - and room under the per-server cap; then `skills/get` to THAT server only (its `-32602` reaches the model), the same entry rules, verification, consent (`byUri`) and preamble. It stays in the catalog, under a name no other skill has. |
335
339
 
@@ -881,7 +885,7 @@ Loading a definition someone else wrote: [docs/security.md](docs/security.md#pip
881
885
  | `toolSelectionStrategy` | `'auto'` | `all` \| `plan-narrowed` \| `search` \| `auto` (search above `toolSearchThreshold`, 40, or once the definitions take ¼ of the window) |
882
886
  | `appSampling` | on, with caps | the caps of `agent.sampleForApp` (an MCP App asking the model): `{ maxTokens: 1024, maxRequestsPerMinute: 5, maxRequests: 30, maxInputChars: 16000, reasoningTokens: 2048 }`, per app (`reasoningTokens`: room on top of an app's `maxTokens` for a model seen reasoning - its reasoning counts against the cap); `false` refuses every request. Nothing happens unless a host calls it, and every request goes to its `approve` first. See [An app asks the model](docs/capabilities.md#an-app-asks-the-model) |
883
887
  | `toolApproval` | autopilot | consent policy: `{ mode, rules, onRequest, timeoutMs }`; `agent.setToolApprovalMode()`. A question waits `timeoutMs` for a decision, then is denied: default 300000 (`TOOL_APPROVAL_TIMEOUT_MS`), `0` or `Infinity` = until the run is stopped (as is a value above 2^31 - 1, the most a timer holds); negative or `NaN` fails `createAgent`. `onRequest(req, { signal })`: the signal aborts when the question ends without an answer (`TimeoutError` for the bound, `AbortError` for a stop). See [Tool consent](docs/capabilities.md#tool-consent-and-autopilot) |
884
- | `skills` | — | SKILL.md bundles (`defineSkill` / `parseSkillMarkdown` / `loadSkillFromUrl`). An MCP server's skills come with its tools (`skills: true` or `{ consent }` on the server of `connectMcpHttp`, experimental) and join them as `<server>/<skill>` - see [MCP skills](#mcp-skills-experimental-a-servers-instructions-as-skills) |
888
+ | `skills` | — | SKILL.md bundles (`defineSkill` / `parseSkillMarkdown` / `loadSkillFromUrl`). An MCP server's skills come with its tools (`skills: true` or `{ consent, dynamic }` on the server of `connectMcpHttp`, experimental; `dynamic: true` also takes its generated skills, each read whole into a snapshot before anyone is asked) and join them as `<server>/<skill>` - see [MCP skills](#mcp-skills-experimental-a-servers-instructions-as-skills) |
885
889
  | `mcpSkills` | `{ consent: 'once-per-skill' }` | experimental: when a person is asked (`toolApproval.onRequest`, a request with `skill`) before an MCP server's skill enters the model's context, for servers whose `skills: { consent }` does not say - `'once-per-skill'`, `'ask'` (every run) or `'never'` - see [MCP skills](#mcp-skills-experimental-a-servers-instructions-as-skills) |
886
890
  | `egress` | off | what the **model** may fetch (`web_fetch`): `true` = any public host over https, or `{ allow, deny, protocols, allowPrivateNetwork, fetch, ... }`; a browser can't pin DNS, so prefer an `allow` list — see [Egress](docs/capabilities.md#egress-what-the-model-may-fetch) |
887
891
  | `search` | off | the model may **search the web** (`web_search`: a short list of title / url / snippet): `{ engine: fn }` - a search engine of yours, any API - or `{ provider: 'google', credentialRef, model, baseURL, maxResults, allowPrivateNetwork, readOnly, fetch }` - Google Search through Gemini grounding: one extra `generateContent` call per search on a Gemini key (default model `gemini-2.5-flash-lite`), which **spends model tokens** (`usage` phase `'search'`) and returns **Google redirect links**, not the pages' URLs. No key ships with the library and none is written in the config (`credentialRef` names it in `credentials`); the request reaches only that API; with `egress`, results the model could not fetch are left out. Recipes for Tavily / Brave / SearXNG as an `engine`, the free-tier models and what the redirect links mean — see [Search](docs/capabilities.md#search-finding-the-page-to-fetch) |