@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.
- package/.turbo/turbo-build.log +7 -7
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +8 -8
- package/CHANGELOG.md +21 -0
- package/dist/index.d.ts +72 -1034
- package/dist/index.js +341 -1505
- package/dist/index.js.map +1 -1
- package/package.json +11 -15
- package/src/components/WfoAvailabilityCheck/WfoAvailabilityCheck.tsx +1 -1
- package/src/components/WfoBackendUnavailable/WfoBackendUnavailable.tsx +2 -31
- package/src/components/WfoMetadata/WfoMetadataStatusField.tsx +18 -1
- package/src/components/WfoProcessList/WfoProcessListDeltaPopover.tsx +1 -1
- package/src/components/WfoTable/WfoAdvancedTable/WfoAdvancedTable.tsx +8 -4
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +36 -25
- package/src/components/index.ts +0 -1
- package/src/configuration/version.ts +1 -1
- package/src/hooks/useBackendAvailability.ts +1 -24
- package/src/messages/en-GB.json +2 -63
- package/src/messages/nl-NL.json +1 -0
- package/src/pages/metadata/WfoScheduleTaskFormPage.tsx +1 -424
- package/src/rtk/endpoints/availability.ts +1 -17
- package/src/rtk/endpoints/index.ts +0 -1
- package/src/utils/getDefaultTableConfig.ts +1 -1
- package/src/components/WfoAgent/ExportButton/ExportButton.tsx +0 -86
- package/src/components/WfoAgent/ExportButton/index.ts +0 -1
- package/src/components/WfoAgent/ExportButton/styles.ts +0 -69
- package/src/components/WfoAgent/WfoAgent/WfoAgent.tsx +0 -147
- package/src/components/WfoAgent/WfoAgent/index.ts +0 -1
- package/src/components/WfoAgent/WfoAgentChart/WfoAgentLineChart.tsx +0 -52
- package/src/components/WfoAgent/WfoAgentChart/WfoAgentPieChart.tsx +0 -55
- package/src/components/WfoAgent/WfoAgentChart/index.ts +0 -2
- package/src/components/WfoAgent/WfoAgentChart/styles.ts +0 -6
- package/src/components/WfoAgent/WfoAgentTable/WfoAgentTable.tsx +0 -66
- package/src/components/WfoAgent/WfoAgentTable/index.ts +0 -1
- package/src/components/WfoAgent/WfoAgentVisualization/WfoAgentVisualization.tsx +0 -54
- package/src/components/WfoAgent/WfoAgentVisualization/index.ts +0 -1
- package/src/components/WfoAgent/WfoPlanProgress/WfoPlanProgress.tsx +0 -107
- package/src/components/WfoAgent/WfoPlanProgress/index.ts +0 -1
- package/src/components/WfoAgent/WfoPlanProgress/styles.ts +0 -62
- package/src/components/WfoAgent/WfoQueryArtifact/WfoQueryArtifact.tsx +0 -40
- package/src/components/WfoAgent/WfoQueryArtifact/index.ts +0 -1
- package/src/components/WfoAgent/index.ts +0 -7
- package/src/hooks/useAgentPlanEvents.ts +0 -187
- package/src/rtk/endpoints/agentExport.ts +0 -23
- package/src/rtk/endpoints/agentQueryResults.ts +0 -19
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import type { AgentSubscriber } from '@ag-ui/client';
|
|
4
|
-
import { useAgent } from '@copilotkit/react-core/v2';
|
|
5
|
-
|
|
6
|
-
/** AG-UI custom event names emitted by the backend agent. */
|
|
7
|
-
enum AgentEvent {
|
|
8
|
-
PLAN_CREATED = 'PLAN_CREATED',
|
|
9
|
-
STEP_ACTIVE = 'AGENT_STEP_ACTIVE',
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/** The backend step name used for the planning phase (not a real task). */
|
|
13
|
-
const PLANNER_STEP_NAME = 'Planner';
|
|
14
|
-
|
|
15
|
-
export type ToolCallState = {
|
|
16
|
-
id: string;
|
|
17
|
-
name: string;
|
|
18
|
-
status: 'executing' | 'complete';
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type PlanStep = {
|
|
22
|
-
step_name: string;
|
|
23
|
-
reasoning: string | null;
|
|
24
|
-
status: 'pending' | 'active' | 'completed';
|
|
25
|
-
tool_calls: ToolCallState[];
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export type PlanExecutionState = {
|
|
29
|
-
planning: boolean;
|
|
30
|
-
steps: PlanStep[];
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const initialState: PlanExecutionState = {
|
|
34
|
-
planning: false,
|
|
35
|
-
steps: [],
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const updateSteps = (
|
|
39
|
-
steps: PlanStep[],
|
|
40
|
-
predicate: (step: PlanStep) => boolean,
|
|
41
|
-
updater: (step: PlanStep) => PlanStep,
|
|
42
|
-
): PlanStep[] => steps.map((step) => (predicate(step) ? updater(step) : step));
|
|
43
|
-
|
|
44
|
-
export function useAgentPlanEvents(agentId: string = 'query_agent'): PlanExecutionState {
|
|
45
|
-
const { agent } = useAgent({ agentId });
|
|
46
|
-
const [executionState, setExecutionState] = useState<PlanExecutionState>(initialState);
|
|
47
|
-
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
if (!agent) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const subscriber: AgentSubscriber = {
|
|
54
|
-
onCustomEvent: (params) => {
|
|
55
|
-
const event = params?.event;
|
|
56
|
-
if (!event) return;
|
|
57
|
-
|
|
58
|
-
if (event.name === AgentEvent.PLAN_CREATED) {
|
|
59
|
-
const tasks = event.value as Array<{
|
|
60
|
-
skillName: string;
|
|
61
|
-
reasoning: string;
|
|
62
|
-
}>;
|
|
63
|
-
if (!Array.isArray(tasks)) return;
|
|
64
|
-
|
|
65
|
-
setExecutionState({
|
|
66
|
-
planning: false,
|
|
67
|
-
steps: tasks.map((task) => ({
|
|
68
|
-
step_name: task.skillName,
|
|
69
|
-
reasoning: task.reasoning,
|
|
70
|
-
status: 'pending' as const,
|
|
71
|
-
tool_calls: [],
|
|
72
|
-
})),
|
|
73
|
-
});
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (event.name === AgentEvent.STEP_ACTIVE) {
|
|
78
|
-
const stepName = event.value?.step;
|
|
79
|
-
if (!stepName) return;
|
|
80
|
-
|
|
81
|
-
if (stepName === PLANNER_STEP_NAME) {
|
|
82
|
-
setExecutionState((prev) => ({
|
|
83
|
-
...prev,
|
|
84
|
-
planning: true,
|
|
85
|
-
}));
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const reasoning = event.value?.reasoning ?? null;
|
|
90
|
-
|
|
91
|
-
setExecutionState((prev) => {
|
|
92
|
-
// Mark previous active step as completed
|
|
93
|
-
const steps = updateSteps(
|
|
94
|
-
prev.steps,
|
|
95
|
-
(step) => step.status === 'active',
|
|
96
|
-
(step) => ({ ...step, status: 'completed' as const }),
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
// If step already exists (from PLAN_CREATED), activate it
|
|
100
|
-
const existingIndex = steps.findIndex((step) => step.step_name === stepName);
|
|
101
|
-
if (existingIndex >= 0) {
|
|
102
|
-
steps[existingIndex] = {
|
|
103
|
-
...steps[existingIndex],
|
|
104
|
-
status: 'active',
|
|
105
|
-
reasoning: reasoning ?? steps[existingIndex].reasoning,
|
|
106
|
-
};
|
|
107
|
-
} else {
|
|
108
|
-
steps.push({
|
|
109
|
-
step_name: stepName,
|
|
110
|
-
reasoning,
|
|
111
|
-
status: 'active',
|
|
112
|
-
tool_calls: [],
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return { planning: false, steps };
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
onToolCallStartEvent: ({ event }) => {
|
|
122
|
-
setExecutionState((prev) => {
|
|
123
|
-
const currentStep = prev.steps.find((step) => step.status === 'active');
|
|
124
|
-
if (!currentStep) return prev;
|
|
125
|
-
|
|
126
|
-
return {
|
|
127
|
-
...prev,
|
|
128
|
-
steps: updateSteps(
|
|
129
|
-
prev.steps,
|
|
130
|
-
(step) => step.step_name === currentStep.step_name,
|
|
131
|
-
(step) => ({
|
|
132
|
-
...step,
|
|
133
|
-
tool_calls: [
|
|
134
|
-
...step.tool_calls,
|
|
135
|
-
{
|
|
136
|
-
id: event.toolCallId,
|
|
137
|
-
name: event.toolCallName,
|
|
138
|
-
status: 'executing' as const,
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
}),
|
|
142
|
-
),
|
|
143
|
-
};
|
|
144
|
-
});
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
onToolCallEndEvent: ({ event }) => {
|
|
148
|
-
setExecutionState((prev) => ({
|
|
149
|
-
...prev,
|
|
150
|
-
steps: updateSteps(
|
|
151
|
-
prev.steps,
|
|
152
|
-
(step) => step.tool_calls.some((toolCall) => toolCall.id === event.toolCallId),
|
|
153
|
-
(step) => ({
|
|
154
|
-
...step,
|
|
155
|
-
tool_calls: step.tool_calls.map((toolCall) =>
|
|
156
|
-
toolCall.id === event.toolCallId ? { ...toolCall, status: 'complete' as const } : toolCall,
|
|
157
|
-
),
|
|
158
|
-
}),
|
|
159
|
-
),
|
|
160
|
-
}));
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
onRunStartedEvent: () => {
|
|
164
|
-
setExecutionState(initialState);
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
onRunFinishedEvent: () => {
|
|
168
|
-
setExecutionState((prev) => ({
|
|
169
|
-
planning: false,
|
|
170
|
-
steps: updateSteps(
|
|
171
|
-
prev.steps,
|
|
172
|
-
(step) => step.status === 'active',
|
|
173
|
-
(step) => ({ ...step, status: 'completed' as const }),
|
|
174
|
-
),
|
|
175
|
-
}));
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
const subscription = agent.subscribe(subscriber);
|
|
180
|
-
|
|
181
|
-
return () => {
|
|
182
|
-
subscription.unsubscribe();
|
|
183
|
-
};
|
|
184
|
-
}, [agent]);
|
|
185
|
-
|
|
186
|
-
return executionState;
|
|
187
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BaseQueryTypes, orchestratorApi } from '@/rtk';
|
|
2
|
-
import { GraphQLPageInfo } from '@/types';
|
|
3
|
-
|
|
4
|
-
export type AgentExportResponse = {
|
|
5
|
-
page: object[];
|
|
6
|
-
pageInfo?: GraphQLPageInfo;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const agentExportApi = orchestratorApi.injectEndpoints({
|
|
10
|
-
endpoints: (builder) => ({
|
|
11
|
-
getAgentExport: builder.query<AgentExportResponse, string>({
|
|
12
|
-
query: (downloadUrl) => ({
|
|
13
|
-
url: downloadUrl,
|
|
14
|
-
method: 'GET',
|
|
15
|
-
}),
|
|
16
|
-
extraOptions: {
|
|
17
|
-
baseQueryType: BaseQueryTypes.fetch,
|
|
18
|
-
},
|
|
19
|
-
}),
|
|
20
|
-
}),
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export const { useLazyGetAgentExportQuery } = agentExportApi;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SEARCH_QUERY_RESULTS_ENDPOINT } from '@/configuration';
|
|
2
|
-
import { BaseQueryTypes, orchestratorApi } from '@/rtk';
|
|
3
|
-
import { QueryResultsData } from '@/types';
|
|
4
|
-
|
|
5
|
-
const agentQueryResultsApi = orchestratorApi.injectEndpoints({
|
|
6
|
-
endpoints: (builder) => ({
|
|
7
|
-
getAgentQueryResults: builder.query<QueryResultsData, string>({
|
|
8
|
-
query: (queryId) => ({
|
|
9
|
-
url: `${SEARCH_QUERY_RESULTS_ENDPOINT}/${queryId}/results`,
|
|
10
|
-
method: 'GET',
|
|
11
|
-
}),
|
|
12
|
-
extraOptions: {
|
|
13
|
-
baseQueryType: BaseQueryTypes.fetch,
|
|
14
|
-
},
|
|
15
|
-
}),
|
|
16
|
-
}),
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export const { useGetAgentQueryResultsQuery } = agentQueryResultsApi;
|