Skip to content

Interface: DevServerSetupContext

Defined in: packages/core/src/server/DevServer.ts:72

Context passed to the setup callback on each reload. Provides the registry for tool registration and the cache-busted URL for ESM module re-imports.

Properties

cacheBustUrl

ts
readonly cacheBustUrl: string | undefined;

Defined in: packages/core/src/server/DevServer.ts:83

Cache-busted URL of the changed file (if any). Use this to re-import ESM modules so the module cache is invalidated:

ts
const mod = await import(ctx.cacheBustUrl ?? cacheBustUrl('./src/tools.ts'));

For CJS modules, cache invalidation is automatic.


registry

ts
readonly registry: ToolRegistryLike;

Defined in: packages/core/src/server/DevServer.ts:74

Registry to register tools on.