@elevasis/ui 2.73.0 → 2.75.0
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/dist/api/index.js +3 -3
- package/dist/app/index.d.ts +58 -0
- package/dist/app/index.js +9 -10
- package/dist/auth/index.js +5 -6
- package/dist/charts/index.js +5 -6
- package/dist/chunk-2GIJBHZT.js +60 -0
- package/dist/{chunk-Z4ICFQXG.js → chunk-2ZRY3ARL.js} +1 -1
- package/dist/{chunk-5B2ZFO44.js → chunk-3H5DIJN7.js} +1 -1
- package/dist/{chunk-LZT2H2MA.js → chunk-47YJVIZE.js} +36 -43
- package/dist/{chunk-3TS5U5BL.js → chunk-5RH6NYZH.js} +1 -1
- package/dist/chunk-5SLRGUC4.js +224 -0
- package/dist/{chunk-JYBJMVNY.js → chunk-5VF5LPYS.js} +1 -1
- package/dist/{chunk-SWKAH2YM.js → chunk-6BJ5HMMC.js} +282 -553
- package/dist/{chunk-NI37YNRP.js → chunk-7OOFMEX6.js} +11 -5
- package/dist/{chunk-IBCEAVB2.js → chunk-A2SB32YV.js} +65 -5
- package/dist/{chunk-CJ2232PQ.js → chunk-CRPH5AAB.js} +1 -1
- package/dist/chunk-D3XXPCCK.js +69 -0
- package/dist/chunk-DMSTDZCJ.js +305 -0
- package/dist/chunk-DTEGVSJ6.js +645 -0
- package/dist/chunk-DVAOCHIF.js +165 -0
- package/dist/chunk-G7O4CBMC.js +231 -0
- package/dist/{chunk-IGBPWD6S.js → chunk-GDTK33QT.js} +5 -3
- package/dist/chunk-ICHDIVQO.js +54 -0
- package/dist/{chunk-U2H3TIHD.js → chunk-IYATYH5I.js} +2 -52
- package/dist/chunk-L3NBMLRN.js +49 -0
- package/dist/{chunk-LEPYXLJ2.js → chunk-LFLM723H.js} +1 -1
- package/dist/chunk-M6VAZAQW.js +45 -0
- package/dist/{chunk-AJOVWB47.js → chunk-MLHZUN2X.js} +6 -3
- package/dist/chunk-N6K2Q5BM.js +393 -0
- package/dist/chunk-NMHQAYZU.js +439 -0
- package/dist/chunk-NYIIRZSA.js +286 -0
- package/dist/{chunk-ETN3TTRT.js → chunk-OGHTJKBV.js} +115 -8
- package/dist/{chunk-M7WWRZ5Z.js → chunk-QFGNRKIE.js} +1 -78
- package/dist/chunk-QFS2GZMV.js +515 -0
- package/dist/{chunk-OCVSPAKM.js → chunk-SB3IHM5Y.js} +1150 -4346
- package/dist/{chunk-4CW2C5BD.js → chunk-SEYOVNS5.js} +1 -1
- package/dist/chunk-SN7X5N2A.js +116 -0
- package/dist/{chunk-PQ4B62HH.js → chunk-TX3UHDL5.js} +2 -2
- package/dist/chunk-VM2OWOXL.js +24 -0
- package/dist/{chunk-ZDKPHFTH.js → chunk-VWGCURZF.js} +5 -3
- package/dist/chunk-WDBNW44Z.js +49 -0
- package/dist/chunk-YQQ5GRUR.js +21 -0
- package/dist/{chunk-NHNTX6ZL.js → chunk-ZG6YJUT4.js} +3 -2
- package/dist/components/index.d.ts +228 -6
- package/dist/components/index.js +321 -35
- package/dist/components/navigation/index.js +6 -7
- package/dist/features/auth/index.d.ts +78 -2
- package/dist/features/auth/index.js +18 -9
- package/dist/features/clients/index.js +7 -7
- package/dist/features/content/index.d.ts +226 -5
- package/dist/features/content/index.js +270 -19
- package/dist/features/crm/index.d.ts +58 -0
- package/dist/features/crm/index.js +10 -8
- package/dist/features/dashboard/index.js +9 -8
- package/dist/features/delivery/index.d.ts +58 -0
- package/dist/features/delivery/index.js +23 -7
- package/dist/features/knowledge/index.js +5 -6
- package/dist/features/lead-gen/index.d.ts +9 -15
- package/dist/features/lead-gen/index.js +12 -8
- package/dist/features/monitoring/index.js +11 -9
- package/dist/features/monitoring/requests/index.js +8 -7
- package/dist/features/operations/index.js +15 -11
- package/dist/features/public-agent-chat/index.js +3 -1
- package/dist/features/settings/index.d.ts +66 -3
- package/dist/features/settings/index.js +9 -8
- package/dist/hooks/access/index.js +5 -6
- package/dist/hooks/delivery/index.d.ts +58 -0
- package/dist/hooks/delivery/index.js +3 -2
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +1 -1
- package/dist/hooks/published.d.ts +181 -5
- package/dist/hooks/published.js +22 -6
- package/dist/initialization/index.d.ts +58 -0
- package/dist/knowledge/index.js +167 -11
- package/dist/{knowledge-search-index-RZLIVWPJ.js → knowledge-search-index-6GQK55IQ.js} +1 -1
- package/dist/layout/index.js +8 -9
- package/dist/profile/index.d.ts +58 -0
- package/dist/provider/index.d.ts +77 -1
- package/dist/provider/index.js +5 -6
- package/dist/provider/published.d.ts +105 -1
- package/dist/provider/published.js +5 -6
- package/dist/test-utils/index.d.ts +16 -5
- package/dist/test-utils/index.js +17 -18
- package/dist/types/index.d.ts +73 -1
- package/dist/utils/index.d.ts +83 -3
- package/dist/utils/index.js +1 -1
- package/package.json +10 -5
- package/dist/chunk-6M6OLGQY.js +0 -36
- package/dist/chunk-MKH2KOAO.js +0 -39
- package/dist/hooks/index.css +0 -659
- package/dist/hooks/index.d.ts +0 -14073
- package/dist/hooks/index.js +0 -27
- package/dist/supabase/index.d.ts +0 -7118
- package/dist/supabase/index.js +0 -3
- package/dist/typeform/index.d.ts +0 -462
- package/dist/typeform/index.js +0 -2051
- package/dist/typeform/schemas.d.ts +0 -67
- package/dist/typeform/schemas.js +0 -2
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { acquisitionListKeys } from './chunk-SB3IHM5Y.js';
|
|
2
|
+
import { showApiErrorNotification, showSuccessNotification } from './chunk-ICHDIVQO.js';
|
|
3
|
+
import { APIClientError } from './chunk-A2SB32YV.js';
|
|
4
|
+
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
5
|
+
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { useState, useCallback, useMemo } from 'react';
|
|
8
|
+
|
|
9
|
+
z.object({
|
|
10
|
+
replyBody: z.string().trim().min(1).max(1e4)
|
|
11
|
+
}).strict();
|
|
12
|
+
function deriveActions(deal, actions = []) {
|
|
13
|
+
return actions.filter((a) => a.isAvailableFor(deal)).map(({ key, label, payloadSchema }) => ({ key, label, payloadSchema }));
|
|
14
|
+
}
|
|
15
|
+
function useTableSort(defaultColumn, defaultDirection = "desc") {
|
|
16
|
+
const [sort, setSort] = useState({ column: defaultColumn, direction: defaultDirection });
|
|
17
|
+
const toggleSort = useCallback((column) => {
|
|
18
|
+
setSort((prev) => {
|
|
19
|
+
if (prev.column === column) {
|
|
20
|
+
return { column, direction: prev.direction === "asc" ? "desc" : "asc" };
|
|
21
|
+
}
|
|
22
|
+
return { column, direction: "desc" };
|
|
23
|
+
});
|
|
24
|
+
}, []);
|
|
25
|
+
return { sort, toggleSort };
|
|
26
|
+
}
|
|
27
|
+
function sortData(data, sort, accessors) {
|
|
28
|
+
const accessor = accessors[sort.column];
|
|
29
|
+
if (!accessor) return data;
|
|
30
|
+
return [...data].sort((a, b) => {
|
|
31
|
+
const aVal = accessor(a);
|
|
32
|
+
const bVal = accessor(b);
|
|
33
|
+
if (aVal == null && bVal == null) return 0;
|
|
34
|
+
if (aVal == null) return 1;
|
|
35
|
+
if (bVal == null) return -1;
|
|
36
|
+
let comparison = 0;
|
|
37
|
+
if (typeof aVal === "string" && typeof bVal === "string") {
|
|
38
|
+
comparison = aVal.localeCompare(bVal);
|
|
39
|
+
} else if (typeof aVal === "number" && typeof bVal === "number") {
|
|
40
|
+
comparison = aVal - bVal;
|
|
41
|
+
} else {
|
|
42
|
+
comparison = String(aVal).localeCompare(String(bVal));
|
|
43
|
+
}
|
|
44
|
+
return sort.direction === "asc" ? comparison : -comparison;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function useSortedData(data, defaultColumn, accessors, defaultDirection = "desc") {
|
|
48
|
+
const { sort, toggleSort } = useTableSort(defaultColumn, defaultDirection);
|
|
49
|
+
const sorted = useMemo(() => sortData(data, sort, accessors), [data, sort, accessors]);
|
|
50
|
+
return { sorted, sort, toggleSort };
|
|
51
|
+
}
|
|
52
|
+
var contactKeys = {
|
|
53
|
+
all: ["acquisition-contacts"],
|
|
54
|
+
list: (organizationId, filters) => [...contactKeys.all, "list", organizationId, filters],
|
|
55
|
+
detail: (organizationId, contactId) => [...contactKeys.all, "detail", organizationId, contactId]
|
|
56
|
+
};
|
|
57
|
+
function buildQueryString(params) {
|
|
58
|
+
const searchParams = new URLSearchParams();
|
|
59
|
+
for (const [key, value] of Object.entries(params)) {
|
|
60
|
+
if (value === void 0) continue;
|
|
61
|
+
searchParams.set(key, String(value));
|
|
62
|
+
}
|
|
63
|
+
const queryString = searchParams.toString();
|
|
64
|
+
return queryString ? `?${queryString}` : "";
|
|
65
|
+
}
|
|
66
|
+
function useContacts(filters = {}) {
|
|
67
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
68
|
+
return useQuery({
|
|
69
|
+
queryKey: contactKeys.list(workOSOrganizationId, filters),
|
|
70
|
+
queryFn: async () => {
|
|
71
|
+
const queryString = buildQueryString({
|
|
72
|
+
listId: filters.listId,
|
|
73
|
+
search: filters.search,
|
|
74
|
+
openingLineIsNull: filters.openingLineIsNull,
|
|
75
|
+
batchId: filters.batchId,
|
|
76
|
+
contactStatus: filters.contactStatus,
|
|
77
|
+
limit: filters.limit,
|
|
78
|
+
offset: filters.offset
|
|
79
|
+
});
|
|
80
|
+
return apiRequest(`/acquisition/contacts${queryString}`);
|
|
81
|
+
},
|
|
82
|
+
enabled: isReady && !!workOSOrganizationId,
|
|
83
|
+
retry: (_failureCount, error) => !(error instanceof APIClientError && error.statusCode === 401)
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function useContact(contactId) {
|
|
87
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
88
|
+
return useQuery({
|
|
89
|
+
queryKey: contactKeys.detail(workOSOrganizationId, contactId),
|
|
90
|
+
queryFn: async () => {
|
|
91
|
+
if (!contactId) return null;
|
|
92
|
+
return apiRequest(`/acquisition/contacts/${contactId}`);
|
|
93
|
+
},
|
|
94
|
+
enabled: isReady && !!workOSOrganizationId && !!contactId
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function useCreateContact() {
|
|
98
|
+
const { apiRequest } = useElevasisServices();
|
|
99
|
+
const queryClient = useQueryClient();
|
|
100
|
+
return useMutation({
|
|
101
|
+
mutationFn: (body) => apiRequest("/acquisition/contacts", {
|
|
102
|
+
method: "POST",
|
|
103
|
+
body: JSON.stringify(body)
|
|
104
|
+
}),
|
|
105
|
+
onSuccess: () => {
|
|
106
|
+
queryClient.invalidateQueries({ queryKey: contactKeys.all });
|
|
107
|
+
queryClient.invalidateQueries({ queryKey: ["acquisition-companies"] });
|
|
108
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.all });
|
|
109
|
+
showSuccessNotification("Contact created");
|
|
110
|
+
},
|
|
111
|
+
onError: (error) => {
|
|
112
|
+
showApiErrorNotification(error);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function useUpdateContact(contactId) {
|
|
117
|
+
const { apiRequest } = useElevasisServices();
|
|
118
|
+
const queryClient = useQueryClient();
|
|
119
|
+
return useMutation({
|
|
120
|
+
mutationFn: (body) => apiRequest(`/acquisition/contacts/${contactId}`, {
|
|
121
|
+
method: "PATCH",
|
|
122
|
+
body: JSON.stringify(body)
|
|
123
|
+
}),
|
|
124
|
+
onSuccess: () => {
|
|
125
|
+
queryClient.invalidateQueries({ queryKey: contactKeys.all });
|
|
126
|
+
queryClient.invalidateQueries({ queryKey: ["acquisition-companies"] });
|
|
127
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.all });
|
|
128
|
+
showSuccessNotification("Contact updated");
|
|
129
|
+
},
|
|
130
|
+
onError: (error) => {
|
|
131
|
+
showApiErrorNotification(error);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function useDeleteContacts() {
|
|
136
|
+
const { apiRequest } = useElevasisServices();
|
|
137
|
+
const queryClient = useQueryClient();
|
|
138
|
+
return useMutation({
|
|
139
|
+
mutationFn: async (contactIds) => {
|
|
140
|
+
const uniqueIds = [...new Set(contactIds)].filter(Boolean);
|
|
141
|
+
if (uniqueIds.length === 0) return;
|
|
142
|
+
await Promise.all(
|
|
143
|
+
uniqueIds.map(
|
|
144
|
+
(contactId) => apiRequest(`/acquisition/contacts/${contactId}`, {
|
|
145
|
+
method: "DELETE"
|
|
146
|
+
})
|
|
147
|
+
)
|
|
148
|
+
);
|
|
149
|
+
},
|
|
150
|
+
onSuccess: () => {
|
|
151
|
+
queryClient.invalidateQueries({ queryKey: contactKeys.all });
|
|
152
|
+
queryClient.invalidateQueries({ queryKey: ["acquisition-companies"] });
|
|
153
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.all });
|
|
154
|
+
showSuccessNotification("Contacts deleted");
|
|
155
|
+
},
|
|
156
|
+
onError: (error) => {
|
|
157
|
+
showApiErrorNotification(error);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// src/hooks/acquisition/useCompanies.ts
|
|
163
|
+
var companyKeys = {
|
|
164
|
+
all: ["acquisition-companies"],
|
|
165
|
+
list: (organizationId, filters) => [...companyKeys.all, "list", organizationId, filters],
|
|
166
|
+
facets: (organizationId) => [...companyKeys.all, "facets", organizationId],
|
|
167
|
+
detail: (organizationId, companyId) => [...companyKeys.all, "detail", organizationId, companyId]
|
|
168
|
+
};
|
|
169
|
+
function buildQueryString2(params) {
|
|
170
|
+
const searchParams = new URLSearchParams();
|
|
171
|
+
for (const [key, value] of Object.entries(params)) {
|
|
172
|
+
if (value === void 0) continue;
|
|
173
|
+
searchParams.set(key, String(value));
|
|
174
|
+
}
|
|
175
|
+
const queryString = searchParams.toString();
|
|
176
|
+
return queryString ? `?${queryString}` : "";
|
|
177
|
+
}
|
|
178
|
+
function useCompanies(filters = {}) {
|
|
179
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
180
|
+
return useQuery({
|
|
181
|
+
queryKey: companyKeys.list(workOSOrganizationId, filters),
|
|
182
|
+
queryFn: async () => {
|
|
183
|
+
const queryString = buildQueryString2({
|
|
184
|
+
listId: filters.listId,
|
|
185
|
+
search: filters.search,
|
|
186
|
+
domain: filters.domain,
|
|
187
|
+
website: filters.website,
|
|
188
|
+
segment: filters.segment,
|
|
189
|
+
category: filters.category,
|
|
190
|
+
batchId: filters.batchId,
|
|
191
|
+
status: filters.status,
|
|
192
|
+
includeAll: filters.includeAll,
|
|
193
|
+
limit: filters.limit,
|
|
194
|
+
offset: filters.offset
|
|
195
|
+
});
|
|
196
|
+
return apiRequest(`/acquisition/companies${queryString}`);
|
|
197
|
+
},
|
|
198
|
+
enabled: isReady && !!workOSOrganizationId,
|
|
199
|
+
retry: (_failureCount, error) => !(error instanceof APIClientError && error.statusCode === 401)
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
function useCompanyFacets() {
|
|
203
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
204
|
+
return useQuery({
|
|
205
|
+
queryKey: companyKeys.facets(workOSOrganizationId),
|
|
206
|
+
queryFn: () => apiRequest("/acquisition/companies/facets"),
|
|
207
|
+
enabled: isReady && !!workOSOrganizationId
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
function useCompany(companyId) {
|
|
211
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
212
|
+
return useQuery({
|
|
213
|
+
queryKey: companyKeys.detail(workOSOrganizationId, companyId),
|
|
214
|
+
queryFn: async () => {
|
|
215
|
+
if (!companyId) return null;
|
|
216
|
+
return apiRequest(`/acquisition/companies/${companyId}`);
|
|
217
|
+
},
|
|
218
|
+
enabled: isReady && !!workOSOrganizationId && !!companyId
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function useCreateCompany() {
|
|
222
|
+
const { apiRequest } = useElevasisServices();
|
|
223
|
+
const queryClient = useQueryClient();
|
|
224
|
+
return useMutation({
|
|
225
|
+
mutationFn: (body) => apiRequest("/acquisition/companies", {
|
|
226
|
+
method: "POST",
|
|
227
|
+
body: JSON.stringify(body)
|
|
228
|
+
}),
|
|
229
|
+
onSuccess: () => {
|
|
230
|
+
queryClient.invalidateQueries({ queryKey: companyKeys.all });
|
|
231
|
+
queryClient.invalidateQueries({ queryKey: ["acquisition-contacts"] });
|
|
232
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.all });
|
|
233
|
+
showSuccessNotification("Company created");
|
|
234
|
+
},
|
|
235
|
+
onError: (error) => {
|
|
236
|
+
showApiErrorNotification(error);
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
function useUpdateCompany(companyId) {
|
|
241
|
+
const { apiRequest } = useElevasisServices();
|
|
242
|
+
const queryClient = useQueryClient();
|
|
243
|
+
return useMutation({
|
|
244
|
+
mutationFn: (body) => apiRequest(`/acquisition/companies/${companyId}`, {
|
|
245
|
+
method: "PATCH",
|
|
246
|
+
body: JSON.stringify(body)
|
|
247
|
+
}),
|
|
248
|
+
onSuccess: () => {
|
|
249
|
+
queryClient.invalidateQueries({ queryKey: companyKeys.all });
|
|
250
|
+
queryClient.invalidateQueries({ queryKey: ["acquisition-contacts"] });
|
|
251
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.all });
|
|
252
|
+
showSuccessNotification("Company updated");
|
|
253
|
+
},
|
|
254
|
+
onError: (error) => {
|
|
255
|
+
showApiErrorNotification(error);
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
function useDeleteCompanies() {
|
|
260
|
+
const { apiRequest } = useElevasisServices();
|
|
261
|
+
const queryClient = useQueryClient();
|
|
262
|
+
return useMutation({
|
|
263
|
+
mutationFn: async (companyIds) => {
|
|
264
|
+
const uniqueIds = [...new Set(companyIds)].filter(Boolean);
|
|
265
|
+
if (uniqueIds.length === 0) return;
|
|
266
|
+
await Promise.all(
|
|
267
|
+
uniqueIds.map(
|
|
268
|
+
(companyId) => apiRequest(`/acquisition/companies/${companyId}`, {
|
|
269
|
+
method: "DELETE"
|
|
270
|
+
})
|
|
271
|
+
)
|
|
272
|
+
);
|
|
273
|
+
},
|
|
274
|
+
onSuccess: () => {
|
|
275
|
+
queryClient.invalidateQueries({ queryKey: companyKeys.all });
|
|
276
|
+
queryClient.invalidateQueries({ queryKey: ["acquisition-contacts"] });
|
|
277
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.all });
|
|
278
|
+
showSuccessNotification("Companies deleted");
|
|
279
|
+
},
|
|
280
|
+
onError: (error) => {
|
|
281
|
+
showApiErrorNotification(error);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export { companyKeys, contactKeys, deriveActions, sortData, useCompanies, useCompany, useCompanyFacets, useContact, useContacts, useCreateCompany, useCreateContact, useDeleteCompanies, useDeleteContacts, useSortedData, useTableSort, useUpdateCompany, useUpdateContact };
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { SubshellLoader } from './chunk-
|
|
2
|
-
import { CollapsibleJsonSection, ExecutionStats, UnifiedWorkflowGraph, WorkflowExecutionTimeline, AgentExecutionVisualizer, AgentExecutionTimeline, AgentIterationDetailPanel } from './chunk-
|
|
1
|
+
import { SubshellLoader } from './chunk-2ZRY3ARL.js';
|
|
2
|
+
import { CollapsibleJsonSection, ExecutionStats, UnifiedWorkflowGraph, WorkflowExecutionTimeline, AgentExecutionVisualizer, AgentExecutionTimeline, AgentIterationDetailPanel } from './chunk-VWGCURZF.js';
|
|
3
|
+
import { useCommandViewData, useCommandViewStats, useCommandViewStore, useResourceExecutions, useCheckpointTasks, useSessionMessages, useSessionWebSocket, useSessionExecutions } from './chunk-NMHQAYZU.js';
|
|
4
|
+
import { findNavigationSurfaceForSystem, getSystemApiInterfaceReadiness } from './chunk-L3NBMLRN.js';
|
|
3
5
|
import { FormFieldRenderer } from './chunk-3MEXPLWT.js';
|
|
4
6
|
import { ChatInterface, ChatHeader } from './chunk-SNZDFCOQ.js';
|
|
5
|
-
import {
|
|
7
|
+
import { mergeSessionMessages } from './chunk-QFGNRKIE.js';
|
|
8
|
+
import { ResourceHealthPanel } from './chunk-SEYOVNS5.js';
|
|
6
9
|
import { Graph_module_css_default } from './chunk-HENXLGVD.js';
|
|
7
|
-
import { AppShellLoader } from './chunk-
|
|
10
|
+
import { AppShellLoader } from './chunk-5RH6NYZH.js';
|
|
8
11
|
import { PageContainer } from './chunk-BZZCNLT6.js';
|
|
9
|
-
import { DEFAULT_ORGANIZATION_GRAPH_FILTERS, resolveSemanticIconComponent, CustomModal, useAppearance, useErrorDetail, JsonViewer, useExecution, useArchivedLogs, useDeleteExecution, useRetryExecution, useCancelExecution, ConfirmationModal, PageTitleCaption, CollapsibleSection, useStatusFilter, useResourceSearch, useResourcesDomainFilters, usePaginationState, useResources, useRecentExecutionsByResource, filterByDomainFilters, TabCountBadge, ResourceCard, useResourceDefinition, isSessionCapable, useOptionalElevasisSystems, useDeleteTask, useCommandQueue, useSubmitAction, useCommandQueueTask, ContextViewer, useElevasisSystems,
|
|
10
|
-
import { showApiErrorNotification, showSuccessNotification } from './chunk-
|
|
12
|
+
import { DEFAULT_ORGANIZATION_GRAPH_FILTERS, resolveSemanticIconComponent, CustomModal, useAppearance, useErrorDetail, JsonViewer, useExecution, useArchivedLogs, useDeleteExecution, useRetryExecution, useCancelExecution, ConfirmationModal, PageTitleCaption, CollapsibleSection, useStatusFilter, useResourceSearch, useResourcesDomainFilters, usePaginationState, useResources, useRecentExecutionsByResource, filterByDomainFilters, TabCountBadge, ResourceCard, useResourceDefinition, isSessionCapable, useOptionalElevasisSystems, useDeleteTask, useCommandQueue, useSubmitAction, useCommandQueueTask, ContextViewer, useElevasisSystems, buildOrganizationGraph, EmptyState, useExecutionPanelState, useSessions, SessionListItem, useDeleteSession, useEndSession, useCreateSession, useSession, getSessionView, SubshellContentContainer, collectResourceFilterFacets, SemanticIcon, useSystemsViewState, aggregateSystemMetrics, useSystemHealth, ORGANIZATION_GRAPH_NODE_KIND_ORDER, formatResourceAttribution, SYSTEM_RESOURCE_KINDS, ORGANIZATION_GRAPH_NODE_KIND_LABELS, ORGANIZATION_GRAPH_EDGE_KIND_LABELS, ORGANIZATION_GRAPH_NODE_KIND_DETAIL_LABELS, ORGANIZATION_GRAPH_NODE_KIND_MEANINGS, ORGANIZATION_GRAPH_EDGE_KIND_MEANINGS } from './chunk-SB3IHM5Y.js';
|
|
13
|
+
import { showApiErrorNotification, showSuccessNotification } from './chunk-ICHDIVQO.js';
|
|
11
14
|
import { topbarHeight } from './chunk-MISHPEJX.js';
|
|
12
15
|
import { CardHeader } from './chunk-62GVNH5U.js';
|
|
13
16
|
import { useInitialization } from './chunk-P45GQ3ZW.js';
|
|
14
|
-
import { mergeSessionMessages } from './chunk-M7WWRZ5Z.js';
|
|
15
17
|
import { StyledMarkdown } from './chunk-3KMDHCAR.js';
|
|
16
18
|
import { getResourceStatusColor, useMergedExecution, useTimelineData, useAgentIterationData } from './chunk-BLXJEIQS.js';
|
|
17
19
|
import { useOrganization } from './chunk-DD3CCMCZ.js';
|
|
18
|
-
import { getErrorInfo, formatErrorMessage, getResourceIcon, formatRelativeTime, PAGE_SIZE_DEFAULT, listAllSystems, getSystem, compileOrganizationOntology, getSystemAncestors } from './chunk-
|
|
20
|
+
import { getErrorInfo, formatErrorMessage, getResourceIcon, formatRelativeTime, PAGE_SIZE_DEFAULT, listAllSystems, getSystem, compileOrganizationOntology, getSystemAncestors } from './chunk-A2SB32YV.js';
|
|
19
21
|
import { ResourceStatusColors, toWorkflowLogMessages } from './chunk-6SSQGWK7.js';
|
|
20
22
|
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
21
23
|
import { useRouterContext } from './chunk-Q7DJKLEN.js';
|
|
@@ -10759,6 +10761,110 @@ function ResourcesSection({ resources }) {
|
|
|
10759
10761
|
] }, resource.id)) })
|
|
10760
10762
|
] }) });
|
|
10761
10763
|
}
|
|
10764
|
+
function buildAdoptionRows(model, systems) {
|
|
10765
|
+
const { resolvedSystems, shellModel, shellRuntime } = systems;
|
|
10766
|
+
return listAllSystems(model).map(({ path, system }) => {
|
|
10767
|
+
const navSurface = findNavigationSurfaceForSystem(model, path, system.id);
|
|
10768
|
+
const module = resolvedSystems.find(
|
|
10769
|
+
(candidate) => candidate.systemId === path || candidate.systemId === system.id
|
|
10770
|
+
);
|
|
10771
|
+
const shellPath = shellModel.findById(path)?.path;
|
|
10772
|
+
const routeMounted = shellPath !== void 0 && shellRuntime.resolveRoute(shellPath).status === "matched";
|
|
10773
|
+
const unlinkedManifest = module === void 0 && shellPath !== void 0 ? resolvedSystems.filter((candidate) => candidate.systemId === void 0).flatMap(
|
|
10774
|
+
(candidate) => (candidate.routePrefixes ?? []).filter((prefix) => shellPath === prefix || shellPath.startsWith(`${prefix}/`)).map((prefix) => ({ key: candidate.key, prefix }))
|
|
10775
|
+
).sort((a, b) => b.prefix.length - a.prefix.length)[0] : void 0;
|
|
10776
|
+
return {
|
|
10777
|
+
path,
|
|
10778
|
+
system,
|
|
10779
|
+
lifecycle: system.lifecycle ?? "active",
|
|
10780
|
+
navSurfaceLabel: navSurface?.label,
|
|
10781
|
+
routeMounted,
|
|
10782
|
+
manifestMounted: module !== void 0,
|
|
10783
|
+
unlinkedManifestKey: unlinkedManifest?.key,
|
|
10784
|
+
apiReadiness: getSystemApiInterfaceReadiness(model, path)
|
|
10785
|
+
};
|
|
10786
|
+
}).sort((a, b) => a.path.localeCompare(b.path));
|
|
10787
|
+
}
|
|
10788
|
+
function adoptionGaps(row) {
|
|
10789
|
+
const gaps = [];
|
|
10790
|
+
if (row.lifecycle !== "active") {
|
|
10791
|
+
gaps.push(`Lifecycle is "${row.lifecycle}" -- flip to "active" in systems.ts to make it reachable.`);
|
|
10792
|
+
}
|
|
10793
|
+
if (!row.navSurfaceLabel) {
|
|
10794
|
+
gaps.push("No navigation.sidebar surface targets this System -- reachable only by typing the URL.");
|
|
10795
|
+
}
|
|
10796
|
+
if (!row.routeMounted) {
|
|
10797
|
+
gaps.push("No mounted route currently resolves this System\u2019s path.");
|
|
10798
|
+
}
|
|
10799
|
+
if (!row.manifestMounted) {
|
|
10800
|
+
gaps.push(
|
|
10801
|
+
row.unlinkedManifestKey ? `The "${row.unlinkedManifestKey}" manifest owns this route but declares no systemId, so the shell never links it to this System.` : "Not present in the shell\u2019s SYSTEM_MANIFESTS."
|
|
10802
|
+
);
|
|
10803
|
+
}
|
|
10804
|
+
if (row.apiReadiness.declared && !row.apiReadiness.ready) {
|
|
10805
|
+
gaps.push(row.apiReadiness.reason ?? "Declared apiInterface is not ready.");
|
|
10806
|
+
}
|
|
10807
|
+
return gaps;
|
|
10808
|
+
}
|
|
10809
|
+
function AdoptionBooleanBadge({ ok, okLabel, missingLabel }) {
|
|
10810
|
+
if (ok) {
|
|
10811
|
+
return /* @__PURE__ */ jsx(Badge, { color: "green", variant: "light", leftSection: /* @__PURE__ */ jsx(IconCheck, { size: 12 }), children: okLabel });
|
|
10812
|
+
}
|
|
10813
|
+
return /* @__PURE__ */ jsx(Badge, { color: "red", variant: "light", leftSection: /* @__PURE__ */ jsx(IconX, { size: 12 }), children: missingLabel });
|
|
10814
|
+
}
|
|
10815
|
+
function SystemAdoptionReport({ model, onNavigate }) {
|
|
10816
|
+
const systems = useElevasisSystems();
|
|
10817
|
+
const rows = buildAdoptionRows(model, systems);
|
|
10818
|
+
if (rows.length === 0) {
|
|
10819
|
+
return /* @__PURE__ */ jsx(
|
|
10820
|
+
EmptyState,
|
|
10821
|
+
{
|
|
10822
|
+
icon: IconRoute,
|
|
10823
|
+
title: "No declared Systems",
|
|
10824
|
+
description: "Declare a System in systems.ts to see it here."
|
|
10825
|
+
}
|
|
10826
|
+
);
|
|
10827
|
+
}
|
|
10828
|
+
return /* @__PURE__ */ jsx(Paper, { withBorder: true, p: "md", radius: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
10829
|
+
/* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
|
|
10830
|
+
/* @__PURE__ */ jsx(Title, { order: 2, size: "h5", children: "Adoption Report" }),
|
|
10831
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Every System declared in the organization model, with its lifecycle, navigation surface, mounted route, manifest, and API Interface readiness. Missing wiring is called out in plain language." })
|
|
10832
|
+
] }),
|
|
10833
|
+
/* @__PURE__ */ jsx(Card, { withBorder: true, padding: 0, radius: "sm", children: /* @__PURE__ */ jsxs(Table, { verticalSpacing: "xs", horizontalSpacing: "md", children: [
|
|
10834
|
+
/* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
10835
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "System" }),
|
|
10836
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Lifecycle" }),
|
|
10837
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Nav surface" }),
|
|
10838
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Route" }),
|
|
10839
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Manifest" }),
|
|
10840
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "API readiness" }),
|
|
10841
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "What's missing" })
|
|
10842
|
+
] }) }),
|
|
10843
|
+
/* @__PURE__ */ jsx(Table.Tbody, { children: rows.map((row) => {
|
|
10844
|
+
const gaps = adoptionGaps(row);
|
|
10845
|
+
return /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
10846
|
+
/* @__PURE__ */ jsxs(Table.Td, { children: [
|
|
10847
|
+
/* @__PURE__ */ jsx(Anchor, { size: "sm", component: "button", onClick: () => onNavigate(row.path), children: row.system.label ?? row.system.id }),
|
|
10848
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: row.path })
|
|
10849
|
+
] }),
|
|
10850
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { variant: "light", color: row.lifecycle === "active" ? "green" : "gray", children: row.lifecycle }) }),
|
|
10851
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(
|
|
10852
|
+
AdoptionBooleanBadge,
|
|
10853
|
+
{
|
|
10854
|
+
ok: row.navSurfaceLabel !== void 0,
|
|
10855
|
+
okLabel: row.navSurfaceLabel ?? "present",
|
|
10856
|
+
missingLabel: "none"
|
|
10857
|
+
}
|
|
10858
|
+
) }),
|
|
10859
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(AdoptionBooleanBadge, { ok: row.routeMounted, okLabel: "mounted", missingLabel: "none" }) }),
|
|
10860
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(AdoptionBooleanBadge, { ok: row.manifestMounted, okLabel: "mounted", missingLabel: "none" }) }),
|
|
10861
|
+
/* @__PURE__ */ jsx(Table.Td, { children: row.apiReadiness.declared ? /* @__PURE__ */ jsx(AdoptionBooleanBadge, { ok: row.apiReadiness.ready, okLabel: "ready", missingLabel: "not ready" }) : /* @__PURE__ */ jsx(Badge, { variant: "light", color: "gray", children: "not declared" }) }),
|
|
10862
|
+
/* @__PURE__ */ jsx(Table.Td, { children: gaps.length === 0 ? /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Fully wired." }) : /* @__PURE__ */ jsx(Stack, { gap: 2, children: gaps.map((gap, index) => /* @__PURE__ */ jsx(Text, { size: "xs", children: gap }, index)) }) })
|
|
10863
|
+
] }, row.path);
|
|
10864
|
+
}) })
|
|
10865
|
+
] }) })
|
|
10866
|
+
] }) });
|
|
10867
|
+
}
|
|
10762
10868
|
function SystemsIndex({ model, onNavigate }) {
|
|
10763
10869
|
const searchQuery = useSystemsViewState((state) => state.searchQuery);
|
|
10764
10870
|
const statusFilter = useSystemsViewState((state) => state.statusFilter);
|
|
@@ -10799,6 +10905,7 @@ function SystemsIndex({ model, onNavigate }) {
|
|
|
10799
10905
|
/* @__PURE__ */ jsx(MetricCard2, { label: "Health", value: "--", detail: "System endpoint pending" })
|
|
10800
10906
|
] })
|
|
10801
10907
|
] }) }),
|
|
10908
|
+
/* @__PURE__ */ jsx(SystemAdoptionReport, { model, onNavigate }),
|
|
10802
10909
|
entries.length > 0 ? /* @__PURE__ */ jsx(SimpleGrid, { cols: 1, spacing: "md", children: entries.map((entry) => /* @__PURE__ */ jsx(SystemSummaryPaper, { entry, rollupMode, onNavigate }, entry.path)) }) : /* @__PURE__ */ jsx(
|
|
10803
10910
|
EmptyState,
|
|
10804
10911
|
{
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { UuidSchema } from './chunk-TVTSASST.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
1
|
// src/hooks/sessions/mergeSessionMessages.ts
|
|
5
2
|
function canonicalize(value) {
|
|
6
3
|
if (Array.isArray(value)) {
|
|
@@ -45,80 +42,6 @@ function mergeSessionMessages(historyMessages, liveMessages) {
|
|
|
45
42
|
return (a.messageIndex ?? 0) - (b.messageIndex ?? 0);
|
|
46
43
|
});
|
|
47
44
|
}
|
|
48
|
-
var SessionIdParamSchema = z.object({
|
|
49
|
-
sessionId: UuidSchema
|
|
50
|
-
}).strict();
|
|
51
|
-
var ExecutionIdParamsSchema = z.object({
|
|
52
|
-
sessionId: UuidSchema,
|
|
53
|
-
executionId: UuidSchema
|
|
54
|
-
}).strict();
|
|
55
|
-
var CreateSessionSchema = z.object({
|
|
56
|
-
resourceId: z.string().min(1).max(100),
|
|
57
|
-
userId: UuidSchema.optional(),
|
|
58
|
-
metadata: z.any().optional()
|
|
59
|
-
}).strict();
|
|
60
|
-
z.object({
|
|
61
|
-
input: z.unknown().refine(
|
|
62
|
-
(val) => {
|
|
63
|
-
let text;
|
|
64
|
-
if (typeof val === "string") {
|
|
65
|
-
text = val;
|
|
66
|
-
} else if (val && typeof val === "object" && "message" in val) {
|
|
67
|
-
text = String(val.message);
|
|
68
|
-
} else {
|
|
69
|
-
text = JSON.stringify(val);
|
|
70
|
-
}
|
|
71
|
-
return text.length > 0 && text.length <= 1e5;
|
|
72
|
-
},
|
|
73
|
-
{ message: "Input must be between 1 and 100,000 characters" }
|
|
74
|
-
),
|
|
75
|
-
metadata: z.any().optional()
|
|
76
|
-
}).strict();
|
|
77
|
-
z.object({
|
|
78
|
-
userId: UuidSchema.optional(),
|
|
79
|
-
resourceId: z.string().optional(),
|
|
80
|
-
limit: z.coerce.number().int().min(1).max(100).default(20)
|
|
81
|
-
}).strict();
|
|
82
|
-
z.object({
|
|
83
|
-
limit: z.coerce.number().int().min(1).max(100).default(100),
|
|
84
|
-
cursor: z.coerce.number().int().min(0).optional()
|
|
85
|
-
}).strict();
|
|
86
|
-
var WebSocketSessionTurnSchema = z.object({
|
|
87
|
-
type: z.literal("session:turn"),
|
|
88
|
-
input: z.unknown().refine(
|
|
89
|
-
(val) => {
|
|
90
|
-
let text;
|
|
91
|
-
if (typeof val === "string") {
|
|
92
|
-
text = val;
|
|
93
|
-
} else if (val && typeof val === "object" && "message" in val) {
|
|
94
|
-
text = String(val.message);
|
|
95
|
-
} else {
|
|
96
|
-
text = JSON.stringify(val) || "";
|
|
97
|
-
}
|
|
98
|
-
return text && text.length > 0 && text.length <= 1e5;
|
|
99
|
-
},
|
|
100
|
-
{ message: "Input must be between 1 and 100,000 characters" }
|
|
101
|
-
)
|
|
102
|
-
}).strict();
|
|
103
|
-
var NotificationCategorySchema = z.enum(["info", "queue", "alert", "error", "system"]);
|
|
104
|
-
var GetNotificationsQuerySchema = z.object({
|
|
105
|
-
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
106
|
-
offset: z.coerce.number().int().min(0).default(0)
|
|
107
|
-
});
|
|
108
|
-
var MarkAsReadParamsSchema = z.object({
|
|
109
|
-
id: UuidSchema
|
|
110
|
-
});
|
|
111
|
-
z.object({
|
|
112
|
-
userId: UuidSchema,
|
|
113
|
-
organizationId: UuidSchema,
|
|
114
|
-
category: NotificationCategorySchema,
|
|
115
|
-
title: z.string().trim().min(1).max(200),
|
|
116
|
-
message: z.string().trim().min(1).max(1e3),
|
|
117
|
-
actionUrl: z.string().url().optional()
|
|
118
|
-
}).strict();
|
|
119
|
-
z.object({
|
|
120
|
-
ids: z.array(UuidSchema).min(1).max(500)
|
|
121
|
-
}).strict();
|
|
122
45
|
|
|
123
46
|
// src/hooks/sessions/sessionWebSocketUtils.ts
|
|
124
47
|
var liveTempMessageCounter = 0;
|
|
@@ -156,4 +79,4 @@ function getWebSocketBaseUrl(apiUrl) {
|
|
|
156
79
|
return `${protocol}//${url.host}`;
|
|
157
80
|
}
|
|
158
81
|
|
|
159
|
-
export {
|
|
82
|
+
export { createLiveTempMessageIdentity, formatMessageEvent, getWebSocketBaseUrl, mergeSessionMessages };
|