Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(frontend): inline Kea types batch 2 (#71456)

Marius Andra0b36bb4da6b7
diff --git a/.kearc b/.kearc
index 6e1af709b93d..5bcbc69a762d 100644
--- a/.kearc
+++ b/.kearc
@@ -8,18 +8,18 @@
"./.kea-inline-batch-01-slot-01",
"./.kea-inline-separator-01",
"./.kea-inline-separator-01-b",
- "./.kea-inline-batch-02-slot-01",
- "./.kea-inline-batch-02-slot-02",
- "./.kea-inline-batch-02-slot-03",
- "./.kea-inline-batch-02-slot-04",
- "./.kea-inline-batch-02-slot-05",
- "./.kea-inline-batch-02-slot-06",
- "./.kea-inline-batch-02-slot-07",
- "./.kea-inline-batch-02-slot-08",
- "./.kea-inline-batch-02-slot-09",
- "./.kea-inline-batch-02-slot-10",
- "./.kea-inline-batch-02-slot-11",
- "./.kea-inline-batch-02-slot-12",
+ "./frontend/src/scenes/StripeConfirmInstall",
+ "./frontend/src/scenes/coupons",
+ "./frontend/src/scenes/data-pipelines",
+ "./frontend/src/scenes/groups",
+ "./frontend/src/scenes/organization",
+ "./frontend/src/scenes/surveys",
+ "./products/ai_observability",
+ "./products/business_knowledge",
+ "./products/growth",
+ "./products/links",
+ "./products/metrics",
+ "./products/session_summaries",
"./.kea-inline-separator-02",
"./.kea-inline-separator-02-b",
"./.kea-inline-batch-03-slot-01",
diff --git a/frontend/src/scenes/StripeConfirmInstall/stripeConfirmInstallLogic.ts b/frontend/src/scenes/StripeConfirmInstall/stripeConfirmInstallLogic.ts
index d1de1dcd5da1..6f742a2992df 100644
--- a/frontend/src/scenes/StripeConfirmInstall/stripeConfirmInstallLogic.ts
+++ b/frontend/src/scenes/StripeConfirmInstall/stripeConfirmInstallLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { router, urlToAction } from 'kea-router'
import api, { ApiError } from 'lib/api'
@@ -8,8 +8,6 @@ import { urls } from 'scenes/urls'
import { IntegrationKind } from '~/types'
-import type { stripeConfirmInstallLogicType } from './stripeConfirmInstallLogicType'
-
export interface StripeConfirmInstallParams {
code: string | null
stripe_user_id: string | null
@@ -24,6 +22,44 @@ const EMPTY_PARAMS: StripeConfirmInstallParams = {
user_id: null,
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface stripeConfirmInstallLogicValues {
+ hasRequiredParams: boolean
+ isSubmitting: boolean
+ params: StripeConfirmInstallParams
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface stripeConfirmInstallLogicActions {
+ loadIntegrations: () => any // integrationsLogic
+ cancelInstall: () => {
+ value: true
+ }
+ confirmInstall: () => {
+ value: true
+ }
+ setParams: (params: StripeConfirmInstallParams) => {
+ params: StripeConfirmInstallParams
+ }
+ setSubmitting: (submitting: boolean) => {
+ submitting: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface stripeConfirmInstallLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasRequiredParams: (params: StripeConfirmInstallParams) => boolean
+ }
+}
+
+export type stripeConfirmInstallLogicType = MakeLogicType<
+ stripeConfirmInstallLogicValues,
+ stripeConfirmInstallLogicActions,
+ Record<string, any>,
+ stripeConfirmInstallLogicMeta
+>
+
export const stripeConfirmInstallLogic = kea<stripeConfirmInstallLogicType>([
path(['scenes', 'StripeConfirmInstall', 'stripeConfirmInstallLogic']),
connect(() => ({
@@ -53,7 +89,10 @@ export const stripeConfirmInstallLogic = kea<stripeConfirmInstallLogicType>([
}),
selectors({
- hasRequiredParams: [(s) => [s.params], (params): boolean => !!params.code && !!params.stripe_user_id],
+ hasRequiredParams: [
+ (s) => [s.params],
+ (params: StripeConfirmInstallParams): boolean => !!params.code && !!params.stripe_user_id,
+ ],
}),
listeners(({ actions, values }) => ({
diff --git a/frontend/src/scenes/coupons/couponLogic.ts b/frontend/src/scenes/coupons/couponLogic.ts
index 461ffc24089b..bf9f3e802d43 100644
--- a/frontend/src/scenes/coupons/couponLogic.ts
+++ b/frontend/src/scenes/coupons/couponLogic.ts
@@ -1,5 +1,6 @@
-import { actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -12,7 +13,7 @@ import { userLogic } from 'scenes/userLogic'
import { ClaimedCouponInfo, CouponsOverview } from '~/types'
-import type { couponLogicType } from './couponLogicType'
+import type { BillingType, OrganizationType, UserType } from '../../types'
export interface CouponLogicProps {
campaign?: string
@@ -23,6 +24,119 @@ export interface CouponFormValues {
organization_name: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface couponLogicValues {
+ billing: BillingType | null // billingLogic
+ billingLoading: boolean // billingLogic
+ currentOrganization: OrganizationType | null // organizationLogic
+ isAdminOrOwner: boolean | null // organizationLogic
+ user: UserType | null // userLogic
+ activeCoupons: ClaimedCouponInfo[]
+ claimed: boolean
+ claimedDetails: any
+ coupon: CouponFormValues
+ couponAllErrors: Record<string, any>
+ couponChanged: boolean
+ couponErrors: DeepPartialMap<CouponFormValues, ValidationErrorType>
+ couponHasErrors: boolean
+ couponManualErrors: Record<string, any>
+ couponTouched: boolean
+ couponTouches: Record<string, boolean>
+ couponValidationErrors: DeepPartialMap<CouponFormValues, ValidationErrorType>
+ couponsOverview: CouponsOverview | null
+ couponsOverviewLoading: boolean
+ getClaimedCouponForCampaign: (campaignSlug: string) => ClaimedCouponInfo | null
+ isCouponSubmitting: boolean
+ isCouponValid: boolean
+ showCouponErrors: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface couponLogicActions {
+ loadBillingSuccess: (
+ billing: BillingType,
+ payload?: any
+ ) => {
+ billing: BillingType
+ payload?: any
+ } // billingLogic
+ loadCurrentOrganizationSuccess: (
+ currentOrganization: OrganizationType | null,
+ payload?: any
+ ) => {
+ currentOrganization: OrganizationType | null
+ payload?: any
+ } // organizationLogic
+ loadCouponsOverview: () => any
+ loadCouponsOverviewFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadCouponsOverviewSuccess: (
+ couponsOverview: CouponsOverview | null,
+ payload?: any
+ ) => {
+ couponsOverview: CouponsOverview | null
+ payload?: any
+ }
+ resetCoupon: (values?: CouponFormValues) => {
+ values?: CouponFormValues
+ }
+ setClaimed: (claimed: boolean) => {
+ claimed: boolean
+ }
+ setClaimedDetails: (details: any) => {
+ details: any
+ }
+ setCouponManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setCouponValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setCouponValues: (values: DeepPartial<CouponFormValues>) => {
+ values: DeepPartial<CouponFormValues>
+ }
+ submitCoupon: () => {
+ value: boolean
+ }
+ submitCouponFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitCouponRequest: (coupon: CouponFormValues) => {
+ coupon: CouponFormValues
+ }
+ submitCouponSuccess: (coupon: CouponFormValues) => {
+ coupon: CouponFormValues
+ }
+ touchCouponField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface couponLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ getClaimedCouponForCampaign: (
+ couponsOverview: CouponsOverview | null
+ ) => (campaignSlug: string) => ClaimedCouponInfo | null
+ activeCoupons: (couponsOverview: CouponsOverview | null) => ClaimedCouponInfo[]
+ }
+}
+
+export type couponLogicType = MakeLogicType<couponLogicValues, couponLogicActions, CouponLogicProps, couponLogicMeta>
+
export const couponLogic = kea<couponLogicType>([
path(['scenes', 'coupons', 'couponLogic']),
props({} as CouponLogicProps),
@@ -61,14 +175,14 @@ export const couponLogic = kea<couponLogicType>([
selectors({
getClaimedCouponForCampaign: [
(s) => [s.couponsOverview],
- (couponsOverview) =>
+ (couponsOverview: CouponsOverview | null) =>
(campaignSlug: string): ClaimedCouponInfo | null => {
return couponsOverview?.claimed_coupons?.find((c) => c.campaign_slug === campaignSlug) || null
},
],
activeCoupons: [
(s) => [s.couponsOverview],
- (couponsOverview): ClaimedCouponInfo[] => {
+ (couponsOverview: CouponsOverview | null): ClaimedCouponInfo[] => {
return couponsOverview?.claimed_coupons?.filter((c) => c.status === 'claimed') ?? []
},
],
diff --git a/frontend/src/scenes/data-pipelines/DataPipelinesNewScene.tsx b/frontend/src/scenes/data-pipelines/DataPipelinesNewScene.tsx
index c16b11321a68..bb32407d8aa9 100644
--- a/frontend/src/scenes/data-pipelines/DataPipelinesNewScene.tsx
+++ b/frontend/src/scenes/data-pipelines/DataPipelinesNewScene.tsx
@@ -1,4 +1,4 @@
-import { BindLogic, kea, path, props, selectors, useValues } from 'kea'
+import { MakeLogicType, BindLogic, kea, path, props, selectors, useValues } from 'kea'
import { LemonSkeleton } from '@posthog/lemon-ui'
@@ -17,7 +17,6 @@ import { availableSourcesLogic } from 'products/data_warehouse/frontend/scenes/N
import { SourceCatalog } from 'products/data_warehouse/frontend/scenes/NewSourceScene/SourceCatalog'
import { sourceWizardLogic } from 'products/data_warehouse/frontend/scenes/NewSourceScene/sourceWizardLogic'
-import type { dataPipelinesNewSceneLogicType } from './DataPipelinesNewSceneType'
import { nonHogFunctionTemplatesLogic } from './utils/nonHogFunctionTemplatesLogic'
export type DataPipelinesNewSceneKind = 'transformation' | 'destination' | 'source' | 'site_app'
@@ -26,6 +25,27 @@ export type DataPipelinesNewSceneProps = {
kind: DataPipelinesNewSceneKind
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataPipelinesNewSceneLogicValues {
+ breadcrumbs: Breadcrumb[]
+ logicProps: any
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataPipelinesNewSceneLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ logicProps: (arg: any) => any
+ breadcrumbs: (arg: any) => Breadcrumb[]
+ }
+}
+
+export type dataPipelinesNewSceneLogicType = MakeLogicType<
+ dataPipelinesNewSceneLogicValues,
+ {},
+ DataPipelinesNewSceneProps,
+ dataPipelinesNewSceneLogicMeta
+>
+
export const dataPipelinesNewSceneLogic = kea<dataPipelinesNewSceneLogicType>([
props({} as DataPipelinesNewSceneProps),
path(() => ['scenes', 'data-pipelines', 'dataPipelinesNewSceneLogic']),
diff --git a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.tsx b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.tsx
index a9ac15e7bf0b..f54f70c02528 100644
--- a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.tsx
+++ b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.tsx
@@ -1,4 +1,5 @@
import {
+ MakeLogicType,
BindLogic,
actions,
kea,
@@ -39,13 +40,43 @@ import {
BatchExportConfigurationSaveButton,
} from './BatchExportConfigurationButtons'
import { RenderBatchExportIcon } from './BatchExportIcon'
-import type { batchExportSceneLogicType } from './BatchExportSceneType'
import { BatchExportsMetrics } from './BatchExportsMetrics'
import { humanizeBatchExportName, normalizeBatchExportService } from './utils'
const BATCH_EXPORT_SCENE_TABS = ['configuration', 'metrics', 'logs', 'runs', 'backfills', 'history'] as const
export type BatchExportSceneTab = (typeof BATCH_EXPORT_SCENE_TABS)[number]
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportSceneLogicValues {
+ breadcrumbs: Breadcrumb[]
+ currentTab: BatchExportSceneTab
+ logicProps: any
+ sidePanelContext: SidePanelSceneContext | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportSceneLogicActions {
+ setCurrentTab: (tab: BatchExportSceneTab) => {
+ tab: 'backfills' | 'configuration' | 'history' | 'logs' | 'metrics' | 'runs'
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportSceneLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ logicProps: (arg: any) => any
+ sidePanelContext: (arg: any) => SidePanelSceneContext | null
+ }
+}
+
+export type batchExportSceneLogicType = MakeLogicType<
+ batchExportSceneLogicValues,
+ batchExportSceneLogicActions,
+ BatchExportConfigFormLogicProps,
+ batchExportSceneLogicMeta
+>
+
export const batchExportSceneLogic = kea<batchExportSceneLogicType>([
props({} as BatchExportConfigFormLogicProps),
key(({ id }: BatchExportConfigFormLogicProps) => id ?? 'new'),
diff --git a/frontend/src/scenes/data-pipelines/batch-exports/batchExportBackfillModalLogic.tsx b/frontend/src/scenes/data-pipelines/batch-exports/batchExportBackfillModalLogic.tsx
index 69d30698be71..ea2446c0e82b 100644
--- a/frontend/src/scenes/data-pipelines/batch-exports/batchExportBackfillModalLogic.tsx
+++ b/frontend/src/scenes/data-pipelines/batch-exports/batchExportBackfillModalLogic.tsx
@@ -1,6 +1,7 @@
// Form logic for the backfill creation modal — date range selection, schedule display, and submission.
-import { actions, connect, kea, key, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, path, props, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { lemonToast } from '@posthog/lemon-ui'
@@ -12,7 +13,6 @@ import { teamLogic } from 'scenes/teamLogic'
import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-general'
import { BatchExportConfiguration } from '~/types'
-import type { batchExportBackfillModalLogicType } from './batchExportBackfillModalLogicType'
import { batchExportDataLogic } from './batchExportDataLogic'
import { BatchExportContext } from './types'
import { dayOptions } from './utils'
@@ -118,6 +118,164 @@ export function getMostRecentIntervalBoundary(
return now.minute(0).second(0).millisecond(0)
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportBackfillModalLogicValues {
+ batchExportConfig: BatchExportConfiguration | null // batchExportDataLogic
+ backfillForm: {
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ }
+ backfillFormAllErrors: Record<string, any>
+ backfillFormChanged: boolean
+ backfillFormErrors: DeepPartialMap<
+ {
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ },
+ ValidationErrorType
+ >
+ backfillFormHasErrors: boolean
+ backfillFormManualErrors: Record<string, any>
+ backfillFormTouched: boolean
+ backfillFormTouches: Record<string, boolean>
+ backfillFormValidationErrors: DeepPartialMap<
+ {
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ },
+ ValidationErrorType
+ >
+ dayOfWeek: number | null
+ dayOfWeekName: string | null
+ defaultEndAt: Dayjs
+ hourOffset: number | null
+ interval: string | undefined
+ isBackfillFormSubmitting: boolean
+ isBackfillFormValid: boolean
+ isBackfillModalOpen: boolean
+ isEarliestBackfill: boolean
+ isHogFunction: boolean
+ showBackfillFormErrors: boolean
+ timezone: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportBackfillModalLogicActions {
+ backfillCreated: (backfillId: string) => {
+ backfillId: string
+ }
+ closeBackfillModal: () => {
+ value: true
+ }
+ openBackfillModal: () => {
+ value: true
+ }
+ resetBackfillForm: (values?: {
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ }) => {
+ values?: {
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ }
+ }
+ setBackfillFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setBackfillFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setBackfillFormValues: (
+ values: DeepPartial<{
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ }>
+ ) => {
+ values: DeepPartial<{
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ }>
+ }
+ setEarliestBackfill: () => {
+ value: true
+ }
+ submitBackfillForm: () => {
+ value: boolean
+ }
+ submitBackfillFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitBackfillFormRequest: (backfillForm: {
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ }) => {
+ backfillForm: {
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ }
+ }
+ submitBackfillFormSuccess: (backfillForm: {
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ }) => {
+ backfillForm: {
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ }
+ }
+ touchBackfillFormField: (key: string) => {
+ key: string
+ }
+ unsetEarliestBackfill: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportBackfillModalLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isHogFunction: (arg: any) => boolean
+ interval: (batchExportConfig: BatchExportConfiguration | null) => string | undefined
+ timezone: (batchExportConfig: BatchExportConfiguration | null, timezone: string) => string
+ dayOfWeek: (batchExportConfig: BatchExportConfiguration | null) => number | null
+ dayOfWeekName: (dayOfWeek: number | null) => string | null
+ hourOffset: (batchExportConfig: BatchExportConfiguration | null) => number | null
+ defaultEndAt: (
+ interval: string | undefined,
+ timezone: string,
+ hourOffset: number | null,
+ dayOfWeek: number | null
+ ) => Dayjs
+ }
+}
+
+export type batchExportBackfillModalLogicType = MakeLogicType<
+ batchExportBackfillModalLogicValues,
+ batchExportBackfillModalLogicActions,
+ BatchExportBackfillModalLogicProps,
+ batchExportBackfillModalLogicMeta
+>
+
export const batchExportBackfillModalLogic = kea<batchExportBackfillModalLogicType>([
props({} as BatchExportBackfillModalLogicProps),
key(({ id }) => id),
diff --git a/frontend/src/scenes/data-pipelines/batch-exports/batchExportBackfillsLogic.tsx b/frontend/src/scenes/data-pipelines/batch-exports/batchExportBackfillsLogic.tsx
index 968dfe4282ca..692ebee085a6 100644
--- a/frontend/src/scenes/data-pipelines/batch-exports/batchExportBackfillsLogic.tsx
+++ b/frontend/src/scenes/data-pipelines/batch-exports/batchExportBackfillsLogic.tsx
@@ -1,5 +1,5 @@
// Loads and manages batch export backfills — listing, cancellation, and polling for estimates.
-import { actions, afterMount, connect, kea, key, listeners, path, props, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api, { PaginatedResponse } from 'lib/api'
@@ -9,8 +9,9 @@ import { teamLogic } from 'scenes/teamLogic'
import { BatchExportBackfill, RawBatchExportBackfill } from '~/types'
+import type { Dayjs } from '../../../lib/dayjs'
+import type { BatchExportConfiguration } from '../../../types'
import { batchExportBackfillModalLogic } from './batchExportBackfillModalLogic'
-import type { batchExportBackfillsLogicType } from './batchExportBackfillsLogicType'
import { batchExportDataLogic } from './batchExportDataLogic'
import { BatchExportContext } from './types'
@@ -19,6 +20,101 @@ export interface BatchExportBackfillsLogicProps {
context?: BatchExportContext
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportBackfillsLogicValues {
+ batchExportConfig: BatchExportConfiguration | null // batchExportDataLogic
+ batchExportConfigLoading: boolean // batchExportDataLogic
+ currentTeamId: number | null // teamLogic
+ backfillsPaginatedResponse: PaginatedResponse<RawBatchExportBackfill> | null
+ backfillsPaginatedResponseLoading: boolean
+ hasMoreBackfillsToLoad: boolean
+ latestBackfills: BatchExportBackfill[]
+ loading: boolean
+ recordLabel: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportBackfillsLogicActions {
+ backfillCreated: (backfillId: string) => {
+ backfillId: string
+ } // batchExportBackfillModalLogic
+ openBackfillModal: () => {
+ value: true
+ } // batchExportBackfillModalLogic
+ submitBackfillFormSuccess: (backfillForm: {
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ }) => {
+ backfillForm: {
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ }
+ } // batchExportBackfillModalLogic
+ cancelBackfill: (backfill: BatchExportBackfill) => {
+ backfill: BatchExportBackfill
+ }
+ loadBackfills: () => {
+ value: true
+ }
+ loadBackfillsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadBackfillsSuccess: (
+ backfillsPaginatedResponse: PaginatedResponse<RawBatchExportBackfill>,
+ payload?: {
+ value: true
+ }
+ ) => {
+ backfillsPaginatedResponse: PaginatedResponse<RawBatchExportBackfill>
+ payload?: {
+ value: true
+ }
+ }
+ loadOlderBackfills: () => any
+ loadOlderBackfillsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadOlderBackfillsSuccess: (
+ backfillsPaginatedResponse: PaginatedResponse<RawBatchExportBackfill> | null,
+ payload?: any
+ ) => {
+ backfillsPaginatedResponse: PaginatedResponse<RawBatchExportBackfill> | null
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportBackfillsLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ recordLabel: (arg: any) => string
+ hasMoreBackfillsToLoad: (
+ backfillsPaginatedResponse: PaginatedResponse<RawBatchExportBackfill> | null
+ ) => boolean
+ loading: (backfillsPaginatedResponseLoading: boolean) => boolean
+ latestBackfills: (
+ backfillsPaginatedResponse: PaginatedResponse<RawBatchExportBackfill> | null
+ ) => BatchExportBackfill[]
+ }
+}
+
+export type batchExportBackfillsLogicType = MakeLogicType<
+ batchExportBackfillsLogicValues,
+ batchExportBackfillsLogicActions,
+ BatchExportBackfillsLogicProps,
+ batchExportBackfillsLogicMeta
+>
+
export const batchExportBackfillsLogic = kea<batchExportBackfillsLogicType>([
props({} as BatchExportBackfillsLogicProps),
key(({ id }) => id),
@@ -79,15 +175,16 @@ export const batchExportBackfillsLogic = kea<batchExportBackfillsLogicType>([
],
hasMoreBackfillsToLoad: [
(s) => [s.backfillsPaginatedResponse],
- (backfillsPaginatedResponse) => !!backfillsPaginatedResponse?.next,
+ (backfillsPaginatedResponse: PaginatedResponse<RawBatchExportBackfill> | null) =>
+ !!backfillsPaginatedResponse?.next,
],
loading: [
(s) => [s.backfillsPaginatedResponseLoading],
- (backfillsPaginatedResponseLoading) => backfillsPaginatedResponseLoading,
+ (backfillsPaginatedResponseLoading: boolean) => backfillsPaginatedResponseLoading,
],
latestBackfills: [
(s) => [s.backfillsPaginatedResponse],
- (backfillsPaginatedResponse): BatchExportBackfill[] => {
+ (backfillsPaginatedResponse: PaginatedResponse<RawBatchExportBackfill> | null): BatchExportBackfill[] => {
const backfills = backfillsPaginatedResponse?.results ?? []
return backfills.map((backfill) => {
const parseDateSafely = (date: string | null | undefined): dayjs.Dayjs | undefined => {
diff --git a/frontend/src/scenes/data-pipelines/batch-exports/batchExportConfigFormLogic.tsx b/frontend/src/scenes/data-pipelines/batch-exports/batchExportConfigFormLogic.tsx
index ede81ac05cdb..d20d11399b15 100644
--- a/frontend/src/scenes/data-pipelines/batch-exports/batchExportConfigFormLogic.tsx
+++ b/frontend/src/scenes/data-pipelines/batch-exports/batchExportConfigFormLogic.tsx
@@ -1,5 +1,6 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import { beforeUnload, router } from 'kea-router'
@@ -18,7 +19,6 @@ import {
BatchExportService,
} from '~/types'
-import type { batchExportConfigFormLogicType } from './batchExportConfigFormLogicType'
import { batchExportDataLogic } from './batchExportDataLogic'
import { DESTINATIONS } from './destinations'
import { genericPersonEventFields, isSelectedCompressionOptionValid } from './destinations/common'
@@ -531,6 +531,233 @@ const sessionsTable: DatabaseSchemaBatchExportTable = {
},
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportConfigFormLogicValues {
+ batchExportConfig: BatchExportConfiguration | null // batchExportDataLogic
+ batchExportConfigLoading: boolean // batchExportDataLogic
+ teamTimezone: string // teamLogic
+ teamWeekStartDay: number // teamLogic
+ batchExportConfigTest: BatchExportConfigurationTest | null
+ batchExportConfigTestLoading: boolean
+ batchExportConfigTestStep: BatchExportConfigurationTestStep | null
+ batchExportConfigTestStepLoading: boolean
+ configuration: Record<string, any>
+ configurationAllErrors: Record<string, any>
+ configurationChanged: boolean
+ configurationErrors: DeepPartialMap<Record<string, any>, ValidationErrorType>
+ configurationHasErrors: boolean
+ configurationManualErrors: Record<string, any>
+ configurationTouched: boolean
+ configurationTouches: Record<string, boolean>
+ configurationValidationErrors: DeepPartialMap<Record<string, any>, ValidationErrorType>
+ isConfigurationSubmitting: boolean
+ isConfigurationValid: boolean
+ isDatabaseDestination: boolean
+ isNew: boolean
+ loading: boolean
+ logicProps: any
+ requiredFields: string[]
+ runningStep: number | null
+ savedConfiguration: Record<string, any>
+ selectedModel: string
+ service:
+ | 'AwsS3'
+ | 'AzureBlob'
+ | 'BigQuery'
+ | 'Databricks'
+ | 'HTTP'
+ | 'Postgres'
+ | 'Redshift'
+ | 'S3'
+ | 'S3Compatible'
+ | 'Snowflake'
+ | null
+ showConfigurationErrors: boolean
+ tables: DatabaseSchemaBatchExportTable[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportConfigFormLogicActions {
+ loadBatchExportConfig: () => any // batchExportDataLogic
+ loadBatchExportConfigSuccess: (
+ batchExportConfig: BatchExportConfiguration | null,
+ payload?: any
+ ) => {
+ batchExportConfig: BatchExportConfiguration | null
+ payload?: any
+ } // batchExportDataLogic
+ setBatchExportConfig: (config: BatchExportConfiguration) => BatchExportConfiguration // batchExportDataLogic
+ deleteBatchExport: () => boolean
+ loadBatchExportConfigTest: () => any
+ loadBatchExportConfigTestFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadBatchExportConfigTestSuccess: (
+ batchExportConfigTest: BatchExportConfigurationTest | null,
+ payload?: any
+ ) => {
+ batchExportConfigTest: BatchExportConfigurationTest | null
+ payload?: any
+ }
+ resetConfiguration: (values?: Record<string, any>) => {
+ values?: Record<string, any>
+ }
+ runBatchExportConfigTestStep: (step: any) => any
+ runBatchExportConfigTestStepFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ runBatchExportConfigTestStepSuccess: (
+ batchExportConfigTestStep: BatchExportConfigurationTestStep | null,
+ payload?: any
+ ) => {
+ batchExportConfigTestStep: BatchExportConfigurationTestStep | null
+ payload?: any
+ }
+ setConfigurationManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setConfigurationValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setConfigurationValues: (values: DeepPartial<Record<string, any>>) => {
+ values: DeepPartial<Record<string, any>>
+ }
+ setRunningStep: (step: number | null) => {
+ step: number | null
+ }
+ setSavedConfiguration: (configuration: Record<string, any>) => {
+ configuration: Record<string, any>
+ }
+ setSelectedModel: (model: string) => {
+ model: string
+ }
+ submitConfiguration: () => {
+ value: boolean
+ }
+ submitConfigurationFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitConfigurationRequest: (configuration: Record<string, any>) => {
+ configuration: Record<string, any>
+ }
+ submitConfigurationSuccess: (configuration: Record<string, any>) => {
+ configuration: Record<string, any>
+ }
+ touchConfigurationField: (key: string) => {
+ key: string
+ }
+ updateBatchExportConfig: (formdata: Record<string, any>) => {
+ formdata: Record<string, any>
+ }
+ updateBatchExportConfigSuccess: (batchExportConfig: BatchExportConfiguration) => {
+ batchExportConfig: BatchExportConfiguration
+ }
+ updateBatchExportConfigTest: (service: any) => any
+ updateBatchExportConfigTestFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateBatchExportConfigTestSuccess: (
+ batchExportConfigTest: BatchExportConfigurationTest | null,
+ payload?: any
+ ) => {
+ batchExportConfigTest: BatchExportConfigurationTest | null
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportConfigFormLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ logicProps: (arg: any) => any
+ service: (
+ batchExportConfig: BatchExportConfiguration | null,
+ service:
+ | 'AwsS3'
+ | 'AzureBlob'
+ | 'BigQuery'
+ | 'Databricks'
+ | 'HTTP'
+ | 'Postgres'
+ | 'Redshift'
+ | 'S3'
+ | 'S3Compatible'
+ | 'Snowflake'
+ | null
+ ) =>
+ | 'AwsS3'
+ | 'AzureBlob'
+ | 'BigQuery'
+ | 'Databricks'
+ | 'HTTP'
+ | 'Postgres'
+ | 'Redshift'
+ | 'S3'
+ | 'S3Compatible'
+ | 'Snowflake'
+ | null
+ isNew: (id: string | null) => boolean
+ loading: (batchExportConfigLoading: boolean, batchExportConfigTestLoading: boolean) => boolean
+ isDatabaseDestination: (
+ service:
+ | 'AwsS3'
+ | 'AzureBlob'
+ | 'BigQuery'
+ | 'Databricks'
+ | 'HTTP'
+ | 'Postgres'
+ | 'Redshift'
+ | 'S3'
+ | 'S3Compatible'
+ | 'Snowflake'
+ | null
+ ) => boolean
+ requiredFields: (
+ service:
+ | 'AwsS3'
+ | 'AzureBlob'
+ | 'BigQuery'
+ | 'Databricks'
+ | 'HTTP'
+ | 'Postgres'
+ | 'Redshift'
+ | 'S3'
+ | 'S3Compatible'
+ | 'Snowflake'
+ | null,
+ isNew: boolean,
+ configuration: Record<string, any>
+ ) => string[]
+ }
+}
+
+export type batchExportConfigFormLogicType = MakeLogicType<
+ batchExportConfigFormLogicValues,
+ batchExportConfigFormLogicActions,
+ BatchExportConfigFormLogicProps,
+ batchExportConfigFormLogicMeta
+>
+
// Form logic for creating and editing batch export configurations.
// Owns form state, validation, dirty-checking, test steps, and save/delete actions.
// Reads the underlying config data from batchExportDataLogic.
@@ -717,21 +944,66 @@ export const batchExportConfigFormLogic = kea<batchExportConfigFormLogicType>([
})),
selectors(() => ({
logicProps: [() => [(_, props) => props], (props) => props],
- service: [(s, p) => [s.batchExportConfig, p.service], (config, service) => config?.destination.type || service],
- isNew: [(_, p) => [p.id], (id): boolean => !id],
+ service: [
+ (s, p) => [s.batchExportConfig, p.service],
+ (
+ config: BatchExportConfiguration | null,
+ service:
+ | 'AwsS3'
+ | 'AzureBlob'
+ | 'BigQuery'
+ | 'Databricks'
+ | 'HTTP'
+ | 'Postgres'
+ | 'Redshift'
+ | 'S3'
+ | 'S3Compatible'
+ | 'Snowflake'
+ | null
+ ) => config?.destination.type || service,
+ ],
+ isNew: [(_, p) => [p.id], (id: string | null): boolean => !id],
loading: [
(s) => [s.batchExportConfigLoading, s.batchExportConfigTestLoading],
- (batchExportConfigLoading, batchExportConfigTestLoading) =>
+ (batchExportConfigLoading: boolean, batchExportConfigTestLoading: boolean) =>
batchExportConfigLoading || batchExportConfigTestLoading,
],
isDatabaseDestination: [
(s) => [s.service],
- (service): boolean =>
+ (
+ service:
+ | 'AwsS3'
+ | 'AzureBlob'
+ | 'BigQuery'
+ | 'Databricks'
+ | 'HTTP'
+ | 'Postgres'
+ | 'Redshift'
+ | 'S3'
+ | 'S3Compatible'
+ | 'Snowflake'
+ | null
+ ): boolean =>
!!service && ['Postgres', 'Redshift', 'Snowflake', 'Databricks', 'BigQuery'].includes(service),
],
requiredFields: [
(s) => [s.service, s.isNew, s.configuration],
- (service, isNew, config): string[] => {
+ (
+ service:
+ | 'AwsS3'
+ | 'AzureBlob'
+ | 'BigQuery'
+ | 'Databricks'
+ | 'HTTP'
+ | 'Postgres'
+ | 'Redshift'
+ | 'S3'
+ | 'S3Compatible'
+ | 'Snowflake'
+ | null,
+ isNew: boolean,
+ config: Record<string, any>
+ ): string[] => {
const generalRequiredFields = ['interval', 'name', 'model']
if (!service) {
return generalRequiredFields
diff --git a/frontend/src/scenes/data-pipelines/batch-exports/batchExportDataLogic.ts b/frontend/src/scenes/data-pipelines/batch-exports/batchExportDataLogic.ts
index 5154a152fdde..4fe168e411dd 100644
--- a/frontend/src/scenes/data-pipelines/batch-exports/batchExportDataLogic.ts
+++ b/frontend/src/scenes/data-pipelines/batch-exports/batchExportDataLogic.ts
@@ -1,19 +1,69 @@
// Lightweight logic that loads and caches a batch export's configuration.
// Child logics (runs, backfills, modal) connect here instead of the heavyweight form logic,
// so they can be mounted independently (e.g. from the hog function backfills tab).
-import { afterMount, kea, key, path, props } from 'kea'
+import { MakeLogicType, afterMount, kea, key, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { BatchExportConfiguration } from '~/types'
-import type { batchExportDataLogicType } from './batchExportDataLogicType'
-
export interface BatchExportConfigLogicProps {
id: string | null
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportDataLogicValues {
+ batchExportConfig: BatchExportConfiguration | null
+ batchExportConfigLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportDataLogicActions {
+ loadBatchExportConfig: () => any
+ loadBatchExportConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadBatchExportConfigSuccess: (
+ batchExportConfig: BatchExportConfiguration | null,
+ payload?: any
+ ) => {
+ batchExportConfig: BatchExportConfiguration | null
+ payload?: any
+ }
+ setBatchExportConfig: (config: BatchExportConfiguration) => BatchExportConfiguration
+ setBatchExportConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ setBatchExportConfigSuccess: (
+ batchExportConfig: BatchExportConfiguration,
+ payload?: BatchExportConfiguration
+ ) => {
+ batchExportConfig: BatchExportConfiguration
+ payload?: BatchExportConfiguration
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportDataLogicMeta {
+ key: string
+}
+
+export type batchExportDataLogicType = MakeLogicType<
+ batchExportDataLogicValues,
+ batchExportDataLogicActions,
+ BatchExportConfigLogicProps,
+ batchExportDataLogicMeta
+>
+
export const batchExportDataLogic = kea<batchExportDataLogicType>([
props({} as BatchExportConfigLogicProps),
key(({ id }) => id ?? 'new'),
diff --git a/frontend/src/scenes/data-pipelines/batch-exports/batchExportRunsLogic.tsx b/frontend/src/scenes/data-pipelines/batch-exports/batchExportRunsLogic.tsx
index 676a4978bc89..0b8c3d7128bb 100644
--- a/frontend/src/scenes/data-pipelines/batch-exports/batchExportRunsLogic.tsx
+++ b/frontend/src/scenes/data-pipelines/batch-exports/batchExportRunsLogic.tsx
@@ -1,5 +1,5 @@
// Loads and manages batch export runs — grouping by date, retry, cancel, and pagination logic.
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { lemonToast } from '@posthog/lemon-ui'
@@ -9,9 +9,10 @@ import { dayjs } from 'lib/dayjs'
import { BatchExportRun, GroupedBatchExportRuns, RawBatchExportRun } from '~/types'
+import type { Dayjs } from '../../../lib/dayjs'
+import type { BatchExportConfiguration } from '../../../types'
import { batchExportBackfillModalLogic } from './batchExportBackfillModalLogic'
import { batchExportDataLogic } from './batchExportDataLogic'
-import type { batchExportRunsLogicType } from './batchExportRunsLogicType'
import { BatchExportContext } from './types'
const DEFAULT_DATE_FROM = '-2d'
@@ -20,6 +21,116 @@ export interface BatchExportRunsLogicProps {
context?: BatchExportContext
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportRunsLogicValues {
+ batchExportConfig: BatchExportConfiguration | null // batchExportDataLogic
+ batchExportConfigLoading: boolean // batchExportDataLogic
+ dateRange: {
+ from: string
+ to: string | null
+ }
+ groupedRuns: GroupedBatchExportRuns[]
+ hasMoreRunsToLoad: boolean
+ latestRuns: BatchExportRun[]
+ loading: boolean
+ recordLabel: string
+ runsPaginatedResponse: PaginatedResponse<RawBatchExportRun> | null
+ runsPaginatedResponseLoading: boolean
+ usingLatestRuns: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportRunsLogicActions {
+ openBackfillModal: () => {
+ value: true
+ } // batchExportBackfillModalLogic
+ submitBackfillFormSuccess: (backfillForm: {
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ }) => {
+ backfillForm: {
+ earliest_backfill: boolean
+ end_at?: Dayjs | undefined
+ start_at?: Dayjs | undefined
+ }
+ } // batchExportBackfillModalLogic
+ cancelRun: (run: BatchExportRun) => {
+ run: BatchExportRun
+ }
+ loadOlderRuns: () => any
+ loadOlderRunsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadOlderRunsSuccess: (
+ runsPaginatedResponse: PaginatedResponse<RawBatchExportRun> | null,
+ payload?: any
+ ) => {
+ runsPaginatedResponse: PaginatedResponse<RawBatchExportRun> | null
+ payload?: any
+ }
+ loadRuns: () => {
+ value: true
+ }
+ loadRunsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRunsSuccess: (
+ runsPaginatedResponse: PaginatedResponse<RawBatchExportRun>,
+ payload?: {
+ value: true
+ }
+ ) => {
+ runsPaginatedResponse: PaginatedResponse<RawBatchExportRun>
+ payload?: {
+ value: true
+ }
+ }
+ retryRun: (run: BatchExportRun) => {
+ run: BatchExportRun
+ }
+ setDateRange: (
+ from: string | null,
+ to: string | null
+ ) => {
+ from: string | null
+ to: string | null
+ }
+ switchLatestRuns: (enabled: boolean) => {
+ enabled: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchExportRunsLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ recordLabel: (arg: any) => string
+ hasMoreRunsToLoad: (runsPaginatedResponse: PaginatedResponse<RawBatchExportRun> | null) => boolean
+ loading: (runsPaginatedResponseLoading: boolean) => boolean
+ latestRuns: (runsPaginatedResponse: PaginatedResponse<RawBatchExportRun> | null) => BatchExportRun[]
+ groupedRuns: (
+ runsPaginatedResponse: PaginatedResponse<RawBatchExportRun> | null,
+ usingLatestRuns: boolean
+ ) => GroupedBatchExportRuns[]
+ }
+}
+
+export type batchExportRunsLogicType = MakeLogicType<
+ batchExportRunsLogicValues,
+ batchExportRunsLogicActions,
+ BatchExportRunsLogicProps,
+ batchExportRunsLogicMeta
+>
+
export const batchExportRunsLogic = kea<batchExportRunsLogicType>([
props({} as BatchExportRunsLogicProps),
key(({ id }) => id),
@@ -84,15 +195,18 @@ export const batchExportRunsLogic = kea<batchExportRunsLogicType>([
() => [(_, props) => props],
(props: BatchExportRunsLogicProps): string => (props.context === 'hog_function' ? 'events' : 'rows'),
],
- hasMoreRunsToLoad: [(s) => [s.runsPaginatedResponse], (runsPaginatedResponse) => !!runsPaginatedResponse?.next],
+ hasMoreRunsToLoad: [
+ (s) => [s.runsPaginatedResponse],
+ (runsPaginatedResponse: PaginatedResponse<RawBatchExportRun> | null) => !!runsPaginatedResponse?.next,
+ ],
loading: [
(s) => [s.runsPaginatedResponseLoading],
- (runsPaginatedResponseLoading) => runsPaginatedResponseLoading,
+ (runsPaginatedResponseLoading: boolean) => runsPaginatedResponseLoading,
],
latestRuns: [
// These aren't grouped because they might not include all runs for a time interval
(s) => [s.runsPaginatedResponse],
- (runsPaginatedResponse): BatchExportRun[] => {
+ (runsPaginatedResponse: PaginatedResponse<RawBatchExportRun> | null): BatchExportRun[] => {
const runs = runsPaginatedResponse?.results ?? []
return runs.map((run) => {
return {
@@ -107,7 +221,10 @@ export const batchExportRunsLogic = kea<batchExportRunsLogicType>([
],
groupedRuns: [
(s) => [s.runsPaginatedResponse, s.usingLatestRuns],
- (runsPaginatedResponse, usingLatestRuns): GroupedBatchExportRuns[] => {
+ (
+ runsPaginatedResponse: PaginatedResponse<RawBatchExportRun> | null,
+ usingLatestRuns: boolean
+ ): GroupedBatchExportRuns[] => {
if (usingLatestRuns) {
return []
}
diff --git a/frontend/src/scenes/data-pipelines/destinationsSceneLogic.ts b/frontend/src/scenes/data-pipelines/destinationsSceneLogic.ts
index 462d3a560576..b7ed5f133965 100644
--- a/frontend/src/scenes/data-pipelines/destinationsSceneLogic.ts
+++ b/frontend/src/scenes/data-pipelines/destinationsSceneLogic.ts
@@ -1,9 +1,21 @@
-import { actions, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers } from 'kea'
import { actionToUrl, router, urlToAction } from 'kea-router'
import { Breadcrumb } from '~/types'
-import type { destinationsSceneLogicType } from './destinationsSceneLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface destinationsSceneLogicValues {
+ activeTab: 'all' | 'history'
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface destinationsSceneLogicActions {
+ setActiveTab: (tab: 'all' | 'history') => {
+ tab: 'all' | 'history'
+ }
+}
+
+export type destinationsSceneLogicType = MakeLogicType<destinationsSceneLogicValues, destinationsSceneLogicActions>
export const destinationsSceneLogic = kea<destinationsSceneLogicType>([
path(['scenes', 'data-pipelines', 'destinationsSceneLogic']),
diff --git a/frontend/src/scenes/data-pipelines/event-filtering/eventFilterLogic.ts b/frontend/src/scenes/data-pipelines/event-filtering/eventFilterLogic.ts
index e17a542ec47d..3ee018cc883f 100644
--- a/frontend/src/scenes/data-pipelines/event-filtering/eventFilterLogic.ts
+++ b/frontend/src/scenes/data-pipelines/event-filtering/eventFilterLogic.ts
@@ -51,8 +51,9 @@
* implementations exist in the Django model (validation on save) and
* the Node.js ingestion pipeline (runtime filtering).
*/
-import { actions, afterMount, kea, listeners, path, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import api from 'lib/api'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
@@ -60,8 +61,6 @@ import { teamLogic } from 'scenes/teamLogic'
import { Breadcrumb } from '~/types'
-import type { eventFilterLogicType } from './eventFilterLogicType'
-
// Limits — must match MAX_CONDITIONS and MAX_TREE_DEPTH in posthog/models/event_filter_config.py
export const EVENT_FILTER_MAX_CONDITIONS = 20
export const EVENT_FILTER_MAX_DEPTH = 5
@@ -244,6 +243,126 @@ export function updateAtPath(node: FilterNode, path: TreePath, updater: (node: F
return node
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface eventFilterLogicValues {
+ allTestsPass: boolean
+ breadcrumbs: Breadcrumb[]
+ conditionCount: number
+ currentTeamId: number
+ filterForm: EventFilterFormValues
+ filterFormAllErrors: Record<string, any>
+ filterFormChanged: boolean
+ filterFormErrors: DeepPartialMap<EventFilterFormValues, ValidationErrorType>
+ filterFormHasErrors: boolean
+ filterFormManualErrors: Record<string, any>
+ filterFormTouched: boolean
+ filterFormTouches: Record<string, boolean>
+ filterFormValidationErrors: DeepPartialMap<EventFilterFormValues, ValidationErrorType>
+ isFilterFormSubmitting: boolean
+ isFilterFormValid: boolean
+ showFilterFormErrors: boolean
+ testResults: TestResult[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface eventFilterLogicActions {
+ addChild: (pathKeys: TreePath) => {
+ pathKeys: TreePath
+ }
+ addTestCase: () => {
+ value: true
+ }
+ convertToGroup: (
+ pathKeys: TreePath,
+ groupType: 'and' | 'or'
+ ) => {
+ groupType: 'and' | 'or'
+ pathKeys: TreePath
+ }
+ removeChild: (
+ pathKeys: TreePath,
+ childIndex: number
+ ) => {
+ childIndex: number
+ pathKeys: TreePath
+ }
+ removeTestCase: (index: number) => {
+ index: number
+ }
+ resetFilterForm: (values?: EventFilterFormValues) => {
+ values?: EventFilterFormValues
+ }
+ setFilterFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setFilterFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setFilterFormValues: (values: DeepPartial<EventFilterFormValues>) => {
+ values: DeepPartial<EventFilterFormValues>
+ }
+ submitFilterForm: () => {
+ value: boolean
+ }
+ submitFilterFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitFilterFormRequest: (filterForm: EventFilterFormValues) => {
+ filterForm: EventFilterFormValues
+ }
+ submitFilterFormSuccess: (filterForm: EventFilterFormValues) => {
+ filterForm: EventFilterFormValues
+ }
+ touchFilterFormField: (key: string) => {
+ key: string
+ }
+ unwrapNot: (pathKeys: TreePath) => {
+ pathKeys: TreePath
+ }
+ updateTestCase: (
+ index: number,
+ updates: Partial<TestCase>
+ ) => {
+ index: number
+ updates: Partial<TestCase>
+ }
+ updateTreeNode: (
+ pathKeys: TreePath,
+ node: FilterNode
+ ) => {
+ node: FilterNode
+ pathKeys: TreePath
+ }
+ wrapInNot: (pathKeys: TreePath) => {
+ pathKeys: TreePath
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface eventFilterLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ currentTeamId: (currentTeamId: number | null) => number
+ conditionCount: (filterForm: EventFilterFormValues) => number
+ testResults: (filterForm: EventFilterFormValues) => TestResult[]
+ allTestsPass: (testResults: TestResult[], filterForm: EventFilterFormValues) => boolean
+ }
+}
+
+export type eventFilterLogicType = MakeLogicType<
+ eventFilterLogicValues,
+ eventFilterLogicActions,
+ Record<string, any>,
+ eventFilterLogicMeta
+>
+
// --- Kea logic ---
export const eventFilterLogic = kea<eventFilterLogicType>([
diff --git a/frontend/src/scenes/data-pipelines/legacy-plugins/LegacyPluginScene.tsx b/frontend/src/scenes/data-pipelines/legacy-plugins/LegacyPluginScene.tsx
index d8acf319e122..fecabe7ae4ab 100644
--- a/frontend/src/scenes/data-pipelines/legacy-plugins/LegacyPluginScene.tsx
+++ b/frontend/src/scenes/data-pipelines/legacy-plugins/LegacyPluginScene.tsx
@@ -1,4 +1,4 @@
-import { actions, kea, key, path, props, reducers, selectors, useActions, useValues } from 'kea'
+import { MakeLogicType, actions, kea, key, path, props, reducers, selectors, useActions, useValues } from 'kea'
import { actionToUrl, router, urlToAction } from 'kea-router'
import { ActivityLog } from 'lib/components/ActivityLog/ActivityLog'
@@ -9,7 +9,6 @@ import { urls } from 'scenes/urls'
import { ActivityScope, Breadcrumb } from '~/types'
-import type { legacyPluginSceneLogicType } from './LegacyPluginSceneType'
import { PipelineNodeLogs } from './PipelineNodeLogs'
import { PipelineNodeMetrics } from './PipelineNodeMetrics'
@@ -20,6 +19,35 @@ export interface LegacyPluginSceneLogicProps {
id: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface legacyPluginSceneLogicValues {
+ breadcrumbs: Breadcrumb[]
+ currentTab: LegacyPluginSceneTab
+ logicProps: any
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface legacyPluginSceneLogicActions {
+ setCurrentTab: (tab: LegacyPluginSceneTab) => {
+ tab: 'configuration' | 'history' | 'logs' | 'metrics'
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface legacyPluginSceneLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ logicProps: (arg: any) => any
+ }
+}
+
+export type legacyPluginSceneLogicType = MakeLogicType<
+ legacyPluginSceneLogicValues,
+ legacyPluginSceneLogicActions,
+ LegacyPluginSceneLogicProps,
+ legacyPluginSceneLogicMeta
+>
+
export const legacyPluginSceneLogic = kea<legacyPluginSceneLogicType>([
props({} as LegacyPluginSceneLogicProps),
key(({ id }: LegacyPluginSceneLogicProps) => id ?? 'new'),
diff --git a/frontend/src/scenes/data-pipelines/legacy-plugins/pipelineNodeLogsLogic.tsx b/frontend/src/scenes/data-pipelines/legacy-plugins/pipelineNodeLogsLogic.tsx
index 3c25ddf9477f..a52debd7ea9d 100644
--- a/frontend/src/scenes/data-pipelines/legacy-plugins/pipelineNodeLogsLogic.tsx
+++ b/frontend/src/scenes/data-pipelines/legacy-plugins/pipelineNodeLogsLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { LemonTableColumns, Link } from '@posthog/lemon-ui'
@@ -11,8 +11,6 @@ import { teamLogic } from 'scenes/teamLogic'
import api from '~/lib/api'
import { LogEntry, LogEntryLevel, LogEntryRequestParams } from '~/types'
-import type { pipelineNodeLogsLogicType } from './pipelineNodeLogsLogicType'
-
export function LogLevelDisplay(level: LogEntryLevel): JSX.Element {
let color: string | undefined
switch (level) {
@@ -61,6 +59,122 @@ type BatchExportNodeId = {
export type PipelineNodeLimitedType = PluginNodeId | BatchExportNodeId
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface pipelineNodeLogsLogicValues {
+ currentTeamId: number | null // teamLogic
+ backgroundLogs: LogEntry[]
+ backgroundLogsLoading: boolean
+ columns: LemonTableColumns<LogEntry>
+ instanceId: string | null
+ isThereMoreToLoad: boolean
+ leadingEntry: LogEntry | null
+ logs: LogEntry[]
+ logsLoading: boolean
+ node: PipelineNodeLimitedType
+ searchTerm: string
+ selectedLogLevels: LogEntryLevel[]
+ selectedLogLevelsForAPI: LogEntryLevel[]
+ trailingEntry: LogEntry | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface pipelineNodeLogsLogicActions {
+ clearBackgroundLogs: () => {
+ value: true
+ }
+ loadLogs: () => any
+ loadLogsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadLogsSuccess: (
+ logs: LogEntry[],
+ payload?: any
+ ) => {
+ logs: LogEntry[]
+ payload?: any
+ }
+ loadMoreLogs: () => any
+ loadMoreLogsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadMoreLogsSuccess: (
+ logs: LogEntry[],
+ payload?: any
+ ) => {
+ logs: LogEntry[]
+ payload?: any
+ }
+ markLogsEnd: () => {
+ value: true
+ }
+ pollBackgroundLogs: () => any
+ pollBackgroundLogsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ pollBackgroundLogsSuccess: (
+ backgroundLogs: LogEntry[],
+ payload?: any
+ ) => {
+ backgroundLogs: LogEntry[]
+ payload?: any
+ }
+ revealBackground: () => any
+ revealBackgroundFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ revealBackgroundSuccess: (
+ logs: LogEntry[],
+ payload?: any
+ ) => {
+ logs: LogEntry[]
+ payload?: any
+ }
+ setInstanceId: (instanceId: string | null) => {
+ instanceId: string | null
+ }
+ setSearchTerm: (searchTerm: string) => {
+ searchTerm: string
+ }
+ setSelectedLogLevels: (levels: LogEntryLevel[]) => {
+ levels: LogEntryLevel[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface pipelineNodeLogsLogicMeta {
+ key: number | string
+ __keaTypeGenInternalSelectorTypes: {
+ node: (id: number | string) => PipelineNodeLimitedType
+ leadingEntry: (logs: LogEntry[], backgroundLogs: LogEntry[]) => LogEntry | null
+ trailingEntry: (logs: LogEntry[], backgroundLogs: LogEntry[]) => LogEntry | null
+ columns: (node: PipelineNodeLimitedType) => LemonTableColumns<LogEntry>
+ selectedLogLevelsForAPI: (selectedLogLevels: LogEntryLevel[]) => LogEntryLevel[]
+ }
+}
+
+export type pipelineNodeLogsLogicType = MakeLogicType<
+ pipelineNodeLogsLogicValues,
+ pipelineNodeLogsLogicActions,
+ PipelineNodeLogsLogicProps,
+ pipelineNodeLogsLogicMeta
+>
+
export const pipelineNodeLogsLogic = kea<pipelineNodeLogsLogicType>([
props({} as PipelineNodeLogsLogicProps),
key(({ id }) => id),
@@ -199,7 +313,7 @@ export const pipelineNodeLogsLogic = kea<pipelineNodeLogsLogicType>([
selectors(({ actions, values }) => ({
node: [
(_, p) => [p.id],
- (id): PipelineNodeLimitedType => {
+ (id: number | string): PipelineNodeLimitedType => {
if (typeof id === 'string') {
return { backend: PipelineBackend.BatchExport, id }
}
@@ -233,7 +347,7 @@ export const pipelineNodeLogsLogic = kea<pipelineNodeLogsLogicType>([
],
columns: [
(s) => [s.node],
- (node): LemonTableColumns<LogEntry> => {
+ (node: PipelineNodeLimitedType): LemonTableColumns<LogEntry> => {
return [
{
title: 'Timestamp',
@@ -288,7 +402,7 @@ export const pipelineNodeLogsLogic = kea<pipelineNodeLogsLogicType>([
selectedLogLevelsForAPI: [
(s) => [s.selectedLogLevels],
- (logLevels): LogEntryLevel[] => {
+ (logLevels: LogEntryLevel[]): LogEntryLevel[] => {
const uniqueLevels = new Set(logLevels)
if (uniqueLevels.has('WARN')) {
uniqueLevels.add('WARNING')
diff --git a/frontend/src/scenes/data-pipelines/legacy-plugins/pipelinePluginConfigurationLogic.tsx b/frontend/src/scenes/data-pipelines/legacy-plugins/pipelinePluginConfigurationLogic.tsx
index 911e2c7ac55f..7dc8f9e5d3fb 100644
--- a/frontend/src/scenes/data-pipelines/legacy-plugins/pipelinePluginConfigurationLogic.tsx
+++ b/frontend/src/scenes/data-pipelines/legacy-plugins/pipelinePluginConfigurationLogic.tsx
@@ -1,5 +1,6 @@
-import { afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import { beforeUnload, router } from 'kea-router'
@@ -11,13 +12,13 @@ import { urls } from 'scenes/urls'
import { PluginConfigWithPluginInfoNew, PluginType } from '~/types'
+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'
import {
defaultConfigForPlugin,
determineInvisibleFields,
determineRequiredFields,
getPluginConfigFormData,
} from './configUtils'
-import type { pipelinePluginConfigurationLogicType } from './pipelinePluginConfigurationLogicType'
export interface PipelinePluginConfigurationLogicProps {
pluginId: number | null
@@ -43,6 +44,160 @@ function getDefaultConfiguration(plugin: PluginType): Record<string, any> {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface pipelinePluginConfigurationLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ currentOrganizationId: string // organizationLogic
+ currentTeamId: number | null // teamLogic
+ configuration: Record<string, any>
+ configurationAllErrors: Record<string, any>
+ configurationChanged: boolean
+ configurationErrors: DeepPartialMap<Record<string, any>, ValidationErrorType>
+ configurationHasErrors: boolean
+ configurationManualErrors: Record<string, any>
+ configurationTouched: boolean
+ configurationTouches: Record<string, boolean>
+ configurationValidationErrors: DeepPartialMap<Record<string, any>, ValidationErrorType>
+ hiddenFields: string[]
+ isConfigurationSubmitting: boolean
+ isConfigurationValid: boolean
+ isNew: boolean
+ loading: boolean
+ plugin: PluginType | null
+ pluginConfig: PluginConfigWithPluginInfoNew | null
+ pluginConfigLoading: boolean
+ pluginFromPluginId: PluginType | null
+ pluginFromPluginIdLoading: boolean
+ requiredFields: string[]
+ savedConfiguration: Record<string, any> | undefined
+ showConfigurationErrors: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface pipelinePluginConfigurationLogicActions {
+ loadPlugin: () => any
+ loadPluginConfig: () => any
+ loadPluginConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadPluginConfigSuccess: (
+ pluginConfig: PluginConfigWithPluginInfoNew | null,
+ payload?: any
+ ) => {
+ pluginConfig: PluginConfigWithPluginInfoNew | null
+ payload?: any
+ }
+ loadPluginFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadPluginSuccess: (
+ pluginFromPluginId: PluginType | null,
+ payload?: any
+ ) => {
+ pluginFromPluginId: PluginType | null
+ payload?: any
+ }
+ migrateToHogFunction: () => any
+ migrateToHogFunctionFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ migrateToHogFunctionSuccess: (
+ pluginConfig: PluginConfigWithPluginInfoNew | null,
+ payload?: any
+ ) => {
+ pluginConfig: PluginConfigWithPluginInfoNew | null
+ payload?: any
+ }
+ resetConfiguration: (values?: Record<string, any>) => {
+ values?: Record<string, any>
+ }
+ setConfigurationManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setConfigurationValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setConfigurationValues: (values: DeepPartial<Record<string, any>>) => {
+ values: DeepPartial<Record<string, any>>
+ }
+ submitConfiguration: () => {
+ value: boolean
+ }
+ submitConfigurationFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitConfigurationRequest: (configuration: Record<string, any>) => {
+ configuration: Record<string, any>
+ }
+ submitConfigurationSuccess: (configuration: Record<string, any>) => {
+ configuration: Record<string, any>
+ }
+ touchConfigurationField: (key: string) => {
+ key: string
+ }
+ updatePluginConfig: (formdata: Record<string, any>) => Record<string, any>
+ updatePluginConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updatePluginConfigSuccess: (
+ pluginConfig: PluginConfigWithPluginInfoNew | null,
+ payload?: Record<string, any>
+ ) => {
+ pluginConfig: PluginConfigWithPluginInfoNew | null
+ payload?: Record<string, any>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface pipelinePluginConfigurationLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ plugin: (
+ pluginFromPluginId: PluginType | null,
+ pluginConfig: PluginConfigWithPluginInfoNew | null
+ ) => PluginType | null
+ loading: (pluginFromPluginIdLoading: boolean, pluginConfigLoading: boolean) => boolean
+ savedConfiguration: (
+ pluginConfig: PluginConfigWithPluginInfoNew | null,
+ plugin: PluginType | null
+ ) => Record<string, any> | undefined
+ requiredFields: (plugin: PluginType | null, configuration: Record<string, any>) => string[]
+ hiddenFields: (plugin: PluginType | null, configuration: Record<string, any>) => string[]
+ isNew: (pluginConfigId: number | null) => boolean
+ }
+}
+
+export type pipelinePluginConfigurationLogicType = MakeLogicType<
+ pipelinePluginConfigurationLogicValues,
+ pipelinePluginConfigurationLogicActions,
+ PipelinePluginConfigurationLogicProps,
+ pipelinePluginConfigurationLogicMeta
+>
+
export const pipelinePluginConfigurationLogic = kea<pipelinePluginConfigurationLogicType>([
props({} as PipelinePluginConfigurationLogicProps),
key(({ pluginId, pluginConfigId }: PipelinePluginConfigurationLogicProps) => {
@@ -170,15 +325,16 @@ export const pipelinePluginConfigurationLogic = kea<pipelinePluginConfigurationL
selectors(() => ({
plugin: [
(s) => [s.pluginFromPluginId, s.pluginConfig],
- (pluginFromId, pluginConfig) => pluginConfig?.plugin_info || pluginFromId,
+ (pluginFromId: PluginType | null, pluginConfig: PluginConfigWithPluginInfoNew | null) =>
+ pluginConfig?.plugin_info || pluginFromId,
],
loading: [
(s) => [s.pluginFromPluginIdLoading, s.pluginConfigLoading],
- (pluginLoading, pluginConfigLoading) => pluginLoading || pluginConfigLoading,
+ (pluginLoading: boolean, pluginConfigLoading: boolean) => pluginLoading || pluginConfigLoading,
],
savedConfiguration: [
(s) => [s.pluginConfig, s.plugin],
- (pluginConfig, plugin) => {
+ (pluginConfig: PluginConfigWithPluginInfoNew | null, plugin: PluginType | null) => {
if (!pluginConfig || !plugin) {
return {}
}
@@ -192,7 +348,7 @@ export const pipelinePluginConfigurationLogic = kea<pipelinePluginConfigurationL
],
requiredFields: [
(s) => [s.plugin, s.configuration],
- (plugin, configuration): string[] => {
+ (plugin: PluginType | null, configuration: Record<string, any>): string[] => {
if (!plugin || !configuration) {
return []
}
@@ -201,14 +357,14 @@ export const pipelinePluginConfigurationLogic = kea<pipelinePluginConfigurationL
],
hiddenFields: [
(s) => [s.plugin, s.configuration],
- (plugin, configuration): string[] => {
+ (plugin: PluginType | null, configuration: Record<string, any>): string[] => {
if (!plugin || !configuration) {
return []
}
return determineInvisibleFields((fieldName) => configuration[fieldName], plugin)
},
],
- isNew: [(_, p) => [p.pluginConfigId], (pluginConfigId): boolean => !pluginConfigId],
+ isNew: [(_, p) => [p.pluginConfigId], (pluginConfigId: number | null): boolean => !pluginConfigId],
})),
forms(({ asyncActions, values }) => ({
configuration: {
diff --git a/frontend/src/scenes/data-pipelines/transformationsSceneLogic.ts b/frontend/src/scenes/data-pipelines/transformationsSceneLogic.ts
index c98379d8abd6..f3db6749cf0e 100644
--- a/frontend/src/scenes/data-pipelines/transformationsSceneLogic.ts
+++ b/frontend/src/scenes/data-pipelines/transformationsSceneLogic.ts
@@ -1,8 +1,9 @@
-import { kea, path } from 'kea'
+import { MakeLogicType, kea, path } from 'kea'
import { Breadcrumb } from '~/types'
-import type { transformationsSceneLogicType } from './transformationsSceneLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export type transformationsSceneLogicType = MakeLogicType<{}, {}>
export const transformationsSceneLogic = kea<transformationsSceneLogicType>([
path(['scenes', 'data-pipelines', 'transformationsSceneLogic']),
diff --git a/frontend/src/scenes/data-pipelines/utils/nonHogFunctionTemplatesLogic.tsx b/frontend/src/scenes/data-pipelines/utils/nonHogFunctionTemplatesLogic.tsx
index cb9dab9c43b7..bd5517dc8808 100644
--- a/frontend/src/scenes/data-pipelines/utils/nonHogFunctionTemplatesLogic.tsx
+++ b/frontend/src/scenes/data-pipelines/utils/nonHogFunctionTemplatesLogic.tsx
@@ -1,4 +1,4 @@
-import { connect, kea, path, props, selectors } from 'kea'
+import { MakeLogicType, connect, kea, path, props, selectors } from 'kea'
import { Link } from '@posthog/lemon-ui'
@@ -13,8 +13,9 @@ import { BATCH_EXPORT_SERVICE_NAMES, HogFunctionTemplateStatus, HogFunctionTempl
import { sourceWizardLogic } from 'products/data_warehouse/frontend/scenes/NewSourceScene/sourceWizardLogic'
import { DATA_WAREHOUSE_SOURCE_ICON_MAP } from 'products/data_warehouse/frontend/shared/components/SourceIcon'
+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'
+import type { ManualLinkSourceType, UserType } from '../../../types'
import { BATCH_EXPORT_ICON_MAP } from '../batch-exports/BatchExportIcon'
-import type { nonHogFunctionTemplatesLogicType } from './nonHogFunctionTemplatesLogicType'
export interface NonHogFunctionTemplatesLogicProps {
availableSources: Record<string, SourceConfig>
@@ -54,6 +55,44 @@ export function getSourceDisplayStatus(unreleased: boolean, featureFlag: boolean
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface nonHogFunctionTemplatesLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ connectors: SourceConfig[] // sourceWizardLogic
+ manualConnectors: {
+ name: string
+ type: ManualLinkSourceType
+ }[] // sourceWizardLogic
+ user: UserType | null // userLogic
+ hogFunctionTemplatesBatchExports: HogFunctionTemplateType[]
+ hogFunctionTemplatesDataWarehouseSources: HogFunctionTemplateType[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface nonHogFunctionTemplatesLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hogFunctionTemplatesDataWarehouseSources: (
+ connectors: SourceConfig[],
+ manualConnectors: {
+ name: string
+ type: ManualLinkSourceType
+ }[],
+ featureFlags: FeatureFlagsSet
+ ) => HogFunctionTemplateType[]
+ hogFunctionTemplatesBatchExports: (
+ featureFlags: FeatureFlagsSet,
+ user: UserType | null
+ ) => HogFunctionTemplateType[]
+ }
+}
+
+export type nonHogFunctionTemplatesLogicType = MakeLogicType<
+ nonHogFunctionTemplatesLogicValues,
+ {},
+ NonHogFunctionTemplatesLogicProps,
+ nonHogFunctionTemplatesLogicMeta
+>
+
export const nonHogFunctionTemplatesLogic = kea<nonHogFunctionTemplatesLogicType>([
props({} as NonHogFunctionTemplatesLogicProps),
path((key) => ['scenes', 'data-pipelines', 'utils', 'nonHogFunctionTemplatesLogic', key]),
@@ -72,7 +111,14 @@ export const nonHogFunctionTemplatesLogic = kea<nonHogFunctionTemplatesLogicType
selectors({
hogFunctionTemplatesDataWarehouseSources: [
(s) => [s.connectors, s.manualConnectors, s.featureFlags],
- (connectors, manualConnectors, featureFlags): HogFunctionTemplateType[] => {
+ (
+ connectors: SourceConfig[],
+ manualConnectors: {
+ name: string
+ type: import('~/types').ManualLinkSourceType
+ }[],
+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet
+ ): HogFunctionTemplateType[] => {
const managed = connectors.map((connector: SourceConfig): HogFunctionTemplateType => {
const featureFlagDefined = !!connector.featureFlag
const featureFlagRaw = featureFlags[connector.featureFlag as FeatureFlagKey]
@@ -137,7 +183,10 @@ export const nonHogFunctionTemplatesLogic = kea<nonHogFunctionTemplatesLogicType
hogFunctionTemplatesBatchExports: [
(s) => [s.featureFlags, s.user],
- (featureFlags, user): HogFunctionTemplateType[] => {
+ (
+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet,
+ user: null | import('~/types').UserType
+ ): HogFunctionTemplateType[] => {
// HTTP is currently only used for Cloud to Cloud migrations and shouldn't be accessible to users
const httpEnabled =
featureFlags[FEATURE_FLAGS.BATCH_EXPORTS_POSTHOG_HTTP] || user?.is_impersonated || user?.is_staff
diff --git a/frontend/src/scenes/data-pipelines/utils/nonHogFunctionsLogic.tsx b/frontend/src/scenes/data-pipelines/utils/nonHogFunctionsLogic.tsx
index 76e230eb3b6b..4e343ba311cc 100644
--- a/frontend/src/scenes/data-pipelines/utils/nonHogFunctionsLogic.tsx
+++ b/frontend/src/scenes/data-pipelines/utils/nonHogFunctionsLogic.tsx
@@ -1,4 +1,4 @@
-import { connect, kea, path } from 'kea'
+import { MakeLogicType, connect, kea, path } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -12,9 +12,77 @@ import { HogFunctionType, PluginConfigTypeNew, PluginType } from '~/types'
import { sourceWizardLogic } from 'products/data_warehouse/frontend/scenes/NewSourceScene/sourceWizardLogic'
+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'
+import type { SourceConfig } from '../../../queries/schema/schema-general'
+import type { UserType } from '../../../types'
import { BATCH_EXPORT_ICON_MAP } from '../batch-exports/BatchExportIcon'
import { humanizeBatchExportDescription } from '../batch-exports/utils'
-import type { nonHogFunctionsLogicType } from './nonHogFunctionsLogicType'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface nonHogFunctionsLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ currentOrganizationId: string // organizationLogic
+ connectors: SourceConfig[] // sourceWizardLogic
+ currentProjectId: number | string // teamLogic
+ user: UserType | null // userLogic
+ hogFunctionBatchExports: HogFunctionType[] | null
+ hogFunctionBatchExportsLoading: boolean
+ hogFunctionPluginsDestinations: HogFunctionType[] | null
+ hogFunctionPluginsDestinationsLoading: boolean
+ hogFunctionPluginsSiteApps: HogFunctionType[] | null
+ hogFunctionPluginsSiteAppsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface nonHogFunctionsLogicActions {
+ loadHogFunctionBatchExports: () => any
+ loadHogFunctionBatchExportsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadHogFunctionBatchExportsSuccess: (
+ hogFunctionBatchExports: HogFunctionType[],
+ payload?: any
+ ) => {
+ hogFunctionBatchExports: HogFunctionType[]
+ payload?: any
+ }
+ loadHogFunctionPluginsDestinations: () => any
+ loadHogFunctionPluginsDestinationsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadHogFunctionPluginsDestinationsSuccess: (
+ hogFunctionPluginsDestinations: HogFunctionType[],
+ payload?: any
+ ) => {
+ hogFunctionPluginsDestinations: HogFunctionType[]
+ payload?: any
+ }
+ loadHogFunctionPluginsSiteApps: () => any
+ loadHogFunctionPluginsSiteAppsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadHogFunctionPluginsSiteAppsSuccess: (
+ hogFunctionPluginsSiteApps: HogFunctionType[],
+ payload?: any
+ ) => {
+ hogFunctionPluginsSiteApps: HogFunctionType[]
+ payload?: any
+ }
+}
+
+export type nonHogFunctionsLogicType = MakeLogicType<nonHogFunctionsLogicValues, nonHogFunctionsLogicActions>
export const nonHogFunctionsLogic = kea<nonHogFunctionsLogicType>([
path((key) => ['scenes', 'data-pipelines', 'utils', 'nonHogFunctionsLogic', key]),
diff --git a/frontend/src/scenes/data-pipelines/webScriptsSceneLogic.ts b/frontend/src/scenes/data-pipelines/webScriptsSceneLogic.ts
index 996d12231e0b..7eb5713f777d 100644
--- a/frontend/src/scenes/data-pipelines/webScriptsSceneLogic.ts
+++ b/frontend/src/scenes/data-pipelines/webScriptsSceneLogic.ts
@@ -1,9 +1,21 @@
-import { actions, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers } from 'kea'
import { actionToUrl, router, urlToAction } from 'kea-router'
import { Breadcrumb } from '~/types'
-import type { webScriptsSceneLogicType } from './webScriptsSceneLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface webScriptsSceneLogicValues {
+ activeTab: 'all' | 'history'
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface webScriptsSceneLogicActions {
+ setActiveTab: (tab: 'all' | 'history') => {
+ tab: 'all' | 'history'
+ }
+}
+
+export type webScriptsSceneLogicType = MakeLogicType<webScriptsSceneLogicValues, webScriptsSceneLogicActions>
export const webScriptsSceneLogic = kea<webScriptsSceneLogicType>([
path(['scenes', 'data-pipelines', 'webScriptsSceneLogic']),
diff --git a/frontend/src/scenes/groups/groupLogic.ts b/frontend/src/scenes/groups/groupLogic.ts
index 0ac2d4115273..6fcc5e0f1989 100644
--- a/frontend/src/scenes/groups/groupLogic.ts
+++ b/frontend/src/scenes/groups/groupLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router, urlToAction } from 'kea-router'
import posthog from 'posthog-js'
@@ -26,7 +26,9 @@ import { ActivityScope, Breadcrumb, Group, GroupTypeIndex, PropertyFilterType, P
import { CUSTOMER_ANALYTICS_DEFAULT_QUERY_TAGS } from 'products/customer_analytics/frontend/constants'
import { revenueAnalyticsLogic } from 'products/revenue_analytics/frontend/revenueAnalyticsLogic'
-import type { groupLogicType } from './groupLogicType'
+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'
+import type { Noun } from '../../models/groupsModel'
+import type { GroupType } from '../../types'
function getGroupEventsQuery(groupTypeIndex: number, groupKey: string): DataTableNode {
return {
@@ -69,6 +71,178 @@ export function resolveBackNavigation(searchParams: Record<string, any>): GroupB
return { url, name: typeof name === 'string' && name ? name : 'Back' }
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun // groupsModel
+ groupTypes: Map<GroupTypeIndex, GroupType> // groupsModel
+ isRevenueAnalyticsEnabled: boolean // revenueAnalyticsLogic
+ currentTeamId: number | null // teamLogic
+ backNavigation: GroupBackNavigation | null
+ backTo: Breadcrumb
+ breadcrumbs: Breadcrumb[]
+ effectiveLifetimeValue: {
+ source: 'properties' | 'revenue-analytics' | null
+ value: number | null
+ }
+ effectiveMRR: {
+ source: 'properties' | 'revenue-analytics' | null
+ value: number | null
+ }
+ groupData: Group | null
+ groupDataLoading: boolean
+ groupEventsQuery: DataTableNode | null
+ groupEventsQueryIsDirty: boolean
+ groupRevenueAnalyticsData: {
+ lifetimeValue: number | null
+ mrr: number | null
+ } | null
+ groupRevenueAnalyticsDataLoading: boolean
+ groupTab: string | null
+ groupType: string | null
+ groupTypeDetailDashboard: number | null
+ groupTypeName: string
+ groupTypeNamePlural: string
+ hasRevenueData: boolean
+ logicProps: GroupLogicProps
+ sidePanelContext: SidePanelSceneContext | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupLogicActions {
+ createDetailDashboard: (groupTypeIndex: number) => number // groupsModel
+ deleteProperty: (key: string) => {
+ key: string
+ }
+ editProperty: (
+ key: string,
+ newValue?: boolean | number | string | null
+ ) => {
+ key: string
+ newValue: boolean | number | string | null | undefined
+ }
+ loadGroup: () => any
+ loadGroupFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadGroupRevenueAnalyticsData: () => any
+ loadGroupRevenueAnalyticsDataFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadGroupRevenueAnalyticsDataSuccess: (
+ groupRevenueAnalyticsData: {
+ lifetimeValue: any
+ mrr: any
+ } | null,
+ payload?: any
+ ) => {
+ groupRevenueAnalyticsData: {
+ lifetimeValue: any
+ mrr: any
+ } | null
+ payload?: any
+ }
+ loadGroupSuccess: (
+ groupData: Group | null,
+ payload?: any
+ ) => {
+ groupData: Group | null
+ payload?: any
+ }
+ resetGroupEventsQuery: () => {
+ value: true
+ }
+ setGroupData: (group: Group) => {
+ group: Group
+ }
+ setGroupEventsQuery: (query: Node) => {
+ query: Node<Record<string, any>>
+ }
+ setGroupTab: (groupTab: string | null) => {
+ groupTab: string | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ logicProps: (arg: any) => GroupLogicProps
+ groupEventsQueryIsDirty: (
+ groupEventsQuery: DataTableNode | null,
+ groupTypeIndex: number,
+ groupKey: string
+ ) => boolean
+ groupTypeName: (
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun,
+ groupTypeIndex: number
+ ) => string
+ groupTypeNamePlural: (
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun,
+ groupTypeIndex: number
+ ) => string
+ groupType: (groupTypes: Map<GroupTypeIndex, GroupType>, groupTypeIndex: number) => string | null
+ groupTypeDetailDashboard: (groupTypes: Map<GroupTypeIndex, GroupType>, groupTypeIndex: number) => number | null
+ effectiveMRR: (
+ groupRevenueAnalyticsData: {
+ lifetimeValue: number | null
+ mrr: number | null
+ } | null,
+ groupData: Group | null
+ ) => {
+ source: 'properties' | 'revenue-analytics' | null
+ value: number | null
+ }
+ effectiveLifetimeValue: (
+ groupRevenueAnalyticsData: {
+ lifetimeValue: number | null
+ mrr: number | null
+ } | null,
+ groupData: Group | null
+ ) => {
+ source: 'properties' | 'revenue-analytics' | null
+ value: number | null
+ }
+ hasRevenueData: (
+ effectiveMRR: {
+ source: 'properties' | 'revenue-analytics' | null
+ value: number | null
+ },
+ effectiveLifetimeValue: {
+ source: 'properties' | 'revenue-analytics' | null
+ value: number | null
+ }
+ ) => boolean
+ backNavigation: (searchParams: Record<string, any>) => GroupBackNavigation | null
+ backTo: (
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun,
+ groupTypeIndex: number,
+ backNavigation: GroupBackNavigation | null
+ ) => Breadcrumb
+ breadcrumbs: (
+ groupTypeName: string,
+ groupTypeIndex: number,
+ groupKey: string,
+ groupData: Group | null
+ ) => Breadcrumb[]
+ sidePanelContext: (
+ groupTypeIndex: number,
+ groupKey: string,
+ featureFlags: FeatureFlagsSet
+ ) => SidePanelSceneContext | null
+ }
+}
+
+export type groupLogicType = MakeLogicType<groupLogicValues, groupLogicActions, GroupLogicProps, groupLogicMeta>
+
export const groupLogic = kea<groupLogicType>([
props({} as GroupLogicProps),
key(({ groupKey, groupTypeIndex }) => `${groupTypeIndex}-${groupKey}`),
@@ -236,7 +410,7 @@ export const groupLogic = kea<groupLogicType>([
groupEventsQueryIsDirty: [
(s, p) => [s.groupEventsQuery, p.groupTypeIndex, p.groupKey],
- (groupEventsQuery, groupTypeIndex, groupKey): boolean => {
+ (groupEventsQuery: DataTableNode | null, groupTypeIndex: number, groupKey: string): boolean => {
if (!groupEventsQuery) {
return false
}
@@ -246,24 +420,44 @@ export const groupLogic = kea<groupLogicType>([
groupTypeName: [
(s, p) => [s.aggregationLabel, p.groupTypeIndex],
- (aggregationLabel, index): string => aggregationLabel(index).singular,
+ (
+ aggregationLabel: (
+ groupTypeIndex: number | null | undefined,
+ deferToUserWording?: boolean
+ ) => import('~/models/groupsModel').Noun,
+ index: number
+ ): string => aggregationLabel(index).singular,
],
groupTypeNamePlural: [
(s, p) => [s.aggregationLabel, p.groupTypeIndex],
- (aggregationLabel, index): string => aggregationLabel(index).plural,
+ (
+ aggregationLabel: (
+ groupTypeIndex: number | null | undefined,
+ deferToUserWording?: boolean
+ ) => import('~/models/groupsModel').Noun,
+ index: number
+ ): string => aggregationLabel(index).plural,
],
groupType: [
(s, p) => [s.groupTypes, p.groupTypeIndex],
- (groupTypes, index): string | null => groupTypes.get(index as GroupTypeIndex)?.group_type ?? null,
+ (groupTypes: Map<GroupTypeIndex, import('~/types').GroupType>, index: number): string | null =>
+ groupTypes.get(index as GroupTypeIndex)?.group_type ?? null,
],
groupTypeDetailDashboard: [
(s, p) => [s.groupTypes, p.groupTypeIndex],
- (groupTypes, index): number | null => groupTypes.get(index as GroupTypeIndex)?.detail_dashboard ?? null,
+ (groupTypes: Map<GroupTypeIndex, import('~/types').GroupType>, index: number): number | null =>
+ groupTypes.get(index as GroupTypeIndex)?.detail_dashboard ?? null,
],
// Combine revenue analytics with group properties, prioritizing analytics
effectiveMRR: [
(s) => [s.groupRevenueAnalyticsData, s.groupData],
- (revenueData, groupData): { value: number | null; source: 'revenue-analytics' | 'properties' | null } => {
+ (
+ revenueData: {
+ lifetimeValue: number | null
+ mrr: number | null
+ } | null,
+ groupData: Group | null
+ ): { value: number | null; source: 'revenue-analytics' | 'properties' | null } => {
// Use pre-calculated data if available
if (revenueData?.mrr !== null && revenueData?.mrr !== undefined) {
return { value: revenueData.mrr, source: 'revenue-analytics' }
@@ -278,7 +472,13 @@ export const groupLogic = kea<groupLogicType>([
],
effectiveLifetimeValue: [
(s) => [s.groupRevenueAnalyticsData, s.groupData],
- (revenueData, groupData): { value: number | null; source: 'revenue-analytics' | 'properties' | null } => {
+ (
+ revenueData: {
+ lifetimeValue: number | null
+ mrr: number | null
+ } | null,
+ groupData: Group | null
+ ): { value: number | null; source: 'revenue-analytics' | 'properties' | null } => {
// Use pre-calculated data if available
if (revenueData?.lifetimeValue !== null && revenueData?.lifetimeValue !== undefined) {
return { value: revenueData.lifetimeValue, source: 'revenue-analytics' }
@@ -293,15 +493,31 @@ export const groupLogic = kea<groupLogicType>([
],
hasRevenueData: [
(s) => [s.effectiveMRR, s.effectiveLifetimeValue],
- (mrr, ltv): boolean => mrr.value !== null || ltv.value !== null,
+ (
+ mrr: {
+ source: 'properties' | 'revenue-analytics' | null
+ value: number | null
+ },
+ ltv: {
+ source: 'properties' | 'revenue-analytics' | null
+ value: number | null
+ }
+ ): boolean => mrr.value !== null || ltv.value !== null,
],
backNavigation: [
() => [router.selectors.searchParams],
- (searchParams): GroupBackNavigation | null => resolveBackNavigation(searchParams),
+ (searchParams: Record<string, any>): GroupBackNavigation | null => resolveBackNavigation(searchParams),
],
backTo: [
(s, p) => [s.aggregationLabel, p.groupTypeIndex, s.backNavigation],
- (aggregationLabel, groupTypeIndex, backNavigation): Breadcrumb => {
+ (
+ aggregationLabel: (
+ groupTypeIndex: number | null | undefined,
+ deferToUserWording?: boolean
+ ) => import('~/models/groupsModel').Noun,
+ groupTypeIndex: number,
+ backNavigation: GroupBackNavigation | null
+ ): Breadcrumb => {
if (backNavigation) {
return { key: 'group-back', name: backNavigation.name, path: backNavigation.url }
}
@@ -314,7 +530,12 @@ export const groupLogic = kea<groupLogicType>([
],
breadcrumbs: [
(s, p) => [s.groupTypeName, p.groupTypeIndex, p.groupKey, s.groupData],
- (groupTypeName, groupTypeIndex, groupKey, groupData): Breadcrumb[] => {
+ (
+ groupTypeName: string,
+ groupTypeIndex: number,
+ groupKey: string,
+ groupData: Group | null
+ ): Breadcrumb[] => {
const breadcrumbs: Breadcrumb[] = []
breadcrumbs.push({
key: Scene.DataManagement,
@@ -340,7 +561,11 @@ export const groupLogic = kea<groupLogicType>([
],
[SIDE_PANEL_CONTEXT_KEY]: [
(s, p) => [p.groupTypeIndex, p.groupKey, s.featureFlags],
- (groupTypeIndex, groupKey, featureFlags): SidePanelSceneContext | null => {
+ (
+ groupTypeIndex: number,
+ groupKey: string,
+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet
+ ): SidePanelSceneContext | null => {
if (!featureFlags[FEATURE_FLAGS.CUSTOMER_ANALYTICS]) {
return null
}
diff --git a/frontend/src/scenes/groups/groupsListLogic.ts b/frontend/src/scenes/groups/groupsListLogic.ts
index 88f395882a49..250c722bc93e 100644
--- a/frontend/src/scenes/groups/groupsListLogic.ts
+++ b/frontend/src/scenes/groups/groupsListLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers } from 'kea'
import { actionToUrl, router, urlToAction } from 'kea-router'
import posthog from 'posthog-js'
@@ -9,7 +9,8 @@ import { groupsModel } from '~/models/groupsModel'
import { DataTableNode, NodeKind, ProductKey } from '~/queries/schema/schema-general'
import { GroupPropertyFilter, GroupTypeIndex } from '~/types'
-import type { groupsListLogicType } from './groupsListLogicType'
+import type { Noun } from '../../models/groupsModel'
+import type { GroupType } from '../../types'
export interface GroupsListLogicProps {
groupTypeIndex: GroupTypeIndex | number
@@ -39,6 +40,43 @@ export const GROUPS_LIST_DEFAULT_QUERY = (groupTypeIndex: GroupTypeIndex | numbe
contextKey: `group-${groupTypeIndex}-list`,
}) as DataTableNode
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupsListLogicValues {
+ groupsEnabled: boolean // groupsAccessLogic
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun // groupsModel
+ groupTypes: Map<GroupTypeIndex, GroupType> // groupsModel
+ currentTeamId: number | null // teamLogic
+ groupFilters: GroupPropertyFilter[]
+ query: DataTableNode
+ queryWasModified: boolean
+ sorting: string[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupsListLogicActions {
+ setGroupFilters: (filters: GroupPropertyFilter[]) => {
+ filters: GroupPropertyFilter[]
+ }
+ setQuery: (query: DataTableNode) => {
+ query: DataTableNode
+ }
+ setQueryWasModified: (queryWasModified: boolean) => {
+ queryWasModified: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupsListLogicMeta {
+ key: number
+}
+
+export type groupsListLogicType = MakeLogicType<
+ groupsListLogicValues,
+ groupsListLogicActions,
+ GroupsListLogicProps,
+ groupsListLogicMeta
+>
+
export const groupsListLogic = kea<groupsListLogicType>([
props({} as GroupsListLogicProps),
key((props: GroupsListLogicProps) => props.groupTypeIndex),
diff --git a/frontend/src/scenes/groups/groupsNewLogic.ts b/frontend/src/scenes/groups/groupsNewLogic.ts
index f3c31f19ed89..3ade99613012 100644
--- a/frontend/src/scenes/groups/groupsNewLogic.ts
+++ b/frontend/src/scenes/groups/groupsNewLogic.ts
@@ -1,5 +1,19 @@
-import { actions, afterMount, beforeUnmount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ afterMount,
+ beforeUnmount,
+ connect,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ reducers,
+ selectors,
+} from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import { actionToUrl } from 'kea-router'
import { router } from 'kea-router'
@@ -15,7 +29,8 @@ import { urls } from 'scenes/urls'
import { groupsModel } from '~/models/groupsModel'
import { Breadcrumb, CreateGroupParams, Group, GroupTypeIndex } from '~/types'
-import type { groupsNewLogicType } from './groupsNewLogicType'
+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'
+import type { Noun } from '../../models/groupsModel'
export type GroupsNewLogicProps = {
groupTypeIndex: number
@@ -36,6 +51,119 @@ export interface GroupProperty {
const NEW_GROUP = {} as NewGroupFormData
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupsNewLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun // groupsModel
+ breadcrumbs: Breadcrumb[]
+ createdGroup: Group | null
+ createdGroupLoading: boolean
+ customProperties: GroupProperty[]
+ group: NewGroupFormData
+ groupAllErrors: Record<string, any>
+ groupChanged: boolean
+ groupErrors: DeepPartialMap<NewGroupFormData, ValidationErrorType>
+ groupHasErrors: boolean
+ groupManualErrors: Record<string, any>
+ groupTouched: boolean
+ groupTouches: Record<string, boolean>
+ groupTypeName: string
+ groupTypeNamePlural: string
+ groupValidationErrors: DeepPartialMap<NewGroupFormData, ValidationErrorType>
+ isGroupSubmitting: boolean
+ isGroupValid: boolean
+ logicProps: GroupsNewLogicProps
+ showGroupErrors: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupsNewLogicActions {
+ addFormProperty: () => {}
+ removeFormProperty: (index: number) => {
+ index: number
+ }
+ resetGroup: (values?: NewGroupFormData) => {
+ values?: NewGroupFormData
+ }
+ saveGroup: (groupParams: CreateGroupParams) => {
+ groupParams: CreateGroupParams
+ }
+ saveGroupFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ saveGroupSuccess: (
+ createdGroup: Group,
+ payload?: {
+ groupParams: CreateGroupParams
+ }
+ ) => {
+ createdGroup: Group
+ payload?: {
+ groupParams: CreateGroupParams
+ }
+ }
+ setGroupManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setGroupValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setGroupValues: (values: DeepPartial<NewGroupFormData>) => {
+ values: DeepPartial<NewGroupFormData>
+ }
+ submitGroup: () => {
+ value: boolean
+ }
+ submitGroupFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitGroupRequest: (group: NewGroupFormData) => {
+ group: NewGroupFormData
+ }
+ submitGroupSuccess: (group: NewGroupFormData) => {
+ group: NewGroupFormData
+ }
+ touchGroupField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupsNewLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ logicProps: (arg: any) => GroupsNewLogicProps
+ groupTypeName: (
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun,
+ logicProps: GroupsNewLogicProps
+ ) => string
+ groupTypeNamePlural: (
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun,
+ logicProps: GroupsNewLogicProps
+ ) => string
+ breadcrumbs: (logicProps: GroupsNewLogicProps, groupTypeName: string) => Breadcrumb[]
+ }
+}
+
+export type groupsNewLogicType = MakeLogicType<
+ groupsNewLogicValues,
+ groupsNewLogicActions,
+ GroupsNewLogicProps,
+ groupsNewLogicMeta
+>
+
export const groupsNewLogic = kea<groupsNewLogicType>([
props({} as GroupsNewLogicProps),
key((props) => `${props.groupTypeIndex}-new`),
@@ -49,19 +177,31 @@ export const groupsNewLogic = kea<groupsNewLogicType>([
logicProps: [() => [(_, props) => props], (props): GroupsNewLogicProps => props],
groupTypeName: [
(s) => [s.aggregationLabel, s.logicProps],
- (aggregationLabel, logicProps): string => {
+ (
+ aggregationLabel: (
+ groupTypeIndex: number | null | undefined,
+ deferToUserWording?: boolean
+ ) => import('~/models/groupsModel').Noun,
+ logicProps: GroupsNewLogicProps
+ ): string => {
return aggregationLabel(logicProps.groupTypeIndex).singular
},
],
groupTypeNamePlural: [
(s) => [s.aggregationLabel, s.logicProps],
- (aggregationLabel, logicProps): string => {
+ (
+ aggregationLabel: (
+ groupTypeIndex: number | null | undefined,
+ deferToUserWording?: boolean
+ ) => import('~/models/groupsModel').Noun,
+ logicProps: GroupsNewLogicProps
+ ): string => {
return aggregationLabel(logicProps.groupTypeIndex).plural
},
],
breadcrumbs: [
(s) => [s.logicProps, s.groupTypeName],
- (logicProps, groupTypeName): Breadcrumb[] => {
+ (logicProps: GroupsNewLogicProps, groupTypeName: string): Breadcrumb[] => {
return [
{
key: Scene.Groups,
diff --git a/frontend/src/scenes/groups/groupsSceneLogic.ts b/frontend/src/scenes/groups/groupsSceneLogic.ts
index d91a8fc6e421..d29c921fa95a 100644
--- a/frontend/src/scenes/groups/groupsSceneLogic.ts
+++ b/frontend/src/scenes/groups/groupsSceneLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, path, reducers, selectors } from 'kea'
import { urlToAction } from 'kea-router'
import { GroupsAccessStatus } from 'lib/introductions/groupsAccessLogic'
@@ -9,7 +9,8 @@ import { urls } from 'scenes/urls'
import { groupsModel } from '~/models/groupsModel'
import { Breadcrumb } from '~/types'
-import type { groupsSceneLogicType } from './groupsSceneLogicType'
+import type { Noun } from '../../models/groupsModel'
+import type { GroupType, GroupTypeIndex } from '../../types'
export type GroupsTab = {
key: string
@@ -19,6 +20,54 @@ export type GroupsTab = {
buttons?: any
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupsSceneLogicValues {
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun // groupsModel
+ groupTypes: Map<GroupTypeIndex, GroupType> // groupsModel
+ groupTypesLoading: boolean // groupsModel
+ groupsAccessStatus: GroupsAccessStatus // groupsModel
+ breadcrumbs: Breadcrumb[]
+ groupTypeIndex: number
+ groupTypeName: string
+ groupTypeNamePlural: string
+ showGroupsIntroductionPage: boolean
+ tabs: GroupsTab[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupsSceneLogicActions {
+ setGroupTypeIndex: (groupTypeIndex: number) => {
+ groupTypeIndex: number
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupsSceneLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ groupTypeName: (
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun,
+ groupTypeIndex: number
+ ) => string
+ groupTypeNamePlural: (
+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun,
+ groupTypeIndex: number
+ ) => string
+ breadcrumbs: (
+ groupTypeIndex: number,
+ groupTypeNamePlural: string,
+ showGroupsIntroductionPage: boolean
+ ) => Breadcrumb[]
+ showGroupsIntroductionPage: (groupsAccessStatus: GroupsAccessStatus) => boolean
+ }
+}
+
+export type groupsSceneLogicType = MakeLogicType<
+ groupsSceneLogicValues,
+ groupsSceneLogicActions,
+ Record<string, any>,
+ groupsSceneLogicMeta
+>
+
export const groupsSceneLogic = kea<groupsSceneLogicType>([
path(['scenes', 'groups', 'groupsSceneLogic']),
connect(() => ({
@@ -44,19 +93,35 @@ export const groupsSceneLogic = kea<groupsSceneLogicType>([
],
groupTypeName: [
(s) => [s.aggregationLabel, s.groupTypeIndex],
- (aggregationLabel, groupTypeIndex): string => {
+ (
+ aggregationLabel: (
+ groupTypeIndex: number | null | undefined,
+ deferToUserWording?: boolean
+ ) => import('~/models/groupsModel').Noun,
+ groupTypeIndex: number
+ ): string => {
return aggregationLabel(groupTypeIndex).singular
},
],
groupTypeNamePlural: [
(s) => [s.aggregationLabel, s.groupTypeIndex],
- (aggregationLabel, groupTypeIndex): string => {
+ (
+ aggregationLabel: (
+ groupTypeIndex: number | null | undefined,
+ deferToUserWording?: boolean
+ ) => import('~/models/groupsModel').Noun,
+ groupTypeIndex: number
+ ): string => {
return aggregationLabel(groupTypeIndex).plural
},
],
breadcrumbs: [
(s) => [s.groupTypeIndex, s.groupTypeNamePlural, s.showGroupsIntroductionPage],
- (groupTypeIndex, groupTypeNamePlural, showGroupsIntroductionPage): Breadcrumb[] => {
+ (
+ groupTypeIndex: number,
+ groupTypeNamePlural: string,
+ showGroupsIntroductionPage: boolean
+ ): Breadcrumb[] => {
return [
{
key: Scene.Groups,
@@ -69,7 +134,7 @@ export const groupsSceneLogic = kea<groupsSceneLogicType>([
],
showGroupsIntroductionPage: [
(s) => [s.groupsAccessStatus],
- (groupsAccessStatus): boolean => {
+ (groupsAccessStatus: GroupsAccessStatus): boolean => {
return [
GroupsAccessStatus.HasAccess,
GroupsAccessStatus.HasGroupTypes,
diff --git a/frontend/src/scenes/groups/relatedGroupsLogic.ts b/frontend/src/scenes/groups/relatedGroupsLogic.ts
index c74c8c2d2483..c6889894668f 100644
--- a/frontend/src/scenes/groups/relatedGroupsLogic.ts
+++ b/frontend/src/scenes/groups/relatedGroupsLogic.ts
@@ -1,4 +1,4 @@
-import { connect, events, kea, key, path, props, selectors } from 'kea'
+import { MakeLogicType, connect, events, kea, key, path, props, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -7,7 +7,70 @@ import { teamLogic } from 'scenes/teamLogic'
import { ActorType } from '~/types'
-import type { relatedGroupsLogicType } from './relatedGroupsLogicType'
+import type { PersonActorType } from '../../types'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface relatedGroupsLogicValues {
+ currentTeamId: number | null // teamLogic
+ relatedActors: ActorType[]
+ relatedActorsLoading: boolean
+ relatedPeople: PersonActorType[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface relatedGroupsLogicActions {
+ loadRelatedActors: () => any
+ loadRelatedActorsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRelatedActorsSuccess: (
+ relatedActors: ActorType[],
+ payload?: any
+ ) => {
+ relatedActors: ActorType[]
+ payload?: any
+ }
+ setGroup: () => any
+ setGroupFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ setGroupSuccess: (
+ relatedActors: never[],
+ payload?: any
+ ) => {
+ relatedActors: never[]
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface relatedGroupsLogicProps {
+ groupTypeIndex: number | null
+ id: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface relatedGroupsLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ relatedPeople: (relatedActors: ActorType[]) => PersonActorType[]
+ }
+}
+
+export type relatedGroupsLogicType = MakeLogicType<
+ relatedGroupsLogicValues,
+ relatedGroupsLogicActions,
+ relatedGroupsLogicProps,
+ relatedGroupsLogicMeta
+>
export const relatedGroupsLogic = kea<relatedGroupsLogicType>([
props(
diff --git a/frontend/src/scenes/organization/ConfirmOrganization/confirmOrganizationLogic.ts b/frontend/src/scenes/organization/ConfirmOrganization/confirmOrganizationLogic.ts
index 81854f718cd5..c71353fff064 100644
--- a/frontend/src/scenes/organization/ConfirmOrganization/confirmOrganizationLogic.ts
+++ b/frontend/src/scenes/organization/ConfirmOrganization/confirmOrganizationLogic.ts
@@ -1,13 +1,12 @@
-import { actions, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { urlToAction } from 'kea-router'
import api from 'lib/api'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { getRelativeNextPath } from 'lib/utils/url'
-import type { confirmOrganizationLogicType } from './confirmOrganizationLogicType'
-
export interface ConfirmOrganizationFormValues {
organization_name?: string
first_name?: string
@@ -16,6 +15,74 @@ export interface ConfirmOrganizationFormValues {
referral_source_ai_prompt?: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface confirmOrganizationLogicValues {
+ confirmOrganization: ConfirmOrganizationFormValues
+ confirmOrganizationAllErrors: Record<string, any>
+ confirmOrganizationChanged: boolean
+ confirmOrganizationErrors: DeepPartialMap<ConfirmOrganizationFormValues, ValidationErrorType>
+ confirmOrganizationHasErrors: boolean
+ confirmOrganizationManualErrors: Record<string, any>
+ confirmOrganizationTouched: boolean
+ confirmOrganizationTouches: Record<string, boolean>
+ confirmOrganizationValidationErrors: DeepPartialMap<ConfirmOrganizationFormValues, ValidationErrorType>
+ email: string
+ isConfirmOrganizationSubmitting: boolean
+ isConfirmOrganizationValid: boolean
+ showConfirmOrganizationErrors: boolean
+ showNewOrgWarning: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface confirmOrganizationLogicActions {
+ resetConfirmOrganization: (values?: ConfirmOrganizationFormValues) => {
+ values?: ConfirmOrganizationFormValues
+ }
+ setConfirmOrganizationManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setConfirmOrganizationValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setConfirmOrganizationValues: (values: DeepPartial<ConfirmOrganizationFormValues>) => {
+ values: DeepPartial<ConfirmOrganizationFormValues>
+ }
+ setEmail: (email: string) => {
+ email: string
+ }
+ setShowNewOrgWarning: (show: boolean) => {
+ show: boolean
+ }
+ submitConfirmOrganization: () => {
+ value: boolean
+ }
+ submitConfirmOrganizationFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitConfirmOrganizationRequest: (confirmOrganization: ConfirmOrganizationFormValues) => {
+ confirmOrganization: ConfirmOrganizationFormValues
+ }
+ submitConfirmOrganizationSuccess: (confirmOrganization: ConfirmOrganizationFormValues) => {
+ confirmOrganization: ConfirmOrganizationFormValues
+ }
+ touchConfirmOrganizationField: (key: string) => {
+ key: string
+ }
+}
+
+export type confirmOrganizationLogicType = MakeLogicType<
+ confirmOrganizationLogicValues,
+ confirmOrganizationLogicActions
+>
+
export const confirmOrganizationLogic = kea<confirmOrganizationLogicType>([
path(['scenes', 'organization', 'confirmOrganizationLogic']),
diff --git a/frontend/src/scenes/organization/membersExportLogic.ts b/frontend/src/scenes/organization/membersExportLogic.ts
index ca10c9da5ab7..be098ad17622 100644
--- a/frontend/src/scenes/organization/membersExportLogic.ts
+++ b/frontend/src/scenes/organization/membersExportLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, selectors } from 'kea'
import { downloadBlob } from 'lib/components/ExportButton/exporter'
import { dayjs } from 'lib/dayjs'
@@ -11,7 +11,7 @@ import { organizationLogic } from 'scenes/organizationLogic'
import { OrganizationMemberType } from '~/types'
-import type { membersExportLogicType } from './membersExportLogicType'
+import type { OrganizationType } from '../../types'
import { membersLogic } from './membersLogic'
function escapeCsvField(value: string): string {
@@ -63,6 +63,38 @@ function buildOrganizationMembersCsv(members: OrganizationMemberType[]): string
return lines.join('\r\n')
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface membersExportLogicValues {
+ membersLoading: boolean // membersLogic
+ sortedMembers: OrganizationMemberType[] | null // membersLogic
+ currentOrganization: OrganizationType | null // organizationLogic
+ downloadMembersListDisabledReason: string | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface membersExportLogicActions {
+ downloadMembersList: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface membersExportLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ downloadMembersListDisabledReason: (
+ membersLoading: boolean,
+ sortedMembers: OrganizationMemberType[] | null
+ ) => string | null
+ }
+}
+
+export type membersExportLogicType = MakeLogicType<
+ membersExportLogicValues,
+ membersExportLogicActions,
+ Record<string, any>,
+ membersExportLogicMeta
+>
+
export const membersExportLogic = kea<membersExportLogicType>([
path(['scenes', 'organization', 'membersExportLogic']),
connect(() => ({
@@ -74,7 +106,7 @@ export const membersExportLogic = kea<membersExportLogicType>([
selectors({
downloadMembersListDisabledReason: [
(s) => [s.membersLoading, s.sortedMembers],
- (membersLoading, sortedMembers): string | null =>
+ (membersLoading: boolean, sortedMembers: OrganizationMemberType[] | null): string | null =>
membersLoading && !sortedMembers?.length
? 'Loading members...'
: !sortedMembers?.length
diff --git a/frontend/src/scenes/organization/membersLogic.tsx b/frontend/src/scenes/organization/membersLogic.tsx
index a281e613311f..23c3f7a9003b 100644
--- a/frontend/src/scenes/organization/membersLogic.tsx
+++ b/frontend/src/scenes/organization/membersLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -11,8 +11,6 @@ import { userLogic } from 'scenes/userLogic'
import { OrganizationMemberScopedApiKeysResponse, OrganizationMemberType, UserType } from '~/types'
-import type { membersLogicType } from './membersLogicType'
-
const PAGINATION_LIMIT = 200
function meAsMember(user: UserType): OrganizationMemberType {
@@ -37,6 +35,195 @@ function meAsMember(user: UserType): OrganizationMemberType {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface membersLogicValues {
+ user: UserType | null // userLogic
+ filteredMembers: OrganizationMemberType[]
+ me: OrganizationMemberType | null
+ meFirstMembers: OrganizationMemberType[]
+ memberCount: number
+ members: OrganizationMemberType[] | null
+ membersLoading: boolean
+ otherMembers: OrganizationMemberType[]
+ scopedApiKeys: OrganizationMemberScopedApiKeysResponse | null
+ scopedApiKeysLoading: boolean
+ search: string
+ searchedMembers: OrganizationMemberType[] | null
+ searchedMembersLoading: boolean
+ selectableMembers: (membersToExclude?: (number | string)[], by?: 'id' | 'uuid') => OrganizationMemberType[]
+ sortedMembers: OrganizationMemberType[] | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface membersLogicActions {
+ changeMemberAccessLevel: (
+ member: OrganizationMemberType,
+ level: OrganizationMembershipLevel
+ ) => {
+ level: OrganizationMembershipLevel
+ member: OrganizationMemberType
+ }
+ changeMemberAccessLevelFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ changeMemberAccessLevelSuccess: (
+ members: OrganizationMemberType[] | null,
+ payload?: {
+ level: OrganizationMembershipLevel
+ member: OrganizationMemberType
+ }
+ ) => {
+ members: OrganizationMemberType[] | null
+ payload?: {
+ level: OrganizationMembershipLevel
+ member: OrganizationMemberType
+ }
+ }
+ ensureAllMembersLoaded: () => {
+ value: true
+ }
+ loadAllMembers: () => {
+ value: true
+ }
+ loadAllMembersFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAllMembersSuccess: (
+ members: OrganizationMemberType[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ members: OrganizationMemberType[]
+ payload?: {
+ value: true
+ }
+ }
+ loadMemberScopedApiKeys: (member: OrganizationMemberType) => {
+ member: OrganizationMemberType
+ }
+ loadMemberScopedApiKeysFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadMemberScopedApiKeysSuccess: (
+ scopedApiKeys: OrganizationMemberScopedApiKeysResponse | null,
+ payload?: {
+ member: OrganizationMemberType
+ }
+ ) => {
+ scopedApiKeys: OrganizationMemberScopedApiKeysResponse | null
+ payload?: {
+ member: OrganizationMemberType
+ }
+ }
+ loadMemberUpdates: () => {
+ value: true
+ }
+ loadMemberUpdatesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadMemberUpdatesSuccess: (
+ members: OrganizationMemberType[] | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ members: OrganizationMemberType[] | null
+ payload?: {
+ value: true
+ }
+ }
+ loadSearchedMembers: () => {
+ value: true
+ }
+ loadSearchedMembersFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSearchedMembersSuccess: (
+ searchedMembers: OrganizationMemberType[] | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ searchedMembers: OrganizationMemberType[] | null
+ payload?: {
+ value: true
+ }
+ }
+ postRemoveMember: (userUuid: string) => {
+ userUuid: string
+ }
+ removeMember: (member: OrganizationMemberType) => OrganizationMemberType
+ removeMemberFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ removeMemberSuccess: (
+ members: OrganizationMemberType[] | null,
+ payload?: OrganizationMemberType
+ ) => {
+ members: OrganizationMemberType[] | null
+ payload?: OrganizationMemberType
+ }
+ setSearch: (search: any) => {
+ search: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface membersLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ sortedMembers: (members: OrganizationMemberType[] | null) => OrganizationMemberType[] | null
+ meFirstMembers: (
+ sortedMembers: OrganizationMemberType[] | null,
+ user: UserType | null
+ ) => OrganizationMemberType[]
+ me: (user: UserType | null) => OrganizationMemberType | null
+ otherMembers: (filteredMembers: OrganizationMemberType[], user: UserType | null) => OrganizationMemberType[]
+ selectableMembers: (
+ me: OrganizationMemberType | null,
+ otherMembers: OrganizationMemberType[],
+ search: string
+ ) => (membersToExclude?: (number | string)[], by?: 'id' | 'uuid') => OrganizationMemberType[]
+ filteredMembers: (
+ meFirstMembers: OrganizationMemberType[],
+ searchedMembers: OrganizationMemberType[] | null,
+ search: string
+ ) => OrganizationMemberType[]
+ memberCount: (user: UserType | null, sortedMembers: OrganizationMemberType[] | null) => number
+ }
+}
+
+export type membersLogicType = MakeLogicType<
+ membersLogicValues,
+ membersLogicActions,
+ Record<string, any>,
+ membersLogicMeta
+>
+
export const membersLogic = kea<membersLogicType>([
path(['scenes', 'organization', 'membersLogic']),
connect(() => ({
@@ -156,7 +343,7 @@ export const membersLogic = kea<membersLogicType>([
selectors({
sortedMembers: [
(s) => [s.members],
- (members): OrganizationMemberType[] | null => {
+ (members: OrganizationMemberType[] | null): OrganizationMemberType[] | null => {
if (!members) {
return null
}
@@ -165,7 +352,7 @@ export const membersLogic = kea<membersLogicType>([
],
meFirstMembers: [
(s) => [s.sortedMembers, s.user],
- (members, user): OrganizationMemberType[] => {
+ (members: OrganizationMemberType[] | null, user: UserType | null): OrganizationMemberType[] => {
const me = user && members?.find((member) => member.user.uuid === user.uuid)
const result: OrganizationMemberType[] = me ? [me] : []
for (const member of members ?? []) {
@@ -176,15 +363,18 @@ export const membersLogic = kea<membersLogicType>([
return result
},
],
- me: [(s) => [s.user], (user): OrganizationMemberType | null => (user ? meAsMember(user) : null)],
+ me: [
+ (s) => [s.user],
+ (user: UserType | null): OrganizationMemberType | null => (user ? meAsMember(user) : null),
+ ],
otherMembers: [
(s) => [s.filteredMembers, s.user],
- (filteredMembers, user): OrganizationMemberType[] =>
+ (filteredMembers: OrganizationMemberType[], user: UserType | null): OrganizationMemberType[] =>
user ? filteredMembers.filter((member) => member.user.uuid !== user.uuid) : filteredMembers,
],
selectableMembers: [
(s) => [s.me, s.otherMembers, s.search],
- (me, otherMembers, search) =>
+ (me: OrganizationMemberType | null, otherMembers: OrganizationMemberType[], search: string) =>
(membersToExclude: (string | number)[] = [], by: 'id' | 'uuid' = 'id'): OrganizationMemberType[] => {
const members = me && !search.trim() ? [me, ...otherMembers] : otherMembers
return members.filter((member) => !membersToExclude.includes(member.user[by]))
@@ -192,7 +382,11 @@ export const membersLogic = kea<membersLogicType>([
],
filteredMembers: [
(s) => [s.meFirstMembers, s.searchedMembers, s.search],
- (members, searched, search): OrganizationMemberType[] => {
+ (
+ members: OrganizationMemberType[],
+ searched: OrganizationMemberType[] | null,
+ search: string
+ ): OrganizationMemberType[] => {
// When a search term is set, return the (server-filtered) searchedMembers
// — this avoids polluting the canonical `members` store with a filtered
// subset, so other consumers (rolesLogic, hedgehogModeLogic) keep seeing
@@ -206,7 +400,7 @@ export const membersLogic = kea<membersLogicType>([
],
memberCount: [
(s) => [s.user, s.sortedMembers],
- (user, members): number => {
+ (user: UserType | null, members: OrganizationMemberType[] | null): number => {
// Typically we can rely on the app context but just in case we use the loaded members if present
const count = user?.organization?.member_count
return Math.max(count ?? 0, members?.length ?? 0)
diff --git a/frontend/src/scenes/surveys/forms/surveyFormBuilderLogic.ts b/frontend/src/scenes/surveys/forms/surveyFormBuilderLogic.ts
index 88a3a7f35155..c6ec2cb8683b 100644
--- a/frontend/src/scenes/surveys/forms/surveyFormBuilderLogic.ts
+++ b/frontend/src/scenes/surveys/forms/surveyFormBuilderLogic.ts
@@ -1,16 +1,57 @@
-import { connect, kea, key, path, props } from 'kea'
+import { MakeLogicType, connect, kea, key, path, props } from 'kea'
import { router, urlToAction } from 'kea-router'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { urls } from 'scenes/urls'
+import type { Survey } from '../../../types'
import { surveysLogic } from '../surveysLogic'
-import type { surveyFormBuilderLogicType } from './surveyFormBuilderLogicType'
export interface SurveyFormBuilderLogicProps {
id: string // 'new' for new surveys, or a UUID for editing
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyFormBuilderLogicValues {
+ formBuilderEnabled: boolean // surveysLogic
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyFormBuilderLogicActions {
+ reportSurveyCreated: (
+ survey: Survey,
+ isDuplicate?: boolean,
+ creationSource?: 'form_builder' | 'full_editor' | 'llm_analytics' | 'quick_create' | 'template' | 'wizard'
+ ) => {
+ creationSource:
+ | 'form_builder'
+ | 'full_editor'
+ | 'llm_analytics'
+ | 'quick_create'
+ | 'template'
+ | 'wizard'
+ | undefined
+ isDuplicate: boolean | undefined
+ survey: Survey
+ } // eventUsageLogic
+ reportSurveyEdited: (survey: Survey) => {
+ survey: Survey
+ } // eventUsageLogic
+ loadSurveys: () => any // surveysLogic
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyFormBuilderLogicMeta {
+ key: string
+}
+
+export type surveyFormBuilderLogicType = MakeLogicType<
+ surveyFormBuilderLogicValues,
+ surveyFormBuilderLogicActions,
+ SurveyFormBuilderLogicProps,
+ surveyFormBuilderLogicMeta
+>
+
export const surveyFormBuilderLogic = kea<surveyFormBuilderLogicType>([
path(['scenes', 'surveys', 'form', 'surveyFormBuilderLogic']),
diff --git a/frontend/src/scenes/surveys/quick-create/quickSurveyFormLogic.ts b/frontend/src/scenes/surveys/quick-create/quickSurveyFormLogic.ts
index a399282972f8..bbb7d59e01d6 100644
--- a/frontend/src/scenes/surveys/quick-create/quickSurveyFormLogic.ts
+++ b/frontend/src/scenes/surveys/quick-create/quickSurveyFormLogic.ts
@@ -1,5 +1,6 @@
-import { actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { router } from 'kea-router'
import { lemonToast } from '@posthog/lemon-ui'
@@ -22,10 +23,10 @@ import {
SurveyType,
} from '~/types'
+import type { SurveyAppearance, SurveyDisplayConditions } from '../../../types'
import { NewSurvey, SURVEY_CREATED_SOURCE, SURVEY_RATING_SCALE, defaultSurveyAppearance } from '../constants'
import { surveysLogic } from '../surveysLogic'
import { toSurveyEvent } from '../utils/opportunityDetection'
-import type { quickSurveyFormLogicType } from './quickSurveyFormLogicType'
import { QuickSurveyType } from './types'
export type QuickSurveyCreateMode = 'launch' | 'edit' | 'draft'
@@ -104,6 +105,104 @@ function buildSurveyQuestion(
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickSurveyFormLogicValues {
+ cancelEvents: string[]
+ createMode: QuickSurveyCreateMode
+ delaySeconds: number
+ isSurveyFormSubmitting: boolean
+ isSurveyFormValid: boolean
+ previewSurvey: NewSurvey
+ selectedEvents: string[]
+ showSurveyFormErrors: boolean
+ submitDisabledReason: string | undefined
+ surveyForm: QuickSurveyFormValues
+ surveyFormAllErrors: Record<string, any>
+ surveyFormChanged: boolean
+ surveyFormErrors: DeepPartialMap<QuickSurveyFormValues, ValidationErrorType>
+ surveyFormHasErrors: boolean
+ surveyFormManualErrors: Record<string, any>
+ surveyFormTouched: boolean
+ surveyFormTouches: Record<string, boolean>
+ surveyFormValidationErrors: DeepPartialMap<QuickSurveyFormValues, ValidationErrorType>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickSurveyFormLogicActions {
+ resetSurveyForm: (values?: QuickSurveyFormValues) => {
+ values?: QuickSurveyFormValues
+ }
+ setCreateMode: (mode: QuickSurveyCreateMode) => {
+ mode: QuickSurveyCreateMode
+ }
+ setSurveyFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setSurveyFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setSurveyFormValues: (values: DeepPartial<QuickSurveyFormValues>) => {
+ values: DeepPartial<QuickSurveyFormValues>
+ }
+ setTriggerEvent: (
+ step: EventsNode | null,
+ field: 'cancelEvents' | 'events'
+ ) => {
+ field: 'cancelEvents' | 'events'
+ step: EventsNode | null
+ }
+ submitSurveyForm: () => {
+ value: boolean
+ }
+ submitSurveyFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitSurveyFormRequest: (surveyForm: QuickSurveyFormValues) => {
+ surveyForm: QuickSurveyFormValues
+ }
+ submitSurveyFormSuccess: (surveyForm: QuickSurveyFormValues) => {
+ surveyForm: QuickSurveyFormValues
+ }
+ touchSurveyFormField: (key: string) => {
+ key: string
+ }
+ updateAppearance: (updates: Partial<Survey['appearance']>) => {
+ updates: Partial<SurveyAppearance | null>
+ }
+ updateConditions: (updates: Partial<Survey['conditions']>) => {
+ updates: Partial<SurveyDisplayConditions | null>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface quickSurveyFormLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ selectedEvents: (surveyForm: QuickSurveyFormValues) => string[]
+ cancelEvents: (surveyForm: QuickSurveyFormValues) => string[]
+ delaySeconds: (surveyForm: QuickSurveyFormValues) => number
+ previewSurvey: (surveyForm: QuickSurveyFormValues) => NewSurvey
+ submitDisabledReason: (
+ surveyFormErrors: DeepPartialMap<QuickSurveyFormValues, ValidationErrorType>
+ ) => string | undefined
+ }
+}
+
+export type quickSurveyFormLogicType = MakeLogicType<
+ quickSurveyFormLogicValues,
+ quickSurveyFormLogicActions,
+ QuickSurveyFormLogicProps,
+ quickSurveyFormLogicMeta
+>
+
export const quickSurveyFormLogic = kea<quickSurveyFormLogicType>([
path(['scenes', 'surveys', 'quickSurveyFormLogic']),
props({} as QuickSurveyFormLogicProps),
@@ -204,21 +303,21 @@ export const quickSurveyFormLogic = kea<quickSurveyFormLogicType>([
selectors({
selectedEvents: [
(s) => [s.surveyForm],
- (surveyForm): string[] =>
+ (surveyForm: QuickSurveyFormValues): string[] =>
(surveyForm.conditions?.events?.values || []).map((e: { name: string }) => e.name),
],
cancelEvents: [
(s) => [s.surveyForm],
- (surveyForm): string[] =>
+ (surveyForm: QuickSurveyFormValues): string[] =>
(surveyForm.conditions?.cancelEvents?.values || []).map((e: { name: string }) => e.name),
],
delaySeconds: [
(s) => [s.surveyForm],
- (surveyForm): number => surveyForm.appearance?.surveyPopupDelaySeconds ?? 15,
+ (surveyForm: QuickSurveyFormValues): number => surveyForm.appearance?.surveyPopupDelaySeconds ?? 15,
],
previewSurvey: [
(s) => [s.surveyForm],
- (surveyForm): NewSurvey =>
+ (surveyForm: QuickSurveyFormValues): NewSurvey =>
({
id: 'new',
name: surveyForm.name,
diff --git a/frontend/src/scenes/surveys/surveyLogic.tsx b/frontend/src/scenes/surveys/surveyLogic.tsx
index 12fca03e8661..5ce55fc0078e 100644
--- a/frontend/src/scenes/surveys/surveyLogic.tsx
+++ b/frontend/src/scenes/surveys/surveyLogic.tsx
@@ -1,5 +1,19 @@
-import { actions, afterMount, connect, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ afterMount,
+ connect,
+ events,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ reducers,
+ selectors,
+} from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import { actionToUrl, router, urlToAction } from 'kea-router'
import posthog from 'posthog-js'
@@ -85,6 +99,20 @@ import {
import { surveysGenerateTranslationsCreate } from 'products/surveys/frontend/generated/api'
+import type { ProductIntentProperties } from '../../lib/utils/product-intents'
+import type {
+ AccessControlLevel,
+ BasicSurveyQuestion,
+ FeatureFlagBasicType,
+ PropertyDefinition,
+ SurveyAppearance,
+ SurveyDisplayConditions,
+ SurveyQuestionDescriptionContentType,
+ SurveyType,
+ TeamPublicType,
+ TeamType,
+ UserType,
+} from '../../types'
import {
LOADING_SURVEY_RESULTS_TOAST_ID,
NEW_SURVEY,
@@ -94,9 +122,10 @@ import {
defaultSurveyAppearance,
defaultSurveyFieldValues,
} from './constants'
-import type { surveyLogicType } from './surveyLogicType'
import { getSurveyStatus, surveysLogic } from './surveysLogic'
+import type { SurveyDataState } from './surveysLogic'
import { SurveyFeatureWarning, getSurveyWarnings } from './surveyVersionRequirements'
+import type { TeamSdkVersions } from './surveyVersionRequirements'
import {
DATE_FORMAT,
type OpenEndedColumnMap,
@@ -606,6 +635,833 @@ export function mergeResponsesByQuestion(
return merged
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyLogicValues {
+ enabledFlags: FeatureFlagsSet // enabledFlagLogic
+ dataProcessingAccepted: boolean // maxGlobalLogic
+ propertyDefinitionsByType: (type: string, groupTypeIndex?: number | null) => PropertyDefinition[] // propertyDefinitionsModel
+ data: SurveyDataState // surveysLogic
+ teamSdkVersions: TeamSdkVersions // surveysLogic
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ user: UserType | null // userLogic
+ activeTab: SurveyTab
+ aiGeneratedTranslationFields: string[]
+ answerFilterHogQLExpression: string
+ answerFilters: EventPropertyFilter[]
+ archivedResponseUuids: Set<string>
+ archivedResponseUuidsLoading: boolean
+ archivedResponsesFilter: string
+ archivedResponsesPropertyFilter: Array<{
+ key: string
+ type: PropertyFilterType.HogQL
+ }>
+ breadcrumbs: Breadcrumb[]
+ compareFilter: CompareFilter
+ consolidatedSurveyResults: any
+ consolidatedSurveyResultsLoading: boolean
+ dataCollectionType: DataCollectionType
+ dataTableQuery: DataTableNode | null
+ dateRange: SurveyDateRange | null
+ defaultAnswerFilters: EventPropertyFilter[]
+ defaultInterval: IntervalType
+ derivedDataCollectionType: DataCollectionType
+ descriptionContentType: (questionIndex: number) => SurveyQuestionDescriptionContentType | undefined
+ deviceTypesMatchTypeValidationError: string | null
+ editingLanguage: string | null
+ enrichedConsolidatedSurveyResults: ConsolidatedSurveyResults
+ expandedResponseUuids: Set<string>
+ filterSurveyStatsByDistinctId: boolean
+ flagPropertyErrors: any
+ formattedOpenEndedResponses: SurveyAnalysisQuestionGroup[]
+ generatingTranslationDrafts: boolean
+ getBranchingDropdownValue: (questionIndex: number, question: SurveyQuestion) => string
+ getResponseBasedBranchingDropdownValue: (
+ questionIndex: number,
+ question: MultipleSurveyQuestion | RatingSurveyQuestion,
+ response: any
+ ) => any
+ hasActiveAnswerFilters: boolean
+ hasActiveDateRange: boolean
+ hasActiveFilters: boolean
+ hasBranchingLogic: boolean
+ hasCycle: false
+ hasTargetingSet: boolean
+ hasTranslationValidationErrors: boolean
+ interval: IntervalType | null
+ isAdaptiveLimitFFEnabled: boolean
+ isAnyResultsLoading: boolean
+ isEditingSurvey: boolean
+ isSurveyHeadlineEnabled: boolean
+ isSurveyRunning: boolean
+ isSurveySubmitting: boolean
+ isSurveyValid: boolean
+ partialResponsesFilter: string
+ personNames: Record<string, string>
+ processedSurveyStats: SurveyStats | null
+ projectTreeRef: ProjectTreeRef
+ propertyFilters: AnyPropertyFilter[]
+ resultsRequeryInProgress: boolean
+ reusableSurveyNotifications: HogFunctionType[]
+ reusableSurveyNotificationsLoading: boolean
+ selectedPageIndex: number | null
+ selectedSection: SurveyEditSection | null
+ showArchivedResponses: boolean
+ showSurveyErrors: boolean
+ showSurveyRepeatSchedule: boolean
+ sidePanelContext: SidePanelSceneContext | null
+ survey: NewSurvey | Survey
+ surveyAllErrors: Record<string, any>
+ surveyAsInsightURL: string
+ surveyBaseStats: any
+ surveyBaseStatsInternal: SurveyBaseStatsResult
+ surveyBaseStatsLoading: boolean
+ surveyChanged: boolean
+ surveyDemoData: SurveyDemoData
+ surveyDismissedAndSentCount: any
+ surveyDismissedAndSentCountInternal: DismissedAndSentCountResult
+ surveyDismissedAndSentCountLoading: boolean
+ surveyErrors: DeepPartialMap<NewSurvey | Survey, ValidationErrorType>
+ surveyHasErrors: boolean
+ surveyHeadline: {
+ has_more: boolean
+ headline: string
+ responses_sampled: number
+ } | null
+ surveyHeadlineLoading: boolean
+ surveyLoading: boolean
+ surveyManualErrors: Record<string, any>
+ surveyMissing: boolean
+ surveyNotifications: HogFunctionType[]
+ surveyNotificationsLoading: boolean
+ surveyRates: SurveyRates | null
+ surveyRepeatedActivationAvailable: boolean
+ surveyShufflingQuestionsAvailable: boolean
+ surveyTouched: boolean
+ surveyTouches: Record<string, boolean>
+ surveyUsesAdaptiveLimit: boolean
+ surveyUsesLimit: boolean
+ surveyValidationErrors: DeepPartialMap<NewSurvey | Survey, ValidationErrorType>
+ surveyWarnings: SurveyFeatureWarning[]
+ targetingFlagFilters: FeatureFlagFilters | undefined
+ timestampFilter: string
+ translationErrorsByQuestion: (questionIndex: number) => TranslationValidationError[]
+ translationErrorsForField: (questionIndex: number, fieldPath: string) => TranslationValidationError | undefined
+ translationValidationErrors: TranslationValidationError[]
+ urlMatchTypeValidationError: string | null
+ urlSearchParams: {
+ answerFilters: string | undefined
+ date_from: string | undefined
+ date_to: string | undefined
+ propertyFilters: string | undefined
+ }
+ writingHTMLDescription: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyLogicActions {
+ reportSurveyArchived: (survey: Survey) => {
+ survey: Survey
+ } // eventUsageLogic
+ reportSurveyConsolidatedResultsQuery: (
+ survey: Survey,
+ totalDurationMs: number,
+ queryDurations: {
+ aggregate: number
+ openEnded: number
+ }
+ ) => {
+ queryDurations: {
+ aggregate: number
+ openEnded: number
+ }
+ survey: Survey
+ totalDurationMs: number
+ } // eventUsageLogic
+ reportSurveyCreated: (
+ survey: Survey,
+ isDuplicate?: boolean,
+ creationSource?: 'form_builder' | 'full_editor' | 'llm_analytics' | 'quick_create' | 'template' | 'wizard'
+ ) => {
+ creationSource:
+ | 'form_builder'
+ | 'full_editor'
+ | 'llm_analytics'
+ | 'quick_create'
+ | 'template'
+ | 'wizard'
+ | undefined
+ isDuplicate: boolean | undefined
+ survey: Survey
+ } // eventUsageLogic
+ reportSurveyCycleDetected: (survey: NewSurvey | Survey) => {
+ survey: NewSurvey | Survey
+ } // eventUsageLogic
+ reportSurveyEdited: (survey: Survey) => {
+ survey: Survey
+ } // eventUsageLogic
+ reportSurveyViewed: (survey: Survey) => {
+ survey: Survey
+ } // eventUsageLogic
+ loadSurveys: () => any // surveysLogic
+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic
+ archiveResponse: (responseUuid: string) => {
+ responseUuid: string
+ }
+ archiveSurvey: () => {
+ value: true
+ }
+ clearAiGeneratedTranslationField: (path: string) => {
+ path: string
+ }
+ clearFilters: () => {
+ value: true
+ }
+ createSurvey: (surveyPayload: Partial<Survey>) => Partial<Survey>
+ createSurveyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ createSurveySuccess: (
+ survey: Survey,
+ payload?: Partial<Survey>
+ ) => {
+ survey: Survey
+ payload?: Partial<Survey>
+ }
+ deleteBranchingLogic: () => {
+ value: true
+ }
+ deleteSurveyNotification: (notification: HogFunctionType) => {
+ notification: HogFunctionType
+ }
+ editingSurvey: (editing: boolean) => {
+ editing: boolean
+ }
+ generateTranslationDrafts: (
+ language: string,
+ overwrite?: boolean
+ ) => {
+ language: string
+ overwrite: boolean
+ }
+ launchSurvey: () => any
+ launchSurveyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ launchSurveySuccess: (
+ survey: Survey,
+ payload?: any
+ ) => {
+ survey: Survey
+ payload?: any
+ }
+ loadArchivedResponseUuids: () => any
+ loadArchivedResponseUuidsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadArchivedResponseUuidsSuccess: (
+ archivedResponseUuids: Set<string>,
+ payload?: any
+ ) => {
+ archivedResponseUuids: Set<string>
+ payload?: any
+ }
+ loadConsolidatedSurveyResults: () => any
+ loadConsolidatedSurveyResultsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadConsolidatedSurveyResultsSuccess: (
+ consolidatedSurveyResults: ConsolidatedSurveyResults,
+ payload?: any
+ ) => {
+ consolidatedSurveyResults: ConsolidatedSurveyResults
+ payload?: any
+ }
+ loadReusableSurveyNotifications: () => any
+ loadReusableSurveyNotificationsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadReusableSurveyNotificationsSuccess: (
+ reusableSurveyNotifications: HogFunctionType[],
+ payload?: any
+ ) => {
+ reusableSurveyNotifications: HogFunctionType[]
+ payload?: any
+ }
+ loadSurvey: () => any
+ loadSurveyBaseStats: () => any
+ loadSurveyBaseStatsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSurveyBaseStatsSuccess: (
+ surveyBaseStats: SurveyBaseStatsResult,
+ payload?: any
+ ) => {
+ surveyBaseStats: SurveyBaseStatsResult
+ payload?: any
+ }
+ loadSurveyDismissedAndSentCount: () => any
+ loadSurveyDismissedAndSentCountFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSurveyDismissedAndSentCountSuccess: (
+ surveyDismissedAndSentCount: DismissedAndSentCountResult,
+ payload?: any
+ ) => {
+ surveyDismissedAndSentCount: DismissedAndSentCountResult
+ payload?: any
+ }
+ loadSurveyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSurveyHeadline: (forceRefresh?: boolean) => boolean
+ loadSurveyHeadlineFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSurveyHeadlineSuccess: (
+ surveyHeadline: {
+ has_more: boolean
+ headline: string
+ responses_sampled: number
+ } | null,
+ payload?: boolean
+ ) => {
+ surveyHeadline: {
+ has_more: boolean
+ headline: string
+ responses_sampled: number
+ } | null
+ payload?: boolean
+ }
+ loadSurveyNotifications: () => any
+ loadSurveyNotificationsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSurveyNotificationsSuccess: (
+ surveyNotifications: HogFunctionType[],
+ payload?: any
+ ) => {
+ surveyNotifications: HogFunctionType[]
+ payload?: any
+ }
+ loadSurveySuccess: (
+ survey:
+ | Survey
+ | {
+ appearance: SurveyAppearance | null
+ archived: boolean
+ base_language?: string | null | undefined
+ conditions: SurveyDisplayConditions | null
+ current_iteration?: number | null | undefined
+ description: string
+ enable_iframe_embedding?: boolean | null | undefined
+ enable_partial_responses?: boolean | null | undefined
+ end_date: string | null
+ form_content?: Record<string, unknown> | null | undefined
+ headline_response_count?: number | null | undefined
+ headline_summary?: string | null | undefined
+ id: 'new'
+ iteration_count?: number | null | undefined
+ iteration_frequency_days?: number | null | undefined
+ iteration_start_dates?: string[] | undefined
+ linked_flag: FeatureFlagBasicType | null
+ linked_flag_id: number | null
+ name: string
+ questions: (
+ | BasicSurveyQuestion
+ | LinkSurveyQuestion
+ | MultipleSurveyQuestion
+ | RatingSurveyQuestion
+ )[]
+ response_sampling_interval?: number | null | undefined
+ response_sampling_interval_type?: string | null | undefined
+ response_sampling_limit?: number | null | undefined
+ response_sampling_start_date?: string | null | undefined
+ responses_limit: number | null
+ schedule?: SurveySchedule | null | undefined
+ start_date: string | null
+ targeting_flag: FeatureFlagBasicType | null
+ targeting_flag_filters?: FeatureFlagFilters | undefined
+ translations?:
+ | Record<
+ string,
+ {
+ backButtonText?: string | undefined
+ name?: string | undefined
+ submitButtonText?: string | undefined
+ thankYouMessageCloseButtonText?: string | undefined
+ thankYouMessageDescription?: string | undefined
+ thankYouMessageHeader?: string | undefined
+ }
+ >
+ | null
+ | undefined
+ type: SurveyType
+ user_access_level: AccessControlLevel
+ },
+ payload?: any
+ ) => {
+ survey:
+ | Survey
+ | {
+ appearance: SurveyAppearance | null
+ archived: boolean
+ base_language?: string | null | undefined
+ conditions: SurveyDisplayConditions | null
+ current_iteration?: number | null | undefined
+ description: string
+ enable_iframe_embedding?: boolean | null | undefined
+ enable_partial_responses?: boolean | null | undefined
+ end_date: string | null
+ form_content?: Record<string, unknown> | null | undefined
+ headline_response_count?: number | null | undefined
+ headline_summary?: string | null | undefined
+ id: 'new'
+ iteration_count?: number | null | undefined
+ iteration_frequency_days?: number | null | undefined
+ iteration_start_dates?: string[] | undefined
+ linked_flag: FeatureFlagBasicType | null
+ linked_flag_id: number | null
+ name: string
+ questions: (
+ | BasicSurveyQuestion
+ | LinkSurveyQuestion
+ | MultipleSurveyQuestion
+ | RatingSurveyQuestion
+ )[]
+ response_sampling_interval?: number | null | undefined
+ response_sampling_interval_type?: string | null | undefined
+ response_sampling_limit?: number | null | undefined
+ response_sampling_start_date?: string | null | undefined
+ responses_limit: number | null
+ schedule?: SurveySchedule | null | undefined
+ start_date: string | null
+ targeting_flag: FeatureFlagBasicType | null
+ targeting_flag_filters?: FeatureFlagFilters | undefined
+ translations?:
+ | Record<
+ string,
+ {
+ backButtonText?: string | undefined
+ name?: string | undefined
+ submitButtonText?: string | undefined
+ thankYouMessageCloseButtonText?: string | undefined
+ thankYouMessageDescription?: string | undefined
+ thankYouMessageHeader?: string | undefined
+ }
+ >
+ | null
+ | undefined
+ type: SurveyType
+ user_access_level: AccessControlLevel
+ }
+ payload?: any
+ }
+ markResultsRequeryCompleted: () => {
+ value: true
+ }
+ moveQuestion: (
+ oldIndex: number,
+ newIndex: number
+ ) => {
+ newIndex: number
+ oldIndex: number
+ }
+ removeQuestion: (questionIndex: number) => {
+ questionIndex: number
+ }
+ resetBranchingForQuestion: (questionIndex: any) => {
+ questionIndex: any
+ }
+ resetSurvey: (values?: NewSurvey | Survey) => {
+ values?: NewSurvey | Survey
+ }
+ resetSurveyAdaptiveSampling: () => {
+ value: true
+ }
+ resetSurveyResponseLimits: () => {
+ value: true
+ }
+ resetTargeting: () => {
+ value: true
+ }
+ resumeSurvey: () => any
+ resumeSurveyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ resumeSurveySuccess: (
+ survey: Survey,
+ payload?: any
+ ) => {
+ survey: Survey
+ payload?: any
+ }
+ setActiveTab: (tab: SurveyTab) => {
+ tab: SurveyTab
+ }
+ setAiGeneratedTranslationFields: (paths: string[]) => {
+ paths: string[]
+ }
+ setAnswerFilters: (
+ filters: EventPropertyFilter[],
+ reloadResults?: boolean
+ ) => {
+ filters: EventPropertyFilter[]
+ reloadResults: boolean
+ }
+ setBaseStatsResults: (results: SurveyBaseStatsResult) => {
+ results: SurveyBaseStatsResult
+ }
+ setCompareFilter: (compareFilter: CompareFilter) => {
+ compareFilter: CompareFilter
+ }
+ setDataCollectionType: (dataCollectionType: DataCollectionType) => {
+ dataCollectionType: DataCollectionType
+ }
+ setDateRange: (
+ dateRange: SurveyDateRange,
+ reloadResults?: boolean
+ ) => {
+ dateRange: SurveyDateRange
+ reloadResults: boolean
+ }
+ setDefaultForQuestionType: (
+ idx: number,
+ surveyQuestion: SurveyQuestion,
+ type: SurveyQuestionType
+ ) => {
+ idx: number
+ surveyQuestion: SurveyQuestion
+ type: SurveyQuestionType
+ }
+ setDismissedAndSentCount: (count: DismissedAndSentCountResult) => {
+ count: DismissedAndSentCountResult
+ }
+ setEditingLanguage: (language: string | null) => {
+ language: string | null
+ }
+ setFilterSurveyStatsByDistinctId: (filterByDistinctId: boolean) => {
+ filterByDistinctId: boolean
+ }
+ setFlagPropertyErrors: (errors: any) => {
+ errors: any
+ }
+ setGeneratingTranslationDrafts: (generating: boolean) => {
+ generating: boolean
+ }
+ setInterval: (interval: IntervalType) => {
+ interval: IntervalType
+ }
+ setMultipleSurveyQuestion: (
+ questionIndex: number,
+ question: MultipleSurveyQuestion,
+ type: SurveyQuestionType.MultipleChoice | SurveyQuestionType.SingleChoice
+ ) => {
+ question: MultipleSurveyQuestion
+ questionIndex: number
+ type: SurveyQuestionType.MultipleChoice | SurveyQuestionType.SingleChoice
+ }
+ setPersonNames: (personNames: Record<string, string>) => {
+ personNames: Record<string, string>
+ }
+ setPropertyFilters: (
+ propertyFilters: AnyPropertyFilter[],
+ reloadResults?: boolean
+ ) => {
+ propertyFilters: AnyPropertyFilter[]
+ reloadResults: boolean
+ }
+ setQuestionBranchingType: (
+ questionIndex: any,
+ type: any,
+ specificQuestionIndex: any
+ ) => {
+ questionIndex: any
+ specificQuestionIndex: any
+ type: any
+ }
+ setResponseBasedBranchingForQuestion: (
+ questionIndex: any,
+ responseValue: any,
+ nextStep: any,
+ specificQuestionIndex: any
+ ) => {
+ nextStep: any
+ questionIndex: any
+ responseValue: any
+ specificQuestionIndex: any
+ }
+ setResponseExpanded: (
+ uuid: string,
+ expanded: boolean
+ ) => {
+ expanded: boolean
+ uuid: string
+ }
+ setSelectedPageIndex: (idx: number | null) => {
+ idx: number | null
+ }
+ setSelectedSection: (section: SurveyEditSection | null) => {
+ section: SurveyEditSection | null
+ }
+ setShowArchivedResponses: (show: boolean) => {
+ show: boolean
+ }
+ setSurveyManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setSurveyMissing: () => {
+ value: true
+ }
+ setSurveyValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setSurveyValues: (values: DeepPartial<NewSurvey | Survey>) => {
+ values: DeepPartial<NewSurvey | Survey>
+ }
+ setWritingHTMLDescription: (writingHTML: boolean) => {
+ writingHTML: boolean
+ }
+ startResultsRequery: () => {
+ value: true
+ }
+ stopSurvey: () => any
+ stopSurveyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ stopSurveySuccess: (
+ survey: Survey,
+ payload?: any
+ ) => {
+ survey: Survey
+ payload?: any
+ }
+ submitSurvey: () => {
+ value: boolean
+ }
+ submitSurveyFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitSurveyRequest: (survey: NewSurvey | Survey) => {
+ survey: NewSurvey | Survey
+ }
+ submitSurveySuccess: (survey: NewSurvey | Survey) => {
+ survey: NewSurvey | Survey
+ }
+ toggleResponseExpansion: (uuid: string) => {
+ uuid: string
+ }
+ toggleSurveyNotificationEnabled: (
+ notificationId: string,
+ enabled: boolean
+ ) => {
+ enabled: boolean
+ notificationId: string
+ }
+ touchSurveyField: (key: string) => {
+ key: string
+ }
+ unarchiveResponse: (responseUuid: string) => {
+ responseUuid: string
+ }
+ updateSurvey: (
+ surveyPayload: Partial<Survey> & {
+ intentContext?: ProductIntentContext
+ }
+ ) => Partial<Survey> & {
+ intentContext?: ProductIntentContext
+ }
+ updateSurveyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateSurveySuccess: (
+ survey: Survey,
+ payload?: Partial<Survey> & {
+ intentContext?: ProductIntentContext
+ }
+ ) => {
+ survey: Survey
+ payload?: Partial<Survey> & {
+ intentContext?: ProductIntentContext
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ enrichedConsolidatedSurveyResults: (
+ consolidatedSurveyResults: any,
+ personNames: Record<string, string>
+ ) => ConsolidatedSurveyResults
+ timestampFilter: (survey: NewSurvey | Survey, dateRange: SurveyDateRange | null) => string
+ partialResponsesFilter: (survey: NewSurvey | Survey, dateRange: SurveyDateRange | null) => string
+ archivedResponsesFilter: (showArchivedResponses: boolean, archivedResponseUuids: Set<string>) => string
+ archivedResponsesPropertyFilter: (
+ showArchivedResponses: boolean,
+ archivedResponseUuids: Set<string>
+ ) => Array<{
+ key: string
+ type: PropertyFilterType.HogQL
+ }>
+ isAdaptiveLimitFFEnabled: (enabledFlags: FeatureFlagsSet) => boolean
+ isSurveyHeadlineEnabled: (enabledFlags: FeatureFlagsSet) => boolean
+ isAnyResultsLoading: (
+ archivedResponseUuidsLoading: boolean,
+ surveyBaseStatsLoading: boolean,
+ surveyDismissedAndSentCountLoading: boolean,
+ consolidatedSurveyResultsLoading: boolean
+ ) => boolean
+ defaultAnswerFilters: (survey: NewSurvey | Survey) => EventPropertyFilter[]
+ hasActiveAnswerFilters: (answerFilters: EventPropertyFilter[]) => boolean
+ hasActiveDateRange: (dateRange: SurveyDateRange | null, survey: NewSurvey | Survey) => boolean
+ hasActiveFilters: (
+ hasActiveAnswerFilters: boolean,
+ propertyFilters: AnyPropertyFilter[],
+ hasActiveDateRange: boolean
+ ) => boolean
+ isSurveyRunning: (survey: NewSurvey | Survey) => boolean
+ surveyUsesLimit: (survey: NewSurvey | Survey) => boolean
+ surveyUsesAdaptiveLimit: (survey: NewSurvey | Survey) => boolean
+ derivedDataCollectionType: (
+ surveyUsesAdaptiveLimit: boolean,
+ surveyUsesLimit: boolean,
+ isAdaptiveLimitFFEnabled: boolean
+ ) => DataCollectionType
+ surveyShufflingQuestionsAvailable: (survey: NewSurvey | Survey) => boolean
+ showSurveyRepeatSchedule: (survey: NewSurvey | Survey) => boolean
+ descriptionContentType: (
+ survey: NewSurvey | Survey
+ ) => (questionIndex: number) => SurveyQuestionDescriptionContentType | undefined
+ surveyRepeatedActivationAvailable: (survey: NewSurvey | Survey) => boolean
+ hasTargetingSet: (survey: NewSurvey | Survey) => boolean
+ breadcrumbs: (survey: NewSurvey | Survey) => Breadcrumb[]
+ sidePanelContext: (survey: NewSurvey | Survey) => SidePanelSceneContext | null
+ projectTreeRef: (arg: string) => ProjectTreeRef
+ answerFilterHogQLExpression: (survey: NewSurvey | Survey, answerFilters: EventPropertyFilter[]) => string
+ dataTableQuery: (
+ survey: NewSurvey | Survey,
+ propertyFilters: AnyPropertyFilter[],
+ answerFilterHogQLExpression: string,
+ partialResponsesFilter: string,
+ archivedResponsesFilter: string,
+ dateRange: SurveyDateRange | null,
+ archivedResponseUuids: Set<string>,
+ showArchivedResponses: boolean
+ ) => DataTableNode | null
+ targetingFlagFilters: (survey: NewSurvey | Survey) => FeatureFlagFilters | undefined
+ urlMatchTypeValidationError: (survey: NewSurvey | Survey) => string | null
+ urlSearchParams: (
+ propertyFilters: AnyPropertyFilter[],
+ answerFilters: EventPropertyFilter[],
+ dateRange: SurveyDateRange | null,
+ survey: NewSurvey | Survey
+ ) => {
+ answerFilters: string | undefined
+ date_from: string | undefined
+ date_to: string | undefined
+ propertyFilters: string | undefined
+ }
+ deviceTypesMatchTypeValidationError: (survey: NewSurvey | Survey) => string | null
+ getBranchingDropdownValue: (
+ survey: NewSurvey | Survey
+ ) => (questionIndex: number, question: SurveyQuestion) => string
+ getResponseBasedBranchingDropdownValue: (
+ survey: NewSurvey | Survey
+ ) => (questionIndex: number, question: MultipleSurveyQuestion | RatingSurveyQuestion, response: any) => any
+ hasCycle: (survey: NewSurvey | Survey) => false
+ hasBranchingLogic: (survey: NewSurvey | Survey) => boolean
+ translationValidationErrors: (survey: NewSurvey | Survey) => TranslationValidationError[]
+ hasTranslationValidationErrors: (translationValidationErrors: TranslationValidationError[]) => boolean
+ translationErrorsByQuestion: (
+ translationValidationErrors: TranslationValidationError[],
+ editingLanguage: string | null
+ ) => (questionIndex: number) => TranslationValidationError[]
+ translationErrorsForField: (
+ translationValidationErrors: TranslationValidationError[],
+ editingLanguage: string | null
+ ) => (questionIndex: number, fieldPath: string) => TranslationValidationError | undefined
+ surveyAsInsightURL: (survey: NewSurvey | Survey) => string
+ defaultInterval: (survey: NewSurvey | Survey) => IntervalType
+ processedSurveyStats: (
+ surveyBaseStatsInternal: SurveyBaseStatsResult,
+ surveyDismissedAndSentCountInternal: DismissedAndSentCountResult
+ ) => SurveyStats | null
+ surveyRates: (processedSurveyStats: SurveyStats | null) => SurveyRates | null
+ surveyDemoData: (survey: NewSurvey | Survey) => SurveyDemoData
+ formattedOpenEndedResponses: (
+ enrichedConsolidatedSurveyResults: ConsolidatedSurveyResults,
+ survey: NewSurvey | Survey
+ ) => SurveyAnalysisQuestionGroup[]
+ surveyWarnings: (
+ survey: NewSurvey | Survey,
+ teamSdkVersions: Partial<Record<import('./surveyVersionRequirements').SurveySdkType, string | null>>
+ ) => SurveyFeatureWarning[]
+ }
+}
+
+export type surveyLogicType = MakeLogicType<surveyLogicValues, surveyLogicActions, SurveyLogicProps, surveyLogicMeta>
+
export const surveyLogic = kea<surveyLogicType>([
props({} as SurveyLogicProps),
key(({ id }) => id),
@@ -2198,7 +3054,7 @@ export const surveyLogic = kea<surveyLogicType>([
],
projectTreeRef: [
() => [(_, props: SurveyLogicProps) => props.id],
- (id): ProjectTreeRef => {
+ (id: string): ProjectTreeRef => {
return { type: 'survey', ref: id === 'new' ? null : String(id) }
},
],
@@ -2291,7 +3147,7 @@ export const surveyLogic = kea<surveyLogicType>([
],
targetingFlagFilters: [
(s) => [s.survey],
- (survey): FeatureFlagFilters | undefined => {
+ (survey: NewSurvey | Survey): FeatureFlagFilters | undefined => {
if (survey.targeting_flag_filters) {
return {
...survey.targeting_flag_filters,
@@ -2306,7 +3162,7 @@ export const surveyLogic = kea<surveyLogicType>([
],
urlMatchTypeValidationError: [
(s) => [s.survey],
- (survey): string | null => {
+ (survey: NewSurvey | Survey): string | null => {
if (
survey.conditions?.url &&
[SurveyMatchType.Regex, SurveyMatchType.NotRegex].includes(
@@ -2374,7 +3230,7 @@ export const surveyLogic = kea<surveyLogicType>([
],
getBranchingDropdownValue: [
(s) => [s.survey],
- (survey) => (questionIndex: number, question: SurveyQuestion) => {
+ (survey: NewSurvey | Survey) => (questionIndex: number, question: SurveyQuestion) => {
if (question.branching?.type) {
const { type } = question.branching
@@ -2392,33 +3248,34 @@ export const surveyLogic = kea<surveyLogicType>([
],
getResponseBasedBranchingDropdownValue: [
(s) => [s.survey],
- (survey) => (questionIndex: number, question: RatingSurveyQuestion | MultipleSurveyQuestion, response) => {
- if (!question.branching || !('responseValues' in question.branching)) {
- return SurveyQuestionBranchingType.NextQuestion
- }
+ (survey: NewSurvey | Survey) =>
+ (questionIndex: number, question: RatingSurveyQuestion | MultipleSurveyQuestion, response) => {
+ if (!question.branching || !('responseValues' in question.branching)) {
+ return SurveyQuestionBranchingType.NextQuestion
+ }
- // If a value is mapped onto an integer, we're redirecting to a specific question
- if (Number.isInteger(question.branching.responseValues[response])) {
- const nextQuestionIndex = question.branching.responseValues[response]
- return `${SurveyQuestionBranchingType.SpecificQuestion}:${nextQuestionIndex}`
- }
+ // If a value is mapped onto an integer, we're redirecting to a specific question
+ if (Number.isInteger(question.branching.responseValues[response])) {
+ const nextQuestionIndex = question.branching.responseValues[response]
+ return `${SurveyQuestionBranchingType.SpecificQuestion}:${nextQuestionIndex}`
+ }
- // If any other value is present (practically only Confirmation message), return that value
- if (question.branching?.responseValues?.[response]) {
- return question.branching.responseValues[response]
- }
+ // If any other value is present (practically only Confirmation message), return that value
+ if (question.branching?.responseValues?.[response]) {
+ return question.branching.responseValues[response]
+ }
- // No branching specified, default to Next question / Confirmation message
- if (questionIndex < survey.questions.length - 1) {
- return SurveyQuestionBranchingType.NextQuestion
- }
+ // No branching specified, default to Next question / Confirmation message
+ if (questionIndex < survey.questions.length - 1) {
+ return SurveyQuestionBranchingType.NextQuestion
+ }
- return SurveyQuestionBranchingType.End
- },
+ return SurveyQuestionBranchingType.End
+ },
],
hasCycle: [
(s) => [s.survey],
- (survey) => {
+ (survey: NewSurvey | Survey) => {
const graph = new Map()
survey.questions.forEach((question, fromIndex: number) => {
if (!graph.has(fromIndex)) {
@@ -2473,12 +3330,12 @@ export const surveyLogic = kea<surveyLogicType>([
],
hasBranchingLogic: [
(s) => [s.survey],
- (survey) =>
+ (survey: NewSurvey | Survey) =>
survey.questions.some((question) => question.branching && Object.keys(question.branching).length > 0),
],
translationValidationErrors: [
(s) => [s.survey],
- (survey): TranslationValidationError[] => {
+ (survey: NewSurvey | Survey): TranslationValidationError[] => {
const errors: TranslationValidationError[] = []
const surveyLevelFieldChecks: TranslationFieldCheck<SurveyTranslationField>[] = [
{ key: 'name', defaultValue: survey.name },
@@ -2752,7 +3609,7 @@ export const surveyLogic = kea<surveyLogicType>([
],
hasTranslationValidationErrors: [
(s) => [s.translationValidationErrors],
- (errors): boolean => errors.length > 0,
+ (errors: TranslationValidationError[]): boolean => errors.length > 0,
],
translationErrorsByQuestion: [
(s) => [s.translationValidationErrors, s.editingLanguage],
@@ -2783,7 +3640,7 @@ export const surveyLogic = kea<surveyLogicType>([
],
surveyAsInsightURL: [
(s) => [s.survey],
- (survey) => {
+ (survey: NewSurvey | Survey) => {
const query: InsightVizNode = {
kind: NodeKind.InsightVizNode,
source: {
@@ -2999,7 +3856,10 @@ export const surveyLogic = kea<surveyLogicType>([
],
surveyWarnings: [
(s) => [s.survey, s.teamSdkVersions],
- (survey, teamSdkVersions): SurveyFeatureWarning[] => {
+ (
+ survey: NewSurvey | Survey,
+ teamSdkVersions: import('./surveyVersionRequirements').TeamSdkVersions
+ ): SurveyFeatureWarning[] => {
return getSurveyWarnings(survey as Survey, teamSdkVersions)
},
],
diff --git a/frontend/src/scenes/surveys/surveyNotificationModalLogic.ts b/frontend/src/scenes/surveys/surveyNotificationModalLogic.ts
index 33ddcecad2e5..940e54a3b97d 100644
--- a/frontend/src/scenes/surveys/surveyNotificationModalLogic.ts
+++ b/frontend/src/scenes/surveys/surveyNotificationModalLogic.ts
@@ -1,5 +1,6 @@
-import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import { actionToUrl, router, urlToAction } from 'kea-router'
@@ -47,7 +48,20 @@ import {
SurveyQuestionType,
} from '~/types'
-import type { surveyNotificationModalLogicType } from './surveyNotificationModalLogicType'
+import type {
+ AccessControlLevel,
+ BasicSurveyQuestion,
+ FeatureFlagBasicType,
+ FeatureFlagFilters,
+ LinkSurveyQuestion,
+ MultipleSurveyQuestion,
+ RatingSurveyQuestion,
+ SurveyAppearance,
+ SurveyDisplayConditions,
+ SurveySchedule,
+ SurveyType,
+} from '../../types'
+import type { NewSurvey } from './constants'
export const WEBHOOK_METHOD_OPTIONS = [
{ value: 'POST', label: 'POST' },
@@ -846,6 +860,286 @@ function getNotificationFormErrors(
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyNotificationModalLogicValues {
+ integrations: IntegrationType[] | null // integrationsLogic
+ survey: NewSurvey | Survey // surveyLogic
+ surveyLoading: boolean // surveyLogic
+ surveyNotifications: HogFunctionType[] // surveyLogic
+ surveyNotificationsLoading: boolean // surveyLogic
+ copiedNotification: HogFunctionType | null
+ editingNotification: HogFunctionType | null
+ hasSlackIntegration: boolean
+ isNotificationFormSubmitting: boolean
+ isNotificationFormValid: boolean
+ isOpen: boolean
+ lastResponseEventQuery: EventsQuery | null
+ notificationForm: SurveyNotificationForm
+ notificationFormAllErrors: Record<string, any>
+ notificationFormChanged: boolean
+ notificationFormErrors: DeepPartialMap<SurveyNotificationForm, ValidationErrorType>
+ notificationFormHasErrors: boolean
+ notificationFormManualErrors: Record<string, any>
+ notificationFormTouched: boolean
+ notificationFormTouches: Record<string, boolean>
+ notificationFormValidationErrors: DeepPartialMap<SurveyNotificationForm, ValidationErrorType>
+ notificationSubmissionError: string | null
+ pendingDeepLink: string | null
+ selectedSlackIntegration: IntegrationType | null
+ showNotificationFormErrors: boolean
+ submitDisabledReason: string | undefined
+ templateGlobals: CyclotronJobInvocationGlobals
+ testResult: CyclotronJobTestInvocationResult | null
+ testResultError: string | null
+ testResultLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyNotificationModalLogicActions {
+ loadSurveyNotifications: () => any // surveyLogic
+ loadSurveyNotificationsSuccess: (
+ surveyNotifications: HogFunctionType[],
+ payload?: any
+ ) => {
+ payload?: any
+ surveyNotifications: HogFunctionType[]
+ } // surveyLogic
+ loadSurveySuccess: (
+ survey:
+ | Survey
+ | {
+ appearance: SurveyAppearance | null
+ archived: boolean
+ base_language?: string | null | undefined
+ conditions: SurveyDisplayConditions | null
+ current_iteration?: number | null | undefined
+ description: string
+ enable_iframe_embedding?: boolean | null | undefined
+ enable_partial_responses?: boolean | null | undefined
+ end_date: string | null
+ form_content?: Record<string, unknown> | null | undefined
+ headline_response_count?: number | null | undefined
+ headline_summary?: string | null | undefined
+ id: 'new'
+ iteration_count?: number | null | undefined
+ iteration_frequency_days?: number | null | undefined
+ iteration_start_dates?: string[] | undefined
+ linked_flag: FeatureFlagBasicType | null
+ linked_flag_id: number | null
+ name: string
+ questions: (
+ | BasicSurveyQuestion
+ | LinkSurveyQuestion
+ | MultipleSurveyQuestion
+ | RatingSurveyQuestion
+ )[]
+ response_sampling_interval?: number | null | undefined
+ response_sampling_interval_type?: string | null | undefined
+ response_sampling_limit?: number | null | undefined
+ response_sampling_start_date?: string | null | undefined
+ responses_limit: number | null
+ schedule?: SurveySchedule | null | undefined
+ start_date: string | null
+ targeting_flag: FeatureFlagBasicType | null
+ targeting_flag_filters?: FeatureFlagFilters | undefined
+ translations?:
+ | Record<
+ string,
+ {
+ backButtonText?: string | undefined
+ name?: string | undefined
+ submitButtonText?: string | undefined
+ thankYouMessageCloseButtonText?: string | undefined
+ thankYouMessageDescription?: string | undefined
+ thankYouMessageHeader?: string | undefined
+ }
+ >
+ | null
+ | undefined
+ type: SurveyType
+ user_access_level: AccessControlLevel
+ },
+ payload?: any
+ ) => {
+ payload?: any
+ survey:
+ | Survey
+ | {
+ appearance: SurveyAppearance | null
+ archived: boolean
+ base_language?: string | null | undefined
+ conditions: SurveyDisplayConditions | null
+ current_iteration?: number | null | undefined
+ description: string
+ enable_iframe_embedding?: boolean | null | undefined
+ enable_partial_responses?: boolean | null | undefined
+ end_date: string | null
+ form_content?: Record<string, unknown> | null | undefined
+ headline_response_count?: number | null | undefined
+ headline_summary?: string | null | undefined
+ id: 'new'
+ iteration_count?: number | null | undefined
+ iteration_frequency_days?: number | null | undefined
+ iteration_start_dates?: string[] | undefined
+ linked_flag: FeatureFlagBasicType | null
+ linked_flag_id: number | null
+ name: string
+ questions: (
+ | BasicSurveyQuestion
+ | LinkSurveyQuestion
+ | MultipleSurveyQuestion
+ | RatingSurveyQuestion
+ )[]
+ response_sampling_interval?: number | null | undefined
+ response_sampling_interval_type?: string | null | undefined
+ response_sampling_limit?: number | null | undefined
+ response_sampling_start_date?: string | null | undefined
+ responses_limit: number | null
+ schedule?: SurveySchedule | null | undefined
+ start_date: string | null
+ targeting_flag: FeatureFlagBasicType | null
+ targeting_flag_filters?: FeatureFlagFilters | undefined
+ translations?:
+ | Record<
+ string,
+ {
+ backButtonText?: string | undefined
+ name?: string | undefined
+ submitButtonText?: string | undefined
+ thankYouMessageCloseButtonText?: string | undefined
+ thankYouMessageDescription?: string | undefined
+ thankYouMessageHeader?: string | undefined
+ }
+ >
+ | null
+ | undefined
+ type: SurveyType
+ user_access_level: AccessControlLevel
+ }
+ } // surveyLogic
+ clearTestResult: () => {
+ value: true
+ }
+ clearTestResultFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ clearTestResultSuccess: (
+ testResult: null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ testResult: null
+ payload?: {
+ value: true
+ }
+ }
+ closeDialog: () => {
+ value: true
+ }
+ consumePendingDeepLink: () => {
+ value: true
+ }
+ openDialog: (payload?: OpenSurveyNotificationDialogPayload) => {
+ intent: SurveyNotificationModalIntent
+ notification: HogFunctionType | null
+ }
+ resetNotificationForm: (values?: SurveyNotificationForm) => {
+ values?: SurveyNotificationForm
+ }
+ sendTestNotification: (payload: { source: SurveyNotificationTestSource }) => {
+ source: SurveyNotificationTestSource
+ }
+ sendTestNotificationFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ sendTestNotificationSuccess: (
+ testResult: CyclotronJobTestInvocationResult,
+ payload?: {
+ source: SurveyNotificationTestSource
+ }
+ ) => {
+ testResult: CyclotronJobTestInvocationResult
+ payload?: {
+ source: SurveyNotificationTestSource
+ }
+ }
+ setNotificationFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setNotificationFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setNotificationFormValues: (values: DeepPartial<SurveyNotificationForm>) => {
+ values: DeepPartial<SurveyNotificationForm>
+ }
+ setNotificationSubmissionError: (error: string | null) => {
+ error: string | null
+ }
+ setPendingDeepLink: (target: string | null) => {
+ target: string | null
+ }
+ submitNotificationForm: () => {
+ value: boolean
+ }
+ submitNotificationFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitNotificationFormRequest: (notificationForm: SurveyNotificationForm) => {
+ notificationForm: SurveyNotificationForm
+ }
+ submitNotificationFormSuccess: (notificationForm: SurveyNotificationForm) => {
+ notificationForm: SurveyNotificationForm
+ }
+ touchNotificationFormField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyNotificationModalLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ hasSlackIntegration: (integrations: IntegrationType[] | null) => boolean
+ selectedSlackIntegration: (
+ integrations: IntegrationType[] | null,
+ notificationForm: SurveyNotificationForm
+ ) => IntegrationType | null
+ templateGlobals: (survey: NewSurvey | Survey) => CyclotronJobInvocationGlobals
+ lastResponseEventQuery: (survey: NewSurvey | Survey) => EventsQuery | null
+ submitDisabledReason: (
+ survey: NewSurvey | Survey,
+ notificationFormErrors: DeepPartialMap<SurveyNotificationForm, ValidationErrorType>,
+ isNotificationFormSubmitting: boolean,
+ editingNotification: HogFunctionType | null,
+ copiedNotification: HogFunctionType | null
+ ) => string | undefined
+ }
+}
+
+export type surveyNotificationModalLogicType = MakeLogicType<
+ surveyNotificationModalLogicValues,
+ surveyNotificationModalLogicActions,
+ SurveyNotificationModalLogicProps,
+ surveyNotificationModalLogicMeta
+>
+
export const surveyNotificationModalLogic = kea<surveyNotificationModalLogicType>([
path(['scenes', 'surveys', 'surveyNotificationModalLogic']),
props({} as SurveyNotificationModalLogicProps),
diff --git a/frontend/src/scenes/surveys/surveyNotificationsListLogic.ts b/frontend/src/scenes/surveys/surveyNotificationsListLogic.ts
index d7e29037d2e0..6136cdbfdd26 100644
--- a/frontend/src/scenes/surveys/surveyNotificationsListLogic.ts
+++ b/frontend/src/scenes/surveys/surveyNotificationsListLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -10,8 +10,6 @@ import { projectLogic } from 'scenes/projectLogic'
import { CyclotronJobFiltersType, HogFunctionType, Survey, SurveyEventName, SurveyEventProperties } from '~/types'
-import type { surveyNotificationsListLogicType } from './surveyNotificationsListLogicType'
-
const SURVEY_NOTIFICATION_LIST_LIMIT = 200
const SURVEY_INDEX_LIMIT = 1000
@@ -42,6 +40,99 @@ export function getSurveyIdsFromNotificationFilters(filters?: CyclotronJobFilter
export type KnownSurvey = Pick<Survey, 'id' | 'name' | 'archived' | 'created_at'>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyNotificationsListLogicValues {
+ currentProjectId: number | null // projectLogic
+ allNotifications: HogFunctionType[]
+ allNotificationsLoading: boolean
+ filteredSelectableSurveys: KnownSurvey[]
+ knownSurveyIds: Set<string>
+ knownSurveys: KnownSurvey[]
+ knownSurveysFailed: boolean
+ knownSurveysLoading: boolean
+ notifications: HogFunctionType[]
+ notificationsFailed: boolean
+ notificationsLoading: boolean
+ selectableSurveys: KnownSurvey[]
+ surveyCreatedAtById: Map<string, string>
+ surveyPickerSearch: string
+ surveyPickerVisible: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyNotificationsListLogicActions {
+ deleteNotification: (notification: HogFunctionType) => {
+ notification: HogFunctionType
+ }
+ loadKnownSurveys: () => any
+ loadKnownSurveysFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadKnownSurveysSuccess: (
+ knownSurveys: KnownSurvey[],
+ payload?: any
+ ) => {
+ knownSurveys: KnownSurvey[]
+ payload?: any
+ }
+ loadNotifications: () => any
+ loadNotificationsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadNotificationsSuccess: (
+ allNotifications: HogFunctionType[],
+ payload?: any
+ ) => {
+ allNotifications: HogFunctionType[]
+ payload?: any
+ }
+ setSurveyPickerSearch: (search: string) => {
+ search: string
+ }
+ setSurveyPickerVisible: (visible: boolean) => {
+ visible: boolean
+ }
+ toggleNotificationEnabled: (
+ notificationId: string,
+ enabled: boolean
+ ) => {
+ enabled: boolean
+ notificationId: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyNotificationsListLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ surveyCreatedAtById: (knownSurveys: KnownSurvey[]) => Map<string, string>
+ knownSurveyIds: (knownSurveys: KnownSurvey[]) => Set<string>
+ selectableSurveys: (knownSurveys: KnownSurvey[]) => KnownSurvey[]
+ filteredSelectableSurveys: (selectableSurveys: KnownSurvey[], surveyPickerSearch: string) => KnownSurvey[]
+ notifications: (
+ allNotifications: HogFunctionType[],
+ knownSurveyIds: Set<string>,
+ surveyCreatedAtById: Map<string, string>,
+ knownSurveysFailed: boolean
+ ) => HogFunctionType[]
+ notificationsLoading: (allNotificationsLoading: boolean, knownSurveysLoading: boolean) => boolean
+ }
+}
+
+export type surveyNotificationsListLogicType = MakeLogicType<
+ surveyNotificationsListLogicValues,
+ surveyNotificationsListLogicActions,
+ Record<string, any>,
+ surveyNotificationsListLogicMeta
+>
+
export const surveyNotificationsListLogic = kea<surveyNotificationsListLogicType>([
path(['scenes', 'surveys', 'surveyNotificationsListLogic']),
connect(() => ({
diff --git a/frontend/src/scenes/surveys/surveyQuestionLabelsLogic.ts b/frontend/src/scenes/surveys/surveyQuestionLabelsLogic.ts
index 3f0a7ae4f309..cd1de6684e55 100644
--- a/frontend/src/scenes/surveys/surveyQuestionLabelsLogic.ts
+++ b/frontend/src/scenes/surveys/surveyQuestionLabelsLogic.ts
@@ -1,10 +1,8 @@
-import { afterMount, kea, path } from 'kea'
+import { MakeLogicType, afterMount, kea, path } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
-import type { surveyQuestionLabelsLogicType } from './surveyQuestionLabelsLogicType'
-
export interface SurveyQuestionLabel {
surveyId: string
surveyName: string
@@ -12,6 +10,36 @@ export interface SurveyQuestionLabel {
questionIndex: number
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyQuestionLabelsLogicValues {
+ surveyQuestionLabels: Record<string, SurveyQuestionLabel>
+ surveyQuestionLabelsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyQuestionLabelsLogicActions {
+ loadSurveyQuestionLabels: () => any
+ loadSurveyQuestionLabelsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSurveyQuestionLabelsSuccess: (
+ surveyQuestionLabels: Record<string, SurveyQuestionLabel>,
+ payload?: any
+ ) => {
+ surveyQuestionLabels: Record<string, SurveyQuestionLabel>
+ payload?: any
+ }
+}
+
+export type surveyQuestionLabelsLogicType = MakeLogicType<
+ surveyQuestionLabelsLogicValues,
+ surveyQuestionLabelsLogicActions
+>
+
export const surveyQuestionLabelsLogic = kea<surveyQuestionLabelsLogicType>([
path(['scenes', 'surveys', 'surveyQuestionLabelsLogic']),
loaders(({ values }) => ({
diff --git a/frontend/src/scenes/surveys/surveysLogic.tsx b/frontend/src/scenes/surveys/surveysLogic.tsx
index 5c28e1fe44f5..e3fc64127d44 100644
--- a/frontend/src/scenes/surveys/surveysLogic.tsx
+++ b/frontend/src/scenes/surveys/surveysLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { actionToUrl, router, urlToAction } from 'kea-router'
@@ -22,9 +22,12 @@ import { deleteFromTree } from '~/layout/panel-layout/ProjectTree/projectTreeLog
import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-general'
import { ActivityScope, AvailableFeature, Breadcrumb, ProgressStatus, Survey, SurveyType } from '~/types'
+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'
+import type { ProductIntentProperties } from '../../lib/utils/product-intents'
+import type { TeamPublicType, TeamType } from '../../types'
import { SURVEY_CREATED_SOURCE } from './constants'
-import type { surveysLogicType } from './surveysLogicType'
import { surveysSdkLogic } from './surveysSdkLogic'
+import type { TeamSdkVersions } from './surveyVersionRequirements'
import { captureMaxAISurveyCreationException } from './utils'
export enum SurveysTabs {
@@ -111,6 +114,307 @@ function updateSurvey(surveys: Survey[], id: string, updatedSurvey: Survey): Sur
return surveys.map((s) => (s.id === id ? updatedSurvey : s))
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveysLogicValues {
+ enabledFlags: FeatureFlagsSet // enabledFlagLogic
+ teamSdkVersions: TeamSdkVersions // surveysSdkLogic
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ currentTeamLoading: boolean // teamLogic
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean // userLogic
+ breadcrumbs: Breadcrumb[]
+ data: SurveyDataState
+ dataLoading: boolean
+ duplicatedSurvey: Survey | null
+ duplicatedSurveyLoading: boolean
+ filters: Partial<SurveysFilters>
+ formBuilderEnabled: boolean
+ globalSurveyAppearanceConfigAvailable: boolean
+ hasNextPage: boolean
+ hasNextSearchPage: boolean
+ isAppearanceModalOpen: boolean
+ preferredEditor: 'full' | 'guided'
+ searchTerm: any
+ searchedSurveys: Survey[]
+ showSurveysDisabledBanner: boolean
+ sidePanelContext: SidePanelSceneContext
+ surveyToDuplicate: Survey | null
+ surveysResponsesCount: {
+ [key: string]: number
+ }
+ surveysResponsesCountLoading: boolean
+ surveysStylingAvailable: boolean
+ tab: SurveysTabs
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveysLogicActions {
+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic
+ loadCurrentTeam: () => any // teamLogic
+ deleteSurvey: (id: any) => any
+ deleteSurveyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteSurveySuccess: (
+ data: {
+ searchSurveys: Survey[]
+ searchSurveysCount: number
+ surveys: Survey[]
+ surveysCount: number
+ },
+ payload?: any
+ ) => {
+ data: {
+ searchSurveys: Survey[]
+ searchSurveysCount: number
+ surveys: Survey[]
+ surveysCount: number
+ }
+ payload?: any
+ }
+ duplicateSurvey: (survey: Survey) => Survey
+ duplicateSurveyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ duplicateSurveySuccess: (
+ duplicatedSurvey: Survey,
+ payload?: Survey
+ ) => {
+ duplicatedSurvey: Survey
+ payload?: Survey
+ }
+ duplicateToProjects: ({ survey, targetTeamIds }: { survey: Survey; targetTeamIds: number[] }) => {
+ survey: Survey
+ targetTeamIds: number[]
+ }
+ duplicateToProjectsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ duplicateToProjectsSuccess: (
+ duplicatedSurvey: Survey,
+ payload?: {
+ survey: Survey
+ targetTeamIds: number[]
+ }
+ ) => {
+ duplicatedSurvey: Survey
+ payload?: {
+ survey: Survey
+ targetTeamIds: number[]
+ }
+ }
+ handleMaxSurveyCreated: (
+ toolOutput: {
+ error?: string
+ error_message?: string
+ survey_id?: string
+ survey_name?: string
+ survey_type?: string
+ },
+ source: SURVEY_CREATED_SOURCE
+ ) => {
+ source: SURVEY_CREATED_SOURCE
+ toolOutput: {
+ error?: string | undefined
+ error_message?: string | undefined
+ survey_id?: string | undefined
+ survey_name?: string | undefined
+ survey_type?: string | undefined
+ }
+ }
+ loadNextPage: () => {
+ value: true
+ }
+ loadNextPageFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadNextPageSuccess: (
+ data: SurveyDataState,
+ payload?: {
+ value: true
+ }
+ ) => {
+ data: SurveyDataState
+ payload?: {
+ value: true
+ }
+ }
+ loadNextSearchPage: () => {
+ value: true
+ }
+ loadNextSearchPageFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadNextSearchPageSuccess: (
+ data: SurveyDataState,
+ payload?: {
+ value: true
+ }
+ ) => {
+ data: SurveyDataState
+ payload?: {
+ value: true
+ }
+ }
+ loadResponsesCount: (surveyIds: string) => string
+ loadResponsesCountFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadResponsesCountSuccess: (
+ surveysResponsesCount: {
+ [key: string]: number
+ },
+ payload?: string
+ ) => {
+ surveysResponsesCount: {
+ [key: string]: number
+ }
+ payload?: string
+ }
+ loadSearchResults: () => any
+ loadSearchResultsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSearchResultsSuccess: (
+ data: SurveyDataState,
+ payload?: any
+ ) => {
+ data: SurveyDataState
+ payload?: any
+ }
+ loadSurveys: () => any
+ loadSurveysFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSurveysSuccess: (
+ data: SurveyDataState,
+ payload?: any
+ ) => {
+ data: SurveyDataState
+ payload?: any
+ }
+ setIsAppearanceModalOpen: (isOpen: boolean) => {
+ isOpen: boolean
+ }
+ setPreferredEditor: (editor: 'full' | 'guided') => {
+ editor: 'full' | 'guided'
+ }
+ setSearchTerm: (searchTerm: string) => {
+ searchTerm: string
+ }
+ setSurveyToDuplicate: (survey: Survey | null) => {
+ survey: Survey | null
+ }
+ setSurveysFilters: (
+ filters: Partial<SurveysFilters>,
+ replace?: boolean
+ ) => {
+ filters: Partial<SurveysFilters>
+ replace: boolean | undefined
+ }
+ setTab: (tab: SurveysTabs) => {
+ tab: SurveysTabs
+ }
+ updateSurvey: ({
+ id,
+ updatePayload,
+ intentContext,
+ }: {
+ id: string
+ intentContext?: ProductIntentContext
+ updatePayload: any
+ }) => {
+ id: string
+ updatePayload: any
+ intentContext?: ProductIntentContext
+ }
+ updateSurveyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateSurveySuccess: (
+ data: {
+ searchSurveys: Survey[]
+ searchSurveysCount: number
+ surveys: Survey[]
+ surveysCount: number
+ },
+ payload?: {
+ id: string
+ updatePayload: any
+ intentContext?: ProductIntentContext
+ }
+ ) => {
+ data: {
+ searchSurveys: Survey[]
+ searchSurveysCount: number
+ surveys: Survey[]
+ surveysCount: number
+ }
+ payload?: {
+ id: string
+ updatePayload: any
+ intentContext?: ProductIntentContext
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveysLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ searchedSurveys: (data: SurveyDataState, searchTerm: any, filters: Partial<SurveysFilters>) => Survey[]
+ surveysStylingAvailable: (
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean
+ ) => boolean
+ formBuilderEnabled: (enabledFlags: FeatureFlagsSet) => boolean
+ globalSurveyAppearanceConfigAvailable: (
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean
+ ) => boolean
+ showSurveysDisabledBanner: (currentTeam: TeamPublicType | TeamType | null) => boolean
+ }
+}
+
+export type surveysLogicType = MakeLogicType<
+ surveysLogicValues,
+ surveysLogicActions,
+ Record<string, any>,
+ surveysLogicMeta
+>
+
export const surveysLogic = kea<surveysLogicType>([
path(['scenes', 'surveys', 'surveysLogic']),
connect(() => ({
@@ -412,7 +716,7 @@ export const surveysLogic = kea<surveysLogicType>([
selectors({
searchedSurveys: [
(selectors) => [selectors.data, selectors.searchTerm, selectors.filters],
- (data, searchTerm, filters) => {
+ (data: SurveyDataState, searchTerm, filters: Partial<SurveysFilters>) => {
let searchedSurveys = searchTerm?.trim() ? data.searchSurveys : data.surveys
const { status, type, created_by, archived } = filters
@@ -448,19 +752,22 @@ export const surveysLogic = kea<surveysLogicType>([
],
surveysStylingAvailable: [
(s) => [s.hasAvailableFeature],
- (hasAvailableFeature) => hasAvailableFeature(AvailableFeature.SURVEYS_STYLING),
+ (hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean) =>
+ hasAvailableFeature(AvailableFeature.SURVEYS_STYLING),
],
formBuilderEnabled: [
(s) => [s.enabledFlags],
- (enabledFlags) => !!enabledFlags[FEATURE_FLAGS.SURVEYS_FORM_BUILDER],
+ (enabledFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet) =>
+ !!enabledFlags[FEATURE_FLAGS.SURVEYS_FORM_BUILDER],
],
globalSurveyAppearanceConfigAvailable: [
(s) => [s.hasAvailableFeature],
- (hasAvailableFeature) => hasAvailableFeature(AvailableFeature.SURVEYS_STYLING),
+ (hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean) =>
+ hasAvailableFeature(AvailableFeature.SURVEYS_STYLING),
],
showSurveysDisabledBanner: [
(s) => [s.currentTeam],
- (currentTeam) => {
+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType) => {
return !currentTeam?.surveys_opt_in
},
],
diff --git a/frontend/src/scenes/surveys/surveysSdkLogic.ts b/frontend/src/scenes/surveys/surveysSdkLogic.ts
index b68b8438f590..994d18afd972 100644
--- a/frontend/src/scenes/surveys/surveysSdkLogic.ts
+++ b/frontend/src/scenes/surveys/surveysSdkLogic.ts
@@ -1,10 +1,25 @@
-import { connect, kea, path, selectors } from 'kea'
+import { MakeLogicType, connect, kea, path, selectors } from 'kea'
import { sdkHealthLogic } from '~/scenes/onboarding/shared/sdkHealth/sdkHealthLogic'
-import type { surveysSdkLogicType } from './surveysSdkLogicType'
+import type { AugmentedTeamSdkVersionsInfo } from '../onboarding/shared/sdkHealth/sdkHealthLogic'
import { TeamSdkVersions } from './surveyVersionRequirements'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveysSdkLogicValues {
+ sdkHealthData: AugmentedTeamSdkVersionsInfo // sdkHealthLogic
+ teamSdkVersions: TeamSdkVersions
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveysSdkLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ teamSdkVersions: (sdkHealthData: AugmentedTeamSdkVersionsInfo) => TeamSdkVersions
+ }
+}
+
+export type surveysSdkLogicType = MakeLogicType<surveysSdkLogicValues, {}, Record<string, any>, surveysSdkLogicMeta>
+
export const surveysSdkLogic = kea<surveysSdkLogicType>([
path(['scenes', 'surveys', 'surveysSdkLogic']),
connect(() => ({
@@ -13,7 +28,9 @@ export const surveysSdkLogic = kea<surveysSdkLogicType>([
selectors({
teamSdkVersions: [
(s) => [s.sdkHealthData],
- (sdkHealthData): TeamSdkVersions => {
+ (
+ sdkHealthData: import('~/scenes/onboarding/shared/sdkHealth/sdkHealthLogic').AugmentedTeamSdkVersionsInfo
+ ): TeamSdkVersions => {
const versions: TeamSdkVersions = {}
for (const [sdkType, sdkInfo] of Object.entries(sdkHealthData ?? {})) {
diff --git a/frontend/src/scenes/surveys/wizard/surveyWizardLogic.ts b/frontend/src/scenes/surveys/wizard/surveyWizardLogic.ts
index 9ad5d9cbe654..c6723b1a7971 100644
--- a/frontend/src/scenes/surveys/wizard/surveyWizardLogic.ts
+++ b/frontend/src/scenes/surveys/wizard/surveyWizardLogic.ts
@@ -1,4 +1,18 @@
-import { actions, afterMount, beforeUnmount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ afterMount,
+ beforeUnmount,
+ connect,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ reducers,
+ selectors,
+} from 'kea'
+import type { FieldName } from 'kea-forms/lib/index'
import { router, urlToAction } from 'kea-router'
import { lemonToast } from '@posthog/lemon-ui'
@@ -13,6 +27,8 @@ import { urls } from 'scenes/urls'
import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-general'
import { Breadcrumb, LinkSurveyQuestion, Survey, SurveyQuestionType, SurveySchedule, SurveyType } from '~/types'
+import type { ProductIntentProperties } from '../../../lib/utils/product-intents'
+import type { TeamPublicType, TeamType } from '../../../types'
import {
SURVEY_CREATED_SOURCE,
SurveyTemplate,
@@ -22,9 +38,9 @@ import {
defaultSurveyTemplates,
surveyThemes,
} from '../constants'
+import type { NewSurvey } from '../constants'
import { surveyLogic } from '../surveyLogic'
import { surveysLogic } from '../surveysLogic'
-import type { surveyWizardLogicType } from './surveyWizardLogicType'
export type WizardStep = 'template' | 'questions' | 'where' | 'when' | 'appearance' | 'success'
@@ -53,6 +69,147 @@ export interface SurveyWizardLogicProps {
id: string // 'new' for new surveys, or a UUID for editing
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyWizardLogicValues {
+ survey: NewSurvey | Survey // surveyLogic
+ surveyChanged: boolean // surveyLogic
+ surveyLoading: boolean // surveyLogic
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ breadcrumbs: Breadcrumb[]
+ coreTemplates: SurveyTemplate[]
+ createdSurvey: Survey | null
+ currentStep: WizardStep
+ currentStepHasErrors: boolean
+ otherTemplates: SurveyTemplate[]
+ recommendedFrequency: {
+ label: string
+ reason: string
+ value: string
+ }
+ selectedTemplate: SurveyTemplate | null
+ stepNumber: number
+ stepValidationErrors: Record<WizardStep, string[]>
+ surveyLaunching: boolean
+ surveySaving: boolean
+ templateMode: SurveyTemplateMode
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyWizardLogicActions {
+ reportSurveyCreated: (
+ survey: Survey,
+ isDuplicate?: boolean,
+ creationSource?: 'form_builder' | 'full_editor' | 'llm_analytics' | 'quick_create' | 'template' | 'wizard'
+ ) => {
+ creationSource:
+ | 'form_builder'
+ | 'full_editor'
+ | 'llm_analytics'
+ | 'quick_create'
+ | 'template'
+ | 'wizard'
+ | undefined
+ isDuplicate: boolean | undefined
+ survey: Survey
+ } // eventUsageLogic
+ reportSurveyEdited: (survey: Survey) => {
+ survey: Survey
+ } // eventUsageLogic
+ reportSurveyTemplateClicked: (
+ template: SurveyTemplateType,
+ source?: string
+ ) => {
+ source: string | undefined
+ template: SurveyTemplateType
+ } // eventUsageLogic
+ loadSurvey: () => any // surveyLogic
+ resetSurvey: (values?: NewSurvey | Survey | undefined) => {
+ values?: NewSurvey | Survey
+ } // surveyLogic
+ setSurveyValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ } // surveyLogic
+ loadSurveys: () => any // surveysLogic
+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic
+ launchSurvey: () => {
+ value: true
+ }
+ launchSurveyFailure: (error: string) => {
+ error: string
+ }
+ launchSurveySuccess: (survey: Survey) => {
+ survey: Survey
+ }
+ nextStep: () => {
+ value: true
+ }
+ prevStep: () => {
+ value: true
+ }
+ resetWizard: () => {
+ value: true
+ }
+ restoreDefaultQuestions: () => {
+ value: true
+ }
+ saveDraft: () => {
+ value: true
+ }
+ saveDraftFailure: (error: string) => {
+ error: string
+ }
+ saveDraftSuccess: (survey: Survey) => {
+ survey: Survey
+ }
+ selectTemplate: (template: SurveyTemplate) => {
+ template: SurveyTemplate
+ }
+ setStep: (step: WizardStep) => {
+ step: WizardStep
+ }
+ setTemplateMode: (mode: SurveyTemplateMode) => {
+ mode: SurveyTemplateMode
+ }
+ updateSurvey: () => {
+ value: true
+ }
+ updateSurveyFailure: (error: string) => {
+ error: string
+ }
+ updateSurveySuccess: (survey: Survey) => {
+ survey: Survey
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface surveyWizardLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ coreTemplates: (templateMode: SurveyTemplateMode) => SurveyTemplate[]
+ otherTemplates: (templateMode: SurveyTemplateMode) => SurveyTemplate[]
+ stepNumber: (currentStep: WizardStep) => number
+ breadcrumbs: (survey: NewSurvey | Survey) => Breadcrumb[]
+ stepValidationErrors: (survey: NewSurvey | Survey) => Record<WizardStep, string[]>
+ currentStepHasErrors: (stepValidationErrors: Record<WizardStep, string[]>, currentStep: WizardStep) => boolean
+ recommendedFrequency: (selectedTemplate: SurveyTemplate | null) => {
+ label: string
+ reason: string
+ value: string
+ }
+ }
+}
+
+export type surveyWizardLogicType = MakeLogicType<
+ surveyWizardLogicValues,
+ surveyWizardLogicActions,
+ SurveyWizardLogicProps,
+ surveyWizardLogicMeta
+>
+
export const surveyWizardLogic = kea<surveyWizardLogicType>([
path(['scenes', 'surveys', 'wizard', 'surveyWizardLogic']),
diff --git a/products/ai_observability/frontend/ConversationDisplay/messageActionsMenuLogic.ts b/products/ai_observability/frontend/ConversationDisplay/messageActionsMenuLogic.ts
index 41d53508aea5..8f96dd00a6d1 100644
--- a/products/ai_observability/frontend/ConversationDisplay/messageActionsMenuLogic.ts
+++ b/products/ai_observability/frontend/ConversationDisplay/messageActionsMenuLogic.ts
@@ -1,11 +1,10 @@
-import { actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { organizationLogic } from 'scenes/organizationLogic'
import supportedLanguagesJson from '../../shared/supported_languages.json'
-import type { messageActionsMenuLogicType } from './messageActionsMenuLogicType'
const STORAGE_KEY = 'posthog-translate-language'
export const MAX_TRANSLATE_LENGTH = 10000
@@ -52,6 +51,81 @@ export interface MessageActionsMenuLogicProps {
content: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface messageActionsMenuLogicValues {
+ content: any
+ currentLanguageLabel: string
+ dataProcessingAccepted: boolean
+ isTooLong: boolean
+ showConsentPopover: boolean
+ showTranslatePopover: boolean
+ targetLanguage: LanguageCode
+ textToTranslate: any
+ translatedWithLanguage: LanguageCode | null
+ translation: {
+ targetLanguage: LanguageCode
+ translation: string
+ } | null
+ translationError: string | null
+ translationLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface messageActionsMenuLogicActions {
+ resetTranslation: () => {
+ value: true
+ }
+ setShowConsentPopover: (show: boolean) => {
+ show: boolean
+ }
+ setShowTranslatePopover: (show: boolean) => {
+ show: boolean
+ }
+ setTargetLanguage: (language: LanguageCode) => {
+ language: string
+ }
+ translate: () => any
+ translateFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ translateSuccess: (
+ translation: {
+ targetLanguage: string
+ translation: string
+ },
+ payload?: any
+ ) => {
+ translation: {
+ targetLanguage: string
+ translation: string
+ }
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface messageActionsMenuLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isTooLong: (content: any) => boolean
+ textToTranslate: (content: any, isTooLong: boolean) => any
+ content: (arg: any) => any
+ currentLanguageLabel: (targetLanguage: string) => string
+ dataProcessingAccepted: (currentOrganization: null | import('~/types').OrganizationType) => boolean
+ }
+}
+
+export type messageActionsMenuLogicType = MakeLogicType<
+ messageActionsMenuLogicValues,
+ messageActionsMenuLogicActions,
+ MessageActionsMenuLogicProps,
+ messageActionsMenuLogicMeta
+>
+
export const messageActionsMenuLogic = kea<messageActionsMenuLogicType>([
path(['products', 'ai_observability', 'frontend', 'ConversationDisplay', 'messageActionsMenuLogic']),
props({} as MessageActionsMenuLogicProps),
@@ -106,16 +180,18 @@ export const messageActionsMenuLogic = kea<messageActionsMenuLogicType>([
isTooLong: [(s) => [s.content], (content) => content.length > MAX_TRANSLATE_LENGTH],
textToTranslate: [
(s) => [s.content, s.isTooLong],
- (content, isTooLong) => (isTooLong ? content.substring(0, MAX_TRANSLATE_LENGTH) : content),
+ (content, isTooLong: boolean) => (isTooLong ? content.substring(0, MAX_TRANSLATE_LENGTH) : content),
],
content: [() => [(_, props) => props.content], (content) => content],
currentLanguageLabel: [
(s) => [s.targetLanguage],
- (targetLanguage) => SUPPORTED_LANGUAGES.find((lang) => lang.value === targetLanguage)?.label || 'English',
+ (targetLanguage: LanguageCode) =>
+ SUPPORTED_LANGUAGES.find((lang) => lang.value === targetLanguage)?.label || 'English',
],
dataProcessingAccepted: [
() => [organizationLogic.selectors.currentOrganization],
- (currentOrganization): boolean => !!currentOrganization?.is_ai_data_processing_approved,
+ (currentOrganization: null | import('~/types').OrganizationType): boolean =>
+ !!currentOrganization?.is_ai_data_processing_approved,
],
}),
loaders(({ values }) => ({
diff --git a/products/ai_observability/frontend/aiObservabilityAIDataLogic.ts b/products/ai_observability/frontend/aiObservabilityAIDataLogic.ts
index 7e2729e09d1b..98032e280409 100644
--- a/products/ai_observability/frontend/aiObservabilityAIDataLogic.ts
+++ b/products/ai_observability/frontend/aiObservabilityAIDataLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -7,7 +7,6 @@ import { dayjs } from 'lib/dayjs'
import { ProductKey } from '~/queries/schema/schema-general'
import { hogql } from '~/queries/utils'
-import type { aiObservabilityAIDataLogicType } from './aiObservabilityAIDataLogicType'
import { parsePartialJSON } from './utils'
const AI_DATA_QUERY_TAGS = {
@@ -216,6 +215,68 @@ async function loadAIDataAsync(params: LoadAIDataParams): Promise<AIData> {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityAIDataLogicValues {
+ aiDataCache: Record<string, AIData>
+ aiDataForEvent:
+ | (AIData & {
+ eventId: string
+ })
+ | null
+ aiDataForEventLoading: boolean
+ isEventLoading: (eventId: string) => boolean
+ loadingEventIds: Set<string>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityAIDataLogicActions {
+ clearAIDataForEvent: (eventId: string) => {
+ eventId: string
+ }
+ clearAllAIData: () => {
+ value: true
+ }
+ loadAIDataForEvent: (params: LoadAIDataParams) => LoadAIDataParams
+ loadAIDataForEventFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAIDataForEventSuccess: (
+ aiDataForEvent: {
+ eventId: string
+ input: unknown
+ output: unknown
+ tools: unknown
+ },
+ payload?: LoadAIDataParams
+ ) => {
+ aiDataForEvent: {
+ eventId: string
+ input: unknown
+ output: unknown
+ tools: unknown
+ }
+ payload?: LoadAIDataParams
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityAIDataLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ isEventLoading: (loadingEventIds: Set<string>) => (eventId: string) => boolean
+ }
+}
+
+export type aiObservabilityAIDataLogicType = MakeLogicType<
+ aiObservabilityAIDataLogicValues,
+ aiObservabilityAIDataLogicActions,
+ Record<string, any>,
+ aiObservabilityAIDataLogicMeta
+>
+
export const aiObservabilityAIDataLogic = kea<aiObservabilityAIDataLogicType>([
path(['products', 'ai_observability', 'frontend', 'aiObservabilityAIDataLogic']),
@@ -270,7 +331,7 @@ export const aiObservabilityAIDataLogic = kea<aiObservabilityAIDataLogicType>([
selectors({
isEventLoading: [
(s) => [s.loadingEventIds],
- (loadingEventIds): ((eventId: string) => boolean) => {
+ (loadingEventIds: Set<string>): ((eventId: string) => boolean) => {
return (eventId: string) => loadingEventIds.has(eventId)
},
],
diff --git a/products/ai_observability/frontend/aiObservabilitySessionDataLogic.ts b/products/ai_observability/frontend/aiObservabilitySessionDataLogic.ts
index 89e96cceb5a6..c961cbecac2c 100644
--- a/products/ai_observability/frontend/aiObservabilitySessionDataLogic.ts
+++ b/products/ai_observability/frontend/aiObservabilitySessionDataLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { subscriptions } from 'kea-subscriptions'
import api from 'lib/api'
@@ -18,7 +18,20 @@ import {
} from '~/queries/schema/schema-general'
import { InsightLogicProps } from '~/types'
-import type { aiObservabilitySessionDataLogicType } from './aiObservabilitySessionDataLogicType'
+import type {
+ ErrorTrackingQueryResponse,
+ HogQLAutocompleteResponse,
+ HogQLMetadataResponse,
+ HogQLQueryResponse,
+ HogQueryResponse,
+ LogAttributesQueryResponse,
+ LogValuesQueryResponse,
+ MetricsQueryResponse,
+ SessionsQueryResponse,
+ TraceSpansAggregationQueryResponse,
+ TraceSpansAttributeBreakdownQueryResponse,
+ TraceSpansQueryResponse,
+} from '../../../frontend/src/queries/schema/schema-general'
import { aiObservabilitySessionLogic } from './aiObservabilitySessionLogic'
import { restoreTree } from './aiObservabilityTraceDataLogic'
import { SessionTurn, extractSessionTurns } from './extractSessionTurns'
@@ -90,6 +103,169 @@ function resolveFocusEventId(trace: LLMTrace, focusKey: string): string | null {
return match?.id ?? null
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySessionDataLogicValues {
+ dateRange: {
+ dateFrom: string | null
+ dateTo: string | null
+ } | null // aiObservabilitySessionLogic
+ sessionId: string // aiObservabilitySessionLogic
+ canLoadNextData: boolean // dataNodeLogic
+ hasMoreData: boolean // dataNodeLogic
+ nextDataLoading: boolean // dataNodeLogic
+ response:
+ | ErrorTrackingQueryResponse
+ | HogQLAutocompleteResponse
+ | HogQLMetadataResponse
+ | HogQLQueryResponse<any[]>
+ | HogQueryResponse
+ | LogAttributesQueryResponse
+ | LogValuesQueryResponse
+ | MetricsQueryResponse
+ | Record<string, any>
+ | SessionsQueryResponse
+ | TraceSpansAggregationQueryResponse
+ | TraceSpansAttributeBreakdownQueryResponse
+ | TraceSpansQueryResponse
+ | null // dataNodeLogic
+ responseError: string | null // dataNodeLogic
+ responseLoading: boolean // dataNodeLogic
+ dataProcessingAccepted: boolean // maxGlobalLogic
+ currentTeamId: number | null // teamLogic
+ drawerFocusKey: string | null
+ drawerTraceId: string | null
+ expandedGenerationIds: Set<string>
+ fullTraceDateRangeCacheKeys: Record<string, string>
+ fullTraces: Record<string, LLMTrace>
+ initialLoading: boolean
+ loadingFullTraces: Set<string>
+ sessionTurns: SessionTurn[]
+ summariesLoading: boolean
+ traceSummaries: Record<string, TraceSummary>
+ traces: LLMTrace[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySessionDataLogicActions {
+ setDateRange: (
+ dateFrom: string | null,
+ dateTo?: string | null | undefined
+ ) => {
+ dateFrom: string | null
+ dateTo: string | null | undefined
+ } // aiObservabilitySessionLogic
+ loadNextData: () => any // dataNodeLogic
+ clearTraceDetails: () => {
+ value: true
+ }
+ clearTraceSummaries: () => {
+ value: true
+ }
+ closeStepsDrawer: () => {
+ value: true
+ }
+ focusGenerationExpanded: (generationId: string) => {
+ generationId: string
+ }
+ loadCachedSummaries: (traceIds: string[]) => {
+ traceIds: string[]
+ }
+ loadCachedSummariesSuccess: (
+ summaries: Array<{
+ title: string
+ trace_id: string
+ }>
+ ) => {
+ summaries: {
+ title: string
+ trace_id: string
+ }[]
+ }
+ loadFullTrace: (traceId: string) => {
+ traceId: string
+ }
+ loadFullTraceFailure: (traceId: string) => {
+ traceId: string
+ }
+ loadFullTraceSuccess: (
+ traceId: string,
+ trace: LLMTrace,
+ dateRangeCacheKey: string
+ ) => {
+ dateRangeCacheKey: string
+ trace: LLMTrace
+ traceId: string
+ }
+ openStepsDrawer: (
+ traceId: string,
+ focusEventKey?: string | null
+ ) => {
+ focusEventKey: string | null
+ traceId: string
+ }
+ summarizeAllTraces: () => {
+ value: true
+ }
+ summarizeTrace: (
+ traceId: string,
+ forceRefresh?: boolean
+ ) => {
+ forceRefresh: boolean
+ traceId: string
+ }
+ summarizeTraceFailure: (
+ traceId: string,
+ error: string
+ ) => {
+ error: string
+ traceId: string
+ }
+ summarizeTraceSuccess: (
+ traceId: string,
+ title: string
+ ) => {
+ title: string
+ traceId: string
+ }
+ toggleGenerationExpanded: (generationId: string) => {
+ generationId: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySessionDataLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ traces: (
+ response:
+ | ErrorTrackingQueryResponse
+ | HogQLAutocompleteResponse
+ | HogQLMetadataResponse
+ | HogQLQueryResponse<any[]>
+ | HogQueryResponse
+ | LogAttributesQueryResponse
+ | LogValuesQueryResponse
+ | MetricsQueryResponse
+ | Record<string, any>
+ | SessionsQueryResponse
+ | TraceSpansAggregationQueryResponse
+ | TraceSpansAttributeBreakdownQueryResponse
+ | TraceSpansQueryResponse
+ | null
+ ) => LLMTrace[]
+ sessionTurns: (traces: LLMTrace[], fullTraces: Record<string, LLMTrace>) => SessionTurn[]
+ summariesLoading: (traceSummaries: Record<string, TraceSummary>) => boolean
+ initialLoading: (responseLoading: boolean) => boolean
+ }
+}
+
+export type aiObservabilitySessionDataLogicType = MakeLogicType<
+ aiObservabilitySessionDataLogicValues,
+ aiObservabilitySessionDataLogicActions,
+ SessionDataLogicProps,
+ aiObservabilitySessionDataLogicMeta
+>
+
export const aiObservabilitySessionDataLogic = kea<aiObservabilitySessionDataLogicType>([
path(['scenes', 'ai-observability', 'aiObservabilitySessionDataLogic']),
props({} as SessionDataLogicProps),
diff --git a/products/ai_observability/frontend/aiObservabilitySessionFeedbackLogic.ts b/products/ai_observability/frontend/aiObservabilitySessionFeedbackLogic.ts
index c634acababa8..81f26c1890a2 100644
--- a/products/ai_observability/frontend/aiObservabilitySessionFeedbackLogic.ts
+++ b/products/ai_observability/frontend/aiObservabilitySessionFeedbackLogic.ts
@@ -1,11 +1,9 @@
-import { actions, afterMount, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, key, listeners, path, props, reducers } from 'kea'
import api from 'lib/api'
import { HogQLQuery, NodeKind } from '~/queries/schema/schema-general'
-import type { aiObservabilitySessionFeedbackLogicType } from './aiObservabilitySessionFeedbackLogicType'
-
export interface SessionFeedback {
rating: string
triggerType: string
@@ -23,6 +21,48 @@ export interface SessionFeedbackLogicProps {
sessionId: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySessionFeedbackLogicValues {
+ feedbackLoading: boolean
+ sessionFeedback: SessionFeedback[]
+ sessionSupportTickets: SessionSupportTicket[]
+ supportTicketsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySessionFeedbackLogicActions {
+ loadSessionFeedback: () => {
+ value: true
+ }
+ loadSessionFeedbackFailure: () => {
+ value: true
+ }
+ loadSessionFeedbackSuccess: (feedback: SessionFeedback[]) => {
+ feedback: SessionFeedback[]
+ }
+ loadSessionSupportTickets: () => {
+ value: true
+ }
+ loadSessionSupportTicketsFailure: () => {
+ value: true
+ }
+ loadSessionSupportTicketsSuccess: (tickets: SessionSupportTicket[]) => {
+ tickets: SessionSupportTicket[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySessionFeedbackLogicMeta {
+ key: string
+}
+
+export type aiObservabilitySessionFeedbackLogicType = MakeLogicType<
+ aiObservabilitySessionFeedbackLogicValues,
+ aiObservabilitySessionFeedbackLogicActions,
+ SessionFeedbackLogicProps,
+ aiObservabilitySessionFeedbackLogicMeta
+>
+
export const aiObservabilitySessionFeedbackLogic = kea<aiObservabilitySessionFeedbackLogicType>([
path(['scenes', 'ai-observability', 'aiObservabilitySessionFeedbackLogic']),
props({} as SessionFeedbackLogicProps),
diff --git a/products/ai_observability/frontend/aiObservabilitySessionLogic.ts b/products/ai_observability/frontend/aiObservabilitySessionLogic.ts
index 30cd9a40a514..6aacd9b60aa3 100644
--- a/products/ai_observability/frontend/aiObservabilitySessionLogic.ts
+++ b/products/ai_observability/frontend/aiObservabilitySessionLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, path, props, reducers, selectors } from 'kea'
import { router, urlToAction } from 'kea-router'
import { urls } from 'scenes/urls'
@@ -8,7 +8,6 @@ import { insightVizDataNodeKey } from '~/queries/nodes/InsightViz/insightVizKeys
import { AnyResponseType, DataTableNode, NodeKind, SessionQuery } from '~/queries/schema/schema-general'
import { Breadcrumb, InsightLogicProps } from '~/types'
-import type { aiObservabilitySessionLogicType } from './aiObservabilitySessionLogicType'
import { aiObservabilitySharedLogic } from './aiObservabilitySharedLogic'
export interface AIObservabilitySessionDataNodeLogicParams {
@@ -38,6 +37,62 @@ export function getDataNodeLogicProps({
export type AIObservabilitySessionLogicProps = Record<string, never>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySessionLogicValues {
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ breadcrumbs: Breadcrumb[]
+ dateRange: {
+ dateFrom: string | null
+ dateTo: string | null
+ } | null
+ query: DataTableNode
+ sessionId: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySessionLogicActions {
+ setDateRange: (
+ dateFrom: string | null,
+ dateTo?: string | null
+ ) => {
+ dateFrom: string | null
+ dateTo: string | null | undefined
+ }
+ setSessionId: (sessionId: string) => {
+ sessionId: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySessionLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ query: (
+ sessionId: string,
+ dateRange: {
+ dateFrom: string | null
+ dateTo: string | null
+ } | null
+ ) => DataTableNode
+ breadcrumbs: (
+ sessionId: string,
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+ ) => Breadcrumb[]
+ }
+}
+
+export type aiObservabilitySessionLogicType = MakeLogicType<
+ aiObservabilitySessionLogicValues,
+ aiObservabilitySessionLogicActions,
+ AIObservabilitySessionLogicProps,
+ aiObservabilitySessionLogicMeta
+>
+
export const aiObservabilitySessionLogic = kea<aiObservabilitySessionLogicType>([
path(['scenes', 'ai-observability', 'aiObservabilitySessionLogic']),
props({} as AIObservabilitySessionLogicProps),
diff --git a/products/ai_observability/frontend/aiObservabilitySharedLogic.ts b/products/ai_observability/frontend/aiObservabilitySharedLogic.ts
index 49c3e6e68cf0..9341ea3aaa95 100644
--- a/products/ai_observability/frontend/aiObservabilitySharedLogic.ts
+++ b/products/ai_observability/frontend/aiObservabilitySharedLogic.ts
@@ -1,4 +1,17 @@
-import { actions, afterMount, beforeUnmount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ afterMount,
+ beforeUnmount,
+ connect,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ reducers,
+ selectors,
+} from 'kea'
import { loaders } from 'kea-loaders'
import { router, urlToAction } from 'kea-router'
@@ -16,7 +29,9 @@ import { isAnyPropertyFilters } from '~/queries/schema-guards'
import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-general'
import { AnyPropertyFilter, Breadcrumb } from '~/types'
-import type { aiObservabilitySharedLogicType } from './aiObservabilitySharedLogicType'
+import type { FeatureFlagsSet } from '../../../frontend/src/lib/logic/featureFlagLogic'
+import type { ProductIntentProperties } from '../../../frontend/src/lib/utils/product-intents'
+import type { UserType } from '../../../frontend/src/types'
import { AI_OBSERVABILITY_CLUSTER_URL_PATTERN } from './clusters/constants'
import { parserRecipesLogic } from './settings/parserRecipesLogic'
import { hasRecentAIEvents } from './utils/aiEvents'
@@ -114,6 +129,88 @@ export function buildApplyUrlStatePayload({
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySharedLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ filterTestAccountsDefault: boolean // filterTestAccountsDefaultsLogic
+ sceneKey: string | null // sceneLogic
+ user: UserType | null // userLogic
+ activeTab: AIObservabilityTabId
+ breadcrumbs: Breadcrumb[]
+ dashboardDateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+ hasSentAiEvent: boolean | undefined
+ hasSentAiEventLoading: boolean
+ propertyFilters: AnyPropertyFilter[]
+ searchQuery: string
+ shouldFilterSupportTraces: boolean
+ shouldFilterTestAccounts: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySharedLogicActions {
+ setLocalDefault: (value: boolean) => {
+ value: boolean
+ } // filterTestAccountsDefaultsLogic
+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic
+ applyUrlState: (state: ApplyUrlStatePayload) => ApplyUrlStatePayload
+ loadAIEventDefinition: () => any
+ loadAIEventDefinitionFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAIEventDefinitionSuccess: (
+ hasSentAiEvent: boolean,
+ payload?: any
+ ) => {
+ hasSentAiEvent: boolean
+ payload?: any
+ }
+ setDates: (
+ dateFrom: string | null,
+ dateTo: string | null
+ ) => {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+ setPropertyFilters: (propertyFilters: AnyPropertyFilter[]) => {
+ propertyFilters: AnyPropertyFilter[]
+ }
+ setSearchQuery: (searchQuery: string) => {
+ searchQuery: string
+ }
+ setShouldFilterSupportTraces: (shouldFilterSupportTraces: boolean) => {
+ shouldFilterSupportTraces: boolean
+ }
+ setShouldFilterTestAccounts: (shouldFilterTestAccounts: boolean) => {
+ shouldFilterTestAccounts: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySharedLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ activeTab: (sceneKey: string | null) => AIObservabilityTabId
+ }
+}
+
+export type aiObservabilitySharedLogicType = MakeLogicType<
+ aiObservabilitySharedLogicValues,
+ aiObservabilitySharedLogicActions,
+ AIObservabilitySharedLogicProps,
+ aiObservabilitySharedLogicMeta
+>
+
export const aiObservabilitySharedLogic = kea<aiObservabilitySharedLogicType>([
path(['products', 'ai_observability', 'frontend', 'aiObservabilitySharedLogic']),
props({} as AIObservabilitySharedLogicProps),
@@ -229,7 +326,7 @@ export const aiObservabilitySharedLogic = kea<aiObservabilitySharedLogicType>([
selectors({
activeTab: [
(s) => [s.sceneKey],
- (sceneKey): AIObservabilityTabId => {
+ (sceneKey: string | null): AIObservabilityTabId => {
if (sceneKey === 'aiObservabilityGenerations') {
return 'generations'
} else if (sceneKey === 'aiObservabilityReviews') {
diff --git a/products/ai_observability/frontend/aiObservabilityTraceDataLogic.ts b/products/ai_observability/frontend/aiObservabilityTraceDataLogic.ts
index 8f7ff336f502..a0ee29d7dd70 100644
--- a/products/ai_observability/frontend/aiObservabilityTraceDataLogic.ts
+++ b/products/ai_observability/frontend/aiObservabilityTraceDataLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { subscriptions } from 'kea-subscriptions'
import posthog from 'posthog-js'
@@ -18,7 +18,20 @@ import {
} from '~/queries/schema/schema-general'
import { InsightLogicProps } from '~/types'
-import type { aiObservabilityTraceDataLogicType } from './aiObservabilityTraceDataLogicType'
+import type {
+ ErrorTrackingQueryResponse,
+ HogQLAutocompleteResponse,
+ HogQLMetadataResponse,
+ HogQLQueryResponse,
+ HogQueryResponse,
+ LogAttributesQueryResponse,
+ LogValuesQueryResponse,
+ MetricsQueryResponse,
+ SessionsQueryResponse,
+ TraceSpansAggregationQueryResponse,
+ TraceSpansAttributeBreakdownQueryResponse,
+ TraceSpansQueryResponse,
+} from '../../../frontend/src/queries/schema/schema-general'
import { type TraceGitMetadata, aiObservabilityTraceLogic } from './aiObservabilityTraceLogic'
import { llmPersonsLazyLoaderLogic } from './llmPersonsLazyLoaderLogic'
import { captureNormalizationFailure, normalizeMessages } from './messageNormalization'
@@ -217,6 +230,149 @@ export function deriveTraceGitMetadata(trace: LLMTrace | undefined): TraceGitMet
return lastFeature ?? first
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityTraceDataLogicValues {
+ eventId: string | null // aiObservabilityTraceLogic
+ initialTab: string | null // aiObservabilityTraceLogic
+ searchQuery: string // aiObservabilityTraceLogic
+ elapsedTime: number | null // dataNodeLogic
+ response:
+ | ErrorTrackingQueryResponse
+ | HogQLAutocompleteResponse
+ | HogQLMetadataResponse
+ | HogQLQueryResponse<any[]>
+ | HogQueryResponse
+ | LogAttributesQueryResponse
+ | LogValuesQueryResponse
+ | MetricsQueryResponse
+ | Record<string, any>
+ | SessionsQueryResponse
+ | TraceSpansAggregationQueryResponse
+ | TraceSpansAttributeBreakdownQueryResponse
+ | TraceSpansQueryResponse
+ | null // dataNodeLogic
+ responseError: string | null // dataNodeLogic
+ responseLoading: boolean // dataNodeLogic
+ availableEventTypes: string[]
+ effectiveEventId: string | null
+ enrichedTree: EnrichedTraceTreeNode[]
+ event: LLMTrace | LLMTraceEvent | null
+ eventMetadata: Record<string, unknown> | undefined
+ feedbackEvents: LLMTraceEvent[] | undefined
+ filteredEvents: LLMTraceEvent[]
+ filteredTree: TraceTreeNode[]
+ hasScrolledToEvent: boolean
+ highlightedEventId: string | null
+ initialFocusEventId: string | null
+ metricEvents: LLMTraceEvent[] | undefined
+ metricsAndFeedbackEvents: {
+ metric: string
+ value: any
+ }[]
+ mostRelevantEvent: LLMTraceEvent | null
+ searchOccurrences: SearchOccurrence[]
+ selectedNode: EnrichedTraceTreeNode | null
+ sessionId: string | null
+ showableEvents: LLMTraceEvent[]
+ singleTraceLoadReported: boolean
+ trace: LLMTrace | undefined
+ traceGitMetadata: TraceGitMetadata | null
+ tree: TraceTreeNode[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityTraceDataLogicActions {
+ setEventId: (eventId: string | null) => {
+ eventId: string | null
+ } // aiObservabilityTraceLogic
+ reportSingleTraceLoadIfReady: () => {
+ value: true
+ }
+ setHasScrolledToEvent: () => {
+ value: true
+ }
+ setSingleTraceLoadReported: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityTraceDataLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ trace: (
+ response:
+ | ErrorTrackingQueryResponse
+ | HogQLAutocompleteResponse
+ | HogQLMetadataResponse
+ | HogQLQueryResponse<any[]>
+ | HogQueryResponse
+ | LogAttributesQueryResponse
+ | LogValuesQueryResponse
+ | MetricsQueryResponse
+ | Record<string, any>
+ | SessionsQueryResponse
+ | TraceSpansAggregationQueryResponse
+ | TraceSpansAttributeBreakdownQueryResponse
+ | TraceSpansQueryResponse
+ | null
+ ) => LLMTrace | undefined
+ showableEvents: (trace: LLMTrace | undefined) => LLMTraceEvent[]
+ filteredEvents: (showableEvents: LLMTraceEvent[], searchQuery: string, traceId: string) => LLMTraceEvent[]
+ filteredTree: (
+ traceId: string,
+ trace: LLMTrace | undefined,
+ searchQuery: string,
+ filteredEvents: LLMTraceEvent[]
+ ) => TraceTreeNode[]
+ mostRelevantEvent: (filteredEvents: LLMTraceEvent[], searchQuery: string) => LLMTraceEvent | null
+ searchOccurrences: (
+ showableEvents: LLMTraceEvent[],
+ searchQuery: string,
+ trace: LLMTrace | undefined
+ ) => SearchOccurrence[]
+ metricEvents: (trace: LLMTrace | undefined) => LLMTraceEvent[] | undefined
+ feedbackEvents: (trace: LLMTrace | undefined) => LLMTraceEvent[] | undefined
+ traceGitMetadata: (trace: LLMTrace | undefined) => TraceGitMetadata | null
+ metricsAndFeedbackEvents: (
+ metricEvents: LLMTraceEvent[] | undefined,
+ feedbackEvents: LLMTraceEvent[] | undefined
+ ) => {
+ metric: string
+ value: any
+ }[]
+ initialFocusEventId: (
+ trace: LLMTrace | undefined,
+ filteredTree: TraceTreeNode[],
+ initialTab: string | null
+ ) => string | null
+ effectiveEventId: (eventId: string | null, initialFocusEventId: string | null) => string | null
+ event: (
+ traceId: string,
+ effectiveEventId: string | null,
+ trace: LLMTrace | undefined,
+ showableEvents: LLMTraceEvent[]
+ ) => LLMTrace | LLMTraceEvent | null
+ tree: (filteredTree: TraceTreeNode[]) => TraceTreeNode[]
+ enrichedTree: (filteredTree: TraceTreeNode[]) => EnrichedTraceTreeNode[]
+ eventMetadata: (event: LLMTrace | LLMTraceEvent | null) => Record<string, unknown> | undefined
+ highlightedEventId: (event: LLMTrace | LLMTraceEvent | null) => string | null
+ selectedNode: (
+ event: LLMTrace | LLMTraceEvent | null,
+ enrichedTree: EnrichedTraceTreeNode[]
+ ) => EnrichedTraceTreeNode | null
+ sessionId: (selectedNode: EnrichedTraceTreeNode | null, event: LLMTrace | LLMTraceEvent | null) => string | null
+ availableEventTypes: (enrichedTree: EnrichedTraceTreeNode[]) => string[]
+ }
+}
+
+export type aiObservabilityTraceDataLogicType = MakeLogicType<
+ aiObservabilityTraceDataLogicValues,
+ aiObservabilityTraceDataLogicActions,
+ TraceDataLogicProps,
+ aiObservabilityTraceDataLogicMeta
+>
+
export const aiObservabilityTraceDataLogic = kea<aiObservabilityTraceDataLogicType>([
path(['scenes', 'ai-observability', 'aiObservabilityTraceDataLogic']),
props({} as TraceDataLogicProps),
@@ -252,14 +408,30 @@ export const aiObservabilityTraceDataLogic = kea<aiObservabilityTraceDataLogicTy
selectors({
trace: [
(s) => [s.response],
- (response): LLMTrace | undefined => {
+ (
+ response:
+ | Record<string, any>
+ | null
+ | import('~/queries/schema').ErrorTrackingQueryResponse
+ | import('~/queries/schema').HogQLAutocompleteResponse
+ | import('~/queries/schema').HogQLMetadataResponse
+ | import('~/queries/schema').HogQLQueryResponse<any[]>
+ | import('~/queries/schema').HogQueryResponse
+ | import('~/queries/schema').LogAttributesQueryResponse
+ | import('~/queries/schema').LogValuesQueryResponse
+ | import('~/queries/schema').MetricsQueryResponse
+ | import('~/queries/schema').SessionsQueryResponse
+ | import('~/queries/schema').TraceSpansAggregationQueryResponse
+ | import('~/queries/schema').TraceSpansAttributeBreakdownQueryResponse
+ | import('~/queries/schema').TraceSpansQueryResponse
+ ): LLMTrace | undefined => {
const traceResponse = response as TraceQueryResponse | null
return traceResponse?.results?.[0]
},
],
showableEvents: [
(s) => [s.trace],
- (trace): LLMTraceEvent[] =>
+ (trace: LLMTrace | undefined): LLMTraceEvent[] =>
trace ? trace.events.filter((event) => !FEEDBACK_EVENTS.has(event.event)) : [],
],
filteredEvents: [
@@ -289,7 +461,12 @@ export const aiObservabilityTraceDataLogic = kea<aiObservabilityTraceDataLogicTy
],
filteredTree: [
(s, p) => [p.traceId, s.trace, s.searchQuery, s.filteredEvents],
- (traceId, trace, searchQuery, filteredEvents): TraceTreeNode[] => {
+ (
+ traceId: string,
+ trace: LLMTrace | undefined,
+ searchQuery: string,
+ filteredEvents: LLMTraceEvent[]
+ ): TraceTreeNode[] => {
if (!searchQuery.trim()) {
return restoreTree(trace?.events || [], traceId)
}
@@ -298,7 +475,7 @@ export const aiObservabilityTraceDataLogic = kea<aiObservabilityTraceDataLogicTy
],
mostRelevantEvent: [
(s) => [s.filteredEvents, s.searchQuery],
- (filteredEvents, searchQuery): LLMTraceEvent | null => {
+ (filteredEvents: LLMTraceEvent[], searchQuery: string): LLMTraceEvent | null => {
if (!searchQuery.trim() || !filteredEvents.length) {
return null
}
@@ -354,7 +531,7 @@ export const aiObservabilityTraceDataLogic = kea<aiObservabilityTraceDataLogicTy
],
searchOccurrences: [
(s) => [s.showableEvents, s.searchQuery, s.trace],
- (showableEvents, searchQuery, trace): SearchOccurrence[] => {
+ (showableEvents: LLMTraceEvent[], searchQuery: string, trace: LLMTrace | undefined): SearchOccurrence[] => {
if (!searchQuery.trim()) {
return []
}
@@ -372,18 +549,24 @@ export const aiObservabilityTraceDataLogic = kea<aiObservabilityTraceDataLogicTy
],
metricEvents: [
(s) => [s.trace],
- (trace): LLMTraceEvent[] | undefined =>
+ (trace: LLMTrace | undefined): LLMTraceEvent[] | undefined =>
trace?.events.filter((event) => event.event === '$ai_metric' && event.properties.$ai_metric_value),
],
feedbackEvents: [
(s) => [s.trace],
- (trace): LLMTraceEvent[] | undefined =>
+ (trace: LLMTrace | undefined): LLMTraceEvent[] | undefined =>
trace?.events.filter((event) => event.event === '$ai_feedback' && event.properties.$ai_feedback_text),
],
- traceGitMetadata: [(s) => [s.trace], (trace): TraceGitMetadata | null => deriveTraceGitMetadata(trace)],
+ traceGitMetadata: [
+ (s) => [s.trace],
+ (trace: LLMTrace | undefined): TraceGitMetadata | null => deriveTraceGitMetadata(trace),
+ ],
metricsAndFeedbackEvents: [
(s) => [s.metricEvents, s.feedbackEvents],
- (metricEvents, feedbackEvents): { metric: string; value: any }[] =>
+ (
+ metricEvents: LLMTraceEvent[] | undefined,
+ feedbackEvents: LLMTraceEvent[] | undefined
+ ): { metric: string; value: any }[] =>
[...(metricEvents ?? []), ...(feedbackEvents ?? [])].map((event) => ({
metric:
event.event === '$ai_metric' ? (event.properties.$ai_metric_name ?? 'Metric') : 'User feedback',
@@ -402,7 +585,12 @@ export const aiObservabilityTraceDataLogic = kea<aiObservabilityTraceDataLogicTy
],
event: [
(s, p) => [p.traceId, s.effectiveEventId, s.trace, s.showableEvents],
- (traceId, effectiveEventId, trace, showableEvents): LLMTrace | LLMTraceEvent | null => {
+ (
+ traceId: string,
+ effectiveEventId: string | null,
+ trace: LLMTrace | undefined,
+ showableEvents: LLMTraceEvent[]
+ ): LLMTrace | LLMTraceEvent | null => {
if (!effectiveEventId || effectiveEventId === traceId) {
return trace || null
}
@@ -417,14 +605,14 @@ export const aiObservabilityTraceDataLogic = kea<aiObservabilityTraceDataLogicTy
return matchedEvent || trace || null
},
],
- tree: [(s) => [s.filteredTree], (filteredTree): TraceTreeNode[] => filteredTree],
+ tree: [(s) => [s.filteredTree], (filteredTree: TraceTreeNode[]): TraceTreeNode[] => filteredTree],
enrichedTree: [
(s) => [s.filteredTree],
(filteredTree: TraceTreeNode[]): EnrichedTraceTreeNode[] => filteredTree.map(enrichNode),
],
eventMetadata: [
(s) => [s.event],
- (event): Record<string, unknown> | undefined => {
+ (event: LLMTrace | LLMTraceEvent | null): Record<string, unknown> | undefined => {
if (event && isLLMEvent(event)) {
// Filter out all system properties as they're typically useless for datasets.
return Object.fromEntries(Object.entries(event.properties).filter(([key]) => !key.startsWith('$')))
diff --git a/products/ai_observability/frontend/aiObservabilityTraceLogic.ts b/products/ai_observability/frontend/aiObservabilityTraceLogic.ts
index 1b32b781f2b5..ea34d971a875 100644
--- a/products/ai_observability/frontend/aiObservabilityTraceLogic.ts
+++ b/products/ai_observability/frontend/aiObservabilityTraceLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { combineUrl, router, urlToAction } from 'kea-router'
import { subscriptions } from 'kea-subscriptions'
@@ -31,8 +31,8 @@ import { ActivityScope, AnyPropertyFilter, Breadcrumb, InsightLogicProps } from
import { engineeringAnalyticsResolveBranch } from 'products/engineering_analytics/frontend/generated/api'
import type { BranchPRMatchApi } from 'products/engineering_analytics/frontend/generated/api.schemas'
+import type { FeatureFlagsSet } from '../../../frontend/src/lib/logic/featureFlagLogic'
import { aiObservabilitySharedLogic } from './aiObservabilitySharedLogic'
-import type { aiObservabilityTraceLogicType } from './aiObservabilityTraceLogicType'
import { buildAiObservabilityStorageConfig } from './preferenceStorage'
export enum DisplayOption {
@@ -107,6 +107,256 @@ export function branchPRResolutionKey(gitMetadata: TraceGitMetadata | null): str
const projectId = (): string => String(ApiConfig.getCurrentProjectId())
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityTraceLogicValues {
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ propertyFilters: AnyPropertyFilter[] // aiObservabilitySharedLogic
+ shouldFilterSupportTraces: boolean // aiObservabilitySharedLogic
+ shouldFilterTestAccounts: boolean // aiObservabilitySharedLogic
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ branchPRMatches: BranchPRMatchApi[]
+ branchPRResolution: BranchPRResolution
+ branchPRResolutionLoading: boolean
+ breadcrumbs: Breadcrumb[]
+ commentCount: number
+ commentCountLoading: boolean
+ dateRange: {
+ dateFrom: string | null
+ dateTo: string | null
+ } | null
+ displayOption: DisplayOption
+ eventId: string | null
+ eventTypeExpanded: (eventType: string) => boolean
+ eventTypeExpandedMap: Record<string, boolean>
+ highlightMessageIndex: number | null
+ initialTab: string | null
+ inputMessageShowStates: boolean[]
+ isRenderingMarkdown: boolean
+ isRenderingXml: boolean
+ isTraceReviewPanelExpanded: boolean
+ lastGitMetadata: TraceGitMetadata | null
+ lineNumber: number | null
+ messageShowStates: {
+ input: boolean[]
+ output: boolean[]
+ }
+ neighbors: TraceNeighborsQueryResponse | null
+ neighborsLoading: boolean
+ newerTimestamp: string | null
+ newerTraceId: string | null
+ olderTimestamp: string | null
+ olderTraceId: string | null
+ outputMessageShowStates: boolean[]
+ query: DataTableNode
+ resolvingKey: string | null
+ searchQuery: string
+ sidePanelContext: SidePanelSceneContext
+ traceId: string
+ viewMode: TraceViewMode
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityTraceLogicActions {
+ applySearchResults: (
+ inputMatches: boolean[],
+ outputMatches: boolean[]
+ ) => {
+ inputMatches: boolean[]
+ outputMatches: boolean[]
+ }
+ copyLinePermalink: (lineNumber: number) => {
+ lineNumber: number
+ }
+ handleTextViewFallback: () => {
+ value: true
+ }
+ hideAllMessages: (type: 'input' | 'output') => {
+ type: 'input' | 'output'
+ }
+ initializeMessageStates: (
+ inputCount: number,
+ outputCount: number
+ ) => {
+ inputCount: number
+ outputCount: number
+ }
+ loadBranchPRMatches: (gitMetadata: TraceGitMetadata | null) => TraceGitMetadata | null
+ loadBranchPRMatchesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadBranchPRMatchesSuccess: (
+ branchPRResolution:
+ | {
+ gated: boolean
+ key: string | null
+ matches: never[]
+ }
+ | {
+ gated?: undefined
+ key: string | null
+ matches: BranchPRMatchApi[]
+ },
+ payload?: TraceGitMetadata | null
+ ) => {
+ branchPRResolution:
+ | {
+ gated: boolean
+ key: string | null
+ matches: never[]
+ }
+ | {
+ gated?: undefined
+ key: string | null
+ matches: BranchPRMatchApi[]
+ }
+ payload?: TraceGitMetadata | null
+ }
+ loadCommentCount: () => {
+ value: true
+ }
+ loadCommentCountFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadCommentCountSuccess: (
+ commentCount: number,
+ payload?: {
+ value: true
+ }
+ ) => {
+ commentCount: number
+ payload?: {
+ value: true
+ }
+ }
+ loadNeighbors: (
+ traceId: string,
+ timestamp: string
+ ) => {
+ timestamp: string
+ traceId: string
+ }
+ loadNeighborsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadNeighborsSuccess: (
+ neighbors: TraceNeighborsQueryResponse | null,
+ payload?: {
+ timestamp: string
+ traceId: string
+ }
+ ) => {
+ neighbors: TraceNeighborsQueryResponse | null
+ payload?: {
+ timestamp: string
+ traceId: string
+ }
+ }
+ setDateRange: (
+ dateFrom: string | null,
+ dateTo?: string | null
+ ) => {
+ dateFrom: string | null
+ dateTo: string | null | undefined
+ }
+ setDisplayOption: (displayOption: DisplayOption) => {
+ displayOption: DisplayOption
+ }
+ setEventId: (eventId: string | null) => {
+ eventId: string | null
+ }
+ setHighlightMessageIndex: (highlightMessageIndex: number | null) => {
+ highlightMessageIndex: number | null
+ }
+ setInitialTab: (tab: string | null) => {
+ tab: string | null
+ }
+ setIsRenderingMarkdown: (isRenderingMarkdown: boolean) => {
+ isRenderingMarkdown: boolean
+ }
+ setIsRenderingXml: (isRenderingXml: boolean) => {
+ isRenderingXml: boolean
+ }
+ setLineNumber: (lineNumber: number | null) => {
+ lineNumber: number | null
+ }
+ setSearchQuery: (searchQuery: string) => {
+ searchQuery: string
+ }
+ setTraceId: (traceId: string) => {
+ traceId: string
+ }
+ setTraceReviewPanelExpanded: (isExpanded: boolean) => {
+ isExpanded: boolean
+ }
+ setViewMode: (viewMode: TraceViewMode) => {
+ viewMode: TraceViewMode
+ }
+ showAllMessages: (type: 'input' | 'output') => {
+ type: 'input' | 'output'
+ }
+ toggleEventTypeExpanded: (eventType: string) => {
+ eventType: string
+ }
+ toggleMarkdownRendering: () => {
+ value: true
+ }
+ toggleMessage: (
+ type: 'input' | 'output',
+ index: number
+ ) => {
+ index: number
+ type: 'input' | 'output'
+ }
+ toggleXmlRendering: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityTraceLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ branchPRMatches: (branchPRResolution: BranchPRResolution, resolvingKey: string | null) => BranchPRMatchApi[]
+ inputMessageShowStates: (messageShowStates: { input: boolean[]; output: boolean[] }) => boolean[]
+ outputMessageShowStates: (messageShowStates: { input: boolean[]; output: boolean[] }) => boolean[]
+ query: (
+ traceId: string,
+ dateRange: {
+ dateFrom: string | null
+ dateTo: string | null
+ } | null
+ ) => DataTableNode
+ breadcrumbs: (traceId: string, searchParams: Record<string, any>) => Breadcrumb[]
+ eventTypeExpanded: (eventTypeExpandedMap: Record<string, boolean>) => (eventType: string) => boolean
+ newerTraceId: (neighbors: TraceNeighborsQueryResponse | null) => string | null
+ newerTimestamp: (neighbors: TraceNeighborsQueryResponse | null) => string | null
+ olderTraceId: (neighbors: TraceNeighborsQueryResponse | null) => string | null
+ olderTimestamp: (neighbors: TraceNeighborsQueryResponse | null) => string | null
+ sidePanelContext: (traceId: string) => SidePanelSceneContext
+ }
+}
+
+export type aiObservabilityTraceLogicType = MakeLogicType<
+ aiObservabilityTraceLogicValues,
+ aiObservabilityTraceLogicActions,
+ AIObservabilityTraceLogicProps,
+ aiObservabilityTraceLogicMeta
+>
+
export const aiObservabilityTraceLogic = kea<aiObservabilityTraceLogicType>([
path(['scenes', 'ai-observability', 'aiObservabilityTraceLogic']),
props({} as AIObservabilityTraceLogicProps),
@@ -407,14 +657,26 @@ export const aiObservabilityTraceLogic = kea<aiObservabilityTraceLogicType>([
// another repo's) PR.
branchPRMatches: [
(s) => [s.branchPRResolution, s.resolvingKey],
- (resolution, resolvingKey): BranchPRMatchApi[] =>
+ (resolution: BranchPRResolution, resolvingKey: string | null): BranchPRMatchApi[] =>
resolution.key === resolvingKey ? resolution.matches : [],
],
- inputMessageShowStates: [(s) => [s.messageShowStates], (messageStates) => messageStates.input],
- outputMessageShowStates: [(s) => [s.messageShowStates], (messageStates) => messageStates.output],
+ inputMessageShowStates: [
+ (s) => [s.messageShowStates],
+ (messageStates: { input: boolean[]; output: boolean[] }) => messageStates.input,
+ ],
+ outputMessageShowStates: [
+ (s) => [s.messageShowStates],
+ (messageStates: { input: boolean[]; output: boolean[] }) => messageStates.output,
+ ],
query: [
(s) => [s.traceId, s.dateRange],
- (traceId, dateRange): DataTableNode => {
+ (
+ traceId: string,
+ dateRange: {
+ dateFrom: string | null
+ dateTo: string | null
+ } | null
+ ): DataTableNode => {
const traceQuery: TraceQuery = {
kind: NodeKind.TraceQuery,
traceId,
@@ -464,18 +726,30 @@ export const aiObservabilityTraceLogic = kea<aiObservabilityTraceLogicType>([
],
eventTypeExpanded: [
(s) => [s.eventTypeExpandedMap],
- (eventTypeExpandedMap) =>
+ (eventTypeExpandedMap: Record<string, boolean>) =>
(eventType: string): boolean => {
return eventTypeExpandedMap[eventType] ?? true
},
],
- newerTraceId: [(s) => [s.neighbors], (neighbors) => neighbors?.newerTraceId ?? null],
- newerTimestamp: [(s) => [s.neighbors], (neighbors) => neighbors?.newerTimestamp ?? null],
- olderTraceId: [(s) => [s.neighbors], (neighbors) => neighbors?.olderTraceId ?? null],
- olderTimestamp: [(s) => [s.neighbors], (neighbors) => neighbors?.olderTimestamp ?? null],
+ newerTraceId: [
+ (s) => [s.neighbors],
+ (neighbors: TraceNeighborsQueryResponse | null) => neighbors?.newerTraceId ?? null,
+ ],
+ newerTimestamp: [
+ (s) => [s.neighbors],
+ (neighbors: TraceNeighborsQueryResponse | null) => neighbors?.newerTimestamp ?? null,
+ ],
+ olderTraceId: [
+ (s) => [s.neighbors],
+ (neighbors: TraceNeighborsQueryResponse | null) => neighbors?.olderTraceId ?? null,
+ ],
+ olderTimestamp: [
+ (s) => [s.neighbors],
+ (neighbors: TraceNeighborsQueryResponse | null) => neighbors?.olderTimestamp ?? null,
+ ],
[SIDE_PANEL_CONTEXT_KEY]: [
(s) => [s.traceId],
- (traceId): SidePanelSceneContext => {
+ (traceId: string): SidePanelSceneContext => {
// Discussions are always at the trace level, accessible from anywhere in the trace
return {
activity_scope: ActivityScope.LLM_TRACE,
diff --git a/products/ai_observability/frontend/clusters/clusterDetailLogic.ts b/products/ai_observability/frontend/clusters/clusterDetailLogic.ts
index 6e2fb1da7000..b607ef228d8f 100644
--- a/products/ai_observability/frontend/clusters/clusterDetailLogic.ts
+++ b/products/ai_observability/frontend/clusters/clusterDetailLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { urlToAction } from 'kea-router'
import posthog from 'posthog-js'
@@ -13,8 +13,9 @@ import { EventsQuery, NodeKind, ProductIntentContext, ProductKey } from '~/queri
import { hogql } from '~/queries/utils'
import { AnyPropertyFilter, Breadcrumb, PropertyFilterType, PropertyOperator } from '~/types'
+import type { ProductIntentProperties } from '../../../../frontend/src/lib/utils/product-intents'
import { aiObservabilitySharedLogic } from '../aiObservabilitySharedLogic'
-import type { clusterDetailLogicType } from './clusterDetailLogicType'
+import type { ApplyUrlStatePayload } from '../aiObservabilitySharedLogic'
import { loadClusterMetrics } from './clusterMetricsLoader'
import {
FILTER_QUERY_MAX_ROWS,
@@ -66,6 +67,150 @@ export interface ScatterDataset {
pointStyle?: 'circle' | 'crossRot'
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clusterDetailLogicValues {
+ propertyFilters: AnyPropertyFilter[] // aiObservabilitySharedLogic
+ shouldFilterTestAccounts: boolean // aiObservabilitySharedLogic
+ breadcrumbs: Breadcrumb[]
+ cluster: Cluster | null
+ clusterData: ClusterData | null
+ clusterDataLoading: boolean
+ clusterMetrics: ClusterMetrics | null
+ clusterMetricsLoading: boolean
+ clusteringLevel: ClusteringLevel
+ currentPage: number
+ filteredItemIds: Set<string> | null
+ filteredItemIdsLoading: boolean
+ hasActiveFilters: boolean
+ isOutlierCluster: boolean
+ paginatedTraceIds: string[]
+ paginatedTracesWithSummaries: TraceWithSummary[]
+ runTimestamp: string
+ scatterPlotDatasets: ScatterDataset[]
+ sortedTraceIds: string[]
+ totalPages: number
+ totalTraces: number
+ traceSummaries: Record<string, TraceSummary>
+ traceSummariesLoading: boolean
+ unfilteredTotalTraces: number
+ windowEnd: string
+ windowStart: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clusterDetailLogicActions {
+ applyUrlState: (state: ApplyUrlStatePayload) => ApplyUrlStatePayload // aiObservabilitySharedLogic
+ setPropertyFilters: (propertyFilters: AnyPropertyFilter[]) => {
+ propertyFilters: AnyPropertyFilter[]
+ } // aiObservabilitySharedLogic
+ setShouldFilterTestAccounts: (shouldFilterTestAccounts: boolean) => {
+ shouldFilterTestAccounts: boolean
+ } // aiObservabilitySharedLogic
+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic
+ loadClusterData: () => any
+ loadClusterDataFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadClusterDataSuccess: (
+ clusterData: {
+ cluster: Cluster
+ clusteringLevel: ClusteringLevel
+ runTimestamp: string
+ windowEnd: string
+ windowStart: string
+ } | null,
+ payload?: any
+ ) => {
+ clusterData: {
+ cluster: Cluster
+ clusteringLevel: ClusteringLevel
+ runTimestamp: string
+ windowEnd: string
+ windowStart: string
+ } | null
+ payload?: any
+ }
+ loadClusterMetricsForCluster: () => {
+ value: true
+ }
+ loadFilteredItemIds: () => {
+ value: true
+ }
+ loadFilteredItemIdsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadFilteredItemIdsSuccess: (
+ filteredItemIds: Set<string> | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ filteredItemIds: Set<string> | null
+ payload?: {
+ value: true
+ }
+ }
+ loadMoreTraces: () => {
+ value: true
+ }
+ setClusterMetrics: (metrics: ClusterMetrics | null) => {
+ metrics: ClusterMetrics | null
+ }
+ setClusterMetricsLoading: (loading: boolean) => {
+ loading: boolean
+ }
+ setPage: (page: number) => {
+ page: number
+ }
+ setTraceSummaries: (summaries: Record<string, TraceSummary>) => {
+ summaries: Record<string, TraceSummary>
+ }
+ setTraceSummariesLoading: (loading: boolean) => {
+ loading: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clusterDetailLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ cluster: (clusterData: ClusterData | null) => Cluster | null
+ runTimestamp: (clusterData: ClusterData | null) => string
+ windowStart: (clusterData: ClusterData | null) => string
+ windowEnd: (clusterData: ClusterData | null) => string
+ clusteringLevel: (clusterData: ClusterData | null) => ClusteringLevel
+ isOutlierCluster: (cluster: Cluster | null) => boolean
+ scatterPlotDatasets: (cluster: Cluster | null, isOutlierCluster: boolean) => ScatterDataset[]
+ sortedTraceIds: (cluster: Cluster | null, filteredItemIds: Set<string> | null) => string[]
+ totalTraces: (sortedTraceIds: string[]) => number
+ unfilteredTotalTraces: (cluster: Cluster | null) => number
+ hasActiveFilters: (propertyFilters: AnyPropertyFilter[], shouldFilterTestAccounts: boolean) => boolean
+ totalPages: (totalTraces: number) => number
+ paginatedTraceIds: (sortedTraceIds: string[], currentPage: number) => string[]
+ paginatedTracesWithSummaries: (
+ paginatedTraceIds: string[],
+ cluster: Cluster | null,
+ traceSummaries: Record<string, TraceSummary>
+ ) => TraceWithSummary[]
+ breadcrumbs: (cluster: Cluster | null, runId: string) => Breadcrumb[]
+ }
+}
+
+export type clusterDetailLogicType = MakeLogicType<
+ clusterDetailLogicValues,
+ clusterDetailLogicActions,
+ ClusterDetailLogicProps,
+ clusterDetailLogicMeta
+>
+
export const clusterDetailLogic = kea<clusterDetailLogicType>([
path(['products', 'ai_observability', 'frontend', 'clusters', 'clusterDetailLogic']),
props({} as ClusterDetailLogicProps),
diff --git a/products/ai_observability/frontend/clusters/clusteringConfigLogic.ts b/products/ai_observability/frontend/clusters/clusteringConfigLogic.ts
index 5e3370476aab..50f2b17da4d5 100644
--- a/products/ai_observability/frontend/clusters/clusteringConfigLogic.ts
+++ b/products/ai_observability/frontend/clusters/clusteringConfigLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -7,8 +7,6 @@ import { teamLogic } from 'scenes/teamLogic'
import type { AnyPropertyFilter } from '~/types'
-import type { clusteringConfigLogicType } from './clusteringConfigLogicType'
-
/** A filter is valid if it has a key set (not just an empty placeholder row). */
export function isValidFilter(f: AnyPropertyFilter): boolean {
return 'key' in f && f.key !== undefined && f.key !== ''
@@ -20,6 +18,60 @@ export interface ClusteringConfig {
updated_at: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clusteringConfigLogicValues {
+ currentTeamIdStrict: number | string // teamLogic
+ config: ClusteringConfig
+ configLoading: boolean
+ isSettingsPanelOpen: boolean
+ localEventFilters: AnyPropertyFilter[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clusteringConfigLogicActions {
+ closeSettingsPanel: () => {
+ value: true
+ }
+ loadConfig: () => any
+ loadConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadConfigSuccess: (
+ config: ClusteringConfig,
+ payload?: any
+ ) => {
+ config: ClusteringConfig
+ payload?: any
+ }
+ openSettingsPanel: () => {
+ value: true
+ }
+ saveEventFilters: () => any
+ saveEventFiltersFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ saveEventFiltersSuccess: (
+ config: ClusteringConfig,
+ payload?: any
+ ) => {
+ config: ClusteringConfig
+ payload?: any
+ }
+ setLocalEventFilters: (filters: AnyPropertyFilter[]) => {
+ filters: AnyPropertyFilter[]
+ }
+}
+
+export type clusteringConfigLogicType = MakeLogicType<clusteringConfigLogicValues, clusteringConfigLogicActions>
+
export const clusteringConfigLogic = kea<clusteringConfigLogicType>([
path(['products', 'ai_observability', 'frontend', 'clusters', 'clusteringConfigLogic']),
connect(() => ({ values: [teamLogic, ['currentTeamIdStrict']] })),
diff --git a/products/ai_observability/frontend/clusters/clusteringJobsLogic.ts b/products/ai_observability/frontend/clusters/clusteringJobsLogic.ts
index 22c198e9c175..ec25f4bad330 100644
--- a/products/ai_observability/frontend/clusters/clusteringJobsLogic.ts
+++ b/products/ai_observability/frontend/clusters/clusteringJobsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -6,9 +6,90 @@ import api from 'lib/api'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { teamLogic } from 'scenes/teamLogic'
-import type { clusteringJobsLogicType } from './clusteringJobsLogicType'
import type { ClusteringJob } from './types'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clusteringJobsLogicValues {
+ currentTeamIdStrict: number | string // teamLogic
+ editingJob: Partial<ClusteringJob> | null
+ isJobsPanelOpen: boolean
+ jobs: ClusteringJob[]
+ jobsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clusteringJobsLogicActions {
+ closeJobsPanel: () => {
+ value: true
+ }
+ createJob: (payload: Partial<ClusteringJob>) => Partial<ClusteringJob>
+ createJobFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ createJobSuccess: (
+ jobs: ClusteringJob[],
+ payload?: Partial<ClusteringJob>
+ ) => {
+ jobs: ClusteringJob[]
+ payload?: Partial<ClusteringJob>
+ }
+ deleteJob: (jobId: number) => {
+ jobId: number
+ }
+ loadJobs: () => any
+ loadJobsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadJobsSuccess: (
+ jobs: ClusteringJob[],
+ payload?: any
+ ) => {
+ jobs: ClusteringJob[]
+ payload?: any
+ }
+ openJobsPanel: () => {
+ value: true
+ }
+ setEditingJob: (job: Partial<ClusteringJob> | null) => {
+ job: Partial<ClusteringJob> | null
+ }
+ updateJob: (
+ payload: Partial<ClusteringJob> & {
+ id: number
+ }
+ ) => Partial<ClusteringJob> & {
+ id: number
+ }
+ updateJobFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateJobSuccess: (
+ jobs: ClusteringJob[],
+ payload?: Partial<ClusteringJob> & {
+ id: number
+ }
+ ) => {
+ jobs: ClusteringJob[]
+ payload?: Partial<ClusteringJob> & {
+ id: number
+ }
+ }
+}
+
+export type clusteringJobsLogicType = MakeLogicType<clusteringJobsLogicValues, clusteringJobsLogicActions>
+
export const clusteringJobsLogic = kea<clusteringJobsLogicType>([
path(['products', 'ai_observability', 'frontend', 'clusters', 'clusteringJobsLogic']),
connect(() => ({ values: [teamLogic, ['currentTeamIdStrict']] })),
diff --git a/products/ai_observability/frontend/clusters/clustersAdminLogic.ts b/products/ai_observability/frontend/clusters/clustersAdminLogic.ts
index b8505046fca9..91f7ba2ab356 100644
--- a/products/ai_observability/frontend/clusters/clustersAdminLogic.ts
+++ b/products/ai_observability/frontend/clusters/clustersAdminLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -9,7 +9,7 @@ import { teamLogic } from 'scenes/teamLogic'
import type { AnyPropertyFilter } from '~/types'
import { clusteringConfigLogic } from './clusteringConfigLogic'
-import type { clustersAdminLogicType } from './clustersAdminLogicType'
+import type { ClusteringConfig } from './clusteringConfigLogic'
export interface ClusteringRunParams {
analysis_level: 'trace' | 'generation' | 'evaluation'
@@ -55,6 +55,63 @@ export const DEFAULT_CLUSTERING_PARAMS: ClusteringRunParams = {
event_filters: [],
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clustersAdminLogicValues {
+ config: ClusteringConfig // clusteringConfigLogic
+ configLoading: boolean // clusteringConfigLogic
+ currentTeamIdStrict: number | string // teamLogic
+ clusteringRun: ClusteringRunResponse | null
+ clusteringRunLoading: boolean
+ isModalOpen: boolean
+ isRunning: boolean
+ params: ClusteringRunParams
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clustersAdminLogicActions {
+ closeModal: () => {
+ value: true
+ }
+ openModal: () => {
+ value: true
+ }
+ resetParams: () => {
+ value: true
+ }
+ setParams: (params: Partial<ClusteringRunParams>) => {
+ params: Partial<ClusteringRunParams>
+ }
+ triggerClusteringRun: () => any
+ triggerClusteringRunFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ triggerClusteringRunSuccess: (
+ clusteringRun: ClusteringRunResponse,
+ payload?: any
+ ) => {
+ clusteringRun: ClusteringRunResponse
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clustersAdminLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ isRunning: (clusteringRunLoading: boolean) => boolean
+ }
+}
+
+export type clustersAdminLogicType = MakeLogicType<
+ clustersAdminLogicValues,
+ clustersAdminLogicActions,
+ Record<string, any>,
+ clustersAdminLogicMeta
+>
+
export const clustersAdminLogic = kea<clustersAdminLogicType>([
path(['products', 'ai_observability', 'frontend', 'clusters', 'clustersAdminLogic']),
@@ -104,7 +161,7 @@ export const clustersAdminLogic = kea<clustersAdminLogicType>([
})),
selectors({
- isRunning: [(s) => [s.clusteringRunLoading], (loading): boolean => loading],
+ isRunning: [(s) => [s.clusteringRunLoading], (loading: boolean): boolean => loading],
}),
listeners(({ actions, values }) => ({
diff --git a/products/ai_observability/frontend/clusters/clustersLogic.ts b/products/ai_observability/frontend/clusters/clustersLogic.ts
index 6bc75f39c13a..2e6a4773401e 100644
--- a/products/ai_observability/frontend/clusters/clustersLogic.ts
+++ b/products/ai_observability/frontend/clusters/clustersLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router, urlToAction } from 'kea-router'
import posthog from 'posthog-js'
@@ -15,8 +15,8 @@ import { hogql } from '~/queries/utils'
import { AnyPropertyFilter, Breadcrumb, PropertyFilterType, PropertyOperator } from '~/types'
import { aiObservabilitySharedLogic } from '../aiObservabilitySharedLogic'
+import type { ApplyUrlStatePayload } from '../aiObservabilitySharedLogic'
import { loadClusterMetrics } from './clusterMetricsLoader'
-import type { clustersLogicType } from './clustersLogicType'
import {
FILTER_QUERY_MAX_ROWS,
AI_OBSERVABILITY_CLUSTERS_SCENE_TAG,
@@ -88,6 +88,217 @@ export interface ScatterDataset {
export type ClustersLogicProps = Record<string, never>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clustersLogicValues {
+ propertyFilters: AnyPropertyFilter[] // aiObservabilitySharedLogic
+ shouldFilterTestAccounts: boolean // aiObservabilitySharedLogic
+ anyFiltersActive: boolean
+ availableEvaluatorNames: {
+ count: number
+ name: string
+ }[]
+ availableVerdictCounts: Record<EvaluationVerdict, number>
+ breadcrumbs: Breadcrumb[]
+ clusterMembershipPredicate: (id: string) => boolean
+ clusterMetrics: Record<number, ClusterMetrics>
+ clusterMetricsLoading: boolean
+ clusteringLevel: ClusteringLevel
+ clusteringRuns: ClusteringRunOption[]
+ clusteringRunsLoading: boolean
+ currentRun: ClusteringRun | null
+ currentRunLoading: boolean
+ currentRunMatchesLevel: boolean
+ effectiveRunId: string | null
+ evalFilterEvaluatorNames: string[]
+ evalFilterPredicate: (evalId: string) => boolean
+ evalFilterVerdicts: EvaluationVerdict[]
+ evalFiltersActive: boolean
+ evaluationItemAttributes: Record<string, EvaluationItemAttributes>
+ expandedClusterIds: Set<number>
+ filteredItemCount: number
+ filteredSortedClusters: Cluster[]
+ isClusterExpanded: (clusterId: number) => boolean
+ isScatterPlotExpanded: boolean
+ propertyFilteredItemIds: Set<string> | null
+ propertyFilteredItemIdsLoading: boolean
+ propertyFiltersActive: boolean
+ scatterPlotDatasets: ScatterDataset[]
+ selectedRunId: string | null
+ sortedClusters: Cluster[]
+ totalItemCount: number
+ traceSummaries: Record<string, TraceSummary>
+ traceSummariesLoading: boolean
+ traceToClusterTitle: Record<string, string>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clustersLogicActions {
+ applyUrlState: (state: ApplyUrlStatePayload) => ApplyUrlStatePayload // aiObservabilitySharedLogic
+ setPropertyFilters: (propertyFilters: AnyPropertyFilter[]) => {
+ propertyFilters: AnyPropertyFilter[]
+ } // aiObservabilitySharedLogic
+ setShouldFilterTestAccounts: (shouldFilterTestAccounts: boolean) => {
+ shouldFilterTestAccounts: boolean
+ } // aiObservabilitySharedLogic
+ clearEvalFilters: () => {
+ value: true
+ }
+ loadClusterMetricsForRun: (run: ClusteringRun) => {
+ run: ClusteringRun
+ }
+ loadClusteringRun: (runId: string) => string
+ loadClusteringRunFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadClusteringRunSuccess: (
+ currentRun: ClusteringRun | null,
+ payload?: string
+ ) => {
+ currentRun: ClusteringRun | null
+ payload?: string
+ }
+ loadClusteringRuns: () => any
+ loadClusteringRunsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadClusteringRunsSuccess: (
+ clusteringRuns: {
+ label: string
+ runId: string
+ windowEnd: string
+ }[],
+ payload?: any
+ ) => {
+ clusteringRuns: {
+ label: string
+ runId: string
+ windowEnd: string
+ }[]
+ payload?: any
+ }
+ loadEvaluationAttributesForRun: (run: ClusteringRun) => {
+ run: ClusteringRun
+ }
+ loadPropertyFilteredItemIds: () => {
+ value: true
+ }
+ loadPropertyFilteredItemIdsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadPropertyFilteredItemIdsSuccess: (
+ propertyFilteredItemIds: Set<string> | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ propertyFilteredItemIds: Set<string> | null
+ payload?: {
+ value: true
+ }
+ }
+ loadTraceSummariesForRun: (run: ClusteringRun) => {
+ run: ClusteringRun
+ }
+ setClusterMetrics: (metrics: Record<number, ClusterMetrics>) => {
+ metrics: Record<number, ClusterMetrics>
+ }
+ setClusterMetricsLoading: (loading: boolean) => {
+ loading: boolean
+ }
+ setClusteringLevel: (level: ClusteringLevel) => {
+ level: ClusteringLevel
+ }
+ setEvalEvaluatorNamesFilter: (names: string[]) => {
+ names: string[]
+ }
+ setEvalVerdictsFilter: (verdicts: EvaluationVerdict[]) => {
+ verdicts: EvaluationVerdict[]
+ }
+ setEvaluationItemAttributes: (attributes: Record<string, EvaluationItemAttributes>) => {
+ attributes: Record<string, EvaluationItemAttributes>
+ }
+ setSelectedRunId: (runId: string | null) => {
+ runId: string | null
+ }
+ setTraceSummaries: (summaries: Record<string, TraceSummary>) => {
+ summaries: Record<string, TraceSummary>
+ }
+ setTraceSummariesLoading: (loading: boolean) => {
+ loading: boolean
+ }
+ syncClusteringLevelFromRun: (level: ClusteringLevel) => {
+ level: ClusteringLevel
+ }
+ toggleClusterExpanded: (clusterId: number) => {
+ clusterId: number
+ }
+ toggleScatterPlotExpanded: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clustersLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ effectiveRunId: (selectedRunId: string | null, clusteringRuns: ClusteringRunOption[]) => string | null
+ currentRunMatchesLevel: (currentRun: ClusteringRun | null, clusteringLevel: ClusteringLevel) => boolean
+ sortedClusters: (currentRun: ClusteringRun | null, currentRunMatchesLevel: boolean) => Cluster[]
+ evalFiltersActive: (
+ clusteringLevel: ClusteringLevel,
+ evalFilterEvaluatorNames: string[],
+ evalFilterVerdicts: EvaluationVerdict[]
+ ) => boolean
+ availableEvaluatorNames: (evaluationItemAttributes: Record<string, EvaluationItemAttributes>) => {
+ count: number
+ name: string
+ }[]
+ availableVerdictCounts: (
+ evaluationItemAttributes: Record<string, EvaluationItemAttributes>
+ ) => Record<EvaluationVerdict, number>
+ evalFilterPredicate: (
+ clusteringLevel: ClusteringLevel,
+ evaluationItemAttributes: Record<string, EvaluationItemAttributes>,
+ evalFilterEvaluatorNames: string[],
+ evalFilterVerdicts: EvaluationVerdict[]
+ ) => (evalId: string) => boolean
+ propertyFiltersActive: (propertyFilters: AnyPropertyFilter[], shouldFilterTestAccounts: boolean) => boolean
+ anyFiltersActive: (evalFiltersActive: boolean, propertyFiltersActive: boolean) => boolean
+ clusterMembershipPredicate: (
+ evalFilterPredicate: (evalId: string) => boolean,
+ propertyFilteredItemIds: Set<string> | null
+ ) => (id: string) => boolean
+ filteredSortedClusters: (
+ sortedClusters: Cluster[],
+ clusterMembershipPredicate: (id: string) => boolean,
+ anyFiltersActive: boolean
+ ) => Cluster[]
+ filteredItemCount: (filteredSortedClusters: Cluster[]) => number
+ totalItemCount: (sortedClusters: Cluster[]) => number
+ isClusterExpanded: (expandedClusterIds: Set<number>) => (clusterId: number) => boolean
+ traceToClusterTitle: (sortedClusters: Cluster[]) => Record<string, string>
+ scatterPlotDatasets: (filteredSortedClusters: Cluster[]) => ScatterDataset[]
+ }
+}
+
+export type clustersLogicType = MakeLogicType<
+ clustersLogicValues,
+ clustersLogicActions,
+ ClustersLogicProps,
+ clustersLogicMeta
+>
+
export const clustersLogic = kea<clustersLogicType>([
path(['products', 'ai_observability', 'frontend', 'clusters', 'clustersLogic']),
props({} as ClustersLogicProps),
diff --git a/products/ai_observability/frontend/components/EvalsTabContent.tsx b/products/ai_observability/frontend/components/EvalsTabContent.tsx
index 62921cc45fac..29abe0ba0d0a 100644
--- a/products/ai_observability/frontend/components/EvalsTabContent.tsx
+++ b/products/ai_observability/frontend/components/EvalsTabContent.tsx
@@ -12,7 +12,7 @@ import { LLMTraceEvent } from '~/queries/schema/schema-general'
import { aiObservabilityTraceLogic } from '../aiObservabilityTraceLogic'
import { llmEvaluationsLogic } from '../evaluations/llmEvaluationsLogic'
import { generationEvaluationRunsLogic } from '../generationEvaluationRunsLogic'
-import { generationEvaluationRunsLogicType } from '../generationEvaluationRunsLogicType'
+import type { generationEvaluationRunsLogicType } from '../generationEvaluationRunsLogic'
import { llmEvaluationExecutionLogic } from '../llmEvaluationExecutionLogic'
import { formatLLMEventTitle } from '../utils'
import { GenerationEvalRunsTable } from './GenerationEvalRunsTable'
diff --git a/products/ai_observability/frontend/components/GenerationEvalRunsTable.tsx b/products/ai_observability/frontend/components/GenerationEvalRunsTable.tsx
index 0b724f42bb76..904e1d7c4481 100644
--- a/products/ai_observability/frontend/components/GenerationEvalRunsTable.tsx
+++ b/products/ai_observability/frontend/components/GenerationEvalRunsTable.tsx
@@ -7,7 +7,7 @@ import { LemonTableColumns } from 'lib/lemon-ui/LemonTable'
import { urls } from 'scenes/urls'
import { EvaluationRun } from '../evaluations/types'
-import { generationEvaluationRunsLogicType } from '../generationEvaluationRunsLogicType'
+import type { generationEvaluationRunsLogicType } from '../generationEvaluationRunsLogic'
import { EvaluationResultTag, getEvaluationResultSortValue } from './EvaluationResultTag'
import { EvaluationRunTargetCell } from './EvaluationRunTargetCell'
diff --git a/products/ai_observability/frontend/components/TraceTimeline/traceTimelineLogic.ts b/products/ai_observability/frontend/components/TraceTimeline/traceTimelineLogic.ts
index 8fff51e8358a..3173877ac423 100644
--- a/products/ai_observability/frontend/components/TraceTimeline/traceTimelineLogic.ts
+++ b/products/ai_observability/frontend/components/TraceTimeline/traceTimelineLogic.ts
@@ -1,7 +1,20 @@
-import { actions, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers } from 'kea'
import { buildAiObservabilityStorageConfig } from '../../preferenceStorage'
-import type { traceTimelineLogicType } from './traceTimelineLogicType'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface traceTimelineLogicValues {
+ collapsed: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface traceTimelineLogicActions {
+ setCollapsed: (collapsed: boolean) => {
+ collapsed: boolean
+ }
+}
+
+export type traceTimelineLogicType = MakeLogicType<traceTimelineLogicValues, traceTimelineLogicActions>
export const traceTimelineLogic = kea<traceTimelineLogicType>([
path(['products', 'ai_observability', 'frontend', 'components', 'TraceTimeline', 'traceTimelineLogic']),
diff --git a/products/ai_observability/frontend/components/clustersTabContentLogic.ts b/products/ai_observability/frontend/components/clustersTabContentLogic.ts
index 6cbd0efc6ba7..4d0317d67e3c 100644
--- a/products/ai_observability/frontend/components/clustersTabContentLogic.ts
+++ b/products/ai_observability/frontend/components/clustersTabContentLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, key, listeners, path, props } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, key, listeners, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -8,7 +8,6 @@ import { hogql } from '~/queries/utils'
import { CLUSTERING_RUNS_LOOKBACK_DAYS, NOISE_CLUSTER_ID } from '../clusters/constants'
import { Cluster } from '../clusters/types'
-import type { clustersTabContentLogicType } from './clustersTabContentLogicType'
export interface ClusterInfo {
runId: string
@@ -23,6 +22,46 @@ export interface ClustersTabContentLogicProps {
traceId: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clustersTabContentLogicValues {
+ clusters: ClusterInfo[]
+ clustersLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clustersTabContentLogicActions {
+ loadClusters: () => any
+ loadClustersFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadClustersSuccess: (
+ clusters: ClusterInfo[],
+ payload?: any
+ ) => {
+ clusters: ClusterInfo[]
+ payload?: any
+ }
+ refreshClusters: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface clustersTabContentLogicMeta {
+ key: string
+}
+
+export type clustersTabContentLogicType = MakeLogicType<
+ clustersTabContentLogicValues,
+ clustersTabContentLogicActions,
+ ClustersTabContentLogicProps,
+ clustersTabContentLogicMeta
+>
+
export const clustersTabContentLogic = kea<clustersTabContentLogicType>([
path(['products', 'ai_observability', 'frontend', 'components', 'clustersTabContentLogic']),
props({} as ClustersTabContentLogicProps),
diff --git a/products/ai_observability/frontend/datasets/aiObservabilityDatasetLogic.ts b/products/ai_observability/frontend/datasets/aiObservabilityDatasetLogic.ts
index cffbffba384e..7d46d834c5da 100644
--- a/products/ai_observability/frontend/datasets/aiObservabilityDatasetLogic.ts
+++ b/products/ai_observability/frontend/datasets/aiObservabilityDatasetLogic.ts
@@ -1,5 +1,19 @@
-import { actions, afterMount, connect, defaults, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ afterMount,
+ connect,
+ defaults,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ reducers,
+ selectors,
+} from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import { combineUrl, router, urlToAction } from 'kea-router'
@@ -15,8 +29,8 @@ import { teamLogic } from '~/scenes/teamLogic'
import { urls } from '~/scenes/urls'
import { Breadcrumb, Dataset, DatasetItem } from '~/types'
+import type { ProductIntentProperties } from '../../../../frontend/src/lib/utils/product-intents'
import { truncateValue } from '../utils'
-import type { aiObservabilityDatasetLogicType } from './aiObservabilityDatasetLogicType'
import { aiObservabilityDatasetsLogic } from './aiObservabilityDatasetsLogic'
import { EMPTY_JSON, coerceJsonToObject, isStringJsonObject, prettifyJson } from './utils'
@@ -53,6 +67,167 @@ function cleanFilters(values: Partial<DatasetItemsFilters>): DatasetItemsFilters
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityDatasetLogicValues {
+ activeTab: DatasetTab
+ breadcrumbs: Breadcrumb[]
+ dataset: Dataset | DatasetFormValues | null
+ datasetForm: DatasetFormValues
+ datasetFormAllErrors: Record<string, any>
+ datasetFormChanged: boolean
+ datasetFormErrors: DeepPartialMap<DatasetFormValues, ValidationErrorType>
+ datasetFormHasErrors: boolean
+ datasetFormManualErrors: Record<string, any>
+ datasetFormTouched: boolean
+ datasetFormTouches: Record<string, boolean>
+ datasetFormValidationErrors: DeepPartialMap<DatasetFormValues, ValidationErrorType>
+ datasetItems: CountedPaginatedResponse<DatasetItem>
+ datasetItemsCount: number
+ datasetItemsLoading: boolean
+ datasetLoading: boolean
+ filters: DatasetItemsFilters
+ isDatasetFormSubmitting: boolean
+ isDatasetFormValid: boolean
+ isDatasetItemModalOpen: boolean
+ isDatasetMissing: boolean
+ isDeletingDataset: boolean
+ isEditingDataset: boolean
+ isNewDataset: boolean
+ pagination: PaginationManual
+ rawFilters: Partial<DatasetItemsFilters> | null
+ selectedDatasetItem: DatasetItem | null
+ shouldDisplaySkeleton: boolean
+ showDatasetFormErrors: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityDatasetLogicActions {
+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic
+ closeModalAndRefetchDatasetItems: (refetchDatasetItems?: boolean) => {
+ refetchDatasetItems: boolean | undefined
+ }
+ deleteDataset: () => {
+ value: true
+ }
+ deleteDatasetItem: (itemId: string) => {
+ itemId: string
+ }
+ editDataset: (editing: boolean) => {
+ editing: boolean
+ }
+ loadDataset: () => any
+ loadDatasetFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDatasetItems: (debounce?: boolean) => boolean
+ loadDatasetItemsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDatasetItemsSuccess: (
+ datasetItems: CountedPaginatedResponse<DatasetItem>,
+ payload?: boolean
+ ) => {
+ datasetItems: CountedPaginatedResponse<DatasetItem>
+ payload?: boolean
+ }
+ loadDatasetSuccess: (
+ dataset: Dataset,
+ payload?: any
+ ) => {
+ dataset: Dataset
+ payload?: any
+ }
+ onUnmount: () => {
+ value: true
+ }
+ resetDatasetForm: (values?: DatasetFormValues) => {
+ values?: DatasetFormValues
+ }
+ setActiveTab: (tab: DatasetTab) => {
+ tab: DatasetTab
+ }
+ setDataset: (dataset: Dataset | DatasetFormValues) => {
+ dataset: Dataset | DatasetFormValues
+ }
+ setDatasetFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setDatasetFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setDatasetFormValues: (values: DeepPartial<DatasetFormValues>) => {
+ values: DeepPartial<DatasetFormValues>
+ }
+ setDeletingDataset: (deleting: boolean) => {
+ deleting: boolean
+ }
+ setFilters: (
+ filters: Partial<DatasetItemsFilters>,
+ debounce?: boolean
+ ) => {
+ debounce: boolean
+ filters: Partial<DatasetItemsFilters>
+ }
+ setSelectedDatasetItem: (datasetItem: DatasetItem) => {
+ datasetItem: DatasetItem
+ }
+ submitDatasetForm: () => {
+ value: boolean
+ }
+ submitDatasetFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitDatasetFormRequest: (datasetForm: DatasetFormValues) => {
+ datasetForm: DatasetFormValues
+ }
+ submitDatasetFormSuccess: (datasetForm: DatasetFormValues) => {
+ datasetForm: DatasetFormValues
+ }
+ touchDatasetFormField: (key: string) => {
+ key: string
+ }
+ triggerDatasetItemModal: (open: boolean) => {
+ open: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityDatasetLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isNewDataset: (arg: any) => boolean
+ isDatasetMissing: (dataset: Dataset | DatasetFormValues | null, datasetLoading: boolean) => boolean
+ shouldDisplaySkeleton: (dataset: Dataset | DatasetFormValues | null, datasetLoading: boolean) => boolean
+ filters: (rawFilters: Partial<DatasetItemsFilters> | null) => DatasetItemsFilters
+ datasetItemsCount: (datasetItems: CountedPaginatedResponse<DatasetItem>) => number
+ pagination: (filters: DatasetItemsFilters, datasetItemsCount: number) => PaginationManual
+ breadcrumbs: (dataset: Dataset | DatasetFormValues | null, searchParams: Record<string, any>) => Breadcrumb[]
+ }
+}
+
+export type aiObservabilityDatasetLogicType = MakeLogicType<
+ aiObservabilityDatasetLogicValues,
+ aiObservabilityDatasetLogicActions,
+ DatasetLogicProps,
+ aiObservabilityDatasetLogicMeta
+>
+
export const aiObservabilityDatasetLogic = kea<aiObservabilityDatasetLogicType>([
path(['scenes', 'ai-observability', 'aiObservabilityDatasetLogic']),
@@ -234,12 +409,13 @@ export const aiObservabilityDatasetLogic = kea<aiObservabilityDatasetLogicType>(
isDatasetMissing: [
(s) => [s.dataset, s.datasetLoading],
- (dataset, datasetLoading) => !datasetLoading && dataset === null,
+ (dataset: Dataset | DatasetFormValues | null, datasetLoading: boolean) =>
+ !datasetLoading && dataset === null,
],
shouldDisplaySkeleton: [
(s) => [s.dataset, s.datasetLoading],
- (dataset, datasetLoading) => !dataset && datasetLoading,
+ (dataset: Dataset | DatasetFormValues | null, datasetLoading: boolean) => !dataset && datasetLoading,
],
filters: [
diff --git a/products/ai_observability/frontend/datasets/aiObservabilityDatasetsLogic.ts b/products/ai_observability/frontend/datasets/aiObservabilityDatasetsLogic.ts
index ceba42aea581..c3a43d0d8910 100644
--- a/products/ai_observability/frontend/datasets/aiObservabilityDatasetsLogic.ts
+++ b/products/ai_observability/frontend/datasets/aiObservabilityDatasetsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router, urlToAction } from 'kea-router'
@@ -15,7 +15,6 @@ import { urls } from '~/scenes/urls'
import { Dataset } from '~/types'
import { cleanPagedSearchOrderParams } from '../utils'
-import type { aiObservabilityDatasetsLogicType } from './aiObservabilityDatasetsLogicType'
export const DATASETS_PER_PAGE = 30
@@ -35,6 +34,73 @@ function cleanFilters(values: Partial<DatasetFilters>): DatasetFilters {
export type AIObservabilityDatasetsLogicProps = Record<string, never>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityDatasetsLogicValues {
+ count: number
+ datasetCountLabel: string
+ datasets: CountedPaginatedResponse<Dataset>
+ datasetsLoading: boolean
+ filters: DatasetFilters
+ pagination: PaginationManual
+ rawFilters: Partial<DatasetFilters> | null
+ sorting: Sorting | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityDatasetsLogicActions {
+ deleteDataset: (datasetId: string) => {
+ datasetId: string
+ }
+ loadDatasets: (debounce?: boolean) => {
+ debounce: boolean
+ }
+ loadDatasetsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDatasetsSuccess: (
+ datasets: CountedPaginatedResponse<Dataset>,
+ payload?: {
+ debounce: boolean
+ }
+ ) => {
+ datasets: CountedPaginatedResponse<Dataset>
+ payload?: {
+ debounce: boolean
+ }
+ }
+ setFilters: (
+ filters: Partial<DatasetFilters>,
+ merge?: boolean,
+ debounce?: boolean
+ ) => {
+ debounce: boolean
+ filters: Partial<DatasetFilters>
+ merge: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityDatasetsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ filters: (rawFilters: Partial<DatasetFilters> | null) => DatasetFilters
+ count: (datasets: CountedPaginatedResponse<Dataset>) => number
+ sorting: (filters: DatasetFilters) => Sorting | null
+ pagination: (filters: DatasetFilters, count: number) => PaginationManual
+ datasetCountLabel: (filters: DatasetFilters, count: number) => string
+ }
+}
+
+export type aiObservabilityDatasetsLogicType = MakeLogicType<
+ aiObservabilityDatasetsLogicValues,
+ aiObservabilityDatasetsLogicActions,
+ AIObservabilityDatasetsLogicProps,
+ aiObservabilityDatasetsLogicMeta
+>
+
export const aiObservabilityDatasetsLogic = kea<aiObservabilityDatasetsLogicType>([
path(['scenes', 'ai-observability', 'aiObservabilityDatasetsLogic']),
props({} as AIObservabilityDatasetsLogicProps),
@@ -139,7 +205,7 @@ export const aiObservabilityDatasetsLogic = kea<aiObservabilityDatasetsLogicType
datasetCountLabel: [
(s) => [s.filters, s.count],
- (filters, count) => {
+ (filters: DatasetFilters, count: number) => {
const start = (filters.page - 1) * DATASETS_PER_PAGE + 1
const end = Math.min(filters.page * DATASETS_PER_PAGE, count)
diff --git a/products/ai_observability/frontend/datasets/datasetItemModalLogic.ts b/products/ai_observability/frontend/datasets/datasetItemModalLogic.ts
index cdd08e22ee03..47bf9dc8dfd0 100644
--- a/products/ai_observability/frontend/datasets/datasetItemModalLogic.ts
+++ b/products/ai_observability/frontend/datasets/datasetItemModalLogic.ts
@@ -1,12 +1,12 @@
-import { actions, defaults, kea, key, path, props, propsChanged, reducers } from 'kea'
+import { MakeLogicType, actions, defaults, kea, key, path, props, propsChanged, reducers } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { lemonToast } from '@posthog/lemon-ui'
import api from '~/lib/api'
import { DatasetItem } from '~/types'
-import type { datasetItemModalLogicType } from './datasetItemModalLogicType'
import { EMPTY_JSON, coerceJsonToObject, isStringJsonObject, prettifyJson } from './utils'
export type TraceMetadata = Required<Pick<DatasetItem, 'ref_trace_id' | 'ref_source_id' | 'ref_timestamp'>>
@@ -41,6 +41,81 @@ const FORM_DEFAULT_VALUE: DatasetItemFormValues = {
metadata: EMPTY_JSON,
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface datasetItemModalLogicValues {
+ datasetItemForm: DatasetItemFormValues
+ datasetItemFormAllErrors: Record<string, any>
+ datasetItemFormChanged: boolean
+ datasetItemFormErrors: DeepPartialMap<DatasetItemFormValues, ValidationErrorType>
+ datasetItemFormHasErrors: boolean
+ datasetItemFormManualErrors: Record<string, any>
+ datasetItemFormTouched: boolean
+ datasetItemFormTouches: Record<string, boolean>
+ datasetItemFormValidationErrors: DeepPartialMap<DatasetItemFormValues, ValidationErrorType>
+ isDatasetItemFormSubmitting: boolean
+ isDatasetItemFormValid: boolean
+ refetchDatasetItems: boolean
+ shouldCloseModal: boolean
+ showDatasetItemFormErrors: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface datasetItemModalLogicActions {
+ resetDatasetItemForm: (values?: DatasetItemFormValues) => {
+ values?: DatasetItemFormValues
+ }
+ setDatasetItemFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setDatasetItemFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setDatasetItemFormValues: (values: DeepPartial<DatasetItemFormValues>) => {
+ values: DeepPartial<DatasetItemFormValues>
+ }
+ setRefetchDatasetItems: (refetchDatasetItems: boolean) => {
+ refetchDatasetItems: boolean
+ }
+ setShouldCloseModal: (shouldCloseModal: boolean) => {
+ shouldCloseModal: boolean
+ }
+ submitDatasetItemForm: () => {
+ value: boolean
+ }
+ submitDatasetItemFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitDatasetItemFormRequest: (datasetItemForm: DatasetItemFormValues) => {
+ datasetItemForm: DatasetItemFormValues
+ }
+ submitDatasetItemFormSuccess: (datasetItemForm: DatasetItemFormValues) => {
+ datasetItemForm: DatasetItemFormValues
+ }
+ touchDatasetItemFormField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface datasetItemModalLogicMeta {
+ key: string
+}
+
+export type datasetItemModalLogicType = MakeLogicType<
+ datasetItemModalLogicValues,
+ datasetItemModalLogicActions,
+ DatasetItemModalLogicProps,
+ datasetItemModalLogicMeta
+>
+
export const datasetItemModalLogic = kea<datasetItemModalLogicType>([
path(['scenes', 'ai-observability', 'datasetItemModalLogic']),
diff --git a/products/ai_observability/frontend/datasets/saveToDatasetButtonLogic.ts b/products/ai_observability/frontend/datasets/saveToDatasetButtonLogic.ts
index ef51e439659b..d8658cf99158 100644
--- a/products/ai_observability/frontend/datasets/saveToDatasetButtonLogic.ts
+++ b/products/ai_observability/frontend/datasets/saveToDatasetButtonLogic.ts
@@ -1,5 +1,17 @@
-import { actions, afterMount, beforeUnmount, kea, listeners, path, props, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ afterMount,
+ beforeUnmount,
+ kea,
+ listeners,
+ path,
+ props,
+ reducers,
+ selectors,
+} from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import { encodeParams, router } from 'kea-router'
@@ -9,8 +21,6 @@ import { urls } from 'scenes/urls'
import api from '~/lib/api'
import { Dataset, DatasetItem } from '~/types'
-import type { saveToDatasetButtonLogicType } from './saveToDatasetButtonLogicType'
-
export interface saveToDatasetButtonLogicProps {
partialDatasetItem: Partial<DatasetItem> | null
}
@@ -23,6 +33,145 @@ export interface SearchFormValues {
datasetId: string | null
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface saveToDatasetButtonLogicValues {
+ datasetStore: Record<string, Dataset[]>
+ datasetStoreLoading: boolean
+ datasets: Dataset[] | null
+ dropdownVisible: boolean
+ editMode: 'create' | 'edit'
+ isLoadingDatasets: boolean
+ isModalMounted: boolean
+ isModalOpen: boolean
+ isSearchFormSubmitting: boolean
+ isSearchFormValid: boolean
+ recentDatasetIds: string[]
+ recentDatasets: Dataset[]
+ recentDatasetsLoading: boolean
+ searchForm: SearchFormValues
+ searchFormAllErrors: Record<string, any>
+ searchFormChanged: boolean
+ searchFormErrors: DeepPartialMap<SearchFormValues, ValidationErrorType>
+ searchFormHasErrors: boolean
+ searchFormManualErrors: Record<string, any>
+ searchFormTouched: boolean
+ searchFormTouches: Record<string, boolean>
+ searchFormValidationErrors: DeepPartialMap<SearchFormValues, ValidationErrorType>
+ selectedDataset: Dataset | null
+ showSearchFormErrors: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface saveToDatasetButtonLogicActions {
+ loadDatasets: (debounce?: boolean) => boolean
+ loadDatasetsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDatasetsSuccess: (
+ datasetStore: {
+ [x: string]: Dataset[]
+ },
+ payload?: boolean
+ ) => {
+ datasetStore: {
+ [x: string]: Dataset[]
+ }
+ payload?: boolean
+ }
+ loadRecentDatasets: (debounce?: boolean) => boolean
+ loadRecentDatasetsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRecentDatasetsSuccess: (
+ recentDatasets: Dataset[],
+ payload?: boolean
+ ) => {
+ recentDatasets: Dataset[]
+ payload?: boolean
+ }
+ resetSearchForm: (values?: SearchFormValues) => {
+ values?: SearchFormValues
+ }
+ setDropdownVisible: (dropdownVisible: boolean) => {
+ dropdownVisible: boolean
+ }
+ setEditMode: (editMode: 'create' | 'edit') => {
+ editMode: 'create' | 'edit'
+ }
+ setIsModalOpen: (isModalOpen: boolean) => {
+ isModalOpen: boolean
+ }
+ setRecentDatasetIds: (recentDatasetIds: string[]) => {
+ recentDatasetIds: string[]
+ }
+ setRecentDatasets: (recentDatasets: Dataset[]) => {
+ recentDatasets: Dataset[]
+ }
+ setSearchFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setSearchFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setSearchFormValues: (values: DeepPartial<SearchFormValues>) => {
+ values: DeepPartial<SearchFormValues>
+ }
+ setSelectedDataset: (dataset: Dataset | null) => {
+ dataset: Dataset | null
+ }
+ submitSearchForm: () => {
+ value: boolean
+ }
+ submitSearchFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitSearchFormRequest: (searchForm: SearchFormValues) => {
+ searchForm: SearchFormValues
+ }
+ submitSearchFormSuccess: (searchForm: SearchFormValues) => {
+ searchForm: SearchFormValues
+ }
+ touchSearchFormField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface saveToDatasetButtonLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ datasets: (datasetStore: Record<string, Dataset[]>, searchForm: SearchFormValues) => Dataset[] | null
+ isLoadingDatasets: (
+ datasets: Dataset[] | null,
+ datasetStoreLoading: boolean,
+ recentDatasetsLoading: boolean
+ ) => boolean
+ isModalMounted: (editMode: 'create' | 'edit') => boolean
+ }
+}
+
+export type saveToDatasetButtonLogicType = MakeLogicType<
+ saveToDatasetButtonLogicValues,
+ saveToDatasetButtonLogicActions,
+ saveToDatasetButtonLogicProps,
+ saveToDatasetButtonLogicMeta
+>
+
export const saveToDatasetButtonLogic = kea<saveToDatasetButtonLogicType>([
path(['scenes', 'ai-observability', 'saveToDatasetButtonLogic']),
@@ -208,7 +357,7 @@ export const saveToDatasetButtonLogic = kea<saveToDatasetButtonLogicType>([
selectors({
datasets: [
(s) => [s.datasetStore, s.searchForm],
- (datasetStore, searchForm): Dataset[] | null => {
+ (datasetStore: Record<string, Dataset[]>, searchForm: SearchFormValues): Dataset[] | null => {
const storageKey = getStorageKey(searchForm.search)
return datasetStore[storageKey] ?? null
},
@@ -216,14 +365,14 @@ export const saveToDatasetButtonLogic = kea<saveToDatasetButtonLogicType>([
isLoadingDatasets: [
(s) => [s.datasets, s.datasetStoreLoading, s.recentDatasetsLoading],
- (datasets, datasetStoreLoading, recentDatasetsLoading): boolean => {
+ (datasets: Dataset[] | null, datasetStoreLoading: boolean, recentDatasetsLoading: boolean): boolean => {
return !datasets && (datasetStoreLoading || recentDatasetsLoading)
},
],
isModalMounted: [
(s) => [s.editMode],
- (editMode): boolean => {
+ (editMode: 'create' | 'edit'): boolean => {
return editMode === 'edit'
},
],
diff --git a/products/ai_observability/frontend/evaluations/evaluationMetricsLogic.ts b/products/ai_observability/frontend/evaluations/evaluationMetricsLogic.ts
index 1b4b62140df1..bb3f2193f7de 100644
--- a/products/ai_observability/frontend/evaluations/evaluationMetricsLogic.ts
+++ b/products/ai_observability/frontend/evaluations/evaluationMetricsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, props, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, props, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -9,7 +9,6 @@ import { ChartDisplayType, HogQLMathType } from '~/types'
// eslint-disable-next-line import/no-cycle
import { PASS_RATE_SUCCESS_THRESHOLD } from './components/EvaluationMetrics'
-import type { evaluationMetricsLogicType } from './evaluationMetricsLogicType'
import { llmEvaluationsLogic } from './llmEvaluationsLogic'
import { EvaluationConfig } from './types'
@@ -59,6 +58,96 @@ function getIntervalFromDateRange(dateFrom: string | null): 'hour' | 'day' {
return duration.asDays() <= 1 ? 'hour' : 'day'
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface evaluationMetricsLogicValues {
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ } // llmEvaluationsLogic
+ evaluations: EvaluationConfig[] // llmEvaluationsLogic
+ chartQuery: TrendsQuery | null
+ evaluationsWithMetrics: Array<
+ EvaluationConfig & {
+ stats?: EvaluationStats
+ }
+ >
+ stats: EvaluationStats[]
+ statsLoading: boolean
+ summaryMetrics: SummaryMetrics
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface evaluationMetricsLogicActions {
+ setDates: (
+ dateFrom: string | null,
+ dateTo: string | null
+ ) => {
+ dateFrom: string | null
+ dateTo: string | null
+ } // llmEvaluationsLogic
+ loadStats: () => any
+ loadStatsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadStatsSuccess: (
+ stats: {
+ applicability_rate: number
+ applicable_count: number
+ evaluation_id: string
+ pass_count: number
+ pass_rate: number
+ runs_count: number
+ }[],
+ payload?: any
+ ) => {
+ stats: {
+ applicability_rate: number
+ applicable_count: number
+ evaluation_id: string
+ pass_count: number
+ pass_rate: number
+ runs_count: number
+ }[]
+ payload?: any
+ }
+ refreshMetrics: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface evaluationMetricsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ summaryMetrics: (stats: EvaluationStats[]) => SummaryMetrics
+ evaluationsWithMetrics: (
+ evaluations: EvaluationConfig[],
+ stats: EvaluationStats[]
+ ) => Array<
+ EvaluationConfig & {
+ stats?: EvaluationStats
+ }
+ >
+ chartQuery: (
+ evaluations: EvaluationConfig[],
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+ ) => TrendsQuery | null
+ }
+}
+
+export type evaluationMetricsLogicType = MakeLogicType<
+ evaluationMetricsLogicValues,
+ evaluationMetricsLogicActions,
+ EvaluationMetricsLogicProps,
+ evaluationMetricsLogicMeta
+>
+
export const evaluationMetricsLogic = kea<evaluationMetricsLogicType>([
path(['products', 'ai_observability', 'frontend', 'evaluations', 'evaluationMetricsLogic']),
props({} as EvaluationMetricsLogicProps),
diff --git a/products/ai_observability/frontend/evaluations/evaluationReportLogic.ts b/products/ai_observability/frontend/evaluations/evaluationReportLogic.ts
index 3ba32e790750..fd83fb402da2 100644
--- a/products/ai_observability/frontend/evaluations/evaluationReportLogic.ts
+++ b/products/ai_observability/frontend/evaluations/evaluationReportLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { lemonToast } from 'lib/lemon-ui/LemonToast'
@@ -11,7 +11,7 @@ import {
llmAnalyticsEvaluationReportsPartialUpdate,
llmAnalyticsEvaluationReportsRunsList,
} from '../generated/api'
-import type { evaluationReportLogicType } from './evaluationReportLogicType'
+import type { EvaluationReportRunApi } from '../generated/api.schemas'
import type {
EvaluationReport,
EvaluationReportDeliveryTarget,
@@ -274,6 +274,209 @@ export async function persistReportDraft(
return true
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface evaluationReportLogicValues {
+ currentTeamId: number | null // teamLogic
+ activeReport: EvaluationReport | null
+ configDraft: ReportConfigDraft
+ configError: string | null
+ configErrors: ReportConfigErrors
+ generateResult: null
+ generateResultLoading: boolean
+ isConfigDirty: boolean
+ isNewEvaluation: boolean
+ reportRuns: EvaluationReportRun[]
+ reportRunsLoading: boolean
+ reports: EvaluationReport[]
+ reportsLoading: boolean
+ selectedReportRun: EvaluationReportRun | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface evaluationReportLogicActions {
+ createReport: (params: {
+ cooldown_minutes?: number | null
+ delivery_targets: EvaluationReportDeliveryTarget[]
+ enabled: boolean
+ evaluationId: string
+ frequency: EvaluationReportFrequency
+ report_prompt_guidance?: string
+ rrule?: string
+ trigger_threshold?: number | null
+ }) => {
+ evaluationId: string
+ enabled: boolean
+ frequency: EvaluationReportFrequency
+ rrule?: string
+ delivery_targets: EvaluationReportDeliveryTarget[]
+ report_prompt_guidance?: string
+ trigger_threshold?: number | null
+ cooldown_minutes?: number | null
+ }
+ createReportFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ createReportSuccess: (
+ reports: EvaluationReport[],
+ payload?: {
+ evaluationId: string
+ enabled: boolean
+ frequency: EvaluationReportFrequency
+ rrule?: string
+ delivery_targets: EvaluationReportDeliveryTarget[]
+ report_prompt_guidance?: string
+ trigger_threshold?: number | null
+ cooldown_minutes?: number | null
+ }
+ ) => {
+ reports: EvaluationReport[]
+ payload?: {
+ evaluationId: string
+ enabled: boolean
+ frequency: EvaluationReportFrequency
+ rrule?: string
+ delivery_targets: EvaluationReportDeliveryTarget[]
+ report_prompt_guidance?: string
+ trigger_threshold?: number | null
+ cooldown_minutes?: number | null
+ }
+ }
+ generateReport: (reportId: string) => string
+ generateReportFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ generateReportSuccess: (
+ generateResult: null,
+ payload?: string
+ ) => {
+ generateResult: null
+ payload?: string
+ }
+ loadReportRuns: (reportId: string) => string
+ loadReportRunsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadReportRunsSuccess: (
+ reportRuns: EvaluationReportRunApi[],
+ payload?: string
+ ) => {
+ reportRuns: EvaluationReportRunApi[]
+ payload?: string
+ }
+ loadReports: () => any
+ loadReportsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadReportsSuccess: (
+ reports: EvaluationReport[],
+ payload?: any
+ ) => {
+ reports: EvaluationReport[]
+ payload?: any
+ }
+ resetDraft: () => {
+ value: true
+ }
+ saveDraft: () => {
+ value: true
+ }
+ seedDraftFromReport: (report: EvaluationReport) => {
+ report: EvaluationReport
+ }
+ selectReportRun: (reportRun: EvaluationReportRun | null) => {
+ reportRun: EvaluationReportRunApi | null
+ }
+ setDraftCooldownHours: (cooldownHours: number) => {
+ cooldownHours: number
+ }
+ setDraftEmailValue: (emailValue: string) => {
+ emailValue: string
+ }
+ setDraftEnabled: (enabled: boolean) => {
+ enabled: boolean
+ }
+ setDraftFrequency: (frequency: EvaluationReportFrequency) => {
+ frequency: EvaluationReportFrequency
+ }
+ setDraftReportPromptGuidance: (reportPromptGuidance: string) => {
+ reportPromptGuidance: string
+ }
+ setDraftScheduleCadence: (cadence: ReportScheduleCadence) => {
+ cadence: ReportScheduleCadence
+ }
+ setDraftSlackChannelValue: (channelValue: string) => {
+ channelValue: string
+ }
+ setDraftSlackIntegrationId: (integrationId: number | null) => {
+ integrationId: number | null
+ }
+ setDraftTriggerThreshold: (triggerThreshold: number) => {
+ triggerThreshold: number
+ }
+ toggleDraftScheduleWeekday: (weekday: ReportScheduleWeekday) => {
+ weekday: ReportScheduleWeekday
+ }
+ updateReport: ({ reportId, data }: { data: Partial<EvaluationReport>; reportId: string }) => {
+ reportId: string
+ data: Partial<EvaluationReport>
+ }
+ updateReportFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateReportSuccess: (
+ reports: EvaluationReport[],
+ payload?: {
+ reportId: string
+ data: Partial<EvaluationReport>
+ }
+ ) => {
+ reports: EvaluationReport[]
+ payload?: {
+ reportId: string
+ data: Partial<EvaluationReport>
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface evaluationReportLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isNewEvaluation: (evaluationId: string) => boolean
+ configErrors: (configDraft: ReportConfigDraft) => ReportConfigErrors
+ configError: (configDraft: ReportConfigDraft) => string | null
+ activeReport: (reports: EvaluationReport[]) => EvaluationReport | null
+ isConfigDirty: (activeReport: EvaluationReport | null, configDraft: ReportConfigDraft) => boolean
+ }
+}
+
+export type evaluationReportLogicType = MakeLogicType<
+ evaluationReportLogicValues,
+ evaluationReportLogicActions,
+ EvaluationReportLogicProps,
+ evaluationReportLogicMeta
+>
+
export const evaluationReportLogic = kea<evaluationReportLogicType>([
path(['products', 'ai_observability', 'frontend', 'evaluations', 'evaluationReportLogic']),
props({} as EvaluationReportLogicProps),
@@ -454,13 +657,13 @@ export const evaluationReportLogic = kea<evaluationReportLogicType>([
],
activeReport: [
(s) => [s.reports],
- (reports): EvaluationReport | null => {
+ (reports: EvaluationReport[]): EvaluationReport | null => {
return reports.find((r: EvaluationReport) => !r.deleted) || null
},
],
isConfigDirty: [
(s) => [s.activeReport, s.configDraft],
- (activeReport, draft): boolean => {
+ (activeReport: EvaluationReport | null, draft: ReportConfigDraft): boolean => {
if (!activeReport) {
// No report yet: draft is "dirty" if it has any savable content.
return (
diff --git a/products/ai_observability/frontend/evaluations/llmEvaluationLogic.ts b/products/ai_observability/frontend/evaluations/llmEvaluationLogic.ts
index 0dccad62f67a..9b4f098c8cbf 100644
--- a/products/ai_observability/frontend/evaluations/llmEvaluationLogic.ts
+++ b/products/ai_observability/frontend/evaluations/llmEvaluationLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { combineUrl, router, urlToAction } from 'kea-router'
import posthog from 'posthog-js'
@@ -19,6 +19,7 @@ import {
} from '../generated/api'
import { parseTrialProviderKeyId } from '../ModelPicker'
import { LLMProviderKey, llmProviderKeysLogic } from '../settings/llmProviderKeysLogic'
+import type { EvaluationTrialConfig } from '../settings/llmProviderKeysLogic'
import { getUnhealthyProviderKey } from '../settings/providerKeyStateUtils'
import { EvaluationRunsStats, queryEvaluationRuns, queryEvaluationRunsStats } from '../utils'
import { evaluationErrorMessage } from './apiErrors'
@@ -31,7 +32,6 @@ import {
isLLMJudgeEvaluation,
} from './evaluationCapabilities'
import { evaluationReportLogic, persistReportDraft } from './evaluationReportLogic'
-import type { llmEvaluationLogicType } from './llmEvaluationLogicType'
import { EvaluationTemplateKey, defaultEvaluationTemplates } from './templates'
import type {
EvaluationConditionSet,
@@ -132,6 +132,264 @@ export interface LLMEvaluationLogicProps {
evaluationType?: EvaluationType
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmEvaluationLogicValues {
+ isTrialGrandfathered: boolean // llmProviderKeysLogic
+ providerKeys: LLMProviderKey[] // llmProviderKeysLogic
+ providerKeysLoading: boolean // llmProviderKeysLogic
+ requiresProviderKey: boolean // llmProviderKeysLogic
+ activeTab: string
+ breadcrumbs: Breadcrumb[]
+ canEnable: boolean
+ canEnableReason: string | null
+ evaluation: EvaluationConfig | null
+ evaluationFormSubmitting: boolean
+ evaluationLoading: boolean
+ evaluationProviderKeyIssue: LLMProviderKey | null
+ evaluationRuns: EvaluationRun[]
+ evaluationRunsLoading: boolean
+ evaluationSummary: EvaluationSummary | null
+ evaluationSummaryError: boolean
+ evaluationSummaryFilter: EvaluationSummaryFilter
+ evaluationSummaryLoading: boolean
+ filteredEvaluationRuns: EvaluationRun[]
+ formValid: boolean
+ hasUnsavedChanges: boolean
+ hogTestResults: HogTestResult[] | null
+ hogTestResultsLoading: boolean
+ isForceRefresh: boolean
+ isNewEvaluation: boolean
+ maxContext: MaxContextInput[]
+ modelSelectionRequired: boolean
+ originalEvaluation: EvaluationConfig | null
+ runsLookup: Record<string, EvaluationRun>
+ runsStats: EvaluationRunsStats | null
+ runsStatsLoading: boolean
+ runsSummary: {
+ applicabilityRate: number
+ errors: number
+ failed: number
+ successful: number
+ successRate: number
+ total: number
+ } | null
+ runsToSummarizeCount: number
+ selectedModel: string
+ selectedPickerProviderKeyId: string | null
+ summaryExpanded: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmEvaluationLogicActions {
+ loadEvaluationConfigSuccess: (
+ evaluationConfig: EvaluationTrialConfig | null,
+ payload?: any
+ ) => {
+ evaluationConfig: EvaluationTrialConfig | null
+ payload?: any
+ } // llmProviderKeysLogic
+ loadProviderKeys: () => any // llmProviderKeysLogic
+ clearHogTestResults: () => {
+ value: true
+ }
+ generateEvaluationSummary: ({ forceRefresh }: { forceRefresh?: boolean }) => {
+ forceRefresh?: boolean
+ }
+ generateEvaluationSummaryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ generateEvaluationSummarySuccess: (
+ evaluationSummary: EvaluationSummary | null,
+ payload?: {
+ forceRefresh?: boolean
+ }
+ ) => {
+ evaluationSummary: EvaluationSummary | null
+ payload?: {
+ forceRefresh?: boolean
+ }
+ }
+ loadEvaluation: () => {
+ value: true
+ }
+ loadEvaluationRuns: () => any
+ loadEvaluationRunsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadEvaluationRunsSuccess: (
+ evaluationRuns: EvaluationRun[],
+ payload?: any
+ ) => {
+ evaluationRuns: EvaluationRun[]
+ payload?: any
+ }
+ loadEvaluationSuccess: (evaluation: EvaluationConfig | null) => {
+ evaluation: EvaluationConfig | null
+ }
+ loadRunsStats: () => any
+ loadRunsStatsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRunsStatsSuccess: (
+ runsStats: EvaluationRunsStats | null,
+ payload?: any
+ ) => {
+ runsStats: EvaluationRunsStats | null
+ payload?: any
+ }
+ refreshEvaluationRuns: () => {
+ value: true
+ }
+ regenerateEvaluationSummary: () => {
+ value: true
+ }
+ resetEvaluation: () => {
+ value: true
+ }
+ saveEvaluation: () => {
+ value: true
+ }
+ saveEvaluationFailure: (error: string) => {
+ error: string
+ }
+ saveEvaluationSuccess: (evaluation: EvaluationConfig) => {
+ evaluation: EvaluationConfig
+ }
+ selectModelFromPicker: (
+ modelId: string,
+ providerKeyId: string
+ ) => {
+ modelId: string
+ providerKeyId: string
+ }
+ setActiveTab: (tab: string) => {
+ tab: string
+ }
+ setAllowsNA: (allowsNA: boolean) => {
+ allowsNA: boolean
+ }
+ setEvaluationDescription: (description: string) => {
+ description: string
+ }
+ setEvaluationEnabled: (enabled: boolean) => {
+ enabled: boolean
+ }
+ setEvaluationName: (name: string) => {
+ name: string
+ }
+ setEvaluationPrompt: (prompt: string) => {
+ prompt: string
+ }
+ setEvaluationSummaryFilter: (
+ filter: EvaluationSummaryFilter,
+ previousFilter: EvaluationSummaryFilter
+ ) => {
+ filter: EvaluationSummaryFilter
+ previousFilter: EvaluationSummaryFilter
+ }
+ setEvaluationTarget: (target: EvaluationTarget) => {
+ target: EvaluationTarget
+ }
+ setEvaluationType: (evaluationType: EvaluationType) => {
+ evaluationType: EvaluationType
+ }
+ setHogSource: (source: string) => {
+ source: string
+ }
+ setModelConfiguration: (modelConfiguration: ModelConfiguration | null) => {
+ modelConfiguration: ModelConfiguration | null
+ }
+ setTraceWindowSeconds: (windowSeconds: number) => {
+ windowSeconds: number
+ }
+ setTriggerConditions: (conditions: EvaluationConditionSet[]) => {
+ conditions: EvaluationConditionSet[]
+ }
+ testHogOnSample: () => any
+ testHogOnSampleFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ testHogOnSampleSuccess: (
+ hogTestResults: HogTestResult[] | null,
+ payload?: any
+ ) => {
+ hogTestResults: HogTestResult[] | null
+ payload?: any
+ }
+ toggleSummaryExpanded: () => {
+ value: true
+ }
+ trackSummarizeClicked: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmEvaluationLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isNewEvaluation: (evaluationId: string) => boolean
+ modelSelectionRequired: (
+ evaluation: EvaluationConfig | null,
+ originalEvaluation: EvaluationConfig | null,
+ evaluationId: string
+ ) => boolean
+ formValid: (evaluation: EvaluationConfig | null, modelSelectionRequired: boolean) => boolean
+ canEnable: (
+ evaluation: EvaluationConfig | null,
+ requiresProviderKey: boolean,
+ isTrialGrandfathered: boolean
+ ) => boolean
+ canEnableReason: (canEnable: boolean) => string | null
+ evaluationProviderKeyIssue: (
+ evaluation: EvaluationConfig | null,
+ providerKeys: LLMProviderKey[]
+ ) => LLMProviderKey | null
+ runsLookup: (evaluationRuns: EvaluationRun[]) => Record<string, EvaluationRun>
+ runsSummary: (runsStats: EvaluationRunsStats | null) => {
+ applicabilityRate: number
+ errors: number
+ failed: number
+ successful: number
+ successRate: number
+ total: number
+ } | null
+ filteredEvaluationRuns: (
+ evaluationRuns: EvaluationRun[],
+ evaluationSummaryFilter: EvaluationSummaryFilter
+ ) => EvaluationRun[]
+ runsToSummarizeCount: (
+ filteredEvaluationRuns: EvaluationRun[],
+ evaluationSummaryFilter: EvaluationSummaryFilter
+ ) => number
+ breadcrumbs: (evaluation: EvaluationConfig | null, searchParams: Record<string, any>) => Breadcrumb[]
+ maxContext: (evaluation: EvaluationConfig | null) => MaxContextInput[]
+ }
+}
+
+export type llmEvaluationLogicType = MakeLogicType<
+ llmEvaluationLogicValues,
+ llmEvaluationLogicActions,
+ LLMEvaluationLogicProps,
+ llmEvaluationLogicMeta
+>
+
export const llmEvaluationLogic = kea<llmEvaluationLogicType>([
path(['products', 'ai_observability', 'evaluations', 'llmEvaluationLogic']),
props({} as LLMEvaluationLogicProps),
@@ -799,7 +1057,7 @@ export const llmEvaluationLogic = kea<llmEvaluationLogicType>([
formValid: [
(s) => [s.evaluation, s.modelSelectionRequired],
- (evaluation, modelSelectionRequired: boolean) => {
+ (evaluation: EvaluationConfig | null, modelSelectionRequired: boolean) => {
if (!evaluation) {
return false
}
@@ -858,7 +1116,7 @@ export const llmEvaluationLogic = kea<llmEvaluationLogicType>([
runsLookup: [
(s) => [s.evaluationRuns],
- (runs): Record<string, EvaluationRun> => {
+ (runs: EvaluationRun[]): Record<string, EvaluationRun> => {
const lookup: Record<string, EvaluationRun> = {}
for (const run of runs) {
if (run.generation_id) {
diff --git a/products/ai_observability/frontend/evaluations/llmEvaluationsLogic.ts b/products/ai_observability/frontend/evaluations/llmEvaluationsLogic.ts
index 47b25199b05e..d8948f02a494 100644
--- a/products/ai_observability/frontend/evaluations/llmEvaluationsLogic.ts
+++ b/products/ai_observability/frontend/evaluations/llmEvaluationsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { combineUrl, router, urlToAction } from 'kea-router'
import api from 'lib/api'
@@ -12,11 +12,12 @@ import { urls } from 'scenes/urls'
import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-general'
+import type { FeatureFlagsSet } from '../../../../frontend/src/lib/logic/featureFlagLogic'
+import type { ProductIntentProperties } from '../../../../frontend/src/lib/utils/product-intents'
import { LLMProviderKey, llmProviderKeysLogic } from '../settings/llmProviderKeysLogic'
import { getUnhealthyProviderKey } from '../settings/providerKeyStateUtils'
import { evaluationErrorMessage } from './apiErrors'
import { evaluationCanResolveModel } from './evaluationCapabilities'
-import type { llmEvaluationsLogicType } from './llmEvaluationsLogicType'
import { EvaluationConfig } from './types'
const INITIAL_DATE_FROM = '-24h' as string | null
@@ -36,6 +37,115 @@ function redirectToOnlineEvaluations(searchParams: Record<string, unknown>): voi
)
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmEvaluationsLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ isTrialGrandfathered: boolean // llmProviderKeysLogic
+ providerKeys: LLMProviderKey[] // llmProviderKeysLogic
+ requiresProviderKey: boolean // llmProviderKeysLogic
+ canEnableEvaluation: (evaluation: EvaluationConfig) => boolean
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+ evaluations: EvaluationConfig[]
+ evaluationsFilter: string
+ evaluationsLoading: boolean
+ filteredEvaluations: EvaluationConfig[]
+ showDisabledEvaluations: boolean
+ unhealthyProviderKeysUsedByEvaluations: LLMProviderKey[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmEvaluationsLogicActions {
+ loadProviderKeys: () => any // llmProviderKeysLogic
+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic
+ createEvaluation: (evaluation: Partial<EvaluationConfig>) => {
+ evaluation: Partial<EvaluationConfig>
+ }
+ createEvaluationSuccess: (evaluation: EvaluationConfig) => {
+ evaluation: EvaluationConfig
+ }
+ deleteEvaluation: (id: string) => {
+ id: string
+ }
+ deleteEvaluationSuccess: (id: string) => {
+ id: string
+ }
+ loadEvaluations: () => {
+ value: true
+ }
+ loadEvaluationsSuccess: (evaluations: EvaluationConfig[]) => {
+ evaluations: EvaluationConfig[]
+ }
+ setDates: (
+ dateFrom: string | null,
+ dateTo: string | null
+ ) => {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+ setEvaluationsFilter: (filter: string) => {
+ filter: string
+ }
+ setShowDisabledEvaluations: (show: boolean) => {
+ show: boolean
+ }
+ toggleEvaluationEnabled: (id: string) => {
+ id: string
+ }
+ toggleEvaluationEnabledFailure: (
+ id: string,
+ error: string
+ ) => {
+ error: string
+ id: string
+ }
+ toggleEvaluationEnabledSuccess: (id: string) => {
+ id: string
+ }
+ updateEvaluation: (
+ id: string,
+ evaluation: Partial<EvaluationConfig>
+ ) => {
+ evaluation: Partial<EvaluationConfig>
+ id: string
+ }
+ updateEvaluationSuccess: (
+ id: string,
+ evaluation: Partial<EvaluationConfig>
+ ) => {
+ evaluation: Partial<EvaluationConfig>
+ id: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmEvaluationsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ filteredEvaluations: (
+ evaluations: EvaluationConfig[],
+ evaluationsFilter: string,
+ showDisabledEvaluations: boolean
+ ) => EvaluationConfig[]
+ canEnableEvaluation: (
+ requiresProviderKey: boolean,
+ isTrialGrandfathered: boolean
+ ) => (evaluation: EvaluationConfig) => boolean
+ unhealthyProviderKeysUsedByEvaluations: (
+ evaluations: EvaluationConfig[],
+ providerKeys: LLMProviderKey[]
+ ) => LLMProviderKey[]
+ }
+}
+
+export type llmEvaluationsLogicType = MakeLogicType<
+ llmEvaluationsLogicValues,
+ llmEvaluationsLogicActions,
+ LLMEvaluationsLogicProps,
+ llmEvaluationsLogicMeta
+>
+
export const llmEvaluationsLogic = kea<llmEvaluationsLogicType>([
path(['products', 'ai_observability', 'evaluations', 'llmEvaluationsLogic']),
props({} as LLMEvaluationsLogicProps),
diff --git a/products/ai_observability/frontend/evaluations/offlineEvaluationsLogic.ts b/products/ai_observability/frontend/evaluations/offlineEvaluationsLogic.ts
index 2393ffb5de7e..790236c915bc 100644
--- a/products/ai_observability/frontend/evaluations/offlineEvaluationsLogic.ts
+++ b/products/ai_observability/frontend/evaluations/offlineEvaluationsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router, urlToAction } from 'kea-router'
@@ -12,7 +12,6 @@ import { getCurrentTeamId } from '~/lib/utils/getAppContext'
import { hogql } from '~/queries/utils'
import { llmAnalyticsOfflineEvaluationsExperimentItemsCreate as aiObservabilityOfflineEvaluationsExperimentItemsCreate } from '../generated/api'
-import type { offlineEvaluationsLogicType } from './offlineEvaluationsLogicType'
const OFFLINE_EXPERIMENTS_LIMIT = 200
const INITIAL_OFFLINE_DATE_FROM = 'dStart' as string | null
@@ -333,6 +332,113 @@ export function mapOfflineExperimentItems(rows: RawOfflineExperimentMetricRow[])
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface offlineEvaluationsLogicValues {
+ filteredOfflineExperimentItems: OfflineExperimentItem[]
+ filteredOfflineExperiments: OfflineExperiment[]
+ offlineDateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+ offlineExperimentItemsFilter: string
+ offlineExperiments: OfflineExperiment[]
+ offlineExperimentsFilter: string
+ offlineExperimentsLoading: boolean
+ offlineMetricColumns: OfflineMetricColumn[]
+ selectedExperiment: OfflineExperiment | null
+ selectedExperimentData: OfflineExperimentData
+ selectedExperimentDataLoading: boolean
+ selectedExperimentId: string | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface offlineEvaluationsLogicActions {
+ clearSelectedExperiment: () => {
+ value: true
+ }
+ loadOfflineExperiments: () => any
+ loadOfflineExperimentsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadOfflineExperimentsSuccess: (
+ offlineExperiments: OfflineExperiment[],
+ payload?: any
+ ) => {
+ offlineExperiments: OfflineExperiment[]
+ payload?: any
+ }
+ loadSelectedExperimentData: (payload?: { experimentId?: string }) => {
+ experimentId?: string
+ }
+ loadSelectedExperimentDataFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSelectedExperimentDataSuccess: (
+ selectedExperimentData: OfflineExperimentData,
+ payload?: {
+ experimentId?: string
+ }
+ ) => {
+ selectedExperimentData: OfflineExperimentData
+ payload?: {
+ experimentId?: string
+ }
+ }
+ refreshOfflineEvaluations: () => {
+ value: true
+ }
+ selectExperiment: (experimentId: string) => {
+ experimentId: string
+ }
+ setOfflineDates: (
+ dateFrom: string | null,
+ dateTo: string | null
+ ) => {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+ setOfflineExperimentItemsFilter: (filter: string) => {
+ filter: string
+ }
+ setOfflineExperimentsFilter: (filter: string) => {
+ filter: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface offlineEvaluationsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ selectedExperiment: (
+ offlineExperiments: OfflineExperiment[],
+ selectedExperimentId: string | null
+ ) => OfflineExperiment | null
+ filteredOfflineExperiments: (
+ offlineExperiments: OfflineExperiment[],
+ offlineExperimentsFilter: string
+ ) => OfflineExperiment[]
+ offlineMetricColumns: (selectedExperimentData: OfflineExperimentData) => OfflineMetricColumn[]
+ filteredOfflineExperimentItems: (
+ selectedExperimentData: OfflineExperimentData,
+ offlineExperimentItemsFilter: string
+ ) => OfflineExperimentItem[]
+ }
+}
+
+export type offlineEvaluationsLogicType = MakeLogicType<
+ offlineEvaluationsLogicValues,
+ offlineEvaluationsLogicActions,
+ OfflineEvaluationsLogicProps,
+ offlineEvaluationsLogicMeta
+>
+
export const offlineEvaluationsLogic = kea<offlineEvaluationsLogicType>([
path(['products', 'ai_observability', 'frontend', 'evaluations', 'offlineEvaluationsLogic']),
props({} as OfflineEvaluationsLogicProps),
@@ -489,7 +595,7 @@ export const offlineEvaluationsLogic = kea<offlineEvaluationsLogicType>([
offlineMetricColumns: [
(s) => [s.selectedExperimentData],
- (selectedExperimentData) => selectedExperimentData.metricColumns,
+ (selectedExperimentData: OfflineExperimentData) => selectedExperimentData.metricColumns,
],
filteredOfflineExperimentItems: [
diff --git a/products/ai_observability/frontend/feedback-view/feedbackViewLogic.ts b/products/ai_observability/frontend/feedback-view/feedbackViewLogic.ts
index 5158972fde0b..88406ef4a261 100644
--- a/products/ai_observability/frontend/feedback-view/feedbackViewLogic.ts
+++ b/products/ai_observability/frontend/feedback-view/feedbackViewLogic.ts
@@ -1,4 +1,4 @@
-import { afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
@@ -10,12 +10,85 @@ import { hogql } from '~/queries/utils'
import { Survey, SurveyEventProperties } from '~/types'
import { aiObservabilityTraceDataLogic } from '../aiObservabilityTraceDataLogic'
-import type { feedbackViewLogicType } from './feedbackViewLogicType'
export interface FeedbackViewLogicProps {
traceId: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface feedbackViewLogicValues {
+ trace: LLMTrace | undefined // aiObservabilityTraceDataLogic
+ hasLoadingError: boolean
+ surveyEvents: LLMTraceEvent[] | null
+ surveyEventsLoading: boolean
+ surveyIds: string[]
+ surveys: Record<string, Survey>
+ surveysLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface feedbackViewLogicActions {
+ loadSurveyEvents: (createdAt: string) => string
+ loadSurveyEventsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSurveyEventsSuccess: (
+ surveyEvents: {
+ createdAt: any
+ event: any
+ id: any
+ properties: any
+ }[],
+ payload?: string
+ ) => {
+ surveyEvents: {
+ createdAt: any
+ event: any
+ id: any
+ properties: any
+ }[]
+ payload?: string
+ }
+ loadSurveys: () => any
+ loadSurveysFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSurveysSuccess: (
+ surveys: {
+ [k: string]: Survey
+ },
+ payload?: any
+ ) => {
+ surveys: {
+ [k: string]: Survey
+ }
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface feedbackViewLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ surveyIds: (surveyEvents: LLMTraceEvent[] | null) => string[]
+ }
+}
+
+export type feedbackViewLogicType = MakeLogicType<
+ feedbackViewLogicValues,
+ feedbackViewLogicActions,
+ FeedbackViewLogicProps,
+ feedbackViewLogicMeta
+>
+
export const feedbackViewLogic = kea<feedbackViewLogicType>([
path(['scenes', 'ai-observability', 'feedbackViewLogic']),
props({} as FeedbackViewLogicProps),
@@ -78,7 +151,7 @@ export const feedbackViewLogic = kea<feedbackViewLogicType>([
selectors({
surveyIds: [
(s) => [s.surveyEvents],
- (surveyEvents): string[] => {
+ (surveyEvents: LLMTraceEvent[] | null): string[] => {
if (!surveyEvents) {
return []
}
diff --git a/products/ai_observability/frontend/feedback-view/wizard/feedbackSurveyWizardLogic.ts b/products/ai_observability/frontend/feedback-view/wizard/feedbackSurveyWizardLogic.ts
index 153f16e279f1..e5146dbefb97 100644
--- a/products/ai_observability/frontend/feedback-view/wizard/feedbackSurveyWizardLogic.ts
+++ b/products/ai_observability/frontend/feedback-view/wizard/feedbackSurveyWizardLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
@@ -16,7 +16,7 @@ import { urls } from 'scenes/urls'
import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-general'
import { Survey, SurveyAppearance, SurveyQuestionBranchingType, SurveyQuestionType, SurveyType } from '~/types'
-import type { feedbackSurveyWizardLogicType } from './feedbackSurveyWizardLogicType'
+import type { TeamPublicType, TeamType } from '../../../../../frontend/src/types'
export type WizardStep = 'intro' | 'configure' | 'implement'
@@ -33,6 +33,116 @@ function generateUniqueSurveyName(existingNames: Set<string>): string {
return `${BASE_SURVEY_NAME} (${counter})`
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface feedbackSurveyWizardLogicValues {
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ activeSurvey: Survey | null
+ allSurveys: Survey[]
+ allSurveysLoading: boolean
+ appearance: SurveyAppearance
+ canCreateSurvey: boolean
+ createdSurvey: Survey | null
+ createdSurveyLoading: boolean
+ defaultAppearance: SurveyAppearance
+ disabledReason: string | undefined
+ eligibleSurveys: Survey[]
+ existingSurveyNames: Set<string>
+ followUpEnabled: boolean
+ followUpQuestion: string
+ nameIsDuplicate: boolean
+ selectedSurvey: Survey | null
+ step: WizardStep
+ surveyName: string
+ surveysNeedEnabling: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface feedbackSurveyWizardLogicActions {
+ updateCurrentTeam: (payload: Partial<TeamType>) => Partial<TeamType> // teamLogic
+ createSurvey: () => any
+ createSurveyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ createSurveySuccess: (
+ createdSurvey: Survey,
+ payload?: any
+ ) => {
+ createdSurvey: Survey
+ payload?: any
+ }
+ loadAllSurveys: () => any
+ loadAllSurveysFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAllSurveysSuccess: (
+ allSurveys: Survey[],
+ payload?: any
+ ) => {
+ allSurveys: Survey[]
+ payload?: any
+ }
+ selectExistingSurvey: (survey: Survey) => {
+ survey: Survey
+ }
+ setFollowUpEnabled: (enabled: boolean) => {
+ enabled: boolean
+ }
+ setFollowUpQuestion: (question: string) => {
+ question: string
+ }
+ setStep: (step: WizardStep) => {
+ step: WizardStep
+ }
+ setSurveyName: (name: string) => {
+ name: string
+ }
+ updateAppearance: (updates: Partial<SurveyAppearance>) => {
+ updates: Partial<SurveyAppearance>
+ }
+ viewSurvey: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface feedbackSurveyWizardLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ defaultAppearance: (currentTeam: TeamPublicType | TeamType | null) => SurveyAppearance
+ existingSurveyNames: (allSurveys: Survey[]) => Set<string>
+ nameIsDuplicate: (surveyName: string, existingSurveyNames: Set<string>) => boolean
+ canCreateSurvey: (
+ surveyName: string,
+ nameIsDuplicate: boolean,
+ followUpEnabled: boolean,
+ followUpQuestion: string
+ ) => boolean
+ disabledReason: (
+ surveyName: string,
+ nameIsDuplicate: boolean,
+ followUpEnabled: boolean,
+ followUpQuestion: string
+ ) => string | undefined
+ eligibleSurveys: (allSurveys: Survey[]) => Survey[]
+ activeSurvey: (createdSurvey: Survey | null, selectedSurvey: Survey | null) => Survey | null
+ surveysNeedEnabling: (currentTeam: TeamPublicType | TeamType | null) => boolean
+ }
+}
+
+export type feedbackSurveyWizardLogicType = MakeLogicType<
+ feedbackSurveyWizardLogicValues,
+ feedbackSurveyWizardLogicActions,
+ Record<string, any>,
+ feedbackSurveyWizardLogicMeta
+>
+
export const feedbackSurveyWizardLogic = kea<feedbackSurveyWizardLogicType>([
path(['scenes', 'ai-observability', 'feedbackSurveyWizardLogic']),
connect({
@@ -168,28 +278,38 @@ export const feedbackSurveyWizardLogic = kea<feedbackSurveyWizardLogicType>([
selectors({
defaultAppearance: [
(s) => [s.currentTeam],
- (currentTeam): SurveyAppearance => ({
+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): SurveyAppearance => ({
...defaultSurveyAppearance,
...currentTeam?.survey_config?.appearance,
}),
],
existingSurveyNames: [
(s) => [s.allSurveys],
- (allSurveys): Set<string> => new Set(allSurveys.map((survey) => survey.name.toLowerCase())),
+ (allSurveys: Survey[]): Set<string> => new Set(allSurveys.map((survey) => survey.name.toLowerCase())),
],
nameIsDuplicate: [
(s) => [s.surveyName, s.existingSurveyNames],
- (surveyName, existingSurveyNames): boolean =>
+ (surveyName: string, existingSurveyNames: Set<string>): boolean =>
surveyName.trim() !== '' && existingSurveyNames.has(surveyName.trim().toLowerCase()),
],
canCreateSurvey: [
(s) => [s.surveyName, s.nameIsDuplicate, s.followUpEnabled, s.followUpQuestion],
- (surveyName, nameIsDuplicate, followUpEnabled, followUpQuestion): boolean =>
+ (
+ surveyName: string,
+ nameIsDuplicate: boolean,
+ followUpEnabled: boolean,
+ followUpQuestion: string
+ ): boolean =>
surveyName.trim() !== '' && !nameIsDuplicate && (!followUpEnabled || followUpQuestion.trim() !== ''),
],
disabledReason: [
(s) => [s.surveyName, s.nameIsDuplicate, s.followUpEnabled, s.followUpQuestion],
- (surveyName, nameIsDuplicate, followUpEnabled, followUpQuestion): string | undefined => {
+ (
+ surveyName: string,
+ nameIsDuplicate: boolean,
+ followUpEnabled: boolean,
+ followUpQuestion: string
+ ): string | undefined => {
if (nameIsDuplicate) {
return 'A survey with this name already exists'
}
@@ -204,7 +324,7 @@ export const feedbackSurveyWizardLogic = kea<feedbackSurveyWizardLogicType>([
],
eligibleSurveys: [
(s) => [s.allSurveys],
- (allSurveys): Survey[] => {
+ (allSurveys: Survey[]): Survey[] => {
return allSurveys
.filter((survey) => {
const firstQuestion = survey.questions?.[0]
@@ -216,9 +336,14 @@ export const feedbackSurveyWizardLogic = kea<feedbackSurveyWizardLogicType>([
],
activeSurvey: [
(s) => [s.createdSurvey, s.selectedSurvey],
- (createdSurvey, selectedSurvey): Survey | null => createdSurvey ?? selectedSurvey,
+ (createdSurvey: Survey | null, selectedSurvey: Survey | null): Survey | null =>
+ createdSurvey ?? selectedSurvey,
+ ],
+ surveysNeedEnabling: [
+ (s) => [s.currentTeam],
+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): boolean =>
+ !currentTeam?.surveys_opt_in,
],
- surveysNeedEnabling: [(s) => [s.currentTeam], (currentTeam): boolean => !currentTeam?.surveys_opt_in],
}),
listeners(({ actions, values }) => ({
loadAllSurveysSuccess: ({ allSurveys }) => {
diff --git a/products/ai_observability/frontend/generationEvaluationRunsLogic.ts b/products/ai_observability/frontend/generationEvaluationRunsLogic.ts
index 055634dce781..f52763a99af5 100644
--- a/products/ai_observability/frontend/generationEvaluationRunsLogic.ts
+++ b/products/ai_observability/frontend/generationEvaluationRunsLogic.ts
@@ -1,14 +1,58 @@
-import { actions, afterMount, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, key, listeners, path, props, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import { EvaluationRun } from './evaluations/types'
-import type { generationEvaluationRunsLogicType } from './generationEvaluationRunsLogicType'
import { queryEvaluationRuns } from './utils'
export interface GenerationEvaluationRunsLogicProps {
traceId: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface generationEvaluationRunsLogicValues {
+ generationEvaluationRuns: EvaluationRun[]
+ generationEvaluationRunsLoading: boolean
+ isForceRefresh: boolean
+ selectedEvaluationId: string | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface generationEvaluationRunsLogicActions {
+ loadGenerationEvaluationRuns: () => any
+ loadGenerationEvaluationRunsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadGenerationEvaluationRunsSuccess: (
+ generationEvaluationRuns: EvaluationRun[],
+ payload?: any
+ ) => {
+ generationEvaluationRuns: EvaluationRun[]
+ payload?: any
+ }
+ refreshGenerationEvaluationRuns: () => {
+ value: true
+ }
+ setSelectedEvaluationId: (evaluationId: string | null) => {
+ evaluationId: string | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface generationEvaluationRunsLogicMeta {
+ key: string
+}
+
+export type generationEvaluationRunsLogicType = MakeLogicType<
+ generationEvaluationRunsLogicValues,
+ generationEvaluationRunsLogicActions,
+ GenerationEvaluationRunsLogicProps,
+ generationEvaluationRunsLogicMeta
+>
+
export const generationEvaluationRunsLogic = kea<generationEvaluationRunsLogicType>([
path(['products', 'ai_observability', 'frontend', 'generationEvaluationRunsLogic']),
props({} as GenerationEvaluationRunsLogicProps),
diff --git a/products/ai_observability/frontend/generationTagRunsLogic.ts b/products/ai_observability/frontend/generationTagRunsLogic.ts
index c60d33ee8dd1..4d2cdd70f90e 100644
--- a/products/ai_observability/frontend/generationTagRunsLogic.ts
+++ b/products/ai_observability/frontend/generationTagRunsLogic.ts
@@ -1,11 +1,10 @@
-import { afterMount, kea, key, path, props } from 'kea'
+import { MakeLogicType, afterMount, kea, key, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { HogQLQuery, NodeKind } from '~/queries/schema/schema-general'
-import type { generationTagRunsLogicType } from './generationTagRunsLogicType'
import { TagRun } from './tags/llmTaggerLogic'
export interface GenerationTagRunsLogicProps {
@@ -31,6 +30,61 @@ export function parseTagsCell(raw: unknown): string[] {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface generationTagRunsLogicValues {
+ generationTagRuns: TagRun[]
+ generationTagRunsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface generationTagRunsLogicActions {
+ loadGenerationTagRuns: () => any
+ loadGenerationTagRunsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadGenerationTagRunsSuccess: (
+ generationTagRuns: {
+ reasoning: any
+ tagger_id: any
+ tagger_name: any
+ tags: string[]
+ target_event_id: any
+ timestamp: any
+ trace_id: any
+ uuid: any
+ }[],
+ payload?: any
+ ) => {
+ generationTagRuns: {
+ reasoning: any
+ tagger_id: any
+ tagger_name: any
+ tags: string[]
+ target_event_id: any
+ timestamp: any
+ trace_id: any
+ uuid: any
+ }[]
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface generationTagRunsLogicMeta {
+ key: string
+}
+
+export type generationTagRunsLogicType = MakeLogicType<
+ generationTagRunsLogicValues,
+ generationTagRunsLogicActions,
+ GenerationTagRunsLogicProps,
+ generationTagRunsLogicMeta
+>
+
export const generationTagRunsLogic = kea<generationTagRunsLogicType>([
path(['products', 'llm_analytics', 'frontend', 'generationTagRunsLogic']),
props({} as GenerationTagRunsLogicProps),
diff --git a/products/ai_observability/frontend/llmEvaluationExecutionLogic.ts b/products/ai_observability/frontend/llmEvaluationExecutionLogic.ts
index 558531fe9205..219b6897736d 100644
--- a/products/ai_observability/frontend/llmEvaluationExecutionLogic.ts
+++ b/products/ai_observability/frontend/llmEvaluationExecutionLogic.ts
@@ -1,11 +1,83 @@
-import { actions, connect, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, connect, kea, path, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { lemonToast } from 'lib/lemon-ui/LemonToast'
import { teamLogic } from 'scenes/teamLogic'
-import type { llmEvaluationExecutionLogicType } from './llmEvaluationExecutionLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmEvaluationExecutionLogicValues {
+ currentTeamId: number | null // teamLogic
+ evaluationRun: {
+ workflow_id: string
+ } | null
+ evaluationRunLoading: boolean
+ lastRunWorkflowId: string | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmEvaluationExecutionLogicActions {
+ runEvaluation: (
+ evaluationId: string,
+ targetEventId: string,
+ timestamp: string,
+ event: string,
+ distinctId?: string
+ ) => {
+ distinctId: string | undefined
+ evaluationId: string
+ event: string
+ targetEventId: string
+ timestamp: string
+ }
+ runEvaluationFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ runEvaluationSuccess: (
+ evaluationRun: {
+ evaluation: {
+ id: string
+ name: string
+ }
+ status: string
+ target_event_id: string
+ workflow_id: string
+ },
+ payload?: {
+ distinctId: string | undefined
+ evaluationId: string
+ event: string
+ targetEventId: string
+ timestamp: string
+ }
+ ) => {
+ evaluationRun: {
+ evaluation: {
+ id: string
+ name: string
+ }
+ status: string
+ target_event_id: string
+ workflow_id: string
+ }
+ payload?: {
+ distinctId: string | undefined
+ evaluationId: string
+ event: string
+ targetEventId: string
+ timestamp: string
+ }
+ }
+}
+
+export type llmEvaluationExecutionLogicType = MakeLogicType<
+ llmEvaluationExecutionLogicValues,
+ llmEvaluationExecutionLogicActions
+>
export const llmEvaluationExecutionLogic = kea<llmEvaluationExecutionLogicType>([
path(['products', 'ai_observability', 'frontend', 'llmEvaluationExecutionLogic']),
diff --git a/products/ai_observability/frontend/llmGenerationSentimentLazyLoaderLogic.ts b/products/ai_observability/frontend/llmGenerationSentimentLazyLoaderLogic.ts
index 4584f41ee2a2..755d22cb9d7c 100644
--- a/products/ai_observability/frontend/llmGenerationSentimentLazyLoaderLogic.ts
+++ b/products/ai_observability/frontend/llmGenerationSentimentLazyLoaderLogic.ts
@@ -1,9 +1,9 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { chunk } from 'lib/utils/arrays'
import { teamLogic } from 'scenes/teamLogic'
-import type { llmGenerationSentimentLazyLoaderLogicType } from './llmGenerationSentimentLazyLoaderLogicType'
+import type { LLMSentimentResult } from '../../../frontend/src/queries/schema/schema-general'
import { fetchStoredGenerationSentiments, type GenerationSentimentLookup } from './sentimentQueries'
import type { GenerationSentiment } from './sentimentResults'
import { runWithConcurrency } from './utils'
@@ -12,6 +12,52 @@ const BATCH_MAX_SIZE = 100
const MAX_CONCURRENT_BATCHES = 2
const BATCH_TIMER_DISPOSABLE_KEY = 'generationSentimentBatchTimer'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmGenerationSentimentLazyLoaderLogicValues {
+ currentTeamId: number | null // teamLogic
+ getGenerationSentiment: (key: string) => GenerationSentiment | null | undefined
+ isGenerationLoading: (key: string) => boolean
+ loadingGenerationKeys: Set<string>
+ sentimentByGenerationKey: Record<string, GenerationSentiment | null>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmGenerationSentimentLazyLoaderLogicActions {
+ clearLoadingGeneration: (key: string) => {
+ key: string
+ }
+ ensureGenerationSentimentLoaded: (lookup: GenerationSentimentLookup) => {
+ lookup: GenerationSentimentLookup
+ }
+ loadGenerationSentimentBatchFailure: (requestedKeys: string[]) => {
+ requestedKeys: string[]
+ }
+ loadGenerationSentimentBatchSuccess: (
+ results: Record<string, GenerationSentiment | null>,
+ requestedKeys: string[]
+ ) => {
+ requestedKeys: string[]
+ results: Record<string, LLMSentimentResult | null>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmGenerationSentimentLazyLoaderLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ isGenerationLoading: (loadingGenerationKeys: Set<string>) => (key: string) => boolean
+ getGenerationSentiment: (
+ sentimentByGenerationKey: Record<string, LLMSentimentResult | null>
+ ) => (key: string) => GenerationSentiment | null | undefined
+ }
+}
+
+export type llmGenerationSentimentLazyLoaderLogicType = MakeLogicType<
+ llmGenerationSentimentLazyLoaderLogicValues,
+ llmGenerationSentimentLazyLoaderLogicActions,
+ Record<string, any>,
+ llmGenerationSentimentLazyLoaderLogicMeta
+>
+
export const llmGenerationSentimentLazyLoaderLogic = kea<llmGenerationSentimentLazyLoaderLogicType>([
path(['products', 'ai_observability', 'frontend', 'llmGenerationSentimentLazyLoaderLogic']),
@@ -100,13 +146,15 @@ export const llmGenerationSentimentLazyLoaderLogic = kea<llmGenerationSentimentL
selectors({
isGenerationLoading: [
(s) => [s.loadingGenerationKeys],
- (loadingGenerationKeys): ((key: string) => boolean) => {
+ (loadingGenerationKeys: Set<string>): ((key: string) => boolean) => {
return (key: string) => loadingGenerationKeys.has(key)
},
],
getGenerationSentiment: [
(s) => [s.sentimentByGenerationKey],
- (sentimentByGenerationKey): ((key: string) => GenerationSentiment | null | undefined) => {
+ (
+ sentimentByGenerationKey: Record<string, GenerationSentiment | null>
+ ): ((key: string) => GenerationSentiment | null | undefined) => {
return (key: string) => sentimentByGenerationKey[key]
},
],
diff --git a/products/ai_observability/frontend/llmGenerationSentimentLazyLoaderLogicType.ts b/products/ai_observability/frontend/llmGenerationSentimentLazyLoaderLogicType.ts
deleted file mode 100644
index 8a7e1881d23a..000000000000
--- a/products/ai_observability/frontend/llmGenerationSentimentLazyLoaderLogicType.ts
+++ /dev/null
@@ -1,116 +0,0 @@
-// Generated by kea-typegen on Thu, 16 Jul 2026 09:55:07 GMT. DO NOT EDIT THIS FILE MANUALLY.
-
-import type { Logic } from 'kea'
-
-import type { GenerationSentimentLookup } from './sentimentQueries'
-import type { GenerationSentiment } from './sentimentResults'
-import type { LLMSentimentResult } from '../../../frontend/src/queries/schema/schema-general'
-
-export interface llmGenerationSentimentLazyLoaderLogicType extends Logic {
- actionCreators: {
- ensureGenerationSentimentLoaded: (lookup: GenerationSentimentLookup) => ({
- type: "ensure generation sentiment loaded (products.ai_observability.frontend.llmGenerationSentimentLazyLoaderLogic)";
- payload: {
- lookup: GenerationSentimentLookup;
- };
- });
- loadGenerationSentimentBatchSuccess: (results: Record<string, GenerationSentiment | null>, requestedKeys: string[]) => ({
- type: "load generation sentiment batch success (products.ai_observability.frontend.llmGenerationSentimentLazyLoaderLogic)";
- payload: {
- requestedKeys: string[];
- results: Record<string, LLMSentimentResult | null>;
- };
- });
- loadGenerationSentimentBatchFailure: (requestedKeys: string[]) => ({
- type: "load generation sentiment batch failure (products.ai_observability.frontend.llmGenerationSentimentLazyLoaderLogic)";
- payload: {
- requestedKeys: string[];
- };
- });
- clearLoadingGeneration: (key: string) => ({
- type: "clear loading generation (products.ai_observability.frontend.llmGenerationSentimentLazyLoaderLogic)";
- payload: {
- key: string;
- };
- });
- };
- actionKeys: {
- "ensure generation sentiment loaded (products.ai_observability.frontend.llmGenerationSentimentLazyLoaderLogic)": "ensureGenerationSentimentLoaded";
- "load generation sentiment batch success (products.ai_observability.frontend.llmGenerationSentimentLazyLoaderLogic)": "loadGenerationSentimentBatchSuccess";
- "load generation sentiment batch failure (products.ai_observability.frontend.llmGenerationSentimentLazyLoaderLogic)": "loadGenerationSentimentBatchFailure";
- "clear loading generation (products.ai_observability.frontend.llmGenerationSentimentLazyLoaderLogic)": "clearLoadingGeneration";
- };
- actionTypes: {
- ensureGenerationSentimentLoaded: "ensure generation sentiment loaded (products.ai_observability.frontend.llmGenerationSentimentLazyLoaderLogic)";
- loadGenerationSentimentBatchSuccess: "load generation sentiment batch success (products.ai_observability.frontend.llmGenerationSentimentLazyLoaderLogic)";
- loadGenerationSentimentBatchFailure: "load generation sentiment batch failure (products.ai_observability.frontend.llmGenerationSentimentLazyLoaderLogic)";
- clearLoadingGeneration: "clear loading generation (products.ai_observability.frontend.llmGenerationSentimentLazyLoaderLogic)";
- };
- actions: {
- ensureGenerationSentimentLoaded: (lookup: GenerationSentimentLookup) => void;
- loadGenerationSentimentBatchSuccess: (results: Record<string, GenerationSentiment | null>, requestedKeys: string[]) => void;
- loadGenerationSentimentBatchFailure: (requestedKeys: string[]) => void;
- clearLoadingGeneration: (key: string) => void;
- };
- asyncActions: {
- ensureGenerationSentimentLoaded: (lookup: GenerationSentimentLookup) => Promise<any>;
- loadGenerationSentimentBatchSuccess: (results: Record<string, GenerationSentiment | null>, requestedKeys: string[]) => Promise<any>;
- loadGenerationSentimentBatchFailure: (requestedKeys: string[]) => Promise<any>;
- clearLoadingGeneration: (key: string) => Promise<any>;
- };
- defaults: {
- sentimentByGenerationKey: Record<string, GenerationSentiment | null>;
- loadingGenerationKeys: Set<string>;
- };
- events: {};
- key: undefined;
- listeners: {
- "ensureGenerationSentimentLoaded": ((action: {
- type: "ensure generation sentiment loaded (products.ai_observability.frontend.llmGenerationSentimentLazyLoaderLogic)";
- payload: {
- lookup: GenerationSentimentLookup;
- };
- }, previousState: any) => void | Promise<void>)[];
- };
- path: [
- "products",
- "ai_observability",
- "frontend",
- "llmGenerationSentimentLazyLoaderLogic"
- ];
- pathString: "products.ai_observability.frontend.llmGenerationSentimentLazyLoaderLogic";
- props: Record<string, unknown>;
- reducer: (state: any, action: any, fullState: any) => {
- sentimentByGenerationKey: Record<string, GenerationSentiment | null>;
- loadingGenerationKeys: Set<string>;
- };
- reducers: {
- sentimentByGenerationKey: (state: Record<string, GenerationSentiment | null>, action: any, fullState: any) => Record<string, GenerationSentiment | null>;
- loadingGenerationKeys: (state: Set<string>, action: any, fullState: any) => Set<string>;
- };
- selector: (state: any) => {
- sentimentByGenerationKey: Record<string, GenerationSentiment | null>;
- loadingGenerationKeys: Set<string>;
- };
- selectors: {
- sentimentByGenerationKey: (state: any, props?: any) => Record<string, GenerationSentiment | null>;
- loadingGenerationKeys: (state: any, props?: any) => Set<string>;
- currentTeamId: (state: any, props?: any) => number | null;
- isGenerationLoading: (state: any, props?: any) => ((key: string) => boolean);
- getGenerationSentiment: (state: any, props?: any) => ((key: string) => GenerationSentiment | null | undefined);
- };
- sharedListeners: {};
- values: {
- sentimentByGenerationKey: Record<string, GenerationSentiment | null>;
- loadingGenerationKeys: Set<string>;
- currentTeamId: number | null;
- isGenerationLoading: ((key: string) => boolean);
- getGenerationSentiment: ((key: string) => GenerationSentiment | null | undefined);
- };
- _isKea: true;
- _isKeaWithKey: false;
- __keaTypeGenInternalSelectorTypes: {
- isGenerationLoading: (loadingGenerationKeys: Set<string>) => ((key: string) => boolean);
- getGenerationSentiment: (sentimentByGenerationKey: Record<string, GenerationSentiment | null>) => ((key: string) => GenerationSentiment | null | undefined);
- };
-}
\ No newline at end of file
diff --git a/products/ai_observability/frontend/llmPersonsLazyLoaderLogic.ts b/products/ai_observability/frontend/llmPersonsLazyLoaderLogic.ts
index 810d4f8772c1..081ce94b9554 100644
--- a/products/ai_observability/frontend/llmPersonsLazyLoaderLogic.ts
+++ b/products/ai_observability/frontend/llmPersonsLazyLoaderLogic.ts
@@ -1,12 +1,10 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import api from 'lib/api'
import { teamLogic } from 'scenes/teamLogic'
import { LLMTracePerson } from '~/queries/schema/schema-general'
-import type { llmPersonsLazyLoaderLogicType } from './llmPersonsLazyLoaderLogicType'
-
interface PersonAPIResponse {
uuid: string
name: string
@@ -28,6 +26,48 @@ function toTracePerson(apiPerson: PersonAPIResponse, distinctId: string): LLMTra
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPersonsLazyLoaderLogicValues {
+ currentTeamId: number | null // teamLogic
+ isDistinctIdLoading: (distinctId: string) => boolean
+ loadingDistinctIds: Set<string>
+ personsCache: Record<string, LLMTracePerson | null>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPersonsLazyLoaderLogicActions {
+ ensurePersonLoaded: (distinctId: string) => {
+ distinctId: string
+ }
+ loadPersonsBatchFailure: (requestedDistinctIds: string[]) => {
+ requestedDistinctIds: string[]
+ }
+ loadPersonsBatchSuccess: (
+ persons: Record<string, LLMTracePerson>,
+ requestedDistinctIds: string[]
+ ) => {
+ persons: Record<string, LLMTracePerson>
+ requestedDistinctIds: string[]
+ }
+ queuePersonLoad: (distinctId: string) => {
+ distinctId: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPersonsLazyLoaderLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ isDistinctIdLoading: (loadingDistinctIds: Set<string>) => (distinctId: string) => boolean
+ }
+}
+
+export type llmPersonsLazyLoaderLogicType = MakeLogicType<
+ llmPersonsLazyLoaderLogicValues,
+ llmPersonsLazyLoaderLogicActions,
+ Record<string, any>,
+ llmPersonsLazyLoaderLogicMeta
+>
+
export const llmPersonsLazyLoaderLogic = kea<llmPersonsLazyLoaderLogicType>([
path(['products', 'ai_observability', 'frontend', 'llmPersonsLazyLoaderLogic']),
@@ -107,7 +147,7 @@ export const llmPersonsLazyLoaderLogic = kea<llmPersonsLazyLoaderLogicType>([
selectors({
isDistinctIdLoading: [
(s) => [s.loadingDistinctIds],
- (loadingDistinctIds): ((distinctId: string) => boolean) => {
+ (loadingDistinctIds: Set<string>): ((distinctId: string) => boolean) => {
return (distinctId: string) => loadingDistinctIds.has(distinctId)
},
],
diff --git a/products/ai_observability/frontend/llmSessionTitleLazyLoaderLogic.ts b/products/ai_observability/frontend/llmSessionTitleLazyLoaderLogic.ts
index c00e62052dd3..647ed35cba77 100644
--- a/products/ai_observability/frontend/llmSessionTitleLazyLoaderLogic.ts
+++ b/products/ai_observability/frontend/llmSessionTitleLazyLoaderLogic.ts
@@ -1,4 +1,4 @@
-import { actions, events, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, events, kea, listeners, path, reducers, selectors } from 'kea'
import api from 'lib/api'
import { chunk } from 'lib/utils/arrays'
@@ -6,7 +6,6 @@ import { chunk } from 'lib/utils/arrays'
import { HogQLQuery, NodeKind } from '~/queries/schema/schema-general'
import { escapeHogQLString } from '~/queries/utils'
-import type { llmSessionTitleLazyLoaderLogicType } from './llmSessionTitleLazyLoaderLogicType'
import { resolveTitleFromInputs } from './sessionTitle'
import type { DateRangeFilter } from './types'
import { parsePartialJSON } from './utils'
@@ -182,6 +181,53 @@ async function fetchSessionTitles(
return titles
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmSessionTitleLazyLoaderLogicValues {
+ getSessionTitle: (sessionId: string) => string | null | undefined
+ loadingSessionIds: Set<string>
+ titlesBySessionId: Map<string, string | null>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmSessionTitleLazyLoaderLogicActions {
+ ensureSessionTitleLoaded: (
+ sessionId: string,
+ dateRange?: DateRangeFilter
+ ) => {
+ dateRange: DateRangeFilter | undefined
+ sessionId: string
+ }
+ loadSessionTitlesBatchFailure: (requestedSessionIds: string[]) => {
+ requestedSessionIds: string[]
+ }
+ loadSessionTitlesBatchSuccess: (
+ titles: Map<string, string | null>,
+ requestedSessionIds: string[]
+ ) => {
+ requestedSessionIds: string[]
+ titles: Map<string, string | null>
+ }
+ markSessionIdsLoading: (sessionIds: string[]) => {
+ sessionIds: string[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmSessionTitleLazyLoaderLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ getSessionTitle: (
+ titlesBySessionId: Map<string, string | null>
+ ) => (sessionId: string) => string | null | undefined
+ }
+}
+
+export type llmSessionTitleLazyLoaderLogicType = MakeLogicType<
+ llmSessionTitleLazyLoaderLogicValues,
+ llmSessionTitleLazyLoaderLogicActions,
+ Record<string, any>,
+ llmSessionTitleLazyLoaderLogicMeta
+>
+
/**
* Lazily derives a human-readable title for each session, shared by the Sessions
* list and the session detail hero. Both fetch by session id, time-bounded to the
@@ -258,7 +304,7 @@ export const llmSessionTitleLazyLoaderLogic = kea<llmSessionTitleLazyLoaderLogic
selectors({
getSessionTitle: [
(s) => [s.titlesBySessionId],
- (titlesBySessionId): ((sessionId: string) => string | null | undefined) => {
+ (titlesBySessionId: Map<string, string | null>): ((sessionId: string) => string | null | undefined) => {
return (sessionId: string) => titlesBySessionId.get(sessionId)
},
],
diff --git a/products/ai_observability/frontend/modelPickerLogic.ts b/products/ai_observability/frontend/modelPickerLogic.ts
index 4a80545b5340..af4a61253a56 100644
--- a/products/ai_observability/frontend/modelPickerLogic.ts
+++ b/products/ai_observability/frontend/modelPickerLogic.ts
@@ -1,9 +1,8 @@
-import { afterMount, connect, kea, listeners, path, selectors } from 'kea'
+import { MakeLogicType, afterMount, connect, kea, listeners, path, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
-import type { modelPickerLogicType } from './modelPickerLogicType'
import {
type LLMProvider,
LLMProviderKey,
@@ -12,6 +11,7 @@ import {
providerSortIndex,
toLLMProvider,
} from './settings/llmProviderKeysLogic'
+import type { CreateLLMProviderKeyPayload, UpdateLLMProviderKeyPayload } from './settings/llmProviderKeysLogic'
import { isUnhealthyProviderKeyState, providerKeyStateSuffix } from './settings/providerKeyStateUtils'
export interface ModelOption {
@@ -58,6 +58,104 @@ export function buildTrialProviderModelGroups(models: ModelOption[]): ProviderMo
})
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface modelPickerLogicValues {
+ providerKeys: LLMProviderKey[] // llmProviderKeysLogic
+ providerKeysLoading: boolean // llmProviderKeysLogic
+ byokModels: ModelOption[]
+ byokModelsLoading: boolean
+ hasByokKeys: boolean
+ providerModelGroups: ProviderModelGroup[]
+ trialModels: ModelOption[]
+ trialModelsLoading: boolean
+ trialProviderModelGroups: ProviderModelGroup[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface modelPickerLogicActions {
+ createProviderKeySuccess: (
+ providerKeys: LLMProviderKey[],
+ payload?:
+ | {
+ payload: CreateLLMProviderKeyPayload
+ }
+ | undefined
+ ) => {
+ payload?: {
+ payload: CreateLLMProviderKeyPayload
+ }
+ providerKeys: LLMProviderKey[]
+ } // llmProviderKeysLogic
+ loadProviderKeysSuccess: (
+ providerKeys: LLMProviderKey[],
+ payload?: any
+ ) => {
+ payload?: any
+ providerKeys: LLMProviderKey[]
+ } // llmProviderKeysLogic
+ updateProviderKeySuccess: (
+ providerKeys: LLMProviderKey[],
+ payload?:
+ | {
+ id: string
+ payload: UpdateLLMProviderKeyPayload
+ }
+ | undefined
+ ) => {
+ payload?: {
+ id: string
+ payload: UpdateLLMProviderKeyPayload
+ }
+ providerKeys: LLMProviderKey[]
+ } // llmProviderKeysLogic
+ loadByokModels: () => any
+ loadByokModelsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadByokModelsSuccess: (
+ byokModels: ModelOption[],
+ payload?: any
+ ) => {
+ byokModels: ModelOption[]
+ payload?: any
+ }
+ loadTrialModels: () => any
+ loadTrialModelsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTrialModelsSuccess: (
+ trialModels: ModelOption[],
+ payload?: any
+ ) => {
+ trialModels: ModelOption[]
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface modelPickerLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasByokKeys: (providerKeys: LLMProviderKey[]) => boolean
+ trialProviderModelGroups: (trialModels: ModelOption[]) => ProviderModelGroup[]
+ providerModelGroups: (byokModels: ModelOption[], providerKeys: LLMProviderKey[]) => ProviderModelGroup[]
+ }
+}
+
+export type modelPickerLogicType = MakeLogicType<
+ modelPickerLogicValues,
+ modelPickerLogicActions,
+ Record<string, any>,
+ modelPickerLogicMeta
+>
+
export const modelPickerLogic = kea<modelPickerLogicType>([
path(['products', 'ai_observability', 'frontend', 'modelPickerLogic']),
diff --git a/products/ai_observability/frontend/playground/llmPlaygroundModelLogic.ts b/products/ai_observability/frontend/playground/llmPlaygroundModelLogic.ts
index 77edebc7e8be..4dec11ab4e66 100644
--- a/products/ai_observability/frontend/playground/llmPlaygroundModelLogic.ts
+++ b/products/ai_observability/frontend/playground/llmPlaygroundModelLogic.ts
@@ -1,13 +1,14 @@
-import { actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api, { ApiError } from 'lib/api'
import { teamLogic } from 'scenes/teamLogic'
import { modelPickerLogic, type ModelOption } from '../modelPickerLogic'
+import type { ProviderModelGroup } from '../modelPickerLogic'
import { LLMProviderKey, llmProviderKeysLogic, normalizeLLMProvider } from '../settings/llmProviderKeysLogic'
-import type { llmPlaygroundModelLogicType } from './llmPlaygroundModelLogicType'
import { llmPlaygroundPromptsLogic, type PromptConfig } from './llmPlaygroundPromptsLogic'
+import type { PlaygroundSetupPayload } from './llmPlaygroundPromptsLogic'
import {
isTraceLikeSelection,
matchClosestModel,
@@ -39,6 +40,154 @@ function normalizePromptsToAvailableModels(
export type LLMPlaygroundModelLogicProps = Record<string, never>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPlaygroundModelLogicValues {
+ activePromptConfig: PromptConfig // llmPlaygroundPromptsLogic
+ pendingTargetIsTrace: boolean // llmPlaygroundPromptsLogic
+ pendingTargetModel: string | null // llmPlaygroundPromptsLogic
+ pendingTargetProvider: string | null // llmPlaygroundPromptsLogic
+ promptConfigs: PromptConfig[] // llmPlaygroundPromptsLogic
+ providerKeys: LLMProviderKey[] // llmProviderKeysLogic
+ providerKeysLoading: boolean // llmProviderKeysLogic
+ byokModels: ModelOption[] // modelPickerLogic
+ byokModelsLoading: boolean // modelPickerLogic
+ hasByokKeys: boolean // modelPickerLogic
+ trialModels: ModelOption[] // modelPickerLogic
+ trialModelsLoading: boolean // modelPickerLogic
+ trialProviderModelGroups: ProviderModelGroup[] // modelPickerLogic
+ activeProviderKeyId: string | null
+ allModelOptions: ModelOption[]
+ byokModelsSettled: boolean
+ effectiveModelOptions: ModelOption[]
+ evaluationConfig: {
+ active_provider_key: {
+ id: string
+ } | null
+ } | null
+ evaluationConfigLoading: boolean
+ hasProviderKey: boolean
+ providerKeyForCurrentModel: LLMProviderKey | null
+ providerKeysSettled: boolean
+ trialModelsErrorStatus: number | null
+ trialModelsSettled: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPlaygroundModelLogicActions {
+ clearPendingTargetModel: () => {
+ value: true
+ } // llmPlaygroundPromptsLogic
+ setModel: (
+ model: string,
+ providerKeyId?: string | undefined,
+ promptId?: string | undefined
+ ) => {
+ model: string
+ promptId: string | undefined
+ providerKeyId: string | undefined
+ } // llmPlaygroundPromptsLogic
+ setPromptConfigs: (promptConfigs: PromptConfig[]) => {
+ promptConfigs: PromptConfig[]
+ } // llmPlaygroundPromptsLogic
+ setupPlaygroundFromEvent: (payload: PlaygroundSetupPayload) => {
+ payload: PlaygroundSetupPayload
+ } // llmPlaygroundPromptsLogic
+ loadProviderKeys: () => any // llmProviderKeysLogic
+ loadProviderKeysFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ } // llmProviderKeysLogic
+ loadProviderKeysSuccess: (
+ providerKeys: LLMProviderKey[],
+ payload?: any
+ ) => {
+ payload?: any
+ providerKeys: LLMProviderKey[]
+ } // llmProviderKeysLogic
+ loadByokModelsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ } // modelPickerLogic
+ loadByokModelsSuccess: (
+ byokModels: ModelOption[],
+ payload?: any
+ ) => {
+ byokModels: ModelOption[]
+ payload?: any
+ } // modelPickerLogic
+ loadTrialModelsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ } // modelPickerLogic
+ loadTrialModelsSuccess: (
+ trialModels: ModelOption[],
+ payload?: any
+ ) => {
+ payload?: any
+ trialModels: ModelOption[]
+ } // modelPickerLogic
+ loadEvaluationConfig: () => any
+ loadEvaluationConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadEvaluationConfigSuccess: (
+ evaluationConfig: {
+ active_provider_key: {
+ id: string
+ } | null
+ } | null,
+ payload?: any
+ ) => {
+ evaluationConfig: {
+ active_provider_key: {
+ id: string
+ } | null
+ } | null
+ payload?: any
+ }
+ setActiveProviderKeyId: (id: string | null) => {
+ id: string | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPlaygroundModelLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ effectiveModelOptions: (
+ hasByokKeys: boolean,
+ byokModels: ModelOption[],
+ trialModels: ModelOption[]
+ ) => ModelOption[]
+ allModelOptions: (trialModels: ModelOption[], byokModels: ModelOption[]) => ModelOption[]
+ providerKeyForCurrentModel: (
+ activePromptConfig: PromptConfig,
+ effectiveModelOptions: ModelOption[],
+ providerKeys: LLMProviderKey[]
+ ) => LLMProviderKey | null
+ hasProviderKey: (providerKeyForCurrentModel: LLMProviderKey | null) => boolean
+ }
+}
+
+export type llmPlaygroundModelLogicType = MakeLogicType<
+ llmPlaygroundModelLogicValues,
+ llmPlaygroundModelLogicActions,
+ LLMPlaygroundModelLogicProps,
+ llmPlaygroundModelLogicMeta
+>
+
export const llmPlaygroundModelLogic = kea<llmPlaygroundModelLogicType>([
path(['products', 'ai_observability', 'frontend', 'playground', 'llmPlaygroundModelLogic']),
props({} as LLMPlaygroundModelLogicProps),
diff --git a/products/ai_observability/frontend/playground/llmPlaygroundPromptsLogic.ts b/products/ai_observability/frontend/playground/llmPlaygroundPromptsLogic.ts
index a24adf36ee45..8dea49e8d5ba 100644
--- a/products/ai_observability/frontend/playground/llmPlaygroundPromptsLogic.ts
+++ b/products/ai_observability/frontend/playground/llmPlaygroundPromptsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, props, reducers, selectors } from 'kea'
import { combineUrl, router, urlToAction } from 'kea-router'
import posthog from 'posthog-js'
@@ -17,7 +17,6 @@ import { llmPromptLogic } from '../prompts/llmPromptLogic'
import { getApiErrorDetail } from '../prompts/utils'
import { normalizeLLMProvider } from '../settings/llmProviderKeysLogic'
import { isOTelPartsMessage, normalizeRole, safeStringify } from '../utils'
-import type { llmPlaygroundPromptsLogicType } from './llmPlaygroundPromptsLogicType'
import { isTraceLikeSelection } from './playgroundModelMatching'
const SOURCE_PARAM_KEYS = ['source_prompt_name', 'source_prompt_version', 'source_evaluation_id'] as const
@@ -441,6 +440,290 @@ function appendRawMessage(conversation: Message[], raw: RawMessage): void {
export type LLMPlaygroundPromptsLogicProps = Record<string, never>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPlaygroundPromptsLogicValues {
+ activePromptConfig: PromptConfig
+ activePromptId: string | null
+ collapsedSections: Record<string, boolean>
+ editModal: {
+ messageIndex?: number
+ promptId: string
+ type: 'message' | 'system' | 'tools'
+ } | null
+ hasRunnablePrompts: boolean
+ linkedSource: {
+ evaluationId: string | null
+ evaluationName: string | null
+ promptName: string | null
+ promptVersion: number | null
+ type: 'evaluation' | 'prompt' | null
+ }
+ localToolsJsonByPromptId: Record<string, string | null>
+ maxTokens: number | null
+ messages: Message[]
+ model: string
+ pendingTargetIsTrace: boolean
+ pendingTargetModel: string | null
+ pendingTargetProvider: string | null
+ promptConfigs: PromptConfig[]
+ reasoningLevel: ReasoningLevel
+ saving: boolean
+ selectedProviderKeyId: string | null
+ sourceSetupLoading: boolean
+ systemPrompt: string
+ temperature: number | null
+ thinking: boolean
+ tools: Record<string, unknown>[] | null
+ toolsJsonErrorByPromptId: Record<string, string | null>
+ topP: number | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPlaygroundPromptsLogicActions {
+ addMessage: (
+ message?: Partial<Message>,
+ promptId?: string
+ ) => {
+ message: Partial<Message> | undefined
+ promptId: string | undefined
+ }
+ addPromptConfig: (sourcePromptId?: string) => {
+ newPromptId: string
+ sourcePromptId: string | undefined
+ }
+ addResultToConversation: (
+ response: string,
+ promptId?: string
+ ) => {
+ promptId: string | undefined
+ response: string
+ }
+ clearConversation: (promptId?: string) => {
+ promptId: string | undefined
+ }
+ clearLinkedSource: () => {
+ value: true
+ }
+ clearPendingTargetModel: () => {
+ value: true
+ }
+ deleteMessage: (
+ index: number,
+ promptId?: string
+ ) => {
+ index: number
+ promptId: string | undefined
+ }
+ removePromptConfig: (promptId: string) => {
+ promptId: string
+ }
+ resetPlayground: () => {
+ value: true
+ }
+ saveAsNewEvaluation: (
+ promptId: string,
+ name: string,
+ modelConfig: {
+ model: string
+ provider: string
+ provider_key_id: string | null
+ } | null
+ ) => {
+ modelConfig: {
+ model: string
+ provider: string
+ provider_key_id: string | null
+ } | null
+ name: string
+ promptId: string
+ }
+ saveAsNewPrompt: (
+ promptId: string,
+ name: string
+ ) => {
+ name: string
+ promptId: string
+ }
+ saveComplete: () => {
+ value: true
+ }
+ saveToLinkedEvaluation: (
+ promptId: string,
+ modelConfig: {
+ model: string
+ provider: string
+ provider_key_id: string | null
+ } | null
+ ) => {
+ modelConfig: {
+ model: string
+ provider: string
+ provider_key_id: string | null
+ } | null
+ promptId: string
+ }
+ saveToLinkedPrompt: (promptId: string) => {
+ promptId: string
+ }
+ setActivePromptId: (promptId: string | null) => {
+ promptId: string | null
+ }
+ setEditModal: (
+ target: {
+ messageIndex?: number
+ promptId: string
+ type: 'message' | 'system' | 'tools'
+ } | null
+ ) => {
+ target: {
+ messageIndex?: number | undefined
+ promptId: string
+ type: 'message' | 'system' | 'tools'
+ } | null
+ }
+ setLocalToolsJson: (
+ json: string | null,
+ promptId?: string
+ ) => {
+ json: string | null
+ promptId: string | undefined
+ }
+ setMaxTokens: (
+ maxTokens: number | null,
+ promptId?: string
+ ) => {
+ maxTokens: number | null
+ promptId: string | undefined
+ }
+ setMessages: (
+ messages: Message[],
+ promptId?: string
+ ) => {
+ messages: Message[]
+ promptId: string | undefined
+ }
+ setModel: (
+ model: string,
+ providerKeyId?: string,
+ promptId?: string
+ ) => {
+ model: string
+ promptId: string | undefined
+ providerKeyId: string | undefined
+ }
+ setPromptConfigs: (promptConfigs: PromptConfig[]) => {
+ promptConfigs: PromptConfig[]
+ }
+ setReasoningLevel: (
+ reasoningLevel: ReasoningLevel,
+ promptId?: string
+ ) => {
+ promptId: string | undefined
+ reasoningLevel: ReasoningLevel
+ }
+ setSourceNames: (
+ promptName: string | null,
+ evaluationName: string | null,
+ promptId?: string
+ ) => {
+ evaluationName: string | null
+ promptId: string | undefined
+ promptName: string | null
+ }
+ setSourceSetupLoading: (isLoading: boolean) => {
+ isLoading: boolean
+ }
+ setSystemPrompt: (
+ systemPrompt: string,
+ promptId?: string
+ ) => {
+ promptId: string | undefined
+ systemPrompt: string
+ }
+ setTemperature: (
+ temperature: number | null,
+ promptId?: string
+ ) => {
+ promptId: string | undefined
+ temperature: number | null
+ }
+ setThinking: (
+ thinking: boolean,
+ promptId?: string
+ ) => {
+ promptId: string | undefined
+ thinking: boolean
+ }
+ setTools: (
+ tools: Record<string, unknown>[] | null,
+ promptId?: string
+ ) => {
+ promptId: string | undefined
+ tools: Record<string, unknown>[] | null
+ }
+ setToolsJsonError: (
+ promptId: string,
+ error: string | null
+ ) => {
+ error: string | null
+ promptId: string
+ }
+ setTopP: (
+ topP: number | null,
+ promptId?: string
+ ) => {
+ promptId: string | undefined
+ topP: number | null
+ }
+ setupPlaygroundFromEvent: (payload: PlaygroundSetupPayload) => {
+ payload: PlaygroundSetupPayload
+ }
+ toggleCollapsed: (key: string) => {
+ key: string
+ }
+ updateMessage: (
+ index: number,
+ payload: Partial<Message>,
+ promptId?: string
+ ) => {
+ index: number
+ payload: Partial<Message>
+ promptId: string | undefined
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPlaygroundPromptsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ activePromptConfig: (promptConfigs: PromptConfig[], activePromptId: string | null) => PromptConfig
+ model: (activePromptConfig: PromptConfig) => string
+ selectedProviderKeyId: (activePromptConfig: PromptConfig) => string | null
+ systemPrompt: (activePromptConfig: PromptConfig) => string
+ maxTokens: (activePromptConfig: PromptConfig) => number | null
+ thinking: (activePromptConfig: PromptConfig) => boolean
+ temperature: (activePromptConfig: PromptConfig) => number | null
+ topP: (activePromptConfig: PromptConfig) => number | null
+ reasoningLevel: (activePromptConfig: PromptConfig) => ReasoningLevel
+ tools: (activePromptConfig: PromptConfig) => Record<string, unknown>[] | null
+ messages: (activePromptConfig: PromptConfig) => Message[]
+ linkedSource: (promptConfigs: PromptConfig[]) => {
+ evaluationId: string | null
+ evaluationName: string | null
+ promptName: string | null
+ promptVersion: number | null
+ type: 'evaluation' | 'prompt' | null
+ }
+ hasRunnablePrompts: (promptConfigs: PromptConfig[]) => boolean
+ }
+}
+
+export type llmPlaygroundPromptsLogicType = MakeLogicType<
+ llmPlaygroundPromptsLogicValues,
+ llmPlaygroundPromptsLogicActions,
+ LLMPlaygroundPromptsLogicProps,
+ llmPlaygroundPromptsLogicMeta
+>
+
export const llmPlaygroundPromptsLogic = kea<llmPlaygroundPromptsLogicType>([
path(['products', 'ai_observability', 'frontend', 'playground', 'llmPlaygroundPromptsLogic']),
props({} as LLMPlaygroundPromptsLogicProps),
diff --git a/products/ai_observability/frontend/playground/llmPlaygroundRunLogic.ts b/products/ai_observability/frontend/playground/llmPlaygroundRunLogic.ts
index 4cec67b5cc6a..daa463b9bf3a 100644
--- a/products/ai_observability/frontend/playground/llmPlaygroundRunLogic.ts
+++ b/products/ai_observability/frontend/playground/llmPlaygroundRunLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, props, reducers } from 'kea'
import posthog from 'posthog-js'
import { lemonToast } from '@posthog/lemon-ui'
@@ -9,9 +9,9 @@ import { uuid } from 'lib/utils/dom'
import type { ModelOption } from '../modelPickerLogic'
import { llmProviderKeysLogic } from '../settings/llmProviderKeysLogic'
+import type { LLMProviderKey } from '../settings/llmProviderKeysLogic'
import { llmPlaygroundModelLogic } from './llmPlaygroundModelLogic'
import { llmPlaygroundPromptsLogic, type Message, type PromptConfig } from './llmPlaygroundPromptsLogic'
-import type { llmPlaygroundRunLogicType } from './llmPlaygroundRunLogicType'
import { resolveProviderKeyForPrompt } from './playgroundModelMatching'
interface ToolCallChunk {
@@ -153,6 +153,56 @@ let currentAbortController: AbortController | null = null
export type LLMPlaygroundRunLogicProps = Record<string, never>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPlaygroundRunLogicValues {
+ activeProviderKeyId: string | null // llmPlaygroundModelLogic
+ effectiveModelOptions: ModelOption[] // llmPlaygroundModelLogic
+ promptConfigs: PromptConfig[] // llmPlaygroundPromptsLogic
+ providerKeys: LLMProviderKey[] // llmProviderKeysLogic
+ comparisonItems: ComparisonItem[]
+ rateLimitedUntil: number | null
+ submitting: boolean
+ subscriptionRequired: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPlaygroundRunLogicActions {
+ resetPlayground: () => {
+ value: true
+ } // llmPlaygroundPromptsLogic
+ abortRun: () => {
+ value: true
+ }
+ addToComparison: (item: ComparisonItem) => {
+ item: ComparisonItem
+ }
+ finishSubmitPrompt: () => {
+ value: true
+ }
+ setRateLimited: (retryAfterSeconds: number) => {
+ retryAfterSeconds: number
+ }
+ setSubscriptionRequired: (required: boolean) => {
+ required: boolean
+ }
+ submitPrompt: () => {
+ value: true
+ }
+ updateComparisonItem: (
+ id: string,
+ payload: Partial<ComparisonItem>
+ ) => {
+ id: string
+ payload: Partial<ComparisonItem>
+ }
+}
+
+export type llmPlaygroundRunLogicType = MakeLogicType<
+ llmPlaygroundRunLogicValues,
+ llmPlaygroundRunLogicActions,
+ LLMPlaygroundRunLogicProps
+>
+
export const llmPlaygroundRunLogic = kea<llmPlaygroundRunLogicType>([
path(['products', 'ai_observability', 'frontend', 'playground', 'llmPlaygroundRunLogic']),
props({} as LLMPlaygroundRunLogicProps),
diff --git a/products/ai_observability/frontend/prompts/createPromptExperimentModalLogic.ts b/products/ai_observability/frontend/prompts/createPromptExperimentModalLogic.ts
index 612360f01a77..26e5f0b881bd 100644
--- a/products/ai_observability/frontend/prompts/createPromptExperimentModalLogic.ts
+++ b/products/ai_observability/frontend/prompts/createPromptExperimentModalLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
import posthog from 'posthog-js'
@@ -16,13 +16,108 @@ import type {
ExperimentsPromptTemplatesRetrieve200Item,
TemplatesEnumApi,
} from '../../../experiments/frontend/generated/api.schemas'
-import type { createPromptExperimentModalLogicType } from './createPromptExperimentModalLogicType'
export const MIN_VERSIONS = 2
export const MAX_VERSIONS = 10
export type VersionSlots = (number | null)[]
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface createPromptExperimentModalLogicValues {
+ canAddSlot: boolean
+ canSubmit: boolean
+ disabledVersionsByIndex: Set<number>[]
+ isModalOpen: boolean
+ isSubmitting: boolean
+ promptName: string | null
+ promptVersions: LLMPromptVersionSummary[]
+ selectedTemplates: TemplatesEnumApi[]
+ selectedVersions: number[]
+ templates: ExperimentsPromptTemplatesRetrieve200Item[]
+ templatesLoading: boolean
+ versionSlots: VersionSlots
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface createPromptExperimentModalLogicActions {
+ addVersionSlot: () => {
+ value: true
+ }
+ closeModal: () => {
+ value: true
+ }
+ loadTemplates: () => any
+ loadTemplatesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTemplatesSuccess: (
+ templates: ExperimentsPromptTemplatesRetrieve200Item[],
+ payload?: any
+ ) => {
+ templates: ExperimentsPromptTemplatesRetrieve200Item[]
+ payload?: any
+ }
+ openModal: (
+ promptName: string,
+ promptVersions: LLMPromptVersionSummary[]
+ ) => {
+ promptName: string
+ promptVersions: LLMPromptVersionSummary[]
+ }
+ removeVersionSlot: (index: number) => {
+ index: number
+ }
+ setSelectedTemplates: (templates: TemplatesEnumApi[]) => {
+ templates: TemplatesEnumApi[]
+ }
+ setVersionAt: (
+ index: number,
+ version: number | null
+ ) => {
+ index: number
+ version: number | null
+ }
+ submitCreate: () => {
+ value: true
+ }
+ submitCreateFailure: (error: string) => {
+ error: string
+ }
+ submitCreateSuccess: (experimentId: number) => {
+ experimentId: number
+ }
+ toggleTemplate: (template: TemplatesEnumApi) => {
+ template: TemplatesEnumApi
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface createPromptExperimentModalLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ selectedVersions: (versionSlots: VersionSlots) => number[]
+ canSubmit: (
+ selectedVersions: number[],
+ selectedTemplates: TemplatesEnumApi[],
+ isSubmitting: boolean,
+ promptName: string | null,
+ versionSlots: VersionSlots
+ ) => boolean
+ disabledVersionsByIndex: (versionSlots: VersionSlots) => Set<number>[]
+ canAddSlot: (versionSlots: VersionSlots) => boolean
+ }
+}
+
+export type createPromptExperimentModalLogicType = MakeLogicType<
+ createPromptExperimentModalLogicValues,
+ createPromptExperimentModalLogicActions,
+ Record<string, any>,
+ createPromptExperimentModalLogicMeta
+>
+
export const createPromptExperimentModalLogic = kea<createPromptExperimentModalLogicType>([
path(['products', 'ai_observability', 'frontend', 'prompts', 'createPromptExperimentModalLogic']),
diff --git a/products/ai_observability/frontend/prompts/llmPromptLogic.ts b/products/ai_observability/frontend/prompts/llmPromptLogic.ts
index 59ceb5ab2c67..cda1fb74204d 100644
--- a/products/ai_observability/frontend/prompts/llmPromptLogic.ts
+++ b/products/ai_observability/frontend/prompts/llmPromptLogic.ts
@@ -1,4 +1,5 @@
import {
+ MakeLogicType,
actions,
afterMount,
beforeUnmount,
@@ -13,6 +14,7 @@ import {
selectors,
} from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import { actionToUrl, combineUrl, router, urlToAction } from 'kea-router'
@@ -41,7 +43,7 @@ import {
PropertyOperator,
} from '~/types'
-import type { llmPromptLogicType } from './llmPromptLogicType'
+import type { ProductIntentProperties } from '../../../../frontend/src/lib/utils/product-intents'
import { llmPromptsLogic } from './llmPromptsLogic'
import { LLM_PROMPTS_FORCE_RELOAD_PARAM } from './llmPromptsLogic'
import { getApiErrorDetail, openDiscardChangesDialog, requestPromptDuplicate, validatePromptName } from './utils'
@@ -145,6 +147,263 @@ function isNameFieldValidationError(error: unknown): error is { attr: 'name'; de
)
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPromptLogicValues {
+ analyticsScope: PromptAnalyticsScope
+ breadcrumbs: Breadcrumb[]
+ canCompareVersions: boolean
+ canLoadMoreVersions: boolean
+ comparePrompt: LLMPrompt | null
+ comparePromptLoading: boolean
+ compareVersion: number | null
+ compareVersionOptions: Array<{
+ label: string
+ value: number
+ }>
+ defaultRelatedTracesQuery: DataTableNode | null
+ isDiffVisible: boolean
+ isEditMode: boolean
+ isHistoricalVersion: boolean
+ isNewPrompt: boolean
+ isOutlineExpanded: boolean
+ isPromptFormDirty: boolean
+ isPromptFormSubmitting: boolean
+ isPromptFormValid: boolean
+ isPromptMissing: boolean
+ isPublishReviewOpen: boolean
+ isRenderingMarkdown: boolean
+ isViewMode: boolean
+ mode: PromptMode
+ nextVersion: number | null
+ prompt: PromptFormValues | ResolvedLLMPrompt | null
+ promptForm: PromptFormValues
+ promptFormAllErrors: Record<string, any>
+ promptFormChanged: boolean
+ promptFormErrors: DeepPartialMap<PromptFormValues, ValidationErrorType>
+ promptFormHasErrors: boolean
+ promptFormManualErrors: Record<string, any>
+ promptFormTouched: boolean
+ promptFormTouches: Record<string, boolean>
+ promptFormValidationErrors: DeepPartialMap<PromptFormValues, ValidationErrorType>
+ promptLoading: boolean
+ promptUsageLogQuery: DataTableNode
+ promptUsagePropertyFilter: AnyPropertyFilter[]
+ promptUsageTrendQuery: InsightVizNode
+ promptVariables: string[]
+ publishConflict: PublishConflict | null
+ relatedTracesQuery: DataTableNode | null
+ relatedTracesQueryOverride: DataTableNode | null
+ shouldDisplaySkeleton: boolean
+ showPromptFormErrors: boolean
+ snippetLanguage: PromptSnippetLanguage
+ tracePropertyFilters: AnyPropertyFilter[]
+ versionDescription: string
+ versions: LLMPromptVersionSummary[]
+ versionsLoading: boolean
+ viewAllTracesUrl: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPromptLogicActions {
+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic
+ cancelEditing: () => {
+ value: true
+ }
+ closePublishReview: () => {
+ value: true
+ }
+ deletePrompt: () => {
+ value: true
+ }
+ duplicatePrompt: (
+ sourceName: string,
+ newName: string
+ ) => {
+ newName: string
+ sourceName: string
+ }
+ loadComparePrompt: (version: number) => number
+ loadComparePromptFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadComparePromptSuccess: (
+ comparePrompt: LLMPrompt,
+ payload?: number
+ ) => {
+ comparePrompt: LLMPrompt
+ payload?: number
+ }
+ loadMoreVersions: () => {
+ value: true
+ }
+ loadPrompt: () => any
+ loadPromptFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadPromptSuccess: (
+ prompt: ResolvedLLMPrompt,
+ payload?: any
+ ) => {
+ prompt: ResolvedLLMPrompt
+ payload?: any
+ }
+ openPublishReview: () => {
+ value: true
+ }
+ requestPublish: () => {
+ value: true
+ }
+ resetPromptForm: (values?: PromptFormValues) => {
+ values?: PromptFormValues
+ }
+ setAnalyticsScope: (analyticsScope: PromptAnalyticsScope) => {
+ analyticsScope: PromptAnalyticsScope
+ }
+ setCompareVersion: (compareVersion: number | null) => {
+ compareVersion: number | null
+ }
+ setMode: (mode: PromptMode) => {
+ mode: PromptMode
+ }
+ setPrompt: (prompt: PromptFormValues | ResolvedLLMPrompt) => {
+ prompt: PromptFormValues | ResolvedLLMPrompt
+ }
+ setPromptFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setPromptFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setPromptFormValues: (values: DeepPartial<PromptFormValues>) => {
+ values: DeepPartial<PromptFormValues>
+ }
+ setPublishConflict: (publishConflict: PublishConflict | null) => {
+ publishConflict: PublishConflict | null
+ }
+ setRelatedTracesQuery: (query: DataTableNode) => {
+ query: DataTableNode
+ }
+ setSnippetLanguage: (snippetLanguage: PromptSnippetLanguage) => {
+ snippetLanguage: PromptSnippetLanguage
+ }
+ setVersionDescription: (versionDescription: string) => {
+ versionDescription: string
+ }
+ setVersionsLoading: (versionsLoading: boolean) => {
+ versionsLoading: boolean
+ }
+ submitPromptForm: () => {
+ value: boolean
+ }
+ submitPromptFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitPromptFormRequest: (promptForm: PromptFormValues) => {
+ promptForm: PromptFormValues
+ }
+ submitPromptFormSuccess: (promptForm: PromptFormValues) => {
+ promptForm: PromptFormValues
+ }
+ toggleMarkdownRendering: () => {
+ value: true
+ }
+ toggleOutlineExpanded: () => {
+ value: true
+ }
+ touchPromptFormField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPromptLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isNewPrompt: (arg: any) => boolean
+ isPromptMissing: (prompt: PromptFormValues | ResolvedLLMPrompt | null, promptLoading: boolean) => boolean
+ shouldDisplaySkeleton: (prompt: PromptFormValues | ResolvedLLMPrompt | null, promptLoading: boolean) => boolean
+ isHistoricalVersion: (prompt: PromptFormValues | ResolvedLLMPrompt | null) => boolean
+ isPromptFormDirty: (
+ promptForm: PromptFormValues,
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ isNewPrompt: boolean
+ ) => boolean
+ nextVersion: (prompt: PromptFormValues | ResolvedLLMPrompt | null) => number | null
+ promptVariables: (promptForm: PromptFormValues) => string[]
+ breadcrumbs: (
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ searchParams: Record<string, any>
+ ) => Breadcrumb[]
+ isViewMode: (mode: PromptMode, arg: any) => boolean
+ isEditMode: (mode: PromptMode, arg: any) => boolean
+ versions: (prompt: PromptFormValues | ResolvedLLMPrompt | null) => LLMPromptVersionSummary[]
+ canLoadMoreVersions: (prompt: PromptFormValues | ResolvedLLMPrompt | null) => boolean
+ isDiffVisible: (compareVersion: number | null) => boolean
+ canCompareVersions: (prompt: PromptFormValues | ResolvedLLMPrompt | null) => boolean
+ compareVersionOptions: (
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ versions: LLMPromptVersionSummary[]
+ ) => Array<{
+ label: string
+ value: number
+ }>
+ tracePropertyFilters: (
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ analyticsScope: PromptAnalyticsScope
+ ) => AnyPropertyFilter[]
+ defaultRelatedTracesQuery: (
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ tracePropertyFilters: AnyPropertyFilter[]
+ ) => DataTableNode | null
+ relatedTracesQuery: (
+ defaultRelatedTracesQuery: DataTableNode | null,
+ relatedTracesQueryOverride: DataTableNode | null
+ ) => DataTableNode | null
+ viewAllTracesUrl: (
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ relatedTracesQuery: DataTableNode | null,
+ tracePropertyFilters: AnyPropertyFilter[]
+ ) => string
+ promptUsagePropertyFilter: (
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ analyticsScope: PromptAnalyticsScope
+ ) => AnyPropertyFilter[]
+ promptUsageTrendQuery: (
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ promptUsagePropertyFilter: AnyPropertyFilter[],
+ analyticsScope: PromptAnalyticsScope
+ ) => InsightVizNode
+ promptUsageLogQuery: (
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ promptUsagePropertyFilter: AnyPropertyFilter[],
+ analyticsScope: PromptAnalyticsScope
+ ) => DataTableNode
+ }
+}
+
+export type llmPromptLogicType = MakeLogicType<
+ llmPromptLogicValues,
+ llmPromptLogicActions,
+ PromptLogicProps,
+ llmPromptLogicMeta
+>
+
export const llmPromptLogic = kea<llmPromptLogicType>([
path(['scenes', 'ai-observability', 'llmPromptLogic']),
props({ promptName: 'new' } as PromptLogicProps),
@@ -397,19 +656,27 @@ export const llmPromptLogic = kea<llmPromptLogicType>([
isPromptMissing: [
(s) => [s.prompt, s.promptLoading],
- (prompt, promptLoading) => !promptLoading && prompt === null,
+ (prompt: PromptFormValues | ResolvedLLMPrompt | null, promptLoading: boolean) =>
+ !promptLoading && prompt === null,
],
shouldDisplaySkeleton: [
(s) => [s.prompt, s.promptLoading],
- (prompt, promptLoading) => !prompt && promptLoading,
+ (prompt: PromptFormValues | ResolvedLLMPrompt | null, promptLoading: boolean) => !prompt && promptLoading,
],
- isHistoricalVersion: [(s) => [s.prompt], (prompt) => (isPrompt(prompt) ? !prompt.is_latest : false)],
+ isHistoricalVersion: [
+ (s) => [s.prompt],
+ (prompt: PromptFormValues | ResolvedLLMPrompt | null) => (isPrompt(prompt) ? !prompt.is_latest : false),
+ ],
isPromptFormDirty: [
(s) => [s.promptForm, s.prompt, s.isNewPrompt],
- (promptForm, prompt, isNewPrompt): boolean => {
+ (
+ promptForm: PromptFormValues,
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ isNewPrompt: boolean
+ ): boolean => {
if (isNewPrompt) {
return !!promptForm.name.trim() || !!promptForm.prompt.trim()
}
@@ -419,7 +686,8 @@ export const llmPromptLogic = kea<llmPromptLogicType>([
nextVersion: [
(s) => [s.prompt],
- (prompt): number | null => (isPrompt(prompt) ? (prompt.latest_version ?? prompt.version) + 1 : null),
+ (prompt: PromptFormValues | ResolvedLLMPrompt | null): number | null =>
+ isPrompt(prompt) ? (prompt.latest_version ?? prompt.version) + 1 : null,
],
promptVariables: [
@@ -460,25 +728,39 @@ export const llmPromptLogic = kea<llmPromptLogicType>([
isViewMode: [
(s) => [s.mode, (_, props) => props],
- (mode, props) => props.promptName !== 'new' && mode === PromptMode.View,
+ (mode: PromptMode, props) => props.promptName !== 'new' && mode === PromptMode.View,
],
isEditMode: [
(s) => [s.mode, (_, props) => props],
- (mode, props) => props.promptName === 'new' || mode === PromptMode.Edit,
+ (mode: PromptMode, props) => props.promptName === 'new' || mode === PromptMode.Edit,
],
- versions: [(s) => [s.prompt], (prompt): LLMPromptVersionSummary[] => (isPrompt(prompt) ? prompt.versions : [])],
+ versions: [
+ (s) => [s.prompt],
+ (prompt: PromptFormValues | ResolvedLLMPrompt | null): LLMPromptVersionSummary[] =>
+ isPrompt(prompt) ? prompt.versions : [],
+ ],
- canLoadMoreVersions: [(s) => [s.prompt], (prompt) => (isPrompt(prompt) ? prompt.has_more : false)],
+ canLoadMoreVersions: [
+ (s) => [s.prompt],
+ (prompt: PromptFormValues | ResolvedLLMPrompt | null) => (isPrompt(prompt) ? prompt.has_more : false),
+ ],
- isDiffVisible: [(s) => [s.compareVersion], (compareVersion): boolean => compareVersion !== null],
+ isDiffVisible: [(s) => [s.compareVersion], (compareVersion: number | null): boolean => compareVersion !== null],
- canCompareVersions: [(s) => [s.prompt], (prompt): boolean => isPrompt(prompt) && prompt.version_count > 1],
+ canCompareVersions: [
+ (s) => [s.prompt],
+ (prompt: PromptFormValues | ResolvedLLMPrompt | null): boolean =>
+ isPrompt(prompt) && prompt.version_count > 1,
+ ],
compareVersionOptions: [
(s) => [s.prompt, s.versions],
- (prompt, versions: LLMPromptVersionSummary[]): Array<{ value: number; label: string }> => {
+ (
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ versions: LLMPromptVersionSummary[]
+ ): Array<{ value: number; label: string }> => {
if (!isPrompt(prompt)) {
return []
}
@@ -493,7 +775,10 @@ export const llmPromptLogic = kea<llmPromptLogicType>([
tracePropertyFilters: [
(s) => [s.prompt, s.analyticsScope],
- (prompt, analyticsScope): AnyPropertyFilter[] => {
+ (
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ analyticsScope: PromptAnalyticsScope
+ ): AnyPropertyFilter[] => {
if (!isPrompt(prompt)) {
return []
}
@@ -528,7 +813,10 @@ export const llmPromptLogic = kea<llmPromptLogicType>([
defaultRelatedTracesQuery: [
(s) => [s.prompt, s.tracePropertyFilters],
- (prompt, tracePropertyFilters): DataTableNode | null => {
+ (
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ tracePropertyFilters: AnyPropertyFilter[]
+ ): DataTableNode | null => {
if (!isPrompt(prompt)) {
return null
}
@@ -568,7 +856,10 @@ export const llmPromptLogic = kea<llmPromptLogicType>([
],
relatedTracesQuery: [
(s) => [s.defaultRelatedTracesQuery, s.relatedTracesQueryOverride],
- (defaultRelatedTracesQuery, relatedTracesQueryOverride): DataTableNode | null => {
+ (
+ defaultRelatedTracesQuery: DataTableNode | null,
+ relatedTracesQueryOverride: DataTableNode | null
+ ): DataTableNode | null => {
if (!defaultRelatedTracesQuery) {
return null
}
@@ -597,7 +888,11 @@ export const llmPromptLogic = kea<llmPromptLogicType>([
viewAllTracesUrl: [
(s) => [s.prompt, s.relatedTracesQuery, s.tracePropertyFilters],
- (prompt, relatedTracesQuery, tracePropertyFilters): string => {
+ (
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ relatedTracesQuery: DataTableNode | null,
+ tracePropertyFilters: AnyPropertyFilter[]
+ ): string => {
if (!isPrompt(prompt)) {
return urls.aiObservabilityTraces()
}
@@ -619,7 +914,10 @@ export const llmPromptLogic = kea<llmPromptLogicType>([
promptUsagePropertyFilter: [
(s) => [s.prompt, s.analyticsScope],
- (prompt, analyticsScope): AnyPropertyFilter[] => {
+ (
+ prompt: PromptFormValues | ResolvedLLMPrompt | null,
+ analyticsScope: PromptAnalyticsScope
+ ): AnyPropertyFilter[] => {
if (!isPrompt(prompt)) {
return []
}
diff --git a/products/ai_observability/frontend/prompts/llmPromptsLogic.ts b/products/ai_observability/frontend/prompts/llmPromptsLogic.ts
index 79907f0329a4..e702331a4780 100644
--- a/products/ai_observability/frontend/prompts/llmPromptsLogic.ts
+++ b/products/ai_observability/frontend/prompts/llmPromptsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router, urlToAction } from 'kea-router'
@@ -14,7 +14,6 @@ import { urls } from '~/scenes/urls'
import { LLMPrompt } from '~/types'
import { cleanPagedSearchOrderParams } from '../utils'
-import type { llmPromptsLogicType } from './llmPromptsLogicType'
import { getApiErrorDetail, requestPromptDuplicate } from './utils'
export const PROMPTS_PER_PAGE = 30
@@ -38,6 +37,88 @@ function cleanFilters(values: Partial<PromptFilters>): PromptFilters {
export type LLMPromptsLogicProps = Record<string, never>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPromptsLogicValues {
+ count: number
+ filters: PromptFilters
+ pagination: PaginationManual
+ promptCountLabel: string
+ prompts: CountedPaginatedResponse<LLMPrompt>
+ promptsLoaded: boolean
+ promptsLoading: boolean
+ rawFilters: Partial<PromptFilters> | null
+ shouldShowEmptyState: boolean
+ sorting: Sorting | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPromptsLogicActions {
+ deletePrompt: (promptName: string) => {
+ promptName: string
+ }
+ duplicatePrompt: (
+ promptName: string,
+ newName: string
+ ) => {
+ newName: string
+ promptName: string
+ }
+ loadPrompts: (debounce?: boolean) => {
+ debounce: boolean
+ }
+ loadPromptsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadPromptsSuccess: (
+ prompts: CountedPaginatedResponse<LLMPrompt>,
+ payload?: {
+ debounce: boolean
+ }
+ ) => {
+ prompts: CountedPaginatedResponse<LLMPrompt>
+ payload?: {
+ debounce: boolean
+ }
+ }
+ setFilters: (
+ filters: Partial<PromptFilters>,
+ merge?: boolean,
+ debounce?: boolean
+ ) => {
+ debounce: boolean
+ filters: Partial<PromptFilters>
+ merge: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmPromptsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ filters: (rawFilters: Partial<PromptFilters> | null) => PromptFilters
+ count: (prompts: CountedPaginatedResponse<LLMPrompt>) => number
+ sorting: (filters: PromptFilters) => Sorting | null
+ pagination: (filters: PromptFilters, count: number) => PaginationManual
+ promptCountLabel: (filters: PromptFilters, count: number) => string
+ shouldShowEmptyState: (
+ count: number,
+ promptsLoaded: boolean,
+ promptsLoading: boolean,
+ filters: PromptFilters
+ ) => boolean
+ }
+}
+
+export type llmPromptsLogicType = MakeLogicType<
+ llmPromptsLogicValues,
+ llmPromptsLogicActions,
+ LLMPromptsLogicProps,
+ llmPromptsLogicMeta
+>
+
export const llmPromptsLogic = kea<llmPromptsLogicType>([
path(['scenes', 'ai-observability', 'llmPromptsLogic']),
props({} as LLMPromptsLogicProps),
@@ -140,7 +221,7 @@ export const llmPromptsLogic = kea<llmPromptsLogicType>([
promptCountLabel: [
(s) => [s.filters, s.count],
- (filters, count) => {
+ (filters: PromptFilters, count: number) => {
const start = (filters.page - 1) * PROMPTS_PER_PAGE + 1
const end = Math.min(filters.page * PROMPTS_PER_PAGE, count)
@@ -150,7 +231,7 @@ export const llmPromptsLogic = kea<llmPromptsLogicType>([
shouldShowEmptyState: [
(s) => [s.count, s.promptsLoaded, s.promptsLoading, s.filters],
- (count, promptsLoaded, promptsLoading, filters): boolean =>
+ (count: number, promptsLoaded: boolean, promptsLoading: boolean, filters: PromptFilters): boolean =>
promptsLoaded && !promptsLoading && count === 0 && !filters.search && !filters.created_by_id,
],
}),
diff --git a/products/ai_observability/frontend/prompts/llmPromptsLogicType.ts b/products/ai_observability/frontend/prompts/llmPromptsLogicType.ts
deleted file mode 100644
index 4cacc207da6b..000000000000
--- a/products/ai_observability/frontend/prompts/llmPromptsLogicType.ts
+++ /dev/null
@@ -1,186 +0,0 @@
-// Generated by kea-typegen on Thu, 09 Jul 2026 12:21:22 GMT. DO NOT EDIT THIS FILE MANUALLY.
-
-import type { Logic } from 'kea'
-
-import type { LLMPromptsLogicProps, PromptFilters } from './llmPromptsLogic'
-import type { CountedPaginatedResponse } from '../../../../frontend/src/lib/api'
-import type { LLMPrompt } from '../../../../frontend/src/types'
-import type { Sorting } from '../../../../frontend/src/lib/lemon-ui/LemonTable/index'
-import type { PaginationManual } from '../../../../frontend/src/lib/lemon-ui/PaginationControl/index'
-
-export interface llmPromptsLogicType extends Logic {
- actionCreators: {
- setFilters: (filters: Partial<PromptFilters>, merge?: boolean, debounce?: boolean) => ({
- type: "set filters (scenes.ai-observability.llmPromptsLogic)";
- payload: {
- debounce: boolean;
- filters: Partial<PromptFilters>;
- merge: boolean;
- };
- });
- loadPrompts: (debounce?: boolean) => ({
- type: "load prompts (scenes.ai-observability.llmPromptsLogic)";
- payload: {
- debounce: boolean;
- };
- });
- deletePrompt: (promptName: string) => ({
- type: "delete prompt (scenes.ai-observability.llmPromptsLogic)";
- payload: {
- promptName: string;
- };
- });
- duplicatePrompt: (promptName: string, newName: string) => ({
- type: "duplicate prompt (scenes.ai-observability.llmPromptsLogic)";
- payload: {
- newName: string;
- promptName: string;
- };
- });
- loadPromptsSuccess: (prompts: CountedPaginatedResponse<LLMPrompt>, payload?: {
- debounce: boolean;
- }) => ({
- type: "load prompts success (scenes.ai-observability.llmPromptsLogic)";
- payload: {
- prompts: CountedPaginatedResponse<LLMPrompt>;
- payload?: {
- debounce: boolean;
- };
- };
- });
- loadPromptsFailure: (error: string, errorObject?: any) => ({
- type: "load prompts failure (scenes.ai-observability.llmPromptsLogic)";
- payload: {
- error: string;
- errorObject?: any;
- };
- });
- };
- actionKeys: {
- "set filters (scenes.ai-observability.llmPromptsLogic)": "setFilters";
- "load prompts (scenes.ai-observability.llmPromptsLogic)": "loadPrompts";
- "delete prompt (scenes.ai-observability.llmPromptsLogic)": "deletePrompt";
- "duplicate prompt (scenes.ai-observability.llmPromptsLogic)": "duplicatePrompt";
- "load prompts success (scenes.ai-observability.llmPromptsLogic)": "loadPromptsSuccess";
- "load prompts failure (scenes.ai-observability.llmPromptsLogic)": "loadPromptsFailure";
- };
- actionTypes: {
- setFilters: "set filters (scenes.ai-observability.llmPromptsLogic)";
- loadPrompts: "load prompts (scenes.ai-observability.llmPromptsLogic)";
- deletePrompt: "delete prompt (scenes.ai-observability.llmPromptsLogic)";
- duplicatePrompt: "duplicate prompt (scenes.ai-observability.llmPromptsLogic)";
- loadPromptsSuccess: "load prompts success (scenes.ai-observability.llmPromptsLogic)";
- loadPromptsFailure: "load prompts failure (scenes.ai-observability.llmPromptsLogic)";
- };
- actions: {
- setFilters: (filters: Partial<PromptFilters>, merge?: boolean, debounce?: boolean) => void;
- loadPrompts: (debounce?: boolean) => void;
- deletePrompt: (promptName: string) => void;
- duplicatePrompt: (promptName: string, newName: string) => void;
- loadPromptsSuccess: (prompts: CountedPaginatedResponse<LLMPrompt>, payload?: {
- debounce: boolean;
- }) => void;
- loadPromptsFailure: (error: string, errorObject?: any) => void;
- };
- asyncActions: {
- setFilters: (filters: Partial<PromptFilters>, merge?: boolean, debounce?: boolean) => Promise<any>;
- loadPrompts: (debounce?: boolean) => Promise<any>;
- deletePrompt: (promptName: string) => Promise<any>;
- duplicatePrompt: (promptName: string, newName: string) => Promise<any>;
- loadPromptsSuccess: (prompts: CountedPaginatedResponse<LLMPrompt>, payload?: {
- debounce: boolean;
- }) => Promise<any>;
- loadPromptsFailure: (error: string, errorObject?: any) => Promise<any>;
- };
- defaults: {
- rawFilters: Partial<PromptFilters> | null;
- promptsLoaded: boolean;
- prompts: CountedPaginatedResponse<LLMPrompt>;
- promptsLoading: boolean;
- };
- events: {};
- key: undefined;
- listeners: {
- "setFilters": ((action: {
- type: "set filters (scenes.ai-observability.llmPromptsLogic)";
- payload: {
- debounce: boolean;
- filters: Partial<PromptFilters>;
- merge: boolean;
- };
- }, previousState: any) => void | Promise<void>)[];
- "deletePrompt": ((action: {
- type: "delete prompt (scenes.ai-observability.llmPromptsLogic)";
- payload: {
- promptName: string;
- };
- }, previousState: any) => void | Promise<void>)[];
- "duplicatePrompt": ((action: {
- type: "duplicate prompt (scenes.ai-observability.llmPromptsLogic)";
- payload: {
- newName: string;
- promptName: string;
- };
- }, previousState: any) => void | Promise<void>)[];
- };
- path: [
- "scenes",
- "ai-observability",
- "llmPromptsLogic"
- ];
- pathString: "scenes.ai-observability.llmPromptsLogic";
- props: LLMPromptsLogicProps;
- reducer: (state: any, action: any, fullState: any) => {
- rawFilters: Partial<PromptFilters> | null;
- promptsLoaded: boolean;
- prompts: CountedPaginatedResponse<LLMPrompt>;
- promptsLoading: boolean;
- };
- reducers: {
- rawFilters: (state: Partial<PromptFilters> | null, action: any, fullState: any) => Partial<PromptFilters> | null;
- promptsLoaded: (state: boolean, action: any, fullState: any) => boolean;
- prompts: (state: CountedPaginatedResponse<LLMPrompt>, action: any, fullState: any) => CountedPaginatedResponse<LLMPrompt>;
- promptsLoading: (state: boolean, action: any, fullState: any) => boolean;
- };
- selector: (state: any) => {
- rawFilters: Partial<PromptFilters> | null;
- promptsLoaded: boolean;
- prompts: CountedPaginatedResponse<LLMPrompt>;
- promptsLoading: boolean;
- };
- selectors: {
- rawFilters: (state: any, props?: any) => Partial<PromptFilters> | null;
- promptsLoaded: (state: any, props?: any) => boolean;
- prompts: (state: any, props?: any) => CountedPaginatedResponse<LLMPrompt>;
- promptsLoading: (state: any, props?: any) => boolean;
- filters: (state: any, props?: any) => PromptFilters;
- count: (state: any, props?: any) => number;
- sorting: (state: any, props?: any) => Sorting | null;
- pagination: (state: any, props?: any) => PaginationManual;
- promptCountLabel: (state: any, props?: any) => string;
- shouldShowEmptyState: (state: any, props?: any) => boolean;
- };
- sharedListeners: {};
- values: {
- rawFilters: Partial<PromptFilters> | null;
- promptsLoaded: boolean;
- prompts: CountedPaginatedResponse<LLMPrompt>;
- promptsLoading: boolean;
- filters: PromptFilters;
- count: number;
- sorting: Sorting | null;
- pagination: PaginationManual;
- promptCountLabel: string;
- shouldShowEmptyState: boolean;
- };
- _isKea: true;
- _isKeaWithKey: false;
- __keaTypeGenInternalSelectorTypes: {
- filters: (rawFilters: Partial<PromptFilters> | null) => PromptFilters;
- count: (prompts: CountedPaginatedResponse<LLMPrompt>) => number;
- sorting: (filters: PromptFilters) => Sorting | null;
- pagination: (filters: PromptFilters, count: number) => PaginationManual;
- promptCountLabel: (filters: PromptFilters, count: number) => string;
- shouldShowEmptyState: (count: number, promptsLoaded: boolean, promptsLoading: boolean, filters: PromptFilters) => boolean;
- };
-}
\ No newline at end of file
diff --git a/products/ai_observability/frontend/prompts/promptExperimentsLogic.ts b/products/ai_observability/frontend/prompts/promptExperimentsLogic.ts
index 8fa28f848552..46f384b9daa0 100644
--- a/products/ai_observability/frontend/prompts/promptExperimentsLogic.ts
+++ b/products/ai_observability/frontend/prompts/promptExperimentsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -7,12 +7,54 @@ import { ApiConfig } from '~/lib/api'
import { experimentsList } from '../../../experiments/frontend/generated/api'
import type { ExperimentBasicApi } from '../../../experiments/frontend/generated/api.schemas'
import { createPromptExperimentModalLogic } from './createPromptExperimentModalLogic'
-import type { promptExperimentsLogicType } from './promptExperimentsLogicType'
export interface PromptExperimentsLogicProps {
promptName: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface promptExperimentsLogicValues {
+ experiments: ExperimentBasicApi[]
+ experimentsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface promptExperimentsLogicActions {
+ submitCreateSuccess: (experimentId: number) => {
+ experimentId: number
+ } // createPromptExperimentModalLogic
+ loadExperiments: () => any
+ loadExperimentsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadExperimentsSuccess: (
+ experiments: ExperimentBasicApi[],
+ payload?: any
+ ) => {
+ experiments: ExperimentBasicApi[]
+ payload?: any
+ }
+ refresh: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface promptExperimentsLogicMeta {
+ key: string
+}
+
+export type promptExperimentsLogicType = MakeLogicType<
+ promptExperimentsLogicValues,
+ promptExperimentsLogicActions,
+ PromptExperimentsLogicProps,
+ promptExperimentsLogicMeta
+>
+
export const promptExperimentsLogic = kea<promptExperimentsLogicType>([
path((key) => ['products', 'ai_observability', 'frontend', 'prompts', 'promptExperimentsLogic', key]),
props({} as PromptExperimentsLogicProps),
diff --git a/products/ai_observability/frontend/reviewQueues/aiObservabilityReviewQueuesLogic.ts b/products/ai_observability/frontend/reviewQueues/aiObservabilityReviewQueuesLogic.ts
index 5a1c8bb2ac43..7183f4a6beb0 100644
--- a/products/ai_observability/frontend/reviewQueues/aiObservabilityReviewQueuesLogic.ts
+++ b/products/ai_observability/frontend/reviewQueues/aiObservabilityReviewQueuesLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router, urlToAction } from 'kea-router'
@@ -19,7 +19,6 @@ import type {
ReviewQueueApi,
ReviewQueueItemApi,
} from '../generated/api.schemas'
-import type { aiObservabilityReviewQueuesLogicType } from './aiObservabilityReviewQueuesLogicType'
import { reviewQueuesApi } from './reviewQueuesApi'
import { getApiErrorDetail } from './reviewQueueUtils'
@@ -152,6 +151,181 @@ function getQueueUrlState(
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityReviewQueuesLogicValues {
+ activeQueue: ReviewQueueApi | null
+ editingQueue: ReviewQueueApi | null
+ hasLoadedQueuesOnce: boolean
+ queueCountLabel: string
+ queueEditorMode: ReviewQueueEditorMode | null
+ queueEditorName: string
+ queueEditorSubmitting: boolean
+ queueEditorTitle: string
+ queueFilters: ReviewQueueFilters
+ queueItemCountLabel: string
+ queueItemFilters: ReviewQueueItemFilters
+ queueItemPagination: PaginationManual
+ queueItemSorting: Sorting | null
+ queueItems: PaginatedReviewQueueItemListApi
+ queueItemsLoading: boolean
+ queuePagination: PaginationManual
+ queueSorting: Sorting | null
+ queues: PaginatedReviewQueueListApi
+ queuesLoading: boolean
+ rawQueueFilters: Partial<ReviewQueueFilters> | null
+ rawQueueItemFilters: Partial<ReviewQueueItemFilters> | null
+ selectedQueue: ReviewQueueApi | null
+ selectedQueueId: string | null
+ visibleQueues: ReviewQueueApi[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityReviewQueuesLogicActions {
+ closeQueueEditor: () => {
+ value: true
+ }
+ deleteQueue: (queue: ReviewQueueApi) => {
+ queue: ReviewQueueApi
+ }
+ loadQueueItems: (debounce?: boolean) => {
+ debounce: boolean
+ }
+ loadQueueItemsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadQueueItemsSuccess: (
+ queueItems: PaginatedReviewQueueItemListApi,
+ payload?: {
+ debounce: boolean
+ }
+ ) => {
+ queueItems: PaginatedReviewQueueItemListApi
+ payload?: {
+ debounce: boolean
+ }
+ }
+ loadQueues: (debounce?: boolean) => {
+ debounce: boolean
+ }
+ loadQueuesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadQueuesSuccess: (
+ queues: PaginatedReviewQueueListApi,
+ payload?: {
+ debounce: boolean
+ }
+ ) => {
+ queues: PaginatedReviewQueueListApi
+ payload?: {
+ debounce: boolean
+ }
+ }
+ openQueueEditor: (
+ mode: ReviewQueueEditorMode,
+ queue?: ReviewQueueApi | null
+ ) => {
+ mode: ReviewQueueEditorMode
+ queue: ReviewQueueApi | null
+ }
+ removeQueueItem: (item: ReviewQueueItemApi) => {
+ item: ReviewQueueItemApi
+ }
+ requestDeleteQueue: (queue: ReviewQueueApi) => {
+ queue: ReviewQueueApi
+ }
+ requestRemoveQueueItem: (item: ReviewQueueItemApi) => {
+ item: ReviewQueueItemApi
+ }
+ selectQueue: (queueId: string | null) => {
+ queueId: string | null
+ }
+ setQueueEditorName: (name: string) => {
+ name: string
+ }
+ setQueueFilters: (
+ filters: Partial<ReviewQueueFilters>,
+ merge?: boolean,
+ debounce?: boolean
+ ) => {
+ debounce: boolean
+ filters: Partial<ReviewQueueFilters>
+ merge: boolean
+ }
+ setQueueItemFilters: (
+ filters: Partial<ReviewQueueItemFilters>,
+ merge?: boolean,
+ debounce?: boolean
+ ) => {
+ debounce: boolean
+ filters: Partial<ReviewQueueItemFilters>
+ merge: boolean
+ }
+ setSelectedQueue: (queue: ReviewQueueApi | null) => {
+ queue: ReviewQueueApi | null
+ }
+ submitQueueEditor: () => {
+ value: true
+ }
+ submitQueueEditorFailure: () => {
+ value: true
+ }
+ submitQueueEditorSuccess: (
+ queue: ReviewQueueApi,
+ mode: ReviewQueueEditorMode
+ ) => {
+ mode: ReviewQueueEditorMode
+ queue: ReviewQueueApi
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityReviewQueuesLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ queueFilters: (rawQueueFilters: Partial<ReviewQueueFilters> | null) => ReviewQueueFilters
+ queueItemFilters: (rawQueueItemFilters: Partial<ReviewQueueItemFilters> | null) => ReviewQueueItemFilters
+ activeQueue: (
+ queues: PaginatedReviewQueueListApi,
+ selectedQueueId: string | null,
+ selectedQueue: ReviewQueueApi | null
+ ) => ReviewQueueApi | null
+ visibleQueues: (queues: PaginatedReviewQueueListApi, activeQueue: ReviewQueueApi | null) => ReviewQueueApi[]
+ queueSorting: (queueFilters: ReviewQueueFilters) => Sorting | null
+ queuePagination: (queueFilters: ReviewQueueFilters, queues: PaginatedReviewQueueListApi) => PaginationManual
+ queueItemSorting: (queueItemFilters: ReviewQueueItemFilters) => Sorting | null
+ queueItemPagination: (
+ queueItemFilters: ReviewQueueItemFilters,
+ queueItems: PaginatedReviewQueueItemListApi
+ ) => PaginationManual
+ queueCountLabel: (
+ queues: PaginatedReviewQueueListApi,
+ queueFilters: ReviewQueueFilters,
+ queuesLoading: boolean
+ ) => string
+ queueItemCountLabel: (
+ queueItems: PaginatedReviewQueueItemListApi,
+ queueItemFilters: ReviewQueueItemFilters,
+ queueItemsLoading: boolean
+ ) => string
+ queueEditorTitle: (queueEditorMode: ReviewQueueEditorMode | null) => string
+ }
+}
+
+export type aiObservabilityReviewQueuesLogicType = MakeLogicType<
+ aiObservabilityReviewQueuesLogicValues,
+ aiObservabilityReviewQueuesLogicActions,
+ AIObservabilityReviewQueuesLogicProps,
+ aiObservabilityReviewQueuesLogicMeta
+>
+
export const aiObservabilityReviewQueuesLogic = kea<aiObservabilityReviewQueuesLogicType>([
path(['products', 'ai_observability', 'frontend', 'reviewQueues', 'aiObservabilityReviewQueuesLogic']),
props({} as AIObservabilityReviewQueuesLogicProps),
@@ -411,7 +585,8 @@ export const aiObservabilityReviewQueuesLogic = kea<aiObservabilityReviewQueuesL
],
queueEditorTitle: [
(s) => [s.queueEditorMode],
- (queueEditorMode): string => (queueEditorMode === 'rename' ? 'Rename queue' : 'New queue'),
+ (queueEditorMode: ReviewQueueEditorMode | null): string =>
+ queueEditorMode === 'rename' ? 'Rename queue' : 'New queue',
],
}),
diff --git a/products/ai_observability/frontend/reviewQueues/reviewQueuePickerModalLogic.ts b/products/ai_observability/frontend/reviewQueues/reviewQueuePickerModalLogic.ts
index c379913e8602..7cb4dd895e5c 100644
--- a/products/ai_observability/frontend/reviewQueues/reviewQueuePickerModalLogic.ts
+++ b/products/ai_observability/frontend/reviewQueues/reviewQueuePickerModalLogic.ts
@@ -1,10 +1,9 @@
-import { actions, afterMount, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { lemonToast } from '~/lib/lemon-ui/LemonToast/LemonToast'
import type { PaginatedReviewQueueListApi, ReviewQueueApi } from '../generated/api.schemas'
-import type { reviewQueuePickerModalLogicType } from './reviewQueuePickerModalLogicType'
import { reviewQueuesApi } from './reviewQueuesApi'
import { getApiErrorDetail } from './reviewQueueUtils'
@@ -25,6 +24,75 @@ const EMPTY_QUEUE_LIST: PaginatedReviewQueueListApi = {
results: [],
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface reviewQueuePickerModalLogicValues {
+ isCreatingQueue: boolean
+ isSubmitting: boolean
+ queues: PaginatedReviewQueueListApi
+ queuesLoading: boolean
+ selectedQueue: ReviewQueueApi | null
+ selectedQueueKey: string | null
+ selectedQueueValue: string[] | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface reviewQueuePickerModalLogicActions {
+ loadQueues: () => {
+ value: true
+ }
+ loadQueuesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadQueuesSuccess: (
+ queues: PaginatedReviewQueueListApi,
+ payload?: {
+ value: true
+ }
+ ) => {
+ queues: PaginatedReviewQueueListApi
+ payload?: {
+ value: true
+ }
+ }
+ setSelectedQueueKey: (queueKey: string | null) => {
+ queueKey: string | null
+ }
+ submit: (queueKey?: string | null) => {
+ queueKey: string | null
+ }
+ submitFailure: () => {
+ value: true
+ }
+ submitSuccess: (
+ queueId: string,
+ createdQueue: boolean
+ ) => {
+ createdQueue: boolean
+ queueId: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface reviewQueuePickerModalLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ selectedQueueValue: (selectedQueueKey: string | null) => string[] | null
+ selectedQueue: (queues: PaginatedReviewQueueListApi, selectedQueueKey: string | null) => ReviewQueueApi | null
+ isCreatingQueue: (selectedQueueKey: string | null, selectedQueue: ReviewQueueApi | null) => boolean
+ }
+}
+
+export type reviewQueuePickerModalLogicType = MakeLogicType<
+ reviewQueuePickerModalLogicValues,
+ reviewQueuePickerModalLogicActions,
+ ReviewQueuePickerModalProps,
+ reviewQueuePickerModalLogicMeta
+>
+
export const reviewQueuePickerModalLogic = kea<reviewQueuePickerModalLogicType>([
path(['products', 'ai_observability', 'frontend', 'reviewQueues', 'reviewQueuePickerModalLogic']),
props({} as ReviewQueuePickerModalProps),
diff --git a/products/ai_observability/frontend/scoreDefinitions/aiObservabilityScoreDefinitionsLogic.ts b/products/ai_observability/frontend/scoreDefinitions/aiObservabilityScoreDefinitionsLogic.ts
index ba71c928f5c4..1c4771f53d29 100644
--- a/products/ai_observability/frontend/scoreDefinitions/aiObservabilityScoreDefinitionsLogic.ts
+++ b/products/ai_observability/frontend/scoreDefinitions/aiObservabilityScoreDefinitionsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router, urlToAction } from 'kea-router'
@@ -21,7 +21,6 @@ import type {
PaginatedScoreDefinitionListApi,
ScoreDefinitionApi,
} from '../generated/api.schemas'
-import type { aiObservabilityScoreDefinitionsLogicType } from './aiObservabilityScoreDefinitionsLogicType'
import { getApiErrorDetail, getCurrentProjectId, type ScoreDefinitionModalMode } from './scoreDefinitionModalUtils'
export const SCORE_DEFINITIONS_PER_PAGE = 30
@@ -85,6 +84,98 @@ function getUrlFilters(filters: ScoreDefinitionFilters): Record<string, unknown>
export type AIObservabilityScoreDefinitionsLogicProps = Record<string, never>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityScoreDefinitionsLogicValues {
+ archivingDefinitionIds: Set<string>
+ count: number
+ filters: ScoreDefinitionFilters
+ isArchivingDefinition: (definitionId: string) => boolean
+ modalMode: ScoreDefinitionModalMode | null
+ pagination: PaginationManual
+ rawFilters: Partial<ScoreDefinitionFilters> | null
+ scoreDefinitionCountLabel: string
+ scoreDefinitions: PaginatedScoreDefinitionListApi
+ scoreDefinitionsLoading: boolean
+ selectedDefinition: ScoreDefinitionApi | null
+ sorting: Sorting | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityScoreDefinitionsLogicActions {
+ closeModal: () => {
+ value: true
+ }
+ loadScoreDefinitions: (debounce?: boolean) => {
+ debounce: boolean
+ }
+ loadScoreDefinitionsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadScoreDefinitionsSuccess: (
+ scoreDefinitions: PaginatedScoreDefinitionListApi,
+ payload?: {
+ debounce: boolean
+ }
+ ) => {
+ scoreDefinitions: PaginatedScoreDefinitionListApi
+ payload?: {
+ debounce: boolean
+ }
+ }
+ openModal: (
+ mode: ScoreDefinitionModalMode,
+ scoreDefinition?: ScoreDefinitionApi | null
+ ) => {
+ mode: ScoreDefinitionModalMode
+ scoreDefinition: ScoreDefinitionApi | null
+ }
+ setFilters: (
+ filters: Partial<ScoreDefinitionFilters>,
+ merge?: boolean,
+ debounce?: boolean
+ ) => {
+ debounce: boolean
+ filters: Partial<ScoreDefinitionFilters>
+ merge: boolean
+ }
+ toggleArchive: (scoreDefinition: ScoreDefinitionApi) => {
+ scoreDefinition: ScoreDefinitionApi
+ }
+ toggleArchiveFailure: (definitionId: string) => {
+ definitionId: string
+ }
+ toggleArchiveSuccess: (definitionId: string) => {
+ definitionId: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityScoreDefinitionsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ filters: (rawFilters: Partial<ScoreDefinitionFilters> | null) => ScoreDefinitionFilters
+ count: (scoreDefinitions: PaginatedScoreDefinitionListApi) => number
+ sorting: (filters: ScoreDefinitionFilters) => Sorting | null
+ pagination: (filters: ScoreDefinitionFilters, count: number) => PaginationManual
+ scoreDefinitionCountLabel: (
+ filters: ScoreDefinitionFilters,
+ count: number,
+ scoreDefinitionsLoading: boolean
+ ) => string
+ isArchivingDefinition: (archivingDefinitionIds: Set<string>) => (definitionId: string) => boolean
+ }
+}
+
+export type aiObservabilityScoreDefinitionsLogicType = MakeLogicType<
+ aiObservabilityScoreDefinitionsLogicValues,
+ aiObservabilityScoreDefinitionsLogicActions,
+ AIObservabilityScoreDefinitionsLogicProps,
+ aiObservabilityScoreDefinitionsLogicMeta
+>
+
export const aiObservabilityScoreDefinitionsLogic = kea<aiObservabilityScoreDefinitionsLogicType>([
path(['products', 'ai_observability', 'frontend', 'scoreDefinitions', 'aiObservabilityScoreDefinitionsLogic']),
props({} as AIObservabilityScoreDefinitionsLogicProps),
@@ -237,7 +328,7 @@ export const aiObservabilityScoreDefinitionsLogic = kea<aiObservabilityScoreDefi
],
isArchivingDefinition: [
(s) => [s.archivingDefinitionIds],
- (archivingDefinitionIds): ((definitionId: string) => boolean) => {
+ (archivingDefinitionIds: Set<string>): ((definitionId: string) => boolean) => {
return (definitionId: string) => archivingDefinitionIds.has(definitionId)
},
],
diff --git a/products/ai_observability/frontend/scoreDefinitions/scoreDefinitionModalLogic.ts b/products/ai_observability/frontend/scoreDefinitions/scoreDefinitionModalLogic.ts
index 08aacaecefbb..a4f2b7b96c76 100644
--- a/products/ai_observability/frontend/scoreDefinitions/scoreDefinitionModalLogic.ts
+++ b/products/ai_observability/frontend/scoreDefinitions/scoreDefinitionModalLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { lemonToast } from '~/lib/lemon-ui/LemonToast/LemonToast'
@@ -8,8 +8,8 @@ import {
llmAnalyticsScoreDefinitionsPartialUpdate as aiObservabilityScoreDefinitionsPartialUpdate,
} from '../generated/api'
import type { ScoreDefinitionApi } from '../generated/api.schemas'
+import type { CategoricalScoreOptionApi } from '../generated/api.schemas'
import { aiObservabilityScoreDefinitionsLogic } from './aiObservabilityScoreDefinitionsLogic'
-import type { scoreDefinitionModalLogicType } from './scoreDefinitionModalLogicType'
import {
createDraft,
buildConfigFromDraft,
@@ -26,6 +26,73 @@ export interface ScoreDefinitionModalLogicProps {
scoreDefinition: ScoreDefinitionApi | null
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface scoreDefinitionModalLogicValues {
+ draft: ScoreDefinitionDraft
+ isConfigMode: boolean
+ isCreateMode: boolean
+ isMetadataMode: boolean
+ submitting: boolean
+ title: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface scoreDefinitionModalLogicActions {
+ addOption: () => {
+ value: true
+ }
+ beginSubmit: () => {
+ value: true
+ }
+ initializeDraft: (draft: ScoreDefinitionDraft) => {
+ draft: ScoreDefinitionDraft
+ }
+ removeOption: (index: number) => {
+ index: number
+ }
+ setDraftField: (
+ field: keyof ScoreDefinitionDraft,
+ value: ScoreDefinitionDraft[keyof ScoreDefinitionDraft]
+ ) => {
+ field: keyof ScoreDefinitionDraft
+ value: string | CategoricalScoreOptionApi[]
+ }
+ submit: () => {
+ value: true
+ }
+ submitFailure: () => {
+ value: true
+ }
+ submitSuccess: () => {
+ value: true
+ }
+ updateOptionLabel: (
+ index: number,
+ value: string
+ ) => {
+ index: number
+ value: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface scoreDefinitionModalLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isCreateMode: (arg: any) => boolean
+ isMetadataMode: (arg: any) => boolean
+ isConfigMode: (arg: any) => boolean
+ title: (arg: any) => string
+ }
+}
+
+export type scoreDefinitionModalLogicType = MakeLogicType<
+ scoreDefinitionModalLogicValues,
+ scoreDefinitionModalLogicActions,
+ ScoreDefinitionModalLogicProps,
+ scoreDefinitionModalLogicMeta
+>
+
export const scoreDefinitionModalLogic = kea<scoreDefinitionModalLogicType>([
path(['products', 'ai_observability', 'frontend', 'scoreDefinitions', 'scoreDefinitionModalLogic']),
props({} as ScoreDefinitionModalLogicProps),
diff --git a/products/ai_observability/frontend/sentimentEvaluationAvailabilityLogic.ts b/products/ai_observability/frontend/sentimentEvaluationAvailabilityLogic.ts
index 61543b378f5b..35460a1fcea3 100644
--- a/products/ai_observability/frontend/sentimentEvaluationAvailabilityLogic.ts
+++ b/products/ai_observability/frontend/sentimentEvaluationAvailabilityLogic.ts
@@ -1,11 +1,51 @@
-import { afterMount, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, afterMount, kea, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { getCurrentTeamId } from '~/lib/utils/getAppContext'
import { evaluationsList } from './generated/api'
import type { EvaluationApi } from './generated/api.schemas'
-import type { sentimentEvaluationAvailabilityLogicType } from './sentimentEvaluationAvailabilityLogicType'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sentimentEvaluationAvailabilityLogicValues {
+ hasLoadedSentimentEvaluations: boolean
+ hasSentimentEvaluations: boolean
+ sentimentEvaluations: EvaluationApi[]
+ sentimentEvaluationsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sentimentEvaluationAvailabilityLogicActions {
+ loadSentimentEvaluations: () => any
+ loadSentimentEvaluationsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSentimentEvaluationsSuccess: (
+ sentimentEvaluations: EvaluationApi[],
+ payload?: any
+ ) => {
+ sentimentEvaluations: EvaluationApi[]
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sentimentEvaluationAvailabilityLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasSentimentEvaluations: (sentimentEvaluations: EvaluationApi[]) => boolean
+ }
+}
+
+export type sentimentEvaluationAvailabilityLogicType = MakeLogicType<
+ sentimentEvaluationAvailabilityLogicValues,
+ sentimentEvaluationAvailabilityLogicActions,
+ Record<string, any>,
+ sentimentEvaluationAvailabilityLogicMeta
+>
export const sentimentEvaluationAvailabilityLogic = kea<sentimentEvaluationAvailabilityLogicType>([
path(['products', 'ai_observability', 'frontend', 'sentimentEvaluationAvailabilityLogic']),
diff --git a/products/ai_observability/frontend/sessionPlaybackLogic.ts b/products/ai_observability/frontend/sessionPlaybackLogic.ts
index 3de18c2f29a8..a56992857705 100644
--- a/products/ai_observability/frontend/sessionPlaybackLogic.ts
+++ b/products/ai_observability/frontend/sessionPlaybackLogic.ts
@@ -1,6 +1,4 @@
-import { actions, kea, key, listeners, path, props, reducers } from 'kea'
-
-import type { sessionPlaybackLogicType } from './sessionPlaybackLogicType'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers } from 'kea'
export const PLAYBACK_SPEEDS = [0.5, 1, 1.5, 2, 3, 4, 8, 16]
const TICK_MS = 50
@@ -9,6 +7,54 @@ export interface SessionPlaybackLogicProps {
sessionId: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionPlaybackLogicValues {
+ currentMs: number
+ durationMs: number
+ playing: boolean
+ speed: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionPlaybackLogicActions {
+ pause: () => {
+ value: true
+ }
+ play: () => {
+ value: true
+ }
+ seek: (ms: number) => {
+ ms: number
+ }
+ setCurrentMs: (ms: number) => {
+ ms: number
+ }
+ setSpeed: (speed: number) => {
+ speed: number
+ }
+ setTimeline: (durationMs: number) => {
+ durationMs: number
+ }
+ tick: (deltaMs: number) => {
+ deltaMs: number
+ }
+ togglePlay: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionPlaybackLogicMeta {
+ key: string
+}
+
+export type sessionPlaybackLogicType = MakeLogicType<
+ sessionPlaybackLogicValues,
+ sessionPlaybackLogicActions,
+ SessionPlaybackLogicProps,
+ sessionPlaybackLogicMeta
+>
+
export const sessionPlaybackLogic = kea<sessionPlaybackLogicType>([
path(['products', 'ai_observability', 'frontend', 'sessionPlaybackLogic']),
props({} as SessionPlaybackLogicProps),
diff --git a/products/ai_observability/frontend/settings/llmProviderKeysLogic.ts b/products/ai_observability/frontend/settings/llmProviderKeysLogic.ts
index 14c599e6502e..54215f1c6f5e 100644
--- a/products/ai_observability/frontend/settings/llmProviderKeysLogic.ts
+++ b/products/ai_observability/frontend/settings/llmProviderKeysLogic.ts
@@ -1,12 +1,10 @@
-import { actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api, { ApiError } from 'lib/api'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { teamLogic } from 'scenes/teamLogic'
-import type { llmProviderKeysLogicType } from './llmProviderKeysLogicType'
-
export type LLMProviderKeyState = 'unknown' | 'ok' | 'invalid' | 'error'
export type LLMProvider =
| 'openai'
@@ -198,6 +196,282 @@ export interface DependentConfigsResponse {
alternative_keys: AlternativeKey[]
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmProviderKeysLogicValues {
+ dependentConfigs: DependentConfigsResponse | null
+ dependentConfigsLoading: boolean
+ editingKey: LLMProviderKey | null
+ evaluationConfig: EvaluationTrialConfig | null
+ evaluationConfigLoading: boolean
+ isTrialGrandfathered: boolean
+ keyToDelete: LLMProviderKey | null
+ newKeyModalOpen: boolean
+ newlyCreatedKey: LLMProviderKey | null
+ preValidationResult: KeyValidationResult | null
+ preValidationResultLoading: boolean
+ providerKeys: LLMProviderKey[]
+ providerKeysLoading: boolean
+ requiresProviderKey: boolean
+ trialEvalLimit: number
+ trialEvalsRemaining: number
+ trialEvalsUsed: number
+ trialEvaluations: TrialEvaluation[]
+ trialEvaluationsLoading: boolean
+ validatingKeyId: string | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmProviderKeysLogicActions {
+ clearPreValidation: () => {
+ value: true
+ }
+ confirmAssignKey: (
+ evaluationIds: string[],
+ enable: boolean
+ ) => {
+ enable: boolean
+ evaluationIds: string[]
+ }
+ confirmDelete: (replacementKeyId?: string) => {
+ replacementKeyId: string | undefined
+ }
+ createProviderKey: ({ payload }: { payload: CreateLLMProviderKeyPayload }) => {
+ payload: CreateLLMProviderKeyPayload
+ }
+ createProviderKeyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ createProviderKeySuccess: (
+ providerKeys: LLMProviderKey[],
+ payload?: {
+ payload: CreateLLMProviderKeyPayload
+ }
+ ) => {
+ providerKeys: LLMProviderKey[]
+ payload?: {
+ payload: CreateLLMProviderKeyPayload
+ }
+ }
+ deleteProviderKey: ({ id, replacementKeyId }: { id: string; replacementKeyId?: string }) => {
+ id: string
+ replacementKeyId?: string
+ }
+ deleteProviderKeyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteProviderKeySuccess: (
+ providerKeys: LLMProviderKey[],
+ payload?: {
+ id: string
+ replacementKeyId?: string
+ }
+ ) => {
+ providerKeys: LLMProviderKey[]
+ payload?: {
+ id: string
+ replacementKeyId?: string
+ }
+ }
+ dismissAssignKey: () => {
+ value: true
+ }
+ loadDependentConfigs: ({ keyId }: { keyId: string }) => {
+ keyId: string
+ }
+ loadDependentConfigsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDependentConfigsSuccess: (
+ dependentConfigs: DependentConfigsResponse | null,
+ payload?: {
+ keyId: string
+ }
+ ) => {
+ dependentConfigs: DependentConfigsResponse | null
+ payload?: {
+ keyId: string
+ }
+ }
+ loadEvaluationConfig: () => any
+ loadEvaluationConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadEvaluationConfigSuccess: (
+ evaluationConfig: EvaluationTrialConfig | null,
+ payload?: any
+ ) => {
+ evaluationConfig: EvaluationTrialConfig | null
+ payload?: any
+ }
+ loadProviderKeys: () => any
+ loadProviderKeysFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadProviderKeysSuccess: (
+ providerKeys: LLMProviderKey[],
+ payload?: any
+ ) => {
+ providerKeys: LLMProviderKey[]
+ payload?: any
+ }
+ loadTrialEvaluations: ({ provider }: { provider: LLMProvider }) => {
+ provider: LLMProvider
+ }
+ loadTrialEvaluationsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTrialEvaluationsSuccess: (
+ trialEvaluations: TrialEvaluation[],
+ payload?: {
+ provider: LLMProvider
+ }
+ ) => {
+ trialEvaluations: TrialEvaluation[]
+ payload?: {
+ provider: LLMProvider
+ }
+ }
+ preValidateKey: ({
+ apiKey,
+ provider,
+ azure_endpoint,
+ api_version,
+ }: {
+ api_version?: string
+ apiKey: string
+ azure_endpoint?: string
+ provider: LLMProvider
+ }) => {
+ apiKey: string
+ provider: LLMProvider
+ azure_endpoint?: string
+ api_version?: string
+ }
+ preValidateKeyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ preValidateKeySuccess: (
+ preValidationResult: KeyValidationResult,
+ payload?: {
+ apiKey: string
+ provider: LLMProvider
+ azure_endpoint?: string
+ api_version?: string
+ }
+ ) => {
+ preValidationResult: KeyValidationResult
+ payload?: {
+ apiKey: string
+ provider: LLMProvider
+ azure_endpoint?: string
+ api_version?: string
+ }
+ }
+ setEditingKey: (key: LLMProviderKey | null) => {
+ key: LLMProviderKey | null
+ }
+ setKeyToDelete: (key: LLMProviderKey | null) => {
+ key: LLMProviderKey | null
+ }
+ setNewKeyModalOpen: (open: boolean) => {
+ open: boolean
+ }
+ setNewlyCreatedKey: (key: LLMProviderKey | null) => {
+ key: LLMProviderKey | null
+ }
+ updateProviderKey: ({ id, payload }: { id: string; payload: UpdateLLMProviderKeyPayload }) => {
+ id: string
+ payload: UpdateLLMProviderKeyPayload
+ }
+ updateProviderKeyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateProviderKeySuccess: (
+ providerKeys: LLMProviderKey[],
+ payload?: {
+ id: string
+ payload: UpdateLLMProviderKeyPayload
+ }
+ ) => {
+ providerKeys: LLMProviderKey[]
+ payload?: {
+ id: string
+ payload: UpdateLLMProviderKeyPayload
+ }
+ }
+ validateProviderKey: ({ id }: { id: string }) => {
+ id: string
+ }
+ validateProviderKeyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ validateProviderKeySuccess: (
+ providerKeys: LLMProviderKey[],
+ payload?: {
+ id: string
+ }
+ ) => {
+ providerKeys: LLMProviderKey[]
+ payload?: {
+ id: string
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmProviderKeysLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ trialEvalsUsed: (evaluationConfig: EvaluationTrialConfig | null) => number
+ trialEvalLimit: (evaluationConfig: EvaluationTrialConfig | null) => number
+ trialEvalsRemaining: (evaluationConfig: EvaluationTrialConfig | null) => number
+ isTrialGrandfathered: (evaluationConfig: EvaluationTrialConfig | null) => boolean
+ requiresProviderKey: (evaluationConfig: EvaluationTrialConfig | null) => boolean
+ }
+}
+
+export type llmProviderKeysLogicType = MakeLogicType<
+ llmProviderKeysLogicValues,
+ llmProviderKeysLogicActions,
+ Record<string, any>,
+ llmProviderKeysLogicMeta
+>
+
export const llmProviderKeysLogic = kea<llmProviderKeysLogicType>([
path(['products', 'ai_observability', 'settings', 'llmProviderKeysLogic']),
diff --git a/products/ai_observability/frontend/settings/parserRecipesLogic.ts b/products/ai_observability/frontend/settings/parserRecipesLogic.ts
index 08343aabecf7..e19bf05f1d94 100644
--- a/products/ai_observability/frontend/settings/parserRecipesLogic.ts
+++ b/products/ai_observability/frontend/settings/parserRecipesLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
import { parse as parseYaml } from 'yaml'
@@ -16,7 +16,6 @@ import {
import { ParserRecipeApi } from '../generated/api.schemas'
import { applyTeamParserRecipes } from '../messageNormalization'
import { compileRecipe, StoredRecipe } from '../normalizer'
-import type { parserRecipesLogicType } from './parserRecipesLogicType'
export interface CustomRecipeItem {
id: string
@@ -42,6 +41,81 @@ export function sourceCompileError(source: string): string | null {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface parserRecipesLogicValues {
+ currentTeamId: number | null // teamLogic
+ customItems: CustomRecipeItem[]
+ editor: RecipeEditorState | null
+ editorCompileError: string | null
+ recipesVersion: number
+ savingEditor: boolean
+ storedForMerge: StoredRecipe[]
+ storedRecipes: ParserRecipeApi[]
+ storedRecipesLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface parserRecipesLogicActions {
+ closeEditor: () => {
+ value: true
+ }
+ deleteItem: (item: CustomRecipeItem) => {
+ item: CustomRecipeItem
+ }
+ loadRecipes: () => any
+ loadRecipesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRecipesSuccess: (
+ storedRecipes: ParserRecipeApi[],
+ payload?: any
+ ) => {
+ storedRecipes: ParserRecipeApi[]
+ payload?: any
+ }
+ openEditorForItem: (item: CustomRecipeItem) => {
+ item: CustomRecipeItem
+ }
+ openEditorForNew: () => {
+ value: true
+ }
+ recipesApplied: () => {
+ value: true
+ }
+ setEditorName: (name: string) => {
+ name: string
+ }
+ setEditorSource: (source: string) => {
+ source: string
+ }
+ submitEditor: () => {
+ value: true
+ }
+ submitEditorDone: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface parserRecipesLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ storedForMerge: (storedRecipes: ParserRecipeApi[]) => StoredRecipe[]
+ customItems: (storedRecipes: ParserRecipeApi[]) => CustomRecipeItem[]
+ editorCompileError: (editor: RecipeEditorState | null) => string | null
+ }
+}
+
+export type parserRecipesLogicType = MakeLogicType<
+ parserRecipesLogicValues,
+ parserRecipesLogicActions,
+ Record<string, any>,
+ parserRecipesLogicMeta
+>
+
// Owns the team's custom recipes end to end: loads them, pushes them into the live
// trace-rendering normalizer, and backs the settings editor. Mounted on every AI
// observability view via aiObservabilitySharedLogic so customizations apply even when
@@ -101,7 +175,7 @@ export const parserRecipesLogic = kea<parserRecipesLogicType>([
selectors({
storedForMerge: [
(s) => [s.storedRecipes],
- (rows): StoredRecipe[] => rows.map((row) => ({ id: row.id, source: row.source })),
+ (rows: ParserRecipeApi[]): StoredRecipe[] => rows.map((row) => ({ id: row.id, source: row.source })),
],
customItems: [
(s) => [s.storedRecipes],
@@ -110,7 +184,7 @@ export const parserRecipesLogic = kea<parserRecipesLogicType>([
],
editorCompileError: [
(s) => [s.editor],
- (editor): string | null => (editor ? sourceCompileError(editor.source) : null),
+ (editor: RecipeEditorState | null): string | null => (editor ? sourceCompileError(editor.source) : null),
],
}),
subscriptions(({ actions }) => ({
diff --git a/products/ai_observability/frontend/summary-view/summaryViewLogic.ts b/products/ai_observability/frontend/summary-view/summaryViewLogic.ts
index 1f5bdddffce2..51a047e9aa1b 100644
--- a/products/ai_observability/frontend/summary-view/summaryViewLogic.ts
+++ b/products/ai_observability/frontend/summary-view/summaryViewLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -8,7 +8,6 @@ import { teamLogic } from 'scenes/teamLogic'
import { LLMTrace, LLMTraceEvent } from '~/queries/schema/schema-general'
import { EnrichedTraceTreeNode } from '../aiObservabilityTraceDataLogic'
-import type { summaryViewLogicType } from './summaryViewLogicType'
export type SummaryMode = 'minimal' | 'detailed'
@@ -36,6 +35,89 @@ export interface SummaryViewLogicProps {
autoGenerate?: boolean
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface summaryViewLogicValues {
+ dataProcessingAccepted: boolean // maxGlobalLogic
+ currentTeamId: number | null // teamLogic
+ entityId: string | null
+ isFlowExpanded: boolean
+ isNotesExpanded: boolean
+ isSummaryExpanded: boolean
+ summaryData: {
+ summary: StructuredSummary
+ text_repr: string
+ } | null
+ summaryDataLoading: boolean
+ summaryMode: SummaryMode
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface summaryViewLogicActions {
+ generateSummary: ({ mode, forceRefresh }: { forceRefresh?: boolean; mode: SummaryMode }) => {
+ mode: SummaryMode
+ forceRefresh?: boolean
+ }
+ generateSummaryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ generateSummarySuccess: (
+ summaryData: {
+ summary: any
+ text_repr: any
+ },
+ payload?: {
+ mode: SummaryMode
+ forceRefresh?: boolean
+ }
+ ) => {
+ summaryData: {
+ summary: any
+ text_repr: any
+ }
+ payload?: {
+ mode: SummaryMode
+ forceRefresh?: boolean
+ }
+ }
+ loadCachedSummary: () => {
+ value: true
+ }
+ regenerateSummary: () => {
+ value: true
+ }
+ setSummaryMode: (mode: SummaryMode) => {
+ mode: SummaryMode
+ }
+ toggleFlowExpanded: () => {
+ value: true
+ }
+ toggleNotesExpanded: () => {
+ value: true
+ }
+ toggleSummaryExpanded: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface summaryViewLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ entityId: (arg: any) => string | null
+ }
+}
+
+export type summaryViewLogicType = MakeLogicType<
+ summaryViewLogicValues,
+ summaryViewLogicActions,
+ SummaryViewLogicProps,
+ summaryViewLogicMeta
+>
+
export const summaryViewLogic = kea<summaryViewLogicType>([
path(['products', 'ai_observability', 'frontend', 'summary-view', 'summaryViewLogic']),
props({} as SummaryViewLogicProps),
diff --git a/products/ai_observability/frontend/tabs/aiObservabilityDashboardLogic.ts b/products/ai_observability/frontend/tabs/aiObservabilityDashboardLogic.ts
index e61f3786b2d8..0b6c595b5c89 100644
--- a/products/ai_observability/frontend/tabs/aiObservabilityDashboardLogic.ts
+++ b/products/ai_observability/frontend/tabs/aiObservabilityDashboardLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
@@ -22,7 +22,6 @@ import {
import { aiObservabilitySharedLogic } from '../aiObservabilitySharedLogic'
import { buildAiObservabilityStorageConfig } from '../preferenceStorage'
-import type { aiObservabilityDashboardLogicType } from './aiObservabilityDashboardLogicType'
export type AIObservabilityDashboardLogicProps = Record<string, never>
@@ -50,6 +49,106 @@ function getDayDateRange(day: string): { date_from: string; date_to: string } {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityDashboardLogicValues {
+ dashboardDateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ propertyFilters: AnyPropertyFilter[] // aiObservabilitySharedLogic
+ shouldFilterTestAccounts: boolean // aiObservabilitySharedLogic
+ availableDashboards: Array<{
+ description: string
+ id: number
+ name: string
+ }>
+ availableDashboardsLoading: boolean
+ isRefreshing: boolean
+ newestRefreshed: Date | null
+ refreshStatus: Record<
+ string,
+ {
+ loading?: boolean
+ timer?: Date
+ }
+ >
+ selectedDashboardId: number | null
+ tiles: QueryTile[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityDashboardLogicActions {
+ loadLLMDashboards: () => {
+ value: true
+ }
+ loadLLMDashboardsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadLLMDashboardsSuccess: (
+ availableDashboards: {
+ description: string
+ id: number
+ name: string
+ }[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ availableDashboards: {
+ description: string
+ id: number
+ name: string
+ }[]
+ payload?: {
+ value: true
+ }
+ }
+ refreshAllDashboardItems: () => {
+ value: true
+ }
+ setRefreshStatus: (
+ tileId: string,
+ loading?: boolean
+ ) => {
+ loading: boolean | undefined
+ tileId: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityDashboardLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ isRefreshing: (
+ refreshStatus: Record<
+ string,
+ {
+ loading?: boolean
+ timer?: Date
+ }
+ >
+ ) => boolean
+ tiles: (
+ dashboardDateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: AnyPropertyFilter[]
+ ) => QueryTile[]
+ }
+}
+
+export type aiObservabilityDashboardLogicType = MakeLogicType<
+ aiObservabilityDashboardLogicValues,
+ aiObservabilityDashboardLogicActions,
+ AIObservabilityDashboardLogicProps,
+ aiObservabilityDashboardLogicMeta
+>
+
export const aiObservabilityDashboardLogic = kea<aiObservabilityDashboardLogicType>([
path(['products', 'ai_observability', 'frontend', 'tabs', 'aiObservabilityDashboardLogic']),
props({} as AIObservabilityDashboardLogicProps),
@@ -189,7 +288,14 @@ export const aiObservabilityDashboardLogic = kea<aiObservabilityDashboardLogicTy
// When feature flag is ON, dashboard is loaded from backend template instead.
tiles: [
(s) => [s.dashboardDateFilter, s.shouldFilterTestAccounts, s.propertyFilters],
- (dashboardDateFilter, shouldFilterTestAccounts, propertyFilters): QueryTile[] => [
+ (
+ dashboardDateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: AnyPropertyFilter[]
+ ): QueryTile[] => [
{
title: 'Traces',
query: {
diff --git a/products/ai_observability/frontend/tabs/aiObservabilityErrorsLogic.ts b/products/ai_observability/frontend/tabs/aiObservabilityErrorsLogic.ts
index d7464786e4e9..a51d799cc89e 100644
--- a/products/ai_observability/frontend/tabs/aiObservabilityErrorsLogic.ts
+++ b/products/ai_observability/frontend/tabs/aiObservabilityErrorsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, path, props, reducers, selectors } from 'kea'
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
@@ -8,10 +8,74 @@ import { AnyPropertyFilter, PropertyFilterType, PropertyOperator } from '~/types
import errorsQueryTemplate from '../../backend/queries/errors.sql?raw'
import { SortDirection, SortState, aiObservabilitySharedLogic } from '../aiObservabilitySharedLogic'
-import type { aiObservabilityErrorsLogicType } from './aiObservabilityErrorsLogicType'
export type AIObservabilityErrorsLogicProps = Record<string, never>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityErrorsLogicValues {
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ propertyFilters: AnyPropertyFilter[] // aiObservabilitySharedLogic
+ shouldFilterTestAccounts: boolean // aiObservabilitySharedLogic
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[] // groupsModel
+ buildAllErrorsTrendQuery: InsightVizNode
+ buildErrorTrendQuery: (errorName: string) => TrendsQuery
+ errorsQuery: DataTableNode
+ errorsSort: SortState
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityErrorsLogicActions {
+ setErrorsSort: (
+ column: string,
+ direction: SortDirection
+ ) => {
+ column: string
+ direction: SortDirection
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityErrorsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ errorsQuery: (
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: AnyPropertyFilter[],
+ errorsSort: SortState,
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[]
+ ) => DataTableNode
+ buildErrorTrendQuery: (
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: AnyPropertyFilter[]
+ ) => (errorName: string) => TrendsQuery
+ buildAllErrorsTrendQuery: (
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: AnyPropertyFilter[]
+ ) => InsightVizNode
+ }
+}
+
+export type aiObservabilityErrorsLogicType = MakeLogicType<
+ aiObservabilityErrorsLogicValues,
+ aiObservabilityErrorsLogicActions,
+ AIObservabilityErrorsLogicProps,
+ aiObservabilityErrorsLogicMeta
+>
+
export const aiObservabilityErrorsLogic = kea<aiObservabilityErrorsLogicType>([
path(['products', 'ai_observability', 'frontend', 'tabs', 'aiObservabilityErrorsLogic']),
props({} as AIObservabilityErrorsLogicProps),
diff --git a/products/ai_observability/frontend/tabs/aiObservabilityGenerationsLogic.ts b/products/ai_observability/frontend/tabs/aiObservabilityGenerationsLogic.ts
index 71efe0117ea9..f47b026ed88a 100644
--- a/products/ai_observability/frontend/tabs/aiObservabilityGenerationsLogic.ts
+++ b/products/ai_observability/frontend/tabs/aiObservabilityGenerationsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import api from 'lib/api'
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
@@ -6,10 +6,11 @@ import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
import { groupsModel } from '~/models/groupsModel'
import { DataTableNode, LLMTrace, NodeKind, TraceQuery } from '~/queries/schema/schema-general'
+import type { AnyPropertyFilter } from '../../../../frontend/src/types'
import { SortDirection, SortState, aiObservabilitySharedLogic } from '../aiObservabilitySharedLogic'
+import type { ApplyUrlStatePayload } from '../aiObservabilitySharedLogic'
import { buildAiObservabilityStorageConfig } from '../preferenceStorage'
import { GENERATION_SENTIMENT_SELECT } from '../sentimentResults'
-import type { aiObservabilityGenerationsLogicType } from './aiObservabilityGenerationsLogicType'
export type AIObservabilityGenerationsLogicProps = Record<string, never>
@@ -29,6 +30,100 @@ export function getDefaultGenerationsColumns(): string[] {
]
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityGenerationsLogicValues {
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ propertyFilters: AnyPropertyFilter[] // aiObservabilitySharedLogic
+ shouldFilterTestAccounts: boolean // aiObservabilitySharedLogic
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[] // groupsModel
+ defaultGenerationsQuery: DataTableNode
+ expandedGenerationIds: Set<string>
+ generationsColumns: string[] | null
+ generationsQuery: DataTableNode
+ generationsQueryOverride: DataTableNode | null
+ generationsSort: SortState
+ loadedTraces: Record<string, LLMTrace>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityGenerationsLogicActions {
+ applyUrlState: (state: ApplyUrlStatePayload) => ApplyUrlStatePayload // aiObservabilitySharedLogic
+ setDates: (
+ dateFrom: string | null,
+ dateTo: string | null
+ ) => {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ setPropertyFilters: (propertyFilters: AnyPropertyFilter[]) => {
+ propertyFilters: AnyPropertyFilter[]
+ } // aiObservabilitySharedLogic
+ setShouldFilterTestAccounts: (shouldFilterTestAccounts: boolean) => {
+ shouldFilterTestAccounts: boolean
+ } // aiObservabilitySharedLogic
+ clearExpandedGenerations: () => {
+ value: true
+ }
+ setGenerationsColumns: (columns: string[]) => {
+ columns: string[]
+ }
+ setGenerationsQuery: (query: DataTableNode) => {
+ query: DataTableNode
+ }
+ setGenerationsSort: (
+ column: string,
+ direction: SortDirection
+ ) => {
+ column: string
+ direction: SortDirection
+ }
+ setLoadedTrace: (
+ traceId: string,
+ trace: LLMTrace
+ ) => {
+ trace: LLMTrace
+ traceId: string
+ }
+ toggleGenerationExpanded: (
+ uuid: string,
+ traceId: string
+ ) => {
+ traceId: string
+ uuid: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityGenerationsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ generationsQuery: (
+ generationsQueryOverride: DataTableNode | null,
+ defaultGenerationsQuery: DataTableNode
+ ) => DataTableNode
+ defaultGenerationsQuery: (
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: AnyPropertyFilter[],
+ generationsColumns: string[] | null,
+ generationsSort: SortState,
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[]
+ ) => DataTableNode
+ }
+}
+
+export type aiObservabilityGenerationsLogicType = MakeLogicType<
+ aiObservabilityGenerationsLogicValues,
+ aiObservabilityGenerationsLogicActions,
+ AIObservabilityGenerationsLogicProps,
+ aiObservabilityGenerationsLogicMeta
+>
+
export const aiObservabilityGenerationsLogic = kea<aiObservabilityGenerationsLogicType>([
path(['products', 'ai_observability', 'frontend', 'tabs', 'aiObservabilityGenerationsLogic']),
// Singleton (unkeyed): the persisted column selection lives in a single localStorage key
@@ -151,7 +246,7 @@ export const aiObservabilityGenerationsLogic = kea<aiObservabilityGenerationsLog
selectors({
generationsQuery: [
(s) => [s.generationsQueryOverride, s.defaultGenerationsQuery],
- (override, defQuery) => override || defQuery,
+ (override: DataTableNode | null, defQuery: DataTableNode) => override || defQuery,
],
defaultGenerationsQuery: [
@@ -164,12 +259,15 @@ export const aiObservabilityGenerationsLogic = kea<aiObservabilityGenerationsLog
s.groupsTaxonomicTypes,
],
(
- dateFilter,
- shouldFilterTestAccounts,
- propertyFilters,
- generationsColumns,
- generationsSort,
- groupsTaxonomicTypes
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: import('~/types').AnyPropertyFilter[],
+ generationsColumns: string[] | null,
+ generationsSort: SortState,
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[]
): DataTableNode => ({
kind: NodeKind.DataTableNode,
source: {
diff --git a/products/ai_observability/frontend/tabs/aiObservabilitySentimentLogic.ts b/products/ai_observability/frontend/tabs/aiObservabilitySentimentLogic.ts
index fc74faee7da1..b38824e572bd 100644
--- a/products/ai_observability/frontend/tabs/aiObservabilitySentimentLogic.ts
+++ b/products/ai_observability/frontend/tabs/aiObservabilitySentimentLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
import posthog from 'posthog-js'
@@ -7,12 +7,13 @@ import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
import { groupsModel } from '~/models/groupsModel'
+import type { AnyPropertyFilter } from '../../../../frontend/src/types'
import { aiObservabilitySharedLogic } from '../aiObservabilitySharedLogic'
+import type { AIObservabilityTabId } from '../aiObservabilitySharedLogic'
import { sentimentEvaluationAvailabilityLogic } from '../sentimentEvaluationAvailabilityLogic'
import { fetchSentimentGenerationsPage, GENERATIONS_PAGE_SIZE, type SentimentGeneration } from '../sentimentQueries'
import type { MessageSentiment } from '../sentimentResults'
import { extractContentText } from '../sentimentUtils'
-import type { aiObservabilitySentimentLogicType } from './aiObservabilitySentimentLogicType'
export type { SentimentGeneration } from '../sentimentQueries'
@@ -147,6 +148,133 @@ function captureEngagementEvents(
let lastRawFetchCount = 0
let nextGenerationsOffset = 0
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySentimentLogicValues {
+ activeTab: AIObservabilityTabId // aiObservabilitySharedLogic
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ propertyFilters: AnyPropertyFilter[] // aiObservabilitySharedLogic
+ shouldFilterTestAccounts: boolean // aiObservabilitySharedLogic
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[] // groupsModel
+ hasLoadedSentimentEvaluations: boolean // sentimentEvaluationAvailabilityLogic
+ hasSentimentEvaluations: boolean // sentimentEvaluationAvailabilityLogic
+ sentimentEvaluationsLoading: boolean // sentimentEvaluationAvailabilityLogic
+ activeFilters: Set<SentimentCategory>
+ autoLoadRounds: number
+ expandedCardIds: Set<string>
+ generations: SentimentGeneration[]
+ generationsError: boolean
+ generationsLoading: boolean
+ groupedSentimentCards: GroupedSentimentCard[]
+ hasLoadedOnce: boolean
+ hasMore: boolean
+ intensityThreshold: number
+ sentimentCards: SentimentCard[]
+ sentimentFilter: SentimentFilterLabel
+ sentimentSummary: Record<SentimentCategory, number>
+ showSentimentEvaluationOnboarding: boolean
+ stillAnalyzing: boolean
+ taxonomicGroupTypes: TaxonomicFilterGroupType[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySentimentLogicActions {
+ activate: () => {
+ value: true
+ }
+ loadGenerations: () => any
+ loadGenerationsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadGenerationsSuccess: (
+ generations: SentimentGeneration[],
+ payload?: any
+ ) => {
+ generations: SentimentGeneration[]
+ payload?: any
+ }
+ loadMoreGenerations: () => {
+ value: true
+ }
+ loadMoreGenerationsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadMoreGenerationsSuccess: (
+ generations: SentimentGeneration[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ generations: SentimentGeneration[]
+ payload?: {
+ value: true
+ }
+ }
+ setHasMore: (hasMore: boolean) => {
+ hasMore: boolean
+ }
+ setIntensityThreshold: (intensityThreshold: number) => {
+ intensityThreshold: number
+ }
+ setSentimentFilter: (sentimentFilter: SentimentFilterLabel) => {
+ sentimentFilter: SentimentFilterLabel
+ }
+ toggleCardExpanded: (cardKey: string) => {
+ cardKey: string
+ }
+ toggleSentimentCategory: (category: SentimentCategory) => {
+ category: SentimentCategory
+ }
+ trackTraceClicked: (card: SentimentCard) => {
+ card: SentimentCard
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySentimentLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ taxonomicGroupTypes: (groupsTaxonomicTypes: TaxonomicFilterGroupType[]) => TaxonomicFilterGroupType[]
+ sentimentCards: (
+ generations: SentimentGeneration[],
+ activeFilters: Set<SentimentCategory>,
+ intensityThreshold: number
+ ) => SentimentCard[]
+ sentimentSummary: (
+ generations: SentimentGeneration[],
+ intensityThreshold: number
+ ) => Record<SentimentCategory, number>
+ groupedSentimentCards: (sentimentCards: SentimentCard[]) => GroupedSentimentCard[]
+ stillAnalyzing: (generationsLoading: boolean) => boolean
+ showSentimentEvaluationOnboarding: (
+ hasLoadedSentimentEvaluations: boolean,
+ hasSentimentEvaluations: boolean,
+ hasLoadedOnce: boolean,
+ generations: SentimentGeneration[],
+ generationsLoading: boolean,
+ generationsError: boolean,
+ hasMore: boolean,
+ autoLoadRounds: number
+ ) => boolean
+ }
+}
+
+export type aiObservabilitySentimentLogicType = MakeLogicType<
+ aiObservabilitySentimentLogicValues,
+ aiObservabilitySentimentLogicActions,
+ AIObservabilitySentimentLogicProps,
+ aiObservabilitySentimentLogicMeta
+>
+
export const aiObservabilitySentimentLogic = kea<aiObservabilitySentimentLogicType>([
path(['products', 'ai_observability', 'frontend', 'tabs', 'aiObservabilitySentimentLogic']),
props({} as AIObservabilitySentimentLogicProps),
diff --git a/products/ai_observability/frontend/tabs/aiObservabilitySessionsViewLogic.ts b/products/ai_observability/frontend/tabs/aiObservabilitySessionsViewLogic.ts
index 73c53896f6b5..8154293e6394 100644
--- a/products/ai_observability/frontend/tabs/aiObservabilitySessionsViewLogic.ts
+++ b/products/ai_observability/frontend/tabs/aiObservabilitySessionsViewLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { actionToUrl, combineUrl, router, urlToAction } from 'kea-router'
import { subscriptions } from 'kea-subscriptions'
@@ -9,11 +9,13 @@ import { urls } from 'scenes/urls'
import { groupsModel } from '~/models/groupsModel'
import { DataTableNode, HogQLQuery, NodeKind, RefreshType } from '~/queries/schema/schema-general'
+import type { AnyPropertyFilter } from '../../../../frontend/src/types'
import sessionsQueryTemplate from '../../backend/queries/sessions.sql?raw'
import type { SortDirection, SortState } from '../aiObservabilitySharedLogic'
import { aiObservabilitySharedLogic } from '../aiObservabilitySharedLogic'
+import type { AIObservabilityTabId } from '../aiObservabilitySharedLogic'
import { llmSessionTitleLazyLoaderLogic } from '../llmSessionTitleLazyLoaderLogic'
-import type { aiObservabilitySessionsViewLogicType } from './aiObservabilitySessionsViewLogicType'
+import type { DateRangeFilter } from '../types'
export type AIObservabilitySessionsViewLogicProps = Record<string, never>
@@ -52,6 +54,96 @@ function parseSessionsResponse(response: { columns?: unknown[]; results?: unknow
}))
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySessionsViewLogicValues {
+ activeTab: AIObservabilityTabId // aiObservabilitySharedLogic
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ propertyFilters: AnyPropertyFilter[] // aiObservabilitySharedLogic
+ shouldFilterTestAccounts: boolean // aiObservabilitySharedLogic
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[] // groupsModel
+ getSessionTitle: (sessionId: string) => string | null | undefined // llmSessionTitleLazyLoaderLogic
+ hasMoreSessions: boolean
+ moreSessionsLoading: boolean
+ selectedSessionId: string | null
+ sessions: SessionListRow[]
+ sessionsLoading: boolean
+ sessionsQuery: DataTableNode
+ sessionsSort: SortState
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySessionsViewLogicActions {
+ ensureSessionTitleLoaded: (
+ sessionId: string,
+ dateRange?: DateRangeFilter | undefined
+ ) => {
+ dateRange: DateRangeFilter | undefined
+ sessionId: string
+ } // llmSessionTitleLazyLoaderLogic
+ loadMoreSessions: () => {
+ value: true
+ }
+ loadMoreSessionsFailure: () => {
+ value: true
+ }
+ loadMoreSessionsSuccess: (
+ sessions: SessionListRow[],
+ hasMoreSessions: boolean
+ ) => {
+ hasMoreSessions: boolean
+ sessions: SessionListRow[]
+ }
+ loadSessions: (payload?: { refresh?: RefreshType }) => {
+ refresh: RefreshType | undefined
+ }
+ loadSessionsFailure: () => {
+ value: true
+ }
+ loadSessionsSuccess: (
+ sessions: SessionListRow[],
+ hasMoreSessions: boolean
+ ) => {
+ hasMoreSessions: boolean
+ sessions: SessionListRow[]
+ }
+ selectSession: (sessionId: string | null) => {
+ sessionId: string | null
+ }
+ setSessionsSort: (
+ column: string,
+ direction: SortDirection
+ ) => {
+ column: string
+ direction: SortDirection
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilitySessionsViewLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ sessionsQuery: (
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: AnyPropertyFilter[],
+ sessionsSort: SortState,
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[]
+ ) => DataTableNode
+ }
+}
+
+export type aiObservabilitySessionsViewLogicType = MakeLogicType<
+ aiObservabilitySessionsViewLogicValues,
+ aiObservabilitySessionsViewLogicActions,
+ AIObservabilitySessionsViewLogicProps,
+ aiObservabilitySessionsViewLogicMeta
+>
+
export const aiObservabilitySessionsViewLogic = kea<aiObservabilitySessionsViewLogicType>([
path(['products', 'ai_observability', 'frontend', 'tabs', 'aiObservabilitySessionsViewLogic']),
props({} as AIObservabilitySessionsViewLogicProps),
@@ -213,7 +305,7 @@ export const aiObservabilitySessionsViewLogic = kea<aiObservabilitySessionsViewL
(
dateFilter: { dateFrom: string | null; dateTo: string | null },
shouldFilterTestAccounts: boolean,
- propertyFilters,
+ propertyFilters: import('~/types').AnyPropertyFilter[],
sessionsSort: { column: string; direction: 'ASC' | 'DESC' },
groupsTaxonomicTypes: TaxonomicFilterGroupType[]
): DataTableNode => {
diff --git a/products/ai_observability/frontend/tabs/aiObservabilityToolsLogic.ts b/products/ai_observability/frontend/tabs/aiObservabilityToolsLogic.ts
index 5744fa515f71..042bec48fcdc 100644
--- a/products/ai_observability/frontend/tabs/aiObservabilityToolsLogic.ts
+++ b/products/ai_observability/frontend/tabs/aiObservabilityToolsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, path, props, reducers, selectors } from 'kea'
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
import { escapeRegex } from 'lib/utils/actions'
@@ -16,10 +16,101 @@ import { AnyPropertyFilter, ChartDisplayType, PathType, PropertyFilterType, Prop
import toolsQueryTemplate from '../../backend/queries/tools.sql?raw'
import { SortDirection, SortState, aiObservabilitySharedLogic } from '../aiObservabilitySharedLogic'
-import type { aiObservabilityToolsLogicType } from './aiObservabilityToolsLogicType'
export type AIObservabilityToolsLogicProps = Record<string, never>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityToolsLogicValues {
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ propertyFilters: AnyPropertyFilter[] // aiObservabilitySharedLogic
+ shouldFilterTestAccounts: boolean // aiObservabilitySharedLogic
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[] // groupsModel
+ buildAllToolsTrendQuery: InsightVizNode
+ buildToolHeatmapQuery: DataVisualizationNode
+ buildToolPathsQuery: (toolName: string) => PathsQuery
+ buildToolSequencesQuery: (toolName: string) => TrendsQuery
+ buildToolTrendQuery: (toolName: string) => TrendsQuery
+ toolsQuery: DataTableNode
+ toolsSort: SortState
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityToolsLogicActions {
+ setToolsSort: (
+ column: string,
+ direction: SortDirection
+ ) => {
+ column: string
+ direction: SortDirection
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityToolsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ toolsQuery: (
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: AnyPropertyFilter[],
+ toolsSort: SortState,
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[]
+ ) => DataTableNode
+ buildToolPathsQuery: (
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: AnyPropertyFilter[]
+ ) => (toolName: string) => PathsQuery
+ buildToolSequencesQuery: (
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: AnyPropertyFilter[]
+ ) => (toolName: string) => TrendsQuery
+ buildToolTrendQuery: (
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: AnyPropertyFilter[]
+ ) => (toolName: string) => TrendsQuery
+ buildAllToolsTrendQuery: (
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: AnyPropertyFilter[]
+ ) => InsightVizNode
+ buildToolHeatmapQuery: (
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: AnyPropertyFilter[]
+ ) => DataVisualizationNode
+ }
+}
+
+export type aiObservabilityToolsLogicType = MakeLogicType<
+ aiObservabilityToolsLogicValues,
+ aiObservabilityToolsLogicActions,
+ AIObservabilityToolsLogicProps,
+ aiObservabilityToolsLogicMeta
+>
+
export const aiObservabilityToolsLogic = kea<aiObservabilityToolsLogicType>([
path(['products', 'ai_observability', 'frontend', 'tabs', 'aiObservabilityToolsLogic']),
props({} as AIObservabilityToolsLogicProps),
diff --git a/products/ai_observability/frontend/tabs/aiObservabilityTracesTabLogic.ts b/products/ai_observability/frontend/tabs/aiObservabilityTracesTabLogic.ts
index 30ea83de76d3..e21ae7b82116 100644
--- a/products/ai_observability/frontend/tabs/aiObservabilityTracesTabLogic.ts
+++ b/products/ai_observability/frontend/tabs/aiObservabilityTracesTabLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, path, props, reducers, selectors } from 'kea'
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
import { FEATURE_FLAGS } from 'lib/constants'
@@ -8,10 +8,11 @@ import { userLogic } from 'scenes/userLogic'
import { groupsModel } from '~/models/groupsModel'
import { DataTableNode, NodeKind } from '~/queries/schema/schema-general'
+import type { FeatureFlagsSet } from '../../../../frontend/src/lib/logic/featureFlagLogic'
+import type { AnyPropertyFilter, UserType } from '../../../../frontend/src/types'
import { aiObservabilitySharedLogic } from '../aiObservabilitySharedLogic'
import { buildAiObservabilityStorageConfig } from '../preferenceStorage'
import { LLM_TRACES_PAGE_SIZE } from '../utils'
-import type { aiObservabilityTracesTabLogicType } from './aiObservabilityTracesTabLogicType'
export interface AIObservabilityTracesTabLogicProps {
personId?: string
@@ -21,6 +22,71 @@ export interface AIObservabilityTracesTabLogicProps {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityTracesTabLogicValues {
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ propertyFilters: AnyPropertyFilter[] // aiObservabilitySharedLogic
+ searchQuery: string // aiObservabilitySharedLogic
+ shouldFilterSupportTraces: boolean // aiObservabilitySharedLogic
+ shouldFilterTestAccounts: boolean // aiObservabilitySharedLogic
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[] // groupsModel
+ user: UserType | null // userLogic
+ defaultTracesQuery: DataTableNode
+ showInputOutputColumns: boolean
+ showSentimentColumn: boolean
+ tracesQuery: DataTableNode
+ tracesQueryOverride: DataTableNode | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityTracesTabLogicActions {
+ setShowInputOutputColumns: (show: boolean) => {
+ show: boolean
+ }
+ setShowSentimentColumn: (show: boolean) => {
+ show: boolean
+ }
+ setTracesQuery: (query: DataTableNode) => {
+ query: DataTableNode
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityTracesTabLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ tracesQuery: (tracesQueryOverride: DataTableNode | null, defaultTracesQuery: DataTableNode) => DataTableNode
+ defaultTracesQuery: (
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ shouldFilterSupportTraces: boolean,
+ propertyFilters: AnyPropertyFilter[],
+ searchQuery: string,
+ arg: any,
+ arg2: any,
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[],
+ featureFlags: FeatureFlagsSet,
+ user: UserType | null,
+ showInputOutputColumns: boolean,
+ showSentimentColumn: boolean
+ ) => DataTableNode
+ }
+}
+
+export type aiObservabilityTracesTabLogicType = MakeLogicType<
+ aiObservabilityTracesTabLogicValues,
+ aiObservabilityTracesTabLogicActions,
+ AIObservabilityTracesTabLogicProps,
+ aiObservabilityTracesTabLogicMeta
+>
+
export const aiObservabilityTracesTabLogic = kea<aiObservabilityTracesTabLogicType>([
path(['products', 'ai_observability', 'frontend', 'tabs', 'aiObservabilityTracesTabLogic']),
key((props: AIObservabilityTracesTabLogicProps) => props?.personId || 'aiObservabilityScene'),
@@ -70,7 +136,7 @@ export const aiObservabilityTracesTabLogic = kea<aiObservabilityTracesTabLogicTy
selectors({
tracesQuery: [
(s) => [s.tracesQueryOverride, s.defaultTracesQuery],
- (override, defQuery) => override || defQuery,
+ (override: DataTableNode | null, defQuery: DataTableNode) => override || defQuery,
],
defaultTracesQuery: [
@@ -92,7 +158,7 @@ export const aiObservabilityTracesTabLogic = kea<aiObservabilityTracesTabLogicTy
dateFilter: { dateFrom: string | null; dateTo: string | null },
shouldFilterTestAccounts: boolean,
shouldFilterSupportTraces: boolean,
- propertyFilters,
+ propertyFilters: import('~/types').AnyPropertyFilter[],
searchQuery: string,
personId: string | undefined,
group: { groupKey: string; groupTypeIndex: number } | undefined,
diff --git a/products/ai_observability/frontend/tabs/aiObservabilityUsersLogic.ts b/products/ai_observability/frontend/tabs/aiObservabilityUsersLogic.ts
index 0fae2fce90ad..09ebc6f9f01f 100644
--- a/products/ai_observability/frontend/tabs/aiObservabilityUsersLogic.ts
+++ b/products/ai_observability/frontend/tabs/aiObservabilityUsersLogic.ts
@@ -1,15 +1,62 @@
-import { actions, connect, kea, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, path, props, reducers, selectors } from 'kea'
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
import { groupsModel } from '~/models/groupsModel'
import { DataTableNode, NodeKind } from '~/queries/schema/schema-general'
+import type { AnyPropertyFilter } from '../../../../frontend/src/types'
import { SortDirection, SortState, aiObservabilitySharedLogic } from '../aiObservabilitySharedLogic'
-import type { aiObservabilityUsersLogicType } from './aiObservabilityUsersLogicType'
export type AIObservabilityUsersLogicProps = Record<string, never>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityUsersLogicValues {
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ propertyFilters: AnyPropertyFilter[] // aiObservabilitySharedLogic
+ shouldFilterTestAccounts: boolean // aiObservabilitySharedLogic
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[] // groupsModel
+ usersQuery: DataTableNode
+ usersSort: SortState
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityUsersLogicActions {
+ setUsersSort: (
+ column: string,
+ direction: SortDirection
+ ) => {
+ column: string
+ direction: SortDirection
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityUsersLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ usersQuery: (
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: AnyPropertyFilter[],
+ usersSort: SortState,
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[]
+ ) => DataTableNode
+ }
+}
+
+export type aiObservabilityUsersLogicType = MakeLogicType<
+ aiObservabilityUsersLogicValues,
+ aiObservabilityUsersLogicActions,
+ AIObservabilityUsersLogicProps,
+ aiObservabilityUsersLogicMeta
+>
+
export const aiObservabilityUsersLogic = kea<aiObservabilityUsersLogicType>([
path(['products', 'ai_observability', 'frontend', 'tabs', 'aiObservabilityUsersLogic']),
props({} as AIObservabilityUsersLogicProps),
@@ -39,11 +86,14 @@ export const aiObservabilityUsersLogic = kea<aiObservabilityUsersLogicType>([
usersQuery: [
(s) => [s.dateFilter, s.shouldFilterTestAccounts, s.propertyFilters, s.usersSort, s.groupsTaxonomicTypes],
(
- dateFilter,
- shouldFilterTestAccounts,
- propertyFilters,
- usersSort,
- groupsTaxonomicTypes
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ },
+ shouldFilterTestAccounts: boolean,
+ propertyFilters: import('~/types').AnyPropertyFilter[],
+ usersSort: SortState,
+ groupsTaxonomicTypes: TaxonomicFilterGroupType[]
): DataTableNode => ({
kind: NodeKind.DataTableNode,
source: {
diff --git a/products/ai_observability/frontend/tags/llmTaggerLogic.ts b/products/ai_observability/frontend/tags/llmTaggerLogic.ts
index 29b1aacea9b4..eb59eb2c778b 100644
--- a/products/ai_observability/frontend/tags/llmTaggerLogic.ts
+++ b/products/ai_observability/frontend/tags/llmTaggerLogic.ts
@@ -1,5 +1,6 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { router } from 'kea-router'
import api from 'lib/api'
@@ -14,7 +15,6 @@ import { ChartDisplayType, PropertyFilterType, PropertyOperator } from '~/types'
import { aiObservabilitySharedLogic } from '../aiObservabilitySharedLogic'
import { parseTrialProviderKeyId } from '../ModelPicker'
import { LLMProviderKey, llmProviderKeysLogic } from '../settings/llmProviderKeysLogic'
-import type { llmTaggerLogicType } from './llmTaggerLogicType'
import { llmTaggersLogic } from './llmTaggersLogic'
import {
getIntervalFromDateRange,
@@ -86,6 +86,165 @@ const DEFAULT_FORM: TaggerForm = {
model_configuration: null,
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmTaggerLogicValues {
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ providerKeys: LLMProviderKey[] // llmProviderKeysLogic
+ activeTab: string
+ hogTestLoading: boolean
+ hogTestResults: HogTestResult[] | null
+ isNewTagger: boolean
+ isTaggerFormSubmitting: boolean
+ isTaggerFormValid: boolean
+ runsChartQuery: TrendsQuery | null
+ selectedModel: string
+ selectedPickerProviderKeyId: string | null
+ showTaggerFormErrors: boolean
+ tagRuns: TagRun[]
+ tagRunsLoading: boolean
+ tagger: Tagger | null
+ taggerForm: TaggerForm
+ taggerFormAllErrors: Record<string, any>
+ taggerFormChanged: boolean
+ taggerFormErrors: DeepPartialMap<TaggerForm, ValidationErrorType>
+ taggerFormHasErrors: boolean
+ taggerFormManualErrors: Record<string, any>
+ taggerFormTouched: boolean
+ taggerFormTouches: Record<string, boolean>
+ taggerFormValidationErrors: DeepPartialMap<TaggerForm, ValidationErrorType>
+ taggerLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmTaggerLogicActions {
+ setDates: (
+ dateFrom: string | null,
+ dateTo: string | null
+ ) => {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ loadProviderKeys: () => any // llmProviderKeysLogic
+ addCondition: () => {
+ value: true
+ }
+ addTag: () => {
+ value: true
+ }
+ clearHogTestResults: () => {
+ value: true
+ }
+ deleteTagger: () => {
+ value: true
+ }
+ loadTagRuns: () => {
+ value: true
+ }
+ loadTagRunsSuccess: (runs: TagRun[]) => {
+ runs: TagRun[]
+ }
+ loadTagger: () => {
+ value: true
+ }
+ loadTaggerSuccess: (tagger: Tagger) => {
+ tagger: Tagger
+ }
+ removeCondition: (index: number) => {
+ index: number
+ }
+ removeTag: (index: number) => {
+ index: number
+ }
+ resetTaggerForm: (values?: TaggerForm) => {
+ values?: TaggerForm
+ }
+ selectModelFromPicker: (
+ modelId: string,
+ providerKeyId: string
+ ) => {
+ modelId: string
+ providerKeyId: string
+ }
+ setActiveTab: (tab: 'configuration' | 'runs') => {
+ tab: 'configuration' | 'runs'
+ }
+ setConditions: (conditions: TaggerConditionSet[]) => {
+ conditions: TaggerConditionSet[]
+ }
+ setTaggerFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setTaggerFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setTaggerFormValues: (values: DeepPartial<TaggerForm>) => {
+ values: DeepPartial<TaggerForm>
+ }
+ submitTaggerForm: () => {
+ value: boolean
+ }
+ submitTaggerFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitTaggerFormRequest: (taggerForm: TaggerForm) => {
+ taggerForm: TaggerForm
+ }
+ submitTaggerFormSuccess: (taggerForm: TaggerForm) => {
+ taggerForm: TaggerForm
+ }
+ testHogTagger: () => {
+ value: true
+ }
+ testHogTaggerSuccess: (results: HogTestResult[]) => {
+ results: HogTestResult[]
+ }
+ touchTaggerFormField: (key: string) => {
+ key: string
+ }
+ updateTag: (
+ index: number,
+ field: 'description' | 'name',
+ value: string
+ ) => {
+ field: 'description' | 'name'
+ index: number
+ value: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmTaggerLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isNewTagger: (id: string) => boolean
+ runsChartQuery: (
+ id: string,
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+ ) => TrendsQuery | null
+ }
+}
+
+export type llmTaggerLogicType = MakeLogicType<
+ llmTaggerLogicValues,
+ llmTaggerLogicActions,
+ LLMTaggerLogicProps,
+ llmTaggerLogicMeta
+>
+
export const llmTaggerLogic = kea<llmTaggerLogicType>([
path(['products', 'ai_observability', 'taggers', 'llmTaggerLogic']),
props({} as LLMTaggerLogicProps),
diff --git a/products/ai_observability/frontend/tags/llmTaggersLogic.ts b/products/ai_observability/frontend/tags/llmTaggersLogic.ts
index 0b3813a28124..927f008a80b4 100644
--- a/products/ai_observability/frontend/tags/llmTaggersLogic.ts
+++ b/products/ai_observability/frontend/tags/llmTaggersLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -8,9 +8,10 @@ import { teamLogic } from 'scenes/teamLogic'
import { HogQLQuery, NodeKind, TrendsQuery } from '~/queries/schema/schema-general'
import { ChartDisplayType } from '~/types'
+import type { FeatureFlagsSet } from '../../../../frontend/src/lib/logic/featureFlagLogic'
+import type { ProductIntentProperties } from '../../../../frontend/src/lib/utils/product-intents'
import { aiObservabilitySharedLogic } from '../aiObservabilitySharedLogic'
import { llmProviderKeysLogic } from '../settings/llmProviderKeysLogic'
-import type { llmTaggersLogicType } from './llmTaggersLogicType'
import { defaultTaggerTemplates } from './templates'
import { getIntervalFromDateRange, Tagger } from './types'
@@ -30,6 +31,133 @@ export interface TaggerTagCount {
type RawStatsRow = [tagger_id: string, runs_count: number]
type RawTagCountRow = [tagger_id: string, tag_name: string, count: number]
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmTaggersLogicValues {
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ chartQuery: TrendsQuery | null
+ filteredTaggers: Tagger[]
+ hasSeededDefaults: boolean
+ runStats: TaggerRunStats[]
+ runStatsLoading: boolean
+ runStatsMap: Record<string, number>
+ tagCounts: TaggerTagCount[]
+ tagCountsLoading: boolean
+ tagDistributionMap: Record<
+ string,
+ Array<{
+ name: string
+ percent: number
+ }>
+ >
+ taggers: Tagger[]
+ taggersFilter: string
+ taggersLoading: boolean
+ totalRuns: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmTaggersLogicActions {
+ setDates: (
+ dateFrom: string | null,
+ dateTo: string | null
+ ) => {
+ dateFrom: string | null
+ dateTo: string | null
+ } // aiObservabilitySharedLogic
+ loadProviderKeys: () => any // llmProviderKeysLogic
+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic
+ loadRunStats: () => any
+ loadRunStatsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRunStatsSuccess: (
+ runStats: {
+ runs_count: number
+ tagger_id: string
+ }[],
+ payload?: any
+ ) => {
+ runStats: {
+ runs_count: number
+ tagger_id: string
+ }[]
+ payload?: any
+ }
+ loadTagCounts: () => any
+ loadTagCountsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTagCountsSuccess: (
+ tagCounts: {
+ count: number
+ tag_name: string
+ tagger_id: string
+ }[],
+ payload?: any
+ ) => {
+ tagCounts: {
+ count: number
+ tag_name: string
+ tagger_id: string
+ }[]
+ payload?: any
+ }
+ loadTaggers: () => {
+ value: true
+ }
+ loadTaggersSuccess: (taggers: Tagger[]) => {
+ taggers: Tagger[]
+ }
+ setTaggersFilter: (filter: string) => {
+ filter: string
+ }
+ toggleTaggerEnabled: (id: string) => {
+ id: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface llmTaggersLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ filteredTaggers: (taggers: Tagger[], taggersFilter: string) => Tagger[]
+ runStatsMap: (runStats: TaggerRunStats[]) => Record<string, number>
+ tagDistributionMap: (tagCounts: TaggerTagCount[]) => Record<
+ string,
+ Array<{
+ name: string
+ percent: number
+ }>
+ >
+ totalRuns: (runStats: TaggerRunStats[]) => number
+ chartQuery: (
+ taggers: Tagger[],
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+ ) => TrendsQuery | null
+ }
+}
+
+export type llmTaggersLogicType = MakeLogicType<
+ llmTaggersLogicValues,
+ llmTaggersLogicActions,
+ LLMTaggersLogicProps,
+ llmTaggersLogicMeta
+>
+
export const llmTaggersLogic = kea<llmTaggersLogicType>([
path(['products', 'ai_observability', 'taggers', 'llmTaggersLogic']),
props({} as LLMTaggersLogicProps),
diff --git a/products/ai_observability/frontend/tags/tagMetricsLogic.ts b/products/ai_observability/frontend/tags/tagMetricsLogic.ts
index 5c4e0cbfd025..39e2e9d64877 100644
--- a/products/ai_observability/frontend/tags/tagMetricsLogic.ts
+++ b/products/ai_observability/frontend/tags/tagMetricsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -7,7 +7,6 @@ import { HogQLQuery, NodeKind, TrendsQuery } from '~/queries/schema/schema-gener
import { ChartDisplayType, PropertyFilterType, PropertyOperator } from '~/types'
import { llmTaggersLogic } from './llmTaggersLogic'
-import type { tagMetricsLogicType } from './tagMetricsLogicType'
import { getIntervalFromDateRange, Tagger } from './types'
export interface TagStats {
@@ -24,6 +23,103 @@ export interface TagSummaryMetrics {
export type TagMetricsLogicProps = Record<string, never>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface tagMetricsLogicValues {
+ taggers: Tagger[] // llmTaggersLogic
+ chartQuery: TrendsQuery | null
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+ enabledTaggerCount: number
+ summaryMetrics: TagSummaryMetrics
+ tagStats: {
+ count: number
+ tag: string
+ }[]
+ tagStatsLoading: boolean
+ totalRuns: number
+ totalRunsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface tagMetricsLogicActions {
+ loadTagStats: () => any
+ loadTagStatsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTagStatsSuccess: (
+ tagStats: {
+ count: number
+ tag: string
+ }[],
+ payload?: any
+ ) => {
+ tagStats: {
+ count: number
+ tag: string
+ }[]
+ payload?: any
+ }
+ loadTotalRuns: () => any
+ loadTotalRunsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTotalRunsSuccess: (
+ totalRuns: number,
+ payload?: any
+ ) => {
+ totalRuns: number
+ payload?: any
+ }
+ setDates: (
+ dateFrom: string | null,
+ dateTo: string | null
+ ) => {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface tagMetricsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ summaryMetrics: (
+ tagStats: {
+ count: number
+ tag: string
+ }[],
+ totalRuns: number
+ ) => TagSummaryMetrics
+ enabledTaggerCount: (taggers: Tagger[]) => number
+ chartQuery: (
+ tagStats: {
+ count: number
+ tag: string
+ }[],
+ dateFilter: {
+ dateFrom: string | null
+ dateTo: string | null
+ }
+ ) => TrendsQuery | null
+ }
+}
+
+export type tagMetricsLogicType = MakeLogicType<
+ tagMetricsLogicValues,
+ tagMetricsLogicActions,
+ TagMetricsLogicProps,
+ tagMetricsLogicMeta
+>
+
export const tagMetricsLogic = kea<tagMetricsLogicType>([
path(['products', 'ai_observability', 'frontend', 'tags', 'tagMetricsLogic']),
props({} as TagMetricsLogicProps),
diff --git a/products/ai_observability/frontend/text-view/textViewLogic.ts b/products/ai_observability/frontend/text-view/textViewLogic.ts
index 3d21626f5a3d..28c86c869685 100644
--- a/products/ai_observability/frontend/text-view/textViewLogic.ts
+++ b/products/ai_observability/frontend/text-view/textViewLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -6,7 +6,6 @@ import api from 'lib/api'
import { LLMTrace, LLMTraceEvent } from '~/queries/schema/schema-general'
import { FALLBACK_DELAY_MS, TEXT_REPR_API_TIMEOUT_MS, UI_TEXT_REPR_MAX_LENGTH } from './constants'
-import type { textViewLogicType } from './textViewLogicType'
interface TraceTreeNode {
event: LLMTraceEvent
@@ -52,6 +51,64 @@ export interface TextViewLogicProps {
onFallback?: () => void
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface textViewLogicValues {
+ copied: boolean
+ expandedSegments: Set<number | string>
+ popoutSegment: number | string | null
+ textRepr: string | null
+ textReprLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface textViewLogicActions {
+ fetchTextRepr: () => any
+ fetchTextReprFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ fetchTextReprSuccess: (
+ textRepr: string | null,
+ payload?: any
+ ) => {
+ textRepr: string | null
+ payload?: any
+ }
+ resetUIState: () => {
+ value: true
+ }
+ setCopied: (copied: boolean) => {
+ copied: boolean
+ }
+ setExpandedSegments: (segments: Set<number | string>) => {
+ segments: Set<number | string>
+ }
+ setPopoutSegment: (index: number | string | null) => {
+ index: number | string | null
+ }
+ toggleSegment: (index: number | string) => {
+ index: number | string
+ }
+ triggerFallback: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface textViewLogicMeta {
+ key: string
+}
+
+export type textViewLogicType = MakeLogicType<
+ textViewLogicValues,
+ textViewLogicActions,
+ TextViewLogicProps,
+ textViewLogicMeta
+>
+
export const textViewLogic = kea<textViewLogicType>([
path(['products', 'ai_observability', 'frontend', 'text-view', 'textViewLogic']),
props({} as TextViewLogicProps),
diff --git a/products/ai_observability/frontend/traceMessagesLazyLoaderLogic.ts b/products/ai_observability/frontend/traceMessagesLazyLoaderLogic.ts
index b189a80422c0..bf5aac43bc4c 100644
--- a/products/ai_observability/frontend/traceMessagesLazyLoaderLogic.ts
+++ b/products/ai_observability/frontend/traceMessagesLazyLoaderLogic.ts
@@ -1,4 +1,4 @@
-import { actions, events, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, events, kea, listeners, path, reducers, selectors } from 'kea'
import api from 'lib/api'
import { chunk } from 'lib/utils/arrays'
@@ -6,7 +6,6 @@ import { chunk } from 'lib/utils/arrays'
import { HogQLQuery, NodeKind } from '~/queries/schema/schema-general'
import { escapeHogQLString } from '~/queries/utils'
-import type { traceMessagesLazyLoaderLogicType } from './traceMessagesLazyLoaderLogicType'
import { parsePartialJSON } from './utils'
export interface TraceMessages {
@@ -37,6 +36,49 @@ function formatHogqlDateTime(d: Date): string {
return d.toISOString().replace('T', ' ').slice(0, 19)
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface traceMessagesLazyLoaderLogicValues {
+ getTraceMessages: (traceId: string) => TraceMessages | null | undefined
+ loadingTraceIds: Set<string>
+ messagesByTraceId: Record<string, TraceMessages | null>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface traceMessagesLazyLoaderLogicActions {
+ ensureTraceMessagesLoaded: (requests: TraceLazyLoadRequest[]) => {
+ requests: TraceLazyLoadRequest[]
+ }
+ loadTraceMessagesBatchFailure: (requestedTraceIds: string[]) => {
+ requestedTraceIds: string[]
+ }
+ loadTraceMessagesBatchSuccess: (
+ results: Record<string, TraceMessages>,
+ requestedTraceIds: string[]
+ ) => {
+ requestedTraceIds: string[]
+ results: Record<string, TraceMessages>
+ }
+ markTraceIdsLoading: (traceIds: string[]) => {
+ traceIds: string[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface traceMessagesLazyLoaderLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ getTraceMessages: (
+ messagesByTraceId: Record<string, TraceMessages | null>
+ ) => (traceId: string) => TraceMessages | null | undefined
+ }
+}
+
+export type traceMessagesLazyLoaderLogicType = MakeLogicType<
+ traceMessagesLazyLoaderLogicValues,
+ traceMessagesLazyLoaderLogicActions,
+ Record<string, any>,
+ traceMessagesLazyLoaderLogicMeta
+>
+
export const traceMessagesLazyLoaderLogic = kea<traceMessagesLazyLoaderLogicType>([
path(['products', 'ai_observability', 'frontend', 'traceMessagesLazyLoaderLogic']),
@@ -109,7 +151,9 @@ export const traceMessagesLazyLoaderLogic = kea<traceMessagesLazyLoaderLogicType
selectors({
getTraceMessages: [
(s) => [s.messagesByTraceId],
- (messagesByTraceId): ((traceId: string) => TraceMessages | null | undefined) => {
+ (
+ messagesByTraceId: Record<string, TraceMessages | null>
+ ): ((traceId: string) => TraceMessages | null | undefined) => {
return (traceId: string) => messagesByTraceId[traceId]
},
],
diff --git a/products/ai_observability/frontend/traceReviews/aiObservabilityReviewsLogic.ts b/products/ai_observability/frontend/traceReviews/aiObservabilityReviewsLogic.ts
index 3ffa8fff53bc..3dd5b7cb90bb 100644
--- a/products/ai_observability/frontend/traceReviews/aiObservabilityReviewsLogic.ts
+++ b/products/ai_observability/frontend/traceReviews/aiObservabilityReviewsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, isBreakpoint, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, isBreakpoint, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router, urlToAction } from 'kea-router'
@@ -17,7 +17,6 @@ import { urls } from '~/scenes/urls'
import { llmAnalyticsScoreDefinitionsList as aiObservabilityScoreDefinitionsList } from '../generated/api'
import type { ScoreDefinitionApi } from '../generated/api.schemas'
-import type { aiObservabilityReviewsLogicType } from './aiObservabilityReviewsLogicType'
import { buildTraceReviewsListUrl, traceReviewListParamsFromFilters, traceReviewsApi } from './traceReviewsApi'
import { fetchAllReviewsForExport, formatReviewsForClipboard, type ReviewClipboardFormat } from './traceReviewsExport'
import type { TraceReview } from './types'
@@ -71,6 +70,98 @@ function getUrlFilters(filters: TraceReviewFilters): Record<string, unknown> {
export type AIObservabilityReviewsLogicProps = Record<string, never>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityReviewsLogicValues {
+ count: number
+ exportPath: string
+ filters: TraceReviewFilters
+ pagination: PaginationManual
+ rawFilters: Partial<TraceReviewFilters> | null
+ reviewCountLabel: string
+ reviews: CountedPaginatedResponse<TraceReview>
+ reviewsLoading: boolean
+ scoreDefinitionOptions: ScoreDefinitionApi[]
+ scoreDefinitionOptionsLoading: boolean
+ sorting: Sorting | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityReviewsLogicActions {
+ copyReviewsToClipboard: (format: ReviewClipboardFormat) => {
+ format: ReviewClipboardFormat
+ }
+ loadReviews: (debounce?: boolean) => {
+ debounce: boolean
+ }
+ loadReviewsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadReviewsSuccess: (
+ reviews: CountedPaginatedResponse<TraceReview>,
+ payload?: {
+ debounce: boolean
+ }
+ ) => {
+ reviews: CountedPaginatedResponse<TraceReview>
+ payload?: {
+ debounce: boolean
+ }
+ }
+ loadScoreDefinitionOptions: () => {
+ value: true
+ }
+ loadScoreDefinitionOptionsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadScoreDefinitionOptionsSuccess: (
+ scoreDefinitionOptions: ScoreDefinitionApi[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ scoreDefinitionOptions: ScoreDefinitionApi[]
+ payload?: {
+ value: true
+ }
+ }
+ setFilters: (
+ filters: Partial<TraceReviewFilters>,
+ merge?: boolean,
+ debounce?: boolean
+ ) => {
+ debounce: boolean
+ filters: Partial<TraceReviewFilters>
+ merge: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiObservabilityReviewsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ filters: (rawFilters: Partial<TraceReviewFilters> | null) => TraceReviewFilters
+ count: (reviews: CountedPaginatedResponse<TraceReview>) => number
+ sorting: (filters: TraceReviewFilters) => Sorting | null
+ pagination: (filters: TraceReviewFilters, count: number) => PaginationManual
+ reviewCountLabel: (filters: TraceReviewFilters, count: number) => string
+ exportPath: (filters: TraceReviewFilters) => string
+ }
+}
+
+export type aiObservabilityReviewsLogicType = MakeLogicType<
+ aiObservabilityReviewsLogicValues,
+ aiObservabilityReviewsLogicActions,
+ AIObservabilityReviewsLogicProps,
+ aiObservabilityReviewsLogicMeta
+>
+
export const aiObservabilityReviewsLogic = kea<aiObservabilityReviewsLogicType>([
path(['products', 'ai_observability', 'frontend', 'traceReviews', 'aiObservabilityReviewsLogic']),
props({} as AIObservabilityReviewsLogicProps),
diff --git a/products/ai_observability/frontend/traceReviews/traceReviewModalLogic.ts b/products/ai_observability/frontend/traceReviews/traceReviewModalLogic.ts
index 0a29f0a3a267..2595b00fabcf 100644
--- a/products/ai_observability/frontend/traceReviews/traceReviewModalLogic.ts
+++ b/products/ai_observability/frontend/traceReviews/traceReviewModalLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { teamLogic } from 'scenes/teamLogic'
@@ -7,7 +7,6 @@ import { ApiConfig } from '~/lib/api'
import { llmAnalyticsScoreDefinitionsList as aiObservabilityScoreDefinitionsList } from '../generated/api'
import type { ScoreDefinitionApi } from '../generated/api.schemas'
-import type { traceReviewModalLogicType } from './traceReviewModalLogicType'
import { traceReviewsApi } from './traceReviewsApi'
import { traceReviewsLazyLoaderLogic } from './traceReviewsLazyLoaderLogic'
import type {
@@ -156,6 +155,167 @@ function mergeDefinitions(
return mergedDefinitions
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface traceReviewModalLogicValues {
+ currentTeamId: number | null // teamLogic
+ canSave: boolean
+ comment: string
+ currentReview: TraceReview | null
+ definitionOptionsLoading: boolean
+ definitionResultsLabel: string | null
+ definitionSearch: string
+ hasMoreDefinitions: boolean
+ isBusy: boolean
+ isFormValid: boolean
+ isOpen: boolean
+ loadedDefinitions: ScoreDefinitionApi[]
+ modalDataLoading: boolean
+ removing: boolean
+ saving: boolean
+ scoreValues: Record<string, TraceReviewFormScoreValue>
+ selectableDefinitions: ScoreDefinitionApi[]
+ selectedDefinitionIds: string[]
+ selectedDefinitionSnapshots: Record<string, ScoreDefinitionApi>
+ selectedDefinitions: ScoreDefinitionApi[]
+ submitPayload: TraceReviewUpsertPayload
+ totalDefinitionCount: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface traceReviewModalLogicActions {
+ cacheTraceReview: (review: TraceReview) => {
+ review: TraceReview
+ } // traceReviewsLazyLoaderLogic
+ setTraceAsUnreviewed: (traceId: string) => {
+ traceId: string
+ } // traceReviewsLazyLoaderLogic
+ closeModal: () => {
+ value: true
+ }
+ loadDefinitionOptions: (replace?: boolean) => {
+ replace: boolean
+ }
+ loadDefinitionOptionsFailure: () => {
+ value: true
+ }
+ loadDefinitionOptionsSuccess: (
+ definitions: ScoreDefinitionApi[],
+ totalCount: number,
+ replace: boolean
+ ) => {
+ definitions: ScoreDefinitionApi[]
+ replace: boolean
+ totalCount: number
+ }
+ loadModalData: () => {
+ value: true
+ }
+ loadModalDataFailure: () => {
+ value: true
+ }
+ loadModalDataSuccess: (
+ review: TraceReview | null,
+ definitions: ScoreDefinitionApi[],
+ totalCount: number
+ ) => {
+ definitions: ScoreDefinitionApi[]
+ review: TraceReview | null
+ totalCount: number
+ }
+ loadMoreDefinitions: () => {
+ value: true
+ }
+ openModal: () => {
+ value: true
+ }
+ populateForm: (review: TraceReview | null) => {
+ review: TraceReview | null
+ }
+ removeCurrentReview: () => {
+ value: true
+ }
+ removeCurrentReviewFailure: () => {
+ value: true
+ }
+ removeCurrentReviewSuccess: () => {
+ value: true
+ }
+ removeSelectedDefinition: (definitionId: string) => {
+ definitionId: string
+ }
+ resetForm: () => {
+ value: true
+ }
+ saveCurrentReview: () => {
+ value: true
+ }
+ saveCurrentReviewFailure: () => {
+ value: true
+ }
+ saveCurrentReviewSuccess: (review: TraceReview) => {
+ review: TraceReview
+ }
+ selectDefinition: (definition: ScoreDefinitionApi) => {
+ definition: ScoreDefinitionApi
+ }
+ setComment: (comment: string) => {
+ comment: string
+ }
+ setDefinitionSearch: (search: string) => {
+ search: string
+ }
+ setScoreValue: (
+ definitionId: string,
+ value: TraceReviewFormScoreValue
+ ) => {
+ definitionId: string
+ value: TraceReviewFormScoreValue
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface traceReviewModalLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ selectedDefinitions: (
+ loadedDefinitions: ScoreDefinitionApi[],
+ selectedDefinitionSnapshots: Record<string, ScoreDefinitionApi>,
+ selectedDefinitionIds: string[]
+ ) => ScoreDefinitionApi[]
+ selectableDefinitions: (
+ loadedDefinitions: ScoreDefinitionApi[],
+ selectedDefinitionIds: string[]
+ ) => ScoreDefinitionApi[]
+ hasMoreDefinitions: (loadedDefinitions: ScoreDefinitionApi[], totalDefinitionCount: number) => boolean
+ definitionResultsLabel: (
+ loadedDefinitions: ScoreDefinitionApi[],
+ totalDefinitionCount: number,
+ definitionSearch: string
+ ) => string | null
+ isFormValid: (
+ selectedDefinitions: ScoreDefinitionApi[],
+ scoreValues: Record<string, TraceReviewFormScoreValue>
+ ) => boolean
+ isBusy: (modalDataLoading: boolean, saving: boolean, removing: boolean) => boolean
+ canSave: (isFormValid: boolean, isBusy: boolean) => boolean
+ submitPayload: (
+ selectedDefinitions: ScoreDefinitionApi[],
+ scoreValues: Record<string, TraceReviewFormScoreValue>,
+ comment: string,
+ currentReview: TraceReview | null,
+ arg: any,
+ arg2: any
+ ) => TraceReviewUpsertPayload
+ }
+}
+
+export type traceReviewModalLogicType = MakeLogicType<
+ traceReviewModalLogicValues,
+ traceReviewModalLogicActions,
+ TraceReviewModalLogicProps,
+ traceReviewModalLogicMeta
+>
+
export const traceReviewModalLogic = kea<traceReviewModalLogicType>([
path(['products', 'ai_observability', 'frontend', 'traceReviews', 'traceReviewModalLogic']),
props({} as TraceReviewModalLogicProps),
@@ -369,7 +529,11 @@ export const traceReviewModalLogic = kea<traceReviewModalLogicType>([
selectors({
selectedDefinitions: [
(s) => [s.loadedDefinitions, s.selectedDefinitionSnapshots, s.selectedDefinitionIds],
- (loadedDefinitions, selectedDefinitionSnapshots, selectedDefinitionIds): ScoreDefinitionApi[] => {
+ (
+ loadedDefinitions: ScoreDefinitionApi[],
+ selectedDefinitionSnapshots: Record<string, ScoreDefinitionApi>,
+ selectedDefinitionIds: string[]
+ ): ScoreDefinitionApi[] => {
const loadedDefinitionsById = new Map(
loadedDefinitions.map((definition) => [definition.id, definition])
)
@@ -385,18 +549,23 @@ export const traceReviewModalLogic = kea<traceReviewModalLogicType>([
selectableDefinitions: [
(s) => [s.loadedDefinitions, s.selectedDefinitionIds],
- (loadedDefinitions, selectedDefinitionIds): ScoreDefinitionApi[] =>
+ (loadedDefinitions: ScoreDefinitionApi[], selectedDefinitionIds: string[]): ScoreDefinitionApi[] =>
loadedDefinitions.filter((definition) => !selectedDefinitionIds.includes(definition.id)),
],
hasMoreDefinitions: [
(s) => [s.loadedDefinitions, s.totalDefinitionCount],
- (loadedDefinitions, totalDefinitionCount): boolean => loadedDefinitions.length < totalDefinitionCount,
+ (loadedDefinitions: ScoreDefinitionApi[], totalDefinitionCount: number): boolean =>
+ loadedDefinitions.length < totalDefinitionCount,
],
definitionResultsLabel: [
(s) => [s.loadedDefinitions, s.totalDefinitionCount, s.definitionSearch],
- (loadedDefinitions, totalDefinitionCount, definitionSearch): string | null => {
+ (
+ loadedDefinitions: ScoreDefinitionApi[],
+ totalDefinitionCount: number,
+ definitionSearch: string
+ ): string | null => {
if (totalDefinitionCount === 0) {
return null
}
@@ -411,7 +580,10 @@ export const traceReviewModalLogic = kea<traceReviewModalLogicType>([
isFormValid: [
(s) => [s.selectedDefinitions, s.scoreValues],
- (selectedDefinitions, scoreValues): boolean =>
+ (
+ selectedDefinitions: ScoreDefinitionApi[],
+ scoreValues: Record<string, TraceReviewFormScoreValue>
+ ): boolean =>
selectedDefinitions.every((definition) => {
const value = scoreValues[definition.id]
@@ -433,10 +605,14 @@ export const traceReviewModalLogic = kea<traceReviewModalLogicType>([
isBusy: [
(s) => [s.modalDataLoading, s.saving, s.removing],
- (modalDataLoading, saving, removing): boolean => modalDataLoading || saving || removing,
+ (modalDataLoading: boolean, saving: boolean, removing: boolean): boolean =>
+ modalDataLoading || saving || removing,
],
- canSave: [(s) => [s.isFormValid, s.isBusy], (isFormValid, isBusy): boolean => isFormValid && !isBusy],
+ canSave: [
+ (s) => [s.isFormValid, s.isBusy],
+ (isFormValid: boolean, isBusy: boolean): boolean => isFormValid && !isBusy,
+ ],
submitPayload: [
(s) => [
@@ -447,7 +623,14 @@ export const traceReviewModalLogic = kea<traceReviewModalLogicType>([
(_, props) => props.traceId,
(_, props) => props.queueId,
],
- (selectedDefinitions, scoreValues, comment, currentReview, traceId, queueId): TraceReviewUpsertPayload => {
+ (
+ selectedDefinitions: ScoreDefinitionApi[],
+ scoreValues: Record<string, TraceReviewFormScoreValue>,
+ comment: string,
+ currentReview: TraceReview | null,
+ traceId,
+ queueId
+ ): TraceReviewUpsertPayload => {
const existingScoresByDefinitionId = getExistingScoreLookup(currentReview)
return {
diff --git a/products/ai_observability/frontend/traceReviews/traceReviewsLazyLoaderLogic.ts b/products/ai_observability/frontend/traceReviews/traceReviewsLazyLoaderLogic.ts
index 5c832c043d26..26a377eb54e0 100644
--- a/products/ai_observability/frontend/traceReviews/traceReviewsLazyLoaderLogic.ts
+++ b/products/ai_observability/frontend/traceReviews/traceReviewsLazyLoaderLogic.ts
@@ -1,14 +1,68 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { chunk } from 'lib/utils/arrays'
import { teamLogic } from 'scenes/teamLogic'
import { traceReviewsApi } from './traceReviewsApi'
-import type { traceReviewsLazyLoaderLogicType } from './traceReviewsLazyLoaderLogicType'
import type { TraceReview } from './types'
const BATCH_MAX_SIZE = 100
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface traceReviewsLazyLoaderLogicValues {
+ currentTeamId: number | null // teamLogic
+ didTraceReviewLoadFail: (traceId: string) => boolean
+ failedTraceIds: Set<string>
+ getTraceReview: (traceId: string) => TraceReview | null | undefined
+ isTraceLoading: (traceId: string) => boolean
+ loadingTraceIds: Set<string>
+ reviewsByTraceId: Record<string, TraceReview | null>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface traceReviewsLazyLoaderLogicActions {
+ ensureReviewsLoaded: (traceIds: string[]) => {
+ traceIds: string[]
+ }
+ loadReviewsBatchFailure: (requestedTraceIds: string[]) => {
+ requestedTraceIds: string[]
+ }
+ loadReviewsBatchSuccess: (
+ results: Record<string, TraceReview | null>,
+ requestedTraceIds: string[]
+ ) => {
+ requestedTraceIds: string[]
+ results: Record<string, TraceReview | null>
+ }
+ markTraceIdsLoading: (traceIds: string[]) => {
+ traceIds: string[]
+ }
+ setTraceAsUnreviewed: (traceId: string) => {
+ traceId: string
+ }
+ setTraceReview: (review: TraceReview) => {
+ review: TraceReview
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface traceReviewsLazyLoaderLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ isTraceLoading: (loadingTraceIds: Set<string>) => (traceId: string) => boolean
+ getTraceReview: (
+ reviewsByTraceId: Record<string, TraceReview | null>
+ ) => (traceId: string) => TraceReview | null | undefined
+ didTraceReviewLoadFail: (failedTraceIds: Set<string>) => (traceId: string) => boolean
+ }
+}
+
+export type traceReviewsLazyLoaderLogicType = MakeLogicType<
+ traceReviewsLazyLoaderLogicValues,
+ traceReviewsLazyLoaderLogicActions,
+ Record<string, any>,
+ traceReviewsLazyLoaderLogicMeta
+>
+
export const traceReviewsLazyLoaderLogic = kea<traceReviewsLazyLoaderLogicType>([
path(['products', 'ai_observability', 'frontend', 'traceReviews', 'traceReviewsLazyLoaderLogic']),
@@ -144,19 +198,21 @@ export const traceReviewsLazyLoaderLogic = kea<traceReviewsLazyLoaderLogicType>(
selectors({
isTraceLoading: [
(s) => [s.loadingTraceIds],
- (loadingTraceIds): ((traceId: string) => boolean) => {
+ (loadingTraceIds: Set<string>): ((traceId: string) => boolean) => {
return (traceId: string) => loadingTraceIds.has(traceId)
},
],
getTraceReview: [
(s) => [s.reviewsByTraceId],
- (reviewsByTraceId): ((traceId: string) => TraceReview | null | undefined) => {
+ (
+ reviewsByTraceId: Record<string, TraceReview | null>
+ ): ((traceId: string) => TraceReview | null | undefined) => {
return (traceId: string) => reviewsByTraceId[traceId]
},
],
didTraceReviewLoadFail: [
(s) => [s.failedTraceIds],
- (failedTraceIds): ((traceId: string) => boolean) => {
+ (failedTraceIds: Set<string>): ((traceId: string) => boolean) => {
return (traceId: string) => failedTraceIds.has(traceId)
},
],
diff --git a/products/business_knowledge/frontend/scenes/businessKnowledgeLogic.ts b/products/business_knowledge/frontend/scenes/businessKnowledgeLogic.ts
index a0dc0f5dca63..1a495d28df62 100644
--- a/products/business_knowledge/frontend/scenes/businessKnowledgeLogic.ts
+++ b/products/business_knowledge/frontend/scenes/businessKnowledgeLogic.ts
@@ -1,5 +1,6 @@
-import { actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
@@ -22,7 +23,6 @@ import {
businessKnowledgeGapSuggestionsList,
} from '../generated/api'
import type { KnowledgeSourceApi } from '../generated/api.schemas'
-import type { businessKnowledgeLogicType } from './businessKnowledgeLogicType'
export interface AggregatedGap {
normalized_topic: string
@@ -110,6 +110,449 @@ function splitGlobs(raw: string): string[] {
.filter(Boolean)
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface businessKnowledgeLogicValues {
+ acceptingGapTopic: string | null
+ createTab: CreateTab
+ editSource: TextSourceFormValues
+ editSourceAllErrors: Record<string, any>
+ editSourceChanged: boolean
+ editSourceErrors: DeepPartialMap<TextSourceFormValues, ValidationErrorType>
+ editSourceHasErrors: boolean
+ editSourceManualErrors: Record<string, any>
+ editSourceTouched: boolean
+ editSourceTouches: Record<string, boolean>
+ editSourceValidationErrors: DeepPartialMap<TextSourceFormValues, ValidationErrorType>
+ editUrlSource: UrlSourceFormValues
+ editUrlSourceAllErrors: Record<string, any>
+ editUrlSourceChanged: boolean
+ editUrlSourceErrors: DeepPartialMap<UrlSourceFormValues, ValidationErrorType>
+ editUrlSourceHasErrors: boolean
+ editUrlSourceManualErrors: Record<string, any>
+ editUrlSourceTouched: boolean
+ editUrlSourceTouches: Record<string, boolean>
+ editUrlSourceValidationErrors: DeepPartialMap<UrlSourceFormValues, ValidationErrorType>
+ editingSource: KnowledgeSource | null
+ editingSourceText: {
+ id: string
+ text: string
+ }
+ editingSourceTextLoading: boolean
+ fileSource: FileSourceFormValues
+ fileSourceAllErrors: Record<string, any>
+ fileSourceChanged: boolean
+ fileSourceErrors: DeepPartialMap<FileSourceFormValues, ValidationErrorType>
+ fileSourceHasErrors: boolean
+ fileSourceManualErrors: Record<string, any>
+ fileSourceTouched: boolean
+ fileSourceTouches: Record<string, boolean>
+ fileSourceValidationErrors: DeepPartialMap<FileSourceFormValues, ValidationErrorType>
+ gapSuggestions: AggregatedGap[]
+ gapSuggestionsLoading: boolean
+ isCreateModalOpen: boolean
+ isEditModalOpen: boolean
+ isEditSourceSubmitting: boolean
+ isEditSourceValid: boolean
+ isEditUrlSourceSubmitting: boolean
+ isEditUrlSourceValid: boolean
+ isFileSourceSubmitting: boolean
+ isFileSourceValid: boolean
+ isTextSourceSubmitting: boolean
+ isTextSourceValid: boolean
+ isUrlSourceSubmitting: boolean
+ isUrlSourceValid: boolean
+ readyCount: number
+ refreshingIds: string[]
+ showEditSourceErrors: boolean
+ showEditUrlSourceErrors: boolean
+ showFileSourceErrors: boolean
+ showTextSourceErrors: boolean
+ showUrlSourceErrors: boolean
+ sources: KnowledgeSource[]
+ sourcesLoading: boolean
+ textSource: TextSourceFormValues
+ textSourceAllErrors: Record<string, any>
+ textSourceChanged: boolean
+ textSourceErrors: DeepPartialMap<TextSourceFormValues, ValidationErrorType>
+ textSourceHasErrors: boolean
+ textSourceManualErrors: Record<string, any>
+ textSourceTouched: boolean
+ textSourceTouches: Record<string, boolean>
+ textSourceValidationErrors: DeepPartialMap<TextSourceFormValues, ValidationErrorType>
+ totalChunks: number
+ urlSource: UrlSourceFormValues
+ urlSourceAllErrors: Record<string, any>
+ urlSourceChanged: boolean
+ urlSourceErrors: DeepPartialMap<UrlSourceFormValues, ValidationErrorType>
+ urlSourceHasErrors: boolean
+ urlSourceManualErrors: Record<string, any>
+ urlSourceTouched: boolean
+ urlSourceTouches: Record<string, boolean>
+ urlSourceValidationErrors: DeepPartialMap<UrlSourceFormValues, ValidationErrorType>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface businessKnowledgeLogicActions {
+ acceptGapSuggestion: (
+ normalizedTopic: string,
+ topic: string
+ ) => {
+ normalizedTopic: string
+ topic: string
+ }
+ closeCreateModal: () => {
+ value: true
+ }
+ closeEditModal: () => {
+ value: true
+ }
+ confirmGapAccept: (
+ normalizedTopic: string,
+ sourceId: string
+ ) => {
+ normalizedTopic: string
+ sourceId: string
+ }
+ deleteSource: (id: string) => {
+ id: string
+ }
+ dismissGapSuggestion: (normalizedTopic: string) => {
+ normalizedTopic: string
+ }
+ loadEditingSourceText: ({ id }: { id: string }) => {
+ id: string
+ }
+ loadEditingSourceTextFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadEditingSourceTextSuccess: (
+ editingSourceText: {
+ id: string
+ text: string
+ },
+ payload?: {
+ id: string
+ }
+ ) => {
+ editingSourceText: {
+ id: string
+ text: string
+ }
+ payload?: {
+ id: string
+ }
+ }
+ loadGapSuggestions: () => {
+ value: true
+ }
+ loadGapSuggestionsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadGapSuggestionsSuccess: (
+ gapSuggestions: AggregatedGap[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ gapSuggestions: AggregatedGap[]
+ payload?: {
+ value: true
+ }
+ }
+ loadSources: () => any
+ loadSourcesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSourcesSuccess: (
+ sources: KnowledgeSourceApi[],
+ payload?: any
+ ) => {
+ sources: KnowledgeSourceApi[]
+ payload?: any
+ }
+ openCreateModal: (prefillName?: string) => {
+ prefillName: string | undefined
+ }
+ openEditModal: (source: KnowledgeSource) => {
+ source: KnowledgeSourceApi
+ }
+ refreshSource: (id: string) => {
+ id: string
+ }
+ refreshSourceDone: (id: string) => {
+ id: string
+ }
+ removeSourceFromList: ({ id }: { id: string }) => {
+ id: string
+ }
+ removeSourceFromListFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ removeSourceFromListSuccess: (
+ sources: KnowledgeSourceApi[],
+ payload?: {
+ id: string
+ }
+ ) => {
+ sources: KnowledgeSourceApi[]
+ payload?: {
+ id: string
+ }
+ }
+ replaceSourceInList: ({ source }: { source: KnowledgeSource }) => {
+ source: KnowledgeSource
+ }
+ replaceSourceInListFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ replaceSourceInListSuccess: (
+ sources: KnowledgeSourceApi[],
+ payload?: {
+ source: KnowledgeSource
+ }
+ ) => {
+ sources: KnowledgeSourceApi[]
+ payload?: {
+ source: KnowledgeSource
+ }
+ }
+ resetEditSource: (values?: TextSourceFormValues) => {
+ values?: TextSourceFormValues
+ }
+ resetEditUrlSource: (values?: UrlSourceFormValues) => {
+ values?: UrlSourceFormValues
+ }
+ resetEditingSourceText: () => any
+ resetEditingSourceTextFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ resetEditingSourceTextSuccess: (
+ editingSourceText: {
+ id: string
+ text: string
+ },
+ payload?: any
+ ) => {
+ editingSourceText: {
+ id: string
+ text: string
+ }
+ payload?: any
+ }
+ resetFileSource: (values?: FileSourceFormValues) => {
+ values?: FileSourceFormValues
+ }
+ resetTextSource: (values?: TextSourceFormValues) => {
+ values?: TextSourceFormValues
+ }
+ resetUrlSource: (values?: UrlSourceFormValues) => {
+ values?: UrlSourceFormValues
+ }
+ setCreateTab: (tab: CreateTab) => {
+ tab: CreateTab
+ }
+ setEditSourceManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setEditSourceValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setEditSourceValues: (values: DeepPartial<TextSourceFormValues>) => {
+ values: DeepPartial<TextSourceFormValues>
+ }
+ setEditUrlSourceManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setEditUrlSourceValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setEditUrlSourceValues: (values: DeepPartial<UrlSourceFormValues>) => {
+ values: DeepPartial<UrlSourceFormValues>
+ }
+ setFileSourceManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setFileSourceValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setFileSourceValues: (values: DeepPartial<FileSourceFormValues>) => {
+ values: DeepPartial<FileSourceFormValues>
+ }
+ setTextSourceManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setTextSourceValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setTextSourceValues: (values: DeepPartial<TextSourceFormValues>) => {
+ values: DeepPartial<TextSourceFormValues>
+ }
+ setUrlSourceManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setUrlSourceValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setUrlSourceValues: (values: DeepPartial<UrlSourceFormValues>) => {
+ values: DeepPartial<UrlSourceFormValues>
+ }
+ submitEditSource: () => {
+ value: boolean
+ }
+ submitEditSourceFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitEditSourceRequest: (editSource: TextSourceFormValues) => {
+ editSource: TextSourceFormValues
+ }
+ submitEditSourceSuccess: (editSource: TextSourceFormValues) => {
+ editSource: TextSourceFormValues
+ }
+ submitEditUrlSource: () => {
+ value: boolean
+ }
+ submitEditUrlSourceFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitEditUrlSourceRequest: (editUrlSource: UrlSourceFormValues) => {
+ editUrlSource: UrlSourceFormValues
+ }
+ submitEditUrlSourceSuccess: (editUrlSource: UrlSourceFormValues) => {
+ editUrlSource: UrlSourceFormValues
+ }
+ submitFileSource: () => {
+ value: boolean
+ }
+ submitFileSourceFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitFileSourceRequest: (fileSource: FileSourceFormValues) => {
+ fileSource: FileSourceFormValues
+ }
+ submitFileSourceSuccess: (fileSource: FileSourceFormValues) => {
+ fileSource: FileSourceFormValues
+ }
+ submitTextSource: () => {
+ value: boolean
+ }
+ submitTextSourceFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitTextSourceRequest: (textSource: TextSourceFormValues) => {
+ textSource: TextSourceFormValues
+ }
+ submitTextSourceSuccess: (textSource: TextSourceFormValues) => {
+ textSource: TextSourceFormValues
+ }
+ submitUrlSource: () => {
+ value: boolean
+ }
+ submitUrlSourceFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitUrlSourceRequest: (urlSource: UrlSourceFormValues) => {
+ urlSource: UrlSourceFormValues
+ }
+ submitUrlSourceSuccess: (urlSource: UrlSourceFormValues) => {
+ urlSource: UrlSourceFormValues
+ }
+ touchEditSourceField: (key: string) => {
+ key: string
+ }
+ touchEditUrlSourceField: (key: string) => {
+ key: string
+ }
+ touchFileSourceField: (key: string) => {
+ key: string
+ }
+ touchTextSourceField: (key: string) => {
+ key: string
+ }
+ touchUrlSourceField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface businessKnowledgeLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ readyCount: (sources: KnowledgeSourceApi[]) => number
+ totalChunks: (sources: KnowledgeSourceApi[]) => number
+ isEditModalOpen: (editingSource: KnowledgeSourceApi | null) => boolean
+ }
+}
+
+export type businessKnowledgeLogicType = MakeLogicType<
+ businessKnowledgeLogicValues,
+ businessKnowledgeLogicActions,
+ Record<string, any>,
+ businessKnowledgeLogicMeta
+>
+
export const businessKnowledgeLogic = kea<businessKnowledgeLogicType>([
path(['products', 'business_knowledge', 'businessKnowledgeLogic']),
actions({
diff --git a/products/growth/frontend/identityMatchingLogic.ts b/products/growth/frontend/identityMatchingLogic.ts
index 0dac9048aa16..9e238c80be64 100644
--- a/products/growth/frontend/identityMatchingLogic.ts
+++ b/products/growth/frontend/identityMatchingLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { teamLogic } from 'scenes/teamLogic'
@@ -15,7 +15,6 @@ import type {
IdentityMatchingRunApi,
IdentityMatchingRunsResponseApi,
} from './generated/api.schemas'
-import type { identityMatchingLogicType } from './identityMatchingLogicType'
export interface IdentityMatchingFilters {
jobId: string | null
@@ -37,6 +36,82 @@ export const LINKS_PAGE_SIZE = 50
export type IdentityMatchingTab = 'links' | 'paid_attribution' | 'runs'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface identityMatchingLogicValues {
+ activeTab: IdentityMatchingTab
+ breadcrumbs: Breadcrumb[]
+ filters: IdentityMatchingFilters
+ links: IdentityMatchingLinkApi[]
+ linksCount: number
+ linksResponse: IdentityMatchingLinksResponseApi | null
+ linksResponseLoading: boolean
+ modelVersions: string[]
+ page: number
+ runs: IdentityMatchingRunApi[]
+ runsResponse: IdentityMatchingRunsResponseApi | null
+ runsResponseLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface identityMatchingLogicActions {
+ loadLinks: (_: unknown) => unknown
+ loadLinksFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadLinksSuccess: (
+ linksResponse: IdentityMatchingLinksResponseApi | null,
+ payload?: unknown
+ ) => {
+ linksResponse: IdentityMatchingLinksResponseApi | null
+ payload?: unknown
+ }
+ loadRuns: () => any
+ loadRunsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRunsSuccess: (
+ runsResponse: IdentityMatchingRunsResponseApi,
+ payload?: any
+ ) => {
+ runsResponse: IdentityMatchingRunsResponseApi
+ payload?: any
+ }
+ setActiveTab: (tab: IdentityMatchingTab) => {
+ tab: IdentityMatchingTab
+ }
+ setFilters: (filters: Partial<IdentityMatchingFilters>) => {
+ filters: Partial<IdentityMatchingFilters>
+ }
+ setPage: (page: number) => {
+ page: number
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface identityMatchingLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ links: (linksResponse: IdentityMatchingLinksResponseApi | null) => IdentityMatchingLinkApi[]
+ linksCount: (linksResponse: IdentityMatchingLinksResponseApi | null) => number
+ runs: (runsResponse: IdentityMatchingRunsResponseApi | null) => IdentityMatchingRunApi[]
+ modelVersions: (runs: IdentityMatchingRunApi[]) => string[]
+ }
+}
+
+export type identityMatchingLogicType = MakeLogicType<
+ identityMatchingLogicValues,
+ identityMatchingLogicActions,
+ Record<string, any>,
+ identityMatchingLogicMeta
+>
+
export const identityMatchingLogic = kea<identityMatchingLogicType>([
path(['products', 'growth', 'frontend', 'identityMatchingLogic']),
actions({
@@ -107,12 +182,23 @@ export const identityMatchingLogic = kea<identityMatchingLogicType>([
],
}),
selectors({
- links: [(s) => [s.linksResponse], (linksResponse): IdentityMatchingLinkApi[] => linksResponse?.results ?? []],
- linksCount: [(s) => [s.linksResponse], (linksResponse): number => linksResponse?.count ?? 0],
- runs: [(s) => [s.runsResponse], (runsResponse): IdentityMatchingRunApi[] => runsResponse?.results ?? []],
+ links: [
+ (s) => [s.linksResponse],
+ (linksResponse: IdentityMatchingLinksResponseApi | null): IdentityMatchingLinkApi[] =>
+ linksResponse?.results ?? [],
+ ],
+ linksCount: [
+ (s) => [s.linksResponse],
+ (linksResponse: IdentityMatchingLinksResponseApi | null): number => linksResponse?.count ?? 0,
+ ],
+ runs: [
+ (s) => [s.runsResponse],
+ (runsResponse: IdentityMatchingRunsResponseApi | null): IdentityMatchingRunApi[] =>
+ runsResponse?.results ?? [],
+ ],
modelVersions: [
(s) => [s.runs],
- (runs): string[] => {
+ (runs: IdentityMatchingRunApi[]): string[] => {
const versions = new Set<string>()
for (const run of runs) {
for (const model of run.models) {
diff --git a/products/links/frontend/linkLogic.ts b/products/links/frontend/linkLogic.ts
index 0acb53bb19bb..46ebb5a23948 100644
--- a/products/links/frontend/linkLogic.ts
+++ b/products/links/frontend/linkLogic.ts
@@ -1,5 +1,6 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import { router, urlToAction } from 'kea-router'
@@ -13,7 +14,6 @@ import { deleteFromTree } from '~/layout/panel-layout/ProjectTree/projectTreeLog
import type { LinkType } from '~/types'
import { Breadcrumb, ProjectTreeRef } from '~/types'
-import type { linkLogicType } from './linkLogicType'
import { linksLogic } from './linksLogic'
export type AvailableDomain = 'phog.gg' | 'postho.gg' | 'hog.gg' | 'custom'
@@ -45,6 +45,128 @@ export interface LinkLogicProps {
id: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linkLogicValues {
+ links: LinkType[] // linksLogic
+ currentTeamId: number | null // teamLogic
+ breadcrumbs: Breadcrumb[]
+ isEditingLink: boolean
+ isLinkSubmitting: boolean
+ isLinkValid: boolean
+ link: LinkType
+ linkAllErrors: Record<string, any>
+ linkChanged: boolean
+ linkErrors: DeepPartialMap<LinkType, ValidationErrorType>
+ linkHasErrors: boolean
+ linkLoading: boolean
+ linkManualErrors: Record<string, any>
+ linkMissing: boolean
+ linkTouched: boolean
+ linkTouches: Record<string, boolean>
+ linkValidationErrors: DeepPartialMap<LinkType, ValidationErrorType>
+ mode: 'edit' | 'view'
+ projectTreeRef: ProjectTreeRef
+ showLinkErrors: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linkLogicActions {
+ loadLinks: () => any // linksLogic
+ loadLinksSuccess: (
+ links: LinkType[],
+ payload?: any
+ ) => {
+ links: LinkType[]
+ payload?: any
+ } // linksLogic
+ deleteLink: (linkId: LinkType['id']) => {
+ linkId: string
+ }
+ editLink: (editing: boolean) => {
+ editing: boolean
+ }
+ loadLink: () => any
+ loadLinkFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadLinkSuccess: (
+ link: LinkType,
+ payload?: any
+ ) => {
+ link: LinkType
+ payload?: any
+ }
+ resetLink: (values?: LinkType) => {
+ values?: LinkType
+ }
+ saveLink: (updatedLink: Partial<LinkType>) => Partial<LinkType>
+ saveLinkFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ saveLinkSuccess: (
+ link: LinkType,
+ payload?: Partial<LinkType>
+ ) => {
+ link: LinkType
+ payload?: Partial<LinkType>
+ }
+ setLinkManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setLinkMissing: () => {
+ value: true
+ }
+ setLinkValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setLinkValues: (values: DeepPartial<LinkType>) => {
+ values: DeepPartial<LinkType>
+ }
+ submitLink: () => {
+ value: boolean
+ }
+ submitLinkFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitLinkRequest: (link: LinkType) => {
+ link: LinkType
+ }
+ submitLinkSuccess: (link: LinkType) => {
+ link: LinkType
+ }
+ touchLinkField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linkLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ mode: (id: string) => 'edit' | 'view'
+ breadcrumbs: (link: LinkType) => Breadcrumb[]
+ projectTreeRef: (arg: string) => ProjectTreeRef
+ }
+}
+
+export type linkLogicType = MakeLogicType<linkLogicValues, linkLogicActions, LinkLogicProps, linkLogicMeta>
+
export const linkLogic = kea<linkLogicType>([
path(['products', 'links', 'frontend', 'linkLogic']),
props({} as LinkLogicProps),
@@ -106,7 +228,7 @@ export const linkLogic = kea<linkLogicType>([
isEditingLink: [false, { editLink: (_, { editing }) => editing }],
}),
selectors({
- mode: [(_, p) => [p.id], (id): 'view' | 'edit' => (id === 'new' ? 'edit' : 'view')],
+ mode: [(_, p) => [p.id], (id: string): 'view' | 'edit' => (id === 'new' ? 'edit' : 'view')],
breadcrumbs: [
(s) => [s.link],
(link: LinkType): Breadcrumb[] => [
@@ -125,7 +247,7 @@ export const linkLogic = kea<linkLogicType>([
],
projectTreeRef: [
() => [(_, props: LinkLogicProps) => props.id],
- (id): ProjectTreeRef => ({ type: 'link', ref: id === 'new' ? null : String(id) }),
+ (id: string): ProjectTreeRef => ({ type: 'link', ref: id === 'new' ? null : String(id) }),
],
}),
listeners(({ actions, values }) => ({
diff --git a/products/links/frontend/linkMetricSparklineLogic.ts b/products/links/frontend/linkMetricSparklineLogic.ts
index ad2b69dad1f1..477a19e06687 100644
--- a/products/links/frontend/linkMetricSparklineLogic.ts
+++ b/products/links/frontend/linkMetricSparklineLogic.ts
@@ -1,4 +1,4 @@
-import { afterMount, kea, key, path, props } from 'kea'
+import { MakeLogicType, afterMount, kea, key, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -7,8 +7,6 @@ import { NodeKind, TrendsQuery } from '~/queries/schema/schema-general'
import { setLatestVersionsOnQuery } from '~/queries/utils'
import { ChartDisplayType } from '~/types'
-import type { linkMetricSparklineLogicType } from './linkMetricSparklineLogicType'
-
export type Props = {
id: string
}
@@ -18,6 +16,43 @@ export type SparklineDataResponse = {
labels: string[]
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linkMetricSparklineLogicValues {
+ sparklineData: SparklineDataResponse | null
+ sparklineDataLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linkMetricSparklineLogicActions {
+ loadSparklineData: () => any
+ loadSparklineDataFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSparklineDataSuccess: (
+ sparklineData: SparklineDataResponse,
+ payload?: any
+ ) => {
+ sparklineData: SparklineDataResponse
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linkMetricSparklineLogicMeta {
+ key: string
+}
+
+export type linkMetricSparklineLogicType = MakeLogicType<
+ linkMetricSparklineLogicValues,
+ linkMetricSparklineLogicActions,
+ Props,
+ linkMetricSparklineLogicMeta
+>
+
export const linkMetricSparklineLogic = kea<linkMetricSparklineLogicType>([
props({} as Props),
key(({ id }: Props) => id),
diff --git a/products/links/frontend/linksLogic.ts b/products/links/frontend/linksLogic.ts
index a612ee13c60c..b2914ad36aae 100644
--- a/products/links/frontend/linksLogic.ts
+++ b/products/links/frontend/linksLogic.ts
@@ -1,11 +1,36 @@
-import { afterMount, kea, path } from 'kea'
+import { MakeLogicType, afterMount, kea, path } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { LinkType } from '~/types'
-import type { linksLogicType } from './linksLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linksLogicValues {
+ links: LinkType[]
+ linksLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface linksLogicActions {
+ loadLinks: () => any
+ loadLinksFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadLinksSuccess: (
+ links: LinkType[],
+ payload?: any
+ ) => {
+ links: LinkType[]
+ payload?: any
+ }
+}
+
+export type linksLogicType = MakeLogicType<linksLogicValues, linksLogicActions>
export const linksLogic = kea<linksLogicType>([
path(() => ['scenes', 'links', 'linksLogic']),
diff --git a/products/metrics/frontend/components/metricNamePickerLogic.ts b/products/metrics/frontend/components/metricNamePickerLogic.ts
index 341bde85f717..1dd1ccf5fba2 100644
--- a/products/metrics/frontend/components/metricNamePickerLogic.ts
+++ b/products/metrics/frontend/components/metricNamePickerLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import { teamLogic } from 'scenes/teamLogic'
@@ -7,10 +7,40 @@ import { metricsValuesRetrieve } from 'products/metrics/frontend/generated/api'
import type { _MetricNameApi } from 'products/metrics/frontend/generated/api.schemas'
import { canViewMetrics } from 'products/metrics/frontend/metricsAccess'
-import type { metricNamePickerLogicType } from './metricNamePickerLogicType'
-
export type MetricNameItem = _MetricNameApi
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricNamePickerLogicValues {
+ currentTeamId: number | null // teamLogic
+ items: MetricNameItem[]
+ itemsLoading: boolean
+ search: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricNamePickerLogicActions {
+ loadItems: (_: any) => any
+ loadItemsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadItemsSuccess: (
+ items: _MetricNameApi[],
+ payload?: any
+ ) => {
+ items: _MetricNameApi[]
+ payload?: any
+ }
+ setSearch: (search: string) => {
+ search: string
+ }
+}
+
+export type metricNamePickerLogicType = MakeLogicType<metricNamePickerLogicValues, metricNamePickerLogicActions>
+
export const metricNamePickerLogic = kea<metricNamePickerLogicType>([
path(['products', 'metrics', 'frontend', 'components', 'metricNamePickerLogic']),
connect(() => ({
diff --git a/products/metrics/frontend/components/metricsSamplesLogic.tsx b/products/metrics/frontend/components/metricsSamplesLogic.tsx
index 2e3ed6f16a9c..b1d659dabbc6 100644
--- a/products/metrics/frontend/components/metricsSamplesLogic.tsx
+++ b/products/metrics/frontend/components/metricsSamplesLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { teamLogic } from 'scenes/teamLogic'
@@ -7,7 +7,6 @@ import { metricsSamplesCreate } from 'products/metrics/frontend/generated/api'
import type { _MetricEventSampleApi } from 'products/metrics/frontend/generated/api.schemas'
import { canViewMetrics } from 'products/metrics/frontend/metricsAccess'
-import type { metricsSamplesLogicType } from './metricsSamplesLogicType'
import { formatSeriesName, seriesColor } from './metricsSeries'
import { type MetricsViewerSeries, metricsViewerLogic, resolveDate } from './metricsViewerLogic'
@@ -25,6 +24,67 @@ export interface MetricsAggregateRow {
total: number
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsSamplesLogicValues {
+ dateFrom: string | null // metricsViewerLogic
+ dateTo: string | null // metricsViewerLogic
+ metricName: string // metricsViewerLogic
+ queryResults: MetricsViewerSeries[] // metricsViewerLogic
+ currentTeamId: number | null // teamLogic
+ activeTab: MetricsPanelTab
+ aggregateRows: MetricsAggregateRow[]
+ samples: _MetricEventSampleApi[]
+ samplesLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsSamplesLogicActions {
+ setDateFrom: (dateFrom: string | null) => {
+ dateFrom: string | null
+ } // metricsViewerLogic
+ setDateTo: (dateTo: string | null) => {
+ dateTo: string | null
+ } // metricsViewerLogic
+ setMetricName: (metricName: string) => {
+ metricName: string
+ } // metricsViewerLogic
+ loadSamples: (_: any) => any
+ loadSamplesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSamplesSuccess: (
+ samples: _MetricEventSampleApi[],
+ payload?: any
+ ) => {
+ samples: _MetricEventSampleApi[]
+ payload?: any
+ }
+ setActiveTab: (activeTab: MetricsPanelTab) => {
+ activeTab: MetricsPanelTab
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsSamplesLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ aggregateRows: (
+ queryResults: import('products/metrics/frontend/generated/api.schemas')._MetricSeriesApi[],
+ metricName: string
+ ) => MetricsAggregateRow[]
+ }
+}
+
+export type metricsSamplesLogicType = MakeLogicType<
+ metricsSamplesLogicValues,
+ metricsSamplesLogicActions,
+ Record<string, any>,
+ metricsSamplesLogicMeta
+>
+
export const metricsSamplesLogic = kea<metricsSamplesLogicType>([
path(['products', 'metrics', 'frontend', 'components', 'metricsSamplesLogic']),
connect(() => ({
diff --git a/products/metrics/frontend/components/metricsSqlEditorTrackingLogic.ts b/products/metrics/frontend/components/metricsSqlEditorTrackingLogic.ts
index 8de79514852e..fe09659b87e2 100644
--- a/products/metrics/frontend/components/metricsSqlEditorTrackingLogic.ts
+++ b/products/metrics/frontend/components/metricsSqlEditorTrackingLogic.ts
@@ -1,4 +1,4 @@
-import { connect, kea, key, listeners, path, props } from 'kea'
+import { MakeLogicType, connect, kea, key, listeners, path, props } from 'kea'
import posthog from 'posthog-js'
import { SaveAsMenuItem } from 'scenes/data-warehouse/editor/editorSceneLogic'
@@ -8,12 +8,71 @@ import { teamLogic } from 'scenes/teamLogic'
import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-general'
-import type { metricsSqlEditorTrackingLogicType } from './metricsSqlEditorTrackingLogicType'
+import type { ProductIntentProperties } from '../../../../frontend/src/lib/utils/product-intents'
export interface MetricsSqlEditorTrackingLogicProps {
sqlEditorTabId: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsSqlEditorTrackingLogicActions {
+ sqlEditorRunQuery: (
+ queryOverride?: string,
+ switchTab?: boolean
+ ) => {
+ queryOverride: string | undefined
+ switchTab: boolean | undefined
+ } // sqlEditorLogic
+ sqlEditorSaveAsEndpointSubmit: (
+ name: string,
+ description?: string,
+ queryOverride?: string,
+ dagId?: string
+ ) => {
+ dagId: string | undefined
+ description: string | undefined
+ name: string
+ queryOverride: string | undefined
+ } // sqlEditorLogic
+ sqlEditorSaveAsInsightSubmit: (
+ name: string,
+ queryOverride?: string
+ ) => {
+ name: string
+ queryOverride: string | undefined
+ } // sqlEditorLogic
+ sqlEditorSaveAsViewSubmit: (
+ name: string,
+ materializeAfterSave?: any,
+ fromDraft?: string,
+ dagId?: string,
+ folderId?: string | null,
+ isTest?: any,
+ queryOverride?: string
+ ) => {
+ dagId: string | undefined
+ folderId: string | null | undefined
+ fromDraft: string | undefined
+ isTest: any
+ materializeAfterSave: any
+ name: string
+ queryOverride: string | undefined
+ } // sqlEditorLogic
+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsSqlEditorTrackingLogicMeta {
+ key: string
+}
+
+export type metricsSqlEditorTrackingLogicType = MakeLogicType<
+ {},
+ metricsSqlEditorTrackingLogicActions,
+ MetricsSqlEditorTrackingLogicProps,
+ metricsSqlEditorTrackingLogicMeta
+>
+
export const metricsSqlEditorTrackingLogic = kea<metricsSqlEditorTrackingLogicType>([
path(['products', 'metrics', 'frontend', 'components', 'metricsSqlEditorTrackingLogic']),
props({} as MetricsSqlEditorTrackingLogicProps),
diff --git a/products/metrics/frontend/components/metricsUsageTrackingLogic.ts b/products/metrics/frontend/components/metricsUsageTrackingLogic.ts
index 63da24733eac..8fa9336900cb 100644
--- a/products/metrics/frontend/components/metricsUsageTrackingLogic.ts
+++ b/products/metrics/frontend/components/metricsUsageTrackingLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path } from 'kea'
import posthog from 'posthog-js'
import { teamLogic } from 'scenes/teamLogic'
@@ -7,10 +7,103 @@ import { type MetricsQuery, ProductIntentContext, ProductKey } from '~/queries/s
import type { _MetricEventSampleApi } from 'products/metrics/frontend/generated/api.schemas'
+import type { MetricSummary } from '../../../../frontend/src/lib/components/Metric/metricSummary'
+import type { ProductIntentProperties } from '../../../../frontend/src/lib/utils/product-intents'
+import type { Node } from '../../../../frontend/src/queries/schema/schema-general'
+import type { QueryBasedInsightModel, UniversalFiltersGroup } from '../../../../frontend/src/types'
+import type { _MetricFilterApi, _MetricSeriesApi } from '../generated/api.schemas'
import { metricsSceneLogic } from '../metricsSceneLogic'
+import type { MetricsSceneActiveTab } from '../metricsSceneLogic'
import { metricsSamplesLogic } from './metricsSamplesLogic'
-import type { metricsUsageTrackingLogicType } from './metricsUsageTrackingLogicType'
+import type { MetricsPanelTab } from './metricsSamplesLogic'
import { isUserInitiatedError, metricsViewerLogic } from './metricsViewerLogic'
+import type { MetricAggregation, MetricsViewMode } from './metricsViewerLogic'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsUsageTrackingLogicValues {
+ aggregation: MetricAggregation // metricsViewerLogic
+ groupByKeys: string[] // metricsViewerLogic
+ hasMetricName: boolean // metricsViewerLogic
+ queryFilters: _MetricFilterApi[] // metricsViewerLogic
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsUsageTrackingLogicActions {
+ loadSamplesSuccess: (
+ samples: _MetricEventSampleApi[],
+ payload?: any
+ ) => {
+ payload?: any
+ samples: _MetricEventSampleApi[]
+ } // metricsSamplesLogic
+ samplesPanelTabChanged: (activeTab: MetricsPanelTab) => {
+ activeTab: MetricsPanelTab
+ } // metricsSamplesLogic
+ sceneTabChanged: (activeTab: MetricsSceneActiveTab) => {
+ activeTab: MetricsSceneActiveTab
+ } // metricsSceneLogic
+ addToDashboard: () => {
+ value: true
+ } // metricsViewerLogic
+ fetchQueryResults: (_: any) => any // metricsViewerLogic
+ fetchQueryResultsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ } // metricsViewerLogic
+ fetchQueryResultsSuccess: (
+ queryResults: _MetricSeriesApi[],
+ payload?: any
+ ) => {
+ payload?: any
+ queryResults: _MetricSeriesApi[]
+ } // metricsViewerLogic
+ saveAsInsightSuccess: (
+ savedInsight: QueryBasedInsightModel<Node<Record<string, any>>> | null,
+ payload?: any
+ ) => {
+ payload?: any
+ savedInsight: QueryBasedInsightModel<Node<Record<string, any>>> | null
+ } // metricsViewerLogic
+ setAggregation: (aggregation: MetricAggregation) => {
+ aggregation: MetricAggregation
+ } // metricsViewerLogic
+ setDateFrom: (dateFrom: string | null) => {
+ dateFrom: string | null
+ } // metricsViewerLogic
+ setFilterGroup: (filterGroup: UniversalFiltersGroup) => {
+ filterGroup: UniversalFiltersGroup
+ } // metricsViewerLogic
+ setGroupByKeys: (groupByKeys: string[]) => {
+ groupByKeys: string[]
+ } // metricsViewerLogic
+ setLiveRefresh: (liveRefresh: boolean) => {
+ liveRefresh: boolean
+ } // metricsViewerLogic
+ setMetricName: (metricName: string) => {
+ metricName: string
+ } // metricsViewerLogic
+ setStatSummary: (statSummary: MetricSummary) => {
+ statSummary: MetricSummary
+ } // metricsViewerLogic
+ setViewMode: (viewMode: MetricsViewMode) => {
+ viewMode: MetricsViewMode
+ } // metricsViewerLogic
+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic
+ sampleRowExpanded: (sample: _MetricEventSampleApi) => {
+ sample: _MetricEventSampleApi
+ }
+ tracePivotClicked: (sample: _MetricEventSampleApi) => {
+ sample: _MetricEventSampleApi
+ }
+}
+
+export type metricsUsageTrackingLogicType = MakeLogicType<
+ metricsUsageTrackingLogicValues,
+ metricsUsageTrackingLogicActions
+>
// Central usage tracking for the metrics scene, following the metricsSqlEditorTrackingLogic
// precedent: captures fire from listeners on the source logics' actions, not from onClick
diff --git a/products/metrics/frontend/components/metricsViewerLogic.tsx b/products/metrics/frontend/components/metricsViewerLogic.tsx
index 8cb894076228..1c64a3fce9cc 100644
--- a/products/metrics/frontend/components/metricsViewerLogic.tsx
+++ b/products/metrics/frontend/components/metricsViewerLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
@@ -34,9 +34,11 @@ import type {
} from 'products/metrics/frontend/generated/api.schemas'
import { canCreateMetricsInsight, canViewMetrics } from 'products/metrics/frontend/metricsAccess'
+import type { Node } from '../../../../frontend/src/queries/schema/schema-general'
+import type { _MetricNameApi } from '../generated/api.schemas'
import { metricNamePickerLogic } from './metricNamePickerLogic'
+import type { MetricNameItem } from './metricNamePickerLogic'
import { formatSeriesName, seriesColor } from './metricsSeries'
-import type { metricsViewerLogicType } from './metricsViewerLogicType'
export type MetricAggregation = 'sum' | 'avg' | 'count' | 'p95' | 'rate' | 'increase'
@@ -150,6 +152,226 @@ const toKnownMetricType = (metricType: string | undefined): OtelMetricTypeEnumAp
return metricType && known.includes(metricType) ? (metricType as OtelMetricTypeEnumApi) : null
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsViewerLogicValues {
+ items: MetricNameItem[] // metricNamePickerLogic
+ currentTeamId: number | null // teamLogic
+ aggregation: MetricAggregation
+ anomalyBadge: MetricsAnomalyBadge | null
+ anomalyReport: _MetricAnomalyReportApi | null
+ anomalyReportLoading: boolean
+ attributeEndpointFilters: Record<string, string>
+ attributeKeyOptions: {
+ key: string
+ label: string
+ }[]
+ attributeKeyOptionsLoading: boolean
+ chartSeries: SparklineTimeSeries[]
+ currentSeries: MetricsViewerSeries | undefined
+ dateFrom: string | null
+ dateTo: string | null
+ filterGroup: UniversalFiltersGroup
+ groupByKeys: string[]
+ groupBySearch: string
+ hasMetricName: boolean
+ isAddToDashboardModalOpen: boolean
+ lastSavedQueryNode: MetricsQuery | null
+ liveRefresh: boolean
+ metricName: string
+ metricsQueryNode: MetricsQuery | null
+ pendingAddToDashboard: boolean
+ queryAbortController: AbortController | null
+ queryError: string | null
+ queryFilters: _MetricFilterApi[]
+ queryResults: MetricsViewerSeries[]
+ queryResultsLoading: boolean
+ savedInsight: QueryBasedInsightModel | null
+ savedInsightLoading: boolean
+ selectedMetricType: OtelMetricTypeEnumApi | null
+ sparklineLabels: string[]
+ sparklineValues: number[]
+ statSummary: MetricSummary
+ statTotal: number
+ viewMode: MetricsViewMode
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsViewerLogicActions {
+ loadItemsSuccess: (
+ items: _MetricNameApi[],
+ payload?: any
+ ) => {
+ items: _MetricNameApi[]
+ payload?: any
+ } // metricNamePickerLogic
+ addToDashboard: () => {
+ value: true
+ }
+ cancelInProgressQuery: (controller: AbortController | null) => {
+ controller: AbortController | null
+ }
+ clearAnomaly: () => any
+ clearAnomalyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ clearAnomalySuccess: (
+ anomalyReport: null,
+ payload?: any
+ ) => {
+ anomalyReport: null
+ payload?: any
+ }
+ closeAddToDashboardModal: () => {
+ value: true
+ }
+ fetchAnomaly: (_: any) => any
+ fetchAnomalyFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ fetchAnomalySuccess: (
+ anomalyReport: _MetricAnomalyReportApi | null,
+ payload?: any
+ ) => {
+ anomalyReport: _MetricAnomalyReportApi | null
+ payload?: any
+ }
+ fetchQueryResults: (_: any) => any
+ fetchQueryResultsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ fetchQueryResultsSuccess: (
+ queryResults: _MetricSeriesApi[],
+ payload?: any
+ ) => {
+ queryResults: _MetricSeriesApi[]
+ payload?: any
+ }
+ loadAttributeKeyOptions: (_: any) => any
+ loadAttributeKeyOptionsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAttributeKeyOptionsSuccess: (
+ attributeKeyOptions: {
+ key: string
+ label: string
+ }[],
+ payload?: any
+ ) => {
+ attributeKeyOptions: {
+ key: string
+ label: string
+ }[]
+ payload?: any
+ }
+ openAddToDashboardModal: () => {
+ value: true
+ }
+ saveAsInsight: () => any
+ saveAsInsightFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ saveAsInsightSuccess: (
+ savedInsight: QueryBasedInsightModel<Node<Record<string, any>>> | null,
+ payload?: any
+ ) => {
+ savedInsight: QueryBasedInsightModel<Node<Record<string, any>>> | null
+ payload?: any
+ }
+ setAggregation: (aggregation: MetricAggregation) => {
+ aggregation: MetricAggregation
+ }
+ setDateFrom: (dateFrom: string | null) => {
+ dateFrom: string | null
+ }
+ setDateTo: (dateTo: string | null) => {
+ dateTo: string | null
+ }
+ setFilterGroup: (filterGroup: UniversalFiltersGroup) => {
+ filterGroup: UniversalFiltersGroup
+ }
+ setGroupByKeys: (groupByKeys: string[]) => {
+ groupByKeys: string[]
+ }
+ setGroupBySearch: (groupBySearch: string) => {
+ groupBySearch: string
+ }
+ setLastSavedQueryNode: (query: MetricsQuery) => {
+ query: MetricsQuery
+ }
+ setLiveRefresh: (liveRefresh: boolean) => {
+ liveRefresh: boolean
+ }
+ setMetricName: (metricName: string) => {
+ metricName: string
+ }
+ setQueryAbortController: (controller: AbortController | null) => {
+ controller: AbortController | null
+ }
+ setRecommendedAggregation: (aggregation: MetricAggregation) => {
+ aggregation: MetricAggregation
+ }
+ setSelectedMetricType: (metricType: OtelMetricTypeEnumApi | null) => {
+ metricType: OtelMetricTypeEnumApi | null
+ }
+ setStatSummary: (statSummary: MetricSummary) => {
+ statSummary: MetricSummary
+ }
+ setViewMode: (viewMode: MetricsViewMode) => {
+ viewMode: MetricsViewMode
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsViewerLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasMetricName: (metricName: string) => boolean
+ metricsQueryNode: (
+ metricName: string,
+ aggregation: MetricAggregation,
+ selectedMetricType: OtelMetricTypeEnumApi | null,
+ dateFrom: string | null,
+ dateTo: string | null,
+ groupByKeys: string[],
+ queryFilters: _MetricFilterApi[]
+ ) => MetricsQuery | null
+ queryFilters: (filterGroup: UniversalFiltersGroup) => _MetricFilterApi[]
+ attributeEndpointFilters: (dateFrom: string | null, dateTo: string | null) => Record<string, string>
+ currentSeries: (queryResults: _MetricSeriesApi[]) => MetricsViewerSeries | undefined
+ chartSeries: (queryResults: _MetricSeriesApi[], metricName: string) => SparklineTimeSeries[]
+ sparklineValues: (currentSeries: _MetricSeriesApi | undefined) => number[]
+ sparklineLabels: (currentSeries: _MetricSeriesApi | undefined) => string[]
+ statTotal: (sparklineValues: number[]) => number
+ anomalyBadge: (anomalyReport: _MetricAnomalyReportApi | null) => MetricsAnomalyBadge | null
+ }
+}
+
+export type metricsViewerLogicType = MakeLogicType<
+ metricsViewerLogicValues,
+ metricsViewerLogicActions,
+ Record<string, any>,
+ metricsViewerLogicMeta
+>
+
export const metricsViewerLogic = kea<metricsViewerLogicType>([
path(['products', 'metrics', 'frontend', 'components', 'metricsViewerLogic']),
connect(() => ({
@@ -460,7 +682,7 @@ export const metricsViewerLogic = kea<metricsViewerLogicType>([
],
})),
selectors({
- hasMetricName: [(s) => [s.metricName], (metricName) => metricName.trim().length > 0],
+ hasMetricName: [(s) => [s.metricName], (metricName: string) => metricName.trim().length > 0],
// The viewer state as a `MetricsQuery` schema node — what "Save as insight"
// persists, so the saved tile re-runs exactly what the viewer shows.
// The REST viewer's 'p95' shorthand maps to the node's quantile aggregation.
@@ -475,13 +697,13 @@ export const metricsViewerLogic = kea<metricsViewerLogicType>([
s.queryFilters,
],
(
- metricName,
- aggregation,
- selectedMetricType,
- dateFrom,
- dateTo,
- groupByKeys,
- queryFilters
+ metricName: string,
+ aggregation: MetricAggregation,
+ selectedMetricType: OtelMetricTypeEnumApi | null,
+ dateFrom: string | null,
+ dateTo: string | null,
+ groupByKeys: string[],
+ queryFilters: _MetricFilterApi[]
): MetricsQuery | null => {
const trimmedName = metricName.trim()
if (!trimmedName) {
@@ -529,13 +751,16 @@ export const metricsViewerLogic = kea<metricsViewerLogicType>([
// taxonomic endpoints as query params.
attributeEndpointFilters: [
(s) => [s.dateFrom, s.dateTo],
- (dateFrom, dateTo): Record<string, string> => ({
+ (dateFrom: string | null, dateTo: string | null): Record<string, string> => ({
...(resolveDate(dateFrom) ? { dateFrom: resolveDate(dateFrom) as string } : {}),
...(resolveDate(dateTo) ? { dateTo: resolveDate(dateTo) as string } : {}),
}),
],
// Metrics has no compare/previous-series concept, so "current" is simply the first series.
- currentSeries: [(s) => [s.queryResults], (results): MetricsViewerSeries | undefined => results[0]],
+ currentSeries: [
+ (s) => [s.queryResults],
+ (results: MetricsViewerSeries[]): MetricsViewerSeries | undefined => results[0],
+ ],
// All series rendered as chart lines (a group-by query returns one series per label combination).
// The x-axis labels come from `sparklineLabels` (the backend grids every series onto one time axis).
chartSeries: [
diff --git a/products/metrics/frontend/metricsIngestionLogic.tsx b/products/metrics/frontend/metricsIngestionLogic.tsx
index 28199b55284b..7ef117541bc9 100644
--- a/products/metrics/frontend/metricsIngestionLogic.tsx
+++ b/products/metrics/frontend/metricsIngestionLogic.tsx
@@ -1,4 +1,4 @@
-import { afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { retryWithBackoff } from 'lib/utils/async'
@@ -6,12 +6,56 @@ import { teamLogic } from 'scenes/teamLogic'
import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-general'
+import type { ProductIntentProperties } from '../../../frontend/src/lib/utils/product-intents'
import { metricsHasMetricsRetrieve } from './generated/api'
import { canViewMetrics } from './metricsAccess'
-import type { metricsIngestionLogicType } from './metricsIngestionLogicType'
const teamId = window.POSTHOG_APP_CONTEXT?.current_team?.id
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsIngestionLogicValues {
+ currentTeamId: number | null // teamLogic
+ cachedTeamHasMetrics: boolean | null
+ hasMetrics: boolean | undefined
+ teamHasMetrics: boolean | undefined
+ teamHasMetricsCheckFailed: boolean
+ teamHasMetricsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsIngestionLogicActions {
+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic
+ loadTeamHasMetrics: () => any
+ loadTeamHasMetricsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTeamHasMetricsSuccess: (
+ teamHasMetrics: boolean | undefined,
+ payload?: any
+ ) => {
+ teamHasMetrics: boolean | undefined
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsIngestionLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasMetrics: (teamHasMetrics: boolean | undefined, cachedTeamHasMetrics: boolean | null) => boolean | undefined
+ }
+}
+
+export type metricsIngestionLogicType = MakeLogicType<
+ metricsIngestionLogicValues,
+ metricsIngestionLogicActions,
+ Record<string, any>,
+ metricsIngestionLogicMeta
+>
+
export const metricsIngestionLogic = kea<metricsIngestionLogicType>([
path(['products', 'metrics', 'frontend', 'metricsIngestionLogic']),
connect(() => ({
@@ -79,7 +123,7 @@ export const metricsIngestionLogic = kea<metricsIngestionLogicType>([
selectors({
hasMetrics: [
(s) => [s.teamHasMetrics, s.cachedTeamHasMetrics],
- (teamHasMetrics, cachedTeamHasMetrics): boolean | undefined =>
+ (teamHasMetrics: boolean | undefined, cachedTeamHasMetrics: boolean | null): boolean | undefined =>
teamHasMetrics ?? cachedTeamHasMetrics ?? undefined,
],
}),
diff --git a/products/metrics/frontend/metricsSceneLogic.tsx b/products/metrics/frontend/metricsSceneLogic.tsx
index d0c59f0d3327..fce3e32d17c2 100644
--- a/products/metrics/frontend/metricsSceneLogic.tsx
+++ b/products/metrics/frontend/metricsSceneLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'
import { router, urlToAction } from 'kea-router'
import { syncSearchParams, updateSearchParams } from '@posthog/products-error-tracking/frontend/utils'
@@ -8,14 +8,29 @@ import { sqlEditorLogic } from 'scenes/data-warehouse/editor/sqlEditorLogic'
import { SQLEditorMode } from 'scenes/data-warehouse/editor/sqlEditorModes'
import { Params } from 'scenes/sceneTypes'
-import type { metricsSceneLogicType } from './metricsSceneLogicType'
-
export const METRICS_SQL_EDITOR_TAB_ID = 'metrics-sql-editor'
export type MetricsSceneActiveTab = 'viewer' | 'sql'
const VALID_ACTIVE_TABS: MetricsSceneActiveTab[] = ['viewer', 'sql']
export const DEFAULT_ACTIVE_TAB: MetricsSceneActiveTab = 'viewer'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsSceneLogicValues {
+ activeTab: MetricsSceneActiveTab
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface metricsSceneLogicActions {
+ keepSqlEditorMounted: (editorTabId: string) => {
+ editorTabId: string
+ }
+ setActiveTab: (activeTab: MetricsSceneActiveTab) => {
+ activeTab: MetricsSceneActiveTab
+ }
+}
+
+export type metricsSceneLogicType = MakeLogicType<metricsSceneLogicValues, metricsSceneLogicActions>
+
export const metricsSceneLogic = kea<metricsSceneLogicType>([
path(['products', 'metrics', 'frontend', 'metricsSceneLogic']),
actions({
diff --git a/products/session_summaries/frontend/sessionGroupSummariesTableLogic.ts b/products/session_summaries/frontend/sessionGroupSummariesTableLogic.ts
index 600f7bb8ca6c..7fe5b2c349e9 100644
--- a/products/session_summaries/frontend/sessionGroupSummariesTableLogic.ts
+++ b/products/session_summaries/frontend/sessionGroupSummariesTableLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { PaginationManual, Sorting } from '@posthog/lemon-ui'
@@ -8,7 +8,6 @@ import { objectClean } from 'lib/utils/objects'
import { Breadcrumb } from '~/types'
-import type { sessionGroupSummariesTableLogicType } from './sessionGroupSummariesTableLogicType'
import { SessionGroupSummaryListItemType } from './types'
export interface SessionGroupSummariesListFilters {
@@ -24,6 +23,93 @@ export const DEFAULT_FILTERS: SessionGroupSummariesListFilters = {
const RESULTS_PER_PAGE = 50
const DEFAULT_SORTING: Sorting = { columnKey: '-created_at', order: 1 }
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionGroupSummariesTableLogicValues {
+ breadcrumbs: Breadcrumb[]
+ filters: SessionGroupSummariesListFilters
+ page: number
+ pagination: PaginationManual
+ sessionGroupSummaries: SessionGroupSummaryListItemType[]
+ sessionGroupSummariesResponse: CountedPaginatedResponse<SessionGroupSummaryListItemType> | null
+ sessionGroupSummariesResponseLoading: boolean
+ tableSorting: Sorting
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionGroupSummariesTableLogicActions {
+ deleteSessionGroupSummary: (id: string) => {
+ id: string
+ }
+ deleteSessionGroupSummaryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteSessionGroupSummarySuccess: (
+ sessionGroupSummariesResponse: null,
+ payload?: {
+ id: string
+ }
+ ) => {
+ sessionGroupSummariesResponse: null
+ payload?: {
+ id: string
+ }
+ }
+ loadSessionGroupSummaries: () => {
+ value: true
+ }
+ loadSessionGroupSummariesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSessionGroupSummariesSuccess: (
+ sessionGroupSummariesResponse: CountedPaginatedResponse<SessionGroupSummaryListItemType>,
+ payload?: {
+ value: true
+ }
+ ) => {
+ sessionGroupSummariesResponse: CountedPaginatedResponse<SessionGroupSummaryListItemType>
+ payload?: {
+ value: true
+ }
+ }
+ setFilters: (filters: Partial<SessionGroupSummariesListFilters>) => {
+ filters: Partial<SessionGroupSummariesListFilters>
+ }
+ setPage: (page: number) => {
+ page: number
+ }
+ tableSortingChanged: (sorting: Sorting | null) => {
+ sorting: Sorting | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionGroupSummariesTableLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ sessionGroupSummaries: (
+ sessionGroupSummariesResponse: CountedPaginatedResponse<SessionGroupSummaryListItemType> | null
+ ) => SessionGroupSummaryListItemType[]
+ pagination: (
+ page: number,
+ sessionGroupSummariesResponse: CountedPaginatedResponse<SessionGroupSummaryListItemType> | null
+ ) => PaginationManual
+ }
+}
+
+export type sessionGroupSummariesTableLogicType = MakeLogicType<
+ sessionGroupSummariesTableLogicValues,
+ sessionGroupSummariesTableLogicActions,
+ Record<string, any>,
+ sessionGroupSummariesTableLogicMeta
+>
+
export const sessionGroupSummariesTableLogic = kea<sessionGroupSummariesTableLogicType>([
path(['products', 'session_summaries', 'frontend', 'sessionGroupSummariesTableLogic']),
actions({
diff --git a/products/session_summaries/frontend/sessionGroupSummarySceneLogic.ts b/products/session_summaries/frontend/sessionGroupSummarySceneLogic.ts
index 7bfb1bc06729..4568088c0fef 100644
--- a/products/session_summaries/frontend/sessionGroupSummarySceneLogic.ts
+++ b/products/session_summaries/frontend/sessionGroupSummarySceneLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, key, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, key, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { actionToUrl, router, urlToAction } from 'kea-router'
@@ -8,7 +8,6 @@ import { urls } from 'scenes/urls'
import { Breadcrumb } from '~/types'
-import type { sessionGroupSummarySceneLogicType } from './sessionGroupSummarySceneLogicType'
import {
EnrichedSessionGroupSummaryPatternsList,
PatternAssignedEventSegmentContext,
@@ -19,6 +18,77 @@ export interface SessionGroupSummarySceneLogicProps {
id: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionGroupSummarySceneLogicValues {
+ accessDeniedToSessionGroupSummary: boolean
+ breadcrumbs: Breadcrumb[]
+ selectedEvent: PatternAssignedEventSegmentContext | null
+ selectedEventUuid: string | null
+ selectedPatternId: number | null
+ sessionGroupSummary: SessionGroupSummaryType | null
+ sessionGroupSummaryLoading: boolean
+ sessionGroupSummaryMissing: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionGroupSummarySceneLogicActions {
+ closeSessionDetails: () => {
+ value: true
+ }
+ loadSessionGroupSummary: () => {
+ value: true
+ }
+ loadSessionGroupSummaryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSessionGroupSummarySuccess: (
+ sessionGroupSummary: SessionGroupSummaryType | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ sessionGroupSummary: SessionGroupSummaryType | null
+ payload?: {
+ value: true
+ }
+ }
+ openSessionDetails: (
+ patternId: number,
+ targetEventUuid: string
+ ) => {
+ patternId: number
+ targetEventUuid: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionGroupSummarySceneLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ sessionGroupSummaryMissing: (
+ sessionGroupSummary: SessionGroupSummaryType | null,
+ sessionGroupSummaryLoading: boolean
+ ) => boolean
+ selectedEvent: (
+ sessionGroupSummary: SessionGroupSummaryType | null,
+ selectedPatternId: number | null,
+ selectedEventUuid: string | null
+ ) => PatternAssignedEventSegmentContext | null
+ breadcrumbs: (sessionGroupSummary: SessionGroupSummaryType | null) => Breadcrumb[]
+ }
+}
+
+export type sessionGroupSummarySceneLogicType = MakeLogicType<
+ sessionGroupSummarySceneLogicValues,
+ sessionGroupSummarySceneLogicActions,
+ SessionGroupSummarySceneLogicProps,
+ sessionGroupSummarySceneLogicMeta
+>
+
export const sessionGroupSummarySceneLogic = kea<sessionGroupSummarySceneLogicType>([
path(['products', 'session_summaries', 'frontend', 'sessionGroupSummarySceneLogic']),
props({} as SessionGroupSummarySceneLogicProps),
@@ -75,13 +145,17 @@ export const sessionGroupSummarySceneLogic = kea<sessionGroupSummarySceneLogicTy
selectors({
sessionGroupSummaryMissing: [
(s) => [s.sessionGroupSummary, s.sessionGroupSummaryLoading],
- (sessionGroupSummary, sessionGroupSummaryLoading): boolean => {
+ (sessionGroupSummary: SessionGroupSummaryType | null, sessionGroupSummaryLoading: boolean): boolean => {
return !sessionGroupSummary && !sessionGroupSummaryLoading
},
],
selectedEvent: [
(s) => [s.sessionGroupSummary, s.selectedPatternId, s.selectedEventUuid],
- (sessionGroupSummary, selectedPatternId, selectedEventUuid): PatternAssignedEventSegmentContext | null => {
+ (
+ sessionGroupSummary: SessionGroupSummaryType | null,
+ selectedPatternId: number | null,
+ selectedEventUuid: string | null
+ ): PatternAssignedEventSegmentContext | null => {
if (!sessionGroupSummary || selectedPatternId === null || !selectedEventUuid) {
return null
}
@@ -97,7 +171,7 @@ export const sessionGroupSummarySceneLogic = kea<sessionGroupSummarySceneLogicTy
],
breadcrumbs: [
(s) => [s.sessionGroupSummary],
- (sessionGroupSummary): Breadcrumb[] => [
+ (sessionGroupSummary: SessionGroupSummaryType | null): Breadcrumb[] => [
{
key: Scene.SessionGroupSummariesTable,
name: 'Session summaries',