Skip to content

Commit fee41f5

Browse files
committed
docs: simplify
1 parent 5ad1053 commit fee41f5

5 files changed

Lines changed: 5 additions & 15 deletions

File tree

docs/content/1.guide/12.in-page-channel.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Channel names are namespaced with the devframe id, like RPC ids. Function names
6464

6565
## The page script endpoint
6666

67-
The required `functions` option and optional `events` option declare every incoming name on the endpoint's protocol side; use `{}` for an empty direction. Functions require a `handler`. Events accept an optional `handler`, and `{}` registers an event for runtime subscriptions through `on()`. Handlers are contextually typed from the shared protocol and support Standard-Schema argument validation and `jsonSerializable` metadata. `defineChannelFunction` retains the named definition shape for lower-level authoring.
67+
The required `functions` option and optional `events` option declare every incoming name on the endpoint's protocol side; use `{}` for an empty direction. Functions require a `handler`. Events accept an optional `handler`, and `{}` registers an event for runtime subscriptions through `on()`. Handlers are contextually typed from the shared protocol and support Standard-Schema argument validation and `jsonSerializable` metadata. A function with `agent` metadata must set `jsonSerializable: true` and is available to coding agents through MCP. `defineChannelFunction` retains the named definition shape for lower-level authoring.
6868

6969
`call()` accepts names from `functions`, including actions returning `void` or `Promise<void>`: callers can await completion and catch errors or timeouts. `emit()`, its deprecated alias `callEvent()`, and `on()` use the names declared in `events`. Function and event names have separate namespaces.
7070

@@ -100,12 +100,6 @@ pageChannel.events.on('panel:disconnected', () => pauseWorkIfNobodyWatches())
100100

101101
`emit` on the page-script endpoint fans out to every connected panel endpoint. Functions declared under `functions.panel` are called through a specific `pageChannel.panels[0].call()` peer handle.
102102

103-
### Agent tools over MCP
104-
105-
A function carrying `agent` metadata is registered with the page's DevFrame client and becomes available through the node MCP endpoint used by `devframe connect`. The channel name qualifies the otherwise-bare function name. Only functions are exposed; events remain channel-only. Agent functions require `jsonSerializable: true`, and their Standard-Schema `args` produce the advertised `arg0` / `arg1` / … input schema.
106-
107-
The registration follows the endpoint and browser connection lifecycle. Closing the channel or browser tab removes its tools. No panel needs to be open: loading the page establishes the bridge.
108-
109103
## The panel endpoint
110104

111105
```ts

docs/content/1.guide/15.agent-native.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,6 @@ rpc.client.register({
157157

158158
`connectDevframe()` wires this on its own when the browser provides a model context; `webmcp: false` keeps the browser side off the WebMCP surface. `registerWebMcpTools(collector)` (from `devframe/client`) applies the same projection to a hand-built collector and returns a dispose that unregisters every tool.
159159

160-
[In-page channel functions](/guide/in-page-channel#agent-tools-over-mcp) use the page's DevFrame connection instead: adding `agent` makes the original handler available through the regular node MCP endpoint without exposing it through WebMCP.
161-
162160
> [!WARNING]
163161
> WebMCP is an experimental proposal; `registerWebMcpTools` tracks the current draft (`AbortSignal`-based unregistration) and earlier handle-returning drafts, but the browser API may still change.
164162

docs/content/1.guide/17.client-context.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ A client-only dock can also carry `type: 'json-render'` with an inline [JSON-ren
6767

6868
## Dock client scripts
6969

70-
A client script is a `ClientScriptEntry`: `{ importFrom, importName?, eager? }` (`importName` defaults `'default'`). The field varies by entry kind: an `action` entry's `action` runs when the dock button is activated, a `custom-render` entry's `renderer` renders its panel, and an `iframe` entry's optional `clientScript` runs alongside the iframe panel inside the host page ([Hub API reference](/references/hub-api#dock-client-script-fields)).
70+
A client script is a `ClientScriptEntry`: `{ importFrom, importName? }` (`importName` defaults `'default'`). The field varies by entry kind: an `action` entry's `action` runs when the dock button is activated, a `custom-render` entry's `renderer` renders its panel, and an `iframe` entry's optional `clientScript` runs alongside the iframe panel inside the host page ([Hub API reference](/references/hub-api#dock-client-script-fields)).
7171

72-
Hub UI normally imports an iframe's client script when its dock is first activated. Set `eager: true` when the script must start observing the host app earlier: the module is imported and its exported function runs once, as soon as both the client context and dock entry are available. This is execution timing, not module preloading; it does not wait for the dock panel to open.
72+
An iframe entry normally runs its client script on first activation. Set `clientScript.eager: true` to run it once as soon as the client context and dock entry are available.
7373

7474
The exported function (`DockClientScriptContext`) receives the client context and two dock-scoped extras:
7575

docs/content/8.references/5.browser-api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ The browser-only endpoint methods of the [in-page channel](/guide/in-page-channe
5252

5353
`InPageChannelProtocol` separates `functions` and `events`. Each section has optional `pageScript` and `panel` maps naming the receiving direction. Endpoint options require a complete `functions` map with handlers; `events` is optional, and when provided can include optional handlers (use `{}` to declare an event without a handler for `channel.on()`). `call()` uses function names regardless of return type, while `emit()`, `callEvent()` (deprecated), and `on()` use event names. A function returning `void` or `Promise<void>` remains an awaitable request/response call.
5454

55-
In-page endpoint functions carrying `agent` are synchronized through the page's DevFrame connection to the node MCP endpoint. Agent functions require `jsonSerializable: true`; events cannot be exposed.
56-
5755
| Method or property | Page-script endpoint | Panel endpoint |
5856
|--------------------|-------------|-------|
5957
| `emit(name, ...args)` | Fans an event out to every connected panel. | Sends an event to the page script, buffering while connecting. |

docs/content/8.references/6.hub-api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ The properties of `DevframeClientContext`: [The client context](/guide/client-co
127127

128128
Which `ClientScriptEntry` field carries an entry's client script, and when it runs: [Dock client scripts](/guide/client-context#dock-client-scripts).
129129

130-
Every client script specifies `importFrom` and may specify `importName` (default: `default`). An iframe `clientScript` may additionally set `eager: true` to import and execute once as soon as the client context and dock entry are available, before activation.
130+
`ClientScriptEntry` requires `importFrom` and accepts `importName` (default: `default`).
131131

132132
| Entry kind | Field | Runs |
133133
|---|---|---|
134134
| `action` | `action` | when the dock button is activated |
135135
| `custom-render` | `renderer` | to render the entry's panel |
136-
| `iframe` | `clientScript` (optional) | alongside the iframe panel, inside the host page |
136+
| `iframe` | `clientScript` (optional) | on first activation, or when the client context and dock entry become available with `clientScript.eager: true` |
137137

138138
## Frame-nav messages
139139

0 commit comments

Comments
 (0)