veryfront 0.1.1126 → 0.1.1128

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/esm/cli/templates/manifest.d.ts +1 -0
  2. package/esm/cli/templates/manifest.js +3 -2
  3. package/esm/deno.js +1 -1
  4. package/esm/src/config/environment-config.d.ts +5 -0
  5. package/esm/src/config/environment-config.d.ts.map +1 -1
  6. package/esm/src/config/environment-config.js +5 -2
  7. package/esm/src/html/hydration-script-builder/dev-client-renderer.js +1 -1
  8. package/esm/src/html/hydration-script-builder/prod-scripts.js +1 -1
  9. package/esm/src/html/hydration-script-builder/templates/router.d.ts.map +1 -1
  10. package/esm/src/html/hydration-script-builder/templates/router.js +35 -11
  11. package/esm/src/html/utils.d.ts.map +1 -1
  12. package/esm/src/html/utils.js +19 -45
  13. package/esm/src/index.client.d.ts +6 -21
  14. package/esm/src/index.client.d.ts.map +1 -1
  15. package/esm/src/index.client.js +6 -21
  16. package/esm/src/middleware/builtin/timeout.d.ts +1 -1
  17. package/esm/src/middleware/builtin/timeout.d.ts.map +1 -1
  18. package/esm/src/middleware/builtin/timeout.js +3 -4
  19. package/esm/src/react/runtime/core.d.ts +22 -0
  20. package/esm/src/react/runtime/core.d.ts.map +1 -1
  21. package/esm/src/react/runtime/core.js +1 -1
  22. package/esm/src/rendering/orchestrator/module-collection.d.ts +10 -2
  23. package/esm/src/rendering/orchestrator/module-collection.d.ts.map +1 -1
  24. package/esm/src/rendering/orchestrator/module-collection.js +12 -2
  25. package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
  26. package/esm/src/rendering/orchestrator/pipeline.js +9 -3
  27. package/esm/src/rendering/orchestrator/types.d.ts +2 -0
  28. package/esm/src/rendering/orchestrator/types.d.ts.map +1 -1
  29. package/esm/src/rendering/renderer.d.ts.map +1 -1
  30. package/esm/src/rendering/renderer.js +18 -8
  31. package/esm/src/rendering/utils/stream-utils.d.ts +19 -7
  32. package/esm/src/rendering/utils/stream-utils.d.ts.map +1 -1
  33. package/esm/src/rendering/utils/stream-utils.js +77 -12
  34. package/esm/src/routing/api/context-builder.d.ts +7 -0
  35. package/esm/src/routing/api/context-builder.d.ts.map +1 -1
  36. package/esm/src/routing/api/context-builder.js +20 -2
  37. package/esm/src/routing/api/module-loader/loader.js +23 -0
  38. package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts.map +1 -1
  39. package/esm/src/server/handlers/dev/files/esbuild-plugins.js +22 -0
  40. package/esm/src/server/handlers/request/module/page-data-endpoint-handler.d.ts.map +1 -1
  41. package/esm/src/server/handlers/request/module/page-data-endpoint-handler.js +40 -4
  42. package/esm/src/server/handlers/response/not-found.d.ts +0 -1
  43. package/esm/src/server/handlers/response/not-found.d.ts.map +1 -1
  44. package/esm/src/server/handlers/response/not-found.js +9 -110
  45. package/esm/src/server/services/rsc/orchestrators/handler.d.ts +3 -1
  46. package/esm/src/server/services/rsc/orchestrators/handler.d.ts.map +1 -1
  47. package/esm/src/server/services/rsc/orchestrators/handler.js +13 -8
  48. package/esm/src/server/services/rsc/orchestrators/render-handler.d.ts +1 -1
  49. package/esm/src/server/services/rsc/orchestrators/render-handler.d.ts.map +1 -1
  50. package/esm/src/server/services/rsc/orchestrators/render-handler.js +2 -2
  51. package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
  52. package/esm/src/transforms/esm/http-cache.js +132 -46
  53. package/esm/src/transforms/esm/in-flight-manager.d.ts +3 -2
  54. package/esm/src/transforms/esm/in-flight-manager.d.ts.map +1 -1
  55. package/esm/src/transforms/esm/in-flight-manager.js +6 -5
  56. package/esm/src/transforms/esm/transform-cache.d.ts.map +1 -1
  57. package/esm/src/transforms/esm/transform-cache.js +2 -16
  58. package/esm/src/transforms/import-rewriter/strategies/bare-strategy.d.ts.map +1 -1
  59. package/esm/src/transforms/import-rewriter/strategies/bare-strategy.js +16 -2
  60. package/esm/src/utils/singleflight.d.ts +5 -0
  61. package/esm/src/utils/singleflight.d.ts.map +1 -1
  62. package/esm/src/utils/singleflight.js +29 -0
  63. package/esm/src/utils/version-constant.d.ts +1 -1
  64. package/esm/src/utils/version-constant.js +1 -1
  65. package/package.json +5 -5
@@ -57,6 +57,7 @@ declare namespace _default {
57
57
  "content/architecture.md": string;
58
58
  "content/getting-started.md": string;
59
59
  "globals.css": string;
60
+ "globals.d.ts": string;
60
61
  "README.md": string;
61
62
  "store.ts": string;
62
63
  "tsconfig.json": string;
@@ -51,15 +51,16 @@ export default {
51
51
  "app/api/ag-ui/route.ts": "import { createAgUiHandler } from \"veryfront/agent\";\nimport { store } from \"../../../store.ts\";\n\nexport const POST = createAgUiHandler(\"rag\", {\n beforeStream: async ({ lastUserText }) => {\n const query = lastUserText.trim();\n if (!query) return;\n\n try {\n const results = await store.search(query, { topK: 5 });\n if (results.length === 0) return;\n\n const contextBlock = results\n .map(\n (result) =>\n `[${result.title}] (score: ${\n result.score.toFixed(2)\n })\\n${result.text}`,\n )\n .join(\"\\n\\n---\\n\\n\");\n\n return {\n prepend: [\n {\n role: \"system\",\n parts: [\n {\n type: \"text\",\n text:\n `Here are relevant documents retrieved for your question:\\n\\n${contextBlock}\\n\\n` +\n \"Use these documents to answer. Cite the document title when referencing information.\",\n },\n ],\n },\n ],\n };\n } catch (e) {\n console.error(\"[RAG] Retrieval failed:\", e);\n return;\n }\n },\n});\n",
52
52
  "app/api/ingest/route.ts": "import { store } from \"../../../store.ts\";\n\nexport async function POST() {\n await store.indexContentDir();\n return Response.json({ ok: true });\n}\n",
53
53
  "app/api/uploads/route.ts": "import { createUploadHandler } from \"veryfront/embedding\";\nimport { store } from \"../../../store.ts\";\n\nexport const { POST, GET, DELETE } = createUploadHandler(store, {\n auth: { type: \"none\", allowUnauthenticated: true },\n});\n",
54
- "app/layout.tsx": "'use client'\n\nimport \"../globals.css\";\nimport {\n AppShell,\n ChatSidebar,\n ChatThemeScope,\n ConversationsProvider,\n Tabs,\n TabsItem,\n} from \"veryfront/chat\";\nimport { Head } from \"veryfront/head\";\nimport { useRouter } from \"veryfront/router\";\n\nexport default function RootLayout({ children }: { children: React.ReactNode }): React.ReactNode {\n const router = useRouter();\n const activeTab = router.pathname.startsWith(\"/uploads\") ? \"uploads\" : \"chat\";\n\n return (\n <>\n <Head><title>Docs Agent</title></Head>\n <ChatThemeScope className=\"flex flex-col h-screen\">\n <ConversationsProvider storageKey=\"rag-conversations\">\n <AppShell className=\"flex-1 min-h-0\">\n <AppShell.Sidebar side=\"left\" className=\"border-r border-[var(--outline-border)]\">\n <AppShell.SidebarContent className=\"p-0\">\n <ChatSidebar.Root>\n <ChatSidebar.NewButton />\n <ChatSidebar.List />\n </ChatSidebar.Root>\n </AppShell.SidebarContent>\n </AppShell.Sidebar>\n <AppShell.Main>\n <AppShell.Header border className=\"h-16 gap-3 px-3\">\n <AppShell.Trigger side=\"left\" />\n <div className=\"flex flex-1 justify-center\">\n <Tabs\n value={activeTab}\n onValueChange={(value) => router.push(value === \"uploads\" ? \"/uploads\" : \"/\")}\n >\n <TabsItem value=\"chat\">Chat</TabsItem>\n <TabsItem value=\"uploads\">Uploads</TabsItem>\n </Tabs>\n </div>\n </AppShell.Header>\n <AppShell.Content className=\"flex flex-col min-h-0 pt-3\">\n {children}\n </AppShell.Content>\n </AppShell.Main>\n </AppShell>\n </ConversationsProvider>\n </ChatThemeScope>\n </>\n );\n}\n",
54
+ "app/layout.tsx": "'use client'\n\nimport \"../globals.css\";\nimport {\n AppShell,\n ChatSidebar,\n ChatThemeScope,\n ConversationsProvider,\n Tabs,\n TabsItem,\n} from \"veryfront/chat\";\nimport { Head } from \"veryfront/head\";\nimport { useRouter } from \"veryfront/router\";\n\nexport default function RootLayout({ children }: { children: React.ReactNode }): React.ReactNode {\n const router = useRouter();\n const activeTab = router.pathname.startsWith(\"/uploads\") ? \"uploads\" : \"chat\";\n\n return (\n <>\n <Head><title>Docs Agent</title></Head>\n <ChatThemeScope className=\"flex flex-col h-screen\">\n <ConversationsProvider storageKey=\"rag-conversations\">\n <AppShell className=\"flex-1 min-h-0\">\n <AppShell.Sidebar side=\"left\" className=\"border-r border-[var(--outline-border)]\">\n <AppShell.SidebarContent className=\"p-0\">\n <ChatSidebar.Root>\n <ChatSidebar.NewButton />\n <ChatSidebar.List />\n </ChatSidebar.Root>\n </AppShell.SidebarContent>\n </AppShell.Sidebar>\n <AppShell.Main>\n <AppShell.Header border className=\"h-16 gap-3 px-3\">\n <AppShell.Trigger side=\"left\" />\n <div className=\"flex flex-1 justify-center\">\n <Tabs\n value={activeTab}\n onValueChange={(value: string) =>\n router.push(value === \"uploads\" ? \"/uploads\" : \"/\")}\n >\n <TabsItem value=\"chat\">Chat</TabsItem>\n <TabsItem value=\"uploads\">Uploads</TabsItem>\n </Tabs>\n </div>\n </AppShell.Header>\n <AppShell.Content className=\"flex flex-col min-h-0 pt-3\">\n {children}\n </AppShell.Content>\n </AppShell.Main>\n </AppShell>\n </ConversationsProvider>\n </ChatThemeScope>\n </>\n );\n}\n",
55
55
  "app/page.tsx": "'use client'\n\nimport { Chat } from 'veryfront/chat'\n\nconst ACCEPT = '.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.csv,.txt,.md,.mdx,.html,.rtf,.epub,.json,.xml'\n\nexport default function DocsChat() {\n return (\n <Chat\n agentId=\"rag\"\n api=\"/api/ag-ui\"\n uploadApi=\"/api/uploads\"\n attachAccept={ACCEPT}\n className=\"flex-1 min-h-0\"\n placeholder=\"Ask anything about your documents...\"\n />\n )\n}\n",
56
56
  "app/uploads/page.tsx": "'use client'\n\nimport { AttachmentsPanel, useUploadsRegistry } from 'veryfront/chat'\n\nconst UPLOAD_API = '/api/uploads'\nconst ACCEPT = '.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.csv,.txt,.md,.mdx,.html,.rtf,.epub,.json,.xml'\n\nexport default function UploadsPage(): React.JSX.Element {\n const uploads = useUploadsRegistry({ url: UPLOAD_API, storageKey: 'rag-uploads' })\n\n return (\n <AttachmentsPanel\n uploads={uploads.items}\n loading={uploads.isLoading}\n onAttach={uploads.upload}\n onRemoveUpload={uploads.remove}\n attachAccept={ACCEPT}\n className=\"flex-1 min-h-0\"\n />\n )\n}\n",
57
57
  "content/architecture.md": "# Architecture\n\nAcme Platform uses a modular, event-driven architecture.\n\n## Core Components\n\n### API Gateway\nRoutes incoming requests to the appropriate microservice. Handles authentication, rate limiting, and request validation.\n\n### Event Bus\nAsynchronous message broker connecting all services. Supports pub/sub and point-to-point messaging patterns.\n\n### Data Layer\nMulti-tenant data storage with automatic sharding. Supports PostgreSQL for relational data and Redis for caching.\n\n## Request Flow\n\n1. Client sends request to API Gateway\n2. Gateway validates authentication token\n3. Request is routed to the target service\n4. Service processes request and publishes events\n5. Response is returned through the gateway\n\n## Scaling\n\nEach component scales independently. The API Gateway uses horizontal scaling with load balancing. Services auto-scale based on queue depth and CPU utilization.\n\n## Security\n\n- All inter-service communication uses mTLS\n- API tokens are rotated every 24 hours\n- Data at rest is encrypted with AES-256\n- Audit logs are retained for 90 days\n",
58
58
  "content/getting-started.md": "# Getting Started\n\nWelcome to Acme Platform. This guide covers initial setup and core concepts.\n\n## Installation\n\nInstall the CLI globally:\n\n```bash\nnpm install -g @acme/cli\n```\n\n## Creating a Project\n\nRun the init command to scaffold a new project:\n\n```bash\nacme init my-project\ncd my-project\n```\n\n## Project Structure\n\n- `src/`: Application source code\n- `config/`: Configuration files\n- `tests/`: Test suite\n- `docs/`: Documentation\n\n## Configuration\n\nCreate an `acme.config.ts` file in your project root:\n\n```ts\nexport default {\n name: \"my-project\",\n region: \"us-east-1\",\n features: [\"auth\", \"storage\"],\n};\n```\n\n## Next Steps\n\n- Read the [Architecture Guide](./architecture) to understand the system design\n- Check [API Reference](./api-reference) for available endpoints\n- Join our Discord community for support\n",
59
59
  "globals.css": "@import \"tailwindcss\";\n",
60
+ "globals.d.ts": "declare module \"*.css\";\n",
60
61
  "README.md": "# Docs Agent\n\nA chatbot that answers questions from your own documents using Retrieval-Augmented Generation (RAG).\n\n## What's included\n\n- Q&A agent with source citation\n- Embedding-based semantic search with convention-based model selection\n- Document upload supporting PDF, DOCX, XLSX, PPTX, CSV, HTML, RTF, EPUB, TXT, and Markdown\n- `ragStore()` with local JSON storage by default, and Veryfront Cloud RAG when bootstrap is present\n- Veryfront Cloud AI Gateway routing for generation and embeddings when bootstrap is present\n- Original uploaded files stored in Veryfront Cloud project uploads when cloud bootstrap is present\n- Sample content in `/content` indexed through a dedicated ingestion route\n\n## Getting started\n\n1. Set your Veryfront Cloud bootstrap vars:\n\n ```bash\n export VERYFRONT_API_TOKEN=vf_...\n export VERYFRONT_PROJECT_SLUG=my-project\n ```\n\n2. Start the dev server:\n\n ```bash\n npx veryfront dev\n ```\n\n3. Index the sample docs in `content/`:\n\n ```bash\n curl -X POST http://localhost:3000/api/ingest\n ```\n\n4. Open the app and upload a document or ask a question.\n\nIf you are using a self-hosted Veryfront API, also set `VERYFRONT_API_URL`.\n\n## Cloud mode\n\nWith `VERYFRONT_API_TOKEN` and `VERYFRONT_PROJECT_SLUG` set, the template uses\nVeryfront Cloud automatically:\n\n- Agent generation routes through Veryfront Cloud model routing.\n- Query and document embeddings route through Veryfront Cloud embedding routing.\n- `veryfront-cloud/openai/...` and `veryfront-cloud/google/...` models use AI Gateway.\n- RAG documents, chunks, and embeddings are stored in the target project.\n\nThe default cloud embedding model is\n`veryfront-cloud/openai/text-embedding-3-small`. Set\n`VERYFRONT_DEFAULT_EMBEDDING_MODEL` only when you need a different embedding\nmodel.\n\n## Architecture\n\nRAG grounds LLM responses in your documents through three pipelines: **Ingestion**, **Query**, and **RAG**. These pipelines are orchestrated around a shared vector store.\n\n```mermaid\nflowchart LR\n ChatUI_L[\"Chat UI\"]\n\n subgraph IngestionFlow[\"Ingestion Pipeline\"]\n D[\"Documents\"] --> EXT[\"Extraction\"] --> DC[\"Chunking\"] --> DE[\"Document\\nEmbedding\"] --> ING[\"Storage\"]\n end\n\n subgraph QueryFlow[\"Query Pipeline\"]\n Q[\"Query\"] --> QE[\"Query\\nEmbedding\"] --> SS[\"Similarity\\nSearch\"]\n end\n\n subgraph RAGFlow[\"RAG Pipeline\"]\n BF[\"beforeStream\\nHook\"] --> RET[\"Retrieval\"] --> AUG[\"Augmentation\"] --> AG[\"Agent\"] --> GEN[\"Generation\"]\n end\n\n EMB((\"Embedding\\nModel\"))\n GEN_LLM((\"Generative\\nModel\"))\n VS[(\"Vector\\nStore\")]\n ChatUI_R[\"Chat UI\"]\n\n ChatUI_L --> D\n ChatUI_L --> Q\n\n QE -.- EMB\n DE -.- EMB\n\n SS --> VS\n ING --> VS\n\n Q --> BF\n VS --> RET\n AG -.- GEN_LLM\n GEN -.- GEN_LLM\n GEN --> ChatUI_R\n```\n\n### Pipelines\n\n**Ingestion**: Documents are parsed into plain text via the built-in kreuzberg extraction engine (supporting PDF, DOCX, XLSX, PPTX, HTML, RTF, EPUB, and 76+ formats), split into overlapping chunks (~1000 chars, 200 char overlap), and stored in the default `ragStore()`. In local mode that means `data/index.json`; with Veryfront Cloud bootstrap it upgrades to the cloud RAG backend automatically. The original uploaded binary is also stored in the project's Veryfront Cloud uploads store so remote projects retain the source file, not just the extracted text. Uploaded files are ingested by the upload route. Bundled files in `content/` are ingested by the `/api/ingest` route.\n\n**Query**: The user's query is embedded into the same vector space as the documents, then compared against all stored chunks using cosine similarity to find the top-*k* most relevant results.\n\n**RAG**: The `beforeStream` hook in the AG-UI route intercepts each message before it reaches the agent. It searches the document store for relevant chunks, assembles them into context, and prepends them as retrieved reference data. The agent then generates a cited response streamed back to the user.\n\n## Structure\n\n```\nstore.ts RAG store config\nagents/rag.ts Q&A agent with citation instructions\ncontent/\n getting-started.md Sample document\n architecture.md Sample document\napp/\n api/ag-ui/route.ts AG-UI endpoint\n api/ingest/route.ts Bundled content ingestion\n api/uploads/route.ts Upload, list, and delete uploads\n uploads/page.tsx Upload management panel\n page.tsx Chat UI\n layout.tsx Chat shell with sidebar and tabs\n```\n\n## Framework usage\n\n| What | Framework | Template code |\n|------|-----------|---------------|\n| Chat UI + streaming | app-mode `Chat` | `page.tsx` |\n| Upload management | `AttachmentsPanel`, `useUploadsRegistry` | `uploads/page.tsx` |\n| Source display | Built into the `Chat` preset | `page.tsx` |\n| Upload API route | `createUploadHandler` | 1 line in `route.ts` |\n| AG-UI route | `createAgUiHandler` | 1 line in `route.ts` |\n| Agent definition | `agent()` | Config object in `agents/rag.ts` |\n| RAG retrieval | `beforeStream` hook | Context injection in `api/ag-ui/route.ts` |\n| Vector store | `ragStore()` | Config in `store.ts` |\n\n## Adding documents\n\n- Drop files into `content/`, then run `curl -X POST http://localhost:3000/api/ingest`\n- Or use the upload panel in the UI for PDF, DOCX, XLSX, PPTX, CSV, HTML, RTF, EPUB, TXT, and MD files\n\n## Production notes\n\nThis is a starter template, not a production-ready setup. For production, consider:\n\n- **Vector store**: Replace the default store with pgvector, Pinecone, or Qdrant for datasets beyond ~10k chunks\n- **Reranking**: Add a cross-encoder reranker (e.g. Cohere Rerank) after retrieval to improve precision\n- **Hybrid search**: Combine dense vectors with BM25 keyword matching for better recall\n",
61
62
  "store.ts": "import { ragStore } from \"veryfront/embedding\";\n\nexport const store = ragStore({\n storagePath: \"data/index.json\",\n contentDir: \"content\",\n});\n",
62
- "tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"strict\": true,\n \"jsx\": \"react-jsx\",\n \"skipLibCheck\": true,\n \"esModuleInterop\": true,\n \"paths\": {\n \"@/*\": [\"./*\"]\n }\n },\n \"include\": [\"**/*.ts\", \"**/*.tsx\"],\n \"exclude\": [\"node_modules\"]\n}\n"
63
+ "tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"strict\": true,\n \"jsx\": \"react-jsx\",\n \"skipLibCheck\": true,\n \"esModuleInterop\": true,\n \"noEmit\": true,\n \"allowImportingTsExtensions\": true,\n \"paths\": {\n \"@/*\": [\"./*\"]\n }\n },\n \"include\": [\"**/*.ts\", \"**/*.tsx\"],\n \"exclude\": [\"node_modules\"]\n}\n"
63
64
  }
64
65
  },
65
66
  "minimal": {
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.1126",
3
+ "version": "0.1.1128",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "minimumDependencyAge": {
@@ -57,6 +57,11 @@ export interface EnvironmentConfig {
57
57
  v8MaxOldSpaceSize: number | undefined;
58
58
  veryfrontVersion: string | undefined;
59
59
  }
60
+ /**
61
+ * Default incoming request deadline. This must remain above the renderer's
62
+ * 60-second pipeline deadline and below the proxy's 90-second upstream one.
63
+ */
64
+ export declare const DEFAULT_REQUEST_TIMEOUT_MS = 75000;
60
65
  export declare function initEnvironmentConfig(): EnvironmentConfig;
61
66
  export declare function refreshEnvironmentConfig(): EnvironmentConfig;
62
67
  export declare function getEnvironmentConfig(): EnvironmentConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"environment-config.d.ts","sourceRoot":"","sources":["../../../src/src/config/environment-config.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,aAAa,GAAG,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IAEnB,KAAK,EAAE,OAAO,CAAC;IACf,EAAE,EAAE,OAAO,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IAErB,UAAU,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,WAAW,EAAE,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AG,SAAS,CAAC;IACjC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAE9B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IAEtC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AA4HD,wBAAgB,qBAAqB,IAAI,iBAAiB,CAWzD;AAED,wBAAgB,wBAAwB,IAAI,iBAAiB,CAI5D;AAgBD,wBAAgB,oBAAoB,IAAI,iBAAiB,CAgBxD;AAED,wBAAgB,8BAA8B,IAAI,OAAO,CAExD;AAED,wBAAgB,2BAA2B,CACzC,SAAS,GAAE,OAAO,CAAC,iBAAiB,CAAM,GACzC,iBAAiB,CAWnB;AAED,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAGrF;AAED,wBAAgB,uBAAuB,IAAI,IAAI,CAI9C"}
1
+ {"version":3,"file":"environment-config.d.ts","sourceRoot":"","sources":["../../../src/src/config/environment-config.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,aAAa,GAAG,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IAEnB,KAAK,EAAE,OAAO,CAAC;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uBAAuB,IAAI,IAAI,CAI9C"}
@@ -3,8 +3,11 @@ import { getHostTelemetryEnv } from "../observability/tracing/telemetry-env.js";
3
3
  import { isTruthyEnvValue } from "../utils/constants/env.js";
4
4
  import { logger } from "../utils/logger/logger.js";
5
5
  import { hasEnvLoaded } from "../utils/env-loader.js";
6
- /** Default timeout for incoming HTTP requests (used when REQUEST_TIMEOUT_MS is set but unparseable) */
7
- const DEFAULT_REQUEST_TIMEOUT_MS = 30_000;
6
+ /**
7
+ * Default incoming request deadline. This must remain above the renderer's
8
+ * 60-second pipeline deadline and below the proxy's 90-second upstream one.
9
+ */
10
+ export const DEFAULT_REQUEST_TIMEOUT_MS = 75_000;
8
11
  /** Default timeout for outgoing HTTP fetch calls (used when VF_HTTP_FETCH_TIMEOUT is set but unparseable) */
9
12
  const DEFAULT_HTTP_FETCH_TIMEOUT_MS = 30_000;
10
13
  const DEFAULTS = {
@@ -6,7 +6,7 @@ export function generateDevClientRendererScript(nonce) {
6
6
  <script type="module"${nonceAttr}>
7
7
  import * as React from 'react';
8
8
  import { createRoot } from 'react-dom/client';
9
- import { RouterProvider, useRouter as useRouterFromModule } from 'veryfront/router';
9
+ import { RouterProvider, useRouter as useRouterFromModule, getNavigationStore } from 'veryfront/router';
10
10
  import { PageContextProvider } from 'veryfront/context';
11
11
 
12
12
  ${getRouterScript()}
@@ -8,7 +8,7 @@ export function generateProdHydrationModule() {
8
8
  return [
9
9
  `import * as React from 'react';`,
10
10
  `import { createRoot } from 'react-dom/client';`,
11
- `import { RouterProvider, useRouter as useRouterFromModule } from 'veryfront/router';`,
11
+ `import { RouterProvider, useRouter as useRouterFromModule, getNavigationStore } from 'veryfront/router';`,
12
12
  `import { PageContextProvider } from 'veryfront/context';`,
13
13
  getRouterScript().trim(),
14
14
  getLoaderScript().trim(),
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/router.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,cAstC3B,CAAC"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/router.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,cA8uC3B,CAAC"}
@@ -592,7 +592,7 @@ export const getRouterScript = () => `
592
592
  // ============================================
593
593
  // SPA navigation handler
594
594
  // ============================================
595
- async function navigateSPA(href, pushState = true, restoreScroll = false) {
595
+ async function navigateSPA(href, historyMode = 'push', restoreScroll = false) {
596
596
  currentAbortController?.abort();
597
597
 
598
598
  if (isNavigating) return;
@@ -626,14 +626,24 @@ export const getRouterScript = () => `
626
626
  // { redirect: { destination } } payload. Follow it with a document
627
627
  // navigation to the target (the same net effect as the full-page 302),
628
628
  // instead of trying to render a page that does not exist here.
629
+ // Only follow http(s)/relative destinations: assigning a javascript:/data:
630
+ // URL to location.href would EXECUTE it (the server also filters these, so
631
+ // this is defense in depth). Fall through to the normal error path otherwise.
629
632
  if (pageData && pageData.redirect && typeof pageData.redirect.destination === 'string') {
630
- log('SPA navigation redirect -> ' + pageData.redirect.destination);
631
- window.location.href = pageData.redirect.destination;
632
- return;
633
+ try {
634
+ var redirectTarget = new URL(pageData.redirect.destination, window.location.origin);
635
+ if (redirectTarget.protocol === 'http:' || redirectTarget.protocol === 'https:') {
636
+ log('SPA navigation redirect -> ' + redirectTarget.href);
637
+ window.location.href = redirectTarget.href;
638
+ return;
639
+ }
640
+ } catch (e) { /* invalid destination — do not follow */ }
633
641
  }
634
642
 
635
- if (pushState) {
643
+ if (historyMode === 'push') {
636
644
  window.history.pushState({ pageData, scrollY: 0 }, '', href);
645
+ } else if (historyMode === 'replace') {
646
+ window.history.replaceState({ pageData, scrollY: 0 }, '', href);
637
647
  }
638
648
 
639
649
  // Update the shared router snapshot BEFORE rendering. RouterProvider
@@ -666,7 +676,11 @@ export const getRouterScript = () => `
666
676
 
667
677
  hideNavigationProgress();
668
678
  perfEnd('nav:total:' + href);
669
- emitRouteTiming('total', targetPath, navigationStartedAt, { href, pushState, restoreScroll });
679
+ emitRouteTiming('total', targetPath, navigationStartedAt, {
680
+ href,
681
+ historyMode,
682
+ restoreScroll
683
+ });
670
684
  log('SPA navigation complete');
671
685
  } catch (error) {
672
686
  hideNavigationProgress();
@@ -1076,10 +1090,10 @@ export const getRouterScript = () => `
1076
1090
  domain: window.location.origin,
1077
1091
  path: window.location.pathname,
1078
1092
  push: (path) => {
1079
- void navigateSPA(path, true);
1093
+ void navigateSPA(path, 'push');
1080
1094
  },
1081
1095
  replace: (path) => {
1082
- void navigateSPA(path, false);
1096
+ void navigateSPA(path, 'replace');
1083
1097
  },
1084
1098
  back: () => {
1085
1099
  window.history.back();
@@ -1105,12 +1119,22 @@ export const getRouterScript = () => `
1105
1119
  })(),
1106
1120
  isPreview: false,
1107
1121
  isMounted: true,
1108
- navigate: (path) => navigateSPA(path, true),
1122
+ navigate: (path) => navigateSPA(path, 'push'),
1109
1123
  reload: () => window.location.reload()
1110
1124
  };
1111
1125
 
1112
1126
  window.__veryfrontRouter = router;
1113
1127
 
1128
+ // Route useRouter().push/replace/navigate (from veryfront/router) through the
1129
+ // same SPA navigator that intercepts <Link> clicks. Without this the shared
1130
+ // navigation store has no navigator registered and its navigate() falls back
1131
+ // to a full-page location.assign (finding #7: push() full-reloads).
1132
+ getNavigationStore().setNavigator((href, options) => {
1133
+ const mode = options && options.history;
1134
+ const historyMode = mode === 'replace' ? 'replace' : mode === 'none' ? 'none' : 'push';
1135
+ return navigateSPA(href, historyMode);
1136
+ });
1137
+
1114
1138
  // ============================================
1115
1139
  // Event handlers
1116
1140
  // ============================================
@@ -1121,7 +1145,7 @@ export const getRouterScript = () => `
1121
1145
  saveScrollPosition(currentPath);
1122
1146
 
1123
1147
  if (!e.state?.pageData) {
1124
- await navigateSPA(path, false, true);
1148
+ await navigateSPA(path, 'none', true);
1125
1149
  return;
1126
1150
  }
1127
1151
 
@@ -1177,7 +1201,7 @@ export const getRouterScript = () => `
1177
1201
 
1178
1202
  e.preventDefault();
1179
1203
  cancelScheduledPrefetch();
1180
- void navigateSPA(href, true);
1204
+ void navigateSPA(href, 'push');
1181
1205
  });
1182
1206
 
1183
1207
  document.addEventListener(
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/src/html/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAO1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAgBjF,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,OAAO,EACjB,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAQR;AAaD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AA4DD,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGrD,CAAC;AA6KF,UAAU,qBAAqB;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACpD;AA+GD,wBAAsB,cAAc,CAClC,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACvD,OAAO,CAAC,cAAc,CAAC,CAmEzB;AAED,wBAAsB,kBAAkB,CACtC,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACvD,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED,wBAAgB,mBAAmB,IAAI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AAmB,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAElF"}
@@ -70,37 +70,33 @@ export const PLATFORM_UTILITIES = {
70
70
  ...CORE_PLATFORM_UTILITIES,
71
71
  ...AI_MODULE_UTILITIES,
72
72
  };
73
+ // React import-map entries, always from esm.sh — the only CDN that serves React
74
+ // as real ESM. Uses the centralized esmShReact() helper so the URLs stay
75
+ // byte-identical across SSR/client (any mismatch loads a second React instance
76
+ // and hooks fail).
77
+ function esmShReactImports(react) {
78
+ return {
79
+ react: esmShReact("react", react),
80
+ "react-dom": esmShReact("react-dom", react, "", true),
81
+ "react-dom/client": esmShReact("react-dom", react, "/client", true),
82
+ "react/jsx-runtime": esmShReact("react", react, "/jsx-runtime", true),
83
+ "react/jsx-dev-runtime": esmShReact("react", react, "/jsx-dev-runtime", true),
84
+ };
85
+ }
73
86
  const CDN_URL_TEMPLATES = {
74
87
  "esm.sh": {
75
- // Use centralized esmShReact() helper from package-registry.ts to ensure URL consistency
76
- // Any URL mismatch causes esm.sh to serve different modules -> multiple React instances -> hooks fail
77
- react: (v) => esmShReact("react", v),
78
- reactDom: (v) => esmShReact("react-dom", v, "", true),
79
- reactDomClient: (v) => esmShReact("react-dom", v, "/client", true),
80
- jsxRuntime: (v) => esmShReact("react", v, "/jsx-runtime", true),
81
- jsxDevRuntime: (v) => esmShReact("react", v, "/jsx-dev-runtime", true),
82
88
  veryfrontChat: (v) => `https://esm.sh/veryfront@${v}/chat?external=react,react-dom&target=es2022`,
83
89
  veryfrontMarkdown: (v) => `https://esm.sh/veryfront@${v}/markdown?external=react,react-dom&target=es2022`,
84
90
  veryfrontMdx: (v) => `https://esm.sh/veryfront@${v}/mdx?external=react,react-dom&target=es2022`,
85
91
  veryfrontWorkflow: (v) => `https://esm.sh/veryfront@${v}/workflow/react?external=react,react-dom&target=es2022`,
86
92
  },
87
93
  unpkg: {
88
- react: (v) => `https://unpkg.com/react@${v}/umd/react.production.min.js`,
89
- reactDom: (v) => `https://unpkg.com/react-dom@${v}/umd/react-dom.production.min.js`,
90
- reactDomClient: (v) => `https://unpkg.com/react-dom@${v}/umd/react-dom.production.min.js`,
91
- jsxRuntime: (v) => `https://unpkg.com/react@${v}/jsx-runtime`,
92
- jsxDevRuntime: (v) => `https://unpkg.com/react@${v}/jsx-dev-runtime`,
93
94
  veryfrontChat: (v) => `https://unpkg.com/veryfront@${v}/esm/src/chat/index.js`,
94
95
  veryfrontMarkdown: (v) => `https://unpkg.com/veryfront@${v}/esm/src/markdown/index.js`,
95
96
  veryfrontMdx: (v) => `https://unpkg.com/veryfront@${v}/esm/src/mdx/index.js`,
96
97
  veryfrontWorkflow: (v) => `https://unpkg.com/veryfront@${v}/esm/src/workflow/react/index.js`,
97
98
  },
98
99
  jsdelivr: {
99
- react: (v) => `https://cdn.jsdelivr.net/npm/react@${v}/umd/react.production.min.js`,
100
- reactDom: (v) => `https://cdn.jsdelivr.net/npm/react-dom@${v}/umd/react-dom.production.min.js`,
101
- reactDomClient: (v) => `https://cdn.jsdelivr.net/npm/react-dom@${v}/umd/react-dom.production.min.js`,
102
- jsxRuntime: (v) => `https://cdn.jsdelivr.net/npm/react@${v}/jsx-runtime`,
103
- jsxDevRuntime: (v) => `https://cdn.jsdelivr.net/npm/react@${v}/jsx-dev-runtime`,
104
100
  veryfrontChat: (v) => `https://cdn.jsdelivr.net/npm/veryfront@${v}/esm/src/chat/index.js`,
105
101
  veryfrontMarkdown: (v) => `https://cdn.jsdelivr.net/npm/veryfront@${v}/esm/src/markdown/index.js`,
106
102
  veryfrontMdx: (v) => `https://cdn.jsdelivr.net/npm/veryfront@${v}/esm/src/mdx/index.js`,
@@ -117,25 +113,15 @@ function buildCdnImportMapFromTemplates(versions, templates,
117
113
  // optionally, the AI modules — never the core runtime.
118
114
  includeAiModulesLocally) {
119
115
  const { react, veryfront } = versions;
120
- // React is ALWAYS served from esm.sh, regardless of the configured CDN
121
- // provider. esm.sh is the only CDN that serves React as real ESM; unpkg and
122
- // jsdelivr only ship UMD globals (react/umd/react.production.min.js), which
123
- // cannot be consumed through an import map at all — the browser rejects them
124
- // with a module-resolution/CORS error and hydration never starts. Self-hosted
125
- // mode already does exactly this. The `provider` only governs where the
126
- // veryfront framework modules load from.
127
- const reactTemplates = CDN_URL_TEMPLATES["esm.sh"];
128
116
  return {
129
- react: reactTemplates.react(react),
130
- "react-dom": reactTemplates.reactDom(react),
131
- "react-dom/client": reactTemplates.reactDomClient(react),
132
- "react/jsx-runtime": reactTemplates.jsxRuntime(react),
133
- "react/jsx-dev-runtime": reactTemplates.jsxDevRuntime(react),
117
+ // React is ALWAYS from esm.sh, regardless of the configured provider (see
118
+ // esmShReactImports). The `provider` only governs the veryfront modules.
119
+ ...esmShReactImports(react),
134
120
  "veryfront/chat": templates.veryfrontChat(veryfront),
135
121
  "veryfront/markdown": templates.veryfrontMarkdown(veryfront),
136
122
  "veryfront/mdx": templates.veryfrontMdx(veryfront),
137
123
  "veryfront/workflow": templates.veryfrontWorkflow(veryfront),
138
- // Core runtime utilities always resolve locally (see comment above).
124
+ // Core runtime utilities always resolve locally.
139
125
  ...CORE_PLATFORM_UTILITIES,
140
126
  // AI modules only override the CDN entries when requested.
141
127
  ...(includeAiModulesLocally ? AI_MODULE_UTILITIES : {}),
@@ -152,13 +138,8 @@ function getJsdelivrImportMap(versions) {
152
138
  }
153
139
  function getSelfHostedImportMap(versions) {
154
140
  const { react } = versions;
155
- const esmShTemplates = CDN_URL_TEMPLATES["esm.sh"];
156
141
  return {
157
- react: esmShTemplates.react(react),
158
- "react-dom": esmShTemplates.reactDom(react),
159
- "react-dom/client": esmShTemplates.reactDomClient(react),
160
- "react/jsx-runtime": esmShTemplates.jsxRuntime(react),
161
- "react/jsx-dev-runtime": esmShTemplates.jsxDevRuntime(react),
142
+ ...esmShReactImports(react),
162
143
  "veryfront/chat": "/_veryfront/lib/chat.js",
163
144
  "veryfront/markdown": "/_veryfront/lib/markdown.js",
164
145
  "veryfront/mdx": "/_veryfront/lib/mdx.js",
@@ -297,14 +278,7 @@ export async function buildImportMap(options) {
297
278
  ? await resolveVersions(projectDir, config)
298
279
  : DEFAULT_VERSIONS;
299
280
  if (mode === "bundled") {
300
- const reactTemplates = CDN_URL_TEMPLATES["esm.sh"];
301
- let imports = {
302
- react: reactTemplates.react(versions.react),
303
- "react-dom": reactTemplates.reactDom(versions.react),
304
- "react-dom/client": reactTemplates.reactDomClient(versions.react),
305
- "react/jsx-runtime": reactTemplates.jsxRuntime(versions.react),
306
- "react/jsx-dev-runtime": reactTemplates.jsxDevRuntime(versions.react),
307
- };
281
+ let imports = { ...esmShReactImports(versions.react) };
308
282
  imports = applyManifestDependencies(imports, releaseAssetManifest);
309
283
  imports = applyReleaseModuleVersions(imports, releaseAssetManifest);
310
284
  imports = { ...imports, ...customImports };
@@ -1,26 +1,11 @@
1
1
  /**
2
- * Client/SSR-safe mirror of the `veryfront` root barrel ({@link file://./index.ts}).
2
+ * Browser- and SSR-safe helpers from the `veryfront` package.
3
3
  *
4
- * The root barrel re-exports the server bootstrap surface (`createHandler`,
5
- * `startServer`, `toNodeHandler`) from `#veryfront/server`. Because the browser
6
- * and SSR pipelines transform modules per-file (no cross-module tree-shaking),
7
- * an ESM re-export eagerly loads its source module, so pulling the root barrel
8
- * into a client chunk drags the entire server graph in, including
9
- * `src/server/production-server.ts`, which has module top-level `await` and
10
- * cannot be transformed to the es2020 browser target (HTTP 500 on that chunk,
11
- * which aborts hydration).
12
- *
13
- * A client-reachable module doing a used value import from the barrel, for
14
- * example `import { getEnv } from "veryfront"`, is not dead-stripped, so it
15
- * keeps the barrel and the leak. This barrel exposes exactly the same
16
- * browser-safe surface minus the server bootstrap functions, which no
17
- * client/SSR page code legitimately calls. The import rewriter redirects
18
- * `veryfront` to this module for the `browser` and `ssr` targets (see
19
- * `src/transforms/import-rewriter/strategies/veryfront-strategy.ts`), the same
20
- * mechanism `veryfront/workflow` already uses.
21
- *
22
- * Keep the exports below in sync with {@link file://./index.ts}: everything
23
- * except the `createHandler` / `startServer` / `toNodeHandler` value exports.
4
+ * This entrypoint exposes the root package's client-safe configuration,
5
+ * platform, routing, data, and security helpers without server bootstrap
6
+ * functions. Most app code can import these helpers from `veryfront`; use this
7
+ * explicit entrypoint when a browser or SSR module needs to declare that
8
+ * boundary directly.
24
9
  *
25
10
  * @example
26
11
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../src/src/index.client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACpF,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAM7C,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE/F,OAAO,EACL,UAAU,EACV,SAAS,EACT,IAAI,EACJ,QAAQ,IAAI,WAAW,EACvB,QAAQ,IAAI,WAAW,EACvB,WAAW,EACX,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAExF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EACV,WAAW,EACX,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../src/src/index.client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACpF,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAM7C,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE/F,OAAO,EACL,UAAU,EACV,SAAS,EACT,IAAI,EACJ,QAAQ,IAAI,WAAW,EACvB,QAAQ,IAAI,WAAW,EACvB,WAAW,EACX,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAExF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EACV,WAAW,EACX,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,26 +1,11 @@
1
1
  /**
2
- * Client/SSR-safe mirror of the `veryfront` root barrel ({@link file://./index.ts}).
2
+ * Browser- and SSR-safe helpers from the `veryfront` package.
3
3
  *
4
- * The root barrel re-exports the server bootstrap surface (`createHandler`,
5
- * `startServer`, `toNodeHandler`) from `#veryfront/server`. Because the browser
6
- * and SSR pipelines transform modules per-file (no cross-module tree-shaking),
7
- * an ESM re-export eagerly loads its source module, so pulling the root barrel
8
- * into a client chunk drags the entire server graph in, including
9
- * `src/server/production-server.ts`, which has module top-level `await` and
10
- * cannot be transformed to the es2020 browser target (HTTP 500 on that chunk,
11
- * which aborts hydration).
12
- *
13
- * A client-reachable module doing a used value import from the barrel, for
14
- * example `import { getEnv } from "veryfront"`, is not dead-stripped, so it
15
- * keeps the barrel and the leak. This barrel exposes exactly the same
16
- * browser-safe surface minus the server bootstrap functions, which no
17
- * client/SSR page code legitimately calls. The import rewriter redirects
18
- * `veryfront` to this module for the `browser` and `ssr` targets (see
19
- * `src/transforms/import-rewriter/strategies/veryfront-strategy.ts`), the same
20
- * mechanism `veryfront/workflow` already uses.
21
- *
22
- * Keep the exports below in sync with {@link file://./index.ts}: everything
23
- * except the `createHandler` / `startServer` / `toNodeHandler` value exports.
4
+ * This entrypoint exposes the root package's client-safe configuration,
5
+ * platform, routing, data, and security helpers without server bootstrap
6
+ * functions. Most app code can import these helpers from `veryfront`; use this
7
+ * explicit entrypoint when a browser or SSR module needs to declare that
8
+ * boundary directly.
24
9
  *
25
10
  * @example
26
11
  * ```ts
@@ -2,7 +2,7 @@ import type { Middleware } from "./types.js";
2
2
  import { type EnvironmentConfig } from "../../config/environment-config.js";
3
3
  /** Options accepted by timeout. */
4
4
  export interface TimeoutOptions {
5
- /** Timeout in milliseconds (default: 60000) */
5
+ /** Timeout in milliseconds (default: 75000) */
6
6
  timeoutMs?: number;
7
7
  /** Custom message for timeout response */
8
8
  message?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"timeout.d.ts","sourceRoot":"","sources":["../../../../src/src/middleware/builtin/timeout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EA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AAE,WAAW,CAAC,GAAG,UAAU,CAEtF"}
@@ -1,9 +1,8 @@
1
1
  import { getRequest } from "./types.js";
2
2
  import { serverLogger } from "../../utils/index.js";
3
- import { getEnvironmentConfig, } from "../../config/environment-config.js";
3
+ import { DEFAULT_REQUEST_TIMEOUT_MS, getEnvironmentConfig, } from "../../config/environment-config.js";
4
4
  import { HTTP_GATEWAY_TIMEOUT } from "../../utils/constants/http.js";
5
5
  const logger = serverLogger.component("timeout");
6
- const DEFAULT_TIMEOUT_MS = 60_000;
7
6
  const TIMEOUT_SENTINEL = Symbol("timeout");
8
7
  const DEFAULT_EXCLUDE_PATHS = ["/healthz", "/readyz", "/_health"];
9
8
  function isExcludedPath(pathname, exclude) {
@@ -26,7 +25,7 @@ function timeoutResponse(pathname, timeoutMs, message) {
26
25
  * returns a 504 Gateway Timeout response.
27
26
  */
28
27
  export function timeout(options) {
29
- const timeoutMs = options?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
28
+ const timeoutMs = options?.timeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
30
29
  const message = options?.message ?? "Request timeout";
31
30
  const exclude = options?.exclude ?? DEFAULT_EXCLUDE_PATHS;
32
31
  return async (ctx, next) => {
@@ -65,7 +64,7 @@ export function timeout(options) {
65
64
  */
66
65
  export function getTimeoutFromEnv(env = getEnvironmentConfig()) {
67
66
  const timeoutMs = env.requestTimeoutMs;
68
- return timeoutMs && timeoutMs > 0 ? timeoutMs : DEFAULT_TIMEOUT_MS;
67
+ return timeoutMs && timeoutMs > 0 ? timeoutMs : DEFAULT_REQUEST_TIMEOUT_MS;
69
68
  }
70
69
  /**
71
70
  * Creates a timeout middleware with configuration from environment
@@ -77,6 +77,28 @@ export interface PageContextProviderProps {
77
77
  /** Page context value to expose to descendants. */
78
78
  pageContext?: PageContextValue;
79
79
  }
80
+ /** How a navigation should affect the history stack. */
81
+ type HistoryMode = "push" | "replace" | "none";
82
+ /** Options accepted by the navigation store's `navigate`. */
83
+ interface NavigateOptions {
84
+ history?: HistoryMode;
85
+ }
86
+ /**
87
+ * The cross-bundle navigation store the client router and this React runtime
88
+ * share. This is an inline mirror of `rendering/client/navigation-store.ts`,
89
+ * kept here so the public React runtime bundle does not import the rendering
90
+ * layer. The shared `Symbol.for` key guarantees both bundles resolve the *same*
91
+ * runtime object regardless of which one evaluates first — so `RouterProvider`
92
+ * can subscribe synchronously on its first render, with no boot-order race.
93
+ */
94
+ interface NavigationStore {
95
+ subscribe(listener: () => void): () => void;
96
+ getHref(): string;
97
+ notify(): void;
98
+ navigate(href: string, options?: NavigateOptions): Promise<void>;
99
+ setNavigator(navigator: (href: string, options?: NavigateOptions) => Promise<void>): void;
100
+ }
101
+ export declare function getNavigationStore(): NavigationStore;
80
102
  /**
81
103
  * Provides the router context. `pathname`/`query` track the live URL through the
82
104
  * shared navigation store's `useSyncExternalStore` surface; `params`/`domain`
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/src/react/runtime/core.ts"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,kDAAkD;AAClD,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,qDAAqD;IACrD,SAAS,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,6CAA6C;IAC7C,IAAI,EAAE,CAAC,GA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C;CAC3F;AAID,wBAAgB,kBAAkB,IAAI,eAAe,CAwCpD;AAsBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,mBAAmB,GAAG,KAAK,CAAC,YAAY,CA0C5F;AAED,4CAA4C;AAC5C,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,CAAC,SAAS,EACtB,OAAO,GAAE,oBAAyB,GACjC,KAAK,CAAC,YAAY,CA6BpB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,WAAW,CAEvC;AAED,2EAA2E;AAC3E,wBAAgB,IAAI,CAAC,EACnB,QAAe,EACf,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,SAAS,GAAG,KAAK,CAAC,YAAY,CAMhC;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,WAAW,GACZ,EAAE,wBAAwB,GAAG,KAAK,CAAC,YAAY,CAc/C;AAED,sCAAsC;AACtC,wBAAgB,cAAc,IAAI,gBAAgB,CAEjD;AAED,sEAAsE;AACtE,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,GAAG,KAAK,CAAC,YAAY,CAwIpF;AAED,OAAO,EAAE,cAAc,IAAI,MAAM,EAAE,CAAC"}
@@ -50,7 +50,7 @@ function collectHead(data) {
50
50
  collector?.(data);
51
51
  }
52
52
  const NAVIGATION_STORE_KEY = Symbol.for("veryfront.navigation.store.v1");
53
- function getNavigationStore() {
53
+ export function getNavigationStore() {
54
54
  const holder = globalThis;
55
55
  const existing = holder[NAVIGATION_STORE_KEY];
56
56
  if (existing)
@@ -9,14 +9,22 @@
9
9
  /** Idle timeout for the module-loading stage. Any concrete module/transform progress resets it. */
10
10
  export declare const MODULE_LOAD_TIMEOUT_MS = 10000;
11
11
  /**
12
- * Absolute module-loading stage cap. Progress is stage-wide, so a single wedged
13
- * module can still run until this hard cap while other modules report progress.
12
+ * Fallback cap when module loading is called without an owner signal.
13
+ * Request and renderer entrypoints supply their own total deadline signal.
14
14
  */
15
15
  export declare const MODULE_LOAD_HARD_TIMEOUT_MS = 45000;
16
16
  /** Timeout for data fetching (getStaticData, getServerData) */
17
17
  export declare const DATA_FETCH_TIMEOUT_MS = 15000;
18
18
  /** Timeout for SSR rendering stage */
19
19
  export declare const SSR_RENDER_TIMEOUT_MS = 20000;
20
+ /**
21
+ * Human-readable label for the module-loading timeout.
22
+ *
23
+ * Falls back to the route pathname when the slug is empty — the index route's
24
+ * slug is `""`, which otherwise produced a blank timeout label
25
+ * (`"Module loading for "`) that named no route when a cold load stalled.
26
+ */
27
+ export declare function moduleLoadLabel(slug: string, pathname: string): string;
20
28
  /** Module to load for data fetching */
21
29
  export interface ModuleToLoad {
22
30
  type: "page" | "layout";
@@ -1 +1 @@
1
- {"version":3,"file":"module-collection.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/module-collection.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mGAAmG;AACnG,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAElD,+DAA+D;AAC/D,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAE5C,sCAAsC;AACtC,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAE5C,uCAAuC;AACvC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,iCAAiC;AACjC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,OAAO,EACxB,iBAAiB,EAAE,OAAO,EAC1B,aAAa,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAC7D,YAAY,EAAE,CAchB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAI7D"}
1
+ {"version":3,"file":"module-collection.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/module-collection.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mGAAmG;AACnG,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAElD,+DAA+D;AAC/D,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAE5C,sCAAsC;AACtC,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAE5C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,uCAAuC;AACvC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,iCAAiC;AACjC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,OAAO,EACxB,iBAAiB,EAAE,OAAO,EAC1B,aAAa,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAC7D,YAAY,EAAE,CAchB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAI7D"}
@@ -9,14 +9,24 @@
9
9
  /** Idle timeout for the module-loading stage. Any concrete module/transform progress resets it. */
10
10
  export const MODULE_LOAD_TIMEOUT_MS = 10_000;
11
11
  /**
12
- * Absolute module-loading stage cap. Progress is stage-wide, so a single wedged
13
- * module can still run until this hard cap while other modules report progress.
12
+ * Fallback cap when module loading is called without an owner signal.
13
+ * Request and renderer entrypoints supply their own total deadline signal.
14
14
  */
15
15
  export const MODULE_LOAD_HARD_TIMEOUT_MS = 45_000;
16
16
  /** Timeout for data fetching (getStaticData, getServerData) */
17
17
  export const DATA_FETCH_TIMEOUT_MS = 15_000;
18
18
  /** Timeout for SSR rendering stage */
19
19
  export const SSR_RENDER_TIMEOUT_MS = 20_000;
20
+ /**
21
+ * Human-readable label for the module-loading timeout.
22
+ *
23
+ * Falls back to the route pathname when the slug is empty — the index route's
24
+ * slug is `""`, which otherwise produced a blank timeout label
25
+ * (`"Module loading for "`) that named no route when a cold load stalled.
26
+ */
27
+ export function moduleLoadLabel(slug, pathname) {
28
+ return `Module loading for ${slug || pathname || "unknown route"}`;
29
+ }
20
30
  /**
21
31
  * Collect modules that need to be loaded for data fetching.
22
32
  *