fix: move getConnectorTelemetryMeta from components/ to lib/ to fix dependency inversion

lib/posthog/events.ts was importing from components/assistant-ui/...,
creating an inverted dependency layer (lib → components).

Move ConnectorTelemetryMeta type, CONNECTOR_TELEMETRY_REGISTRY,
getConnectorTelemetryMeta, and getReauthEndpoint into the new
lib/connector-telemetry.ts module so that lib/ no longer depends upward
into the UI tree.

connector-constants.ts now re-exports from the new module for
backward compatibility.

Fixes #1375
This commit is contained in:
guangyang1206 2026-05-22 12:15:20 +08:00
parent c381dd5ba9
commit a1397a51b5
3 changed files with 161 additions and 106 deletions

View file

@ -1,5 +1,5 @@
import posthog from "posthog-js";
import { getConnectorTelemetryMeta } from "@/components/assistant-ui/connector-popup/constants/connector-constants";
import type { ConnectorTelemetryMeta } from "@/lib/connector-telemetry";
import { getConnectorTelemetryMeta } from "@/lib/connector-telemetry";
import type { ChatErrorKind, ChatErrorSeverity, ChatFlow } from "@/lib/chat/chat-error-classifier";
/**