Skip to content

Commit 42577e5

Browse files
committed
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.
1 parent 7edebca commit 42577e5

58 files changed

Lines changed: 243 additions & 243 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/content/2.adapters/1.initiate.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
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,…'
44
---
55

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.
77

88
```ts
99
import { initDevframe } from 'devframe/initiate'
@@ -15,7 +15,7 @@ const devtools = initDevframe(myDevframe, { base: '/__my-tool/' })
1515
// devtools.connectionMeta(), devtools.close()
1616
```
1717

18-
`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.
1919

2020
## Mount the handler
2121

@@ -110,24 +110,24 @@ export const GET = ({ request }) => devtools.handler(request)
110110
```
111111

112112
::
113-
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.
114114

115115
## The WebSocket binding
116116

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:
118118

119119
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.
123123

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).
125125

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).
127127

128128
## Auth
129129

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.
131131

132132
## Relation to the other adapters
133133

docs/content/2.adapters/2.cac.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ defineDevframe({
6565
port: 7777, // preferred port
6666
portRange: [7777, 9000], // passed through to get-port-please
6767
random: false, // passed through to get-port-please
68-
host: '127.0.0.1', // default host; --host overrides
68+
host: '127.0.0.1', // default bind host; --host overrides
6969
open: true, // auto-open the browser on dev start; embeds the current OTP so the tab lands authenticated
7070
configure(cli) { // contribute capability flags/commands
7171
cli.option('--config <file>', 'Custom config file')

docs/content/2.adapters/4.build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ await createBuild(devframe, {
2525
| `distDir` | `def.clientAssets` | SPA dist override (or [remote assets](/guide/client-assets)). |
2626
| `pretty` | `false` | Pretty-print dump JSON. |
2727

28-
The client runs read-only. For a custom URL base, build with relative asset paths (`vite.base: './'`).
28+
The RPC client runs read-only. For a custom URL base, build with relative asset paths (`vite.base: './'`).

docs/content/2.adapters/5.vite.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ The returned object has the shape `{ name, devtools: { setup, capabilities } }`.
2121
| `name` | `devframe:<id>` | Plugin name. |
2222
| `base` | `def.basePath ?? /.${id}/` | Mount path override. |
2323
| `dock` | `{}` | Overrides for the iframe dock entry (category, icon, when). |
24-
| `setup` || Host-only setup hook; receives the kit-augmented context. |
24+
| `setup` || Setup hook run only in the Vite host; receives the kit-augmented context. |

docs/content/2.adapters/7.mcp.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
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.'
44
---
55

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.
77

88
```ts
99
import { createMcpServer } from 'devframe/adapters/mcp'
@@ -12,11 +12,11 @@ import devframe from './devframe'
1212
await createMcpServer(devframe, { transport: 'stdio' })
1313
```
1414

15-
`@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.
1616

1717
## Route-based server
1818

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`:
2020

2121
```ts
2222
import { defineDevframe } from 'devframe'
@@ -29,9 +29,9 @@ export default defineDevframe({
2929
})
3030
```
3131

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.
3333

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'] } }`.
3535

3636
### Hosted bridges
3737

@@ -45,7 +45,7 @@ devframeViteBridge(devframe, { mcp: true })
4545
createDevframeNextHandler(devframe, { mcp: true })
4646
```
4747

48-
## Custom hosts
48+
## Custom host frameworks
4949

5050
`createMcpFetchHandler(ctx, options)` returns the endpoint as a `Request → Response` handler plus a `dispose()` — mount on any fetch server.
5151

@@ -75,8 +75,8 @@ The `devframe` bin ships an MCP **connector** ([next-devtools-mcp](https://githu
7575
Two gateway tools (`devframe:connect:*` ids — see [tool ids and wire names](/guide/agent-native#tool-ids-and-wire-names)):
7676

7777
- **`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.
7979

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.
8181

8282
See [Agent-Native](/guide/agent-native) for the API and safety model.

docs/content/2.adapters/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ SPA basePath depends on the adapter:
2626
| Adapter kind | Default basePath | Reason |
2727
|--------------|------------------|--------|
2828
| `cli`, `build` (standalone) | `/` | Owns the origin. |
29-
| `vite`, `embedded` (hosted) | `/__<id>/` | Shares a host's origin. |
29+
| `vite`, `embedded` (hosted) | `/__<id>/` | Shares a host framework's origin. |
3030

3131
Override with `DevframeDefinition.basePath`:
3232

@@ -38,4 +38,4 @@ defineDevframe({
3838
})
3939
```
4040

41-
The client discovers its SPA base at runtime — see [Client](/guide/client#runtime-basepath-discovery).
41+
The SPA discovers its base at runtime — see [Client](/guide/client#runtime-basepath-discovery).

docs/content/3.frameworks/1.vite.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
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.'
44
---
55

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.
77

88
`single` exports `devframeVitePlugin`, `devframeViteBridge`, and `devframeVite`; also used by [`@devframes/nuxt`](/frameworks/nuxt).
99

@@ -16,7 +16,7 @@ export default defineConfig({
1616
// Statically mounts the built SPA at `/__<id>/` — no RPC server:
1717
plugins: [devframeVitePlugin(devframe)],
1818
// Or bridge the RPC/WS backend into this dev server instead — the
19-
// host app owns the SPA:
19+
// user app owns the SPA:
2020
// plugins: [devframeViteBridge(devframe)],
2121
})
2222
```
@@ -48,7 +48,7 @@ Devframe spawns a separate RPC + WS server and registers Vite middleware at `<ba
4848

4949
## Mounting a hub
5050

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`.
5252

5353

5454
```ts

docs/content/3.frameworks/2.nuxt.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
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.'
44
---
55

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.
77

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`.
99

1010
## Install
1111

@@ -67,7 +67,7 @@ export default defineNuxtConfig({
6767
- Runs `devframe.setup(ctx, { flags })`.
6868
- Cleans up on Vite restart, `nuxt dev` shutdown, and bundle close.
6969

70-
On by default when `devframe` is set; disable it (client-only) with `devMiddleware: false`.
70+
On by default when `devframe` is set; disable it (browser side only) with `devMiddleware: false`.
7171

7272
### Customizing the bridge
7373

@@ -116,7 +116,7 @@ At runtime the SPA fetches `./__connection.json` and branches on `backend` — `
116116

117117
## Mounting a hub
118118

119-
`@devframes/nuxt/hub` mounts a whole [devframes-hub](/guide/hub) alongside `nuxt dev`, injecting `@devframes/hub-ui`'s dock. `ui` swaps the default; `ui: false` gives a headless hub via `@devframes/nuxt/hub/client`.
119+
`@devframes/nuxt/hub` mounts a whole [hub](/guide/hub) alongside `nuxt dev`, injecting `@devframes/hub-ui`'s dock. `ui` swaps the default; `ui: false` gives a headless hub via `@devframes/nuxt/hub/client`.
120120

121121
```ts [nuxt.config.ts]
122122
export default defineNuxtConfig({

docs/content/3.frameworks/3.next.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: '@devframes/next hosts devframes from a Next.js App Router app via
88
99
`@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).
1010

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`).
1212

1313
## Config
1414

@@ -50,7 +50,7 @@ export const GET = handler.fetch
5050

5151
## Hosting a hub
5252

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`):
5454

5555
```ts [devframe/host.ts]
5656
import { DEVFRAMES_HUB_BASE, initHub } from '@devframes/hub/initiate'
@@ -76,7 +76,7 @@ export async function GET(request: Request): Promise<Response> {
7676
}
7777
```
7878

79-
## React client
79+
## React RPC client
8080

8181
```tsx [app/providers.tsx]
8282
'use client'

docs/content/3.frameworks/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
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:'
44
---
55

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**:
77

88
| Scope | Subpath | You are… |
99
|-------|---------|----------|
1010
| **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 |
1212

1313
The bare package root throws, pointing to the two subpaths.
1414

@@ -22,8 +22,8 @@ The bare package root throws, pointing to the two subpaths.
2222

2323
For framework-neutral CLI/build/embedded outputs, use the [adapters](/adapters) instead.
2424

25-
## hub: mount a devframes-hub
25+
## hub: mount a hub
2626

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)**.
2828

2929
`@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

Comments
 (0)