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
docs: sweep docs and READMEs to the canonical vocabulary
Every docs page (error pages included) and README now follows the Terms
page: built-in devframes instead of a plugin concept, host framework /
host page / user app, node side / browser side, client runtime, RPC
client, viewer over shell, dock rail/panel, page script and in-page
channel, qualified scopes and sessions.
Copy file name to clipboardExpand all lines: docs/content/2.adapters/1.initiate.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
2
title: 'The Standard Handler'
3
-
description: 'initDevframe() turns a DevframeDefinition into a live instance whose .handler — a Web Standard (request: Request) => Promise<Response> — carries the entire surface (SPA, __connection.json discovery, RPC socket, auth gate, MCP route) under one mount base. Every other serving path — adapters,…'
3
+
description: 'initDevframe() turns a DevframeDefinition into a running devframe whose .handler — a Web Standard (request: Request) => Promise<Response> — carries everything a devframe serves (SPA, __connection.json discovery, RPC socket, auth gate, MCP route) under one mount base. Every other serving path — adapters,…'
4
4
---
5
5
6
-
`initDevframe()` turns a `DevframeDefinition` into a live instance whose `.handler` — a Web Standard `(request: Request) => Promise<Response>` — carries the entire surface (SPA, `__connection.json` discovery, RPC socket, auth gate, MCP route) under one mount base. Every other serving path — [adapters](/adapters), [framework packages](/frameworks), [hub](/guide/hub-initiate) — is assembled from it. Mount it with a catch-all route.
6
+
`initDevframe()` turns a `DevframeDefinition` into a running devframe whose `.handler` — a Web Standard `(request: Request) => Promise<Response>` — carries everything a devframe serves (SPA, `__connection.json` discovery, RPC socket, auth gate, MCP route) under one mount base. Every other serving path — [adapters](/adapters), [framework kits](/frameworks), [hub](/guide/hub-initiate) — is assembled from it. Mount it with a catch-all route.
`base` is required — pass `resolveBasePath(def, 'hosted')` (`def.basePath ?? /__<id>/`) to default it; the instance echoes it back as `devtools.base`. `handler`/`nodeMiddleware` await readiness internally. The instance binds no port — [the WebSocket binding](#the-websocket-binding) is the host's call.
18
+
`base` is required — pass `resolveBasePath(def, 'hosted')` (`def.basePath ?? /__<id>/`) to default it; the running devframe echoes it back as `devtools.base`. `handler`/`nodeMiddleware` await readiness internally. The running devframe binds no port — [the WebSocket binding](#the-websocket-binding) is the host framework's call.
Frameworks with dev-time module reloading (Next, Nitro, SvelteKit) re-evaluate the calling module, so memoize the instance on `globalThis` to avoid leaking a socket per reload. `@devframes/next`'s `createDevframeNextHandler` handles this.
113
+
Host frameworks with dev-time module reloading (Next, Nitro, SvelteKit) re-evaluate the calling module, so memoize the running devframe on `globalThis` to avoid leaking a socket per reload. `@devframes/next`'s `createDevframeNextHandler` handles this.
114
114
115
115
## The WebSocket binding
116
116
117
-
Fetch handlers only hand over `Request`s, so the host binds the RPC socket. The **local binding** resolves in this order:
117
+
Fetch handlers only hand over `Request`s, so the host framework binds the RPC socket. The **local binding** resolves in this order:
118
118
119
119
1.**`ws.port`** — a side-car server on that exact port.
120
-
2.**`server`** — share the host's `node:http` server; the upgrade binds at `<base>__ws`. No extra ports.
121
-
3.**`ws: { sidecar: true }`** — a side-car server on a free port, for hosts whose handlers never see upgrades (Next.js route handlers, Nitro, Rsbuild).
122
-
4.**The host's own upgrades** — with none set, the socket waits: `devtools.attach(server)` routes a server's `upgrade` events (returning a detach fn); `devtools.handleUpgrade(req, socket, head)` completes a single one from a listener you own.
120
+
2.**`server`** — share the host framework's `node:http` server; the upgrade binds at `<base>__ws`. No extra ports.
121
+
3.**`ws: { sidecar: true }`** — a side-car server on a free port, for host frameworks whose handlers never see upgrades (Next.js route handlers, Nitro, Rsbuild).
122
+
4.**The host framework's own upgrades** — with none set, the socket waits: `devtools.attach(server)` routes a server's `upgrade` events (returning a detach fn); `devtools.handleUpgrade(req, socket, head)` completes a single one from a listener you own.
123
123
124
-
`ws.url` controls the *advertisement* instead — the browser dials it verbatim. Alone, an external server owns the transport and its auth (wire the instance's `context` via `createContextRpcServer` + a WS transport); alongside a local binding it overrides only the advertisement (the tunnel pattern).
124
+
`ws.url` controls the *advertisement* instead — the browser dials it verbatim. Alone, an external WebSocket server owns the transport and its auth (wire the running devframe's `context` via `createContextRpcServer` + a WS transport); alongside a local binding it overrides only the advertisement (the tunnel pattern).
125
125
126
-
`__connection.json` describes the active combination. Asking a configured instance to take over host upgrades reports `DF0055` (a local binding owns the socket) or `DF0056` (`ws.url` handed it off).
126
+
`__connection.json` describes the active combination. Asking a configured running devframe to take over the host framework's upgrades reports `DF0055` (a local binding owns the socket) or `DF0056` (`ws.url` handed it off).
127
127
128
128
## Auth
129
129
130
-
The instance**gates by default**. The interactive OTP handler wires automatically, printing its code/magic-link banner once the public origin is known (the first request, or the `origin` option). Pass `auth: false` for single-user localhost, or a `DevframeAuthHandler` for a custom scheme.
130
+
The running devframe**gates by default**. The interactive OTP handler wires automatically, printing its code/magic-link banner once the public origin is known (the first request, or the `origin` option). Pass `auth: false` for single-user localhost, or a `DevframeAuthHandler` for a custom scheme.
Copy file name to clipboardExpand all lines: docs/content/2.adapters/7.mcp.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
2
title: 'MCP'
3
-
description: 'Exposes a devframe''s agent host as a Model Context Protocol server: agents call flagged RPCs and read resources.'
3
+
description: 'Exposes a devframe''s agent-facing API as a Model Context Protocol server: coding agents call flagged RPCs and read resources.'
4
4
---
5
5
6
-
Exposes a devframe's agent host as a [Model Context Protocol](https://modelcontextprotocol.io) server: agents call flagged RPCs and read resources.
6
+
Exposes a devframe's agent-facing API as a [Model Context Protocol](https://modelcontextprotocol.io) server: coding agents call flagged RPCs and read resources.
`@modelcontextprotocol/server` is a peer dependency; `createMcpServer` speaks `stdio`, spawned per session.
15
+
`@modelcontextprotocol/server` is a peer dependency; `createMcpServer` speaks `stdio`, spawned per MCP session.
16
16
17
17
## Route-based server
18
18
19
-
The dev server exposes the same surface over HTTP, live. Enable with `cli.mcp`:
19
+
The dev server exposes the same MCP API over HTTP, live. Enable with `cli.mcp`:
20
20
21
21
```ts
22
22
import { defineDevframe } from'devframe'
@@ -29,9 +29,9 @@ export default defineDevframe({
29
29
})
30
30
```
31
31
32
-
The endpoint speaks Streamable-HTTP at `/__mcp` (`/__<id>/__mcp` under a host), sharing its origin/port. `--mcp` / `--no-mcp` override; `__connection.json` advertises it.
32
+
The endpoint speaks Streamable-HTTP at `/__mcp` (`/__<id>/__mcp` under a host framework), sharing its origin/port. `--mcp` / `--no-mcp` override; `__connection.json` advertises it.
33
33
34
-
Each session gets its own MCP server, keyed by `Mcp-Session-Id`. An origin gate requires `Origin` be loopback (or allow-listed) and rejects `Origin`-less requests. Widen for a tunnel/LAN origin with `cli: { mcp: { allowedOrigins: ['https://tunnel.example.com'] } }`.
34
+
Each MCP session gets its own MCP server, keyed by `Mcp-Session-Id`. An origin gate requires `Origin` be loopback (or allow-listed) and rejects `Origin`-less requests. Widen for a tunnel/LAN origin with `cli: { mcp: { allowedOrigins: ['https://tunnel.example.com'] } }`.
`createMcpFetchHandler(ctx, options)` returns the endpoint as a `Request → Response` handler plus a `dispose()` — mount on any fetch server.
51
51
@@ -75,8 +75,8 @@ The `devframe` bin ships an MCP **connector** ([next-devtools-mcp](https://githu
75
75
Two gateway tools (`devframe:connect:*` ids — see [tool ids and wire names](/guide/agent-native#tool-ids-and-wire-names)):
76
76
77
77
-**`devframe_connect_list-instances`** — list running dev servers and their MCP tools.
78
-
-**`devframe_connect_call-tool`** — invoke one tool on an instance (`{ port, tool, args }`) over Streamable-HTTP.
78
+
-**`devframe_connect_call-tool`** — invoke one tool on a running devframe (`{ port, tool, args }`) over Streamable-HTTP.
79
79
80
-
Discovery reads the **instance registry**: every `createDevServer` writes `~/.devframe/instances/<pid>-<port>.json`, dialed with a loopback origin. In-process hosts register via `registerDevframeInstance` (`devframe/node`). `--port <n>` probes a port; `DEVFRAME_INSTANCES_DIR` relocates the registry, `DEVFRAME_DISABLE_INSTANCE_REGISTRY=1` opts out.
80
+
Discovery reads the **instance registry**: every `createDevServer` writes `~/.devframe/instances/<pid>-<port>.json`, dialed with a loopback origin. In-process host frameworks register via `registerDevframeInstance` (`devframe/node`). `--port <n>` probes a port; `DEVFRAME_INSTANCES_DIR` relocates the registry, `DEVFRAME_DISABLE_INSTANCE_REGISTRY=1` opts out.
81
81
82
82
See [Agent-Native](/guide/agent-native) for the API and safety model.
Copy file name to clipboardExpand all lines: docs/content/3.frameworks/1.vite.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
2
title: 'Vite'
3
-
description: '@devframes/vite splits into @devframes/vite/single (dev-serve one devframe''s SPA) and @devframes/vite/hub (mount a devframes-hub); the bare import throws.'
3
+
description: '@devframes/vite splits into @devframes/vite/single (dev-serve one devframe''s SPA) and @devframes/vite/hub (mount a hub); the bare import throws.'
4
4
---
5
5
6
-
`@devframes/vite` splits into **`@devframes/vite/single`** (dev-serve one devframe's SPA) and [**`@devframes/vite/hub`**](#mounting-a-hub) (mount a devframes-hub); the bare import throws.
6
+
`@devframes/vite` splits into **`@devframes/vite/single`** (dev-serve one devframe's SPA) and [**`@devframes/vite/hub`**](#mounting-a-hub) (mount a hub); the bare import throws.
7
7
8
8
`single` exports `devframeVitePlugin`, `devframeViteBridge`, and `devframeVite`; also used by [`@devframes/nuxt`](/frameworks/nuxt).
9
9
@@ -16,7 +16,7 @@ export default defineConfig({
16
16
// Statically mounts the built SPA at `/__<id>/` — no RPC server:
17
17
plugins: [devframeVitePlugin(devframe)],
18
18
// Or bridge the RPC/WS backend into this dev server instead — the
19
-
//host app owns the SPA:
19
+
//user app owns the SPA:
20
20
// plugins: [devframeViteBridge(devframe)],
21
21
})
22
22
```
@@ -48,7 +48,7 @@ Devframe spawns a separate RPC + WS server and registers Vite middleware at `<ba
48
48
49
49
## Mounting a hub
50
50
51
-
`@devframes/vite/hub` mounts a [devframes-hub](/guide/hub) with `viteDevframeHub()`: wraps `initHub`, shares Vite's HTTP server, defaults dock UI to `@devframes/hub-ui`.
51
+
`@devframes/vite/hub` mounts a [hub](/guide/hub) with `viteDevframeHub()`: wraps `initHub`, shares Vite's HTTP server, defaults dock UI to `@devframes/hub-ui`.
Copy file name to clipboardExpand all lines: docs/content/3.frameworks/2.nuxt.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
2
title: 'Nuxt'
3
-
description: '@devframes/nuxt splits into @devframes/nuxt/single (author one devframe) and @devframes/nuxt/hub (mount a devframes-hub); the bare import throws.'
3
+
description: '@devframes/nuxt splits into @devframes/nuxt/single (author one devframe) and @devframes/nuxt/hub (mount a hub); the bare import throws.'
4
4
---
5
5
6
-
`@devframes/nuxt` splits into `@devframes/nuxt/single` (author one devframe) and [`@devframes/nuxt/hub`](#mounting-a-hub) (mount a devframes-hub); the bare import throws.
6
+
`@devframes/nuxt` splits into `@devframes/nuxt/single` (author one devframe) and [`@devframes/nuxt/hub`](#mounting-a-hub) (mount a hub); the bare import throws.
7
7
8
-
The `single` module wires a Nuxt SPA as a devframe client and types `useNuxtApp().$rpc` as `DevframeRpcClient`.
8
+
The `single` module wires a Nuxt SPA as a devframe's browser side and types `useNuxtApp().$rpc` as `DevframeRpcClient`.
Copy file name to clipboardExpand all lines: docs/content/3.frameworks/3.next.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ description: '@devframes/next hosts devframes from a Next.js App Router app via
8
8
9
9
`@devframes/next` hosts devframes from a Next.js App Router app via a route handler: one `fetch` handler serves each SPA and its `__connection.json` via [`serveStaticHandler`](/adapters/dev).
10
10
11
-
It splits into `@devframes/next/single` and [`@devframes/next/hub`](#mounting-a-hub); the bare import throws. `single` gives **`withDevframe()`**, **`createDevframeNextHandler()`**, and a React client (`@devframes/next/single/client`).
11
+
It splits into `@devframes/next/single` and [`@devframes/next/hub`](#mounting-a-hub); the bare import throws. `single` gives **`withDevframe()`**, **`createDevframeNextHandler()`**, and a React RPC-client helper (`@devframes/next/single/client`).
12
12
13
13
## Config
14
14
@@ -50,7 +50,7 @@ export const GET = handler.fetch
50
50
51
51
## Hosting a hub
52
52
53
-
[`@devframes/hub`](/guide/hub)'s `initHub` mounts every frame under `<base><id>/` behind one `handler` (memoize on `globalThis`; see `examples/hub-next`):
53
+
[`@devframes/hub`](/guide/hub)'s `initHub` mounts every devframe under `<base><id>/` behind one `handler` (memoize on `globalThis`; see `examples/hub-next`):
Copy file name to clipboardExpand all lines: docs/content/3.frameworks/index.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
2
title: 'Frameworks'
3
-
description: 'The framework packages — @devframes/vite, @devframes/nuxt, @devframes/next — integrate devframe with a meta-framework''s dev server. Two subpaths:'
3
+
description: 'The framework kits — @devframes/vite, @devframes/nuxt, @devframes/next — integrate devframe with a meta-framework''s dev server. Two subpaths:'
4
4
---
5
5
6
-
The framework packages — [`@devframes/vite`](/frameworks/vite), [`@devframes/nuxt`](/frameworks/nuxt), [`@devframes/next`](/frameworks/next) — integrate devframe with a meta-framework's dev server. Two **subpaths**:
6
+
The framework kits — [`@devframes/vite`](/frameworks/vite), [`@devframes/nuxt`](/frameworks/nuxt), [`@devframes/next`](/frameworks/next) — integrate devframe with a meta-framework's dev server. Two **subpaths**:
7
7
8
8
| Scope | Subpath | You are… |
9
9
|-------|---------|----------|
10
10
|**single**|`.../single`| building & dev-serving a **single devframe's SPA** with that tool |
11
-
|**hub**|`.../hub`| mounting a whole **[devframes-hub](/guide/hub)** (many integrations) inside that tool |
11
+
|**hub**|`.../hub`| mounting a whole **[hub](/guide/hub)** (many devframes) inside that tool |
12
12
13
13
The bare package root throws, pointing to the two subpaths.
14
14
@@ -22,8 +22,8 @@ The bare package root throws, pointing to the two subpaths.
22
22
23
23
For framework-neutral CLI/build/embedded outputs, use the [adapters](/adapters) instead.
24
24
25
-
## hub: mount a devframes-hub
25
+
## hub: mount a hub
26
26
27
-
Each `hub`entry wraps [`initHub`](/guide/hub-initiate) and defaults the UI to [`@devframes/hub-ui`](/guide/build-your-own-hub-ui)'s `createUi()` (`ui` to override, `ui: false` for headless). Per tool: **[Vite](/frameworks/vite#mounting-a-hub)**, **[Nuxt](/frameworks/nuxt#mounting-a-hub)**, **[Next](/frameworks/next#mounting-a-hub)**.
27
+
Each `hub`scope wraps [`initHub`](/guide/hub-initiate) and defaults the UI to [`@devframes/hub-ui`](/guide/build-your-own-hub-ui)'s `createUi()` (`ui` to override, `ui: false` for headless). Per tool: **[Vite](/frameworks/vite#mounting-a-hub)**, **[Nuxt](/frameworks/nuxt#mounting-a-hub)**, **[Next](/frameworks/next#mounting-a-hub)**.
28
28
29
29
`@devframes/vite/hub` and `@devframes/nuxt/hub` recommend the native viewers ([Vite DevTools](https://devtools.vite.dev), [Nuxt DevTools](https://devtools.nuxt.com)) once (silence with `{ quiet: true }`). Next has none, so `@devframes/next/hub` stays quiet.
0 commit comments