A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.
perf: cut cold route compilation and unblock preview images (#6441)
Thomasb32ad82850d3
diff --git a/.dockerignore b/.dockerignoreindex 521c55109..c0f2129a3 100644--- a/.dockerignore+++ b/.dockerignore@@ -17,7 +17,8 @@ coveragedev.builde2e-apps/docs+apps/docs/*+!apps/docs/package.jsonapps/nextjs/.next.env.env.*diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex dcbb352c3..dbb3d2a2d 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -82,7 +82,7 @@ jobs:run: cp .env.example .env- name: Lint, typecheck, and build affected workspaces- run: pnpm turbo run lint typecheck build --affected --continue=dependencies-successful+ run: pnpm turbo run lint typecheck build --affected --continue=dependencies-successful --concurrency=2- name: Validate workspace configurationrun: pnpm lint:wsdiff --git a/.gitignore b/.gitignoreindex c22262f6d..71a27829a 100644--- a/.gitignore+++ b/.gitignore@@ -78,3 +78,4 @@ skills-lock.jsonapps/docs/.docusaurusapps/docs/build.pnpm-store+benchmark-resultsdiff --git a/Dockerfile b/Dockerfileindex 8f4c5e49a..afc7b5ded 100644--- a/Dockerfile+++ b/Dockerfile@@ -3,12 +3,18 @@FROM node:24.18.0-alpine AS baseFROM base AS builder+ARG TARGETPLATFORMWORKDIR /app-RUN apk add --no-cache libc6-compat curl bash && apk update+# Native dependencies normally use prebuilds, but the build must remain+# reproducible when a prebuild download times out and compilation is required.+RUN apk add --no-cache libc6-compat curl bash python3 make g++RUN corepack enable pnpm-COPY pnpm-lock.yaml pnpm-workspace.yaml package.json ./+COPY .npmrc pnpm-lock.yaml pnpm-workspace.yaml package.json ./COPY patches ./patches+COPY --parents ./apps/*/package.json ./packages/*/package.json ./tooling/*/package.json ./+# @homarr/definitions generates documentation types during install.+COPY --parents ./packages/definitions/src ./# Workaround for pnpm/pnpm#5268: pnpm fetch crashes when patchedDependencies# are configured with nodeLinker: hoisted. The applyPatchToDir function tries# to chdir into node_modules/<pkg> which doesn't exist during fetch (only the@@ -19,14 +25,16 @@ COPY patches ./patchesRUN --mount=type=cache,id=pnpm-store,target=/pnpm/store \pnpm config set store-dir /pnpm/store && \sed -i 's/nodeLinker: hoisted/nodeLinker: isolated/' pnpm-workspace.yaml && \- pnpm fetch && \+ pnpm fetch --ignore-scripts && \sed -i 's/nodeLinker: isolated/nodeLinker: hoisted/' pnpm-workspace.yaml-COPY . .-# Follow the pnpm fetch pattern from https://pnpm.io/cli/fetch-# --frozen-lockfile is omitted as recommended by the pnpm fetch docs+# Install only from the fetched, committed lockfile so local and Docker builds+# resolve the same dependency graph. Serial lifecycle builds avoid esbuild's+# atomic binary replacement racing across the hoisted workspace (pnpm/pnpm#8200).RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store \- pnpm install --recursive+ npm_config_nodedir=/usr/local pnpm install --recursive --offline --frozen-lockfile --child-concurrency=1++COPY . .ARG SKIP_ENV_VALIDATION='true'ARG CI='true'@@ -37,7 +45,9 @@ RUN --mount=type=secret,id=TURBO_API,env=TURBO_API \--mount=type=secret,id=TURBO_TEAM,env=TURBO_TEAM \--mount=type=secret,id=TURBO_TOKEN,env=TURBO_TOKEN \--mount=type=secret,id=TURBO_REMOTE_CACHE_SIGNATURE_KEY,env=TURBO_REMOTE_CACHE_SIGNATURE_KEY \- TURBO_PLATFORM="${TARGETPLATFORM:-linux/amd64}" pnpm build+ --mount=type=cache,id=homarr-next-build-${TARGETPLATFORM},target=/app/apps/nextjs/.next/cache,sharing=locked \+ TURBO_PLATFORM="${TARGETPLATFORM:-linux/amd64}" \+ pnpm turbo build --filter=@homarr/nextjs... --filter=@homarr/cliFROM base AS runnerWORKDIR /appdiff --git a/apps/docs/docs/advanced/development/getting-started.mdx b/apps/docs/docs/advanced/development/getting-started.mdxindex e8f68ea6d..1bad7be05 100644--- a/apps/docs/docs/advanced/development/getting-started.mdx+++ b/apps/docs/docs/advanced/development/getting-started.mdx@@ -14,8 +14,8 @@ This guide will help you set up your development environment to start contributi### Prerequisites-- **Node.js (lts)**: You can download it from the [official website](https://nodejs.org/).-- **pnpm (latest)**: You can install it by running `npm install -g pnpm`.+- **Node.js 24.18 or newer**: You can download it from the [official website](https://nodejs.org/).+- **Corepack**: Run `corepack enable` so the repository selects its pinned pnpm version.- **Git**: You can download it from the [official website](https://git-scm.com/).- **Docker or Docker Desktop**: Required for the Redis service and the developer Docker CLI.- **Go 1.25+**: Required only for the developer Docker CLI. You can download it from the [official website](https://go.dev/).@@ -49,7 +49,10 @@ This guide will help you set up your development environment to start contributi#### During development-- `pnpm dev`: Start the development server.+- `pnpm dev`: Start the Next.js development server.+- `pnpm dev:benchmark`: Run the local authenticated-board benchmark. Set `DEV_BENCHMARK_BOARD_URL` and+ `DEV_BENCHMARK_STORAGE_STATE`; readiness-only measurements require the explicit `--smoke` flag and are not+ suitable for performance claims.- `pnpm dev:cli -- dev`: Browse and run local images and remote pull-request images.- `pnpm dev:cli -- build <name>`: Build the current checkout as `homarr:<name>`.- `pnpm dev:cli -- build --pr <number>`: Build a pull request locally from a temporary checkout.@@ -74,4 +77,5 @@ This guide will help you set up your development environment to start contributi- `pnpm build`: Build the project for production.- `pnpm dev:cli -- build <name>`: Build a `homarr:<name>` image and record its checkout for later rebuilds.+- `docker build -t homarr .`: Build a docker image for the project.- `docker run -p 7575:7575 -e SECRET_ENCRYPTION_KEY='your_64_character_hex_string' homarr:<name>`: Run the created docker image.diff --git a/apps/docs/docs/advanced/environment-variables/index.mdx b/apps/docs/docs/advanced/environment-variables/index.mdxindex ad249e734..e7dc6960d 100644--- a/apps/docs/docs/advanced/environment-variables/index.mdx+++ b/apps/docs/docs/advanced/environment-variables/index.mdx@@ -25,15 +25,13 @@ This is especially useful for [docker secrets](https://docs.docker.com/engine/swUsing the `PUID` and `PGID` will require you to set the correct permissions on the mounted volumes and if used the docker socket. See more in the [Running as a different user](/docs/advanced/running-as-different-user) documentation.:::-| Environment Variable | Description | Possible values | Default |-| ------------------------ | ----------- | --------------- | ------- |-| ``PUID`` | User ID to run the container as | Any valid user ID | ``0`` |-| ``PGID`` | Group ID to run the container as | Any valid group ID | ``0`` |-| ``LOG_LEVEL`` | Log level to use | ``debug`` / ``info`` / ``warn`` / ``error`` | ``info`` |-| ``NO_EXTERNAL_CONNECTION`` | Disables some requests that need internet connection | `true` or `false` | `false` |-| ``ENABLE_DNS_CACHING`` | Enables dns caching. Enabled by default, but if you experience issues with IPv6 or static IPs, see [#4006](https://github.com/homarr-labs/homarr/issues/4006) or disable this flag | `true` or `false` | `true` |--+| Environment Variable | Description | Possible values | Default |+| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | ------- |+| `PUID` | User ID to run the container as | Any valid user ID | `0` |+| `PGID` | Group ID to run the container as | Any valid group ID | `0` |+| `LOG_LEVEL` | Log level to use | `debug` / `info` / `warn` / `error` | `info` |+| `NO_EXTERNAL_CONNECTION` | Disables Homarr's internet-backed requests, including update checks, weather, and RSS feeds | `true` or `false` | `false` |+| `ENABLE_DNS_CACHING` | Enables dns caching. Enabled by default, but if you experience issues with IPv6 or static IPs, see [#4006](https://github.com/homarr-labs/homarr/issues/4006) or disable this flag | `true` or `false` | `true` |## Authentication@@ -43,9 +41,9 @@ See [Single Sign-On](/docs/advanced/single-sign-on) for more informations.The `SECRET_ENCRYPTION_KEY` is required. If none is specified before starting the container, a random key will be shown in the error message and the container will exit.-| Environment Variable | Description | Possible values | Default |-| ------------------------ | ----------- | --------------- | ------- |-| ``SECRET_ENCRYPTION_KEY`` | Secret used to encrypt secrets in database. | 64 character hex string | - |+| Environment Variable | Description | Possible values | Default |+| ----------------------- | ------------------------------------------- | ----------------------- | ------- |+| `SECRET_ENCRYPTION_KEY` | Secret used to encrypt secrets in database. | 64 character hex string | - |:::infoA random secret can be generated by using the following command: `openssl rand -hex 32`@@ -53,26 +51,26 @@ A random secret can be generated by using the following command: `openssl rand -## Docker-| Environment Variable | Description | Possible values | Default |-| ------------------------ | ----------- | --------------- | ------- |-| ``DOCKER_HOSTNAMES`` | Comma-separated list of hostnames to connect to | For example `localhost,docker.example.com` | - |-| ``DOCKER_PORTS`` | Comma-separated list of ports to connect to | For example `2375,2376` | - |-| ``DOCKER_SOCKET_PATHS`` | Comma-separated list of mounted Docker-compatible socket paths. See the [Docker and Podman integration guide](/docs/integrations/docker) | For example `/var/run/docker.sock,/var/run/podman.sock` | - |+| Environment Variable | Description | Possible values | Default |+| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | ------- |+| `DOCKER_HOSTNAMES` | Comma-separated list of hostnames to connect to | For example `localhost,docker.example.com` | - |+| `DOCKER_PORTS` | Comma-separated list of ports to connect to | For example `2375,2376` | - |+| `DOCKER_SOCKET_PATHS` | Comma-separated list of mounted Docker-compatible socket paths. See the [Docker and Podman integration guide](/docs/integrations/docker) | For example `/var/run/docker.sock,/var/run/podman.sock` | - |## Database-| Environment Variable | Description | Possible values | Default |-| ------------------------ | ----------- | --------------- | ------- |-| ``DB_DRIVER`` | Database driver to use. Currently `better-sqlite3` is used for sqlite, `mysql2` for mysql and `node-postgres` for postgresql | ``better-sqlite3`` / ``mysql2`` / ``node-postgres`` | ``better-sqlite3`` |-| ``DB_DIALECT`` | Database dialect to use. | ``sqlite`` / ``mysql`` / ``postgresql`` | ``sqlite`` |-| ``DB_URL`` | Database URL to connect to. | Any valid database URL | ``/appdata/db/db.sqlite`` |-| ``DB_HOST`` | Database host to connect to. | Any valid database host | - |-| ``DB_PORT`` | Database port to connect to. | Any valid database port | - |-| ``DB_NAME`` | Database name to connect to. | Any valid database name | - |-| ``DB_USER`` | Database user to connect with. | Any valid database user | - |-| ``DB_PASSWORD`` | Database password to connect with. | Any valid database password | - |-You can either use the url or host, port, name and credentials combined. The URL will be prioritized over the other values.+| Environment Variable | Description | Possible values | Default |+| -------------------- | ---------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | ----------------------- |+| `DB_DRIVER` | Database driver to use. Currently `better-sqlite3` is used for sqlite, `mysql2` for mysql and `node-postgres` for postgresql | `better-sqlite3` / `mysql2` / `node-postgres` | `better-sqlite3` |+| `DB_DIALECT` | Database dialect to use. | `sqlite` / `mysql` / `postgresql` | `sqlite` |+| `DB_URL` | Database URL to connect to. | Any valid database URL | `/appdata/db/db.sqlite` |+| `DB_HOST` | Database host to connect to. | Any valid database host | - |+| `DB_PORT` | Database port to connect to. | Any valid database port | - |+| `DB_NAME` | Database name to connect to. | Any valid database name | - |+| `DB_USER` | Database user to connect with. | Any valid database user | - |+| `DB_PASSWORD` | Database password to connect with. | Any valid database password | - |+You can either use the url or host, port, name and credentials combined. The URL will be prioritized over the other values.## Redis@@ -83,25 +81,23 @@ However for example for K8s it can be useful to use an external Redis instance.External redis is currently not supported with Proxmox Community Scripts:::-| Environment Variable | Description | Possible values | Default |-| ------------------------ | ----------- | --------------- | ------- |-| `REDIS_IS_EXTERNAL` | Whether Redis is running externally. | `true` / `false` | `false` |-| `REDIS_HOST` | Hostname of the Redis instance. | Any valid hostname | - |-| `REDIS_PORT` | Port of the Redis instance. | Any valid port | `6379` |-| `REDIS_USERNAME` | Username to connect to the Redis instance. | Any valid username | - |-| `REDIS_PASSWORD` | Password to connect to the Redis instance. | Any valid password | - |-| `REDIS_DATABASE_INDEX` | Select which database of your redis instance should be used. | Any numeric index | - |-| `REDIS_TLS_CA` | CA certificate for Redis TLS connections. If a certificate is specified the connection will use TLS. | Any valid CA certificate | - |-+| Environment Variable | Description | Possible values | Default |+| ---------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------ | ------- |+| `REDIS_IS_EXTERNAL` | Whether Redis is running externally. | `true` / `false` | `false` |+| `REDIS_HOST` | Hostname of the Redis instance. | Any valid hostname | - |+| `REDIS_PORT` | Port of the Redis instance. | Any valid port | `6379` |+| `REDIS_USERNAME` | Username to connect to the Redis instance. | Any valid username | - |+| `REDIS_PASSWORD` | Password to connect to the Redis instance. | Any valid password | - |+| `REDIS_DATABASE_INDEX` | Select which database of your redis instance should be used. | Any numeric index | - |+| `REDIS_TLS_CA` | CA certificate for Redis TLS connections. If a certificate is specified the connection will use TLS. | Any valid CA certificate | - |## Proxy-| Environment Variable | Description | Possible values | Default |-| ------------------------ | ----------- | --------------- | ------- |-| ``HTTP_PROXY`` | HTTP proxy to use | Any valid HTTP proxy URL | - |-| ``HTTPS_PROXY`` | HTTPS proxy to use | Any valid HTTPS proxy URL | - |-| ``NO_PROXY`` | Comma separated list of hosts that should be excluded from proxying | Any valid hostnames | - |-+| Environment Variable | Description | Possible values | Default |+| -------------------- | ------------------------------------------------------------------- | ------------------------- | ------- |+| `HTTP_PROXY` | HTTP proxy to use | Any valid HTTP proxy URL | - |+| `HTTPS_PROXY` | HTTPS proxy to use | Any valid HTTPS proxy URL | - |+| `NO_PROXY` | Comma separated list of hosts that should be excluded from proxying | Any valid hostnames | - |## Advanced deployments@@ -109,6 +105,6 @@ External redis is currently not supported with Proxmox Community ScriptsThe advanced deployments environment variables should only be used if you know what you are doing.:::-| Environment Variable | Description |-| ------------------------ | ----------- |-| ``DB_MIGRATIONS_DISABLED`` | Disable db migrations. For example for helm charts |+| Environment Variable | Description |+| ------------------------ | -------------------------------------------------- |+| `DB_MIGRATIONS_DISABLED` | Disable db migrations. For example for helm charts |diff --git a/apps/nextjs/next.config.ts b/apps/nextjs/next.config.tsindex 4ff31b9aa..2105259be 100644--- a/apps/nextjs/next.config.ts+++ b/apps/nextjs/next.config.ts@@ -1,4 +1,6 @@// Importing env files here to validate on build+import path from "node:path";+import "@homarr/auth/env";import "@homarr/core/infrastructure/db/env";import "@homarr/common/env";@@ -13,7 +15,21 @@ const withNextIntl = createNextIntlPlugin({requestConfig: "../../packages/translation/src/request.ts",});+const getDevelopmentServiceAliases = () => {+ if (process.env.NODE_ENV !== "development") {+ return undefined;+ }++ return {+ "@homarr/tasks": "./src/instrumentation-noop.ts",+ "@homarr/websocket": "./src/instrumentation-noop.ts",+ };+};+const nextConfig: NextConfig = {+ // Next previews otherwise create agent instruction files in the application+ // directory during development.+ agentRules: false,env: {HOMARR_VERSION: process.env.HOMARR_VERSION ?? "unknown",},@@ -30,19 +46,14 @@ const nextConfig: NextConfig = {serverExternalPackages: ["dockerode", "isomorphic-dompurify", "jsdom", "better-sqlite3"],experimental: {optimizePackageImports: ["@mantine/core", "@mantine/hooks", "@tabler/icons-react"],- turbopackFileSystemCacheForDev: true,- webpackMemoryOptimizations: true,+ turbopackFileSystemCacheForBuild: true,+ useTypeScriptCli: true,},turbopack: {- // ponytail: known Turbopack NFT warning from path.join(process.cwd(), …) in- // src/app/api/backup/{route,shared}.ts. No working placement in 16.2.x- // (see vercel/next.js#95125). Suppress until upstream fix lands.- ignoreIssue: [- {- path: "**/*",- title: "Encountered unexpected file in NFT list",- },- ],+ root: path.resolve(import.meta.dirname, "../.."),+ // Development runs tasks and WebSocket as separate processes. These aliases+ // keep their production-only instrumentation imports out of the dev graph.+ resolveAlias: getDevelopmentServiceAliases(),},transpilePackages: ["@homarr/ui", "@homarr/notifications", "@homarr/modals", "@homarr/spotlight", "@homarr/widgets"],images: {diff --git a/apps/nextjs/package.json b/apps/nextjs/package.jsonindex 4a3e0dd3e..3c33a1545 100644--- a/apps/nextjs/package.json+++ b/apps/nextjs/package.json@@ -59,11 +59,10 @@"@modelcontextprotocol/sdk": "catalog:","@scalar/api-reference-react": "catalog:","@tabler/icons-react": "catalog:",- "@tanstack/query-async-storage-persister": "catalog:",+ "@tanstack/react-devtools": "catalog:","@tanstack/react-query": "catalog:","@tanstack/react-query-devtools": "catalog:","@tanstack/react-query-next-experimental": "catalog:",- "@tanstack/react-query-persist-client": "catalog:","@trpc/client": "catalog:","@trpc/next": "catalog:","@trpc/react-query": "catalog:",diff --git a/apps/nextjs/src/app/[locale]/_client-providers/development-tools.tsx b/apps/nextjs/src/app/[locale]/_client-providers/development-tools.tsxnew file mode 100644index 000000000..a23164547--- /dev/null+++ b/apps/nextjs/src/app/[locale]/_client-providers/development-tools.tsx@@ -0,0 +1,120 @@+"use client";++import { useEffect, useState } from "react";+import { usePathname } from "next/navigation";+import { TanStackDevtools } from "@tanstack/react-devtools";+import type { TanStackDevtoolsReactPlugin } from "@tanstack/react-devtools";+import type { QueryClient } from "@tanstack/react-query";+import { useQueryClient } from "@tanstack/react-query";+import { ReactQueryDevtoolsPanel } from "@tanstack/react-query-devtools";++const valueStyle = { fontFamily: "monospace", overflowWrap: "anywhere" } as const;+const metricStyle = {+ background: "color-mix(in srgb, currentColor 4%, transparent)",+ border: "1px solid color-mix(in srgb, currentColor 18%, transparent)",+ borderRadius: 8,+ padding: 12,+} as const;++const readDiagnostics = (queryClient: QueryClient) => {+ const queries = queryClient.getQueryCache().getAll();+ const mutations = queryClient.getMutationCache().getAll();+ const board = document.querySelector("[data-homarr-dev-benchmark-board]");+ const widgetItems = board?.querySelectorAll('[data-type="item"]').length ?? 0;+ const readyWidgets = board?.querySelectorAll("[data-homarr-widget-ready]").length ?? 0;+ const resources = performance.getEntriesByType("resource") as PerformanceResourceTiming[];++ return {+ active: queries.filter((query) => query.getObserversCount() > 0).length,+ errors: queries.filter((query) => query.state.status === "error").length,+ fetching: queries.filter((query) => query.state.fetchStatus === "fetching").length,+ pendingMutations: mutations.filter((mutation) => mutation.state.status === "pending").length,+ stale: queries.filter((query) => query.isStale()).length,+ total: queries.length,+ readyWidgets,+ widgetItems,+ scriptKiB: Math.round(+ resources+ .filter((resource) => resource.initiatorType === "script")+ .reduce((total, resource) => total + resource.decodedBodySize, 0) / 1024,+ ),+ };+};++const Metric = ({ label, value }: { label: string; value: number | string }) => (+ <div style={metricStyle}>+ <div style={{ fontSize: 12, opacity: 0.7 }}>{label}</div>+ <output style={{ ...valueStyle, display: "block", fontSize: 22, fontWeight: 600, marginTop: 4 }}>{value}</output>+ </div>+);++const HomarrDevtoolsPanel = ({ active }: { active: boolean }) => {+ const pathname = usePathname();+ const queryClient = useQueryClient();+ const [diagnostics, setDiagnostics] = useState(() => readDiagnostics(queryClient));++ useEffect(() => {+ if (!active) return;++ const update = () => setDiagnostics(readDiagnostics(queryClient));+ let frame: number | undefined;+ const scheduleUpdate = () => {+ if (frame !== undefined) return;+ frame = window.requestAnimationFrame(() => {+ frame = undefined;+ update();+ });+ };+ const unsubscribeQueries = queryClient.getQueryCache().subscribe(scheduleUpdate);+ const unsubscribeMutations = queryClient.getMutationCache().subscribe(scheduleUpdate);+ const observer = new MutationObserver(scheduleUpdate);+ observer.observe(document.body, { childList: true, subtree: true });+ update();++ return () => {+ unsubscribeQueries();+ unsubscribeMutations();+ observer.disconnect();+ if (frame !== undefined) window.cancelAnimationFrame(frame);+ };+ }, [active, pathname, queryClient]);++ if (!active) return null;++ return (+ <section data-homarr-devtools-panel style={{ fontFamily: "system-ui, sans-serif", padding: 16 }}>+ <header style={{ marginBottom: 16 }}>+ <h2 style={{ margin: 0 }}>Homarr performance</h2>+ <p style={{ marginBlock: "4px 0", opacity: 0.7 }}>Live state for {pathname}</p>+ </header>+ <div style={{ display: "grid", gap: 8, gridTemplateColumns: "repeat(auto-fit, minmax(110px, 1fr))" }}>+ <Metric label="Queries" value={diagnostics.total} />+ <Metric label="Active" value={diagnostics.active} />+ <Metric label="Fetching" value={diagnostics.fetching} />+ <Metric label="Stale" value={diagnostics.stale} />+ <Metric label="Errors" value={diagnostics.errors} />+ <Metric label="Mutations" value={diagnostics.pendingMutations} />+ <Metric label="Widgets ready" value={`${diagnostics.readyWidgets}/${diagnostics.widgetItems}`} />+ <Metric label="Script KiB" value={diagnostics.scriptKiB} />+ </div>+ </section>+ );+};++const developmentToolsPlugins = [+ {+ id: "tanstack-query",+ name: "TanStack Query",+ render: () => <ReactQueryDevtoolsPanel />,+ },+ {+ id: "homarr-performance",+ name: "Homarr",+ defaultOpen: true,+ render: (_element, { devtoolsOpen }) => <HomarrDevtoolsPanel active={devtoolsOpen} />,+ },+] satisfies TanStackDevtoolsReactPlugin[];++export const DevelopmentTools = () => (+ <TanStackDevtools config={{ position: "bottom-right", hideUntilHover: true }} plugins={developmentToolsPlugins} />+);diff --git a/apps/nextjs/src/app/[locale]/_client-providers/query-cache-persister.ts b/apps/nextjs/src/app/[locale]/_client-providers/query-cache-persister.tsdeleted file mode 100644index 3af24c508..000000000--- a/apps/nextjs/src/app/[locale]/_client-providers/query-cache-persister.ts+++ /dev/null@@ -1,32 +0,0 @@-import { createAsyncStoragePersister } from "@tanstack/query-async-storage-persister";-import superjson from "superjson";--import { fetchApi } from "@homarr/api/client";-import { getActiveQueryCacheBoardId, queryCacheStoragePrefix } from "@homarr/api/query-cache";--const queryCacheStorage = {- getItem: (_key: string) => null as string | null,- async setItem(_key: string, value: string) {- const boardId = getActiveQueryCacheBoardId();- if (!boardId) return;- await fetchApi.queryCache.setItem.mutate({ boardId, value }).catch((error) => {- console.warn("[query-cache] persist failed", error);- });- },- async removeItem(_key: string) {- const boardId = getActiveQueryCacheBoardId();- if (!boardId) return;- await fetchApi.queryCache.removeItem.mutate({ boardId }).catch((error) => {- console.warn("[query-cache] remove failed", error);- });- },-};--export const createWidgetQueryPersister = () =>- createAsyncStoragePersister({- storage: typeof window === "undefined" ? undefined : queryCacheStorage,- key: queryCacheStoragePrefix,- throttleTime: 2000,- serialize: (data) => superjson.stringify(data),- deserialize: (data) => superjson.parse(data),- });diff --git a/apps/nextjs/src/app/[locale]/_client-providers/query-retry.spec.ts b/apps/nextjs/src/app/[locale]/_client-providers/query-retry.spec.tsnew file mode 100644index 000000000..77aa7c918--- /dev/null+++ b/apps/nextjs/src/app/[locale]/_client-providers/query-retry.spec.ts@@ -0,0 +1,27 @@+import { describe, expect, it } from "vitest";+import { TRPCClientError } from "@trpc/client";++import { createQueryRetry } from "./query-retry";++const createTrpcError = (code: string) => {+ const error = Object.assign(new Error(code), { data: { code } });+ Object.setPrototypeOf(error, TRPCClientError.prototype);+ return error;+};++describe("createQueryRetry", () => {+ it.each(["BAD_REQUEST", "UNAUTHORIZED", "FORBIDDEN", "NOT_FOUND", "UNPROCESSABLE_CONTENT"])(+ "does not retry the permanent %s response",+ (code) => {+ expect(createQueryRetry(3)(0, createTrpcError(code))).toBe(false);+ },+ );++ it("retries transient and network failures only up to the configured limit", () => {+ const retry = createQueryRetry(3);++ expect(retry(0, createTrpcError("INTERNAL_SERVER_ERROR"))).toBe(true);+ expect(retry(2, new Error("connection reset"))).toBe(true);+ expect(retry(3, new Error("connection reset"))).toBe(false);+ });+});diff --git a/apps/nextjs/src/app/[locale]/_client-providers/query-retry.ts b/apps/nextjs/src/app/[locale]/_client-providers/query-retry.tsnew file mode 100644index 000000000..09b5f19c3--- /dev/null+++ b/apps/nextjs/src/app/[locale]/_client-providers/query-retry.ts@@ -0,0 +1,20 @@+import { TRPCClientError } from "@trpc/client";++const nonRetryableTrpcCodes = new Set([+ "PARSE_ERROR",+ "BAD_REQUEST",+ "UNAUTHORIZED",+ "FORBIDDEN",+ "NOT_FOUND",+ "METHOD_NOT_SUPPORTED",+ "CONFLICT",+ "PRECONDITION_FAILED",+ "PAYLOAD_TOO_LARGE",+ "UNPROCESSABLE_CONTENT",+]);++export const createQueryRetry = (maxRetries: number) => (failureCount: number, error: unknown) => {+ if (failureCount >= maxRetries) return false;+ if (error instanceof TRPCClientError && error.data?.code && nonRetryableTrpcCodes.has(error.data.code)) return false;+ return true;+};diff --git a/apps/nextjs/src/app/[locale]/_client-providers/session-query-scope.spec.ts b/apps/nextjs/src/app/[locale]/_client-providers/session-query-scope.spec.tsnew file mode 100644index 000000000..f82001a5e--- /dev/null+++ b/apps/nextjs/src/app/[locale]/_client-providers/session-query-scope.spec.ts@@ -0,0 +1,52 @@+// @vitest-environment jsdom++import { act, createElement } from "react";+import { createRoot } from "react-dom/client";+import { describe, expect, it, vi } from "vitest";++import { getSessionQueryScope, SessionQueryScopeGuard } from "./session-query-scope";++describe("getSessionQueryScope", () => {+ it("is stable when permission order changes", () => {+ expect(getSessionQueryScope({ user: { id: "user-a", permissions: ["board-view", "integration-use"] } })).toBe(+ getSessionQueryScope({ user: { id: "user-a", permissions: ["integration-use", "board-view"] } }),+ );+ });++ it("changes for a different user or permission set", () => {+ const original = getSessionQueryScope({ user: { id: "user-a", permissions: ["board-view"] } });++ expect(getSessionQueryScope({ user: { id: "user-b", permissions: ["board-view"] } })).not.toBe(original);+ expect(getSessionQueryScope({ user: { id: "user-a", permissions: [] } })).not.toBe(original);+ expect(getSessionQueryScope(null)).toBeNull();+ });++ it("removes the previous session subtree before requesting a document reload", async () => {+ const host = document.createElement("div");+ const root = createRoot(host);+ const onScopeChange = vi.fn();+ const renderScope = async (currentScope: string) => {+ await act(async () => {+ root.render(+ createElement(+ SessionQueryScopeGuard,+ { currentScope, initialScope: "a", onScopeChange },+ createElement("span", null, "session-a-secret"),+ ),+ );+ });+ };++ try {+ await renderScope("a");+ expect(host.textContent).toBe("session-a-secret");++ await renderScope("b");+ expect(host.textContent).not.toContain("session-a-secret");+ expect(host.querySelector('[role="status"]')?.getAttribute("aria-busy")).toBe("true");+ expect(onScopeChange).toHaveBeenCalledOnce();+ } finally {+ await act(async () => root.unmount());+ }+ });+});diff --git a/apps/nextjs/src/app/[locale]/_client-providers/session-query-scope.ts b/apps/nextjs/src/app/[locale]/_client-providers/session-query-scope.tsnew file mode 100644index 000000000..d2fa1e732--- /dev/null+++ b/apps/nextjs/src/app/[locale]/_client-providers/session-query-scope.ts@@ -0,0 +1,39 @@+import type { PropsWithChildren } from "react";+import { createElement, useEffect } from "react";++interface QuerySession {+ user: {+ id: string;+ permissions: string[];+ };+}++export const getSessionQueryScope = (session: QuerySession | null | undefined) =>+ session ? JSON.stringify([session.user.id, session.user.permissions.toSorted()]) : null;++interface SessionQueryScopeGuardProps {+ initialScope: string | null;+ currentScope: string | null;+ onScopeChange: () => void;+}++export const SessionQueryScopeGuard = ({+ initialScope,+ currentScope,+ onScopeChange,+ children,+}: PropsWithChildren<SessionQueryScopeGuardProps>) => {+ const hasScopeChanged = initialScope !== currentScope;+ useEffect(() => {+ if (hasScopeChanged) onScopeChange();+ }, [hasScopeChanged, onScopeChange]);++ if (!hasScopeChanged) return children;++ return createElement("div", {+ "aria-busy": true,+ "aria-label": "Refreshing session",+ role: "status",+ style: { minHeight: "100dvh" },+ });+};diff --git a/apps/nextjs/src/app/[locale]/_client-providers/trpc.tsx b/apps/nextjs/src/app/[locale]/_client-providers/trpc.tsxindex 3e167dd8c..535d88e1c 100644--- a/apps/nextjs/src/app/[locale]/_client-providers/trpc.tsx+++ b/apps/nextjs/src/app/[locale]/_client-providers/trpc.tsx@@ -1,12 +1,10 @@"use client";import type { PropsWithChildren } from "react";-import { useState } from "react";-import type { QueryKey } from "@tanstack/react-query";-import { QueryClient } from "@tanstack/react-query";-import { ReactQueryDevtools } from "@tanstack/react-query-devtools";+import { useEffect, useMemo, useState } from "react";+import dynamic from "next/dynamic";+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";import { ReactQueryStreamedHydration } from "@tanstack/react-query-next-experimental";-import { PersistQueryClientProvider } from "@tanstack/react-query-persist-client";import {createWSClient,httpBatchStreamLink,@@ -25,18 +23,24 @@ import { TRPCClientError } from "@trpc/client";import type { AppRouter } from "@homarr/api";import { clientApi } from "@homarr/api/client";import {- isPersistableWidgetQueryKey,- queryCacheBuster,+ dashboardSupportingQueryPolicies,queryCacheDefaultGcTimeMs,queryCacheDefaultRefetchIntervalMs,queryCacheDefaultStaleTimeMs,} from "@homarr/api/query-cache";import { createHeadersCallbackForSource, getTrpcUrl } from "@homarr/api/shared";+import { useSession } from "@homarr/auth/client";import { env } from "@homarr/common/env";import { showWarningNotification } from "@homarr/notifications";-import { widgetImports } from "@homarr/widgets";+import { widgetQueryRefetchIntervals } from "@homarr/widgets/refetch-intervals";-import { createWidgetQueryPersister } from "./query-cache-persister";+import { getSessionQueryScope, SessionQueryScopeGuard } from "./session-query-scope";+import { createQueryRetry } from "./query-retry";++const DevelopmentTools =+ process.env.NODE_ENV === "development"+ ? dynamic(() => import("./development-tools").then(({ DevelopmentTools: Tools }) => Tools), { ssr: false })+ : () => null;const getWebSocketProtocol = () => {if (typeof window === "undefined") {@@ -59,21 +63,46 @@ const constructWebsocketUrl = () => {return `${getWebSocketProtocol()}://${window.location.hostname}:${window.location.port}/websockets`;};-const wsClient = createWSClient({- url: constructWebsocketUrl(),-});+export function TRPCReactProvider({ children }: PropsWithChildren) {+ const { data: session } = useSession();+ const sessionQueryScope = getSessionQueryScope(session);+ const [initialSessionQueryScope] = useState(() => sessionQueryScope);++ return (+ <SessionQueryScopeGuard+ initialScope={initialSessionQueryScope}+ currentScope={sessionQueryScope}+ onScopeChange={reloadPage}+ >+ <ScopedTRPCReactProvider>{children}</ScopedTRPCReactProvider>+ </SessionQueryScopeGuard>+ );+}++const reloadPage = () => window.location.reload();-export function TRPCReactProvider(props: PropsWithChildren) {- const [persister] = useState(() => createWidgetQueryPersister());+const ScopedTRPCReactProvider = ({ children }: PropsWithChildren) => {+ const wsClient = useMemo(+ () =>+ createWSClient({+ url: constructWebsocketUrl(),+ lazy: { enabled: true, closeMs: 30_000 },+ }),+ [],+ );+ useEffect(+ () => () => {+ void wsClient.close();+ },+ [wsClient],+ );const [queryClient] = useState(() => {const client = new QueryClient({defaultOptions: {queries: {staleTime: queryCacheDefaultStaleTimeMs,gcTime: queryCacheDefaultGcTimeMs,- refetchOnWindowFocus: false,- refetchOnReconnect: false,- retry: 3,+ retry: createQueryRetry(env.NODE_ENV === "development" ? 1 : 3),},mutations: {onError(error) {@@ -91,23 +120,29 @@ export function TRPCReactProvider(props: PropsWithChildren) {},},});- client.setQueryDefaults([["widget"]], { refetchInterval: queryCacheDefaultRefetchIntervalMs });- for (const { definition } of Object.values(widgetImports)) {- const def = definition as { refetchInterval?: number | null; queryKey?: QueryKey; kind: string };- if (def.refetchInterval === undefined) continue;- const key = def.queryKey ?? [["widget", def.kind]];- const interval = def.refetchInterval === null ? false : def.refetchInterval * 1000;- client.setQueryDefaults(key, { refetchInterval: interval });+ client.setQueryDefaults([["widget"]], {+ refetchInterval: queryCacheDefaultRefetchIntervalMs,+ refetchOnWindowFocus: false,+ refetchOnReconnect: false,+ });+ for (const { queryKey, intervalSeconds } of widgetQueryRefetchIntervals) {+ client.setQueryDefaults(queryKey, {+ refetchInterval: intervalSeconds === null ? false : intervalSeconds * 1000,+ });+ }+ for (const { queryKey, ...policy } of dashboardSupportingQueryPolicies) {+ client.setQueryDefaults(queryKey, policy);}return client;});- const [trpcClient] = useState(() => {+ useEffect(() => () => queryClient.clear(), [queryClient]);++ const trpcClient = useMemo(() => {return clientApi.createClient({links: [loggerLink({- enabled: (opts) =>- env.NODE_ENV === "development" || (opts.direction === "down" && opts.result instanceof Error),+ enabled: (opts) => opts.direction === "down" && opts.result instanceof Error,}),splitLink({condition: ({ type }) => type === "subscription",@@ -147,25 +182,14 @@ export function TRPCReactProvider(props: PropsWithChildren) {}),],});- });+ }, [wsClient]);return (<clientApi.Provider client={trpcClient} queryClient={queryClient}>- <PersistQueryClientProvider- client={queryClient}- persistOptions={{- persister,- buster: queryCacheBuster,- maxAge: queryCacheDefaultGcTimeMs,- dehydrateOptions: {- shouldDehydrateQuery: (query) =>- query.state.status === "success" && isPersistableWidgetQueryKey(query.queryKey),- },- }}- >- <ReactQueryStreamedHydration transformer={superjson}>{props.children}</ReactQueryStreamedHydration>- <ReactQueryDevtools initialIsOpen={false} />- </PersistQueryClientProvider>+ <QueryClientProvider client={queryClient}>+ <ReactQueryStreamedHydration transformer={superjson}>{children}</ReactQueryStreamedHydration>+ {process.env.NODE_ENV === "development" && <DevelopmentTools />}+ </QueryClientProvider></clientApi.Provider>);-}+};diff --git a/apps/nextjs/src/app/[locale]/boards/(content)/(home)/_definition.ts b/apps/nextjs/src/app/[locale]/boards/(content)/(home)/_definition.tsindex 2357d7424..d64fdb56e 100644--- a/apps/nextjs/src/app/[locale]/boards/(content)/(home)/_definition.ts+++ b/apps/nextjs/src/app/[locale]/boards/(content)/(home)/_definition.ts@@ -1,9 +1,9 @@-import { api } from "@homarr/api/server";+import { getHomeBoardAsync } from "@homarr/api/board-server";import { createBoardContentPage } from "../_creator";export default createBoardContentPage<{ locale: string }>({async getInitialBoardAsync() {- return await api.board.getHomeBoard();+ return await getHomeBoardAsync();},});diff --git a/apps/nextjs/src/app/[locale]/boards/(content)/[name]/(board)/_definition.tsx b/apps/nextjs/src/app/[locale]/boards/(content)/[name]/(board)/_definition.tsxindex d3b65a5e9..f0924bb6e 100644--- a/apps/nextjs/src/app/[locale]/boards/(content)/[name]/(board)/_definition.tsx+++ b/apps/nextjs/src/app/[locale]/boards/(content)/[name]/(board)/_definition.tsx@@ -1,9 +1,9 @@-import { api } from "@homarr/api/server";+import { getBoardByNameAsync } from "@homarr/api/board-server";import { createBoardContentPage } from "../../_creator";export default createBoardContentPage<{ locale: string; name: string }>({async getInitialBoardAsync({ name }) {- return await api.board.getBoardByName({ name });+ return await getBoardByNameAsync(name);},});diff --git a/apps/nextjs/src/app/[locale]/boards/(content)/_board-add-menu.tsx b/apps/nextjs/src/app/[locale]/boards/(content)/_board-add-menu.tsxnew file mode 100644index 000000000..e49fefe5e--- /dev/null+++ b/apps/nextjs/src/app/[locale]/boards/(content)/_board-add-menu.tsx@@ -0,0 +1,84 @@+"use client";++import { useCallback } from "react";+import { Group, Menu } from "@mantine/core";+import { IconBox, IconBoxAlignTop, IconChevronDown, IconPlug, IconPlus, IconResize } from "@tabler/icons-react";++import { useSession } from "@homarr/auth/client";+import { useModalAction } from "@homarr/modals";+import { AppSelectModal } from "@homarr/modals-collection";+import { useI18n } from "@homarr/translation/client";++import { useItemActions } from "~/components/board/items/item-actions";+import { ItemSelectModal } from "~/components/board/items/item-select-modal";+import { useCategoryActions } from "~/components/board/sections/category/category-actions";+import { CategoryEditModal } from "~/components/board/sections/category/category-edit-modal";+import { useDynamicSectionActions } from "~/components/board/sections/dynamic/dynamic-actions";+import { IntegrationSelectModal } from "~/components/integration/integration-select-modal";+import { HeaderButton } from "~/components/layout/header/button";++export const BoardAddMenu = () => {+ const { data: session } = useSession();+ const { openModal: openCategoryEditModal } = useModalAction(CategoryEditModal);+ const { openModal: openItemSelectModal } = useModalAction(ItemSelectModal);+ const { openModal: openAppSelectModal } = useModalAction(AppSelectModal);+ const { openModal: openIntegrationSelectModal } = useModalAction(IntegrationSelectModal);+ const { addCategoryToEnd } = useCategoryActions();+ const { addDynamicSection } = useDynamicSectionActions();+ const { createItem } = useItemActions();+ const t = useI18n();++ const handleAddCategory = useCallback(+ () =>+ openCategoryEditModal(+ {+ category: { id: "new", name: "" },+ onSuccess({ name }) {+ addCategoryToEnd({ name });+ },+ submitLabel: t("section.category.create.submit"),+ },+ { title: (translate) => translate("section.category.create.title") },+ ),+ [addCategoryToEnd, openCategoryEditModal, t],+ );++ return (+ <Menu position="bottom-end">+ <Menu.Target>+ <HeaderButton w="auto" px={4}>+ <Group gap={4} wrap="nowrap">+ <IconPlus stroke={1.5} />+ <IconChevronDown color="gray" size={16} />+ </Group>+ </HeaderButton>+ </Menu.Target>+ <Menu.Dropdown style={{ transform: "translate(-3px, 0)" }}>+ <Menu.Item leftSection={<IconResize size={20} />} onClick={() => openItemSelectModal()}>+ {t("item.action.create")}+ </Menu.Item>+ <Menu.Item+ leftSection={<IconBox size={20} />}+ onClick={() =>+ openAppSelectModal({+ onSelect: (app) => createItem({ kind: "app", options: { appId: app.id } }),+ withCreate: session?.user.permissions.includes("app-create") ?? false,+ })+ }+ >+ {t("app.action.add")}+ </Menu.Item>+ <Menu.Item leftSection={<IconPlug size={20} />} onClick={() => openIntegrationSelectModal({})}>+ {t("integration.action.create")}+ </Menu.Item>+ <Menu.Divider />+ <Menu.Item leftSection={<IconBoxAlignTop size={20} />} onClick={handleAddCategory}>+ {t("section.category.action.create")}+ </Menu.Item>+ <Menu.Item leftSection={<IconResize size={20} />} onClick={addDynamicSection}>+ {t("section.dynamic.action.create")}+ </Menu.Item>+ </Menu.Dropdown>+ </Menu>+ );+};diff --git a/apps/nextjs/src/app/[locale]/boards/(content)/_client.tsx b/apps/nextjs/src/app/[locale]/boards/(content)/_client.tsxindex 0ba502a9a..1b4308d38 100644--- a/apps/nextjs/src/app/[locale]/boards/(content)/_client.tsx+++ b/apps/nextjs/src/app/[locale]/boards/(content)/_client.tsx@@ -14,10 +14,10 @@ export const ClientBoard = () => {const fullWidthSortedSections = board.sections.filter((section) => section.kind === "empty" || section.kind === "category")- .sort((sectionA, sectionB) => sectionA.yOffset - sectionB.yOffset);+ .toSorted((sectionA, sectionB) => sectionA.yOffset - sectionB.yOffset);return (- <Box h="100%" pos="relative">+ <Box h="100%" pos="relative" data-homarr-dev-benchmark-board><BoardBackgroundVideo /><Stack h="100%">{fullWidthSortedSections.map((section) =>diff --git a/apps/nextjs/src/app/[locale]/boards/(content)/_creator.tsx b/apps/nextjs/src/app/[locale]/boards/(content)/_creator.tsxindex 16be5c478..2bb868f7d 100644--- a/apps/nextjs/src/app/[locale]/boards/(content)/_creator.tsx+++ b/apps/nextjs/src/app/[locale]/boards/(content)/_creator.tsx@@ -1,15 +1,12 @@import type { Metadata } from "next";-import { Suspense } from "react";+import { cache } from "react";import { TRPCError } from "@trpc/server";// Placed here because gridstack styles are used for board contentimport "~/styles/gridstack.scss";import { dehydrate, HydrationBoundary } from "@tanstack/react-query";-import type { PersistedClient } from "@tanstack/react-query-persist-client";-import superjson from "superjson";-import { queryCacheBuster } from "@homarr/api/query-cache";-import { getQueryClient } from "@homarr/api/server";+import { makeQueryClient } from "@homarr/api/shared";import { IntegrationProvider } from "@homarr/auth/client";import { auth } from "@homarr/auth/next";import { getIntegrationsWithPermissionsAsync } from "@homarr/auth/server";@@ -17,7 +14,6 @@ import { isNullOrWhitespace } from "@homarr/common";import { createLogger } from "@homarr/core/infrastructure/logs";import { ErrorWithMetadata } from "@homarr/core/infrastructure/logs/error";import type { WidgetKind } from "@homarr/definitions";-import { getQueryCacheAsync } from "@homarr/redis";import { getI18n } from "@homarr/translation/server";import { prefetchForKindAsync } from "@homarr/widgets/prefetch";@@ -29,6 +25,7 @@ import { DynamicClientBoard } from "./_dynamic-client";import { BoardContentHeaderActions } from "./_header-actions";const logger = createLogger({ module: "createBoardContentPage" });+const getQueryClient = cache(makeQueryClient);export type Params = Record<string, unknown>;@@ -61,7 +58,6 @@ export const createBoardContentPage = <TParams extends Record<string, unknown>>(}return acc;}, new Map<WidgetKind, Item[]>());-const [integrations] = await Promise.all([getIntegrationsWithPermissionsAsync(session),...Array.from(itemsMap).map(([kind, items]) =>@@ -77,19 +73,12 @@ export const createBoardContentPage = <TParams extends Record<string, unknown>>(),]);- const userId = session?.user.id ?? "anonymous";-return (- <>- <Suspense>- <QueryCacheHydration userId={userId} boardId={board.id} />- </Suspense>- <HydrationBoundary state={dehydrate(queryClient)}>- <IntegrationProvider integrations={integrations}>- <DynamicClientBoard />- </IntegrationProvider>- </HydrationBoundary>- </>+ <HydrationBoundary state={dehydrate(queryClient)}>+ <IntegrationProvider integrations={integrations}>+ <DynamicClientBoard />+ </IntegrationProvider>+ </HydrationBoundary>);},generateMetadataAsync: async ({ params }: { params: Promise<TParams> }): Promise<Metadata> => {@@ -120,19 +109,3 @@ export const createBoardContentPage = <TParams extends Record<string, unknown>>(},};};--async function QueryCacheHydration({ userId, boardId }: { userId: string; boardId: string }) {- try {- const serialized = await getQueryCacheAsync(userId, boardId);- if (!serialized) return null;-- const persisted = superjson.parse<PersistedClient | undefined>(serialized);- if (!persisted || persisted.buster !== queryCacheBuster) return null;- if (!persisted.clientState?.queries?.length) return null;-- return <HydrationBoundary state={persisted.clientState} />;- } catch (error) {- logger.warn(new ErrorWithMetadata("Failed to hydrate query cache", { userId, boardId }, { cause: error }));- return null;- }-}diff --git a/apps/nextjs/src/app/[locale]/boards/(content)/_dynamic-client.tsx b/apps/nextjs/src/app/[locale]/boards/(content)/_dynamic-client.tsxindex 50b0aff66..44d0a77c6 100644--- a/apps/nextjs/src/app/[locale]/boards/(content)/_dynamic-client.tsx+++ b/apps/nextjs/src/app/[locale]/boards/(content)/_dynamic-client.tsx@@ -1,7 +1,24 @@"use client";import dynamic from "next/dynamic";+import { SimpleGrid, Skeleton, Stack } from "@mantine/core";++const BoardLoadingShell = () => (+ <Stack h="100%" p="md" aria-busy aria-label="Loading dashboard" role="status">+ <SimpleGrid cols={{ base: 1, sm: 2, lg: 3 }} spacing="md">+ {[2, 1, 2, 2, 1, 2].map((rows, index) => (+ <Skeleton+ key={index}+ data-homarr-dev-benchmark-board-shell+ height={rows * 96}+ radius="var(--mantine-radius-default)"+ />+ ))}+ </SimpleGrid>+ </Stack>+);export const DynamicClientBoard = dynamic(() => import("./_client").then((mod) => mod.ClientBoard), {ssr: false,+ loading: BoardLoadingShell,});diff --git a/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx b/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsxindex 30c91de40..6036a4905 100644--- a/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx+++ b/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx@@ -1,45 +1,36 @@"use client";-import { useCallback, useEffect } from "react";+import { useCallback, useEffect, useState } from "react";+import dynamic from "next/dynamic";import { useRouter } from "next/navigation";-import { OnboardingTour } from "@gfazioli/mantine-onboarding-tour";-import { Box, Group, Menu, ScrollArea } from "@mantine/core";+import { Box, Center, Loader, Menu, ScrollArea } from "@mantine/core";import { useHotkeys } from "@mantine/hooks";-import {- IconBox,- IconBoxAlignTop,- IconChevronDown,- IconLayoutBoard,- IconPencil,- IconPencilOff,- IconPlug,- IconPlus,- IconReplace,- IconResize,- IconSettings,-} from "@tabler/icons-react";+import { IconLayoutBoard, IconPencil, IconPencilOff, IconPlus, IconReplace, IconSettings } from "@tabler/icons-react";import { clientApi } from "@homarr/api/client";-import { useSession } from "@homarr/auth/client";import { useRequiredBoard } from "@homarr/boards/context";import { useEditMode } from "@homarr/boards/edit-mode";import { revalidatePathActionAsync } from "@homarr/common/client";import { env } from "@homarr/common/env";import { hotkeys } from "@homarr/definitions";-import { useConfirmModal, useModalAction } from "@homarr/modals";-import { AppSelectModal } from "@homarr/modals-collection";+import { useConfirmModal } from "@homarr/modals";import { showErrorNotification, showSuccessNotification } from "@homarr/notifications";import { useI18n, useScopedI18n } from "@homarr/translation/client";import { Link } from "@homarr/ui";-import { useItemActions } from "~/components/board/items/item-actions";-import { ItemSelectModal } from "~/components/board/items/item-select-modal";import { useBoardPermissions } from "~/components/board/permissions/client";-import { useCategoryActions } from "~/components/board/sections/category/category-actions";-import { CategoryEditModal } from "~/components/board/sections/category/category-edit-modal";-import { useDynamicSectionActions } from "~/components/board/sections/dynamic/dynamic-actions";-import { IntegrationSelectModal } from "~/components/integration/integration-select-modal";import { HeaderButton } from "~/components/layout/header/button";+import { TourTarget } from "~/components/layout/header/tour-target";++const loadBoardAddMenu = () => import("./_board-add-menu");+const preloadBoardAddMenu = () => void loadBoardAddMenu().catch(() => undefined);+const BoardAddMenu = dynamic(() => loadBoardAddMenu().then(({ BoardAddMenu: AddMenu }) => AddMenu), {+ loading: () => (+ <HeaderButton loading>+ <IconPlus stroke={1.5} />+ </HeaderButton>+ ),+});export const BoardContentHeaderActions = ({ demoReadOnly }: { demoReadOnly: boolean }) => {const [isEditMode] = useEditMode();@@ -52,16 +43,16 @@ export const BoardContentHeaderActions = ({ demoReadOnly }: { demoReadOnly: boolreturn (<>- {isEditMode && <AddMenu />}+ {isEditMode && <BoardAddMenu />}<EditModeMenu demoReadOnly={demoReadOnly} />{!demoReadOnly && (- <OnboardingTour.Target id="board-settings">+ <TourTarget id="board-settings"><HeaderButton href={`/boards/${board.name}/settings`}><IconSettings stroke={1.5} /></HeaderButton>- </OnboardingTour.Target>+ </TourTarget>)}<SelectBoardsMenu />@@ -69,94 +60,6 @@ export const BoardContentHeaderActions = ({ demoReadOnly }: { demoReadOnly: bool);};-const AddMenu = () => {- const { data: session } = useSession();- const { openModal: openCategoryEditModal } = useModalAction(CategoryEditModal);- const { openModal: openItemSelectModal } = useModalAction(ItemSelectModal);- const { openModal: openAppSelectModal } = useModalAction(AppSelectModal);- const { openModal: openIntegrationSelectModal } = useModalAction(IntegrationSelectModal);- const { addCategoryToEnd } = useCategoryActions();- const { addDynamicSection } = useDynamicSectionActions();- const { createItem } = useItemActions();- const t = useI18n();-- const handleAddCategory = useCallback(- () =>- openCategoryEditModal(- {- category: {- id: "new",- name: "",- },- onSuccess({ name }) {- addCategoryToEnd({ name });- },- submitLabel: t("section.category.create.submit"),- },- {- title: (t) => t("section.category.create.title"),- },- ),- [addCategoryToEnd, openCategoryEditModal, t],- );-- const handleSelectItem = useCallback(() => {- openItemSelectModal();- }, [openItemSelectModal]);-- const handleSelectApp = useCallback(() => {- openAppSelectModal({- onSelect: (app) => {- createItem({- kind: "app",- options: { appId: app.id },- });- },- withCreate: session?.user.permissions.includes("app-create") ?? false,- });- }, [openAppSelectModal, createItem]);-- const handleAddIntegration = useCallback(() => {- openIntegrationSelectModal({});- }, [openIntegrationSelectModal]);-- return (- <Menu position="bottom-end">- <Menu.Target>- <HeaderButton w="auto" px={4}>- <Group gap={4} wrap="nowrap">- <IconPlus stroke={1.5} />- <IconChevronDown color="gray" size={16} />- </Group>- </HeaderButton>- </Menu.Target>- <Menu.Dropdown style={{ transform: "translate(-3px, 0)" }}>- <Menu.Item leftSection={<IconResize size={20} />} onClick={handleSelectItem}>- {t("item.action.create")}- </Menu.Item>-- <Menu.Item leftSection={<IconBox size={20} />} onClick={handleSelectApp}>- {t("app.action.add")}- </Menu.Item>-- <Menu.Item leftSection={<IconPlug size={20} />} onClick={handleAddIntegration}>- {t("integration.action.create")}- </Menu.Item>-- <Menu.Divider />-- <Menu.Item leftSection={<IconBoxAlignTop size={20} />} onClick={handleAddCategory}>- {t("section.category.action.create")}- </Menu.Item>-- <Menu.Item leftSection={<IconResize size={20} />} onClick={addDynamicSection}>- {t("section.dynamic.action.create")}- </Menu.Item>- </Menu.Dropdown>- </Menu>- );-};-const EditModeMenu = ({ demoReadOnly }: { demoReadOnly: boolean }) => {const [isEditMode, { open, close }] = useEditMode();const board = useRequiredBoard();@@ -197,21 +100,29 @@ const EditModeMenu = ({ demoReadOnly }: { demoReadOnly: boolean }) => {usePreventLeaveWithDirty(isEditMode);return (- <OnboardingTour.Target id="board-edit-mode">- <HeaderButton onClick={toggle} loading={isPending}>+ <TourTarget id="board-edit-mode">+ <HeaderButton+ onClick={toggle}+ loading={isPending}+ onFocus={preloadBoardAddMenu}+ onPointerEnter={preloadBoardAddMenu}+ >{isEditMode ? <IconPencilOff stroke={1.5} /> : <IconPencil stroke={1.5} />}</HeaderButton>- </OnboardingTour.Target>+ </TourTarget>);};const SelectBoardsMenu = () => {- const { data: boards = [] } = clientApi.board.getAllBoards.useQuery();+ const [isOpen, setIsOpen] = useState(false);+ const utils = clientApi.useUtils();+ const { data: boards = [], isPending } = clientApi.board.getAllBoards.useQuery(undefined, { enabled: isOpen });+ const preloadBoards = () => void utils.board.getAllBoards.prefetch();return (- <OnboardingTour.Target id="board-switcher">- <Box>- <Menu position="bottom-end">+ <TourTarget id="board-switcher">+ <Box onFocus={preloadBoards} onPointerEnter={preloadBoards}>+ <Menu position="bottom-end" opened={isOpen} onChange={setIsOpen}><Menu.Target><HeaderButton w="auto" px={4}><IconReplace stroke={1.5} />@@ -219,6 +130,11 @@ const SelectBoardsMenu = () => {</Menu.Target><Menu.Dropdown style={{ transform: "translate(-7px, 0)" }}><ScrollArea.Autosize mah={300}>+ {isPending && (+ <Center p="xs">+ <Loader size="xs" />+ </Center>+ )}{boards.map((board) => (<Menu.Itemkey={board.id}@@ -233,7 +149,7 @@ const SelectBoardsMenu = () => {</Menu.Dropdown></Menu></Box>- </OnboardingTour.Target>+ </TourTarget>);};@@ -246,15 +162,13 @@ const usePreventLeaveWithDirty = (isDirty: boolean) => {useEffect(() => {if (!isDirty) return;- const handleClick = (event: Event) => {- const target = (event.target as HTMLElement).closest("a");-- if (!target) {- console.warn("No anchor element found for click event", event);- return;- }+ const handleClick = (event: MouseEvent) => {+ if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;+ const target = event.target instanceof Element ? event.target.closest<HTMLAnchorElement>(anchorSelector) : null;+ if (!target) return;event.preventDefault();+ event.stopPropagation();openConfirmModal({title: t("board.action.edit.confirmLeave.title"),@@ -280,19 +194,14 @@ const usePreventLeaveWithDirty = (isDirty: boolean) => {event.returnValue = true;};- const anchors = document.querySelectorAll(anchorSelector);- anchors.forEach((link) => {- link.addEventListener("click", handleClick);- });+ document.addEventListener("click", handleClick, true);window.addEventListener("popstate", handlePopState);window.addEventListener("beforeunload", handleBeforeUnload);return () => {- anchors.forEach((link) => {- link.removeEventListener("click", handleClick);- });+ document.removeEventListener("click", handleClick, true);window.removeEventListener("popstate", handlePopState);window.removeEventListener("beforeunload", handleBeforeUnload);};- }, [isDirty]);+ }, [isDirty, openConfirmModal, router, t]);};diff --git a/apps/nextjs/src/app/[locale]/boards/[name]/layout.tsx b/apps/nextjs/src/app/[locale]/boards/[name]/layout.tsxindex 1f129e4c1..0c5fd10e0 100644--- a/apps/nextjs/src/app/[locale]/boards/[name]/layout.tsx+++ b/apps/nextjs/src/app/[locale]/boards/[name]/layout.tsx@@ -1,4 +1,4 @@-import { api } from "@homarr/api/server";+import { getBoardByNameAsync } from "@homarr/api/board-server";import { BoardOtherHeaderActions } from "../_header-actions";import { createBoardLayout } from "../_layout-creator";@@ -6,6 +6,6 @@ import { createBoardLayout } from "../_layout-creator";export default createBoardLayout<{ locale: string; name: string }>({headerActions: <BoardOtherHeaderActions />,async getInitialBoardAsync({ name }) {- return await api.board.getBoardByName({ name });+ return await getBoardByNameAsync(name);},});diff --git a/apps/nextjs/src/app/[locale]/boards/_layout-creator.tsx b/apps/nextjs/src/app/[locale]/boards/_layout-creator.tsxindex 3cddc6685..24ebe3d03 100644--- a/apps/nextjs/src/app/[locale]/boards/_layout-creator.tsx+++ b/apps/nextjs/src/app/[locale]/boards/_layout-creator.tsx@@ -3,6 +3,7 @@ import { notFound, redirect } from "next/navigation";import { AppShellMain } from "@mantine/core";import { TRPCError } from "@trpc/server";+import { getRscUserSettingsAsync } from "@homarr/api/user-server";import { auth } from "@homarr/auth/next";import { BoardProvider } from "@homarr/boards/context";import { EditModeProvider } from "@homarr/boards/edit-mode";@@ -11,7 +12,8 @@ import { createLogger } from "@homarr/core/infrastructure/logs";import { MainHeader } from "~/components/layout/header";import { BoardLogoWithTitle } from "~/components/layout/logo/board-logo";import { ClientShell } from "~/components/layout/shell";-import { BoardTourProvider } from "~/components/onboarding/board-tour";+import { BoardTourGate } from "~/components/onboarding/board-tour-gate";+import { env } from "~/env";import { getCurrentColorSchemeAsync } from "~/theme/color-scheme";import type { Board } from "./_types";import type { Params } from "./(content)/_creator";@@ -21,11 +23,6 @@ import { BoardMantineProvider } from "./(content)/_theme";const logger = createLogger({ module: "createBoardLayout" });-const BoardTourWrapper = ({ hasSession, children }: PropsWithChildren<{ hasSession: boolean }>) => {- if (!hasSession) return <>{children}</>;- return <BoardTourProvider>{children}</BoardTourProvider>;-};-interface CreateBoardLayoutProps<TParams extends Params> {headerActions: JSX.Element;getInitialBoardAsync: (params: TParams) => Promise<Board>;@@ -43,8 +40,32 @@ export const createBoardLayout = <TParams extends Params>({}: PropsWithChildren<{params: Promise<TParams>;}>) => {- const session = await auth();- const initialBoard = await getInitialBoard(await params).catch((error) => {+ const resolvedParams = await params;+ const sessionPromise = auth();+ const initialBoardPromise = getInitialBoard(resolvedParams).then(+ (board) => ({ status: "fulfilled", board }) as const,+ (error: unknown) => ({ status: "rejected", error }) as const,+ );+ const colorSchemePromise = getCurrentColorSchemeAsync();+ const shouldRunBoardTourPromise = sessionPromise.then(async (session) => {+ if (!withTour || !session || env.DEMO_MODE) return false;++ try {+ const user = await getRscUserSettingsAsync(session.user.id);+ return user !== undefined && !user.completedBoardTour;+ } catch (error) {+ logger.error(new Error("Failed to load the board tour status", { cause: error }));+ return false;+ }+ });+ const [session, initialBoardResult, colorScheme, shouldRunBoardTour] = await Promise.all([+ sessionPromise,+ initialBoardPromise,+ colorSchemePromise,+ shouldRunBoardTourPromise,+ ]);+ if (initialBoardResult.status === "rejected") {+ const { error } = initialBoardResult;if (error instanceof TRPCError && error.code === "NOT_FOUND") {if (!session) {logger.debug("No home board found for anonymous user, redirecting to login");@@ -60,8 +81,8 @@ export const createBoardLayout = <TParams extends Params>({}throw error;- });- const colorScheme = await getCurrentColorSchemeAsync();+ }+ const initialBoard = initialBoardResult.board;return (<BoardProvider initialBoard={initialBoard}>@@ -69,7 +90,7 @@ export const createBoardLayout = <TParams extends Params>({<EditModeProvider><BoardMantineProvider defaultColorScheme={colorScheme}><CustomCss />- <BoardTourWrapper hasSession={withTour && !!session}>+ <BoardTourGate enabled={shouldRunBoardTour}><ClientShell hasNavigation={false}><MainHeaderlogo={<BoardLogoWithTitle size="md" hideTitleOnMobile />}@@ -78,7 +99,7 @@ export const createBoardLayout = <TParams extends Params>({/><AppShellMain>{children}</AppShellMain></ClientShell>- </BoardTourWrapper>+ </BoardTourGate></BoardMantineProvider></EditModeProvider></BoardReadyProvider>diff --git a/apps/nextjs/src/app/[locale]/init/page.tsx b/apps/nextjs/src/app/[locale]/init/page.tsxindex 212c74e73..0013c3170 100644--- a/apps/nextjs/src/app/[locale]/init/page.tsx+++ b/apps/nextjs/src/app/[locale]/init/page.tsx@@ -1,8 +1,8 @@import type { JSX } from "react";import { Box, Center, Stack, Text, Title } from "@mantine/core";-import { api } from "@homarr/api/server";import type { MaybePromise } from "@homarr/common/types";+import { db } from "@homarr/db";import type { OnboardingStep } from "@homarr/definitions";import { getScopedI18n } from "@homarr/translation/server";@@ -29,9 +29,16 @@ const stepComponents: Record<OnboardingStep, null | (() => MaybePromise<JSX.Elemfinish: InitFinish,};+const getCurrentOnboardingStepAsync = async () => {+ const value = await db.query.onboarding.findFirst();+ if (!value) return { current: "start" as const, previous: null };++ return { current: value.step, previous: value.previousStep };+};+export default async function InitPage() {const t = await getScopedI18n("init.step");- const currentStep = await api.onboard.currentStep();+ const currentStep = await getCurrentOnboardingStepAsync();const CurrentComponent = stepComponents[currentStep.current];diff --git a/apps/nextjs/src/app/[locale]/layout.tsx b/apps/nextjs/src/app/[locale]/layout.tsxindex 2388e2812..ea62beadf 100644--- a/apps/nextjs/src/app/[locale]/layout.tsx+++ b/apps/nextjs/src/app/[locale]/layout.tsx@@ -13,11 +13,11 @@ import { notFound } from "next/navigation";import type { DayOfWeek } from "@mantine/dates";import { NextIntlClientProvider } from "next-intl";-import { api } from "@homarr/api/server";+import { getRscServerSettingsAsync } from "@homarr/api/server-settings-server";+import { getRscUserSettingsAsync } from "@homarr/api/user-server";import { env } from "@homarr/auth/env";import { auth } from "@homarr/auth/next";-import { db } from "@homarr/db";-import { getServerSettingsAsync } from "@homarr/db/queries";+import { createLogger } from "@homarr/core/infrastructure/logs";import { ModalProvider } from "@homarr/modals";import { Notifications } from "@homarr/notifications";import { SettingsProvider } from "@homarr/settings";@@ -43,6 +43,8 @@ const fontSans = Inter({variable: "--font-sans",});+const logger = createLogger({ module: "rootLayout" });+// eslint-disable-next-line no-restricted-syntaxexport const generateMetadata = async (): Promise<Metadata> => ({title: "Homarr",@@ -78,15 +80,27 @@ export default async function Layout(props: {children: React.ReactNode;params: Promise<{ locale: SupportedLanguage }>;}) {- if (!isLocaleSupported((await props.params).locale)) {+ const { locale } = await props.params;+ if (!isLocaleSupported(locale)) {notFound();}- const session = await auth();- const user = session ? await api.user.getById({ userId: session.user.id }).catch(() => null) : null;- const serverSettings = await getServerSettingsAsync(db);- const colorScheme = await getCurrentColorSchemeAsync();- const direction = isLocaleRTL((await props.params).locale) ? "rtl" : "ltr";+ const sessionPromise = auth();+ const userPromise = sessionPromise.then((session) =>+ session+ ? getRscUserSettingsAsync(session.user.id).catch((error: unknown) => {+ logger.error(new Error("Failed to load the authenticated user in the root layout", { cause: error }));+ return null;+ })+ : null,+ );+ const [session, user, serverSettings, colorScheme] = await Promise.all([+ sessionPromise,+ userPromise,+ getRscServerSettingsAsync(),+ getCurrentColorSchemeAsync(),+ ]);+ const direction = isLocaleRTL(locale) ? "rtl" : "ltr";const StackedProvider = composeWrappers([(innerProps) => {@@ -125,8 +139,6 @@ export default async function Layout(props: {(innerProps) => <SpotlightProvider {...innerProps} />,]);- const { locale } = await props.params;-return (// Instead of ColorSchemScript we use data-mantine-color-scheme to prevent flickering<htmldiff --git a/apps/nextjs/src/app/[locale]/manage/layout.tsx b/apps/nextjs/src/app/[locale]/manage/layout.tsxindex 1cd0d3d2e..33bdcce06 100644--- a/apps/nextjs/src/app/[locale]/manage/layout.tsx+++ b/apps/nextjs/src/app/[locale]/manage/layout.tsx@@ -27,8 +27,10 @@ import {IconUsersGroup,} from "@tabler/icons-react";+import { getRscUserSettingsAsync } from "@homarr/api/user-server";import { auth } from "@homarr/auth/next";import { isProviderEnabled } from "@homarr/auth/server";+import { createLogger } from "@homarr/core/infrastructure/logs";import { createDocumentationLink } from "@homarr/definitions";import { dbEnv } from "@homarr/core/infrastructure/db/env";import { env } from "@homarr/docker/env";@@ -39,11 +41,29 @@ import { homarrLogoPath } from "~/components/layout/logo/homarr-logo";import type { NavigationLink } from "~/components/layout/navigation";import { MainNavigation } from "~/components/layout/navigation";import { ClientShell } from "~/components/layout/shell";-import { ManageTourProvider } from "~/components/onboarding/manage-tour";+import { ManageTourGate } from "~/components/onboarding/manage-tour-gate";+import { env as nextEnv } from "~/env";++const logger = createLogger({ module: "manageLayout" });export default async function ManageLayout({ children }: PropsWithChildren) {- const t = await getScopedI18n("management.navbar");- const session = await auth();+ const sessionPromise = auth();+ const shouldRunManageTourPromise = sessionPromise.then(async (session) => {+ if (!session || nextEnv.DEMO_MODE) return false;++ try {+ const user = await getRscUserSettingsAsync(session.user.id);+ return user !== undefined && !user.completedManageTour;+ } catch (error) {+ logger.error(new Error("Failed to load the management tour status", { cause: error }));+ return false;+ }+ });+ const [t, session, shouldRunManageTour] = await Promise.all([+ getScopedI18n("management.navbar"),+ sessionPromise,+ shouldRunManageTourPromise,+ ]);const navigationLinks: NavigationLink[] = [{label: t("items.home"),@@ -225,7 +245,9 @@ export default async function ManageLayout({ children }: PropsWithChildren) {</ClientShell>);- if (!session) return shell;-- return <ManageTourProvider isAdmin={isAdmin}>{shell}</ManageTourProvider>;+ return (+ <ManageTourGate enabled={shouldRunManageTour} isAdmin={isAdmin}>+ {shell}+ </ManageTourGate>+ );}diff --git a/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/_reset-tours.tsx b/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/_reset-tours.tsxindex 76f33a8db..82e50d218 100644--- a/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/_reset-tours.tsx+++ b/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/_reset-tours.tsx@@ -1,5 +1,6 @@"use client";+import { useRouter } from "next/navigation";import { Badge, Button, Group, Stack, Text } from "@mantine/core";import { IconRefresh } from "@tabler/icons-react";@@ -9,6 +10,7 @@ import { useScopedI18n } from "@homarr/translation/client";export const ResetTours = () => {const t = useScopedI18n("management.page.user.setting.general.item.onboardingTours");+ const router = useRouter();const utils = clientApi.useUtils();const { data: tourStatus } = clientApi.user.getTourStatus.useQuery();const { mutate: resetTours, isPending } = clientApi.user.resetTours.useMutation({@@ -18,6 +20,7 @@ export const ResetTours = () => {message: t("resetSuccess.message"),});void utils.user.getTourStatus.invalidate();+ router.refresh();},});diff --git a/apps/nextjs/src/app/[locale]/widgets/[kind]/_content.tsx b/apps/nextjs/src/app/[locale]/widgets/[kind]/_content.tsxindex 9bbc0ac93..882842ee7 100644--- a/apps/nextjs/src/app/[locale]/widgets/[kind]/_content.tsx+++ b/apps/nextjs/src/app/[locale]/widgets/[kind]/_content.tsx@@ -1,41 +1,38 @@"use client";-import { useCallback, useMemo, useState } from "react";+import { use, useCallback, useState } from "react";import { ActionIcon, Affix, Card } from "@mantine/core";import { IconDimensions, IconPencil, IconToggleLeft, IconToggleRight } from "@tabler/icons-react";import { QueryErrorResetBoundary } from "@tanstack/react-query";import { ErrorBoundary } from "react-error-boundary";-import type { IntegrationKind, WidgetKind } from "@homarr/definitions";+import { clientApi } from "@homarr/api/client";+import type { WidgetKind } from "@homarr/definitions";import { useModalAction } from "@homarr/modals";-import { showSuccessNotification } from "@homarr/notifications";+import { showErrorNotification, showSuccessNotification } from "@homarr/notifications";import { useSettings } from "@homarr/settings";import { useI18n } from "@homarr/translation/client";import type { BoardItemAdvancedOptions } from "@homarr/validation/shared";-import { loadWidgetDynamic, reduceWidgetOptionsWithDefaultValues, widgetImports } from "@homarr/widgets";import { WidgetError } from "@homarr/widgets/errors";-import { WidgetEditModal } from "@homarr/widgets/modals";+import { loadWidgetResources, reduceWidgetOptionsWithDefinition } from "@homarr/widgets/manifest";+import { LazyWidgetEditModal, preloadWidgetEditModal } from "~/components/board/items/lazy-widget-edit-modal";import type { Dimensions } from "./_dimension-modal";import { PreviewDimensionsModal } from "./_dimension-modal";interface WidgetPreviewPageContentProps {kind: WidgetKind;- integrationData: {- id: string;- name: string;- url: string;- kind: IntegrationKind;- }[];}-export const WidgetPreviewPageContent = ({ kind, integrationData }: WidgetPreviewPageContentProps) => {+export const WidgetPreviewPageContent = ({ kind }: WidgetPreviewPageContentProps) => {const settings = useSettings();const t = useI18n();- const { openModal: openWidgetEditModal } = useModalAction(WidgetEditModal);+ const utils = clientApi.useUtils();+ const { openModal: openWidgetEditModal } = useModalAction(LazyWidgetEditModal);const { openModal: openPreviewDimensionsModal } = useModalAction(PreviewDimensionsModal);- const currentDefinition = useMemo(() => widgetImports[kind].definition, [kind]);+ const { definition: currentDefinition, Component } = use(loadWidgetResources(kind));const [editMode, setEditMode] = useState(false);+ const [isEditorLoading, setIsEditorLoading] = useState(false);const [dimensions, setDimensions] = useState<Dimensions>({width: 128,height: 128,@@ -45,7 +42,7 @@ export const WidgetPreviewPageContent = ({ kind, integrationData }: WidgetPrevieintegrationIds: string[];advancedOptions: BoardItemAdvancedOptions;}>({- options: reduceWidgetOptionsWithDefaultValues(kind, settings, {}),+ options: reduceWidgetOptionsWithDefinition(currentDefinition, settings, {}),integrationIds: [],advancedOptions: {title: null,@@ -54,31 +51,41 @@ export const WidgetPreviewPageContent = ({ kind, integrationData }: WidgetPrevie},});- const handleOpenEditWidgetModal = useCallback(() => {- openWidgetEditModal(- {- kind,- value: state,- onSuccessfulEdit: (value) => {- setState(value);+ const handleOpenEditWidgetModal = useCallback(async () => {+ const hasIntegrationSupport = "supportedIntegrations" in currentDefinition;+ setIsEditorLoading(true);+ preloadWidgetEditModal();+ try {+ const integrationData = hasIntegrationSupport ? await utils.integration.all.ensureData() : [];+ openWidgetEditModal(+ {+ kind,+ definition: currentDefinition,+ value: state,+ onSuccessfulEdit: (value) => {+ setState(value);+ },+ integrationData: integrationData.filter((integration) =>+ (currentDefinition.supportedIntegrations ?? []).includes(integration.kind),+ ),+ integrationSupport: hasIntegrationSupport,+ settings,},- integrationData: integrationData.filter(- (integration) =>- "supportedIntegrations" in currentDefinition &&- (currentDefinition.supportedIntegrations as string[]).some((kind) => kind === integration.kind),- ),- integrationSupport: "supportedIntegrations" in currentDefinition,- settings,- },- {- title(t) {- return `${t("item.edit.title")} - ${t(`widget.${kind}.name`)}`;+ {+ title(translate) {+ return `${translate("item.edit.title")} - ${translate(`widget.${kind}.name`)}`;+ },},- },- );- }, [currentDefinition, integrationData, kind, openWidgetEditModal, settings, state]);-- const Comp = loadWidgetDynamic(kind);+ );+ } catch (error) {+ showErrorNotification({+ title: t("common.error"),+ message: error instanceof Error ? error.message : String(error),+ });+ } finally {+ setIsEditorLoading(false);+ }+ }, [currentDefinition, kind, openWidgetEditModal, settings, state, t, utils]);const toggleEditMode = useCallback(() => {setEditMode((editMode) => !editMode);@@ -94,8 +101,11 @@ export const WidgetPreviewPageContent = ({ kind, integrationData }: WidgetPrevie});}, [dimensions, openPreviewDimensionsModal]);- const updateOptions = ({ newOptions }: { newOptions: Record<string, unknown> }) =>- setState({ ...state, options: { ...state.options, newOptions } });+ const updateOptions = useCallback(+ ({ newOptions }: { newOptions: Record<string, unknown> }) =>+ setState((current) => ({ ...current, options: { ...current.options, ...newOptions } })),+ [],+ );return (<>@@ -105,10 +115,10 @@ export const WidgetPreviewPageContent = ({ kind, integrationData }: WidgetPrevie<ErrorBoundaryonReset={reset}fallbackRender={({ resetErrorBoundary, error }) => (- <WidgetError kind={kind} error={error} resetErrorBoundary={resetErrorBoundary} />+ <WidgetError definition={currentDefinition} error={error} resetErrorBoundary={resetErrorBoundary} />)}>- <Comp+ <Componentoptions={state.options as never}integrationIds={state.integrationIds}width={dimensions.width}@@ -127,7 +137,10 @@ export const WidgetPreviewPageContent = ({ kind, integrationData }: WidgetPreviesize={48}variant="default"radius="xl"- onClick={handleOpenEditWidgetModal}+ onClick={() => void handleOpenEditWidgetModal()}+ onFocus={preloadWidgetEditModal}+ onPointerEnter={preloadWidgetEditModal}+ loading={isEditorLoading}aria-label={t("common.action.edit")}><IconPencil size={24} />diff --git a/apps/nextjs/src/app/[locale]/widgets/[kind]/layout.tsx b/apps/nextjs/src/app/[locale]/widgets/[kind]/layout.tsxindex cfd213f9d..9cdf91241 100644--- a/apps/nextjs/src/app/[locale]/widgets/[kind]/layout.tsx+++ b/apps/nextjs/src/app/[locale]/widgets/[kind]/layout.tsx@@ -1,23 +1,18 @@import type { PropsWithChildren } from "react";-import { widgetImports } from "@homarr/widgets";+import { widgetKinds } from "@homarr/definitions";+import { widgetCatalogIcons } from "@homarr/widgets/catalog";import { MainNavigation } from "~/components/layout/navigation";import { ClientShell } from "~/components/layout/shell";-const getLinks = () => {- return Object.entries(widgetImports).map(([key, value]) => {- return {- href: `/widgets/${key}`,- icon: value.definition.icon,- label: value.definition.kind,- };- });-};+const links = widgetKinds.map((kind) => ({+ href: `/widgets/${kind}`,+ icon: widgetCatalogIcons[kind],+ label: kind,+}));export default function WidgetPreviewLayout({ children }: PropsWithChildren) {- const links = getLinks();-return (<ClientShell hasHeader={false}><MainNavigation links={links} />diff --git a/apps/nextjs/src/app/[locale]/widgets/[kind]/page.tsx b/apps/nextjs/src/app/[locale]/widgets/[kind]/page.tsxindex fbcd741c2..454e7a805 100644--- a/apps/nextjs/src/app/[locale]/widgets/[kind]/page.tsx+++ b/apps/nextjs/src/app/[locale]/widgets/[kind]/page.tsx@@ -1,10 +1,9 @@+import { Suspense } from "react";import { notFound } from "next/navigation";-import { Center } from "@mantine/core";+import { Center, Loader } from "@mantine/core";-import { env } from "@homarr/common/env";-import { db } from "@homarr/db";import type { WidgetKind } from "@homarr/definitions";-import { widgetImports } from "@homarr/widgets";+import { widgetKinds } from "@homarr/widgets/manifest";import { WidgetPreviewPageContent } from "./_content";@@ -13,24 +12,16 @@ interface Props {}export default async function WidgetPreview(props: Props) {- if (!((await props.params).kind in widgetImports || env.NODE_ENV !== "development")) {+ const { kind } = await props.params;+ if (!widgetKinds.includes(kind as WidgetKind)) {notFound();}- const integrationData = await db.query.integrations.findMany({- columns: {- id: true,- name: true,- url: true,- kind: true,- },- });-- const sort = (await props.params).kind as WidgetKind;-return (<Center h="100vh">- <WidgetPreviewPageContent kind={sort} integrationData={integrationData} />+ <Suspense fallback={<Loader size="sm" />}>+ <WidgetPreviewPageContent key={kind} kind={kind as WidgetKind} />+ </Suspense></Center>);}diff --git a/apps/nextjs/src/components/board/items/item-content.tsx b/apps/nextjs/src/components/board/items/item-content.tsxindex ad0f3a305..bd6ef5fa3 100644--- a/apps/nextjs/src/components/board/items/item-content.tsx+++ b/apps/nextjs/src/components/board/items/item-content.tsx@@ -1,17 +1,21 @@-import type { MutableRefObject } from "react";-import { useRef } from "react";-import { Badge, Card } from "@mantine/core";+import type { ComponentType, MutableRefObject } from "react";+import { Suspense, use, useRef } from "react";+import type { CardProps } from "@mantine/core";+import { Badge, Card, Center, Loader } from "@mantine/core";import { useElementSize } from "@mantine/hooks";import { QueryErrorResetBoundary, useQueryClient } from "@tanstack/react-query";import combineClasses from "clsx";import { NoIntegrationSelectedError } from "@homarr/widgets/errors/classes";+import type { FallbackProps } from "react-error-boundary";import { ErrorBoundary } from "react-error-boundary";import { useRequiredBoard } from "@homarr/boards/context";import { useEditMode } from "@homarr/boards/edit-mode";import { useSettings } from "@homarr/settings";-import { loadWidgetDynamic, reduceWidgetOptionsWithDefaultValues, widgetImports } from "@homarr/widgets";import { WidgetError } from "@homarr/widgets/errors";+import { getWidgetQueryKeys } from "@homarr/widgets/definition";+import type { WidgetComponentProps, WidgetDefinition } from "@homarr/widgets/definition";+import { loadWidgetResources, reduceWidgetOptionsWithDefinition } from "@homarr/widgets/manifest";import type { SectionItem } from "~/app/[locale]/boards/_types";import classes from "../sections/item.module.css";@@ -19,7 +23,7 @@ import { useItemActions } from "./item-actions";import itemContentClasses from "./item-content.module.css";import { BoardItemMenu } from "./item-menu";import { WidgetContextMenu } from "./widget-context-menu";-import { removePersistedWidgetQueries } from "./widget-query-recovery";+import { removeWidgetDataQueries } from "./widget-query-recovery";interface BoardItemContentProps {item: SectionItem;@@ -31,6 +35,53 @@ const getOverflowFromKind = (kind: SectionItem["kind"]) => {return undefined;};+type BoardItemCardProps = CardProps & {+ item: SectionItem;+ innerRef: (element: HTMLDivElement | null) => void;+};++const BoardItemCard = ({ item, innerRef, children, ...cardProps }: BoardItemCardProps) => {+ const board = useRequiredBoard();++ return (+ <Card+ {...cardProps}+ ref={innerRef}+ className={combineClasses(+ classes.itemCard,+ `${item.kind}-wrapper`,+ "grid-stack-item-content",+ item.advancedOptions.customCssClasses.join(" "),+ )}+ radius={board.itemRadius}+ styles={{+ root: {+ "--opacity": board.opacity / 100,+ containerType: "size",+ overflow: getOverflowFromKind(item.kind),+ "--border-color": item.advancedOptions.borderColor !== "" ? item.advancedOptions.borderColor : undefined,+ },+ }}+ p={0}+ >+ {children}+ </Card>+ );+};++const WidgetDefinitionLoadError = ({+ error,+ resetErrorBoundary,+ item,+ innerRef,+}: FallbackProps & Pick<BoardItemCardProps, "item" | "innerRef">) => (+ <BoardItemCard item={item} innerRef={innerRef}>+ <Center h="100%">+ <WidgetError error={error} resetErrorBoundary={resetErrorBoundary} />+ </Center>+ </BoardItemCard>+);+export const BoardItemContent = ({ item }: BoardItemContentProps) => {const { ref, width, height } = useElementSize<HTMLDivElement>();const board = useRequiredBoard();@@ -38,29 +89,28 @@ export const BoardItemContent = ({ item }: BoardItemContentProps) => {return (<>- <WidgetContextMenu item={item} widgetStateRef={widgetStateRef}>- <Card- ref={ref}- className={combineClasses(- classes.itemCard,- `${item.kind}-wrapper`,- "grid-stack-item-content",- item.advancedOptions.customCssClasses.join(" "),- )}- radius={board.itemRadius}- styles={{- root: {- "--opacity": board.opacity / 100,- containerType: "size",- overflow: getOverflowFromKind(item.kind),- "--border-color": item.advancedOptions.borderColor !== "" ? item.advancedOptions.borderColor : undefined,- },- }}- p={0}+ <ErrorBoundary+ resetKeys={[item.kind]}+ fallbackRender={(fallbackProps) => <WidgetDefinitionLoadError {...fallbackProps} item={item} innerRef={ref} />}+ >+ <Suspense+ fallback={+ <BoardItemCard item={item} innerRef={ref}>+ <Center h="100%">+ <Loader size="sm" />+ </Center>+ </BoardItemCard>+ }>- <InnerContent item={item} width={width} height={height} widgetStateRef={widgetStateRef} />- </Card>- </WidgetContextMenu>+ <LoadedBoardItemContent+ item={item}+ width={width}+ height={height}+ widgetStateRef={widgetStateRef}+ innerRef={ref}+ />+ </Suspense>+ </ErrorBoundary>{item.advancedOptions.title?.trim() && (<Badgepos="absolute"@@ -86,40 +136,72 @@ export const BoardItemContent = ({ item }: BoardItemContentProps) => {);};+interface LoadedBoardItemContentProps extends Omit<InnerContentProps, "definition" | "Component"> {+ innerRef: (element: HTMLDivElement | null) => void;+}++const LoadedBoardItemContent = ({ item, innerRef, ...innerContentProps }: LoadedBoardItemContentProps) => {+ const { definition, Component } = use(loadWidgetResources(item.kind));++ return (+ <WidgetContextMenu item={item} definition={definition} widgetStateRef={innerContentProps.widgetStateRef}>+ <BoardItemCard item={item} innerRef={innerRef}>+ <ErrorBoundary+ resetKeys={[item.kind]}+ fallbackRender={({ resetErrorBoundary, error }) => (+ <>+ <BoardItemMenu offset={4} item={item} definition={definition} resetErrorBoundary={resetErrorBoundary} />+ <WidgetError definition={definition} error={error} resetErrorBoundary={resetErrorBoundary} />+ </>+ )}+ >+ <InnerContent item={item} definition={definition} Component={Component} {...innerContentProps} />+ </ErrorBoundary>+ </BoardItemCard>+ </WidgetContextMenu>+ );+};+interface InnerContentProps {item: SectionItem;width: number;height: number;widgetStateRef: MutableRefObject<Record<string, unknown> | null>;+ definition: WidgetDefinition;+ Component: ComponentType<WidgetComponentProps<SectionItem["kind"]>>;}-const InnerContent = ({ item, ...dimensions }: InnerContentProps) => {+const InnerContent = ({ item, definition, Component, ...dimensions }: InnerContentProps) => {const settings = useSettings();const board = useRequiredBoard();const [isEditMode] = useEditMode();- const Comp = loadWidgetDynamic(item.kind);- const { definition } = widgetImports[item.kind];- const options = reduceWidgetOptionsWithDefaultValues(item.kind, settings, item.options);+ const options = reduceWidgetOptionsWithDefinition(definition, settings, item.options);const newItem = { ...item, options };const { updateItemOptions } = useItemActions();const updateOptions = ({ newOptions }: { newOptions: Record<string, unknown> }) =>updateItemOptions({ itemId: item.id, newOptions });const widgetSupportsIntegrations =- "supportedIntegrations" in definition && definition.supportedIntegrations.length >= 1;+ "supportedIntegrations" in definition && (definition.supportedIntegrations?.length ?? 0) >= 1;const queryClient = useQueryClient();+ const widgetQueryKeys = getWidgetQueryKeys(definition, item.kind);return (<QueryErrorResetBoundary>{({ reset }) => (<ErrorBoundaryonReset={() => {- removePersistedWidgetQueries(queryClient);+ removeWidgetDataQueries(queryClient, widgetQueryKeys);reset();}}fallbackRender={({ resetErrorBoundary, error }) => (<>- <BoardItemMenu offset={4} item={newItem} resetErrorBoundary={resetErrorBoundary} />- <WidgetError kind={item.kind} error={error} resetErrorBoundary={resetErrorBoundary} />+ <BoardItemMenu+ offset={4}+ item={newItem}+ definition={definition}+ resetErrorBoundary={resetErrorBoundary}+ />+ <WidgetError definition={definition} error={error} resetErrorBoundary={resetErrorBoundary} /></>)}>@@ -131,23 +213,25 @@ const InnerContent = ({ item, ...dimensions }: InnerContentProps) => {(!("integrationsRequired" in definition) || definition.integrationsRequired !== false)}/>- <BoardItemMenu offset={4} item={newItem} />- <Comp- options={options as never}- integrationIds={item.integrationIds}- isEditMode={isEditMode}- boardId={board.id}- itemId={item.id}- setOptions={(partialNewOptions) =>- updateOptions({- newOptions: {- ...options,- ...partialNewOptions.newOptions,- },- })- }- {...dimensions}- />+ <BoardItemMenu offset={4} item={newItem} definition={definition} />+ <div data-homarr-widget-ready={item.kind} style={{ display: "contents" }}>+ <Component+ options={options as never}+ integrationIds={item.integrationIds}+ isEditMode={isEditMode}+ boardId={board.id}+ itemId={item.id}+ setOptions={(partialNewOptions) =>+ updateOptions({+ newOptions: {+ ...options,+ ...partialNewOptions.newOptions,+ },+ })+ }+ {...dimensions}+ />+ </div></ErrorBoundary>)}</QueryErrorResetBoundary>diff --git a/apps/nextjs/src/components/board/items/item-menu.tsx b/apps/nextjs/src/components/board/items/item-menu.tsxindex b8a136bbb..13fa8a16e 100644--- a/apps/nextjs/src/components/board/items/item-menu.tsx+++ b/apps/nextjs/src/components/board/items/item-menu.tsx@@ -1,4 +1,4 @@-import { useEffect, useMemo, useRef } from "react";+import { useEffect, useRef, useState } from "react";import { ActionIcon, Menu } from "@mantine/core";import { IconCopy, IconDotsVertical, IconLayoutKanban, IconPencil, IconTrash } from "@tabler/icons-react";@@ -8,39 +8,44 @@ import { useEditMode } from "@homarr/boards/edit-mode";import { useConfirmModal, useModalAction } from "@homarr/modals";import { useSettings } from "@homarr/settings";import { useI18n, useScopedI18n } from "@homarr/translation/client";-import { widgetImports } from "@homarr/widgets";-import { WidgetEditModal } from "@homarr/widgets/modals";+import type { WidgetDefinition } from "@homarr/widgets/definition";import type { SectionItem } from "~/app/[locale]/boards/_types";import { useSectionContext } from "../sections/section-context";import { useItemActions } from "./item-actions";-import { ItemMoveModal } from "./item-move-modal";+import { LazyItemMoveModal, preloadItemMoveModal } from "./lazy-item-move-modal";+import { LazyWidgetEditModal, preloadWidgetEditModal } from "./lazy-widget-edit-modal";interface BoardItemMenuProps {offset: number;item: SectionItem;+ definition: WidgetDefinition;resetErrorBoundary?: () => void;}export const BoardItemMenu = (props: BoardItemMenuProps) => {const { data: session } = useSession();- if (!session) return null;+ const [isEditMode] = useEditMode();+ if (!session || !isEditMode) return null;return <BoardItemMenuInner {...props} />;};-const BoardItemMenuInner = ({ offset, item, resetErrorBoundary }: BoardItemMenuProps) => {+const BoardItemMenuInner = ({ offset, item, definition, resetErrorBoundary }: BoardItemMenuProps) => {const refResetErrorBoundaryOnNextRender = useRef(false);const tItem = useScopedI18n("item");const t = useI18n();- const { openModal } = useModalAction(WidgetEditModal);- const { openModal: openMoveModal } = useModalAction(ItemMoveModal);+ const { openModal } = useModalAction(LazyWidgetEditModal);+ const { openModal: openMoveModal } = useModalAction(LazyItemMoveModal);const { openConfirmModal } = useConfirmModal();- const [isEditMode] = useEditMode();+ const [isMenuOpen, setIsMenuOpen] = useState(false);+ const hasSupportedIntegrations =+ "supportedIntegrations" in definition && (definition.supportedIntegrations?.length ?? 0) > 0;const { updateItemOptions, updateItemAdvancedOptions, updateItemIntegrations, duplicateItem, removeItem } =useItemActions();- const { data: integrationData, isPending } = clientApi.integration.all.useQuery();- const currentDefinition = useMemo(() => widgetImports[item.kind].definition, [item.kind]);+ const { data: integrationData, isPending } = clientApi.integration.all.useQuery(undefined, {+ enabled: isMenuOpen && hasSupportedIntegrations,+ });const { gridstack } = useSectionContext().refs;const settings = useSettings();@@ -52,12 +57,11 @@ const BoardItemMenuInner = ({ offset, item, resetErrorBoundary }: BoardItemMenuP}}, [item, resetErrorBoundary]);- if (!isEditMode || isPending) return null;-const openEditModal = () => {openModal({kind: item.kind,+ definition,value: {advancedOptions: item.advancedOptions,options: item.options,@@ -80,10 +84,10 @@ const BoardItemMenuInner = ({ offset, item, resetErrorBoundary }: BoardItemMenuP},integrationData: (integrationData ?? []).filter((integration) =>- "supportedIntegrations" in currentDefinition &&- (currentDefinition.supportedIntegrations as string[]).some((kind) => kind === integration.kind),+ "supportedIntegrations" in definition &&+ (definition.supportedIntegrations as string[]).some((kind) => kind === integration.kind),),- integrationSupport: "supportedIntegrations" in currentDefinition,+ integrationSupport: "supportedIntegrations" in definition,settings,itemId: item.id,appId: item.kind === "app" ? (item.options.appId as string | undefined) : undefined,@@ -107,7 +111,7 @@ const BoardItemMenuInner = ({ offset, item, resetErrorBoundary }: BoardItemMenuP};return (- <Menu withinPortal position="right-start" arrowPosition="center">+ <Menu withinPortal position="right-start" arrowPosition="center" opened={isMenuOpen} onChange={setIsMenuOpen}><Menu.Target><ActionIconvariant="default"@@ -123,11 +127,19 @@ const BoardItemMenuInner = ({ offset, item, resetErrorBoundary }: BoardItemMenuP</Menu.Target><Menu.Dropdown miw={128}><Menu.Label>{tItem("menu.label.settings")}</Menu.Label>- <Menu.Item leftSection={<IconPencil size={16} />} onClick={openEditModal}>+ <Menu.Item+ leftSection={<IconPencil size={16} />}+ onClick={openEditModal}+ onFocus={preloadWidgetEditModal}+ onPointerEnter={preloadWidgetEditModal}+ disabled={hasSupportedIntegrations && isPending}+ >{tItem("action.edit")}</Menu.Item><Menu.ItemleftSection={<IconLayoutKanban size={16} />}+ onFocus={preloadItemMoveModal}+ onPointerEnter={preloadItemMoveModal}onClick={() => {if (!gridstack.current) return;openMoveModal({ item, columnCount: gridstack.current.getColumn(), gridStack: gridstack.current });diff --git a/apps/nextjs/src/components/board/items/item-move-modal.tsx b/apps/nextjs/src/components/board/items/item-move-modal.tsxindex 38e362ede..276e1124e 100644--- a/apps/nextjs/src/components/board/items/item-move-modal.tsx+++ b/apps/nextjs/src/components/board/items/item-move-modal.tsx@@ -9,13 +9,13 @@ import { useI18n } from "@homarr/translation/client";import type { Item, SectionItem } from "~/app/[locale]/boards/_types";-interface InnerProps {+export interface ItemMoveModalProps {gridStack: GridStack;item: Pick<SectionItem, "id" | "width" | "height" | "xOffset" | "yOffset">;columnCount: number;}-export const ItemMoveModal = createModal<InnerProps>(({ actions, innerProps }) => {+export const ItemMoveModal = createModal<ItemMoveModalProps>(({ actions, innerProps }) => {const t = useI18n();const maxWidthRef = useRef(innerProps.columnCount - innerProps.item.xOffset);const form = useZodForm(diff --git a/apps/nextjs/src/components/board/items/item-select-data.spec.ts b/apps/nextjs/src/components/board/items/item-select-data.spec.tsnew file mode 100644index 000000000..4d0e77860--- /dev/null+++ b/apps/nextjs/src/components/board/items/item-select-data.spec.ts@@ -0,0 +1,48 @@+import { describe, expect, it, vi } from "vitest";++import { resolveMatchingIntegrationsAsync, tryLockSelection, unlockSelection } from "./item-select-data";++describe("widget selection lock", () => {+ it("rejects repeated selection synchronously until the active selection finishes", () => {+ const lock = { current: false };++ expect(tryLockSelection(lock)).toBe(true);+ expect(tryLockSelection(lock)).toBe(false);++ unlockSelection(lock);+ expect(tryLockSelection(lock)).toBe(true);+ });+});++describe("resolveMatchingIntegrationsAsync", () => {+ it("waits for the shared integration query before a cold integration-backed selection", async () => {+ const ensureDataAsync = vi.fn(async () => [+ { id: "matching", kind: "sonarr" as const },+ { id: "other", kind: "radarr" as const },+ ]);++ await expect(+ resolveMatchingIntegrationsAsync({+ hasIntegrationSupport: true,+ supportedIntegrations: ["sonarr"],+ currentData: undefined,+ ensureDataAsync,+ }),+ ).resolves.toEqual([{ id: "matching", kind: "sonarr" }]);+ expect(ensureDataAsync).toHaveBeenCalledOnce();+ });++ it("does not wait for integrations when the widget has no integration support", async () => {+ const ensureDataAsync = vi.fn(async () => [{ id: "unused", kind: "sonarr" as const }]);++ await expect(+ resolveMatchingIntegrationsAsync({+ hasIntegrationSupport: false,+ supportedIntegrations: [],+ currentData: undefined,+ ensureDataAsync,+ }),+ ).resolves.toEqual([]);+ expect(ensureDataAsync).not.toHaveBeenCalled();+ });+});diff --git a/apps/nextjs/src/components/board/items/item-select-data.ts b/apps/nextjs/src/components/board/items/item-select-data.tsnew file mode 100644index 000000000..f2b37f700--- /dev/null+++ b/apps/nextjs/src/components/board/items/item-select-data.ts@@ -0,0 +1,28 @@+import type { IntegrationKind } from "@homarr/definitions";++export const tryLockSelection = (lock: { current: boolean }) => {+ if (lock.current) return false;+ lock.current = true;+ return true;+};++export const unlockSelection = (lock: { current: boolean }) => {+ lock.current = false;+};++export const resolveMatchingIntegrationsAsync = async <TIntegration extends { kind: IntegrationKind }>({+ hasIntegrationSupport,+ supportedIntegrations,+ currentData,+ ensureDataAsync,+}: {+ hasIntegrationSupport: boolean;+ supportedIntegrations: readonly IntegrationKind[];+ currentData: TIntegration[] | undefined;+ ensureDataAsync: () => Promise<TIntegration[]>;+}) => {+ if (!hasIntegrationSupport) return [];++ const integrations = currentData ?? (await ensureDataAsync());+ return integrations.filter((integration) => supportedIntegrations.includes(integration.kind));+};diff --git a/apps/nextjs/src/components/board/items/item-select-modal.module.css b/apps/nextjs/src/components/board/items/item-select-modal.module.cssnew file mode 100644index 000000000..ef8c56d8d--- /dev/null+++ b/apps/nextjs/src/components/board/items/item-select-modal.module.css@@ -0,0 +1,21 @@+.action {+ opacity: 0;+ transition: opacity 150ms ease;+}++.card:hover .action,+.card:focus-within .action {+ opacity: 1;+}++@media (hover: none), (pointer: coarse) {+ .action {+ opacity: 1;+ }+}++@media (prefers-reduced-motion: reduce) {+ .action {+ transition: none;+ }+}diff --git a/apps/nextjs/src/components/board/items/item-select-modal.tsx b/apps/nextjs/src/components/board/items/item-select-modal.tsxindex 2ac349c6d..497a63e49 100644--- a/apps/nextjs/src/components/board/items/item-select-modal.tsx+++ b/apps/nextjs/src/components/board/items/item-select-modal.tsx@@ -1,46 +1,65 @@-import { useMemo, useState } from "react";+import { useMemo, useRef, useState } from "react";import { Avatar, Box, Button, Card, Center, Divider, Group, Image, Stack, Text, Tooltip } from "@mantine/core";import { IconApi } from "@tabler/icons-react";+import type { RouterOutputs } from "@homarr/api";import { clientApi } from "@homarr/api/client";-import { createId, objectEntries } from "@homarr/common";-import { getIconUrl, getIntegrationName } from "@homarr/definitions";+import { createId } from "@homarr/common";+import { getIconUrl, getIntegrationName, widgetIntegrationSupport, widgetKinds } from "@homarr/definitions";import type { IntegrationKind, WidgetKind } from "@homarr/definitions";import { createModal, modalSizeSelect, useModalAction } from "@homarr/modals";+import { showErrorNotification } from "@homarr/notifications";import { useSettings } from "@homarr/settings";import { useI18n } from "@homarr/translation/client";import { SelectGridLayout, selectGridCardHeight } from "@homarr/ui";import type { TablerIcon } from "@homarr/ui";-import { reduceWidgetOptionsWithDefaultValues, widgetImports } from "@homarr/widgets";-import { WidgetEditModal } from "@homarr/widgets/modals";+import { widgetCatalogIcons } from "@homarr/widgets/catalog";+import { loadWidgetDefinition, reduceWidgetOptionsWithDefinition } from "@homarr/widgets/manifest";import { useItemActions } from "./item-actions";+import { resolveMatchingIntegrationsAsync, tryLockSelection, unlockSelection } from "./item-select-data";+import { LazyWidgetEditModal, preloadWidgetEditModal } from "./lazy-widget-edit-modal";+import classes from "./item-select-modal.module.css";-export const ItemSelectModal = createModal<void>(({ actions }) => {+interface ItemSelectModalContentProps {+ actions: { closeModal: () => void };+ innerProps: void;+ integrationData: RouterOutputs["integration"]["all"] | undefined;+ customWidgetDefs: RouterOutputs["customWidget"]["all"] | undefined;+ ensureIntegrationDataAsync: () => Promise<RouterOutputs["integration"]["all"]>;+}++const ItemSelectModalContent = ({+ actions,+ integrationData,+ customWidgetDefs,+ ensureIntegrationDataAsync,+}: ItemSelectModalContentProps) => {const [search, setSearch] = useState("");+ const [loadingSelection, setLoadingSelection] = useState<string | null>(null);+ const selectionLock = useRef(false);const t = useI18n();const { createItem, updateItemOptions, updateItemAdvancedOptions, updateItemIntegrations } = useItemActions();- const { openModal: openEditModal } = useModalAction(WidgetEditModal);- const { data: integrationData } = clientApi.integration.all.useQuery();- const { data: customWidgetDefs } = clientApi.customWidget.all.useQuery();+ const { openModal: openEditModal } = useModalAction(LazyWidgetEditModal);const settings = useSettings();const availableKinds = useMemo(() => new Set((integrationData ?? []).map((i) => i.kind)), [integrationData]);const items = useMemo(() =>- objectEntries(widgetImports)- .filter(([kind]) => kind !== "customApi")- .map(([kind, value]) => ({- kind,- supportedIntegrations:- "supportedIntegrations" in value.definition- ? value.definition.supportedIntegrations.filter((integration) => integration !== "mock")- : [],- icon: value.definition.icon,- name: t(`widget.${kind}.name`),- description: t(`widget.${kind}.description`),- }))+ widgetKinds+ .filter((kind) => kind !== "customApi")+ .map((kind) => {+ return {+ kind,+ supportedIntegrations: (widgetIntegrationSupport[kind] ?? []).filter(+ (integration) => integration !== "mock",+ ),+ icon: widgetCatalogIcons[kind],+ name: t(`widget.${kind}.name`),+ description: t(`widget.${kind}.description`),+ };+ }).sort((itemA, itemB) => {if (itemA.kind === "app") return -1;if (itemB.kind === "app") return 1;@@ -66,52 +85,81 @@ export const ItemSelectModal = createModal<void>(({ actions }) => {[customWidgetDefs, search],);- const handleAddCustomWidget = (definitionId: string) => {- const itemId = createId();- const defaultOptions = reduceWidgetOptionsWithDefaultValues("customApi", settings);- createItem({ id: itemId, kind: "customApi", integrationIds: [] });- updateItemOptions({ itemId, newOptions: { ...defaultOptions, definitionId } });- actions.closeModal();+ const notifyDefinitionLoadError = (error: unknown) => {+ showErrorNotification({+ title: t("common.error"),+ message: error instanceof Error ? error.message : String(error),+ });};- const handleAdd = (kind: WidgetKind) => {- const definition = widgetImports[kind].definition;- const hasIntegrationSupport = "supportedIntegrations" in definition;+ const handleAddCustomWidget = async (definitionId: string) => {+ if (!tryLockSelection(selectionLock)) return;+ setLoadingSelection(`custom:${definitionId}`);+ try {+ const definition = await loadWidgetDefinition("customApi");+ const itemId = createId();+ const defaultOptions = reduceWidgetOptionsWithDefinition(definition, settings);+ createItem({ id: itemId, kind: "customApi", integrationIds: [] });+ updateItemOptions({ itemId, newOptions: { ...defaultOptions, definitionId } });+ actions.closeModal();+ } catch (error) {+ notifyDefinitionLoadError(error);+ } finally {+ unlockSelection(selectionLock);+ setLoadingSelection(null);+ }+ };- const matchingIntegrations = hasIntegrationSupport- ? (integrationData ?? []).filter((integration) =>- (definition.supportedIntegrations as string[]).includes(integration.kind),- )- : [];+ const handleAdd = async (kind: WidgetKind) => {+ if (!tryLockSelection(selectionLock)) return;+ setLoadingSelection(kind);+ preloadWidgetEditModal();+ try {+ const definition = await loadWidgetDefinition(kind);+ const hasIntegrationSupport = "supportedIntegrations" in definition;- const integrationIds = matchingIntegrations.map((i) => i.id);- const itemId = createId();- const defaultOptions = reduceWidgetOptionsWithDefaultValues(kind, settings);+ const matchingIntegrations = await resolveMatchingIntegrationsAsync({+ hasIntegrationSupport,+ supportedIntegrations: definition.supportedIntegrations ?? [],+ currentData: integrationData,+ ensureDataAsync: ensureIntegrationDataAsync,+ });- createItem({ id: itemId, kind, integrationIds });- actions.closeModal();+ const integrationIds = matchingIntegrations.map((i) => i.id);+ const itemId = createId();+ const defaultOptions = reduceWidgetOptionsWithDefinition(definition, settings);- openEditModal(- {- kind,- value: {- advancedOptions: { title: null, customCssClasses: [], borderColor: "" },- options: defaultOptions,- integrationIds,+ createItem({ id: itemId, kind, integrationIds });+ actions.closeModal();++ openEditModal(+ {+ kind,+ definition,+ value: {+ advancedOptions: { title: null, customCssClasses: [], borderColor: "" },+ options: defaultOptions,+ integrationIds,+ },+ onSuccessfulEdit: ({ options, integrationIds: newIntegrationIds, advancedOptions }) => {+ updateItemOptions({ itemId, newOptions: options });+ updateItemAdvancedOptions({ itemId, newAdvancedOptions: advancedOptions });+ updateItemIntegrations({ itemId, newIntegrations: newIntegrationIds });+ },+ integrationData: matchingIntegrations,+ integrationSupport: hasIntegrationSupport,+ settings,},- onSuccessfulEdit: ({ options, integrationIds: newIntegrationIds, advancedOptions }) => {- updateItemOptions({ itemId, newOptions: options });- updateItemAdvancedOptions({ itemId, newAdvancedOptions: advancedOptions });- updateItemIntegrations({ itemId, newIntegrations: newIntegrationIds });+ {+ title: (titleT) => `${titleT("item.edit.title")} - ${titleT(`widget.${kind}.name`)}`,},- integrationData: matchingIntegrations,- integrationSupport: hasIntegrationSupport,- settings,- },- {- title: (titleT) => `${titleT("item.edit.title")} - ${titleT(`widget.${kind}.name`)}`,- },- );+ );+ } catch (error) {+ notifyDefinitionLoadError(error);+ } finally {+ unlockSelection(selectionLock);+ setLoadingSelection(null);+ }};return (@@ -120,9 +168,9 @@ export const ItemSelectModal = createModal<void>(({ actions }) => {onSearchChange={setSearch}placeholder={`${t("item.create.search")}...`}onSearchKeyDown={(event) => {- if (event.key === "Enter" && filteredItems.length === 1) {- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion- handleAdd(filteredItems[0]!.kind);+ if (event.key === "Enter" && loadingSelection === null && filteredItems.length === 1) {+ const [item] = filteredItems;+ if (item) void handleAdd(item.kind);}}}>@@ -130,7 +178,13 @@ export const ItemSelectModal = createModal<void>(({ actions }) => {<WidgetItemkey={item.kind}item={item}- onSelect={() => handleAdd(item.kind)}+ onSelect={() => void handleAdd(item.kind)}+ onIntent={() => {+ void loadWidgetDefinition(item.kind).catch(() => undefined);+ preloadWidgetEditModal();+ }}+ disabled={loadingSelection !== null}+ loading={loadingSelection === item.kind}hasMatchingIntegration={item.supportedIntegrations.some((kind) => availableKinds.has(kind))}/>))}@@ -146,12 +200,12 @@ export const ItemSelectModal = createModal<void>(({ actions }) => {{filteredCustomWidgets.map((def) => (<Cardkey={def.id}+ className={classes.card}h={selectGridCardHeight}withBorderpos="relative"- style={{ overflow: "hidden", "--_hover-opacity": "0" }}- onMouseEnter={(e) => e.currentTarget.style.setProperty("--_hover-opacity", "1")}- onMouseLeave={(e) => e.currentTarget.style.setProperty("--_hover-opacity", "0")}+ style={{ overflow: "hidden" }}+ onPointerEnter={() => void loadWidgetDefinition("customApi").catch(() => undefined)}><Stack h="100%" gap="xs"><Group gap="sm" wrap="nowrap" align="flex-start">@@ -169,18 +223,24 @@ export const ItemSelectModal = createModal<void>(({ actions }) => {</Text></Stack><Box+ className={classes.action}pos="absolute"bottom={0}left={0}right={0}p="xs"style={{- opacity: "var(--_hover-opacity)",- transition: "opacity 150ms ease",background: "linear-gradient(transparent, var(--mantine-color-body) 30%)",}}>- <Button onClick={() => handleAddCustomWidget(def.id)} variant="light" size="xs" fullWidth>+ <Button+ onClick={() => void handleAddCustomWidget(def.id)}+ variant="light"+ size="xs"+ fullWidth+ disabled={loadingSelection !== null}+ loading={loadingSelection === `custom:${def.id}`}+ >{t("item.create.addToBoard")}</Button></Box>@@ -196,7 +256,24 @@ export const ItemSelectModal = createModal<void>(({ actions }) => {)}</SelectGridLayout>);-}).withOptions({+};++const ItemSelectModalFrame = (props: Pick<ItemSelectModalContentProps, "actions" | "innerProps">) => {+ const utils = clientApi.useUtils();+ const { data: integrationData } = clientApi.integration.all.useQuery();+ const { data: customWidgetDefs } = clientApi.customWidget.all.useQuery();++ return (+ <ItemSelectModalContent+ {...props}+ integrationData={integrationData}+ customWidgetDefs={customWidgetDefs}+ ensureIntegrationDataAsync={() => utils.integration.all.ensureData()}+ />+ );+};++export const ItemSelectModal = createModal<void>((props) => <ItemSelectModalFrame {...props} />).withOptions({defaultTitle: (t) => t("item.create.title"),size: modalSizeSelect,});@@ -204,6 +281,9 @@ export const ItemSelectModal = createModal<void>(({ actions }) => {const WidgetItem = ({item,onSelect,+ onIntent,+ disabled,+ loading,hasMatchingIntegration,}: {item: {@@ -214,23 +294,27 @@ const WidgetItem = ({icon: TablerIcon;};onSelect: () => void;+ onIntent: () => void;+ disabled: boolean;+ loading: boolean;hasMatchingIntegration: boolean;}) => {const t = useI18n();return (<Card+ className={classes.card}h={selectGridCardHeight}withBorderpos="relative"style={{overflow: "hidden",- "--_hover-opacity": "0",borderColor: hasMatchingIntegration ? "var(--mantine-color-blue-6)" : undefined,borderWidth: hasMatchingIntegration ? 2 : undefined,}}- onMouseEnter={(e) => e.currentTarget.style.setProperty("--_hover-opacity", "1")}- onMouseLeave={(e) => e.currentTarget.style.setProperty("--_hover-opacity", "0")}+ onFocus={onIntent}+ onPointerEnter={onIntent}+ aria-busy={loading || undefined}><Stack h="100%" gap="xs"><Group gap="sm" wrap="nowrap" align="flex-start">@@ -247,18 +331,17 @@ const WidgetItem = ({<SupportedIntegrations integrations={item.supportedIntegrations} /></Stack><Box+ className={classes.action}pos="absolute"bottom={0}left={0}right={0}p="xs"style={{- opacity: "var(--_hover-opacity)",- transition: "opacity 150ms ease",background: "linear-gradient(transparent, var(--mantine-color-body) 30%)",}}>- <Button onClick={onSelect} variant="light" size="xs" fullWidth>+ <Button onClick={onSelect} variant="light" size="xs" fullWidth disabled={disabled} loading={loading}>{t(`item.create.addToBoard`)}</Button></Box>diff --git a/apps/nextjs/src/components/board/items/lazy-item-move-modal.tsx b/apps/nextjs/src/components/board/items/lazy-item-move-modal.tsxnew file mode 100644index 000000000..836017bc1--- /dev/null+++ b/apps/nextjs/src/components/board/items/lazy-item-move-modal.tsx@@ -0,0 +1,67 @@+"use client";++import { Suspense, use } from "react";+import { Center, Loader } from "@mantine/core";+import { ErrorBoundary } from "react-error-boundary";++import { createModal, modalSizeForm } from "@homarr/modals";+import { WidgetError } from "@homarr/widgets/errors";++import type { ItemMoveModalProps } from "./item-move-modal";++let itemMoveModalPromise: Promise<typeof import("./item-move-modal")> | undefined;++const loadItemMoveModal = () => {+ if (itemMoveModalPromise) return itemMoveModalPromise;++ const currentPromise = import("./item-move-modal");+ itemMoveModalPromise = currentPromise;+ void currentPromise.catch(() => {+ if (itemMoveModalPromise === currentPromise) itemMoveModalPromise = undefined;+ });+ return currentPromise;+};++export const preloadItemMoveModal = () => void loadItemMoveModal().catch(() => undefined);++interface LazyItemMoveModalContentProps {+ actions: { closeModal: () => void };+ innerProps: ItemMoveModalProps;+}++const LazyItemMoveModalContent = (props: LazyItemMoveModalContentProps) => {+ const { ItemMoveModal } = use(loadItemMoveModal());+ const Component = ItemMoveModal.component;+ return <Component {...props} />;+};++export const LazyItemMoveModal = createModal<ItemMoveModalProps>((props) => (+ <ErrorBoundary+ fallbackRender={({ error, resetErrorBoundary }) => (+ <Center py="xl">+ <WidgetError+ error={error}+ resetErrorBoundary={() => {+ itemMoveModalPromise = undefined;+ resetErrorBoundary();+ }}+ />+ </Center>+ )}+ >+ <Suspense+ fallback={+ <Center py="xl">+ <Loader size="sm" />+ </Center>+ }+ >+ <LazyItemMoveModalContent {...props} />+ </Suspense>+ </ErrorBoundary>+)).withOptions({+ defaultTitle(t) {+ return t("item.moveResize.title");+ },+ size: modalSizeForm,+});diff --git a/apps/nextjs/src/components/board/items/lazy-widget-edit-modal.tsx b/apps/nextjs/src/components/board/items/lazy-widget-edit-modal.tsxnew file mode 100644index 000000000..fb7a26bcd--- /dev/null+++ b/apps/nextjs/src/components/board/items/lazy-widget-edit-modal.tsx@@ -0,0 +1,68 @@+"use client";++import { Suspense, use } from "react";+import { Center, Loader } from "@mantine/core";+import { ErrorBoundary } from "react-error-boundary";++import type { WidgetKind } from "@homarr/definitions";+import { createModal, modalSizeForm } from "@homarr/modals";+import { WidgetError } from "@homarr/widgets/errors";+import type { WidgetEditModalProps } from "@homarr/widgets/modals";++let widgetEditModalPromise: Promise<typeof import("@homarr/widgets/modals")> | undefined;++export const loadWidgetEditModal = () => {+ if (widgetEditModalPromise) return widgetEditModalPromise;++ const currentPromise = import("@homarr/widgets/modals");+ widgetEditModalPromise = currentPromise;+ void currentPromise.catch(() => {+ if (widgetEditModalPromise === currentPromise) widgetEditModalPromise = undefined;+ });+ return currentPromise;+};++export const preloadWidgetEditModal = () => void loadWidgetEditModal().catch(() => undefined);++interface LazyWidgetEditModalContentProps {+ actions: { closeModal: () => void };+ innerProps: WidgetEditModalProps<WidgetKind>;+}++const LazyWidgetEditModalContent = (props: LazyWidgetEditModalContentProps) => {+ const { WidgetEditModal } = use(loadWidgetEditModal());+ const Component = WidgetEditModal.component;+ return <Component {...props} />;+};++export const LazyWidgetEditModal = createModal<WidgetEditModalProps<WidgetKind>>((props) => (+ <ErrorBoundary+ fallbackRender={({ error, resetErrorBoundary }) => (+ <Center py="xl">+ <WidgetError+ error={error}+ resetErrorBoundary={() => {+ widgetEditModalPromise = undefined;+ resetErrorBoundary();+ }}+ />+ </Center>+ )}+ >+ <Suspense+ fallback={+ <Center py="xl">+ <Loader size="sm" />+ </Center>+ }+ >+ <LazyWidgetEditModalContent {...props} />+ </Suspense>+ </ErrorBoundary>+)).withOptions({+ keepMounted: true,+ defaultTitle(t) {+ return t("item.edit.title");+ },+ size: modalSizeForm,+});diff --git a/apps/nextjs/src/components/board/items/widget-context-menu.tsx b/apps/nextjs/src/components/board/items/widget-context-menu.tsxindex 8520d6b89..3b844874f 100644--- a/apps/nextjs/src/components/board/items/widget-context-menu.tsx+++ b/apps/nextjs/src/components/board/items/widget-context-menu.tsx@@ -1,7 +1,7 @@"use client";import type { MutableRefObject, ReactNode } from "react";-import { useCallback, useMemo } from "react";+import { useCallback, useMemo, useState } from "react";import { Group, Loader, Menu, Switch, Text, Tooltip } from "@mantine/core";import {IconAlertTriangle,@@ -13,7 +13,7 @@ import {IconTrash,} from "@tabler/icons-react";import type { QueryClient, QueryKey } from "@tanstack/react-query";-import { useIsFetching, useQueryClient } from "@tanstack/react-query";+import { partialMatchKey, useIsFetching, useQueryClient } from "@tanstack/react-query";import { clientApi } from "@homarr/api/client";import { useSession } from "@homarr/auth/client";@@ -25,63 +25,116 @@ import { useSettings } from "@homarr/settings";import { translateIfNecessary } from "@homarr/translation";import { useI18n, useScopedI18n } from "@homarr/translation/client";import type { TranslationFunction } from "@homarr/translation";-import type { WidgetContextMenuAction } from "@homarr/widgets";-import { reduceWidgetOptionsWithDefaultValues, widgetImports } from "@homarr/widgets";-import { WidgetEditModal } from "@homarr/widgets/modals";+import type { WidgetContextMenuAction, WidgetDefinition } from "@homarr/widgets/definition";+import { getWidgetQueryKeys } from "@homarr/widgets/definition";+import { reduceWidgetOptionsWithDefinition } from "@homarr/widgets/manifest";import type { SectionItem } from "~/app/[locale]/boards/_types";import { useSectionContext } from "../sections/section-context";import { useItemActions } from "./item-actions";-import { ItemMoveModal } from "./item-move-modal";+import { LazyItemMoveModal, preloadItemMoveModal } from "./lazy-item-move-modal";+import { LazyWidgetEditModal, preloadWidgetEditModal } from "./lazy-widget-edit-modal";interface WidgetContextMenuProps {item: SectionItem;+ definition: WidgetDefinition;widgetStateRef: MutableRefObject<Record<string, unknown> | null>;children: ReactNode;}-export const WidgetContextMenu = ({ item, widgetStateRef, children }: WidgetContextMenuProps) => {+export const WidgetContextMenu = ({ item, definition, widgetStateRef, children }: WidgetContextMenuProps) => {const { data: session } = useSession();+ const settings = useSettings();++ if (!session || !settings.enableRightClickOnWidgets) return <>{children}</>;++ return (+ <WidgetContextMenuInner item={item} definition={definition} widgetStateRef={widgetStateRef} settings={settings}>+ {children}+ </WidgetContextMenuInner>+ );+};++const WidgetContextMenuInner = ({+ item,+ definition,+ widgetStateRef,+ children,+ settings,+}: WidgetContextMenuProps & { settings: ReturnType<typeof useSettings> }) => {+ const [isMenuOpen, setIsMenuOpen] = useState(false);++ return (+ <Menu+ shadow="md"+ width={300}+ closeOnItemClick={false}+ position="right-start"+ offset={4}+ opened={isMenuOpen}+ onChange={setIsMenuOpen}+ >+ <Menu.ContextMenu>{children}</Menu.ContextMenu>+ <Menu.Dropdown>+ {isMenuOpen && (+ <WidgetContextMenuDropdown+ item={item}+ definition={definition}+ widgetStateRef={widgetStateRef}+ settings={settings}+ />+ )}+ </Menu.Dropdown>+ </Menu>+ );+};++type WidgetContextMenuDropdownProps = Omit<WidgetContextMenuProps, "children"> & {+ settings: ReturnType<typeof useSettings>;+};++const WidgetContextMenuDropdown = ({ item, definition, widgetStateRef, settings }: WidgetContextMenuDropdownProps) => {const [isEditMode] = useEditMode();const board = useRequiredBoard();const tItem = useScopedI18n("item");const tMenu = useScopedI18n("item.menu.label");const t = useI18n();- const settings = useSettings();- const isRightClickEnabled = settings.enableRightClickOnWidgets;- const { openModal } = useModalAction(WidgetEditModal);- const { openModal: openMoveModal } = useModalAction(ItemMoveModal);+ const hasSupportedIntegrations =+ "supportedIntegrations" in definition && (definition.supportedIntegrations?.length ?? 0) > 0;+ const { openModal } = useModalAction(LazyWidgetEditModal);+ const { openModal: openMoveModal } = useModalAction(LazyItemMoveModal);const { openConfirmModal } = useConfirmModal();const { updateItemOptions, updateItemAdvancedOptions, updateItemIntegrations, duplicateItem, removeItem } =useItemActions();- const { data: integrationData, isPending } = clientApi.integration.all.useQuery();+ const { data: integrationData, isPending } = clientApi.integration.all.useQuery(undefined, {+ enabled: hasSupportedIntegrations,+ });const { mutate: saveBoard } = clientApi.board.saveBoard.useMutation();- const currentDefinition = useMemo(() => widgetImports[item.kind].definition, [item.kind]);const { gridstack } = useSectionContext().refs;const queryClient = useQueryClient();- const widgetQueryKey = useMemo(- () => ("queryKey" in currentDefinition ? (currentDefinition.queryKey as QueryKey) : [["widget", item.kind]]),- [currentDefinition, item.kind],- );- const isWidgetFetching = useIsFetching({ queryKey: widgetQueryKey }) > 0;+ const widgetQueryKeys = useMemo(() => getWidgetQueryKeys(definition, item.kind), [definition, item.kind]);+ const isWidgetFetching =+ useIsFetching({+ predicate: (query) => widgetQueryKeys.some((queryKey) => partialMatchKey(query.queryKey, queryKey)),+ }) > 0;const handleRefetch = useCallback(() => {- void queryClient.refetchQueries({ queryKey: widgetQueryKey, type: "all" });- }, [queryClient, widgetQueryKey]);+ void Promise.all(widgetQueryKeys.map((queryKey) => queryClient.refetchQueries({ queryKey, type: "all" })));+ }, [queryClient, widgetQueryKeys]);const options = useMemo(- () => reduceWidgetOptionsWithDefaultValues(item.kind, settings, item.options) as Record<string, unknown>,- [item.kind, settings, item.options],+ () => reduceWidgetOptionsWithDefinition(definition, settings, item.options),+ [definition, settings, item.options],);type OptionDef = { type: string; skipContextMenu?: boolean };const toggleOptions = useMemo(() => {- const rawOptions = currentDefinition.createOptions(settings) as unknown as Record<string, OptionDef>;+ const rawOptions = definition.createOptions(settings) as unknown as Record<string, OptionDef>;return Object.entries(rawOptions).filter(([, def]) => def.type === "switch" && !def.skipContextMenu);- }, [currentDefinition, settings]);+ }, [definition, settings]);const widgetContextActions = useMemo(() => {- const def = currentDefinition as Record<string, unknown>;+ const def = definition as unknown as Record<string, unknown>;if (typeof def.contextActions !== "function") return [];// eslint-disable-next-line @typescript-eslint/no-explicit-anyconst actions = (def.contextActions as any)({@@ -94,7 +147,7 @@ export const WidgetContextMenu = ({ item, widgetStateRef, children }: WidgetContwidgetStateRef,});return (Array.isArray(actions) ? actions : []) as WidgetContextMenuAction[];- }, [currentDefinition, options, item, updateItemOptions, isEditMode, board.id, widgetStateRef]);+ }, [definition, options, item, updateItemOptions, isEditMode, board.id, widgetStateRef]);const persistBoard = useCallback((updatedItems: typeof board.items) => {@@ -107,6 +160,7 @@ export const WidgetContextMenu = ({ item, widgetStateRef, children }: WidgetContopenModal({kind: item.kind,+ definition,value: {advancedOptions: item.advancedOptions,options: item.options,@@ -133,10 +187,10 @@ export const WidgetContextMenu = ({ item, widgetStateRef, children }: WidgetCont},integrationData: (integrationData ?? []).filter((integration) =>- "supportedIntegrations" in currentDefinition &&- (currentDefinition.supportedIntegrations as string[]).some((kind) => kind === integration.kind),+ "supportedIntegrations" in definition &&+ (definition.supportedIntegrations as string[]).some((kind) => kind === integration.kind),),- integrationSupport: "supportedIntegrations" in currentDefinition,+ integrationSupport: "supportedIntegrations" in definition,settings,appId: item.kind === "app" ? (item.options.appId as string | undefined) : undefined,},@@ -150,7 +204,7 @@ export const WidgetContextMenu = ({ item, widgetStateRef, children }: WidgetContupdateItemAdvancedOptions,updateItemIntegrations,integrationData,- currentDefinition,+ definition,settings,isEditMode,persistBoard,@@ -168,135 +222,133 @@ export const WidgetContextMenu = ({ item, widgetStateRef, children }: WidgetCont[options, item.id, updateItemOptions, persistBoard, board],);- if (!session) return <>{children}</>;- if (!isRightClickEnabled) return <>{children}</>;-const visibleWidgetActions = widgetContextActions.filter((a) => !a.hidden);return (- <Menu shadow="md" width={300} closeOnItemClick={false} position="right-start" offset={4}>- <Menu.ContextMenu>{children}</Menu.ContextMenu>- <Menu.Dropdown>- {toggleOptions.length > 0 && (- <>- <Menu.Label>{tMenu("options")}</Menu.Label>- {toggleOptions.map(([key]) => (- <Menu.Item key={key} onClick={() => handleToggle(key)(!options[key])}>- {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}- <Group wrap="nowrap">- {String(translateIfNecessary(t, ((fn: any) => fn(`widget.${item.kind}.option.${key}.label`)) as any))}- <Switch size="xs" checked={Boolean(options[key])} readOnly tabIndex={-1} ml="auto" />- </Group>- </Menu.Item>- ))}- </>- )}-- {visibleWidgetActions.length > 0 && (- <>- {toggleOptions.length > 0 && <Menu.Divider />}- <Menu.Label>{tMenu("actions")}</Menu.Label>- {visibleWidgetActions.map((action) => {- const Icon = action.icon;- return (- <Menu.Item- key={action.key}- closeMenuOnClick- leftSection={Icon ? <Icon size={16} /> : undefined}- onClick={action.onClick}- disabled={action.disabled}- color={action.color}- >- {String(translateIfNecessary(t, action.label))}- </Menu.Item>- );- })}- </>- )}-- {isEditMode && (- <>- {(toggleOptions.length > 0 || visibleWidgetActions.length > 0) && <Menu.Divider />}- <Menu.Item- closeMenuOnClick- leftSection={<IconLayoutKanban size={16} />}- onClick={() => {- if (!gridstack.current) return;- openMoveModal({ item, columnCount: gridstack.current.getColumn(), gridStack: gridstack.current });- }}- >- {tItem("action.moveResize")}- </Menu.Item>- <Menu.Item- closeMenuOnClick- leftSection={<IconCopy size={16} />}- onClick={() => duplicateItem({ itemId: item.id })}- >- {tItem("action.duplicate")}+ <>+ {toggleOptions.length > 0 && (+ <>+ <Menu.Label>{tMenu("options")}</Menu.Label>+ {toggleOptions.map(([key]) => (+ <Menu.Item key={key} onClick={() => handleToggle(key)(!options[key])}>+ {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}+ <Group wrap="nowrap">+ {String(translateIfNecessary(t, ((fn: any) => fn(`widget.${item.kind}.option.${key}.label`)) as any))}+ <Switch size="xs" checked={Boolean(options[key])} readOnly tabIndex={-1} ml="auto" />+ </Group></Menu.Item>- </>- )}+ ))}+ </>+ )}++ {visibleWidgetActions.length > 0 && (+ <>+ {toggleOptions.length > 0 && <Menu.Divider />}+ <Menu.Label>{tMenu("actions")}</Menu.Label>+ {visibleWidgetActions.map((action) => {+ const Icon = action.icon;+ return (+ <Menu.Item+ key={action.key}+ closeMenuOnClick+ leftSection={Icon ? <Icon size={16} /> : undefined}+ onClick={action.onClick}+ disabled={action.disabled}+ color={action.color}+ >+ {String(translateIfNecessary(t, action.label))}+ </Menu.Item>+ );+ })}+ </>+ )}+ {isEditMode && (<>- {(toggleOptions.length > 0 || visibleWidgetActions.length > 0 || isEditMode) && <Menu.Divider />}+ {(toggleOptions.length > 0 || visibleWidgetActions.length > 0) && <Menu.Divider />}<Menu.Item- leftSection={isWidgetFetching ? <Loader size={16} /> : <IconRefresh size={16} />}- onClick={handleRefetch}- disabled={isWidgetFetching}+ closeMenuOnClick+ leftSection={<IconLayoutKanban size={16} />}+ onFocus={preloadItemMoveModal}+ onPointerEnter={preloadItemMoveModal}+ onClick={() => {+ if (!gridstack.current) return;+ openMoveModal({ item, columnCount: gridstack.current.getColumn(), gridStack: gridstack.current });+ }}>- <Group justify="space-between" wrap="nowrap" gap="sm">- {tMenu("refresh")}- <WidgetQueryStatus- queryClient={queryClient}- queryKey={widgetQueryKey}- isFetching={isWidgetFetching}- t={t}- />- </Group>+ {tItem("action.moveResize")}</Menu.Item><Menu.ItemcloseMenuOnClick- leftSection={<IconSettings size={16} />}- onClick={openEditModal}- disabled={isPending}+ leftSection={<IconCopy size={16} />}+ onClick={() => duplicateItem({ itemId: item.id })}>- {tMenu("settings")}+ {tItem("action.duplicate")}</Menu.Item></>+ )}- {isEditMode && (- <>- <Menu.Divider />- <Menu.Item- closeMenuOnClick- color="red"- leftSection={<IconTrash size={16} />}- onClick={() => {- openConfirmModal({- title: tItem("remove.title"),- children: tItem("remove.message"),- onConfirm: () => removeItem({ itemId: item.id }),- });- }}- >- {tItem("action.remove")}- </Menu.Item>- </>- )}- </Menu.Dropdown>- </Menu>+ <>+ {(toggleOptions.length > 0 || visibleWidgetActions.length > 0 || isEditMode) && <Menu.Divider />}+ <Menu.Item+ leftSection={isWidgetFetching ? <Loader size={16} /> : <IconRefresh size={16} />}+ onClick={handleRefetch}+ disabled={isWidgetFetching}+ >+ <Group justify="space-between" wrap="nowrap" gap="sm">+ {tMenu("refresh")}+ <WidgetQueryStatus+ queryClient={queryClient}+ queryKeys={widgetQueryKeys}+ isFetching={isWidgetFetching}+ t={t}+ />+ </Group>+ </Menu.Item>+ <Menu.Item+ closeMenuOnClick+ leftSection={<IconSettings size={16} />}+ onClick={openEditModal}+ onFocus={preloadWidgetEditModal}+ onPointerEnter={preloadWidgetEditModal}+ disabled={hasSupportedIntegrations && isPending}+ >+ {tMenu("settings")}+ </Menu.Item>+ </>++ {isEditMode && (+ <>+ <Menu.Divider />+ <Menu.Item+ closeMenuOnClick+ color="red"+ leftSection={<IconTrash size={16} />}+ onClick={() => {+ openConfirmModal({+ title: tItem("remove.title"),+ children: tItem("remove.message"),+ onConfirm: () => removeItem({ itemId: item.id }),+ });+ }}+ >+ {tItem("action.remove")}+ </Menu.Item>+ </>+ )}+ </>);};interface WidgetQueryStatusProps {queryClient: QueryClient;- queryKey: QueryKey;+ queryKeys: QueryKey[];isFetching: boolean;t: TranslationFunction;}-const WidgetQueryStatus = ({ queryClient, queryKey, isFetching, t }: WidgetQueryStatusProps) => {- const queries = queryClient.getQueryCache().findAll({ queryKey });+const WidgetQueryStatus = ({ queryClient, queryKeys, isFetching, t }: WidgetQueryStatusProps) => {+ const queries = [...new Set(queryKeys.flatMap((queryKey) => queryClient.getQueryCache().findAll({ queryKey })))];const timestamps = queries.map((query) => query.state.dataUpdatedAt).filter(Boolean);const latest = timestamps.length > 0 ? Math.max(...timestamps) : 0;const ageLabel = useTimeAgo(new Date(latest));@@ -334,7 +386,8 @@ const WidgetQueryStatus = ({ queryClient, queryKey, isFetching, t }: WidgetQuery<Group gap={4} wrap="nowrap"><IconAlertTriangle size={12} color="var(--mantine-color-red-6)" /><Text size="xs" c="red.6">- {t("item.menu.status.error")} · {ageLabel}+ {t("item.menu.status.error")}+ {latest > 0 && ` · ${ageLabel}`}</Text></Group></Tooltip>@@ -345,7 +398,8 @@ const WidgetQueryStatus = ({ queryClient, queryKey, isFetching, t }: WidgetQuery<Group gap={4} wrap="nowrap"><IconCircleCheck size={12} color="var(--mantine-color-green-6)" /><Text size="xs" c="dimmed">- {t("item.menu.status.success")} · {ageLabel}+ {t("item.menu.status.success")}+ {latest > 0 && ` · ${ageLabel}`}</Text></Group>);diff --git a/apps/nextjs/src/components/board/items/widget-hover-metadata.ts b/apps/nextjs/src/components/board/items/widget-hover-metadata.tsdeleted file mode 100644index 22a75c9b3..000000000--- a/apps/nextjs/src/components/board/items/widget-hover-metadata.ts+++ /dev/null@@ -1,155 +0,0 @@-import { objectEntries } from "@homarr/common";-import type { IntegrationKind, WidgetKind } from "@homarr/definitions";-import type { SettingsContextProps } from "@homarr/settings/creator";-import type { WidgetOptionDefinition, WidgetOptionType } from "@homarr/widgets";-import { reduceWidgetOptionsWithDefaultValues, widgetImports } from "@homarr/widgets";--import type { SectionItem } from "~/app/[locale]/boards/_types";--export type Translator = {- (key: string): string;-};--export interface HoverMetadataItem {- label: string;- value: string;-}--const maxMetadataItems = 3;--const skippedOptionTypes: Partial<Record<WidgetOptionType, true>> = {- app: true,- anchorNote: true,- dynamicSelect: true,- sortableItemList: true,- multiReleasesRepositories: true,- umamiEventName: true,- umamiEventNames: true,- umamiWebsite: true,-};--const isEqualValue = (left: unknown, right: unknown) => JSON.stringify(left) === JSON.stringify(right);--type OptionDefinitionWithRules = WidgetOptionDefinition & {- shouldHide?: (options: never, integrationKinds: IntegrationKind[]) => boolean;- options?: readonly { value: unknown; label: unknown }[];-};--type OptionFormatter = (value: unknown, definition: OptionDefinitionWithRules, t: Translator) => string | null;--const resolveSelectLabel = (value: unknown, definition: OptionDefinitionWithRules, t: Translator) => {- const match = definition.options?.find((option) => option.value === value);- const label = match?.label;- const fallbackLabel = () => String(value);- const labelResolvers: Record<string, () => string> = {- function: () => (label as (translator: Translator) => string)(t),- string: () => label as string,- missing: fallbackLabel,- };- const labelType = typeof label;- const resolveLabel: () => string = labelResolvers[labelType] ?? fallbackLabel;- return resolveLabel();-};--const optionTypeFormatters: Partial<Record<WidgetOptionType, OptionFormatter>> = {- switch: (value, _, t) => {- const switchLabels: Record<string, string> = {- true: t("common.action.show"),- false: t("common.action.hide"),- };- return switchLabels[String(Boolean(value))] ?? null;- },- text: (value) => {- const text = String(value).trim();- return text.length > 0 ? text : null;- },- number: (value) => String(value),- slider: (value) => String(value),- select: (value, definition, t) => resolveSelectLabel(value, definition, t),- multiSelect: (value) => {- const items = value as unknown[];- return items.length > 0 ? String(items.length) : null;- },- multiText: (value) => {- const items = (value as string[]).filter((entry) => entry.trim().length > 0);- return items.length > 0 ? items.join(", ") : null;- },- location: (value) => {- const location = value as { name?: string };- const name = location.name?.trim() ?? "";- return name.length > 0 ? name : null;- },-};--const formatOptionValue = (- type: WidgetOptionType,- value: unknown,- definition: OptionDefinitionWithRules,- t: Translator,-) => {- const formatter = optionTypeFormatters[type];- return formatter?.(value, definition, t) ?? null;-};--const getOptionLabel = (kind: WidgetKind, key: string, t: Translator) => {- const labelKey = `widget.${kind}.option.${key}.label`;- const translated = t(labelKey);- return translated === labelKey ? key : translated;-};--export const collectWidgetHoverMetadata = (- item: SectionItem,- settings: Pick<SettingsContextProps, "enableStatusByDefault" | "forceDisableStatus">,- integrationKinds: IntegrationKind[],- t: Translator,-): HoverMetadataItem[] => {- const { definition } = widgetImports[item.kind];- const optionDefinitions = definition.createOptions(settings) as Record<string, OptionDefinitionWithRules>;- const resolvedOptions = reduceWidgetOptionsWithDefaultValues(item.kind, settings, item.options);-- return objectEntries(optionDefinitions)- .filter(([key, optionDefinition]) => {- const skip = skippedOptionTypes[optionDefinition.type];- const hidden = optionDefinition.shouldHide?.(resolvedOptions as never, integrationKinds);- const unchanged = isEqualValue(resolvedOptions[key], optionDefinition.defaultValue);- return !skip && !hidden && !unchanged;- })- .map(([key, optionDefinition]) => {- const formattedValue = formatOptionValue(optionDefinition.type, resolvedOptions[key], optionDefinition, t);- return {- label: getOptionLabel(item.kind, key, t),- value: formattedValue ?? "",- };- })- .filter((entry) => entry.value.length > 0)- .slice(0, maxMetadataItems);-};--interface DisplayNameSource {- matches: (item: SectionItem, options: Record<string, unknown>) => boolean;- resolve: (item: SectionItem, options: Record<string, unknown>) => string;-}--const displayNameSources: DisplayNameSource[] = [- {- matches: (item) => Boolean(item.advancedOptions.title?.trim()),- resolve: (item) => item.advancedOptions.title?.trim() ?? "",- },- {- matches: (item, options) =>- item.kind === "clock" &&- Boolean(options.customTitleToggle) &&- String(options.customTitle ?? "").trim().length > 0,- resolve: (_, options) => String(options.customTitle).trim(),- },-];--export const resolveWidgetDisplayName = (- item: SectionItem,- settings: Pick<SettingsContextProps, "enableStatusByDefault" | "forceDisableStatus">,- t: Translator,-) => {- const resolvedOptions = reduceWidgetOptionsWithDefaultValues(item.kind, settings, item.options);- const source = displayNameSources.find((entry) => entry.matches(item, resolvedOptions));- return source?.resolve(item, resolvedOptions) ?? t(`widget.${item.kind}.name`);-};diff --git a/apps/nextjs/src/components/board/items/widget-hover-overlay.tsx b/apps/nextjs/src/components/board/items/widget-hover-overlay.tsxindex 6fcdc4a93..6529eed12 100644--- a/apps/nextjs/src/components/board/items/widget-hover-overlay.tsx+++ b/apps/nextjs/src/components/board/items/widget-hover-overlay.tsx@@ -1,12 +1,13 @@"use client";+import { Suspense, use } from "react";import { Avatar, Text, Tooltip } from "@mantine/core";import type { RouterOutputs } from "@homarr/api";import { useEditMode } from "@homarr/boards/edit-mode";import { getIconUrl } from "@homarr/definitions";import { useI18n } from "@homarr/translation/client";-import { widgetImports } from "@homarr/widgets";+import { loadWidgetDefinition } from "@homarr/widgets/manifest";import type { SectionItem } from "~/app/[locale]/boards/_types";import classes from "./widget-hover-overlay.module.css";@@ -18,8 +19,19 @@ interface WidgetHoverOverlayProps {export const WidgetHoverOverlay = ({ item, integrations }: WidgetHoverOverlayProps) => {const [isEditMode] = useEditMode();++ if (!isEditMode) return null;++ return (+ <Suspense fallback={null}>+ <LoadedWidgetHoverOverlay item={item} integrations={integrations} />+ </Suspense>+ );+};++const LoadedWidgetHoverOverlay = ({ item, integrations }: WidgetHoverOverlayProps) => {const t = useI18n();- const { definition } = widgetImports[item.kind];+ const definition = use(loadWidgetDefinition(item.kind));const WidgetIcon = definition.icon;const displayName = item.advancedOptions.title?.trim() || t(`widget.${item.kind}.name`);@@ -28,10 +40,6 @@ export const WidgetHoverOverlay = ({ item, integrations }: WidgetHoverOverlayProitem.integrationIds.includes(integration.id),);- if (!isEditMode) {- return null;- }-return (<div className={classes.wrapper}><div className={classes.panel}>diff --git a/apps/nextjs/src/components/board/items/widget-query-recovery.spec.ts b/apps/nextjs/src/components/board/items/widget-query-recovery.spec.tsindex b666df4e9..dabb464f3 100644--- a/apps/nextjs/src/components/board/items/widget-query-recovery.spec.ts+++ b/apps/nextjs/src/components/board/items/widget-query-recovery.spec.ts@@ -1,27 +1,36 @@import { QueryClient } from "@tanstack/react-query";import { describe, expect, test } from "vitest";-import { removePersistedWidgetQueries } from "./widget-query-recovery";+import { removeWidgetDataQueries } from "./widget-query-recovery";-describe("removePersistedWidgetQueries", () => {- test("removes stale widget queries and allows fresh data to be fetched", async () => {+describe("removeWidgetDataQueries", () => {+ test("removes only the failed widget prefix and allows fresh data to be fetched", async () => {const queryClient = new QueryClient();const crashedWidgetQueryKey = [["widget", "mediaServer", "getCurrentStreams"], { input: {} }];+ const sameWidgetQueryKey = [["widget", "mediaServer", "getLibraries"], { input: {} }];+ const unrelatedWidgetQueryKey = [["widget", "calendar", "getEvents"], { input: {} }];+ const appQueryKey = [["app", "byId"], { input: {} }];const unrelatedQueryKey = [["user", "me"], { input: {} }];queryClient.setQueryData(crashedWidgetQueryKey, "stale");+ queryClient.setQueryData(sameWidgetQueryKey, "related");+ queryClient.setQueryData(unrelatedWidgetQueryKey, "other-widget");+ queryClient.setQueryData(appQueryKey, "app");queryClient.setQueryData(unrelatedQueryKey, "unrelated");- removePersistedWidgetQueries(queryClient);+ removeWidgetDataQueries(queryClient, [[["widget", "mediaServer"]]]);expect(queryClient.getQueryData(crashedWidgetQueryKey)).toBeUndefined();+ expect(queryClient.getQueryData(sameWidgetQueryKey)).toBeUndefined();+ expect(queryClient.getQueryData(unrelatedWidgetQueryKey)).toBe("other-widget");+ expect(queryClient.getQueryData(appQueryKey)).toBe("app");expect(queryClient.getQueryData(unrelatedQueryKey)).toBe("unrelated");await expect(queryClient.fetchQuery({ queryKey: crashedWidgetQueryKey, queryFn: () => Promise.resolve("fresh") }),).resolves.toBe("fresh");});- test("removes persisted queries outside the widget router", () => {+ test("uses an explicit supporting query prefix without purging other supporting data", () => {const queryClient = new QueryClient();const dockerQueryKey = [["docker", "getContainers"], { input: {} }];const appQueryKey = [["app", "byId"], { input: {} }];@@ -31,14 +40,14 @@ describe("removePersistedWidgetQueries", () => {queryClient.setQueryData(appQueryKey, "stale");queryClient.setQueryData(unrelatedQueryKey, "unrelated");- removePersistedWidgetQueries(queryClient);+ removeWidgetDataQueries(queryClient, [[["docker", "getContainers"]]]);expect(queryClient.getQueryData(dockerQueryKey)).toBeUndefined();- expect(queryClient.getQueryData(appQueryKey)).toBeUndefined();+ expect(queryClient.getQueryData(appQueryKey)).toBe("stale");expect(queryClient.getQueryData(unrelatedQueryKey)).toBe("unrelated");});- test("removes persisted widget queries when the widget kind and query path differ", () => {+ test("uses the definition query prefix when the widget kind and query path differ", () => {const queryClient = new QueryClient();const crashedWidgetQueryKey = [["widget", "anchorNotes", "getNote"], { input: {} }];const unrelatedQueryKey = [["user", "me"], { input: {} }];@@ -46,7 +55,7 @@ describe("removePersistedWidgetQueries", () => {queryClient.setQueryData(crashedWidgetQueryKey, "stale");queryClient.setQueryData(unrelatedQueryKey, "unrelated");- removePersistedWidgetQueries(queryClient);+ removeWidgetDataQueries(queryClient, [[["widget", "anchorNotes"]]]);expect(queryClient.getQueryData(crashedWidgetQueryKey)).toBeUndefined();expect(queryClient.getQueryData(unrelatedQueryKey)).toBe("unrelated");diff --git a/apps/nextjs/src/components/board/items/widget-query-recovery.ts b/apps/nextjs/src/components/board/items/widget-query-recovery.tsindex 800614bf4..9bb0b81c5 100644--- a/apps/nextjs/src/components/board/items/widget-query-recovery.ts+++ b/apps/nextjs/src/components/board/items/widget-query-recovery.ts@@ -1,7 +1,5 @@-import type { QueryClient } from "@tanstack/react-query";+import type { QueryClient, QueryKey } from "@tanstack/react-query";-import { isPersistableWidgetQueryKey } from "@homarr/api/query-cache";--export const removePersistedWidgetQueries = (queryClient: QueryClient) => {- queryClient.removeQueries({ predicate: (query) => isPersistableWidgetQueryKey(query.queryKey) });+export const removeWidgetDataQueries = (queryClient: QueryClient, queryKeys: QueryKey[]) => {+ queryKeys.forEach((queryKey) => queryClient.removeQueries({ queryKey }));};diff --git a/apps/nextjs/src/components/board/sections/category/category-menu-actions.tsx b/apps/nextjs/src/components/board/sections/category/category-menu-actions.tsxindex 906abdea6..894bcbad6 100644--- a/apps/nextjs/src/components/board/sections/category/category-menu-actions.tsx+++ b/apps/nextjs/src/components/board/sections/category/category-menu-actions.tsx@@ -105,12 +105,14 @@ export const useCategoryMenuActions = (category: CategorySection) => {const settings = useSettings();const openAllInNewTabs = useCallback(async () => {const currentLayoutId = getCurrentLayout(board);- const appIds = filterByItemKind(- board.items.filter(- (item) => item.layouts.find((layout) => layout.layoutId === currentLayoutId)?.sectionId === category.id,- ),- settings,- "app",+ const appIds = (+ await filterByItemKind(+ board.items.filter(+ (item) => item.layouts.find((layout) => layout.layoutId === currentLayoutId)?.sectionId === category.id,+ ),+ settings,+ "app",+ )).map((item) => {return item.options.appId;});diff --git a/apps/nextjs/src/components/board/sections/category/filter.ts b/apps/nextjs/src/components/board/sections/category/filter.tsindex 72bb4443f..3866a0075 100644--- a/apps/nextjs/src/components/board/sections/category/filter.ts+++ b/apps/nextjs/src/components/board/sections/category/filter.ts@@ -1,21 +1,23 @@import type { WidgetKind } from "@homarr/definitions";import type { SettingsContextProps } from "@homarr/settings/creator";-import type { WidgetComponentProps } from "@homarr/widgets";-import { reduceWidgetOptionsWithDefaultValues } from "@homarr/widgets";+import type { WidgetComponentProps } from "@homarr/widgets/definition";+import { loadWidgetDefinition, reduceWidgetOptionsWithDefinition } from "@homarr/widgets/manifest";import type { Item } from "~/app/[locale]/boards/_types";-export const filterByItemKind = <TKind extends WidgetKind>(+export const filterByItemKind = async <TKind extends WidgetKind>(items: Item[],settings: SettingsContextProps,kind: TKind,) => {+ const definition = await loadWidgetDefinition(kind);+return items.filter((item) => item.kind === kind).map((item) => ({...item,- options: reduceWidgetOptionsWithDefaultValues(- kind,+ options: reduceWidgetOptionsWithDefinition(+ definition,settings,item.options,) as WidgetComponentProps<TKind>["options"],diff --git a/apps/nextjs/src/components/board/sections/content.tsx b/apps/nextjs/src/components/board/sections/content.tsxindex ced30c796..aa3b5adc2 100644--- a/apps/nextjs/src/components/board/sections/content.tsx+++ b/apps/nextjs/src/components/board/sections/content.tsx@@ -4,6 +4,8 @@ import type { GridItemHTMLElement } from "@homarr/gridstack";import type { RouterOutputs } from "@homarr/api";import { clientApi } from "@homarr/api/client";+import { useSession } from "@homarr/auth/client";+import { useEditMode } from "@homarr/boards/edit-mode";import type { DynamicSectionItem, SectionItem } from "~/app/[locale]/boards/_types";import { BoardItemContent } from "../items/item-content";@@ -15,7 +17,11 @@ import { useSectionItems } from "./use-section-items";export const SectionContent = () => {const { innerSections, items, refs } = useSectionContext();- const { data: integrations } = clientApi.integration.all.useQuery();+ const { data: session } = useSession();+ const [isEditMode] = useEditMode();+ const { data: integrations } = clientApi.integration.all.useQuery(undefined, {+ enabled: Boolean(session) && isEditMode,+ });/*** IMPORTANT: THE ORDER OF THE BELOW ITEMS HAS TO MATCH THE ORDER OFdiff --git a/apps/nextjs/src/components/integration/integration-grid-shared.ts b/apps/nextjs/src/components/integration/integration-grid-shared.tsindex 7451af1e7..03056c130 100644--- a/apps/nextjs/src/components/integration/integration-grid-shared.ts+++ b/apps/nextjs/src/components/integration/integration-grid-shared.ts@@ -1,4 +1,3 @@-import { objectEntries } from "@homarr/common";import type { IntegrationKind, WidgetKind } from "@homarr/definitions";import {featuredIntegrations,@@ -6,30 +5,8 @@ import {hiddenFromOnboarding,integrationDefs,integrationKinds,+ getWidgetKindsForIntegration,} from "@homarr/definitions";-import { widgetImports } from "@homarr/widgets";--const buildWidgetsByIntegration = () => {- const map = Object.fromEntries(integrationKinds.map((kind) => [kind, [] as WidgetKind[]])) as Record<- IntegrationKind,- WidgetKind[]- >;-- for (const [widgetKind, widget] of objectEntries(widgetImports)) {- const supported =- "supportedIntegrations" in widget.definition- ? (widget.definition.supportedIntegrations as IntegrationKind[])- : [];- for (const kind of supported) {- if (kind in map) {- map[kind].push(widgetKind);- }- }- }- return map;-};--export const widgetsByIntegration = buildWidgetsByIntegration();export const categoryTranslationKeys: Record<string, string> = {dnsHole: "integration.category.dnsHole",@@ -70,11 +47,11 @@ export interface IntegrationGridItem {export const buildSortedIntegrations = (options: { enableMockIntegration?: boolean; onboarding?: boolean } = {},-): IntegrationGridItem[] =>- integrationKinds+): IntegrationGridItem[] => {+ return integrationKinds.filter((kind) => {if (options.onboarding && hiddenFromOnboarding.has(kind)) return false;- if (options.onboarding && widgetsByIntegration[kind].length === 0) return false;+ if (options.onboarding && getWidgetKindsForIntegration(kind).length === 0) return false;if (!options.enableMockIntegration && kind === "mock") return false;return true;})@@ -82,9 +59,9 @@ export const buildSortedIntegrations = (kind,name: getIntegrationName(kind),categories: [...new Set(integrationDefs[kind].category.flat())] as string[],- widgets: widgetsByIntegration[kind],+ widgets: getWidgetKindsForIntegration(kind),}))- .sort((left, right) => {+ .toSorted((left, right) => {const leftIdx = featuredIntegrations.indexOf(left.kind);const rightIdx = featuredIntegrations.indexOf(right.kind);if (leftIdx !== -1 && rightIdx !== -1) return leftIdx - rightIdx;@@ -92,6 +69,7 @@ export const buildSortedIntegrations = (if (rightIdx !== -1) return 1;return right.widgets.length - left.widgets.length || left.name.localeCompare(right.name);});+};export const filterIntegrations = (items: IntegrationGridItem[], search: string) =>items.filter((i) => i.name.toLowerCase().includes(search.toLowerCase().trim()));diff --git a/apps/nextjs/src/components/layout/header.tsx b/apps/nextjs/src/components/layout/header.tsxindex e9d93f7fc..2c46608c0 100644--- a/apps/nextjs/src/components/layout/header.tsx+++ b/apps/nextjs/src/components/layout/header.tsx@@ -1,7 +1,6 @@import type { ReactNode } from "react";import { AppShellHeader, Group, UnstyledButton } from "@mantine/core";-import { Spotlight } from "@homarr/spotlight";import { Link } from "@homarr/ui";import { ClientBurger } from "./header/burger";@@ -9,6 +8,7 @@ import { DesktopSearchInput, MobileSearchButton } from "./header/search";import { TourTarget } from "./header/tour-target";import { UserButton } from "./header/user";import { HomarrLogoWithTitle } from "./logo/homarr-logo";+import { LazySpotlight } from "./header/lazy-spotlight";interface Props {logo?: ReactNode;@@ -37,7 +37,7 @@ export const MainHeader = ({ logo, actions, hasNavigation = true }: Props) => {</TourTarget></Group></Group>- <Spotlight />+ <LazySpotlight /></AppShellHeader>);};diff --git a/apps/nextjs/src/components/layout/header/button.tsx b/apps/nextjs/src/components/layout/header/button.tsxindex e8d858b6a..27d48445d 100644--- a/apps/nextjs/src/components/layout/header/button.tsx+++ b/apps/nextjs/src/components/layout/header/button.tsx@@ -14,6 +14,9 @@ type HeaderButtonProps = (}) & {children: ReactNode;+ onFocus?: () => void;+ onPointerDown?: () => void;+ onPointerEnter?: () => void;} & Partial<ActionIconProps>;const headerButtonActionIconProps: ActionIconProps = {diff --git a/apps/nextjs/src/components/layout/header/lazy-spotlight.tsx b/apps/nextjs/src/components/layout/header/lazy-spotlight.tsxnew file mode 100644index 000000000..958c0d537--- /dev/null+++ b/apps/nextjs/src/components/layout/header/lazy-spotlight.tsx@@ -0,0 +1,89 @@+"use client";++import { useEffect, useState } from "react";+import dynamic from "next/dynamic";+import { Center, Loader, Paper } from "@mantine/core";+import { useHotkeys } from "@mantine/hooks";++import { hotkeys } from "@homarr/definitions";+import { hasPendingSpotlightOpen, openSpotlight, spotlightOpenEvent } from "@homarr/spotlight/open";++const loadSpotlight = () => import("@homarr/spotlight/component");+const SpotlightLoading = () => (+ <Center+ data-homarr-dev-benchmark-spotlight-feedback+ pos="fixed"+ inset={0}+ role="status"+ aria-label="Loading search"+ style={{ zIndex: 1000, background: "rgb(0 0 0 / 20%)", backdropFilter: "blur(2px)" }}+ >+ <Paper withBorder radius="md" p="xl" shadow="xl">+ <Loader />+ </Paper>+ </Center>+);+const Spotlight = dynamic(() => loadSpotlight().then(({ Spotlight: Component }) => Component), {+ ssr: false,+ loading: SpotlightLoading,+});++export const preloadSpotlight = () => void loadSpotlight().catch(() => undefined);++export const LazySpotlight = () => {+ const [isMounted, setIsMounted] = useState(false);+ const [isPreloaded, setIsPreloaded] = useState(false);++ useHotkeys(+ isMounted+ ? []+ : [+ [+ hotkeys.openSpotlight,+ () => {+ setIsMounted(true);+ openSpotlight();+ },+ ],+ ],+ );++ useEffect(() => {+ let isActive = true;+ const mount = () => setIsMounted(true);+ window.addEventListener(spotlightOpenEvent, mount);+ if (hasPendingSpotlightOpen()) mount();++ const preload = () => {+ void loadSpotlight().then(+ () => {+ if (isActive) setIsPreloaded(true);+ },+ () => undefined,+ );+ };+ let idleId: number | undefined;+ const delayId = window.setTimeout(() => {+ idleId = window.requestIdleCallback?.(preload, { timeout: 1_000 });+ if (idleId === undefined) preload();+ }, 1_000);+ return () => {+ isActive = false;+ window.removeEventListener(spotlightOpenEvent, mount);+ window.clearTimeout(delayId);+ if (idleId !== undefined) window.cancelIdleCallback?.(idleId);+ };+ }, []);++ return isMounted || isPreloaded ? (+ <>+ {isPreloaded && <span hidden data-homarr-dev-benchmark-spotlight-preloaded />}+ {isMounted && (+ <>+ <span hidden data-homarr-dev-benchmark-spotlight-mounted />+ <Spotlight />+ </>+ )}+ </>+ ) : null;+};diff --git a/apps/nextjs/src/components/layout/header/search.tsx b/apps/nextjs/src/components/layout/header/search.tsxindex 8f6e4f908..8e42efd9a 100644--- a/apps/nextjs/src/components/layout/header/search.tsx+++ b/apps/nextjs/src/components/layout/header/search.tsx@@ -3,23 +3,28 @@import { TextInput, UnstyledButton } from "@mantine/core";import { IconSearch } from "@tabler/icons-react";-import { openSpotlight } from "@homarr/spotlight";+import { openSpotlight } from "@homarr/spotlight/open";import { useI18n } from "@homarr/translation/client";import { HeaderButton } from "./button";import classes from "./search.module.css";+import { preloadSpotlight } from "./lazy-spotlight";export const DesktopSearchInput = () => {const t = useI18n();return (<TextInput+ data-homarr-dev-benchmark-interaction="search"component={UnstyledButton}className={classes.desktopSearch}w={400}size="sm"leftSection={<IconSearch size={20} stroke={1.5} />}onClick={openSpotlight}+ onFocus={preloadSpotlight}+ onPointerDown={preloadSpotlight}+ onPointerEnter={preloadSpotlight}radius="xl">{`${t("search.placeholder")}...`}@@ -29,7 +34,14 @@ export const DesktopSearchInput = () => {export const MobileSearchButton = () => {return (- <HeaderButton onClick={openSpotlight} className={classes.mobileSearch}>+ <HeaderButton+ data-homarr-dev-benchmark-interaction="search"+ onClick={openSpotlight}+ onFocus={preloadSpotlight}+ onPointerDown={preloadSpotlight}+ onPointerEnter={preloadSpotlight}+ className={classes.mobileSearch}+ ><IconSearch size={20} stroke={1.5} /></HeaderButton>);diff --git a/apps/nextjs/src/components/layout/header/tour-target.spec.ts b/apps/nextjs/src/components/layout/header/tour-target.spec.tsnew file mode 100644index 000000000..8c0ae7816--- /dev/null+++ b/apps/nextjs/src/components/layout/header/tour-target.spec.ts@@ -0,0 +1,71 @@+import type { ReactNode } from "react";+import { act, createElement } from "react";+import { createRoot } from "react-dom/client";+import { MantineProvider } from "@mantine/core";+import { afterEach, beforeAll, describe, expect, it, vi } from "vitest";++import { TourTarget, TourTargetsProvider } from "./tour-target";++vi.mock("@gfazioli/mantine-onboarding-tour", () => ({+ OnboardingTour: {+ Target: ({ children }: { children: ReactNode }) => children,+ },+}));++const mountedRoots: Array<ReturnType<typeof createRoot>> = [];++beforeAll(() => {+ Object.defineProperty(globalThis, "IS_REACT_ACT_ENVIRONMENT", { value: true, writable: true });+ Object.defineProperty(window, "matchMedia", {+ writable: true,+ value: (query: string) => ({+ matches: false,+ media: query,+ onchange: null,+ addListener: () => undefined,+ removeListener: () => undefined,+ addEventListener: () => undefined,+ removeEventListener: () => undefined,+ dispatchEvent: () => false,+ }),+ });+});++afterEach(async () => {+ await act(async () => {+ for (const root of mountedRoots.splice(0)) root.unmount();+ });+});++const renderTargetAsync = async (enabled: boolean) => {+ const host = document.createElement("div");+ const root = createRoot(host);+ mountedRoots.push(root);++ await act(async () => {+ root.render(+ createElement(+ MantineProvider,+ null,+ createElement(TourTargetsProvider, {+ enabled,+ children: createElement(TourTarget, { id: "example", children: createElement("button", null, "Target") }),+ }),+ ),+ );+ });+ return host;+};++describe("TourTarget", () => {+ it("keeps a stable route-transition marker while a tour is active", async () => {+ const host = await renderTargetAsync(true);+ expect(host.querySelector('[data-tour-target="example"] button')?.textContent).toBe("Target");+ });++ it("adds no wrapper for users without an active tour", async () => {+ const host = await renderTargetAsync(false);+ expect(host.querySelector("[data-tour-target]")).toBeNull();+ expect(host.querySelector("button")?.parentElement).toBe(host);+ });+});diff --git a/apps/nextjs/src/components/layout/header/tour-target.tsx b/apps/nextjs/src/components/layout/header/tour-target.tsxindex b23572d1e..ea8ba726b 100644--- a/apps/nextjs/src/components/layout/header/tour-target.tsx+++ b/apps/nextjs/src/components/layout/header/tour-target.tsx@@ -1,11 +1,41 @@"use client";-import type { ReactNode } from "react";-import { OnboardingTour } from "@gfazioli/mantine-onboarding-tour";+import type { PropsWithChildren, ReactNode } from "react";+import { createContext, Suspense, use, useContext } from "react";import { Box } from "@mantine/core";-export const TourTarget = ({ id, children }: { id: string; children: ReactNode }) => (- <OnboardingTour.Target id={id}>- <Box data-tour-target={id}>{children}</Box>- </OnboardingTour.Target>+const TourTargetsEnabledContext = createContext(false);+let tourLibraryPromise: Promise<typeof import("@gfazioli/mantine-onboarding-tour")> | undefined;++const loadTourLibrary = () => {+ if (tourLibraryPromise) return tourLibraryPromise;++ const currentPromise = import("@gfazioli/mantine-onboarding-tour");+ tourLibraryPromise = currentPromise;+ void currentPromise.catch(() => {+ if (tourLibraryPromise === currentPromise) tourLibraryPromise = undefined;+ });+ return currentPromise;+};++export const TourTargetsProvider = ({ enabled = true, children }: PropsWithChildren<{ enabled?: boolean }>) => (+ <TourTargetsEnabledContext value={enabled}>{children}</TourTargetsEnabledContext>);++const LoadedTourTarget = ({ id, children }: { id: string; children: ReactNode }) => {+ const { OnboardingTour } = use(loadTourLibrary());+ return <OnboardingTour.Target id={id}>{children}</OnboardingTour.Target>;+};++export const TourTarget = ({ id, children }: { id: string; children: ReactNode }) => {+ const isEnabled = useContext(TourTargetsEnabledContext);+ if (!isEnabled) return children;++ const target = <Box data-tour-target={id}>{children}</Box>;++ return (+ <Suspense fallback={target}>+ <LoadedTourTarget id={id}>{target}</LoadedTourTarget>+ </Suspense>+ );+};diff --git a/apps/nextjs/src/components/layout/header/update.tsx b/apps/nextjs/src/components/layout/header/update.tsxindex 1989ecd22..81e68b277 100644--- a/apps/nextjs/src/components/layout/header/update.tsx+++ b/apps/nextjs/src/components/layout/header/update.tsx@@ -1,7 +1,6 @@"use client";import type { PropsWithChildren } from "react";-import { Suspense, use } from "react";import { Indicator, Menu, Text } from "@mantine/core";import { IconBellRinging } from "@tabler/icons-react";@@ -9,67 +8,28 @@ import type { RouterOutputs } from "@homarr/api";import { useScopedI18n } from "@homarr/translation/client";interface UpdateIndicatorProps extends PropsWithChildren {- availableUpdatesPromise: Promise<RouterOutputs["updateChecker"]["getAvailableUpdates"]> | undefined;+ availableUpdates: RouterOutputs["updateChecker"]["getAvailableUpdates"] | undefined;disabled: boolean;}-export const UpdateIndicator = ({ children, availableUpdatesPromise, disabled }: UpdateIndicatorProps) => {- if (disabled || availableUpdatesPromise === undefined) {+export const UpdateIndicator = ({ children, availableUpdates, disabled }: UpdateIndicatorProps) => {+ if (disabled || availableUpdates === undefined) {return children;}return (- <Suspense fallback={children}>- <InnerUpdateIndicator availableUpdatesPromise={availableUpdatesPromise} disabled={disabled}>- {children}- </InnerUpdateIndicator>- </Suspense>- );-};--interface InnerUpdateIndicatorProps extends PropsWithChildren {- availableUpdatesPromise: Promise<RouterOutputs["updateChecker"]["getAvailableUpdates"]>;- disabled: boolean;-}--const InnerUpdateIndicator = ({ children, disabled, availableUpdatesPromise }: InnerUpdateIndicatorProps) => {- const availableUpdates = use(availableUpdatesPromise);-- return (- <Indicator- disabled={!availableUpdates || availableUpdates.length === 0 || disabled}- size={15}- processing- withBorder- >+ <Indicator disabled={availableUpdates.length === 0} size={15} processing withBorder>{children}</Indicator>);};interface AvailableUpdatesMenuItemProps {- availableUpdatesPromise: Promise<RouterOutputs["updateChecker"]["getAvailableUpdates"]> | undefined;-}--export const AvailableUpdatesMenuItem = ({ availableUpdatesPromise }: AvailableUpdatesMenuItemProps) => {- if (availableUpdatesPromise === undefined) {- return null;- }-- return (- <Suspense fallback={null}>- <InnerAvailableUpdatesMenuItem availableUpdatesPromise={availableUpdatesPromise} />- </Suspense>- );-};--interface InnerAvailableUpdatesMenuItemProps {- availableUpdatesPromise: Promise<RouterOutputs["updateChecker"]["getAvailableUpdates"]>;+ availableUpdates: RouterOutputs["updateChecker"]["getAvailableUpdates"] | undefined;}-const InnerAvailableUpdatesMenuItem = ({ availableUpdatesPromise }: InnerAvailableUpdatesMenuItemProps) => {+export const AvailableUpdatesMenuItem = ({ availableUpdates }: AvailableUpdatesMenuItemProps) => {const t = useScopedI18n("common.userAvatar.menu");- const availableUpdates = use(availableUpdatesPromise);if (availableUpdates === undefined || availableUpdates.length === 0) {return null;}diff --git a/apps/nextjs/src/components/layout/header/user-client.tsx b/apps/nextjs/src/components/layout/header/user-client.tsxnew file mode 100644index 000000000..f6c66cbf7--- /dev/null+++ b/apps/nextjs/src/components/layout/header/user-client.tsx@@ -0,0 +1,125 @@+"use client";++import type { ComponentProps, ReactNode } from "react";+import { Suspense, use, useEffect, useState } from "react";+import { Box, Loader, UnstyledButton, useMantineColorScheme } from "@mantine/core";+import { useHotkeys } from "@mantine/hooks";+import { ErrorBoundary } from "react-error-boundary";++import { clientApi } from "@homarr/api/client";+import { useSession } from "@homarr/auth/client";+import { hotkeys } from "@homarr/definitions";++import { UpdateIndicator } from "./update";++type UserAvatarMenuModule = typeof import("~/components/user-avatar-menu");+type UserAvatarMenuProps = ComponentProps<UserAvatarMenuModule["UserAvatarMenu"]>;++let userAvatarMenuPromise: Promise<UserAvatarMenuModule> | undefined;+const loadUserAvatarMenu = () => {+ if (userAvatarMenuPromise) return userAvatarMenuPromise;++ const promise = import("~/components/user-avatar-menu");+ userAvatarMenuPromise = promise;+ void promise.catch(() => {+ if (userAvatarMenuPromise === promise) userAvatarMenuPromise = undefined;+ });+ return promise;+};+const preloadUserAvatarMenu = () => void loadUserAvatarMenu().catch(() => undefined);++const LazyUserAvatarMenu = (props: UserAvatarMenuProps) => {+ const { UserAvatarMenu } = use(loadUserAvatarMenu());+ return <UserAvatarMenu {...props} />;+};++interface UserButtonClientProps {+ avatar: ReactNode;+ isAdmin: boolean;+ isDockerEnabled: boolean;+}++export const UserButtonClient = ({ avatar, isAdmin, isDockerEnabled }: UserButtonClientProps) => {+ const [canCheckForUpdates, setCanCheckForUpdates] = useState(false);+ const [isMenuMounted, setIsMenuMounted] = useState(false);+ const [isMenuOpen, setIsMenuOpen] = useState(false);+ const session = useSession();+ const { toggleColorScheme } = useMantineColorScheme();+ useHotkeys([[hotkeys.toggleColorScheme, toggleColorScheme]]);+ const isCurrentSessionAdmin =+ isAdmin && session.status === "authenticated" && session.data.user.permissions.includes("admin");++ useEffect(() => {+ if (!isCurrentSessionAdmin) {+ setCanCheckForUpdates(false);+ return;+ }++ const timeout = window.setTimeout(() => setCanCheckForUpdates(true), 2_000);+ return () => window.clearTimeout(timeout);+ }, [isCurrentSessionAdmin]);++ const { data: availableUpdates } = clientApi.updateChecker.getAvailableUpdates.useQuery(undefined, {+ enabled: canCheckForUpdates,+ refetchOnWindowFocus: false,+ retry: false,+ staleTime: 60 * 60 * 1_000,+ });+ const visibleUpdates = isCurrentSessionAdmin ? availableUpdates : undefined;+ const openMenu = () => {+ setIsMenuMounted(true);+ setIsMenuOpen(true);+ };+ const renderButton = (onClick: () => void, isLoading = false) => (+ <UnstyledButton+ onClick={onClick}+ onFocus={preloadUserAvatarMenu}+ onMouseEnter={preloadUserAvatarMenu}+ onPointerDown={preloadUserAvatarMenu}+ aria-busy={isLoading || undefined}+ disabled={isLoading}+ >+ <UpdateIndicator availableUpdates={visibleUpdates} disabled={!isCurrentSessionAdmin}>+ <Box pos="relative" style={{ display: "inline-flex" }}>+ <Box opacity={isLoading ? 0.35 : 1}>{avatar}</Box>+ {isLoading && (+ <Loader+ aria-label="Loading user menu"+ size={18}+ pos="absolute"+ top="50%"+ left="50%"+ style={{ transform: "translate(-50%, -50%)" }}+ />+ )}+ </Box>+ </UpdateIndicator>+ </UnstyledButton>+ );+ const button = renderButton(openMenu);+ const loadingButton = renderButton(() => undefined, true);++ if (!isMenuMounted) return button;++ return (+ <ErrorBoundary+ fallbackRender={({ resetErrorBoundary }) =>+ renderButton(() => {+ resetErrorBoundary();+ openMenu();+ })+ }+ >+ <Suspense fallback={loadingButton}>+ <LazyUserAvatarMenu+ availableUpdates={visibleUpdates}+ isDockerEnabled={isDockerEnabled}+ opened={isMenuOpen}+ onOpenChange={setIsMenuOpen}+ >+ {button}+ </LazyUserAvatarMenu>+ </Suspense>+ </ErrorBoundary>+ );+};diff --git a/apps/nextjs/src/components/layout/header/user.tsx b/apps/nextjs/src/components/layout/header/user.tsxindex af3d72121..e1dc9ad1f 100644--- a/apps/nextjs/src/components/layout/header/user.tsx+++ b/apps/nextjs/src/components/layout/header/user.tsx@@ -1,28 +1,14 @@-import { Suspense } from "react";-import { UnstyledButton } from "@mantine/core";--import { api } from "@homarr/api/server";import { auth } from "@homarr/auth/next";import { env } from "@homarr/docker/env";import { CurrentUserAvatar } from "~/components/user-avatar";-import { UserAvatarMenu } from "~/components/user-avatar-menu";-import { UpdateIndicator } from "./update";+import { UserButtonClient } from "./user-client";export const UserButton = async () => {const session = await auth();- const isAdmin = session?.user.permissions.includes("admin");+ const isAdmin = Boolean(session?.user.permissions.includes("admin"));const isDockerEnabled = isAdmin && env.ENABLE_DOCKER;- const availableUpdatesPromise = isAdmin ? api.updateChecker.getAvailableUpdates() : undefined;return (- <UserAvatarMenu availableUpdatesPromise={availableUpdatesPromise} isDockerEnabled={isDockerEnabled}>- <UnstyledButton>- <Suspense fallback={<CurrentUserAvatar size="md" />}>- <UpdateIndicator availableUpdatesPromise={availableUpdatesPromise} disabled={!isAdmin}>- <CurrentUserAvatar size="md" />- </UpdateIndicator>- </Suspense>- </UnstyledButton>- </UserAvatarMenu>+ <UserButtonClient avatar={<CurrentUserAvatar size="md" />} isAdmin={isAdmin} isDockerEnabled={isDockerEnabled} />);};diff --git a/apps/nextjs/src/components/layout/navigation-link.tsx b/apps/nextjs/src/components/layout/navigation-link.tsxindex 032dbc3bc..383692cfe 100644--- a/apps/nextjs/src/components/layout/navigation-link.tsx+++ b/apps/nextjs/src/components/layout/navigation-link.tsx@@ -1,20 +1,19 @@"use client";-import type { ReactNode } from "react";+import type { ReactElement, ReactNode } from "react";import { useEffect, useState } from "react";import { usePathname } from "next/navigation";-import { OnboardingTour } from "@gfazioli/mantine-onboarding-tour";import { NavLink } from "@mantine/core";import { Link } from "@homarr/ui";+import { TourTarget } from "./header/tour-target";+export const CommonNavLink = (props: ClientNavigationLink) =>"href" in props ? <NavLinkHref {...props} /> : <NavLinkWithItems {...props} />;-const TourTarget = ({ id, children }: { id?: string; children: ReactNode }) => {- if (!id) return <>{children}</>;- return <OnboardingTour.Target id={id}>{children}</OnboardingTour.Target>;-};+const withOptionalTourTarget = (id: string | undefined, children: ReactElement) =>+ id ? <TourTarget id={id}>{children}</TourTarget> : children;const pathMatches = (pathname: string, href: string) => pathname === href || pathname.startsWith(`${href}/`);@@ -43,7 +42,7 @@ const NavLinkHref = (props: NavigationLinkHref) => {active={isClient && pathMatches(pathname, props.href)}/>);- return <TourTarget id={tourId}>{link}</TourTarget>;+ return withOptionalTourTarget(tourId, link);};const NavLinkWithItems = (props: NavigationLinkWithItems) => {@@ -56,7 +55,7 @@ const NavLinkWithItems = (props: NavigationLinkWithItems) => {))}</NavLink>);- return <TourTarget id={props["data-onboarding-tour-id"]}>{nav}</TourTarget>;+ return withOptionalTourTarget(props["data-onboarding-tour-id"], nav);};interface CommonNavigationLinkProps {diff --git a/apps/nextjs/src/components/onboarding/board-tour-gate.tsx b/apps/nextjs/src/components/onboarding/board-tour-gate.tsxnew file mode 100644index 000000000..31365544f--- /dev/null+++ b/apps/nextjs/src/components/onboarding/board-tour-gate.tsx@@ -0,0 +1,11 @@+import type { PropsWithChildren } from "react";++export const BoardTourGate = async ({ enabled, children }: PropsWithChildren<{ enabled: boolean }>) => {+ if (!enabled) return children;++ // Native server-side import keeps the completed-user client graph lean while+ // giving first-time users one stable board tree instead of swapping a+ // Suspense fallback after GridStack has mounted.+ const { BoardTourProvider } = await import("./board-tour");+ return <BoardTourProvider>{children}</BoardTourProvider>;+};diff --git a/apps/nextjs/src/components/onboarding/board-tour.tsx b/apps/nextjs/src/components/onboarding/board-tour.tsxindex d7f5d2765..f51a8451f 100644--- a/apps/nextjs/src/components/onboarding/board-tour.tsx+++ b/apps/nextjs/src/components/onboarding/board-tour.tsx@@ -1,7 +1,7 @@"use client";import type { PropsWithChildren } from "react";-import { useMemo } from "react";+import { useMemo, useState } from "react";import type { OnboardingTourStep } from "@gfazioli/mantine-onboarding-tour";import { clientApi } from "@homarr/api/client";@@ -10,6 +10,7 @@ import { createDocumentationLink } from "@homarr/definitions";import { useScopedI18n } from "@homarr/translation/client";import { useBoardPermissions } from "~/components/board/permissions/client";+import { TourTargetsProvider } from "~/components/layout/header/tour-target";import { TourShell } from "./tour-shell";import { TourStepContent } from "./tour-step-content";@@ -17,21 +18,11 @@ export const BoardTourProvider = ({ children }: PropsWithChildren) => {const t = useScopedI18n("onboardingTour.board");const board = useRequiredBoard();const { hasChangeAccess } = useBoardPermissions(board);- const utils = clientApi.useUtils();- const { data: tourStatus } = clientApi.user.getTourStatus.useQuery();- const { mutate: completeTour } = clientApi.user.completeTour.useMutation({- onSuccess() {- void utils.user.getTourStatus.invalidate();- },- });-- const started = tourStatus !== undefined && !tourStatus.completedBoardTour;+ const [started, setStarted] = useState(true);+ const { mutate: completeTour } = clientApi.user.completeTour.useMutation();const handleEnd = () => {- utils.user.getTourStatus.setData(undefined, {- completedManageTour: tourStatus?.completedManageTour ?? false,- completedBoardTour: true,- });+ setStarted(false);completeTour({ tour: "board" });};@@ -101,8 +92,10 @@ export const BoardTourProvider = ({ children }: PropsWithChildren) => {}, [hasChangeAccess, t]);return (- <TourShell steps={steps} started={started} onEnd={handleEnd} position={{ base: "bottom", sm: "left" }}>- {children}- </TourShell>+ <TourTargetsProvider enabled={started}>+ <TourShell steps={steps} started={started} onEnd={handleEnd} position={{ base: "bottom", sm: "left" }}>+ {children}+ </TourShell>+ </TourTargetsProvider>);};diff --git a/apps/nextjs/src/components/onboarding/manage-tour-gate.tsx b/apps/nextjs/src/components/onboarding/manage-tour-gate.tsxnew file mode 100644index 000000000..33f408b21--- /dev/null+++ b/apps/nextjs/src/components/onboarding/manage-tour-gate.tsx@@ -0,0 +1,12 @@+import type { PropsWithChildren } from "react";++export const ManageTourGate = async ({+ enabled,+ isAdmin,+ children,+}: PropsWithChildren<{ enabled: boolean; isAdmin: boolean }>) => {+ if (!enabled) return children;++ const { ManageTourProvider } = await import("./manage-tour");+ return <ManageTourProvider isAdmin={isAdmin}>{children}</ManageTourProvider>;+};diff --git a/apps/nextjs/src/components/onboarding/manage-tour.tsx b/apps/nextjs/src/components/onboarding/manage-tour.tsxindex c242a1bb2..b6b00894f 100644--- a/apps/nextjs/src/components/onboarding/manage-tour.tsx+++ b/apps/nextjs/src/components/onboarding/manage-tour.tsx@@ -1,7 +1,7 @@"use client";import type { PropsWithChildren } from "react";-import { useCallback, useEffect, useMemo, useRef, useState } from "react";+import { useCallback, useEffect, useMemo, useState } from "react";import { usePathname, useRouter } from "next/navigation";import type { OnboardingTourFocusRevealProps, OnboardingTourStep } from "@gfazioli/mantine-onboarding-tour";import { useMediaQuery } from "@mantine/hooks";@@ -17,6 +17,7 @@ import { clientApi } from "@homarr/api/client";import { createDocumentationLink } from "@homarr/definitions";import { useScopedI18n } from "@homarr/translation/client";+import { TourTargetsProvider } from "~/components/layout/header/tour-target";import { TourShell } from "./tour-shell";import { TourStepContent } from "./tour-step-content";@@ -46,13 +47,7 @@ const usersStepFocusRevealProps: OnboardingTourFocusRevealProps = {export const ManageTourProvider = ({ children, isAdmin }: ManageTourProviderProps) => {const t = useScopedI18n("onboardingTour.manage");- const utils = clientApi.useUtils();- const { data: tourStatus } = clientApi.user.getTourStatus.useQuery();- const { mutate: completeTour } = clientApi.user.completeTour.useMutation({- onSuccess() {- void utils.user.getTourStatus.invalidate();- },- });+ const { mutate: completeTour } = clientApi.user.completeTour.useMutation();const isMobile = useMediaQuery("(max-width: 48em)");const pathname = usePathname();const router = useRouter();@@ -62,14 +57,13 @@ export const ManageTourProvider = ({ children, isAdmin }: ManageTourProviderPropconst [tourActive, setTourActive] = useState(false);const [tourDismissed, setTourDismissed] = useState(false);- const wasManageTourCompletedRef = useRef(tourStatus?.completedManageTour);useEffect(() => {if (tourDismissed) return;- if (isManageHome && tourStatus !== undefined && !tourStatus.completedManageTour && !isMobile) {+ if (isManageHome && !isMobile) {setTourActive(true);}- }, [isManageHome, tourStatus, isMobile, tourDismissed]);+ }, [isManageHome, isMobile, tourDismissed]);useEffect(() => {if (!isManageSection) {@@ -77,25 +71,12 @@ export const ManageTourProvider = ({ children, isAdmin }: ManageTourProviderProp}}, [isManageSection]);- useEffect(() => {- const wasCompleted = wasManageTourCompletedRef.current;- const isCompleted = tourStatus?.completedManageTour;- if (wasCompleted === true && isCompleted === false) {- setTourDismissed(false);- }- wasManageTourCompletedRef.current = isCompleted;- }, [tourStatus?.completedManageTour]);-const handleEnd = useCallback(() => {setTourDismissed(true);setTourActive(false);- utils.user.getTourStatus.setData(undefined, {- completedManageTour: true,- completedBoardTour: tourStatus?.completedBoardTour ?? false,- });completeTour({ tour: "manage" });router.push("/manage");- }, [completeTour, router, tourStatus?.completedBoardTour, utils.user.getTourStatus]);+ }, [completeTour, router]);const steps = useMemo(() => {const allSteps: (OnboardingTourStep & { adminOnly?: boolean })[] = [@@ -207,14 +188,16 @@ export const ManageTourProvider = ({ children, isAdmin }: ManageTourProviderProp}, [isAdmin, t]);return (- <TourShell- steps={steps}- started={tourActive}- onEnd={handleEnd}- stepRoutes={stepRoutes}- position={{ base: "bottom", sm: "right" }}- >- {children}- </TourShell>+ <TourTargetsProvider enabled={tourActive}>+ <TourShell+ steps={steps}+ started={tourActive}+ onEnd={handleEnd}+ stepRoutes={stepRoutes}+ position={{ base: "bottom", sm: "right" }}+ >+ {children}+ </TourShell>+ </TourTargetsProvider>);};diff --git a/apps/nextjs/src/components/user-avatar-menu.tsx b/apps/nextjs/src/components/user-avatar-menu.tsxindex cf6d013a2..2cfed0b5b 100644--- a/apps/nextjs/src/components/user-avatar-menu.tsx+++ b/apps/nextjs/src/components/user-avatar-menu.tsx@@ -1,24 +1,13 @@"use client";import type { ReactNode } from "react";-import { useCallback, useEffect } from "react";-import { useRouter } from "next/navigation";-import { Center, Menu, Stack, Text, useMantineColorScheme } from "@mantine/core";-import { useHotkeys, useTimeout } from "@mantine/hooks";-import {- IconBrandDocker,- IconCheck,- IconHome,- IconLogin,- IconLogout,- IconSettings,- IconTool,-} from "@tabler/icons-react";+import { useCallback } from "react";+import { Menu } from "@mantine/core";+import { IconBrandDocker, IconHome, IconLogin, IconLogout, IconSettings, IconTool } from "@tabler/icons-react";import type { RouterOutputs } from "@homarr/api";import { signOut, useSession } from "@homarr/auth/client";-import { hotkeys } from "@homarr/definitions";-import { createModal, useModalAction } from "@homarr/modals";+import { useModalAction } from "@homarr/modals";import { useScopedI18n } from "@homarr/translation/client";import { Link } from "@homarr/ui";@@ -30,42 +19,38 @@ import { AvailableUpdatesMenuItem } from "./layout/header/update";interface UserAvatarMenuProps {children: ReactNode;- availableUpdatesPromise?: Promise<RouterOutputs["updateChecker"]["getAvailableUpdates"]>;+ availableUpdates?: RouterOutputs["updateChecker"]["getAvailableUpdates"];isDockerEnabled?: boolean;+ opened: boolean;+ onOpenChange: (opened: boolean) => void;}-export const UserAvatarMenu = ({ children, availableUpdatesPromise, isDockerEnabled }: UserAvatarMenuProps) => {+export const UserAvatarMenu = ({+ children,+ availableUpdates,+ isDockerEnabled,+ opened,+ onOpenChange,+}: UserAvatarMenuProps) => {const t = useScopedI18n("common.userAvatar.menu");- const { toggleColorScheme } = useMantineColorScheme();- useHotkeys([[hotkeys.toggleColorScheme, toggleColorScheme]]);-const session = useSession();- const router = useRouter();const { logoutUrl } = useAuthContext();- const { openModal } = useModalAction(LogoutModal);const { openModal: openDockerModal } = useModalAction(DockerQuickAccessModal);const handleSignout = useCallback(async () => {+ const redirectUrl = logoutUrl ?? "/auth/login";await signOut({redirect: false,});- openModal({- onTimeout: () => {- if (logoutUrl) {- window.location.assign(logoutUrl);- return;- }- router.push("/auth/login");- },- });- }, [logoutUrl, openModal, router]);+ window.location.assign(redirectUrl);+ }, [logoutUrl]);return (// We use keepMounted so we can add event listeners to prevent navigating away without saving the board- <Menu width={300} withinPortal keepMounted>+ <Menu width={300} withinPortal keepMounted opened={opened} onChange={onOpenChange}><Menu.Dropdown>- <AvailableUpdatesMenuItem availableUpdatesPromise={availableUpdatesPromise} />+ <AvailableUpdatesMenuItem availableUpdates={availableUpdates} /><Menu.Item component={Link} href="/boards" leftSection={<IconHome size="1rem" />}>{t("homeBoard")}</Menu.Item>@@ -113,35 +98,3 @@ export const UserAvatarMenu = ({ children, availableUpdatesPromise, isDockerEnab</Menu>);};--const LogoutModal = createModal<{ onTimeout: () => void }>(({ actions, innerProps }) => {- const t = useScopedI18n("common.userAvatar.menu");- const { start } = useTimeout(() => {- actions.closeModal();- innerProps.onTimeout();- }, 1500);-- useEffect(() => {- start();- }, [start]);-- return (- <Center h={200 - 2 * 16}>- <Stack align="center" c="green">- <IconCheck size={50} />- <Text ta="center" fw="bold">- {t("loggedOut")}- </Text>- </Stack>- </Center>- );-}).withOptions({- centered: true,- withCloseButton: false,- transitionProps: {- transition: "pop",- },- size: 200,- closeOnClickOutside: false,- closeOnEscape: false,-});diff --git a/apps/nextjs/src/instrumentation-noop.ts b/apps/nextjs/src/instrumentation-noop.tsnew file mode 100644index 000000000..fee327293--- /dev/null+++ b/apps/nextjs/src/instrumentation-noop.ts@@ -0,0 +1,4 @@+// Development runs background services as separate processes. The aliases in+// next.config.ts keep production-only instrumentation imports out of the graph.+export const instrumentationNoop = true;+export const startupPromise = Promise.resolve();diff --git a/apps/nextjs/src/instrumentation.spec.ts b/apps/nextjs/src/instrumentation.spec.tsnew file mode 100644index 000000000..e987ccbee--- /dev/null+++ b/apps/nextjs/src/instrumentation.spec.ts@@ -0,0 +1,125 @@+// @vitest-environment node++import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";++const registerAsync = async (nodeEnv: string, nextRuntime: string) => {+ const loggerLoaded = vi.fn();+ const tasksStarted = vi.fn();+ const websocketStarted = vi.fn();+ vi.stubEnv("NODE_ENV", nodeEnv);+ vi.stubEnv("NEXT_RUNTIME", nextRuntime);+ vi.doMock("@homarr/core/infrastructure/logs", () => {+ loggerLoaded();+ return { createLogger: () => ({ error: vi.fn() }) };+ });+ vi.doMock("@homarr/tasks", () => {+ tasksStarted();+ return { startupPromise: Promise.resolve() };+ });+ vi.doMock("@homarr/websocket", () => {+ websocketStarted();+ return { startupPromise: Promise.resolve() };+ });++ const { register } = await import("./instrumentation");+ await register();+ if (nodeEnv === "production" && nextRuntime === "nodejs") {+ await vi.waitFor(() => {+ expect(tasksStarted).toHaveBeenCalledOnce();+ expect(websocketStarted).toHaveBeenCalledOnce();+ });+ }+ return { loggerLoaded, tasksStarted, websocketStarted };+};++describe("Next instrumentation", () => {+ beforeEach(() => {+ vi.resetModules();+ });++ afterEach(() => {+ vi.restoreAllMocks();+ vi.doUnmock("@homarr/core/infrastructure/logs");+ vi.doUnmock("@homarr/tasks");+ vi.doUnmock("@homarr/websocket");+ vi.unstubAllEnvs();+ });++ test("embeds background services in the production Node runtime", async () => {+ const { loggerLoaded, tasksStarted, websocketStarted } = await registerAsync("production", "nodejs");++ expect(loggerLoaded).toHaveBeenCalledOnce();+ expect(tasksStarted).toHaveBeenCalledOnce();+ expect(websocketStarted).toHaveBeenCalledOnce();+ });++ test("does not embed background services in the development server", async () => {+ const { loggerLoaded, tasksStarted, websocketStarted } = await registerAsync("development", "nodejs");++ expect(loggerLoaded).not.toHaveBeenCalled();+ expect(tasksStarted).not.toHaveBeenCalled();+ expect(websocketStarted).not.toHaveBeenCalled();+ });++ test("does not embed Node services in the edge runtime", async () => {+ const { loggerLoaded, tasksStarted, websocketStarted } = await registerAsync("production", "edge");++ expect(loggerLoaded).not.toHaveBeenCalled();+ expect(tasksStarted).not.toHaveBeenCalled();+ expect(websocketStarted).not.toHaveBeenCalled();+ });++ test("does not block Next readiness on slow cron run-on-start hooks", async () => {+ const neverFinishes = new Promise<void>(() => undefined);+ vi.stubEnv("NODE_ENV", "production");+ vi.stubEnv("NEXT_RUNTIME", "nodejs");+ vi.doMock("@homarr/core/infrastructure/logs", () => ({ createLogger: () => ({ error: vi.fn() }) }));+ vi.doMock("@homarr/tasks", () => ({ startupPromise: neverFinishes }));+ vi.doMock("@homarr/websocket", () => ({ startupPromise: Promise.resolve() }));++ const { register } = await import("./instrumentation");++ await expect(register()).resolves.toBeUndefined();+ });++ test("terminates a ready Node process when cron startup later fails", async () => {+ const websocketStarted = vi.fn();+ const errorLogged = vi.fn();+ let rejectTasks!: (error: Error) => void;+ const exit = vi.spyOn(process, "exit").mockImplementation(() => undefined as never);+ vi.stubEnv("NODE_ENV", "production");+ vi.stubEnv("NEXT_RUNTIME", "nodejs");+ vi.doMock("@homarr/core/infrastructure/logs", () => ({+ createLogger: () => ({ error: errorLogged }),+ }));+ vi.doMock("@homarr/tasks", () => ({+ startupPromise: new Promise<void>((_resolve, reject) => {+ rejectTasks = reject;+ }),+ }));+ vi.doMock("@homarr/websocket", () => {+ websocketStarted();+ return { startupPromise: Promise.resolve() };+ });++ const { register } = await import("./instrumentation");++ await expect(register()).resolves.toBeUndefined();+ rejectTasks(new Error("task startup failed"));+ await vi.waitFor(() => expect(exit).toHaveBeenCalledWith(1));+ expect(websocketStarted).toHaveBeenCalledOnce();+ expect(errorLogged).toHaveBeenCalledOnce();+ });++ test("fails readiness when the embedded WebSocket listener cannot start", async () => {+ vi.stubEnv("NODE_ENV", "production");+ vi.stubEnv("NEXT_RUNTIME", "nodejs");+ vi.doMock("@homarr/core/infrastructure/logs", () => ({ createLogger: () => ({ error: vi.fn() }) }));+ vi.doMock("@homarr/tasks", () => ({ startupPromise: Promise.resolve() }));+ vi.doMock("@homarr/websocket", () => ({ startupPromise: Promise.reject(new Error("port unavailable")) }));++ const { register } = await import("./instrumentation");++ await expect(register()).rejects.toThrow("Failed to start embedded websocket service");+ });+});diff --git a/apps/nextjs/src/instrumentation.ts b/apps/nextjs/src/instrumentation.tsindex 19a2865b7..e1755a1b4 100644--- a/apps/nextjs/src/instrumentation.ts+++ b/apps/nextjs/src/instrumentation.ts@@ -1,6 +1,38 @@export async function register() {- if (process.env.NEXT_RUNTIME === "nodejs") {- await import("@homarr/tasks");- await import("@homarr/websocket");- }+ if (process.env.NEXT_RUNTIME !== "nodejs") return;+ if (process.env.NODE_ENV !== "production") return;++ const { createLogger } = await import("@homarr/core/infrastructure/logs");+ const logger = createLogger({ module: "instrumentation" });++ const startTasksAsync = async () => {+ try {+ const tasks = await import("@homarr/tasks");+ // Cron run-on-start hooks can perform slow external work. Keep dashboard+ // readiness independent, but never leave the process permanently degraded.+ void tasks.startupPromise.catch((cause: unknown) => {+ logger.error(new Error("Failed to start embedded tasks service", { cause }));+ process.exit(1);+ });+ } catch (cause) {+ const error = new Error("Failed to load embedded tasks service", { cause });+ logger.error(error);+ throw error;+ }+ };++ const startWebsocketAsync = async () => {+ try {+ const websocket = await import("@homarr/websocket");+ // Listening is a bounded local readiness condition and prevents Next from+ // becoming healthy with subscriptions unavailable.+ await websocket.startupPromise;+ } catch (cause) {+ const error = new Error("Failed to start embedded websocket service", { cause });+ logger.error(error);+ throw error;+ }+ };++ await Promise.all([startTasksAsync(), startWebsocketAsync()]);}diff --git a/apps/nextjs/src/proxy.spec.ts b/apps/nextjs/src/proxy.spec.tsnew file mode 100644index 000000000..2b9101bde--- /dev/null+++ b/apps/nextjs/src/proxy.spec.ts@@ -0,0 +1,122 @@+import { beforeEach, describe, expect, it, vi } from "vitest";+import { NextRequest, NextResponse } from "next/server";++import { localeCookieKey } from "@homarr/definitions";++const mocks = vi.hoisted(() => ({+ getOnboardingStep: vi.fn(),+ getDefaultLocale: vi.fn(),+ createI18nMiddleware: vi.fn(),+}));++vi.mock("@homarr/db/proxy-reader", () => ({+ getDefaultLocaleForProxyAsync: mocks.getDefaultLocale,+ getOnboardingStepForProxyAsync: mocks.getOnboardingStep,+}));++vi.mock("@homarr/translation/middleware", () => ({+ createI18nMiddleware: mocks.createI18nMiddleware,+}));++const loadProxy = async () => {+ vi.resetModules();+ return import("./proxy");+};++const createRequest = (pathname: string, locale?: string) => {+ const request = new NextRequest(`http://localhost${pathname}`);+ if (locale) request.cookies.set(localeCookieKey, locale);+ return request;+};++describe("locale and onboarding proxy", () => {+ beforeEach(() => {+ vi.clearAllMocks();+ mocks.getOnboardingStep.mockResolvedValue("finish");+ mocks.getDefaultLocale.mockResolvedValue("en");+ mocks.createI18nMiddleware.mockImplementation((defaultLocale: string) => (request: NextRequest) => {+ request.headers.set("x-test-default-locale", defaultLocale);+ return NextResponse.next();+ });+ });++ it("redirects unfinished onboarding to /init", async () => {+ mocks.getOnboardingStep.mockResolvedValue("integrations");+ const { proxy } = await loadProxy();++ const response = await proxy(createRequest("/en/dashboard"));++ expect(response.status).toBe(307);+ expect(response.headers.get("location")).toBe("http://localhost/init");+ expect(mocks.getOnboardingStep).toHaveBeenCalledOnce();+ });++ it("allows /init while onboarding is unfinished", async () => {+ mocks.getOnboardingStep.mockResolvedValue("start");+ const { proxy } = await loadProxy();++ const response = await proxy(createRequest("/en/init"));++ expect(response.status).toBe(200);+ expect(mocks.getOnboardingStep).not.toHaveBeenCalled();+ expect(mocks.getDefaultLocale).toHaveBeenCalledOnce();+ });++ it("uses the configured default locale for a missing or invalid locale cookie", async () => {+ mocks.getDefaultLocale.mockResolvedValue("de");+ const { proxy } = await loadProxy();++ await proxy(createRequest("/en/dashboard", "not-a-locale"));++ expect(mocks.getDefaultLocale).toHaveBeenCalledOnce();+ expect(mocks.createI18nMiddleware).toHaveBeenCalledWith("de");+ });++ it("keeps a valid locale cookie and does not query the configured default", async () => {+ const { proxy } = await loadProxy();++ const response = await proxy(createRequest("/fr/dashboard", "fr"));++ expect(response.status).toBe(200);+ expect(mocks.getDefaultLocale).not.toHaveBeenCalled();+ expect(mocks.createI18nMiddleware).toHaveBeenCalledWith("en");+ });++ it("deduplicates concurrent cold-start database reads", async () => {+ let finishOnboarding!: (step: string) => void;+ let finishLocale!: (locale: string) => void;+ mocks.getOnboardingStep.mockImplementation(+ () =>+ new Promise<string>((resolve) => {+ finishOnboarding = resolve;+ }),+ );+ mocks.getDefaultLocale.mockImplementation(+ () =>+ new Promise<string>((resolve) => {+ finishLocale = resolve;+ }),+ );+ const { proxy } = await loadProxy();+ const responses = Array.from({ length: 50 }, () => proxy(createRequest("/en/dashboard", "not-a-locale")));++ await vi.waitFor(() => expect(mocks.getOnboardingStep).toHaveBeenCalledOnce());+ finishOnboarding("finish");+ await vi.waitFor(() => expect(mocks.getDefaultLocale).toHaveBeenCalledOnce());+ finishLocale("de");++ await expect(Promise.all(responses)).resolves.toHaveLength(50);+ expect(mocks.getOnboardingStep).toHaveBeenCalledOnce();+ expect(mocks.getDefaultLocale).toHaveBeenCalledOnce();+ });++ it("clears failed in-flight reads so the next request can recover", async () => {+ mocks.getOnboardingStep.mockRejectedValueOnce(new Error("temporary database failure")).mockResolvedValue("finish");+ const { proxy } = await loadProxy();++ await expect(proxy(createRequest("/en/dashboard", "en"))).rejects.toThrow("temporary database failure");+ await expect(proxy(createRequest("/en/dashboard", "en"))).resolves.toMatchObject({ status: 200 });++ expect(mocks.getOnboardingStep).toHaveBeenCalledTimes(2);+ });+});diff --git a/apps/nextjs/src/proxy.ts b/apps/nextjs/src/proxy.tsindex 42553bc2c..1bf12ba49 100644--- a/apps/nextjs/src/proxy.ts+++ b/apps/nextjs/src/proxy.ts@@ -1,21 +1,51 @@import type { NextRequest } from "next/server";import { NextResponse } from "next/server";-import { api } from "@homarr/api/server";-import { localeCookieKey } from "@homarr/definitions";-import type { SupportedLanguage } from "@homarr/translation";-import { supportedLanguages } from "@homarr/translation";+import { getDefaultLocaleForProxyAsync, getOnboardingStepForProxyAsync } from "@homarr/db/proxy-reader";+import { localeCookieKey } from "@homarr/definitions/cookie";+import type { SupportedLanguage } from "@homarr/translation/languages";+import { supportedLanguages } from "@homarr/translation/languages";import { createI18nMiddleware } from "@homarr/translation/middleware";let isOnboardingFinished = false;+let onboardingStepPromise: Promise<string> | null = null;+let defaultLocalePromise: Promise<string> | null = null;++const getOnboardingStepDedupedAsync = () => {+ onboardingStepPromise ??= getOnboardingStepForProxyAsync().then(+ (step) => {+ onboardingStepPromise = null;+ return step;+ },+ (error: unknown) => {+ onboardingStepPromise = null;+ throw error;+ },+ );+ return onboardingStepPromise;+};++const getDefaultLocaleDedupedAsync = () => {+ defaultLocalePromise ??= getDefaultLocaleForProxyAsync().then(+ (locale) => {+ defaultLocalePromise = null;+ return locale;+ },+ (error: unknown) => {+ defaultLocalePromise = null;+ throw error;+ },+ );+ return defaultLocalePromise;+};export async function proxy(request: NextRequest) {// Redirect to onboarding if it's not finished yetconst pathname = request.nextUrl.pathname;if (!isOnboardingFinished && !pathname.endsWith("/init")) {- const currentOnboardingStep = await api.onboard.currentStep();- if (currentOnboardingStep.current !== "finish") {+ const currentOnboardingStep = await getOnboardingStepDedupedAsync();+ if (currentOnboardingStep !== "finish") {return NextResponse.redirect(new URL("/init", request.url));}@@ -26,7 +56,10 @@ export async function proxy(request: NextRequest) {const currentLocale = request.cookies.get(localeCookieKey)?.value;let defaultLocale: SupportedLanguage = "en";if (!currentLocale || !supportedLanguages.includes(currentLocale as SupportedLanguage)) {- defaultLocale = await api.serverSettings.getCulture().then((culture) => culture.defaultLocale);+ const configuredLocale = await getDefaultLocaleDedupedAsync();+ if (supportedLanguages.includes(configuredLocale as SupportedLanguage)) {+ defaultLocale = configuredLocale as SupportedLanguage;+ }}// We don't want to fallback to accept-language header so we clear itdiff --git a/apps/nextjs/src/theme/color-scheme.ts b/apps/nextjs/src/theme/color-scheme.tsindex 284b636b4..230a0367e 100644--- a/apps/nextjs/src/theme/color-scheme.ts+++ b/apps/nextjs/src/theme/color-scheme.ts@@ -1,8 +1,7 @@import { cache } from "react";import { cookies } from "next/headers";-import { db } from "@homarr/db";-import { getServerSettingByKeyAsync } from "@homarr/db/queries";+import { getRscServerSettingsAsync } from "@homarr/api/server-settings-server";import type { ColorScheme } from "@homarr/definitions";import { colorSchemeCookieKey } from "@homarr/definitions";@@ -13,6 +12,6 @@ export const getCurrentColorSchemeAsync = cache(async () => {return cookieValue as ColorScheme;}- const appearanceSettings = await getServerSettingByKeyAsync(db, "appearance");- return appearanceSettings.defaultColorScheme;+ const serverSettings = await getRscServerSettingsAsync();+ return serverSettings.appearance.defaultColorScheme;});diff --git a/apps/tasks/src/main.ts b/apps/tasks/src/main.tsindex 55416e689..514694b77 100644--- a/apps/tasks/src/main.ts+++ b/apps/tasks/src/main.ts@@ -5,7 +5,7 @@ import { jobGroup } from "@homarr/cron-jobs";import { onStartAsync } from "./on-start";-void (async () => {+export const startupPromise = (async () => {await onStartAsync();await jobGroup.initializeAsync();await jobGroup.startAllAsync();diff --git a/apps/tasks/src/on-start/index.ts b/apps/tasks/src/on-start/index.tsindex cc6967dce..15b873186 100644--- a/apps/tasks/src/on-start/index.ts+++ b/apps/tasks/src/on-start/index.ts@@ -1,7 +1,5 @@import { cleanupSessionsAsync } from "./session-cleanup";-import { warmUpdateCheckerAsync } from "./warm-update-checker";export async function onStartAsync() {await cleanupSessionsAsync();- await warmUpdateCheckerAsync();}diff --git a/apps/tasks/src/on-start/warm-update-checker.ts b/apps/tasks/src/on-start/warm-update-checker.tsdeleted file mode 100644index a3b9f94a9..000000000--- a/apps/tasks/src/on-start/warm-update-checker.ts+++ /dev/null@@ -1,14 +0,0 @@-import { createLogger } from "@homarr/core/infrastructure/logs";-import { updateCheckerRequestHandler } from "@homarr/request-handler/update-checker";--const logger = createLogger({ module: "warmUpdateChecker" });--export async function warmUpdateCheckerAsync() {- try {- const handler = updateCheckerRequestHandler.handler({});- await handler.getDataAsync();- logger.debug("Update checker warmed");- } catch (error) {- logger.error(new Error("Failed to warm update checker", { cause: error }));- }-}diff --git a/apps/websocket/src/main.ts b/apps/websocket/src/main.tsindex 45dfe50a2..9e0032201 100644--- a/apps/websocket/src/main.ts+++ b/apps/websocket/src/main.ts@@ -12,6 +12,25 @@ const logger = createLogger({ module: "websocketMain" });const wss = new WebSocketServer({port: 3001,});+wss.on("error", (error) => {+ logger.error(new Error("WebSocket server error", { cause: error }));+});++export const startupPromise = new Promise<void>((resolve, reject) => {+ const onListening = () => {+ wss.off("error", onError);+ logger.info("✅ WebSocket Server listening on ws://localhost:3001");+ resolve();+ };+ const onError = (error: Error) => {+ wss.off("listening", onListening);+ reject(error);+ };++ wss.once("listening", onListening);+ wss.once("error", onError);+});+const handler = applyWSSHandler({wss,router: appRouter,@@ -57,7 +76,6 @@ wss.on("connection", (websocket, incomingMessage) => {logger.info(`➖ Connection (${wss.clients.size}) ${code} ${reason.toString()}`);});});-logger.info("✅ WebSocket Server listening on ws://localhost:3001");process.on("SIGTERM", () => {logger.info("SIGTERM");diff --git a/e2e/custom-widgets-custom-jsx.spec.ts b/e2e/custom-widgets-custom-jsx.spec.tsindex cba6c0d75..f85df45dd 100644--- a/e2e/custom-widgets-custom-jsx.spec.ts+++ b/e2e/custom-widgets-custom-jsx.spec.ts@@ -45,8 +45,9 @@ describe("Custom JSX custom widgets", () => {await page.goto(`${baseUrl}/auth/login`);await page.getByLabel("Username").fill(adminCredentials.username);await page.locator("#password").fill(adminCredentials.password);+ const loginNavigation = page.waitForURL(baseUrl, { timeout: 15_000, waitUntil: "commit" });await page.locator("css=button[type='submit']").click();- await page.waitForURL(baseUrl, { timeout: 15_000 });+ await loginNavigation;await page.goto(`${baseUrl}/manage/custom-widgets/new`);await page.waitForURL("**/manage/custom-widgets/new", { timeout: 15_000 });diff --git a/e2e/health-checks.spec.ts b/e2e/health-checks.spec.tsindex b280fcc56..411d8e29c 100644--- a/e2e/health-checks.spec.ts+++ b/e2e/health-checks.spec.ts@@ -8,13 +8,17 @@ describe("Health checks", () => {// Arrangeconst homarrContainer = await createHomarrContainer().start();- // Act- const readyResponse = await fetch(`http://localhost:${homarrContainer.getMappedPort(7575)}/api/health/ready`);- const liveResponse = await fetch(`http://localhost:${homarrContainer.getMappedPort(7575)}/api/health/live`);+ try {+ // Act+ const readyResponse = await fetch(`http://localhost:${homarrContainer.getMappedPort(7575)}/api/health/ready`);+ const liveResponse = await fetch(`http://localhost:${homarrContainer.getMappedPort(7575)}/api/health/live`);- // Assert- expect(readyResponse.status).toBe(200);- expect(liveResponse.status).toBe(200);+ // Assert+ expect(readyResponse.status).toBe(200);+ expect(liveResponse.status).toBe(200);+ } finally {+ await homarrContainer.stop();+ }}, 60_000);test("ready and live should return 200 OK with external redis", async () => {@@ -29,18 +33,22 @@ describe("Health checks", () => {},}).start();- // Act- const readyResponse = await fetch(`http://localhost:${homarrContainer.getMappedPort(7575)}/api/health/ready`);- const liveResponse = await fetch(`http://localhost:${homarrContainer.getMappedPort(7575)}/api/health/live`);+ try {+ // Act+ const readyResponse = await fetch(`http://localhost:${homarrContainer.getMappedPort(7575)}/api/health/ready`);+ const liveResponse = await fetch(`http://localhost:${homarrContainer.getMappedPort(7575)}/api/health/live`);- // Assert- expect(- readyResponse.status,- `Expected ready to return OK statusCode=${readyResponse.status} content=${await readyResponse.text()}`,- ).toBe(200);- expect(- liveResponse.status,- `Expected live to return OK statusCode=${liveResponse.status} content=${await liveResponse.text()}`,- ).toBe(200);+ // Assert+ expect(+ readyResponse.status,+ `Expected ready to return OK statusCode=${readyResponse.status} content=${await readyResponse.text()}`,+ ).toBe(200);+ expect(+ liveResponse.status,+ `Expected live to return OK statusCode=${liveResponse.status} content=${await liveResponse.text()}`,+ ).toBe(200);+ } finally {+ await Promise.all([homarrContainer.stop(), redisContainer.stop()]);+ }}, 60_000);});diff --git a/e2e/home.spec.ts b/e2e/home.spec.tsindex 2d79d7247..dcc8685c9 100644--- a/e2e/home.spec.ts+++ b/e2e/home.spec.ts@@ -7,10 +7,14 @@ describe("Home", () => {// Arrangeconst homarrContainer = await createHomarrContainer().start();- // Act- const homeResponse = await fetch(`http://localhost:${homarrContainer.getMappedPort(7575)}/`);+ try {+ // Act+ const homeResponse = await fetch(`http://localhost:${homarrContainer.getMappedPort(7575)}/`);- // Assert- expect(homeResponse.status).toBe(200);+ // Assert+ expect(homeResponse.status).toBe(200);+ } finally {+ await homarrContainer.stop();+ }}, 60_000);});diff --git a/e2e/lazy-widgets.spec.ts b/e2e/lazy-widgets.spec.tsnew file mode 100644index 000000000..0c31f0492--- /dev/null+++ b/e2e/lazy-widgets.spec.ts@@ -0,0 +1,110 @@+import { createId } from "@paralleldrive/cuid2";+import { chromium, expect } from "@playwright/test";+import { eq } from "drizzle-orm";+import { stringify } from "superjson";+import { describe, test } from "vitest";++import * as sqliteSchema from "../packages/db/schema/sqlite";+import { createHomarrContainer } from "./shared/create-homarr-container";+import { createSqliteDbFileAsync } from "./shared/e2e-db";+import { seedAdminUserAsync } from "./shared/seed-admin-user";++const adminCredentials = {+ username: "admin",+ password: "Comp(exP4sswOrd",+};++describe("lazy widget application graph", () => {+ test("renders an authenticated board and preserves first-use UI behavior after reload", async () => {+ const { db, localMountPath } = await createSqliteDbFileAsync();+ const { userId } = await seedAdminUserAsync(db, adminCredentials);+ const boardId = createId();+ const layoutId = createId();+ const sectionId = createId();+ const itemId = createId();++ await db.insert(sqliteSchema.boards).values({+ id: boardId,+ name: "lazy-widget-board",+ creatorId: userId,+ });+ await db.insert(sqliteSchema.layouts).values({+ id: layoutId,+ name: "Base",+ boardId,+ columnCount: 12,+ });+ await db.insert(sqliteSchema.sections).values({+ id: sectionId,+ boardId,+ kind: "empty",+ xOffset: 0,+ yOffset: 0,+ });+ await db.insert(sqliteSchema.items).values({+ id: itemId,+ boardId,+ kind: "clock",+ options: stringify({ showSeconds: true }),+ });+ await db.insert(sqliteSchema.itemLayouts).values({+ itemId,+ sectionId,+ layoutId,+ xOffset: 0,+ yOffset: 0,+ width: 4,+ height: 2,+ });+ await db.update(sqliteSchema.users).set({ homeBoardId: boardId }).where(eq(sqliteSchema.users.id, userId));++ const homarrContainer = await createHomarrContainer({+ environment: {+ AUTH_PROVIDERS: "credentials",+ },+ mounts: {+ "/appdata": localMountPath,+ },+ }).start();++ const baseUrl = `http://${homarrContainer.getHost()}:${homarrContainer.getMappedPort(7575)}`;+ const browser = await chromium.launch();+ const context = await browser.newContext();+ const page = await context.newPage();+ const pageErrors: Error[] = [];+ page.on("pageerror", (error) => pageErrors.push(error));++ try {+ await page.goto(`${baseUrl}/auth/login`);+ await page.getByLabel("Username").fill(adminCredentials.username);+ await page.locator("#password").fill(adminCredentials.password);+ await page.locator("css=button[type='submit']").click();++ await expect(page.locator("[data-homarr-dev-benchmark-board]")).toBeVisible({ timeout: 30_000 });+ await expect(page.locator(`[data-id="${itemId}"] .clock-widget-container`)).toBeVisible({ timeout: 15_000 });++ await page.keyboard.press("Control+K");+ await expect(page.locator("[data-homarr-dev-benchmark-spotlight]")).toBeVisible();+ await page.keyboard.press("Escape");+ await expect(page.locator("[data-homarr-dev-benchmark-spotlight]")).not.toBeVisible();++ await expect+ .poll(+ async () =>+ await page.evaluate(async () => {+ const registrations = await navigator.serviceWorker.getRegistrations();+ return registrations[0]?.scope ?? null;+ }),+ { timeout: 15_000 },+ )+ .toBe(`${baseUrl}/`);++ await page.reload();+ await expect(page.locator(`[data-id="${itemId}"] .clock-widget-container`)).toBeVisible({ timeout: 15_000 });+ expect(pageErrors).toEqual([]);+ } finally {+ await browser.close();+ await homarrContainer.stop();+ }+ }, 120_000);+});diff --git a/e2e/lldap.spec.ts b/e2e/lldap.spec.tsindex f1f07790d..19ff9905c 100644--- a/e2e/lldap.spec.ts+++ b/e2e/lldap.spec.ts@@ -37,45 +37,48 @@ describe("LLDAP authorization", () => {const context = await browser.newContext();const page = await context.newPage();- const onboardingActions = new OnboardingActions(page, db);- await onboardingActions.skipOnboardingAsync({- group: defaultCredentials.group,- });+ try {+ const onboardingActions = new OnboardingActions(page, db);+ await onboardingActions.skipOnboardingAsync({+ group: defaultCredentials.group,+ });- // Act- await page.goto(`http://${homarrContainer.getHost()}:${homarrContainer.getMappedPort(7575)}/auth/login`);- await page.getByLabel("Username").fill(defaultCredentials.username);- await page.locator("#password").fill(defaultCredentials.password);- await page.locator("css=button[type='submit']").click();+ // Act+ const baseUrl = `http://${homarrContainer.getHost()}:${homarrContainer.getMappedPort(7575)}`;+ await page.goto(`${baseUrl}/auth/login`);+ await page.getByLabel("Username").fill(defaultCredentials.username);+ await page.locator("#password").fill(defaultCredentials.password);+ await page.locator("css=button[type='submit']").click();- // Assert- await page.waitForURL(`http://${homarrContainer.getHost()}:${homarrContainer.getMappedPort(7575)}`);- const users = await db.query.users.findMany({- with: {- groups: {- with: {- group: true,+ // Assert+ await page.waitForURL(baseUrl, { timeout: 60_000 });+ const users = await db.query.users.findMany({+ with: {+ groups: {+ with: {+ group: true,+ },},},- },- });- expect(users).toHaveLength(1);- const user = users[0]!;- expect(user).toEqual(- expect.objectContaining({- name: defaultCredentials.username,- email: defaultCredentials.email,- provider: "ldap",- }),- );-- const groups = user.groups.map((g) => g.group.name);- expect(groups).toContain(defaultCredentials.group);+ });+ expect(users).toHaveLength(1);+ const user = users[0];+ if (!user) {+ throw new Error("Expected LDAP login to create one user");+ }+ expect(user).toEqual(+ expect.objectContaining({+ name: defaultCredentials.username,+ email: defaultCredentials.email,+ provider: "ldap",+ }),+ );- // Cleanup- await browser.close();- await homarrContainer.stop();- await lldapContainer.stop();+ const groups = user.groups.map((g) => g.group.name);+ expect(groups).toContain(defaultCredentials.group);+ } finally {+ await Promise.all([browser.close(), homarrContainer.stop(), lldapContainer.stop()]);+ }}, 120_000);});diff --git a/e2e/onboarding.spec.ts b/e2e/onboarding.spec.tsindex a8a09773e..39f473c20 100644--- a/e2e/onboarding.spec.ts+++ b/e2e/onboarding.spec.ts@@ -22,25 +22,25 @@ describe("Onboarding", () => {const actions = new OnboardingActions(page, db);const assertions = new OnboardingAssertions(page, db);- // Act- await page.goto(`http://${homarrContainer.getHost()}:${homarrContainer.getMappedPort(7575)}`);- await actions.startOnboardingAsync("scratch");- await actions.processUserStepAsync({- username: "admin",- password: "Comp(exP4sswOrd",- confirmPassword: "Comp(exP4sswOrd",- });- await actions.processSettingsStepAsync();- await actions.processIntegrationsStepAsync();+ try {+ // Act+ await page.goto(`http://${homarrContainer.getHost()}:${homarrContainer.getMappedPort(7575)}`);+ await actions.startOnboardingAsync("scratch");+ await actions.processUserStepAsync({+ username: "admin",+ password: "Comp(exP4sswOrd",+ confirmPassword: "Comp(exP4sswOrd",+ });+ await actions.processSettingsStepAsync();+ await actions.processIntegrationsStepAsync();- // Assert- await assertions.assertFinishStepVisibleAsync();- await assertions.assertUserAndAdminGroupInsertedAsync("admin");- await assertions.assertDbOnboardingStepAsync("finish");-- // Cleanup- await browser.close();- await homarrContainer.stop();+ // Assert+ await assertions.assertFinishStepVisibleAsync();+ await assertions.assertUserAndAdminGroupInsertedAsync("admin");+ await assertions.assertDbOnboardingStepAsync("finish");+ } finally {+ await Promise.all([browser.close(), homarrContainer.stop()]);+ }}, 60_000);test("External provider onboarding setup should be successful", async () => {@@ -66,22 +66,22 @@ describe("Onboarding", () => {const actions = new OnboardingActions(page, db);const assertions = new OnboardingAssertions(page, db);- // Act- await page.goto(`http://${homarrContainer.getHost()}:${homarrContainer.getMappedPort(7575)}`);- await actions.startOnboardingAsync("scratch");- await actions.processExternalGroupStepAsync({- name: externalGroupName,- });- await actions.processSettingsStepAsync();- await actions.processIntegrationsStepAsync();-- // Assert- await assertions.assertFinishStepVisibleAsync();- await assertions.assertExternalGroupInsertedAsync(externalGroupName);- await assertions.assertDbOnboardingStepAsync("finish");+ try {+ // Act+ await page.goto(`http://${homarrContainer.getHost()}:${homarrContainer.getMappedPort(7575)}`);+ await actions.startOnboardingAsync("scratch");+ await actions.processExternalGroupStepAsync({+ name: externalGroupName,+ });+ await actions.processSettingsStepAsync();+ await actions.processIntegrationsStepAsync();- // Cleanup- await browser.close();- await homarrContainer.stop();+ // Assert+ await assertions.assertFinishStepVisibleAsync();+ await assertions.assertExternalGroupInsertedAsync(externalGroupName);+ await assertions.assertDbOnboardingStepAsync("finish");+ } finally {+ await Promise.all([browser.close(), homarrContainer.stop()]);+ }}, 60_000);});diff --git a/e2e/shared/assertions/onboarding-assertions.ts b/e2e/shared/assertions/onboarding-assertions.tsindex 12cda67d0..c6cffc29c 100644--- a/e2e/shared/assertions/onboarding-assertions.ts+++ b/e2e/shared/assertions/onboarding-assertions.ts@@ -57,6 +57,6 @@ export class OnboardingAssertions {}public async assertFinishStepVisibleAsync() {- await this.page.waitForSelector("text=completed the setup", { timeout: 15000 });+ await this.page.waitForSelector("text=completed the setup", { timeout: 30_000 });}}diff --git a/package.json b/package.jsonindex 49f002ba6..25d23c1f0 100644--- a/package.json+++ b/package.json@@ -4,6 +4,11 @@"private": true,"scripts": {"build": "cross-env CI=true turbo build",+ "benchmark:build:docker": "node --experimental-strip-types scripts/benchmarks/docker-build.mts",+ "benchmark:compare": "node --experimental-strip-types scripts/benchmarks/benchmark-compare.mts",+ "benchmark:board-graph": "node --experimental-strip-types scripts/benchmarks/board-static-graph.mts",+ "benchmark:docker": "node --experimental-strip-types scripts/benchmarks/docker-runtime.mts",+ "benchmark:request-memory": "node --expose-gc --import tsx scripts/benchmarks/request-handler-memory.mts","clean": "git clean -xdf node_modules","clean:workspaces": "turbo clean","ci:act:all": "bash scripts/ci/act.sh all",@@ -21,6 +26,7 @@"db:push": "pnpm -F db push:sqlite","db:studio": "pnpm -F db studio","dev": "pnpm -F nextjs dev",+ "dev:benchmark": "node --experimental-strip-types scripts/benchmarks/dev-board.mts","dev:cli": "go -C tools/homarr-dev run .","dev:cli:install": "go -C tools/homarr-dev install .","dev:docs": "pnpm -F @homarr/docs dev",@@ -34,7 +40,7 @@"release": "semantic-release","scripts:update-bug-report-template": "tsx ./scripts/update-bug-report-template.mts","scripts:update-readme-integrations": "tsx ./scripts/update-integration-list.mts",- "start": "concurrently \"pnpm with-env node apps/tasks/tasks.cjs\" \"pnpm with-env node apps/websocket/wssServer.cjs\" \"pnpm -F nextjs start\"",+ "start": "pnpm -F nextjs start","test": "cross-env NODE_ENV=development CI=true vitest run --exclude e2e --coverage.enabled ","test:e2e": "cross-env NODE_ENV=development CI=true vitest e2e","test:ui": "cross-env NODE_ENV=development CI=true vitest --exclude e2e --ui --coverage.enabled",@@ -45,6 +51,7 @@"jsonpath-plus": "catalog:"},"devDependencies": {+ "@babel/parser": "catalog:","@playwright/test": "catalog:","@semantic-release/changelog": "catalog:","@semantic-release/commit-analyzer": "catalog:",@@ -65,6 +72,7 @@"oxlint": "catalog:","semantic-release": "catalog:","testcontainers": "catalog:",+ "tsx": "catalog:","turbo": "catalog:","typescript": "catalog:","vite": "catalog:",diff --git a/packages/api/package.json b/packages/api/package.jsonindex e747e2c5d..92f68ea36 100644--- a/packages/api/package.json+++ b/packages/api/package.json@@ -9,7 +9,10 @@"exports": {".": "./src/index.ts","./client": "./src/client.ts",+ "./board-server": "./src/board-server.ts","./query-cache": "./src/query-cache.ts",+ "./server-settings-server": "./src/server-settings-server.ts",+ "./user-server": "./src/user-server.ts","./server": "./src/server.ts","./websocket": "./src/websocket.ts","./shared": "./src/shared.ts",diff --git a/packages/api/src/board-server.ts b/packages/api/src/board-server.tsnew file mode 100644index 000000000..aabd3a364--- /dev/null+++ b/packages/api/src/board-server.ts@@ -0,0 +1,16 @@+import { cache } from "react";++import { createRscTrpcContext } from "./rsc-context";+import { boardRouter } from "./router/board";++const createBoardCallerAsync = async () => boardRouter.createCaller(await createRscTrpcContext());++export const getBoardByNameAsync = cache(async (name: string) => {+ const caller = await createBoardCallerAsync();+ return await caller.getBoardByName({ name });+});++export const getHomeBoardAsync = cache(async () => {+ const caller = await createBoardCallerAsync();+ return await caller.getHomeBoard();+});diff --git a/packages/api/src/query-cache.ts b/packages/api/src/query-cache.tsindex a8cdb9641..50f96e1c2 100644--- a/packages/api/src/query-cache.ts+++ b/packages/api/src/query-cache.ts@@ -1,22 +1,54 @@import type { QueryKey } from "@tanstack/react-query";-export const queryCacheDefaultStaleTimeMs = 0;+// RSC-prefetched data must survive the hydration pass without an immediate+// duplicate fetch. Widget-specific intervals still control live refreshes.+export const queryCacheDefaultStaleTimeMs = 30_000;export const queryCacheDefaultRefetchIntervalMs = 30_000;-export const queryCacheDefaultGcTimeMs = 1000 * 60 * 60 * 24;-export const queryCacheMaxValueBytes = 1024 * 1024;-export const queryCacheStoragePrefix = "homarr-widget-query";-export const queryCacheBuster = "v2-superjson";+export const queryCacheDefaultGcTimeMs = 1000 * 60 * 5;+export const queryCacheMetadataStaleTimeMs = 1000 * 60 * 5;-let activeQueryCacheBoardId: string | null = null;+const widgetDataQueryPaths = new Set(["app.byId", "app.byIds", "docker.getContainers", "integration.byIds"]);+const excludedWidgetPaths = new Set(["widget.app.ping", "widget.beszel.getSystemStats"]);-export const setActiveQueryCacheBoardId = (boardId: string | null) => {- activeQueryCacheBoardId = boardId;+export const isWidgetDataTrpcPath = (path: string) => {+ if (path.startsWith("widget.")) return !excludedWidgetPaths.has(path);+ return widgetDataQueryPaths.has(path);};-export const getActiveQueryCacheBoardId = () => activeQueryCacheBoardId;--const persistableQueryPaths = new Set(["app.byId", "app.byIds", "docker.getContainers", "integration.byIds"]);-const excludedWidgetPaths = new Set(["widget.app.ping", "widget.beszel.getSystemStats"]);+// These supporting queries can be numerous on a dashboard. Give them a+// predictable refresh policy instead of refetching all of them after every tab+// focus/reconnect event. Metadata can refresh after a bounded stale window;+// Docker state remains live on a single shared timer.+export const dashboardSupportingQueryPolicies = [+ {+ queryKey: [["app", "byId"]],+ refetchInterval: false,+ staleTime: queryCacheMetadataStaleTimeMs,+ refetchOnWindowFocus: true,+ refetchOnReconnect: true,+ },+ {+ queryKey: [["app", "byIds"]],+ refetchInterval: false,+ staleTime: queryCacheMetadataStaleTimeMs,+ refetchOnWindowFocus: true,+ refetchOnReconnect: true,+ },+ {+ queryKey: [["integration", "byIds"]],+ refetchInterval: false,+ staleTime: queryCacheMetadataStaleTimeMs,+ refetchOnWindowFocus: true,+ refetchOnReconnect: true,+ },+ {+ queryKey: [["docker", "getContainers"]],+ refetchInterval: queryCacheDefaultRefetchIntervalMs,+ staleTime: queryCacheDefaultStaleTimeMs,+ refetchOnWindowFocus: false,+ refetchOnReconnect: false,+ },+] as const;const getTrpcPathFromQueryKey = (queryKey: QueryKey) => {const first = queryKey[0];@@ -26,11 +58,9 @@ const getTrpcPathFromQueryKey = (queryKey: QueryKey) => {return parts.length > 0 ? parts : null;};-export const isPersistableWidgetQueryKey = (queryKey: QueryKey) => {+export const isWidgetDataQueryKey = (queryKey: QueryKey) => {const path = getTrpcPathFromQueryKey(queryKey);if (!path) return false;- if (path[0] === "widget") return !excludedWidgetPaths.has(path.join("."));-- return persistableQueryPaths.has(path.join("."));+ return isWidgetDataTrpcPath(path.join("."));};diff --git a/packages/api/src/root.ts b/packages/api/src/root.tsindex e210d5cb4..691e868b3 100644--- a/packages/api/src/root.ts+++ b/packages/api/src/root.ts@@ -24,7 +24,6 @@ export const appRouter = createTRPCRouter({cronJobs: lazy(() => import("./router/cron-jobs").then((mod) => mod.cronJobsRouter)),apiKeys: lazy(() => import("./router/apiKeys").then((mod) => mod.apiKeysRouter)),media: lazy(() => import("./router/medias/media-router").then((mod) => mod.mediaRouter)),- queryCache: lazy(() => import("./router/query-cache").then((mod) => mod.queryCacheRouter)),updateChecker: lazy(() => import("./router/update-checker").then((mod) => mod.updateCheckerRouter)),certificates: lazy(() => import("./router/certificates/certificate-router").then((mod) => mod.certificateRouter)),bangs: lazy(() => import("./router/bangs/bangs-router").then((mod) => mod.bangsRouter)),diff --git a/packages/api/src/router/board.ts b/packages/api/src/router/board.tsindex 9cb34d1bd..88a1c42be 100644--- a/packages/api/src/router/board.ts+++ b/packages/api/src/router/board.ts@@ -1757,9 +1757,12 @@ const getElementsForLayout = (board: Awaited<ReturnType<typeof getFullBoardWithW};const getFullBoardWithWhereAsync = async (db: Database, where: SQL<unknown>, userId: string | null) => {- const groupsOfCurrentUser = await db.query.groupMembers.findMany({- where: eq(groupMembers.userId, userId ?? ""),- });+ const groupPermissionWhere = userId+ ? inArray(+ boardGroupPermissions.groupId,+ db.select({ groupId: groupMembers.groupId }).from(groupMembers).where(eq(groupMembers.userId, userId)),+ )+ : eq(boardGroupPermissions.groupId, "");const board = await db.query.boards.findFirst({where,with: {@@ -1782,8 +1785,8 @@ const getFullBoardWithWhereAsync = async (db: Database, where: SQL<unknown>, useitems: {with: {integrations: {- with: {- integration: true,+ columns: {+ integrationId: true,},},layouts: true,@@ -1797,7 +1800,7 @@ const getFullBoardWithWhereAsync = async (db: Database, where: SQL<unknown>, use},},groupPermissions: {- where: inArray(boardGroupPermissions.groupId, groupsOfCurrentUser.map((group) => group.groupId).concat("")),+ where: groupPermissionWhere,},},});@@ -1845,7 +1848,7 @@ const getFullBoardWithWhereAsync = async (db: Database, where: SQL<unknown>, uselayoutId: layout.layoutId,sectionId: layout.sectionId,})),- integrationIds: itemIntegrations.map((item) => item.integration.id),+ integrationIds: itemIntegrations.map((item) => item.integrationId),advancedOptions: superjson.parse<BoardItemAdvancedOptions>(item.advancedOptions),options: superjson.parse<Record<string, unknown>>(item.options),}),diff --git a/packages/api/src/router/board/board-access.ts b/packages/api/src/router/board/board-access.tsindex 1e4351cba..1eec666a6 100644--- a/packages/api/src/router/board/board-access.ts+++ b/packages/api/src/router/board/board-access.ts@@ -19,9 +19,12 @@ export const throwIfActionForbiddenAsync = async (permission: BoardPermission,) => {const { db, session } = ctx;- const groupsOfCurrentUser = await db.query.groupMembers.findMany({- where: eq(groupMembers.userId, session?.user.id ?? ""),- });+ const groupPermissionWhere = session+ ? inArray(+ boardGroupPermissions.groupId,+ db.select({ groupId: groupMembers.groupId }).from(groupMembers).where(eq(groupMembers.userId, session.user.id)),+ )+ : eq(boardGroupPermissions.groupId, "");const board = await db.query.boards.findFirst({where: boardWhere,columns: {@@ -34,7 +37,7 @@ export const throwIfActionForbiddenAsync = async (where: eq(boardUserPermissions.userId, session?.user.id ?? ""),},groupPermissions: {- where: inArray(boardGroupPermissions.groupId, groupsOfCurrentUser.map((group) => group.groupId).concat("")),+ where: groupPermissionWhere,},},});diff --git a/packages/api/src/router/query-cache.ts b/packages/api/src/router/query-cache.tsdeleted file mode 100644index 25c9f3808..000000000--- a/packages/api/src/router/query-cache.ts+++ /dev/null@@ -1,42 +0,0 @@-import { z } from "zod/v4";--import { eq } from "@homarr/db";-import { boards } from "@homarr/db/schema";-import { removeQueryCacheAsync, setQueryCacheAsync } from "@homarr/redis";--import { queryCacheDefaultGcTimeMs, queryCacheMaxValueBytes } from "../query-cache";-import { createTRPCRouter, internalProcedure } from "../trpc";-import { throwIfActionForbiddenAsync } from "./board/board-access";--const queryCacheBoardInput = z.object({- boardId: z.string().min(1),-});--const queryCacheSetInput = queryCacheBoardInput.extend({- value: z.string().max(queryCacheMaxValueBytes * 2),-});--const validateBoardAccessAsync = async (ctx: Parameters<typeof throwIfActionForbiddenAsync>[0], boardId: string) => {- await throwIfActionForbiddenAsync(ctx, eq(boards.id, boardId), "view");-};--export const queryCacheRouter = createTRPCRouter({- setItem: internalProcedure.input(queryCacheSetInput).mutation(async ({ ctx, input }) => {- await validateBoardAccessAsync(ctx, input.boardId);- const userId = ctx.session?.user.id ?? "anonymous";- return {- stored: await setQueryCacheAsync(- userId,- input.boardId,- input.value,- queryCacheDefaultGcTimeMs,- queryCacheMaxValueBytes,- ),- };- }),- removeItem: internalProcedure.input(queryCacheBoardInput).mutation(async ({ ctx, input }) => {- await validateBoardAccessAsync(ctx, input.boardId);- const userId = ctx.session?.user.id ?? "anonymous";- await removeQueryCacheAsync(userId, input.boardId);- }),-});diff --git a/packages/api/src/router/test/update-checker.spec.ts b/packages/api/src/router/test/update-checker.spec.tsnew file mode 100644index 000000000..e35209f06--- /dev/null+++ b/packages/api/src/router/test/update-checker.spec.ts@@ -0,0 +1,58 @@+import { describe, expect, test, vi } from "vitest";++import type { Session } from "@homarr/auth";+import type { Database } from "@homarr/db";+import type { GroupPermissionKey } from "@homarr/definitions";++import { updateCheckerRouter } from "../update-checker";++const mocks = vi.hoisted(() => ({+ getDataAsync: vi.fn(async () => ({+ data: { availableUpdates: [{ tagName: "v99.0.0" }] },+ timestamp: new Date(),+ })),+}));++vi.mock("@homarr/request-handler/update-checker", () => ({+ updateCheckerRequestHandler: {+ handler: () => ({ getDataAsync: mocks.getDataAsync }),+ },+}));++const createSession = (permissions: GroupPermissionKey[]): Session => ({+ user: {+ id: "user",+ permissions,+ colorScheme: "light",+ },+ expires: new Date().toISOString(),+});++const createCaller = (session: Session | null) =>+ updateCheckerRouter.createCaller({+ db: null as unknown as Database,+ deviceType: undefined,+ session,+ });++describe("update checker authorization", () => {+ test("allows administrators to read the cached result", async () => {+ await expect(createCaller(createSession(["admin"])).getAvailableUpdates()).resolves.toEqual([+ { tagName: "v99.0.0" },+ ]);+ });++ test("rejects authenticated users without admin permission", async () => {+ await expect(createCaller(createSession([])).getAvailableUpdates()).rejects.toThrow("Permission denied");+ });++ test("rejects anonymous users", async () => {+ await expect(createCaller(null).getAvailableUpdates()).rejects.toThrow("UNAUTHORIZED");+ });++ test("returns an empty result when the cache reader fails", async () => {+ mocks.getDataAsync.mockRejectedValueOnce(new Error("Redis unavailable"));++ await expect(createCaller(createSession(["admin"])).getAvailableUpdates()).resolves.toEqual([]);+ });+});diff --git a/packages/api/src/router/update-checker.ts b/packages/api/src/router/update-checker.tsindex 8cb6c097e..cd7af0e56 100644--- a/packages/api/src/router/update-checker.ts+++ b/packages/api/src/router/update-checker.ts@@ -12,8 +12,8 @@ export const updateCheckerRouter = createTRPCRouter({const data = await handler.getDataAsync();return data.data.availableUpdates;} catch (error) {- logger.error(new Error("Failed to get available updates", { cause: error }));- return undefined; // We return undefined to not show the indicator in the UI+ logger.error(new Error("Failed to read the cached update check", { cause: error }));+ return []; // An empty list hides the indicator without violating TanStack Query's data contract.}}),});diff --git a/packages/api/src/router/widgets/rssFeed.ts b/packages/api/src/router/widgets/rssFeed.tsindex 5e43efe3e..6cb198395 100644--- a/packages/api/src/router/widgets/rssFeed.ts+++ b/packages/api/src/router/widgets/rssFeed.ts@@ -2,6 +2,7 @@ import SuperJSON from "superjson";import { z } from "zod/v4";import type { Session } from "@homarr/auth";+import { env } from "@homarr/common/env";import type { Database } from "@homarr/db";import { eq } from "@homarr/db";import { items, users } from "@homarr/db/schema";@@ -20,6 +21,8 @@ const feedsInput = z.object({export const rssFeedRouter = createTRPCRouter({getFeeds: publicProcedure.input(feedsInput).query(async ({ ctx, input }) => {+ if (env.NO_EXTERNAL_CONNECTION) return [];+const urls = (await canAccessAllFeedsAsync(ctx.db, ctx.session))? input.urls: await restrictUrlsAsync(ctx.db, input.urls);diff --git a/packages/api/src/router/widgets/weather.ts b/packages/api/src/router/widgets/weather.tsindex 87ea6b48a..98416ee3c 100644--- a/packages/api/src/router/widgets/weather.ts+++ b/packages/api/src/router/widgets/weather.ts@@ -1,5 +1,6 @@import { z } from "zod/v4";+import { env } from "@homarr/common/env";import { weatherRequestHandler } from "@homarr/request-handler/weather";import { createTRPCRouter, publicProcedure } from "../../trpc";@@ -11,6 +12,8 @@ const atLocationInput = z.object({export const weatherRouter = createTRPCRouter({atLocation: publicProcedure.input(atLocationInput).query(async ({ input }) => {+ if (env.NO_EXTERNAL_CONNECTION) return null;+const handler = weatherRequestHandler.handler(input);return await handler.getDataAsync().then((result) => result.data);}),diff --git a/packages/api/src/rsc-context.ts b/packages/api/src/rsc-context.tsnew file mode 100644index 000000000..6ea6eeb2d--- /dev/null+++ b/packages/api/src/rsc-context.ts@@ -0,0 +1,16 @@+import { cache } from "react";+import { headers } from "next/headers";++import { auth } from "@homarr/auth/next";++import { createTRPCContext } from "./trpc";++export const createRscTrpcContext = cache(async () => {+ const requestHeaders = new Headers(await headers());+ requestHeaders.set("x-trpc-source", "rsc");++ return createTRPCContext({+ session: await auth(),+ headers: requestHeaders,+ });+});diff --git a/packages/api/src/server-settings-server.ts b/packages/api/src/server-settings-server.tsnew file mode 100644index 000000000..29755dfac--- /dev/null+++ b/packages/api/src/server-settings-server.ts@@ -0,0 +1,8 @@+import { cache } from "react";++import { db } from "@homarr/db";+import { getServerSettingsAsync } from "@homarr/db/queries";++// One settings snapshot per RSC request, shared by the root layout, theme, and+// widget prefetching. React invalidates this cache between requests.+export const getRscServerSettingsAsync = cache(async () => await getServerSettingsAsync(db));diff --git a/packages/api/src/server.ts b/packages/api/src/server.tsindex b172e2e84..eae175c62 100644--- a/packages/api/src/server.ts+++ b/packages/api/src/server.ts@@ -1,25 +1,16 @@import { cache } from "react";-import { headers } from "next/headers";import { createTRPCOptionsProxy } from "@trpc/tanstack-react-query";-import { appRouter, createCaller, createTRPCContext } from "@homarr/api";-import { auth } from "@homarr/auth/next";+import { appRouter, createCaller } from "@homarr/api";+import { createRscTrpcContext } from "./rsc-context";import { makeQueryClient } from "./shared";/*** This wraps the `createTRPCContext` helper and provides the required context for the tRPC API when* handling a tRPC call from a React Server Component.*/-const createContext = cache(async () => {- const heads = new Headers(await headers());- heads.set("x-trpc-source", "rsc");-- return createTRPCContext({- session: await auth(),- headers: heads,- });-});+const createContext = () => createRscTrpcContext();export const api = createCaller(createContext);diff --git a/packages/api/src/test/query-cache.spec.ts b/packages/api/src/test/query-cache.spec.tsindex 68d28eb15..e5928bf71 100644--- a/packages/api/src/test/query-cache.spec.ts+++ b/packages/api/src/test/query-cache.spec.ts@@ -1,65 +1,20 @@import { afterEach, describe, expect, test, vi } from "vitest";import { QueryClient } from "@tanstack/react-query";-import type { Session } from "@homarr/auth";-import { createId } from "@homarr/common";-import type { Database } from "@homarr/db";-import { boards, users } from "@homarr/db/schema";-import { createDb } from "@homarr/db/test";import {- isPersistableWidgetQueryKey,+ dashboardSupportingQueryPolicies,+ isWidgetDataQueryKey,+ isWidgetDataTrpcPath,+ queryCacheDefaultRefetchIntervalMs,queryCacheDefaultStaleTimeMs,- queryCacheMaxValueBytes,+ queryCacheMetadataStaleTimeMs,} from "@homarr/api/query-cache";-import { queryCacheRouter } from "../router/query-cache";--const redisMock = vi.hoisted(() => {- const values = new Map<string, string>();-- return {- values,- setQueryCacheAsync: vi.fn(- async (_userId: string, _boardId: string, value: string, _ttlMs: number, maxValueBytes: number) => {- if (Buffer.byteLength(value, "utf8") > maxValueBytes) return false;- values.set(`${_userId}:${_boardId}`, value);- return true;- },- ),- removeQueryCacheAsync: vi.fn(async (_userId: string, _boardId: string) => {- values.delete(`${_userId}:${_boardId}`);- }),- };-});--vi.mock("@homarr/redis", () => ({- setQueryCacheAsync: redisMock.setQueryCacheAsync,- removeQueryCacheAsync: redisMock.removeQueryCacheAsync,-}));--vi.mock("@homarr/auth", () => ({ auth: () => ({}) as Session }));-afterEach(() => {vi.useRealTimers();- redisMock.values.clear();- redisMock.setQueryCacheAsync.mockClear();- redisMock.removeQueryCacheAsync.mockClear();-});--const createSession = (userId = createId()): Session => ({- user: {- id: userId,- permissions: [],- colorScheme: "light",- },- expires: new Date().toISOString(),});-const insertUserAsync = async (db: Database, id: string) => {- await db.insert(users).values({ id });-};--describe("isPersistableWidgetQueryKey", () => {+describe("isWidgetDataQueryKey", () => {test.each([[[["widget", "calendar", "findAllEvents"], { type: "query" }], true],[[["app", "byId"], { type: "query" }], true],@@ -72,77 +27,22 @@ describe("isPersistableWidgetQueryKey", () => {[[["app", "selectable"], { type: "query" }], false],[[["board", "getBoardByName"], { type: "query" }], false],[["widget"], false],- ])("matches persist filter for %j", (queryKey, expected) => {- expect(isPersistableWidgetQueryKey(queryKey)).toBe(expected);+ ])("matches widget data queries for %j", (queryKey, expected) => {+ expect(isWidgetDataQueryKey(queryKey)).toBe(expected);});});-describe("queryCacheRouter", () => {- test("stores and removes data for a board viewer", async () => {- const db = createDb();- const session = createSession();- await insertUserAsync(db, session.user.id);- await db.insert(boards).values({ id: "board-1", name: "board", creatorId: session.user.id, isPublic: false });-- const caller = queryCacheRouter.createCaller({ db, deviceType: undefined, session });-- await expect(caller.setItem({ boardId: "board-1", value: "cached-value" })).resolves.toEqual({- stored: true,- });- expect(redisMock.setQueryCacheAsync).toHaveBeenCalledWith(- session.user.id,- "board-1",- "cached-value",- expect.any(Number),- queryCacheMaxValueBytes,- );-- await caller.removeItem({ boardId: "board-1" });- expect(redisMock.removeQueryCacheAsync).toHaveBeenCalledWith(session.user.id, "board-1");- });-- test("does not touch Redis when board access is denied", async () => {- const db = createDb();- await insertUserAsync(db, "owner");- await db.insert(boards).values({ id: "board-1", name: "board", creatorId: "owner", isPublic: false });-- redisMock.setQueryCacheAsync.mockClear();- const caller = queryCacheRouter.createCaller({ db, deviceType: undefined, session: createSession("other-user") });-- await expect(caller.setItem({ boardId: "board-1", value: "cached-value" })).rejects.toThrow("Board not found");- expect(redisMock.setQueryCacheAsync).not.toHaveBeenCalled();- });-- test("scopes anonymous public-board cache entries by anonymous user", async () => {- const db = createDb();- await insertUserAsync(db, "owner");- await db.insert(boards).values({ id: "board-1", name: "board", creatorId: "owner", isPublic: true });-- const caller = queryCacheRouter.createCaller({ db, deviceType: undefined, session: null });-- await caller.setItem({ boardId: "board-1", value: "cached-value" });-- expect(redisMock.setQueryCacheAsync).toHaveBeenCalledWith(- "anonymous",- "board-1",- "cached-value",- expect.any(Number),- queryCacheMaxValueBytes,- );- });-- test("rejects oversized values", async () => {- const db = createDb();- const session = createSession("user-1");- await insertUserAsync(db, session.user.id);- await db.insert(boards).values({ id: "board-1", name: "board", creatorId: session.user.id, isPublic: false });-- const caller = queryCacheRouter.createCaller({ db, deviceType: undefined, session });- const value = "x".repeat(queryCacheMaxValueBytes + 1);-- await expect(caller.setItem({ boardId: "board-1", value })).resolves.toEqual({- stored: false,- });+describe("isWidgetDataTrpcPath", () => {+ test.each([+ ["widget.calendar.findAllEvents", true],+ ["app.byIds", true],+ ["integration.byIds", true],+ ["docker.getContainers", true],+ ["widget.app.ping", false],+ ["widget.beszel.getSystemStats", false],+ ["board.getBoardByName", false],+ ])("classifies dashboard data path %s", (path, expected) => {+ expect(isWidgetDataTrpcPath(path)).toBe(expected);});});@@ -176,3 +76,38 @@ describe("query cache stale handling", () => {expect(queryFn).toHaveBeenCalledOnce();});});++describe("dashboard supporting query policies", () => {+ test("bounds metadata staleness without adding per-widget timers", () => {+ expect(dashboardSupportingQueryPolicies).toEqual([+ {+ queryKey: [["app", "byId"]],+ refetchInterval: false,+ staleTime: queryCacheMetadataStaleTimeMs,+ refetchOnWindowFocus: true,+ refetchOnReconnect: true,+ },+ {+ queryKey: [["app", "byIds"]],+ refetchInterval: false,+ staleTime: queryCacheMetadataStaleTimeMs,+ refetchOnWindowFocus: true,+ refetchOnReconnect: true,+ },+ {+ queryKey: [["integration", "byIds"]],+ refetchInterval: false,+ staleTime: queryCacheMetadataStaleTimeMs,+ refetchOnWindowFocus: true,+ refetchOnReconnect: true,+ },+ {+ queryKey: [["docker", "getContainers"]],+ refetchInterval: queryCacheDefaultRefetchIntervalMs,+ staleTime: queryCacheDefaultStaleTimeMs,+ refetchOnWindowFocus: false,+ refetchOnReconnect: false,+ },+ ]);+ });+});diff --git a/packages/api/src/user-server.ts b/packages/api/src/user-server.tsnew file mode 100644index 000000000..e0455af77--- /dev/null+++ b/packages/api/src/user-server.ts@@ -0,0 +1,24 @@+import { cache } from "react";++import { db, eq } from "@homarr/db";+import { users } from "@homarr/db/schema";++// Keep the authenticated user lookup shared across nested RSC layouts. React+// clears this memo between requests, so authorization changes cannot leak.+export const getRscUserSettingsAsync = cache(async (userId: string) =>+ db.query.users.findFirst({+ columns: {+ homeBoardId: true,+ mobileHomeBoardId: true,+ firstDayOfWeek: true,+ pingIconsEnabled: true,+ enableRightClickOnWidgets: true,+ defaultSearchEngineId: true,+ openSearchInNewTab: true,+ ddgBangs: true,+ completedManageTour: true,+ completedBoardTour: true,+ },+ where: eq(users.id, userId),+ }),+);diff --git a/packages/auth/callbacks.ts b/packages/auth/callbacks.tsindex 51c9c83e5..4a12cef2f 100644--- a/packages/auth/callbacks.ts+++ b/packages/auth/callbacks.ts@@ -3,24 +3,18 @@ import type { NextAuthConfig } from "next-auth";import type { Session } from "@homarr/auth";import type { Database } from "@homarr/db";-import { eq, inArray } from "@homarr/db";+import { eq } from "@homarr/db";import { groupMembers, groupPermissions, users } from "@homarr/db/schema";import { getPermissionsWithChildren } from "@homarr/definitions";export const getCurrentUserPermissionsAsync = async (db: Database, userId: string) => {- const dbGroupMembers = await db.query.groupMembers.findMany({- where: eq(groupMembers.userId, userId),- });- const groupIds = dbGroupMembers.map((groupMember) => groupMember.groupId);-- if (groupIds.length === 0) return [];-const dbGroupPermissions = await db.selectDistinct({permission: groupPermissions.permission,}).from(groupPermissions)- .where(inArray(groupPermissions.groupId, groupIds));+ .innerJoin(groupMembers, eq(groupPermissions.groupId, groupMembers.groupId))+ .where(eq(groupMembers.userId, userId));const permissionKeys = dbGroupPermissions.map(({ permission }) => permission);return getPermissionsWithChildren(permissionKeys);@@ -43,12 +37,15 @@ export const createSessionAsync = async (export const createSessionCallback = (db: Database): NextAuthCallbackOf<"session"> => {return async ({ session, user }) => {- const additionalProperties = await db.query.users.findFirst({- where: eq(users.id, user.id),- columns: {- colorScheme: true,- },- });+ const [additionalProperties, permissions] = await Promise.all([+ db.query.users.findFirst({+ where: eq(users.id, user.id),+ columns: {+ colorScheme: true,+ },+ }),+ getCurrentUserPermissionsAsync(db, user.id),+ ]);return {...session,@@ -57,7 +54,7 @@ export const createSessionCallback = (db: Database): NextAuthCallbackOf<"session...additionalProperties,id: user.id,name: user.name,- permissions: await getCurrentUserPermissionsAsync(db, user.id),+ permissions,},};};diff --git a/packages/auth/permissions/integration-provider.tsx b/packages/auth/permissions/integration-provider.tsxindex f63fd3c3d..3a2946502 100644--- a/packages/auth/permissions/integration-provider.tsx+++ b/packages/auth/permissions/integration-provider.tsx@@ -3,14 +3,9 @@import type { PropsWithChildren } from "react";import { createContext, useContext } from "react";-import type { IntegrationKind } from "@homarr/definitions";-interface IntegrationContextProps {integrations: {id: string;- name: string;- url: string;- kind: IntegrationKind;permissions: {hasFullAccess: boolean;hasInteractAccess: boolean;diff --git a/packages/auth/permissions/integrations-with-permissions.ts b/packages/auth/permissions/integrations-with-permissions.tsindex 76cae6c93..a49ec4d76 100644--- a/packages/auth/permissions/integrations-with-permissions.ts+++ b/packages/auth/permissions/integrations-with-permissions.ts@@ -6,31 +6,28 @@ import { groupMembers, integrationGroupPermissions, integrationUserPermissions }import { constructIntegrationPermissions } from "./integration-permissions";export const getIntegrationsWithPermissionsAsync = async (session: Session | null) => {- const groupsOfCurrentUser = await db.query.groupMembers.findMany({- where: eq(groupMembers.userId, session?.user.id ?? ""),- });- const integrations = await db.query.integrations.findMany({+ const groupPermissionWhere = session+ ? inArray(+ integrationGroupPermissions.groupId,+ db.select({ groupId: groupMembers.groupId }).from(groupMembers).where(eq(groupMembers.userId, session.user.id)),+ )+ : eq(integrationGroupPermissions.groupId, "");+ const integrationRows = await db.query.integrations.findMany({columns: {id: true,- name: true,- url: true,- kind: true,},with: {userPermissions: {where: eq(integrationUserPermissions.userId, session?.user.id ?? ""),},groupPermissions: {- where: inArray(- integrationGroupPermissions.groupId,- groupsOfCurrentUser.map((group) => group.groupId),- ),+ where: groupPermissionWhere,},},});- return integrations.map(({ userPermissions, groupPermissions, ...integration }) => ({- ...integration,+ return integrationRows.map(({ id, userPermissions, groupPermissions }) => ({+ id,permissions: constructIntegrationPermissions({ userPermissions, groupPermissions }, session),}));};diff --git a/packages/boards/src/context.tsx b/packages/boards/src/context.tsxindex b482fbe0c..a74503b97 100644--- a/packages/boards/src/context.tsx+++ b/packages/boards/src/context.tsx@@ -6,7 +6,6 @@ import { usePathname } from "next/navigation";import type { RouterOutputs } from "@homarr/api";import { clientApi } from "@homarr/api/client";-import { getActiveQueryCacheBoardId, setActiveQueryCacheBoardId } from "@homarr/api/query-cache";import { updateBoardName } from "./updater";@@ -36,16 +35,6 @@ export const BoardProvider = ({};}, [pathname, utils, initialBoard.name]);- useEffect(() => {- setActiveQueryCacheBoardId(data.id);-- return () => {- if (getActiveQueryCacheBoardId() === data.id) {- setActiveQueryCacheBoardId(null);- }- };- }, [data.id]);-return (<BoardContext.Providervalue={{diff --git a/packages/db/collection.ts b/packages/db/collection.tsindex 00e5aba18..7449e2f79 100644--- a/packages/db/collection.ts+++ b/packages/db/collection.ts@@ -35,8 +35,10 @@ export const createDbInsertCollectionForTransaction = <TTableKey extends TableKedb.transaction((transaction) => {for (const [key, values] of objectEntries(context)) {if (values.length >= 1) {+ // oxlint-disable-next-line import/namespace -- TableKey limits key to exported schema tables.+ const table = schema[key];transaction- .insert(schema[key])+ .insert(table).values(values as never).run();}@@ -50,7 +52,9 @@ export const createDbInsertCollectionForTransaction = <TTableKey extends TableKefor (const [key, values] of objectEntries(context)) {if (values.length >= 1) {// Below is actually the mysqlSchema when the driver is mysql- await transaction.insert(schema[key] as never).values(values as never);+ // oxlint-disable-next-line import/namespace -- TableKey limits key to exported schema tables.+ const table = schema[key] as never;+ await transaction.insert(table).values(values as never);}}});diff --git a/packages/db/package.json b/packages/db/package.jsonindex 970fbab94..f8bdfacc5 100644--- a/packages/db/package.json+++ b/packages/db/package.json@@ -9,6 +9,7 @@"exports": {".": "./index.ts","./collection": "./collection.ts",+ "./proxy-reader": "./proxy-reader.ts","./schema": "./schema/index.ts","./test": "./test/index.ts","./queries": "./queries/index.ts",diff --git a/packages/db/proxy-reader.integration.spec.ts b/packages/db/proxy-reader.integration.spec.tsnew file mode 100644index 000000000..2d85495b5--- /dev/null+++ b/packages/db/proxy-reader.integration.spec.ts@@ -0,0 +1,128 @@+// @vitest-environment node++import fs from "node:fs/promises";+import os from "node:os";+import path from "node:path";+import Database from "better-sqlite3";+import { MySqlContainer } from "@testcontainers/mysql";+import { PostgreSqlContainer } from "@testcontainers/postgresql";+import mysql from "mysql2/promise";+import { Client } from "pg";+import { stringify } from "superjson";+import { describe, expect, test, vi } from "vitest";++const mocks = vi.hoisted(() => ({+ dbEnv: {} as Record<string, unknown>,+}));++vi.mock("@homarr/core/infrastructure/db/env", () => ({ dbEnv: mocks.dbEnv }));++const configureDriver = (values: Record<string, unknown>) => {+ vi.resetModules();+ for (const key of Object.keys(mocks.dbEnv)) delete mocks.dbEnv[key];+ Object.assign(mocks.dbEnv, values);+};++const readSettingsAsync = async () => {+ const reader = await import("./proxy-reader");+ const result = {+ locale: await reader.getDefaultLocaleForProxyAsync(),+ onboardingStep: await reader.getOnboardingStepForProxyAsync(),+ };+ await reader.closeProxySettingsReaderAsync();+ return result;+};++describe("proxy settings reader database compatibility", () => {+ test("reads SQLite settings and falls back for malformed culture data", async () => {+ const databasePath = path.join(os.tmpdir(), `homarr-proxy-reader-${process.pid}-${Date.now()}.sqlite`);+ const database = new Database(databasePath);+ database.exec("CREATE TABLE onboarding (step TEXT NOT NULL)");+ database.exec('CREATE TABLE "serverSetting" (setting_key TEXT NOT NULL, value TEXT NOT NULL)');+ database.prepare("INSERT INTO onboarding (step) VALUES (?)").run("finish");+ database+ .prepare('INSERT INTO "serverSetting" (setting_key, value) VALUES (?, ?)')+ .run("culture", stringify({ defaultLocale: "de" }));+ database.close();++ try {+ configureDriver({ DRIVER: "better-sqlite3", URL: databasePath });+ await expect(readSettingsAsync()).resolves.toEqual({ locale: "de", onboardingStep: "finish" });++ const malformedDatabase = new Database(databasePath);+ malformedDatabase.prepare('UPDATE "serverSetting" SET value = ? WHERE setting_key = ?').run("{", "culture");+ malformedDatabase.close();+ vi.resetModules();+ await expect(readSettingsAsync()).resolves.toEqual({ locale: "en", onboardingStep: "finish" });+ } finally {+ await fs.rm(databasePath, { force: true });+ }+ });++ test("reads MySQL settings through the bounded host configuration", async () => {+ const container = await new MySqlContainer("mysql:latest").start();+ try {+ const connection = await mysql.createConnection({+ host: container.getHost(),+ port: container.getPort(),+ database: container.getDatabase(),+ user: container.getUsername(),+ password: container.getUserPassword(),+ });+ await connection.execute("CREATE TABLE onboarding (step VARCHAR(32) NOT NULL)");+ await connection.execute("CREATE TABLE serverSetting (setting_key VARCHAR(64) NOT NULL, value TEXT NOT NULL)");+ await connection.execute("INSERT INTO onboarding (step) VALUES (?)", ["finish"]);+ await connection.execute("INSERT INTO serverSetting (setting_key, value) VALUES (?, ?)", [+ "culture",+ stringify({ defaultLocale: "fr" }),+ ]);+ await connection.end();++ configureDriver({+ DRIVER: "mysql2",+ HOST: container.getHost(),+ PORT: container.getPort(),+ NAME: container.getDatabase(),+ USER: container.getUsername(),+ PASSWORD: container.getUserPassword(),+ });+ await expect(readSettingsAsync()).resolves.toEqual({ locale: "fr", onboardingStep: "finish" });+ } finally {+ await container.stop();+ }+ }, 120_000);++ test("reads PostgreSQL settings through the bounded host configuration", async () => {+ const container = await new PostgreSqlContainer("postgres:latest").start();+ try {+ const connection = new Client({+ host: container.getHost(),+ port: container.getPort(),+ database: container.getDatabase(),+ user: container.getUsername(),+ password: container.getPassword(),+ });+ await connection.connect();+ await connection.query("CREATE TABLE onboarding (step TEXT NOT NULL)");+ await connection.query('CREATE TABLE "serverSetting" (setting_key TEXT NOT NULL, value TEXT NOT NULL)');+ await connection.query("INSERT INTO onboarding (step) VALUES ($1)", ["finish"]);+ await connection.query('INSERT INTO "serverSetting" (setting_key, value) VALUES ($1, $2)', [+ "culture",+ stringify({ defaultLocale: "es" }),+ ]);+ await connection.end();++ configureDriver({+ DRIVER: "node-postgres",+ HOST: container.getHost(),+ PORT: container.getPort(),+ NAME: container.getDatabase(),+ USER: container.getUsername(),+ PASSWORD: container.getPassword(),+ });+ await expect(readSettingsAsync()).resolves.toEqual({ locale: "es", onboardingStep: "finish" });+ } finally {+ await container.stop();+ }+ }, 120_000);+});diff --git a/packages/db/proxy-reader.spec.ts b/packages/db/proxy-reader.spec.tsnew file mode 100644index 000000000..f46c79cef--- /dev/null+++ b/packages/db/proxy-reader.spec.ts@@ -0,0 +1,128 @@+import { beforeEach, describe, expect, it, vi } from "vitest";++const mocks = vi.hoisted(() => {+ const query = {+ where: vi.fn(),+ limit: vi.fn().mockResolvedValue([{ step: "finish" }]),+ };+ query.where.mockReturnValue(query);++ return {+ dbEnv: {+ DRIVER: "mysql2",+ URL: "mysql://homarr:test@localhost:3306/homarr",+ } as Record<string, unknown>,+ mysqlCreatePool: vi.fn(() => ({})),+ postgresPool: vi.fn(function PostgresPool() {+ return {};+ }),+ database: {+ select: vi.fn(() => ({ from: vi.fn(() => query) })),+ },+ };+});++vi.mock("@homarr/core/infrastructure/db/env", () => ({ dbEnv: mocks.dbEnv }));+vi.mock("mysql2", () => ({ default: { createPool: mocks.mysqlCreatePool } }));+vi.mock("pg", () => ({ Pool: mocks.postgresPool }));+vi.mock("drizzle-orm/mysql2", () => ({ drizzle: vi.fn(() => mocks.database) }));+vi.mock("drizzle-orm/node-postgres", () => ({ drizzle: vi.fn(() => mocks.database) }));+vi.mock("./proxy/mysql", () => ({+ proxySchema: { onboarding: { step: {} }, serverSettings: { settingKey: {}, value: {} } },+}));+vi.mock("./proxy/postgresql", () => ({+ proxySchema: { onboarding: { step: {} }, serverSettings: { settingKey: {}, value: {} } },+}));++const initializeProxyReader = async () => {+ const { getOnboardingStepForProxyAsync } = await import("./proxy-reader");+ await getOnboardingStepForProxyAsync();+};++describe("proxy database pools", () => {+ beforeEach(() => {+ vi.resetModules();+ vi.clearAllMocks();+ for (const key of Object.keys(mocks.dbEnv)) delete mocks.dbEnv[key];+ mocks.mysqlCreatePool.mockReturnValue({});+ });++ it("bounds MySQL URL pools instead of falling back to the driver defaults", async () => {+ Object.assign(mocks.dbEnv, {+ DRIVER: "mysql2",+ URL: "mysql://homarr:test@localhost:3306/homarr",+ });++ await initializeProxyReader();++ expect(mocks.mysqlCreatePool).toHaveBeenCalledWith({+ uri: "mysql://homarr:test@localhost:3306/homarr",+ connectionLimit: 1,+ maxIdle: 1,+ idleTimeout: 60_000,+ enableKeepAlive: true,+ });+ });++ it("bounds MySQL host pools instead of falling back to the driver defaults", async () => {+ Object.assign(mocks.dbEnv, {+ DRIVER: "mysql2",+ HOST: "localhost",+ PORT: 3306,+ NAME: "homarr",+ USER: "homarr",+ PASSWORD: "test",+ });++ await initializeProxyReader();++ expect(mocks.mysqlCreatePool).toHaveBeenCalledWith(expect.objectContaining({ connectionLimit: 1, maxIdle: 1 }));+ });++ it("bounds PostgreSQL URL pools instead of falling back to the driver defaults", async () => {+ Object.assign(mocks.dbEnv, {+ DRIVER: "node-postgres",+ URL: "postgresql://homarr:test@localhost:5432/homarr",+ });++ await initializeProxyReader();++ expect(mocks.postgresPool).toHaveBeenCalledWith({+ connectionString: "postgresql://homarr:test@localhost:5432/homarr",+ max: 1,+ idleTimeoutMillis: 60_000,+ allowExitOnIdle: false,+ });+ });++ it("bounds PostgreSQL host pools instead of falling back to the driver defaults", async () => {+ Object.assign(mocks.dbEnv, {+ DRIVER: "node-postgres",+ HOST: "localhost",+ PORT: 5432,+ NAME: "homarr",+ USER: "homarr",+ PASSWORD: "test",+ });++ await initializeProxyReader();++ expect(mocks.postgresPool).toHaveBeenCalledWith(expect.objectContaining({ max: 1 }));+ });++ it("retries initialization after a transient driver failure", async () => {+ Object.assign(mocks.dbEnv, {+ DRIVER: "mysql2",+ URL: "mysql://homarr:test@localhost:3306/homarr",+ });+ mocks.mysqlCreatePool.mockImplementationOnce(() => {+ throw new Error("database unavailable");+ });++ const { getOnboardingStepForProxyAsync } = await import("./proxy-reader");++ await expect(getOnboardingStepForProxyAsync()).rejects.toThrow("database unavailable");+ await expect(getOnboardingStepForProxyAsync()).resolves.toBe("finish");+ expect(mocks.mysqlCreatePool).toHaveBeenCalledTimes(2);+ });+});diff --git a/packages/db/proxy-reader.ts b/packages/db/proxy-reader.tsnew file mode 100644index 000000000..1fd85f223--- /dev/null+++ b/packages/db/proxy-reader.ts@@ -0,0 +1,173 @@+import { parse as parseSuperJson } from "superjson";++import { eq } from "drizzle-orm";+import type { SQLWrapper } from "drizzle-orm";+import { defaultServerSettings } from "@homarr/server-settings";+import { dbEnv } from "@homarr/core/infrastructure/db/env";++type ProxyRow = Record<string, unknown>;+type ProxySchema = {+ onboarding: { step: SQLWrapper };+ serverSettings: { settingKey: SQLWrapper; value: SQLWrapper };+};+type ProxyQuery = {+ where(condition: unknown): ProxyQuery;+ limit(count: number): Promise<ProxyRow[]>;+};+type ProxyDatabase = {+ select(selection: Record<string, unknown>): { from(table: unknown): ProxyQuery };+};++type ProxyReader = {+ closeAsync: () => Promise<void>;+ getOnboardingStepAsync: () => Promise<string>;+ getDefaultLocaleAsync: () => Promise<string>;+};++// The proxy is long-lived and only performs two single-row reads. Keep its+// independent pool deliberately smaller than the application pool.+const proxyPoolConnectionLimit = 1;++const createProxyReader = (database: unknown, schema: ProxySchema, closeAsync: () => Promise<void>): ProxyReader => {+ const queryDatabase = database as ProxyDatabase;++ return {+ closeAsync,+ async getOnboardingStepAsync() {+ const rows = await queryDatabase.select({ step: schema.onboarding.step }).from(schema.onboarding).limit(1);+ const step = rows[0]?.step;+ return typeof step === "string" ? step : "start";+ },+ async getDefaultLocaleAsync() {+ const rows = await queryDatabase+ .select({ value: schema.serverSettings.value })+ .from(schema.serverSettings)+ .where(eq(schema.serverSettings.settingKey, "culture"))+ .limit(1);+ const value = rows[0]?.value;+ if (typeof value !== "string") return defaultServerSettings.culture.defaultLocale;++ try {+ const culture: unknown = parseSuperJson(value);+ if (+ typeof culture === "object" &&+ culture !== null &&+ "defaultLocale" in culture &&+ typeof culture.defaultLocale === "string"+ ) {+ return culture.defaultLocale;+ }+ } catch {+ // Fall through to the default when a legacy or malformed value cannot be decoded.+ }++ return defaultServerSettings.culture.defaultLocale;+ },+ };+};++const createProxyReaderAsync = async (): Promise<ProxyReader> => {+ switch (dbEnv.DRIVER) {+ case "better-sqlite3": {+ const [{ default: Database }, { drizzle }, { proxySchema }] = await Promise.all([+ import("better-sqlite3"),+ import("drizzle-orm/better-sqlite3"),+ import("./proxy/sqlite"),+ ]);+ const connection = new Database(dbEnv.URL);+ const database = drizzle(connection, { schema: proxySchema });+ return createProxyReader(database, proxySchema, async () => {+ connection.close();+ });+ }+ case "mysql2": {+ const [{ default: mysql }, { drizzle }, { proxySchema }] = await Promise.all([+ import("mysql2"),+ import("drizzle-orm/mysql2"),+ import("./proxy/mysql"),+ ]);+ const connection = dbEnv.HOST+ ? mysql.createPool({+ host: dbEnv.HOST,+ port: dbEnv.PORT,+ database: dbEnv.NAME,+ user: dbEnv.USER,+ password: dbEnv.PASSWORD,+ connectionLimit: proxyPoolConnectionLimit,+ maxIdle: 1,+ idleTimeout: 60_000,+ enableKeepAlive: true,+ })+ : mysql.createPool({+ uri: dbEnv.URL,+ connectionLimit: proxyPoolConnectionLimit,+ maxIdle: 1,+ idleTimeout: 60_000,+ enableKeepAlive: true,+ });+ const database = drizzle(connection, { schema: proxySchema, mode: "default" });+ return createProxyReader(+ database,+ proxySchema,+ async () =>+ await new Promise<void>((resolve, reject) => {+ connection.end((error) => {+ if (error) reject(error);+ else resolve();+ });+ }),+ );+ }+ case "node-postgres": {+ const [{ Pool }, { drizzle }, { proxySchema }] = await Promise.all([+ import("pg"),+ import("drizzle-orm/node-postgres"),+ import("./proxy/postgresql"),+ ]);+ const connection = dbEnv.HOST+ ? new Pool({+ host: dbEnv.HOST,+ port: dbEnv.PORT,+ database: dbEnv.NAME,+ user: dbEnv.USER,+ password: dbEnv.PASSWORD,+ max: proxyPoolConnectionLimit,+ idleTimeoutMillis: 60_000,+ allowExitOnIdle: false,+ })+ : new Pool({+ connectionString: dbEnv.URL,+ max: proxyPoolConnectionLimit,+ idleTimeoutMillis: 60_000,+ allowExitOnIdle: false,+ });+ const database = drizzle({ client: connection, schema: proxySchema });+ return createProxyReader(database, proxySchema, async () => {+ await connection.end();+ });+ }+ }+};++let proxyReaderPromise: Promise<ProxyReader> | null = null;++const getProxyReaderAsync = () => {+ if (!proxyReaderPromise) {+ proxyReaderPromise = createProxyReaderAsync().catch((error: unknown) => {+ proxyReaderPromise = null;+ throw error;+ });+ }+ return proxyReaderPromise;+};++export const getOnboardingStepForProxyAsync = async () => (await getProxyReaderAsync()).getOnboardingStepAsync();++export const getDefaultLocaleForProxyAsync = async () => (await getProxyReaderAsync()).getDefaultLocaleAsync();++export const closeProxySettingsReaderAsync = async () => {+ if (!proxyReaderPromise) return;+ const reader = await proxyReaderPromise;+ proxyReaderPromise = null;+ await reader.closeAsync();+};diff --git a/packages/db/proxy/mysql.ts b/packages/db/proxy/mysql.tsnew file mode 100644index 000000000..266cc4610--- /dev/null+++ b/packages/db/proxy/mysql.ts@@ -0,0 +1,11 @@+import { mysqlTable, text, varchar } from "drizzle-orm/mysql-core";++export const proxySchema = {+ onboarding: mysqlTable("onboarding", {+ step: varchar("step", { length: 32 }).notNull(),+ }),+ serverSettings: mysqlTable("serverSetting", {+ settingKey: varchar("setting_key", { length: 64 }).notNull(),+ value: text("value").notNull(),+ }),+};diff --git a/packages/db/proxy/postgresql.ts b/packages/db/proxy/postgresql.tsnew file mode 100644index 000000000..832f0f559--- /dev/null+++ b/packages/db/proxy/postgresql.ts@@ -0,0 +1,11 @@+import { pgTable, text } from "drizzle-orm/pg-core";++export const proxySchema = {+ onboarding: pgTable("onboarding", {+ step: text("step").notNull(),+ }),+ serverSettings: pgTable("serverSetting", {+ settingKey: text("setting_key").notNull(),+ value: text("value").notNull(),+ }),+};diff --git a/packages/db/proxy/sqlite.ts b/packages/db/proxy/sqlite.tsnew file mode 100644index 000000000..c95491d7f--- /dev/null+++ b/packages/db/proxy/sqlite.ts@@ -0,0 +1,11 @@+import { sqliteTable, text } from "drizzle-orm/sqlite-core";++export const proxySchema = {+ onboarding: sqliteTable("onboarding", {+ step: text("step").notNull(),+ }),+ serverSettings: sqliteTable("serverSetting", {+ settingKey: text("setting_key").notNull(),+ value: text("value").notNull(),+ }),+};diff --git a/packages/db/test/schema.spec.ts b/packages/db/test/schema.spec.tsindex 246219547..61245cca8 100644--- a/packages/db/test/schema.spec.ts+++ b/packages/db/test/schema.spec.ts@@ -63,6 +63,7 @@ test("schemas should match", () => {if (!("uniqueName" in sqliteColumn)) return;if (!("primary" in sqliteColumn)) return;+ // oxlint-disable-next-line import/namespace -- this test intentionally compares matching dynamic schema keys.const mysqlTable = mysqlSchema[tableName];const mysqlColumn = mysqlTable[columnName as keyof typeof mysqlTable] as object;@@ -84,6 +85,7 @@ test("schemas should match", () => {).toEqual(mysqlColumn.primary);});+ // oxlint-disable-next-line import/namespace -- this test intentionally compares matching dynamic schema keys.const mysqlTable = mysqlSchema[tableName];const sqliteForeignKeys = sqliteTable[Symbol.for("drizzle:SQLiteInlineForeignKeys") as keyof typeof sqliteTable] as| SqliteForeignKey[]@@ -144,6 +146,7 @@ test("schemas should match for postgresql", () => {objectEntries(sqliteSchema).forEach(([tableName, sqliteTable]) => {// keys of sqliteSchema and postgresqlSchema are the same, so we can safely use tableName as key// skipcq: JS-E1007+ // oxlint-disable-next-line import/namespace -- this test intentionally compares matching dynamic schema keys.const postgresqlTable = postgresqlSchema[tableName];Object.entries(sqliteTable).forEach(([columnName, sqliteColumn]: [string, object]) => {if (!("isUnique" in sqliteColumn)) return;diff --git a/packages/db/tsconfig.json b/packages/db/tsconfig.jsonindex 35b272c7e..8fba65692 100644--- a/packages/db/tsconfig.json+++ b/packages/db/tsconfig.json@@ -4,5 +4,5 @@"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"},"include": ["."],- "exclude": ["node_modules"]+ "exclude": ["node_modules", "migrations/*/migrate.cjs"]}diff --git a/packages/definitions/package.json b/packages/definitions/package.jsonindex 9059e3c92..dff0deb5e 100644--- a/packages/definitions/package.json+++ b/packages/definitions/package.json@@ -13,6 +13,7 @@},"exports": {".": "./index.ts",+ "./cookie": "./src/cookie.ts","./docs/*": "./src/docs/*.ts"},"scripts": {diff --git a/packages/definitions/src/widget-integration-map.ts b/packages/definitions/src/widget-integration-map.tsindex 1844fb662..6a6fb32c6 100644--- a/packages/definitions/src/widget-integration-map.ts+++ b/packages/definitions/src/widget-integration-map.ts@@ -27,7 +27,7 @@ export const widgetIntegrationSupport: Partial<Record<WidgetKind, readonly InteghealthMonitoring: getIntegrationKindsByCategory("healthMonitoring").filter((kind) => kind !== "patchmon"),firewall: getIntegrationKindsByCategory("firewall"),notifications: getIntegrationKindsByCategory("notifications"),- mediaReleases: ["emby", "jellyfin", "plex"],+ mediaReleases: ["mock", "emby", "jellyfin", "plex"],systemResources: ["dashDot", "openmediavault", "truenas", "unraid", "glances", "synology"],systemDisks: ["dashDot", "openmediavault", "truenas", "unraid", "synology"],coolify: ["coolify"],@@ -40,7 +40,13 @@ export const widgetIntegrationSupport: Partial<Record<WidgetKind, readonly IntegspeedtestTracker: ["speedtestTracker"],uptimeKuma: ["uptimeKuma"],audioStats: ["navidrome", "audiobookshelf"],+ umami: ["umami"],vpn: getIntegrationKindsByCategory("vpn"),+ ups: getIntegrationKindsByCategory("ups"),+ beszelSystemTable: ["beszel", "mock"],+ beszelSystemGrid: ["beszel", "mock"],+ beszelAlerts: ["beszel", "mock"],+ beszelSystemStats: ["beszel", "mock"],archiveTeamWarrior: ["archiveTeamWarrior"],anchorNote: ["anchor"],traefik: ["traefik"],diff --git a/packages/redis/src/index.ts b/packages/redis/src/index.tsindex 02258a2e0..24f6046d5 100644--- a/packages/redis/src/index.ts+++ b/packages/redis/src/index.ts@@ -6,9 +6,7 @@ export {handshakeAsync,createSubPubChannel,createGetSetChannel,- setQueryCacheAsync,- getQueryCacheAsync,- removeQueryCacheAsync,+ createLockChannel,invalidateIntegrationCacheAsync,} from "./lib/channel";diff --git a/packages/redis/src/lib/channel.spec.ts b/packages/redis/src/lib/channel.spec.tsnew file mode 100644index 000000000..0ec39a2a5--- /dev/null+++ b/packages/redis/src/lib/channel.spec.ts@@ -0,0 +1,21 @@+// @vitest-environment node++import { describe, expect, test, vi } from "vitest";++vi.mock("./connection", () => ({+ createRedisConnection: () => null,+}));++import { createLockChannel } from "./channel";++describe("createLockChannel", () => {+ test("degrades gracefully when Redis connections are disabled", async () => {+ const lock = createLockChannel("test-lock");++ const token = await lock.acquireAsync(60);++ expect(token).toEqual(expect.any(String));+ if (!token) throw new Error("Expected the fallback lock to return a token");+ await expect(lock.releaseAsync(token)).resolves.toBeUndefined();+ });+});diff --git a/packages/redis/src/lib/channel.ts b/packages/redis/src/lib/channel.tsindex 1b1e582c1..4731ccfa1 100644--- a/packages/redis/src/lib/channel.ts+++ b/packages/redis/src/lib/channel.ts@@ -1,13 +1,10 @@import superjson from "superjson";import { createId } from "@homarr/common";-import { createLogger } from "@homarr/core/infrastructure/logs";import { ChannelSubscriptionTracker } from "./channel-subscription-tracker";import { createRedisConnection } from "./connection";-const logger = createLogger({ module: "redisChannel" });-const publisher = createRedisConnection();const lastDataClient = createRedisConnection();@@ -114,10 +111,11 @@ export const createGetSetChannel = <TData>(name: string) => {* @param options optional TTL in seconds*/setAsync: async (data: TData, options?: { ttlSeconds?: number }) => {- await getSetClient.set(name, superjson.stringify(data));if (options?.ttlSeconds) {- await getSetClient.expire(name, options.ttlSeconds);+ await getSetClient.set(name, superjson.stringify(data), "EX", options.ttlSeconds);+ return;}+ await getSetClient.set(name, superjson.stringify(data));},/*** Remove data from the channel@@ -128,32 +126,34 @@ export const createGetSetChannel = <TData>(name: string) => {};};-const queryCacheKey = (userId: string, boardId: string) => `qc:${userId}:${boardId}`;--export const setQueryCacheAsync = async (- userId: string,- boardId: string,- value: string,- ttlMs: number,- maxValueBytes: number,-) => {- if (Buffer.byteLength(value, "utf8") > maxValueBytes) {- logger.warn("Query cache value exceeded maximum size", {- key: queryCacheKey(userId, boardId),- valueBytes: Buffer.byteLength(value, "utf8"),- maxValueBytes,- });- return false;- }- await getSetClient.set(queryCacheKey(userId, boardId), value, "PX", ttlMs);- return true;-};+/**+ * Creates a short-lived distributed lock.+ *+ * The token prevents a process from releasing a lock that expired and was+ * acquired by another process in the meantime.+ */+export const createLockChannel = (name: string) => {+ return {+ acquireAsync: async (ttlSeconds: number) => {+ const token = createId();+ const client = getSetClient as typeof getSetClient | null;+ if (!client) return token;-export const getQueryCacheAsync = async (userId: string, boardId: string) =>- await getSetClient.get(queryCacheKey(userId, boardId));+ const result = await client.set(name, token, "EX", ttlSeconds, "NX");+ return result === "OK" ? token : null;+ },+ releaseAsync: async (token: string) => {+ const client = getSetClient as typeof getSetClient | null;+ if (!client) return;-export const removeQueryCacheAsync = async (userId: string, boardId: string) => {- await getSetClient.del(queryCacheKey(userId, boardId));+ await client.eval(+ "if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('del', KEYS[1]) else return 0 end",+ 1,+ name,+ token,+ );+ },+ };};export const invalidateIntegrationCacheAsync = async (integrationId: string): Promise<void> => {diff --git a/packages/request-handler/src/lib/integration-request-handler.ts b/packages/request-handler/src/lib/integration-request-handler.tsindex cf6f49cea..e07ba3881 100644--- a/packages/request-handler/src/lib/integration-request-handler.ts+++ b/packages/request-handler/src/lib/integration-request-handler.ts@@ -14,6 +14,7 @@ interface Options<TData, TKind extends IntegrationKind, TInput extends Record<strequestAsync: (integration: IntegrationOfKind<TKind>, input: TInput) => Promise<TData>;cacheTtlMs?: number;fallbackToStaleOnError?: boolean;+ staleIfErrorTtlMs?: number;}export const createIntegrationRequestHandler = <@@ -23,24 +24,18 @@ export const createIntegrationRequestHandler = <>(options: Options<TData, TKind, TInput>,) => {- const integrationMap = new Map<string, IntegrationOfKind<TKind>>();- const inner = createRequestHandler<TData, { integrationId: string; options: TInput }>({- requestAsync: async (input) => {- const integration = integrationMap.get(input.integrationId);- if (!integration) {- throw new Error(`Integration ${input.integrationId} not found in cache`);- }- return options.requestAsync(integration, input.options);- },+ const inner = createRequestHandler<TData, { integration: IntegrationOfKind<TKind>; options: TInput }>({+ requestAsync: async ({ integration, options: itemOptions }) => options.requestAsync(integration, itemOptions),+ getCacheKey: ({ integration, options: itemOptions }) =>+ JSON.stringify({ integrationId: integration.id, itemOptions }),cacheTtlMs: options.cacheTtlMs,fallbackToStaleOnError: options.fallbackToStaleOnError,+ staleIfErrorTtlMs: options.staleIfErrorTtlMs,});return {invalidateCache: inner.invalidateCache,- handler: (integration: IntegrationOfKind<TKind>, itemOptions: TInput) => {- integrationMap.set(integration.id, integration);- return inner.handler({ integrationId: integration.id, options: itemOptions });- },+ handler: (integration: IntegrationOfKind<TKind>, itemOptions: TInput) =>+ inner.handler({ integration, options: itemOptions }),};};diff --git a/packages/request-handler/src/lib/request-handler.spec.ts b/packages/request-handler/src/lib/request-handler.spec.tsnew file mode 100644index 000000000..85ee34339--- /dev/null+++ b/packages/request-handler/src/lib/request-handler.spec.ts@@ -0,0 +1,224 @@+import { afterEach, describe, expect, it, vi } from "vitest";++import type { Integration, IntegrationSecret } from "@homarr/db/schema";++import { createIntegrationRequestHandler } from "./integration-request-handler";+import { createRequestHandler } from "./request-handler";+import { createWidgetRequestHandler } from "./widget-request-handler";++const deferred = <T>() => {+ let resolve!: (value: T) => void;+ let reject!: (reason?: unknown) => void;+ const promise = new Promise<T>((resolvePromise, rejectPromise) => {+ resolve = resolvePromise;+ reject = rejectPromise;+ });+ return { promise, resolve, reject };+};++const createIntegration = (secret: string) =>+ ({+ id: "integration-id",+ kind: "sonarr",+ decryptedSecrets: [{ kind: "apiKey", value: secret }],+ }) as Omit<Integration, "kind"> & {+ kind: "sonarr";+ decryptedSecrets: Pick<IntegrationSecret, "kind" | "value">[];+ externalUrl: string | null;+ };++afterEach(() => {+ vi.useRealTimers();+});++describe("createRequestHandler", () => {+ it("deduplicates in-flight work and caches completed data", async () => {+ let calls = 0;+ const request = deferred<string>();+ const handler = createRequestHandler({+ requestAsync: async () => {+ calls += 1;+ return await request.promise;+ },+ });++ const first = handler.handler({ id: "same" }).getDataAsync();+ const second = handler.handler({ id: "same" }).getDataAsync();+ expect(calls).toBe(1);++ request.resolve("value");+ await expect(Promise.all([first, second])).resolves.toMatchObject([{ data: "value" }, { data: "value" }]);+ await expect(handler.handler({ id: "same" }).getDataAsync()).resolves.toMatchObject({ data: "value" });+ expect(calls).toBe(1);+ });++ it("keeps in-flight deduplication but retains no payload when ttl is zero", async () => {+ let calls = 0;+ const request = deferred<{ call: number }>();+ const handler = createRequestHandler({+ cacheTtlMs: 0,+ requestAsync: async () => {+ calls += 1;+ if (calls === 1) return await request.promise;+ return { call: calls };+ },+ });++ const first = handler.handler({ id: "same" }).getDataAsync();+ const second = handler.handler({ id: "same" }).getDataAsync();+ expect(calls).toBe(1);++ request.resolve({ call: 1 });+ await expect(Promise.all([first, second])).resolves.toMatchObject([{ data: { call: 1 } }, { data: { call: 1 } }]);+ await expect(handler.handler({ id: "same" }).getDataAsync()).resolves.toMatchObject({ data: { call: 2 } });+ expect(calls).toBe(2);+ });++ it("releases positive-ttl entries after expiry without another request", async () => {+ vi.useFakeTimers();+ let calls = 0;+ const handler = createRequestHandler({+ cacheTtlMs: 25,+ requestAsync: async () => ({ call: ++calls }),+ });++ await expect(handler.handler({ id: "same" }).getDataAsync()).resolves.toMatchObject({ data: { call: 1 } });+ await vi.advanceTimersByTimeAsync(25);+ await expect(handler.handler({ id: "same" }).getDataAsync()).resolves.toMatchObject({ data: { call: 2 } });++ expect(calls).toBe(2);+ });++ it("cancels scheduled expiry work when the cache is invalidated", async () => {+ vi.useFakeTimers();+ const handler = createRequestHandler({ cacheTtlMs: 25, requestAsync: async () => "value" });+ await handler.handler({ id: "same" }).getDataAsync();++ expect(vi.getTimerCount()).toBe(1);+ handler.invalidateCache();+ expect(vi.getTimerCount()).toBe(0);+ });++ it("bounds stale-on-error fallback and releases it while idle", async () => {+ vi.useFakeTimers();+ let calls = 0;+ const handler = createRequestHandler({+ cacheTtlMs: 25,+ fallbackToStaleOnError: true,+ staleIfErrorTtlMs: 50,+ requestAsync: async () => {+ calls += 1;+ if (calls === 1) return "last-known-good";+ throw new Error("upstream unavailable");+ },+ });++ await expect(handler.handler({ id: "same" }).getDataAsync()).resolves.toMatchObject({+ data: "last-known-good",+ });+ await vi.advanceTimersByTimeAsync(25);+ await expect(handler.handler({ id: "same" }).getDataAsync()).resolves.toMatchObject({+ data: "last-known-good",+ });++ await vi.advanceTimersByTimeAsync(51);+ await expect(handler.handler({ id: "same" }).getDataAsync()).rejects.toThrow("upstream unavailable");+ expect(calls).toBe(3);+ });++ it("reschedules staggered stale entries by their retirement deadline without spinning", async () => {+ vi.useFakeTimers();+ const handler = createRequestHandler({+ cacheTtlMs: 10,+ fallbackToStaleOnError: true,+ staleIfErrorTtlMs: 100,+ requestAsync: async ({ id }: { id: string }) => id,+ });++ await handler.handler({ id: "first" }).getDataAsync();+ await vi.advanceTimersByTimeAsync(20);+ await handler.handler({ id: "second" }).getDataAsync();+ expect(vi.getTimerCount()).toBe(1);++ await vi.advanceTimersByTimeAsync(90);+ expect(vi.getTimerCount()).toBe(1);+ await vi.advanceTimersByTimeAsync(20);+ expect(vi.getTimerCount()).toBe(0);+ });++ it("evicts an empty-string cache key at the size limit", async () => {+ let calls = 0;+ const handler = createRequestHandler({+ cacheTtlMs: 60_000,+ getCacheKey: ({ id }: { id: string }) => id,+ requestAsync: async () => ++calls,+ });++ await handler.handler({ id: "" }).getDataAsync();+ for (let index = 0; index < 1000; index += 1) {+ await handler.handler({ id: String(index) }).getDataAsync();+ }+ await handler.handler({ id: "" }).getDataAsync();++ expect(calls).toBe(1002);+ });++ it("does not let a pre-invalidation request repopulate or clear newer work", async () => {+ const staleRequest = deferred<string>();+ const freshRequest = deferred<string>();+ const requests = [staleRequest, freshRequest];+ let calls = 0;+ const handler = createRequestHandler({+ requestAsync: async () => {+ const request = requests[calls++];+ if (!request) throw new Error("Unexpected request");+ return await request.promise;+ },+ });++ const stale = handler.handler({ id: "same" }).getDataAsync();+ handler.invalidateCache();+ const fresh = handler.handler({ id: "same" }).getDataAsync();++ staleRequest.resolve("stale");+ await expect(stale).resolves.toMatchObject({ data: "stale" });+ const joinsFresh = handler.handler({ id: "same" }).getDataAsync();+ expect(calls).toBe(2);++ freshRequest.resolve("fresh");+ await expect(Promise.all([fresh, joinsFresh])).resolves.toMatchObject([{ data: "fresh" }, { data: "fresh" }]);+ await expect(handler.handler({ id: "same" }).getDataAsync()).resolves.toMatchObject({ data: "fresh" });+ expect(calls).toBe(2);+ });+});++describe("createIntegrationRequestHandler", () => {+ it("keys requests by integration id and options without retaining secret values", async () => {+ let calls = 0;+ const request = deferred<string>();+ const handler = createIntegrationRequestHandler<string, "sonarr", { page: number }>({+ requestAsync: async () => {+ calls += 1;+ return await request.promise;+ },+ });+ const first = handler.handler(createIntegration("first-secret"), { page: 1 }).getDataAsync();+ const second = handler.handler(createIntegration("rotated-secret"), { page: 1 }).getDataAsync();+ expect(calls).toBe(1);++ request.resolve("value");+ await expect(Promise.all([first, second])).resolves.toMatchObject([{ data: "value" }, { data: "value" }]);+ });+});++describe("createWidgetRequestHandler", () => {+ it("shares its cache across calls while keeping distinct inputs separate", async () => {+ let calls = 0;+ const handler = createWidgetRequestHandler({ requestAsync: async ({ id }: { id: string }) => `${id}-${++calls}` });++ await expect(handler.handler({ id: "one" }).getDataAsync()).resolves.toMatchObject({ data: "one-1" });+ await expect(handler.handler({ id: "one" }).getDataAsync()).resolves.toMatchObject({ data: "one-1" });+ await expect(handler.handler({ id: "two" }).getDataAsync()).resolves.toMatchObject({ data: "two-2" });+ expect(calls).toBe(2);+ });+});diff --git a/packages/request-handler/src/lib/request-handler.ts b/packages/request-handler/src/lib/request-handler.tsindex 4dbdb5b11..a447c377b 100644--- a/packages/request-handler/src/lib/request-handler.ts+++ b/packages/request-handler/src/lib/request-handler.ts@@ -1,18 +1,21 @@interface Options<TData, TInput extends Record<string, unknown>> {requestAsync: (input: TInput) => Promise<TData>;+ getCacheKey?: (input: TInput) => string;cacheTtlMs?: number;fallbackToStaleOnError?: boolean;+ staleIfErrorTtlMs?: number;}-type CacheEntry<TData> = { data: TData; timestamp: Date; expiresAt: number };+type CacheEntry<TData> = { data: TData; timestamp: Date; expiresAt: number; staleUntil: number };const MAX_CACHE_SIZE = 1000;const DEFAULT_TTL_MS = 10_000;+const DEFAULT_STALE_IF_ERROR_TTL_MS = 5 * 60_000;const evictExpired = <TData>(cache: Map<string, CacheEntry<TData>>) => {const now = Date.now();for (const [key, entry] of cache) {- if (now >= entry.expiresAt) cache.delete(key);+ if (now >= entry.staleUntil) cache.delete(key);}};@@ -21,44 +24,98 @@ export const createRequestHandler = <TData, TInput extends Record<string, unknow) => {const cache = new Map<string, CacheEntry<TData>>();const inflight = new Map<string, Promise<CacheEntry<TData>>>();+ let expiryTimer: ReturnType<typeof setTimeout> | undefined;+ let expiryTimerAt: number | undefined;+ let generation = 0;++ const scheduleExpiry = (candidateExpiryAt?: number) => {+ if (candidateExpiryAt !== undefined && expiryTimerAt !== undefined && expiryTimerAt <= candidateExpiryAt) return;+ if (expiryTimer) clearTimeout(expiryTimer);+ expiryTimer = undefined;+ expiryTimerAt = undefined;+ if (cache.size === 0) return;++ const nextExpiryAt = candidateExpiryAt ?? Math.min(...[...cache.values()].map(({ staleUntil }) => staleUntil));+ expiryTimerAt = nextExpiryAt;+ expiryTimer = setTimeout(+ () => {+ expiryTimer = undefined;+ expiryTimerAt = undefined;+ evictExpired(cache);+ scheduleExpiry();+ },+ Math.max(0, nextExpiryAt - Date.now()),+ );+ expiryTimer.unref?.();+ };return {invalidateCache: () => {+ generation += 1;cache.clear();inflight.clear();+ if (expiryTimer) clearTimeout(expiryTimer);+ expiryTimer = undefined;+ expiryTimerAt = undefined;},handler: (input: TInput) => ({async getDataAsync(): Promise<{ data: TData; timestamp: Date }> {const ttl = options.cacheTtlMs ?? DEFAULT_TTL_MS;- const key = JSON.stringify(input);+ const key = options.getCacheKey?.(input) ?? JSON.stringify(input);- const cached = cache.get(key);- if (cached && Date.now() < cached.expiresAt) {+ let cached = cache.get(key);+ const now = Date.now();+ if (cached && now < cached.expiresAt) {return { data: cached.data, timestamp: cached.timestamp };}+ if (cached && now >= cached.staleUntil) {+ cache.delete(key);+ scheduleExpiry();+ cached = undefined;+ }const existing = inflight.get(key);if (existing) return existing;- const promise = options+ const requestGeneration = generation;+ let promise: Promise<CacheEntry<TData>>;+ promise = options.requestAsync(input).then((data) => {- if (cache.size >= MAX_CACHE_SIZE) evictExpired(cache);- if (cache.size >= MAX_CACHE_SIZE) {- const oldest = cache.keys().next().value;- if (oldest) cache.delete(oldest);+ const expiresAt = Date.now() + ttl;+ const staleIfErrorTtlMs = options.fallbackToStaleOnError+ ? Math.max(0, options.staleIfErrorTtlMs ?? DEFAULT_STALE_IF_ERROR_TTL_MS)+ : 0;+ const entry: CacheEntry<TData> = {+ data,+ timestamp: new Date(),+ expiresAt,+ staleUntil: expiresAt + staleIfErrorTtlMs,+ };+ if (ttl > 0 && generation === requestGeneration) {+ evictExpired(cache);+ if (cache.size >= MAX_CACHE_SIZE) {+ const oldest = cache.keys().next().value;+ if (oldest !== undefined) cache.delete(oldest);+ }+ cache.set(key, entry);+ scheduleExpiry(entry.staleUntil);}- const entry: CacheEntry<TData> = { data, timestamp: new Date(), expiresAt: Date.now() + ttl };- cache.set(key, entry);- inflight.delete(key);return entry;}).catch((err) => {- inflight.delete(key);- if (options.fallbackToStaleOnError && cached) {+ if (+ options.fallbackToStaleOnError &&+ cached &&+ Date.now() < cached.staleUntil &&+ generation === requestGeneration+ ) {return cached;}throw err;+ })+ .finally(() => {+ if (inflight.get(key) === promise) inflight.delete(key);});inflight.set(key, promise);diff --git a/packages/request-handler/src/lib/widget-request-handler.ts b/packages/request-handler/src/lib/widget-request-handler.tsindex 8649791af..b5273c87f 100644--- a/packages/request-handler/src/lib/widget-request-handler.ts+++ b/packages/request-handler/src/lib/widget-request-handler.ts@@ -6,9 +6,7 @@ interface Options<TData, TInput extends Record<string, unknown>> {export const createWidgetRequestHandler = <TData, TInput extends Record<string, unknown>>(options: Options<TData, TInput>,-) => ({- handler: (widgetOptions: TInput) =>- createRequestHandler<TData, TInput>({- requestAsync: options.requestAsync,- }).handler(widgetOptions),-});+) => {+ const inner = createRequestHandler<TData, TInput>({ requestAsync: options.requestAsync });+ return inner;+};diff --git a/packages/request-handler/src/test/update-checker-cache.spec.ts b/packages/request-handler/src/test/update-checker-cache.spec.tsnew file mode 100644index 000000000..b5c17e654--- /dev/null+++ b/packages/request-handler/src/test/update-checker-cache.spec.ts@@ -0,0 +1,244 @@+// @vitest-environment node++import { beforeEach, describe, expect, test, vi } from "vitest";++const mocks = vi.hoisted(() => {+ type StoredValue = {+ expiresAt: number | null;+ value: unknown;+ };++ const values = new Map<string, StoredValue>();+ const locks = new Set<string>();+ const listReleases = vi.fn();+ const redisOperation = vi.fn();++ return {+ env: { NO_EXTERNAL_CONNECTION: false },+ listReleases,+ redisOperation,+ values,+ locks,+ removeFreshResult() {+ for (const key of values.keys()) {+ if (key.startsWith("update-checker:fresh:")) values.delete(key);+ }+ },+ };+});++vi.mock("@homarr/common/env", () => ({ env: mocks.env }));++vi.mock("@homarr/core/infrastructure/http", () => ({+ fetchWithTrustedCertificatesAsync: vi.fn(),+}));++vi.mock("@homarr/core/infrastructure/logs", () => ({+ createLogger: () => ({+ debug: vi.fn(),+ error: vi.fn(),+ info: vi.fn(),+ warn: vi.fn(),+ }),+}));++vi.mock("@homarr/redis", () => ({+ createGetSetChannel: (name: string) => ({+ getAsync: async () => {+ mocks.redisOperation();+ const stored = mocks.values.get(name);+ if (!stored) return null;+ if (stored.expiresAt !== null && Date.now() >= stored.expiresAt) {+ mocks.values.delete(name);+ return null;+ }+ return stored.value;+ },+ setAsync: async (value: unknown, options?: { ttlSeconds?: number }) => {+ mocks.redisOperation();+ mocks.values.set(name, {+ value,+ expiresAt: options?.ttlSeconds ? Date.now() + options.ttlSeconds * 1_000 : null,+ });+ },+ removeAsync: async () => {+ mocks.redisOperation();+ mocks.values.delete(name);+ },+ }),+ createLockChannel: (name: string) => ({+ acquireAsync: async () => {+ mocks.redisOperation();+ if (mocks.locks.has(name)) return null;+ mocks.locks.add(name);+ return "test-lock-token";+ },+ releaseAsync: async () => {+ mocks.redisOperation();+ mocks.locks.delete(name);+ },+ }),+}));++vi.mock("octokit", () => ({+ Octokit: class {+ rest = {+ repos: {+ listReleases: mocks.listReleases,+ },+ };+ },+}));++const successfulResponse = {+ data: [+ {+ body_html: undefined,+ html_url: "https://github.com/homarr-labs/homarr/releases/tag/v99.0.0",+ name: "v99.0.0",+ prerelease: false,+ tag_name: "v99.0.0",+ },+ ],+ headers: {},+ status: 200,+ url: "",+};++const loadHandlerAsync = async () => {+ const { updateCheckerRequestHandler } = await import("../update-checker");+ return updateCheckerRequestHandler.handler({});+};++describe("persisted update checker cache", () => {+ beforeEach(() => {+ vi.resetModules();+ vi.restoreAllMocks();+ mocks.env.NO_EXTERNAL_CONNECTION = false;+ mocks.listReleases.mockReset();+ mocks.redisOperation.mockReset();+ mocks.values.clear();+ mocks.locks.clear();+ });++ test("checks GitHub once for repeated page loads inside 24 hours", async () => {+ mocks.listReleases.mockResolvedValue(successfulResponse);+ const handler = await loadHandlerAsync();++ const first = await handler.getDataAsync();+ const second = await handler.getDataAsync();++ expect(first.data).toEqual(second.data);+ expect(mocks.listReleases).toHaveBeenCalledTimes(1);+ });++ test("deduplicates concurrent checks", async () => {+ mocks.listReleases.mockImplementation(async () => {+ await Promise.resolve();+ return successfulResponse;+ });+ const handler = await loadHandlerAsync();++ const results = await Promise.all(Array.from({ length: 10 }, async () => await handler.getDataAsync()));++ expect(results.every(({ data }) => data.availableUpdates.length === 1)).toBe(true);+ expect(mocks.listReleases).toHaveBeenCalledTimes(1);+ });++ test("deduplicates concurrent checks across simulated processes", async () => {+ let completeGitHubRequest: (() => void) | undefined;+ mocks.listReleases.mockImplementation(+ async () =>+ await new Promise<typeof successfulResponse>((resolve) => {+ completeGitHubRequest = () => resolve(successfulResponse);+ }),+ );+ const firstHandler = await loadHandlerAsync();+ vi.resetModules();+ const secondHandler = await loadHandlerAsync();++ const firstRequest = firstHandler.getDataAsync();+ await vi.waitFor(() => expect(mocks.listReleases).toHaveBeenCalledOnce());+ const secondRequest = secondHandler.getDataAsync();+ completeGitHubRequest?.();++ const results = await Promise.all([firstRequest, secondRequest]);++ expect(results[0].data).toEqual(results[1].data);+ expect(mocks.listReleases).toHaveBeenCalledTimes(1);+ });++ test("refreshes at the 24-hour boundary, not before it", async () => {+ let now = 1_000;+ vi.spyOn(Date, "now").mockImplementation(() => now);+ mocks.listReleases.mockResolvedValue(successfulResponse);+ const handler = await loadHandlerAsync();+ await handler.getDataAsync();++ now += 24 * 60 * 60 * 1_000 - 1;+ await handler.getDataAsync();+ expect(mocks.listReleases).toHaveBeenCalledTimes(1);++ now += 1;+ await handler.getDataAsync();+ expect(mocks.listReleases).toHaveBeenCalledTimes(2);+ });++ test("reuses the Redis result after a simulated process restart", async () => {+ mocks.listReleases.mockResolvedValue(successfulResponse);+ const firstHandler = await loadHandlerAsync();+ await firstHandler.getDataAsync();++ vi.resetModules();+ const restartedHandler = await loadHandlerAsync();+ await restartedHandler.getDataAsync();++ expect(mocks.listReleases).toHaveBeenCalledTimes(1);+ });++ test("ignores update results created for an older application version", async () => {+ mocks.values.set("update-checker:fresh:v1", {+ value: { availableUpdates: [], attemptedAt: 1, checkedAt: 1 },+ expiresAt: null,+ });+ mocks.listReleases.mockResolvedValue(successfulResponse);++ const handler = await loadHandlerAsync();+ const result = await handler.getDataAsync();++ expect(result.data.availableUpdates).toHaveLength(1);+ expect(mocks.listReleases).toHaveBeenCalledOnce();+ });++ test("serves stale data and retries only after 24 hours following a provider failure", async () => {+ let now = 1_000;+ vi.spyOn(Date, "now").mockImplementation(() => now);+ mocks.listReleases.mockResolvedValueOnce(successfulResponse).mockRejectedValue(new Error("GitHub unavailable"));+ const handler = await loadHandlerAsync();+ const fresh = await handler.getDataAsync();+ mocks.removeFreshResult();++ const stale = await handler.getDataAsync();+ now += 24 * 60 * 60 * 1_000 - 1;+ const repeated = await handler.getDataAsync();++ expect(stale.data).toEqual(fresh.data);+ expect(repeated.data).toEqual(fresh.data);+ expect(mocks.listReleases).toHaveBeenCalledTimes(2);++ now += 1;+ const retried = await handler.getDataAsync();++ expect(retried.data).toEqual(fresh.data);+ expect(mocks.listReleases).toHaveBeenCalledTimes(3);+ });++ test("does not contact GitHub when external connections are disabled", async () => {+ mocks.env.NO_EXTERNAL_CONNECTION = true;+ const handler = await loadHandlerAsync();++ await expect(handler.getDataAsync()).resolves.toMatchObject({ data: { availableUpdates: [] } });+ expect(mocks.listReleases).not.toHaveBeenCalled();+ expect(mocks.redisOperation).not.toHaveBeenCalled();+ });+});diff --git a/packages/request-handler/src/update-checker.ts b/packages/request-handler/src/update-checker.tsindex 1cf4dbd6f..9bc2085cd 100644--- a/packages/request-handler/src/update-checker.ts+++ b/packages/request-handler/src/update-checker.ts@@ -5,19 +5,114 @@ import { env } from "@homarr/common/env";import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";import { createLogger } from "@homarr/core/infrastructure/logs";import { ErrorWithMetadata } from "@homarr/core/infrastructure/logs/error";-import { createRequestHandler } from "./lib/request-handler";+import { createGetSetChannel, createLockChannel } from "@homarr/redis";import packageJson from "../../../package.json";const logger = createLogger({ module: "updateCheckerRequestHandler" });-export const updateCheckerRequestHandler = createRequestHandler({- async requestAsync(_) {+const updateCheckTtlSeconds = 24 * 60 * 60;+const updateCheckLockTtlSeconds = 2 * 60;+const updateCheckWaitIntervalMs = 100;+const updateCheckWaitAttempts = 50;++type UpdateCheckCacheEntry = {+ availableUpdates: Update[];+ attemptedAt: number;+ checkedAt: number | null;+};++const updateCheckCacheVersion = `v2:${packageJson.version}`;+const freshUpdateCheckChannel = createGetSetChannel<UpdateCheckCacheEntry>(+ `update-checker:fresh:${updateCheckCacheVersion}`,+);+const staleUpdateCheckChannel = createGetSetChannel<UpdateCheckCacheEntry>(+ `update-checker:stale:${updateCheckCacheVersion}`,+);+const updateCheckLock = createLockChannel(`update-checker:lock:${updateCheckCacheVersion}`);++const waitAsync = async (durationMs: number) =>+ await new Promise<void>((resolve) => {+ setTimeout(resolve, durationMs);+ });++const waitForConcurrentUpdateCheckAsync = async () => {+ for (let attempt = 0; attempt < updateCheckWaitAttempts; attempt++) {+ await waitAsync(updateCheckWaitIntervalMs);+ const cached = await freshUpdateCheckChannel.getAsync();+ if (cached) return cached;+ }++ return await staleUpdateCheckChannel.getAsync();+};++const getCachedAvailableUpdatesAsync = async (): Promise<UpdateCheckCacheEntry> => {+ if (env.NO_EXTERNAL_CONNECTION) {+ return {+ availableUpdates: [],+ attemptedAt: Date.now(),+ checkedAt: null,+ };+ }++ const cached = await freshUpdateCheckChannel.getAsync();+ if (cached) return cached;++ const staleBeforeRefresh = await staleUpdateCheckChannel.getAsync();+ const lockToken = await updateCheckLock.acquireAsync(updateCheckLockTtlSeconds);+ if (!lockToken) {+ if (staleBeforeRefresh) return staleBeforeRefresh;+ const concurrentResult = await waitForConcurrentUpdateCheckAsync();+ if (concurrentResult) return concurrentResult;+ throw new Error("Timed out waiting for the update check");+ }++ try {+ const attemptedAt = Date.now();const availableUpdates = await getAvailableUpdatesAsync(packageJson.version);- return { availableUpdates };- },- cacheTtlMs: 30 * 60 * 1000,-});+ const result: UpdateCheckCacheEntry = {+ availableUpdates,+ attemptedAt,+ checkedAt: attemptedAt,+ };+ await staleUpdateCheckChannel.setAsync(result);+ await freshUpdateCheckChannel.setAsync(result, { ttlSeconds: updateCheckTtlSeconds });+ return result;+ } catch (error) {+ const stale = await staleUpdateCheckChannel.getAsync();+ const result: UpdateCheckCacheEntry = {+ availableUpdates: stale?.availableUpdates ?? [],+ attemptedAt: Date.now(),+ checkedAt: stale?.checkedAt ?? null,+ };+ await freshUpdateCheckChannel.setAsync(result, { ttlSeconds: updateCheckTtlSeconds });+ logger.warn("Failed to fetch available updates; suppressing retries for 24 hours", {+ error: error instanceof Error ? error.message : String(error),+ servingStale: stale !== null,+ });+ return result;+ } finally {+ try {+ await updateCheckLock.releaseAsync(lockToken);+ } catch (error) {+ logger.warn("Failed to release the update-check lock", {+ error: error instanceof Error ? error.message : String(error),+ });+ }+ }+};++export const updateCheckerRequestHandler = {+ handler: (_input: Record<string, never>) => ({+ getDataAsync: async () => {+ const result = await getCachedAvailableUpdatesAsync();+ return {+ data: { availableUpdates: result.availableUpdates },+ timestamp: new Date(result.checkedAt ?? result.attemptedAt),+ };+ },+ }),+};interface Update {name: string | null;diff --git a/packages/spotlight/package.json b/packages/spotlight/package.jsonindex b9c16aef8..7781ba78a 100644--- a/packages/spotlight/package.json+++ b/packages/spotlight/package.json@@ -13,6 +13,8 @@},"exports": {".": "./index.ts",+ "./component": "./src/component.ts",+ "./open": "./src/open.ts","./styles.css": "./src/styles.css"},"scripts": {diff --git a/packages/spotlight/src/component.ts b/packages/spotlight/src/component.tsnew file mode 100644index 000000000..2f9b5eeef--- /dev/null+++ b/packages/spotlight/src/component.ts@@ -0,0 +1,3 @@+"use client";++export { Spotlight } from "./components/spotlight";diff --git a/packages/spotlight/src/components/spotlight.tsx b/packages/spotlight/src/components/spotlight.tsxindex 89b1b0d63..3e285da9a 100644--- a/packages/spotlight/src/components/spotlight.tsx+++ b/packages/spotlight/src/components/spotlight.tsx@@ -11,18 +11,18 @@ import { hotkeys } from "@homarr/definitions";import type { TranslationObject } from "@homarr/translation";import { useI18n } from "@homarr/translation/client";-import type { OpenMediaRequestSearchOptions } from "../index";+import {+ consumePendingMediaRequestSearch,+ consumePendingSpotlightOpen,+ mediaRequestSearchEvent,+ spotlightOpenEvent,+} from "../open";+import type { OpenMediaRequestSearchOptions } from "../open";import type { inferSearchInteractionOptions } from "../lib/interaction";import type { SearchMode } from "../lib/mode";import { searchModes } from "../modes";import { useHomeEmptyGroupsWithPreferences } from "../modes/help/home-empty-groups";-import {- mediaRequestSearchEvent,- mediaRequestSearchScopeAtom,- selectAction,- spotlightActions,- spotlightStore,-} from "../spotlight-store";+import { mediaRequestSearchScopeAtom, selectAction, spotlightActions, spotlightStore } from "../spotlight-store";import { SpotlightChildrenActions } from "./actions/children-actions";import { SpotlightActionGroups } from "./actions/groups/action-group";@@ -64,6 +64,17 @@ const SpotlightWithActiveMode = ({ modeState, queryState, activeMode }: Spotlighconst homeEmptyGroups = useHomeEmptyGroupsWithPreferences();const hasModeCharacter = activeMode.modeKey !== defaultMode && activeMode.character !== undefined;+ useEffect(() => {+ const handleOpen = () => {+ consumePendingSpotlightOpen();+ spotlightActions.open();+ };++ window.addEventListener(spotlightOpenEvent, handleOpen);+ if (consumePendingSpotlightOpen()) spotlightActions.open();+ return () => window.removeEventListener(spotlightOpenEvent, handleOpen);+ }, []);+const clearChildrenStack = useCallback(() => {setChildrenStack([]);}, []);@@ -84,17 +95,24 @@ const SpotlightWithActiveMode = ({ modeState, queryState, activeMode }: Spotligh}, [setQuery]);useEffect(() => {- const handleMediaRequestSearch = (event: Event) => {- const { integrationIds, query } = (event as CustomEvent<OpenMediaRequestSearchOptions>).detail ?? {};+ const applyMediaRequestSearch = ({ integrationIds, query: searchQuery }: OpenMediaRequestSearchOptions) => {setMediaRequestSearchScope({ integrationIds });setMode("media");clearChildrenStack();- setQuery(query ?? "");+ setQuery(searchQuery ?? "");spotlightActions.open();setTimeout(() => selectAction(0, spotlightStore));};+ const handleMediaRequestSearch = (event: Event) => {+ consumePendingMediaRequestSearch();+ const { integrationIds, query: searchQuery } = (event as CustomEvent<OpenMediaRequestSearchOptions>).detail ?? {};+ applyMediaRequestSearch({ integrationIds, query: searchQuery });+ };+window.addEventListener(mediaRequestSearchEvent, handleMediaRequestSearch);+ const pendingSearch = consumePendingMediaRequestSearch();+ if (pendingSearch) applyMediaRequestSearch(pendingSearch);return () => {window.removeEventListener(mediaRequestSearchEvent, handleMediaRequestSearch);};@@ -134,6 +152,7 @@ const SpotlightWithActiveMode = ({ modeState, queryState, activeMode }: Spotlighstore={spotlightStore}><MantineSpotlight.Search+ data-homarr-dev-benchmark-spotlightplaceholder={`${t("search.placeholder")}...`}ref={inputRef}leftSectionWidth={hasModeCharacter ? 80 : 48}diff --git a/packages/spotlight/src/index.ts b/packages/spotlight/src/index.tsindex 3433b7125..706480f7c 100644--- a/packages/spotlight/src/index.ts+++ b/packages/spotlight/src/index.ts@@ -1,28 +1,8 @@"use client";-import { mediaRequestSearchEvent, spotlightActions } from "./spotlight-store";--export { Spotlight } from "./components/spotlight";-export { openSpotlight, openMediaRequestSearch };+export { openSpotlight, openMediaRequestSearch, mediaRequestSearchEvent } from "./open";export {SpotlightProvider,useRegisterSpotlightContextResults,useRegisterSpotlightContextActions,} from "./modes/home/context";--const openSpotlight = spotlightActions.open;--export interface OpenMediaRequestSearchOptions {- integrationIds?: string[];- query?: string;-}--const openMediaRequestSearch = (options: OpenMediaRequestSearchOptions = {}) => {- if (typeof window !== "undefined") {- window.dispatchEvent(new CustomEvent<OpenMediaRequestSearchOptions>(mediaRequestSearchEvent, { detail: options }));- }-- spotlightActions.open();-};--export { mediaRequestSearchEvent };diff --git a/packages/spotlight/src/open.spec.ts b/packages/spotlight/src/open.spec.tsnew file mode 100644index 000000000..9b9c07f83--- /dev/null+++ b/packages/spotlight/src/open.spec.ts@@ -0,0 +1,54 @@+import { beforeEach, describe, expect, it, vi } from "vitest";++import {+ consumePendingMediaRequestSearch,+ consumePendingSpotlightOpen,+ hasPendingSpotlightOpen,+ mediaRequestSearchEvent,+ openMediaRequestSearch,+ openSpotlight,+ spotlightOpenEvent,+} from "./open";++describe("lazy Spotlight open bridge", () => {+ beforeEach(() => {+ consumePendingSpotlightOpen();+ consumePendingMediaRequestSearch();+ });++ it("keeps a pre-mount open request until the lazy component consumes it", () => {+ const listener = vi.fn();+ window.addEventListener(spotlightOpenEvent, listener);++ openSpotlight();++ expect(listener).toHaveBeenCalledOnce();+ expect(consumePendingSpotlightOpen()).toBe(true);+ expect(consumePendingSpotlightOpen()).toBe(false);+ window.removeEventListener(spotlightOpenEvent, listener);+ });++ it("lets a listener installed after the request discover the pending open", () => {+ openSpotlight();++ expect(hasPendingSpotlightOpen()).toBe(true);+ expect(consumePendingSpotlightOpen()).toBe(true);+ expect(hasPendingSpotlightOpen()).toBe(false);+ });++ it("retains media options while dispatching both mount and media events", () => {+ const openListener = vi.fn();+ const mediaListener = vi.fn();+ window.addEventListener(spotlightOpenEvent, openListener);+ window.addEventListener(mediaRequestSearchEvent, mediaListener);++ openMediaRequestSearch({ integrationIds: ["integration-a"], query: "movie" });++ expect(openListener).toHaveBeenCalledOnce();+ expect(mediaListener).toHaveBeenCalledOnce();+ expect(consumePendingSpotlightOpen()).toBe(true);+ expect(consumePendingMediaRequestSearch()).toEqual({ integrationIds: ["integration-a"], query: "movie" });+ window.removeEventListener(spotlightOpenEvent, openListener);+ window.removeEventListener(mediaRequestSearchEvent, mediaListener);+ });+});diff --git a/packages/spotlight/src/open.ts b/packages/spotlight/src/open.tsnew file mode 100644index 000000000..53aa5173f--- /dev/null+++ b/packages/spotlight/src/open.ts@@ -0,0 +1,44 @@+"use client";++export const spotlightOpenEvent = "homarr:spotlight:open";+export const mediaRequestSearchEvent = "homarr:spotlight:media-request-search";++export interface OpenMediaRequestSearchOptions {+ integrationIds?: string[];+ query?: string;+}++let pendingMediaRequestSearch: OpenMediaRequestSearchOptions | null = null;+let pendingSpotlightOpen = false;++const requestSpotlightMount = () => {+ if (typeof window !== "undefined") window.dispatchEvent(new Event(spotlightOpenEvent));+};++export const openSpotlight = () => {+ pendingSpotlightOpen = true;+ requestSpotlightMount();+};++export const consumePendingSpotlightOpen = () => {+ const pending = pendingSpotlightOpen;+ pendingSpotlightOpen = false;+ return pending;+};++export const hasPendingSpotlightOpen = () => pendingSpotlightOpen;++export const consumePendingMediaRequestSearch = () => {+ const pending = pendingMediaRequestSearch;+ pendingMediaRequestSearch = null;+ return pending;+};++export const openMediaRequestSearch = (options: OpenMediaRequestSearchOptions = {}) => {+ pendingMediaRequestSearch = options;+ openSpotlight();++ if (typeof window !== "undefined") {+ window.dispatchEvent(new CustomEvent<OpenMediaRequestSearchOptions>(mediaRequestSearchEvent, { detail: options }));+ }+};diff --git a/packages/spotlight/src/spotlight-store.ts b/packages/spotlight/src/spotlight-store.tsindex a144cdc94..f1fc2cedc 100644--- a/packages/spotlight/src/spotlight-store.ts+++ b/packages/spotlight/src/spotlight-store.ts@@ -12,7 +12,6 @@ export interface MediaRequestSearchScope {}export const mediaRequestSearchScopeAtom = atom<MediaRequestSearchScope>({});-export const mediaRequestSearchEvent = "homarr:spotlight:media-request-search";export const setSelectedAction = (index: number, store: SpotlightStore) => {store.updateState((state) => ({ ...state, selected: index }));diff --git a/packages/translation/package.json b/packages/translation/package.jsonindex 4dc9d8cd6..411d2dd07 100644--- a/packages/translation/package.json+++ b/packages/translation/package.json@@ -16,6 +16,7 @@"./client": "./src/client/index.ts","./server": "./src/server.ts","./middleware": "./src/middleware.ts",+ "./languages": "./src/languages.ts","./request": "./src/request.ts","./dayjs": "./src/dayjs.ts"},diff --git a/packages/translation/src/client/index.ts b/packages/translation/src/client/index.tsindex 5c6755883..990267981 100644--- a/packages/translation/src/client/index.ts+++ b/packages/translation/src/client/index.ts@@ -15,13 +15,10 @@ declare module "next-intl" {}}-export const { useI18n, useScopedI18n } = {- useI18n: useTranslations,- useScopedI18n: useTranslations,-};--export const { useI18nMessages } = {- useI18nMessages: () => useMessages(),-};+// Keep these as direct exports so Turbopack and webpack can statically inspect+// the client package's public surface.+export const useI18n = useTranslations;+export const useScopedI18n = useTranslations;+export const useI18nMessages = () => useMessages();export { useTranslations };diff --git a/packages/translation/src/config.ts b/packages/translation/src/config.tsindex 6acf807d4..ea3bc7dca 100644--- a/packages/translation/src/config.ts+++ b/packages/translation/src/config.ts@@ -1,6 +1,9 @@import type { MRT_Localization } from "mantine-react-table";-import { objectKeys } from "@homarr/common";+import type { SupportedLanguage } from "./languages";++export { supportedLanguages } from "./languages";+export type { SupportedLanguage } from "./languages";export const localeConfigurations = {ca: {@@ -433,10 +436,7 @@ export type LanguageIconDefinition =url: string;};-export const supportedLanguages = objectKeys(localeConfigurations);-export type SupportedLanguage = (typeof supportedLanguages)[number];--export const fallbackLocale = "en" satisfies SupportedLanguage;+export { fallbackLocale } from "./languages";export const isLocaleRTL = (locale: SupportedLanguage) =>"isRTL" in localeConfigurations[locale] && localeConfigurations[locale].isRTL;diff --git a/packages/translation/src/index.ts b/packages/translation/src/index.tsindex fff1e95aa..4a234d3d5 100644--- a/packages/translation/src/index.ts+++ b/packages/translation/src/index.ts@@ -1,5 +1,5 @@-import type { SupportedLanguage } from "./config";-import { supportedLanguages } from "./config";+import type { SupportedLanguage } from "./languages";+import { supportedLanguages } from "./languages";import type { stringOrTranslation, TranslationFunction } from "./type";export * from "./type";diff --git a/packages/translation/src/languages.spec.ts b/packages/translation/src/languages.spec.tsnew file mode 100644index 000000000..7775119d0--- /dev/null+++ b/packages/translation/src/languages.spec.ts@@ -0,0 +1,10 @@+import { describe, expect, it } from "vitest";++import { localeConfigurations } from "./config";+import { supportedLanguages } from "./languages";++describe("supported translation languages", () => {+ it("matches the locale configuration registry", () => {+ expect(Object.keys(localeConfigurations)).toEqual([...supportedLanguages]);+ });+});diff --git a/packages/translation/src/languages.ts b/packages/translation/src/languages.tsnew file mode 100644index 000000000..bffc197c9--- /dev/null+++ b/packages/translation/src/languages.ts@@ -0,0 +1,46 @@+/**+ * Keep the locale list dependency-free. This module is used by Next's proxy,+ * where importing the full translation barrel would widen every route graph.+ */+export const supportedLanguages = [+ "ca",+ "cn",+ "cr",+ "cs",+ "da",+ "de",+ "de-CH",+ "en-gb",+ "en",+ "el",+ "es",+ "et",+ "fi",+ "fr",+ "he",+ "hr",+ "hu",+ "it",+ "ja",+ "ko",+ "lt",+ "lv",+ "nl",+ "no",+ "pl",+ "pt",+ "pt-br",+ "ro",+ "ru",+ "sk",+ "sl",+ "sv",+ "tr",+ "zh",+ "uk",+ "vi",+] as const;++export type SupportedLanguage = (typeof supportedLanguages)[number];++export const fallbackLocale = "en" satisfies SupportedLanguage;diff --git a/packages/translation/src/middleware.ts b/packages/translation/src/middleware.tsindex 4c41325ee..14f587959 100644--- a/packages/translation/src/middleware.ts+++ b/packages/translation/src/middleware.ts@@ -1,7 +1,7 @@import createMiddleware from "next-intl/middleware";import type { SupportedLanguage } from ".";-import { supportedLanguages } from "./config";+import { supportedLanguages } from "./languages";import { createRouting } from "./routing";export const createI18nMiddleware = (defaultLocale: SupportedLanguage) =>diff --git a/packages/translation/src/routing.ts b/packages/translation/src/routing.tsindex e6f268690..b579ae131 100644--- a/packages/translation/src/routing.ts+++ b/packages/translation/src/routing.ts@@ -1,9 +1,9 @@import { defineRouting } from "next-intl/routing";-import { localeCookieKey } from "@homarr/definitions";+import { localeCookieKey } from "@homarr/definitions/cookie";-import type { SupportedLanguage } from "./config";-import { supportedLanguages } from "./config";+import type { SupportedLanguage } from "./languages";+import { supportedLanguages } from "./languages";export const createRouting = (defaultLocale: SupportedLanguage) =>defineRouting({diff --git a/packages/widgets/package.json b/packages/widgets/package.jsonindex 2f835dafd..d3e516202 100644--- a/packages/widgets/package.json+++ b/packages/widgets/package.json@@ -16,11 +16,16 @@"./_inputs/json-path-tree-picker": "./src/_inputs/json-path-tree-picker.tsx","./custom-api/component": "./src/custom-api/component.tsx","./custom-api/extract-display-data": "./src/custom-api/extract-display-data.ts",+ "./catalog": "./src/catalog.ts",+ "./definition": "./src/definition.ts","./errors": "./src/errors/component.tsx",+ "./manifest": "./src/manifest.ts",+ "./options": "./src/options.ts","./errors/classes": "./src/errors/index.ts","./widget-integration-select": "./src/widget-integration-select.tsx","./modals": "./src/modals/index.ts",- "./prefetch": "./src/prefetch.ts"+ "./prefetch": "./src/prefetch.ts",+ "./refetch-intervals": "./src/refetch-intervals.ts"},"scripts": {"clean": "rm -rf .turbo node_modules",diff --git a/packages/widgets/src/anchor-note/index.ts b/packages/widgets/src/anchor-note/index.tsindex a54aada3f..896570b65 100644--- a/packages/widgets/src/anchor-note/index.ts+++ b/packages/widgets/src/anchor-note/index.ts@@ -5,6 +5,7 @@ import { optionsBuilder } from "../options";export const { definition, componentLoader } = createWidgetDefinition("anchorNote", {icon: IconNotes,+ queryKey: [["widget", "anchorNotes"]],supportedIntegrations: ["anchor"],createOptions() {return optionsBuilder.from((factory) => ({diff --git a/packages/widgets/src/app/index.ts b/packages/widgets/src/app/index.tsindex 62f01287d..7755ac105 100644--- a/packages/widgets/src/app/index.ts+++ b/packages/widgets/src/app/index.ts@@ -15,6 +15,7 @@ import { optionsBuilder } from "../options";export const { definition, componentLoader } = createWidgetDefinition("app", {icon: IconApps,+ queryKeys: [[["app", "byId"]], [["widget", "app"]]],createOptions(settings) {return optionsBuilder.from((factory) => ({diff --git a/packages/widgets/src/app/prefetch.ts b/packages/widgets/src/app/prefetch.tsindex 45300197b..8e99f7082 100644--- a/packages/widgets/src/app/prefetch.ts+++ b/packages/widgets/src/app/prefetch.ts@@ -1,9 +1,9 @@-import { trpc } from "@homarr/api/server";import { createLogger } from "@homarr/core/infrastructure/logs";import { db, inArray } from "@homarr/db";import { apps } from "@homarr/db/schema";import type { Prefetch } from "../definition";+import { createTrpcQueryKey } from "../trpc-query-key";const logger = createLogger({ module: "appWidgetPrefetch" });@@ -16,7 +16,7 @@ const prefetchAllAsync: Prefetch<"app"> = async (queryClient, items) => {});for (const app of dbApps) {- queryClient.setQueryData(trpc.app.byId.queryKey({ id: app.id }), app);+ queryClient.setQueryData(createTrpcQueryKey("app.byId", { id: app.id }), app);}logger.info("Successfully prefetched apps for app widget", { count: dbApps.length });diff --git a/packages/widgets/src/beszel-alerts/index.ts b/packages/widgets/src/beszel-alerts/index.tsindex 5e3799a90..f7dd6dee7 100644--- a/packages/widgets/src/beszel-alerts/index.ts+++ b/packages/widgets/src/beszel-alerts/index.ts@@ -6,6 +6,7 @@ import { optionsBuilder } from "../options";export const { definition, componentLoader } = createWidgetDefinition("beszelAlerts", {icon: IconBell,+ queryKey: [["widget", "beszel"]],supportedIntegrations: ["beszel", "mock"],integrationsRequired: true,createOptions() {diff --git a/packages/widgets/src/bookmarks/index.tsx b/packages/widgets/src/bookmarks/index.tsxindex c57b909fd..81a38e970 100644--- a/packages/widgets/src/bookmarks/index.tsx+++ b/packages/widgets/src/bookmarks/index.tsx@@ -10,6 +10,7 @@ import { BookmarkAddButton } from "./add-button";export const { definition, componentLoader } = createWidgetDefinition("bookmarks", {icon: IconBookmark,+ queryKeys: [[["app", "byIds"]]],createOptions() {return optionsBuilder.from((factory) => ({title: factory.text(),diff --git a/packages/widgets/src/bookmarks/prefetch.ts b/packages/widgets/src/bookmarks/prefetch.tsindex 2c3970327..616de0718 100644--- a/packages/widgets/src/bookmarks/prefetch.ts+++ b/packages/widgets/src/bookmarks/prefetch.ts@@ -1,9 +1,9 @@-import { trpc } from "@homarr/api/server";import { createLogger } from "@homarr/core/infrastructure/logs";import { db, inArray } from "@homarr/db";import { apps } from "@homarr/db/schema";import type { Prefetch } from "../definition";+import { createTrpcQueryKey } from "../trpc-query-key";const logger = createLogger({ module: "bookmarksWidgetPrefetch" });@@ -21,7 +21,7 @@ const prefetchAllAsync: Prefetch<"bookmarks"> = async (queryClient, items) => {}queryClient.setQueryData(- trpc.app.byIds.queryKey(item.options.items),+ createTrpcQueryKey("app.byIds", item.options.items),dbApps.filter((app) => item.options.items.includes(app.id)),);}diff --git a/packages/widgets/src/catalog.ts b/packages/widgets/src/catalog.tsnew file mode 100644index 000000000..7951dbf7d--- /dev/null+++ b/packages/widgets/src/catalog.ts@@ -0,0 +1,110 @@+import {+ IconActivityHeartbeat,+ IconAd,+ IconApi,+ IconApps,+ IconArchive,+ IconBadgeCc,+ IconBatteryCharging,+ IconBell,+ IconBinaryTree,+ IconBookmark,+ IconBrandDocker,+ IconBrandMinecraft,+ IconBrowser,+ IconBuildingBank,+ IconBusStop,+ IconCalendar,+ IconChartAreaLine,+ IconChartBar,+ IconClock,+ IconCloud,+ IconDeviceCctv,+ IconDeviceGamepad,+ IconDownload,+ IconFileText,+ IconGraphFilled,+ IconHeadphones,+ IconHeartRateMonitor,+ IconHeartbeat,+ IconLayoutGrid,+ IconMessage,+ IconMovie,+ IconNotes,+ IconPhoto,+ IconReportSearch,+ IconRocket,+ IconRoute,+ IconRss,+ IconServer2,+ IconShieldCheck,+ IconShieldLock,+ IconSpeedboat,+ IconTable,+ IconTicket,+ IconTopologyFull,+ IconTransform,+ IconVideo,+ IconWall,+ IconZoomQuestion,+} from "@tabler/icons-react";++import type { WidgetKind } from "@homarr/definitions";+import type { TablerIcon } from "@homarr/ui";++export const widgetCatalogIcons: Record<WidgetKind, TablerIcon> = {+ clock: IconClock,+ weather: IconCloud,+ app: IconApps,+ iframe: IconBrowser,+ video: IconDeviceCctv,+ notebook: IconNotes,+ anchorNote: IconNotes,+ dnsHoleSummary: IconAd,+ dnsHoleControls: IconDeviceGamepad,+ "smartHome-entityState": IconBinaryTree,+ "smartHome-executeAutomation": IconBinaryTree,+ stockPrice: IconBuildingBank,+ mediaServer: IconVideo,+ calendar: IconCalendar,+ downloads: IconDownload,+ "mediaRequests-requestList": IconZoomQuestion,+ "mediaRequests-requestStats": IconChartBar,+ mediaTranscoding: IconTransform,+ mediaMissing: IconMovie,+ minecraftServerStatus: IconBrandMinecraft,+ networkControllerSummary: IconTopologyFull,+ networkControllerStatus: IconTopologyFull,+ rssFeed: IconRss,+ bookmarks: IconBookmark,+ indexerManager: IconReportSearch,+ healthMonitoring: IconHeartRateMonitor,+ releases: IconRocket,+ mediaReleases: IconTicket,+ dockerContainers: IconBrandDocker,+ firewall: IconWall,+ notifications: IconMessage,+ systemResources: IconGraphFilled,+ coolify: IconCloud,+ systemDisks: IconServer2,+ timetable: IconBusStop,+ "immich-serverStats": IconGraphFilled,+ "immich-albumCarousel": IconPhoto,+ paperlessNgx: IconFileText,+ patchmon: IconShieldCheck,+ bazarr: IconBadgeCc,+ tracearr: IconActivityHeartbeat,+ speedtestTracker: IconSpeedboat,+ uptimeKuma: IconHeartbeat,+ audioStats: IconHeadphones,+ umami: IconChartBar,+ vpn: IconShieldLock,+ archiveTeamWarrior: IconArchive,+ ups: IconBatteryCharging,+ beszelSystemTable: IconTable,+ beszelSystemGrid: IconLayoutGrid,+ beszelAlerts: IconBell,+ beszelSystemStats: IconChartAreaLine,+ traefik: IconRoute,+ customApi: IconApi,+};diff --git a/packages/widgets/src/clock/index.ts b/packages/widgets/src/clock/index.tsindex 20b22d6a0..3fe152b73 100644--- a/packages/widgets/src/clock/index.ts+++ b/packages/widgets/src/clock/index.ts@@ -6,6 +6,7 @@ import { optionsBuilder } from "../options";export const { definition, componentLoader } = createWidgetDefinition("clock", {icon: IconClock,+ queryKey: [["widget", "weather"]],createOptions() {return optionsBuilder.from((factory) => ({diff --git a/packages/widgets/src/definition.ts b/packages/widgets/src/definition.tsindex 3ba53987e..12482f511 100644--- a/packages/widgets/src/definition.ts+++ b/packages/widgets/src/definition.ts@@ -70,6 +70,7 @@ export const createWidgetDefinition = <TKind extends WidgetKind, TDefinition extexport interface WidgetDefinition {icon: TablerIcon;queryKey?: QueryKey;+ queryKeys?: QueryKey[];refetchInterval?: number | null;supportedIntegrations?: IntegrationKind[];integrationsRequired?: boolean;@@ -90,6 +91,9 @@ export interface WidgetDefinition {contextActions?: (props: Omit<WidgetContextActionProps<WidgetKind>, "kind">) => WidgetContextMenuAction[];}+export const getWidgetQueryKeys = (definition: WidgetDefinition, kind: WidgetKind): QueryKey[] =>+ definition.queryKeys ?? [definition.queryKey ?? [["widget", kind]]];+export interface WidgetProps<TKind extends WidgetKind> {options: inferOptionsFromCreator<WidgetOptionsRecordOf<TKind>>;integrationIds: string[];diff --git a/packages/widgets/src/downloads/prefetch.ts b/packages/widgets/src/downloads/prefetch.tsdeleted file mode 100644index 4eb073c43..000000000--- a/packages/widgets/src/downloads/prefetch.ts+++ /dev/null@@ -1,29 +0,0 @@-import { api, trpc } from "@homarr/api/server";-import { createLogger } from "@homarr/core/infrastructure/logs";--import type { Prefetch } from "../definition";--const logger = createLogger({ module: "downloadsWidgetPrefetch" });--const prefetchAllAsync: Prefetch<"downloads"> = async (queryClient, items) => {- await Promise.all(- items.map(async (item) => {- if (item.integrationIds.length === 0) return;-- const input = {- integrationIds: item.integrationIds,- limitPerIntegration: Number(item.options.limitPerIntegration) || 50,- };-- try {- const data = await api.widget.downloads.getJobsAndStatuses(input);- queryClient.setQueryData(trpc.widget.downloads.getJobsAndStatuses.queryKey(input), data);- logger.info("Prefetched downloads widget data", { integrations: item.integrationIds.length });- } catch (error) {- logger.warn("Failed to prefetch downloads widget data", { error });- }- }),- );-};--export default prefetchAllAsync;diff --git a/packages/widgets/src/errors/base-component.tsx b/packages/widgets/src/errors/base-component.tsxindex 8d656f0c4..69392923d 100644--- a/packages/widgets/src/errors/base-component.tsx+++ b/packages/widgets/src/errors/base-component.tsx@@ -17,7 +17,7 @@ export const BaseWidgetError = (props: BaseWidgetErrorProps) => {const t = useI18n();return (- <Stack h="100%" align="center" justify="center" gap="md">+ <Stack h="100%" align="center" justify="center" gap="md" data-homarr-widget-error><props.icon size={40} /><Stack gap={0}><Text ta="center">{translateIfNecessary(t, props.message)}</Text>diff --git a/packages/widgets/src/errors/component.tsx b/packages/widgets/src/errors/component.tsxindex 57f77d62a..733a5c3d3 100644--- a/packages/widgets/src/errors/component.tsx+++ b/packages/widgets/src/errors/component.tsx@@ -1,30 +1,24 @@-import { useMemo } from "react";import { IconExclamationCircle, IconShield } from "@tabler/icons-react";import { TRPCClientError } from "@trpc/client";import type { DefaultErrorData } from "@trpc/server/unstable-core-do-not-import";-import type { WidgetKind } from "@homarr/definitions";--import type { WidgetDefinition } from "..";-import { widgetImports } from "..";+import type { WidgetDefinition } from "../definition";import { ErrorBoundaryError } from "./base";import type { BaseWidgetErrorProps } from "./base-component";import { BaseWidgetError } from "./base-component";interface WidgetErrorProps {- kind: WidgetKind;+ definition?: WidgetDefinition;error: unknown;resetErrorBoundary: () => void;}-export const WidgetError = ({ error, resetErrorBoundary, kind }: WidgetErrorProps) => {- const currentDefinition = useMemo(() => widgetImports[kind].definition, [kind]);-+export const WidgetError = ({ error, resetErrorBoundary, definition }: WidgetErrorProps) => {if (error instanceof ErrorBoundaryError) {return <BaseWidgetError {...error.getErrorBoundaryData()} onRetry={resetErrorBoundary} />;}- const widgetTrpcErrorData = handleWidgetTrpcError(error, currentDefinition);+ const widgetTrpcErrorData = definition ? handleWidgetTrpcError(error, definition) : null;if (widgetTrpcErrorData) {return <BaseWidgetError {...widgetTrpcErrorData} onRetry={resetErrorBoundary} />;}@@ -34,13 +28,7 @@ export const WidgetError = ({ error, resetErrorBoundary, kind }: WidgetErrorPropreturn <BaseWidgetError {...trpcErrorData} onRetry={resetErrorBoundary} />;}- return (- <BaseWidgetError- icon={IconExclamationCircle}- message={(error as { toString: () => string }).toString()}- onRetry={resetErrorBoundary}- />- );+ return <BaseWidgetError icon={IconExclamationCircle} message={String(error)} onRetry={resetErrorBoundary} />;};const handleWidgetTrpcError = (diff --git a/packages/widgets/src/health-monitoring/index.ts b/packages/widgets/src/health-monitoring/index.tsindex ff8eb87ab..a8dedc5c3 100644--- a/packages/widgets/src/health-monitoring/index.ts+++ b/packages/widgets/src/health-monitoring/index.ts@@ -8,6 +8,7 @@ import { createStorageVolumeMultiSelectOptions } from "../storage-volume-optionsexport const { definition, componentLoader } = createWidgetDefinition("healthMonitoring", {icon: IconHeartRateMonitor,+ queryKeys: [[["widget", "healthMonitoring"]], [["integration", "byIds"]]],refetchInterval: 5,createOptions() {return optionsBuilder.from(diff --git a/packages/widgets/src/manifest.spec.ts b/packages/widgets/src/manifest.spec.tsnew file mode 100644index 000000000..f80f4349c--- /dev/null+++ b/packages/widgets/src/manifest.spec.ts@@ -0,0 +1,151 @@+import type { QueryKey } from "@tanstack/react-query";+import { describe, expect, it } from "vitest";++import { widgetIntegrationSupport, widgetKinds as definedWidgetKinds } from "@homarr/definitions";++import {+ createRetryableLoader,+ loadAllWidgetDefinitions,+ loadWidgetComponent,+ loadWidgetDefinition,+ loadWidgetModule,+ loadWidgetResources,+ reduceWidgetOptionsWithDefinition,+ widgetKinds,+} from "./manifest";+import { widgetQueryRefetchIntervals } from "./refetch-intervals";+import { widgetCatalogIcons } from "./catalog";++describe("widget manifest promise stability", () => {+ it("returns the same module promise for every render", () => {+ expect(loadWidgetModule("clock")).toBe(loadWidgetModule("clock"));+ });++ it("returns the same derived definition promise for every render", () => {+ expect(loadWidgetDefinition("clock")).toBe(loadWidgetDefinition("clock"));+ });++ it("returns stable component and combined resource promises", () => {+ expect(loadWidgetComponent("clock")).toBe(loadWidgetComponent("clock"));+ expect(loadWidgetResources("clock")).toBe(loadWidgetResources("clock"));+ });++ it("returns the same all-definitions promise for every modal render", () => {+ expect(loadAllWidgetDefinitions()).toBe(loadAllWidgetDefinitions());+ });++ it("retries a failed loader instead of retaining its rejected promise", async () => {+ let attempts = 0;+ const loader = createRetryableLoader(+ new Map([+ [+ "example",+ () => {+ attempts += 1;+ if (attempts === 1) return Promise.reject(new Error("temporary failure"));+ return Promise.resolve("loaded");+ },+ ],+ ]),+ );++ await expect(loader("example")).rejects.toThrow("temporary failure");+ await expect(loader("example")).resolves.toBe("loaded");+ expect(attempts).toBe(2);+ });++ it("covers every declared widget kind", () => {+ expect(new Set(widgetKinds)).toEqual(new Set(definedWidgetKinds));+ });++ it("loads matching definitions and component loaders for every widget", async () => {+ const definitions = await loadAllWidgetDefinitions();++ await Promise.all(+ widgetKinds.map(async (kind) => {+ const module = await loadWidgetModule(kind);+ const canonicalComponent = await module.componentLoader();+ const component = await loadWidgetComponent(kind);+ const resources = await loadWidgetResources(kind);+ expect(definitions.get(kind)).toBe(module.definition);+ expect(component.default).toBe(canonicalComponent.default);+ expect(component.default).toBeDefined();+ expect(resources.definition).toBe(module.definition);+ expect(resources.Component).toBe(component.default);+ }),+ );+ }, 30_000);++ it("preserves every widget option default", async () => {+ const definitions = await loadAllWidgetDefinitions();+ const settings = { enableStatusByDefault: true, forceDisableStatus: false };++ for (const definition of definitions.values()) {+ const options = definition.createOptions(settings);+ const reduced = reduceWidgetOptionsWithDefinition(definition, settings);+ expect(Object.keys(reduced)).toEqual(Object.keys(options));+ expect(Object.values(reduced).every((value) => value !== undefined)).toBe(true);+ }+ });++ it("keeps the lightweight integration support map aligned with widget definitions", async () => {+ const definitions = await loadAllWidgetDefinitions();++ for (const kind of widgetKinds) {+ const definition = definitions.get(kind);+ const supportedIntegrations =+ definition && "supportedIntegrations" in definition ? (definition.supportedIntegrations ?? []) : [];+ expect([...(widgetIntegrationSupport[kind] ?? [])].toSorted()).toEqual([...supportedIntegrations].toSorted());+ }+ });++ it("keeps the lightweight catalog icons aligned with widget definitions", async () => {+ const definitions = await loadAllWidgetDefinitions();++ for (const kind of widgetKinds) {+ expect(widgetCatalogIcons[kind]).toBe(definitions.get(kind)?.icon);+ }+ });++ it("declares the real query prefix for widget kinds that share a router", async () => {+ const definitions = await loadAllWidgetDefinitions();+ const expectedQueryKeys = new Map([+ ["anchorNote", [["widget", "anchorNotes"]]],+ ["beszelAlerts", [["widget", "beszel"]]],+ ["clock", [["widget", "weather"]]],+ ["mediaMissing", [["widget", "mediaOrganizer"]]],+ ["mediaRequests-requestList", [["widget", "mediaRequests"]]],+ ["mediaRequests-requestStats", [["widget", "mediaRequests"]]],+ ["smartHome-entityState", [["widget", "smartHome"]]],+ ] as const);++ for (const [kind, queryKey] of expectedQueryKeys) {+ expect(definitions.get(kind)?.queryKey).toEqual(queryKey);+ }+ });++ it("keeps the client polling policy aligned with widget definitions", async () => {+ const definitions = await loadAllWidgetDefinitions();+ type PollingPolicy = { queryKey: QueryKey; intervalSeconds: number | null };+ const expectedByQueryKey = new Map<string, PollingPolicy>();++ for (const kind of widgetKinds) {+ const definition = definitions.get(kind);+ if (definition?.refetchInterval === undefined) continue;++ const entry = {+ queryKey: definition.queryKey ?? [["widget", kind]],+ intervalSeconds: definition.refetchInterval,+ } as const;+ const serializedQueryKey = JSON.stringify(entry.queryKey);+ const existing = expectedByQueryKey.get(serializedQueryKey);+ expect(existing?.intervalSeconds ?? entry.intervalSeconds).toBe(entry.intervalSeconds);+ expectedByQueryKey.set(serializedQueryKey, entry);+ }++ const serializePolicy = (entry: PollingPolicy) => JSON.stringify(entry);+ expect(widgetQueryRefetchIntervals.map(serializePolicy).toSorted()).toEqual(+ [...expectedByQueryKey.values()].map(serializePolicy).toSorted(),+ );+ });+});diff --git a/packages/widgets/src/manifest.ts b/packages/widgets/src/manifest.tsnew file mode 100644index 000000000..4bb2cdf2d--- /dev/null+++ b/packages/widgets/src/manifest.ts@@ -0,0 +1,229 @@+import type { ComponentType } from "react";++import { objectEntries } from "@homarr/common";+import type { WidgetKind } from "@homarr/definitions";+import type { SettingsContextProps } from "@homarr/settings/creator";++import type { WidgetComponentProps, WidgetDefinition } from "./definition";+import type { WidgetOptionDefinition } from "./options";++type WidgetModule = {+ definition: WidgetDefinition;+ componentLoader: () => Promise<{ default: ComponentType<WidgetComponentProps<WidgetKind>> }>;+};++type WidgetComponentModule = {+ default: ComponentType<WidgetComponentProps<WidgetKind>>;+};++export type WidgetResources = {+ definition: WidgetDefinition;+ Component: ComponentType<WidgetComponentProps<WidgetKind>>;+};++const moduleLoaders: Record<WidgetKind, () => Promise<WidgetModule>> = {+ clock: () => import("./clock") as Promise<WidgetModule>,+ weather: () => import("./weather") as Promise<WidgetModule>,+ app: () => import("./app") as Promise<WidgetModule>,+ archiveTeamWarrior: () => import("./archive-team-warrior") as Promise<WidgetModule>,+ anchorNote: () => import("./anchor-note") as Promise<WidgetModule>,+ notebook: () => import("./notebook") as Promise<WidgetModule>,+ iframe: () => import("./iframe") as Promise<WidgetModule>,+ video: () => import("./video") as Promise<WidgetModule>,+ dnsHoleSummary: () => import("./dns-hole/summary") as Promise<WidgetModule>,+ dnsHoleControls: () => import("./dns-hole/controls") as Promise<WidgetModule>,+ "smartHome-entityState": () => import("./smart-home/entity-state") as Promise<WidgetModule>,+ "smartHome-executeAutomation": () => import("./smart-home/execute-automation") as Promise<WidgetModule>,+ stockPrice: () => import("./stocks") as Promise<WidgetModule>,+ mediaServer: () => import("./media-server") as Promise<WidgetModule>,+ calendar: () => import("./calendar") as Promise<WidgetModule>,+ downloads: () => import("./downloads") as Promise<WidgetModule>,+ "mediaRequests-requestList": () => import("./media-requests/list") as Promise<WidgetModule>,+ "mediaRequests-requestStats": () => import("./media-requests/stats") as Promise<WidgetModule>,+ mediaMissing: () => import("./media-missing") as Promise<WidgetModule>,+ networkControllerSummary: () => import("./network-controller/summary") as Promise<WidgetModule>,+ networkControllerStatus: () => import("./network-controller/network-status") as Promise<WidgetModule>,+ rssFeed: () => import("./rssFeed") as Promise<WidgetModule>,+ bookmarks: () => import("./bookmarks") as Promise<WidgetModule>,+ bazarr: () => import("./bazarr") as Promise<WidgetModule>,+ indexerManager: () => import("./indexer-manager") as Promise<WidgetModule>,+ healthMonitoring: () => import("./health-monitoring") as Promise<WidgetModule>,+ mediaTranscoding: () => import("./media-transcoding") as Promise<WidgetModule>,+ minecraftServerStatus: () => import("./minecraft/server-status") as Promise<WidgetModule>,+ dockerContainers: () => import("./docker") as Promise<WidgetModule>,+ releases: () => import("./releases") as Promise<WidgetModule>,+ firewall: () => import("./firewall") as Promise<WidgetModule>,+ notifications: () => import("./notifications") as Promise<WidgetModule>,+ mediaReleases: () => import("./media-releases") as Promise<WidgetModule>,+ systemResources: () => import("./system-resources") as Promise<WidgetModule>,+ coolify: () => import("./coolify") as Promise<WidgetModule>,+ systemDisks: () => import("./system-disks") as Promise<WidgetModule>,+ timetable: () => import("./timetable") as Promise<WidgetModule>,+ "immich-serverStats": () => import("./immich/server-stats") as Promise<WidgetModule>,+ "immich-albumCarousel": () => import("./immich/album-carousel") as Promise<WidgetModule>,+ paperlessNgx: () => import("./paperless-ngx") as Promise<WidgetModule>,+ patchmon: () => import("./patchmon") as Promise<WidgetModule>,+ tracearr: () => import("./tracearr") as Promise<WidgetModule>,+ speedtestTracker: () => import("./speedtest-tracker") as Promise<WidgetModule>,+ uptimeKuma: () => import("./uptime-kuma") as Promise<WidgetModule>,+ audioStats: () => import("./audio-stats") as Promise<WidgetModule>,+ umami: () => import("./umami") as Promise<WidgetModule>,+ vpn: () => import("./vpn") as Promise<WidgetModule>,+ ups: () => import("./ups") as Promise<WidgetModule>,+ beszelSystemTable: () => import("./beszel-system-table") as Promise<WidgetModule>,+ beszelSystemGrid: () => import("./beszel-system-grid") as Promise<WidgetModule>,+ beszelAlerts: () => import("./beszel-alerts") as Promise<WidgetModule>,+ beszelSystemStats: () => import("./beszel-system-stats") as Promise<WidgetModule>,+ traefik: () => import("./traefik") as Promise<WidgetModule>,+ customApi: () => import("./custom-api") as Promise<WidgetModule>,+};++// Keep these imports explicit so Turbopack can create one discoverable chunk per+// widget implementation. Loading this registry does not load the implementations.+const componentLoaders: Record<WidgetKind, () => Promise<WidgetComponentModule>> = {+ clock: () => import("./clock/component") as Promise<WidgetComponentModule>,+ weather: () => import("./weather/component") as Promise<WidgetComponentModule>,+ app: () => import("./app/component") as Promise<WidgetComponentModule>,+ archiveTeamWarrior: () => import("./archive-team-warrior/component") as Promise<WidgetComponentModule>,+ anchorNote: () => import("./anchor-note/component") as Promise<WidgetComponentModule>,+ notebook: () => import("./notebook/component") as Promise<WidgetComponentModule>,+ iframe: () => import("./iframe/component") as Promise<WidgetComponentModule>,+ video: () => import("./video/component") as Promise<WidgetComponentModule>,+ dnsHoleSummary: () => import("./dns-hole/summary/component") as Promise<WidgetComponentModule>,+ dnsHoleControls: () => import("./dns-hole/controls/component") as Promise<WidgetComponentModule>,+ "smartHome-entityState": () => import("./smart-home/entity-state/component") as Promise<WidgetComponentModule>,+ "smartHome-executeAutomation": () =>+ import("./smart-home/execute-automation/component") as Promise<WidgetComponentModule>,+ stockPrice: () => import("./stocks/component") as Promise<WidgetComponentModule>,+ mediaServer: () => import("./media-server/component") as Promise<WidgetComponentModule>,+ calendar: () => import("./calendar/component") as Promise<WidgetComponentModule>,+ downloads: () => import("./downloads/component") as Promise<WidgetComponentModule>,+ "mediaRequests-requestList": () => import("./media-requests/list/component") as Promise<WidgetComponentModule>,+ "mediaRequests-requestStats": () => import("./media-requests/stats/component") as Promise<WidgetComponentModule>,+ mediaMissing: () => import("./media-missing/component") as Promise<WidgetComponentModule>,+ networkControllerSummary: () => import("./network-controller/summary/component") as Promise<WidgetComponentModule>,+ networkControllerStatus: () =>+ import("./network-controller/network-status/component") as Promise<WidgetComponentModule>,+ rssFeed: () => import("./rssFeed/component") as Promise<WidgetComponentModule>,+ bookmarks: () => import("./bookmarks/component") as Promise<WidgetComponentModule>,+ bazarr: () => import("./bazarr/component") as Promise<WidgetComponentModule>,+ indexerManager: () => import("./indexer-manager/component") as Promise<WidgetComponentModule>,+ healthMonitoring: () => import("./health-monitoring/component") as Promise<WidgetComponentModule>,+ mediaTranscoding: () => import("./media-transcoding/component") as Promise<WidgetComponentModule>,+ minecraftServerStatus: () => import("./minecraft/server-status/component") as Promise<WidgetComponentModule>,+ dockerContainers: () => import("./docker/component") as Promise<WidgetComponentModule>,+ releases: () => import("./releases/component") as Promise<WidgetComponentModule>,+ firewall: () => import("./firewall/component") as Promise<WidgetComponentModule>,+ notifications: () => import("./notifications/component") as Promise<WidgetComponentModule>,+ mediaReleases: () => import("./media-releases/component") as Promise<WidgetComponentModule>,+ systemResources: () => import("./system-resources/component") as Promise<WidgetComponentModule>,+ coolify: () => import("./coolify/component") as Promise<WidgetComponentModule>,+ systemDisks: () => import("./system-disks/component") as Promise<WidgetComponentModule>,+ timetable: () => import("./timetable/component") as Promise<WidgetComponentModule>,+ "immich-serverStats": () => import("./immich/server-stats/component") as Promise<WidgetComponentModule>,+ "immich-albumCarousel": () => import("./immich/album-carousel/component") as Promise<WidgetComponentModule>,+ paperlessNgx: () => import("./paperless-ngx/component") as Promise<WidgetComponentModule>,+ patchmon: () => import("./patchmon/component") as Promise<WidgetComponentModule>,+ tracearr: () => import("./tracearr/component") as Promise<WidgetComponentModule>,+ speedtestTracker: () => import("./speedtest-tracker/component") as Promise<WidgetComponentModule>,+ uptimeKuma: () => import("./uptime-kuma/component") as Promise<WidgetComponentModule>,+ audioStats: () => import("./audio-stats/component") as Promise<WidgetComponentModule>,+ umami: () => import("./umami/component") as Promise<WidgetComponentModule>,+ vpn: () => import("./vpn/component") as Promise<WidgetComponentModule>,+ ups: () => import("./ups/component") as Promise<WidgetComponentModule>,+ beszelSystemTable: () => import("./beszel-system-table/component") as Promise<WidgetComponentModule>,+ beszelSystemGrid: () => import("./beszel-system-grid/component") as Promise<WidgetComponentModule>,+ beszelAlerts: () => import("./beszel-alerts/component") as Promise<WidgetComponentModule>,+ beszelSystemStats: () => import("./beszel-system-stats/component") as Promise<WidgetComponentModule>,+ traefik: () => import("./traefik/component") as Promise<WidgetComponentModule>,+ customApi: () => import("./custom-api/component") as Promise<WidgetComponentModule>,+};++const definitionPromises = new Map<WidgetKind, Promise<WidgetDefinition>>();++export const widgetKinds = Object.keys(moduleLoaders) as WidgetKind[];++export const createRetryableLoader = <TKey, TValue>(loaders: ReadonlyMap<TKey, () => Promise<TValue>>) => {+ const promises = new Map<TKey, Promise<TValue>>();++ return (key: TKey) => {+ const existing = promises.get(key);+ if (existing) return existing;++ const loader = loaders.get(key);+ if (!loader) throw new Error(`No loader is registered for ${String(key)}`);++ const promise = loader();+ promises.set(key, promise);+ void promise.catch(() => {+ if (promises.get(key) === promise) promises.delete(key);+ });+ return promise;+ };+};++export const loadWidgetModule = createRetryableLoader(+ new Map(Object.entries(moduleLoaders) as [WidgetKind, () => Promise<WidgetModule>][]),+);++export const loadWidgetComponent = createRetryableLoader(+ new Map(Object.entries(componentLoaders) as [WidgetKind, () => Promise<WidgetComponentModule>][]),+);++export const loadWidgetResources = createRetryableLoader(+ new Map(+ (Object.keys(moduleLoaders) as WidgetKind[]).map((kind) => [+ kind,+ async () => {+ const [{ definition }, { default: Component }] = await Promise.all([+ loadWidgetModule(kind),+ loadWidgetComponent(kind),+ ]);+ return { definition, Component } satisfies WidgetResources;+ },+ ]),+ ),+);++export const loadWidgetDefinition = (kind: WidgetKind) => {+ const existing = definitionPromises.get(kind);+ if (existing) return existing;++ const promise = loadWidgetModule(kind).then(({ definition }) => definition);+ definitionPromises.set(kind, promise);+ void promise.catch(() => {+ if (definitionPromises.get(kind) === promise) definitionPromises.delete(kind);+ });+ return promise;+};++let allWidgetDefinitionsPromise: Promise<Map<WidgetKind, WidgetDefinition>> | undefined;++export const loadAllWidgetDefinitions = () => {+ if (allWidgetDefinitionsPromise) return allWidgetDefinitionsPromise;++ const promise = Promise.all(widgetKinds.map(async (kind) => [kind, await loadWidgetDefinition(kind)] as const)).then(+ (entries) => new Map(entries),+ );+ allWidgetDefinitionsPromise = promise;+ void promise.catch(() => {+ if (allWidgetDefinitionsPromise === promise) allWidgetDefinitionsPromise = undefined;+ });++ return promise;+};++export const reduceWidgetOptionsWithDefinition = (+ definition: WidgetDefinition,+ settings: Pick<SettingsContextProps, "enableStatusByDefault" | "forceDisableStatus">,+ currentValue: Record<string, unknown> = {},+) => {+ const options = definition.createOptions(settings) as Record<string, WidgetOptionDefinition>;+ return objectEntries(options).reduce(+ (prev, [key, value]) => ({+ ...prev,+ [key]: currentValue[key] ?? value.defaultValue,+ }),+ {} as Record<string, unknown>,+ );+};diff --git a/packages/widgets/src/media-missing/index.ts b/packages/widgets/src/media-missing/index.tsindex eaa44be6d..fd325f801 100644--- a/packages/widgets/src/media-missing/index.ts+++ b/packages/widgets/src/media-missing/index.ts@@ -9,6 +9,7 @@ const pageSizeOptions = ["10", "20", "30", "50"] as const;export const { componentLoader, definition } = createWidgetDefinition("mediaMissing", {icon: IconMovie,+ queryKey: [["widget", "mediaOrganizer"]],createOptions() {return optionsBuilder.from((factory) => ({showMissing: factory.switch({ defaultValue: true }),diff --git a/packages/widgets/src/media-requests/list/index.ts b/packages/widgets/src/media-requests/list/index.tsindex 1f65cd0c3..bcc5dd4fd 100644--- a/packages/widgets/src/media-requests/list/index.ts+++ b/packages/widgets/src/media-requests/list/index.ts@@ -11,6 +11,7 @@ const mediaRequestStatusValues = ["pending", "approved", "declined", "failed", "export const { componentLoader, definition } = createWidgetDefinition("mediaRequests-requestList", {icon: IconZoomQuestion,+ queryKey: [["widget", "mediaRequests"]],createOptions() {return optionsBuilder.from((factory) => ({linksTargetNewTab: factory.switch({diff --git a/packages/widgets/src/media-requests/stats/index.ts b/packages/widgets/src/media-requests/stats/index.tsindex d49cb8495..5efbd8909 100644--- a/packages/widgets/src/media-requests/stats/index.ts+++ b/packages/widgets/src/media-requests/stats/index.ts@@ -7,6 +7,7 @@ import { createWidgetDefinition } from "../../definition";export const { componentLoader, definition } = createWidgetDefinition("mediaRequests-requestStats", {icon: IconChartBar,+ queryKey: [["widget", "mediaRequests"]],createOptions() {return {};},diff --git a/packages/widgets/src/modals/widget-edit-modal.tsx b/packages/widgets/src/modals/widget-edit-modal.tsxindex 3edb6ffe5..a312f92eb 100644--- a/packages/widgets/src/modals/widget-edit-modal.tsx+++ b/packages/widgets/src/modals/widget-edit-modal.tsx@@ -14,11 +14,11 @@ import type { SettingsContextProps } from "@homarr/settings/creator";import { useI18n } from "@homarr/translation/client";import { zodErrorMap } from "@homarr/validation/form/i18n";-import { widgetImports } from "..";import { getInputForType } from "../_inputs";import { FormProvider, useForm } from "../_inputs/form";import type { BoardItemAdvancedOptions } from "../../../validation/src/shared";import type { OptionsBuilderResult } from "../options";+import type { WidgetDefinition } from "../definition";import { OPTIONS_SUPER_REFINE } from "../options";import type { IntegrationSelectOption } from "../widget-integration-select";import { WidgetIntegrationSelect } from "../widget-integration-select";@@ -32,8 +32,9 @@ export interface WidgetEditModalState {advancedOptions: BoardItemAdvancedOptions;}-interface ModalProps<TSort extends WidgetKind> {+export interface WidgetEditModalProps<TSort extends WidgetKind> {kind: TSort;+ definition: WidgetDefinition;value: WidgetEditModalState;onSuccessfulEdit: (value: WidgetEditModalState) => void;integrationData: IntegrationSelectOption[];@@ -43,7 +44,7 @@ interface ModalProps<TSort extends WidgetKind> {appId?: string;}-export const WidgetEditModal = createModal<ModalProps<WidgetKind>>(({ actions, innerProps }) => {+export const WidgetEditModal = createModal<WidgetEditModalProps<WidgetKind>>(({ actions, innerProps }) => {const t = useI18n();const { data: session } = useSession();const [advancedOptions, setAdvancedOptions] = useState<BoardItemAdvancedOptions>(innerProps.value.advancedOptions);@@ -53,7 +54,7 @@ export const WidgetEditModal = createModal<ModalProps<WidgetKind>>(({ actions, iz.config({customError: zodErrorMap(t),});- const { definition } = widgetImports[innerProps.kind];+ const { definition } = innerProps;const options = definition.createOptions(innerProps.settings) as Record<string, OptionsBuilderResult[string]>;const optionsSuperRefine = (options as Record<symbol, unknown>)[OPTIONS_SUPER_REFINE] as| ((data: Record<string, unknown>, ctx: z.RefinementCtx) => void)@@ -124,10 +125,7 @@ export const WidgetEditModal = createModal<ModalProps<WidgetKind>>(({ actions, i<WidgetIntegrationSelectlabel={t("item.edit.field.integrations.label")}data={innerProps.integrationData}- canSelectMultiple={- ((widgetImports[innerProps.kind].definition as { maxIntegrations?: number }).maxIntegrations ?? Infinity) >- 1- }+ canSelectMultiple={((definition as { maxIntegrations?: number }).maxIntegrations ?? Infinity) > 1}{...form.getInputProps("integrationIds")}/>)}diff --git a/packages/widgets/src/prefetch.ts b/packages/widgets/src/prefetch.tsindex c0e3d03c4..36e2f3415 100644--- a/packages/widgets/src/prefetch.ts+++ b/packages/widgets/src/prefetch.ts@@ -1,26 +1,20 @@-import { cache } from "react";import type { QueryClient } from "@tanstack/react-query";-import { db } from "@homarr/db";-import { getServerSettingsAsync } from "@homarr/db/queries";+import { getRscServerSettingsAsync } from "@homarr/api/server-settings-server";import type { WidgetKind } from "@homarr/definitions";import { createSettings } from "@homarr/settings/creator";-import { reduceWidgetOptionsWithDefaultValues } from ".";+import { loadWidgetDefinition, reduceWidgetOptionsWithDefinition } from "./manifest";import prefetchForApps from "./app/prefetch";import prefetchForBookmarks from "./bookmarks/prefetch";-import prefetchForDownloads from "./downloads/prefetch";import type { Prefetch, WidgetOptionsRecordOf } from "./definition";import type { inferOptionsFromCreator } from "./options";-const cachedGetServerSettingsAsync = cache(getServerSettingsAsync);-const prefetchCallbacks: Partial<{[TKind in WidgetKind]: Prefetch<TKind>;}> = {bookmarks: prefetchForBookmarks,app: prefetchForApps,- downloads: prefetchForDownloads,};export const prefetchForKindAsync = async <TKind extends WidgetKind>(@@ -36,11 +30,15 @@ export const prefetchForKindAsync = async <TKind extends WidgetKind>(return;}- const serverSettings = await cachedGetServerSettingsAsync(db);+ const [serverSettings, definition] = await Promise.all([getRscServerSettingsAsync(), loadWidgetDefinition(kind)]);const itemsWithDefaultOptions = items.map((item) => ({...item,- options: reduceWidgetOptionsWithDefaultValues(kind, createSettings({ user: null, serverSettings }), item.options),+ options: reduceWidgetOptionsWithDefinition(+ definition,+ createSettings({ user: null, serverSettings }),+ item.options,+ ),}));await callback(queryClient, itemsWithDefaultOptions as never[]);diff --git a/packages/widgets/src/refetch-intervals.ts b/packages/widgets/src/refetch-intervals.tsnew file mode 100644index 000000000..fcb1ffcd4--- /dev/null+++ b/packages/widgets/src/refetch-intervals.ts@@ -0,0 +1,29 @@+/**+ * Query policy used by the root client provider.+ *+ * Keep this module free of widget component/definition imports. Importing the+ * full widget registry from a root provider makes every widget part of the+ * initial client graph, even before a board has rendered one widget.+ */+export const widgetQueryRefetchIntervals = [+ { queryKey: [["docker", "getContainers"]], intervalSeconds: 30 },+ { queryKey: [["widget", "dnsHole"]], intervalSeconds: 5 },+ { queryKey: [["widget", "downloads"]], intervalSeconds: 5 },+ { queryKey: [["widget", "firewall"]], intervalSeconds: 5 },+ { queryKey: [["widget", "healthMonitoring"]], intervalSeconds: 5 },+ { queryKey: [["widget", "mediaServer"]], intervalSeconds: 5 },+ { queryKey: [["widget", "tracearr"]], intervalSeconds: 5 },+ { queryKey: [["widget", "immich"]], intervalSeconds: null },+ { queryKey: [["widget", "indexerManager"]], intervalSeconds: null },+ { queryKey: [["widget", "mediaRelease"]], intervalSeconds: null },+ { queryKey: [["widget", "mediaTranscoding"]], intervalSeconds: null },+ { queryKey: [["widget", "minecraft"]], intervalSeconds: null },+ { queryKey: [["widget", "networkController"]], intervalSeconds: null },+ { queryKey: [["widget", "paperlessNgx"]], intervalSeconds: null },+ { queryKey: [["widget", "releases"]], intervalSeconds: null },+ { queryKey: [["widget", "rssFeed"]], intervalSeconds: null },+ { queryKey: [["widget", "speedtestTracker"]], intervalSeconds: null },+ { queryKey: [["widget", "stockPrice"]], intervalSeconds: null },+ { queryKey: [["widget", "umami"]], intervalSeconds: null },+ { queryKey: [["widget", "vpn"]], intervalSeconds: null },+] as const;diff --git a/packages/widgets/src/smart-home/entity-state/index.ts b/packages/widgets/src/smart-home/entity-state/index.tsindex a4dd32921..143f2f232 100644--- a/packages/widgets/src/smart-home/entity-state/index.ts+++ b/packages/widgets/src/smart-home/entity-state/index.ts@@ -7,6 +7,7 @@ import { optionsBuilder } from "../../options";export const { definition, componentLoader } = createWidgetDefinition("smartHome-entityState", {icon: IconBinaryTree,+ queryKey: [["widget", "smartHome"]],createOptions() {return optionsBuilder.from((factory) => ({entityId: factory.text({diff --git a/packages/widgets/src/test/translation.spec.ts b/packages/widgets/src/test/translation.spec.tsindex 8af82dc25..7f65261e0 100644--- a/packages/widgets/src/test/translation.spec.ts+++ b/packages/widgets/src/test/translation.spec.ts@@ -1,15 +1,16 @@import { describe, expect, it } from "vitest";-import { objectEntries } from "@homarr/common";import type { SettingsContextProps } from "@homarr/settings/creator";import { createLanguageMapping } from "@homarr/translation";-import { widgetImports } from "..";+import { loadAllWidgetDefinitions } from "../manifest";-describe("Widget properties with description should have matching translations", async () => {- const enTranslation = await createLanguageMapping().en();- objectEntries(widgetImports).forEach(([key, value]) => {- Object.entries(value.definition.createOptions({} as SettingsContextProps)).forEach(([optionKey, optionValue_]) => {+const widgetDefinitions = await loadAllWidgetDefinitions();+const enTranslation = await createLanguageMapping().en();++describe("Widget properties with description should have matching translations", () => {+ for (const [key, definition] of widgetDefinitions) {+ Object.entries(definition.createOptions({} as SettingsContextProps)).forEach(([optionKey, optionValue_]) => {const optionValue = optionValue_ as { withDescription: boolean };it(`should have matching translations for ${optionKey} option description of ${key} widget`, () => {const option = enTranslation.default.widget[key].option;@@ -21,13 +22,12 @@ describe("Widget properties with description should have matching translations",expect("description" in value).toBe(optionValue.withDescription);});});- });+ }});-describe("Widget properties should have matching name translations", async () => {- const enTranslation = await createLanguageMapping().en();- objectEntries(widgetImports).forEach(([key, value]) => {- Object.keys(value.definition.createOptions({} as SettingsContextProps)).forEach((optionKey) => {+describe("Widget properties should have matching name translations", () => {+ for (const [key, definition] of widgetDefinitions) {+ Object.keys(definition.createOptions({} as SettingsContextProps)).forEach((optionKey) => {it(`should have matching translations for ${optionKey} option name of ${key} widget`, () => {const option = enTranslation.default.widget[key].option;if (!(optionKey in option)) {@@ -38,5 +38,5 @@ describe("Widget properties should have matching name translations", async () =>expect("label" in value).toBe(true);});});- });+ }});diff --git a/packages/widgets/src/trpc-query-key.spec.ts b/packages/widgets/src/trpc-query-key.spec.tsnew file mode 100644index 000000000..e411f8272--- /dev/null+++ b/packages/widgets/src/trpc-query-key.spec.ts@@ -0,0 +1,12 @@+import { describe, expect, test } from "vitest";++import { createTrpcQueryKey } from "./trpc-query-key";++describe("createTrpcQueryKey", () => {+ test("matches the tRPC TanStack query key shape", () => {+ expect(createTrpcQueryKey("widget.downloads.getJobsAndStatuses", { integrationIds: ["one"], limit: 50 })).toEqual([+ ["widget", "downloads", "getJobsAndStatuses"],+ { input: { integrationIds: ["one"], limit: 50 }, type: "query" },+ ]);+ });+});diff --git a/packages/widgets/src/trpc-query-key.ts b/packages/widgets/src/trpc-query-key.tsnew file mode 100644index 000000000..51ea030dd--- /dev/null+++ b/packages/widgets/src/trpc-query-key.ts@@ -0,0 +1,4 @@+export const createTrpcQueryKey = <TInput>(path: string, input: TInput) => [+ path.split("."),+ { input, type: "query" as const },+];diff --git a/packages/widgets/src/weather/component.tsx b/packages/widgets/src/weather/component.tsxindex 0329597b1..6b11453b2 100644--- a/packages/widgets/src/weather/component.tsx+++ b/packages/widgets/src/weather/component.tsx@@ -43,7 +43,7 @@ export default function WeatherWidget({ isEditMode, options }: WidgetComponentPr}interface WeatherProps extends Pick<WidgetComponentProps<"weather">, "options"> {- weather: RouterOutputs["widget"]["weather"]["atLocation"];+ weather: NonNullable<RouterOutputs["widget"]["weather"]["atLocation"]>;}const DailyWeather = ({ options, weather }: WeatherProps) => {diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 2e49bb680..d620d34f4 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -12,6 +12,9 @@ catalogs:'@auth/drizzle-adapter':specifier: ^1.11.2version: 1.11.2+ '@babel/parser':+ specifier: ^7.29.7+ version: 7.29.7'@ctrl/deluge':specifier: ^8.0.0version: 8.0.0@@ -126,9 +129,9 @@ catalogs:'@tabler/icons-react':specifier: ^3.44.0version: 3.44.0- '@tanstack/query-async-storage-persister':- specifier: ^5.101.2- version: 5.101.2+ '@tanstack/react-devtools':+ specifier: ^0.10.8+ version: 0.10.9'@tanstack/react-query':specifier: ^5.101.2version: 5.101.2@@ -138,9 +141,6 @@ catalogs:'@tanstack/react-query-next-experimental':specifier: ^5.101.2version: 5.101.2- '@tanstack/react-query-persist-client':- specifier: ^5.101.2- version: 5.101.2'@testcontainers/mysql':specifier: ^12.0.4version: 12.0.4@@ -415,8 +415,8 @@ catalogs:specifier: 3.22.6version: 3.22.6next:- specifier: 16.2.10- version: 16.2.10+ specifier: 16.3.0-preview.9+ version: 16.3.0-preview.9next-auth:specifier: 5.0.0-beta.31version: 5.0.0-beta.31@@ -517,8 +517,8 @@ catalogs:specifier: ^2.10.4version: 2.10.4typescript:- specifier: npm:@typescript/typescript6@^6.0.2- version: 6.0.2+ specifier: 7.0.2+ version: 7.0.2undici:specifier: 7.28.0version: 7.28.0@@ -592,27 +592,30 @@ importers:specifier: 'catalog:'version: 10.4.0devDependencies:+ '@babel/parser':+ specifier: 'catalog:'+ version: 7.29.7'@playwright/test':specifier: 'catalog:'version: 1.61.1'@semantic-release/changelog':specifier: 'catalog:''@semantic-release/commit-analyzer':specifier: 'catalog:'- version: 13.0.1([email protected](@typescript/[email protected])([email protected]))([email protected])'@semantic-release/git':specifier: 'catalog:'- version: 11.0.1([email protected](@typescript/[email protected])([email protected]))([email protected])'@semantic-release/github':specifier: 'catalog:'- version: 12.0.9([email protected](@typescript/[email protected])([email protected]))([email protected])'@semantic-release/npm':specifier: 'catalog:''@semantic-release/release-notes-generator':specifier: 'catalog:'- version: 14.1.1([email protected](@typescript/[email protected])([email protected]))([email protected])'@testcontainers/redis':specifier: 'catalog:'version: 12.0.4([email protected])@@ -621,7 +624,7 @@ importers:version: 2.10.4(@types/[email protected])'@vitejs/plugin-react':specifier: 'catalog:'- version: 6.0.3([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))+ version: 6.0.3([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))'@vitest/coverage-v8':specifier: 'catalog:'version: 4.1.10([email protected])@@ -648,49 +651,52 @@ importers:version: 1.73.0semantic-release:specifier: 'catalog:'- version: 25.0.5(@typescript/[email protected])([email protected])+ version: 25.0.5([email protected])([email protected])testcontainers:specifier: 'catalog:'version: 12.0.4([email protected])+ tsx:+ specifier: 'catalog:'+ version: 4.20.4turbo:specifier: 'catalog:'version: 2.10.4typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2vite:specifier: 'catalog:'- version: 8.1.4(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ version: 8.1.4(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])vite-tsconfig-paths:specifier: 'catalog:'- version: 6.1.1(@typescript/[email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))+ version: 6.1.1([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))vitest:specifier: 'catalog:'- version: 4.1.10(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])(@typescript/[email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))+ version: 4.1.10(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))apps/docs:dependencies:'@docusaurus/core':specifier: ^3.10.1- version: 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ version: 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/faster':specifier: ^3.10.1- version: 3.10.1(@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])+ version: 3.10.1(@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])'@docusaurus/plugin-content-docs':specifier: ^3.10.1- version: 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ version: 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/plugin-sitemap':specifier: ^3.10.1- version: 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ version: 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/preset-classic':specifier: ^3.10.1- version: 3.10.1(@algolia/[email protected])(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ version: 3.10.1(@algolia/[email protected])(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])'@docusaurus/theme-common':specifier: ^3.10.1- version: 3.10.1(693648dca07bcb0a42a6196192ee56b1)+ version: 3.10.1(76621e8bff6c45bac3fc2219e99bbda8)'@docusaurus/theme-mermaid':specifier: ^3.10.1- version: 3.10.1(c336c9d98c1f4baf3a75901518d97959)+ version: 3.10.1(61e2dfd21fb4d409e7bca036dfc2b268)'@homarr/definitions':specifier: workspace:^version: link:../../packages/definitions@@ -702,10 +708,10 @@ importers:'@scalar/api-reference-react':specifier: 'catalog:'- version: 0.9.54(@typescript/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])+ version: 0.9.54([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])'@signalwire/docusaurus-plugin-llms-txt':specifier: ^1.2.2- version: 1.2.2(@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])+ version: 1.2.2(@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]))([email protected])'@tabler/icons-react':specifier: 'catalog:'version: 3.44.0([email protected])@@ -720,7 +726,7 @@ importers:version: 1.11.21docusaurus-plugin-image-zoom:specifier: ^3.0.1- version: 3.0.1(@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))+ version: 3.0.1(@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]))leader-line-new:specifier: ^1.1.9version: 1.1.9@@ -775,7 +781,7 @@ importers:version: 1.2.0typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2zod:specifier: 'catalog:'version: 4.4.3@@ -913,13 +919,13 @@ importers:version: 1.29.0([email protected])([email protected])'@scalar/api-reference-react':specifier: 'catalog:'- version: 0.9.54(@typescript/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])+ version: 0.9.54([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])'@tabler/icons-react':specifier: 'catalog:'version: 3.44.0([email protected])- '@tanstack/query-async-storage-persister':+ '@tanstack/react-devtools':specifier: 'catalog:'- version: 5.101.2+ version: 0.10.9(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])'@tanstack/react-query':specifier: 'catalog:'version: 5.101.2([email protected])@@ -928,22 +934,19 @@ importers:'@tanstack/react-query-next-experimental':specifier: 'catalog:'- version: 5.101.2(@tanstack/[email protected]([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])- '@tanstack/react-query-persist-client':- specifier: 'catalog:'+ version: 5.101.2(@tanstack/[email protected]([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])'@trpc/client':specifier: 'catalog:'- version: 11.18.0(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])'@trpc/next':specifier: 'catalog:'- version: 11.18.0(@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected]))(@trpc/[email protected](@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected]))(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])([email protected]))(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])+ version: 11.18.0(@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected]([email protected]))([email protected]))(@trpc/[email protected](@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected]([email protected]))([email protected]))(@trpc/[email protected]([email protected]))([email protected])([email protected]))(@trpc/[email protected]([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])'@trpc/react-query':specifier: 'catalog:'- version: 11.18.0(@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected]))(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])([email protected])+ version: 11.18.0(@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected]([email protected]))([email protected]))(@trpc/[email protected]([email protected]))([email protected])([email protected])'@trpc/server':specifier: 'catalog:'- version: 11.18.0(@typescript/[email protected])+ version: 11.18.0([email protected])'@xterm/addon-canvas':specifier: 'catalog:'version: 0.7.0(@xterm/[email protected])@@ -1003,10 +1006,10 @@ importers:version: [email protected](@mantine/[email protected](@mantine/[email protected]([email protected]))(@types/[email protected])([email protected]([email protected]))([email protected]))(@mantine/[email protected](@mantine/[email protected](@mantine/[email protected]([email protected]))(@types/[email protected])([email protected]([email protected]))([email protected]))(@mantine/[email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected]))(@mantine/[email protected]([email protected]))(@tabler/[email protected]([email protected]))([email protected])([email protected])([email protected]([email protected]))([email protected])mcp-handler:specifier: 'catalog:'- version: 1.1.0(@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))+ version: 1.1.0(@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))next:specifier: 'catalog:'- version: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ version: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])postcss-preset-mantine:specifier: 'catalog:'version: 1.18.0([email protected])@@ -1039,7 +1042,7 @@ importers:version: 2.2.6trpc-to-mcp:specifier: 'catalog:'- version: 1.3.2(6bd31c056f397ffcf9e77883340c3ff9)+ version: 1.3.2(7c45d4095abf7cef4938a6fc2cc62863)use-deep-compare-effect:specifier: 'catalog:'version: 1.8.1([email protected])@@ -1082,7 +1085,7 @@ importers:version: 2.1.0([email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2apps/tasks:dependencies:@@ -1170,7 +1173,7 @@ importers:version: 4.20.4typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2apps/websocket:dependencies:@@ -1219,7 +1222,7 @@ importers:version: 0.28.0typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/analytics:dependencies:@@ -1247,7 +1250,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/api:dependencies:@@ -1316,16 +1319,16 @@ importers:version: 5.101.2([email protected])'@trpc/client':specifier: 'catalog:'- version: 11.18.0(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])'@trpc/react-query':specifier: 'catalog:'- version: 11.18.0(@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected]))(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])([email protected])+ version: 11.18.0(@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected]([email protected]))([email protected]))(@trpc/[email protected]([email protected]))([email protected])([email protected])'@trpc/server':specifier: 'catalog:'- version: 11.18.0(@typescript/[email protected])+ version: 11.18.0([email protected])'@trpc/tanstack-react-query':specifier: 'catalog:'- version: 11.18.0(@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected]))(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])([email protected])+ version: 11.18.0(@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected]([email protected]))([email protected]))(@trpc/[email protected]([email protected]))([email protected])([email protected])jsonpath-plus:specifier: 'catalog:'version: 10.4.0@@ -1334,7 +1337,7 @@ importers:version: 4.5.0next:specifier: 'catalog:'- version: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ version: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])react:specifier: 'catalog:'version: 19.2.7@@ -1346,10 +1349,10 @@ importers:version: 2.2.6trpc-to-mcp:specifier: 'catalog:'- version: 1.3.2(20caeb9169922dd2adb62d9d2fa0352f)+ version: 1.3.2(09f4f932022b61bbb1db30a9d75546c7)trpc-to-openapi:specifier: 'catalog:'- version: 3.3.0(patch_hash=2ca3c16af0fcca0c736697ad4fe553a14f794524fa9ce0d5c3e8ee4aea76090c)(@trpc/[email protected](@typescript/[email protected]))([email protected]([email protected]))([email protected])+ version: 3.3.0(patch_hash=2ca3c16af0fcca0c736697ad4fe553a14f794524fa9ce0d5c3e8ee4aea76090c)(@trpc/[email protected]([email protected]))([email protected]([email protected]))([email protected])zod:specifier: 'catalog:'version: 4.4.3@@ -1359,7 +1362,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/auth:dependencies:@@ -1395,10 +1398,10 @@ importers:version: 8.1.8next:specifier: 'catalog:'- version: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ version: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])next-auth:specifier: 'catalog:'- version: 5.0.0-beta.31([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])+ version: 5.0.0-beta.31([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])react:specifier: 'catalog:'version: 19.2.7@@ -1420,7 +1423,7 @@ importers:version: 0.9.2typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/boards:dependencies:@@ -1439,7 +1442,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/cli:dependencies:@@ -1470,7 +1473,7 @@ importers:version: 0.28.0typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/common:dependencies:@@ -1488,7 +1491,7 @@ importers:version: 1.11.21next:specifier: 'catalog:'- version: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ version: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])octokit:specifier: 'catalog:'version: 5.0.5@@ -1513,13 +1516,13 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/core:dependencies:'@t3-oss/env-nextjs':specifier: 'catalog:'better-sqlite3:specifier: 'catalog:'version: 12.11.1@@ -1559,7 +1562,7 @@ importers:version: 8.20.0typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/cron-job-status:dependencies:@@ -1572,7 +1575,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/cron-jobs:dependencies:@@ -1636,7 +1639,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/cron-jobs-core:dependencies:@@ -1658,7 +1661,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/db:dependencies:@@ -1737,7 +1740,7 @@ importers:version: 4.20.4typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/definitions:dependencies:@@ -1759,7 +1762,7 @@ importers:version: 4.20.4typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/docker:dependencies:@@ -1781,7 +1784,7 @@ importers:version: 4.0.1typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/form:dependencies:@@ -1806,7 +1809,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/forms-collection:dependencies:@@ -1849,7 +1852,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/icons:dependencies:@@ -1868,7 +1871,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/image-proxy:dependencies:@@ -1893,7 +1896,7 @@ importers:version: 6.0.0typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/integrations:dependencies:@@ -1984,7 +1987,7 @@ importers:version: 0.4.14typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/modals:dependencies:@@ -2009,7 +2012,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/modals-collection:dependencies:@@ -2057,7 +2060,7 @@ importers:version: 1.11.21next:specifier: 'catalog:'- version: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ version: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])react:specifier: 'catalog:'version: 19.2.7@@ -2073,7 +2076,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/notifications:dependencies:@@ -2092,7 +2095,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/old-import:dependencies:@@ -2140,7 +2143,7 @@ importers:version: 0.5.18next:specifier: 'catalog:'- version: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ version: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])react:specifier: 'catalog:'version: 19.2.7@@ -2165,7 +2168,7 @@ importers:version: 0.5.8typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/old-schema:dependencies:@@ -2181,7 +2184,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/ping:dependencies:@@ -2197,7 +2200,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/redis:dependencies:@@ -2225,7 +2228,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/request-handler:dependencies:@@ -2274,7 +2277,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/server-settings:dependencies:@@ -2290,7 +2293,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/settings:dependencies:@@ -2305,7 +2308,7 @@ importers:version: 9.4.1(@mantine/[email protected](@mantine/[email protected]([email protected]))(@types/[email protected])([email protected]([email protected]))([email protected]))(@mantine/[email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])next:specifier: 'catalog:'- version: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ version: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])react:specifier: 'catalog:'version: 19.2.7@@ -2318,7 +2321,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/spotlight:dependencies:@@ -2372,7 +2375,7 @@ importers:version: 2.20.1(@babel/[email protected]([email protected]))(@babel/[email protected])(@types/[email protected])([email protected])next:specifier: 'catalog:'- version: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ version: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])react:specifier: 'catalog:'version: 19.2.7@@ -2388,7 +2391,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/translation:dependencies:@@ -2409,10 +2412,10 @@ importers:version: [email protected](@mantine/[email protected](@mantine/[email protected]([email protected]))(@types/[email protected])([email protected]([email protected]))([email protected]))(@mantine/[email protected](@mantine/[email protected](@mantine/[email protected]([email protected]))(@types/[email protected])([email protected]([email protected]))([email protected]))(@mantine/[email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected]))(@mantine/[email protected]([email protected]))(@tabler/[email protected]([email protected]))([email protected])([email protected])([email protected]([email protected]))([email protected])next:specifier: 'catalog:'- version: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ version: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])next-intl:specifier: 'catalog:'- version: 4.13.1(@typescript/[email protected])([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])+ version: 4.13.1([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected])react:specifier: 'catalog:'version: 19.2.7@@ -2425,7 +2428,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/ui:dependencies:@@ -2464,7 +2467,7 @@ importers:version: [email protected](@mantine/[email protected](@mantine/[email protected]([email protected]))(@types/[email protected])([email protected]([email protected]))([email protected]))(@mantine/[email protected](@mantine/[email protected](@mantine/[email protected]([email protected]))(@types/[email protected])([email protected]([email protected]))([email protected]))(@mantine/[email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected]))(@mantine/[email protected]([email protected]))(@tabler/[email protected]([email protected]))([email protected])([email protected])([email protected]([email protected]))([email protected])next:specifier: 'catalog:'- version: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ version: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])react:specifier: 'catalog:'version: 19.2.7@@ -2486,7 +2489,7 @@ importers:version: 1.0.5typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/validation:dependencies:@@ -2508,7 +2511,7 @@ importers:version: link:../../tooling/typescripttypescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2packages/widgets:dependencies:@@ -2664,7 +2667,7 @@ importers:version: [email protected](@mantine/[email protected](@mantine/[email protected]([email protected]))(@types/[email protected])([email protected]([email protected]))([email protected]))(@mantine/[email protected](@mantine/[email protected](@mantine/[email protected]([email protected]))(@types/[email protected])([email protected]([email protected]))([email protected]))(@mantine/[email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected]))(@mantine/[email protected]([email protected]))(@tabler/[email protected]([email protected]))([email protected])([email protected])([email protected]([email protected]))([email protected])next:specifier: 'catalog:'- version: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ version: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])react:specifier: 'catalog:'version: 19.2.7@@ -2698,7 +2701,7 @@ importers:version: 7.3.58typescript:specifier: 'catalog:'- version: '@typescript/[email protected]'+ version: 7.0.2tooling/github: {}@@ -5025,156 +5028,165 @@ packages:'@iconify/[email protected]':resolution: {integrity: sha512-LPKOXPn/zV+zis1oOfGWogaXVpqUybF3ZS6SCZIsz8vg0ivVp9+fVqyYB7xq0aiST/VhUQYGO1qo6uoYSiEJqw==}- '@img/[email protected]':- resolution: {integrity: sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==}+ '@img/[email protected]':+ resolution: {integrity: sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==}engines: {node: '>=18'}- '@img/[email protected]':- resolution: {integrity: sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ '@img/[email protected]':+ resolution: {integrity: sha512-RMnFX7YQsMoh7lWfcM4NEHHymBX/rLuKNPVM84XE9ONPcaSCDgE7CHIHpSgPcO2xcRthgBy1HfNO319mwhIAkg==}+ engines: {node: '>=20.9.0'}cpu: [arm64]os: [darwin]- '@img/[email protected]':- resolution: {integrity: sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ '@img/[email protected]':+ resolution: {integrity: sha512-Xo+5uFBtLN0BKqieTxiFzFPQAUlBbbH5iBKyRX/z1JrbnYsHTfKJnUfL8+p2TPXr1pXqao4eeL4Rl144uDpK9w==}+ engines: {node: '>=20.9.0'}cpu: [x64]os: [darwin]- '@img/[email protected]':- resolution: {integrity: sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==}+ '@img/[email protected]':+ resolution: {integrity: sha512-lUxcqWIj2wMQ9BrwNjngcr1gWUr5xgaGThBRqPPalIC2n67Cqj1uPh8NnA/ZhAg8hUbKl+kVHKwgUIwe6ZYPrg==}+ engines: {node: '>=20.9.0'}+ os: [freebsd]++ '@img/[email protected]':+ resolution: {integrity: sha512-9J6ypZFpQBj4YnePGoq/S38w6nz+vqg5WZLrLGY4YuSemdMq47GMLBPO42MzwdGwpg/agZ7xzZcFHa48xlywfg==}cpu: [arm64]os: [darwin]- '@img/[email protected]':- resolution: {integrity: sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==}+ '@img/[email protected]':+ resolution: {integrity: sha512-m2pW1n6cns9VaubNwsZ+c3CRYjxNQWgJ5gPlnL1nbBcpkBvFm6SCFN5o0psFHI8w9n11NKhFkeEDns98tiqbEw==}cpu: [x64]os: [darwin]- '@img/[email protected]':- resolution: {integrity: sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==}+ '@img/[email protected]':+ resolution: {integrity: sha512-dqVSFynCox4C/J8kT16V7SIFAns0IjgLwkvYT7p8LQVmJ5OS5b6tI9IGflxTeuBS//zXeFIUbwt5dwxyZ17cnA==}cpu: [arm64]os: [linux]libc: [glibc]- '@img/[email protected]':- resolution: {integrity: sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==}+ '@img/[email protected]':+ resolution: {integrity: sha512-1eMLzy92I4J6rmi4mAT8yC3HxOtniyGELlzGbNMLLeqe052ahFQ0h6LFq+lh5DsDIdYViIDst08abvSbcEdLXQ==}cpu: [arm]os: [linux]libc: [glibc]- '@img/[email protected]':- resolution: {integrity: sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==}+ '@img/[email protected]':+ resolution: {integrity: sha512-3z0NHDxD6n5I9gc05U1eW1AyRm+Gznzq3naMrthPNqE6oYykcogW0l/jfpJdjYnuNl8R7yI9pNbE1XiUeyq0Aw==}cpu: [ppc64]os: [linux]libc: [glibc]- '@img/[email protected]':- resolution: {integrity: sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==}+ '@img/[email protected]':+ resolution: {integrity: sha512-bsb4rI+NldGOsXuej2r8OdSS8+zXDVaCWxyWrcv6kneTOlgAHtZABRzBBCwdsPiD90J4myNJuHpg6kA20ImW/w==}cpu: [riscv64]os: [linux]libc: [glibc]- '@img/[email protected]':- resolution: {integrity: sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==}+ '@img/[email protected]':+ resolution: {integrity: sha512-/ABshyj8gCpyIrNXnHn4LorDJ0HHm1VhXPBlxZ8zAtfVPAaSafXPGn+sUSIRiwaSBy0mmFjSjiXI5mkcwdChKQ==}cpu: [s390x]os: [linux]libc: [glibc]- '@img/[email protected]':- resolution: {integrity: sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==}+ '@img/[email protected]':+ resolution: {integrity: sha512-ITPEtgffGJ0S6G9dRyw/366tJQqFRcHWPHhC+Stpg3Z8AEMrDrTr2lhdz4f/Y/HMbRh//7Z5mBzEpVdi62Oc3w==}cpu: [x64]os: [linux]libc: [glibc]- '@img/[email protected]':- resolution: {integrity: sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==}+ '@img/[email protected]':+ resolution: {integrity: sha512-zE9EdiUzUmg5mDT5a1rk5fYJ6GWPloTwWBYDS14naqHsL+EaMpDj1AWnpLgh3u0YCORv2Tt50wrcrpYqkP97Kw==}cpu: [arm64]os: [linux]libc: [musl]- '@img/[email protected]':- resolution: {integrity: sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==}+ '@img/[email protected]':+ resolution: {integrity: sha512-m0lrLiUt+lBYnCFr8qV/65yMR4E/c7/wf78I5eKTdkEakFAlZ9QlzEM3QIhhAwVeUhLAHLcCq7a7Vszq/oFNZQ==}cpu: [x64]os: [linux]libc: [musl]- '@img/[email protected]':- resolution: {integrity: sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ '@img/[email protected]':+ resolution: {integrity: sha512-QgKDspHPnrU+GQ55XPhGwyhC8acLVOOSyAvo1oVfFmrIXLkDNmGWzAfDZ4xK8oSA1qBQrALcHX0G5UZni/SuFQ==}+ engines: {node: '>=20.9.0'}cpu: [arm64]os: [linux]libc: [glibc]- '@img/[email protected]':- resolution: {integrity: sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ '@img/[email protected]':+ resolution: {integrity: sha512-affVWCTLooy8TSxbDx2qkzuDeaWLNVBA+P//FNBirHsXpP2fuBhk5AuboYUnrDnzoXes8GFjpTx0SBFOCRg+FA==}+ engines: {node: '>=20.9.0'}cpu: [arm]os: [linux]libc: [glibc]- '@img/[email protected]':- resolution: {integrity: sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ '@img/[email protected]':+ resolution: {integrity: sha512-sMd8rDxmpLOwv/7N44klFjOD5DUO7FLdjiXDI0hoxYaf7Ar262dQIEkosE98bps+5HPLtp/EvNqeqQtOycP/IA==}+ engines: {node: '>=20.9.0'}cpu: [ppc64]os: [linux]libc: [glibc]- '@img/[email protected]':- resolution: {integrity: sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ '@img/[email protected]':+ resolution: {integrity: sha512-0Eob78yjlYPfL5vMNWAW55l3R9Y6BQS/gOfe0ZcP9mEz9ohhKSt4im1hayiknXgf8AWrFqMvJcKIdmLmEe7yeQ==}+ engines: {node: '>=20.9.0'}cpu: [riscv64]os: [linux]libc: [glibc]- '@img/[email protected]':- resolution: {integrity: sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ '@img/[email protected]':+ resolution: {integrity: sha512-KgAxQ0DxpNOq1rG2t5cgTgShJFGSuU7XO45cqC+1NVOuZnP6tlgZRuSYOfNupGkHID0o3cJOsw4DVeJpMovcGw==}+ engines: {node: '>=20.9.0'}cpu: [s390x]os: [linux]libc: [glibc]- '@img/[email protected]':- resolution: {integrity: sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ '@img/[email protected]':+ resolution: {integrity: sha512-8pqvxubL2PGdhlPy6GLqzDYMUjyRmKAwKHYKixpdJYBUK7PJ0C029XdsnpFIdgRZG68fZiGdHVWcKPvtiPB4cA==}+ engines: {node: '>=20.9.0'}cpu: [x64]os: [linux]libc: [glibc]- '@img/[email protected]':- resolution: {integrity: sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ '@img/[email protected]':+ resolution: {integrity: sha512-Vz0iQjzzcSX3HCbfwFfCSG/9SCIqyO0mH2sXyiHaAYfBk0cRsCWXRyQYX0ovCK/PAQBbTzQ0dsPQHh5MAFL59w==}+ engines: {node: '>=20.9.0'}cpu: [arm64]os: [linux]libc: [musl]- '@img/[email protected]':- resolution: {integrity: sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ '@img/[email protected]':+ resolution: {integrity: sha512-6O1NPKcDVj9QEdg7Hx549EX8U0rp6yXQERqru6yRN7fGBn32UvIRJUlWnk+8xDCiG76hXVBbX82NZ/ZKr0euIg==}+ engines: {node: '>=20.9.0'}cpu: [x64]os: [linux]libc: [musl]- '@img/[email protected]':- resolution: {integrity: sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ '@img/[email protected]':+ resolution: {integrity: sha512-cZ0XkcYGpHZkqW6iCkqTcmUC0CD9DhD5d/qeZlZkfRBn6GnHniZXLUo5+9xw8Iv76YE6LQFN9YNBlKREcCG76w==}+ engines: {node: '>=20.9.0'}++ '@img/[email protected]':+ resolution: {integrity: sha512-2rnq7bX3NzeR2T4YWgz8qiG4h3TSdMe+vN1iQXpJleSJ3SM5zQ8Fy2SyyXAWlbxpEZ2Y+Z4u1BePgJEYbSy80Q==}+ engines: {node: '>=20.9.0'}cpu: [wasm32]- '@img/[email protected]':- resolution: {integrity: sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ '@img/[email protected]':+ resolution: {integrity: sha512-4bPwFdMbeC4JQ8L8LOyWp6nsHcboP5fxkp6iPOXz2Vg49R42TuMs2whkJ5OAP4/Ul035qOzy0AecOF9VOscn4w==}+ engines: {node: '>=20.9.0'}cpu: [arm64]os: [win32]- '@img/[email protected]':- resolution: {integrity: sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ '@img/[email protected]':+ resolution: {integrity: sha512-r53mXsBN6lFUDiST764SvgwUdHAqM4rPAiDzAmf4fLoB6X/rkfyTrLCg6+g17wJJiCmB3JYgHuUldCWUIRFSXw==}+ engines: {node: ^20.9.0}cpu: [ia32]os: [win32]- '@img/[email protected]':- resolution: {integrity: sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ '@img/[email protected]':+ resolution: {integrity: sha512-D4y1vNeZrIIJCN+uHaWVtH86B+aCrdMYYjicy9pXHvbGZeGYLLSd3wdVuC37FxVXlU1ARsk84eKWfWMXGYEqvA==}+ engines: {node: '>=20.9.0'}cpu: [x64]os: [win32]@@ -5731,57 +5743,57 @@ packages:'@emnapi/core': ^1.7.1'@emnapi/runtime': ^1.7.1- '@next/[email protected]':- resolution: {integrity: sha512-zLPxg9M0MEHmygpj5OuxjQ+vHMiy/K7cSp74G8ecYolmgUWw0RwN02tF56npup/+qaI8JB97hQgS/r2Hb6QwVA==}+ '@next/[email protected]':+ resolution: {integrity: sha512-BcD+/sVDfoHckHcEx6e4RaLfWrUb+DpXgL9jOc6f29RTyvNwVVtnAaPljp3ok4zFQan6RhFE7q32lSXAFjjV9A==}- '@next/[email protected]':- resolution: {integrity: sha512-v9IdJCa0H0mbo+8z5zwUpOk1Vj7RjkcI5uNYf5Ws1y6szf/p3Mzl9hLaST8SCt6L9h8NGnruZcd2+o0NTNwDhA==}+ '@next/[email protected]':+ resolution: {integrity: sha512-42OV/jDhHoKuqq+kp0RYrW1uksykLhXQeX+zx4SYFEG45ec9HnLHnsGgG1vy5W+LaSDvj3BPMBPTKMCh1vl1Ew==}engines: {node: '>= 10'}cpu: [arm64]os: [darwin]- '@next/[email protected]':- resolution: {integrity: sha512-17IS0jJRViROGmA9uGdNR8VPJpfbnaVG7E9qhso5jDLkmyd0lSDORWxbcKINzcFqzZqGwGtMSnrFRxBpuUYjLQ==}+ '@next/[email protected]':+ resolution: {integrity: sha512-j6dvZHjhjB3l+uDQiBmuajzzCyCetWdQw+eouwR0mE455b+OvPY32dUNIY+D33oTOe3f0My9wSw4Um5hxywUlA==}engines: {node: '>= 10'}cpu: [x64]os: [darwin]- '@next/[email protected]':- resolution: {integrity: sha512-GRQRsRtuciNJvB54AvvuQTiq0oZtFwa1owQqtZD8wwnGpM2L39MV22kpI72YSXLKIyY40LC66EiLFv4PiicXxg==}+ '@next/[email protected]':+ resolution: {integrity: sha512-2+1WzP2+ngzCkXiyzBwowgBiYaUycjAB/9b5ah5TjP0icBHOHf7oaPnjSZlZ8iq6x2G6QuR9S840jkOKNInUCw==}engines: {node: '>= 10'}cpu: [arm64]os: [linux]libc: [glibc]- '@next/[email protected]':- resolution: {integrity: sha512-zkN9MQYS7UQBro+FnISUq1itaQjXI9xqISzuQ+2bc921NcJ1x4yPCqrn77tVN6/dOOXaaWVX3k6/bR07pPwK+A==}+ '@next/[email protected]':+ resolution: {integrity: sha512-2Tq6H0LtObGQj2s7u56TYakTJ3NmDOWnNRaT2TI17oQEUfPv3O4a22jt4xIDVkxvaYfB2L4y2hl8DGAEw1WV6g==}engines: {node: '>= 10'}cpu: [arm64]os: [linux]libc: [musl]- '@next/[email protected]':- resolution: {integrity: sha512-iCVJnwvrPYECvA6WM/7+oo+OiTvedIKLxtCLAZP4xZR3nXa1zmzZyLPbYCmWvpd4CvMYF1EMTafd0ii3DygLvA==}+ '@next/[email protected]':+ resolution: {integrity: sha512-H2bCT2w2H/W6xRLRw4oWgOEMIyWc1tn65c46u0zC60omKig9hPWj7vrhMBqwOMTmZcFZwNqBTpJTF0LuopEfHA==}engines: {node: '>= 10'}cpu: [x64]os: [linux]libc: [glibc]- '@next/[email protected]':- resolution: {integrity: sha512-ov2g4H0dHY9bPoOU83m91hWT7Iq5qy13bUnyyshLU3HGR1Ownn0X9QpmDPc5iIUaahTp7f7LeGAhV4DSFtackw==}+ '@next/[email protected]':+ resolution: {integrity: sha512-WK0CI8ky1oDGwqzi8oJjtC5rfMNOUx4DMBiVr1o9mvsMwkCUkVh7n6+AAx2Qxk8llRJxpaGlBZv1fhHytsENVw==}engines: {node: '>= 10'}cpu: [x64]os: [linux]libc: [musl]- '@next/[email protected]':- resolution: {integrity: sha512-DwAnhLX76HQiFFQNgWlcK+JzlnD1rZ+UK/WY0ZMI/deXpvgnesjNYrqcfo1JzBuz4Kf7o3brIBL0glI1junatA==}+ '@next/[email protected]':+ resolution: {integrity: sha512-COFwXsMQsStyBv4qBn6E3tKHuPVifMkpVvF2k2/I0HsLAwuelgj+5uO8jS4e+sfTcdvczdvuiG8BjJz3aAa0IQ==}engines: {node: '>= 10'}cpu: [arm64]os: [win32]- '@next/[email protected]':- resolution: {integrity: sha512-0JXq3b85Jk9Jg4ntLUbXSPvoDw3gpZou7twuKdoFG2jOw635v7+IiXfTaa0TxVMyx78pUjnrVYwLgjKfX4e6/A==}+ '@next/[email protected]':+ resolution: {integrity: sha512-RG4rEpg3ynGwTP6mnsDZHLuFbKksXkQCd9A5MDkgPY9+wYawIrc23pJYHZxyBxisuV/t+dwCgbpZoclW8icE7A==}engines: {node: '>= 10'}cpu: [x64]os: [win32]@@ -6882,6 +6894,36 @@ packages:'@so-ric/[email protected]':resolution: {integrity: sha512-/KiKkpHNOBgkFJwu9sh48LkHSMYGyuTcSFK/qMBdnOAlrRJzRSXAOFB5qwzaVQuDl8wAvHVMkaASQDReTahxuw==}+ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-5I0YJcTVYIWoMmgBSROBZGcz+ymhew/pGTg2dHW74BUjFKsV8Li4bOZYl0YAGP4mHw5o4UBd9/BEesqBci3wxw==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-558RPNYnXx4nGh537DSqAn4xMrC8iFipl/5+xzgzWoTNFst4RnUN3BOLmtDjJ0UGGoQXVMALYR3bNOHM0xnt1Q==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-9Fuu/EWBeGj+atGHRJp70HKhdfalmpjwxY8a32NZixdLNmfCJ45AfhLQNr6uOzETbbiMx4iCKlTrJ8KZCHC2Ww==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-TOIZa1VUfVJ+9nkCcRajw3U4t9vBOP1HxX1WHNTbXq32mXwlqTvUnC4CRIilohcryBkT9u2ZkhUDSHRTaGp55g==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-LgtVaVBtB7EbmS4+M0b8xY5Iq6pUWXBsIC4VgtrFKDGDdyCaDt88sHk0fUlx1Enxm/XZnZyLXJABRoa39RjJqA==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-ISSB5QX1qP2ynrheIpYwc4oKR5Ny4siNuUyf1qZniy+Il+p/PtDB0QK1Dnle8noiHpwRD3gpPdubOC3qI/Zamg==}+ peerDependencies:+ solid-js: ^1.6.12+'@standard-schema/[email protected]':resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==}@@ -7268,21 +7310,50 @@ packages:'@tailwindcss/[email protected]':resolution: {integrity: sha512-rjVWYCa7Ngbi5AarT6k8TkxUG3Wl1QKzHdIZVsjZSzf36Jmo2IKZt/NHRAwly8oDkbBOH0YTu+CHuf9jPxMc+g==}+ '@tanstack/[email protected]':+ resolution: {integrity: sha512-cG3iZkGWCwN330bLBKa8+9r4Of2AXNoz2zUqcsy/4XsD3105ghVBx78cGyvJj9fSclNomPxoqAnDGXXhg1WLvA==}+ engines: {node: '>=18'}++ '@tanstack/[email protected]':+ resolution: {integrity: sha512-2LHzhwBFlKHCcklsQrGe8TeyjHd4XAF8nuCO6wHmva5fePUkJUULbu6CsCNAlGlCi0KkEsMXZSvRdR4HgMq4yA==}+ engines: {node: '>=18'}++ '@tanstack/[email protected]':+ resolution: {integrity: sha512-H+OH3zC6Vhu/K0NaVfQKknEKawc/+2PT+D3SB3Ox0V8SiMlTo0abbmH2rH0721R2aNYbjdMXA1oENOd8E2UVoA==}+ engines: {node: '>=18'}+ hasBin: true++ '@tanstack/[email protected]':+ resolution: {integrity: sha512-CVaM6rT6Nl5ijo83vJYFa2SjofvpuOl/uOvbYGhBrRgUhhelNHhx8zZX+hnZCHmIr0/lzM65hsocnZ72592Rvg==}+ engines: {node: '>=18'}+ peerDependencies:+ solid-js: '>=1.9.7'++ '@tanstack/[email protected]':+ resolution: {integrity: sha512-p/nOH9bS/OO/u3402zPjoGu+Mz6Fzi/iRqJuYghuuYRUY32kZt+C0/d+pP/bi6/2JTi1FdT6oEXI2lWlA5tXxw==}+ engines: {node: '>=18'}+ hasBin: true+ peerDependencies:+ solid-js: '>=1.9.7'+'@tanstack/[email protected]':resolution: {integrity: sha512-Wo1iKt2b9OT7d+YGhvEPD3DXvPv2etTusIMhMUoG7fbhmxcXCtIjJDEygy91Y2JFlwGyjqiBPRozme7UD8hoqg==}engines: {node: '>=12'}- '@tanstack/[email protected]':- resolution: {integrity: sha512-jf7zvVKZ5q2j/xuhbTIBUpw5xt6cw/ioOFQquxK7fRY0AmMQP8A0JVMOgYoeQLA4PKdeT7RxsuLAF0Lft9oJ8Q==}-'@tanstack/[email protected]':resolution: {integrity: sha512-hH5MLoJhF7KaIGd7q3xTXGXvslI+GYlM1Z/35aSHHWaCJWB7XvTSHYuV3eM7tw+aE0mT/xMro4M4Q9rCGHT0lw==}'@tanstack/[email protected]':resolution: {integrity: sha512-o+wHcqgN7Pp0s8v1i0UGq/ZrrEKrxdIiMQmKRdYb2w7NPtylYSJ4+wg/tIn71m9DLstwUwdEGAvROdly6HXP6w==}- '@tanstack/[email protected]':- resolution: {integrity: sha512-rgMsbvBVpSPDUsprC9FYxojdG0Q1LH6yq1i3DXz2aps4VEqv2l4Msj3YDqIifU3xkl/DrYe9YWntZAJLrM6xTg==}+ '@tanstack/[email protected]':+ resolution: {integrity: sha512-lS6mtccEmUaodsWiRORGM/MGKT0jgzcy5v+eY6pzOPxEgzTHUDhca+WGxShFqKxmF4oneRxXjww1gkvMrWq6uw==}+ engines: {node: '>=18'}+ peerDependencies:+ '@types/react': '>=16.8'+ '@types/react-dom': '>=16.8'+ react: '>=16.8'+ react-dom: '>=16.8''@tanstack/[email protected]':resolution: {integrity: sha512-eU7HctdA9gDjqoERoEdzLbw9DiqnBDfh5+Hu0u26gjqoHJezOpQAuiesDL2VvkU+2cPV76zgv0tMZsOrI4LjnQ==}@@ -7297,12 +7368,6 @@ packages:next: ^13 || ^14 || ^15 || ^16react: ^18 || ^19- '@tanstack/[email protected]':- resolution: {integrity: sha512-19UpaRtf0lvB2QAJ2MoixxtGf3osMOd508g99EsttUj4+3eLs+ulnNgYjB7AkQMHrRlcbVXqpVNqWkB4a7g8Zw==}- peerDependencies:- '@tanstack/react-query': ^5.101.2- react: ^18 || ^19-'@tanstack/[email protected]':resolution: {integrity: sha512-seDkr6kzGzX1okaaTtZPtgA688CDPlXUz1C6xSg0ESqn04Vuc8tlrYms1s3de+znBqhPVxFRfpAfUf+6XvfPWg==}peerDependencies:@@ -8006,9 +8071,125 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==}- '@typescript/[email protected]':- resolution: {integrity: sha512-mbCddXd+jm7hfx7w2YU64/Av4/NqqeG3GoRZgxPcgoTxYjhrcfJRw9ULch71SS4G+Q3bOXFhRvPqjguN0Hyp5w==}- hasBin: true+ '@typescript/[email protected]':+ resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==}+ engines: {node: '>=16.20.0'}+ cpu: [ppc64]+ os: [aix]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==}+ engines: {node: '>=16.20.0'}+ cpu: [arm64]+ os: [darwin]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==}+ engines: {node: '>=16.20.0'}+ cpu: [x64]+ os: [darwin]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==}+ engines: {node: '>=16.20.0'}+ cpu: [arm64]+ os: [freebsd]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==}+ engines: {node: '>=16.20.0'}+ cpu: [x64]+ os: [freebsd]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==}+ engines: {node: '>=16.20.0'}+ cpu: [arm64]+ os: [linux]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==}+ engines: {node: '>=16.20.0'}+ cpu: [arm]+ os: [linux]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==}+ engines: {node: '>=16.20.0'}+ cpu: [loong64]+ os: [linux]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==}+ engines: {node: '>=16.20.0'}+ cpu: [mips64el]+ os: [linux]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==}+ engines: {node: '>=16.20.0'}+ cpu: [ppc64]+ os: [linux]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==}+ engines: {node: '>=16.20.0'}+ cpu: [riscv64]+ os: [linux]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==}+ engines: {node: '>=16.20.0'}+ cpu: [s390x]+ os: [linux]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==}+ engines: {node: '>=16.20.0'}+ cpu: [x64]+ os: [linux]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==}+ engines: {node: '>=16.20.0'}+ cpu: [arm64]+ os: [netbsd]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==}+ engines: {node: '>=16.20.0'}+ cpu: [x64]+ os: [netbsd]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==}+ engines: {node: '>=16.20.0'}+ cpu: [arm64]+ os: [openbsd]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==}+ engines: {node: '>=16.20.0'}+ cpu: [x64]+ os: [openbsd]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==}+ engines: {node: '>=16.20.0'}+ cpu: [x64]+ os: [sunos]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==}+ engines: {node: '>=16.20.0'}+ cpu: [arm64]+ os: [win32]++ '@typescript/[email protected]':+ resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==}+ engines: {node: '>=16.20.0'}+ cpu: [x64]+ os: [win32]'@ungap/[email protected]':resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==}@@ -10124,8 +10305,8 @@ packages:resolution: {integrity: sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==}engines: {node: '>=18.0.0'}- resolution: {integrity: sha512-Cxl6MKxB1dr1H0FHmiizJ+lavKF7pV+fcDZFyqMB8d5m7qUPm/OtZYcD5vPWePKxSnTQ57KuBd9mtdZ3oNCvyQ==}+ resolution: {integrity: sha512-ge98qjkRK4IB7tL7Ju/6qmm5LHoH1eEMt5FNZrz3f4UIYhF28lggX20z3FaX1sgc67msLEn0N0BscOs29iuwyw==}engines: {node: '>=22'}@@ -10517,6 +10698,11 @@ packages:resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==}+ resolution: {integrity: sha512-U7veizMqxyKlM58+Z5j2ngJBH/r9siDmxpvNxSw0PylF6WQvrASJEZrxh1hidRBJc2jqoBVSyOban5u8m+6Rxg==}+ peerDependencies:+ csstype: ^3.0.10+resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}engines: {node: '>= 0.4'}@@ -12096,8 +12282,8 @@ packages:typescript:optional: true- resolution: {integrity: sha512-2som5AVXb3kE6Yjine3/mNbBayYF58eguBWIVVUdr1y/L426xyVEgYxgBG+1QC34P2x5E+tcDup6XkuOAX3dCA==}+ resolution: {integrity: sha512-ruev+K1No0Cm/05hSrgKLtzaBdUIT+2I/Bj8x+K8/vk3j/dW+9YJOqGdDEkqNBOXtQlLxuEgeTH71jgsKTfWiQ==}engines: {node: '>=20.9.0'}hasBin: truepeerDependencies:@@ -13104,8 +13290,8 @@ packages:peerDependencies:postcss: ^8.4.31- resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==}+ resolution: {integrity: sha512-pMMHxBOZKFU6HgAZ4eyGnwXF/EvPGGqUr0MnZ5+99485wwW41kW91A4LOGxSHhgugZmSChL5AlElNdwlNgcnLQ==}engines: {node: ^10 || ^12 || >=14}@@ -13876,6 +14062,11 @@ packages:engines: {node: '>=10'}hasBin: true+ resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==}+ engines: {node: '>=10'}+ hasBin: true+resolution: {integrity: sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==}engines: {node: '>= 0.8.0'}@@ -13887,6 +14078,16 @@ packages:resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==}+ resolution: {integrity: sha512-HXuLAX2pu/UByPpaeo/TaMfvMIi+1QqIoPJYCcAtU8QkVNwgR6MPlGuCQTErV1JwraaMbYaWVIBX7mppzGLATQ==}+ engines: {node: '>=10'}+ peerDependencies:+ seroval: ^1.0++ resolution: {integrity: sha512-rVQVWjjSvlINzaQPZH5JFqsqEsIWdTxY3iJZCnTL/5gQbXIRooVZKI60tVCkOVfzcRPejboxO2t0P89dg5mQaA==}+ engines: {node: '>=10'}+resolution: {integrity: sha512-CinAq1xWb0vR3twAv9evEU8cNWkXCb9kd5ePAHUKJBkOsUpR1wt/CvGdeca7vqumL1U5cSaeVQ6zZMxiJ3yWsg==}@@ -13925,9 +14126,14 @@ packages:resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==}- resolution: {integrity: sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==}- engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}+ resolution: {integrity: sha512-ej0zVHuZGHCiABXcNxeYhpRnPNPAcvbG8RMdBAhDAxLKkCRVSpK3Iyu7qbqw3JMzoj0REeM6f3tJLtVwl0023Q==}+ engines: {node: '>=20.9.0'}+ peerDependencies:+ '@types/node': '*'+ peerDependenciesMeta:+ '@types/node':+ optional: trueresolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}@@ -14022,6 +14228,9 @@ packages:resolution: {integrity: sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==}engines: {node: '>= 10.0.0', npm: '>= 3.0.0'}+ resolution: {integrity: sha512-sAEXC0Kk0S1EDg+8ysEWJDbYhA3RRoEjwuySUGlKIemeo0I5YZfOyumNjNs9Sv3y2nmhD+0rW66ag2HsMuQiGQ==}+resolution: {integrity: sha512-w6AxtubXa2wTXAUsZMMWERrsIRAdrK0Sc+FUytWvYAhBJLyuI4llrMIC1DtlNSdI99EI86KZum2MMq3EAZlF9Q==}@@ -14657,9 +14866,9 @@ packages:resolution: {integrity: sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==}- resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==}- engines: {node: '>=14.17'}+ resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==}+ engines: {node: '>=16.20.0'}hasBin: true@@ -15323,8 +15532,8 @@ packages:resolution: {integrity: sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==}engines: {node: '>=18'}- resolution: {integrity: sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==}+ resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==}engines: {node: '>=18'}@@ -15395,12 +15604,12 @@ snapshots:dependencies:json-schema: 0.4.0dependencies:'@ai-sdk/provider-utils': 4.0.5([email protected])ai: 6.0.33([email protected])- swrv: 1.2.0([email protected](@typescript/[email protected]))- vue: 3.5.35(@typescript/[email protected])+ swrv: 1.2.0([email protected]([email protected]))+ vue: 3.5.35([email protected])transitivePeerDependencies:- zod@@ -17019,7 +17228,7 @@ snapshots:- uglify-js- webpack-cli- '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])':dependencies:'@babel/core': 7.29.0([email protected])'@docusaurus/babel': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])@@ -17038,7 +17247,7 @@ snapshots:mini-css-extract-plugin: 2.10.2([email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))null-loader: 4.0.1([email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))postcss: 8.5.16- postcss-loader: 7.3.4(@typescript/[email protected])([email protected])([email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))+ postcss-loader: 7.3.4([email protected])([email protected])([email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))postcss-preset-env: 10.6.1([email protected])terser-webpack-plugin: 5.6.0(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))tslib: 2.8.1@@ -17046,7 +17255,7 @@ snapshots:webpack: 5.107.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])webpackbar: 7.0.0(@rspack/[email protected])([email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))optionalDependencies:- '@docusaurus/faster': 3.10.1(@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/faster': 3.10.1(@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])transitivePeerDependencies:- '@minify-html/node'- '@parcel/css'@@ -17064,10 +17273,10 @@ snapshots:- uglify-js- webpack-cli- '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])':dependencies:'@docusaurus/babel': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/bundler': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/bundler': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/logger': 3.10.1'@docusaurus/mdx-loader': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])@@ -17112,7 +17321,7 @@ snapshots:webpack-dev-server: 5.2.4([email protected]([email protected]))([email protected])([email protected])([email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))webpack-merge: 6.0.1optionalDependencies:- '@docusaurus/faster': 3.10.1(@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/faster': 3.10.1(@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])transitivePeerDependencies:- '@minify-html/node'- '@parcel/css'@@ -17142,10 +17351,10 @@ snapshots:postcss-sort-media-queries: 5.2.0([email protected])tslib: 2.8.1- '@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])':+ '@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])':dependencies:'@docusaurus/types': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@rspack/core': 1.7.11(@swc/[email protected])+ '@rspack/core': 1.7.11'@swc/core': 1.15.3'@swc/html': 1.15.40browserslist: 4.28.2@@ -17243,13 +17452,13 @@ snapshots:- uglify-js- webpack-cli- '@docusaurus/[email protected](c336c9d98c1f4baf3a75901518d97959)':+ '@docusaurus/[email protected](61e2dfd21fb4d409e7bca036dfc2b268)':dependencies:- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/logger': 3.10.1'@docusaurus/mdx-loader': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/plugin-content-docs': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/theme-common': 3.10.1(693648dca07bcb0a42a6196192ee56b1)+ '@docusaurus/plugin-content-docs': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/theme-common': 3.10.1(76621e8bff6c45bac3fc2219e99bbda8)'@docusaurus/types': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils-common': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])@@ -17291,13 +17500,13 @@ snapshots:- utf-8-validate- webpack-cli- '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])':dependencies:- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/logger': 3.10.1'@docusaurus/mdx-loader': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/module-type-aliases': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/theme-common': 3.10.1(693648dca07bcb0a42a6196192ee56b1)+ '@docusaurus/theme-common': 3.10.1(76621e8bff6c45bac3fc2219e99bbda8)'@docusaurus/types': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils-common': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])@@ -17337,9 +17546,9 @@ snapshots:- utf-8-validate- webpack-cli- '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])':dependencies:- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/mdx-loader': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/types': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])@@ -17373,9 +17582,9 @@ snapshots:- utf-8-validate- webpack-cli- '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])':dependencies:- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/types': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils-validation': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])@@ -17406,9 +17615,9 @@ snapshots:- utf-8-validate- webpack-cli- '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])':dependencies:- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/types': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])fs-extra: 11.2.0@@ -17440,9 +17649,9 @@ snapshots:- utf-8-validate- webpack-cli- '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])':dependencies:- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/types': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils-validation': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])react: 19.2.7@@ -17472,9 +17681,9 @@ snapshots:- utf-8-validate- webpack-cli- '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])':dependencies:- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/types': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils-validation': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@types/gtag.js': 0.0.20@@ -17505,9 +17714,9 @@ snapshots:- utf-8-validate- webpack-cli- '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])':dependencies:- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/types': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils-validation': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])react: 19.2.7@@ -17537,9 +17746,9 @@ snapshots:- utf-8-validate- webpack-cli- '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])':dependencies:- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/logger': 3.10.1'@docusaurus/types': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])@@ -17574,14 +17783,14 @@ snapshots:- utf-8-validate- webpack-cli- '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])':dependencies:- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/types': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils-validation': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@svgr/core': 8.1.0(@typescript/[email protected])([email protected])- '@svgr/webpack': 8.1.0(@typescript/[email protected])([email protected])+ '@svgr/core': 8.1.0([email protected])([email protected])+ '@svgr/webpack': 8.1.0([email protected])([email protected])react: 19.2.7react-dom: 19.2.7([email protected])tslib: 2.8.1@@ -17610,22 +17819,22 @@ snapshots:- utf-8-validate- webpack-cli- '@docusaurus/[email protected](@algolia/[email protected])(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])':- dependencies:- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/plugin-content-blog': 3.10.1(c336c9d98c1f4baf3a75901518d97959)- '@docusaurus/plugin-content-docs': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/plugin-content-pages': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/plugin-css-cascade-layers': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/plugin-debug': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/plugin-google-analytics': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/plugin-google-gtag': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/plugin-google-tag-manager': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/plugin-sitemap': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/plugin-svgr': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/theme-classic': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/theme-common': 3.10.1(693648dca07bcb0a42a6196192ee56b1)- '@docusaurus/theme-search-algolia': 3.10.1(@algolia/[email protected])(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/[email protected](@algolia/[email protected])(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])':+ dependencies:+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/plugin-content-blog': 3.10.1(61e2dfd21fb4d409e7bca036dfc2b268)+ '@docusaurus/plugin-content-docs': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/plugin-content-pages': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/plugin-css-cascade-layers': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/plugin-debug': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/plugin-google-analytics': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/plugin-google-gtag': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/plugin-google-tag-manager': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/plugin-sitemap': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/plugin-svgr': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/theme-classic': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/theme-common': 3.10.1(76621e8bff6c45bac3fc2219e99bbda8)+ '@docusaurus/theme-search-algolia': 3.10.1(@algolia/[email protected])(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])'@docusaurus/types': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])react: 19.2.7react-dom: 19.2.7([email protected])@@ -17661,16 +17870,16 @@ snapshots:'@types/react': 19.2.17react: 19.2.7- '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])':dependencies:- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/logger': 3.10.1'@docusaurus/mdx-loader': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/module-type-aliases': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/plugin-content-blog': 3.10.1(c336c9d98c1f4baf3a75901518d97959)- '@docusaurus/plugin-content-docs': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/plugin-content-pages': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/theme-common': 3.10.1(693648dca07bcb0a42a6196192ee56b1)+ '@docusaurus/plugin-content-blog': 3.10.1(61e2dfd21fb4d409e7bca036dfc2b268)+ '@docusaurus/plugin-content-docs': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/plugin-content-pages': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/theme-common': 3.10.1(76621e8bff6c45bac3fc2219e99bbda8)'@docusaurus/theme-translations': 3.10.1'@docusaurus/types': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])@@ -17714,11 +17923,11 @@ snapshots:- utf-8-validate- webpack-cli- '@docusaurus/[email protected](693648dca07bcb0a42a6196192ee56b1)':+ '@docusaurus/[email protected](76621e8bff6c45bac3fc2219e99bbda8)':dependencies:'@docusaurus/mdx-loader': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/module-type-aliases': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/plugin-content-docs': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/plugin-content-docs': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/utils': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils-common': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@types/history': 4.7.11@@ -17747,11 +17956,11 @@ snapshots:- uglify-js- webpack-cli- '@docusaurus/[email protected](c336c9d98c1f4baf3a75901518d97959)':+ '@docusaurus/[email protected](61e2dfd21fb4d409e7bca036dfc2b268)':dependencies:- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/module-type-aliases': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/theme-common': 3.10.1(693648dca07bcb0a42a6196192ee56b1)+ '@docusaurus/theme-common': 3.10.1(76621e8bff6c45bac3fc2219e99bbda8)'@docusaurus/types': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils-validation': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])mermaid: 11.15.0@@ -17783,14 +17992,14 @@ snapshots:- utf-8-validate- webpack-cli- '@docusaurus/[email protected](@algolia/[email protected])(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])':+ '@docusaurus/[email protected](@algolia/[email protected])(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])':dependencies:'@algolia/autocomplete-core': 1.19.8(@algolia/[email protected])([email protected])([email protected])'@docsearch/react': 4.6.3(@algolia/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])'@docusaurus/logger': 3.10.1- '@docusaurus/plugin-content-docs': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])- '@docusaurus/theme-common': 3.10.1(693648dca07bcb0a42a6196192ee56b1)+ '@docusaurus/plugin-content-docs': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])+ '@docusaurus/theme-common': 3.10.1(76621e8bff6c45bac3fc2219e99bbda8)'@docusaurus/theme-translations': 3.10.1'@docusaurus/utils': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@docusaurus/utils-validation': 3.10.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])@@ -18370,20 +18579,20 @@ snapshots:'@floating-ui/[email protected]': {}dependencies:'@floating-ui/dom': 1.7.6'@floating-ui/utils': 0.2.11- vue-demi: 0.14.10([email protected](@typescript/[email protected]))+ vue-demi: 0.14.10([email protected]([email protected]))transitivePeerDependencies:- '@vue/composition-api'- vuedependencies:'@floating-ui/dom': 1.7.6'@floating-ui/utils': 0.2.11- vue-demi: 0.14.10([email protected](@typescript/[email protected]))+ vue-demi: 0.14.10([email protected]([email protected]))transitivePeerDependencies:- '@vue/composition-api'- vue@@ -18452,10 +18661,10 @@ snapshots:dependencies:tailwindcss: 4.3.2dependencies:- '@tanstack/vue-virtual': 3.13.28([email protected](@typescript/[email protected]))- vue: 3.5.35(@typescript/[email protected])+ '@tanstack/vue-virtual': 3.13.28([email protected]([email protected]))+ vue: 3.5.35([email protected])'@homarr/[email protected]': {}@@ -18484,101 +18693,111 @@ snapshots:'@iconify/types': 2.0.0import-meta-resolve: 4.2.0- '@img/[email protected]':+ '@img/[email protected]':optional: true- '@img/[email protected]':+ '@img/[email protected]':optionalDependencies:- '@img/sharp-libvips-darwin-arm64': 1.2.4+ '@img/sharp-libvips-darwin-arm64': 1.3.2optional: true- '@img/[email protected]':+ '@img/[email protected]':optionalDependencies:- '@img/sharp-libvips-darwin-x64': 1.2.4+ '@img/sharp-libvips-darwin-x64': 1.3.2optional: true- '@img/[email protected]':+ '@img/[email protected]':+ dependencies:+ '@img/sharp-wasm32': 0.35.3optional: true- '@img/[email protected]':+ '@img/[email protected]':optional: true- '@img/[email protected]':+ '@img/[email protected]':optional: true- '@img/[email protected]':+ '@img/[email protected]':optional: true- '@img/[email protected]':+ '@img/[email protected]':optional: true- '@img/[email protected]':+ '@img/[email protected]':optional: true- '@img/[email protected]':+ '@img/[email protected]':optional: true- '@img/[email protected]':+ '@img/[email protected]':optional: true- '@img/[email protected]':+ '@img/[email protected]':optional: true- '@img/[email protected]':+ '@img/[email protected]':optional: true- '@img/[email protected]':+ '@img/[email protected]':+ optional: true++ '@img/[email protected]':optionalDependencies:- '@img/sharp-libvips-linux-arm64': 1.2.4+ '@img/sharp-libvips-linux-arm64': 1.3.2optional: true- '@img/[email protected]':+ '@img/[email protected]':optionalDependencies:- '@img/sharp-libvips-linux-arm': 1.2.4+ '@img/sharp-libvips-linux-arm': 1.3.2optional: true- '@img/[email protected]':+ '@img/[email protected]':optionalDependencies:- '@img/sharp-libvips-linux-ppc64': 1.2.4+ '@img/sharp-libvips-linux-ppc64': 1.3.2optional: true- '@img/[email protected]':+ '@img/[email protected]':optionalDependencies:- '@img/sharp-libvips-linux-riscv64': 1.2.4+ '@img/sharp-libvips-linux-riscv64': 1.3.2optional: true- '@img/[email protected]':+ '@img/[email protected]':optionalDependencies:- '@img/sharp-libvips-linux-s390x': 1.2.4+ '@img/sharp-libvips-linux-s390x': 1.3.2optional: true- '@img/[email protected]':+ '@img/[email protected]':optionalDependencies:- '@img/sharp-libvips-linux-x64': 1.2.4+ '@img/sharp-libvips-linux-x64': 1.3.2optional: true- '@img/[email protected]':+ '@img/[email protected]':optionalDependencies:- '@img/sharp-libvips-linuxmusl-arm64': 1.2.4+ '@img/sharp-libvips-linuxmusl-arm64': 1.3.2optional: true- '@img/[email protected]':+ '@img/[email protected]':optionalDependencies:- '@img/sharp-libvips-linuxmusl-x64': 1.2.4+ '@img/sharp-libvips-linuxmusl-x64': 1.3.2optional: true- '@img/[email protected]':+ '@img/[email protected]':dependencies:'@emnapi/runtime': 1.11.1optional: true- '@img/[email protected]':+ '@img/[email protected]':+ dependencies:+ '@img/sharp-wasm32': 0.35.3+ optional: true++ '@img/[email protected]':optional: true- '@img/[email protected]':+ '@img/[email protected]':optional: true- '@img/[email protected]':+ '@img/[email protected]':optional: true'@immich/[email protected]':@@ -19256,30 +19475,30 @@ snapshots:'@tybys/wasm-util': 0.10.3optional: true- '@next/[email protected]': {}+ '@next/[email protected]': {}- '@next/[email protected]':+ '@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true- '@next/[email protected]':+ '@next/[email protected]':optional: true@@ -20120,39 +20339,37 @@ snapshots:'@rspack/binding-win32-ia32-msvc': 1.7.11'@rspack/binding-win32-x64-msvc': 1.7.11- '@rspack/[email protected](@swc/[email protected])':+ '@rspack/[email protected]':dependencies:'@module-federation/runtime-tools': 0.22.0'@rspack/binding': 1.7.11'@rspack/lite-tapable': 1.1.0- optionalDependencies:- '@swc/helpers': 0.5.15'@rspack/[email protected]': {}'@rvf/[email protected]': {}- '@scalar/[email protected](@typescript/[email protected])([email protected])([email protected])([email protected])([email protected])':+ '@scalar/[email protected]([email protected])([email protected])([email protected])([email protected])([email protected])':dependencies:- '@scalar/api-client': 3.13.3(@typescript/[email protected])([email protected])([email protected])([email protected])+ '@scalar/api-client': 3.13.3([email protected])([email protected])([email protected])([email protected])'@scalar/helpers': 0.9.0- '@scalar/icons': 0.7.3(@typescript/[email protected])+ '@scalar/icons': 0.7.3([email protected])'@scalar/json-magic': 0.12.17'@scalar/openapi-types': 0.9.1'@scalar/schemas': 0.7.2'@scalar/themes': 0.16.2'@scalar/types': 0.16.2- '@scalar/use-toasts': 0.10.2(@typescript/[email protected])+ '@scalar/use-toasts': 0.10.2([email protected])'@scalar/validation': 0.6.0- '@scalar/workspace-store': 0.55.3(@typescript/[email protected])- '@vueuse/core': 13.9.0([email protected](@typescript/[email protected]))+ '@scalar/workspace-store': 0.55.3([email protected])+ '@vueuse/core': 13.9.0([email protected]([email protected]))ai: 6.0.33([email protected])js-base64: 3.7.8neverpanic: 0.0.8truncate-json: 3.0.1- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])transitivePeerDependencies:- '@vue/composition-api'- async-validator@@ -20170,36 +20387,36 @@ snapshots:- universal-cookie- zod- '@scalar/[email protected](@typescript/[email protected])([email protected])([email protected])([email protected])':+ '@scalar/[email protected]([email protected])([email protected])([email protected])([email protected])':dependencies:'@headlessui/tailwindcss': 0.2.2([email protected])- '@headlessui/vue': 1.7.23([email protected](@typescript/[email protected]))+ '@headlessui/vue': 1.7.23([email protected]([email protected]))'@scalar/helpers': 0.9.0- '@scalar/icons': 0.7.3(@typescript/[email protected])- '@scalar/oas-utils': 0.19.4(@typescript/[email protected])+ '@scalar/icons': 0.7.3([email protected])+ '@scalar/oas-utils': 0.19.4([email protected])'@scalar/openapi-types': 0.9.1'@scalar/snippetz': 0.9.21'@scalar/themes': 0.16.2'@scalar/typebox': 0.1.3'@scalar/types': 0.16.2- '@scalar/use-codemirror': 0.14.12(@typescript/[email protected])- '@scalar/use-hooks': 0.4.7(@typescript/[email protected])- '@scalar/use-toasts': 0.10.2(@typescript/[email protected])- '@scalar/workspace-store': 0.55.3(@typescript/[email protected])- '@vueuse/core': 13.9.0([email protected](@typescript/[email protected]))- '@vueuse/integrations': 13.9.0([email protected])([email protected])([email protected])([email protected](@typescript/[email protected]))+ '@scalar/use-codemirror': 0.14.12([email protected])+ '@scalar/use-hooks': 0.4.7([email protected])+ '@scalar/use-toasts': 0.10.2([email protected])+ '@scalar/workspace-store': 0.55.3([email protected])+ '@vueuse/core': 13.9.0([email protected]([email protected]))+ '@vueuse/integrations': 13.9.0([email protected])([email protected])([email protected])([email protected]([email protected]))focus-trap: 7.8.0fuse.js: 7.4.2js-base64: 3.7.8jsonc-parser: 3.3.1nanoid: 5.1.16pretty-ms: 9.3.0- radix-vue: 1.9.17([email protected](@typescript/[email protected]))+ radix-vue: 1.9.17([email protected]([email protected]))set-cookie-parser: 3.1.0- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])yaml: 2.9.0zod: 4.4.3transitivePeerDependencies:@@ -20218,9 +20435,9 @@ snapshots:- typescript- universal-cookie- '@scalar/[email protected](@typescript/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])':+ '@scalar/[email protected]([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])':dependencies:- '@scalar/api-reference': 1.62.5(@typescript/[email protected])([email protected])([email protected])([email protected])([email protected])+ '@scalar/api-reference': 1.62.5([email protected])([email protected])([email protected])([email protected])([email protected])'@scalar/types': 0.16.2react: 19.2.7transitivePeerDependencies:@@ -20240,32 +20457,32 @@ snapshots:- universal-cookie- zod- '@scalar/[email protected](@typescript/[email protected])([email protected])([email protected])([email protected])([email protected])':+ '@scalar/[email protected]([email protected])([email protected])([email protected])([email protected])([email protected])':dependencies:- '@headlessui/vue': 1.7.23([email protected](@typescript/[email protected]))- '@scalar/agent-chat': 0.12.18(@typescript/[email protected])([email protected])([email protected])([email protected])([email protected])- '@scalar/api-client': 3.13.3(@typescript/[email protected])([email protected])([email protected])([email protected])+ '@headlessui/vue': 1.7.23([email protected]([email protected]))+ '@scalar/agent-chat': 0.12.18([email protected])([email protected])([email protected])([email protected])([email protected])+ '@scalar/api-client': 3.13.3([email protected])([email protected])([email protected])([email protected])'@scalar/code-highlight': 0.4.1([email protected])'@scalar/helpers': 0.9.0- '@scalar/icons': 0.7.3(@typescript/[email protected])- '@scalar/oas-utils': 0.19.4(@typescript/[email protected])+ '@scalar/icons': 0.7.3([email protected])+ '@scalar/oas-utils': 0.19.4([email protected])'@scalar/schemas': 0.7.2'@scalar/snippetz': 0.9.21'@scalar/themes': 0.16.2'@scalar/types': 0.16.2- '@scalar/use-hooks': 0.4.7(@typescript/[email protected])- '@scalar/use-toasts': 0.10.2(@typescript/[email protected])+ '@scalar/use-hooks': 0.4.7([email protected])+ '@scalar/use-toasts': 0.10.2([email protected])'@scalar/validation': 0.6.0- '@scalar/workspace-store': 0.55.3(@typescript/[email protected])- '@unhead/vue': 2.1.15([email protected](@typescript/[email protected]))- '@vueuse/core': 13.9.0([email protected](@typescript/[email protected]))+ '@scalar/workspace-store': 0.55.3([email protected])+ '@unhead/vue': 2.1.15([email protected]([email protected]))+ '@vueuse/core': 13.9.0([email protected]([email protected]))fuse.js: 7.4.2microdiff: 1.5.0nanoid: 5.1.16- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])yaml: 2.9.0transitivePeerDependencies:- '@vue/composition-api'@@ -20288,18 +20505,18 @@ snapshots:dependencies:'@scalar/helpers': 0.9.0dependencies:'@scalar/helpers': 0.9.0- '@scalar/icons': 0.7.3(@typescript/[email protected])+ '@scalar/icons': 0.7.3([email protected])'@scalar/snippetz': 0.9.21'@scalar/themes': 0.16.2'@scalar/types': 0.16.2- '@scalar/workspace-store': 0.55.3(@typescript/[email protected])+ '@scalar/workspace-store': 0.55.3([email protected])'@types/har-format': 1.2.16js-base64: 3.7.8- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])transitivePeerDependencies:- '@vue/composition-api'- supports-color@@ -20326,21 +20543,21 @@ snapshots:transitivePeerDependencies:- supports-colordependencies:'@floating-ui/utils': 0.2.10- '@floating-ui/vue': 1.1.9([email protected](@typescript/[email protected]))+ '@floating-ui/vue': 1.1.9([email protected]([email protected]))'@headlessui/tailwindcss': 0.2.2([email protected])- '@headlessui/vue': 1.7.23([email protected](@typescript/[email protected]))+ '@headlessui/vue': 1.7.23([email protected]([email protected]))'@scalar/code-highlight': 0.4.1([email protected])'@scalar/helpers': 0.9.0- '@scalar/icons': 0.7.3(@typescript/[email protected])+ '@scalar/icons': 0.7.3([email protected])'@scalar/themes': 0.16.2- '@scalar/use-hooks': 0.4.7(@typescript/[email protected])- '@vueuse/core': 13.9.0([email protected](@typescript/[email protected]))- cva: 1.0.0-beta.4(@typescript/[email protected])- radix-vue: 1.9.17([email protected](@typescript/[email protected]))- vue: 3.5.35(@typescript/[email protected])+ '@scalar/use-hooks': 0.4.7([email protected])+ '@vueuse/core': 13.9.0([email protected]([email protected]))+ cva: 1.0.0-beta.4([email protected])+ radix-vue: 1.9.17([email protected]([email protected]))+ vue: 3.5.35([email protected])vue-component-type-helpers: 3.3.4transitivePeerDependencies:- '@vue/composition-api'@@ -20350,12 +20567,12 @@ snapshots:'@scalar/[email protected]': {}- '@scalar/[email protected](@typescript/[email protected])':+ '@scalar/[email protected]([email protected])':dependencies:'@phosphor-icons/core': 2.1.1'@types/node': 24.13.2chalk: 5.6.2- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])transitivePeerDependencies:- typescript@@ -20365,14 +20582,14 @@ snapshots:pathe: 2.0.3yaml: 2.9.0- '@scalar/[email protected](@typescript/[email protected])':+ '@scalar/[email protected]([email protected])':dependencies:'@scalar/helpers': 0.9.0'@scalar/themes': 0.16.2'@scalar/types': 0.16.2- '@scalar/workspace-store': 0.55.3(@typescript/[email protected])+ '@scalar/workspace-store': 0.55.3([email protected])flatted: 3.4.2- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])yaml: 2.9.0transitivePeerDependencies:- typescript@@ -20388,15 +20605,15 @@ snapshots:'@scalar/helpers': 0.9.0'@scalar/validation': 0.6.0dependencies:'@scalar/helpers': 0.9.0- '@scalar/icons': 0.7.3(@typescript/[email protected])+ '@scalar/icons': 0.7.3([email protected])'@scalar/themes': 0.16.2- '@scalar/use-hooks': 0.4.7(@typescript/[email protected])- '@scalar/workspace-store': 0.55.3(@typescript/[email protected])- vue: 3.5.35(@typescript/[email protected])+ '@scalar/use-hooks': 0.4.7([email protected])+ '@scalar/workspace-store': 0.55.3([email protected])+ vue: 3.5.35([email protected])transitivePeerDependencies:- '@vue/composition-api'- supports-color@@ -20423,7 +20640,7 @@ snapshots:type-fest: 5.7.0zod: 4.4.3- '@scalar/[email protected](@typescript/[email protected])':+ '@scalar/[email protected]([email protected])':dependencies:'@codemirror/autocomplete': 6.20.3'@codemirror/commands': 6.10.3@@ -20439,31 +20656,31 @@ snapshots:'@lezer/common': 1.5.2'@lezer/highlight': 1.2.3'@replit/codemirror-css-color-picker': 6.3.0(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])transitivePeerDependencies:- typescript- '@scalar/[email protected](@typescript/[email protected])':+ '@scalar/[email protected]([email protected])':dependencies:- '@scalar/use-toasts': 0.10.2(@typescript/[email protected])+ '@scalar/use-toasts': 0.10.2([email protected])'@scalar/validation': 0.6.0- '@vueuse/core': 13.9.0([email protected](@typescript/[email protected]))- cva: 1.0.0-beta.4(@typescript/[email protected])+ '@vueuse/core': 13.9.0([email protected]([email protected]))+ cva: 1.0.0-beta.4([email protected])tailwind-merge: 3.5.0- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])transitivePeerDependencies:- typescript- '@scalar/[email protected](@typescript/[email protected])':+ '@scalar/[email protected]([email protected])':dependencies:- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])vue-sonner: 1.3.2transitivePeerDependencies:- typescript'@scalar/[email protected]': {}- '@scalar/[email protected](@typescript/[email protected])':+ '@scalar/[email protected]([email protected])':dependencies:'@scalar/asyncapi-upgrader': 0.1.2'@scalar/helpers': 0.9.0@@ -20476,7 +20693,7 @@ snapshots:'@scalar/validation': 0.6.0js-base64: 3.7.8type-fest: 5.7.0- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])yaml: 2.9.0transitivePeerDependencies:- typescript@@ -20485,14 +20702,14 @@ snapshots:'@sec-ant/[email protected]': {}- '@semantic-release/[email protected]([email protected](@typescript/[email protected])([email protected]))':dependencies:'@semantic-release/error': 4.0.0aggregate-error: 5.0.0lodash-es: 4.17.21- semantic-release: 25.0.5(@typescript/[email protected])([email protected])+ semantic-release: 25.0.5([email protected])([email protected])- '@semantic-release/[email protected]([email protected](@typescript/[email protected])([email protected]))([email protected])':+ '@semantic-release/[email protected]([email protected]([email protected])([email protected]))([email protected])':dependencies:conventional-changelog-angular: 8.0.0conventional-changelog-writer: 8.0.0@@ -20502,27 +20719,27 @@ snapshots:import-from-esm: 2.0.0([email protected])lodash-es: 4.17.21micromatch: 4.0.8- semantic-release: 25.0.5(@typescript/[email protected])([email protected])+ semantic-release: 25.0.5([email protected])([email protected])transitivePeerDependencies:- supports-color'@semantic-release/[email protected]': {}- '@semantic-release/[email protected]([email protected](@typescript/[email protected])([email protected]))([email protected])':+ '@semantic-release/[email protected]([email protected]([email protected])([email protected]))([email protected])':dependencies:'@semantic-release/error': 4.0.0aggregate-error: 5.0.0debug: 4.4.3([email protected])dir-glob: 3.0.1- execa: 10.0.0+ execa: 10.0.1lodash-es: 4.17.21micromatch: 4.0.8p-reduce: 3.0.0- semantic-release: 25.0.5(@typescript/[email protected])([email protected])+ semantic-release: 25.0.5([email protected])([email protected])transitivePeerDependencies:- supports-color- '@semantic-release/[email protected]([email protected](@typescript/[email protected])([email protected]))([email protected])':+ '@semantic-release/[email protected]([email protected]([email protected])([email protected]))([email protected])':dependencies:'@octokit/core': 7.0.6'@octokit/plugin-paginate-rest': 14.0.0(@octokit/[email protected])@@ -20538,14 +20755,14 @@ snapshots:lodash-es: 4.17.21mime: 4.0.4p-filter: 4.1.0- semantic-release: 25.0.5(@typescript/[email protected])([email protected])+ semantic-release: 25.0.5([email protected])([email protected])tinyglobby: 0.2.17undici: 7.28.0url-join: 5.0.0transitivePeerDependencies:- supports-color- '@semantic-release/[email protected]([email protected](@typescript/[email protected])([email protected]))':dependencies:'@actions/core': 3.0.0'@semantic-release/error': 4.0.0@@ -20560,11 +20777,11 @@ snapshots:rc: 1.2.8read-pkg: 10.0.0registry-auth-token: 5.0.2- semantic-release: 25.0.5(@typescript/[email protected])([email protected])+ semantic-release: 25.0.5([email protected])([email protected])semver: 7.7.4tempy: 3.1.0- '@semantic-release/[email protected]([email protected](@typescript/[email protected])([email protected]))([email protected])':+ '@semantic-release/[email protected]([email protected]([email protected])([email protected]))([email protected])':dependencies:conventional-changelog-angular: 8.0.0conventional-changelog-writer: 8.0.0@@ -20574,7 +20791,7 @@ snapshots:import-from-esm: 2.0.0([email protected])lodash-es: 4.17.21read-package-up: 11.0.0- semantic-release: 25.0.5(@typescript/[email protected])([email protected])+ semantic-release: 25.0.5([email protected])([email protected])transitivePeerDependencies:- supports-color@@ -20586,9 +20803,9 @@ snapshots:'@sideway/[email protected]': {}- '@signalwire/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])':+ '@signalwire/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]))([email protected])':dependencies:- '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/core': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@mdx-js/[email protected](@types/[email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])fs-extra: 11.2.0hast-util-select: 6.0.4hast-util-to-html: 9.0.5@@ -20633,6 +20850,40 @@ snapshots:color: 5.0.2text-hex: 1.0.0+ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/utils': 6.4.1([email protected])+ solid-js: 1.9.14++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/event-listener': 2.4.6([email protected])+ '@solid-primitives/rootless': 1.5.4([email protected])+ '@solid-primitives/utils': 6.4.1([email protected])+ solid-js: 1.9.14++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/event-listener': 2.4.6([email protected])+ '@solid-primitives/rootless': 1.5.4([email protected])+ '@solid-primitives/static-store': 0.1.4([email protected])+ '@solid-primitives/utils': 6.4.1([email protected])+ solid-js: 1.9.14++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/utils': 6.4.1([email protected])+ solid-js: 1.9.14++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/utils': 6.4.1([email protected])+ solid-js: 1.9.14++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ solid-js: 1.9.14+'@standard-schema/[email protected]': {}'@standard-schema/[email protected]': {}@@ -20681,12 +20932,12 @@ snapshots:'@svgr/babel-plugin-transform-react-native-svg': 8.1.0(@babel/[email protected]([email protected]))'@svgr/babel-plugin-transform-svg-component': 8.0.0(@babel/[email protected]([email protected]))dependencies:'@babel/core': 7.29.0([email protected])'@svgr/babel-preset': 8.1.0(@babel/[email protected]([email protected]))camelcase: 6.3.0- cosmiconfig: 8.3.6(@typescript/[email protected])+ cosmiconfig: 8.3.6([email protected])snake-case: 3.0.4transitivePeerDependencies:- supports-color@@ -20697,35 +20948,35 @@ snapshots:'@babel/types': 7.29.7entities: 4.5.0- '@svgr/[email protected](@svgr/[email protected](@typescript/[email protected])([email protected]))([email protected])':+ '@svgr/[email protected](@svgr/[email protected]([email protected])([email protected]))([email protected])':dependencies:'@babel/core': 7.29.0([email protected])'@svgr/babel-preset': 8.1.0(@babel/[email protected]([email protected]))- '@svgr/core': 8.1.0(@typescript/[email protected])([email protected])+ '@svgr/core': 8.1.0([email protected])([email protected])'@svgr/hast-util-to-babel-ast': 8.0.0svg-parser: 2.0.4transitivePeerDependencies:- supports-color- '@svgr/[email protected](@svgr/[email protected](@typescript/[email protected])([email protected]))(@typescript/[email protected])':+ '@svgr/[email protected](@svgr/[email protected]([email protected])([email protected]))([email protected])':dependencies:- '@svgr/core': 8.1.0(@typescript/[email protected])([email protected])- cosmiconfig: 8.3.6(@typescript/[email protected])+ '@svgr/core': 8.1.0([email protected])([email protected])+ cosmiconfig: 8.3.6([email protected])deepmerge: 4.3.1svgo: 3.3.3transitivePeerDependencies:- typescriptdependencies:'@babel/core': 7.29.0([email protected])'@babel/plugin-transform-react-constant-elements': 7.29.7(@babel/[email protected]([email protected]))- '@svgr/core': 8.1.0(@typescript/[email protected])([email protected])- '@svgr/plugin-jsx': 8.1.0(@svgr/[email protected](@typescript/[email protected])([email protected]))([email protected])- '@svgr/plugin-svgo': 8.1.0(@svgr/[email protected](@typescript/[email protected])([email protected]))(@typescript/[email protected])+ '@svgr/core': 8.1.0([email protected])([email protected])+ '@svgr/plugin-jsx': 8.1.0(@svgr/[email protected]([email protected])([email protected]))([email protected])+ '@svgr/plugin-svgo': 8.1.0(@svgr/[email protected]([email protected])([email protected]))([email protected])transitivePeerDependencies:- supports-color- typescript@@ -20843,18 +21094,18 @@ snapshots:dependencies:defer-to-connect: 2.0.1optionalDependencies:arktype: 2.1.20- typescript: '@typescript/[email protected]'+ typescript: 7.0.2zod: 4.4.3dependencies:optionalDependencies:arktype: 2.1.20- typescript: '@typescript/[email protected]'+ typescript: 7.0.2zod: 4.4.3'@tabler/[email protected]([email protected])':@@ -20933,22 +21184,64 @@ snapshots:postcss: 8.5.15tailwindcss: 4.3.2- '@tanstack/[email protected]':+ '@tanstack/[email protected]':dependencies:- remove-accents: 0.5.0+ '@tanstack/devtools-event-client': 0.5.0- '@tanstack/[email protected]':+ '@tanstack/[email protected]':dependencies:- '@tanstack/query-core': 5.101.2- '@tanstack/query-persist-client-core': 5.101.2+ ws: 8.21.0+ transitivePeerDependencies:+ - bufferutil+ - utf-8-validate++ '@tanstack/[email protected]': {}++ dependencies:+ clsx: 2.1.1+ dayjs: 1.11.21+ goober: 2.1.19([email protected])+ solid-js: 1.9.14+ transitivePeerDependencies:+ - csstype++ dependencies:+ '@solid-primitives/event-listener': 2.4.6([email protected])+ '@solid-primitives/keyboard': 1.3.7([email protected])+ '@solid-primitives/resize-observer': 2.2.0([email protected])+ '@tanstack/devtools-client': 0.0.8+ '@tanstack/devtools-event-bus': 0.4.2+ '@tanstack/devtools-ui': 0.6.0([email protected])([email protected])+ clsx: 2.1.1+ goober: 2.1.19([email protected])+ solid-js: 1.9.14+ transitivePeerDependencies:+ - bufferutil+ - csstype+ - utf-8-validate++ '@tanstack/[email protected]':+ dependencies:+ remove-accents: 0.5.0'@tanstack/[email protected]': {}'@tanstack/[email protected]': {}- '@tanstack/[email protected]':+ '@tanstack/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])':dependencies:- '@tanstack/query-core': 5.101.2+ '@tanstack/devtools': 0.13.0([email protected])([email protected])+ '@types/react': 19.2.17+ '@types/react-dom': 19.2.3(@types/[email protected])+ react: 19.2.7+ react-dom: 19.2.7([email protected])+ transitivePeerDependencies:+ - bufferutil+ - csstype+ - solid-js+ - utf-8-validatedependencies:@@ -20956,16 +21249,10 @@ snapshots:'@tanstack/react-query': 5.101.2([email protected])react: 19.2.7- '@tanstack/[email protected](@tanstack/[email protected]([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])':- dependencies:- '@tanstack/react-query': 5.101.2([email protected])- next: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])- react: 19.2.7-+ '@tanstack/[email protected](@tanstack/[email protected]([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])':dependencies:- '@tanstack/query-persist-client-core': 5.101.2'@tanstack/react-query': 5.101.2([email protected])+ next: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])react: 19.2.7'@tanstack/[email protected]([email protected])':@@ -20991,10 +21278,10 @@ snapshots:'@tanstack/[email protected]': {}dependencies:'@tanstack/virtual-core': 3.17.0- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])'@testcontainers/[email protected]([email protected])':dependencies:@@ -21238,42 +21525,42 @@ snapshots:'@tiptap/extensions': 3.27.3(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])'@tiptap/pm': 3.27.3- '@trpc/[email protected](@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])':dependencies:- '@trpc/server': 11.18.0(@typescript/[email protected])- typescript: '@typescript/[email protected]'+ '@trpc/server': 11.18.0([email protected])+ typescript: 7.0.2- '@trpc/[email protected](@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected]))(@trpc/[email protected](@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected]))(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])([email protected]))(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])':+ '@trpc/[email protected](@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected]([email protected]))([email protected]))(@trpc/[email protected](@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected]([email protected]))([email protected]))(@trpc/[email protected]([email protected]))([email protected])([email protected]))(@trpc/[email protected]([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])':dependencies:- '@trpc/client': 11.18.0(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])- '@trpc/server': 11.18.0(@typescript/[email protected])- next: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ '@trpc/server': 11.18.0([email protected])+ next: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])react: 19.2.7react-dom: 19.2.7([email protected])- typescript: '@typescript/[email protected]'+ typescript: 7.0.2optionalDependencies:'@tanstack/react-query': 5.101.2([email protected])- '@trpc/react-query': 11.18.0(@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected]))(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])([email protected])+ '@trpc/react-query': 11.18.0(@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected]([email protected]))([email protected]))(@trpc/[email protected]([email protected]))([email protected])([email protected])- '@trpc/[email protected](@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected]))(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])([email protected])':+ '@trpc/[email protected](@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected]([email protected]))([email protected]))(@trpc/[email protected]([email protected]))([email protected])([email protected])':dependencies:'@tanstack/react-query': 5.101.2([email protected])- '@trpc/client': 11.18.0(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])- '@trpc/server': 11.18.0(@typescript/[email protected])+ '@trpc/server': 11.18.0([email protected])react: 19.2.7- typescript: '@typescript/[email protected]'+ typescript: 7.0.2- '@trpc/[email protected](@typescript/[email protected])':+ '@trpc/[email protected]([email protected])':dependencies:- typescript: '@typescript/[email protected]'+ typescript: 7.0.2- '@trpc/[email protected](@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected]))(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])([email protected])':+ '@trpc/[email protected](@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected]([email protected]))([email protected]))(@trpc/[email protected]([email protected]))([email protected])([email protected])':dependencies:'@tanstack/react-query': 5.101.2([email protected])- '@trpc/client': 11.18.0(@trpc/[email protected](@typescript/[email protected]))(@typescript/[email protected])- '@trpc/server': 11.18.0(@typescript/[email protected])+ '@trpc/server': 11.18.0([email protected])react: 19.2.7- typescript: '@typescript/[email protected]'+ typescript: 7.0.2'@tsconfig/[email protected]': {}@@ -21725,17 +22012,73 @@ snapshots:dependencies:'@types/yargs-parser': 21.0.3- '@typescript/[email protected]':- dependencies:- '@typescript/old': [email protected]+ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true++ '@typescript/[email protected]':+ optional: true'@ungap/[email protected]': {}dependencies:hookable: 6.1.1unhead: 2.1.15- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])'@upsetjs/[email protected]':optionalDependencies:@@ -21771,10 +22114,10 @@ snapshots:global: 4.4.0is-function: 1.0.2- '@vitejs/[email protected]([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))':+ '@vitejs/[email protected]([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))':dependencies:'@rolldown/pluginutils': 1.0.1- vite: 8.1.4(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ vite: 8.1.4(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])optionalDependencies:babel-plugin-react-compiler: 1.0.0@@ -21790,7 +22133,7 @@ snapshots:obug: 2.1.1std-env: 4.0.0tinyrainbow: 3.1.0- vitest: 4.1.10(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])(@typescript/[email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))+ vitest: 4.1.10(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))'@vitest/[email protected]':dependencies:@@ -21801,14 +22144,24 @@ snapshots:chai: 6.2.2tinyrainbow: 3.1.0- '@vitest/[email protected]([email protected](@types/[email protected])(@typescript/[email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))':+ '@vitest/[email protected]([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))':dependencies:'@vitest/spy': 4.1.10estree-walker: 3.0.3magic-string: 0.30.21optionalDependencies:- msw: 2.14.6(@types/[email protected])(@typescript/[email protected])+ msw: 2.14.6(@types/[email protected])([email protected])+ vite: 8.1.4(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])++ '@vitest/[email protected]([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))':+ dependencies:+ '@vitest/spy': 4.1.10+ estree-walker: 3.0.3+ magic-string: 0.30.21+ optionalDependencies:+ msw: 2.14.6(@types/[email protected])([email protected])vite: 8.1.4(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ optional: true'@vitest/[email protected]':dependencies:@@ -21837,7 +22190,7 @@ snapshots:sirv: 3.0.2tinyglobby: 0.2.17tinyrainbow: 3.1.0- vitest: 4.1.10(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])(@typescript/[email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))+ vitest: 4.1.10(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))'@vitest/[email protected]':dependencies:@@ -21891,36 +22244,36 @@ snapshots:'@vue/shared': 3.5.35csstype: 3.2.3dependencies:'@vue/compiler-ssr': 3.5.35'@vue/shared': 3.5.35- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])'@vue/[email protected]': {}dependencies:'@types/web-bluetooth': 0.0.20'@vueuse/metadata': 10.11.1- '@vueuse/shared': 10.11.1([email protected](@typescript/[email protected]))- vue-demi: 0.14.10([email protected](@typescript/[email protected]))+ '@vueuse/shared': 10.11.1([email protected]([email protected]))+ vue-demi: 0.14.10([email protected]([email protected]))transitivePeerDependencies:- '@vue/composition-api'- vuedependencies:'@types/web-bluetooth': 0.0.21'@vueuse/metadata': 13.9.0- '@vueuse/shared': 13.9.0([email protected](@typescript/[email protected]))- vue: 3.5.35(@typescript/[email protected])+ '@vueuse/shared': 13.9.0([email protected]([email protected]))+ vue: 3.5.35([email protected])- '@vueuse/[email protected]([email protected])([email protected])([email protected])([email protected](@typescript/[email protected]))':+ '@vueuse/[email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))':dependencies:- '@vueuse/core': 13.9.0([email protected](@typescript/[email protected]))- '@vueuse/shared': 13.9.0([email protected](@typescript/[email protected]))- vue: 3.5.35(@typescript/[email protected])+ '@vueuse/core': 13.9.0([email protected]([email protected]))+ '@vueuse/shared': 13.9.0([email protected]([email protected]))+ vue: 3.5.35([email protected])optionalDependencies:focus-trap: 7.8.0fuse.js: 7.4.2@@ -21930,16 +22283,16 @@ snapshots:'@vueuse/[email protected]': {}dependencies:- vue-demi: 0.14.10([email protected](@typescript/[email protected]))+ vue-demi: 0.14.10([email protected]([email protected]))transitivePeerDependencies:- '@vue/composition-api'- vuedependencies:- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])'@webassemblyjs/[email protected]':dependencies:@@ -22389,7 +22742,7 @@ snapshots:- [email protected](@opentelemetry/[email protected])([email protected])([email protected])([email protected](@libsql/[email protected])(@opentelemetry/[email protected])(@types/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected]))([email protected])([email protected]))([email protected](@types/[email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected](@typescript/[email protected])):+ [email protected](@opentelemetry/[email protected])([email protected])([email protected])([email protected](@libsql/[email protected])(@opentelemetry/[email protected])(@types/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected]))([email protected])([email protected]))([email protected](@types/[email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]([email protected])):dependencies:'@better-auth/core': 1.6.15(@better-auth/[email protected])(@better-fetch/[email protected])(@opentelemetry/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@better-auth/drizzle-adapter': 1.6.15(@better-auth/[email protected](@better-auth/[email protected])(@better-fetch/[email protected])(@opentelemetry/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@better-auth/[email protected])([email protected](@libsql/[email protected])(@opentelemetry/[email protected])(@types/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected]))([email protected])([email protected]))@@ -22413,12 +22766,13 @@ snapshots:drizzle-kit: 0.31.10drizzle-orm: 0.45.2(@libsql/[email protected])(@opentelemetry/[email protected])(@types/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected]))([email protected])([email protected])mysql2: 3.22.6(@types/[email protected])- next: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ next: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])pg: 8.22.0react: 19.2.7react-dom: 19.2.7([email protected])- vitest: 4.1.10(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])(@typescript/[email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))- vue: 3.5.35(@typescript/[email protected])+ solid-js: 1.9.14+ vitest: 4.1.10(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))+ vue: 3.5.35([email protected])transitivePeerDependencies:- '@cloudflare/workers-types'- '@opentelemetry/api'@@ -22984,23 +23338,23 @@ snapshots:dependencies:layout-base: 2.0.1- [email protected](@typescript/[email protected]):dependencies:import-fresh: 3.3.0js-yaml: 4.1.1parse-json: 5.2.0path-type: 4.0.0optionalDependencies:- typescript: '@typescript/[email protected]'+ typescript: 7.0.2- [email protected](@typescript/[email protected]):dependencies:env-paths: 2.2.1import-fresh: 3.3.0js-yaml: 4.1.1parse-json: 5.2.0optionalDependencies:- typescript: '@typescript/[email protected]'+ typescript: 7.0.2dependencies:@@ -23067,7 +23421,7 @@ snapshots:postcss-value-parser: 4.2.0semver: 7.7.4optionalDependencies:- '@rspack/core': 1.7.11(@swc/[email protected])+ '@rspack/core': 1.7.11webpack: 5.107.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])[email protected]([email protected])([email protected])([email protected])([email protected])([email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])):@@ -23189,11 +23543,11 @@ snapshots:- [email protected](@typescript/[email protected]):dependencies:clsx: 2.1.1optionalDependencies:- typescript: '@typescript/[email protected]'+ typescript: 7.0.2dependencies:@@ -23544,9 +23898,9 @@ snapshots:transitivePeerDependencies:- supports-color- [email protected](@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])):+ [email protected](@docusaurus/[email protected](@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])):dependencies:- '@docusaurus/theme-classic': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])(@typescript/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@docusaurus/theme-classic': 3.10.1(@docusaurus/[email protected](@docusaurus/[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected]))(@rspack/[email protected])(@swc/[email protected])(@swc/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])medium-zoom: 1.1.0validate-peer-dependencies: 2.2.0@@ -23977,7 +24331,7 @@ snapshots:dependencies:eventsource-parser: 3.1.0dependencies:'@sindresorhus/merge-streams': 4.0.0figures: 6.1.0@@ -23986,12 +24340,11 @@ snapshots:is-plain-obj: 4.1.0is-stream: 4.0.1npm-run-path: 6.0.0- path-key: 4.0.0pretty-ms: 9.3.0signal-exit: 4.1.0strip-final-newline: 4.0.0which-command: 0.1.0- yoctocolors: 2.1.2+ yoctocolors: 2.2.0dependencies:@@ -24372,7 +24725,7 @@ snapshots:'@petamoriken/float16': 3.9.3debug: 4.4.3([email protected])env-paths: 3.0.0- semver: 7.7.4+ semver: 7.8.5shell-quote: 1.8.4which: 4.0.0transitivePeerDependencies:@@ -24502,6 +24855,10 @@ snapshots:+ dependencies:+ csstype: 3.2.3+@@ -24887,7 +25244,7 @@ snapshots:pretty-error: 4.0.0tapable: 2.3.3optionalDependencies:- '@rspack/core': 1.7.11(@swc/[email protected])+ '@rspack/core': 1.7.11webpack: 5.107.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])@@ -25690,23 +26047,23 @@ snapshots:- [email protected](@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])):+ [email protected](@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])):dependencies:'@modelcontextprotocol/sdk': 1.26.0([email protected])([email protected])chalk: 5.6.2commander: 11.1.0redis: 4.7.1optionalDependencies:- next: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ next: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])- [email protected](@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])):+ [email protected](@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])):dependencies:'@modelcontextprotocol/sdk': 1.29.0([email protected])([email protected])chalk: 5.6.2commander: 11.1.0redis: 4.7.1optionalDependencies:- next: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ next: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])dependencies:@@ -26348,7 +26705,7 @@ snapshots:dependencies:'@inquirer/confirm': 6.0.13(@types/[email protected])'@mswjs/interceptors': 0.41.9@@ -26369,7 +26726,7 @@ snapshots:until-async: 3.0.2yargs: 17.7.2optionalDependencies:- typescript: '@typescript/[email protected]'+ typescript: 7.0.2transitivePeerDependencies:- '@types/node'optional: true@@ -26434,57 +26791,58 @@ snapshots:- [email protected]([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]):+ [email protected]([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]):dependencies:'@auth/core': 0.41.2- next: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ next: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])react: 19.2.7- [email protected](@typescript/[email protected])([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]):+ [email protected]([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected]):dependencies:'@formatjs/intl-localematcher': 0.8.1'@parcel/watcher': 2.4.1'@swc/core': 1.15.3icu-minify: 4.13.1negotiator: 1.0.0- next: 16.2.10(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ next: 16.3.0-preview.9(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])next-intl-swc-plugin-extractor: 4.13.1po-parser: 2.1.1react: 19.2.7use-intl: 4.13.1([email protected])optionalDependencies:- typescript: '@typescript/[email protected]'+ typescript: 7.0.2transitivePeerDependencies:- '@swc/helpers'- [email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]):+ [email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]):dependencies:- '@next/env': 16.2.10+ '@next/env': 16.3.0-preview.9'@swc/helpers': 0.5.15baseline-browser-mapping: 2.10.31caniuse-lite: 1.0.30001793- postcss: 8.4.31+ postcss: 8.5.10react: 19.2.7react-dom: 19.2.7([email protected])optionalDependencies:- '@next/swc-darwin-arm64': 16.2.10- '@next/swc-darwin-x64': 16.2.10- '@next/swc-linux-arm64-gnu': 16.2.10- '@next/swc-linux-arm64-musl': 16.2.10- '@next/swc-linux-x64-gnu': 16.2.10- '@next/swc-linux-x64-musl': 16.2.10- '@next/swc-win32-arm64-msvc': 16.2.10- '@next/swc-win32-x64-msvc': 16.2.10+ '@next/swc-darwin-arm64': 16.3.0-preview.9+ '@next/swc-darwin-x64': 16.3.0-preview.9+ '@next/swc-linux-arm64-gnu': 16.3.0-preview.9+ '@next/swc-linux-arm64-musl': 16.3.0-preview.9+ '@next/swc-linux-x64-gnu': 16.3.0-preview.9+ '@next/swc-linux-x64-musl': 16.3.0-preview.9+ '@next/swc-win32-arm64-msvc': 16.3.0-preview.9+ '@next/swc-win32-x64-msvc': 16.3.0-preview.9'@opentelemetry/api': 1.9.0'@playwright/test': 1.61.1babel-plugin-react-compiler: 1.0.0sass: 1.101.0- sharp: 0.34.5+ sharp: 0.35.3(@types/[email protected])transitivePeerDependencies:- '@babel/core'+ - '@types/node'- babel-plugin-macros@@ -27150,9 +27508,9 @@ snapshots:'@csstools/utilities': 2.0.0([email protected])postcss: 8.5.16- [email protected](@typescript/[email protected])([email protected])([email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])):+ [email protected]([email protected])([email protected])([email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])):dependencies:- cosmiconfig: 8.3.6(@typescript/[email protected])+ cosmiconfig: 8.3.6([email protected])jiti: 1.21.7postcss: 8.5.16semver: 7.7.4@@ -27466,7 +27824,7 @@ snapshots:dependencies:postcss: 8.5.16dependencies:nanoid: 3.3.12picocolors: 1.1.1@@ -27746,20 +28104,20 @@ snapshots:parchment: 3.0.0quill-delta: 5.1.0dependencies:'@floating-ui/dom': 1.7.6- '@floating-ui/vue': 1.1.11([email protected](@typescript/[email protected]))+ '@floating-ui/vue': 1.1.11([email protected]([email protected]))'@internationalized/date': 3.12.2'@internationalized/number': 3.6.7- '@tanstack/vue-virtual': 3.13.28([email protected](@typescript/[email protected]))- '@vueuse/core': 10.11.1([email protected](@typescript/[email protected]))- '@vueuse/shared': 10.11.1([email protected](@typescript/[email protected]))+ '@tanstack/vue-virtual': 3.13.28([email protected]([email protected]))+ '@vueuse/core': 10.11.1([email protected]([email protected]))+ '@vueuse/shared': 10.11.1([email protected]([email protected]))aria-hidden: 1.2.6defu: 6.1.7fast-deep-equal: 3.1.3nanoid: 5.1.16- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])transitivePeerDependencies:- '@vue/composition-api'@@ -28434,15 +28792,15 @@ snapshots:'@peculiar/x509': 1.14.3pkijs: 3.4.0dependencies:- '@semantic-release/commit-analyzer': 13.0.1([email protected](@typescript/[email protected])([email protected]))([email protected])+ '@semantic-release/commit-analyzer': 13.0.1([email protected]([email protected])([email protected]))([email protected])'@semantic-release/error': 4.0.0- '@semantic-release/github': 12.0.9([email protected](@typescript/[email protected])([email protected]))([email protected])- '@semantic-release/npm': 13.1.5([email protected](@typescript/[email protected])([email protected]))- '@semantic-release/release-notes-generator': 14.1.1([email protected](@typescript/[email protected])([email protected]))([email protected])+ '@semantic-release/github': 12.0.9([email protected]([email protected])([email protected]))([email protected])+ '@semantic-release/release-notes-generator': 14.1.1([email protected]([email protected])([email protected]))([email protected])aggregate-error: 5.0.0- cosmiconfig: 9.0.0(@typescript/[email protected])+ cosmiconfig: 9.0.0([email protected])debug: 4.4.3([email protected])env-ci: 11.2.0execa: 9.5.2@@ -28480,6 +28838,9 @@ snapshots:+ optional: true+dependencies:debug: 2.6.9([email protected])@@ -28518,6 +28879,12 @@ snapshots:dependencies:randombytes: 2.1.0+ dependencies:+ seroval: 1.5.6++ [email protected]: {}+dependencies:bytes: 3.0.0@@ -28581,36 +28948,38 @@ snapshots:+ [email protected](@types/[email protected]):dependencies:- '@img/colour': 1.0.0+ '@img/colour': 1.1.0detect-libc: 2.1.2- semver: 7.7.4+ semver: 7.8.5optionalDependencies:- '@img/sharp-darwin-arm64': 0.34.5- '@img/sharp-darwin-x64': 0.34.5- '@img/sharp-libvips-darwin-arm64': 1.2.4- '@img/sharp-libvips-darwin-x64': 1.2.4- '@img/sharp-libvips-linux-arm': 1.2.4- '@img/sharp-libvips-linux-arm64': 1.2.4- '@img/sharp-libvips-linux-ppc64': 1.2.4- '@img/sharp-libvips-linux-riscv64': 1.2.4- '@img/sharp-libvips-linux-s390x': 1.2.4- '@img/sharp-libvips-linux-x64': 1.2.4- '@img/sharp-libvips-linuxmusl-arm64': 1.2.4- '@img/sharp-libvips-linuxmusl-x64': 1.2.4- '@img/sharp-linux-arm': 0.34.5- '@img/sharp-linux-arm64': 0.34.5- '@img/sharp-linux-ppc64': 0.34.5- '@img/sharp-linux-riscv64': 0.34.5- '@img/sharp-linux-s390x': 0.34.5- '@img/sharp-linux-x64': 0.34.5- '@img/sharp-linuxmusl-arm64': 0.34.5- '@img/sharp-linuxmusl-x64': 0.34.5- '@img/sharp-wasm32': 0.34.5- '@img/sharp-win32-arm64': 0.34.5- '@img/sharp-win32-ia32': 0.34.5- '@img/sharp-win32-x64': 0.34.5+ '@img/sharp-darwin-arm64': 0.35.3+ '@img/sharp-darwin-x64': 0.35.3+ '@img/sharp-freebsd-wasm32': 0.35.3+ '@img/sharp-libvips-darwin-arm64': 1.3.2+ '@img/sharp-libvips-darwin-x64': 1.3.2+ '@img/sharp-libvips-linux-arm': 1.3.2+ '@img/sharp-libvips-linux-arm64': 1.3.2+ '@img/sharp-libvips-linux-ppc64': 1.3.2+ '@img/sharp-libvips-linux-riscv64': 1.3.2+ '@img/sharp-libvips-linux-s390x': 1.3.2+ '@img/sharp-libvips-linux-x64': 1.3.2+ '@img/sharp-libvips-linuxmusl-arm64': 1.3.2+ '@img/sharp-libvips-linuxmusl-x64': 1.3.2+ '@img/sharp-linux-arm': 0.35.3+ '@img/sharp-linux-arm64': 0.35.3+ '@img/sharp-linux-ppc64': 0.35.3+ '@img/sharp-linux-riscv64': 0.35.3+ '@img/sharp-linux-s390x': 0.35.3+ '@img/sharp-linux-x64': 0.35.3+ '@img/sharp-linuxmusl-arm64': 0.35.3+ '@img/sharp-linuxmusl-x64': 0.35.3+ '@img/sharp-webcontainers-wasm32': 0.35.3+ '@img/sharp-win32-arm64': 0.35.3+ '@img/sharp-win32-ia32': 0.35.3+ '@img/sharp-win32-x64': 0.35.3+ '@types/node': 24.13.3optional: true@@ -28724,6 +29093,12 @@ snapshots:ip-address: 9.0.5smart-buffer: 4.2.0+ dependencies:+ csstype: 3.2.3+ seroval: 1.5.6+ seroval-plugins: 1.5.6([email protected])+dependencies:atomic-sleep: 1.0.0@@ -29004,9 +29379,9 @@ snapshots:dependencies:- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])@@ -29244,31 +29619,31 @@ snapshots:- [email protected](20caeb9169922dd2adb62d9d2fa0352f):+ [email protected](09f4f932022b61bbb1db30a9d75546c7):dependencies:'@modelcontextprotocol/sdk': 1.29.0([email protected])([email protected])- '@trpc/server': 11.18.0(@typescript/[email protected])- better-auth: 1.6.15(@opentelemetry/[email protected])([email protected])([email protected])([email protected](@libsql/[email protected])(@opentelemetry/[email protected])(@types/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected]))([email protected])([email protected]))([email protected](@types/[email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected](@typescript/[email protected]))- mcp-handler: 1.1.0(@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))+ '@trpc/server': 11.18.0([email protected])+ better-auth: 1.6.15(@opentelemetry/[email protected])([email protected])([email protected])([email protected](@libsql/[email protected])(@opentelemetry/[email protected])(@types/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected]))([email protected])([email protected]))([email protected](@types/[email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]([email protected]))+ mcp-handler: 1.1.0(@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))zod: 4.4.3transitivePeerDependencies:- '@cfworker/json-schema'- supports-color- [email protected](6bd31c056f397ffcf9e77883340c3ff9):+ [email protected](7c45d4095abf7cef4938a6fc2cc62863):dependencies:'@modelcontextprotocol/sdk': 1.29.0([email protected])([email protected])- '@trpc/server': 11.18.0(@typescript/[email protected])- better-auth: 1.6.15(@opentelemetry/[email protected])([email protected])([email protected])([email protected](@libsql/[email protected])(@opentelemetry/[email protected])(@types/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected]))([email protected])([email protected]))([email protected](@types/[email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected](@typescript/[email protected]))- mcp-handler: 1.1.0(@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))+ '@trpc/server': 11.18.0([email protected])+ better-auth: 1.6.15(@opentelemetry/[email protected])([email protected])([email protected])([email protected](@libsql/[email protected])(@opentelemetry/[email protected])(@types/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected]))([email protected])([email protected]))([email protected](@types/[email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]([email protected]))+ mcp-handler: 1.1.0(@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))zod: 4.4.3transitivePeerDependencies:- '@cfworker/json-schema'- supports-color- [email protected](patch_hash=2ca3c16af0fcca0c736697ad4fe553a14f794524fa9ce0d5c3e8ee4aea76090c)(@trpc/[email protected](@typescript/[email protected]))([email protected]([email protected]))([email protected]):+ [email protected](patch_hash=2ca3c16af0fcca0c736697ad4fe553a14f794524fa9ce0d5c3e8ee4aea76090c)(@trpc/[email protected]([email protected]))([email protected]([email protected]))([email protected]):dependencies:- '@trpc/server': 11.18.0(@typescript/[email protected])+ '@trpc/server': 11.18.0([email protected])co-body: 6.2.0h3: 1.15.11openapi3-ts: 4.4.0@@ -29285,9 +29660,9 @@ snapshots:- [email protected](@typescript/[email protected]):optionalDependencies:- typescript: '@typescript/[email protected]'+ typescript: 7.0.2dependencies:@@ -29366,7 +29741,28 @@ snapshots:dependencies:is-typedarray: 1.0.0- [email protected]: {}+ optionalDependencies:+ '@typescript/typescript-aix-ppc64': 7.0.2+ '@typescript/typescript-darwin-arm64': 7.0.2+ '@typescript/typescript-darwin-x64': 7.0.2+ '@typescript/typescript-freebsd-arm64': 7.0.2+ '@typescript/typescript-freebsd-x64': 7.0.2+ '@typescript/typescript-linux-arm': 7.0.2+ '@typescript/typescript-linux-arm64': 7.0.2+ '@typescript/typescript-linux-loong64': 7.0.2+ '@typescript/typescript-linux-mips64el': 7.0.2+ '@typescript/typescript-linux-ppc64': 7.0.2+ '@typescript/typescript-linux-riscv64': 7.0.2+ '@typescript/typescript-linux-s390x': 7.0.2+ '@typescript/typescript-linux-x64': 7.0.2+ '@typescript/typescript-netbsd-arm64': 7.0.2+ '@typescript/typescript-netbsd-x64': 7.0.2+ '@typescript/typescript-openbsd-arm64': 7.0.2+ '@typescript/typescript-openbsd-x64': 7.0.2+ '@typescript/typescript-sunos-x64': 7.0.2+ '@typescript/typescript-win32-arm64': 7.0.2+ '@typescript/typescript-win32-x64': 7.0.2@@ -29645,16 +30041,34 @@ snapshots:dependencies:global: 4.4.0- [email protected](@typescript/[email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])):+ [email protected]([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])):dependencies:debug: 4.4.3([email protected])globrex: 0.1.2- tsconfck: 3.1.3(@typescript/[email protected])- vite: 8.1.4(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ tsconfck: 3.1.3([email protected])+ vite: 8.1.4(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])transitivePeerDependencies:- supports-color- typescript+ [email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]):+ dependencies:+ lightningcss: 1.32.0+ picomatch: 4.0.5+ postcss: 8.5.16+ rolldown: 1.1.4+ tinyglobby: 0.2.17+ optionalDependencies:+ '@types/node': 24.13.3+ esbuild: 0.28.1+ fsevents: 2.3.3+ jiti: 2.7.0+ sass: 1.101.0+ sugarss: 5.0.0([email protected])+ terser: 5.46.1+ tsx: 4.20.4+ yaml: 2.9.0+[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]):dependencies:lightningcss: 1.32.0@@ -29672,11 +30086,43 @@ snapshots:terser: 5.46.1tsx: 4.21.0yaml: 2.9.0+ optional: true- [email protected](@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])(@typescript/[email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])):+ [email protected](@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])):dependencies:'@vitest/expect': 4.1.10- '@vitest/mocker': 4.1.10([email protected](@types/[email protected])(@typescript/[email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))+ '@vitest/mocker': 4.1.10([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))+ '@vitest/pretty-format': 4.1.10+ '@vitest/runner': 4.1.10+ '@vitest/snapshot': 4.1.10+ '@vitest/spy': 4.1.10+ '@vitest/utils': 4.1.10+ es-module-lexer: 2.1.0+ expect-type: 1.3.0+ magic-string: 0.30.21+ obug: 2.1.1+ pathe: 2.0.3+ picomatch: 4.0.4+ std-env: 4.0.0+ tinybench: 2.9.0+ tinyexec: 1.0.2+ tinyglobby: 0.2.17+ tinyrainbow: 3.1.0+ vite: 8.1.4(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ why-is-node-running: 2.3.0+ optionalDependencies:+ '@opentelemetry/api': 1.9.0+ '@types/node': 24.13.3+ '@vitest/coverage-v8': 4.1.10([email protected])+ '@vitest/ui': 4.1.10([email protected])+ jsdom: 29.1.1(@noble/[email protected])+ transitivePeerDependencies:+ - msw++ [email protected](@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@noble/[email protected]))([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])):+ dependencies:+ '@vitest/expect': 4.1.10+ '@vitest/mocker': 4.1.10([email protected](@types/[email protected])([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))'@vitest/pretty-format': 4.1.10'@vitest/runner': 4.1.10'@vitest/snapshot': 4.1.10@@ -29703,24 +30149,25 @@ snapshots:jsdom: 29.1.1(@noble/[email protected])transitivePeerDependencies:- msw+ optional: truedependencies:- vue: 3.5.35(@typescript/[email protected])+ vue: 3.5.35([email protected])- [email protected](@typescript/[email protected]):dependencies:'@vue/compiler-dom': 3.5.35'@vue/compiler-sfc': 3.5.35'@vue/runtime-dom': 3.5.35- '@vue/server-renderer': 3.5.35([email protected](@typescript/[email protected]))+ '@vue/server-renderer': 3.5.35([email protected]([email protected]))'@vue/shared': 3.5.35optionalDependencies:- typescript: '@typescript/[email protected]'+ typescript: 7.0.2@@ -29875,7 +30322,7 @@ snapshots:pretty-time: 1.1.0std-env: 3.10.0optionalDependencies:- '@rspack/core': 1.7.11(@swc/[email protected])+ '@rspack/core': 1.7.11webpack: 5.107.1(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])@@ -30071,7 +30518,7 @@ snapshots:- [email protected]: {}+ [email protected]: {}dependencies:diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 915083389..16a82efb0 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -3,6 +3,7 @@ packages:- packages/*- tooling/*catalog:+ "@babel/parser": ^7.29.7"@auth/core": ^0.41.2"@auth/drizzle-adapter": ^1.11.2"@ctrl/deluge": ^8.0.0@@ -33,7 +34,6 @@ catalog:"@mantine/notifications": ^9.4.1"@mantine/spotlight": ^9.4.1"@mantine/tiptap": ^9.4.1- "@next/eslint-plugin-next": 16.2.10"@octokit/auth-app": ^8.2.0"@paralleldrive/cuid2": ^3.3.0"@playwright/test": ^1.61.1@@ -45,11 +45,10 @@ catalog:"@semantic-release/release-notes-generator": ^14.1.1"@t3-oss/env-nextjs": ^0.13.11"@tabler/icons-react": ^3.44.0- "@tanstack/query-async-storage-persister": ^5.101.2+ "@tanstack/react-devtools": ^0.10.8"@tanstack/react-query": ^5.101.2"@tanstack/react-query-devtools": ^5.101.2"@tanstack/react-query-next-experimental": ^5.101.2- "@tanstack/react-query-persist-client": ^5.101.2"@testcontainers/mysql": ^12.0.4"@testcontainers/postgresql": ^12.0.4"@testcontainers/redis": ^12.0.4@@ -146,7 +145,7 @@ catalog:mcp-handler: ^1.1.0maria2: ^0.4.1mysql2: 3.22.6- next: 16.2.10+ next: 16.3.0-preview.9next-auth: 5.0.0-beta.31next-intl: 4.13.1node-loader: ^2.1.0@@ -177,7 +176,7 @@ catalog:tsdav: ^2.3.0tsx: 4.20.4turbo: ^2.10.4- typescript: "npm:@typescript/typescript6@^6.0.2"+ typescript: 7.0.2vite: ^8.1.4undici: 7.28.0use-deep-compare-effect: ^1.8.1@@ -201,6 +200,7 @@ minimumReleaseAge: 4320minimumReleaseAgeExclude:- next- "@next/*"+ - "[email protected]"- "@immich/[email protected]"# Renovate security update: [email protected]diff --git a/scripts/benchmarks/benchmark-compare.mts b/scripts/benchmarks/benchmark-compare.mtsnew file mode 100644index 000000000..2b77fd2b0--- /dev/null+++ b/scripts/benchmarks/benchmark-compare.mts@@ -0,0 +1,40 @@+import { mkdir, readFile, writeFile } from "node:fs/promises";+import path from "node:path";++import type { BenchmarkPairInput, BuildResult, RuntimeResult } from "./benchmark-pair-lib.mts";+import { compareBenchmarkPair } from "./benchmark-pair-lib.mts";++const values = new Map<string, string[]>();+for (let index = 2; index < process.argv.length; index += 2) {+ const flag = process.argv[index];+ const value = process.argv[index + 1];+ if (!flag?.startsWith("--") || !value) throw new Error(`Invalid argument at ${String(flag)}`);+ values.set(flag, [...(values.get(flag) ?? []), value]);+}++const requireMany = (flag: string) => {+ const result = values.get(flag) ?? [];+ if (result.length === 0) throw new Error(`${flag} is required`);+ return result;+};+const requireOne = (flag: string) => {+ const result = requireMany(flag);+ if (result.length !== 1) throw new Error(`${flag} must be provided exactly once`);+ return result[0] as string;+};+const readJson = async <T,>(file: string) => JSON.parse(await readFile(path.resolve(file), "utf8")) as T;++const input: BenchmarkPairInput = {+ baselineWarmup: await readJson<BuildResult>(requireOne("--baseline-warmup")),+ candidateWarmup: await readJson<BuildResult>(requireOne("--candidate-warmup")),+ baselineBuilds: await Promise.all(requireMany("--baseline-build").map(readJson<BuildResult>)),+ candidateBuilds: await Promise.all(requireMany("--candidate-build").map(readJson<BuildResult>)),+ baselineRuntime: await readJson<RuntimeResult>(requireOne("--baseline-runtime")),+ candidateRuntime: await readJson<RuntimeResult>(requireOne("--candidate-runtime")),+};+const result = compareBenchmarkPair(input);+const outputPath = path.resolve(requireOne("--output"));+await mkdir(path.dirname(outputPath), { recursive: true });+await writeFile(outputPath, `${JSON.stringify(result, null, 2)}\n`);+console.log(JSON.stringify({ outputPath, ...result }, null, 2));+if (!result.claimEligible) process.exitCode = 1;diff --git a/scripts/benchmarks/benchmark-pair-lib.mts b/scripts/benchmarks/benchmark-pair-lib.mtsnew file mode 100644index 000000000..4ee7885aa--- /dev/null+++ b/scripts/benchmarks/benchmark-pair-lib.mts@@ -0,0 +1,713 @@+import { summarize } from "./dev-benchmark-lib.mts";++type BuildResult = {+ schemaVersion: number;+ createdAt: string;+ run: { startedAt: string; finishedAt: string };+ claimEligible: boolean;+ claimIneligibleReasons: string[];+ mode: string;+ builder: string | null;+ runLabel: string | null;+ declaredRevision: string | null;+ series: { id: string | null; cacheState: string | null; repetition: number; totalRepetitions: number };+ source: {+ headSha: string;+ measuredRevision: string;+ fingerprint: string;+ baseFingerprint: string;+ syntheticSourceChange: { file: string; id: string } | null;+ };+ host: {+ architecture: string;+ dockerServer: { architecture: string; operatingSystem: string; targetPlatform: string; version: string | null };+ platform: string;+ };+ image: {+ architecture: string;+ digest: string | null;+ id: string;+ revision: string | null;+ sourceFingerprint: string | null;+ targetPlatform: string;+ };+ builderCache: {+ expected: Array<{ logicalId: string; target: string; mustIncreaseUsage: boolean }>;+ before: BuildCacheSnapshot | null;+ after: BuildCacheSnapshot | null;+ afterStability: { attempts: number; pollIntervalMs: number; stableForMs: number; timeoutMs: number } | null;+ };+ build: { nextCompileMs: number | null; wallTimeMs: number };+};++type BuildCacheSnapshot = {+ cacheMountCount: number;+ cacheMounts: Array<{+ logicalId: string | null;+ recordId: string;+ target: string | null;+ usageCount: number | null;+ }>;+ recordCount: number;+ recordsFingerprint: string;+};++type RuntimePageSample = {+ boardMountedMs: number;+ fcpMs: number;+ lcpFinalizedByInputMs: number;+ lcpMs: number;+ ttfbMs: number;+ widgetImplementationsMountedMs: number | null;+ widgetDataSettledMs: number;+};++type RuntimeResult = {+ schemaVersion: number;+ claimEligible: boolean;+ claimIneligibleReasons: string[];+ claimScope: string[];+ metricEligibility: Record<string, { claimEligible: boolean }>;+ image: {+ architecture: string;+ digest: string | null;+ id: string;+ revision: string | null;+ sourceFingerprint: string | null;+ };+ host: {+ architecture: string;+ node: { version: string; v8Version: string };+ platform: string;+ release: string;+ };+ provenance: {+ browser: {+ engine: string;+ executablePath: string;+ headless: boolean;+ httpCachePolicy: string;+ launchArguments?: string[];+ version: string;+ viewport: unknown;+ };+ container: {+ cpuLimit: number;+ memoryLimitBytes: number;+ network: { internal: boolean };+ node: { architecture: string; platform: string; version: string; v8Version: string };+ };+ docker: { engine: unknown; version: unknown };+ ingressProxy: { excludedFromMemorySamples: boolean; implementation: string };+ };+ browserNetworkIsolation: {+ active: boolean;+ canaries: {+ http: { attemptCount: number; responseHeader: string | null; status: number | null };+ webSockets: Array<{+ attemptCount: number;+ browserEventCount: number;+ closeCount: number;+ connectTarget: string;+ errorEvent: boolean;+ frameReceivedCount: number;+ frameSentCount: number;+ opened: boolean;+ socketErrorCount: number;+ timedOut: boolean;+ url: string;+ }>;+ };+ externalBrowserWebSockets: unknown[];+ unexpectedExternalResponses: unknown[];+ };+ serverNetworkIsolation: {+ active: boolean;+ canary: { directIp: { blocked: boolean }; domain: { blocked: boolean } };+ network: { internal: boolean };+ };+ checkpoints: Array<{ capturedAt: string; name: string }>;+ workload: {+ settleMs: number;+ sampleIntervalMs: number;+ settleSampleCount: number;+ lcpObservationMs: number;+ lcpStabilityMs: number;+ widgetDataQuietMs: number;+ spotlightIdleMs: number;+ spotlightIdlePolicy: string;+ interactionIterations: number;+ widgetCount: number;+ implementationMarkerPolicy: string;+ widgetImplementationMarkerCount: number;+ widgetErrorCount: number;+ startToReadyMs: number;+ coldSpotlightFeedbackMs: number | null;+ coldSpotlightReadyMs: number | null;+ postIdleWarmInteractionMs: number | null;+ routeTimings: Array<{ path: string }>;+ pageLoadSamples: RuntimePageSample[];+ };+ summary: {+ startupBytes: number | null;+ workloadBytes: number | null;+ settledBytes: number | null;+ peakBytes: number | null;+ };+};++export type BenchmarkPairInput = {+ baselineWarmup: BuildResult;+ candidateWarmup: BuildResult;+ baselineBuilds: BuildResult[];+ candidateBuilds: BuildResult[];+ baselineRuntime: RuntimeResult;+ candidateRuntime: RuntimeResult;+};++const stable = (value: unknown) => JSON.stringify(value);+const unique = <T,>(values: T[]) => [...new Set(values)];++const improvement = (baseline: number | null, candidate: number | null) => ({+ baseline,+ candidate,+ delta: baseline === null || candidate === null ? null : candidate - baseline,+ improvementPercent:+ baseline === null || candidate === null || baseline === 0 ? null : ((baseline - candidate) / baseline) * 100,+});++const validateRunWindow = (label: string, build: BuildResult, reasons: string[]) => {+ const startedAt = Date.parse(build.run.startedAt);+ const finishedAt = Date.parse(build.run.finishedAt);+ if (!Number.isFinite(startedAt) || !Number.isFinite(finishedAt) || finishedAt < startedAt) {+ reasons.push(`${label} build run window is invalid`);+ }+ if (build.createdAt !== build.run.finishedAt) reasons.push(`${label} build completion timestamp is inconsistent`);+};++const validateMeasuredBuildCache = (label: string, build: BuildResult, reasons: string[]) => {+ const { after, before, expected } = build.builderCache;+ if (expected.length === 0) {+ reasons.push(`${label} build declares no expected cache mounts`);+ return;+ }+ if (!before || !after) {+ reasons.push(`${label} build cache continuity snapshots are missing`);+ return;+ }+ for (const expectedMount of expected) {+ const matches = (snapshot: BuildCacheSnapshot) =>+ snapshot.cacheMounts.filter(+ ({ logicalId, target }) => logicalId === expectedMount.logicalId && target === expectedMount.target,+ );+ const beforeMatches = matches(before);+ const afterMatches = matches(after);+ if (beforeMatches.length !== 1 || afterMatches.length !== 1) {+ reasons.push(`${label} build cache mount ${expectedMount.logicalId} cannot be traced uniquely`);+ continue;+ }+ const beforeMount = beforeMatches[0];+ const afterMount = afterMatches[0];+ if (!beforeMount || !afterMount || beforeMount.recordId !== afterMount.recordId) {+ reasons.push(`${label} build cache mount ${expectedMount.logicalId} was replaced`);+ continue;+ }+ if (+ expectedMount.mustIncreaseUsage &&+ (beforeMount.usageCount === null ||+ afterMount.usageCount === null ||+ afterMount.usageCount <= beforeMount.usageCount)+ ) {+ reasons.push(`${label} build cache mount ${expectedMount.logicalId} usage did not increase`);+ }+ }+};++const validateBuildSide = (label: string, builds: BuildResult[], reasons: string[]) => {+ if (builds.length === 0) {+ reasons.push(`${label} build series is empty`);+ return;+ }++ const first = builds[0];+ if (!first) return;+ for (const build of builds) {+ if (build.schemaVersion !== 4) reasons.push(`${label} build schema is not 4`);+ validateRunWindow(`${label} repetition ${build.series.repetition}`, build, reasons);+ if (!build.claimEligible || build.claimIneligibleReasons.length > 0) {+ reasons.push(`${label} build repetition ${build.series.repetition} is not claim eligible`);+ }+ if (build.mode !== "source-change") reasons.push(`${label} build is not a source-change rebuild`);+ if (build.runLabel !== label) reasons.push(`${label} build run label is not ${label}`);+ if (build.series.cacheState !== "warm") reasons.push(`${label} build cache is not warm`);+ if (!build.source.syntheticSourceChange) reasons.push(`${label} build has no synthetic source change`);+ if (build.source.fingerprint === build.source.baseFingerprint) {+ reasons.push(`${label} build synthetic source fingerprint did not change`);+ }+ if (build.image.sourceFingerprint !== build.source.fingerprint) {+ reasons.push(`${label} build image fingerprint does not match its immutable source snapshot`);+ }+ if (!Number.isFinite(build.build.nextCompileMs) || (build.build.nextCompileMs ?? 0) <= 0) {+ reasons.push(`${label} build has no valid Next compile timing`);+ }+ if (!Number.isFinite(build.build.wallTimeMs) || build.build.wallTimeMs <= 0) {+ reasons.push(`${label} build has no valid wall timing`);+ }+ validateMeasuredBuildCache(`${label} repetition ${build.series.repetition}`, build, reasons);+ if (!build.builderCache.afterStability || build.builderCache.afterStability.stableForMs < 10_000) {+ reasons.push(`${label} build cache snapshot did not settle for 10000ms`);+ }+ if (!Number.isFinite(Date.parse(build.createdAt))) reasons.push(`${label} build timestamp is invalid`);+ }++ const expectedRepetitions = Array.from({ length: first.series.totalRepetitions }, (_, index) => index + 1);+ const actualRepetitions = builds.map(({ series }) => series.repetition).toSorted((left, right) => left - right);+ if (first.series.totalRepetitions < 2 || stable(actualRepetitions) !== stable(expectedRepetitions)) {+ reasons.push(`${label} build repetitions are incomplete`);+ }++ const stableFields: Array<[string, unknown[]]> = [+ ["builder", builds.map(({ builder }) => builder)],+ ["series id", builds.map(({ series }) => series.id)],+ ["total repetitions", builds.map(({ series }) => series.totalRepetitions)],+ ["declared revision", builds.map(({ declaredRevision }) => declaredRevision)],+ ["head SHA", builds.map(({ source }) => source.headSha)],+ ["measured revision", builds.map(({ source }) => source.measuredRevision)],+ ["base fingerprint", builds.map(({ source }) => source.baseFingerprint)],+ ["host", builds.map(({ host }) => stable(host))],+ ["image platform", builds.map(({ image }) => `${image.architecture}:${image.targetPlatform}`)],+ ["expected cache mounts", builds.map(({ builderCache }) => stable(builderCache.expected))],+ ];+ for (const [field, values] of stableFields) {+ if (unique(values).length !== 1) reasons.push(`${label} build ${field} changes within the series`);+ }+ if (!first.builder) reasons.push(`${label} build builder is missing`);+ if (!first.series.id) reasons.push(`${label} build series id is missing`);+};++const validateWarmup = (label: string, warmup: BuildResult, builds: BuildResult[], reasons: string[]) => {+ if (warmup.schemaVersion !== 4) reasons.push(`${label} warmup schema is not 4`);+ validateRunWindow(`${label} warmup`, warmup, reasons);+ if (warmup.mode !== "cached") reasons.push(`${label} warmup mode is not cached`);+ if (warmup.runLabel !== label) reasons.push(`${label} warmup run label is not ${label}`);+ if (warmup.series.cacheState !== "cold") reasons.push(`${label} warmup cache state is not cold`);+ if (warmup.source.syntheticSourceChange !== null) reasons.push(`${label} warmup contains a synthetic source change`);+ const expectedWarmupReason = "cached mode does not force an application rebuild";+ if (+ warmup.claimEligible ||+ !warmup.claimIneligibleReasons.includes(expectedWarmupReason) ||+ warmup.claimIneligibleReasons.some((reason) => reason !== expectedWarmupReason)+ ) {+ reasons.push(`${label} warmup has unexpected claim eligibility reasons`);+ }+ if (!warmup.builderCache.before || warmup.builderCache.before.recordCount !== 0) {+ reasons.push(`${label} warmup builder did not begin empty`);+ }+ if (!warmup.builderCache.after || warmup.builderCache.after.recordCount === 0) {+ reasons.push(`${label} warmup did not populate the builder cache`);+ }+ if (!warmup.builderCache.afterStability || warmup.builderCache.afterStability.stableForMs < 10_000) {+ reasons.push(`${label} warmup cache snapshot did not settle for 10000ms`);+ }+ for (const expected of warmup.builderCache.expected) {+ const matches =+ warmup.builderCache.after?.cacheMounts.filter(+ ({ logicalId, target }) => logicalId === expected.logicalId && target === expected.target,+ ) ?? [];+ if (matches.length !== 1) {+ reasons.push(`${label} warmup did not populate cache mount ${expected.logicalId} at ${expected.target}`);+ }+ }+ if (warmup.image.sourceFingerprint !== warmup.source.baseFingerprint) {+ reasons.push(`${label} warmup image fingerprint does not match its source`);+ }+ if (warmup.source.fingerprint !== warmup.source.baseFingerprint) {+ reasons.push(`${label} warmup immutable source fingerprint does not match its base source`);+ }+ if (warmup.image.revision !== warmup.source.measuredRevision) {+ reasons.push(`${label} warmup image revision does not match its source`);+ }++ const first = builds[0];+ if (!first) return;+ const stableFields: Array<[string, unknown, unknown]> = [+ ["builder", warmup.builder, first.builder],+ ["series id", warmup.series.id, first.series.id],+ ["declared revision", warmup.declaredRevision, first.declaredRevision],+ ["head SHA", warmup.source.headSha, first.source.headSha],+ ["measured revision", warmup.source.measuredRevision, first.source.measuredRevision],+ ["base fingerprint", warmup.source.baseFingerprint, first.source.baseFingerprint],+ ["host", stable(warmup.host), stable(first.host)],+ [+ "image platform",+ `${warmup.image.architecture}:${warmup.image.targetPlatform}`,+ `${first.image.architecture}:${first.image.targetPlatform}`,+ ],+ ["expected cache mounts", stable(warmup.builderCache.expected), stable(first.builderCache.expected)],+ ];+ for (const [field, warmupValue, measuredValue] of stableFields) {+ if (warmupValue !== measuredValue) reasons.push(`${label} warmup ${field} does not match the measured series`);+ }++ let previous = warmup;+ for (const build of builds.toSorted((left, right) => left.series.repetition - right.series.repetition)) {+ if (!previous.builderCache.after || !build.builderCache.before) {+ reasons.push(`${label} cache continuity snapshot is missing before repetition ${build.series.repetition}`);+ } else if (previous.builderCache.after.recordsFingerprint !== build.builderCache.before.recordsFingerprint) {+ reasons.push(`${label} builder cache changed outside repetition ${build.series.repetition}`);+ }+ previous = build;+ }+};++const runtimeConfiguration = (runtime: RuntimeResult) => ({+ host: runtime.host,+ browser: {+ ...runtime.provenance.browser,+ launchArguments: runtime.provenance.browser.launchArguments?.map((argument) =>+ argument.startsWith("--proxy-server=") ? "--proxy-server=<ephemeral-deny-proxy>" : argument,+ ),+ },+ container: {+ cpuLimit: runtime.provenance.container.cpuLimit,+ memoryLimitBytes: runtime.provenance.container.memoryLimitBytes,+ node: runtime.provenance.container.node,+ },+ docker: runtime.provenance.docker,+ workload: {+ settleMs: runtime.workload.settleMs,+ sampleIntervalMs: runtime.workload.sampleIntervalMs,+ settleSampleCount: runtime.workload.settleSampleCount,+ lcpObservationMs: runtime.workload.lcpObservationMs,+ lcpStabilityMs: runtime.workload.lcpStabilityMs,+ widgetDataQuietMs: runtime.workload.widgetDataQuietMs,+ spotlightIdleMs: runtime.workload.spotlightIdleMs,+ interactionIterations: runtime.workload.interactionIterations,+ widgetCount: runtime.workload.widgetCount,+ implementationMarkerPolicy: runtime.workload.implementationMarkerPolicy,+ routePaths: runtime.workload.routeTimings.map(({ path }) => path),+ pageSampleCount: runtime.workload.pageLoadSamples.length,+ },+});++const validateRuntime = (label: string, runtime: RuntimeResult, reasons: string[]) => {+ const expectedClaimScope = ["pageLoads", "largestContentfulPaint", "widgetDataSettled", "settleStability"];+ if (runtime.schemaVersion !== 7) reasons.push(`${label} runtime schema is not 7`);+ if (stable(runtime.claimScope) !== stable(expectedClaimScope)) {+ reasons.push(`${label} runtime claim scope is incomplete`);+ }+ if (!runtime.claimEligible || runtime.claimIneligibleReasons.length > 0) {+ reasons.push(`${label} runtime is not claim eligible`);+ }+ for (const metric of ["pageLoads", "largestContentfulPaint", "widgetDataSettled", "settleStability"]) {+ if (runtime.metricEligibility[metric]?.claimEligible !== true) {+ reasons.push(`${label} runtime metric ${metric} is not claim eligible`);+ }+ }+ if (runtime.workload.pageLoadSamples.length < 20) reasons.push(`${label} runtime has fewer than 20 page samples`);+ if (runtime.workload.lcpObservationMs < 5_000) reasons.push(`${label} runtime LCP observation is below 5000ms`);+ if (runtime.workload.widgetDataQuietMs < 500)+ reasons.push(`${label} runtime widget-data quiet window is below 500ms`);+ if (runtime.workload.settleMs < 600_000) reasons.push(`${label} runtime settle duration is below 600000ms`);+ const actualSettleSampleCount = runtime.checkpoints.filter(({ name }) => name.startsWith("settle-")).length;+ if (runtime.workload.settleSampleCount < 20 || actualSettleSampleCount < 20) {+ reasons.push(`${label} runtime has fewer than 20 settle samples`);+ }+ if (runtime.workload.settleSampleCount !== actualSettleSampleCount) {+ reasons.push(`${label} runtime settle sample count does not match checkpoints`);+ }+ const workloadCheckpoints = runtime.checkpoints.filter(({ name }) => name === "workload");+ const settleCheckpoints = runtime.checkpoints.filter(({ name }) => name.startsWith("settle-"));+ const expectedSettleNames = Array.from({ length: actualSettleSampleCount }, (_, index) => `settle-${index + 1}`);+ if (+ workloadCheckpoints.length !== 1 ||+ stable(settleCheckpoints.map(({ name }) => name)) !== stable(expectedSettleNames) ||+ runtime.checkpoints.some(({ capturedAt }) => !Number.isFinite(Date.parse(capturedAt))) ||+ runtime.checkpoints.some(+ ({ capturedAt }, index, checkpoints) =>+ index > 0 && Date.parse(capturedAt) < Date.parse(checkpoints[index - 1]?.capturedAt ?? ""),+ )+ ) {+ reasons.push(`${label} runtime checkpoint chronology is invalid`);+ }+ const workloadCapturedAt = Date.parse(workloadCheckpoints[0]?.capturedAt ?? "");+ const finalSettleCapturedAt = Date.parse(settleCheckpoints.at(-1)?.capturedAt ?? "");+ if (+ !Number.isFinite(workloadCapturedAt) ||+ !Number.isFinite(finalSettleCapturedAt) ||+ finalSettleCapturedAt - workloadCapturedAt < runtime.workload.settleMs+ ) {+ reasons.push(`${label} runtime checkpoint span is shorter than the declared settle duration`);+ }+ for (const metric of [+ "boardMountedMs",+ "fcpMs",+ "lcpFinalizedByInputMs",+ "lcpMs",+ "ttfbMs",+ "widgetImplementationsMountedMs",+ "widgetDataSettledMs",+ ] satisfies Array<keyof RuntimePageSample>) {+ const values = runtime.workload.pageLoadSamples.map((sample) => sample[metric]);+ if (+ values.some((value) => typeof value !== "number" || !Number.isFinite(value) || value < 0) ||+ runtimeMetric(runtime, metric).count !== runtime.workload.pageLoadSamples.length+ ) {+ reasons.push(`${label} runtime metric ${metric} has invalid or missing samples`);+ }+ }+ if (+ runtime.workload.pageLoadSamples.some(+ ({ lcpFinalizedByInputMs, lcpMs }) =>+ lcpFinalizedByInputMs < runtime.workload.lcpObservationMs || lcpMs > lcpFinalizedByInputMs,+ )+ ) {+ reasons.push(`${label} runtime LCP samples were not observed and finalized for the declared window`);+ }+ if (runtime.workload.widgetErrorCount !== 0) reasons.push(`${label} runtime rendered widget errors`);+ if (runtime.workload.widgetImplementationMarkerCount !== runtime.workload.widgetCount) {+ reasons.push(`${label} runtime did not mount every widget implementation`);+ }+ const webSocketCanaryProtocols = runtime.browserNetworkIsolation.canaries.webSockets.flatMap(+ ({ connectTarget, url }) => {+ try {+ const parsed = new URL(url);+ const defaultPort = parsed.protocol === "ws:" ? "80" : parsed.protocol === "wss:" ? "443" : null;+ return defaultPort && connectTarget === `${parsed.hostname}:${parsed.port || defaultPort}`+ ? [parsed.protocol]+ : [];+ } catch {+ return [];+ }+ },+ );+ if (+ !runtime.browserNetworkIsolation.active ||+ runtime.browserNetworkIsolation.unexpectedExternalResponses.length > 0 ||+ runtime.browserNetworkIsolation.externalBrowserWebSockets.length > 0 ||+ runtime.browserNetworkIsolation.canaries.http.status !== 502 ||+ runtime.browserNetworkIsolation.canaries.http.responseHeader !== "true" ||+ runtime.browserNetworkIsolation.canaries.http.attemptCount < 1 ||+ runtime.browserNetworkIsolation.canaries.webSockets.length !== 2 ||+ stable(webSocketCanaryProtocols.toSorted()) !== stable(["ws:", "wss:"]) ||+ runtime.browserNetworkIsolation.canaries.webSockets.some(+ ({+ attemptCount,+ browserEventCount,+ closeCount,+ errorEvent,+ frameReceivedCount,+ frameSentCount,+ opened,+ socketErrorCount,+ timedOut,+ }) =>+ attemptCount < 1 ||+ browserEventCount < 1 ||+ closeCount < 1 ||+ !errorEvent ||+ frameReceivedCount !== 0 ||+ frameSentCount !== 0 ||+ opened ||+ socketErrorCount < 1 ||+ timedOut,+ )+ ) {+ reasons.push(`${label} browser network is not isolated`);+ }+ if (+ !runtime.serverNetworkIsolation.active ||+ !runtime.serverNetworkIsolation.network.internal ||+ !runtime.serverNetworkIsolation.canary.domain.blocked ||+ !runtime.serverNetworkIsolation.canary.directIp.blocked+ ) {+ reasons.push(`${label} server network is not isolated`);+ }+ if (!runtime.provenance.container.network.internal) reasons.push(`${label} app container network is not internal`);+ if (!runtime.provenance.ingressProxy.excludedFromMemorySamples) {+ reasons.push(`${label} ingress proxy memory accounting is ambiguous`);+ }+};++const runtimeMetric = (runtime: RuntimeResult, key: keyof RuntimePageSample) =>+ summarize(runtime.workload.pageLoadSamples.map((sample) => sample[key]));++export const compareBenchmarkPair = (input: BenchmarkPairInput) => {+ const reasons: string[] = [];+ validateBuildSide("baseline", input.baselineBuilds, reasons);+ validateBuildSide("candidate", input.candidateBuilds, reasons);+ validateWarmup("baseline", input.baselineWarmup, input.baselineBuilds, reasons);+ validateWarmup("candidate", input.candidateWarmup, input.candidateBuilds, reasons);+ validateRuntime("baseline", input.baselineRuntime, reasons);+ validateRuntime("candidate", input.candidateRuntime, reasons);++ const baselineBuild = input.baselineBuilds[0];+ const candidateBuild = input.candidateBuilds[0];+ if (baselineBuild && candidateBuild) {+ if (baselineBuild.series.id !== candidateBuild.series.id) reasons.push("build series ids do not match");+ if (baselineBuild.builder === candidateBuild.builder) reasons.push("build sides reuse the same builder cache");+ if (baselineBuild.source.measuredRevision !== candidateBuild.source.measuredRevision) {+ reasons.push("build measured revisions do not match");+ }+ if (stable(baselineBuild.host) !== stable(candidateBuild.host)) reasons.push("build hosts do not match");+ if (+ `${baselineBuild.image.architecture}:${baselineBuild.image.targetPlatform}` !==+ `${candidateBuild.image.architecture}:${candidateBuild.image.targetPlatform}`+ ) {+ reasons.push("build image platforms do not match");+ }+ if (baselineBuild.source.baseFingerprint === candidateBuild.source.baseFingerprint) {+ reasons.push("baseline and candidate source fingerprints are identical");+ }++ const candidateByRepetition = new Map(+ input.candidateBuilds.map((build) => [build.series.repetition, build.source.syntheticSourceChange?.id]),+ );+ for (const build of input.baselineBuilds) {+ if (build.source.syntheticSourceChange?.id !== candidateByRepetition.get(build.series.repetition)) {+ reasons.push(`synthetic source change differs at repetition ${build.series.repetition}`);+ }+ }++ if (baselineBuild.series.totalRepetitions !== 2 || candidateBuild.series.totalRepetitions !== 2) {+ reasons.push("balanced build order currently requires exactly two repetitions per side");+ } else {+ const chronologicalRuns = [+ { build: input.baselineWarmup, label: "baseline:warmup" },+ { build: input.candidateWarmup, label: "candidate:warmup" },+ ...input.baselineBuilds.map((build) => ({ build, label: `baseline:${build.series.repetition}` })),+ ...input.candidateBuilds.map((build) => ({ build, label: `candidate:${build.series.repetition}` })),+ ].toSorted((left, right) => Date.parse(left.build.run.startedAt) - Date.parse(right.build.run.startedAt));+ const chronologicalOrder = chronologicalRuns.map(({ label }) => label);+ if (+ stable(chronologicalOrder) !==+ stable(["baseline:warmup", "candidate:warmup", "baseline:1", "candidate:1", "candidate:2", "baseline:2"])+ ) {+ reasons.push(+ "build execution order is not cold-warmup baseline-candidate then balanced baseline-candidate-candidate-baseline",+ );+ }+ for (let index = 1; index < chronologicalRuns.length; index += 1) {+ const previous = chronologicalRuns[index - 1];+ const current = chronologicalRuns[index];+ if (+ previous &&+ current &&+ Date.parse(previous.build.run.finishedAt) > Date.parse(current.build.run.startedAt)+ ) {+ reasons.push(`build runs overlap between ${previous.label} and ${current.label}`);+ }+ }+ }++ if (input.baselineRuntime.image.sourceFingerprint !== baselineBuild.source.baseFingerprint) {+ reasons.push("baseline runtime image does not match the baseline build source");+ }+ if (input.baselineRuntime.image.sourceFingerprint !== input.baselineWarmup.image.sourceFingerprint) {+ reasons.push("baseline runtime image does not match the baseline warmup image");+ }+ if (input.candidateRuntime.image.sourceFingerprint !== input.candidateWarmup.image.sourceFingerprint) {+ reasons.push("candidate runtime image does not match the candidate warmup image");+ }+ if (+ input.baselineRuntime.image.id !== input.baselineWarmup.image.id ||+ input.baselineRuntime.image.digest !== input.baselineWarmup.image.digest+ ) {+ reasons.push("baseline runtime image identity does not match the baseline warmup image");+ }+ if (+ input.candidateRuntime.image.id !== input.candidateWarmup.image.id ||+ input.candidateRuntime.image.digest !== input.candidateWarmup.image.digest+ ) {+ reasons.push("candidate runtime image identity does not match the candidate warmup image");+ }+ if (input.candidateRuntime.image.sourceFingerprint !== candidateBuild.source.baseFingerprint) {+ reasons.push("candidate runtime image does not match the candidate build source");+ }+ if (+ input.baselineRuntime.image.revision !== baselineBuild.source.measuredRevision ||+ input.candidateRuntime.image.revision !== candidateBuild.source.measuredRevision+ ) {+ reasons.push("runtime image revisions do not match their build revisions");+ }+ }++ if (input.baselineRuntime.image.revision !== input.candidateRuntime.image.revision) {+ reasons.push("runtime image revisions do not match");+ }+ if (input.baselineRuntime.image.architecture !== input.candidateRuntime.image.architecture) {+ reasons.push("runtime image architectures do not match");+ }+ if (stable(runtimeConfiguration(input.baselineRuntime)) !== stable(runtimeConfiguration(input.candidateRuntime))) {+ reasons.push("runtime host, browser, container, or workload configuration does not match");+ }+ if (stable(input.baselineRuntime.claimScope) !== stable(input.candidateRuntime.claimScope)) {+ reasons.push("runtime claim scopes do not match");+ }+ if (input.baselineRuntime.workload.spotlightIdlePolicy !== "mounted") {+ reasons.push("baseline Spotlight idle policy is not mounted");+ }+ if (input.candidateRuntime.workload.spotlightIdlePolicy !== "preload-only") {+ reasons.push("candidate Spotlight idle policy is not preload-only");+ }++ const buildMetric = (key: "wallTimeMs" | "nextCompileMs") => {+ const baseline = summarize(input.baselineBuilds.map(({ build }) => build[key]));+ const candidate = summarize(input.candidateBuilds.map(({ build }) => build[key]));+ return { baseline, candidate, comparison: improvement(baseline.median, candidate.median) };+ };+ const pageMetric = (key: keyof RuntimePageSample) => {+ const baseline = runtimeMetric(input.baselineRuntime, key);+ const candidate = runtimeMetric(input.candidateRuntime, key);+ return { baseline, candidate, comparison: improvement(baseline.median, candidate.median) };+ };++ return {+ schemaVersion: 1,+ claimEligible: reasons.length === 0,+ claimIneligibleReasons: unique(reasons),+ claimScope: {+ build: "alternating warm incremental Docker source rebuilds",+ runtime: "fresh authenticated Chromium documents against one warmed, network-isolated app container",+ },+ limitations: [+ "build series report controlled medians, not statistical significance",+ "runtime documents share one warmed server",+ "widget settlement covers observed non-subscription tRPC requests followed by the configured quiet window",+ "startup, RAM levels, initial bundle data, and cold Spotlight timings remain single-container diagnostics",+ ],+ build: {+ seriesId: baselineBuild?.series.id ?? null,+ baselineFingerprint: baselineBuild?.source.baseFingerprint ?? null,+ candidateFingerprint: candidateBuild?.source.baseFingerprint ?? null,+ wallTimeMs: buildMetric("wallTimeMs"),+ nextCompileMs: buildMetric("nextCompileMs"),+ },+ runtime: {+ boardMountedMs: pageMetric("boardMountedMs"),+ fcpMs: pageMetric("fcpMs"),+ lcpMs: pageMetric("lcpMs"),+ ttfbMs: pageMetric("ttfbMs"),+ widgetImplementationsMountedMs: pageMetric("widgetImplementationsMountedMs"),+ widgetDataSettledMs: pageMetric("widgetDataSettledMs"),+ },+ diagnostics: {+ baseline: {+ startToReadyMs: input.baselineRuntime.workload.startToReadyMs,+ coldSpotlightFeedbackMs: input.baselineRuntime.workload.coldSpotlightFeedbackMs,+ coldSpotlightReadyMs: input.baselineRuntime.workload.coldSpotlightReadyMs,+ postIdleFirstOpenMs: input.baselineRuntime.workload.postIdleWarmInteractionMs,+ memory: input.baselineRuntime.summary,+ },+ candidate: {+ startToReadyMs: input.candidateRuntime.workload.startToReadyMs,+ coldSpotlightFeedbackMs: input.candidateRuntime.workload.coldSpotlightFeedbackMs,+ coldSpotlightReadyMs: input.candidateRuntime.workload.coldSpotlightReadyMs,+ postIdleFirstOpenMs: input.candidateRuntime.workload.postIdleWarmInteractionMs,+ memory: input.candidateRuntime.summary,+ },+ },+ };+};++export type { BuildResult, RuntimeResult };diff --git a/scripts/benchmarks/benchmark-pair-lib.spec.ts b/scripts/benchmarks/benchmark-pair-lib.spec.tsnew file mode 100644index 000000000..be8477dba--- /dev/null+++ b/scripts/benchmarks/benchmark-pair-lib.spec.ts@@ -0,0 +1,360 @@+import { describe, expect, it } from "vitest";++import type { BenchmarkPairInput, BuildResult, RuntimeResult } from "./benchmark-pair-lib.mts";+import { compareBenchmarkPair } from "./benchmark-pair-lib.mts";++const runWindow = (index: number) => {+ const startedAt = new Date(Date.UTC(2026, 0, 1, 0, 0, index * 2)).toISOString();+ const finishedAt = new Date(Date.UTC(2026, 0, 1, 0, 0, index * 2 + 1)).toISOString();+ return { startedAt, finishedAt };+};++const expectedCache = [{ logicalId: "pnpm-store", target: "/pnpm/store", mustIncreaseUsage: true }];+const cacheStability = { attempts: 6, pollIntervalMs: 2_000, stableForMs: 10_000, timeoutMs: 30_000 };+const cacheSnapshot = (side: "baseline" | "candidate", stage: "empty" | "warm" | "r1" | "r2") => ({+ cacheMountCount: stage === "empty" ? 0 : 1,+ cacheMounts:+ stage === "empty"+ ? []+ : [+ {+ logicalId: "pnpm-store",+ recordId: `${side}-pnpm-record`,+ target: "/pnpm/store",+ usageCount: { warm: 1, r1: 2, r2: 3 }[stage],+ },+ ],+ recordCount: stage === "empty" ? 0 : { warm: 10, r1: 12, r2: 14 }[stage],+ recordsFingerprint: `${side}-${stage}`,+});++const build = (side: "baseline" | "candidate", repetition: number): BuildResult => ({+ schemaVersion: 4,+ createdAt: runWindow(side === "baseline" ? (repetition === 1 ? 2 : 5) : repetition === 1 ? 3 : 4).finishedAt,+ run: runWindow(side === "baseline" ? (repetition === 1 ? 2 : 5) : repetition === 1 ? 3 : 4),+ claimEligible: true,+ claimIneligibleReasons: [],+ mode: "source-change",+ builder: `${side}-builder`,+ runLabel: side,+ declaredRevision: "head+worktree",+ series: { id: "series", cacheState: "warm", repetition, totalRepetitions: 2 },+ source: {+ headSha: "head",+ measuredRevision: "head+worktree",+ fingerprint: `${side}-change-${repetition}`,+ baseFingerprint: `${side}-fingerprint`,+ syntheticSourceChange: { file: "layout.tsx", id: `change-${repetition}` },+ },+ host: {+ architecture: "arm64",+ dockerServer: { architecture: "arm64", operatingSystem: "linux", targetPlatform: "linux/arm64", version: "1" },+ platform: "darwin",+ },+ image: {+ architecture: "arm64",+ digest: null,+ id: `${side}-build-${repetition}`,+ revision: "head+worktree",+ sourceFingerprint: `${side}-change-${repetition}`,+ targetPlatform: "linux/arm64",+ },+ builderCache: {+ expected: expectedCache,+ before: cacheSnapshot(side, repetition === 1 ? "warm" : "r1"),+ after: cacheSnapshot(side, repetition === 1 ? "r1" : "r2"),+ afterStability: cacheStability,+ },+ build: { nextCompileMs: side === "baseline" ? 200 : 100, wallTimeMs: side === "baseline" ? 300 : 150 },+});++const warmup = (side: "baseline" | "candidate"): BuildResult => {+ const run = runWindow(side === "baseline" ? 0 : 1);+ return {+ schemaVersion: 4,+ createdAt: run.finishedAt,+ run,+ claimEligible: false,+ claimIneligibleReasons: ["cached mode does not force an application rebuild"],+ mode: "cached",+ builder: `${side}-builder`,+ runLabel: side,+ declaredRevision: "head+worktree",+ series: { id: "series", cacheState: "cold", repetition: 1, totalRepetitions: 2 },+ source: {+ headSha: "head",+ measuredRevision: "head+worktree",+ fingerprint: `${side}-fingerprint`,+ baseFingerprint: `${side}-fingerprint`,+ syntheticSourceChange: null,+ },+ host: {+ architecture: "arm64",+ dockerServer: {+ architecture: "arm64",+ operatingSystem: "linux",+ targetPlatform: "linux/arm64",+ version: "1",+ },+ platform: "darwin",+ },+ image: {+ architecture: "arm64",+ digest: null,+ id: `${side}-runtime-image`,+ revision: "head+worktree",+ sourceFingerprint: `${side}-fingerprint`,+ targetPlatform: "linux/arm64",+ },+ builderCache: {+ expected: expectedCache,+ before: cacheSnapshot(side, "empty"),+ after: cacheSnapshot(side, "warm"),+ afterStability: cacheStability,+ },+ build: { nextCompileMs: side === "baseline" ? 400 : 300, wallTimeMs: side === "baseline" ? 500 : 400 },+ };+};++const runtimeSample = (value: number) => ({+ boardMountedMs: value,+ fcpMs: value,+ lcpFinalizedByInputMs: 5_100,+ lcpMs: value,+ ttfbMs: value,+ widgetImplementationsMountedMs: value,+ widgetDataSettledMs: value,+});++const runtime = (side: "baseline" | "candidate"): RuntimeResult => {+ return {+ schemaVersion: 7,+ claimEligible: true,+ claimIneligibleReasons: [],+ claimScope: ["pageLoads", "largestContentfulPaint", "widgetDataSettled", "settleStability"],+ metricEligibility: Object.fromEntries(+ ["pageLoads", "largestContentfulPaint", "widgetDataSettled", "settleStability"].map((key) => [+ key,+ { claimEligible: true },+ ]),+ ),+ image: {+ architecture: "arm64",+ digest: null,+ id: `${side}-runtime-image`,+ revision: "head+worktree",+ sourceFingerprint: `${side}-fingerprint`,+ },+ host: { architecture: "arm64", node: { version: "24", v8Version: "13" }, platform: "darwin", release: "1" },+ provenance: {+ browser: {+ engine: "chromium",+ executablePath: "/chromium",+ headless: true,+ httpCachePolicy: "default",+ launchArguments: [`--proxy-server=http://127.0.0.1:${side === "baseline" ? "31001" : "32002"}`],+ version: "1",+ viewport: { width: 1280, height: 720 },+ },+ container: {+ cpuLimit: 2,+ memoryLimitBytes: 1024,+ network: { internal: true },+ node: { architecture: "arm64", platform: "linux", version: "24", v8Version: "13" },+ },+ docker: { engine: { version: "1" }, version: { version: "1" } },+ ingressProxy: { excludedFromMemorySamples: true, implementation: "Node.js TCP proxy" },+ },+ browserNetworkIsolation: {+ active: true,+ canaries: {+ http: { attemptCount: 1, responseHeader: "true", status: 502 },+ webSockets: [+ { connectTarget: "browser-ws.invalid:80", url: "ws://browser-ws.invalid/canary" },+ { connectTarget: "browser-wss.invalid:443", url: "wss://browser-wss.invalid/canary" },+ ].map((canary) => ({+ ...canary,+ attemptCount: 1,+ browserEventCount: 1,+ closeCount: 1,+ errorEvent: true,+ frameReceivedCount: 0,+ frameSentCount: 0,+ opened: false,+ socketErrorCount: 1,+ timedOut: false,+ })),+ },+ externalBrowserWebSockets: [],+ unexpectedExternalResponses: [],+ },+ serverNetworkIsolation: {+ active: true,+ canary: { directIp: { blocked: true }, domain: { blocked: true } },+ network: { internal: true },+ },+ workload: {+ settleMs: 600_000,+ sampleIntervalMs: 30_000,+ settleSampleCount: 20,+ lcpObservationMs: 5_000,+ lcpStabilityMs: 500,+ widgetDataQuietMs: 500,+ spotlightIdleMs: 2_500,+ spotlightIdlePolicy: side === "baseline" ? "mounted" : "preload-only",+ interactionIterations: 7,+ widgetCount: 32,+ implementationMarkerPolicy: "true",+ widgetImplementationMarkerCount: 32,+ widgetErrorCount: 0,+ startToReadyMs: 1_000,+ coldSpotlightFeedbackMs: 20,+ coldSpotlightReadyMs: 200,+ postIdleWarmInteractionMs: 30,+ routeTimings: [{ path: "/manage" }],+ pageLoadSamples: Array.from({ length: 20 }, () => runtimeSample(side === "baseline" ? 200 : 100)),+ },+ checkpoints: [+ { capturedAt: new Date(0).toISOString(), name: "startup" },+ { capturedAt: new Date(1_000).toISOString(), name: "workload" },+ ...Array.from({ length: 20 }, (_, index) => ({+ capturedAt: new Date(1_000 + (index + 1) * 30_000).toISOString(),+ name: `settle-${index + 1}`,+ })),+ ],+ summary: { startupBytes: 1, workloadBytes: 2, settledBytes: 2, peakBytes: 3 },+ };+};++const validInput = (): BenchmarkPairInput => ({+ baselineWarmup: warmup("baseline"),+ candidateWarmup: warmup("candidate"),+ baselineBuilds: [build("baseline", 1), build("baseline", 2)],+ candidateBuilds: [build("candidate", 1), build("candidate", 2)],+ baselineRuntime: runtime("baseline"),+ candidateRuntime: runtime("candidate"),+});++describe("benchmark pair validation", () => {+ it("accepts a complete, isolated, provenance-matched comparison", () => {+ const result = compareBenchmarkPair(validInput());++ expect(result.claimEligible).toBe(true);+ expect(result.claimIneligibleReasons).toEqual([]);+ expect(result.runtime.lcpMs.comparison).toMatchObject({ baseline: 200, candidate: 100, improvementPercent: 50 });+ });++ it("rejects an incomplete build series", () => {+ const input = validInput();+ input.candidateBuilds.pop();++ expect(compareBenchmarkPair(input).claimIneligibleReasons).toContain("candidate build repetitions are incomplete");+ });++ it("rejects runtime source drift and uncontrolled server egress", () => {+ const input = validInput();+ input.candidateRuntime.image.sourceFingerprint = "wrong";+ input.candidateRuntime.serverNetworkIsolation.canary.directIp.blocked = false;++ const result = compareBenchmarkPair(input);+ expect(result.claimEligible).toBe(false);+ expect(result.claimIneligibleReasons).toContain(+ "candidate runtime image does not match the candidate build source",+ );+ expect(result.claimIneligibleReasons).toContain("candidate server network is not isolated");+ });++ it("rejects runtime evidence without blocked HTTP, WS, and WSS browser canaries", () => {+ const input = validInput();+ const wssCanary = input.candidateRuntime.browserNetworkIsolation.canaries.webSockets[1];+ if (!wssCanary) throw new Error("Missing WSS canary fixture");+ wssCanary.opened = true;++ expect(compareBenchmarkPair(input).claimIneligibleReasons).toContain("candidate browser network is not isolated");+ });++ it("requires one WS and one WSS browser isolation canary", () => {+ const input = validInput();+ const wssCanary = input.candidateRuntime.browserNetworkIsolation.canaries.webSockets[1];+ if (!wssCanary) throw new Error("Missing WSS canary fixture");+ wssCanary.url = "ws://second-browser-ws.invalid/canary";+ wssCanary.connectTarget = "second-browser-ws.invalid:80";++ expect(compareBenchmarkPair(input).claimIneligibleReasons).toContain("candidate browser network is not isolated");+ });++ it("recomputes runtime claim minima instead of trusting embedded eligibility flags", () => {+ const input = validInput();+ input.candidateRuntime.claimScope = [];+ input.candidateRuntime.workload.lcpObservationMs = 1_000;+ input.candidateRuntime.workload.widgetDataQuietMs = 100;+ input.candidateRuntime.workload.settleMs = 1_000;+ input.candidateRuntime.workload.settleSampleCount = 19;+ input.candidateRuntime.checkpoints.pop();+ const firstSample = input.candidateRuntime.workload.pageLoadSamples[0];+ if (!firstSample) throw new Error("Missing runtime sample fixture");+ firstSample.lcpMs = Number.POSITIVE_INFINITY;++ const reasons = compareBenchmarkPair(input).claimIneligibleReasons;+ expect(reasons).toContain("candidate runtime claim scope is incomplete");+ expect(reasons).toContain("candidate runtime LCP observation is below 5000ms");+ expect(reasons).toContain("candidate runtime widget-data quiet window is below 500ms");+ expect(reasons).toContain("candidate runtime settle duration is below 600000ms");+ expect(reasons).toContain("candidate runtime has fewer than 20 settle samples");+ expect(reasons).toContain("candidate runtime metric lcpMs has invalid or missing samples");+ });++ it("recomputes measured cache-mount use instead of trusting build eligibility flags", () => {+ const input = validInput();+ const firstBuild = input.candidateBuilds[0];+ const beforeMount = firstBuild?.builderCache.before?.cacheMounts[0];+ const afterMount = firstBuild?.builderCache.after?.cacheMounts[0];+ if (!beforeMount || !afterMount) throw new Error("Missing cache mount fixture");+ afterMount.usageCount = beforeMount.usageCount;++ expect(compareBenchmarkPair(input).claimIneligibleReasons).toContain(+ "candidate repetition 1 build cache mount pnpm-store usage did not increase",+ );+ });++ it("verifies actual settle chronology, LCP finalization, and immutable build fingerprints", () => {+ const input = validInput();+ const finalSettle = input.candidateRuntime.checkpoints.at(-1);+ const firstSample = input.candidateRuntime.workload.pageLoadSamples[0];+ const firstBuild = input.candidateBuilds[0];+ if (!finalSettle || !firstSample || !firstBuild) throw new Error("Missing evidence fixture");+ finalSettle.capturedAt = new Date(500_000).toISOString();+ firstSample.lcpFinalizedByInputMs = 4_999;+ firstBuild.image.sourceFingerprint = "wrong-fingerprint";++ const reasons = compareBenchmarkPair(input).claimIneligibleReasons;+ expect(reasons).toContain("candidate runtime checkpoint span is shorter than the declared settle duration");+ expect(reasons).toContain("candidate runtime LCP samples were not observed and finalized for the declared window");+ expect(reasons).toContain("candidate build image fingerprint does not match its immutable source snapshot");+ });++ it("rejects a contaminated warmup or cache use outside the measured chain", () => {+ const input = validInput();+ if (input.candidateWarmup.builderCache.before) input.candidateWarmup.builderCache.before.recordCount = 1;+ if (input.baselineBuilds[0]?.builderCache.before) {+ input.baselineBuilds[0].builderCache.before.recordsFingerprint = "unrecorded-cache-use";+ }++ const result = compareBenchmarkPair(input);+ expect(result.claimIneligibleReasons).toContain("candidate warmup builder did not begin empty");+ expect(result.claimIneligibleReasons).toContain("baseline builder cache changed outside repetition 1");+ });++ it("rejects overlapping builds and a stale runtime image with copied labels", () => {+ const input = validInput();+ const candidateFirst = input.candidateBuilds[0];+ if (candidateFirst) candidateFirst.run.startedAt = input.baselineBuilds[0]?.run.startedAt ?? "";+ input.candidateRuntime.image.id = "stale-image-with-matching-labels";++ const result = compareBenchmarkPair(input);+ expect(result.claimIneligibleReasons).toContain("build runs overlap between baseline:1 and candidate:1");+ expect(result.claimIneligibleReasons).toContain(+ "candidate runtime image identity does not match the candidate warmup image",+ );+ });+});diff --git a/scripts/benchmarks/board-static-graph.mts b/scripts/benchmarks/board-static-graph.mtsnew file mode 100644index 000000000..8c7dda589--- /dev/null+++ b/scripts/benchmarks/board-static-graph.mts@@ -0,0 +1,235 @@+import fs from "node:fs";+import path from "node:path";+import { pathToFileURL } from "node:url";+import { parse } from "@babel/parser";++export const getRuntimeModuleSpecifiers = (sourceText: string, fileName: string) => {+ try {+ const ast = parse(sourceText, { sourceFilename: fileName, sourceType: "module", plugins: ["typescript", "jsx"] });+ return ast.program.body.flatMap((statement) => {+ if (statement.type === "ImportDeclaration") {+ if (statement.importKind === "type" || statement.importKind === "typeof") return [];+ const hasRuntimeBinding =+ statement.specifiers.length === 0 ||+ statement.specifiers.some(+ (specifier) => specifier.type !== "ImportSpecifier" || specifier.importKind !== "type",+ );+ return hasRuntimeBinding ? [statement.source.value] : [];+ }+ if (statement.type === "ExportAllDeclaration") {+ return statement.exportKind === "type" ? [] : [statement.source.value];+ }+ if (statement.type === "ExportNamedDeclaration" && statement.source) {+ if (statement.exportKind === "type") return [];+ const hasRuntimeBinding =+ statement.specifiers.length === 0 ||+ statement.specifiers.some((specifier) => specifier.exportKind !== "type");+ return hasRuntimeBinding ? [statement.source.value] : [];+ }+ return [];+ });+ } catch (error) {+ throw new Error(`Unable to parse static imports in ${fileName}`, { cause: error });+ }+};++const canonicalize = (fileName: string) => {+ try {+ return fs.realpathSync.native(fileName);+ } catch {+ return path.resolve(fileName);+ }+};++const resolveFile = (candidate: string) => {+ const candidates = path.extname(candidate)+ ? [candidate]+ : [+ candidate,+ `${candidate}.ts`,+ `${candidate}.tsx`,+ `${candidate}.mts`,+ `${candidate}.js`,+ `${candidate}.jsx`,+ path.join(candidate, "index.ts"),+ path.join(candidate, "index.tsx"),+ path.join(candidate, "index.mts"),+ path.join(candidate, "index.js"),+ ];+ return candidates.find((fileName) => fs.existsSync(fileName) && fs.statSync(fileName).isFile()) ?? null;+};++const firstExportTarget = (value: unknown): string | null => {+ if (typeof value === "string") return value;+ if (!value || typeof value !== "object") return null;+ for (const nested of Object.values(value)) {+ const target = firstExportTarget(nested);+ if (target) return target;+ }+ return null;+};++const getPackageName = (specifier: string) => specifier.split("/").slice(0, 2).join("/");++const resolvePackageExport = (exports: unknown, exportKey: string) => {+ if (exportKey === "." && typeof exports === "string") return exports;+ if (!exports || typeof exports !== "object") return null;+ const exportMap = exports as Record<string, unknown>;+ const exact = firstExportTarget(exportMap[exportKey]);+ if (exact) return exact;++ for (const [pattern, value] of Object.entries(exportMap)) {+ const wildcard = pattern.indexOf("*");+ if (wildcard < 0) continue;+ const prefix = pattern.slice(0, wildcard);+ const suffix = pattern.slice(wildcard + 1);+ if (!exportKey.startsWith(prefix) || !exportKey.endsWith(suffix)) continue;+ const match = exportKey.slice(prefix.length, exportKey.length - suffix.length);+ const target = firstExportTarget(value);+ if (target) return target.replaceAll("*", match);+ }+ return null;+};++const getWorkspacePackages = (root: string) => {+ const packages = new Map<string, { directory: string; exports: unknown }>();+ for (const parent of ["apps", "packages", "tooling"]) {+ const parentDirectory = path.join(root, parent);+ if (!fs.existsSync(parentDirectory)) continue;+ for (const directoryEntry of fs.readdirSync(parentDirectory, { withFileTypes: true })) {+ if (!directoryEntry.isDirectory()) continue;+ const directory = path.join(parentDirectory, directoryEntry.name);+ const manifestPath = path.join(directory, "package.json");+ if (!fs.existsSync(manifestPath)) continue;+ const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8")) as { name?: string; exports?: unknown };+ if (manifest.name) packages.set(manifest.name, { directory, exports: manifest.exports });+ }+ }+ return packages;+};++export const collectBoardStaticGraph = (repositoryRoot: string) => {+ const root = canonicalize(repositoryRoot);+ const entries = [+ "apps/nextjs/src/app/[locale]/layout.tsx",+ "apps/nextjs/src/app/[locale]/(home)/(board)/layout.tsx",+ "apps/nextjs/src/app/[locale]/(home)/(board)/page.tsx",+ "apps/nextjs/src/app/[locale]/boards/(content)/[name]/(board)/layout.tsx",+ "apps/nextjs/src/app/[locale]/boards/(content)/[name]/(board)/page.tsx",+ "apps/nextjs/src/app/[locale]/boards/(content)/_client.tsx",+ ].map((entry) => path.join(root, entry));+ const workspacePackages = getWorkspacePackages(root);+ const unresolvedWorkspaceImports: Array<{ importer: string; specifier: string }> = [];++ const resolveSpecifier = (specifier: string, importer: string) => {+ if (specifier.startsWith(".")) return resolveFile(path.resolve(path.dirname(importer), specifier));+ if (specifier.startsWith("~/")) return resolveFile(path.join(root, "apps/nextjs/src", specifier.slice(2)));+ if (specifier.startsWith("@static-data/")) {+ return resolveFile(path.join(root, "static-data", specifier.slice("@static-data/".length)));+ }+ if (!specifier.startsWith("@homarr/") || specifier === "@homarr/node-unifi") return null;++ const [, , ...subpathParts] = specifier.split("/");+ const workspacePackage = workspacePackages.get(getPackageName(specifier));+ if (!workspacePackage) return null;+ const exportKey = subpathParts.length === 0 ? "." : `./${subpathParts.join("/")}`;+ const target = resolvePackageExport(workspacePackage.exports, exportKey);+ return target ? resolveFile(path.resolve(workspacePackage.directory, target)) : null;+ };++ const queue = [...entries];+ const visited = new Set<string>();+ const parents = new Map<string, { importer: string; specifier: string }>();+ const bareWidgetImports: Array<{ importer: string; specifier: string }> = [];+ const forbiddenModules = new Set([+ path.join(root, "packages/widgets/index.ts"),+ path.join(root, "packages/widgets/src/index.tsx"),+ path.join(root, "packages/spotlight/src/component.ts"),+ path.join(root, "packages/spotlight/src/components/spotlight.tsx"),+ path.join(root, "packages/spotlight/src/spotlight-store.ts"),+ path.join(root, "packages/widgets/src/modals/widget-edit-modal.tsx"),+ path.join(root, "apps/nextjs/src/components/board/items/item-move-modal.tsx"),+ path.join(root, "apps/nextjs/src/components/onboarding/board-tour.tsx"),+ path.join(root, "apps/nextjs/src/components/onboarding/tour-shell.tsx"),+ ]);++ while (queue.length > 0) {+ const next = queue.shift();+ if (!next) continue;+ const current = canonicalize(next);+ if (visited.has(current)) continue;+ visited.add(current);+ if (!/\.[cm]?[jt]sx?$/.test(current)) continue;++ const sourceText = fs.readFileSync(current, "utf8");+ for (const specifier of getRuntimeModuleSpecifiers(sourceText, current)) {+ if (specifier === "@homarr/widgets") bareWidgetImports.push({ importer: current, specifier });+ const resolved = resolveSpecifier(specifier, current);+ if (!resolved) {+ if (workspacePackages.has(getPackageName(specifier))) {+ unresolvedWorkspaceImports.push({ importer: current, specifier });+ }+ continue;+ }+ const target = canonicalize(resolved);+ if (!target.startsWith(`${root}${path.sep}`) || target.includes(`${path.sep}node_modules${path.sep}`)) continue;+ if (!parents.has(target)) parents.set(target, { importer: current, specifier });+ queue.push(target);+ }+ }++ const reachedForbiddenModules = [...forbiddenModules].filter((fileName) => visited.has(fileName));+ const formatChain = (target: string) => {+ const chain = [path.relative(root, target)];+ let current = target;+ while (parents.has(current)) {+ const parent = parents.get(current);+ if (!parent) break;+ chain.unshift(`${path.relative(root, parent.importer)} --${parent.specifier}-->`);+ current = parent.importer;+ }+ return chain.join(" ");+ };++ return {+ entries: entries.map((entry) => path.relative(root, entry)),+ visitedModuleCount: visited.size,+ bareWidgetImports: bareWidgetImports.map(({ importer, specifier }) => ({+ importer: path.relative(root, importer),+ specifier,+ })),+ reachedForbiddenModules: reachedForbiddenModules.map(formatChain),+ unresolvedWorkspaceImports: unresolvedWorkspaceImports.map(({ importer, specifier }) => ({+ importer: path.relative(root, importer),+ specifier,+ })),+ };+};++const run = () => {+ const repositoryRoot = path.resolve(process.env.BOARD_GRAPH_ROOT ?? ".");+ const result = collectBoardStaticGraph(repositoryRoot);+ if (+ result.bareWidgetImports.length > 0 ||+ result.reachedForbiddenModules.length > 0 ||+ result.unresolvedWorkspaceImports.length > 0+ ) {+ throw new Error(`Board static graph reaches a forbidden eager module:\n${JSON.stringify(result, null, 2)}`);+ }+ console.log(+ JSON.stringify(+ {+ ...result,+ eagerWidgetRegistryReachable: false,+ eagerSpotlightImplementationReachable: false,+ eagerWidgetEditorReachable: false,+ eagerItemMoveEditorReachable: false,+ eagerBoardTourReachable: false,+ },+ null,+ 2,+ ),+ );+};++if (process.argv[1] && import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href) run();diff --git a/scripts/benchmarks/board-static-graph.spec.ts b/scripts/benchmarks/board-static-graph.spec.tsnew file mode 100644index 000000000..dede54b7d--- /dev/null+++ b/scripts/benchmarks/board-static-graph.spec.ts@@ -0,0 +1,37 @@+import path from "node:path";+import { describe, expect, it } from "vitest";++import { collectBoardStaticGraph, getRuntimeModuleSpecifiers } from "./board-static-graph.mts";++describe("board static dependency graph", () => {+ it("ignores type-only and dynamic imports", () => {+ expect(+ getRuntimeModuleSpecifiers(+ [+ 'import type { A } from "type-only";',+ 'import { type B } from "also-type-only";',+ 'import { C, type D } from "runtime";',+ 'export type { E } from "export-type";',+ 'export { type F } from "also-export-type";',+ 'export { G } from "runtime-export";',+ 'export * from "runtime-star";',+ 'import "runtime-side-effect";',+ "import {",+ " H,",+ " type I,",+ '} from "runtime-multiline";',+ 'void import("lazy");',+ ].join("\n"),+ "fixture.ts",+ ),+ ).toEqual(["runtime", "runtime-export", "runtime-star", "runtime-side-effect", "runtime-multiline"]);+ });++ it("keeps widget registries, editors, Spotlight, and onboarding tour out of the board's static graph", () => {+ const result = collectBoardStaticGraph(path.resolve("."));+ expect(result.visitedModuleCount).toBeGreaterThan(0);+ expect(result.bareWidgetImports).toEqual([]);+ expect(result.reachedForbiddenModules).toEqual([]);+ expect(result.unresolvedWorkspaceImports).toEqual([]);+ });+});diff --git a/scripts/benchmarks/dev-benchmark-lib.mts b/scripts/benchmarks/dev-benchmark-lib.mtsnew file mode 100644index 000000000..4113eaaf3--- /dev/null+++ b/scripts/benchmarks/dev-benchmark-lib.mts@@ -0,0 +1,81 @@+export type NumericSummary = {+ count: number;+ min: number | null;+ median: number | null;+ p95: number | null;+ max: number | null;+ standardDeviation: number | null;+ outliers: number[];+};++export const normalizeTrpcPath = (requestUrl: string) => {+ try {+ const url = new URL(requestUrl, "http://benchmark.invalid");+ url.searchParams.sort();+ return url.pathname + url.search;+ } catch {+ return requestUrl;+ }+};++export const countDuplicateTrpcPaths = (requestUrls: string[]) => {+ const paths = requestUrls.map(normalizeTrpcPath);+ return Math.max(0, paths.length - new Set(paths).size);+};++const values = (numbers: Array<number | null | undefined>) =>+ numbers.filter((value): value is number => typeof value === "number" && value >= 0).toSorted((a, b) => a - b);++export const summarize = (numbers: Array<number | null | undefined>): NumericSummary => {+ const sorted = values(numbers);+ if (sorted.length === 0) {+ return { count: 0, min: null, median: null, p95: null, max: null, standardDeviation: null, outliers: [] };+ }++ const middleIndex = Math.floor(sorted.length / 2);+ let median = sorted[middleIndex] ?? 0;+ if (sorted.length % 2 === 0) {+ median = ((sorted[middleIndex - 1] ?? 0) + median) / 2;+ }+ const p95Index = Math.min(sorted.length - 1, Math.ceil(sorted.length * 0.95) - 1);+ const mean = sorted.reduce((total, value) => total + value, 0) / sorted.length;+ const variance = sorted.reduce((total, value) => total + (value - mean) ** 2, 0) / sorted.length;+ const firstQuartile = sorted[Math.floor((sorted.length - 1) * 0.25)] ?? 0;+ const thirdQuartile = sorted[Math.floor((sorted.length - 1) * 0.75)] ?? 0;+ const iqr = thirdQuartile - firstQuartile;+ const outlierLimit = thirdQuartile + Math.max(1, iqr * 1.5);++ return {+ count: sorted.length,+ min: sorted[0] ?? null,+ median,+ p95: sorted.length >= 20 ? (sorted[p95Index] ?? null) : null,+ max: sorted.at(-1) ?? null,+ standardDeviation: Math.round(Math.sqrt(variance)),+ outliers: sorted.filter((value) => value > outlierLimit),+ };+};++export const validateBrowserMeasurement = (measurement: {+ responseStatus: number | null;+ domContentLoadedMs: number;+ boardHydratedMs: number | null;+ widgetsReadyMs?: number | null;+ widgetCount?: number;+ coldImmediateInteractionMs?: number | null;+ postIdleWarmInteractionMs?: number | null;+ error?: string;+}) => {+ const errors: string[] = [];+ if (measurement.error) errors.push(measurement.error);+ if (measurement.responseStatus === null) errors.push("browser navigation returned no response");+ else if (measurement.responseStatus < 200 || measurement.responseStatus >= 300)+ errors.push(`browser navigation returned HTTP ${measurement.responseStatus}`);+ if (measurement.domContentLoadedMs < 0) errors.push("DOMContentLoaded timing is missing");+ if (measurement.boardHydratedMs === null) errors.push("board hydration marker is missing");+ if (measurement.widgetsReadyMs === null) errors.push("widget readiness marker is missing");+ if (measurement.widgetCount === 0) errors.push("representative board contains no widgets");+ if (measurement.coldImmediateInteractionMs === null) errors.push("cold immediate interaction timing is missing");+ if (measurement.postIdleWarmInteractionMs === null) errors.push("post-idle warm interaction timing is missing");+ return errors;+};diff --git a/scripts/benchmarks/dev-benchmark-lib.spec.ts b/scripts/benchmarks/dev-benchmark-lib.spec.tsnew file mode 100644index 000000000..b7755102d--- /dev/null+++ b/scripts/benchmarks/dev-benchmark-lib.spec.ts@@ -0,0 +1,56 @@+import { describe, expect, it } from "vitest";++import {+ countDuplicateTrpcPaths,+ normalizeTrpcPath,+ summarize,+ validateBrowserMeasurement,+} from "./dev-benchmark-lib.mts";++describe("development benchmark measurements", () => {+ it("preserves tRPC input payloads when counting duplicates", () => {+ const first = "/api/trpc/board.get?batch=1&input=%7B%22json%22%3A1%7D";+ const second = "/api/trpc/board.get?batch=1&input=%7B%22json%22%3A2%7D";++ expect(normalizeTrpcPath(first)).toBe("/api/trpc/board.get?batch=1&input=%7B%22json%22%3A1%7D");+ expect(countDuplicateTrpcPaths([first, second, first, "/api/trpc/user.get"])).toBe(1);+ });++ it("reports median, p95, deviation, and high outliers", () => {+ expect(summarize([1, 2, 3, 4, 5, 6, 100])).toEqual({+ count: 7,+ min: 1,+ median: 4,+ p95: null,+ max: 100,+ standardDeviation: 34,+ outliers: [100],+ });+ });++ it("averages both middle values for an even sample count", () => {+ expect(summarize([100, 200]).median).toBe(150);+ expect(summarize(Array.from({ length: 20 }, (_, index) => index + 1)).p95).toBe(19);+ });++ it("requires a successful authenticated board hydration and interaction", () => {+ expect(+ validateBrowserMeasurement({+ responseStatus: 307,+ domContentLoadedMs: 120,+ boardHydratedMs: null,+ widgetsReadyMs: null,+ widgetCount: 0,+ coldImmediateInteractionMs: null,+ postIdleWarmInteractionMs: null,+ }),+ ).toEqual([+ "browser navigation returned HTTP 307",+ "board hydration marker is missing",+ "widget readiness marker is missing",+ "representative board contains no widgets",+ "cold immediate interaction timing is missing",+ "post-idle warm interaction timing is missing",+ ]);+ });+});diff --git a/scripts/benchmarks/dev-board.mts b/scripts/benchmarks/dev-board.mtsnew file mode 100644index 000000000..1765b1623--- /dev/null+++ b/scripts/benchmarks/dev-board.mts@@ -0,0 +1,324 @@+import fs from "node:fs/promises";+import os from "node:os";+import path from "node:path";+import { performance } from "node:perf_hooks";+import type { BrowserContext, Page } from "@playwright/test";+import { chromium } from "@playwright/test";++import { countDuplicateTrpcPaths, summarize, validateBrowserMeasurement } from "./dev-benchmark-lib.mts";++type BoardMeasurement = {+ boardMountedMs: number;+ domContentLoadedMs: number;+ postIdleWarmInteractionMs: number;+ widgetCount: number;+ widgetsReadyMs: number;+ pageErrors: string[];+ responseStatus: number | null;+ trpcDuplicateRequestCount: number;+ trpcRequestCount: number;+ webSocketCount: number;+ performance: {+ cls: number;+ decodedScriptBytes: number;+ jsHeapBytes: number | null;+ lcpMs: number | null;+ longTaskCount: number;+ longTaskTotalMs: number;+ resourceCount: number;+ transferBytes: number;+ };+};++const root = path.resolve(import.meta.dirname, "../..");+const argumentsSet = new Set(process.argv.slice(2));+const smokeOnly = argumentsSet.has("--smoke");+const iterations = Number(process.env.DEV_BENCHMARK_ITERATIONS ?? 10);+const spotlightIdleMs = Number(process.env.DEV_BENCHMARK_SPOTLIGHT_IDLE_MS ?? 2_500);+const outputDirectory = path.resolve(+ process.env.DEV_BENCHMARK_OUTPUT_DIR ?? path.join(root, "benchmark-results", "dev"),+);+const boardUrl = process.env.DEV_BENCHMARK_BOARD_URL;+const storageStatePath = process.env.DEV_BENCHMARK_STORAGE_STATE;+const readinessUrl = process.env.DEV_BENCHMARK_READINESS_URL ?? "http://127.0.0.1:3000/api/health/ready";+const boardSelector = "[data-homarr-dev-benchmark-board]";+const interactionSelector = '[data-homarr-dev-benchmark-interaction="search"]';+const spotlightSelector = "[data-homarr-dev-benchmark-spotlight]";+const spotlightFeedbackSelector =+ "[data-homarr-dev-benchmark-spotlight-feedback], [data-homarr-dev-benchmark-spotlight]";++if (!Number.isInteger(iterations) || iterations < 7) {+ throw new Error("DEV_BENCHMARK_ITERATIONS must be an integer of at least 7");+}+if (!Number.isFinite(spotlightIdleMs) || spotlightIdleMs < 0) {+ throw new Error("DEV_BENCHMARK_SPOTLIGHT_IDLE_MS must be non-negative");+}++await fs.mkdir(outputDirectory, { recursive: true });++if (smokeOnly) {+ const measurements: number[] = [];+ for (let iteration = 0; iteration < iterations; iteration++) {+ const startedAt = performance.now();+ const response = await fetch(readinessUrl);+ await response.arrayBuffer();+ if (!response.ok) throw new Error(`Readiness smoke received HTTP ${response.status}`);+ measurements.push(Math.round(performance.now() - startedAt));+ }++ const result = {+ kind: "readiness-smoke",+ claimEligible: false,+ reason: "Readiness checks do not exercise the browser or dashboard graph",+ url: readinessUrl,+ iterations,+ summary: summarize(measurements),+ };+ const outputPath = path.join(outputDirectory, `smoke-${Date.now()}.json`);+ await fs.writeFile(outputPath, `${JSON.stringify(result, null, 2)}\n`);+ console.log(JSON.stringify({ outputPath, result }, null, 2));+ process.exit(0);+}++if (!boardUrl || !storageStatePath) {+ throw new Error(+ "Authenticated mode requires DEV_BENCHMARK_BOARD_URL and DEV_BENCHMARK_STORAGE_STATE. " ++ "Use --smoke only for the non-claimable readiness check.",+ );+}++await fs.access(storageStatePath);++const installPerformanceObservers = () => {+ const state = { cls: 0, lcpMs: null as number | null, longTaskCount: 0, longTaskTotalMs: 0 };+ Object.defineProperty(window, "homarrBenchmarkVitals", { value: state, configurable: true });++ if (PerformanceObserver.supportedEntryTypes.includes("largest-contentful-paint")) {+ new PerformanceObserver((list) => {+ const latest = list.getEntries().at(-1);+ if (latest) state.lcpMs = latest.startTime;+ }).observe({ type: "largest-contentful-paint", buffered: true });+ }+ if (PerformanceObserver.supportedEntryTypes.includes("layout-shift")) {+ new PerformanceObserver((list) => {+ for (const entry of list.getEntries()) {+ const shift = entry as PerformanceEntry & { hadRecentInput?: boolean; value?: number };+ if (!shift.hadRecentInput) state.cls += shift.value ?? 0;+ }+ }).observe({ type: "layout-shift", buffered: true });+ }+ if (PerformanceObserver.supportedEntryTypes.includes("longtask")) {+ new PerformanceObserver((list) => {+ for (const entry of list.getEntries()) {+ state.longTaskCount += 1;+ state.longTaskTotalMs += entry.duration;+ }+ }).observe({ type: "longtask", buffered: true });+ }+};++const createContextAsync = async (): Promise<BrowserContext> => {+ const context = await browser.newContext({ storageState: storageStatePath });+ await context.addInitScript(installPerformanceObservers);+ return context;+};++const browser = await chromium.launch();+const freshContext: BoardMeasurement[] = [];+const warmPage: BoardMeasurement[] = [];+const coldInteractionSamples: Array<{ feedbackMs: number; readyMs: number }> = [];++const measureBoardAsync = async (page: Page) => {+ const trpcRequests: string[] = [];+ const pageErrors: string[] = [];+ let webSocketCount = 0;++ page.on("request", (request) => {+ if (request.url().includes("/api/trpc/")) trpcRequests.push(request.url());+ });+ page.on("websocket", () => {+ webSocketCount += 1;+ });+ page.on("pageerror", (error) => pageErrors.push(error.message));++ const startedAt = performance.now();+ const response = await page.goto(boardUrl, { waitUntil: "domcontentloaded" });+ const domContentLoadedMs = Math.round(performance.now() - startedAt);+ await page.locator(boardSelector).waitFor({ state: "visible" });+ const boardMountedMs = Math.round(performance.now() - startedAt);++ await page.waitForFunction(+ (selector) => {+ const board = document.querySelector(selector);+ if (!board) return false;+ const widgetCount = board.querySelectorAll('[data-type="item"]').length;+ return widgetCount > 0 && board.querySelectorAll("[data-homarr-widget-ready]").length === widgetCount;+ },+ boardSelector,+ { timeout: 30_000 },+ );+ const widgetsReadyMs = Math.round(performance.now() - startedAt);+ const widgetCount = await page.locator(`${boardSelector} [data-type="item"]`).count();++ await page.waitForTimeout(spotlightIdleMs);+ const warmInteractionStartedAt = performance.now();+ await page.locator(`${interactionSelector}:visible`).click();+ await page.locator(spotlightSelector).waitFor({ state: "visible" });+ const postIdleWarmInteractionMs = Math.round(performance.now() - warmInteractionStartedAt);+ await page.keyboard.press("Escape");+ await page.locator(spotlightSelector).waitFor({ state: "hidden" });++ const browserPerformance = await page.evaluate(() => {+ const resources = performance.getEntriesByType("resource") as PerformanceResourceTiming[];+ const vitals = (+ window as Window & {+ homarrBenchmarkVitals?: {+ cls: number;+ lcpMs: number | null;+ longTaskCount: number;+ longTaskTotalMs: number;+ };+ }+ ).homarrBenchmarkVitals;+ const memory = performance as Performance & { memory?: { usedJSHeapSize: number } };+ return {+ cls: Number((vitals?.cls ?? 0).toFixed(4)),+ decodedScriptBytes: resources+ .filter((resource) => resource.initiatorType === "script")+ .reduce((total, resource) => total + resource.decodedBodySize, 0),+ jsHeapBytes: memory.memory?.usedJSHeapSize ?? null,+ lcpMs: vitals?.lcpMs === null || vitals?.lcpMs === undefined ? null : Math.round(vitals.lcpMs),+ longTaskCount: vitals?.longTaskCount ?? 0,+ longTaskTotalMs: Math.round(vitals?.longTaskTotalMs ?? 0),+ resourceCount: resources.length,+ transferBytes: resources.reduce((total, resource) => total + resource.transferSize, 0),+ };+ });++ const measurement: BoardMeasurement = {+ responseStatus: response?.status() ?? null,+ domContentLoadedMs,+ boardMountedMs,+ widgetsReadyMs,+ widgetCount,+ postIdleWarmInteractionMs,+ trpcRequestCount: trpcRequests.length,+ trpcDuplicateRequestCount: countDuplicateTrpcPaths(trpcRequests),+ webSocketCount,+ performance: browserPerformance,+ pageErrors,+ };+ const errors = validateBrowserMeasurement({+ responseStatus: measurement.responseStatus,+ domContentLoadedMs,+ boardHydratedMs: boardMountedMs,+ widgetsReadyMs,+ widgetCount,+ postIdleWarmInteractionMs,+ error: pageErrors.length > 0 ? pageErrors.join("; ") : undefined,+ });+ if (errors.length > 0) throw new Error(errors.map((error) => `${boardUrl}: ${error}`).join("; "));++ return measurement;+};++const measureColdInteractionAsync = async (page: Page) => {+ const pageErrors: string[] = [];+ page.on("pageerror", (error) => pageErrors.push(error.message));++ const response = await page.goto(boardUrl, { waitUntil: "domcontentloaded" });+ if (!response?.ok()) {+ throw new Error(`Cold-interaction board returned HTTP ${String(response?.status() ?? "none")}`);+ }+ await page.locator(boardSelector).waitFor({ state: "visible" });+ const interactionStartedAt = performance.now();+ await page.locator(`${interactionSelector}:visible`).click();+ await page.locator(spotlightFeedbackSelector).waitFor({ state: "visible" });+ const feedbackMs = Math.round(performance.now() - interactionStartedAt);+ await page.locator(spotlightSelector).waitFor({ state: "visible" });+ const readyMs = Math.round(performance.now() - interactionStartedAt);+ if (pageErrors.length > 0) throw new Error(`Cold-interaction page errors: ${pageErrors.join("; ")}`);+ return { feedbackMs, readyMs };+};++try {+ for (let iteration = 0; iteration < iterations; iteration++) {+ const context = await createContextAsync();+ const firstPage = await context.newPage();+ freshContext.push(await measureBoardAsync(firstPage));+ await firstPage.close();+ const secondPage = await context.newPage();+ warmPage.push(await measureBoardAsync(secondPage));+ await context.close();++ const coldContext = await createContextAsync();+ await coldContext.addInitScript(() => {+ // Measure the actual first-open path instead of racing the intentional+ // requestIdleCallback prefetch used during normal idle time.+ Object.defineProperty(window, "requestIdleCallback", { value: () => 0, configurable: true });+ Object.defineProperty(window, "cancelIdleCallback", { value: () => undefined, configurable: true });+ });+ const coldPage = await coldContext.newPage();+ coldInteractionSamples.push(await measureColdInteractionAsync(coldPage));+ await coldContext.close();+ }+} finally {+ await browser.close();+}++const summarizeMeasurements = (measurements: BoardMeasurement[]) => ({+ boardMountedMs: summarize(measurements.map(({ boardMountedMs }) => boardMountedMs)),+ widgetsReadyMs: summarize(measurements.map(({ widgetsReadyMs }) => widgetsReadyMs)),+ domContentLoadedMs: summarize(measurements.map(({ domContentLoadedMs }) => domContentLoadedMs)),+ postIdleWarmInteractionMs: summarize(measurements.map(({ postIdleWarmInteractionMs }) => postIdleWarmInteractionMs)),+ lcpMs: summarize(measurements.map(({ performance: browserPerformance }) => browserPerformance.lcpMs)),+ cls: summarize(measurements.map(({ performance: browserPerformance }) => browserPerformance.cls)),+ longTaskTotalMs: summarize(+ measurements.map(({ performance: browserPerformance }) => browserPerformance.longTaskTotalMs),+ ),+ decodedScriptBytes: summarize(+ measurements.map(({ performance: browserPerformance }) => browserPerformance.decodedScriptBytes),+ ),+ transferBytes: summarize(measurements.map(({ performance: browserPerformance }) => browserPerformance.transferBytes)),+ jsHeapBytes: summarize(measurements.map(({ performance: browserPerformance }) => browserPerformance.jsHeapBytes)),+ trpcRequests: summarize(measurements.map(({ trpcRequestCount }) => trpcRequestCount)),+ duplicateTrpcRequests: summarize(measurements.map(({ trpcDuplicateRequestCount }) => trpcDuplicateRequestCount)),+});++const sha = process.env.DEV_BENCHMARK_SHA ?? null;+const image = process.env.DEV_BENCHMARK_IMAGE ?? null;+const runtime = process.env.DEV_BENCHMARK_RUNTIME ?? "development";+const claimEligible = false;+const result = {+ kind: "authenticated-board",+ claimEligible,+ claimIneligibleReasons: [+ "served revision and production runtime are self-reported, not independently verified",+ ...(runtime === "production" ? [] : ["runtime is not production"]),+ ...(sha ? [] : ["DEV_BENCHMARK_SHA is missing"]),+ ...(image ? [] : ["DEV_BENCHMARK_IMAGE is missing"]),+ ],+ boardUrl,+ createdAt: new Date().toISOString(),+ environment: {+ architecture: process.arch,+ cpus: os.cpus().map(({ model }) => model),+ image,+ node: process.version,+ platform: `${process.platform} ${os.release()}`,+ runtime,+ sha,+ },+ iterations,+ spotlightIdleMs,+ measurements: { freshContext, warmPage, coldInteractionSamples },+ summary: {+ coldInteractionFeedbackMs: summarize(coldInteractionSamples.map(({ feedbackMs }) => feedbackMs)),+ coldInteractionReadyMs: summarize(coldInteractionSamples.map(({ readyMs }) => readyMs)),+ freshContext: summarizeMeasurements(freshContext),+ warmPage: summarizeMeasurements(warmPage),+ },+};+const outputPath = path.join(outputDirectory, `board-${Date.now()}.json`);+await fs.writeFile(outputPath, `${JSON.stringify(result, null, 2)}\n`);+console.log(JSON.stringify({ outputPath, claimEligible, summary: result.summary }, null, 2));diff --git a/scripts/benchmarks/docker-build-lib.mts b/scripts/benchmarks/docker-build-lib.mtsnew file mode 100644index 000000000..4eaebcdad--- /dev/null+++ b/scripts/benchmarks/docker-build-lib.mts@@ -0,0 +1,259 @@+import { createHash } from "node:crypto";++export type DockerBuildSourceEntry =+ | { file: string; mode: number; content: Buffer; linkTarget?: never }+ | { file: string; mode: number; content?: never; linkTarget: string };++export type DockerBuildSyntheticSourceChange = {+ file: string;+ id: string;+ from: string;+ to: string;+};++export const nextBuildCacheTarget = "/app/apps/nextjs/.next/cache";++export type ExpectedDockerBuildCacheMount = {+ logicalId: string;+ target: string;+ mustIncreaseUsage: boolean;+};++export type DockerBuildCacheMount = {+ description: string | null;+ logicalId: string | null;+ recordId: string;+ size: string | null;+ target: string | null;+ usageCount: number | null;+};++export type DockerBuildCacheSnapshot = {+ cacheMountCount: number;+ cacheMounts: DockerBuildCacheMount[];+ recordCount: number;+};++export const fingerprintDockerBuildSource = (entries: DockerBuildSourceEntry[]) => {+ const hash = createHash("sha256");+ for (const entry of entries.toSorted((left, right) => left.file.localeCompare(right.file))) {+ hash.update(entry.file);+ hash.update("\0");+ hash.update(String(entry.mode));+ hash.update("\0");+ hash.update(entry.linkTarget ?? entry.content);+ hash.update("\0");+ }+ return hash.digest("hex");+};++export const applyDockerBuildSyntheticSourceChange = (+ entries: DockerBuildSourceEntry[],+ id: string,+): { entries: DockerBuildSourceEntry[]; change: DockerBuildSyntheticSourceChange } => {+ const file = "apps/nextjs/src/app/[locale]/layout.tsx";+ const from = 'siteName: "Homarr",';+ const to = `siteName: ${JSON.stringify(`Homarr build benchmark ${id}`)},`;+ let changed = false;+ const nextEntries = entries.map((entry) => {+ if (entry.file !== file || entry.content === undefined) return entry;+ const source = entry.content.toString("utf8");+ if (source.split(from).length !== 2) {+ throw new Error(`Expected exactly one build benchmark source marker in ${file}`);+ }+ changed = true;+ return { ...entry, content: Buffer.from(source.replace(from, to)) };+ });+ if (!changed) throw new Error(`Build benchmark source marker file is missing: ${file}`);+ return { entries: nextEntries, change: { file, id, from, to } };+};++const expandDockerfileMountValue = (value: string, variables: Record<string, string>) => {+ const expanded = value.replaceAll(+ /\$(?:\{([A-Za-z_][A-Za-z0-9_]*)\}|([A-Za-z_][A-Za-z0-9_]*))/g,+ (reference, braced, plain) => {+ const name = (braced ?? plain) as string;+ const replacement = variables[name];+ if (replacement === undefined) {+ throw new Error(`Dockerfile cache mount contains unresolved variable ${reference}`);+ }+ return replacement;+ },+ );+ if (expanded.includes("$")) {+ throw new Error(`Dockerfile cache mount contains unresolved variable in ${value}`);+ }+ return expanded;+};++export const parseDockerfileCacheMounts = (+ dockerfile: string,+ targetPlatform: string,+): ExpectedDockerBuildCacheMount[] => {+ const mounts = [...dockerfile.matchAll(/--mount=([^\s\\]+)/g)]+ .map(([, serialized = ""]) =>+ Object.fromEntries(+ serialized.split(",").map((option) => {+ const separator = option.indexOf("=");+ return separator === -1 ? [option, ""] : [option.slice(0, separator), option.slice(separator + 1)];+ }),+ ),+ )+ .filter(({ type }) => type === "cache")+ .map((options) => {+ const id = options.id;+ const target = options.target ?? options.dst ?? options.destination;+ if (!id || !target) {+ throw new Error("Dockerfile cache mounts must declare explicit id and target options");+ }+ const variables = { TARGETPLATFORM: targetPlatform };+ const logicalId = expandDockerfileMountValue(id, variables);+ const expandedTarget = expandDockerfileMountValue(target, variables);+ return {+ logicalId,+ target: expandedTarget,+ mustIncreaseUsage: expandedTarget === nextBuildCacheTarget,+ };+ });++ const uniqueMounts = new Map(mounts.map((mount) => [`${mount.logicalId}\0${mount.target}`, mount]));+ return [...uniqueMounts.values()].toSorted(+ (left, right) => left.logicalId.localeCompare(right.logicalId) || left.target.localeCompare(right.target),+ );+};++export const parseDockerBuildCacheMountDescription = (description: string | null) => {+ if (!description) return null;+ const match = /^cached mount (\S+) from exec .* with id "(\/[^"\n]+)"$/.exec(description);+ if (!match) return null;+ const [, target = "", printedId = ""] = match;+ return { logicalId: printedId.slice(1), target };+};++export const normalizeDockerArchitecture = (architecture: string) => {+ switch (architecture.toLowerCase()) {+ case "x64":+ case "x86_64":+ return "amd64";+ case "aarch64":+ return "arm64";+ case "armv6l":+ return "arm/v6";+ case "armv7l":+ return "arm/v7";+ default:+ return architecture.toLowerCase();+ }+};++export const parseDockerBuildOutput = (output: string) => {+ const compileDurationsMs = [...output.matchAll(/Compiled (?:successfully )?in\s+([\d.]+)\s*(ms|s)/gi)].map(+ ([, value = "0", unit = "ms"]) => Number(value) * (unit.toLowerCase() === "s" ? 1_000 : 1),+ );++ return {+ cachedStepCount: (output.match(/^#\d+ CACHED$/gm) ?? []).length,+ completedStepCount: (output.match(/^#\d+ DONE(?:\s+[\d.]+s)?$/gm) ?? []).length,+ nextCompileMs: compileDurationsMs.at(-1) ?? null,+ };+};++export const getMeasuredRevision = (headSha: string, dirty: boolean) => (dirty ? `${headSha}+worktree` : headSha);++export const getBuildCacheStateIneligibleReasons = (+ cacheState: string | null,+ snapshot: DockerBuildCacheSnapshot | null,+ expectedMounts: ExpectedDockerBuildCacheMount[],+) => {+ if (cacheState !== "cold" && cacheState !== "warm") {+ return ["BUILD_BENCHMARK_CACHE_STATE must be cold or warm"];+ }+ if (!snapshot) return ["Docker builder cache state could not be inspected"];+ if (cacheState === "cold" && snapshot.recordCount !== 0) {+ return [`cold builder already contains ${snapshot.recordCount} cache records`];+ }+ if (cacheState === "warm" && expectedMounts.length === 0) {+ return ["Dockerfile declares no cache mounts for a warm build"];+ }+ if (cacheState === "warm") {+ return expectedMounts.flatMap((expected) => {+ const matches = snapshot.cacheMounts.filter(+ ({ logicalId, target }) => logicalId === expected.logicalId && target === expected.target,+ );+ if (matches.length === 0) {+ return [`warm builder is missing cache mount ${expected.logicalId} at ${expected.target}`];+ }+ if (matches.length > 1) {+ return [`warm builder contains duplicate cache mounts ${expected.logicalId} at ${expected.target}`];+ }+ return [];+ });+ }+ return [];+};++export const getBuildCacheContinuityIneligibleReasons = (+ cacheState: string | null,+ before: DockerBuildCacheSnapshot | null,+ after: DockerBuildCacheSnapshot | null,+ expectedMounts: ExpectedDockerBuildCacheMount[],+) => {+ if (cacheState !== "warm") return [];+ if (!before || !after) return ["warm builder cache continuity could not be inspected"];++ return expectedMounts.flatMap((expected) => {+ const beforeMatches = before.cacheMounts.filter(+ ({ logicalId, target }) => logicalId === expected.logicalId && target === expected.target,+ );+ const afterMatches = after.cacheMounts.filter(+ ({ logicalId, target }) => logicalId === expected.logicalId && target === expected.target,+ );+ if (beforeMatches.length !== 1 || afterMatches.length !== 1) {+ return [`warm cache mount ${expected.logicalId} at ${expected.target} could not be traced across the build`];+ }+ const beforeMount = beforeMatches[0];+ const afterMount = afterMatches[0];+ if (!beforeMount || !afterMount || beforeMount.recordId !== afterMount.recordId) {+ return [`warm cache mount ${expected.logicalId} at ${expected.target} was replaced during the build`];+ }+ if (!expected.mustIncreaseUsage) return [];+ if (beforeMount.usageCount === null || afterMount.usageCount === null) {+ return [`warm cache mount ${expected.logicalId} usage could not be verified`];+ }+ if (afterMount.usageCount <= beforeMount.usageCount) {+ return [`warm cache mount ${expected.logicalId} was not used by the application build`];+ }+ return [];+ });+};++export const getDockerBuildClaimIneligibleReasons = ({+ expectedRevision,+ expectedSourceFingerprint,+ imageArchitecture,+ imageRevision,+ imageSourceFingerprint,+ expectedImageArchitecture,+}: {+ expectedRevision: string | null;+ expectedSourceFingerprint: string;+ imageArchitecture: string;+ imageRevision: string | null;+ imageSourceFingerprint: string | null;+ expectedImageArchitecture: string;+}) => {+ const reasons: string[] = [];++ if (!expectedRevision) reasons.push("BUILD_BENCHMARK_REVISION is missing");+ else if (imageRevision !== expectedRevision) {+ reasons.push(`image revision ${imageRevision ?? "missing"} does not match ${expectedRevision}`);+ }+ if (imageSourceFingerprint !== expectedSourceFingerprint) {+ reasons.push("image source fingerprint does not match the measured context");+ }+ if (imageArchitecture !== expectedImageArchitecture) {+ reasons.push(`image architecture ${imageArchitecture} is not Docker server ${expectedImageArchitecture}`);+ }++ return reasons;+};diff --git a/scripts/benchmarks/docker-build-lib.spec.ts b/scripts/benchmarks/docker-build-lib.spec.tsnew file mode 100644index 000000000..f2b4ac9a2--- /dev/null+++ b/scripts/benchmarks/docker-build-lib.spec.ts@@ -0,0 +1,224 @@+import { describe, expect, it } from "vitest";++import {+ applyDockerBuildSyntheticSourceChange,+ fingerprintDockerBuildSource,+ getBuildCacheContinuityIneligibleReasons,+ getBuildCacheStateIneligibleReasons,+ getDockerBuildClaimIneligibleReasons,+ getMeasuredRevision,+ nextBuildCacheTarget,+ normalizeDockerArchitecture,+ parseDockerBuildCacheMountDescription,+ parseDockerBuildOutput,+ parseDockerfileCacheMounts,+} from "./docker-build-lib.mts";++const pnpmMount = { logicalId: "pnpm-store", target: "/pnpm/store", mustIncreaseUsage: false };+const nextMount = {+ logicalId: "homarr-next-build-linux/arm64",+ target: nextBuildCacheTarget,+ mustIncreaseUsage: true,+};+const cacheRecord = ({+ logicalId,+ recordId,+ target,+ usageCount,+}: {+ logicalId: string;+ recordId: string;+ target: string;+ usageCount: number | null;+}) => ({+ description: `cached mount ${target} from exec benchmark with id "/${logicalId}"`,+ logicalId,+ recordId,+ size: "1MB",+ target,+ usageCount,+});++describe("Docker build benchmark", () => {+ it("fingerprints the exact imported source mutation used to force incremental compilation", () => {+ const entries = [+ {+ file: "apps/nextjs/src/app/[locale]/layout.tsx",+ mode: 0o100644,+ content: Buffer.from('openGraph: {\n siteName: "Homarr",\n },\n'),+ },+ ];+ const before = fingerprintDockerBuildSource(entries);+ const { entries: changedEntries, change } = applyDockerBuildSyntheticSourceChange(entries, "paired-edit-1");++ expect(change).toEqual({+ file: "apps/nextjs/src/app/[locale]/layout.tsx",+ id: "paired-edit-1",+ from: 'siteName: "Homarr",',+ to: 'siteName: "Homarr build benchmark paired-edit-1",',+ });+ expect(changedEntries[0]?.content?.toString("utf8")).toContain(change.to);+ expect(fingerprintDockerBuildSource(changedEntries)).not.toBe(before);+ });++ it("fails closed when the real source marker is absent or ambiguous", () => {+ expect(() =>+ applyDockerBuildSyntheticSourceChange(+ [{ file: "apps/nextjs/src/app/[locale]/layout.tsx", mode: 0o100644, content: Buffer.from("no marker") }],+ "edit",+ ),+ ).toThrow("Expected exactly one build benchmark source marker");+ expect(() => applyDockerBuildSyntheticSourceChange([], "edit")).toThrow("source marker file is missing");+ });++ it("derives the exact context-specific cache mounts for the target platform", () => {+ const dockerfile = `RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store echo fetch+RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store echo install+RUN --mount=type=cache,id=homarr-next-build-\${TARGETPLATFORM},target=${nextBuildCacheTarget},sharing=locked echo build`;++ expect(parseDockerfileCacheMounts(dockerfile, "linux/arm64")).toEqual([nextMount, pnpmMount]);+ expect(parseDockerfileCacheMounts(dockerfile.split("\n").slice(0, 2).join("\n"), "linux/arm64")).toEqual([+ pnpmMount,+ ]);+ });++ it("fails closed for implicit or unresolved Dockerfile cache mount identity", () => {+ expect(() => parseDockerfileCacheMounts("RUN --mount=type=cache,target=/cache echo build", "linux/arm64")).toThrow(+ "explicit id and target",+ );+ expect(() =>+ parseDockerfileCacheMounts(+ "RUN --mount=type=cache,id=homarr-${BUILDPLATFORM},target=/cache echo build",+ "linux/arm64",+ ),+ ).toThrow("unresolved variable ${BUILDPLATFORM}");+ expect(() =>+ parseDockerfileCacheMounts(+ "RUN --mount=type=cache,id=homarr-${INVALID-NAME},target=/cache echo build",+ "linux/arm64",+ ),+ ).toThrow("unresolved variable");+ });++ it("reads exact logical cache identity from real buildx du descriptions", () => {+ expect(+ parseDockerBuildCacheMountDescription(+ 'cached mount /app/apps/nextjs/.next/cache from exec /bin/sh -c pnpm build with id "/homarr-next-build-linux/arm64"',+ ),+ ).toEqual({ logicalId: "homarr-next-build-linux/arm64", target: nextBuildCacheTarget });+ expect(parseDockerBuildCacheMountDescription("unrecognized output")).toBeNull();+ });++ it("extracts cache and Next compilation measurements from plain BuildKit output", () => {+ const output = `#7 CACHED+#8 DONE 0.4s+#9 12.0 ✓ Compiled successfully in 21.7s+#9 DONE 22.3s`;++ expect(parseDockerBuildOutput(output)).toEqual({+ cachedStepCount: 1,+ completedStepCount: 2,+ nextCompileMs: 21_700,+ });+ });++ it("only permits claims for a native image labeled with the exact measured source", () => {+ expect(+ getDockerBuildClaimIneligibleReasons({+ expectedRevision: "head+worktree",+ expectedSourceFingerprint: "source-hash",+ imageArchitecture: "amd64",+ imageRevision: "head+worktree",+ imageSourceFingerprint: "source-hash",+ expectedImageArchitecture: "amd64",+ }),+ ).toEqual([]);+ });++ it("normalizes Docker server architectures into OCI platform names", () => {+ expect(normalizeDockerArchitecture("x86_64")).toBe("amd64");+ expect(normalizeDockerArchitecture("aarch64")).toBe("arm64");+ expect(normalizeDockerArchitecture("armv7l")).toBe("arm/v7");+ });++ it("derives revisions from Git state instead of trusting image-label input", () => {+ expect(getMeasuredRevision("abc123", false)).toBe("abc123");+ expect(getMeasuredRevision("abc123", true)).toBe("abc123+worktree");+ });++ it("verifies declared cold and warm cache preconditions", () => {+ const empty = { cacheMountCount: 0, cacheMounts: [], recordCount: 0 };+ const warm = {+ cacheMountCount: 2,+ cacheMounts: [+ cacheRecord({ logicalId: pnpmMount.logicalId, recordId: "pnpm", target: pnpmMount.target, usageCount: 2 }),+ cacheRecord({ logicalId: nextMount.logicalId, recordId: "next", target: nextMount.target, usageCount: 4 }),+ ],+ recordCount: 4,+ };+ expect(getBuildCacheStateIneligibleReasons("cold", empty, [pnpmMount])).toEqual([]);+ expect(getBuildCacheStateIneligibleReasons("cold", warm, [pnpmMount])).toEqual([+ "cold builder already contains 4 cache records",+ ]);+ expect(getBuildCacheStateIneligibleReasons("warm", warm, [pnpmMount, nextMount])).toEqual([]);++ const staleNext = {+ ...warm,+ cacheMounts: [+ warm.cacheMounts[0]!,+ cacheRecord({+ logicalId: "homarr-next-build",+ recordId: "old-next",+ target: nextBuildCacheTarget,+ usageCount: 9,+ }),+ ],+ };+ expect(getBuildCacheStateIneligibleReasons("warm", staleNext, [pnpmMount, nextMount])).toEqual([+ `warm builder is missing cache mount ${nextMount.logicalId} at ${nextBuildCacheTarget}`,+ ]);+ });++ it("requires every warm cache record to survive and the Next cache to be used", () => {+ const before = {+ cacheMountCount: 2,+ cacheMounts: [+ cacheRecord({ logicalId: pnpmMount.logicalId, recordId: "pnpm", target: pnpmMount.target, usageCount: 2 }),+ cacheRecord({ logicalId: nextMount.logicalId, recordId: "next", target: nextMount.target, usageCount: 4 }),+ ],+ recordCount: 4,+ };+ const after = {+ cacheMountCount: 2,+ cacheMounts: [+ cacheRecord({ logicalId: pnpmMount.logicalId, recordId: "pnpm", target: pnpmMount.target, usageCount: 2 }),+ cacheRecord({ logicalId: nextMount.logicalId, recordId: "next", target: nextMount.target, usageCount: 6 }),+ ],+ recordCount: 8,+ };++ expect(getBuildCacheContinuityIneligibleReasons("warm", before, after, [pnpmMount, nextMount])).toEqual([]);+ expect(+ getBuildCacheContinuityIneligibleReasons(+ "warm",+ before,+ {+ ...after,+ cacheMounts: [after.cacheMounts[0]!, { ...after.cacheMounts[1]!, recordId: "replacement" }],+ },+ [pnpmMount, nextMount],+ ),+ ).toEqual([`warm cache mount ${nextMount.logicalId} at ${nextBuildCacheTarget} was replaced during the build`]);+ expect(+ getBuildCacheContinuityIneligibleReasons(+ "warm",+ before,+ {+ ...after,+ cacheMounts: [after.cacheMounts[0]!, { ...after.cacheMounts[1]!, usageCount: 4 }],+ },+ [pnpmMount, nextMount],+ ),+ ).toEqual([`warm cache mount ${nextMount.logicalId} was not used by the application build`]);+ });+});diff --git a/scripts/benchmarks/docker-build.mts b/scripts/benchmarks/docker-build.mtsnew file mode 100644index 000000000..5df7e1fcc--- /dev/null+++ b/scripts/benchmarks/docker-build.mts@@ -0,0 +1,351 @@+import { execFile, spawn } from "node:child_process";+import { createHash } from "node:crypto";+import { chmod, lstat, mkdir, mkdtemp, readFile, readlink, rm, symlink, writeFile } from "node:fs/promises";+import os from "node:os";+import path from "node:path";+import { performance } from "node:perf_hooks";+import { promisify } from "node:util";++import {+ applyDockerBuildSyntheticSourceChange,+ fingerprintDockerBuildSource,+ getBuildCacheContinuityIneligibleReasons,+ getBuildCacheStateIneligibleReasons,+ getDockerBuildClaimIneligibleReasons,+ getMeasuredRevision,+ normalizeDockerArchitecture,+ parseDockerBuildCacheMountDescription,+ parseDockerBuildOutput,+ parseDockerfileCacheMounts,+} from "./docker-build-lib.mts";+import type { DockerBuildSourceEntry } from "./docker-build-lib.mts";++const runStartedAt = new Date().toISOString();+const execFileAsync = promisify(execFile);+const contextDirectory = path.resolve(process.env.BUILD_BENCHMARK_CONTEXT ?? ".");+const declaredRevision = process.env.BUILD_BENCHMARK_REVISION?.trim() || null;+const mode = process.env.BUILD_BENCHMARK_MODE ?? "cached";+if (mode !== "cached" && mode !== "no-cache" && mode !== "source-change") {+ throw new Error("BUILD_BENCHMARK_MODE must be cached, no-cache, or source-change");+}+const sourceChangeId = process.env.BUILD_BENCHMARK_SOURCE_CHANGE_ID?.trim() || null;+if (mode === "source-change" && !sourceChangeId) {+ throw new Error("BUILD_BENCHMARK_SOURCE_CHANGE_ID is required in source-change mode");+}++const imageTag = process.env.BUILD_BENCHMARK_IMAGE ?? `homarr-build-benchmark:${process.pid}`;+const builder = process.env.BUILD_BENCHMARK_BUILDER?.trim() || null;+const runLabel = process.env.BUILD_BENCHMARK_RUN_LABEL?.trim() || null;+const seriesId = process.env.BUILD_BENCHMARK_SERIES_ID?.trim() || null;+const cacheState = process.env.BUILD_BENCHMARK_CACHE_STATE?.trim() || null;+const repetition = Number(process.env.BUILD_BENCHMARK_REPETITION ?? 0);+const totalRepetitions = Number(process.env.BUILD_BENCHMARK_TOTAL_REPETITIONS ?? 0);+const outputDirectory = path.resolve(process.env.BUILD_BENCHMARK_OUTPUT_DIR ?? "benchmark-results/docker-build");+const cacheSnapshotPollMs = 2_000;+const cacheSnapshotStableMs = 10_000;+const cacheSnapshotTimeoutMs = 30_000;+const execGitAsync = async (args: string[]) =>+ await execFileAsync("git", ["-C", contextDirectory, ...args], { maxBuffer: 16 * 1024 * 1024 });++const inspectDockerServerAsync = async () => {+ const { stdout } = await execFileAsync("docker", ["version", "--format", "{{json .Server}}"], {+ maxBuffer: 16 * 1024 * 1024,+ });+ const server = JSON.parse(stdout) as {+ ApiVersion?: string;+ Arch?: string;+ Os?: string;+ Version?: string;+ } | null;+ if (!server?.Arch || !server.Os) throw new Error("Docker server OS and architecture could not be inspected");+ const architecture = normalizeDockerArchitecture(server.Arch);+ return {+ apiVersion: server.ApiVersion ?? null,+ architecture,+ operatingSystem: server.Os.toLowerCase(),+ targetPlatform: `${server.Os.toLowerCase()}/${architecture}`,+ version: server.Version ?? null,+ };+};++const fingerprintSourceAsync = async () => {+ const { stdout } = await execGitAsync(["ls-files", "--cached", "--others", "--exclude-standard", "-z"]);+ const files = stdout.split("\0").filter(Boolean).toSorted();+ let fileCount = 0;+ const entries: DockerBuildSourceEntry[] = [];++ for (const file of files) {+ const absolutePath = path.join(contextDirectory, file);+ const stats = await lstat(absolutePath).catch((error: NodeJS.ErrnoException) => {+ if (error.code === "ENOENT") return null;+ throw error;+ });+ if (!stats) continue;+ fileCount += 1;+ const entry: DockerBuildSourceEntry = stats.isSymbolicLink()+ ? { file, mode: stats.mode, linkTarget: await readlink(absolutePath) }+ : { file, mode: stats.mode, content: await readFile(absolutePath) };+ entries.push(entry);+ }++ return { fingerprint: fingerprintDockerBuildSource(entries), fileCount, entries };+};++const materializeSourceSnapshotAsync = async (entries: DockerBuildSourceEntry[]) => {+ const directory = await mkdtemp(path.join(os.tmpdir(), "homarr-build-benchmark-"));+ for (const entry of entries) {+ const destination = path.join(directory, entry.file);+ await mkdir(path.dirname(destination), { recursive: true });+ if (entry.linkTarget !== undefined) {+ await symlink(entry.linkTarget, destination);+ } else {+ await writeFile(destination, entry.content);+ await chmod(destination, entry.mode & 0o777);+ }+ }+ return directory;+};++const runDockerBuildAsync = async (args: string[]) =>+ await new Promise<{ output: string; wallTimeMs: number }>((resolve, reject) => {+ const startedAt = performance.now();+ const child = spawn("docker", args, { cwd: contextDirectory, env: process.env, stdio: ["ignore", "pipe", "pipe"] });+ const chunks: Buffer[] = [];+ const capture = (chunk: Buffer) => {+ chunks.push(chunk);+ process.stdout.write(chunk);+ };+ child.stdout.on("data", capture);+ child.stderr.on("data", capture);+ child.once("error", reject);+ child.once("close", (code) => {+ const output = Buffer.concat(chunks).toString("utf8");+ const wallTimeMs = Math.round(performance.now() - startedAt);+ if (code !== 0) {+ reject(new Error(`docker build exited with ${String(code)} after ${wallTimeMs}ms`));+ return;+ }+ resolve({ output, wallTimeMs });+ });+ });++const inspectBuilderCacheAsync = async () => {+ if (!builder) return null;+ await execFileAsync("docker", ["buildx", "inspect", "--builder", builder, "--bootstrap"], {+ maxBuffer: 16 * 1024 * 1024,+ });+ const { stdout } = await execFileAsync("docker", ["buildx", "du", "--builder", builder, "--format", "json"], {+ maxBuffer: 16 * 1024 * 1024,+ });+ const records = stdout+ .split("\n")+ .filter(Boolean)+ .map(+ (line) =>+ JSON.parse(line) as {+ CreatedAt?: string;+ Description?: string;+ ID: string;+ Mutable?: boolean;+ Parents?: string[];+ Reclaimable?: boolean;+ Shared?: boolean;+ Size?: string;+ Type?: string;+ UsageCount?: number;+ },+ );+ const normalizedRecords = records+ .map(({ CreatedAt, Description, ID, Mutable, Parents, Reclaimable, Shared, Size, Type, UsageCount }) => ({+ createdAt: CreatedAt ?? null,+ description: Description ?? null,+ id: ID,+ mutable: Mutable ?? null,+ parents: Parents?.toSorted() ?? [],+ reclaimable: Reclaimable ?? null,+ shared: Shared ?? null,+ size: Size ?? null,+ type: Type ?? null,+ usageCount: UsageCount ?? null,+ }))+ .toSorted((left, right) => left.id.localeCompare(right.id));+ const cacheMounts = records+ .filter(({ Type }) => Type === "exec.cachemount")+ .map(({ Description, ID, Size, UsageCount }) => {+ const description = Description ?? null;+ const identity = parseDockerBuildCacheMountDescription(description);+ return {+ description,+ logicalId: identity?.logicalId ?? null,+ recordId: ID,+ size: Size ?? null,+ target: identity?.target ?? null,+ usageCount: UsageCount ?? null,+ };+ });+ return {+ cacheMountCount: cacheMounts.length,+ cacheMounts,+ recordCount: records.length,+ recordsFingerprint: createHash("sha256").update(JSON.stringify(normalizedRecords)).digest("hex"),+ };+};++const inspectSettledBuilderCacheAsync = async () => {+ if (!builder) return { snapshot: null, stability: null };+ const startedAt = performance.now();+ let attempts = 1;+ let previous = await inspectBuilderCacheAsync();+ let stableSince = performance.now();++ while (performance.now() - startedAt < cacheSnapshotTimeoutMs) {+ await new Promise((resolve) => setTimeout(resolve, cacheSnapshotPollMs));+ const current = await inspectBuilderCacheAsync();+ attempts += 1;+ if (current?.recordsFingerprint !== previous?.recordsFingerprint) stableSince = performance.now();+ previous = current;+ const stableForMs = Math.round(performance.now() - stableSince);+ if (stableForMs >= cacheSnapshotStableMs) {+ return {+ snapshot: current,+ stability: { attempts, pollIntervalMs: cacheSnapshotPollMs, stableForMs, timeoutMs: cacheSnapshotTimeoutMs },+ };+ }+ }++ throw new Error(`Docker builder cache did not settle for ${cacheSnapshotStableMs}ms`);+};++await mkdir(outputDirectory, { recursive: true });+const [{ stdout: headOutput }, { stdout: statusOutput }, source, dockerServer] = await Promise.all([+ execGitAsync(["rev-parse", "HEAD"]),+ execGitAsync(["status", "--porcelain=v1"]),+ fingerprintSourceAsync(),+ inspectDockerServerAsync(),+]);+const headSha = headOutput.trim();+const dirty = statusOutput.trim().length > 0;+const measuredRevision = getMeasuredRevision(headSha, dirty);+const dockerfile = source.entries.find(({ file }) => file === "Dockerfile");+if (!dockerfile?.content) throw new Error("Docker build context contains no regular Dockerfile");+const expectedCacheMounts = parseDockerfileCacheMounts(+ dockerfile.content.toString("utf8"),+ dockerServer.targetPlatform,+);+const cacheBefore = await inspectBuilderCacheAsync();+const syntheticSource =+ mode === "source-change"+ ? applyDockerBuildSyntheticSourceChange(source.entries, sourceChangeId as string)+ : { entries: source.entries, change: null };+const measuredSourceFingerprint = fingerprintDockerBuildSource(syntheticSource.entries);++const buildArgs = [+ "build",+ "--progress=plain",+ "--platform",+ dockerServer.targetPlatform,+ "--label",+ `org.opencontainers.image.revision=${measuredRevision}`,+ "--label",+ `dev.homarr.source-fingerprint=${measuredSourceFingerprint}`,+ "--tag",+ imageTag,+];+if (builder) buildArgs.push("--builder", builder, "--load");+if (mode === "no-cache") buildArgs.push("--no-cache");+const snapshotDirectory = await materializeSourceSnapshotAsync(syntheticSource.entries);+buildArgs.push(snapshotDirectory);++const build = await runDockerBuildAsync(buildArgs).finally(+ async () => await rm(snapshotDirectory, { recursive: true }),+);+const { snapshot: cacheAfter, stability: cacheAfterStability } = await inspectSettledBuilderCacheAsync();+const imageInspect = JSON.parse((await execFileAsync("docker", ["image", "inspect", imageTag])).stdout)[0] as {+ Architecture: string;+ Config?: { Labels?: Record<string, string> };+ Id: string;+ RepoDigests?: string[];+ Size: number;+};+const labels = imageInspect.Config?.Labels ?? {};+const parsedBuild = parseDockerBuildOutput(build.output);+const claimIneligibleReasons = getDockerBuildClaimIneligibleReasons({+ expectedRevision: measuredRevision,+ expectedSourceFingerprint: measuredSourceFingerprint,+ imageArchitecture: imageInspect.Architecture,+ imageRevision: labels["org.opencontainers.image.revision"] ?? null,+ imageSourceFingerprint: labels["dev.homarr.source-fingerprint"] ?? null,+ expectedImageArchitecture: dockerServer.architecture.split("/")[0] as string,+});+if (!declaredRevision) claimIneligibleReasons.push("BUILD_BENCHMARK_REVISION is missing");+else if (declaredRevision !== measuredRevision) {+ claimIneligibleReasons.push(`declared revision ${declaredRevision} does not match measured ${measuredRevision}`);+}+if (!builder) claimIneligibleReasons.push("BUILD_BENCHMARK_BUILDER is missing");+if (!seriesId) claimIneligibleReasons.push("BUILD_BENCHMARK_SERIES_ID is missing");+claimIneligibleReasons.push(...getBuildCacheStateIneligibleReasons(cacheState, cacheBefore, expectedCacheMounts));+claimIneligibleReasons.push(+ ...getBuildCacheContinuityIneligibleReasons(cacheState, cacheBefore, cacheAfter, expectedCacheMounts),+);+if (mode === "cached") claimIneligibleReasons.push("cached mode does not force an application rebuild");+if (mode === "no-cache" && cacheState === "warm") {+ claimIneligibleReasons.push("no-cache mode resets BuildKit cache mounts and cannot measure a warm build");+}+if (mode !== "cached" && parsedBuild.nextCompileMs === null) {+ claimIneligibleReasons.push("application build did not expose a Next compilation measurement");+}+if (!Number.isInteger(totalRepetitions) || totalRepetitions < 2) {+ claimIneligibleReasons.push("BUILD_BENCHMARK_TOTAL_REPETITIONS must be at least 2");+}+if (!Number.isInteger(repetition) || repetition < 1 || repetition > totalRepetitions) {+ claimIneligibleReasons.push("BUILD_BENCHMARK_REPETITION is outside the declared series");+}+const timestamp = Date.now();+const logPath = path.join(outputDirectory, `build-${timestamp}.log`);+const outputPath = path.join(outputDirectory, `build-${timestamp}.json`);+const runFinishedAt = new Date().toISOString();+const result = {+ schemaVersion: 4,+ claimEligible: claimIneligibleReasons.length === 0,+ claimIneligibleReasons,+ createdAt: runFinishedAt,+ run: { startedAt: runStartedAt, finishedAt: runFinishedAt },+ mode,+ builder,+ runLabel,+ declaredRevision,+ series: { id: seriesId, cacheState, repetition, totalRepetitions },+ source: {+ contextDirectory,+ headSha,+ dirty,+ measuredRevision,+ fingerprint: measuredSourceFingerprint,+ baseFingerprint: source.fingerprint,+ fileCount: source.fileCount,+ immutableSnapshot: true,+ syntheticSourceChange: syntheticSource.change,+ },+ builderCache: {+ expected: expectedCacheMounts,+ before: cacheBefore,+ after: cacheAfter,+ afterStability: cacheAfterStability,+ },+ host: { architecture: process.arch, cpuCount: os.cpus().length, dockerServer, platform: os.platform() },+ image: {+ requested: imageTag,+ id: imageInspect.Id,+ digest: imageInspect.RepoDigests?.[0] ?? null,+ revision: labels["org.opencontainers.image.revision"] ?? null,+ sourceFingerprint: labels["dev.homarr.source-fingerprint"] ?? null,+ architecture: imageInspect.Architecture,+ targetPlatform: dockerServer.targetPlatform,+ localUncompressedBytes: imageInspect.Size,+ },+ build: { wallTimeMs: build.wallTimeMs, ...parsedBuild },+ logPath,+};++await Promise.all([writeFile(logPath, build.output), writeFile(outputPath, `${JSON.stringify(result, null, 2)}\n`)]);+console.log(JSON.stringify({ outputPath, ...result }, null, 2));diff --git a/scripts/benchmarks/docker-runtime-lib.mts b/scripts/benchmarks/docker-runtime-lib.mtsnew file mode 100644index 000000000..adae41819--- /dev/null+++ b/scripts/benchmarks/docker-runtime-lib.mts@@ -0,0 +1,649 @@+import { createHash } from "node:crypto";+import { jsonlStreamConsumer } from "@trpc/server/unstable-core-do-not-import";+import { deserialize } from "superjson";+import type { SuperJSONResult } from "superjson";++import { isWidgetDataTrpcPath } from "../../packages/api/src/query-cache.ts";++export type RuntimeMemoryCheckpoint = {+ name: string;+ capturedAt: string;+ container: {+ currentBytes: number;+ peakBytes: number | null;+ anonymousBytes: number;+ fileBytes: number;+ };+ cpu: {+ usageUsec: number;+ userUsec: number;+ systemUsec: number;+ nrThrottled: number;+ throttledUsec: number;+ };+ processes: Array<{+ command: string;+ parentPid: number;+ pid: number;+ pssBytes: number;+ rssBytes: number;+ }>;+ redis: { usedMemoryBytes: number; peakMemoryBytes: number } | null;+};++export const minimumClaimSettleMs = 10 * 60 * 1_000;+export const minimumClaimSettleSamples = 20;+export const minimumClaimPageSamples = 20;+export const minimumClaimLcpObservationMs = 5_000;+export const minimumClaimWidgetDataQuietMs = 500;++export const getBrowserNetworkIsolationLaunchArgs = (denyProxyUrl: string) => [+ `--proxy-server=${denyProxyUrl}`,+ "--proxy-bypass-list=127.0.0.1;localhost",+ "--host-resolver-rules=MAP * ~NOTFOUND, EXCLUDE 127.0.0.1, EXCLUDE localhost",+];++export const normalizeDockerArchitecture = (nodeArchitecture: string) =>+ nodeArchitecture === "x64" ? "amd64" : nodeArchitecture;++export const getTrpcProcedures = (requestUrl: string) => {+ const pathname = new URL(requestUrl).pathname;+ const prefix = "/api/trpc/";+ const index = pathname.indexOf(prefix);+ if (index < 0) return [];++ return decodeURIComponent(pathname.slice(index + prefix.length))+ .split(",")+ .filter(Boolean);+};++const canonicalizeJson = (value: unknown): string => {+ if (value === null || typeof value !== "object") return JSON.stringify(value) ?? "undefined";+ if (Array.isArray(value)) return `[${value.map(canonicalizeJson).join(",")}]`;++ return `{${Object.entries(value)+ .toSorted(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))+ .map(([key, nestedValue]) => `${JSON.stringify(key)}:${canonicalizeJson(nestedValue)}`)+ .join(",")}}`;+};++const hashRequestInput = (value: unknown) => createHash("sha256").update(canonicalizeJson(value)).digest("hex");++export type TrpcRequestIdentity = { batchIndex: number; identity: string; inputHash: string; procedure: string };++export const getTrpcRequestIdentities = (requestUrl: string): TrpcRequestIdentity[] => {+ const url = new URL(requestUrl);+ const procedures = getTrpcProcedures(requestUrl);+ if (procedures.length === 0) return [];+ const rawInput = url.searchParams.get("input");+ let parsedInput: unknown = null;+ if (rawInput !== null) {+ try {+ parsedInput = JSON.parse(rawInput) as unknown;+ } catch {+ throw new Error("Malformed serialized tRPC request input");+ }+ }++ const isBatch = url.searchParams.get("batch") === "1";+ return procedures.map((procedure, index) => {+ const input =+ isBatch && parsedInput !== null && typeof parsedInput === "object" && !Array.isArray(parsedInput)+ ? (parsedInput as Record<string, unknown>)[String(index)]+ : parsedInput;+ const inputHash = hashRequestInput(input);+ return { batchIndex: index, procedure, inputHash, identity: `${procedure}#${inputHash}` };+ });+};++export const isRuntimeWidgetDataProcedure = (procedure: string) => {+ if (procedure.split(".").some((part) => part.startsWith("subscribe"))) return false;+ if (procedure.startsWith("widget.")) return procedure !== "widget.app.ping";+ return isWidgetDataTrpcPath(procedure);+};++export const isRuntimeWidgetDataRequest = (method: string, procedure: string) =>+ method === "GET" && isRuntimeWidgetDataProcedure(procedure);++export const recordWidgetDataRequestOutcome = (+ recoveryBalance: Map<string, number>,+ requestIdentities: string[],+ outcome: "aborted" | "completed",+) => {+ const delta = outcome === "aborted" ? 1 : -1;+ for (const requestIdentity of requestIdentities) {+ recoveryBalance.set(requestIdentity, (recoveryBalance.get(requestIdentity) ?? 0) + delta);+ }+};++export const getUnrecoveredWidgetDataRequests = (recoveryBalance: Map<string, number>) =>+ [...recoveryBalance.entries()]+ .filter(([, balance]) => balance > 0)+ .flatMap(([requestIdentity, balance]) => Array.from({ length: balance }, () => requestIdentity))+ .toSorted();++export const hasBlockingWidgetDataAborts = (allowUnrecoveredAborts: boolean, unrecoveredProcedureCount: number) =>+ !allowUnrecoveredAborts && unrecoveredProcedureCount > 0;++export const getSpotlightIdleNetworkFailure = (policy: string, nonWidgetTrpcRequestCount: number) =>+ policy === "preload-only" && nonWidgetTrpcRequestCount > 0+ ? `Idle Spotlight preload-only preparation made ${nonWidgetTrpcRequestCount} non-widget tRPC requests`+ : null;++export const getSpotlightIdleMountFailure = (policy: string, mountedCount: number) =>+ policy === "preload-only" && mountedCount > 0 ? "Idle Spotlight preload mounted the UI before user intent" : null;++const isRecord = (value: unknown): value is Record<string, unknown> =>+ value !== null && typeof value === "object" && !Array.isArray(value);++export type TrpcOperationFailure = {+ batchIndex: number;+ kind: "http-status" | "invalid-jsonl" | "index-mismatch" | "invalid-envelope" | "trpc-error" | "stream-error";+ httpStatus?: number;+ jsonRpcCode?: number;+ status?: number;+ trpcCode?: string;+};++export type TrpcBatchInspection = { failures: TrpcOperationFailure[]; successfulIndexes: number[] };++const failEveryOperation = (+ operationCount: number,+ failure: Omit<TrpcOperationFailure, "batchIndex">,+): TrpcBatchInspection => ({+ failures: Array.from({ length: operationCount }, (_, batchIndex) => ({ batchIndex, ...failure })),+ successfulIndexes: [],+});++const safeTrpcError = (batchIndex: number, error: unknown): TrpcOperationFailure => {+ const record = isRecord(error) ? error : {};+ const data = isRecord(record.data) ? record.data : {};+ return {+ batchIndex,+ kind: "trpc-error",+ ...(typeof data.httpStatus === "number" ? { httpStatus: data.httpStatus } : {}),+ ...(typeof record.code === "number" ? { jsonRpcCode: record.code } : {}),+ ...(typeof data.code === "string" ? { trpcCode: data.code } : {}),+ };+};++export const inspectTrpcBatchStreamResponse = async (+ status: number,+ responseBody: string,+ expectedOperationCount: number,+): Promise<TrpcBatchInspection> => {+ if (!Number.isInteger(expectedOperationCount) || expectedOperationCount < 1) {+ throw new Error("expectedOperationCount must be a positive integer");+ }+ if (status < 200 || status >= 300) {+ return failEveryOperation(expectedOperationCount, { kind: "http-status", status });+ }+ if (responseBody.trim().length === 0) return failEveryOperation(expectedOperationCount, { kind: "invalid-jsonl" });++ const physicalLines = responseBody.split("\n");+ const trailing = physicalLines.pop() ?? "";+ if (trailing.trim() !== "") return failEveryOperation(expectedOperationCount, { kind: "invalid-jsonl" });+ try {+ const records = physicalLines.filter((line) => line.trim().length > 0);+ if (records.length === 0) throw new Error("missing JSONL records");+ for (const line of records) {+ const serialized = JSON.parse(line) as unknown;+ if (!isRecord(serialized) || !Object.hasOwn(serialized, "json")) throw new Error("not SuperJSON");+ deserialize(serialized as SuperJSONResult);+ }+ } catch {+ return failEveryOperation(expectedOperationCount, { kind: "invalid-jsonl" });+ }++ const abortController = new AbortController();+ try {+ const bytes = new TextEncoder().encode(responseBody);+ const from = new ReadableStream<Uint8Array>({+ start(controller) {+ controller.enqueue(bytes);+ controller.close();+ },+ });+ const [head] = await jsonlStreamConsumer<Record<string, Promise<unknown>>>({+ abortController,+ deserialize: (value) => deserialize(value as SuperJSONResult),+ formatError: () => new Error("tRPC stream operation error"),+ from,+ });+ if (!isRecord(head)) return failEveryOperation(expectedOperationCount, { kind: "invalid-envelope" });++ const actualIndexes = Object.keys(head);+ const expectedIndexes = Array.from({ length: expectedOperationCount }, (_, index) => String(index));+ if (+ actualIndexes.length !== expectedIndexes.length ||+ expectedIndexes.some((index) => !Object.hasOwn(head, index))+ ) {+ for (const value of Object.values(head)) void Promise.resolve(value).catch(() => undefined);+ return failEveryOperation(expectedOperationCount, { kind: "index-mismatch" });+ }++ const outcomes = await Promise.all(+ expectedIndexes.map(async (key): Promise<{ failure: TrpcOperationFailure | null; index: number }> => {+ const batchIndex = Number(key);+ try {+ const envelope = await Promise.resolve(head[key]);+ if (!isRecord(envelope)) return { failure: { batchIndex, kind: "invalid-envelope" }, index: batchIndex };+ if (Object.hasOwn(envelope, "error")) {+ return { failure: safeTrpcError(batchIndex, envelope.error), index: batchIndex };+ }+ if (!Object.hasOwn(envelope, "result")) {+ return { failure: { batchIndex, kind: "invalid-envelope" }, index: batchIndex };+ }+ const result = await Promise.resolve(envelope.result);+ if (!isRecord(result) || !Object.hasOwn(result, "data")) {+ return { failure: { batchIndex, kind: "invalid-envelope" }, index: batchIndex };+ }+ await Promise.resolve(result.data);+ return { failure: null, index: batchIndex };+ } catch {+ return { failure: { batchIndex, kind: "stream-error" }, index: batchIndex };+ }+ }),+ );+ return {+ failures: outcomes.flatMap(({ failure }) => (failure ? [failure] : [])),+ successfulIndexes: outcomes.flatMap(({ failure, index }) => (failure ? [] : [index])),+ };+ } catch {+ return failEveryOperation(expectedOperationCount, { kind: "invalid-jsonl" });+ } finally {+ abortController.abort();+ }+};++type RuntimeMetricEligibilityInput = {+ expectedSha: string | null;+ expectedSourceFingerprint: string | null;+ browserNetworkIsolated: boolean;+ serverNetworkIsolated: boolean;+ imageArchitecture: string;+ lcpObservationMs: number;+ lcpSampleCount: number;+ nodeArchitecture: string;+ pageSampleCount: number;+ requireImplementationMarkers: boolean;+ revision: string | null;+ sourceFingerprint: string | null;+ settleMs: number;+ settleSampleCount: number;+ widgetDataQuietMs: number;+ widgetDataSampleCount: number;+};++const getRuntimeProvenanceIneligibleReasons = ({+ browserNetworkIsolated,+ serverNetworkIsolated,+ expectedSha,+ expectedSourceFingerprint,+ imageArchitecture,+ nodeArchitecture,+ revision,+ sourceFingerprint,+}: Pick<+ RuntimeMetricEligibilityInput,+ | "browserNetworkIsolated"+ | "serverNetworkIsolated"+ | "expectedSha"+ | "expectedSourceFingerprint"+ | "imageArchitecture"+ | "nodeArchitecture"+ | "revision"+ | "sourceFingerprint"+>) => {+ const reasons: string[] = [];+ const expectedArchitecture = normalizeDockerArchitecture(nodeArchitecture);++ if (imageArchitecture !== expectedArchitecture) {+ reasons.push(`image architecture ${imageArchitecture} is not host ${expectedArchitecture}`);+ }+ if (!expectedSha) reasons.push("RUNTIME_BENCHMARK_SHA is missing");+ else if (!revision) reasons.push("image revision label is missing");+ else if (revision !== expectedSha) reasons.push(`image revision ${revision} does not match ${expectedSha}`);+ if (!expectedSourceFingerprint) reasons.push("RUNTIME_BENCHMARK_SOURCE_FINGERPRINT is missing");+ else if (!sourceFingerprint) reasons.push("image source fingerprint label is missing");+ else if (sourceFingerprint !== expectedSourceFingerprint) {+ reasons.push(`image source fingerprint ${sourceFingerprint} does not match ${expectedSourceFingerprint}`);+ }+ if (!browserNetworkIsolated) reasons.push("browser external network isolation is not active");+ if (!serverNetworkIsolated) reasons.push("server external network isolation is not active");++ return reasons;+};++const createEligibility = ({+ ineligibleReasons,+ kind,+ limitations,+ requiredSampleCount,+ sampleCount,+ sampleUnit,+ scope,+}: {+ ineligibleReasons: string[];+ kind: "comparative" | "diagnostic" | "within-run";+ limitations: string[];+ requiredSampleCount: number | null;+ sampleCount: number;+ sampleUnit: string;+ scope: string;+}) => ({+ claimEligible: ineligibleReasons.length === 0,+ ineligibleReasons,+ kind,+ limitations,+ requiredSampleCount,+ sampleCount,+ sampleUnit,+ scope,+});++export const getRuntimeMetricEligibility = (input: RuntimeMetricEligibilityInput) => {+ const provenanceReasons = getRuntimeProvenanceIneligibleReasons(input);+ const markerReasons = input.requireImplementationMarkers ? [] : ["widget implementation markers are not required"];+ const pageReasons = [+ ...provenanceReasons,+ ...markerReasons,+ ...(input.pageSampleCount < minimumClaimPageSamples+ ? [`page sample count ${input.pageSampleCount} is below ${minimumClaimPageSamples}`]+ : []),+ ];+ const lcpReasons = [+ ...provenanceReasons,+ ...markerReasons,+ ...(input.lcpObservationMs < minimumClaimLcpObservationMs+ ? [`LCP observation ${input.lcpObservationMs}ms is below ${minimumClaimLcpObservationMs}ms`]+ : []),+ ...(input.lcpSampleCount < minimumClaimPageSamples+ ? [`LCP sample count ${input.lcpSampleCount} is below ${minimumClaimPageSamples}`]+ : []),+ ];+ const settleReasons = [+ ...provenanceReasons,+ ...markerReasons,+ ...(input.settleMs < minimumClaimSettleMs+ ? [`settle duration ${input.settleMs}ms is below ${minimumClaimSettleMs}ms`]+ : []),+ ...(input.settleSampleCount < minimumClaimSettleSamples+ ? [`settle sample count ${input.settleSampleCount} is below ${minimumClaimSettleSamples}`]+ : []),+ ];+ const widgetDataReasons = [+ ...provenanceReasons,+ ...markerReasons,+ ...(input.widgetDataQuietMs < minimumClaimWidgetDataQuietMs+ ? [`widget data quiet window ${input.widgetDataQuietMs}ms is below ${minimumClaimWidgetDataQuietMs}ms`]+ : []),+ ...(input.widgetDataSampleCount < minimumClaimPageSamples+ ? [`widget data sample count ${input.widgetDataSampleCount} is below ${minimumClaimPageSamples}`]+ : []),+ ];++ return {+ pageLoads: createEligibility({+ ineligibleReasons: pageReasons,+ kind: "comparative",+ limitations: [+ "samples share one container instance",+ "application ingress traverses a local TCP proxy sidecar excluded from memory samples",+ ],+ requiredSampleCount: minimumClaimPageSamples,+ sampleCount: input.pageSampleCount,+ sampleUnit: "fresh authenticated Chromium document",+ scope: "fresh authenticated dashboard document load timings",+ }),+ largestContentfulPaint: createEligibility({+ ineligibleReasons: lcpReasons,+ kind: "comparative",+ limitations: [+ "samples share one container instance",+ "application ingress traverses a local TCP proxy sidecar excluded from memory samples",+ ],+ requiredSampleCount: minimumClaimPageSamples,+ sampleCount: input.lcpSampleCount,+ sampleUnit: "fresh authenticated Chromium document",+ scope: `dashboard LCP observed for at least ${minimumClaimLcpObservationMs}ms and finalized by trusted input`,+ }),+ widgetDataSettled: createEligibility({+ ineligibleReasons: widgetDataReasons,+ kind: "comparative",+ limitations: [+ "samples share one container instance",+ "covers observed widget read-side tRPC requests; excludes subscriptions and widget.app.ping",+ "application ingress traverses a local TCP proxy sidecar excluded from memory samples",+ ],+ requiredSampleCount: minimumClaimPageSamples,+ sampleCount: input.widgetDataSampleCount,+ sampleUnit: "fresh authenticated Chromium document",+ scope: `widget tRPC completion followed by a ${minimumClaimWidgetDataQuietMs}ms quiet window and two animation frames`,+ }),+ settleStability: createEligibility({+ ineligibleReasons: settleReasons,+ kind: "within-run",+ limitations: [+ "one container instance",+ "eligible only for within-run memory stability and trend, not cross-build RAM level claims",+ ],+ requiredSampleCount: minimumClaimSettleSamples,+ sampleCount: input.settleSampleCount,+ sampleUnit: "time-series checkpoint",+ scope: `one warmed container observed for at least ${minimumClaimSettleMs}ms`,+ }),+ startup: createEligibility({+ ineligibleReasons: ["single container start is diagnostic only"],+ kind: "diagnostic",+ limitations: ["n=1 container start"],+ requiredSampleCount: null,+ sampleCount: 1,+ sampleUnit: "container start",+ scope: "start-to-ready timing",+ }),+ memoryLevels: createEligibility({+ ineligibleReasons: ["memory levels have one container observation per workload stage"],+ kind: "diagnostic",+ limitations: ["n=1 container per workload stage", "settle checkpoints are correlated time samples"],+ requiredSampleCount: null,+ sampleCount: 1,+ sampleUnit: "container instance",+ scope: "startup, workload, peak, and settled RAM levels",+ }),+ coldSpotlightInteraction: createEligibility({+ ineligibleReasons: ["cold Spotlight interaction has one observation"],+ kind: "diagnostic",+ limitations: ["n=1 cold interaction"],+ requiredSampleCount: null,+ sampleCount: 1,+ sampleUnit: "cold browser interaction",+ scope: "first feedback and full-ready Spotlight latency",+ }),+ };+};++export const getRuntimeClaimIneligibleReasons = (input: RuntimeMetricEligibilityInput) => {+ const eligibility = getRuntimeMetricEligibility(input);+ return [+ ...new Set([+ ...eligibility.pageLoads.ineligibleReasons,+ ...eligibility.largestContentfulPaint.ineligibleReasons,+ ...eligibility.widgetDataSettled.ineligibleReasons,+ ...eligibility.settleStability.ineligibleReasons,+ ]),+ ];+};++const readNumericLine = (input: string, key: string) => {+ const match = input.match(new RegExp(`^${key}[=:]\\s*(\\d+)`, "m"));+ return match ? Number(match[1]) : null;+};++export const parseRuntimeMemorySnapshot = (name: string, output: string): RuntimeMemoryCheckpoint => {+ const currentBytes = readNumericLine(output, "memory_current");+ const anonymousBytes = readNumericLine(output, "cgroup_anon");+ const fileBytes = readNumericLine(output, "cgroup_file");+ if (currentBytes === null || anonymousBytes === null || fileBytes === null) {+ throw new Error(`Incomplete cgroup memory snapshot for ${name}`);+ }++ const usageUsec = readNumericLine(output, "cpu_usage_usec");+ const userUsec = readNumericLine(output, "cpu_user_usec");+ const systemUsec = readNumericLine(output, "cpu_system_usec");+ const nrThrottled = readNumericLine(output, "cpu_nr_throttled");+ const throttledUsec = readNumericLine(output, "cpu_throttled_usec");+ if (+ usageUsec === null ||+ userUsec === null ||+ systemUsec === null ||+ nrThrottled === null ||+ throttledUsec === null+ ) {+ throw new Error(`Incomplete cgroup CPU snapshot for ${name}`);+ }++ const processes = output+ .split("\n")+ .filter((line) => line.startsWith("process="))+ .flatMap((line) => {+ const [pid, parentPid, rssKiB, command, pssKiB] = line.slice("process=".length).split("|");+ if (!pid || !parentPid || !rssKiB || !command || !pssKiB) return [];+ return [+ {+ pid: Number(pid),+ parentPid: Number(parentPid),+ rssBytes: Number(rssKiB) * 1024,+ pssBytes: Number(pssKiB) * 1024,+ command,+ },+ ];+ });+ const redisUsed = readNumericLine(output, "redis_used_memory");+ const redisPeak = readNumericLine(output, "redis_used_memory_peak");++ return {+ name,+ capturedAt: new Date().toISOString(),+ container: {+ currentBytes,+ peakBytes: readNumericLine(output, "memory_peak"),+ anonymousBytes,+ fileBytes,+ },+ cpu: { usageUsec, userUsec, systemUsec, nrThrottled, throttledUsec },+ processes,+ redis: redisUsed === null || redisPeak === null ? null : { usedMemoryBytes: redisUsed, peakMemoryBytes: redisPeak },+ };+};++const cpuDelta = (start: RuntimeMemoryCheckpoint | undefined, end: RuntimeMemoryCheckpoint | undefined) =>+ start && end+ ? {+ usageUsec: end.cpu.usageUsec - start.cpu.usageUsec,+ userUsec: end.cpu.userUsec - start.cpu.userUsec,+ systemUsec: end.cpu.systemUsec - start.cpu.systemUsec,+ nrThrottled: end.cpu.nrThrottled - start.cpu.nrThrottled,+ throttledUsec: end.cpu.throttledUsec - start.cpu.throttledUsec,+ }+ : null;++const summarizeSamples = (values: number[]) => {+ if (values.length === 0) return null;+ const sorted = values.toSorted((left, right) => left - right);+ const middle = Math.floor(sorted.length / 2);+ const median =+ sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? 0) + (sorted[middle] ?? 0)) / 2 : (sorted[middle] ?? 0);+ const mean = sorted.reduce((total, value) => total + value, 0) / sorted.length;+ const variance = sorted.reduce((total, value) => total + (value - mean) ** 2, 0) / sorted.length;+ return {+ count: sorted.length,+ minBytes: sorted[0] ?? null,+ medianBytes: median,+ p95Bytes: sorted[Math.min(sorted.length - 1, Math.ceil(sorted.length * 0.95) - 1)] ?? null,+ maxBytes: sorted.at(-1) ?? null,+ standardDeviationBytes: Math.round(Math.sqrt(variance)),+ };+};++const getTrendBytesPerHour = (samples: Array<{ capturedAt: string; value: number }>) => {+ if (samples.length < 2) return null;+ const originMs = Date.parse(samples[0]?.capturedAt ?? "");+ const timedSamples = samples.flatMap(({ capturedAt, value }) => {+ const capturedAtMs = Date.parse(capturedAt);+ return Number.isFinite(originMs) && Number.isFinite(capturedAtMs)+ ? [{ elapsedMs: capturedAtMs - originMs, value }]+ : [];+ });+ if (timedSamples.length < 2) return null;+ const xMean = timedSamples.reduce((total, { elapsedMs }) => total + elapsedMs, 0) / timedSamples.length;+ const yMean = timedSamples.reduce((total, { value }) => total + value, 0) / timedSamples.length;+ let numerator = 0;+ let denominator = 0;+ for (const { elapsedMs, value } of timedSamples) {+ numerator += (elapsedMs - xMean) * (value - yMean);+ denominator += (elapsedMs - xMean) ** 2;+ }+ return denominator === 0 ? null : (numerator / denominator) * 3_600_000;+};++export const summarizeRuntimeMemory = (checkpoints: RuntimeMemoryCheckpoint[]) => {+ const startup = checkpoints.find(({ name }) => name === "startup");+ const workload = checkpoints.find(({ name }) => name === "workload");+ const settled = checkpoints.at(-1);+ const settleValues = checkpoints+ .filter(({ name }) => name.startsWith("settle-"))+ .map(({ container }) => container.currentBytes);+ const settleCurrentSamples = checkpoints+ .filter(({ name }) => name.startsWith("settle-"))+ .map(({ capturedAt, container }) => ({ capturedAt, value: container.currentBytes }));+ const settleAnonymousValues = checkpoints+ .filter(({ name }) => name.startsWith("settle-"))+ .map(({ container }) => container.anonymousBytes);+ const settleAnonymousSamples = checkpoints+ .filter(({ name }) => name.startsWith("settle-"))+ .map(({ capturedAt, container }) => ({ capturedAt, value: container.anonymousBytes }));+ const settleFileValues = checkpoints+ .filter(({ name }) => name.startsWith("settle-"))+ .map(({ container }) => container.fileBytes);+ const settleFileSamples = checkpoints+ .filter(({ name }) => name.startsWith("settle-"))+ .map(({ capturedAt, container }) => ({ capturedAt, value: container.fileBytes }));+ const settle = summarizeSamples(settleValues);+ const settleAnonymous = summarizeSamples(settleAnonymousValues);+ const settleFile = summarizeSamples(settleFileValues);+ const currentValues = checkpoints.map(({ container }) => container.currentBytes);+ const peakValues = checkpoints.flatMap(({ container }) =>+ container.peakBytes === null ? [] : [container.peakBytes],+ );+ const growthBytes = workload && settle ? settle.medianBytes - workload.container.currentBytes : null;+ return {+ startupBytes: startup?.container.currentBytes ?? null,+ workloadBytes: workload?.container.currentBytes ?? null,+ settledBytes: settled?.container.currentBytes ?? null,+ maximumSampleBytes: currentValues.length > 0 ? Math.max(...currentValues) : null,+ peakBytes: peakValues.length > 0 ? Math.max(...peakValues) : null,+ growthBytes,+ growthPercent:+ workload && growthBytes !== null && workload.container.currentBytes > 0+ ? (growthBytes / workload.container.currentBytes) * 100+ : null,+ settle: settle+ ? {+ ...settle,+ trendBytesPerHour: getTrendBytesPerHour(settleCurrentSamples),+ anonymous: settleAnonymous+ ? {+ ...settleAnonymous,+ trendBytesPerHour: getTrendBytesPerHour(settleAnonymousSamples),+ }+ : null,+ file: settleFile ? { ...settleFile, trendBytesPerHour: getTrendBytesPerHour(settleFileSamples) } : null,+ }+ : null,+ cpu: {+ startupToWorkload: cpuDelta(startup, workload),+ workloadToSettled: cpuDelta(workload, settled),+ },+ };+};diff --git a/scripts/benchmarks/docker-runtime-lib.spec.ts b/scripts/benchmarks/docker-runtime-lib.spec.tsnew file mode 100644index 000000000..c434b3217--- /dev/null+++ b/scripts/benchmarks/docker-runtime-lib.spec.ts@@ -0,0 +1,432 @@+import { describe, expect, it } from "vitest";++import {+ getBrowserNetworkIsolationLaunchArgs,+ getSpotlightIdleMountFailure,+ getSpotlightIdleNetworkFailure,+ getTrpcRequestIdentities,+ getUnrecoveredWidgetDataRequests,+ getTrpcProcedures,+ getRuntimeClaimIneligibleReasons,+ getRuntimeMetricEligibility,+ hasBlockingWidgetDataAborts,+ normalizeDockerArchitecture,+ isRuntimeWidgetDataProcedure,+ isRuntimeWidgetDataRequest,+ inspectTrpcBatchStreamResponse,+ parseRuntimeMemorySnapshot,+ recordWidgetDataRequestOutcome,+ summarizeRuntimeMemory,+} from "./docker-runtime-lib.mts";++const snapshot = (current: number, peak: number, cpuUsageUsec = 1_000) => `memory_current=${current}+memory_peak=${peak}+cgroup_anon=100+cgroup_file=20+cpu_usage_usec=${cpuUsageUsec}+cpu_user_usec=${cpuUsageUsec - 300}+cpu_system_usec=300+cpu_nr_throttled=2+cpu_throttled_usec=50+process=42|1|200|next-server|180+process=7|1|10|redis-server|8+redis_used_memory=30+redis_used_memory_peak=40`;++const trpcRequestUrl = (input: string) =>+ `https://homarr.test/api/trpc/widget.weather.atLocation,app.byIds?batch=1&input=${input}`;++describe("Docker runtime memory parsing", () => {+ it("classifies every procedure in batched tRPC requests", () => {+ expect(getTrpcProcedures("https://homarr.test/api/trpc/widget.foo,queryCache.setItem?batch=1")).toEqual([+ "widget.foo",+ "queryCache.setItem",+ ]);+ expect(getTrpcProcedures("https://homarr.test/api/trpc/widget.foo%2Csearch.query?batch=1")).toEqual([+ "widget.foo",+ "search.query",+ ]);+ expect(getTrpcProcedures("https://homarr.test/api/health/ready")).toEqual([]);+ expect(isRuntimeWidgetDataProcedure("widget.calendar.findAllEvents")).toBe(true);+ expect(isRuntimeWidgetDataProcedure("app.byIds")).toBe(true);+ expect(isRuntimeWidgetDataProcedure("integration.byIds")).toBe(true);+ expect(isRuntimeWidgetDataProcedure("docker.getContainers")).toBe(true);+ expect(isRuntimeWidgetDataProcedure("widget.beszel.getSystemStats")).toBe(true);+ expect(isRuntimeWidgetDataProcedure("widget.beszel.subscribeSystemStats")).toBe(false);+ expect(isRuntimeWidgetDataProcedure("widget.app.ping")).toBe(false);+ expect(isRuntimeWidgetDataProcedure("board.getBoardByName")).toBe(false);+ expect(isRuntimeWidgetDataRequest("GET", "widget.weather.atLocation")).toBe(true);+ expect(isRuntimeWidgetDataRequest("POST", "widget.options.saveItemOptions")).toBe(false);+ });++ it("normalizes Node's x64 architecture to Docker's amd64 name", () => {+ expect(normalizeDockerArchitecture("x64")).toBe("amd64");+ expect(normalizeDockerArchitecture("arm64")).toBe("arm64");+ });++ it("keys batched tRPC operations by procedure and canonical serialized input", () => {+ const first = encodeURIComponent(+ JSON.stringify({+ 0: { json: { location: "Paris", units: "metric" } },+ 1: { json: { ids: ["app-1"] } },+ }),+ );+ const reordered = encodeURIComponent(+ JSON.stringify({+ 0: { json: { units: "metric", location: "Paris" } },+ 1: { json: { ids: ["app-1"] } },+ }),+ );+ const different = encodeURIComponent(+ JSON.stringify({+ 0: { json: { location: "Lyon", units: "metric" } },+ 1: { json: { ids: ["app-1"] } },+ }),+ );+ const identities = getTrpcRequestIdentities(trpcRequestUrl(first));+ expect(identities.map(({ procedure }) => procedure)).toEqual(["widget.weather.atLocation", "app.byIds"]);+ expect(identities.map(({ batchIndex }) => batchIndex)).toEqual([0, 1]);+ expect(identities).toEqual(getTrpcRequestIdentities(trpcRequestUrl(reordered)));+ expect(getTrpcRequestIdentities(trpcRequestUrl(different))[0]?.identity).not.toBe(identities[0]?.identity);+ expect(getTrpcRequestIdentities(trpcRequestUrl(different))[1]?.identity).toBe(identities[1]?.identity);+ expect(+ identities.every(+ ({ identity, inputHash, procedure }) =>+ procedure.includes(".") && /^[a-f0-9]{64}$/.test(inputHash) && identity === `${procedure}#${inputHash}`,+ ),+ ).toBe(true);+ expect(JSON.stringify(identities)).not.toContain("Paris");+ expect(() =>+ getTrpcRequestIdentities("https://homarr.test/api/trpc/widget.weather.atLocation?batch=1&input=%7Bmalformed"),+ ).toThrow("Malformed serialized tRPC request input");+ });++ it("requires every aborted widget-data request identity to be recovered by an exact successful request", () => {+ const recoveryBalance = new Map<string, number>();+ recordWidgetDataRequestOutcome(recoveryBalance, ["weather#paris", "app#1"], "aborted");+ recordWidgetDataRequestOutcome(recoveryBalance, ["app#1", "weather#lyon"], "completed");++ expect(getUnrecoveredWidgetDataRequests(recoveryBalance)).toEqual(["weather#paris"]);++ recordWidgetDataRequestOutcome(recoveryBalance, ["weather#paris"], "completed");+ expect(getUnrecoveredWidgetDataRequests(recoveryBalance)).toEqual([]);+ });++ it("credits an earlier successful response when a superseding refetch is aborted", () => {+ const recoveryBalance = new Map<string, number>();+ recordWidgetDataRequestOutcome(recoveryBalance, ["widget.weather.atLocation"], "completed");+ recordWidgetDataRequestOutcome(recoveryBalance, ["widget.weather.atLocation"], "aborted");++ expect(getUnrecoveredWidgetDataRequests(recoveryBalance)).toEqual([]);+ });++ it("allows unrecovered aborts only for the non-claim login transition", () => {+ expect(hasBlockingWidgetDataAborts(true, 2)).toBe(false);+ expect(hasBlockingWidgetDataAborts(false, 0)).toBe(false);+ expect(hasBlockingWidgetDataAborts(false, 1)).toBe(true);+ });++ it("allows eager baseline Spotlight work but keeps preload-only preparation network-free", () => {+ expect(getSpotlightIdleNetworkFailure("mounted", 1)).toBeNull();+ expect(getSpotlightIdleNetworkFailure("preload-only", 0)).toBeNull();+ expect(getSpotlightIdleNetworkFailure("preload-only", 1)).toBe(+ "Idle Spotlight preload-only preparation made 1 non-widget tRPC requests",+ );+ expect(getSpotlightIdleMountFailure("mounted", 1)).toBeNull();+ expect(getSpotlightIdleMountFailure("preload-only", 0)).toBeNull();+ expect(getSpotlightIdleMountFailure("preload-only", 1)).toBe(+ "Idle Spotlight preload mounted the UI before user intent",+ );+ });++ it("fails closed on HTTP, malformed, missing, and per-operation streamed tRPC errors", async () => {+ const errorShape = {+ code: -32603,+ data: { code: "INTERNAL_SERVER_ERROR", httpStatus: 500 },+ message: "boom",+ };+ const head = `${JSON.stringify({ json: { 0: [[0], [null, 0, 0]] } })}\n`;+ const errorBody = `${head}${JSON.stringify({ json: [0, 0, [[{ error: errorShape }]]] })}\n`;+ const rejectedBody = `${head}${JSON.stringify({ json: [0, 1, errorShape] })}\n`;+ const rejectedDataBody = [+ head.trimEnd(),+ JSON.stringify({ json: [0, 0, [[{ result: 0 }], ["result", 0, 1]]] }),+ JSON.stringify({ json: [1, 0, [[{ data: 0 }], ["data", 0, 2]]] }),+ JSON.stringify({ json: [2, 1, errorShape] }),+ "",+ ].join("\n");+ const successfulUserDataBody = [+ head.trimEnd(),+ JSON.stringify({ json: [0, 0, [[{ result: 0 }], ["result", 0, 1]]] }),+ JSON.stringify({ json: [1, 0, [[{ data: 0 }], ["data", 0, 2]]] }),+ JSON.stringify({ json: [2, 0, [[{ error: errorShape }]]] }),+ "",+ ].join("\n");+ const mixedBody = [+ JSON.stringify({ json: { 0: [[0], [null, 0, 0]], 1: [[0], [null, 0, 1]] } }),+ JSON.stringify({ json: [0, 0, [[{ result: 0 }], ["result", 0, 2]]] }),+ JSON.stringify({ json: [1, 0, [[{ error: errorShape }]]] }),+ JSON.stringify({ json: [2, 0, [[{ data: "ok" }]]] }),+ "",+ ].join("\n");++ await expect(inspectTrpcBatchStreamResponse(500, errorBody, 2)).resolves.toEqual({+ failures: [+ { batchIndex: 0, kind: "http-status", status: 500 },+ { batchIndex: 1, kind: "http-status", status: 500 },+ ],+ successfulIndexes: [],+ });+ for (const body of ["", "not-json\n", "{}\n", head.trimEnd()]) {+ await expect(inspectTrpcBatchStreamResponse(200, body, 1)).resolves.toEqual({+ failures: [{ batchIndex: 0, kind: "invalid-jsonl" }],+ successfulIndexes: [],+ });+ }+ await expect(inspectTrpcBatchStreamResponse(200, head, 2)).resolves.toEqual({+ failures: [+ { batchIndex: 0, kind: "index-mismatch" },+ { batchIndex: 1, kind: "index-mismatch" },+ ],+ successfulIndexes: [],+ });+ await expect(inspectTrpcBatchStreamResponse(200, errorBody, 1)).resolves.toEqual({+ failures: [+ {+ batchIndex: 0,+ httpStatus: 500,+ jsonRpcCode: -32603,+ kind: "trpc-error",+ trpcCode: "INTERNAL_SERVER_ERROR",+ },+ ],+ successfulIndexes: [],+ });+ for (const body of [rejectedBody, rejectedDataBody]) {+ await expect(inspectTrpcBatchStreamResponse(200, body, 1)).resolves.toEqual({+ failures: [{ batchIndex: 0, kind: "stream-error" }],+ successfulIndexes: [],+ });+ }+ await expect(inspectTrpcBatchStreamResponse(200, successfulUserDataBody, 1)).resolves.toEqual({+ failures: [],+ successfulIndexes: [0],+ });+ await expect(inspectTrpcBatchStreamResponse(200, mixedBody, 2)).resolves.toEqual({+ failures: [+ {+ batchIndex: 1,+ httpStatus: 500,+ jsonRpcCode: -32603,+ kind: "trpc-error",+ trpcCode: "INTERNAL_SERVER_ERROR",+ },+ ],+ successfulIndexes: [0],+ });+ });++ it("isolates external browser traffic without disabling Chromium's HTTP cache", () => {+ expect(getBrowserNetworkIsolationLaunchArgs("http://127.0.0.1:43123")).toEqual([+ "--proxy-server=http://127.0.0.1:43123",+ "--proxy-bypass-list=127.0.0.1;localhost",+ "--host-resolver-rules=MAP * ~NOTFOUND, EXCLUDE 127.0.0.1, EXCLUDE localhost",+ ]);+ expect(getBrowserNetworkIsolationLaunchArgs("http://127.0.0.1:43123").join(" ")).not.toContain("disable-cache");+ });++ it("only permits claims with native, SHA-pinned images and enough settle samples", () => {+ expect(+ getRuntimeClaimIneligibleReasons({+ expectedSha: "abc123",+ expectedSourceFingerprint: "source-hash",+ browserNetworkIsolated: true,+ serverNetworkIsolated: true,+ imageArchitecture: "amd64",+ lcpObservationMs: 5_000,+ lcpSampleCount: 20,+ nodeArchitecture: "x64",+ pageSampleCount: 20,+ requireImplementationMarkers: true,+ revision: "abc123",+ sourceFingerprint: "source-hash",+ settleMs: 10 * 60 * 1_000,+ settleSampleCount: 20,+ widgetDataQuietMs: 500,+ widgetDataSampleCount: 20,+ }),+ ).toEqual([]);++ expect(+ getRuntimeClaimIneligibleReasons({+ expectedSha: "abc123",+ expectedSourceFingerprint: "source-hash",+ browserNetworkIsolated: false,+ serverNetworkIsolated: false,+ imageArchitecture: "arm64",+ lcpObservationMs: 1_000,+ lcpSampleCount: 1,+ nodeArchitecture: "x64",+ pageSampleCount: 1,+ requireImplementationMarkers: false,+ revision: null,+ sourceFingerprint: null,+ settleMs: 0,+ settleSampleCount: 0,+ widgetDataQuietMs: 100,+ widgetDataSampleCount: 1,+ }),+ ).toEqual([+ "image architecture arm64 is not host amd64",+ "image revision label is missing",+ "image source fingerprint label is missing",+ "browser external network isolation is not active",+ "server external network isolation is not active",+ "widget implementation markers are not required",+ "page sample count 1 is below 20",+ "LCP observation 1000ms is below 5000ms",+ "LCP sample count 1 is below 20",+ "widget data quiet window 100ms is below 500ms",+ "widget data sample count 1 is below 20",+ "settle duration 0ms is below 600000ms",+ "settle sample count 0 is below 20",+ ]);+ });++ it("scopes repeatable, within-run, and single-sample metrics separately", () => {+ const eligibility = getRuntimeMetricEligibility({+ expectedSha: "abc123",+ expectedSourceFingerprint: "source-hash",+ browserNetworkIsolated: true,+ serverNetworkIsolated: true,+ imageArchitecture: "amd64",+ lcpObservationMs: 5_000,+ lcpSampleCount: 20,+ nodeArchitecture: "x64",+ pageSampleCount: 20,+ requireImplementationMarkers: true,+ revision: "abc123",+ sourceFingerprint: "source-hash",+ settleMs: 10 * 60 * 1_000,+ settleSampleCount: 20,+ widgetDataQuietMs: 500,+ widgetDataSampleCount: 20,+ });++ expect(eligibility.pageLoads).toMatchObject({+ claimEligible: true,+ kind: "comparative",+ requiredSampleCount: 20,+ sampleCount: 20,+ });+ expect(eligibility.largestContentfulPaint).toMatchObject({+ claimEligible: true,+ kind: "comparative",+ requiredSampleCount: 20,+ sampleCount: 20,+ });+ expect(eligibility.widgetDataSettled).toMatchObject({+ claimEligible: true,+ kind: "comparative",+ requiredSampleCount: 20,+ sampleCount: 20,+ });+ expect(eligibility.settleStability).toMatchObject({+ claimEligible: true,+ kind: "within-run",+ requiredSampleCount: 20,+ sampleCount: 20,+ });+ expect(eligibility.settleStability.limitations).toContain("one container instance");+ expect(eligibility.startup).toMatchObject({ claimEligible: false, kind: "diagnostic", sampleCount: 1 });+ expect(eligibility.memoryLevels).toMatchObject({ claimEligible: false, kind: "diagnostic", sampleCount: 1 });+ expect(eligibility.coldSpotlightInteraction).toMatchObject({+ claimEligible: false,+ kind: "diagnostic",+ sampleCount: 1,+ });+ });++ it("normalizes cgroup, process, and Redis values", () => {+ expect(parseRuntimeMemorySnapshot("startup", snapshot(1_000, 2_000))).toMatchObject({+ name: "startup",+ container: { currentBytes: 1_000, peakBytes: 2_000, anonymousBytes: 100, fileBytes: 20 },+ cpu: { usageUsec: 1_000, userUsec: 700, systemUsec: 300, nrThrottled: 2, throttledUsec: 50 },+ processes: [+ { pid: 42, parentPid: 1, rssBytes: 200 * 1024, pssBytes: 180 * 1024, command: "next-server" },+ { pid: 7, parentPid: 1, rssBytes: 10 * 1024, pssBytes: 8 * 1024, command: "redis-server" },+ ],+ redis: { usedMemoryBytes: 30, peakMemoryBytes: 40 },+ });+ });++ it("keeps a failed Redis collection absent instead of reporting zero bytes", () => {+ const withoutRedis = snapshot(1_000, 2_000)+ .split("\n")+ .filter((line) => !line.startsWith("redis_"))+ .join("\n");++ expect(parseRuntimeMemorySnapshot("startup", withoutRedis).redis).toBeNull();+ });++ it("reports workload-to-settled growth and the largest sample", () => {+ const checkpoints = [+ parseRuntimeMemorySnapshot("startup", snapshot(1_000, 2_000)),+ parseRuntimeMemorySnapshot("workload", snapshot(1_100, 2_500, 1_500)),+ parseRuntimeMemorySnapshot("settle-1", snapshot(1_200, 2_500, 1_800)),+ ];+ checkpoints.forEach((checkpoint, index) => {+ checkpoint.capturedAt = new Date(Date.UTC(2026, 0, 1, 0, index)).toISOString();+ });++ expect(summarizeRuntimeMemory(checkpoints)).toEqual({+ startupBytes: 1_000,+ workloadBytes: 1_100,+ settledBytes: 1_200,+ maximumSampleBytes: 1_200,+ peakBytes: 2_500,+ growthBytes: 100,+ growthPercent: 100 / 11,+ settle: {+ count: 1,+ minBytes: 1_200,+ medianBytes: 1_200,+ p95Bytes: 1_200,+ maxBytes: 1_200,+ standardDeviationBytes: 0,+ trendBytesPerHour: null,+ anonymous: {+ count: 1,+ minBytes: 100,+ medianBytes: 100,+ p95Bytes: 100,+ maxBytes: 100,+ standardDeviationBytes: 0,+ trendBytesPerHour: null,+ },+ file: {+ count: 1,+ minBytes: 20,+ medianBytes: 20,+ p95Bytes: 20,+ maxBytes: 20,+ standardDeviationBytes: 0,+ trendBytesPerHour: null,+ },+ },+ cpu: {+ startupToWorkload: { usageUsec: 500, userUsec: 500, systemUsec: 0, nrThrottled: 0, throttledUsec: 0 },+ workloadToSettled: { usageUsec: 300, userUsec: 300, systemUsec: 0, nrThrottled: 0, throttledUsec: 0 },+ },+ });+ });++ it("derives memory trends from observed checkpoint timestamps", () => {+ const first = parseRuntimeMemorySnapshot("settle-1", snapshot(1_000, 2_000));+ const second = parseRuntimeMemorySnapshot("settle-2", snapshot(1_100, 2_000));+ first.capturedAt = "2026-01-01T00:00:00.000Z";+ second.capturedAt = "2026-01-01T02:00:00.000Z";++ expect(summarizeRuntimeMemory([first, second]).settle?.trendBytesPerHour).toBe(50);+ });+});diff --git a/scripts/benchmarks/docker-runtime.mts b/scripts/benchmarks/docker-runtime.mtsnew file mode 100644index 000000000..b3500e70c--- /dev/null+++ b/scripts/benchmarks/docker-runtime.mts@@ -0,0 +1,1656 @@+import { execFile } from "node:child_process";+import { createHash } from "node:crypto";+import { mkdtemp, mkdir, rm, writeFile } from "node:fs/promises";+import { createServer } from "node:http";+import type { AddressInfo } from "node:net";+import os from "node:os";+import path from "node:path";+import { promisify } from "node:util";+import { chromium } from "@playwright/test";+import type { BrowserContext, BrowserContextOptions, Page, Request } from "@playwright/test";++import {+ getBrowserNetworkIsolationLaunchArgs,+ getSpotlightIdleMountFailure,+ getSpotlightIdleNetworkFailure,+ getRuntimeClaimIneligibleReasons,+ getRuntimeMetricEligibility,+ getTrpcProcedures,+ getTrpcRequestIdentities,+ getUnrecoveredWidgetDataRequests,+ hasBlockingWidgetDataAborts,+ inspectTrpcBatchStreamResponse,+ isRuntimeWidgetDataRequest,+ parseRuntimeMemorySnapshot,+ recordWidgetDataRequestOutcome,+ summarizeRuntimeMemory,+} from "./docker-runtime-lib.mts";+import type { RuntimeMemoryCheckpoint, TrpcBatchInspection, TrpcRequestIdentity } from "./docker-runtime-lib.mts";+import { summarize } from "./dev-benchmark-lib.mts";++const execFileAsync = promisify(execFile);+const image = process.env.RUNTIME_BENCHMARK_IMAGE;+if (!image) throw new Error("RUNTIME_BENCHMARK_IMAGE is required");++const expectedSha = process.env.RUNTIME_BENCHMARK_SHA?.trim() || null;+const expectedSourceFingerprint = process.env.RUNTIME_BENCHMARK_SOURCE_FINGERPRINT?.trim() || null;+const settleMs = Number(process.env.RUNTIME_BENCHMARK_SETTLE_MS ?? 10 * 60 * 1_000);+const sampleIntervalMs = Number(process.env.RUNTIME_BENCHMARK_SAMPLE_INTERVAL_MS ?? 30_000);+const lcpObservationMs = Number(process.env.RUNTIME_BENCHMARK_LCP_OBSERVATION_MS ?? 5_000);+const lcpStabilityMs = 500;+const widgetDataQuietMs = Number(process.env.RUNTIME_BENCHMARK_WIDGET_DATA_QUIET_MS ?? 500);+const spotlightIdleMs = Number(process.env.RUNTIME_BENCHMARK_SPOTLIGHT_IDLE_MS ?? 2_500);+const spotlightIdlePolicy = process.env.RUNTIME_BENCHMARK_SPOTLIGHT_IDLE_POLICY;+const interactionIterations = Number(process.env.RUNTIME_BENCHMARK_INTERACTION_ITERATIONS ?? 7);+const pageIterations = Number(process.env.RUNTIME_BENCHMARK_PAGE_ITERATIONS ?? 20);+const readyMarkerPolicy = process.env.RUNTIME_BENCHMARK_REQUIRE_READY_MARKERS;+const requireImplementationMarkers = readyMarkerPolicy === "true";+const outputDirectory = path.resolve(process.env.RUNTIME_BENCHMARK_OUTPUT_DIR ?? "benchmark-results/docker-runtime");+const routePaths = (+ process.env.RUNTIME_BENCHMARK_ROUTES ?? "/manage,/manage/apps,/manage/integrations,/manage/settings"+)+ .split(",")+ .filter(Boolean);+const viewport = { height: 720, width: 1280 } as const;++const safeUrlDetails = (rawUrl: string) => {+ const parsed = new URL(rawUrl);+ return {+ origin: parsed.origin,+ pathname: parsed.pathname,+ protocol: parsed.protocol,+ urlHash: createHash("sha256").update(parsed.href).digest("hex"),+ };+};++if (!Number.isFinite(settleMs) || settleMs < 0) throw new Error("RUNTIME_BENCHMARK_SETTLE_MS must be non-negative");+if (!Number.isFinite(sampleIntervalMs) || sampleIntervalMs <= 0) {+ throw new Error("RUNTIME_BENCHMARK_SAMPLE_INTERVAL_MS must be positive");+}+if (!Number.isFinite(lcpObservationMs) || lcpObservationMs < 1_000) {+ throw new Error("RUNTIME_BENCHMARK_LCP_OBSERVATION_MS must be at least 1000");+}+if (!Number.isFinite(spotlightIdleMs) || spotlightIdleMs < 0) {+ throw new Error("RUNTIME_BENCHMARK_SPOTLIGHT_IDLE_MS must be non-negative");+}+if (spotlightIdlePolicy !== "mounted" && spotlightIdlePolicy !== "preload-only") {+ throw new Error('RUNTIME_BENCHMARK_SPOTLIGHT_IDLE_POLICY must be "mounted" or "preload-only"');+}+if (!Number.isFinite(widgetDataQuietMs) || widgetDataQuietMs < 0) {+ throw new Error("RUNTIME_BENCHMARK_WIDGET_DATA_QUIET_MS must be non-negative");+}+if (!Number.isInteger(interactionIterations) || interactionIterations < 7) {+ throw new Error("RUNTIME_BENCHMARK_INTERACTION_ITERATIONS must be an integer of at least 7");+}+if (!Number.isInteger(pageIterations) || pageIterations < 1) {+ throw new Error("RUNTIME_BENCHMARK_PAGE_ITERATIONS must be a positive integer");+}+if (readyMarkerPolicy !== "true" && readyMarkerPolicy !== "false") {+ throw new Error("RUNTIME_BENCHMARK_REQUIRE_READY_MARKERS must be true or false");+}++const startExternalDenyProxyAsync = async () => {+ const attempts = new Map<string, { count: number; method: string; origin: string | null; target: string }>();+ const recordAttempt = (method: string, target: string) => {+ let origin: string | null = null;+ try {+ origin = new URL(method === "CONNECT" ? `https://${target}` : target).origin;+ } catch {+ // Keep the raw target when Chromium sends a non-URL proxy request.+ }+ const key = `${method} ${target}`;+ const existing = attempts.get(key);+ attempts.set(key, { count: (existing?.count ?? 0) + 1, method, origin, target });+ };+ const server = createServer((request, response) => {+ recordAttempt(request.method ?? "GET", request.url ?? "");+ response.writeHead(502, {+ "cache-control": "no-store",+ connection: "close",+ "x-homarr-benchmark-blocked": "true",+ });+ response.end("External network disabled by Homarr runtime benchmark\n");+ });+ server.on("connect", (request, socket) => {+ recordAttempt("CONNECT", request.url ?? "");+ socket.end("HTTP/1.1 502 Bad Gateway\r\nConnection: close\r\n\r\n");+ });+ server.on("upgrade", (request, socket) => {+ const rawTarget = request.url ?? "";+ const target = /^wss?:\/\//.test(rawTarget) ? rawTarget : `ws://${request.headers.host ?? "unknown"}${rawTarget}`;+ recordAttempt("UPGRADE", target);+ socket.end("HTTP/1.1 502 Bad Gateway\r\nConnection: close\r\nX-Homarr-Benchmark-Blocked: true\r\n\r\n");+ });+ await new Promise<void>((resolve, reject) => {+ server.once("error", reject);+ server.listen(0, "127.0.0.1", () => {+ server.off("error", reject);+ resolve();+ });+ });+ const address = server.address() as AddressInfo;+ return {+ closeAsync: async () => {+ await new Promise<void>((resolve, reject) => {+ server.close((error) => (error ? reject(error) : resolve()));+ });+ },+ getAttempts: () => [...attempts.values()].toSorted((left, right) => left.target.localeCompare(right.target)),+ host: address.address,+ port: address.port,+ url: `http://127.0.0.1:${address.port}`,+ };+};++const memoryScript = String.raw`+echo "memory_current=$(cat /sys/fs/cgroup/memory.current)"+memory_peak="$(cat /sys/fs/cgroup/memory.peak 2>/dev/null || true)"+case "$memory_peak" in ''|'max') ;; *) echo "memory_peak=$memory_peak" ;; esac+awk '/^anon / { print "cgroup_anon=" $2 } /^file / { print "cgroup_file=" $2 }' /sys/fs/cgroup/memory.stat+awk '/^usage_usec / { print "cpu_usage_usec=" $2 } /^user_usec / { print "cpu_user_usec=" $2 } /^system_usec / { print "cpu_system_usec=" $2 } /^nr_throttled / { print "cpu_nr_throttled=" $2 } /^throttled_usec / { print "cpu_throttled_usec=" $2 }' /sys/fs/cgroup/cpu.stat+for status_file in /proc/[0-9]*/status; do+ process_dir="\${status_file%/status}"+ process_values="$(awk '/^Name:/ { name=$2 } /^Pid:/ { pid=$2 } /^PPid:/ { ppid=$2 } /^VmRSS:/ { rss=$2 } END { print pid "|" ppid "|" rss "|" name }' "$status_file")"+ process_pss="$(awk '/^Pss:/ { print $2 }' "$process_dir/smaps_rollup" 2>/dev/null || echo 0)"+ echo "process=$process_values|$process_pss"+done+redis_info="$(redis-cli INFO memory 2>/dev/null | tr -d '\r' || true)"+redis_used="$(printf '%s\n' "$redis_info" | awk -F: '/^used_memory:/ { print $2 }')"+redis_peak="$(printf '%s\n' "$redis_info" | awk -F: '/^used_memory_peak:/ { print $2 }')"+if [ -n "$redis_used" ] && [ -n "$redis_peak" ]; then+ echo "redis_used_memory=$redis_used"+ echo "redis_used_memory_peak=$redis_peak"+fi+`;++const waitForReadyAsync = async (baseUrl: string) => {+ const deadline = Date.now() + 120_000;+ while (Date.now() < deadline) {+ try {+ const response = await fetch(`${baseUrl}/api/health/ready`);+ if (response.ok) return;+ } catch {+ // The socket is not listening yet.+ }+ await new Promise((resolve) => setTimeout(resolve, 1_000));+ }+ throw new Error(`Container did not become ready at ${baseUrl}`);+};++const captureCheckpointAsync = async (containerId: string, name: string): Promise<RuntimeMemoryCheckpoint> => {+ const { stdout } = await execFileAsync("docker", ["exec", containerId, "sh", "-c", memoryScript], {+ maxBuffer: 4 * 1024 * 1024,+ });+ await writeFile(path.join(outputDirectory, `${name}.txt`), stdout);+ return parseRuntimeMemorySnapshot(name, stdout);+};++const waitForBoardWidgetsAsync = async (page: Page) => {+ const boardSelector = "[data-homarr-dev-benchmark-board]";+ await page.locator(boardSelector).waitFor({ state: "visible", timeout: 30_000 });+ await page.waitForFunction((selector) => {+ const board = document.querySelector(selector);+ const items = [...(board?.querySelectorAll('[data-type="item"]') ?? [])];+ return items.length > 0 && items.every((item) => item.querySelector(".grid-stack-item-content") !== null);+ }, boardSelector);++ if (requireImplementationMarkers) {+ await page.waitForFunction((selector) => {+ const board = document.querySelector(selector);+ const items = [...(board?.querySelectorAll('[data-type="item"]') ?? [])];+ return (+ items.length > 0 &&+ items.every(+ (item) =>+ item.querySelector("[data-homarr-widget-ready]") !== null ||+ item.querySelector('[data-homarr-widget-error], a[href*="/manage/tools/logs"]') !== null,+ )+ );+ }, boardSelector);+ } else {+ await page.waitForLoadState("networkidle");+ }+ await page.evaluate(+ () => new Promise<void>((resolve) => requestAnimationFrame(() => requestAnimationFrame(() => resolve()))),+ );+ return await readBoardWidgetStateAsync(page);+};++const waitForSpotlightIdlePreparationAsync = async (page: Page) => {+ const startedAt = performance.now();+ const marker =+ spotlightIdlePolicy === "preload-only"+ ? "[data-homarr-dev-benchmark-spotlight-preloaded]"+ : "[data-homarr-dev-benchmark-spotlight-mounted]";+ await page.locator(marker).waitFor({+ state: "attached",+ timeout: Math.max(30_000, spotlightIdleMs + 5_000),+ });+ const remainingIdleMs = Math.max(0, spotlightIdleMs - (performance.now() - startedAt));+ if (remainingIdleMs > 0) await page.waitForTimeout(remainingIdleMs);+ await page.evaluate(+ () => new Promise<void>((resolve) => requestAnimationFrame(() => requestAnimationFrame(() => resolve()))),+ );+ await page.waitForTimeout(100);+ const mountFailure = getSpotlightIdleMountFailure(+ spotlightIdlePolicy,+ await page.locator("[data-homarr-dev-benchmark-spotlight-mounted]").count(),+ );+ if (mountFailure) throw new Error(mountFailure);+};++const readBoardWidgetStateAsync = async (page: Page) =>+ await page.evaluate((selector) => {+ const board = document.querySelector(selector);+ return {+ widgetCount: board?.querySelectorAll('[data-type="item"]').length ?? 0,+ implementationMarkerCount: board?.querySelectorAll("[data-homarr-widget-ready]").length ?? 0,+ widgetErrorCount:+ board?.querySelectorAll('[data-homarr-widget-error], a[href*="/manage/tools/logs"]').length ?? 0,+ };+ }, "[data-homarr-dev-benchmark-board]");++const assertBoardWidgetState = (state: Awaited<ReturnType<typeof readBoardWidgetStateAsync>>, scope: string) => {+ if (requireImplementationMarkers && state.implementationMarkerCount !== state.widgetCount) {+ throw new Error(`${scope} has incomplete widget implementation markers`);+ }+ if (state.widgetErrorCount > 0) {+ throw new Error(`${scope} rendered ${state.widgetErrorCount} widget errors`);+ }+};++type WidgetDataRequestTracker = {+ activeRequests: Map<Request, { operationCount: number; widgetOperations: TrpcRequestIdentity[] }>;+ completedOperationCount: number;+ failedRequests: string[];+ lastActivityAtMs: number;+ observedOperationCount: number;+ recoveryBalance: Map<string, number>;+};++const trackWidgetDataRequests = (page: Page): WidgetDataRequestTracker => {+ const tracker: WidgetDataRequestTracker = {+ activeRequests: new Map(),+ completedOperationCount: 0,+ failedRequests: [],+ lastActivityAtMs: performance.now(),+ observedOperationCount: 0,+ recoveryBalance: new Map(),+ };+ page.on("request", (request) => {+ if (request.method() !== "GET") return;+ try {+ const operations = getTrpcRequestIdentities(request.url());+ const widgetOperations = operations.filter(({ procedure }) =>+ isRuntimeWidgetDataRequest(request.method(), procedure),+ );+ if (widgetOperations.length === 0) return;+ tracker.activeRequests.set(request, { operationCount: operations.length, widgetOperations });+ tracker.observedOperationCount += widgetOperations.length;+ tracker.lastActivityAtMs = performance.now();+ } catch {+ if (getTrpcProcedures(request.url()).length === 0) return;+ tracker.failedRequests.push("malformed serialized tRPC request input");+ tracker.lastActivityAtMs = performance.now();+ }+ });+ const takeRequest = (request: Request) => {+ const trackedRequest = tracker.activeRequests.get(request);+ if (!trackedRequest) return null;+ tracker.activeRequests.delete(request);+ tracker.lastActivityAtMs = performance.now();+ return trackedRequest;+ };+ const settleTransportFailure = (request: Request, failure: string) => {+ const trackedRequest = takeRequest(request);+ if (!trackedRequest) return;+ const identities = trackedRequest.widgetOperations.map(({ identity }) => identity);+ if (failure === "net::ERR_ABORTED") {+ recordWidgetDataRequestOutcome(tracker.recoveryBalance, identities, "aborted");+ } else {+ tracker.failedRequests.push(`transport failure ${failure}: ${identities.join(",")}`);+ }+ };+ const settleInspection = (request: Request, inspection: TrpcBatchInspection) => {+ const trackedRequest = takeRequest(request);+ if (!trackedRequest) return;+ const failuresByIndex = new Map(inspection.failures.map((failure) => [failure.batchIndex, failure]));+ const successfulIndexes = new Set(inspection.successfulIndexes);+ for (const operation of trackedRequest.widgetOperations) {+ const failure = failuresByIndex.get(operation.batchIndex);+ if (failure) {+ tracker.failedRequests.push(`${JSON.stringify(failure)}: ${operation.identity}`);+ } else if (successfulIndexes.has(operation.batchIndex)) {+ tracker.completedOperationCount += 1;+ recordWidgetDataRequestOutcome(tracker.recoveryBalance, [operation.identity], "completed");+ } else {+ tracker.failedRequests.push(`missing tRPC response outcome: ${operation.identity}`);+ }+ }+ };+ page.on("requestfinished", (request) => {+ const trackedRequest = tracker.activeRequests.get(request);+ if (!trackedRequest) return;+ void (async () => {+ try {+ const response = await request.response();+ if (!response) {+ settleTransportFailure(request, "missing HTTP response");+ return;+ }+ settleInspection(+ request,+ await inspectTrpcBatchStreamResponse(response.status(), await response.text(), trackedRequest.operationCount),+ );+ } catch {+ settleTransportFailure(request, "unable to inspect response");+ }+ })();+ });+ page.on("requestfailed", (request) =>+ settleTransportFailure(request, request.failure()?.errorText ?? "request failed"),+ );+ return tracker;+};++const waitForWidgetDataSettledAsync = async (+ page: Page,+ tracker: WidgetDataRequestTracker,+ { allowUnrecoveredAborts = false } = {},+) => {+ const deadline = Date.now() + 30_000;+ while (Date.now() < deadline) {+ if (tracker.failedRequests.length > 0) {+ throw new Error(`Widget data requests failed: ${tracker.failedRequests.join("; ")}`);+ }+ const unrecoveredRequests = getUnrecoveredWidgetDataRequests(tracker.recoveryBalance);+ const remainingQuietMs = widgetDataQuietMs - (performance.now() - tracker.lastActivityAtMs);+ if (+ tracker.observedOperationCount > 0 &&+ tracker.activeRequests.size === 0 &&+ !hasBlockingWidgetDataAborts(allowUnrecoveredAborts, unrecoveredRequests.length) &&+ remainingQuietMs <= 0+ ) {+ const lastActivityAtMs = tracker.lastActivityAtMs;+ await page.evaluate(+ () => new Promise<void>((resolve) => requestAnimationFrame(() => requestAnimationFrame(() => resolve()))),+ );+ if (tracker.activeRequests.size === 0 && tracker.lastActivityAtMs === lastActivityAtMs) {+ return {+ completedOperationCount: tracker.completedOperationCount,+ observedOperationCount: tracker.observedOperationCount,+ quietWindowObserved: true,+ unrecoveredAbortedRequests: unrecoveredRequests,+ };+ }+ }+ await new Promise((resolve) => setTimeout(resolve, Math.max(10, Math.min(50, remainingQuietMs))));+ }+ const unrecoveredRequests = getUnrecoveredWidgetDataRequests(tracker.recoveryBalance);+ throw new Error(+ `Widget data did not settle: observed=${tracker.observedOperationCount} active=${tracker.activeRequests.size} unrecoveredAborts=${unrecoveredRequests.join(",") || "none"}`,+ );+};++const deferIdleCallbacksForInitialMeasurement = () => {+ const originalRequest = window.requestIdleCallback?.bind(window);+ const originalCancel = window.cancelIdleCallback?.bind(window);+ const queued = new Map<number, { callback: IdleRequestCallback; options?: IdleRequestOptions }>();+ let nextId = 1;+ Object.defineProperty(window, "requestIdleCallback", {+ configurable: true,+ value: (callback: IdleRequestCallback, options?: IdleRequestOptions) => {+ const id = nextId++;+ queued.set(id, { callback, options });+ return id;+ },+ });+ Object.defineProperty(window, "cancelIdleCallback", {+ configurable: true,+ value: (id: number) => {+ queued.delete(id);+ },+ });+ Object.defineProperty(window, "homarrReleaseBenchmarkIdleCallbacks", {+ configurable: true,+ value: () => {+ if (originalRequest)+ Object.defineProperty(window, "requestIdleCallback", { configurable: true, value: originalRequest });+ if (originalCancel)+ Object.defineProperty(window, "cancelIdleCallback", { configurable: true, value: originalCancel });+ for (const { callback, options } of queued.values()) {+ if (originalRequest) originalRequest(callback, options);+ else window.setTimeout(() => callback({ didTimeout: false, timeRemaining: () => 50 }), 0);+ }+ queued.clear();+ },+ });+};++const initializeBrowserVitals = () => {+ const state = {+ cls: 0,+ lcpElement: null as null | {+ className: string | null;+ id: string | null;+ origin: string | null;+ pathname: string | null;+ size: number | null;+ tagName: string | null;+ text: string | null;+ },+ lcpMs: null as number | null,+ lcpFinalizedByInputMs: null as number | null,+ lcpUpdatedAtMs: null as number | null,+ longTaskCount: 0,+ longTaskTotalMs: 0,+ };+ Object.defineProperty(window, "homarrBenchmarkVitals", { value: state, configurable: true });+ window.addEventListener(+ "keydown",+ (event) => {+ if (event.isTrusted && state.lcpFinalizedByInputMs === null) state.lcpFinalizedByInputMs = performance.now();+ },+ { capture: true },+ );+ if (PerformanceObserver.supportedEntryTypes.includes("largest-contentful-paint")) {+ new PerformanceObserver((list) => {+ const entry = list.getEntries().at(-1);+ if (!entry) return;+ const lcp = entry as PerformanceEntry & { element?: Element; size?: number; url?: string };+ const element = lcp.element;+ state.lcpMs = entry.startTime;+ state.lcpUpdatedAtMs = performance.now();+ state.lcpElement = {+ className: element?.getAttribute("class") ?? null,+ id: element?.id || null,+ origin: lcp.url ? new URL(lcp.url, window.location.href).origin : null,+ pathname: lcp.url ? new URL(lcp.url, window.location.href).pathname : null,+ size: lcp.size ?? null,+ tagName: element?.tagName ?? null,+ text: element?.textContent?.trim().slice(0, 120) || null,+ };+ }).observe({ type: "largest-contentful-paint", buffered: true });+ }+ if (PerformanceObserver.supportedEntryTypes.includes("layout-shift")) {+ new PerformanceObserver((list) => {+ for (const entry of list.getEntries()) {+ const shift = entry as PerformanceEntry & { hadRecentInput?: boolean; value?: number };+ if (!shift.hadRecentInput) state.cls += shift.value ?? 0;+ }+ }).observe({ type: "layout-shift", buffered: true });+ }+ if (PerformanceObserver.supportedEntryTypes.includes("longtask")) {+ new PerformanceObserver((list) => {+ for (const entry of list.getEntries()) {+ state.longTaskCount += 1;+ state.longTaskTotalMs += entry.duration;+ }+ }).observe({ type: "longtask", buffered: true });+ }+};++const installMeasurementScriptsAsync = async (context: BrowserContext, options?: { deferIdle?: boolean }) => {+ if (options?.deferIdle) await context.addInitScript(deferIdleCallbacksForInitialMeasurement);+ await context.addInitScript(initializeBrowserVitals);+};++const waitForFinalLcpAsync = async (page: Page) => {+ await page.waitForFunction(+ () =>+ typeof (window as Window & { homarrBenchmarkVitals?: { lcpMs: number | null } }).homarrBenchmarkVitals?.lcpMs ===+ "number",+ undefined,+ { timeout: Math.max(10_000, lcpObservationMs + 5_000) },+ );+ while (true) {+ const { elapsedMs, lastCandidateAtMs } = await page.evaluate(() => {+ const vitals = (window as Window & { homarrBenchmarkVitals?: { lcpUpdatedAtMs: number | null } })+ .homarrBenchmarkVitals;+ return { elapsedMs: performance.now(), lastCandidateAtMs: vitals?.lcpUpdatedAtMs ?? null };+ });+ if (lastCandidateAtMs === null) throw new Error("LCP candidate timestamp is missing");+ const remainingMs = Math.max(0, lcpObservationMs - elapsedMs, lcpStabilityMs - (elapsedMs - lastCandidateAtMs));+ if (remainingMs === 0) break;+ await page.waitForTimeout(remainingMs);+ }++ // LCP remains open to later candidates until the first trusted input. End+ // the declared observation window with an inert key so the recorded value+ // is final, while leaving application state and layout untouched.+ await page.keyboard.press("Shift");+ await page.waitForFunction(+ () =>+ typeof (window as Window & { homarrBenchmarkVitals?: { lcpFinalizedByInputMs: number | null } })+ .homarrBenchmarkVitals?.lcpFinalizedByInputMs === "number",+ );+ await page.waitForTimeout(100);+};++const readBrowserMetricsAsync = async (page: Page) =>+ await page.evaluate(() => {+ const resources = performance.getEntriesByType("resource") as PerformanceResourceTiming[];+ const navigation = performance.getEntriesByType("navigation")[0] as PerformanceNavigationTiming | undefined;+ const firstContentfulPaint = performance+ .getEntriesByType("paint")+ .find(({ name }) => name === "first-contentful-paint");+ const vitals = (+ window as Window & {+ homarrBenchmarkVitals?: {+ cls: number;+ lcpElement: {+ className: string | null;+ id: string | null;+ origin: string | null;+ pathname: string | null;+ size: number | null;+ tagName: string | null;+ text: string | null;+ } | null;+ lcpMs: number | null;+ lcpFinalizedByInputMs: number | null;+ lcpUpdatedAtMs: number | null;+ longTaskCount: number;+ longTaskTotalMs: number;+ };+ }+ ).homarrBenchmarkVitals;+ const memory = performance as Performance & { memory?: { usedJSHeapSize: number } };+ return {+ cls: Number((vitals?.cls ?? 0).toFixed(4)),+ decodedScriptBytes: resources+ .filter((resource) => resource.initiatorType === "script")+ .reduce((sum, resource) => sum + resource.decodedBodySize, 0),+ domContentLoadedMs: navigation ? Math.round(navigation.domContentLoadedEventEnd) : null,+ fcpMs: firstContentfulPaint ? Math.round(firstContentfulPaint.startTime) : null,+ jsHeapBytes: memory.memory?.usedJSHeapSize ?? null,+ lcpElement: vitals?.lcpElement ?? null,+ lcpFinalizedByInputMs:+ vitals?.lcpFinalizedByInputMs === null || vitals?.lcpFinalizedByInputMs === undefined+ ? null+ : Math.round(vitals.lcpFinalizedByInputMs),+ lcpMs: vitals?.lcpMs === null || vitals?.lcpMs === undefined ? null : Math.round(vitals.lcpMs),+ lcpUpdatedAtMs:+ vitals?.lcpUpdatedAtMs === null || vitals?.lcpUpdatedAtMs === undefined+ ? null+ : Math.round(vitals.lcpUpdatedAtMs),+ loadMs: navigation?.loadEventEnd ? Math.round(navigation.loadEventEnd) : null,+ longTaskCount: vitals?.longTaskCount ?? 0,+ longTaskTotalMs: Math.round(vitals?.longTaskTotalMs ?? 0),+ largestScripts: resources+ .filter((resource) => resource.initiatorType === "script")+ .toSorted((left, right) => right.decodedBodySize - left.decodedBodySize)+ .slice(0, 10)+ .map(({ decodedBodySize, name, transferSize }) => {+ const url = new URL(name, window.location.href);+ return { decodedBodySize, origin: url.origin, pathname: url.pathname, transferSize };+ }),+ resourceCount: resources.length,+ slowestResources: resources+ .toSorted((left, right) => right.duration - left.duration)+ .slice(0, 10)+ .map(({ duration, initiatorType, name, transferSize }) => {+ const url = new URL(name, window.location.href);+ return {+ durationMs: Math.round(duration),+ initiatorType,+ origin: url.origin,+ pathname: url.pathname,+ transferSize,+ };+ }),+ ttfbMs: navigation ? Math.round(navigation.responseStart) : null,+ transferBytes: resources.reduce((sum, resource) => sum + resource.transferSize, 0),+ };+ });++await mkdir(outputDirectory, { recursive: true });+const appDataDirectory = await mkdtemp(path.join(os.tmpdir(), "homarr-runtime-benchmark-"));+const containerName = `homarr-runtime-benchmark-${process.pid}`;+const proxyContainerName = `${containerName}-proxy`;+const isolationNetworkName = `${containerName}-internal`;+let containerId: string | undefined;+let proxyContainerId: string | undefined;+let isolationNetworkId: string | undefined;+let browser: Awaited<ReturnType<typeof chromium.launch>> | undefined;+let denyProxy: Awaited<ReturnType<typeof startExternalDenyProxyAsync>> | undefined;+let cleanupPromise: Promise<void> | undefined;+let lifecycleMutation: ReturnType<typeof execFileAsync> | undefined;+let shutdownRequested = false;++const execDockerLifecycleAsync = async (args: string[]) => {+ const mutation = execFileAsync("docker", args);+ lifecycleMutation = mutation;+ try {+ const result = await mutation;+ if (shutdownRequested) throw new Error("Runtime benchmark interrupted");+ return result;+ } finally {+ if (lifecycleMutation === mutation) lifecycleMutation = undefined;+ }+};++const cleanupAsync = () => {+ cleanupPromise ??= (async () => {+ const activeLifecycleMutation = lifecycleMutation;+ if (activeLifecycleMutation) await activeLifecycleMutation.catch(() => undefined);+ await browser?.close().catch(() => undefined);+ await denyProxy?.closeAsync().catch(() => undefined);+ await execFileAsync("docker", ["rm", "--force", proxyContainerName]).catch(() => undefined);+ await execFileAsync("docker", ["rm", "--force", containerName]).catch(() => undefined);+ await execFileAsync("docker", ["network", "rm", isolationNetworkName]).catch(() => undefined);+ await rm(appDataDirectory, { recursive: true, force: true }).catch(() => undefined);+ })();+ return cleanupPromise;+};++const handleSignal = (signal: "SIGINT" | "SIGTERM") => {+ shutdownRequested = true;+ console.error(`Received ${signal}; cleaning up runtime benchmark resources`);+ void cleanupAsync().finally(() => process.exit(signal === "SIGINT" ? 130 : 143));+};+const handleSigint = () => handleSignal("SIGINT");+const handleSigterm = () => handleSignal("SIGTERM");+process.once("SIGINT", handleSigint);+process.once("SIGTERM", handleSigterm);++try {+ const imageInspect = JSON.parse((await execFileAsync("docker", ["image", "inspect", image])).stdout)[0] as {+ Architecture: string;+ Config?: { Labels?: Record<string, string> };+ Id: string;+ RepoDigests?: string[];+ Size: number;+ };+ const revision = imageInspect.Config?.Labels?.["org.opencontainers.image.revision"] ?? null;+ const sourceFingerprint = imageInspect.Config?.Labels?.["dev.homarr.source-fingerprint"] ?? null;+ const dockerVersion = JSON.parse(+ (await execFileAsync("docker", ["version", "--format", "{{json .}}"])).stdout,+ ) as Record<string, unknown>;+ const dockerInfo = JSON.parse((await execFileAsync("docker", ["info", "--format", "{{json .}}"])).stdout) as {+ Architecture?: string;+ CgroupDriver?: string;+ CgroupVersion?: string;+ Driver?: string;+ KernelVersion?: string;+ MemTotal?: number;+ NCPU?: number;+ OSType?: string;+ OperatingSystem?: string;+ ServerVersion?: string;+ };++ const containerStartedAt = performance.now();+ isolationNetworkId = (+ await execDockerLifecycleAsync(["network", "create", "--driver", "bridge", "--internal", isolationNetworkName])+ ).stdout.trim();+ const runResult = await execDockerLifecycleAsync([+ "run",+ "--detach",+ "--rm",+ "--name",+ containerName,+ "--cpus",+ "2",+ "--memory",+ "1g",+ "--network",+ isolationNetworkName,+ "--volume",+ `${appDataDirectory}:/appdata`,+ "--env",+ "DEMO_MODE=true",+ "--env",+ "DEMO_READ_ONLY=false",+ "--env",+ "UNSAFE_ENABLE_MOCK_INTEGRATION=true",+ "--env",+ "NO_EXTERNAL_CONNECTION=true",+ "--env",+ "LOG_LEVEL=warn",+ "--env",+ `SECRET_ENCRYPTION_KEY=${"0".repeat(64)}`,+ imageInspect.Id,+ ]);+ containerId = runResult.stdout.trim();+ proxyContainerId = (+ await execDockerLifecycleAsync([+ "run",+ "--detach",+ "--rm",+ "--name",+ proxyContainerName,+ "--publish",+ "127.0.0.1::7575",+ "--env",+ `UPSTREAM_HOST=${containerName}`,+ "--entrypoint",+ "node",+ imageInspect.Id,+ "-e",+ `const net = require("node:net");+net.createServer((client) => {+ const upstream = net.connect(7575, process.env.UPSTREAM_HOST);+ client.pipe(upstream).pipe(client);+ const close = () => { client.destroy(); upstream.destroy(); };+ client.on("error", close);+ upstream.on("error", close);+}).listen(7575, "0.0.0.0");`,+ ])+ ).stdout.trim();+ await execDockerLifecycleAsync(["network", "connect", isolationNetworkName, proxyContainerId]);+ const portOutput = (await execFileAsync("docker", ["port", proxyContainerId, "7575/tcp"])).stdout;+ const port = Number(portOutput.trim().match(/:(\d+)$/)?.[1]);+ if (!Number.isInteger(port)) throw new Error(`Unable to resolve mapped port from ${portOutput}`);+ const baseUrl = `http://127.0.0.1:${port}`;+ await waitForReadyAsync(baseUrl);+ const startToReadyMs = Math.round(performance.now() - containerStartedAt);+ const containerNode = JSON.parse(+ (+ await execFileAsync("docker", [+ "exec",+ containerId,+ "node",+ "-p",+ "JSON.stringify({architecture:process.arch,platform:process.platform,version:process.version,v8Version:process.versions.v8})",+ ])+ ).stdout,+ ) as { architecture: string; platform: string; version: string; v8Version: string };+ const serverNetworkIsolationCanary = JSON.parse(+ (+ await execFileAsync("docker", [+ "exec",+ containerId,+ "node",+ "-e",+ `Promise.all([+ fetch("https://example.com", { signal: AbortSignal.timeout(3000) }).then((response) => ({ blocked: false, status: response.status }), (error) => ({ blocked: true, code: error.cause?.code ?? error.name })),+ fetch("http://1.1.1.1", { signal: AbortSignal.timeout(3000) }).then((response) => ({ blocked: false, status: response.status }), (error) => ({ blocked: true, code: error.cause?.code ?? error.name })),+]).then((result) => console.log(JSON.stringify({ domain: result[0], directIp: result[1] })));`,+ ])+ ).stdout,+ ) as {+ directIp: { blocked: boolean; code?: string; status?: number };+ domain: { blocked: boolean; code?: string; status?: number };+ };+ const serverNetworkIsolated =+ serverNetworkIsolationCanary.domain.blocked && serverNetworkIsolationCanary.directIp.blocked;+ if (!serverNetworkIsolated) {+ throw new Error(`Server external network isolation canary failed: ${JSON.stringify(serverNetworkIsolationCanary)}`);+ }++ const checkpoints: RuntimeMemoryCheckpoint[] = [];+ checkpoints.push(await captureCheckpointAsync(containerId, "startup"));++ denyProxy = await startExternalDenyProxyAsync();+ const browserLaunchArguments = getBrowserNetworkIsolationLaunchArgs(denyProxy.url);+ browser = await chromium.launch({ args: browserLaunchArguments });+ const isolationCanaryUrl = "http://homarr-benchmark.invalid/__network-isolation-canary__";+ const canaryAttemptsBefore = denyProxy+ .getAttempts()+ .filter(({ method, target }) => method === "GET" && target === isolationCanaryUrl)+ .reduce((total, { count }) => total + count, 0);+ const canaryContext = await browser.newContext({ viewport });+ const canaryPage = await canaryContext.newPage();+ const canaryWebSocketUrls: string[] = [];+ const canaryWebSocketEvents = new Map<+ string,+ { closeCount: number; frameReceivedCount: number; frameSentCount: number; socketErrorCount: number }+ >();+ canaryPage.on("websocket", (webSocket) => {+ const url = webSocket.url();+ canaryWebSocketUrls.push(url);+ const events = { closeCount: 0, frameReceivedCount: 0, frameSentCount: 0, socketErrorCount: 0 };+ canaryWebSocketEvents.set(url, events);+ webSocket.on("close", () => {+ events.closeCount += 1;+ });+ webSocket.on("framereceived", () => {+ events.frameReceivedCount += 1;+ });+ webSocket.on("framesent", () => {+ events.frameSentCount += 1;+ });+ webSocket.on("socketerror", () => {+ events.socketErrorCount += 1;+ });+ });+ const canaryResponse = await canaryPage.goto(isolationCanaryUrl, { waitUntil: "domcontentloaded" });+ const canaryAttemptsAfter = denyProxy+ .getAttempts()+ .filter(({ method, target }) => method === "GET" && target === isolationCanaryUrl)+ .reduce((total, { count }) => total + count, 0);+ const browserNetworkIsolationCanary = {+ attemptCount: canaryAttemptsAfter - canaryAttemptsBefore,+ responseHeader: canaryResponse?.headers()["x-homarr-benchmark-blocked"] ?? null,+ status: canaryResponse?.status() ?? null,+ url: isolationCanaryUrl,+ };+ const runWebSocketIsolationCanaryAsync = async (url: string, connectTarget: string) => {+ const getAttemptCount = () =>+ denyProxy+ ?.getAttempts()+ .filter(+ ({ method, target }) =>+ (method === "CONNECT" && target === connectTarget) || (method === "UPGRADE" && target === url),+ )+ .reduce((total, { count }) => total + count, 0) ?? 0;+ const attemptsBefore = getAttemptCount();+ const result = await canaryPage.evaluate(+ (canaryUrl) =>+ new Promise<{ closeCode: number | null; errorEvent: boolean; opened: boolean; timedOut: boolean }>(+ (resolve) => {+ const webSocket = new WebSocket(canaryUrl);+ let settled = false;+ const finish = (value: {+ closeCode: number | null;+ errorEvent: boolean;+ opened: boolean;+ timedOut: boolean;+ }) => {+ if (settled) return;+ settled = true;+ window.clearTimeout(timeout);+ if (webSocket.readyState === WebSocket.OPEN) webSocket.close();+ resolve(value);+ };+ const timeout = window.setTimeout(+ () => finish({ closeCode: null, errorEvent: false, opened: false, timedOut: true }),+ 5_000,+ );+ webSocket.addEventListener("open", () =>+ finish({ closeCode: null, errorEvent: false, opened: true, timedOut: false }),+ );+ webSocket.addEventListener("error", () =>+ finish({ closeCode: null, errorEvent: true, opened: false, timedOut: false }),+ );+ webSocket.addEventListener("close", (event) =>+ finish({ closeCode: event.code, errorEvent: false, opened: false, timedOut: false }),+ );+ },+ ),+ url,+ );+ const eventsDeadline = Date.now() + 2_000;+ while (Date.now() < eventsDeadline) {+ const events = canaryWebSocketEvents.get(url);+ if ((events?.closeCount ?? 0) > 0 && (events?.socketErrorCount ?? 0) > 0) break;+ await canaryPage.waitForTimeout(25);+ }+ const events = canaryWebSocketEvents.get(url) ?? {+ closeCount: 0,+ frameReceivedCount: 0,+ frameSentCount: 0,+ socketErrorCount: 0,+ };+ return {+ ...result,+ ...events,+ attemptCount: getAttemptCount() - attemptsBefore,+ browserEventCount: canaryWebSocketUrls.filter((observedUrl) => observedUrl === url).length,+ connectTarget,+ url,+ };+ };+ const browserWebSocketIsolationCanaries = await Promise.all([+ runWebSocketIsolationCanaryAsync(+ "ws://homarr-benchmark-ws.invalid/__websocket-network-isolation-canary__",+ "homarr-benchmark-ws.invalid:80",+ ),+ runWebSocketIsolationCanaryAsync(+ "wss://homarr-benchmark-wss.invalid/__websocket-network-isolation-canary__",+ "homarr-benchmark-wss.invalid:443",+ ),+ ]);+ await canaryContext.close();+ const browserNetworkIsolated =+ browserNetworkIsolationCanary.status === 502 &&+ browserNetworkIsolationCanary.responseHeader === "true" &&+ browserNetworkIsolationCanary.attemptCount > 0 &&+ browserWebSocketIsolationCanaries.every(+ ({+ attemptCount,+ browserEventCount,+ closeCount,+ errorEvent,+ frameReceivedCount,+ frameSentCount,+ opened,+ socketErrorCount,+ timedOut,+ }) =>+ attemptCount > 0 &&+ browserEventCount > 0 &&+ closeCount > 0 &&+ errorEvent &&+ frameReceivedCount === 0 &&+ frameSentCount === 0 &&+ !opened &&+ socketErrorCount > 0 &&+ !timedOut,+ );+ if (!browserNetworkIsolated) {+ throw new Error(+ `Browser network isolation canary failed: ${JSON.stringify({ http: browserNetworkIsolationCanary, webSockets: browserWebSocketIsolationCanaries })}`,+ );+ }+ const browserNetworkObservations = new Map<+ string,+ {+ failedCount: number;+ failureTexts: Set<string>;+ methods: Set<string>;+ origin: string;+ pathname: string;+ protocol: string;+ requestCount: number;+ resourceTypes: Set<string>;+ responseStatuses: Set<number>;+ urlHash: string;+ }+ >();+ const browserWebSocketObservations = new Map<+ string,+ {+ closeCount: number;+ frameReceivedCount: number;+ frameSentCount: number;+ origin: string;+ pathname: string;+ protocol: string;+ requestCount: number;+ socketErrorCount: number;+ urlHash: string;+ }+ >();+ const allowedBrowserOrigin = new URL(baseUrl).origin;+ const allowedBrowserWebSocketUrl = new URL(baseUrl);+ allowedBrowserWebSocketUrl.protocol = allowedBrowserWebSocketUrl.protocol === "https:" ? "wss:" : "ws:";+ const allowedBrowserWebSocketOrigin = allowedBrowserWebSocketUrl.origin;+ const getNetworkObservation = (url: string) => {+ const safeUrl = safeUrlDetails(url);+ const existing = browserNetworkObservations.get(safeUrl.urlHash);+ if (existing) return existing;+ const observation = {+ failedCount: 0,+ failureTexts: new Set<string>(),+ methods: new Set<string>(),+ ...safeUrl,+ requestCount: 0,+ resourceTypes: new Set<string>(),+ responseStatuses: new Set<number>(),+ };+ browserNetworkObservations.set(safeUrl.urlHash, observation);+ return observation;+ };+ const observeBrowserNetwork = (browserContext: BrowserContext) => {+ browserContext.on("request", (request) => {+ const observation = getNetworkObservation(request.url());+ observation.requestCount += 1;+ observation.methods.add(request.method());+ observation.resourceTypes.add(request.resourceType());+ });+ browserContext.on("requestfailed", (request) => {+ const observation = getNetworkObservation(request.url());+ observation.failedCount += 1;+ const failureText = request.failure()?.errorText;+ if (failureText) observation.failureTexts.add(failureText);+ });+ browserContext.on("response", (response) => {+ getNetworkObservation(response.url()).responseStatuses.add(response.status());+ });+ browserContext.on("page", (observedPage) => {+ observedPage.on("websocket", (webSocket) => {+ const url = webSocket.url();+ const safeUrl = safeUrlDetails(url);+ const observation = browserWebSocketObservations.get(safeUrl.urlHash) ?? {+ closeCount: 0,+ frameReceivedCount: 0,+ frameSentCount: 0,+ ...safeUrl,+ requestCount: 0,+ socketErrorCount: 0,+ };+ observation.requestCount += 1;+ browserWebSocketObservations.set(safeUrl.urlHash, observation);+ webSocket.on("close", () => {+ observation.closeCount += 1;+ });+ webSocket.on("framereceived", () => {+ observation.frameReceivedCount += 1;+ });+ webSocket.on("framesent", () => {+ observation.frameSentCount += 1;+ });+ webSocket.on("socketerror", () => {+ observation.socketErrorCount += 1;+ });+ });+ });+ };+ const createBenchmarkContextAsync = async (options: BrowserContextOptions = {}) => {+ if (!browser) throw new Error("Chromium is not running");+ const browserContext = await browser.newContext({+ deviceScaleFactor: 1,+ viewport,+ ...options,+ });+ observeBrowserNetwork(browserContext);+ return browserContext;+ };+ const browserProvenance = {+ engine: "chromium",+ executablePath: chromium.executablePath(),+ headless: true,+ httpCachePolicy: "Chromium default cache enabled within each browser context",+ launchArguments: browserLaunchArguments,+ version: browser.version(),+ viewport: { deviceScaleFactor: 1, ...viewport },+ };+ const context = await createBenchmarkContextAsync();+ await installMeasurementScriptsAsync(context, { deferIdle: true });+ const page = await context.newPage();+ await page.goto(`${baseUrl}/auth/login`, { waitUntil: "domcontentloaded" });+ await page.waitForFunction(+ () => {+ const form = document.querySelector("form");+ return form !== null && Object.keys(form).some((key) => key.startsWith("__reactProps$"));+ },+ undefined,+ { timeout: 30_000 },+ );+ await page.getByLabel("Username").fill("demo");+ await page.locator("#password").fill("demo");+ const loginWidgetDataTracker = trackWidgetDataRequests(page);++ const pageErrors: string[] = [];+ let legacyQueryCacheWriteBytes = 0;+ let legacyQueryCacheWriteCount = 0;+ let trpcRequestCount = 0;+ let nonWidgetTrpcRequestCount = 0;+ let widgetRequestCount = 0;+ let webSocketCount = 0;+ page.on("pageerror", (error) => pageErrors.push(error.message));+ page.on("websocket", () => {+ webSocketCount += 1;+ });+ page.on("request", (request) => {+ const procedures = getTrpcProcedures(request.url());+ const widgetProcedures = procedures.filter((procedure) => procedure.startsWith("widget."));+ const legacyQueryCacheWrites = procedures.filter((procedure) => procedure === "queryCache.setItem");+ trpcRequestCount += procedures.length;+ widgetRequestCount += widgetProcedures.length;+ nonWidgetTrpcRequestCount += procedures.length - widgetProcedures.length;+ if (legacyQueryCacheWrites.length > 0) {+ legacyQueryCacheWriteCount += legacyQueryCacheWrites.length;+ legacyQueryCacheWriteBytes += request.postDataBuffer()?.byteLength ?? 0;+ }+ });++ const loginJourneyBoardStartedAt = performance.now();+ await page.locator('button[type="submit"]').click();+ await page.waitForURL(`${baseUrl}/`, { timeout: 30_000, waitUntil: "domcontentloaded" });+ await page.locator("[data-homarr-dev-benchmark-board]").waitFor({ state: "visible", timeout: 30_000 });+ const loginJourneyBoardMountedMs = Math.round(performance.now() - loginJourneyBoardStartedAt);+ const loginBoardState = await waitForBoardWidgetsAsync(page);+ const { widgetCount, implementationMarkerCount, widgetErrorCount } = loginBoardState;+ if (requireImplementationMarkers && implementationMarkerCount !== widgetCount) {+ throw new Error(`Only ${implementationMarkerCount} of ${widgetCount} widget implementations mounted`);+ }+ if (widgetErrorCount > 0) throw new Error(`Representative board rendered ${widgetErrorCount} widget errors`);+ const loginJourneyWidgetImplementationsMountedMs = requireImplementationMarkers+ ? Math.round(performance.now() - loginJourneyBoardStartedAt)+ : null;+ const loginJourneyWidgetData = await waitForWidgetDataSettledAsync(page, loginWidgetDataTracker, {+ allowUnrecoveredAborts: true,+ });+ const loginJourneyWidgetDataSettledMs =+ loginJourneyWidgetData.completedOperationCount > 0 && loginJourneyWidgetData.unrecoveredAbortedRequests.length === 0+ ? Math.round(performance.now() - loginJourneyBoardStartedAt)+ : null;+ assertBoardWidgetState(await readBoardWidgetStateAsync(page), "Representative board after widget data settled");+ const authenticatedStorageState = await context.storageState();+ const loginJourneyNetworkCounts = {+ trpcRequestCount,+ widgetRequestCount,+ webSocketCount,+ legacyQueryCacheWriteCount,+ legacyQueryCacheWriteBytes,+ };+ const pageLoadSamples = [] as Array<{+ boardMountedMs: number;+ fcpMs: number;+ lcpFinalizedByInputMs: number;+ lcpMs: number;+ ttfbMs: number;+ widgetImplementationsMountedMs: number | null;+ widgetDataObservedOperationCount: number;+ widgetDataSettledMs: number;+ }>;++ // Login uses a soft navigation whose LCP is terminated by the submit click.+ // Keep that journey timing separate and measure browser vitals in a fresh,+ // naturally scheduled authenticated document.+ const initialContext = await createBenchmarkContextAsync({ storageState: authenticatedStorageState });+ await installMeasurementScriptsAsync(initialContext);+ const initialPage = await initialContext.newPage();+ const initialWidgetDataTracker = trackWidgetDataRequests(initialPage);+ const initialPageErrors: string[] = [];+ const initialNetworkCounts = {+ legacyQueryCacheWriteBytes: 0,+ legacyQueryCacheWriteCount: 0,+ trpcRequestCount: 0,+ webSocketCount: 0,+ widgetRequestCount: 0,+ };+ initialPage.on("pageerror", (error) => initialPageErrors.push(error.message));+ initialPage.on("websocket", () => {+ initialNetworkCounts.webSocketCount += 1;+ });+ initialPage.on("request", (request) => {+ const procedures = getTrpcProcedures(request.url());+ const legacyQueryCacheWrites = procedures.filter((procedure) => procedure === "queryCache.setItem");+ initialNetworkCounts.trpcRequestCount += procedures.length;+ initialNetworkCounts.widgetRequestCount += procedures.filter((procedure) => procedure.startsWith("widget.")).length;+ if (legacyQueryCacheWrites.length > 0) {+ initialNetworkCounts.legacyQueryCacheWriteCount += legacyQueryCacheWrites.length;+ initialNetworkCounts.legacyQueryCacheWriteBytes += request.postDataBuffer()?.byteLength ?? 0;+ }+ });+ const initialDashboardStartedAt = performance.now();+ const initialDashboardResponse = await initialPage.goto(baseUrl, { waitUntil: "domcontentloaded" });+ if (!initialDashboardResponse?.ok()) {+ throw new Error(`Initial authenticated dashboard returned HTTP ${String(initialDashboardResponse?.status())}`);+ }+ const initialAuthenticatedBoardState = await waitForBoardWidgetsAsync(initialPage);+ if (+ requireImplementationMarkers &&+ initialAuthenticatedBoardState.implementationMarkerCount !== initialAuthenticatedBoardState.widgetCount+ ) {+ throw new Error("Initial authenticated dashboard has incomplete widget implementation markers");+ }+ if (initialAuthenticatedBoardState.widgetErrorCount > 0) {+ throw new Error(+ `Initial authenticated dashboard rendered ${initialAuthenticatedBoardState.widgetErrorCount} widget errors`,+ );+ }+ const initialWidgetData = await waitForWidgetDataSettledAsync(initialPage, initialWidgetDataTracker);+ const initialWidgetDataSettledMs = Math.round(performance.now() - initialDashboardStartedAt);+ assertBoardWidgetState(+ await readBoardWidgetStateAsync(initialPage),+ "Initial authenticated dashboard after widget data settled",+ );+ await waitForFinalLcpAsync(initialPage);+ const initialBrowserMetrics = await readBrowserMetricsAsync(initialPage);+ if (initialBrowserMetrics.lcpFinalizedByInputMs === null) {+ throw new Error("Initial authenticated dashboard did not finalize LCP with trusted input");+ }+ if (initialPageErrors.length > 0) {+ throw new Error(`Initial authenticated dashboard page errors: ${initialPageErrors.join("; ")}`);+ }+ await initialContext.close();++ const trpcRequestCountBeforeIdleSpotlight = trpcRequestCount;+ const nonWidgetTrpcRequestCountBeforeIdleSpotlight = nonWidgetTrpcRequestCount;+ await page.evaluate(() => {+ (window as Window & { homarrReleaseBenchmarkIdleCallbacks?: () => void }).homarrReleaseBenchmarkIdleCallbacks?.();+ });+ await waitForSpotlightIdlePreparationAsync(page);+ const idleSpotlightNetworkCounts = {+ trpcRequestCount: trpcRequestCount - trpcRequestCountBeforeIdleSpotlight,+ nonWidgetTrpcRequestCount: nonWidgetTrpcRequestCount - nonWidgetTrpcRequestCountBeforeIdleSpotlight,+ };+ const idleSpotlightNetworkFailure = getSpotlightIdleNetworkFailure(+ spotlightIdlePolicy,+ idleSpotlightNetworkCounts.nonWidgetTrpcRequestCount,+ );+ if (idleSpotlightNetworkFailure) throw new Error(idleSpotlightNetworkFailure);++ const warmInteractionSamplesMs: number[] = [];+ for (let iteration = 0; iteration < interactionIterations; iteration += 1) {+ const warmInteractionStartedAt = performance.now();+ await page.locator('[data-homarr-dev-benchmark-interaction="search"]:visible').click();+ await page.locator("[data-homarr-dev-benchmark-spotlight]").waitFor({ state: "visible" });+ warmInteractionSamplesMs.push(Math.round(performance.now() - warmInteractionStartedAt));+ await page.keyboard.press("Escape");+ await page.locator("[data-homarr-dev-benchmark-spotlight]").waitFor({ state: "hidden" });+ }+ const postIdleWarmInteractionMs = warmInteractionSamplesMs[0] ?? null;+ const postIdleWarmInteractionSummary = summarize(warmInteractionSamplesMs);++ const websocketStartedAt = performance.now();+ await page.evaluate(+ () =>+ new Promise<void>((resolve, reject) => {+ const socket = new WebSocket(+ `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/websockets`,+ );+ const timeout = window.setTimeout(() => {+ socket.close();+ reject(new Error("WebSocket readiness probe timed out"));+ }, 10_000);+ socket.addEventListener("open", () => {+ window.clearTimeout(timeout);+ socket.close();+ resolve();+ });+ socket.addEventListener("error", () => {+ window.clearTimeout(timeout);+ reject(new Error("WebSocket readiness probe failed"));+ });+ }),+ );+ const websocketReadyMs = Math.round(performance.now() - websocketStartedAt);++ checkpoints.push(await captureCheckpointAsync(containerId, "first-board"));++ for (let iteration = 0; iteration < pageIterations; iteration += 1) {+ const iterationContext = await createBenchmarkContextAsync({ storageState: authenticatedStorageState });+ await installMeasurementScriptsAsync(iterationContext);+ const iterationPage = await iterationContext.newPage();+ const iterationWidgetDataTracker = trackWidgetDataRequests(iterationPage);+ const iterationErrors: string[] = [];+ iterationPage.on("pageerror", (error) => iterationErrors.push(error.message));+ const iterationStartedAt = performance.now();+ const response = await iterationPage.goto(baseUrl, { waitUntil: "domcontentloaded" });+ if (!response?.ok()) {+ throw new Error(`Board iteration ${iteration + 1} returned HTTP ${String(response?.status() ?? "none")}`);+ }+ await iterationPage.locator("[data-homarr-dev-benchmark-board]").waitFor({ state: "visible", timeout: 30_000 });+ const iterationBoardMountedMs = Math.round(performance.now() - iterationStartedAt);+ const iterationBoardState = await waitForBoardWidgetsAsync(iterationPage);+ if (+ requireImplementationMarkers &&+ iterationBoardState.implementationMarkerCount !== iterationBoardState.widgetCount+ ) {+ throw new Error(`Board iteration ${iteration + 1} has incomplete widget implementation markers`);+ }+ if (iterationBoardState.widgetErrorCount > 0) {+ throw new Error(+ `Board iteration ${iteration + 1} rendered ${iterationBoardState.widgetErrorCount} widget errors`,+ );+ }+ const iterationWidgetImplementationsMountedMs = requireImplementationMarkers+ ? Math.round(performance.now() - iterationStartedAt)+ : null;+ const iterationWidgetData = await waitForWidgetDataSettledAsync(iterationPage, iterationWidgetDataTracker);+ const iterationWidgetDataSettledMs = Math.round(performance.now() - iterationStartedAt);+ assertBoardWidgetState(+ await readBoardWidgetStateAsync(iterationPage),+ `Board iteration ${iteration + 1} after widget data settled`,+ );+ await waitForFinalLcpAsync(iterationPage);+ const iterationMetrics = await readBrowserMetricsAsync(iterationPage);+ if (iterationMetrics.fcpMs === null) throw new Error(`Board iteration ${iteration + 1} has no FCP sample`);+ if (iterationMetrics.lcpFinalizedByInputMs === null) {+ throw new Error(`Board iteration ${iteration + 1} did not finalize LCP with trusted input`);+ }+ if (iterationMetrics.lcpMs === null) throw new Error(`Board iteration ${iteration + 1} has no LCP sample`);+ if (iterationMetrics.ttfbMs === null) throw new Error(`Board iteration ${iteration + 1} has no TTFB sample`);+ pageLoadSamples.push({+ boardMountedMs: iterationBoardMountedMs,+ fcpMs: iterationMetrics.fcpMs,+ lcpFinalizedByInputMs: iterationMetrics.lcpFinalizedByInputMs,+ lcpMs: iterationMetrics.lcpMs,+ ttfbMs: iterationMetrics.ttfbMs,+ widgetImplementationsMountedMs: iterationWidgetImplementationsMountedMs,+ widgetDataObservedOperationCount: iterationWidgetData.observedOperationCount,+ widgetDataSettledMs: iterationWidgetDataSettledMs,+ });+ if (iterationErrors.length > 0) {+ throw new Error(`Board iteration ${iteration + 1} page errors: ${iterationErrors.join("; ")}`);+ }+ await iterationContext.close();+ }++ const coldContext = await createBenchmarkContextAsync({ storageState: authenticatedStorageState });+ await coldContext.addInitScript(() => {+ // Keep the cold-interaction probe cold instead of racing the application's+ // intentional requestIdleCallback prefetch.+ Object.defineProperty(window, "requestIdleCallback", { value: () => 0, configurable: true });+ Object.defineProperty(window, "cancelIdleCallback", { value: () => undefined, configurable: true });+ });+ const coldPage = await coldContext.newPage();+ const coldPageErrors: string[] = [];+ coldPage.on("pageerror", (error) => coldPageErrors.push(error.message));+ const coldResponse = await coldPage.goto(`${baseUrl}/`, { waitUntil: "domcontentloaded" });+ if (!coldResponse?.ok()) {+ throw new Error(`Cold-interaction board returned HTTP ${String(coldResponse?.status() ?? "none")}`);+ }+ await coldPage.locator("[data-homarr-dev-benchmark-board]").waitFor({ state: "visible", timeout: 30_000 });+ await coldPage.evaluate(() => {+ const state = {+ clickedAtMs: null as number | null,+ feedbackAtMs: null as number | null,+ observer: null as MutationObserver | null,+ };+ const recordFeedback = () => {+ const element = document.querySelector("[data-homarr-dev-benchmark-spotlight-feedback]");+ if (+ state.clickedAtMs !== null &&+ state.feedbackAtMs === null &&+ element instanceof HTMLElement &&+ element.getClientRects().length > 0 &&+ window.getComputedStyle(element).visibility !== "hidden"+ ) {+ state.feedbackAtMs = performance.now();+ }+ };+ document.addEventListener(+ "click",+ (event) => {+ if (+ !(event.target instanceof Element) ||+ !event.target.closest('[data-homarr-dev-benchmark-interaction="search"]')+ )+ return;+ state.clickedAtMs = performance.now();+ state.observer = new MutationObserver(recordFeedback);+ state.observer.observe(document.documentElement, {+ attributes: true,+ childList: true,+ subtree: true,+ });+ recordFeedback();+ },+ { capture: true, once: true },+ );+ Object.defineProperty(window, "homarrColdSpotlightProbe", { configurable: true, value: state });+ });+ const coldInteractionStartedAt = performance.now();+ await coldPage.locator('[data-homarr-dev-benchmark-interaction="search"]:visible').click();+ await coldPage.locator("[data-homarr-dev-benchmark-spotlight]").waitFor({ state: "visible" });+ const coldSpotlightReadyMs = Math.round(performance.now() - coldInteractionStartedAt);+ const coldSpotlightFeedbackMs = await coldPage.evaluate(() => {+ const state = (+ window as Window & {+ homarrColdSpotlightProbe?: {+ clickedAtMs: number | null;+ feedbackAtMs: number | null;+ observer: MutationObserver | null;+ };+ }+ ).homarrColdSpotlightProbe;+ state?.observer?.disconnect();+ return state?.clickedAtMs !== null && state?.clickedAtMs !== undefined && state.feedbackAtMs !== null+ ? Math.round(state.feedbackAtMs - state.clickedAtMs)+ : null;+ });+ if (coldPageErrors.length > 0) throw new Error(`Cold-interaction page errors: ${coldPageErrors.join("; ")}`);+ await coldPage.close();+ await coldContext.close();++ const routeContext = await createBenchmarkContextAsync({ storageState: authenticatedStorageState });+ await installMeasurementScriptsAsync(routeContext);+ const routePage = await routeContext.newPage();+ const routePageErrors: string[] = [];+ routePage.on("pageerror", (error) => routePageErrors.push(error.message));+ const routeTimings = [] as Array<{ path: string; durationMs: number; status: number | null }>;+ for (const routePath of routePaths) {+ const startedAt = performance.now();+ const response = await routePage.goto(`${baseUrl}${routePath}`, { waitUntil: "domcontentloaded" });+ await routePage.locator("main:visible").waitFor({ state: "visible", timeout: 30_000 });+ if (!response?.ok()) throw new Error(`Route ${routePath} returned HTTP ${String(response?.status() ?? "none")}`);+ routeTimings.push({+ path: routePath,+ durationMs: Math.round(performance.now() - startedAt),+ status: response.status(),+ });+ }++ await routePage.goto(`${baseUrl}/`, { waitUntil: "domcontentloaded" });+ const finalBoardState = await waitForBoardWidgetsAsync(routePage);+ if (requireImplementationMarkers && finalBoardState.implementationMarkerCount !== finalBoardState.widgetCount) {+ throw new Error("Final board load has incomplete widget implementation markers");+ }+ if (finalBoardState.widgetErrorCount > 0) {+ throw new Error(`Final board load rendered ${finalBoardState.widgetErrorCount} widget errors`);+ }+ await waitForSpotlightIdlePreparationAsync(routePage);+ if (routePageErrors.length > 0) throw new Error(`Route browser page errors: ${routePageErrors.join("; ")}`);+ checkpoints.push(await captureCheckpointAsync(containerId, "workload"));++ const settleDeadline = Date.now() + settleMs;+ let sample = 0;+ while (Date.now() < settleDeadline) {+ await new Promise((resolve) => setTimeout(resolve, Math.min(sampleIntervalMs, settleDeadline - Date.now())));+ sample += 1;+ checkpoints.push(await captureCheckpointAsync(containerId, `settle-${sample}`));+ }++ if (pageErrors.length > 0) throw new Error(`Browser page errors: ${pageErrors.join("; ")}`);+ if (widgetRequestCount === 0) throw new Error("Representative board made no widget requests");+ if (webSocketCount === 0) throw new Error("WebSocket readiness was not observed by the browser");++ const containerLogs = await execFileAsync("docker", ["logs", containerId]);+ const startupErrors = `${containerLogs.stdout}\n${containerLogs.stderr}`+ .split("\n")+ .filter((line) => /Failed to (?:load|start) embedded/.test(line));+ if (startupErrors.length > 0) throw new Error(`Embedded service startup failed: ${startupErrors.join("; ")}`);++ const browserNetworkRequests = [...browserNetworkObservations.values()]+ .map((observation) => ({+ failedCount: observation.failedCount,+ failureTexts: [...observation.failureTexts].toSorted(),+ methods: [...observation.methods].toSorted(),+ origin: observation.origin,+ pathname: observation.pathname,+ protocol: observation.protocol,+ requestCount: observation.requestCount,+ resourceTypes: [...observation.resourceTypes].toSorted(),+ responseStatuses: [...observation.responseStatuses].toSorted((left, right) => left - right),+ urlHash: observation.urlHash,+ }))+ .toSorted((left, right) => left.urlHash.localeCompare(right.urlHash));+ const browserWebSockets = [...browserWebSocketObservations.values()].toSorted((left, right) =>+ left.urlHash.localeCompare(right.urlHash),+ );+ const externalBrowserWebSockets = browserWebSockets.filter(({ origin }) => origin !== allowedBrowserWebSocketOrigin);+ if (externalBrowserWebSockets.length > 0) {+ throw new Error(+ `Application pages attempted external WebSockets: ${externalBrowserWebSockets+ .map(({ origin, pathname, urlHash }) => `${origin}${pathname}#${urlHash.slice(0, 12)}`)+ .join("; ")}`,+ );+ }+ const externalBrowserRequests = browserNetworkRequests.filter(+ ({ origin, protocol }) => (protocol === "http:" || protocol === "https:") && origin !== allowedBrowserOrigin,+ );+ const unexpectedExternalResponses = externalBrowserRequests.flatMap(+ ({ origin, pathname, responseStatuses, urlHash }) =>+ responseStatuses.filter((status) => status !== 502).map((status) => ({ origin, pathname, status, urlHash })),+ );+ if (unexpectedExternalResponses.length > 0) {+ throw new Error(+ `External browser responses bypassed the deny proxy: ${unexpectedExternalResponses+ .map(({ origin, pathname, status, urlHash }) => `${status} ${origin}${pathname}#${urlHash.slice(0, 12)}`)+ .join("; ")}`,+ );+ }+ const proxyAttempts = denyProxy+ .getAttempts()+ .filter(({ method, target }) => !(method === "GET" && target === isolationCanaryUrl));+ const safeProxyAttempts = proxyAttempts.map(({ count, method, target }) => {+ const targetHash = createHash("sha256").update(target).digest("hex");+ try {+ const safeUrl = safeUrlDetails(method === "CONNECT" ? `https://${target}` : target);+ return { count, method, ...safeUrl, targetHash };+ } catch {+ return { count, method, origin: null, pathname: null, protocol: null, targetHash, urlHash: null };+ }+ });+ const observedOrigins = [...new Set(browserNetworkRequests.map(({ origin }) => origin))].toSorted();++ const settleSampleCount = checkpoints.filter(({ name }) => name.startsWith("settle-")).length;+ const pageLoadSummary = {+ boardMountedMs: summarize(pageLoadSamples.map((measurement) => measurement.boardMountedMs)),+ fcpMs: summarize(pageLoadSamples.map((measurement) => measurement.fcpMs)),+ lcpFinalizedByInputMs: summarize(pageLoadSamples.map((measurement) => measurement.lcpFinalizedByInputMs)),+ lcpMs: summarize(pageLoadSamples.map((measurement) => measurement.lcpMs)),+ ttfbMs: summarize(pageLoadSamples.map((measurement) => measurement.ttfbMs)),+ widgetImplementationsMountedMs: summarize(+ pageLoadSamples.flatMap((measurement) =>+ measurement.widgetImplementationsMountedMs === null ? [] : [measurement.widgetImplementationsMountedMs],+ ),+ ),+ widgetDataSettledMs: summarize(pageLoadSamples.map((measurement) => measurement.widgetDataSettledMs)),+ };+ const eligibilityInput = {+ expectedSha,+ expectedSourceFingerprint,+ browserNetworkIsolated,+ serverNetworkIsolated,+ imageArchitecture: imageInspect.Architecture,+ lcpObservationMs,+ lcpSampleCount: pageLoadSummary.lcpMs.count,+ nodeArchitecture: process.arch,+ revision,+ sourceFingerprint,+ pageSampleCount: pageLoadSamples.length,+ requireImplementationMarkers,+ settleMs,+ settleSampleCount,+ widgetDataQuietMs,+ widgetDataSampleCount: pageLoadSummary.widgetDataSettledMs.count,+ };+ const metricEligibility = getRuntimeMetricEligibility(eligibilityInput);+ const claimIneligibleReasons = getRuntimeClaimIneligibleReasons(eligibilityInput);+ const claimEligible = claimIneligibleReasons.length === 0;+ const result = {+ schemaVersion: 7,+ claimEligible,+ claimIneligibleReasons,+ claimScope: ["pageLoads", "largestContentfulPaint", "widgetDataSettled", "settleStability"],+ metricEligibility,+ createdAt: new Date().toISOString(),+ image: {+ requested: image,+ id: imageInspect.Id,+ digest: imageInspect.RepoDigests?.[0] ?? null,+ revision,+ sourceFingerprint,+ architecture: imageInspect.Architecture,+ localUncompressedBytes: imageInspect.Size,+ },+ host: {+ architecture: process.arch,+ cpus: os.cpus().map(({ model }) => model),+ node: { executable: process.execPath, version: process.version, v8Version: process.versions.v8 },+ platform: os.platform(),+ release: os.release(),+ totalMemoryBytes: os.totalmem(),+ },+ provenance: {+ browser: browserProvenance,+ container: {+ cpuLimit: 2,+ memoryLimitBytes: 1024 ** 3,+ network: { id: isolationNetworkId, internal: true, name: isolationNetworkName },+ node: containerNode,+ },+ ingressProxy: {+ containerId: proxyContainerId,+ excludedFromMemorySamples: true,+ implementation: "Node.js TCP proxy",+ },+ docker: {+ engine: {+ architecture: dockerInfo.Architecture ?? null,+ cgroupDriver: dockerInfo.CgroupDriver ?? null,+ cgroupVersion: dockerInfo.CgroupVersion ?? null,+ cpuCount: dockerInfo.NCPU ?? null,+ kernelVersion: dockerInfo.KernelVersion ?? null,+ memoryBytes: dockerInfo.MemTotal ?? null,+ operatingSystem: dockerInfo.OperatingSystem ?? null,+ osType: dockerInfo.OSType ?? null,+ serverVersion: dockerInfo.ServerVersion ?? null,+ storageDriver: dockerInfo.Driver ?? null,+ },+ version: dockerVersion,+ },+ },+ browserNetworkIsolation: {+ active: browserNetworkIsolated,+ allowedOrigins: [allowedBrowserOrigin, allowedBrowserWebSocketOrigin],+ blockedProxyAttemptCount: proxyAttempts.reduce((total, { count }) => total + count, 0),+ externalBrowserRequests,+ externalBrowserWebSockets,+ hostResolverPolicy: "deny all DNS except localhost and 127.0.0.1",+ httpCachePolicy: browserProvenance.httpCachePolicy,+ observedOrigins,+ proxy: { host: denyProxy.host, port: denyProxy.port, policy: "deny", attempts: safeProxyAttempts },+ canaries: { http: browserNetworkIsolationCanary, webSockets: browserWebSocketIsolationCanaries },+ observedWebSockets: browserWebSockets,+ unexpectedExternalResponses,+ },+ serverNetworkIsolation: {+ active: serverNetworkIsolated,+ canary: serverNetworkIsolationCanary,+ network: { id: isolationNetworkId, internal: true, name: isolationNetworkName },+ policy: "application container attached only to an internal Docker network",+ },+ workload: {+ baseUrl,+ startToReadyMs,+ settleMs,+ sampleIntervalMs,+ settleSampleCount,+ lcpObservationMs,+ lcpStabilityMs,+ widgetDataQuietMs,+ spotlightIdleMs,+ spotlightIdlePolicy,+ interactionIterations,+ widgetCount,+ implementationMarkerPolicy: readyMarkerPolicy,+ widgetImplementationMarkerCount: implementationMarkerCount,+ widgetErrorCount,+ loginJourneyBoardMountedMs,+ loginJourneyWidgetImplementationsMountedMs,+ loginJourneyWidgetData,+ loginJourneyWidgetDataSettledMs,+ pageLoadSamples,+ pageLoadSummary,+ coldSpotlightFeedbackMs,+ coldSpotlightReadyMs,+ idleSpotlightNetworkCounts,+ postIdleWarmInteractionMs,+ postIdleWarmInteractionSummary,+ warmInteractionSamplesMs,+ routeTimings,+ trpcRequestCount,+ widgetRequestCount,+ webSocketCount,+ websocketReadyMs,+ legacyQueryCacheWriteCount,+ legacyQueryCacheWriteBytes,+ initialNetworkCounts,+ loginJourneyNetworkCounts,+ initialBrowserMetrics,+ initialWidgetData,+ initialWidgetDataSettledMs,+ },+ checkpoints,+ summary: summarizeRuntimeMemory(checkpoints),+ };+ const outputPath = path.join(outputDirectory, `runtime-${Date.now()}.json`);+ await writeFile(outputPath, `${JSON.stringify(result, null, 2)}\n`);+ console.log(+ JSON.stringify({ outputPath, claimEligible, summary: result.summary, workload: result.workload }, null, 2),+ );++ await page.close();+ await context.close();+ await routeContext.close();+} catch (error) {+ if (containerId) {+ const logs = await execFileAsync("docker", ["logs", "--tail", "100", containerId]).catch(() => null);+ if (logs?.stdout) console.error(logs.stdout);+ if (logs?.stderr) console.error(logs.stderr);+ }+ throw error;+} finally {+ process.off("SIGINT", handleSigint);+ process.off("SIGTERM", handleSigterm);+ await cleanupAsync();+}diff --git a/scripts/benchmarks/request-handler-memory.mts b/scripts/benchmarks/request-handler-memory.mtsnew file mode 100644index 000000000..c867efaa1--- /dev/null+++ b/scripts/benchmarks/request-handler-memory.mts@@ -0,0 +1,107 @@+import { createIntegrationRequestHandler } from "../../packages/request-handler/src/lib/integration-request-handler.ts";+import { createRequestHandler } from "../../packages/request-handler/src/lib/request-handler.ts";++const allocations = Number(process.env.REQUEST_MEMORY_ALLOCATIONS ?? 64);+const allocationBytes = Number(process.env.REQUEST_MEMORY_ALLOCATION_BYTES ?? 1024 * 1024);+const maxRetainedBytes = Number(process.env.REQUEST_MEMORY_MAX_RETAINED_BYTES ?? 16 * 1024 * 1024);+const positiveTtlMs = Number(process.env.REQUEST_MEMORY_POSITIVE_TTL_MS ?? 25);++if (!globalThis.gc) throw new Error("Run this benchmark with node --expose-gc");+if (!Number.isInteger(allocations) || allocations < 2) throw new Error("REQUEST_MEMORY_ALLOCATIONS must be >= 2");+if (!Number.isInteger(allocationBytes) || allocationBytes < 1) {+ throw new Error("REQUEST_MEMORY_ALLOCATION_BYTES must be positive");+}++const collectGarbage = async () => {+ for (let index = 0; index < 4; index++) {+ globalThis.gc?.();+ await new Promise((resolve) => setImmediate(resolve));+ }+};++const retainedRoots: unknown[] = [];+const measureArrayBufferGrowthAsync = async (workload: () => Promise<unknown>) => {+ await collectGarbage();+ const before = process.memoryUsage().arrayBuffers;+ const retainedRoot = await workload();+ retainedRoots.push(retainedRoot);+ await collectGarbage();+ const growth = process.memoryUsage().arrayBuffers - before;+ retainedRoots.pop();+ return growth;+};++const zeroTtlGrowthBytes = await measureArrayBufferGrowthAsync(async () => {+ const handler = createRequestHandler<Uint8Array, { id: number }>({+ cacheTtlMs: 0,+ requestAsync: async () => new Uint8Array(allocationBytes),+ });+ for (let id = 0; id < allocations; id++) {+ await handler.handler({ id }).getDataAsync();+ }+ return handler;+});++const integrationGrowthBytes = await measureArrayBufferGrowthAsync(async () => {+ const handler = createIntegrationRequestHandler<number, "mock", Record<string, never>>({+ cacheTtlMs: 0,+ requestAsync: async (integration) =>+ (integration as typeof integration & { benchmarkPayload: Uint8Array }).benchmarkPayload.byteLength,+ });+ for (let id = 0; id < allocations; id++) {+ await handler+ .handler(+ {+ id: `benchmark-${id}`,+ kind: "mock",+ name: "benchmark",+ url: "http://benchmark.invalid",+ externalUrl: null,+ decryptedSecrets: [],+ benchmarkPayload: new Uint8Array(allocationBytes),+ } as never,+ {},+ )+ .getDataAsync();+ }+ return handler;+});++const expiredPositiveTtlGrowthBytes = await measureArrayBufferGrowthAsync(async () => {+ const handler = createRequestHandler<Uint8Array, { id: number }>({+ cacheTtlMs: positiveTtlMs,+ requestAsync: async () => new Uint8Array(allocationBytes),+ });+ for (let id = 0; id < allocations; id++) {+ await handler.handler({ id }).getDataAsync();+ }+ await new Promise((resolve) => setTimeout(resolve, positiveTtlMs + 25));+ return handler;+});++const positiveControlGrowthBytes = await measureArrayBufferGrowthAsync(async () =>+ Array.from({ length: allocations }, () => new Uint8Array(allocationBytes)),+);+const positiveControlMinimumBytes = allocations * allocationBytes * 0.8;++const result = {+ allocations,+ allocationBytes,+ allocatedPerScenarioBytes: allocations * allocationBytes,+ maxRetainedBytes,+ positiveTtlMs,+ zeroTtlGrowthBytes,+ integrationGrowthBytes,+ expiredPositiveTtlGrowthBytes,+ positiveControlGrowthBytes,+ positiveControlMinimumBytes,+ zeroTtlPass: zeroTtlGrowthBytes <= maxRetainedBytes,+ integrationPass: integrationGrowthBytes <= maxRetainedBytes,+ expiredPositiveTtlPass: expiredPositiveTtlGrowthBytes <= maxRetainedBytes,+ positiveControlPass: positiveControlGrowthBytes >= positiveControlMinimumBytes,+};++console.log(JSON.stringify(result, null, 2));+if (!result.zeroTtlPass || !result.integrationPass || !result.expiredPositiveTtlPass || !result.positiveControlPass) {+ process.exitCode = 1;+}