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
Restore the `devframe/adapters/embedded` entry point (`createEmbedded`) that the
0.9 surface reduction had removed — kept as a named, discoverable adapter
alongside cac/dev/build/mcp. Re-adds the export map / tsdown / alias plumbing,
the source, the docs page + nav + adapter tables, the SKILL row, and the tsnapi
snapshot, and drops the corresponding migration-0.9 note.
Co-authored-by: opencode <noreply@opencode.ai>
Register a devframe into an already-running context at runtime. Mirrors the [`vite`](./vite) adapter's plugin-scan, but for callers that need dynamic, post-startup registration. The host decides the mount path; `embedded` is a hosted adapter and inherits the `/__<id>/` default when one is needed.
Copy file name to clipboardExpand all lines: docs/adapters/index.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ outline: deep
4
4
5
5
# Adapters
6
6
7
-
An adapter takes a `DevframeDefinition` and deploys it into a specific runtime — a standalone CLI, a Vite plugin, a static snapshot, or an MCP server. Each adapter ships at its own entry point (`devframe/adapters/<name>`); the bundler pulls in only the ones you use. To register a definition into an already-running host, call its `setup` directly: `await def.setup(ctx)`.
7
+
An adapter takes a `DevframeDefinition` and deploys it into a specific runtime — a standalone CLI, a Vite plugin, a static snapshot, an embedded host, or an MCP server. Each adapter ships at its own entry point (`devframe/adapters/<name>`); the bundler pulls in only the ones you use.
8
8
9
9
Every adapter factory has the shape `createXxx(devframeDef, options?)`. Some adapters draw on an optional peer dependency, installed only when you opt into that adapter: `cac` pulls in [`cac`](https://github.com/cacjs/cac), and `mcp` pulls in [`@modelcontextprotocol/server`](https://github.com/modelcontextprotocol/typescript-sdk).
10
10
@@ -16,6 +16,7 @@ Every adapter factory has the shape `createXxx(devframeDef, options?)`. Some ada
16
16
|[`dev`](./dev)|`devframe/adapters/dev`|`createDevServer(def, options?)`| Run the dev server programmatically — drive it from any CLI framework |
17
17
|[`build`](./build)|`devframe/adapters/build`|`createBuild(def, options?)`| Offline reports, CI artifacts, deployable SPA snapshots |
18
18
|[`vite`](./vite)|`@vitejs/devtools-kit/node`|`createPluginFromDevframe(def, options?)`| Mount the definition into Vite DevTools (or any compatible host) |
19
+
|[`embedded`](./embedded)|`devframe/adapters/embedded`|`createEmbedded(def, { ctx })`| Runtime registration into an already-running host |
19
20
|[`mcp`](./mcp)|`devframe/adapters/mcp`|`createMcpServer(def, options?)`| Exposing a devframe to coding agents |
20
21
21
22
## Mount paths
@@ -25,7 +26,7 @@ A devframe's SPA basePath depends on which adapter is running it:
25
26
| Adapter kind | Default basePath | Reason |
26
27
|--------------|------------------|--------|
27
28
|`cli`, `spa`, `build` (standalone) |`/`| The devframe owns the origin. |
28
-
|`vite`, embedding hosts (hosted) |`/__<id>/`| The devframe shares the origin with a host app and namespaces itself. |
29
+
|`vite`, `embedded` (hosted) |`/__<id>/`| The devframe shares the origin with a host app and namespaces itself. |
29
30
30
31
Override either side explicitly with `DevframeDefinition.basePath`:
Copy file name to clipboardExpand all lines: docs/guide/index.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Devframe keeps its surface focused on one tool, so the same definition stays por
15
15
-**One tool per definition.** A devframe describes a single integration. Deploy it through any adapter; host-level features that only matter when several tools share a UI (palettes, cross-tool toasts, unified terminals) come from whichever host you mount into — Vite DevTools is one example.
16
16
-**Headless.** Hook into `onReady`, `cli.configure`, and friends to print your own startup banners and styling — Devframe stays out of the way.
17
17
-**App-owned file watching.** Wire your own watcher (chokidar, fs.watch, …) and signal change via `ctx.rpc.sharedState.set(...)` or event-typed RPCs.
18
-
-**Context-aware mount paths.** Standalone adapters (`cli`, `spa`, `build`) serve at `/` by default; hosted contexts (`vite`, or a host that calls `setup`) serve at `/.<id>/`. Override via `DevframeDefinition.basePath`.
18
+
-**Context-aware mount paths.** Standalone adapters (`cli`, `spa`, `build`) serve at `/` by default; hosted adapters (`vite`, `embedded`) serve at `/.<id>/`. Override via `DevframeDefinition.basePath`.
19
19
-**SPAs own their base at runtime.** Build with relative asset paths (`vite.base: './'`); `connectDevframe` discovers the effective base from the executing script's location.
20
20
-**CLI flags compose.** The `cac` instance is exposed to both the devframe (`cli.configure`) and the caller of `createCac`, so capability flags and app flags merge cleanly.
node ./my-devframe.js mcp # stdio MCP server (experimental)
85
85
```
86
86
87
-
The CLI adapter serves the SPA at `/` by default. When the same devframe is embedded inside a host (`vite`, or a host that calls `setup`), the default becomes `/.my-devframe/`. Override either side via `defineDevframe({ basePath })`.
87
+
The CLI adapter serves the SPA at `/` by default. When the same devframe is embedded inside a host (`vite`, `embedded`), the default becomes `/.my-devframe/`. Override either side via `defineDevframe({ basePath })`.
88
88
89
89
## Adapters at a glance
90
90
@@ -95,10 +95,9 @@ Devframe deploys the same `DevframeDefinition` through one of these adapters:
95
95
|`cli`|`createCac(d).parse()`| Standalone CLI with dev / build / mcp subcommands |
96
96
|`vite`|`createPluginFromDevframe(d, opts?)`*(from `@vitejs/devtools-kit/node`)*| Mount the devframe into Vite DevTools (or another compatible host) |
97
97
|`build`|`createBuild(d, opts?)`| Self-contained static deploy with baked RPC dumps |
98
+
|`embedded`|`createEmbedded(d, { ctx })`| Runtime registration into an existing host |
98
99
|`mcp`|`createMcpServer(d, opts)`| Model Context Protocol server |
99
100
100
-
To register a definition into an already-running host, call `await d.setup(ctx)` directly.
101
-
102
101
See [Adapters](/adapters/) for the full reference.
`devframe/types` still resolves as the type-only subpath — useful for `declare module 'devframe/types'` augmentations — but `devframe` is the canonical import for both values and types.
116
116
117
-
## `devframe/adapters/embedded` is removed
118
-
119
-
`createEmbedded(def, { ctx })` was a one-line wrapper around the definition's own `setup`. Call `setup` directly to register a devframe into an already-running host context:
0 commit comments