You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f15fe17
Browse filesBrowse the repository at this point in the historyBrowse files
Drop agent.tools.list() and call(), and sessions' direct tool calls, in favor of WebMCP (#140)
A page reaches its own tools through WebMCP (document.modelContext.getTools()
and executeTool()). The person's installed tools now reach a site only
through the person's agent, in agent.run() or agent.chat.open(). Neither
window.agent nor a session can call them directly any more.
Removed, with no alias:
- window.agent.tools.list() and call(), their handlers and message types,
and surfaces.tools in agent.capabilities().
- A session's callTool(), listAllowedTools(), tools capability and
maxToolCalls budget, and its tool-call count in the sidebar. A tool.call
action in requestCapabilities() now grants nothing.
- ERR_TOOL_NOT_ALLOWED, ERR_TOOL_NOT_FOUND and ERR_BUDGET_EXCEEDED, which
only those paths sent.
Kept: the mcp:tools.list and mcp:tools.call scopes and the per-site tool
allowlist, which the built-in agent.run() still checks; agent.run()'s own
maxToolCalls; and the Tool access setting, which now covers
agent.mcp.register(). The consent text for the two scopes and the Tool
access card now say what they permit.
The demos, spec example, test-harness mock and types, E2E tests, about 25
docs and the spec move to WebMCP or agent.run(). A new Firefox E2E checks
that a page registers, lists and calls its own tool through
document.modelContext, and that window.agent.tools is gone.
Also fixed:
- test-getting-started.mjs read Firefox's tab list before the page loaded,
so it failed on main. It also expected a walkthrough step that's gone.
- Docs said agent.run() sent ERR_BUDGET_EXCEEDED; a spent run stops calling
tools and answers.
- ARCHITECTURE.md described a rate limiter that doesn't exist.
- spec/explainer.md's proposed capabilities() report exposed the person's
installed tools, and its shipped signature said surfaces.ai instead of
surfaces.languageModel.
- spec/security-privacy.md cited a direct tool call and a deleted handler.
- docs/agent-workflow.md records two test-setup pitfalls.
Fixes HBR-183
Co-Authored-By: Claude Opus 5.5 (Claude Code) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 (Claude Code) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,10 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
### Changed
11
11
12
12
-**Firefox 128 or later is now required.**`"world": "MAIN"` in a manifest content script, which `injected.js` relies on, needs Firefox 128; an older Firefox would run it in the isolated world instead.
13
-
- **`LanguageModel`, `window.agent` and `document.modelContext` now exist before a page's own scripts run, not just after the page has finished loading.** `injected.js` runs as a main-world content script at `document_start` (declared directly in the Firefox and Chrome manifests; registered at runtime with `scripting.registerContentScripts` on Safari), instead of a `<script src>` the old isolated-world content script inserted, which Firefox didn't run until the page's own parser had already finished. A turned-off feature flag no longer removes an API or any of its members — `agent.tools`, `agent.browser.*`, `agent.agents.*` and the rest always exist and call through; the background refuses the call (`ERR_FEATURE_DISABLED`) when its flag is off, same as it already did for a page calling the transport directly. `LanguageModel` itself is always defined unless a native one already exists, and `LanguageModel.availability()` resolves `"unavailable"` with Text Generation off rather than rejecting, matching the Prompt API's own contract that `availability()` never rejects. `agent.capabilities()` reports the flags synchronously, but can still read Harbor's defaults for a script that calls it before the first `agent-ready`, which fires once `DOMContentLoaded` has happened — confirmed even if `injected.js` starts after that already did, such as in a tab that was already open when Harbor installed or was enabled — and Harbor knows the person's real settings, whichever is later, then again, but only when a setting actually changes (never a repeat firing for the same six flags, which a flags delivery can otherwise carry more than once, including across a back/forward cache restore).
13
+
- **`LanguageModel`, `window.agent` and `document.modelContext` now exist before a page's own scripts run, not just after the page has finished loading.** `injected.js` runs as a main-world content script at `document_start` (declared directly in the Firefox and Chrome manifests; registered at runtime with `scripting.registerContentScripts` on Safari), instead of a `<script src>` the old isolated-world content script inserted, which Firefox didn't run until the page's own parser had already finished. A turned-off feature flag no longer removes an API or any of its members — `agent.browser.*`, `agent.agents.*` and the rest always exist and call through; the background refuses the call (`ERR_FEATURE_DISABLED`) when its flag is off, same as it already did for a page calling the transport directly. `LanguageModel` itself is always defined unless a native one already exists, and `LanguageModel.availability()` resolves `"unavailable"` with Text Generation off rather than rejecting, matching the Prompt API's own contract that `availability()` never rejects. `agent.capabilities()` reports the flags synchronously, but can still read Harbor's defaults for a script that calls it before the first `agent-ready`, which fires once `DOMContentLoaded` has happened — confirmed even if `injected.js` starts after that already did, such as in a tab that was already open when Harbor installed or was enabled — and Harbor knows the person's real settings, whichever is later, then again, but only when a setting actually changes (never a repeat firing for the same six flags, which a flags delivery can otherwise carry more than once, including across a back/forward cache restore).
14
14
-**`window.ai` is replaced by the Prompt API's `LanguageModel`.** Pages call `LanguageModel.availability()` and `LanguageModel.create()` (https://webmachinelearning.github.io/prompt-api/) instead of `window.ai.canCreateTextSession()` / `createTextSession()` / `languageModel.capabilities()` / `languageModel.create()`. `create()` asks you for the `model:prompt` grant itself if the site doesn't already have it, and rejects with `NotAllowedError` on Deny; `availability()` needs no grant. The `providers.*` calls and the `model:list` permission scope are removed, along with the `{ provider, model }` session option — you pick your model or agent in Harbor, not the page.
15
15
- **`document.modelContext` now matches the current [WebMCP draft](https://webmachinelearning.github.io/webmcp/).** `registerTool()` keeps the same shape, but `document.modelContext` is now a full `ModelContext`: `getTools()` resolves to this document's own tools, sorted by name, each with a `title` (`""` if you didn't give one) and `annotations` (all four hints, defaulted, if you gave any at all — `null` if you didn't); `executeTool(tool, inputObject)` runs a tool the page itself registered, with no permission needed, accepts any object including arrays, and resolves to the JSON serialization of the result; `waitForToolsUntil(promise)` holds the agent-facing tool list for up to 10 seconds from your first call, a deadline later calls can't extend; and `toolchange`, `toolactivated` and `toolcancel` all fire on `document.modelContext` for a real execution, agent-called or your own `executeTool()` alike. `navigator.modelContext`, `addTool()`, `removeTool()` and the `tools` getter are removed, with no alias; unregister by aborting the `signal` passed to `registerTool()`'s options, and list tools with `getTools()`. `exposedTo` entries are validated (`SecurityError` for an invalid or non-trustworthy origin) but otherwise accepted with no effect, and a non-empty `fromOrigins` still adds nothing, because Harbor's polyfill injects into the top frame only. A document other than the page's own, such as one from `createHTMLDocument()`, gets its own `modelContext` whose methods all reject or throw `InvalidStateError`.
16
16
-**Tool hints are the WebMCP draft's four, not MCP's seven.** A page tool's `annotations` keep only `readOnlyHint`, `untrustedContentHint`, `consequentialHint` and `debugging`. MCP's `destructiveHint`, `idempotentHint` and `openWorldHint` are no longer accepted, on the page, in the background, or in the text Harbor's built-in model is told about a tool.
17
+
-**The tool permissions now say what they let a site do.** A site can no longer call your installed tools itself, so the prompt for `mcp:tools.list` and `mcp:tools.call` now asks whether your agent may see and use your installed tools while it works for that site ("Use your tools"). The sidebar's **Tool access** setting now covers a site registering its own tool server (`agent.mcp.register()`), the only page call it still controls.
17
18
18
19
### Added
19
20
@@ -156,6 +157,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
156
157
157
158
### Removed
158
159
160
+
-`window.agent.tools.list()` and `agent.tools.call()`, with no alias. A page reaches its own tools through WebMCP (`document.modelContext.getTools()` and `executeTool()`). The person's installed tools are reachable only through their agent, inside `agent.run()` or `agent.chat.open()`.
161
+
- A session's `callTool()`, `listAllowedTools()`, its `tools` capability, and its `maxToolCalls` limit. Sessions now carry LLM and browser capabilities only. To call a tool, start `agent.run()`, which keeps its own `maxToolCalls`.
162
+
- The error codes only those calls sent: `ERR_TOOL_NOT_ALLOWED`, `ERR_TOOL_NOT_FOUND` and `ERR_BUDGET_EXCEEDED`. Several docs said `agent.run()` could send them; it never did. When a run spends its `maxToolCalls`, it stops calling tools and gives its answer.
159
163
- Error codes Harbor documented but never sent: `ERR_USER_GESTURE_REQUIRED`, `ERR_SCOPE_REQUIRED`, `ERR_NOT_INSTALLED`, `ERR_TOOL_TIMEOUT`, `ERR_RATE_LIMITED` and a few MCP and bridge codes. They're gone from the docs and the spec. A missing scope is `ERR_PERMISSION_DENIED`, a page tool that times out is `ERR_TOOL_FAILED`, and a page without Harbor has no `window.agent` at all.
160
164
- The sidebar's **Open Chat** button and the chat page bundled inside the extension. That page ran its own copy of `window.agent` with every permission treated as granted, so it skipped the permission checks and loop fixes that web pages get. To chat with tools, use the demo-site chat (`demo/web-agents/chat-poc/`), which goes through the same `agent.run` as any site. The extension also no longer exposes `demo/*` or `demo-bootstrap.js` to web pages.
161
165
- The old Jekyll scaffolding under `whitepaper/` (`_config.yml`, `_layouts/`, `Gemfile`, `index.md`, `landscape.md`) — replaced by static HTML. `.nojekyll` added so GitHub Pages serves the files as authored.
0 commit comments