Generated files
Generated files prove how ViteHub resolved Definitions, Runtime Registries, stable imports, and Provider Output. Application code uses documented ViteHub imports instead of generated files.
Common generated paths
| Path | Owner | Purpose |
|---|---|---|
.vitehub/env/public.mjs | Env Package | Generated Public Env runtime module. |
.vitehub/env/server.mjs | Env Package | Generated Server Env runtime module. |
.vitehub/types/env.d.ts | Env Package | Generated Public Env and Server Env types. |
.vitehub/types/browser.d.ts | Browser Package | Generated Browser Definition names and input/result module types. |
.vitehub/types/email.d.ts | Email Package | Exact module declarations for discovered #vitehub/emails/<name> imports. |
.vitehub/types/markdown-template.d.ts | Markdown Template Package | Generated module type for direct *.template.md imports. |
.vitehub/types/workspace.d.ts | Workspace Package | Generated Workspace name types. |
.vitehub/email/templates/*.mjs | Email Package | Bundled Markdown email templates used by provider builds. |
.vitehub/rate-limit/manifest.json | Rate Limit Package | Sorted Rate Limit IDs, resolved providers, and inspectable driver capabilities. |
.vitehub/nitro/realtime/registry.mjs | Realtime Package | Generated registry for discovered Realtime Definitions. |
.vitehub/nitro/realtime/handler.ts | Realtime Package | Generated WebSocket and checkpoint route handler. |
.vitehub/agent/chat-webhook-route.ts | Agent Package | Generated Chat Webhook Route handler for discovered chat-capable Agents. |
.vitehub/agent/discord-gateway-plugin.ts | Agent Package | Generated Nitro process lifecycle for Discord Gateway listeners on the Node preset. |
.vitehub/agent/discord-gateway-route.ts | Agent Package | Generated Nitro route handler that wakes the Discord Gateway listener for discovered Discord Agents. |
.vitehub/agent/deno-server.ts | Agent Package | Generated Deno server output for Agent chat and webhook routes. |
.vitehub/schedule/deno-cron.mjs | Schedule Package | Deno Deno.cron wake output for Static Schedule Definitions. |
.vitehub/nitro/schedule/* | Schedule Package | Narrow Nitro bridge for Schedule Provider Wake. |
.vitehub/provision.json | ViteHub CLI | Non-secret Provision State read by Vite Integrations. |
.vercel/output/** | Provider Output | Vercel Build Output generated during provider builds. |
.netlify/v1/functions/** | Provider Output | Netlify Agent and static Schedule functions generated by their package integrations. |
dist/<app>/wrangler.json | Provider Output | Cloudflare worker config generated during provider builds. |
The .vitehub/agent/** paths above are the default for Vite integrations. The Nuxt integration keeps generated Agent artifacts inside Nuxt's build directory instead, under <buildDir>/vitehub/agent/** (normally .nuxt/vitehub/agent/**). Agent Definition discovery still uses the project and server directories.
Inspect generation
List generated files after Vite startup or build. The exact set depends on the package integrations and Provider Selection.
find .vitehub -maxdepth 4 -type f | sort
For Nuxt, inspect the framework-owned generated directory instead.
find .nuxt/vitehub -maxdepth 4 -type f | sort
Inspect resolved Rate Limit guarantees before deployment. The manifest uses schemaVersion: 2 and contains sorted rateLimits entries with name, provider, and capabilities; it is generated state for agents and tooling, not an application import.
cat .vitehub/rate-limit/manifest.json
Inspect env aliases through the stable import paths. The generated files are implementation details behind those imports.
import { useServerEnv } from '#vitehub/env/server'
const env = useServerEnv()
Regenerate after edits
Vite Integrations refresh generated files during dev startup, hot updates, or build hooks depending on the package. Restart the Vite dev server when a generated file does not match the current Definition set.
pnpm dev
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Stable import does not resolve | Generated type path is missing from TypeScript includes, or the Vite Integration did not run. | Add .vitehub/types/**/*.d.ts to tsconfig.json and restart Vite. |
| Generated registry is empty | Discovery path does not match the package file convention. | Check File conventions. |
| Provider output is stale | Build skipped provider output during dev or e2e mode. | Run a production-shaped build. |
| Provision ids are missing | Provision State was never written, or env vars override it. | Run vitehub provision run --dry-run, then apply with credentials if needed. |
Next steps
- Use Import paths for public import boundaries.
- Use Provider output for host artifacts.
- Use Runtime and host support for qualified host coverage.
- Use File conventions for discovery rules.