@odigos/ui-kit 0.0.285 → 0.0.286-dev.520

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/docs/api-context.md +1 -1
  3. package/lib/chunks/{helpers-C5bkjRbO.js → helpers-B0SJ6hqm.js} +2 -2
  4. package/lib/chunks/index-9H2LDuOq.js +311 -0
  5. package/lib/chunks/source-instrument-form-context-BF70uJ_R.js +5 -0
  6. package/lib/chunks/ui-components-DqG0z5U0.js +1878 -0
  7. package/lib/components/_cards/data-card/index.d.ts +6 -1
  8. package/lib/components/_cards/text-card/index.d.ts +3 -0
  9. package/lib/components/drawer/header/index.d.ts +2 -0
  10. package/lib/components/hover-actions/index.d.ts +1 -1
  11. package/lib/components/index.d.ts +2 -0
  12. package/lib/components/info-row/index.d.ts +11 -0
  13. package/lib/components/input/index.d.ts +2 -0
  14. package/lib/components/table/index.d.ts +10 -0
  15. package/lib/components/table/styled.d.ts +11 -0
  16. package/lib/components/table/table-rows/index.d.ts +6 -1
  17. package/lib/components/table/types.d.ts +11 -2
  18. package/lib/components/trace-view/index.d.ts +4 -0
  19. package/lib/components/trace-view/styled.d.ts +43 -0
  20. package/lib/components/trace-view/types.d.ts +46 -0
  21. package/lib/components.js +1 -1
  22. package/lib/constants.js +1 -1
  23. package/lib/containers/_drawers/edit-source-drawer/overview/runtime-card.d.ts +5 -2
  24. package/lib/containers/_drawers/edit-source-drawer/pods/containers-card/process-card.d.ts +1 -7
  25. package/lib/containers/index.d.ts +1 -0
  26. package/lib/containers/insights/consts.d.ts +6 -0
  27. package/lib/containers/insights/findings/drawer/anomaly/anomaly-blast-radius/animated-edge.d.ts +10 -0
  28. package/lib/containers/insights/findings/drawer/anomaly/anomaly-blast-radius/blast-radius-node.d.ts +6 -0
  29. package/lib/containers/insights/findings/drawer/anomaly/anomaly-blast-radius/helpers.d.ts +28 -0
  30. package/lib/containers/insights/findings/drawer/anomaly/anomaly-blast-radius/index.d.ts +7 -0
  31. package/lib/containers/insights/findings/drawer/anomaly/anomaly-blast-radius/types.d.ts +19 -0
  32. package/lib/containers/insights/findings/drawer/anomaly/anomaly-trace-compare/helpers.d.ts +15 -0
  33. package/lib/containers/insights/findings/drawer/anomaly/anomaly-trace-compare/index.d.ts +7 -0
  34. package/lib/containers/insights/findings/drawer/anomaly/index.d.ts +15 -0
  35. package/lib/containers/insights/findings/drawer/anomaly/why-this-fired/index.d.ts +6 -0
  36. package/lib/containers/insights/findings/drawer/helpers.d.ts +11 -0
  37. package/lib/containers/insights/findings/drawer/index.d.ts +6 -0
  38. package/lib/containers/insights/findings/drawer/violation/index.d.ts +6 -0
  39. package/lib/containers/insights/findings/drawer/violation/violation-trace-view/index.d.ts +8 -0
  40. package/lib/containers/insights/findings/helpers.d.ts +47 -0
  41. package/lib/containers/insights/findings/index.d.ts +2 -0
  42. package/lib/containers/insights/index.d.ts +6 -0
  43. package/lib/containers/insights/insights-context.d.ts +44 -0
  44. package/lib/containers/insights/overview/contained-table-and-heading/index.d.ts +18 -0
  45. package/lib/containers/insights/overview/index.d.ts +6 -0
  46. package/lib/containers/insights/settings-and-configurations/constants.d.ts +16 -0
  47. package/lib/containers/insights/settings-and-configurations/content-panel/index.d.ts +11 -0
  48. package/lib/containers/insights/settings-and-configurations/index.d.ts +2 -0
  49. package/lib/containers/insights/settings-and-configurations/menu-config.d.ts +24 -0
  50. package/lib/containers/insights/settings-and-configurations/panels/detection/constants.d.ts +40 -0
  51. package/lib/containers/insights/settings-and-configurations/panels/detection/create-override-panel.d.ts +14 -0
  52. package/lib/containers/insights/settings-and-configurations/panels/detection/index.d.ts +2 -0
  53. package/lib/containers/insights/settings-and-configurations/panels/detection/mappers.d.ts +12 -0
  54. package/lib/containers/insights/settings-and-configurations/panels/detection/mock.d.ts +4 -0
  55. package/lib/containers/insights/settings-and-configurations/panels/detection/policies-menu.d.ts +10 -0
  56. package/lib/containers/insights/settings-and-configurations/panels/detection/policy-editor.d.ts +8 -0
  57. package/lib/containers/insights/settings-and-configurations/panels/detection/policy-list-item.d.ts +8 -0
  58. package/lib/containers/insights/settings-and-configurations/panels/detection/risk-levels.d.ts +15 -0
  59. package/lib/containers/insights/settings-and-configurations/panels/detection/risk-model-drawer/constants.d.ts +16 -0
  60. package/lib/containers/insights/settings-and-configurations/panels/detection/risk-model-drawer/default-catalog.d.ts +3 -0
  61. package/lib/containers/insights/settings-and-configurations/panels/detection/risk-model-drawer/helpers.d.ts +30 -0
  62. package/lib/containers/insights/settings-and-configurations/panels/detection/risk-model-drawer/index.d.ts +10 -0
  63. package/lib/containers/insights/settings-and-configurations/panels/detection/signal-weights-panel.d.ts +13 -0
  64. package/lib/containers/insights/settings-and-configurations/panels/detection/signal-weights.d.ts +17 -0
  65. package/lib/containers/insights/settings-and-configurations/panels/detection/types.d.ts +29 -0
  66. package/lib/containers/insights/settings-and-configurations/panels/guardrails/constants.d.ts +35 -0
  67. package/lib/containers/insights/settings-and-configurations/panels/guardrails/create-panel.d.ts +17 -0
  68. package/lib/containers/insights/settings-and-configurations/panels/guardrails/edit-panel.d.ts +10 -0
  69. package/lib/containers/insights/settings-and-configurations/panels/guardrails/facet-section.d.ts +13 -0
  70. package/lib/containers/insights/settings-and-configurations/panels/guardrails/guardrail-list-item.d.ts +8 -0
  71. package/lib/containers/insights/settings-and-configurations/panels/guardrails/guardrails-menu.d.ts +9 -0
  72. package/lib/containers/insights/settings-and-configurations/panels/guardrails/index.d.ts +2 -0
  73. package/lib/containers/insights/settings-and-configurations/panels/guardrails/mappers.d.ts +18 -0
  74. package/lib/containers/insights/settings-and-configurations/panels/guardrails/types.d.ts +10 -0
  75. package/lib/containers/insights/settings-and-configurations/panels/learning/constants.d.ts +82 -0
  76. package/lib/containers/insights/settings-and-configurations/panels/learning/create-override-panel.d.ts +21 -0
  77. package/lib/containers/insights/settings-and-configurations/panels/learning/index.d.ts +2 -0
  78. package/lib/containers/insights/settings-and-configurations/panels/learning/mappers.d.ts +38 -0
  79. package/lib/containers/insights/settings-and-configurations/panels/learning/policies-menu.d.ts +10 -0
  80. package/lib/containers/insights/settings-and-configurations/panels/learning/policy-editor.d.ts +9 -0
  81. package/lib/containers/insights/settings-and-configurations/panels/learning/policy-list-item.d.ts +8 -0
  82. package/lib/containers/insights/settings-and-configurations/panels/learning/types.d.ts +31 -0
  83. package/lib/containers/insights/settings-and-configurations/panels/storage/constants.d.ts +52 -0
  84. package/lib/containers/insights/settings-and-configurations/panels/storage/formatters.d.ts +5 -0
  85. package/lib/containers/insights/settings-and-configurations/panels/storage/index.d.ts +2 -0
  86. package/lib/containers/insights/settings-and-configurations/panels/storage/layout.d.ts +18 -0
  87. package/lib/containers/insights/settings-and-configurations/panels/storage/mappers.d.ts +27 -0
  88. package/lib/containers/insights/settings-and-configurations/panels/system/constants.d.ts +31 -0
  89. package/lib/containers/insights/settings-and-configurations/panels/system/index.d.ts +2 -0
  90. package/lib/containers/insights/settings-and-configurations/settings-menu/category-header.d.ts +8 -0
  91. package/lib/containers/insights/settings-and-configurations/settings-menu/index.d.ts +7 -0
  92. package/lib/containers/insights/transactions/drawer/baselines/helpers.d.ts +16 -0
  93. package/lib/containers/insights/transactions/drawer/baselines/index.d.ts +5 -0
  94. package/lib/containers/insights/transactions/drawer/index.d.ts +2 -0
  95. package/lib/containers/insights/transactions/drawer/observations/helpers.d.ts +11 -0
  96. package/lib/containers/insights/transactions/drawer/observations/index.d.ts +5 -0
  97. package/lib/containers/insights/transactions/helpers.d.ts +35 -0
  98. package/lib/containers/insights/transactions/index.d.ts +2 -0
  99. package/lib/containers.js +1381 -261
  100. package/lib/contexts/odigos-api/capabilities.d.ts +2 -0
  101. package/lib/contexts/odigos-api/hooks/use-insights-api.d.ts +153 -0
  102. package/lib/contexts/odigos-api/index.d.ts +2 -1
  103. package/lib/contexts/odigos-api/internal/notify.d.ts +4 -3
  104. package/lib/contexts/odigos-api/types.d.ts +201 -1
  105. package/lib/contexts/odigos-api/use-odigos-api.d.ts +2 -0
  106. package/lib/contexts.js +1 -1
  107. package/lib/functions/index.d.ts +1 -0
  108. package/lib/functions/parse-raw-otlp/index.d.ts +43 -0
  109. package/lib/functions.js +1 -1
  110. package/lib/hooks/useCopy.d.ts +2 -3
  111. package/lib/hooks/useTimeAgo.d.ts +4 -0
  112. package/lib/hooks.js +1 -1
  113. package/lib/icons/common/index.d.ts +3 -0
  114. package/lib/icons/common/insights-findings-icon/index.d.ts +2 -0
  115. package/lib/icons/common/insights-transactions-icon/index.d.ts +2 -0
  116. package/lib/icons/common/threat-detection-icon/index.d.ts +2 -0
  117. package/lib/icons/overview/index.d.ts +1 -0
  118. package/lib/icons/overview/insights-icon/index.d.ts +2 -0
  119. package/lib/icons.js +1 -1
  120. package/lib/snippets/code-modal/index.d.ts +9 -0
  121. package/lib/snippets/index.d.ts +1 -0
  122. package/lib/snippets/trace-modal/index.d.ts +8 -0
  123. package/lib/snippets.js +1 -1
  124. package/lib/store.js +1 -1
  125. package/lib/theme/palettes/index.d.ts +7 -1
  126. package/lib/theme.js +1 -1
  127. package/lib/types/common/index.d.ts +2 -0
  128. package/lib/types/index.d.ts +1 -0
  129. package/lib/types/insights/index.d.ts +598 -0
  130. package/lib/types/workload/index.d.ts +14 -0
  131. package/lib/types.js +1 -1
  132. package/lib/visuals.js +1 -1
  133. package/package.json +1 -1
  134. package/lib/chunks/index-DBZ1mLhG.js +0 -298
  135. package/lib/chunks/source-instrument-form-context-CnRKQq6W.js +0 -5
  136. package/lib/chunks/ui-components-Ci-Vq1Dl.js +0 -1620
@@ -0,0 +1,47 @@
1
+ import { type FormatDurationAgo } from '../../../hooks';
2
+ import { type DefaultTheme } from 'styled-components';
3
+ import { type OpenInsightsDrawer } from '../insights-context';
4
+ import { type InsightsFinding, InsightsSeverity, InsightsViolationStatus, InsightsAnomalyStatus } from '../../../types';
5
+ import { type TableColumn, type TableRow, type HoverAction, type BadgeProps } from '../../../components';
6
+ export declare enum FindingsColumnKeys {
7
+ Title = "title",
8
+ TransactionId = "transactionId",
9
+ LastSeen = "lastSeen",
10
+ Namespace = "namespace",
11
+ Service = "service",
12
+ Kind = "kind",
13
+ Status = "status",
14
+ Score = "score",
15
+ Severity = "severity",
16
+ Occurrences = "occurrences",
17
+ Offending = "offending",
18
+ Signature = "signature",
19
+ RuleKey = "ruleKey",
20
+ ScopeKey = "scopeKey"
21
+ }
22
+ export type FindingsServiceGroup = {
23
+ service: string;
24
+ namespace: string;
25
+ occurrences: number;
26
+ lastSeen: string;
27
+ findings: InsightsFinding[];
28
+ };
29
+ /** Stable drawer/table id — anomalies: transactionId+signature; violations: scopeKey+ruleKey+offending. */
30
+ export declare const getFindingId: (finding: InsightsFinding) => string;
31
+ export declare const findFindingById: (findings: InsightsFinding[] | undefined, id: string) => InsightsFinding | undefined;
32
+ export declare const getFindingsRowActions: (row: TableRow, openDrawer: OpenInsightsDrawer) => HoverAction[];
33
+ export declare const FINDINGS_TABLE_COLUMNS: TableColumn[];
34
+ export declare const FINDINGS_GROUP_BY_SERVICE_COLUMNS: TableColumn[];
35
+ export declare const getCountsForFindings: (findings?: InsightsFinding[]) => {
36
+ open: number;
37
+ violations: number;
38
+ anomalies: number;
39
+ critical: number;
40
+ high: number;
41
+ medium: number;
42
+ low: number;
43
+ };
44
+ export declare const getBadgePropsForSeverity: (theme: DefaultTheme, severity: InsightsSeverity) => BadgeProps;
45
+ export declare const getBadgePropsForStatus: (theme: DefaultTheme, status: InsightsViolationStatus | InsightsAnomalyStatus) => BadgeProps;
46
+ export declare const getTableRowsForFindings: (theme: DefaultTheme, formatDurationAgo: FormatDurationAgo, findings?: InsightsFinding[], limit?: number) => TableRow[];
47
+ export declare const getTableRowsForFindingsGroupedByService: (theme: DefaultTheme, formatDurationAgo: FormatDurationAgo, openDrawer: OpenInsightsDrawer, groups: FindingsServiceGroup[]) => TableRow[];
@@ -0,0 +1,2 @@
1
+ import { type FC } from 'react';
2
+ export declare const Findings: FC;
@@ -0,0 +1,6 @@
1
+ import { type FC } from 'react';
2
+ import type { MinSupportedVersion } from '../../types';
3
+ export interface InsightsProps {
4
+ minSupportedVersion?: MinSupportedVersion;
5
+ }
6
+ export declare const Insights: FC<InsightsProps>;
@@ -0,0 +1,44 @@
1
+ import React, { type PropsWithChildren } from 'react';
2
+ export declare enum InsightsDrawerType {
3
+ Anomaly = "anomaly",
4
+ Violation = "violation",
5
+ Transaction = "transaction"
6
+ }
7
+ type DrawerIsOpenFor = {
8
+ type: InsightsDrawerType | null;
9
+ id: string | null;
10
+ };
11
+ export type OpenInsightsDrawer = (type: InsightsDrawerType, id: string) => void;
12
+ export type CloseInsightsDrawer = () => void;
13
+ export declare enum InsightsModalType {
14
+ JsonCode = "jsonCode",
15
+ TraceView = "traceView"
16
+ }
17
+ type ModalIsOpenFor = {
18
+ type: InsightsModalType | null;
19
+ payload?: {
20
+ jsonCode?: string | null;
21
+ transactionId?: string | null;
22
+ traceId?: string | null;
23
+ } | null;
24
+ };
25
+ export type OpenInsightsModal = (type: InsightsModalType, payload?: ModalIsOpenFor['payload']) => void;
26
+ export type CloseInsightsModal = () => void;
27
+ export declare const InsightsContext: React.Context<{
28
+ drawerIsOpenFor: DrawerIsOpenFor;
29
+ openDrawer: OpenInsightsDrawer;
30
+ closeDrawer: CloseInsightsDrawer;
31
+ modalIsOpenFor: ModalIsOpenFor;
32
+ openModal: OpenInsightsModal;
33
+ closeModal: CloseInsightsModal;
34
+ }>;
35
+ export declare const InsightsContextProvider: ({ children }: PropsWithChildren) => React.JSX.Element;
36
+ export declare const useInsightsContext: () => {
37
+ drawerIsOpenFor: DrawerIsOpenFor;
38
+ openDrawer: OpenInsightsDrawer;
39
+ closeDrawer: CloseInsightsDrawer;
40
+ modalIsOpenFor: ModalIsOpenFor;
41
+ openModal: OpenInsightsModal;
42
+ closeModal: CloseInsightsModal;
43
+ };
44
+ export {};
@@ -0,0 +1,18 @@
1
+ import { type ReactNode, type CSSProperties, type FC } from 'react';
2
+ import { ActionsProps, type RichTitleProps } from '../../../../snippets';
3
+ import { type TableColumn, type TableRow, type TextCardProps, type TableProps } from '../../../../components';
4
+ interface ContainedTableAndHeadingProps {
5
+ richTitle: RichTitleProps;
6
+ textCards: TextCardProps[];
7
+ tableColumns: TableColumn[];
8
+ tableRows: TableRow[];
9
+ getRowActions?: TableProps['getRowActions'];
10
+ /** Remount the table when this changes (e.g. all vs group-by-service) so virtualized rows don't leak across modes. */
11
+ tableKey?: string | number;
12
+ tableMaxHeight?: CSSProperties['maxHeight'];
13
+ isLoading?: boolean;
14
+ actions?: ActionsProps['actions'];
15
+ children?: ReactNode;
16
+ }
17
+ export declare const ContainedTableAndHeading: FC<ContainedTableAndHeadingProps>;
18
+ export {};
@@ -0,0 +1,6 @@
1
+ import React, { type FC } from 'react';
2
+ import { InsightsTabs } from '../consts';
3
+ export interface OverviewProps {
4
+ setSelectedTab: React.Dispatch<React.SetStateAction<InsightsTabs>>;
5
+ }
6
+ export declare const Overview: FC<OverviewProps>;
@@ -0,0 +1,16 @@
1
+ export declare const TITLE_SETTINGS_MENU = "Settings Menu";
2
+ export declare const TITLE_CATEGORY_THREAT_DETECTION = "Threat detection";
3
+ export declare const TITLE_CATEGORY_LEARNING = "Learning";
4
+ export declare const TITLE_CATEGORY_ADVANCED = "Advanced";
5
+ export declare const TITLE_MENU_DETECTION = "Detection";
6
+ export declare const DESC_MENU_DETECTION = "When a finding fires";
7
+ export declare const TITLE_MENU_GUARDRAILS = "Guardrails";
8
+ export declare const DESC_MENU_GUARDRAILS = "L7 allowlist rules (Enforce / Suggest)";
9
+ export declare const TITLE_MENU_LEARNING = "Learning";
10
+ export declare const DESC_MENU_LEARNING = "Control baseline learning";
11
+ export declare const TITLE_MENU_SYSTEM = "System";
12
+ export declare const DESC_MENU_SYSTEM = "Sampling, retention, capacity";
13
+ export declare const DESC_PANEL_SYSTEM = "Engine-wide operational configuration. Detection thresholds and learning rules live on their own tabs.";
14
+ export declare const TITLE_MENU_STORAGE = "Storage";
15
+ export declare const DESC_MENU_STORAGE = "ClickHouse health";
16
+ export declare const LABEL_COMING_SOON = "Coming soon";
@@ -0,0 +1,11 @@
1
+ import { type FC, type ReactNode } from 'react';
2
+ import type { SVG } from '../../../../types';
3
+ export interface SettingsContentPanelProps {
4
+ icon?: SVG;
5
+ title: string;
6
+ /** Optional count badge shown next to the title. */
7
+ count?: number;
8
+ description?: string;
9
+ children: ReactNode;
10
+ }
11
+ export declare const SettingsContentPanel: FC<SettingsContentPanelProps>;
@@ -0,0 +1,2 @@
1
+ import { type FC } from 'react';
2
+ export declare const SettingsAndConfigurations: FC;
@@ -0,0 +1,24 @@
1
+ import type { SVG } from '../../../types';
2
+ export declare enum SettingsMenuItemId {
3
+ Detection = "detection",
4
+ Guardrails = "guardrails",
5
+ Learning = "learning",
6
+ System = "system",
7
+ Storage = "storage"
8
+ }
9
+ export declare const DEFAULT_SETTINGS_MENU_ITEM = SettingsMenuItemId.Guardrails;
10
+ export interface SettingsMenuItem {
11
+ id: SettingsMenuItemId;
12
+ title: string;
13
+ description: string;
14
+ panelIcon: SVG;
15
+ panelDescription?: string;
16
+ }
17
+ export interface SettingsMenuCategory {
18
+ id: string;
19
+ title: string;
20
+ icon: SVG;
21
+ items: SettingsMenuItem[];
22
+ }
23
+ export declare const SETTINGS_MENU_CATEGORIES: SettingsMenuCategory[];
24
+ export declare const getSettingsMenuItem: (id: SettingsMenuItemId) => SettingsMenuItem | undefined;
@@ -0,0 +1,40 @@
1
+ import { LABEL_DISABLED, LABEL_ENABLED } from '../../../../../constants';
2
+ export { LABEL_DISABLED, LABEL_ENABLED };
3
+ export declare const TITLE_ANOMALY_DETECTION_POLICIES = "Anomaly Detection Policies";
4
+ export declare const DESC_ANOMALY_DETECTION_POLICIES = "Configure when Odigos should create findings based on runtime risk signals.\nUse service overrides to adjust detection sensitivity for specific services.";
5
+ export declare const TITLE_DEFAULT_POLICY = "Default Policy";
6
+ export declare const TITLE_OVERRIDES = "Overrides";
7
+ export declare const TITLE_NO_OVERRIDES = "No overrides yet";
8
+ export declare const DESC_NO_OVERRIDES = "Add overrides to adjust detection sensitivity for specific services.";
9
+ export declare const BTN_ADD_OVERRIDE_POLICY = "Add override policy";
10
+ export declare const BTN_ADD_OVERRIDE = "Add override";
11
+ export declare const BTN_ADD_SELECTION = "Add selection";
12
+ export declare const BTN_SAVE_CHANGES = "Save Changes";
13
+ export declare const TITLE_CHOOSE_OVERRIDE_SCOPE = "Choose override scope";
14
+ export declare const DESC_CHOOSE_OVERRIDE_SCOPE = "Select where this policy should override the global detection settings.\nYou can apply it to a specific service or transaction.";
15
+ export declare const LABEL_GLOBAL = "Global";
16
+ export declare const LABEL_COMING_SOON = "Coming soon";
17
+ export declare const LABEL_NAME = "Name";
18
+ export declare const LABEL_TRIGGER_RISK_LEVEL = "Trigger when risk level is";
19
+ export declare const LABEL_CUSTOMIZE_SIGNAL_WEIGHTS = "Customize signal weights (advanced)";
20
+ export declare const LABEL_BASE_WEIGHT = "Base weight";
21
+ export declare const LABEL_RISK_POINTS = "Risk points";
22
+ export declare const TITLE_DANGEROUS_SUBCASES = "Dangerous sub-cases - added on top of the base when detected:";
23
+ export declare const DESC_SIGNAL_WEIGHTS_LEGEND = "Every detected signal adds its weight (points) to a 0\u2013100 risk score; the policy fires when the total reaches the threshold above. Sub-cases add on top of the base. Set any weight to 0 to mute that signal for this scope.";
24
+ export declare const LABEL_CHOOSE_OVERRIDE_TYPE = "Choose Override type";
25
+ export declare const LABEL_SELECT_SERVICE = "Select Service";
26
+ export declare const LABEL_SELECT_TRANSACTION = "Select Transaction";
27
+ export declare const LABEL_OVERRIDE_TYPE_SERVICE = "Service";
28
+ export declare const LABEL_OVERRIDE_TYPE_TRANSACTION = "Transaction";
29
+ export declare const PLACEHOLDER_SELECT_SERVICE = "Select service\u2026";
30
+ export declare const PLACEHOLDER_SELECT_TRANSACTION = "Select transaction\u2026";
31
+ export declare const LABEL_RISK_LEVEL_LOW = "Low";
32
+ export declare const LABEL_RISK_LEVEL_MEDIUM = "Medium";
33
+ export declare const LABEL_RISK_LEVEL_HIGH = "High";
34
+ export declare const LABEL_RISK_LEVEL_CRITICAL = "Critical";
35
+ export declare const getFireSummary: (fireAtScore: number, signalWeightOverrideCount: number) => string;
36
+ export declare const MOCK_GLOBAL_DEFAULT_ID = "global-default";
37
+ export declare const MOCK_GLOBAL_DEFAULT_NAME = "Global default";
38
+ export declare const MOCK_GLOBAL_DEFAULT_SUMMARY = "Triggers at Medium risk or higher";
39
+ export declare const MOCK_GLOBAL_DEFAULT_FIRE_AT_SCORE = 20;
40
+ export declare const MOCK_GLOBAL_DEFAULT_SIGNAL_WEIGHT_OVERRIDES = 1;
@@ -0,0 +1,14 @@
1
+ import { type FC } from 'react';
2
+ import type { InsightsServiceStat, InsightsTransactionStat } from '../../../../../types';
3
+ import { DetectionPolicyScope } from './types';
4
+ export interface CreateOverridePanelProps {
5
+ services: InsightsServiceStat[];
6
+ transactions: InsightsTransactionStat[];
7
+ existingScopeKeys: string[];
8
+ onSubmit: (payload: {
9
+ scope: DetectionPolicyScope.Service | DetectionPolicyScope.Transaction;
10
+ scopeKey: string;
11
+ name: string;
12
+ }) => void | Promise<void>;
13
+ }
14
+ export declare const CreateOverridePanel: FC<CreateOverridePanelProps>;
@@ -0,0 +1,2 @@
1
+ import { type FC } from 'react';
2
+ export declare const DetectionPanel: FC;
@@ -0,0 +1,12 @@
1
+ import type { InsightsPolicy, InsightsPolicyInput } from '../../../../../types';
2
+ import { DetectionPolicyScope, RiskLevel, type DetectionPolicyListItem } from './types';
3
+ export declare const fireAtScoreToRiskLevel: (fireAtScore: number) => RiskLevel;
4
+ export declare const getRiskLevelTriggerSummary: (riskLevel: RiskLevel) => string;
5
+ export declare const insightsPolicyToListItem: (policy: InsightsPolicy) => DetectionPolicyListItem;
6
+ export declare const listItemToInsightsPolicyInput: (policy: DetectionPolicyListItem) => InsightsPolicyInput;
7
+ export declare const buildOverridePolicy: ({ scope, scopeKey, name, defaults, }: {
8
+ scope: DetectionPolicyScope.Service | DetectionPolicyScope.Transaction;
9
+ scopeKey: string;
10
+ name: string;
11
+ defaults?: DetectionPolicyListItem | null;
12
+ }) => DetectionPolicyListItem;
@@ -0,0 +1,4 @@
1
+ import { type DetectionPolicyListItem } from './types';
2
+ /** Local fallback when Detection Policies APIs are unsupported by the host. */
3
+ export declare const MOCK_DEFAULT_POLICIES: DetectionPolicyListItem[];
4
+ export declare const MOCK_OVERRIDE_POLICIES: DetectionPolicyListItem[];
@@ -0,0 +1,10 @@
1
+ import { type FC } from 'react';
2
+ import type { DetectionPolicyListItem } from './types';
3
+ export interface PoliciesMenuProps {
4
+ defaultPolicies: DetectionPolicyListItem[];
5
+ overridePolicies: DetectionPolicyListItem[];
6
+ selectedId: string | null;
7
+ onSelect: (id: string) => void;
8
+ onAddOverride: () => void;
9
+ }
10
+ export declare const PoliciesMenu: FC<PoliciesMenuProps>;
@@ -0,0 +1,8 @@
1
+ import { type FC } from 'react';
2
+ import { type DetectionPolicyListItem } from './types';
3
+ export interface PolicyEditorProps {
4
+ policy: DetectionPolicyListItem;
5
+ onAddOverride: () => void;
6
+ onSave: (policy: DetectionPolicyListItem) => void | Promise<void>;
7
+ }
8
+ export declare const PolicyEditor: FC<PolicyEditorProps>;
@@ -0,0 +1,8 @@
1
+ import { type FC } from 'react';
2
+ import { type DetectionPolicyListItem } from './types';
3
+ export interface PolicyListItemProps {
4
+ policy: DetectionPolicyListItem;
5
+ isSelected: boolean;
6
+ onSelect: (id: string) => void;
7
+ }
8
+ export declare const PolicyListItem: FC<PolicyListItemProps>;
@@ -0,0 +1,15 @@
1
+ import { RiskLevel } from './types';
2
+ export declare const RISK_LEVEL_OPTIONS: readonly [{
3
+ readonly id: RiskLevel.Low;
4
+ readonly label: "Low";
5
+ }, {
6
+ readonly id: RiskLevel.Medium;
7
+ readonly label: "Medium";
8
+ }, {
9
+ readonly id: RiskLevel.High;
10
+ readonly label: "High";
11
+ }, {
12
+ readonly id: RiskLevel.Critical;
13
+ readonly label: "Critical";
14
+ }];
15
+ export declare const RISK_LEVEL_FIRE_AT_SCORE: Record<RiskLevel, number>;
@@ -0,0 +1,16 @@
1
+ export declare const TITLE_RISK_MODEL = "Risk model";
2
+ export declare const DESC_RISK_MODEL = "The default risk model every anomaly policy builds on. Each signal adds its weight (points) to a 0\u2013100 risk score; dangerous sub-cases add on top of a class\u2019s base novelty. Read-only reference \u2014 tune the weights per scope in this Detection policy.";
3
+ export declare const LABEL_VIEW_RISK_MODEL = "View risk model";
4
+ export declare const COL_SIGNAL = "Signal";
5
+ export declare const COL_CLASS_SOURCE = "Class / source";
6
+ export declare const COL_WEIGHT = "Weight";
7
+ export declare const COL_BAND = "Band";
8
+ export declare const COL_CATEGORY = "Category";
9
+ export declare const COL_WHAT_IT_MEANS = "What it means";
10
+ export declare const TITLE_HOW_SCORING_WORKS = "How scoring works";
11
+ export declare const SCORING_FORMULA = "Base signal + modifiers + cross-category bonus = final risk score";
12
+ export declare const DESC_MODIFIERS = "Modifiers are not independent signals. They are added only when their parent base signal occurs.";
13
+ export declare const LABEL_MODIFIER = "Modifier";
14
+ export declare const getScoringLimitsDesc: (bonus: number) => string;
15
+ export declare const TITLE_CROSS_CLASS_CORRELATION = "Cross-class correlation";
16
+ export declare const getCorrelationBonusDesc: (bonus: number) => string;
@@ -0,0 +1,3 @@
1
+ import { type InsightsCatalog } from '../../../../../../types';
2
+ /** Mirrors the live risk package catalog (odigos-enterprise/insights/internal/risk). */
3
+ export declare const DEFAULT_RISK_MODEL_CATALOG: InsightsCatalog;
@@ -0,0 +1,30 @@
1
+ import type { InsightsCatalog } from '../../../../../../types';
2
+ import { InsightsSeverity } from '../../../../../../types';
3
+ export interface RiskModelRow {
4
+ id: string;
5
+ signal: string;
6
+ source: string;
7
+ weight: number;
8
+ weightLabel: string;
9
+ band: InsightsSeverity;
10
+ bandLabel: string;
11
+ category: string;
12
+ description: string;
13
+ isSubCase: boolean;
14
+ }
15
+ export interface RiskModelScoringExample {
16
+ baseLabel: string;
17
+ baseScore: number;
18
+ modifierLabel: string;
19
+ modifierWeight: number;
20
+ finalScore: number;
21
+ finalBand: InsightsSeverity;
22
+ finalBandLabel: string;
23
+ }
24
+ export declare const buildRiskModelRows: (catalog: InsightsCatalog) => RiskModelRow[];
25
+ export declare const buildScoringExample: (catalog: InsightsCatalog) => RiskModelScoringExample | null;
26
+ export declare const bandThresholdsForHint: (catalog: InsightsCatalog) => {
27
+ severity: InsightsSeverity;
28
+ label: string;
29
+ minScore: number;
30
+ }[];
@@ -0,0 +1,10 @@
1
+ import { type FC } from 'react';
2
+ import type { InsightsCatalog } from '../../../../../../types';
3
+ import { type DrawerProps } from '../../../../../../components';
4
+ import { type HeaderProps } from '../../../../../../components/drawer/header';
5
+ export interface RiskModelDrawerProps {
6
+ isOpen: DrawerProps['isOpen'];
7
+ onClose: HeaderProps['onClose'];
8
+ catalog: InsightsCatalog;
9
+ }
10
+ export declare const RiskModelDrawer: FC<RiskModelDrawerProps>;
@@ -0,0 +1,13 @@
1
+ import { type FC } from 'react';
2
+ import type { InsightsCatalog } from '../../../../../types';
3
+ export interface SignalWeightsPanelProps {
4
+ catalog: InsightsCatalog;
5
+ signalWeights?: string | null;
6
+ enricherLists?: string | null;
7
+ onChange: (next: {
8
+ signalWeights: string | null;
9
+ enricherLists: string | null;
10
+ overrideCount: number;
11
+ }) => void;
12
+ }
13
+ export declare const SignalWeightsPanel: FC<SignalWeightsPanelProps>;
@@ -0,0 +1,17 @@
1
+ import type { InsightsCatalog, InsightsCatalogClass, InsightsCatalogEnricher, InsightsSeverityBand } from '../../../../../types';
2
+ import { InsightsSeverity } from '../../../../../types';
3
+ export declare const WEIGHT_BANDS: InsightsSeverityBand[];
4
+ export declare const SEVERITY_LABEL: Record<InsightsSeverity, string>;
5
+ export declare const severityForScore: (score: number, bands?: InsightsSeverityBand[]) => InsightsSeverity;
6
+ export declare const parseSignalWeights: (raw?: string | null) => Record<string, number>;
7
+ export declare const parseEnricherLists: (raw?: string | null) => Record<string, string[]>;
8
+ export declare const listToText: (items: string[]) => string;
9
+ export declare const textToList: (text: string) => string[];
10
+ export declare const getDefaultWeight: (catalog: InsightsCatalog, source: string) => number;
11
+ export declare const getEffectiveWeight: (catalog: InsightsCatalog, source: string, overrides: Record<string, number>) => number;
12
+ export declare const encodeSignalWeightOverrides: (catalog: InsightsCatalog, effective: Record<string, number>) => string | null;
13
+ export declare const encodeEnricherListOverrides: (catalog: InsightsCatalog, lists: Record<string, string[]>) => string | null;
14
+ export declare const buildEffectiveWeights: (catalog: InsightsCatalog, rawOverrides?: string | null) => Record<string, number>;
15
+ export declare const buildEffectiveLists: (catalog: InsightsCatalog, rawOverrides?: string | null) => Record<string, string[]>;
16
+ export declare const enrichersForClass: (catalog: InsightsCatalog, classId: string) => InsightsCatalogEnricher[];
17
+ export declare const orderedClasses: (catalog: InsightsCatalog) => InsightsCatalogClass[];
@@ -0,0 +1,29 @@
1
+ export declare enum DetectionPolicyScope {
2
+ Global = "global",
3
+ Service = "service",
4
+ Transaction = "transaction"
5
+ }
6
+ export declare enum RiskLevel {
7
+ Low = "low",
8
+ Medium = "medium",
9
+ High = "high",
10
+ Critical = "critical"
11
+ }
12
+ export interface DetectionPolicyListItem {
13
+ id: string;
14
+ name: string;
15
+ scope: DetectionPolicyScope;
16
+ /** Empty for global policies; service/transaction identifier otherwise. */
17
+ scopeKey: string;
18
+ enabled: boolean;
19
+ /** Short subtitle shown under the policy name in the side menu. */
20
+ summary: string;
21
+ fireAtScore: number;
22
+ riskLevel: RiskLevel;
23
+ signalWeightOverrideCount: number;
24
+ /** JSON-encoded map[string]int — preserved for upsert round-trips. */
25
+ signalWeights?: string | null;
26
+ /** JSON-encoded map[string][]string — preserved for upsert round-trips. */
27
+ enricherLists?: string | null;
28
+ }
29
+ export declare const isGlobalPolicy: (policy: DetectionPolicyListItem) => boolean;
@@ -0,0 +1,35 @@
1
+ export declare const TITLE_GUARDRAILS = "Guardrails";
2
+ export declare const DESC_PANEL_GUARDRAILS = "Guardrails are rules you declare about how a service may communicate. A broken guardrail is a Policy violation.\nPick a service to see what it actually talks to, check the callers/callees/egress you want to allow.";
3
+ export declare const TITLE_CREATED_GUARDRAILS = "Created Guardrails";
4
+ export declare const TITLE_NO_GUARDRAILS = "No guardrails yet";
5
+ export declare const DESC_NO_GUARDRAILS = "Create a guardrail to declare allowed service communication.";
6
+ export declare const TITLE_INSPECT_SERVICE = "Inspect a service";
7
+ export declare const TITLE_EDIT_GUARDRAIL = "Edit guardrail";
8
+ export declare const LABEL_NAMESPACE = "Namespace";
9
+ export declare const LABEL_SERVICE = "Service";
10
+ export declare const TITLE_CALLERS = "Callers";
11
+ export declare const DESC_CALLERS = "Who may call this service (inbound)";
12
+ export declare const TITLE_NO_CALLERS = "No Callers detected";
13
+ export declare const DESC_NO_CALLERS = "No callers found for this selection";
14
+ export declare const TITLE_CALLEES = "Callees";
15
+ export declare const DESC_CALLEES = "Internal services it may call (outbound)";
16
+ export declare const TITLE_NO_CALLEES = "No Callees detected";
17
+ export declare const DESC_NO_CALLEES = "No callees found for this selection";
18
+ export declare const TITLE_EGRESS = "Egress";
19
+ export declare const DESC_EGRESS = "External destinations it may reach";
20
+ export declare const TITLE_NO_EGRESS = "No egress detected";
21
+ export declare const DESC_NO_EGRESS = "No egress found for this selection";
22
+ export declare const TITLE_ADOPT_ENFORCE = "Adopt as enforce";
23
+ export declare const DESC_ADOPT_ENFORCE = "Alert on violation";
24
+ export declare const TITLE_ADOPT_SUGGEST = "Adopt as suggest";
25
+ export declare const DESC_ADOPT_SUGGEST = "Observe only";
26
+ export declare const BTN_CREATE_NEW_GUARDRAIL = "Create new guardrail";
27
+ export declare const BTN_ADD_TO_GUARDRAILS = "Add to guardrails";
28
+ export declare const BTN_SAVE_CHANGES = "Save changes";
29
+ export declare const BTN_DELETE_GUARDRAIL = "Delete";
30
+ export declare const LABEL_ENFORCE = "Enforce";
31
+ export declare const LABEL_SUGGEST = "Suggest";
32
+ export declare const LABEL_COMING_SOON = "Coming soon";
33
+ export declare const RULE_KEY_CALLERS = "allowed_callers";
34
+ export declare const RULE_KEY_CALLEES = "allowed_callees";
35
+ export declare const RULE_KEY_EGRESS = "allowed_egress";
@@ -0,0 +1,17 @@
1
+ import { type FC } from 'react';
2
+ import { InsightsRuleMode, type InsightsServiceProfile, type InsightsServiceStat } from '../../../../../types';
3
+ export interface CreatePanelProps {
4
+ services: InsightsServiceStat[];
5
+ profile: InsightsServiceProfile | null;
6
+ profileLoading?: boolean;
7
+ namespace: string;
8
+ service: string;
9
+ onNamespaceChange: (namespace: string) => void;
10
+ onServiceChange: (service: string) => void;
11
+ onSubmit: (payload: {
12
+ scopeKey: string;
13
+ mode: InsightsRuleMode;
14
+ items: string;
15
+ }) => void | Promise<void>;
16
+ }
17
+ export declare const CreatePanel: FC<CreatePanelProps>;
@@ -0,0 +1,10 @@
1
+ import { type FC } from 'react';
2
+ import { type InsightsGuardrail, type InsightsGuardrailInput, type InsightsServiceProfile } from '../../../../../types';
3
+ export interface EditPanelProps {
4
+ guardrail: InsightsGuardrail;
5
+ profile: InsightsServiceProfile | null;
6
+ profileLoading?: boolean;
7
+ onSave: (input: InsightsGuardrailInput) => void | Promise<void>;
8
+ onDelete: (scopeKey: string) => void | Promise<void>;
9
+ }
10
+ export declare const EditPanel: FC<EditPanelProps>;
@@ -0,0 +1,13 @@
1
+ import { type FC } from 'react';
2
+ import type { SVG } from '../../../../../types';
3
+ export interface FacetSectionProps {
4
+ title: string;
5
+ description: string;
6
+ items: string[];
7
+ selected: Set<string>;
8
+ onToggle: (item: string, checked: boolean) => void;
9
+ emptyIcon: SVG;
10
+ emptyTitle: string;
11
+ emptyDescription: string;
12
+ }
13
+ export declare const FacetSection: FC<FacetSectionProps>;
@@ -0,0 +1,8 @@
1
+ import { type FC } from 'react';
2
+ import type { GuardrailListItem } from './types';
3
+ export interface GuardrailListItemProps {
4
+ guardrail: GuardrailListItem;
5
+ isSelected: boolean;
6
+ onSelect: (id: string) => void;
7
+ }
8
+ export declare const GuardrailListItemCard: FC<GuardrailListItemProps>;
@@ -0,0 +1,9 @@
1
+ import { type FC } from 'react';
2
+ import type { GuardrailListItem } from './types';
3
+ export interface GuardrailsMenuProps {
4
+ guardrails: GuardrailListItem[];
5
+ selectedId: string | null;
6
+ onSelect: (id: string) => void;
7
+ onCreate: () => void;
8
+ }
9
+ export declare const GuardrailsMenu: FC<GuardrailsMenuProps>;
@@ -0,0 +1,2 @@
1
+ import { type FC } from 'react';
2
+ export declare const GuardrailsPanel: FC;
@@ -0,0 +1,18 @@
1
+ import { InsightsRuleMode, type InsightsGuardrail, type InsightsGuardrailInput } from '../../../../../types';
2
+ import type { GuardrailListItem } from './types';
3
+ export declare const insightsGuardrailToListItem: (guardrail: InsightsGuardrail) => GuardrailListItem;
4
+ export declare const parseScopeKey: (scopeKey: string) => {
5
+ namespace: string;
6
+ service: string;
7
+ };
8
+ export declare const getRuleAllowlist: (guardrail: InsightsGuardrail, key: string) => string[];
9
+ export declare const getGuardrailMode: (guardrail: InsightsGuardrail) => InsightsRuleMode;
10
+ export declare const uniqueUnion: (...lists: (string[] | undefined)[]) => string[];
11
+ export declare const buildGuardrailInput: (params: {
12
+ scope: InsightsGuardrail["scope"];
13
+ scopeKey: string;
14
+ mode: InsightsRuleMode;
15
+ callers: string[];
16
+ callees: string[];
17
+ egress: string[];
18
+ }) => InsightsGuardrailInput;
@@ -0,0 +1,10 @@
1
+ import type { InsightsRuleMode } from '../../../../../types';
2
+ export interface GuardrailListItem {
3
+ /** Unique key — namespace/service scopeKey. */
4
+ id: string;
5
+ scopeKey: string;
6
+ /** Primary rule label shown under the title (e.g. "Allowed callees"). */
7
+ ruleLabel: string;
8
+ allowlistCount: number;
9
+ mode: InsightsRuleMode;
10
+ }