@orchestrator-ui/orchestrator-ui-components 8.3.0 → 8.4.1

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 (45) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/.turbo/turbo-test.log +8 -8
  4. package/CHANGELOG.md +21 -0
  5. package/dist/index.d.ts +72 -1034
  6. package/dist/index.js +341 -1505
  7. package/dist/index.js.map +1 -1
  8. package/package.json +11 -15
  9. package/src/components/WfoAvailabilityCheck/WfoAvailabilityCheck.tsx +1 -1
  10. package/src/components/WfoBackendUnavailable/WfoBackendUnavailable.tsx +2 -31
  11. package/src/components/WfoMetadata/WfoMetadataStatusField.tsx +18 -1
  12. package/src/components/WfoProcessList/WfoProcessListDeltaPopover.tsx +1 -1
  13. package/src/components/WfoTable/WfoAdvancedTable/WfoAdvancedTable.tsx +8 -4
  14. package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +36 -25
  15. package/src/components/index.ts +0 -1
  16. package/src/configuration/version.ts +1 -1
  17. package/src/hooks/useBackendAvailability.ts +1 -24
  18. package/src/messages/en-GB.json +2 -63
  19. package/src/messages/nl-NL.json +1 -0
  20. package/src/pages/metadata/WfoScheduleTaskFormPage.tsx +1 -424
  21. package/src/rtk/endpoints/availability.ts +1 -17
  22. package/src/rtk/endpoints/index.ts +0 -1
  23. package/src/utils/getDefaultTableConfig.ts +1 -1
  24. package/src/components/WfoAgent/ExportButton/ExportButton.tsx +0 -86
  25. package/src/components/WfoAgent/ExportButton/index.ts +0 -1
  26. package/src/components/WfoAgent/ExportButton/styles.ts +0 -69
  27. package/src/components/WfoAgent/WfoAgent/WfoAgent.tsx +0 -147
  28. package/src/components/WfoAgent/WfoAgent/index.ts +0 -1
  29. package/src/components/WfoAgent/WfoAgentChart/WfoAgentLineChart.tsx +0 -52
  30. package/src/components/WfoAgent/WfoAgentChart/WfoAgentPieChart.tsx +0 -55
  31. package/src/components/WfoAgent/WfoAgentChart/index.ts +0 -2
  32. package/src/components/WfoAgent/WfoAgentChart/styles.ts +0 -6
  33. package/src/components/WfoAgent/WfoAgentTable/WfoAgentTable.tsx +0 -66
  34. package/src/components/WfoAgent/WfoAgentTable/index.ts +0 -1
  35. package/src/components/WfoAgent/WfoAgentVisualization/WfoAgentVisualization.tsx +0 -54
  36. package/src/components/WfoAgent/WfoAgentVisualization/index.ts +0 -1
  37. package/src/components/WfoAgent/WfoPlanProgress/WfoPlanProgress.tsx +0 -107
  38. package/src/components/WfoAgent/WfoPlanProgress/index.ts +0 -1
  39. package/src/components/WfoAgent/WfoPlanProgress/styles.ts +0 -62
  40. package/src/components/WfoAgent/WfoQueryArtifact/WfoQueryArtifact.tsx +0 -40
  41. package/src/components/WfoAgent/WfoQueryArtifact/index.ts +0 -1
  42. package/src/components/WfoAgent/index.ts +0 -7
  43. package/src/hooks/useAgentPlanEvents.ts +0 -187
  44. package/src/rtk/endpoints/agentExport.ts +0 -23
  45. package/src/rtk/endpoints/agentQueryResults.ts +0 -19
@@ -1,147 +0,0 @@
1
- import React, { useCallback, useRef } from 'react';
2
-
3
- import { useTranslations } from 'next-intl';
4
-
5
- import { useRenderToolCall } from '@copilotkit/react-core';
6
- import { CopilotChat } from '@copilotkit/react-ui';
7
- import type { RenderMessageProps } from '@copilotkit/react-ui';
8
-
9
- import { WfoAvailabilityCheck } from '@/components/WfoAvailabilityCheck';
10
- import { getPageTemplateStyles } from '@/components/WfoPageTemplate/WfoPageTemplate/styles';
11
- import { useWithOrchestratorTheme } from '@/hooks';
12
- import { type PlanExecutionState, useAgentPlanEvents } from '@/hooks/useAgentPlanEvents';
13
- import { useAgentAvailability } from '@/hooks/useBackendAvailability';
14
- import { ExportArtifact, QueryArtifact } from '@/types';
15
-
16
- import { ExportButton } from '../ExportButton';
17
- import { WfoPlanProgress } from '../WfoPlanProgress';
18
- import { WfoQueryArtifact } from '../WfoQueryArtifact';
19
-
20
- export function WfoAgent() {
21
- const tPage = useTranslations('agent.page');
22
-
23
- const { NAVIGATION_HEIGHT } = useWithOrchestratorTheme(getPageTemplateStyles);
24
- const agentAvailability = useAgentAvailability();
25
- const planProgress = useAgentPlanEvents();
26
-
27
- // Use a ref so the RenderMessage callback stays stable (no blink)
28
- // while always reading the latest plan progress
29
- const planProgressRef = useRef<PlanExecutionState>(planProgress);
30
- planProgressRef.current = planProgress;
31
-
32
- const RenderMessage = useCallback(
33
- ({
34
- message,
35
- messages,
36
- inProgress,
37
- index,
38
- isCurrentMessage,
39
- AssistantMessage,
40
- UserMessage,
41
- ImageRenderer,
42
- onRegenerate,
43
- ...rest
44
- }: RenderMessageProps) => {
45
- if (message.role === 'user') {
46
- return UserMessage ?
47
- <UserMessage key={index} rawData={message} message={message} ImageRenderer={ImageRenderer!} />
48
- : null;
49
- }
50
-
51
- if (message.role === 'assistant') {
52
- const progress = planProgressRef.current;
53
-
54
- // Show plan progress on the first assistant message
55
- // after the last user message (the active response)
56
- const lastUserIndex = [...messages].reverse().findIndex((msg) => msg.role === 'user');
57
- const firstAssistantAfterUser = lastUserIndex >= 0 ? messages.length - lastUserIndex : -1;
58
- const showPlanProgress = index === firstAssistantAfterUser && (progress.planning || progress.steps.length > 0);
59
-
60
- return (
61
- <>
62
- {showPlanProgress && <WfoPlanProgress executionState={progress} />}
63
- {AssistantMessage && (
64
- <AssistantMessage
65
- key={index}
66
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- generativeUI is an internal CopilotKit property not in public types
67
- subComponent={(message as any).generativeUI?.()}
68
- rawData={message}
69
- message={message}
70
- messages={messages}
71
- isLoading={inProgress && isCurrentMessage && !message.content}
72
- isGenerating={inProgress && isCurrentMessage && !!message.content}
73
- isCurrentMessage={isCurrentMessage}
74
- onRegenerate={() => onRegenerate?.(message.id)}
75
- feedback={rest.messageFeedback?.[message.id] || null}
76
- ImageRenderer={ImageRenderer!}
77
- {...rest}
78
- />
79
- )}
80
- </>
81
- );
82
- }
83
-
84
- return null;
85
- },
86
- [],
87
- );
88
-
89
- const renderQueryResult = ({ result }: { result?: unknown }) => {
90
- if (!result) {
91
- return <></>;
92
- }
93
- return <WfoQueryArtifact artifact={result as QueryArtifact} />;
94
- };
95
-
96
- useRenderToolCall({ name: 'run_search', render: renderQueryResult });
97
- useRenderToolCall({ name: 'run_aggregation', render: renderQueryResult });
98
-
99
- useRenderToolCall({
100
- name: 'prepare_export',
101
- render: ({ result }) => {
102
- if (!result) {
103
- return <></>;
104
- }
105
- return <ExportButton artifact={result as ExportArtifact} />;
106
- },
107
- });
108
-
109
- return (
110
- <WfoAvailabilityCheck featureType="agent" availability={agentAvailability}>
111
- <div style={{ height: `calc(90vh - ${NAVIGATION_HEIGHT}px)` }}>
112
- <style>{`
113
- .copilotKitChat {
114
- height: 100%;
115
- display: flex;
116
- flex-direction: column;
117
- }
118
- `}</style>
119
- <CopilotChat
120
- RenderMessage={RenderMessage}
121
- labels={{
122
- title: tPage('copilot.title'),
123
- initial: tPage('copilot.initial'),
124
- }}
125
- suggestions={[
126
- {
127
- title: tPage('suggestions.findActiveSubscriptions'),
128
- message: tPage('suggestions.findActiveSubscriptions'),
129
- },
130
- {
131
- title: tPage('suggestions.showTerminatedWorkflows'),
132
- message: tPage('suggestions.showTerminatedWorkflows'),
133
- },
134
- {
135
- title: tPage('suggestions.listAllSubscriptionsAndExport'),
136
- message: tPage('suggestions.listAllSubscriptionsAndExport'),
137
- },
138
- {
139
- title: tPage('suggestions.showActiveSubscriptionsPerMonth'),
140
- message: tPage('suggestions.showActiveSubscriptionsPerMonth'),
141
- },
142
- ]}
143
- />
144
- </div>
145
- </WfoAvailabilityCheck>
146
- );
147
- }
@@ -1 +0,0 @@
1
- export * from './WfoAgent';
@@ -1,52 +0,0 @@
1
- import React from 'react';
2
-
3
- import { Axis, Chart, DARK_THEME, LIGHT_THEME, LineSeries, Position, Settings } from '@elastic/charts';
4
- import '@elastic/charts/dist/theme_only_dark.css';
5
- import '@elastic/charts/dist/theme_only_light.css';
6
-
7
- import { useOrchestratorTheme } from '@/hooks';
8
- import { QueryResultsData } from '@/types';
9
-
10
- export type WfoAgentLineChartProps = {
11
- aggregationData: QueryResultsData;
12
- };
13
-
14
- export function WfoAgentLineChart({ aggregationData }: WfoAgentLineChartProps) {
15
- const { results } = aggregationData;
16
- const { isDarkModeActive, multiplyByBaseUnit } = useOrchestratorTheme();
17
- const chartBaseTheme = isDarkModeActive ? DARK_THEME : LIGHT_THEME;
18
-
19
- const firstResult = results[0];
20
- const groupKeys = Object.keys(firstResult.group_values);
21
- const aggKeys = Object.keys(firstResult.aggregations);
22
-
23
- const xKey = groupKeys[0];
24
- const chartData = results.map((result, index) => ({
25
- x: index,
26
- xLabel: result.group_values[xKey],
27
- ...result.aggregations,
28
- }));
29
-
30
- return (
31
- <Chart size={{ height: multiplyByBaseUnit(30) }}>
32
- <Settings showLegend baseTheme={chartBaseTheme} />
33
- <Axis
34
- id="bottom"
35
- position={Position.Bottom}
36
- title={xKey.replace(/_/g, ' ')}
37
- tickFormat={(d) => chartData[d]?.xLabel?.split(' ')[0] || d}
38
- />
39
- <Axis id="left" position={Position.Left} title="Count" />
40
- {aggKeys.map((aggKey) => (
41
- <LineSeries
42
- key={aggKey}
43
- id={aggKey}
44
- name={aggKey.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase())}
45
- data={chartData}
46
- xAccessor="x"
47
- yAccessors={[aggKey]}
48
- />
49
- ))}
50
- </Chart>
51
- );
52
- }
@@ -1,55 +0,0 @@
1
- import React from 'react';
2
-
3
- import { Chart, DARK_THEME, LIGHT_THEME, Partition, PartitionLayout, Position, Settings } from '@elastic/charts';
4
- import '@elastic/charts/dist/theme_only_dark.css';
5
- import '@elastic/charts/dist/theme_only_light.css';
6
-
7
- import { QueryResultsData } from '@/types';
8
-
9
- import { useOrchestratorTheme } from '../../../hooks';
10
- import { containerStyle } from './styles';
11
-
12
- export type WfoAgentPieChartProps = {
13
- aggregationData: QueryResultsData;
14
- };
15
-
16
- export function WfoAgentPieChart({ aggregationData }: WfoAgentPieChartProps) {
17
- const { results } = aggregationData;
18
- const { isDarkModeActive, multiplyByBaseUnit } = useOrchestratorTheme();
19
- const chartBaseTheme = isDarkModeActive ? DARK_THEME : LIGHT_THEME;
20
-
21
- const firstResult = results[0];
22
- const groupKeys = Object.keys(firstResult.group_values);
23
- const aggKeys = Object.keys(firstResult.aggregations);
24
-
25
- // Use the first group key for labels and first aggregation for values
26
- const groupKey = groupKeys[0];
27
- const aggKey = aggKeys[0];
28
- const pieData = results.map((result) => ({
29
- label: result.group_values[groupKey],
30
- value: result.aggregations[aggKey],
31
- }));
32
-
33
- return (
34
- <div css={containerStyle}>
35
- <Chart size={{ height: multiplyByBaseUnit(25) }}>
36
- <Settings showLegend legendPosition={Position.Right} baseTheme={chartBaseTheme} />
37
- <Partition
38
- id="pieByPR"
39
- data={pieData}
40
- layout={PartitionLayout.sunburst}
41
- valueAccessor={(d) => d.value}
42
- layers={[
43
- {
44
- groupByRollup: (d: (typeof pieData)[0]) => d.label,
45
- shape: {
46
- fillColor: (_, sortIndex) => chartBaseTheme.colors.vizColors![sortIndex],
47
- },
48
- },
49
- ]}
50
- clockwiseSectors={false}
51
- />
52
- </Chart>
53
- </div>
54
- );
55
- }
@@ -1,2 +0,0 @@
1
- export * from './WfoAgentLineChart';
2
- export * from './WfoAgentPieChart';
@@ -1,6 +0,0 @@
1
- import { css } from '@emotion/react';
2
-
3
- export const containerStyle = css({
4
- maxWidth: '50%',
5
- marginRight: 'auto',
6
- });
@@ -1,66 +0,0 @@
1
- import React from 'react';
2
-
3
- import { EuiBasicTable, EuiBasicTableColumn } from '@elastic/eui';
4
-
5
- import { QueryResultsData, ResultRow } from '@/types';
6
-
7
- export type WfoAgentTableProps = {
8
- aggregationData: QueryResultsData;
9
- };
10
-
11
- const formatColumnName = (key: string) => key.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase());
12
-
13
- export function WfoAgentTable({ aggregationData }: WfoAgentTableProps) {
14
- const { results } = aggregationData;
15
- const [pageIndex, setPageIndex] = React.useState(0);
16
- const [pageSize, setPageSize] = React.useState(5);
17
-
18
- const columns: EuiBasicTableColumn<ResultRow>[] = React.useMemo(() => {
19
- if (results.length === 0) return [];
20
-
21
- const firstResult = results[0];
22
- const groupKeys = Object.keys(firstResult.group_values);
23
- const aggKeys = Object.keys(firstResult.aggregations);
24
-
25
- const groupColumns: EuiBasicTableColumn<ResultRow>[] = groupKeys.map((key) => ({
26
- field: 'group_values' as keyof ResultRow,
27
- name: formatColumnName(key),
28
- render: (_: unknown, record: ResultRow) => record.group_values[key],
29
- }));
30
-
31
- const aggColumns: EuiBasicTableColumn<ResultRow>[] = aggKeys.map((key) => ({
32
- field: 'aggregations' as keyof ResultRow,
33
- name: formatColumnName(key),
34
- render: (_: unknown, record: ResultRow) => record.aggregations[key],
35
- }));
36
-
37
- return [...groupColumns, ...aggColumns];
38
- }, [results]);
39
-
40
- const startIndex = pageIndex * pageSize;
41
- const paginatedItems = results.slice(startIndex, startIndex + pageSize);
42
-
43
- const pagination = {
44
- pageIndex,
45
- pageSize,
46
- totalItemCount: results.length,
47
- pageSizeOptions: [5, 10, 25, 50],
48
- };
49
-
50
- const onTableChange = ({ page }: { page?: { index: number; size: number } }) => {
51
- if (page) {
52
- setPageIndex(page.index);
53
- setPageSize(page.size);
54
- }
55
- };
56
-
57
- return (
58
- <EuiBasicTable
59
- items={paginatedItems}
60
- columns={columns}
61
- tableLayout="auto"
62
- pagination={pagination}
63
- onChange={onTableChange}
64
- />
65
- );
66
- }
@@ -1 +0,0 @@
1
- export * from './WfoAgentTable';
@@ -1,54 +0,0 @@
1
- import React from 'react';
2
-
3
- import { useTranslations } from 'next-intl';
4
-
5
- import { EuiText } from '@elastic/eui';
6
-
7
- import { QueryResultsData, VisualizationType } from '@/types';
8
-
9
- import { WfoAgentLineChart } from '../WfoAgentChart/WfoAgentLineChart';
10
- import { WfoAgentPieChart } from '../WfoAgentChart/WfoAgentPieChart';
11
- import { WfoAgentTable } from '../WfoAgentTable';
12
-
13
- export type WfoAgentVisualizationProps = {
14
- aggregationData: QueryResultsData;
15
- };
16
-
17
- export function WfoAgentVisualization({ aggregationData }: WfoAgentVisualizationProps) {
18
- const { visualization_type, results } = aggregationData;
19
- const t = useTranslations('agent.page.visualization');
20
-
21
- if (!results || results.length === 0) {
22
- return (
23
- <EuiText size="s">
24
- <p>{t('noDataAvailable')}</p>
25
- </EuiText>
26
- );
27
- }
28
-
29
- // For charts (pie/line), validate data structure
30
- const visualizationType = visualization_type?.type;
31
- if (visualizationType === VisualizationType.PIE || visualizationType === VisualizationType.LINE) {
32
- const firstResult = results[0];
33
- const groupKeys = Object.keys(firstResult.group_values);
34
- const aggKeys = Object.keys(firstResult.aggregations);
35
-
36
- if (groupKeys.length === 0 || aggKeys.length === 0) {
37
- return (
38
- <EuiText size="s">
39
- <p>{t('invalidDataStructure')}</p>
40
- </EuiText>
41
- );
42
- }
43
- }
44
-
45
- switch (visualizationType) {
46
- case VisualizationType.PIE:
47
- return <WfoAgentPieChart aggregationData={aggregationData} />;
48
- case VisualizationType.LINE:
49
- return <WfoAgentLineChart aggregationData={aggregationData} />;
50
- case VisualizationType.TABLE:
51
- default:
52
- return <WfoAgentTable aggregationData={aggregationData} />;
53
- }
54
- }
@@ -1 +0,0 @@
1
- export * from './WfoAgentVisualization';
@@ -1,107 +0,0 @@
1
- import React, { useState } from 'react';
2
-
3
- import { useTranslations } from 'next-intl';
4
-
5
- import { EuiLoadingSpinner, EuiPanel, EuiText } from '@elastic/eui';
6
-
7
- import { useWithOrchestratorTheme } from '@/hooks';
8
- import type { PlanExecutionState } from '@/hooks/useAgentPlanEvents';
9
- import { useOrchestratorTheme } from '@/hooks/useOrchestratorTheme';
10
- import { WfoCheckmarkCircleFill, WfoChevronDown, WfoChevronUp, WfoMinusCircleOutline } from '@/icons';
11
-
12
- import { getWfoPlanProgressStyles } from './styles';
13
-
14
- type WfoPlanProgressProps = {
15
- executionState: PlanExecutionState;
16
- };
17
-
18
- export const WfoPlanProgress = ({ executionState }: WfoPlanProgressProps) => {
19
- const [expandedSteps, setExpandedSteps] = useState<Set<string>>(new Set());
20
- const t = useTranslations('agent.page.planProgress');
21
- const { theme } = useOrchestratorTheme();
22
-
23
- const { containerStyle, headerStyle, rowStyle, reasoningStyle, toolCallsToggleStyle, toolCallsListStyle, iconSize } =
24
- useWithOrchestratorTheme(getWfoPlanProgressStyles);
25
-
26
- if (!executionState.planning && executionState.steps.length === 0) {
27
- return null;
28
- }
29
-
30
- const toggleStep = (stepName: string) => {
31
- setExpandedSteps((prev) => {
32
- const next = new Set(prev);
33
- if (next.has(stepName)) {
34
- next.delete(stepName);
35
- } else {
36
- next.add(stepName);
37
- }
38
- return next;
39
- });
40
- };
41
-
42
- const completedCount = executionState.steps.filter((s) => s.status === 'completed').length;
43
- const totalCount = executionState.steps.length;
44
- const allDone = totalCount > 0 && completedCount === totalCount;
45
-
46
- const headerLabel =
47
- executionState.planning ? t('planning')
48
- : allDone ? t('completed')
49
- : t('executing', { completed: completedCount, total: totalCount });
50
-
51
- const StatusIcon = ({ status }: { status: string }) => {
52
- if (status === 'completed')
53
- return <WfoCheckmarkCircleFill color={theme.colors.success} width={iconSize} height={iconSize} />;
54
- if (status === 'pending')
55
- return <WfoMinusCircleOutline color={theme.colors.textSubdued} width={iconSize} height={iconSize} />;
56
- return <EuiLoadingSpinner size="s" />;
57
- };
58
-
59
- return (
60
- <EuiPanel hasBorder paddingSize="s" css={containerStyle}>
61
- <div css={headerStyle}>
62
- {allDone ?
63
- <WfoCheckmarkCircleFill color={theme.colors.success} width={iconSize} height={iconSize} />
64
- : <EuiLoadingSpinner size="s" />}
65
- <span>{headerLabel}</span>
66
- </div>
67
- {executionState.steps.map((step) => {
68
- const isExpanded = expandedSteps.has(step.step_name);
69
- const hasToolCalls = step.tool_calls.length > 0;
70
-
71
- return (
72
- <div key={step.step_name}>
73
- <div css={rowStyle}>
74
- <StatusIcon status={step.status} />
75
- <EuiText size="s" color={step.status === 'pending' ? 'subdued' : undefined}>
76
- {step.step_name}
77
- </EuiText>
78
- {hasToolCalls && (
79
- <span css={toolCallsToggleStyle} onClick={() => toggleStep(step.step_name)}>
80
- {step.tool_calls.length}
81
- {isExpanded ?
82
- <WfoChevronUp width={iconSize} height={iconSize} />
83
- : <WfoChevronDown width={iconSize} height={iconSize} />}
84
- </span>
85
- )}
86
- </div>
87
- {step.reasoning && (
88
- <EuiText size="xs" color="subdued" css={reasoningStyle}>
89
- {step.reasoning}
90
- </EuiText>
91
- )}
92
- {isExpanded && hasToolCalls && (
93
- <div css={toolCallsListStyle}>
94
- {step.tool_calls.map((tc) => (
95
- <EuiText size="xs" key={tc.id} css={rowStyle}>
96
- <StatusIcon status={tc.status === 'complete' ? 'completed' : 'active'} />
97
- <span>{tc.name}</span>
98
- </EuiText>
99
- ))}
100
- </div>
101
- )}
102
- </div>
103
- );
104
- })}
105
- </EuiPanel>
106
- );
107
- };
@@ -1 +0,0 @@
1
- export { WfoPlanProgress } from './WfoPlanProgress';
@@ -1,62 +0,0 @@
1
- import { css } from '@emotion/react';
2
-
3
- import { WfoThemeHelpers } from '@/hooks';
4
-
5
- export const getWfoPlanProgressStyles = ({ theme }: WfoThemeHelpers) => {
6
- const iconSize = 14;
7
-
8
- const containerStyle = css({
9
- maxWidth: '50%',
10
- marginRight: 'auto',
11
- marginBottom: theme.size.s,
12
- fontSize: theme.size.m,
13
- });
14
-
15
- const headerStyle = css({
16
- display: 'flex',
17
- alignItems: 'center',
18
- gap: theme.size.s,
19
- paddingBottom: theme.size.s,
20
- marginBottom: theme.size.xs,
21
- borderBottom: `${theme.border.width.thin} solid ${theme.colors.borderBaseSubdued}`,
22
- fontWeight: theme.font.weight.semiBold,
23
- });
24
-
25
- const rowStyle = css({
26
- display: 'flex',
27
- alignItems: 'center',
28
- gap: theme.size.s,
29
- padding: `${theme.size.xxs} 0`,
30
- });
31
-
32
- const reasoningStyle = css({
33
- marginLeft: `calc(${iconSize}px + ${theme.size.s})`,
34
- });
35
-
36
- const toolCallsToggleStyle = css({
37
- display: 'inline-flex',
38
- alignItems: 'center',
39
- gap: theme.size.xxs,
40
- cursor: 'pointer',
41
- fontSize: theme.size.s,
42
- color: theme.colors.textSubdued,
43
- marginLeft: 'auto',
44
- '&:hover': {
45
- color: theme.colors.textParagraph,
46
- },
47
- });
48
-
49
- const toolCallsListStyle = css({
50
- paddingLeft: `calc(${iconSize}px + ${theme.size.s})`,
51
- });
52
-
53
- return {
54
- containerStyle,
55
- headerStyle,
56
- rowStyle,
57
- reasoningStyle,
58
- toolCallsToggleStyle,
59
- toolCallsListStyle,
60
- iconSize,
61
- };
62
- };
@@ -1,40 +0,0 @@
1
- import React from 'react';
2
-
3
- import { useTranslations } from 'next-intl';
4
-
5
- import { EuiText } from '@elastic/eui';
6
-
7
- import { WfoLoading } from '@/components';
8
- import { useGetAgentQueryResultsQuery } from '@/rtk/endpoints/agentQueryResults';
9
- import { QueryArtifact } from '@/types';
10
-
11
- import { WfoAgentVisualization } from '../WfoAgentVisualization';
12
-
13
- export type WfoQueryArtifactProps = {
14
- artifact: QueryArtifact;
15
- };
16
-
17
- export function WfoQueryArtifact({ artifact }: WfoQueryArtifactProps) {
18
- const t = useTranslations('agent.page.visualization');
19
- const { data, isLoading, isError } = useGetAgentQueryResultsQuery(artifact.query_id);
20
-
21
- if (isLoading) {
22
- return <WfoLoading />;
23
- }
24
-
25
- if (isError || !data) {
26
- return (
27
- <EuiText size="s" color="danger">
28
- <p>{t('noDataAvailable')}</p>
29
- </EuiText>
30
- );
31
- }
32
-
33
- // Use the visualization_type from the artifact (set by the LLM) rather than the response
34
- const aggregationData = {
35
- ...data,
36
- visualization_type: artifact.visualization_type,
37
- };
38
-
39
- return <WfoAgentVisualization aggregationData={aggregationData} />;
40
- }
@@ -1 +0,0 @@
1
- export * from './WfoQueryArtifact';
@@ -1,7 +0,0 @@
1
- export * from './WfoAgent';
2
- export * from './WfoAgentTable';
3
- export * from './WfoAgentChart/WfoAgentLineChart';
4
- export * from './WfoAgentChart/WfoAgentPieChart';
5
- export * from './WfoAgentVisualization';
6
- export * from './WfoPlanProgress';
7
- export * from './WfoQueryArtifact';