@odigos/ui-kit 0.0.305 → 0.0.306

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 (34) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/lib/chunks/{helpers-D9jCyoin.js → helpers-Cnnu6nDZ.js} +1 -1
  3. package/lib/chunks/{index-C9PqEBy4.js → index-qLBXdBIN.js} +1 -1
  4. package/lib/chunks/source-instrument-form-context-CB8LQMmT.js +5 -0
  5. package/lib/chunks/ui-components-DRnj62bc.js +2298 -0
  6. package/lib/components.js +1 -1
  7. package/lib/constants/insights/index.d.ts +1 -0
  8. package/lib/constants/insights/recommendations.d.ts +78 -0
  9. package/lib/constants.js +1 -1
  10. package/lib/containers/insights/consts.d.ts +1 -0
  11. package/lib/containers/insights/recommendations/card-primitives.d.ts +69 -0
  12. package/lib/containers/insights/recommendations/drawer.d.ts +12 -0
  13. package/lib/containers/insights/recommendations/edit-apply-drawer.d.ts +8 -0
  14. package/lib/containers/insights/recommendations/grouped.d.ts +11 -0
  15. package/lib/containers/insights/recommendations/guardrail-card.d.ts +22 -0
  16. package/lib/containers/insights/recommendations/helpers.d.ts +200 -0
  17. package/lib/containers/insights/recommendations/index.d.ts +2 -0
  18. package/lib/containers/insights/recommendations/rule-card.d.ts +11 -0
  19. package/lib/containers.js +642 -567
  20. package/lib/contexts/odigos-api/capabilities.d.ts +2 -0
  21. package/lib/contexts/odigos-api/hooks/use-insights-api.d.ts +42 -2
  22. package/lib/contexts/odigos-api/types.d.ts +56 -1
  23. package/lib/contexts.js +1 -1
  24. package/lib/functions.js +1 -1
  25. package/lib/hooks.js +1 -1
  26. package/lib/snippets.js +1 -1
  27. package/lib/store.js +1 -1
  28. package/lib/theme.js +1 -1
  29. package/lib/types/insights/index.d.ts +292 -0
  30. package/lib/types.js +1 -1
  31. package/lib/visuals.js +1 -1
  32. package/package.json +1 -1
  33. package/lib/chunks/source-instrument-form-context-BLqtizcA.js +0 -5
  34. package/lib/chunks/ui-components-B-AB4_8e.js +0 -2298
@@ -44,6 +44,8 @@ export interface Capabilities {
44
44
  canManageSamplingRules: boolean;
45
45
  canManageInsightsPolicies: boolean;
46
46
  canFetchInsights: boolean;
47
+ /** Insights' mined guardrail rules — unrelated to canManageRecommendations below. */
48
+ canManageInsightsRecommendations: boolean;
47
49
  canManageRecommendations: boolean;
48
50
  }
49
51
  export declare const deriveCapabilities: (operations: OdigosApiOperations, ctx: OperationContext) => Capabilities;
@@ -10,8 +10,8 @@
10
10
  * the `{ insights: { … } }` / mutation-root wire envelope).
11
11
  */
12
12
  import { type UseApiQueryOptions, type UseApiQueryResult } from '../use-api-query';
13
- import type { GetInsightsAnomaliesVars, GetInsightsAnomalyVars, GetInsightsBaselineVars, GetInsightsFindingsVars, GetInsightsGuardrailViolationsVars, GetInsightsGuardrailViolationVars, GetInsightsServiceProfileVars, GetInsightsBlastRadiusVars, GetInsightsObservationVars, GetInsightsObservationsVars, GetInsightsTransactionVars, GetInsightsTransactionsVars, OperationContext, OdigosApiOperations, ForcePromoteInsightsServiceVars, EnableInsightsTransactionGuardrailVars, DisableInsightsTransactionGuardrailVars, PromoteInsightsBaselineClassVars, ResolveInsightsAnomalyVars } from '../types';
14
- import type { InsightsAnomalyIssue, InsightsAnomalySummary, InsightsBaselineClass, InsightsBulkDeleteResult, InsightsBulkPromoteResult, InsightsBulkResolveResult, InsightsCatalog, InsightsFinding, InsightsGuardrail, InsightsGuardrailViolation, InsightsGuardrailViolationDetail, InsightsLearningPolicy, InsightsLearningPolicyInput, InsightsObservation, InsightsObservationSummary, InsightsPolicy, InsightsPolicyInput, InsightsPromoteResult, InsightsServiceStat, InsightsServiceProfile, InsightsBlastRadiusSubgraph, InsightsStorageHealth, InsightsSystemSettings, InsightsSystemSettingsInput, InsightsTransaction, InsightsTransactionStat, InsightsViolationActionInput, InsightsGuardrailInput, InsightsGuardrailSeedInput, InsightsDeviationClass, InsightsBulkResolution, InsightsPolicyScope, InsightsAnomalyRefInput } from '../../../types';
13
+ import type { GetInsightsAnomaliesVars, GetInsightsAnomalyVars, GetInsightsBaselineVars, GetInsightsFindingsVars, GetInsightsGuardrailViolationsVars, GetInsightsGuardrailViolationVars, GetInsightsServiceProfileVars, GetInsightsBlastRadiusVars, GetInsightsObservationVars, GetInsightsObservationsVars, GetInsightsTransactionVars, GetInsightsTransactionsVars, OperationContext, OdigosApiOperations, ForcePromoteInsightsServiceVars, EnableInsightsTransactionGuardrailVars, DisableInsightsTransactionGuardrailVars, PromoteInsightsBaselineClassVars, ResolveInsightsAnomalyVars, GetInsightsRecommendationsVars, GetInsightsRecommendationVars, PreviewInsightsRecommendationVars, RecomputeInsightsRecommendationsVars } from '../types';
14
+ import type { InsightsAnomalyIssue, InsightsAnomalySummary, InsightsBaselineClass, InsightsBulkDeleteResult, InsightsBulkPromoteResult, InsightsBulkResolveResult, InsightsCatalog, InsightsFinding, InsightsGuardrail, InsightsGuardrailViolation, InsightsGuardrailViolationDetail, InsightsLearningPolicy, InsightsLearningPolicyInput, InsightsObservation, InsightsObservationSummary, InsightsPolicy, InsightsPolicyInput, InsightsPromoteResult, InsightsServiceStat, InsightsServiceProfile, InsightsBlastRadiusSubgraph, InsightsStorageHealth, InsightsSystemSettings, InsightsSystemSettingsInput, InsightsTransaction, InsightsTransactionStat, InsightsViolationActionInput, InsightsGuardrailInput, InsightsGuardrailSeedInput, InsightsDeviationClass, InsightsBulkResolution, InsightsPolicyScope, InsightsAnomalyRefInput, InsightsRecommendation, InsightsRecommendationApplyItemInput, InsightsRecommendationBulkResult, InsightsRecommendationPreview } from '../../../types';
15
15
  export interface InsightsApi {
16
16
  useServices: (options?: UseApiQueryOptions<InsightsServiceStat[]>) => UseApiQueryResult<InsightsServiceStat[]>;
17
17
  useServiceNames: (options?: UseApiQueryOptions<string[]>) => UseApiQueryResult<string[]>;
@@ -33,6 +33,8 @@ export interface InsightsApi {
33
33
  useCatalog: (options?: UseApiQueryOptions<InsightsCatalog>) => UseApiQueryResult<InsightsCatalog>;
34
34
  useSystemSettings: (options?: UseApiQueryOptions<InsightsSystemSettings>) => UseApiQueryResult<InsightsSystemSettings>;
35
35
  useStorageHealth: (options?: UseApiQueryOptions<InsightsStorageHealth>) => UseApiQueryResult<InsightsStorageHealth>;
36
+ useRecommendations: (vars?: GetInsightsRecommendationsVars, options?: UseApiQueryOptions<InsightsRecommendation[]>) => UseApiQueryResult<InsightsRecommendation[]>;
37
+ useRecommendation: (vars: GetInsightsRecommendationVars, options?: UseApiQueryOptions<InsightsRecommendation | undefined>) => UseApiQueryResult<InsightsRecommendation | undefined>;
36
38
  getServices?: () => Promise<{
37
39
  data?: InsightsServiceStat[];
38
40
  error?: string;
@@ -97,6 +99,14 @@ export interface InsightsApi {
97
99
  data?: InsightsStorageHealth;
98
100
  error?: string;
99
101
  }>;
102
+ getRecommendations?: (vars?: GetInsightsRecommendationsVars) => Promise<{
103
+ data?: InsightsRecommendation[];
104
+ error?: string;
105
+ }>;
106
+ getRecommendation?: (vars: GetInsightsRecommendationVars) => Promise<{
107
+ data?: InsightsRecommendation;
108
+ error?: string;
109
+ }>;
100
110
  promoteBaselineClass?: (vars: PromoteInsightsBaselineClassVars) => Promise<{
101
111
  data?: InsightsPromoteResult;
102
112
  error?: string;
@@ -174,5 +184,35 @@ export interface InsightsApi {
174
184
  data?: InsightsSystemSettings;
175
185
  error?: string;
176
186
  } | undefined>;
187
+ applyRecommendations?: (items: InsightsRecommendationApplyItemInput[]) => Promise<{
188
+ data?: InsightsRecommendationBulkResult;
189
+ error?: string;
190
+ } | undefined>;
191
+ dismissRecommendations?: (ids: string[]) => Promise<{
192
+ data?: InsightsRecommendationBulkResult;
193
+ error?: string;
194
+ } | undefined>;
195
+ restoreRecommendations?: (ids: string[]) => Promise<{
196
+ data?: InsightsRecommendationBulkResult;
197
+ error?: string;
198
+ } | undefined>;
199
+ revertRecommendations?: (ids: string[]) => Promise<{
200
+ data?: InsightsRecommendationBulkResult;
201
+ error?: string;
202
+ } | undefined>;
203
+ /** Dry run against stored samples. Persists nothing; no success toast. */
204
+ previewRecommendation?: (vars: PreviewInsightsRecommendationVars) => Promise<{
205
+ data?: InsightsRecommendationPreview;
206
+ error?: string;
207
+ } | undefined>;
208
+ /**
209
+ * Queue a mining run. Pass nothing to sweep everything, `{ transactionId }`
210
+ * to re-mine one transaction's correlations, or `{ namespace, service }` to
211
+ * rebuild one service's guardrail card — never a namespace on its own, and
212
+ * never a transaction id together with a service.
213
+ */
214
+ recomputeRecommendations?: (vars?: RecomputeInsightsRecommendationsVars) => Promise<{
215
+ error?: string;
216
+ } | undefined>;
177
217
  }
178
218
  export declare const useInsightsApi: (operations: OdigosApiOperations, ctx: OperationContext) => InsightsApi;
@@ -18,7 +18,7 @@ import type { ReactNode } from 'react';
18
18
  import type { DocumentNode } from '@apollo/client';
19
19
  import type { InstrumentationRuleInputWire } from '../../functions/instrumentation-rule-source-scopes';
20
20
  import type { ApolloClient, ApolloLink, FetchPolicy, MutationFetchPolicy, TypePolicies, WatchQueryFetchPolicy } from '@apollo/client';
21
- import type { Action, ActionFormData, AllClusterSnapshots, ClusterSnapshot, CloudConnectorCreateInput, CloudConnectorCreateResult, CloudConnectorProvider, ConfigYaml, Connection, CostReductionRule, CostReductionRuleInput, DataStream, DescribeOdigos, DescribeSource, Destination, DestinationFormData, DiagnoseFormData, EffectiveConfig, EffectiveConfigInput, EnableProfilingResult, ExtendedPodInfo, FetchedConfig, GatewayInfo, GetActionTypesResult, GetInstrumentationRuleTypesResult, GoOffsets, GetDestinationCategoriesResult, GetPotentialDestinationsResult, GetProfileHotFunctionsVars, HighlyRelevantOperationRule, HighlyRelevantOperationRuleInput, HotFunctionsResult, InsightsAnomalyIssue, InsightsAnomalyRefInput, InsightsAnomalyResolution, InsightsAnomalySummary, InsightsBaselineClass, InsightsBulkDeleteResult, InsightsBulkPromoteResult, InsightsBulkResolution, InsightsBulkResolveResult, InsightsCatalog, InsightsDeviationClass, InsightsFinding, InsightsFindingKind, InsightsGuardrail, InsightsGuardrailInput, InsightsGuardrailSeedInput, InsightsGuardrailViolation, InsightsGuardrailViolationDetail, InsightsLearningPolicy, InsightsLearningPolicyInput, InsightsObservation, InsightsObservationSummary, InsightsPolicy, InsightsPolicyInput, InsightsPolicyScope, InsightsPromoteResult, InsightsSampleReason, InsightsServiceStat, InsightsServiceProfile, InsightsBlastRadiusSubgraph, InsightsStorageHealth, InsightsSystemSettings, InsightsSystemSettingsInput, InsightsTransaction, InsightsTransactionKind, InsightsTransactionStat, InsightsViolationActionInput, InstrumentationAgent, GoOffsetsUpdateCheck, InstrumentationInstructions, InstrumentationRule, K8sResourceKind, LocalUiConfigInput, Metrics, Namespace, NoisyOperationRule, NoisyOperationRuleInput, NodeCollectoInfo, PlatformType, PodInfo, ProfilingSlots, SourceProfilingVars, Recommendation, SamplingRules, SamplingRulesK8sHealthConfig, ServiceMapSources, SourceFormData, SourceProfilingResult, TestConnectionResponse, Tier, TokenPayload, Workload, WorkloadId, PeerSources } from '../../types';
21
+ import type { Action, ActionFormData, AllClusterSnapshots, ClusterSnapshot, CloudConnectorCreateInput, CloudConnectorCreateResult, CloudConnectorProvider, ConfigYaml, Connection, CostReductionRule, CostReductionRuleInput, DataStream, DescribeOdigos, DescribeSource, Destination, DestinationFormData, DiagnoseFormData, EffectiveConfig, EffectiveConfigInput, EnableProfilingResult, ExtendedPodInfo, FetchedConfig, GatewayInfo, GetActionTypesResult, GetInstrumentationRuleTypesResult, GoOffsets, GetDestinationCategoriesResult, GetPotentialDestinationsResult, GetProfileHotFunctionsVars, HighlyRelevantOperationRule, HighlyRelevantOperationRuleInput, HotFunctionsResult, InsightsAnomalyIssue, InsightsAnomalyRefInput, InsightsAnomalyResolution, InsightsAnomalySummary, InsightsBaselineClass, InsightsBulkDeleteResult, InsightsBulkPromoteResult, InsightsBulkResolution, InsightsBulkResolveResult, InsightsCatalog, InsightsDeviationClass, InsightsFinding, InsightsFindingKind, InsightsGuardrail, InsightsGuardrailInput, InsightsGuardrailSeedInput, InsightsGuardrailViolation, InsightsGuardrailViolationDetail, InsightsLearningPolicy, InsightsLearningPolicyInput, InsightsObservation, InsightsObservationSummary, InsightsPolicy, InsightsPolicyInput, InsightsPolicyScope, InsightsPromoteResult, InsightsRecommendation, InsightsRecommendationApplyItemInput, InsightsRecommendationBulkResult, InsightsRecommendationKind, InsightsRecommendationPreview, InsightsRecommendationState, InsightsCorrelationSpecInput, InsightsSampleReason, InsightsServiceStat, InsightsServiceProfile, InsightsBlastRadiusSubgraph, InsightsStorageHealth, InsightsSystemSettings, InsightsSystemSettingsInput, InsightsTransaction, InsightsTransactionKind, InsightsTransactionStat, InsightsViolationActionInput, InstrumentationAgent, GoOffsetsUpdateCheck, InstrumentationInstructions, InstrumentationRule, K8sResourceKind, LocalUiConfigInput, Metrics, Namespace, NoisyOperationRule, NoisyOperationRuleInput, NodeCollectoInfo, PlatformType, PodInfo, ProfilingSlots, SourceProfilingVars, Recommendation, SamplingRules, SamplingRulesK8sHealthConfig, ServiceMapSources, SourceFormData, SourceProfilingResult, TestConnectionResponse, Tier, TokenPayload, Workload, WorkloadId, PeerSources } from '../../types';
22
22
  /**
23
23
  * The execution context for a given operation, propagated through every
24
24
  * `Operation.document(ctx)` / `transformVariables(vars, ctx)` /
@@ -761,6 +761,53 @@ export interface InsightsViolationActionVars {
761
761
  export interface UpdateInsightsSystemSettingsVars {
762
762
  settings: InsightsSystemSettingsInput;
763
763
  }
764
+ export interface GetInsightsRecommendationsVars {
765
+ kind?: InsightsRecommendationKind | null;
766
+ state?: InsightsRecommendationState | null;
767
+ transactionId?: string | null;
768
+ service?: string | null;
769
+ namespace?: string | null;
770
+ /** Include rows the latest mining run no longer produced. Defaults to false. */
771
+ includeStale?: boolean | null;
772
+ }
773
+ export interface GetInsightsRecommendationVars {
774
+ id: string;
775
+ }
776
+ export interface ApplyInsightsRecommendationsVars {
777
+ items: InsightsRecommendationApplyItemInput[];
778
+ }
779
+ /** Shared by the dismiss / restore / revert bulk actions. */
780
+ export interface InsightsRecommendationIdsVars {
781
+ ids: string[];
782
+ }
783
+ export interface PreviewInsightsRecommendationVars {
784
+ transactionId: string;
785
+ spec: InsightsCorrelationSpecInput;
786
+ }
787
+ /**
788
+ * Queue a mining run. Three legal shapes, and the server rejects the rest:
789
+ *
790
+ * - all three omitted — full sweep (every promoted transaction with unmined
791
+ * samples, plus every fully-learned service);
792
+ * - `transactionId` alone — re-mine that transaction's correlations (404 when
793
+ * the transaction does not exist);
794
+ * - `namespace` **and** `service` together — rebuild that service's guardrail card.
795
+ *
796
+ * `namespace` on its own is a 400, and mixing `transactionId` with
797
+ * `namespace`/`service` is a 400. A bare `service` is accepted but then fails
798
+ * downstream, so always pass the namespace with it.
799
+ *
800
+ * Success is 202 with no body: mining runs in the background and there is no
801
+ * job id, so the caller polls the list rather than awaiting a result.
802
+ */
803
+ export interface RecomputeInsightsRecommendationsVars {
804
+ /** Omit to sweep every promoted transaction with unmined samples. Mutually exclusive with `service`. */
805
+ transactionId?: string | null;
806
+ /** Only with `service` — never on its own. */
807
+ namespace?: string | null;
808
+ /** Re-mine this one service's `service_guardrail` card. Always pass `namespace` too. */
809
+ service?: string | null;
810
+ }
764
811
  export interface PersistSourcesResult {
765
812
  persistK8sSources: boolean;
766
813
  }
@@ -1067,6 +1114,14 @@ export interface OdigosApiOperations {
1067
1114
  DISMISS_INSIGHTS_GUARDRAIL_VIOLATION?: Operation<boolean, InsightsViolationActionVars>;
1068
1115
  REOPEN_INSIGHTS_GUARDRAIL_VIOLATION?: Operation<boolean, InsightsViolationActionVars>;
1069
1116
  UPDATE_INSIGHTS_SYSTEM_SETTINGS?: Operation<InsightsSystemSettings, UpdateInsightsSystemSettingsVars>;
1117
+ GET_INSIGHTS_RECOMMENDATIONS?: Operation<InsightsRecommendation[], GetInsightsRecommendationsVars | undefined>;
1118
+ GET_INSIGHTS_RECOMMENDATION?: Operation<InsightsRecommendation | undefined, GetInsightsRecommendationVars>;
1119
+ APPLY_INSIGHTS_RECOMMENDATIONS?: Operation<InsightsRecommendationBulkResult, ApplyInsightsRecommendationsVars>;
1120
+ DISMISS_INSIGHTS_RECOMMENDATIONS?: Operation<InsightsRecommendationBulkResult, InsightsRecommendationIdsVars>;
1121
+ RESTORE_INSIGHTS_RECOMMENDATIONS?: Operation<InsightsRecommendationBulkResult, InsightsRecommendationIdsVars>;
1122
+ REVERT_INSIGHTS_RECOMMENDATIONS?: Operation<InsightsRecommendationBulkResult, InsightsRecommendationIdsVars>;
1123
+ PREVIEW_INSIGHTS_RECOMMENDATION?: Operation<InsightsRecommendationPreview, PreviewInsightsRecommendationVars>;
1124
+ RECOMPUTE_INSIGHTS_RECOMMENDATIONS?: Operation<boolean, RecomputeInsightsRecommendationsVars | undefined>;
1070
1125
  }
1071
1126
  /**
1072
1127
  * The host's Apollo configuration. The kit constructs the ApolloClient
package/lib/contexts.js CHANGED
@@ -1 +1 @@
1
- import{u as a,r as P,a as T}from"./chunks/source-instrument-form-context-BLqtizcA.js";export{A as ActionFormContextProvider,C as CloudConnectorFormContextProvider,D as DataStreamFormContextProvider,b as DestinationFormContextProvider,c as DetectionOverrideFormContextProvider,d as DetectionPolicyFormContextProvider,G as GuardrailFormContextProvider,L as LearningOverrideFormContextProvider,e as LearningPolicyFormContextProvider,O as OdigosApiConnectionsScope,f as OdigosApiProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,g as SamplingRulesFormProvider,h as SourceEditFormContextProvider,i as SourceInstrumentFormContextProvider,j as SystemSettingsFormContextProvider,p as prepareNamespacePayloads,k as prepareSourcePayloads,l as useActionFormContext,m as useApiLazyQuery,n as useApiMutation,o as useApiQuery,q as useCloudConnectorFormContext,s as useDataStreamFormContext,t as useDestinationFormContext,v as useDetectionOverrideFormContext,w as useDetectionPolicyFormContext,x as useGuardrailFormContext,y as useLearningOverrideFormContext,z as useLearningPolicyFormContext,B as useOdigosApi,E as useRuleFormContext,F as useSamplingRulesFormContext,H as useSourceEditFormContext,I as useSourceInstrumentFormContext,J as useSystemSettingsFormContext}from"./chunks/source-instrument-form-context-BLqtizcA.js";export{O as OdigosProvider,c as checkVersionSupport,r as resolveMinSupportedVersion,u as useOdigos}from"./chunks/helpers-D9jCyoin.js";import{jsx as _}from"react/jsx-runtime";import{useMemo as M,useContext as N,createContext as V}from"react";import{P as U,t as $}from"./chunks/ui-components-B-AB4_8e.js";import{useApolloClient as K}from"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";const Q=()=>{const o=K(),{operations:r,context:e}=a();return{multiFetch:async(t,n,s)=>{const i=r[t];return i?T(o,i,n,s,e):{results:[],allSucceeded:!1,anySucceeded:!1,successCount:0,failureCount:n.length,error:`Operation ${String(t)} not configured`}},bulkPersistSources:async(t,n)=>{const s=[];for(const i of t){const t={...e,proxyID:i},{error:a}=await P(o,r.PERSIST_SOURCES,n,t);a&&s.push(`${i}: ${a}`)}return s.length?{error:s.join(", ")}:void 0},applyConfigurations:async(t,n)=>{if(!r.UPDATE_REMOTE_CONFIG)return{error:"UPDATE_REMOTE_CONFIG not configured"};if(!t.length)return{error:"No connections selected"};const s={formData:n,connectionIds:t},i=r.UPDATE_REMOTE_CONFIG;let a;return 1===t.length?({error:a}=await P(o,i,s,e)):({error:a}=await T(o,i,t,s,e)),a?{error:a}:void 0}}},W=(o,r)=>o.platformType===U.K8s?r.K8s:[U.Vm,U.Connector,U.AwsEcs].includes(o.platformType)?r.Vm:void 0,X=o=>r=>{const e=o[r.platformType];if(!e)return;const t=Object.keys(e);if(0===t.length)return;const n=$(r.schemaVersion??r.version),s=[...t].sort((o,r)=>$(r)-$(o)).find(o=>n>=$(o));return s?e[s]:void 0},Y=(o,r)=>{const e={};for(const t of Object.keys(o))e[t]=r(o[t]);return e},Z=V({formType:void 0}),oo=({children:o,formType:r})=>{const e=M(()=>({formType:r}),[r]);return _(Z.Provider,{value:e,children:o})},ro=()=>N(Z);export{oo as StorybookProvider,W as pickByPlatform,Q as useApiForConnections,ro as useStorybook,X as versionedDocument,Y as vmDialectMap};
1
+ import{u as a,r as P,a as T}from"./chunks/source-instrument-form-context-CB8LQMmT.js";export{A as ActionFormContextProvider,C as CloudConnectorFormContextProvider,D as DataStreamFormContextProvider,b as DestinationFormContextProvider,c as DetectionOverrideFormContextProvider,d as DetectionPolicyFormContextProvider,G as GuardrailFormContextProvider,L as LearningOverrideFormContextProvider,e as LearningPolicyFormContextProvider,O as OdigosApiConnectionsScope,f as OdigosApiProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,g as SamplingRulesFormProvider,h as SourceEditFormContextProvider,i as SourceInstrumentFormContextProvider,j as SystemSettingsFormContextProvider,p as prepareNamespacePayloads,k as prepareSourcePayloads,l as useActionFormContext,m as useApiLazyQuery,n as useApiMutation,o as useApiQuery,q as useCloudConnectorFormContext,s as useDataStreamFormContext,t as useDestinationFormContext,v as useDetectionOverrideFormContext,w as useDetectionPolicyFormContext,x as useGuardrailFormContext,y as useLearningOverrideFormContext,z as useLearningPolicyFormContext,B as useOdigosApi,E as useRuleFormContext,F as useSamplingRulesFormContext,H as useSourceEditFormContext,I as useSourceInstrumentFormContext,J as useSystemSettingsFormContext}from"./chunks/source-instrument-form-context-CB8LQMmT.js";export{O as OdigosProvider,c as checkVersionSupport,r as resolveMinSupportedVersion,u as useOdigos}from"./chunks/helpers-Cnnu6nDZ.js";import{jsx as _}from"react/jsx-runtime";import{useMemo as M,useContext as N,createContext as V}from"react";import{P as U,t as $}from"./chunks/ui-components-DRnj62bc.js";import{useApolloClient as K}from"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";const Q=()=>{const o=K(),{operations:r,context:e}=a();return{multiFetch:async(t,n,s)=>{const i=r[t];return i?T(o,i,n,s,e):{results:[],allSucceeded:!1,anySucceeded:!1,successCount:0,failureCount:n.length,error:`Operation ${String(t)} not configured`}},bulkPersistSources:async(t,n)=>{const s=[];for(const i of t){const t={...e,proxyID:i},{error:a}=await P(o,r.PERSIST_SOURCES,n,t);a&&s.push(`${i}: ${a}`)}return s.length?{error:s.join(", ")}:void 0},applyConfigurations:async(t,n)=>{if(!r.UPDATE_REMOTE_CONFIG)return{error:"UPDATE_REMOTE_CONFIG not configured"};if(!t.length)return{error:"No connections selected"};const s={formData:n,connectionIds:t},i=r.UPDATE_REMOTE_CONFIG;let a;return 1===t.length?({error:a}=await P(o,i,s,e)):({error:a}=await T(o,i,t,s,e)),a?{error:a}:void 0}}},W=(o,r)=>o.platformType===U.K8s?r.K8s:[U.Vm,U.Connector,U.AwsEcs].includes(o.platformType)?r.Vm:void 0,X=o=>r=>{const e=o[r.platformType];if(!e)return;const t=Object.keys(e);if(0===t.length)return;const n=$(r.schemaVersion??r.version),s=[...t].sort((o,r)=>$(r)-$(o)).find(o=>n>=$(o));return s?e[s]:void 0},Y=(o,r)=>{const e={};for(const t of Object.keys(o))e[t]=r(o[t]);return e},Z=V({formType:void 0}),oo=({children:o,formType:r})=>{const e=M(()=>({formType:r}),[r]);return _(Z.Provider,{value:e,children:o})},ro=()=>N(Z);export{oo as StorybookProvider,W as pickByPlatform,Q as useApiForConnections,ro as useStorybook,X as versionedDocument,Y as vmDialectMap};
package/lib/functions.js CHANGED
@@ -1 +1 @@
1
- export{by as adaptInstrumentationRuleFromWire,bw as adaptInstrumentationRuleInputForWire,gl as agentSupportsOffsets,fm as buildBadgeForDesiredStatus,n3 as buildCatalogFieldsDataCard,fd as buildCatalogFieldsSegments,n4 as capitalizeFirstLetter,n5 as cleanObjectEmptyStringsValues,a6 as compareCondition,n6 as decimalsOnly,b1 as deepClone,ld as entityIdKey,li as filterActions,lh as filterDestinations,fh as filterDestinationsByStream,lg as filterSources,l3 as filterSourcesByStream,k1 as findSourceByService,n7 as flattenObjectKeys,fA as formatBytes,kc as formatDuration,ba as generateId,la as getActionConditions,ff as getActionIcon,gk as getAgentTierBadgeColors,lb as getConditionsBooleans,fS as getContainersIcons,n8 as getContainersInstrumentedCount,n9 as getDeepValue,f4 as getDestinationIcon,na as getDetectedLanguageIcons,fr as getEffectiveLanguage,fI as getEffectiveRuntimeVersion,le as getEntityIcon,br as getEntityId,l9 as getEntityIdKey,lc as getEntityLabel,nb as getHealthBadgeLabel,bm as getIdFromSseTarget,fj as getInstrumentationRuleIcon,nc as getInstrumentedCountLabel,nd as getMainContainerLanguage,ne as getMetricForEntity,nf as getMonitorIcon,ng as getNearestTypographySize,fR as getPlatformIcon,jU as getPlatformLabel,Y as getProgrammingLanguageIcon,nh as getRecursiveValues,fz as getSourceKindLabel,fw as getSourceLanguageIcons,bf as getSseTargetFromId,fG as getStatusColor,lk as getStatusFromPodStatus,fH as getStatusIcon,fB as getStatusTypeFromOdigosHealth,ni as getValueForRange,fv as getVirtualServiceIcon,fu as getWorkloadId,fi as getYamlFieldsForDestination,nj as hasUnhealthyInstances,nk as instrumentationRuleSourceScopesFromWire,nl as instrumentationRuleSourceScopesToWire,bK as isEmpty,bL as isLegalK8sLabel,iG as isOverTime,nm as isStringABoolean,nn as isTimeElapsed,fF as isValidVersion,no as mapConditions,fo as mapDesiredStatusToConditionStatus,fb as mapDesiredStatusesToConditions,fg as mapDestinationFieldsForDisplay,bP as mapExportedSignals,bN as mapSupportedSignals,np as numbersOnly,nq as parseBooleanFromString,nr as parseJsonStringToPrettyString,ke as parseRawOtlp,cr as prepareDestinationFormData,ns as removeEmptyValuesFromObject,y as safeJsonParse,nt as safeJsonStringify,nu as setDeepValue,nv as sleep,ak as splitCamelString,nw as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-B-AB4_8e.js";import"react/jsx-runtime";import"react";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";
1
+ export{by as adaptInstrumentationRuleFromWire,bw as adaptInstrumentationRuleInputForWire,gl as agentSupportsOffsets,fm as buildBadgeForDesiredStatus,o6 as buildCatalogFieldsDataCard,fd as buildCatalogFieldsSegments,o7 as capitalizeFirstLetter,o8 as cleanObjectEmptyStringsValues,a6 as compareCondition,o9 as decimalsOnly,b1 as deepClone,mg as entityIdKey,ml as filterActions,mk as filterDestinations,fh as filterDestinationsByStream,mj as filterSources,m6 as filterSourcesByStream,k1 as findSourceByService,oa as flattenObjectKeys,fA as formatBytes,lf as formatDuration,ba as generateId,md as getActionConditions,ff as getActionIcon,gk as getAgentTierBadgeColors,me as getConditionsBooleans,fS as getContainersIcons,ob as getContainersInstrumentedCount,oc as getDeepValue,f4 as getDestinationIcon,od as getDetectedLanguageIcons,fr as getEffectiveLanguage,fI as getEffectiveRuntimeVersion,mh as getEntityIcon,br as getEntityId,mc as getEntityIdKey,mf as getEntityLabel,oe as getHealthBadgeLabel,bm as getIdFromSseTarget,fj as getInstrumentationRuleIcon,of as getInstrumentedCountLabel,og as getMainContainerLanguage,oh as getMetricForEntity,oi as getMonitorIcon,oj as getNearestTypographySize,fR as getPlatformIcon,jU as getPlatformLabel,Y as getProgrammingLanguageIcon,ok as getRecursiveValues,fz as getSourceKindLabel,fw as getSourceLanguageIcons,bf as getSseTargetFromId,fG as getStatusColor,mn as getStatusFromPodStatus,fH as getStatusIcon,fB as getStatusTypeFromOdigosHealth,ol as getValueForRange,fv as getVirtualServiceIcon,fu as getWorkloadId,fi as getYamlFieldsForDestination,om as hasUnhealthyInstances,on as instrumentationRuleSourceScopesFromWire,oo as instrumentationRuleSourceScopesToWire,bK as isEmpty,bL as isLegalK8sLabel,iG as isOverTime,op as isStringABoolean,oq as isTimeElapsed,fF as isValidVersion,or as mapConditions,fo as mapDesiredStatusToConditionStatus,fb as mapDesiredStatusesToConditions,fg as mapDestinationFieldsForDisplay,bP as mapExportedSignals,bN as mapSupportedSignals,os as numbersOnly,ot as parseBooleanFromString,ou as parseJsonStringToPrettyString,lh as parseRawOtlp,cr as prepareDestinationFormData,ov as removeEmptyValuesFromObject,y as safeJsonParse,ow as safeJsonStringify,ox as setDeepValue,oy as sleep,ak as splitCamelString,oz as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-DRnj62bc.js";import"react/jsx-runtime";import"react";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";
package/lib/hooks.js CHANGED
@@ -1 +1 @@
1
- export{pl as IGNORE_OUTSIDE_CLICK_ATTR,d0 as PopupAlignX,iH as PopupAlignY,k8 as formatDurationMinutes,pm as formatDurationMs,pn as isInsideIgnoredPortal,po as useActionFormData,c$ as useAnchoredPopup,pp as useBodyScroll,lf as useContainerSize,b8 as useCopy,pq as useDataStreamFormData,pr as useDestinationFormData,u as useFullscreen,bG as useGenericForm,ps as useInstrumentationRuleFormData,iF as useKeyDown,fC as useOnClickOutside,ls as useOverflow,pt as usePopup,fl as useScrollIntoViewWhen,lD as useScrollTo,l6 as useSessionStorage,pu as useSourceFormData,c_ as useTimeAgo}from"./chunks/ui-components-B-AB4_8e.js";import"react/jsx-runtime";import"react";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";
1
+ export{qx as IGNORE_OUTSIDE_CLICK_ATTR,d0 as PopupAlignX,iH as PopupAlignY,k8 as formatDurationMinutes,qy as formatDurationMs,qz as isInsideIgnoredPortal,qA as useActionFormData,c$ as useAnchoredPopup,qB as useBodyScroll,mi as useContainerSize,b8 as useCopy,qC as useDataStreamFormData,qD as useDestinationFormData,u as useFullscreen,bG as useGenericForm,qE as useInstrumentationRuleFormData,iF as useKeyDown,fC as useOnClickOutside,mv as useOverflow,qF as usePopup,fl as useScrollIntoViewWhen,mG as useScrollTo,m9 as useSessionStorage,qG as useSourceFormData,c_ as useTimeAgo}from"./chunks/ui-components-DRnj62bc.js";import"react/jsx-runtime";import"react";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";
package/lib/snippets.js CHANGED
@@ -1 +1 @@
1
- export{A as ActionType,a as Actions,R as RichTitle}from"./chunks/ui-components-B-AB4_8e.js";export{A as AnimatedCollapse,a as AnimatedGraphEdge,b as AutoFitView,B as BlastRadius,C as CancelModal,D as DEFAULT_GRAPH_FIT_VIEW_OPTIONS,c as DURATION_OPTIONS,d as DeleteModal,e as DurationErrorsSection,f as DynamicActionFields,g as DynamicField,h as DynamicFields,E as EnableDisableSegment,G as GRAPH_FLOW_ANIMATED_EDGE,i as GraphFlow,j as GraphFlowComponent,I as InstrumentationPreviewSection,k as IntroModal,N as NOISY_PERCENTAGE_OPTIONS,O as OdigosLogoTextByTier,l as OperationSection,P as PERCENTAGE_OPTIONS,m as PercentageSection,n as PresetWithCustomInput,R as RuleInfoSection,o as RuleTypeSection,S as SamplingPreviewSection,p as SignalsCheckboxList,q as SourceScopeSection,U as UpgradeModal,W as WIDE_DRAWER_WIDTH,r as WideDrawer,Y as YamlSectionCard,s as getElkLayoutedElements,t as getGraphEdgePath}from"./chunks/index-C9PqEBy4.js";export{C as ColoredSpan,a as ColoredSpanVariant}from"./chunks/helpers-D9jCyoin.js";import"react/jsx-runtime";import"react";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";import"elkjs/lib/elk.bundled.js";import"@xyflow/react";import"@xyflow/react/dist/style.css";
1
+ export{A as ActionType,a as Actions,R as RichTitle}from"./chunks/ui-components-DRnj62bc.js";export{A as AnimatedCollapse,a as AnimatedGraphEdge,b as AutoFitView,B as BlastRadius,C as CancelModal,D as DEFAULT_GRAPH_FIT_VIEW_OPTIONS,c as DURATION_OPTIONS,d as DeleteModal,e as DurationErrorsSection,f as DynamicActionFields,g as DynamicField,h as DynamicFields,E as EnableDisableSegment,G as GRAPH_FLOW_ANIMATED_EDGE,i as GraphFlow,j as GraphFlowComponent,I as InstrumentationPreviewSection,k as IntroModal,N as NOISY_PERCENTAGE_OPTIONS,O as OdigosLogoTextByTier,l as OperationSection,P as PERCENTAGE_OPTIONS,m as PercentageSection,n as PresetWithCustomInput,R as RuleInfoSection,o as RuleTypeSection,S as SamplingPreviewSection,p as SignalsCheckboxList,q as SourceScopeSection,U as UpgradeModal,W as WIDE_DRAWER_WIDTH,r as WideDrawer,Y as YamlSectionCard,s as getElkLayoutedElements,t as getGraphEdgePath}from"./chunks/index-qLBXdBIN.js";export{C as ColoredSpan,a as ColoredSpanVariant}from"./chunks/helpers-Cnnu6nDZ.js";import"react/jsx-runtime";import"react";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";import"elkjs/lib/elk.bundled.js";import"@xyflow/react";import"@xyflow/react/dist/style.css";
package/lib/store.js CHANGED
@@ -1 +1 @@
1
- export{iI as DrawerType,bl as ProgressKeys,l7 as getDrawerTypeForAdd,fy as getDrawerTypeForEdit,bi as useDataStreamStore,ft as useDrawerStore,l2 as useFilterStore,bd as useNotificationStore,bj as useProgressStore,l8 as useSelectedStore,bk as useSetupStore}from"./chunks/ui-components-B-AB4_8e.js";import"react/jsx-runtime";import"react";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";
1
+ export{iI as DrawerType,bl as ProgressKeys,ma as getDrawerTypeForAdd,fy as getDrawerTypeForEdit,bi as useDataStreamStore,ft as useDrawerStore,m5 as useFilterStore,bd as useNotificationStore,bj as useProgressStore,mb as useSelectedStore,bk as useSetupStore}from"./chunks/ui-components-DRnj62bc.js";import"react/jsx-runtime";import"react";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";
package/lib/theme.js CHANGED
@@ -1 +1 @@
1
- export{pv as Provider,pw as animations,px as opacity,py as palettes}from"./chunks/ui-components-B-AB4_8e.js";import"react/jsx-runtime";import"react";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";
1
+ export{qH as Provider,qI as animations,qJ as opacity,qK as palettes}from"./chunks/ui-components-DRnj62bc.js";import"react/jsx-runtime";import"react";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";
@@ -546,6 +546,298 @@ export interface InsightsGuardrailSeedInput {
546
546
  /** JSON-encoded map[string][]string; keys: allowed_callers | allowed_callees | allowed_egress | allowed_transactions. */
547
547
  items: string;
548
548
  }
549
+ /**
550
+ * The guardrail rule type a recommendation would create.
551
+ *
552
+ * Unrelated to the platform `Recommendation` types in `@/types/recommendations`
553
+ * (InferDBAttributes, UrlTemplatization and friends) — those tune the Odigos
554
+ * pipeline, these are mined security rules.
555
+ *
556
+ * The wire shape is a **flattened union discriminated by `kind`**: there is one
557
+ * `Recommendation` object and the fields of the kind it is not are simply
558
+ * absent. Consumers must `switch (kind)` — never assume a field is there
559
+ * because the other kind always carries it.
560
+ */
561
+ export declare enum InsightsRecommendationKind {
562
+ /** Two span attributes that always agreed on one transaction. Transaction-scoped. */
563
+ AttributeCorrelation = "attribute_correlation",
564
+ /**
565
+ * A service finished learning, so the callers / callees / egress /
566
+ * transactions it was seen with can become its guardrail. Service-scoped,
567
+ * one card per service, ever.
568
+ */
569
+ ServiceGuardrail = "service_guardrail"
570
+ }
571
+ /**
572
+ * The guardrail rule keys a `service_guardrail` recommendation can propose, in
573
+ * the order the engine emits them (and the order the UI renders them).
574
+ *
575
+ * `InsightsRecommendationRule.rule` is a plain **string** on the wire, not an
576
+ * enum — a future server may add a key this build has never heard of, so match
577
+ * on it defensively and fall back to the server-supplied `label`.
578
+ */
579
+ export declare enum InsightsRecommendationRuleKey {
580
+ AllowedCallers = "allowed_callers",
581
+ AllowedCallees = "allowed_callees",
582
+ AllowedEgress = "allowed_egress",
583
+ AllowedTransactions = "allowed_transactions"
584
+ }
585
+ /** Lifecycle bucket. `dismissed` is sticky across re-mining. */
586
+ export declare enum InsightsRecommendationState {
587
+ Open = "open",
588
+ Applied = "applied",
589
+ Dismissed = "dismissed"
590
+ }
591
+ /**
592
+ * How much the engine trusts the relation. `Low` means live traffic has already
593
+ * broken it, so applying would fire violations immediately.
594
+ */
595
+ export declare enum InsightsRecommendationConfidenceLevel {
596
+ High = "high",
597
+ Medium = "medium",
598
+ Low = "low"
599
+ }
600
+ /** One stored sample the relation held on, with the two values it compared. */
601
+ export interface InsightsRecommendationExample {
602
+ traceId: string;
603
+ leftValue: string;
604
+ rightValue: string;
605
+ observedAt: string;
606
+ }
607
+ /**
608
+ * Why the engine believes the relation. The sample stats come from the stored
609
+ * relation samples the mining run read; the live counters come from shadow
610
+ * evaluation against real traffic and keep growing until the recommendation is
611
+ * applied or dismissed.
612
+ */
613
+ export interface InsightsRecommendationConfidence {
614
+ level: InsightsRecommendationConfidenceLevel;
615
+ /**
616
+ * held / observed on the stored samples (0..1).
617
+ * `attribute_correlation` only — absent on a `service_guardrail` card.
618
+ */
619
+ holdRatio?: number | null;
620
+ /**
621
+ * Stored samples where both values were present.
622
+ * `attribute_correlation` only — absent on a `service_guardrail` card.
623
+ */
624
+ observed?: number | null;
625
+ /**
626
+ * Of those, how many satisfied the relation.
627
+ * `attribute_correlation` only — absent on a `service_guardrail` card.
628
+ */
629
+ held?: number | null;
630
+ /**
631
+ * Distinct left-hand values seen agreeing.
632
+ * `attribute_correlation` only — absent on a `service_guardrail` card.
633
+ */
634
+ distinct?: number | null;
635
+ /**
636
+ * Per kind: `attribute_correlation` — relation samples the mining run looked
637
+ * at; `service_guardrail` — promoted transactions whose learned profile
638
+ * seeded the lists. Label it accordingly.
639
+ */
640
+ sampleCount: number;
641
+ /**
642
+ * `attribute_correlation`: live **traces** the relation held on.
643
+ * `service_guardrail`: Σ over `rules[]` of `liveChecked - liveViolated`, i.e.
644
+ * **rule-checks**, not traces — one trace contributes up to one per rule.
645
+ */
646
+ liveHeld: number;
647
+ /**
648
+ * `attribute_correlation`: live **traces** the relation broke on.
649
+ * `service_guardrail`: Σ over `rules[]` of `liveViolated` — again rule-checks.
650
+ */
651
+ liveBroken: number;
652
+ /**
653
+ * Null until the first live trace was evaluated.
654
+ *
655
+ * ⚠ The server emits the Go zero time (`0001-01-01T00:00:00Z`) instead of
656
+ * omitting the field, so treat that value as null — `isLiveTimestamp()` does.
657
+ */
658
+ liveSince?: string | null;
659
+ /** Null until the first live trace was evaluated. Same zero-time caveat as `liveSince`. */
660
+ liveLast?: string | null;
661
+ /** Render-ready evidence lines, e.g. "Held on 50 of 50 stored samples". Never parse them. */
662
+ reasons: string[];
663
+ }
664
+ /**
665
+ * One allowlist rule a `service_guardrail` recommendation would write, with the
666
+ * list as it stands and how live traffic has fared against it while the card
667
+ * sat open (shadow evaluation — nothing is enforced until apply).
668
+ */
669
+ export interface InsightsRecommendationRule {
670
+ /**
671
+ * The catalog rule key — one of `InsightsRecommendationRuleKey` today, but a
672
+ * plain open-ended string on the wire.
673
+ */
674
+ rule: string;
675
+ /** Catalog label, e.g. "Allowed callers". Falls back to the raw key server-side. */
676
+ label: string;
677
+ /** One-line "what it enforces", straight from the catalog. */
678
+ description: string;
679
+ /**
680
+ * The allowlist apply would write: trimmed, de-duplicated, sorted ascending.
681
+ * Never null, and an **empty list is meaningful** — "this service does none
682
+ * of this, so enforcing forbids any".
683
+ *
684
+ * `allowed_transactions` items are `"<KIND>\toperation"`, TAB-separated —
685
+ * split on `\t` to render, never on a space.
686
+ */
687
+ items: string[];
688
+ /** This rule's own level: `low` if violated live, `high` at 50+ live checks, else `medium`. */
689
+ confidence: InsightsRecommendationConfidenceLevel;
690
+ /** Live traces of this service checked silently against the proposed list. */
691
+ liveChecked: number;
692
+ /** Of those, how many carried something outside the list. > 0 means traffic already disagrees. */
693
+ liveViolated: number;
694
+ /** Null until the rule was first checked. Same Go zero-time caveat as the confidence block. */
695
+ liveSince?: string | null;
696
+ /** Null until the rule was first checked. Same Go zero-time caveat as the confidence block. */
697
+ liveLast?: string | null;
698
+ }
699
+ /**
700
+ * One mined recommendation the operator can apply as-is, edit and apply, or
701
+ * dismiss. `title`, `summary`, `whyItMatters` and `confidence.reasons` are
702
+ * written by the engine, so the UI lays them out rather than interpreting the
703
+ * numbers itself.
704
+ *
705
+ * This is a **flattened union discriminated by `kind`**. Only the fields marked
706
+ * required below are present on both kinds; everything else belongs to one kind
707
+ * and is absent — not false, not zero, absent — on the other. And because the
708
+ * server uses `omitempty`, a kind's own field also vanishes when it is
709
+ * zero-valued, so read every optional as optional-with-default.
710
+ */
711
+ export interface InsightsRecommendation {
712
+ id: string;
713
+ kind: InsightsRecommendationKind;
714
+ state: InsightsRecommendationState;
715
+ /** The latest mining run no longer produced this row. Orthogonal to `state`. */
716
+ stale: boolean;
717
+ /** Position among the scope's recommendations, 0 = strongest. Always 0 on a service card. */
718
+ rank: number;
719
+ /**
720
+ * The guardrail this would extend: `transaction` for `attribute_correlation`,
721
+ * `service` for `service_guardrail`.
722
+ */
723
+ scope: InsightsPolicyScope;
724
+ /** Decimal transaction id for `attribute_correlation`, `"<namespace>/<service>"` for `service_guardrail`. */
725
+ scopeKey: string;
726
+ /** `attribute_correlation` only — a service card has no transaction. */
727
+ transactionId?: string | null;
728
+ /** `attribute_correlation` only. */
729
+ transactionKind?: InsightsTransactionKind | null;
730
+ service: string;
731
+ namespace: string;
732
+ /** `attribute_correlation` only — a service card covers every operation. */
733
+ operation?: string | null;
734
+ /**
735
+ * One-line headline, e.g. "resolvePrincipal return.value matches getCart arg.0"
736
+ * or "Lock down account-service". Never parse anything out of it — in
737
+ * particular the rule count is `rules.length`, it is not in the title.
738
+ */
739
+ title: string;
740
+ /** One sentence explaining what this would do and on what evidence. */
741
+ summary: string;
742
+ /** The security story — what breaking this would mean. */
743
+ whyItMatters: string;
744
+ /**
745
+ * `attribute_correlation` only. How the two values relate: `exact`
746
+ * (identical), `core` (identical after a constant prefix/suffix), `digits`
747
+ * (same numeric id), `contains` (one value is embedded in the other).
748
+ */
749
+ transform?: string | null;
750
+ /**
751
+ * `attribute_correlation` only. Guaranteed by the transport rather than by
752
+ * business logic — the same field on both ends of one hop, such as a Kafka
753
+ * message key. Shown as a tag, mined at low severity, and ranked after every
754
+ * business relation. Absent rather than `false` when it does not apply.
755
+ */
756
+ transport?: boolean | null;
757
+ /**
758
+ * `attribute_correlation` only. The exact rule apply would add; edit it and
759
+ * pass it back to apply something else. **Never send it with a
760
+ * `service_guardrail` id** — the server validates the spec before it knows
761
+ * the kind, so it can 400 the whole batch.
762
+ */
763
+ spec?: InsightsCorrelationSpec | null;
764
+ confidence: InsightsRecommendationConfidence;
765
+ /** `attribute_correlation` only. Up to three stored samples the relation held on. */
766
+ examples?: InsightsRecommendationExample[] | null;
767
+ /**
768
+ * `attribute_correlation` only. The transaction's guardrail already has a rule
769
+ * on the same two attributes (e.g. written by hand), so applying would replace it.
770
+ */
771
+ alreadyCovered?: boolean | null;
772
+ /**
773
+ * `service_guardrail` only. The allowlist rules apply would write, in catalog
774
+ * order. Rules the service already enforces (or switched off) are left out,
775
+ * so applying only ever extends a guardrail.
776
+ */
777
+ rules?: InsightsRecommendationRule[] | null;
778
+ /**
779
+ * `service_guardrail` only, and only once applied: the rule keys that apply
780
+ * actually turned on — a subset of `rules[]` when the operator edited first.
781
+ */
782
+ appliedRules?: string[] | null;
783
+ minedAt: string;
784
+ createdAt: string;
785
+ updatedAt: string;
786
+ }
787
+ export interface InsightsRecommendationItemError {
788
+ id: string;
789
+ error: string;
790
+ }
791
+ /**
792
+ * Outcome of a bulk action. Items are independent — one failing does not stop
793
+ * the rest — so `done` and `errors` can both be non-empty. Always check
794
+ * `errors`, not just the absence of a request error.
795
+ */
796
+ export interface InsightsRecommendationBulkResult {
797
+ done: number;
798
+ failed: number;
799
+ errors: InsightsRecommendationItemError[];
800
+ }
801
+ /** One recommendation to apply, optionally with the operator's edits. */
802
+ export interface InsightsRecommendationApplyItemInput {
803
+ id: string;
804
+ /**
805
+ * `attribute_correlation` only. Optional edited rule applied instead of the
806
+ * mined one. Left/right service, span and attr must match the recommendation;
807
+ * name, severity, why, relation and extract regexes may differ.
808
+ *
809
+ * ⚠ Never send it alongside a `service_guardrail` id: the server validates
810
+ * every spec before it knows the item's kind, so an invalid one rejects the
811
+ * **whole** request with a 400, even though it would then be ignored.
812
+ */
813
+ spec?: InsightsCorrelationSpecInput | null;
814
+ /**
815
+ * `service_guardrail` only. Which of the card's rules to turn on — the
816
+ * "edit & apply" subset selector.
817
+ *
818
+ * ⚠ Omitting it, sending `[]`, or sending only blanks all mean **every rule
819
+ * on the card**. There is no way to say "apply nothing": a UI that wants that
820
+ * must not call apply at all. A key that is not on the card fails that one
821
+ * item; a key that has meanwhile been enforced or switched off is skipped
822
+ * silently, and the item only fails when every selected rule was skipped.
823
+ */
824
+ rules?: string[] | null;
825
+ }
826
+ /**
827
+ * How a spec fares on the transaction's stored relation samples. Backs the
828
+ * "edit & apply" flow so the operator sees how often the rule would have held
829
+ * before enforcing it.
830
+ */
831
+ export interface InsightsRecommendationPreview {
832
+ sampleCount: number;
833
+ observed: number;
834
+ held: number;
835
+ distinct: number;
836
+ holdRatio: number;
837
+ examples: InsightsRecommendationExample[];
838
+ /** Up to three samples where the relation did not hold. */
839
+ counterExamples: InsightsRecommendationExample[];
840
+ }
549
841
  export interface InsightsCatalogClass {
550
842
  id: string;
551
843
  label: string;
package/lib/types.js CHANGED
@@ -1 +1 @@
1
- export{f0 as ActionCategoryTypes,bI as ActionKeyTypes,bJ as ActionType,mw as AgentInjectedReason,mx as BooleanOperation,f9 as CloudConnectorFeatureKey,aj as CodeAttributesKeyTypes,my as ConditionType,bg as Crud,ad as CustomInstrumentationsKeyTypes,fJ as DesiredConditionActionItemType,fn as DesiredStateProgress,mz as DestinationTypes,bh as EntityTypes,cm as ExtractionDataFormat,o as FieldTypes,af as GolangCustomProbe,ah as HeadersCollectionKeyTypes,G as InputTypes,mA as InsightsAnomalyClassFindingKind,k6 as InsightsAnomalyResolution,k3 as InsightsAnomalyStatus,mB as InsightsBaselineHistogramUnit,k7 as InsightsBaselineLearningPhase,k5 as InsightsBulkResolution,bX as InsightsCorrelationRelation,c5 as InsightsDeviationClass,bp as InsightsEntityTypes,k4 as InsightsFindingKind,c7 as InsightsLearningConditionType,c9 as InsightsLearningMode,b_ as InsightsPolicyScope,b$ as InsightsRuleMode,ki as InsightsSampleReason,bW as InsightsSeverity,kP as InsightsStorageDiskStatus,mC as InsightsStorageHealthStatus,cZ as InsightsTransactionKind,k2 as InsightsViolationStatus,mD as InstallationMethod,mE as InstallationStatus,mF as InstrumentationAgentKind,mG as InstrumentationAgentTier,ac as InstrumentationRuleType,mH as IntrumentationStatus,ae as JavaCustomProbe,mI as JsonOperation,ck as K8sAttributesFrom,ce as K8sResourceKind,mJ as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,mK as ListDirection,mL as NumberOperation,mM as OtelDistroName,bq as OtherEntityTypes,ai as PayloadCollectionKeyTypes,ag as PhpCustomProbe,P as PlatformType,mN as PodContainerLifecycleStatus,mO as PodContainerStatus,mP as PodPhase,mQ as Profile,X as ProgrammingLanguages,gr as RecommendationApplyExampleType,mR as RecommendationRemediationType,go as RecommendationState,mS as RecommendationType,mT as SIGNAL_KEY_TO_TYPE,mU as SIGNAL_TYPE_TO_KEY,mV as SignalKey,bO as SignalType,mW as SortDirection,S as StatusType,mX as StringOperation,b as Tier,mY as WorkloadRolloutReason,ll as WorkloadRolloutStatus}from"./chunks/ui-components-B-AB4_8e.js";import"react/jsx-runtime";import"react";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";
1
+ export{f0 as ActionCategoryTypes,bI as ActionKeyTypes,bJ as ActionType,nz as AgentInjectedReason,nA as BooleanOperation,f9 as CloudConnectorFeatureKey,aj as CodeAttributesKeyTypes,nB as ConditionType,bg as Crud,ad as CustomInstrumentationsKeyTypes,fJ as DesiredConditionActionItemType,fn as DesiredStateProgress,nC as DestinationTypes,bh as EntityTypes,cm as ExtractionDataFormat,o as FieldTypes,af as GolangCustomProbe,ah as HeadersCollectionKeyTypes,G as InputTypes,nD as InsightsAnomalyClassFindingKind,k6 as InsightsAnomalyResolution,k3 as InsightsAnomalyStatus,nE as InsightsBaselineHistogramUnit,k7 as InsightsBaselineLearningPhase,k5 as InsightsBulkResolution,bX as InsightsCorrelationRelation,c5 as InsightsDeviationClass,bp as InsightsEntityTypes,k4 as InsightsFindingKind,c7 as InsightsLearningConditionType,c9 as InsightsLearningMode,b_ as InsightsPolicyScope,kd as InsightsRecommendationConfidenceLevel,ke as InsightsRecommendationKind,ky as InsightsRecommendationRuleKey,kc as InsightsRecommendationState,b$ as InsightsRuleMode,ll as InsightsSampleReason,bW as InsightsSeverity,lS as InsightsStorageDiskStatus,nF as InsightsStorageHealthStatus,cZ as InsightsTransactionKind,k2 as InsightsViolationStatus,nG as InstallationMethod,nH as InstallationStatus,nI as InstrumentationAgentKind,nJ as InstrumentationAgentTier,ac as InstrumentationRuleType,nK as IntrumentationStatus,ae as JavaCustomProbe,nL as JsonOperation,ck as K8sAttributesFrom,ce as K8sResourceKind,nM as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,nN as ListDirection,nO as NumberOperation,nP as OtelDistroName,bq as OtherEntityTypes,ai as PayloadCollectionKeyTypes,ag as PhpCustomProbe,P as PlatformType,nQ as PodContainerLifecycleStatus,nR as PodContainerStatus,nS as PodPhase,nT as Profile,X as ProgrammingLanguages,gr as RecommendationApplyExampleType,nU as RecommendationRemediationType,go as RecommendationState,nV as RecommendationType,nW as SIGNAL_KEY_TO_TYPE,nX as SIGNAL_TYPE_TO_KEY,nY as SignalKey,bO as SignalType,nZ as SortDirection,S as StatusType,n_ as StringOperation,b as Tier,n$ as WorkloadRolloutReason,mo as WorkloadRolloutStatus}from"./chunks/ui-components-DRnj62bc.js";import"react/jsx-runtime";import"react";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";
package/lib/visuals.js CHANGED
@@ -1 +1 @@
1
- export{jZ as VISUAL_CONNECTION_MORPH_HEIGHT,jY as VISUAL_CONNECTION_MORPH_WIDTH,mZ as VISUAL_ODIGOS_LOGO_HEIGHT,m_ as VISUAL_ODIGOS_LOGO_WIDTH,m$ as VISUAL_TERMINAL_HEIGHT,n0 as VISUAL_TERMINAL_WIDTH,jX as VisualConnectionMorph,b4 as VisualGreenRings,n1 as VisualOdigosLogo,iS as VisualPurpleRings,n2 as VisualTerminal}from"./chunks/ui-components-B-AB4_8e.js";import"react/jsx-runtime";import"react";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";
1
+ export{jZ as VISUAL_CONNECTION_MORPH_HEIGHT,jY as VISUAL_CONNECTION_MORPH_WIDTH,o0 as VISUAL_ODIGOS_LOGO_HEIGHT,o1 as VISUAL_ODIGOS_LOGO_WIDTH,o2 as VISUAL_TERMINAL_HEIGHT,o3 as VISUAL_TERMINAL_WIDTH,jX as VisualConnectionMorph,b4 as VisualGreenRings,o4 as VisualOdigosLogo,iS as VisualPurpleRings,o5 as VisualTerminal}from"./chunks/ui-components-DRnj62bc.js";import"react/jsx-runtime";import"react";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"flubber";import"prism-react-renderer";import"react-error-boundary";import"virtua";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odigos/ui-kit",
3
- "version": "0.0.305",
3
+ "version": "0.0.306",
4
4
  "author": "Odigos",
5
5
  "license": "MIT",
6
6
  "repository": {