Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

refactor(web): reroute leftover long-tail feature deep imports through index.ts (#17762)

Nikita Kabardin1e6d10c19433
diff --git a/web/src/__tests__/organization-settings-pages.clienttest.tsx b/web/src/__tests__/organization-settings-pages.clienttest.tsx
index 211e4f0a3f..abacaf25ff 100644
--- a/web/src/__tests__/organization-settings-pages.clienttest.tsx
+++ b/web/src/__tests__/organization-settings-pages.clienttest.tsx
@@ -56,7 +56,7 @@ vi.mock("@/src/features/entitlements/hooks", () => ({
usePlan: vi.fn(),
}));
-vi.mock("@/src/ee/features/sso-settings/components/SSOSettings", () => ({
+vi.mock("@/src/ee/features/sso-settings", () => ({
SSOSettings: () => null,
}));
@@ -80,7 +80,7 @@ vi.mock("@/src/ee/features/billing/utils/isCloudBilling", () => ({
useIsCloudBillingAvailable: vi.fn(),
}));
-vi.mock("@/src/ee/features/audit-log-viewer/OrgAuditLogsSettingsPage", () => ({
+vi.mock("@/src/ee/features/audit-log-viewer", () => ({
OrgAuditLogsSettingsPage: () => null,
}));
diff --git a/web/src/__tests__/server/audit-log-in-app-agent.servertest.ts b/web/src/__tests__/server/audit-log-in-app-agent.servertest.ts
index 8c57b8ed9e..1ec2ded8fe 100644
--- a/web/src/__tests__/server/audit-log-in-app-agent.servertest.ts
+++ b/web/src/__tests__/server/audit-log-in-app-agent.servertest.ts
@@ -1,6 +1,6 @@
import { randomUUID } from "crypto";
import { afterEach, describe, expect, it, vi } from "vitest";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import { prisma, AuditLogRecordType } from "@langfuse/shared/src/db";
import { createAndAddApiKeysToDb } from "@langfuse/shared/src/server/auth/apiKeys";
import { createOrgProjectAndApiKey } from "@langfuse/shared/src/server";
diff --git a/web/src/__tests__/server/dataset-service.servertest.ts b/web/src/__tests__/server/dataset-service.servertest.ts
index cc89cc9fd5..a5ac3729a6 100644
--- a/web/src/__tests__/server/dataset-service.servertest.ts
+++ b/web/src/__tests__/server/dataset-service.servertest.ts
@@ -25,8 +25,7 @@ import {
import {
aggregateScores,
composeAggregateScoreKey,
-} from "@/src/features/scores/lib/aggregateScores";
-
+} from "@/src/features/scores/server";
const projectId = "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a";
process.env.LANGFUSE_DATASET_SERVICE_READ_FROM_VERSIONED_IMPLEMENTATION =
diff --git a/web/src/__tests__/server/in-app-agent-api-route-auth.servertest.ts b/web/src/__tests__/server/in-app-agent-api-route-auth.servertest.ts
index 85ee4562bf..07402a0fa1 100644
--- a/web/src/__tests__/server/in-app-agent-api-route-auth.servertest.ts
+++ b/web/src/__tests__/server/in-app-agent-api-route-auth.servertest.ts
@@ -30,9 +30,13 @@ vi.mock("@/src/server/auth", () => ({
getServerAuthSessionForRequest: authMocks.getServerAuthSessionForRequest,
}));
-vi.mock("@/src/features/entitlements/server/hasEntitlement", () => ({
- hasEntitlement: entitlementMocks.hasEntitlement,
-}));
+vi.mock("@/src/features/entitlements/server", async (importOriginal) => {
+ const actual = (await importOriginal()) as Record<string, unknown>;
+ return {
+ ...actual,
+ hasEntitlement: entitlementMocks.hasEntitlement,
+ };
+});
describe("in-app agent public API route auth", () => {
beforeEach(() => {
diff --git a/web/src/__tests__/server/onboarding-router.servertest.ts b/web/src/__tests__/server/onboarding-router.servertest.ts
index f8a37b57e6..97c9a495a8 100644
--- a/web/src/__tests__/server/onboarding-router.servertest.ts
+++ b/web/src/__tests__/server/onboarding-router.servertest.ts
@@ -5,7 +5,7 @@ import { env } from "@/src/env.mjs";
import { appRouter } from "@/src/server/api/root";
import { createInnerTRPCContext } from "@/src/server/api/trpc";
import { createProjectMembershipsOnSignup } from "@/src/features/auth/lib/createProjectMembershipsOnSignup";
-import { V4_DEFAULT_ENABLED_FROM_AT } from "@/src/features/events/lib/v4Rollout";
+import { V4_DEFAULT_ENABLED_FROM_AT } from "@/src/features/events/server";
import { createProjectRoute } from "@/src/features/setup";
import { prisma, Role } from "@langfuse/shared/src/db";
diff --git a/web/src/__tests__/server/policy-auth.servertest.ts b/web/src/__tests__/server/policy-auth.servertest.ts
index df9da63395..1536ea3f9a 100644
--- a/web/src/__tests__/server/policy-auth.servertest.ts
+++ b/web/src/__tests__/server/policy-auth.servertest.ts
@@ -5,7 +5,7 @@ import {
} from "@langfuse/shared/src/server";
import { prisma } from "@langfuse/shared/src/db";
-import { Authenticator } from "@/src/features/apiKey/authenticator";
+import { Authenticator } from "@/src/features/apiKey/server";
import { authorize } from "@/src/features/auth/policy/authorize";
import { ApiAuthService } from "@/src/features/public-api/server/apiAuth";
diff --git a/web/src/__tests__/server/traces-trpc.servertest.ts b/web/src/__tests__/server/traces-trpc.servertest.ts
index 0caefed3a5..f0471fa4a4 100644
--- a/web/src/__tests__/server/traces-trpc.servertest.ts
+++ b/web/src/__tests__/server/traces-trpc.servertest.ts
@@ -19,7 +19,7 @@ import {
import waitForExpect from "wait-for-expect";
import { randomUUID } from "crypto";
import { env } from "@/src/env.mjs";
-import { composeAggregateScoreKey } from "@/src/features/scores/lib/aggregateScores";
+import { composeAggregateScoreKey } from "@/src/features/scores/server";
import { BatchExportFileFormat, BatchTableNames } from "@langfuse/shared";
describe("traces trpc", () => {
diff --git a/web/src/__tests__/server/unit/apiKey/authenticator.servertest.ts b/web/src/__tests__/server/unit/apiKey/authenticator.servertest.ts
index 204393753f..149174a6f5 100644
--- a/web/src/__tests__/server/unit/apiKey/authenticator.servertest.ts
+++ b/web/src/__tests__/server/unit/apiKey/authenticator.servertest.ts
@@ -13,7 +13,7 @@ import {
createShaHash,
} from "@langfuse/shared/src/server";
-import { Authenticator } from "@/src/features/apiKey/authenticator";
+import { Authenticator } from "@/src/features/apiKey/server";
import { AuthenticatorCache } from "@/src/features/apiKey/authenticatorCache";
import {
OrganizationRepository,
diff --git a/web/src/__tests__/server/unit/batch-actions-comment-filter.servertest.ts b/web/src/__tests__/server/unit/batch-actions-comment-filter.servertest.ts
index f8439c3a9f..160dd0ffbf 100644
--- a/web/src/__tests__/server/unit/batch-actions-comment-filter.servertest.ts
+++ b/web/src/__tests__/server/unit/batch-actions-comment-filter.servertest.ts
@@ -20,7 +20,7 @@ vi.mock("@langfuse/shared/src/server", async (importOriginal) => {
};
});
-vi.mock("@/src/features/audit-logs/auditLog", () => ({
+vi.mock("@/src/features/audit-logs/server", () => ({
auditLog: vi.fn(),
}));
diff --git a/web/src/__tests__/server/unit/buildScoreFilters.servertest.ts b/web/src/__tests__/server/unit/buildScoreFilters.servertest.ts
index ea48119d6d..846b3d2781 100644
--- a/web/src/__tests__/server/unit/buildScoreFilters.servertest.ts
+++ b/web/src/__tests__/server/unit/buildScoreFilters.servertest.ts
@@ -11,7 +11,7 @@ vi.mock("@/src/features/public-api/server/scores", () => ({
convertScoreToPublicApi: vi.fn((score) => score),
}));
-vi.mock("@/src/features/audit-logs/auditLog", () => ({
+vi.mock("@/src/features/audit-logs/server", () => ({
auditLog: vi.fn(),
}));
diff --git a/web/src/__tests__/server/unit/chbBillingService.servertest.ts b/web/src/__tests__/server/unit/chbBillingService.servertest.ts
index 3683196042..aa9302722e 100644
--- a/web/src/__tests__/server/unit/chbBillingService.servertest.ts
+++ b/web/src/__tests__/server/unit/chbBillingService.servertest.ts
@@ -11,7 +11,7 @@ const mocks = vi.hoisted(() => ({
vi.mock("@/src/env.mjs", () => ({ env: mocks.env }));
-vi.mock("@/src/features/audit-logs/auditLog", () => ({
+vi.mock("@/src/features/audit-logs/server", () => ({
auditLog: mocks.auditLog,
}));
diff --git a/web/src/__tests__/server/unit/chbWebhookHandler.servertest.ts b/web/src/__tests__/server/unit/chbWebhookHandler.servertest.ts
index d5eb6e55db..a5cca0dc6d 100644
--- a/web/src/__tests__/server/unit/chbWebhookHandler.servertest.ts
+++ b/web/src/__tests__/server/unit/chbWebhookHandler.servertest.ts
@@ -48,7 +48,7 @@ vi.mock("@langfuse/shared/src/server", async (importOriginal) => {
};
});
-vi.mock("@/src/features/audit-logs/auditLog", () => ({
+vi.mock("@/src/features/audit-logs/server", () => ({
auditLog: mocks.auditLog,
}));
diff --git a/web/src/__tests__/server/unit/cloudBillingRouter.servertest.ts b/web/src/__tests__/server/unit/cloudBillingRouter.servertest.ts
index 6c7a4f5e1b..5c22033a6b 100644
--- a/web/src/__tests__/server/unit/cloudBillingRouter.servertest.ts
+++ b/web/src/__tests__/server/unit/cloudBillingRouter.servertest.ts
@@ -13,15 +13,19 @@ vi.mock("@/src/ee/features/billing/server/resolveBillingService", () => ({
resolveBillingService: mocks.resolveBillingService,
}));
-vi.mock("@/src/features/entitlements/server/hasEntitlement", () => ({
- throwIfNoEntitlement: mocks.throwIfNoEntitlement,
-}));
+vi.mock("@/src/features/entitlements/server", async (importOriginal) => {
+ const actual = (await importOriginal()) as Record<string, unknown>;
+ return {
+ ...actual,
+ throwIfNoEntitlement: mocks.throwIfNoEntitlement,
+ };
+});
vi.mock("@/src/features/rbac/utils/checkOrganizationAccess", () => ({
throwIfNoOrganizationAccess: mocks.throwIfNoOrganizationAccess,
}));
-vi.mock("@/src/features/audit-logs/auditLog", () => ({
+vi.mock("@/src/features/audit-logs/server", () => ({
auditLog: mocks.auditLog,
}));
diff --git a/web/src/__tests__/server/unit/data-access-days.servertest.ts b/web/src/__tests__/server/unit/data-access-days.servertest.ts
index 750ac6a6e1..316cc7d547 100644
--- a/web/src/__tests__/server/unit/data-access-days.servertest.ts
+++ b/web/src/__tests__/server/unit/data-access-days.servertest.ts
@@ -1,7 +1,6 @@
import { describe, expect, it } from "vitest";
-import { clampToDataAccessDays } from "@/src/features/entitlements/server/hasEntitlementLimit";
-
+import { clampToDataAccessDays } from "@/src/features/entitlements/server";
const NOW = new Date("2026-08-28T12:00:00.000Z");
describe("clampToDataAccessDays", () => {
diff --git a/web/src/__tests__/server/unit/mcp-v4-migration.servertest.ts b/web/src/__tests__/server/unit/mcp-v4-migration.servertest.ts
index bb2f14a60f..8bd702b116 100644
--- a/web/src/__tests__/server/unit/mcp-v4-migration.servertest.ts
+++ b/web/src/__tests__/server/unit/mcp-v4-migration.servertest.ts
@@ -4,7 +4,7 @@ const { getProjectV4MigrationData } = vi.hoisted(() => ({
getProjectV4MigrationData: vi.fn(),
}));
-vi.mock("@/src/features/v4/server/v4TransitionService", () => ({
+vi.mock("@/src/features/v4/server", () => ({
getProjectV4MigrationData,
}));
diff --git a/web/src/__tests__/server/unit/onboardingService.servertest.ts b/web/src/__tests__/server/unit/onboardingService.servertest.ts
index 1ee4a3fb25..3204e06f47 100644
--- a/web/src/__tests__/server/unit/onboardingService.servertest.ts
+++ b/web/src/__tests__/server/unit/onboardingService.servertest.ts
@@ -2,7 +2,7 @@ const { auditLogMock } = vi.hoisted(() => ({
auditLogMock: vi.fn(),
}));
-vi.mock("@/src/features/audit-logs/auditLog", () => ({
+vi.mock("@/src/features/audit-logs/server", () => ({
auditLog: auditLogMock,
}));
@@ -13,7 +13,7 @@ import {
provisionStarterOrganizationForNewUser,
resolveOnboardingRedirectTarget,
type RealOrganizationMembership,
-} from "@/src/features/onboarding/server/onboardingService";
+} from "@/src/features/onboarding/server";
type CompletionPrisma = Parameters<
typeof completeCloudSignupOnboarding
diff --git a/web/src/__tests__/server/unit/resolveFilterPrompt.servertest.ts b/web/src/__tests__/server/unit/resolveFilterPrompt.servertest.ts
index 13cff1024d..54cf853401 100644
--- a/web/src/__tests__/server/unit/resolveFilterPrompt.servertest.ts
+++ b/web/src/__tests__/server/unit/resolveFilterPrompt.servertest.ts
@@ -1,11 +1,11 @@
import { afterEach, describe, expect, it, vi } from "vitest";
-vi.mock("@/src/features/natural-language-filters/server/utils", () => ({
+vi.mock("@/src/features/natural-language-filters/server", () => ({
getLangfuseClient: vi.fn(),
}));
import { logger } from "@langfuse/shared/src/server";
-import { getLangfuseClient } from "@/src/features/natural-language-filters/server/utils";
+import { getLangfuseClient } from "@/src/features/natural-language-filters/server";
import {
buildFieldCatalog,
buildFilterSystemPrompt,
diff --git a/web/src/__tests__/server/users-facet-coverage.servertest.ts b/web/src/__tests__/server/users-facet-coverage.servertest.ts
index a44658670a..3b20dc7aea 100644
--- a/web/src/__tests__/server/users-facet-coverage.servertest.ts
+++ b/web/src/__tests__/server/users-facet-coverage.servertest.ts
@@ -13,7 +13,7 @@
*/
import { randomUUID } from "crypto";
-import { observationEventsFilterConfig } from "@/src/features/events/config/filter-config";
+import { observationEventsFilterConfig } from "@/src/features/events/server";
import { traceFilterConfig } from "@/src/features/filters/config/traces-config";
import {
usersEventsFilterConfig,
diff --git a/web/src/ee/features/admin-api/server/index.ts b/web/src/ee/features/admin-api/server/index.ts
new file mode 100644
index 0000000000..f4808760bf
--- /dev/null
+++ b/web/src/ee/features/admin-api/server/index.ts
@@ -0,0 +1 @@
+export { AdminApiAuthService } from "@/src/ee/features/admin-api/server/adminApiAuth";
diff --git a/web/src/ee/features/audit-log-viewer/index.ts b/web/src/ee/features/audit-log-viewer/index.ts
new file mode 100644
index 0000000000..d865f9035d
--- /dev/null
+++ b/web/src/ee/features/audit-log-viewer/index.ts
@@ -0,0 +1,2 @@
+export { AuditLogsSettingsPage } from "@/src/ee/features/audit-log-viewer/AuditLogsSettingsPage";
+export { OrgAuditLogsSettingsPage } from "@/src/ee/features/audit-log-viewer/OrgAuditLogsSettingsPage";
diff --git a/web/src/ee/features/billing/server/chb/chbWebhookHandler.ts b/web/src/ee/features/billing/server/chb/chbWebhookHandler.ts
index 7810cd684f..41f039641f 100644
--- a/web/src/ee/features/billing/server/chb/chbWebhookHandler.ts
+++ b/web/src/ee/features/billing/server/chb/chbWebhookHandler.ts
@@ -4,7 +4,7 @@ import { type NextRequest, NextResponse } from "next/server";
import { z } from "zod";
import { env } from "@/src/env.mjs";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import {
chbPlanCodes,
CloudConfigSchema,
diff --git a/web/src/ee/features/multi-tenant-sso/createNewSsoConfigHandler.ts b/web/src/ee/features/multi-tenant-sso/createNewSsoConfigHandler.ts
index 64fc19948b..e071953e5c 100644
--- a/web/src/ee/features/multi-tenant-sso/createNewSsoConfigHandler.ts
+++ b/web/src/ee/features/multi-tenant-sso/createNewSsoConfigHandler.ts
@@ -7,8 +7,7 @@ import { type NextApiRequest, type NextApiResponse } from "next";
import { env } from "@/src/env.mjs";
import { logger } from "@langfuse/shared/src/server";
import { multiTenantSsoAvailable } from "@/src/ee/features/multi-tenant-sso/multiTenantSsoAvailable";
-import { AdminApiAuthService } from "@/src/ee/features/admin-api/server/adminApiAuth";
-
+import { AdminApiAuthService } from "@/src/ee/features/admin-api/server";
export async function createNewSsoConfigHandler(
req: NextApiRequest,
res: NextApiResponse,
diff --git a/web/src/ee/features/sso-settings/components/SSOSettings.tsx b/web/src/ee/features/sso-settings/components/SSOSettings.tsx
index be0183a973..77894bdb8c 100644
--- a/web/src/ee/features/sso-settings/components/SSOSettings.tsx
+++ b/web/src/ee/features/sso-settings/components/SSOSettings.tsx
@@ -30,7 +30,7 @@ import { Input } from "@/src/components/ui/input";
import Header from "@/src/components/layouts/header";
import { useHasEntitlement } from "@/src/features/entitlements";
import { useHasOrganizationAccess } from "@/src/features/rbac";
-import { VerifiedDomainsSettings } from "@/src/ee/features/verified-domains/components/VerifiedDomainsSettings";
+import { VerifiedDomainsSettings } from "@/src/ee/features/verified-domains";
import { SsoProviderSchema } from "@/src/ee/features/multi-tenant-sso";
import { api } from "@/src/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
diff --git a/web/src/ee/features/sso-settings/index.ts b/web/src/ee/features/sso-settings/index.ts
new file mode 100644
index 0000000000..d80ecb38ab
--- /dev/null
+++ b/web/src/ee/features/sso-settings/index.ts
@@ -0,0 +1 @@
+export { SSOSettings } from "@/src/ee/features/sso-settings/components/SSOSettings";
diff --git a/web/src/ee/features/verified-domains/index.ts b/web/src/ee/features/verified-domains/index.ts
new file mode 100644
index 0000000000..55805babcb
--- /dev/null
+++ b/web/src/ee/features/verified-domains/index.ts
@@ -0,0 +1 @@
+export { VerifiedDomainsSettings } from "@/src/ee/features/verified-domains/components/VerifiedDomainsSettings";
diff --git a/web/src/features/apiKey/server/index.ts b/web/src/features/apiKey/server/index.ts
new file mode 100644
index 0000000000..d60f22b6bc
--- /dev/null
+++ b/web/src/features/apiKey/server/index.ts
@@ -0,0 +1,4 @@
+export {
+ Authenticator,
+ authenticator,
+} from "@/src/features/apiKey/authenticator";
diff --git a/web/src/features/auth-credentials/index.ts b/web/src/features/auth-credentials/index.ts
new file mode 100644
index 0000000000..ba1195e9db
--- /dev/null
+++ b/web/src/features/auth-credentials/index.ts
@@ -0,0 +1,4 @@
+export {
+ isEmailVerificationRequired,
+ PASSWORD_SETUP_EMAIL_STORAGE_KEY,
+} from "@/src/features/auth-credentials/lib/credentialsUtils";
diff --git a/web/src/features/auth/SignUpPage.tsx b/web/src/features/auth/SignUpPage.tsx
index a7165bfc4d..138364fbd4 100644
--- a/web/src/features/auth/SignUpPage.tsx
+++ b/web/src/features/auth/SignUpPage.tsx
@@ -34,8 +34,7 @@ import { isJsonParseSyntaxError } from "@/src/features/auth/lib/expectedAuthErro
import { usePostHogClientCapture } from "@/src/features/posthog-analytics";
import useLocalStorage from "@/src/components/useLocalStorage";
import { noUrlCheck, StringNoHTMLNonEmpty } from "@langfuse/shared";
-import { PASSWORD_SETUP_EMAIL_STORAGE_KEY } from "@/src/features/auth-credentials/lib/credentialsUtils";
-
+import { PASSWORD_SETUP_EMAIL_STORAGE_KEY } from "@/src/features/auth-credentials";
type NextAuthProvider = NonNullable<Parameters<typeof signIn>[0]>;
// Schema for the verified signup flow (email + name only, no password)
diff --git a/web/src/features/auth/lib/createProjectMembershipsOnSignup.ts b/web/src/features/auth/lib/createProjectMembershipsOnSignup.ts
index cfb708f2df..a5c5ecb313 100644
--- a/web/src/features/auth/lib/createProjectMembershipsOnSignup.ts
+++ b/web/src/features/auth/lib/createProjectMembershipsOnSignup.ts
@@ -9,7 +9,7 @@ import {
import { shouldAutoEnableV4 } from "@/src/features/events/lib/v4Rollout";
import { getSfdcService } from "@/src/ee/features/sfdc-sync/server";
import { canCreateOrganizations } from "@/src/features/organizations/server";
-import { provisionStarterOrganizationForNewUser } from "@/src/features/onboarding/server/onboardingService";
+import { provisionStarterOrganizationForNewUser } from "@/src/features/onboarding/server";
import { projectRoleAccessRights } from "@langfuse/shared";
import { type AdClickIds } from "@/src/features/auth/lib/signupAttribution";
diff --git a/web/src/features/auth/server/getSignInPageServerSideProps.ts b/web/src/features/auth/server/getSignInPageServerSideProps.ts
index a62c18bebd..a213e5030f 100644
--- a/web/src/features/auth/server/getSignInPageServerSideProps.ts
+++ b/web/src/features/auth/server/getSignInPageServerSideProps.ts
@@ -2,7 +2,7 @@
import { type GetServerSideProps } from "next";
import { env } from "@/src/env.mjs";
import { isAnySsoConfigured } from "@/src/ee/features/multi-tenant-sso/server";
-import { isEmailVerificationRequired } from "@/src/features/auth-credentials/lib/credentialsUtils";
+import { isEmailVerificationRequired } from "@/src/features/auth-credentials";
import { type PageProps } from "@/src/features/auth/SignInPage";
// Also used in src/pages/auth/sign-up.tsx via the pages/auth/sign-in shim.
diff --git a/web/src/features/batch-exports/index.ts b/web/src/features/batch-exports/index.ts
new file mode 100644
index 0000000000..699936e266
--- /dev/null
+++ b/web/src/features/batch-exports/index.ts
@@ -0,0 +1 @@
+export { BatchExportsSettingsPage } from "@/src/features/batch-exports/components/BatchExportsSettingsPage";
diff --git a/web/src/features/blobstorage-integration/authorizeBlobStorageRequest.ts b/web/src/features/blobstorage-integration/authorizeBlobStorageRequest.ts
index 7ae7f85dfa..293ecc4959 100644
--- a/web/src/features/blobstorage-integration/authorizeBlobStorageRequest.ts
+++ b/web/src/features/blobstorage-integration/authorizeBlobStorageRequest.ts
@@ -3,7 +3,7 @@ import { type NextApiRequest } from "next";
import { ForbiddenError, UnauthorizedError } from "@langfuse/shared";
import { type ApiAccessScope } from "@langfuse/shared/src/server";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
import {
shadowAuth,
ErrorOrgApiKeyRequired,
diff --git a/web/src/features/blobstorage-integration/index.ts b/web/src/features/blobstorage-integration/index.ts
new file mode 100644
index 0000000000..3e5329e3c0
--- /dev/null
+++ b/web/src/features/blobstorage-integration/index.ts
@@ -0,0 +1,6 @@
+export {
+ EXPORT_START_DATE_FUTURE_ERROR,
+ exportStartDateNotInFuture,
+ validateAzureContainerName,
+ validateExportFieldGroups,
+} from "@/src/features/blobstorage-integration/validation";
diff --git a/web/src/features/datasets/server/dataset-router.ts b/web/src/features/datasets/server/dataset-router.ts
index 3a3e4e5eea..81723efcf1 100644
--- a/web/src/features/datasets/server/dataset-router.ts
+++ b/web/src/features/datasets/server/dataset-router.ts
@@ -93,7 +93,7 @@ import {
deleteDatasetsByIds,
findDatasetsForDeletion,
} from "@langfuse/shared/src/server";
-import { aggregateScores } from "@/src/features/scores/lib/aggregateScores";
+import { aggregateScores } from "@/src/features/scores/server";
import {
updateDataset,
upsertDataset,
diff --git a/web/src/features/datasets/server/service.ts b/web/src/features/datasets/server/service.ts
index c3ea703106..83e94d5632 100644
--- a/web/src/features/datasets/server/service.ts
+++ b/web/src/features/datasets/server/service.ts
@@ -21,7 +21,7 @@ import {
} from "@langfuse/shared/src/server";
import Decimal from "decimal.js";
import groupBy from "lodash/groupBy";
-import { aggregateScores } from "@/src/features/scores/lib/aggregateScores";
+import { aggregateScores } from "@/src/features/scores/server";
import { calculateRecursiveMetricsForRunItems } from "./utils";
export const datasetRunsTableSchema = z.object({
diff --git a/web/src/features/developer-tools/index.ts b/web/src/features/developer-tools/index.ts
new file mode 100644
index 0000000000..caf7379e3d
--- /dev/null
+++ b/web/src/features/developer-tools/index.ts
@@ -0,0 +1,2 @@
+export { AgentToolsBanner } from "@/src/features/developer-tools/components/AgentToolsBanner";
+export { DeveloperToolsSettings } from "@/src/features/developer-tools/components/DeveloperToolsSettings";
diff --git a/web/src/features/evals/v2/server/evaluators/evaluatorService.ts b/web/src/features/evals/v2/server/evaluators/evaluatorService.ts
index ad48e754c2..7329e1a150 100644
--- a/web/src/features/evals/v2/server/evaluators/evaluatorService.ts
+++ b/web/src/features/evals/v2/server/evaluators/evaluatorService.ts
@@ -25,7 +25,7 @@ import {
invalidateProjectEvalConfigCaches,
logger,
} from "@langfuse/shared/src/server";
-import { resolveLangfuseAiFeatureAvailability } from "@/src/features/ai-features/server/availability";
+import { resolveLangfuseAiFeatureAvailability } from "@/src/features/ai-features/server";
import { getEvaluatorDefinitionPreflightError } from "@/src/features/evals/server/evaluator-preflight";
import {
type CreateEvaluatorInput,
diff --git a/web/src/features/evals/v2/server/rules/ruleService.ts b/web/src/features/evals/v2/server/rules/ruleService.ts
index 80247eba5b..b9017d4124 100644
--- a/web/src/features/evals/v2/server/rules/ruleService.ts
+++ b/web/src/features/evals/v2/server/rules/ruleService.ts
@@ -25,7 +25,7 @@ import {
getRecentRuleExecutionTraces,
getTotalCostByRule,
} from "@langfuse/shared/src/server";
-import { resolveLangfuseAiFeatureAvailability } from "@/src/features/ai-features/server/availability";
+import { resolveLangfuseAiFeatureAvailability } from "@/src/features/ai-features/server";
import type {
CreateOrAttachFromEvaluatorFiltersInput,
CreateRuleInput,
diff --git a/web/src/features/events/server/eventsRouter.ts b/web/src/features/events/server/eventsRouter.ts
index 696b466447..75e817f0e0 100644
--- a/web/src/features/events/server/eventsRouter.ts
+++ b/web/src/features/events/server/eventsRouter.ts
@@ -1,7 +1,7 @@
import { type z, z as zodSchema } from "zod";
import { TRPCError } from "@trpc/server";
import { env } from "@/src/env.mjs";
-import { hasInternalAccess } from "@/src/features/feature-flags/utils";
+import { hasInternalAccess } from "@/src/features/feature-flags/server";
import {
createTRPCRouter,
protectedProjectProcedure,
diff --git a/web/src/features/events/server/eventsService.ts b/web/src/features/events/server/eventsService.ts
index 33dd506cc1..88c0d81eaa 100644
--- a/web/src/features/events/server/eventsService.ts
+++ b/web/src/features/events/server/eventsService.ts
@@ -29,8 +29,7 @@ import {
type EventBatchIOResult,
type EventFilterOptionColumn,
} from "@langfuse/shared/src/server";
-import { aggregateScores } from "@/src/features/scores/lib/aggregateScores";
-
+import { aggregateScores } from "@/src/features/scores/server";
type TimeFilter = z.infer<typeof timeFilter>;
const TRACE_SCORE_SCOPE_FILTER: FilterCondition[] = [
diff --git a/web/src/features/events/server/index.ts b/web/src/features/events/server/index.ts
index 6b07f2df89..c534cee138 100644
--- a/web/src/features/events/server/index.ts
+++ b/web/src/features/events/server/index.ts
@@ -6,3 +6,10 @@ export {
getEventFilterNumericRange,
getEventFilterValuePage,
} from "@/src/features/events/server/eventsService";
+export { observationEventsFilterConfig } from "@/src/features/events/config/filter-config";
+export {
+ canToggleV4,
+ isV4UpgradeUiAvailable,
+ shouldAutoEnableV4,
+ V4_DEFAULT_ENABLED_FROM_AT,
+} from "@/src/features/events/lib/v4Rollout";
diff --git a/web/src/features/experiments/server/router.ts b/web/src/features/experiments/server/router.ts
index 22c1a97179..3095e93089 100644
--- a/web/src/features/experiments/server/router.ts
+++ b/web/src/features/experiments/server/router.ts
@@ -56,7 +56,7 @@ import {
PROMPT_TOOL_STRUCTURED_OUTPUT_CONFLICT_MESSAGE,
} from "@langfuse/shared";
import { throwIfNoProjectAccess } from "@/src/features/rbac";
-import { aggregateScores } from "@/src/features/scores/lib/aggregateScores";
+import { aggregateScores } from "@/src/features/scores/server";
import { describeVariableMismatch } from "@/src/features/experiments/fns/describeVariableMismatch";
const ExperimentFilterOptions = z.object({
diff --git a/web/src/features/feature-flags/server/index.ts b/web/src/features/feature-flags/server/index.ts
index ffa156ece7..9638d1aa30 100644
--- a/web/src/features/feature-flags/server/index.ts
+++ b/web/src/features/feature-flags/server/index.ts
@@ -13,6 +13,7 @@ export {
} from "@/src/features/feature-flags/server/organizationFeatureFlags";
export {
getFeaturePreviewOptOutFlag,
+ hasInternalAccess,
parseFlags,
parseFlagsWithOrganizationDefaults,
} from "@/src/features/feature-flags/utils";
diff --git a/web/src/features/llm-api-key/index.ts b/web/src/features/llm-api-key/index.ts
new file mode 100644
index 0000000000..2961f9872f
--- /dev/null
+++ b/web/src/features/llm-api-key/index.ts
@@ -0,0 +1,5 @@
+export {
+ AuthMethod,
+ BedrockAuthMethodSchema,
+ type BedrockAuthMethod,
+} from "@/src/features/llm-api-key/types";
diff --git a/web/src/features/llm-schemas/index.ts b/web/src/features/llm-schemas/index.ts
new file mode 100644
index 0000000000..9b35164bd8
--- /dev/null
+++ b/web/src/features/llm-schemas/index.ts
@@ -0,0 +1 @@
+export { LLMSchemaNameSchema } from "@/src/features/llm-schemas/validation";
diff --git a/web/src/features/llm-tools/index.ts b/web/src/features/llm-tools/index.ts
new file mode 100644
index 0000000000..3c1258bc1a
--- /dev/null
+++ b/web/src/features/llm-tools/index.ts
@@ -0,0 +1 @@
+export { LLMToolNameSchema } from "@/src/features/llm-tools/validation";
diff --git a/web/src/features/mcp/server/observations/tools/getObservationFilterSchema.ts b/web/src/features/mcp/server/observations/tools/getObservationFilterSchema.ts
index 3ed25af84c..0179506b60 100644
--- a/web/src/features/mcp/server/observations/tools/getObservationFilterSchema.ts
+++ b/web/src/features/mcp/server/observations/tools/getObservationFilterSchema.ts
@@ -6,8 +6,7 @@ import {
OBSERVATION_MCP_ALLOWED_EVENTS_TABLE_FILTER_COLUMNS,
} from "@langfuse/shared";
import { defineTool } from "../../../core/define-tool";
-import { observationEventsFilterConfig } from "@/src/features/events/config/filter-config";
-
+import { observationEventsFilterConfig } from "@/src/features/events/server";
const EmptyInputSchema = z.object({});
const OBSERVATION_MCP_FILTER_COLUMNS = eventsTableCols
diff --git a/web/src/features/mcp/server/v4Migration/tools/getV4MigrationData.ts b/web/src/features/mcp/server/v4Migration/tools/getV4MigrationData.ts
index 9eae5201bf..99973c120f 100644
--- a/web/src/features/mcp/server/v4Migration/tools/getV4MigrationData.ts
+++ b/web/src/features/mcp/server/v4Migration/tools/getV4MigrationData.ts
@@ -1,7 +1,7 @@
import { prisma } from "@langfuse/shared/src/db";
import { z } from "zod";
-import { getProjectV4MigrationData } from "@/src/features/v4/server/v4TransitionService";
+import { getProjectV4MigrationData } from "@/src/features/v4/server";
import { defineTool } from "@/src/features/mcp/core/define-tool";
import { runMcpTool } from "@/src/features/mcp/core/run-mcp-tool";
diff --git a/web/src/features/metrics/index.ts b/web/src/features/metrics/index.ts
new file mode 100644
index 0000000000..ab331bc20b
--- /dev/null
+++ b/web/src/features/metrics/index.ts
@@ -0,0 +1 @@
+export { MetricsFilterBuilder } from "@/src/features/metrics/components/MetricsFilterBuilder";
diff --git a/web/src/features/models/ModelDetailPage.tsx b/web/src/features/models/ModelDetailPage.tsx
index c3a8a790f5..774735fb86 100644
--- a/web/src/features/models/ModelDetailPage.tsx
+++ b/web/src/features/models/ModelDetailPage.tsx
@@ -19,7 +19,7 @@ import Decimal from "decimal.js";
import { PriceUnitSelector } from "@/src/features/models/components/PriceUnitSelector";
import { useMemo, useState } from "react";
import { usePriceUnitMultiplier } from "@/src/features/models/hooks/usePriceUnitMultiplier";
-import Generations from "@/src/features/tracing-tables/observations/ObservationsTable";
+import { ObservationsTable as Generations } from "@/src/features/tracing-tables";
import Page from "@/src/components/layouts/page";
import { SquareArrowOutUpRight, Info as InfoIcon } from "lucide-react";
import {
diff --git a/web/src/features/monitors/components/MonitorForm.tsx b/web/src/features/monitors/components/MonitorForm.tsx
index 77c49a6706..8c2beb2c56 100644
--- a/web/src/features/monitors/components/MonitorForm.tsx
+++ b/web/src/features/monitors/components/MonitorForm.tsx
@@ -42,7 +42,7 @@ import { useHasProjectAccess } from "@/src/features/rbac";
import { useLangfuseCloudRegion } from "@/src/features/organizations";
import { useProject } from "@/src/features/projects";
import { WidgetPropertySelectItem } from "@/src/features/widgets";
-import { MetricsFilterBuilder } from "@/src/features/metrics/components/MetricsFilterBuilder";
+import { MetricsFilterBuilder } from "@/src/features/metrics";
import { partitionWidgetUiTableFiltersToView } from "@/src/features/dashboard";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics";
import { resolveMonitorNameForSave } from "@/src/features/monitors/fns/resolveMonitorNameForSave";
diff --git a/web/src/features/natural-language-filters/server/index.ts b/web/src/features/natural-language-filters/server/index.ts
new file mode 100644
index 0000000000..08f9d360e5
--- /dev/null
+++ b/web/src/features/natural-language-filters/server/index.ts
@@ -0,0 +1 @@
+export { getLangfuseClient } from "@/src/features/natural-language-filters/server/utils";
diff --git a/web/src/features/onboarding/server/index.ts b/web/src/features/onboarding/server/index.ts
new file mode 100644
index 0000000000..b04990ac70
--- /dev/null
+++ b/web/src/features/onboarding/server/index.ts
@@ -0,0 +1,7 @@
+export {
+ completeCloudSignupOnboarding,
+ getCloudSignupOnboardingStatus,
+ provisionStarterOrganizationForNewUser,
+ resolveOnboardingRedirectTarget,
+ type RealOrganizationMembership,
+} from "@/src/features/onboarding/server/onboardingService";
diff --git a/web/src/features/organizations/OrganizationSettingsPage.tsx b/web/src/features/organizations/OrganizationSettingsPage.tsx
index 3eafb7ac03..2623e00169 100644
--- a/web/src/features/organizations/OrganizationSettingsPage.tsx
+++ b/web/src/features/organizations/OrganizationSettingsPage.tsx
@@ -14,14 +14,14 @@ import { BillingSettings } from "@/src/ee/features/billing/components/BillingSet
import { useHasEntitlement, usePlan } from "@/src/features/entitlements";
import ContainerPage from "@/src/components/layouts/container-page";
import { NoDataOrLoading } from "@/src/components/NoDataOrLoading";
-import { SSOSettings } from "@/src/ee/features/sso-settings/components/SSOSettings";
+import { SSOSettings } from "@/src/ee/features/sso-settings";
import { isCloudPlan } from "@langfuse/shared";
import { useQueryProjectOrOrganization } from "@/src/features/projects";
import { ApiKeyList } from "@/src/features/public-api/components/ApiKeyList";
import AIFeatureSwitch from "@/src/features/organizations/components/AIFeatureSwitch";
import { useIsCloudBillingAvailable } from "@/src/ee/features/billing";
import { env } from "@/src/env.mjs";
-import { OrgAuditLogsSettingsPage } from "@/src/ee/features/audit-log-viewer/OrgAuditLogsSettingsPage";
+import { OrgAuditLogsSettingsPage } from "@/src/ee/features/audit-log-viewer";
import { useV4UpgradeUiFlag } from "@/src/features/v4-migration/useV4UpgradeUiEnabled";
import { OrganizationFeaturePreviewsSettings } from "@/src/features/feature-flags/components/OrganizationFeaturePreviewsSettings";
import { useIsFeatureEnabled } from "@/src/features/feature-flags";
diff --git a/web/src/features/organizations/components/ProjectOverview.tsx b/web/src/features/organizations/components/ProjectOverview.tsx
index 1fc6264c06..7dfda6ea13 100644
--- a/web/src/features/organizations/components/ProjectOverview.tsx
+++ b/web/src/features/organizations/components/ProjectOverview.tsx
@@ -33,7 +33,7 @@ import { isCloudPlan, planLabels } from "@langfuse/shared";
import ContainerPage from "@/src/components/layouts/container-page";
import { type Session } from "next-auth";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics";
-import { AgentToolsBanner } from "@/src/features/developer-tools/components/AgentToolsBanner";
+import { AgentToolsBanner } from "@/src/features/developer-tools";
import {
V4MigrationBanner,
useV4MigrationBannerState,
diff --git a/web/src/features/organizations/server/organizationRouter.ts b/web/src/features/organizations/server/organizationRouter.ts
index 5707149952..76569969bd 100644
--- a/web/src/features/organizations/server/organizationRouter.ts
+++ b/web/src/features/organizations/server/organizationRouter.ts
@@ -19,7 +19,7 @@ import {
} from "@langfuse/shared/src/server";
import { resolveBillingService } from "@/src/ee/features/billing/server";
import { isCloudBillingEnabled } from "@/src/ee/features/billing/utils/isCloudBilling";
-import { shouldAutoEnableV4 } from "@/src/features/events/lib/v4Rollout";
+import { shouldAutoEnableV4 } from "@/src/features/events/server";
import { buildAdminOrgContext } from "@/src/features/organizations/server/adminOrgContext";
import { getSfdcService } from "@/src/ee/features/sfdc-sync/server";
import {
diff --git a/web/src/features/playground/page/components/CreateOrEditLLMSchemaDialog.tsx b/web/src/features/playground/page/components/CreateOrEditLLMSchemaDialog.tsx
index 210573ac78..4746665e86 100644
--- a/web/src/features/playground/page/components/CreateOrEditLLMSchemaDialog.tsx
+++ b/web/src/features/playground/page/components/CreateOrEditLLMSchemaDialog.tsx
@@ -25,7 +25,7 @@ import {
} from "@/src/components/ui/form";
import { Input } from "@/src/components/ui/input";
import { Textarea } from "@/src/components/ui/textarea";
-import { LLMSchemaNameSchema } from "@/src/features/llm-schemas/validation";
+import { LLMSchemaNameSchema } from "@/src/features/llm-schemas";
import { api } from "@/src/utils/api";
import { JSONSchemaFormSchema, type LlmSchema } from "@langfuse/shared";
diff --git a/web/src/features/playground/page/components/CreateOrEditLLMToolDialog.tsx b/web/src/features/playground/page/components/CreateOrEditLLMToolDialog.tsx
index de0ab37891..0ba4dd4889 100644
--- a/web/src/features/playground/page/components/CreateOrEditLLMToolDialog.tsx
+++ b/web/src/features/playground/page/components/CreateOrEditLLMToolDialog.tsx
@@ -25,7 +25,7 @@ import {
} from "@/src/components/ui/form";
import { Input } from "@/src/components/ui/input";
import { Textarea } from "@/src/components/ui/textarea";
-import { LLMToolNameSchema } from "@/src/features/llm-tools/validation";
+import { LLMToolNameSchema } from "@/src/features/llm-tools";
import { api } from "@/src/utils/api";
import { CodeMirrorEditor } from "@/src/components/editor";
diff --git a/web/src/features/projects/ProjectSettingsPage.tsx b/web/src/features/projects/ProjectSettingsPage.tsx
index d643fa39b0..79f822a3d9 100644
--- a/web/src/features/projects/ProjectSettingsPage.tsx
+++ b/web/src/features/projects/ProjectSettingsPage.tsx
@@ -23,22 +23,22 @@ import { useHasEntitlement } from "@/src/features/entitlements";
import { useRouter } from "next/router";
import { SettingsDangerZone } from "@/src/components/SettingsDangerZone";
import { ActionButton } from "@/src/components/ActionButton";
-import { BatchExportsSettingsPage } from "@/src/features/batch-exports/components/BatchExportsSettingsPage";
+import { BatchExportsSettingsPage } from "@/src/features/batch-exports";
import { BatchActionsSettingsPage } from "@/src/features/batch-actions";
-import { AuditLogsSettingsPage } from "@/src/ee/features/audit-log-viewer/AuditLogsSettingsPage";
+import { AuditLogsSettingsPage } from "@/src/ee/features/audit-log-viewer";
import { ModelsSettings } from "@/src/features/models";
import ConfigureRetention from "@/src/features/projects/components/ConfigureRetention";
import ContainerPage from "@/src/components/layouts/container-page";
import { NoDataOrLoading } from "@/src/components/NoDataOrLoading";
import { ProtectedLabelsSettings } from "@/src/features/prompts";
import { SiSlack } from "react-icons/si";
-import { ScoreConfigSettings } from "@/src/features/score-configs/components/ScoreConfigSettings";
+import { ScoreConfigSettings } from "@/src/features/score-configs";
import { env } from "@/src/env.mjs";
import { PersonalNotificationSettings } from "@/src/features/notifications/components/PersonalNotificationSettings";
import { ProjectNotificationChannels } from "@/src/features/notifications/components/ProjectNotificationChannels";
import useSessionStorage from "@/src/components/useSessionStorage";
import { WebCalloutIntegrationCard } from "@/src/features/web-callouts";
-import { DeveloperToolsSettings } from "@/src/features/developer-tools/components/DeveloperToolsSettings";
+import { DeveloperToolsSettings } from "@/src/features/developer-tools";
import { useV4UpgradeUiFlag } from "@/src/features/v4-migration/useV4UpgradeUiEnabled";
import { api } from "@/src/utils/api";
diff --git a/web/src/features/prompts/server/routers/promptRouter.ts b/web/src/features/prompts/server/routers/promptRouter.ts
index 88b077bcbe..ea9cc567f1 100644
--- a/web/src/features/prompts/server/routers/promptRouter.ts
+++ b/web/src/features/prompts/server/routers/promptRouter.ts
@@ -48,7 +48,7 @@ import {
getAggregatedScoresForPromptsFromEvents,
postgresSearchCondition,
} from "@langfuse/shared/src/server";
-import { aggregateScores } from "@/src/features/scores/lib/aggregateScores";
+import { aggregateScores } from "@/src/features/scores/server";
import { TRPCError } from "@trpc/server";
import { promptChangeEventSourcing } from "@/src/features/prompts/server/promptChangeEventSourcing";
diff --git a/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx b/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
index 9fcaa75ffb..9fea3fa26f 100644
--- a/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
+++ b/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
@@ -43,8 +43,7 @@ import {
AuthMethod,
BedrockAuthMethodSchema,
type BedrockAuthMethod,
-} from "@/src/features/llm-api-key/types";
-
+} from "@/src/features/llm-api-key";
const isLangfuseCloud = Boolean(env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION);
/**
diff --git a/web/src/features/public-api/server/enforceAuth.ts b/web/src/features/public-api/server/enforceAuth.ts
index 2cc7b90ef6..2a3052351b 100644
--- a/web/src/features/public-api/server/enforceAuth.ts
+++ b/web/src/features/public-api/server/enforceAuth.ts
@@ -10,7 +10,7 @@ import { type ApiAccessScope } from "@langfuse/shared/src/server";
import { prisma } from "@langfuse/shared/src/db";
import { authorize } from "@/src/features/auth/policy/authorize";
-import { authenticator } from "@/src/features/apiKey/authenticator";
+import { authenticator } from "@/src/features/apiKey/server";
import { toApiAccessScope } from "@/src/features/public-api/server/toApiAccessScope";
import {
forbiddenError,
diff --git a/web/src/features/public-api/server/score-configs-api-service.ts b/web/src/features/public-api/server/score-configs-api-service.ts
index 0999cb98bc..72013b2ecd 100644
--- a/web/src/features/public-api/server/score-configs-api-service.ts
+++ b/web/src/features/public-api/server/score-configs-api-service.ts
@@ -1,6 +1,6 @@
import { v4 } from "uuid";
import { type z } from "zod";
-import { isBooleanDataType } from "@/src/features/scores/lib/helpers";
+import { isBooleanDataType } from "@/src/features/scores/server";
import {
InvalidRequestError,
LangfuseNotFoundError,
diff --git a/web/src/features/public-api/types/blob-storage-integrations.ts b/web/src/features/public-api/types/blob-storage-integrations.ts
index 52e0ee4126..aae661946e 100644
--- a/web/src/features/public-api/types/blob-storage-integrations.ts
+++ b/web/src/features/public-api/types/blob-storage-integrations.ts
@@ -10,8 +10,7 @@ import {
validateExportFieldGroups,
exportStartDateNotInFuture,
EXPORT_START_DATE_FUTURE_ERROR,
-} from "@/src/features/blobstorage-integration/validation";
-
+} from "@/src/features/blobstorage-integration";
/**
* Enums
*/
diff --git a/web/src/features/score-configs/index.ts b/web/src/features/score-configs/index.ts
new file mode 100644
index 0000000000..a050804f9a
--- /dev/null
+++ b/web/src/features/score-configs/index.ts
@@ -0,0 +1 @@
+export { ScoreConfigSettings } from "@/src/features/score-configs/components/ScoreConfigSettings";
diff --git a/web/src/features/scores-chart-view/index.ts b/web/src/features/scores-chart-view/index.ts
index 067b4a4f69..135fd03062 100644
--- a/web/src/features/scores-chart-view/index.ts
+++ b/web/src/features/scores-chart-view/index.ts
@@ -4,3 +4,4 @@
export { ScoresChartView } from "@/src/features/scores-chart-view/components/ScoresChartView";
export { ScoresOutlierStrip } from "@/src/features/scores-chart-view/components/ScoresOutlierStrip";
export { useScoresChartViewState } from "@/src/features/scores-chart-view/hooks/useScoresChartViewState";
+export { getScoreChartTimeRange } from "@/src/features/scores-chart-view/fns/scoreChartConfig";
diff --git a/web/src/features/scores/ScoresTable.tsx b/web/src/features/scores/ScoresTable.tsx
index 264cacc2f5..d562d1fd41 100644
--- a/web/src/features/scores/ScoresTable.tsx
+++ b/web/src/features/scores/ScoresTable.tsx
@@ -50,7 +50,12 @@ import {
import { isNumericDataType } from "@/src/features/scores/lib/helpers";
import { ScoresSearchBar } from "@/src/features/scores/components/ScoresSearchBar";
-import { getScoreChartTimeRange } from "@/src/features/scores-chart-view/fns/scoreChartConfig";
+import {
+ getScoreChartTimeRange,
+ ScoresChartView,
+ ScoresOutlierStrip,
+ useScoresChartViewState,
+} from "@/src/features/scores-chart-view";
import { useOrderByState } from "@/src/features/orderBy";
import { useTableDateRange } from "@/src/hooks/useTableDateRange";
import { toAbsoluteTimeRange } from "@/src/utils/date-range-utils";
@@ -89,11 +94,6 @@ import {
type ScoreLevel,
} from "@/src/components/score-tag";
import { ViewModeToggle } from "@/src/features/chart-view";
-import {
- ScoresChartView,
- ScoresOutlierStrip,
- useScoresChartViewState,
-} from "@/src/features/scores-chart-view";
export type ScoresTableRow = {
id: string;
diff --git a/web/src/features/scores/server/index.ts b/web/src/features/scores/server/index.ts
new file mode 100644
index 0000000000..1ce33ddf6a
--- /dev/null
+++ b/web/src/features/scores/server/index.ts
@@ -0,0 +1,12 @@
+// Dual-use scores helpers for server callers (RFC rule 8 / rule 10).
+// The client door already re-exports these for UI; tRPC routers and public
+// API services reach them here so they do not load AnnotationForm / ScoresTable.
+export {
+ aggregateScores,
+ composeAggregateScoreKey,
+} from "@/src/features/scores/lib/aggregateScores";
+export {
+ isBooleanDataType,
+ isNumericDataType,
+ isTraceScore,
+} from "@/src/features/scores/lib/helpers";
diff --git a/web/src/features/search-bar/server/resolveFilterPrompt.ts b/web/src/features/search-bar/server/resolveFilterPrompt.ts
index 5c7fc14162..7527fc42fa 100644
--- a/web/src/features/search-bar/server/resolveFilterPrompt.ts
+++ b/web/src/features/search-bar/server/resolveFilterPrompt.ts
@@ -44,7 +44,7 @@ import {
logger,
} from "@langfuse/shared/src/server";
import type { ChatPromptClient } from "langfuse";
-import { getLangfuseClient } from "@/src/features/natural-language-filters/server/utils";
+import { getLangfuseClient } from "@/src/features/natural-language-filters/server";
import {
buildFieldCatalog,
buildFilterSystemPrompt,
diff --git a/web/src/features/traces/components/TraceMessagesView/TraceMessagesView.tsx b/web/src/features/traces/components/TraceMessagesView/TraceMessagesView.tsx
index bdfd8fe909..f3d78dd1fe 100644
--- a/web/src/features/traces/components/TraceMessagesView/TraceMessagesView.tsx
+++ b/web/src/features/traces/components/TraceMessagesView/TraceMessagesView.tsx
@@ -13,7 +13,7 @@ import type { NormalizedMessage } from "@langfuse/shared/src/utils/normalized-io
import { api, type RouterOutputs } from "@/src/utils/api";
import { Button } from "@/src/components/ui/button";
import { useMarkdownRenderCharacterLimit } from "@/src/hooks/useMarkdownRenderCharacterLimit";
-import { type MediaReturnType } from "@/src/features/media/validation";
+import { type MediaReturnType } from "@/src/features/media";
import { ChatMessageList } from "@/src/features/traces/components/ChatMessageList";
import { useSelection } from "@/src/features/traces/contexts/SelectionContext";
import { useTraceData } from "@/src/features/traces/contexts/TraceDataContext";
diff --git a/web/src/features/traces/components/TracePanelNavigation.tsx b/web/src/features/traces/components/TracePanelNavigation.tsx
index fe626c7e86..95825ca231 100644
--- a/web/src/features/traces/components/TracePanelNavigation.tsx
+++ b/web/src/features/traces/components/TracePanelNavigation.tsx
@@ -25,7 +25,7 @@ import { TraceSearchList } from "./TraceSearchList";
import { TraceTimelineCompact } from "./TraceTimelineDense/TraceTimelineCompact";
import { TraceGraphView } from "./TraceGraphView/TraceGraphView";
import { TraceMessagesView } from "./TraceMessagesView/TraceMessagesView";
-import useIsFeatureEnabled from "@/src/features/feature-flags/hooks/useIsFeatureEnabled";
+import { useIsFeatureEnabled } from "@/src/features/feature-flags";
import { useReadPath } from "@/src/features/events";
import { useMemo } from "react";
diff --git a/web/src/features/traces/components/TracePanelNavigationHeader/TracePanelNavigationHeader.tsx b/web/src/features/traces/components/TracePanelNavigationHeader/TracePanelNavigationHeader.tsx
index 93f9e47924..2909504672 100644
--- a/web/src/features/traces/components/TracePanelNavigationHeader/TracePanelNavigationHeader.tsx
+++ b/web/src/features/traces/components/TracePanelNavigationHeader/TracePanelNavigationHeader.tsx
@@ -21,7 +21,7 @@ import {
TooltipTrigger,
} from "@/src/components/ui/tooltip";
import { useReadPath } from "@/src/features/events";
-import useIsFeatureEnabled from "@/src/features/feature-flags/hooks/useIsFeatureEnabled";
+import { useIsFeatureEnabled } from "@/src/features/feature-flags";
import { Command, CommandInput } from "@/src/components/ui/command";
import { Button } from "@/src/components/ui/button";
import {
diff --git a/web/src/features/v4-migration/hooks/useV4MigrationData.ts b/web/src/features/v4-migration/hooks/useV4MigrationData.ts
index cd11516428..01ad45b91a 100644
--- a/web/src/features/v4-migration/hooks/useV4MigrationData.ts
+++ b/web/src/features/v4-migration/hooks/useV4MigrationData.ts
@@ -3,7 +3,7 @@ import {
countActionableLegacyApiEntrypoints,
isActionableLegacyApiUsage,
normalizeLegacyApiEntrypoint,
-} from "@/src/features/v4/utils";
+} from "@/src/features/v4";
import {
getLegacyIntegrationLabels,
getMigrationActionState,
diff --git a/web/src/features/v4/index.ts b/web/src/features/v4/index.ts
new file mode 100644
index 0000000000..3bcd2f4876
--- /dev/null
+++ b/web/src/features/v4/index.ts
@@ -0,0 +1,5 @@
+export {
+ countActionableLegacyApiEntrypoints,
+ isActionableLegacyApiUsage,
+ normalizeLegacyApiEntrypoint,
+} from "@/src/features/v4/utils";
diff --git a/web/src/features/v4/server/index.ts b/web/src/features/v4/server/index.ts
new file mode 100644
index 0000000000..b463fe6d57
--- /dev/null
+++ b/web/src/features/v4/server/index.ts
@@ -0,0 +1 @@
+export { getProjectV4MigrationData } from "@/src/features/v4/server/v4TransitionService";
diff --git a/web/src/features/widgets/components/WidgetForm.tsx b/web/src/features/widgets/components/WidgetForm.tsx
index f6e24160a0..9cb1098f9e 100644
--- a/web/src/features/widgets/components/WidgetForm.tsx
+++ b/web/src/features/widgets/components/WidgetForm.tsx
@@ -55,7 +55,7 @@ import { useReadPath } from "@/src/features/events";
import { Input } from "@/src/components/ui/input";
import startCase from "lodash/startCase";
import { DatePickerWithRange } from "@/src/components/date-picker";
-import { MetricsFilterBuilder } from "@/src/features/metrics/components/MetricsFilterBuilder";
+import { MetricsFilterBuilder } from "@/src/features/metrics";
import { useDashboardDateRange } from "@/src/hooks/useDashboardDateRange";
import {
toAbsoluteTimeRange,
diff --git a/web/src/initialize.ts b/web/src/initialize.ts
index 224996d522..dbd27c8857 100644
--- a/web/src/initialize.ts
+++ b/web/src/initialize.ts
@@ -2,7 +2,7 @@ import { env } from "@/src/env.mjs";
import { createUserEmailPassword } from "@/src/features/auth-credentials/lib/credentialsServerUtils";
import { prisma } from "@langfuse/shared/src/db";
import { createAndAddApiKeysToDb } from "@langfuse/shared/src/server/auth/apiKeys";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
import { getOrganizationPlanServerSide } from "@/src/features/entitlements/server/getPlan";
import { CloudConfigSchema } from "@langfuse/shared";
import {
diff --git a/web/src/pages/api/admin/api-keys/index.ts b/web/src/pages/api/admin/api-keys/index.ts
index 71cee91436..160cfe4c4a 100644
--- a/web/src/pages/api/admin/api-keys/index.ts
+++ b/web/src/pages/api/admin/api-keys/index.ts
@@ -7,8 +7,7 @@ import {
redis,
} from "@langfuse/shared/src/server";
import { ApiAuthService } from "@/src/features/public-api/server/apiAuth";
-import { AdminApiAuthService } from "@/src/ee/features/admin-api/server/adminApiAuth";
-
+import { AdminApiAuthService } from "@/src/ee/features/admin-api/server";
/*
This API route is used by Langfuse Cloud to delete API keys for a project.
We will work on admin APIs in the future. See the discussion here: https://github.com/orgs/langfuse/discussions/3243
diff --git a/web/src/pages/api/admin/bullmq/index.ts b/web/src/pages/api/admin/bullmq/index.ts
index 15d69377e9..3b32244b89 100644
--- a/web/src/pages/api/admin/bullmq/index.ts
+++ b/web/src/pages/api/admin/bullmq/index.ts
@@ -15,8 +15,7 @@ import {
OtelIngestionQueue,
SecondaryOtelIngestionQueue,
} from "@langfuse/shared/src/server";
-import { AdminApiAuthService } from "@/src/ee/features/admin-api/server/adminApiAuth";
-
+import { AdminApiAuthService } from "@/src/ee/features/admin-api/server";
/*
This API route is used by Langfuse Cloud to retry failed bullmq jobs.
*/
diff --git a/web/src/pages/api/admin/ingestion-replay.ts b/web/src/pages/api/admin/ingestion-replay.ts
index 15f6dbc5fc..930b274344 100644
--- a/web/src/pages/api/admin/ingestion-replay.ts
+++ b/web/src/pages/api/admin/ingestion-replay.ts
@@ -13,8 +13,7 @@ import {
type QueueName,
type TQueueJobTypes,
} from "@langfuse/shared/src/server";
-import { AdminApiAuthService } from "@/src/ee/features/admin-api/server/adminApiAuth";
-
+import { AdminApiAuthService } from "@/src/ee/features/admin-api/server";
const IngestionReplayBody = z.object({
keys: z.array(z.string()).min(1).max(1000),
});
diff --git a/web/src/pages/api/admin/organizations/[organizationId]/apiKeys/[apiKeyId].ts b/web/src/pages/api/admin/organizations/[organizationId]/apiKeys/[apiKeyId].ts
index 395f8df263..044ec4a458 100644
--- a/web/src/pages/api/admin/organizations/[organizationId]/apiKeys/[apiKeyId].ts
+++ b/web/src/pages/api/admin/organizations/[organizationId]/apiKeys/[apiKeyId].ts
@@ -1,12 +1,12 @@
import { type NextApiRequest, type NextApiResponse } from "next";
import { logger } from "@langfuse/shared/src/server";
-import { AdminApiAuthService } from "@/src/ee/features/admin-api/server/adminApiAuth";
+import { AdminApiAuthService } from "@/src/ee/features/admin-api/server";
import {
validateQueryParams,
handleDeleteApiKey,
} from "@/src/ee/features/admin-api/server/organizations/apiKeys/apiKeyById";
import { prisma } from "@langfuse/shared/src/db";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
import { getSelfHostedInstancePlanServerSide } from "@/src/features/entitlements/server/getPlan";
export default async function handler(
diff --git a/web/src/pages/api/admin/organizations/[organizationId]/apiKeys/index.ts b/web/src/pages/api/admin/organizations/[organizationId]/apiKeys/index.ts
index 40afffe13e..d0eeca7e63 100644
--- a/web/src/pages/api/admin/organizations/[organizationId]/apiKeys/index.ts
+++ b/web/src/pages/api/admin/organizations/[organizationId]/apiKeys/index.ts
@@ -1,13 +1,13 @@
import { type NextApiRequest, type NextApiResponse } from "next";
import { logger } from "@langfuse/shared/src/server";
-import { AdminApiAuthService } from "@/src/ee/features/admin-api/server/adminApiAuth";
+import { AdminApiAuthService } from "@/src/ee/features/admin-api/server";
import {
validateQueryAndExtractId,
handleGetApiKeys,
handleCreateApiKey,
} from "@/src/ee/features/admin-api/server/organizations/apiKeys";
import { prisma } from "@langfuse/shared/src/db";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
import { getSelfHostedInstancePlanServerSide } from "@/src/features/entitlements/server/getPlan";
export default async function handler(
diff --git a/web/src/pages/api/admin/organizations/[organizationId]/index.ts b/web/src/pages/api/admin/organizations/[organizationId]/index.ts
index 894bc8a1a4..ef255b3fef 100644
--- a/web/src/pages/api/admin/organizations/[organizationId]/index.ts
+++ b/web/src/pages/api/admin/organizations/[organizationId]/index.ts
@@ -1,12 +1,12 @@
import { type NextApiRequest, type NextApiResponse } from "next";
import { logger } from "@langfuse/shared/src/server";
-import { AdminApiAuthService } from "@/src/ee/features/admin-api/server/adminApiAuth";
+import { AdminApiAuthService } from "@/src/ee/features/admin-api/server";
import {
handleGetOrganizationById,
handleUpdateOrganization,
handleDeleteOrganization,
} from "@/src/ee/features/admin-api/server/organizations/organizationById";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
import { getSelfHostedInstancePlanServerSide } from "@/src/features/entitlements/server/getPlan";
export default async function handler(
diff --git a/web/src/pages/api/admin/organizations/index.ts b/web/src/pages/api/admin/organizations/index.ts
index ecfe640d03..9f4da4c328 100644
--- a/web/src/pages/api/admin/organizations/index.ts
+++ b/web/src/pages/api/admin/organizations/index.ts
@@ -1,11 +1,11 @@
import { type NextApiRequest, type NextApiResponse } from "next";
import { logger } from "@langfuse/shared/src/server";
-import { AdminApiAuthService } from "@/src/ee/features/admin-api/server/adminApiAuth";
+import { AdminApiAuthService } from "@/src/ee/features/admin-api/server";
import {
handleGetOrganizations,
handleCreateOrganization,
} from "@/src/ee/features/admin-api/server/organizations";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
import { getSelfHostedInstancePlanServerSide } from "@/src/features/entitlements/server/getPlan";
export default async function handler(
diff --git a/web/src/pages/api/auth/signup-verify.ts b/web/src/pages/api/auth/signup-verify.ts
index 650e0856cf..5bfe192d7a 100644
--- a/web/src/pages/api/auth/signup-verify.ts
+++ b/web/src/pages/api/auth/signup-verify.ts
@@ -1,5 +1,5 @@
import { env } from "@/src/env.mjs";
-import { isEmailVerificationRequired } from "@/src/features/auth-credentials/lib/credentialsUtils";
+import { isEmailVerificationRequired } from "@/src/features/auth-credentials";
import { validateSignupEligibility } from "@/src/features/auth-credentials/server/signupApiHandler";
import { createProjectMembershipsOnSignup } from "@/src/features/auth/lib/createProjectMembershipsOnSignup";
import { getAdClickIdsFromRequest } from "@/src/features/auth/lib/signupAttribution";
diff --git a/web/src/pages/api/public/experiment-items/index.ts b/web/src/pages/api/public/experiment-items/index.ts
index c246ca15a0..d6cdb97ca6 100644
--- a/web/src/pages/api/public/experiment-items/index.ts
+++ b/web/src/pages/api/public/experiment-items/index.ts
@@ -8,8 +8,7 @@ import {
GetExperimentItemsV1Response,
} from "@/src/features/public-api/types/experiments";
import { listExperimentItemsForPublicApi } from "@/src/features/experiments/server/public";
-import { clampToDataAccessDays } from "@/src/features/entitlements/server/hasEntitlementLimit";
-
+import { clampToDataAccessDays } from "@/src/features/entitlements/server";
export default withMiddlewares({
GET: createAuthedProjectAPIRoute({
name: "Get Experiment Items",
diff --git a/web/src/pages/api/public/experiments/index.ts b/web/src/pages/api/public/experiments/index.ts
index 674d797862..b5e3bdc0f4 100644
--- a/web/src/pages/api/public/experiments/index.ts
+++ b/web/src/pages/api/public/experiments/index.ts
@@ -8,8 +8,7 @@ import {
GetExperimentsV1Response,
} from "@/src/features/public-api/types/experiments";
import { listExperimentsForPublicApi } from "@/src/features/experiments/server/public";
-import { clampToDataAccessDays } from "@/src/features/entitlements/server/hasEntitlementLimit";
-
+import { clampToDataAccessDays } from "@/src/features/entitlements/server";
export default withMiddlewares({
GET: createAuthedProjectAPIRoute({
name: "Get Experiments",
diff --git a/web/src/pages/api/public/integrations/blob-storage/[id].ts b/web/src/pages/api/public/integrations/blob-storage/[id].ts
index 917ec9ffa8..93a0aadbac 100644
--- a/web/src/pages/api/public/integrations/blob-storage/[id].ts
+++ b/web/src/pages/api/public/integrations/blob-storage/[id].ts
@@ -1,7 +1,7 @@
import { withMiddlewares } from "@/src/features/public-api/server/withMiddlewares";
import { prisma } from "@langfuse/shared/src/db";
import { type NextApiRequest, type NextApiResponse } from "next";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import { InvalidRequestError, LangfuseNotFoundError } from "@langfuse/shared";
import type { BlobStorageIntegrationStatusResponseType } from "@/src/features/public-api/types/blob-storage-integrations";
import { deriveSyncStatus } from "@/src/features/blobstorage-integration/deriveSyncStatus";
diff --git a/web/src/pages/api/public/integrations/blob-storage/index.ts b/web/src/pages/api/public/integrations/blob-storage/index.ts
index 4634630436..39c5b7986a 100644
--- a/web/src/pages/api/public/integrations/blob-storage/index.ts
+++ b/web/src/pages/api/public/integrations/blob-storage/index.ts
@@ -13,7 +13,7 @@ import {
} from "@langfuse/shared";
import { upsertBlobStorageIntegration } from "@/src/features/blobstorage-integration/service";
import { resolveExportSource } from "@/src/features/analytics-integrations/server";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import { authorizeBlobStorageRequest } from "@/src/features/blobstorage-integration/authorizeBlobStorageRequest";
export default withMiddlewares({
diff --git a/web/src/pages/api/public/llm-connections/[id].ts b/web/src/pages/api/public/llm-connections/[id].ts
index 12ebe3cf51..d9ff1a5908 100644
--- a/web/src/pages/api/public/llm-connections/[id].ts
+++ b/web/src/pages/api/public/llm-connections/[id].ts
@@ -5,7 +5,7 @@ import {
DeleteLlmConnectionV1Query,
DeleteLlmConnectionV1Response,
} from "@/src/features/public-api/types/llm-connections";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import { EvaluatorBlockReason, LangfuseNotFoundError } from "@langfuse/shared";
import {
blockEvaluatorsUsingDefaultModel,
diff --git a/web/src/pages/api/public/llm-connections/index.ts b/web/src/pages/api/public/llm-connections/index.ts
index 231bdbcb96..b2bba797f6 100644
--- a/web/src/pages/api/public/llm-connections/index.ts
+++ b/web/src/pages/api/public/llm-connections/index.ts
@@ -10,7 +10,7 @@ import {
} from "@/src/features/public-api/types/llm-connections";
import { encrypt } from "@langfuse/shared/encryption";
import { getDisplaySecretKey } from "@/src/features/llm-api-key/server/router";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import {
InvalidRequestError,
BEDROCK_USE_DEFAULT_CREDENTIALS,
diff --git a/web/src/pages/api/public/metrics/daily.ts b/web/src/pages/api/public/metrics/daily.ts
index 86b626841d..c4ccdaa097 100644
--- a/web/src/pages/api/public/metrics/daily.ts
+++ b/web/src/pages/api/public/metrics/daily.ts
@@ -9,8 +9,7 @@ import {
getDailyMetricsCount,
} from "@/src/features/public-api/server/dailyMetrics";
import { METRICS_DEPRECATION } from "@/src/features/public-api/server/deprecations";
-import { clampToDataAccessDays } from "@/src/features/entitlements/server/hasEntitlementLimit";
-
+import { clampToDataAccessDays } from "@/src/features/entitlements/server";
export default withMiddlewares({
GET: createAuthedProjectAPIRoute({
name: "Get Daily Metrics",
diff --git a/web/src/pages/api/public/metrics/index.ts b/web/src/pages/api/public/metrics/index.ts
index c4ebfee92d..7b32347dc7 100644
--- a/web/src/pages/api/public/metrics/index.ts
+++ b/web/src/pages/api/public/metrics/index.ts
@@ -10,7 +10,7 @@ import {
} from "@/src/features/public-api/types/metrics";
import { executeQuery } from "@langfuse/shared/query/server";
import { METRICS_DEPRECATION } from "@/src/features/public-api/server/deprecations";
-import { clampToDataAccessDays } from "@/src/features/entitlements/server/hasEntitlementLimit";
+import { clampToDataAccessDays } from "@/src/features/entitlements/server";
export default withMiddlewares(
{
GET: createAuthedProjectAPIRoute({
diff --git a/web/src/pages/api/public/observations/index.ts b/web/src/pages/api/public/observations/index.ts
index 4ba7bcb30c..99d2862381 100644
--- a/web/src/pages/api/public/observations/index.ts
+++ b/web/src/pages/api/public/observations/index.ts
@@ -21,8 +21,7 @@ import {
} from "@/src/features/public-api/server/observations";
import { legacyPublicApiRateLimitUpgradePaths } from "@/src/features/public-api/server/rateLimitUpgradePaths";
import { OBSERVATIONS_V1_DEPRECATION } from "@/src/features/public-api/server/deprecations";
-import { clampToDataAccessDays } from "@/src/features/entitlements/server/hasEntitlementLimit";
-
+import { clampToDataAccessDays } from "@/src/features/entitlements/server";
export default withMiddlewares(
{
GET: createAuthedProjectAPIRoute({
diff --git a/web/src/pages/api/public/organizations/apiKeys/index.ts b/web/src/pages/api/public/organizations/apiKeys/index.ts
index 55895eb196..7993f4cd0d 100644
--- a/web/src/pages/api/public/organizations/apiKeys/index.ts
+++ b/web/src/pages/api/public/organizations/apiKeys/index.ts
@@ -4,8 +4,7 @@ import { RateLimitService } from "@/src/features/public-api/server/RateLimitServ
import { handleGetApiKeys } from "@/src/ee/features/admin-api/server/organizations/apiKeys";
import { shadowAuth, writeOrgError } from "@/src/features/public-api/server";
import { type NextApiRequest, type NextApiResponse } from "next";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
-
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
export default async function handler(
req: NextApiRequest,
res: NextApiResponse,
diff --git a/web/src/pages/api/public/organizations/memberships/index.ts b/web/src/pages/api/public/organizations/memberships/index.ts
index a9c6fcdb15..cd28b0b4de 100644
--- a/web/src/pages/api/public/organizations/memberships/index.ts
+++ b/web/src/pages/api/public/organizations/memberships/index.ts
@@ -8,8 +8,7 @@ import {
} from "@/src/ee/features/admin-api/server/memberships";
import { shadowAuth, writeOrgError } from "@/src/features/public-api/server";
import { type NextApiRequest, type NextApiResponse } from "next";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
-
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
export default async function handler(
req: NextApiRequest,
res: NextApiResponse,
diff --git a/web/src/pages/api/public/organizations/projects/index.ts b/web/src/pages/api/public/organizations/projects/index.ts
index fd6c37b32c..dc760df635 100644
--- a/web/src/pages/api/public/organizations/projects/index.ts
+++ b/web/src/pages/api/public/organizations/projects/index.ts
@@ -4,8 +4,7 @@ import { RateLimitService } from "@/src/features/public-api/server/RateLimitServ
import { handleGetProjects } from "@/src/ee/features/admin-api/server/projects";
import { shadowAuth, writeOrgError } from "@/src/features/public-api/server";
import { type NextApiRequest, type NextApiResponse } from "next";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
-
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
export default async function handler(
req: NextApiRequest,
res: NextApiResponse,
diff --git a/web/src/pages/api/public/projects/[projectId]/apiKeys/[apiKeyId].ts b/web/src/pages/api/public/projects/[projectId]/apiKeys/[apiKeyId].ts
index 111221c125..6a205abc56 100644
--- a/web/src/pages/api/public/projects/[projectId]/apiKeys/[apiKeyId].ts
+++ b/web/src/pages/api/public/projects/[projectId]/apiKeys/[apiKeyId].ts
@@ -7,7 +7,7 @@ import {
validateQueryParams,
handleDeleteApiKey,
} from "@/src/ee/features/admin-api/server/projects/projectById/apiKeys/apiKeyById";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
import {
shadowAuth,
writeProjectError,
diff --git a/web/src/pages/api/public/projects/[projectId]/apiKeys/index.ts b/web/src/pages/api/public/projects/[projectId]/apiKeys/index.ts
index 6101d11633..5c3447fa87 100644
--- a/web/src/pages/api/public/projects/[projectId]/apiKeys/index.ts
+++ b/web/src/pages/api/public/projects/[projectId]/apiKeys/index.ts
@@ -8,7 +8,7 @@ import {
handleGetApiKeys,
handleCreateApiKey,
} from "@/src/ee/features/admin-api/server/projects/projectById/apiKeys";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
import {
shadowAuth,
writeProjectError,
diff --git a/web/src/pages/api/public/projects/[projectId]/index.ts b/web/src/pages/api/public/projects/[projectId]/index.ts
index f1865a1a83..81f00f93b4 100644
--- a/web/src/pages/api/public/projects/[projectId]/index.ts
+++ b/web/src/pages/api/public/projects/[projectId]/index.ts
@@ -5,7 +5,7 @@ import {
handleUpdateProject,
handleDeleteProject,
} from "@/src/ee/features/admin-api/server/projects/projectById";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
import { type NextApiRequest, type NextApiResponse } from "next";
import {
shadowAuth,
diff --git a/web/src/pages/api/public/projects/[projectId]/memberships/index.ts b/web/src/pages/api/public/projects/[projectId]/memberships/index.ts
index 85322e8362..e0a83f4dd4 100644
--- a/web/src/pages/api/public/projects/[projectId]/memberships/index.ts
+++ b/web/src/pages/api/public/projects/[projectId]/memberships/index.ts
@@ -1,7 +1,7 @@
import { cors, runMiddleware } from "@/src/features/public-api/server/cors";
import { prisma } from "@langfuse/shared/src/db";
import { logger } from "@langfuse/shared/src/server";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
import {
handleGetMemberships,
handleUpdateMembership,
diff --git a/web/src/pages/api/public/projects/index.ts b/web/src/pages/api/public/projects/index.ts
index e5b73ea0d0..384db3ce08 100644
--- a/web/src/pages/api/public/projects/index.ts
+++ b/web/src/pages/api/public/projects/index.ts
@@ -3,7 +3,7 @@ import { prisma } from "@langfuse/shared/src/db";
import { logger } from "@langfuse/shared/src/server";
import { handleCreateProject } from "@/src/ee/features/admin-api/server/projects/createProject";
import { type NextApiRequest, type NextApiResponse } from "next";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
import {
shadowAuth,
writeProjectError,
diff --git a/web/src/pages/api/public/scim/Users/[id].ts b/web/src/pages/api/public/scim/Users/[id].ts
index 6fc5519857..d9fcefd3ce 100644
--- a/web/src/pages/api/public/scim/Users/[id].ts
+++ b/web/src/pages/api/public/scim/Users/[id].ts
@@ -1,11 +1,11 @@
import { cors, runMiddleware } from "@/src/features/public-api/server/cors";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import { Prisma, prisma, type User, type Role } from "@langfuse/shared/src/db";
import { logger } from "@langfuse/shared/src/server";
import { z } from "zod";
import { type NextApiRequest, type NextApiResponse } from "next";
import { getSfdcService } from "@/src/ee/features/sfdc-sync/server";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
import { shadowAuth, writeScimError } from "@/src/features/public-api/server";
// Parse the first valid role from a SCIM `roles` array. Returns undefined when
diff --git a/web/src/pages/api/public/scim/Users/index.ts b/web/src/pages/api/public/scim/Users/index.ts
index e6924751f4..b45cbfb1d6 100644
--- a/web/src/pages/api/public/scim/Users/index.ts
+++ b/web/src/pages/api/public/scim/Users/index.ts
@@ -5,9 +5,9 @@ import { logger } from "@langfuse/shared/src/server";
import { type NextApiRequest, type NextApiResponse } from "next";
import { z } from "zod";
import { type Role } from "@langfuse/shared";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import { getSfdcService } from "@/src/ee/features/sfdc-sync/server";
-import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";
+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server";
import { shadowAuth, writeScimError } from "@/src/features/public-api/server";
export default async function handler(
req: NextApiRequest,
diff --git a/web/src/pages/api/public/scores/index.ts b/web/src/pages/api/public/scores/index.ts
index eebef065b1..fb69bda361 100644
--- a/web/src/pages/api/public/scores/index.ts
+++ b/web/src/pages/api/public/scores/index.ts
@@ -15,8 +15,7 @@ import {
import { ScoresApiService } from "@/src/features/public-api/server/scores-api-service";
import { SCORES_DEPRECATION } from "@/src/features/public-api/server/deprecations";
import { randomUUID } from "crypto";
-import { clampToDataAccessDays } from "@/src/features/entitlements/server/hasEntitlementLimit";
-
+import { clampToDataAccessDays } from "@/src/features/entitlements/server";
export default withMiddlewares({
POST: createAuthedProjectAPIRoute({
name: "Create Score",
diff --git a/web/src/pages/api/public/sessions/index.ts b/web/src/pages/api/public/sessions/index.ts
index 8e55f85616..a802071dc0 100644
--- a/web/src/pages/api/public/sessions/index.ts
+++ b/web/src/pages/api/public/sessions/index.ts
@@ -8,8 +8,7 @@ import { withMiddlewares } from "@/src/features/public-api/server/withMiddleware
import { createAuthedProjectAPIRoute } from "@/src/features/public-api/server/createAuthedProjectAPIRoute";
import { legacyPublicApiRateLimitUpgradePaths } from "@/src/features/public-api/server/rateLimitUpgradePaths";
import { SESSIONS_DEPRECATION } from "@/src/features/public-api/server/deprecations";
-import { clampToDataAccessDays } from "@/src/features/entitlements/server/hasEntitlementLimit";
-
+import { clampToDataAccessDays } from "@/src/features/entitlements/server";
export default withMiddlewares({
GET: createAuthedProjectAPIRoute({
name: "Get Sessions",
diff --git a/web/src/pages/api/public/traces/[traceId].ts b/web/src/pages/api/public/traces/[traceId].ts
index 5f836756d8..25e75d79a5 100644
--- a/web/src/pages/api/public/traces/[traceId].ts
+++ b/web/src/pages/api/public/traces/[traceId].ts
@@ -27,7 +27,7 @@ import {
traceDeletionProcessor,
} from "@langfuse/shared/src/server";
import Decimal from "decimal.js";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import { legacyPublicApiRateLimitUpgradePaths } from "@/src/features/public-api/server/rateLimitUpgradePaths";
import { TRACES_DEPRECATION } from "@/src/features/public-api/server/deprecations";
diff --git a/web/src/pages/api/public/traces/index.ts b/web/src/pages/api/public/traces/index.ts
index cc739c482e..ebeba8a4e3 100644
--- a/web/src/pages/api/public/traces/index.ts
+++ b/web/src/pages/api/public/traces/index.ts
@@ -25,7 +25,7 @@ import {
} from "@langfuse/shared/src/server";
import { v4 } from "uuid";
import { telemetry } from "@/src/features/telemetry";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import {
generateTracesForPublicApi,
getTracesCountForPublicApi,
@@ -33,8 +33,7 @@ import {
import { env } from "@/src/env.mjs";
import { legacyPublicApiRateLimitUpgradePaths } from "@/src/features/public-api/server/rateLimitUpgradePaths";
import { TRACES_DEPRECATION } from "@/src/features/public-api/server/deprecations";
-import { clampToDataAccessDays } from "@/src/features/entitlements/server/hasEntitlementLimit";
-
+import { clampToDataAccessDays } from "@/src/features/entitlements/server";
export default withMiddlewares(
{
POST: createAuthedProjectAPIRoute({
diff --git a/web/src/pages/api/public/v2/metrics.ts b/web/src/pages/api/public/v2/metrics.ts
index 6ba1e4c491..f7ae14c6a1 100644
--- a/web/src/pages/api/public/v2/metrics.ts
+++ b/web/src/pages/api/public/v2/metrics.ts
@@ -9,7 +9,7 @@ import {
import { InvalidRequestError, LangfuseNotFoundError } from "@langfuse/shared";
import { executeQuery } from "@langfuse/shared/query/server";
import { validateQuery } from "@langfuse/shared/query";
-import { clampToDataAccessDays } from "@/src/features/entitlements/server/hasEntitlementLimit";
+import { clampToDataAccessDays } from "@/src/features/entitlements/server";
const DEFAULT_ROW_LIMIT = 100;
export function isMetricsV2Available(): boolean {
diff --git a/web/src/pages/api/public/v2/observations/index.ts b/web/src/pages/api/public/v2/observations/index.ts
index 486af8374a..6e934e8430 100644
--- a/web/src/pages/api/public/v2/observations/index.ts
+++ b/web/src/pages/api/public/v2/observations/index.ts
@@ -10,8 +10,7 @@ import {
GetObservationsV2Response,
encodeCursor,
} from "@/src/features/public-api/types/observations";
-import { clampToDataAccessDays } from "@/src/features/entitlements/server/hasEntitlementLimit";
-
+import { clampToDataAccessDays } from "@/src/features/entitlements/server";
export default withMiddlewares({
GET: createAuthedProjectAPIRoute({
name: "Get Observations V2",
diff --git a/web/src/pages/api/public/v2/scores/index.ts b/web/src/pages/api/public/v2/scores/index.ts
index dc42e20236..63ad341717 100644
--- a/web/src/pages/api/public/v2/scores/index.ts
+++ b/web/src/pages/api/public/v2/scores/index.ts
@@ -8,8 +8,7 @@ import {
} from "@langfuse/shared";
import { ScoresApiService } from "@/src/features/public-api/server/scores-api-service";
import { SCORES_DEPRECATION } from "@/src/features/public-api/server/deprecations";
-import { clampToDataAccessDays } from "@/src/features/entitlements/server/hasEntitlementLimit";
-
+import { clampToDataAccessDays } from "@/src/features/entitlements/server";
export default withMiddlewares({
GET: createAuthedProjectAPIRoute({
name: "/api/public/scores",
diff --git a/web/src/pages/api/public/v3/scores/index.ts b/web/src/pages/api/public/v3/scores/index.ts
index aa2cab6f48..e83deae72a 100644
--- a/web/src/pages/api/public/v3/scores/index.ts
+++ b/web/src/pages/api/public/v3/scores/index.ts
@@ -3,8 +3,7 @@ import { withMiddlewares } from "@/src/features/public-api/server/withMiddleware
import { GetScoresQueryV3, GetScoresResponseV3 } from "@langfuse/shared";
import { listScoresV3ForPublicApi } from "@/src/features/public-api/server/scores-api-v3";
import { EncodedScoresCursorV3 } from "@/src/features/public-api/types/scores";
-import { clampToDataAccessDays } from "@/src/features/entitlements/server/hasEntitlementLimit";
-
+import { clampToDataAccessDays } from "@/src/features/entitlements/server";
const GetScoresV3Query = GetScoresQueryV3.extend({
cursor: EncodedScoresCursorV3.optional(),
}).superRefine((data, ctx) => {
diff --git a/web/src/server/api/routers/auditLogs.ts b/web/src/server/api/routers/auditLogs.ts
index 1bb638db1d..3ed8cb2b78 100644
--- a/web/src/server/api/routers/auditLogs.ts
+++ b/web/src/server/api/routers/auditLogs.ts
@@ -8,7 +8,7 @@ import {
throwIfNoProjectAccess,
throwIfNoOrganizationAccess,
} from "@/src/features/rbac";
-import { throwIfNoEntitlement } from "@/src/features/entitlements/server/hasEntitlement";
+import { throwIfNoEntitlement } from "@/src/features/entitlements/server";
import { paginationZod } from "@langfuse/shared";
import { AuditLogRecordType, type AuditLog } from "@langfuse/shared/src/db";
diff --git a/web/src/server/api/routers/comments.ts b/web/src/server/api/routers/comments.ts
index e4b0d45e8c..543b5e06b9 100644
--- a/web/src/server/api/routers/comments.ts
+++ b/web/src/server/api/routers/comments.ts
@@ -11,7 +11,7 @@ import {
CreateCommentData,
DeleteCommentData,
} from "@langfuse/shared";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import { TRPCError } from "@trpc/server";
import { validateCommentReferenceObject } from "@/src/features/comments/validateCommentReferenceObject";
import {
diff --git a/web/src/server/api/routers/generations/db/getAllGenerationsSqlQuery.ts b/web/src/server/api/routers/generations/db/getAllGenerationsSqlQuery.ts
index 9008fd1adf..c88ccdde78 100644
--- a/web/src/server/api/routers/generations/db/getAllGenerationsSqlQuery.ts
+++ b/web/src/server/api/routers/generations/db/getAllGenerationsSqlQuery.ts
@@ -1,4 +1,4 @@
-import { aggregateScores } from "@/src/features/scores/lib/aggregateScores";
+import { aggregateScores } from "@/src/features/scores/server";
import {
filterAndValidateDbScoreList,
LISTABLE_SCORE_TYPES,
diff --git a/web/src/server/api/routers/models.ts b/web/src/server/api/routers/models.ts
index 807f3b078d..2135804d37 100644
--- a/web/src/server/api/routers/models.ts
+++ b/web/src/server/api/routers/models.ts
@@ -2,7 +2,7 @@
import { v4 as uuidv4 } from "uuid";
import { z } from "zod";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import { isValidPostgresRegex } from "@/src/features/models/server/isValidPostgresRegex";
import {
GetModelResultSchema,
diff --git a/web/src/server/api/routers/notificationPreferences.ts b/web/src/server/api/routers/notificationPreferences.ts
index 32437d2e7b..555321d7d0 100644
--- a/web/src/server/api/routers/notificationPreferences.ts
+++ b/web/src/server/api/routers/notificationPreferences.ts
@@ -5,8 +5,7 @@ import {
createTRPCRouter,
protectedProjectProcedure,
} from "@/src/server/api/trpc";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
-
+import { auditLog } from "@/src/features/audit-logs/server";
// Use enums from Prisma types to stay in sync with DB schema
const NotificationChannelEnum = z.enum(NotificationChannel);
const NotificationTypeEnum = z.enum(NotificationType);
diff --git a/web/src/server/api/routers/scoreConfigs.ts b/web/src/server/api/routers/scoreConfigs.ts
index ea90960ef3..c6166ee8b4 100644
--- a/web/src/server/api/routers/scoreConfigs.ts
+++ b/web/src/server/api/routers/scoreConfigs.ts
@@ -17,7 +17,7 @@ import {
validateDbScoreConfigSafe,
} from "@langfuse/shared";
import { traceException } from "@langfuse/shared/src/server";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import { appendCategoryToExisting } from "@/src/features/scores/lib/annotationFormHelpers";
const ScoreConfigAllInput = z.object({
diff --git a/web/src/server/api/routers/scores.ts b/web/src/server/api/routers/scores.ts
index 192ad1eec7..c00d2086bc 100644
--- a/web/src/server/api/routers/scores.ts
+++ b/web/src/server/api/routers/scores.ts
@@ -1,8 +1,12 @@
import { z } from "zod";
import { throwIfNoProjectAccess } from "@/src/features/rbac";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
-import { composeAggregateScoreKey } from "@/src/features/scores/lib/aggregateScores";
+import { auditLog } from "@/src/features/audit-logs/server";
+import {
+ composeAggregateScoreKey,
+ isNumericDataType,
+ isTraceScore,
+} from "@/src/features/scores/server";
import {
getDateFromOption,
SelectedTimeOptionSchema,
@@ -62,14 +66,10 @@ import {
validateConfigAgainstBody,
} from "@langfuse/shared/src/server";
import { v4 } from "uuid";
-import { throwIfNoEntitlement } from "@/src/features/entitlements/server/hasEntitlement";
+import { throwIfNoEntitlement } from "@/src/features/entitlements/server";
import { createBatchActionJob } from "@/src/features/table/server";
import { TRPCError } from "@trpc/server";
import { randomUUID } from "crypto";
-import {
- isNumericDataType,
- isTraceScore,
-} from "@/src/features/scores/lib/helpers";
import { toDomainWithStringifiedMetadata } from "@/src/utils/clientSideDomainTypes";
const ScoreFilterOptions = z.object({
diff --git a/web/src/server/api/routers/sessions.ts b/web/src/server/api/routers/sessions.ts
index 6a4c0abe5c..9d631c1bdf 100644
--- a/web/src/server/api/routers/sessions.ts
+++ b/web/src/server/api/routers/sessions.ts
@@ -1,5 +1,5 @@
import { z } from "zod";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import { throwIfNoProjectAccess } from "@/src/features/rbac";
import {
applyCommentFilters,
@@ -52,7 +52,7 @@ import {
import { TRPCError } from "@trpc/server";
import Decimal from "decimal.js";
import chunk from "lodash/chunk";
-import { aggregateScores } from "@/src/features/scores/lib/aggregateScores";
+import { aggregateScores } from "@/src/features/scores/server";
import {
toDomainArrayWithStringifiedMetadata,
toDomainWithStringifiedMetadata,
diff --git a/web/src/server/api/routers/traces.ts b/web/src/server/api/routers/traces.ts
index 7ae1e4becd..0f2827b62a 100644
--- a/web/src/server/api/routers/traces.ts
+++ b/web/src/server/api/routers/traces.ts
@@ -1,8 +1,8 @@
/* eslint-disable no-nested-ternary */
import { z } from "zod";
-import { auditLog } from "@/src/features/audit-logs/auditLog";
+import { auditLog } from "@/src/features/audit-logs/server";
import { throwIfNoProjectAccess } from "@/src/features/rbac";
-import { aggregateScores } from "@/src/features/scores/lib/aggregateScores";
+import { aggregateScores } from "@/src/features/scores/server";
import {
applyCommentFilters,
traceException,
@@ -58,7 +58,7 @@ import {
} from "@langfuse/shared";
import { TRPCError } from "@trpc/server";
import { createBatchActionJob } from "@/src/features/table/server";
-import { throwIfNoEntitlement } from "@/src/features/entitlements/server/hasEntitlement";
+import { throwIfNoEntitlement } from "@/src/features/entitlements/server";
import { sanitizeLegacyTracingSearch } from "@/src/features/traces/server";
import {
type AgentGraphDataResponse,
diff --git a/web/src/server/api/routers/userAccount.ts b/web/src/server/api/routers/userAccount.ts
index a333e1ad59..77c6c3b1fe 100644
--- a/web/src/server/api/routers/userAccount.ts
+++ b/web/src/server/api/routers/userAccount.ts
@@ -6,7 +6,7 @@ import {
import { TRPCError } from "@trpc/server";
import { StringNoHTML } from "@langfuse/shared";
import { Role, Prisma, type PrismaClient } from "@langfuse/shared/src/db";
-import { canToggleV4 } from "@/src/features/events/lib/v4Rollout";
+import { canToggleV4 } from "@/src/features/events/server";
import { V4_PREVIEW_LABEL } from "@/src/features/events/lib/v4PreviewLabel";
import { env } from "@/src/env.mjs";
import { getSfdcService } from "@/src/ee/features/sfdc-sync/server";
diff --git a/web/src/server/api/trpc.ts b/web/src/server/api/trpc.ts
index 1d64f09995..476dcf8704 100644
--- a/web/src/server/api/trpc.ts
+++ b/web/src/server/api/trpc.ts
@@ -93,7 +93,7 @@ import {
getActiveTraceId,
} from "@langfuse/shared/src/server";
-import { AdminApiAuthService } from "@/src/ee/features/admin-api/server/adminApiAuth";
+import { AdminApiAuthService } from "@/src/ee/features/admin-api/server";
import { env } from "@/src/env.mjs";
import { isBaseError, parseIO } from "@langfuse/shared";
import { recordBackendActivity } from "@/src/features/posthog-analytics/server/backendActivity";
diff --git a/web/src/server/auth.ts b/web/src/server/auth.ts
index 849d1d4cda..3509a0a195 100644
--- a/web/src/server/auth.ts
+++ b/web/src/server/auth.ts
@@ -81,7 +81,7 @@ import { createSupportEmailHash } from "@/src/features/support-chat/createSuppor
import {
canToggleV4,
isV4UpgradeUiAvailable,
-} from "@/src/features/events/lib/v4Rollout";
+} from "@/src/features/events/server";
import { canCreateOrganizations } from "@/src/features/organizations/server";
const staticProviders: Provider[] = [