Skip to content

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 and mcp need an optional peer (cac, @modelcontextprotocol/server).

Comparison ​

Entry pointModuleFactoryBest for
Standard Handlerdevframe/initiateinitDevframe(def, { base })Raw handler
cacdevframe/adapters/caccreateCac()Standalone tools
devdevframe/adapters/devcreateDevServer()Dev server
builddevframe/adapters/buildcreateBuild()Static snapshots
vite@vitejs/devtools-kit/nodecreatePluginFromDevframe()Vite DevTools
embeddeddevframe/adapters/embeddedcreateEmbedded(def, { ctx })Runtime
mcpdevframe/adapters/mcpcreateMcpServer()Coding agents

Mount paths ​

SPA basePath depends on the adapter:

Adapter kindDefault basePathReason
cli, build (standalone)/Owns the origin.
vite, embedded (hosted)/__<id>/Shares a host's origin.

Override with DevframeDefinition.basePath:

ts
defineDevframe({
  id: 'my-devframe',
  basePath: '/devframes/', // force this base regardless of adapter
  setup(ctx) { /* … */ },
})

The client discovers its SPA base at runtime — see Client.

Released under the MIT License.