Initial commit from agent-native create

This commit is contained in:
agent-native
2026-07-25 17:10:38 +00:00
commit ffea2aeff7
120 changed files with 6804 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
// Import only the tiny URL-helper module, not the full client barrel.
// This keeps the ~650-700 KB gzip chat stack off the static import closure
// of the client entry point so it can't block the first page parse.
import { appBasePath } from "@agent-native/core/client/api-path";
import { hydrateRoot } from "react-dom/client";
import { HydratedRouter } from "react-router/dom";
const basePath = appBasePath();
const pathname = window.location.pathname;
const routerBasePath =
basePath && (pathname === basePath || pathname.startsWith(`${basePath}/`))
? basePath
: "";
const context = (
window as Window & { __reactRouterContext?: { basename?: string } }
).__reactRouterContext;
if (context) context.basename = routerBasePath;
hydrateRoot(document, <HydratedRouter />);