Adapters
The lowest-level path is the standard handler, initDevframe(def, { base }): a Web Standard (request: Request) => Promise<Response> for any catch-all route. Every path below builds on it.
Adapters wrap it as createXxx(def, options?) at devframe/adapters/<name>. cac needs an optional peer (cac).
Comparison
| Entry point | Module | Factory | Best for |
|---|---|---|---|
| Standard Handler | devframe/initiate | initDevframe(def, { base }) | Raw handler |
cac | devframe/adapters/cac | createCac() | Standalone tools |
dev | devframe/adapters/dev | createDevServer() | Dev server |
build | devframe/adapters/build | createBuild() | Static snapshots |
vite | @vitejs/devtools-kit/node | createPluginFromDevframe() | Vite DevTools |
embedded | devframe/adapters/embedded | createEmbedded(def, { ctx }) | Runtime |
mcp | devframe/adapters/mcp | createMcpServer() | Coding agents |
Mount paths
SPA basePath depends on the adapter:
| Adapter kind | Default basePath | Reason |
|---|---|---|
cli, build (standalone) | / | Owns the origin. |
vite, embedded (hosted) | /__<id>/ | Shares a host framework's origin. |
Override with DevframeDefinition.basePath:
defineDevframe({
id: 'my-tool',
basePath: '/devframes/', // force this base regardless of adapter
setup(ctx) { /* … */ },
})The SPA discovers its base at runtime; see Client.
Built with Devframe
Real-world devtools and hub UI providers built on devframe, from Vite DevTools to ESLint Config Inspector.
The Standard Handler
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,…