@elevasis/ui 2.49.0 → 2.51.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 +4 -3
- package/dist/app/index.d.ts +132 -0
- package/dist/app/index.js +8 -6
- package/dist/auth/index.js +8 -6
- package/dist/charts/index.js +8 -6
- package/dist/{chunk-SOGPJFO6.js → chunk-4UA62IDF.js} +1 -1
- package/dist/{chunk-OFLWSKSC.js → chunk-7Q5THR43.js} +1 -1
- package/dist/chunk-EJL4U7OZ.js +79 -0
- package/dist/chunk-FVOMKZ7S.js +118 -0
- package/dist/{chunk-Y3HPUATG.js → chunk-SBNC3FRX.js} +117 -118
- package/dist/{chunk-CDZB24OR.js → chunk-XOPLS4S6.js} +1 -85
- package/dist/components/index.d.ts +132 -0
- package/dist/components/index.js +8 -6
- package/dist/components/navigation/index.js +8 -6
- package/dist/features/auth/index.d.ts +132 -0
- package/dist/features/auth/index.js +9 -7
- package/dist/features/clients/index.js +8 -6
- package/dist/features/crm/index.d.ts +132 -0
- package/dist/features/crm/index.js +8 -6
- package/dist/features/dashboard/index.js +8 -6
- package/dist/features/delivery/index.d.ts +132 -0
- package/dist/features/delivery/index.js +8 -6
- package/dist/features/knowledge/index.js +8 -6
- package/dist/features/lead-gen/index.js +8 -6
- package/dist/features/monitoring/index.js +8 -6
- package/dist/features/monitoring/requests/index.js +9 -7
- package/dist/features/operations/index.d.ts +2 -2
- package/dist/features/operations/index.js +8 -6
- package/dist/features/public-agent-chat/index.d.ts +161 -0
- package/dist/features/public-agent-chat/index.js +413 -0
- package/dist/features/settings/index.d.ts +132 -0
- package/dist/features/settings/index.js +8 -6
- package/dist/hooks/access/index.js +8 -6
- package/dist/hooks/delivery/index.d.ts +132 -0
- package/dist/hooks/delivery/index.js +8 -6
- package/dist/hooks/index.d.ts +135 -1
- package/dist/hooks/index.js +8 -6
- package/dist/hooks/published.d.ts +135 -1
- package/dist/hooks/published.js +8 -6
- package/dist/index.d.ts +135 -1
- package/dist/index.js +9 -7
- package/dist/initialization/index.d.ts +132 -0
- package/dist/knowledge/index.d.ts +48 -2
- package/dist/knowledge/index.js +583 -108
- package/dist/{knowledge-search-index-MHOBQTT3.js → knowledge-search-index-JOPRYZN6.js} +600 -561
- package/dist/layout/index.js +8 -6
- package/dist/organization/index.js +8 -6
- package/dist/profile/index.d.ts +132 -0
- package/dist/provider/index.d.ts +132 -0
- package/dist/provider/index.js +8 -6
- package/dist/provider/published.d.ts +132 -0
- package/dist/provider/published.js +8 -6
- package/dist/supabase/index.d.ts +258 -0
- package/dist/test-utils/index.js +4 -3
- package/dist/types/index.d.ts +135 -3
- package/dist/utils/index.js +2 -1
- package/package.json +10 -5
- package/src/knowledge/README.md +4 -2
package/dist/api/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { createElevasisQueryClient } from '../chunk-
|
|
2
|
-
export { ApiClientProvider, useApiClient, useApiClientContext } from '../chunk-
|
|
1
|
+
export { createElevasisQueryClient } from '../chunk-4UA62IDF.js';
|
|
2
|
+
export { ApiClientProvider, useApiClient, useApiClientContext } from '../chunk-7Q5THR43.js';
|
|
3
3
|
import '../chunk-DD3CCMCZ.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-XOPLS4S6.js';
|
|
5
|
+
import '../chunk-FVOMKZ7S.js';
|
|
5
6
|
import '../chunk-KRWALB24.js';
|
|
6
7
|
import '../chunk-TVTSASST.js';
|
|
7
8
|
import '../chunk-I2KLQ2HA.js';
|
package/dist/app/index.d.ts
CHANGED
|
@@ -2122,6 +2122,138 @@ type Database = {
|
|
|
2122
2122
|
};
|
|
2123
2123
|
Relationships: [];
|
|
2124
2124
|
};
|
|
2125
|
+
agent_access_grants: {
|
|
2126
|
+
Row: {
|
|
2127
|
+
allowed_origins: string[];
|
|
2128
|
+
branding: Json;
|
|
2129
|
+
capture_fields: Json;
|
|
2130
|
+
code_hash: string | null;
|
|
2131
|
+
code_salt: string | null;
|
|
2132
|
+
created_at: string;
|
|
2133
|
+
disabled_at: string | null;
|
|
2134
|
+
expires_at: string | null;
|
|
2135
|
+
id: string;
|
|
2136
|
+
max_sessions_per_visitor: number;
|
|
2137
|
+
max_turns_per_session: number;
|
|
2138
|
+
mode: string;
|
|
2139
|
+
organization_id: string;
|
|
2140
|
+
resource_id: string;
|
|
2141
|
+
slug: string;
|
|
2142
|
+
tool_policy: Json;
|
|
2143
|
+
updated_at: string;
|
|
2144
|
+
};
|
|
2145
|
+
Insert: {
|
|
2146
|
+
allowed_origins?: string[];
|
|
2147
|
+
branding?: Json;
|
|
2148
|
+
capture_fields?: Json;
|
|
2149
|
+
code_hash?: string | null;
|
|
2150
|
+
code_salt?: string | null;
|
|
2151
|
+
created_at?: string;
|
|
2152
|
+
disabled_at?: string | null;
|
|
2153
|
+
expires_at?: string | null;
|
|
2154
|
+
id?: string;
|
|
2155
|
+
max_sessions_per_visitor?: number;
|
|
2156
|
+
max_turns_per_session?: number;
|
|
2157
|
+
mode?: string;
|
|
2158
|
+
organization_id: string;
|
|
2159
|
+
resource_id: string;
|
|
2160
|
+
slug: string;
|
|
2161
|
+
tool_policy?: Json;
|
|
2162
|
+
updated_at?: string;
|
|
2163
|
+
};
|
|
2164
|
+
Update: {
|
|
2165
|
+
allowed_origins?: string[];
|
|
2166
|
+
branding?: Json;
|
|
2167
|
+
capture_fields?: Json;
|
|
2168
|
+
code_hash?: string | null;
|
|
2169
|
+
code_salt?: string | null;
|
|
2170
|
+
created_at?: string;
|
|
2171
|
+
disabled_at?: string | null;
|
|
2172
|
+
expires_at?: string | null;
|
|
2173
|
+
id?: string;
|
|
2174
|
+
max_sessions_per_visitor?: number;
|
|
2175
|
+
max_turns_per_session?: number;
|
|
2176
|
+
mode?: string;
|
|
2177
|
+
organization_id?: string;
|
|
2178
|
+
resource_id?: string;
|
|
2179
|
+
slug?: string;
|
|
2180
|
+
tool_policy?: Json;
|
|
2181
|
+
updated_at?: string;
|
|
2182
|
+
};
|
|
2183
|
+
Relationships: [
|
|
2184
|
+
{
|
|
2185
|
+
foreignKeyName: "agent_access_grants_organization_id_fkey";
|
|
2186
|
+
columns: ["organization_id"];
|
|
2187
|
+
isOneToOne: false;
|
|
2188
|
+
referencedRelation: "organizations";
|
|
2189
|
+
referencedColumns: ["id"];
|
|
2190
|
+
}
|
|
2191
|
+
];
|
|
2192
|
+
};
|
|
2193
|
+
agent_chat_capabilities: {
|
|
2194
|
+
Row: {
|
|
2195
|
+
created_at: string;
|
|
2196
|
+
expires_at: string;
|
|
2197
|
+
grant_id: string;
|
|
2198
|
+
id: string;
|
|
2199
|
+
organization_id: string;
|
|
2200
|
+
origin: string | null;
|
|
2201
|
+
resource_id: string;
|
|
2202
|
+
revoked_at: string | null;
|
|
2203
|
+
session_id: string | null;
|
|
2204
|
+
token_hash: string;
|
|
2205
|
+
visitor_id: string | null;
|
|
2206
|
+
};
|
|
2207
|
+
Insert: {
|
|
2208
|
+
created_at?: string;
|
|
2209
|
+
expires_at: string;
|
|
2210
|
+
grant_id: string;
|
|
2211
|
+
id?: string;
|
|
2212
|
+
organization_id: string;
|
|
2213
|
+
origin?: string | null;
|
|
2214
|
+
resource_id: string;
|
|
2215
|
+
revoked_at?: string | null;
|
|
2216
|
+
session_id?: string | null;
|
|
2217
|
+
token_hash: string;
|
|
2218
|
+
visitor_id?: string | null;
|
|
2219
|
+
};
|
|
2220
|
+
Update: {
|
|
2221
|
+
created_at?: string;
|
|
2222
|
+
expires_at?: string;
|
|
2223
|
+
grant_id?: string;
|
|
2224
|
+
id?: string;
|
|
2225
|
+
organization_id?: string;
|
|
2226
|
+
origin?: string | null;
|
|
2227
|
+
resource_id?: string;
|
|
2228
|
+
revoked_at?: string | null;
|
|
2229
|
+
session_id?: string | null;
|
|
2230
|
+
token_hash?: string;
|
|
2231
|
+
visitor_id?: string | null;
|
|
2232
|
+
};
|
|
2233
|
+
Relationships: [
|
|
2234
|
+
{
|
|
2235
|
+
foreignKeyName: "agent_chat_capabilities_grant_id_fkey";
|
|
2236
|
+
columns: ["grant_id"];
|
|
2237
|
+
isOneToOne: false;
|
|
2238
|
+
referencedRelation: "agent_access_grants";
|
|
2239
|
+
referencedColumns: ["id"];
|
|
2240
|
+
},
|
|
2241
|
+
{
|
|
2242
|
+
foreignKeyName: "agent_chat_capabilities_organization_id_fkey";
|
|
2243
|
+
columns: ["organization_id"];
|
|
2244
|
+
isOneToOne: false;
|
|
2245
|
+
referencedRelation: "organizations";
|
|
2246
|
+
referencedColumns: ["id"];
|
|
2247
|
+
},
|
|
2248
|
+
{
|
|
2249
|
+
foreignKeyName: "agent_chat_capabilities_session_id_fkey";
|
|
2250
|
+
columns: ["session_id"];
|
|
2251
|
+
isOneToOne: false;
|
|
2252
|
+
referencedRelation: "sessions";
|
|
2253
|
+
referencedColumns: ["session_id"];
|
|
2254
|
+
}
|
|
2255
|
+
];
|
|
2256
|
+
};
|
|
2125
2257
|
organizations: {
|
|
2126
2258
|
Row: {
|
|
2127
2259
|
config: Json;
|
package/dist/app/index.js
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { useSessionCheck, AppErrorBoundary, SidebarProvider, ElevasisSystemsProvider, useElevasisSystems, AppShellContainer, Sidebar, AppShellRightSideContainer, AppShellRightSideOuterContainer, SystemShell, ElevasisUIProvider } from '../chunk-
|
|
1
|
+
import { useSessionCheck, AppErrorBoundary, SidebarProvider, ElevasisSystemsProvider, useElevasisSystems, AppShellContainer, Sidebar, AppShellRightSideContainer, AppShellRightSideOuterContainer, SystemShell, ElevasisUIProvider } from '../chunk-SBNC3FRX.js';
|
|
2
2
|
import '../chunk-NZ2F5RQ4.js';
|
|
3
3
|
import '../chunk-OJJK27GC.js';
|
|
4
|
+
import '../chunk-ZTWA5H77.js';
|
|
4
5
|
import '../chunk-AUDNF2Q7.js';
|
|
5
6
|
import '../chunk-6M6OLGQY.js';
|
|
6
7
|
import '../chunk-MKH2KOAO.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
+
import '../chunk-7Q5THR43.js';
|
|
8
9
|
import '../chunk-SJHM4WDG.js';
|
|
9
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-GMXGDO3I.js';
|
|
10
11
|
import '../chunk-S3XR4II4.js';
|
|
11
12
|
import { useInitialization } from '../chunk-6DO4PE3O.js';
|
|
12
|
-
import '../chunk-OFLWSKSC.js';
|
|
13
13
|
import '../chunk-DD3CCMCZ.js';
|
|
14
|
-
import '../chunk-
|
|
14
|
+
import '../chunk-EJL4U7OZ.js';
|
|
15
|
+
import '../chunk-GUKY77FJ.js';
|
|
15
16
|
import { TanStackRouterBridge, ScrollToTop } from '../chunk-2IFYDILW.js';
|
|
16
17
|
import '../chunk-Q7DJKLEN.js';
|
|
17
18
|
import '../chunk-HENXLGVD.js';
|
|
18
19
|
import '../chunk-7FPLLSHN.js';
|
|
19
20
|
import '../chunk-RNP5R5I3.js';
|
|
20
21
|
import '../chunk-W2SFTXMT.js';
|
|
21
|
-
import { listAllSystems } from '../chunk-
|
|
22
|
+
import { listAllSystems } from '../chunk-XOPLS4S6.js';
|
|
23
|
+
import '../chunk-FVOMKZ7S.js';
|
|
22
24
|
import '../chunk-KRWALB24.js';
|
|
23
25
|
import '../chunk-2FTX4WO2.js';
|
|
24
26
|
import '../chunk-MQZE7SUI.js';
|
package/dist/auth/index.js
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
export { AccessGuard, AccessKeys, ProtectedRoute, useSessionCheck as useRefocusSessionCheck, useSessionCheck, useStableAccessToken } from '../chunk-
|
|
1
|
+
export { AccessGuard, AccessKeys, ProtectedRoute, useSessionCheck as useRefocusSessionCheck, useSessionCheck, useStableAccessToken } from '../chunk-SBNC3FRX.js';
|
|
2
2
|
import '../chunk-NZ2F5RQ4.js';
|
|
3
3
|
import '../chunk-OJJK27GC.js';
|
|
4
|
+
import '../chunk-ZTWA5H77.js';
|
|
4
5
|
import '../chunk-AUDNF2Q7.js';
|
|
5
6
|
import '../chunk-6M6OLGQY.js';
|
|
6
7
|
import '../chunk-MKH2KOAO.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
+
import '../chunk-7Q5THR43.js';
|
|
8
9
|
import '../chunk-SJHM4WDG.js';
|
|
9
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-GMXGDO3I.js';
|
|
10
11
|
import '../chunk-S3XR4II4.js';
|
|
11
12
|
import '../chunk-6DO4PE3O.js';
|
|
12
|
-
import '../chunk-OFLWSKSC.js';
|
|
13
13
|
import '../chunk-DD3CCMCZ.js';
|
|
14
|
-
import '../chunk-
|
|
14
|
+
import '../chunk-EJL4U7OZ.js';
|
|
15
|
+
import '../chunk-GUKY77FJ.js';
|
|
15
16
|
import '../chunk-2IFYDILW.js';
|
|
16
17
|
import '../chunk-Q7DJKLEN.js';
|
|
17
18
|
import '../chunk-HENXLGVD.js';
|
|
18
19
|
import '../chunk-7FPLLSHN.js';
|
|
19
20
|
import '../chunk-RNP5R5I3.js';
|
|
20
21
|
import '../chunk-W2SFTXMT.js';
|
|
21
|
-
import '../chunk-
|
|
22
|
+
import '../chunk-XOPLS4S6.js';
|
|
23
|
+
import '../chunk-FVOMKZ7S.js';
|
|
22
24
|
import '../chunk-KRWALB24.js';
|
|
23
25
|
import '../chunk-2FTX4WO2.js';
|
|
24
26
|
import '../chunk-MQZE7SUI.js';
|
package/dist/charts/index.js
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
export { ActivityTrendChart, ChartFrame, CombinedTrendChart, CostTrendChart, CyberAreaChart, CyberDonut, CyberDonutTooltip, CyberLegendItem, HeroStatsRow, getSeriesColor, useCyberColors } from '../chunk-
|
|
1
|
+
export { ActivityTrendChart, ChartFrame, CombinedTrendChart, CostTrendChart, CyberAreaChart, CyberDonut, CyberDonutTooltip, CyberLegendItem, HeroStatsRow, getSeriesColor, useCyberColors } from '../chunk-SBNC3FRX.js';
|
|
2
2
|
import '../chunk-NZ2F5RQ4.js';
|
|
3
3
|
import '../chunk-OJJK27GC.js';
|
|
4
|
+
import '../chunk-ZTWA5H77.js';
|
|
4
5
|
import '../chunk-AUDNF2Q7.js';
|
|
5
6
|
import '../chunk-6M6OLGQY.js';
|
|
6
7
|
import '../chunk-MKH2KOAO.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
+
import '../chunk-7Q5THR43.js';
|
|
8
9
|
import '../chunk-SJHM4WDG.js';
|
|
9
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-GMXGDO3I.js';
|
|
10
11
|
import '../chunk-S3XR4II4.js';
|
|
11
12
|
import '../chunk-6DO4PE3O.js';
|
|
12
|
-
import '../chunk-OFLWSKSC.js';
|
|
13
13
|
import '../chunk-DD3CCMCZ.js';
|
|
14
|
-
import '../chunk-
|
|
14
|
+
import '../chunk-EJL4U7OZ.js';
|
|
15
|
+
import '../chunk-GUKY77FJ.js';
|
|
15
16
|
import '../chunk-2IFYDILW.js';
|
|
16
17
|
import '../chunk-Q7DJKLEN.js';
|
|
17
18
|
import '../chunk-HENXLGVD.js';
|
|
18
19
|
import '../chunk-7FPLLSHN.js';
|
|
19
20
|
import '../chunk-RNP5R5I3.js';
|
|
20
21
|
import '../chunk-W2SFTXMT.js';
|
|
21
|
-
import '../chunk-
|
|
22
|
+
import '../chunk-XOPLS4S6.js';
|
|
23
|
+
import '../chunk-FVOMKZ7S.js';
|
|
22
24
|
import '../chunk-KRWALB24.js';
|
|
23
25
|
import '../chunk-2FTX4WO2.js';
|
|
24
26
|
import '../chunk-MQZE7SUI.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OrganizationContext } from './chunk-DD3CCMCZ.js';
|
|
2
|
-
import { APIClientError } from './chunk-
|
|
2
|
+
import { APIClientError } from './chunk-XOPLS4S6.js';
|
|
3
3
|
import { createContext, useContext, useMemo, useCallback } from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { UuidSchema } from './chunk-TVTSASST.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
var SessionIdParamSchema = z.object({
|
|
5
|
+
sessionId: UuidSchema
|
|
6
|
+
}).strict();
|
|
7
|
+
var ExecutionIdParamsSchema = z.object({
|
|
8
|
+
sessionId: UuidSchema,
|
|
9
|
+
executionId: UuidSchema
|
|
10
|
+
}).strict();
|
|
11
|
+
var CreateSessionSchema = z.object({
|
|
12
|
+
resourceId: z.string().min(1).max(100),
|
|
13
|
+
userId: UuidSchema.optional(),
|
|
14
|
+
metadata: z.any().optional()
|
|
15
|
+
}).strict();
|
|
16
|
+
z.object({
|
|
17
|
+
input: z.unknown().refine(
|
|
18
|
+
(val) => {
|
|
19
|
+
let text;
|
|
20
|
+
if (typeof val === "string") {
|
|
21
|
+
text = val;
|
|
22
|
+
} else if (val && typeof val === "object" && "message" in val) {
|
|
23
|
+
text = String(val.message);
|
|
24
|
+
} else {
|
|
25
|
+
text = JSON.stringify(val);
|
|
26
|
+
}
|
|
27
|
+
return text.length > 0 && text.length <= 1e5;
|
|
28
|
+
},
|
|
29
|
+
{ message: "Input must be between 1 and 100,000 characters" }
|
|
30
|
+
),
|
|
31
|
+
metadata: z.any().optional()
|
|
32
|
+
}).strict();
|
|
33
|
+
z.object({
|
|
34
|
+
userId: UuidSchema.optional(),
|
|
35
|
+
resourceId: z.string().optional(),
|
|
36
|
+
limit: z.coerce.number().int().min(1).max(100).default(20)
|
|
37
|
+
}).strict();
|
|
38
|
+
z.object({
|
|
39
|
+
limit: z.coerce.number().int().min(1).max(100).default(100),
|
|
40
|
+
cursor: z.coerce.number().int().min(0).optional()
|
|
41
|
+
}).strict();
|
|
42
|
+
var WebSocketSessionTurnSchema = z.object({
|
|
43
|
+
type: z.literal("session:turn"),
|
|
44
|
+
input: z.unknown().refine(
|
|
45
|
+
(val) => {
|
|
46
|
+
let text;
|
|
47
|
+
if (typeof val === "string") {
|
|
48
|
+
text = val;
|
|
49
|
+
} else if (val && typeof val === "object" && "message" in val) {
|
|
50
|
+
text = String(val.message);
|
|
51
|
+
} else {
|
|
52
|
+
text = JSON.stringify(val) || "";
|
|
53
|
+
}
|
|
54
|
+
return text && text.length > 0 && text.length <= 1e5;
|
|
55
|
+
},
|
|
56
|
+
{ message: "Input must be between 1 and 100,000 characters" }
|
|
57
|
+
)
|
|
58
|
+
}).strict();
|
|
59
|
+
var NotificationCategorySchema = z.enum(["info", "queue", "alert", "error", "system"]);
|
|
60
|
+
var GetNotificationsQuerySchema = z.object({
|
|
61
|
+
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
62
|
+
offset: z.coerce.number().int().min(0).default(0)
|
|
63
|
+
});
|
|
64
|
+
var MarkAsReadParamsSchema = z.object({
|
|
65
|
+
id: UuidSchema
|
|
66
|
+
});
|
|
67
|
+
z.object({
|
|
68
|
+
userId: UuidSchema,
|
|
69
|
+
organizationId: UuidSchema,
|
|
70
|
+
category: NotificationCategorySchema,
|
|
71
|
+
title: z.string().trim().min(1).max(200),
|
|
72
|
+
message: z.string().trim().min(1).max(1e3),
|
|
73
|
+
actionUrl: z.string().url().optional()
|
|
74
|
+
}).strict();
|
|
75
|
+
z.object({
|
|
76
|
+
ids: z.array(UuidSchema).min(1).max(500)
|
|
77
|
+
}).strict();
|
|
78
|
+
|
|
79
|
+
export { CreateSessionSchema, ExecutionIdParamsSchema, GetNotificationsQuerySchema, MarkAsReadParamsSchema, SessionIdParamSchema, WebSocketSessionTurnSchema };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// ../core/src/platform/utils/debounce.ts
|
|
2
|
+
function debounce(fn, wait) {
|
|
3
|
+
let timeoutId = null;
|
|
4
|
+
const debounced = (...args) => {
|
|
5
|
+
if (timeoutId !== null) {
|
|
6
|
+
clearTimeout(timeoutId);
|
|
7
|
+
}
|
|
8
|
+
timeoutId = setTimeout(() => {
|
|
9
|
+
fn(...args);
|
|
10
|
+
timeoutId = null;
|
|
11
|
+
}, wait);
|
|
12
|
+
};
|
|
13
|
+
debounced.cancel = () => {
|
|
14
|
+
if (timeoutId !== null) {
|
|
15
|
+
clearTimeout(timeoutId);
|
|
16
|
+
timeoutId = null;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
return debounced;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// ../core/src/platform/utils/token-counter.ts
|
|
23
|
+
function estimateTokens(text) {
|
|
24
|
+
const content = typeof text === "string" ? text : JSON.stringify(text);
|
|
25
|
+
const chars = content.length;
|
|
26
|
+
return Math.ceil(chars / 3.5);
|
|
27
|
+
}
|
|
28
|
+
function validateTokenLimit(text, limits) {
|
|
29
|
+
const content = typeof text === "string" ? text : JSON.stringify(text);
|
|
30
|
+
const characters = content.length;
|
|
31
|
+
const tokens = estimateTokens(content);
|
|
32
|
+
return {
|
|
33
|
+
tokens,
|
|
34
|
+
characters,
|
|
35
|
+
withinLimit: tokens <= limits.maxTokens
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
var TOKEN_LIMITS = {
|
|
39
|
+
// User input limits (prompts)
|
|
40
|
+
USER_MESSAGE: 25e3,
|
|
41
|
+
// ~100KB text - allows large code pastes
|
|
42
|
+
CHAT_MESSAGE: 1e4,
|
|
43
|
+
// ~40KB text - typical chat message
|
|
44
|
+
// WebSocket message limits
|
|
45
|
+
WEBSOCKET_MESSAGE: 25e3,
|
|
46
|
+
// Same as user message
|
|
47
|
+
WEBSOCKET_TOTAL: 25e4,
|
|
48
|
+
// Hard limit for entire payload (1MB)
|
|
49
|
+
// AI model context windows (for reference)
|
|
50
|
+
GPT4_TURBO: 128e3,
|
|
51
|
+
CLAUDE_SONNET: 2e5,
|
|
52
|
+
GPT35_TURBO: 16385
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// ../core/src/operations/observability/utils.ts
|
|
56
|
+
function getTimeRangeDates(range) {
|
|
57
|
+
const end = /* @__PURE__ */ new Date();
|
|
58
|
+
const start = /* @__PURE__ */ new Date();
|
|
59
|
+
switch (range) {
|
|
60
|
+
case "1h":
|
|
61
|
+
start.setHours(start.getHours() - 1);
|
|
62
|
+
break;
|
|
63
|
+
case "24h":
|
|
64
|
+
start.setHours(start.getHours() - 24);
|
|
65
|
+
break;
|
|
66
|
+
case "7d":
|
|
67
|
+
start.setDate(start.getDate() - 7);
|
|
68
|
+
break;
|
|
69
|
+
case "30d":
|
|
70
|
+
start.setDate(start.getDate() - 30);
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
startDate: start.toISOString(),
|
|
75
|
+
endDate: end.toISOString()
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function getTimeRangeLabel(range) {
|
|
79
|
+
switch (range) {
|
|
80
|
+
case "1h":
|
|
81
|
+
return "Last 1 hour";
|
|
82
|
+
case "24h":
|
|
83
|
+
return "Last 24 hours";
|
|
84
|
+
case "7d":
|
|
85
|
+
return "Last 7 days";
|
|
86
|
+
case "30d":
|
|
87
|
+
return "Last 30 days";
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function formatBucketTime(timestamp, granularity) {
|
|
91
|
+
const date = new Date(timestamp);
|
|
92
|
+
if (granularity === "hour") {
|
|
93
|
+
return date.toLocaleTimeString("en-US", {
|
|
94
|
+
hour: "2-digit",
|
|
95
|
+
minute: "2-digit",
|
|
96
|
+
hour12: false
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return date.toLocaleDateString("en-US", {
|
|
100
|
+
month: "short",
|
|
101
|
+
day: "numeric"
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// src/utils/constants/polling.ts
|
|
106
|
+
var REFETCH_INTERVAL_DASHBOARD = 6e4;
|
|
107
|
+
var REFETCH_INTERVAL_REALTIME = 3e4;
|
|
108
|
+
var REFETCH_INTERVAL_RUNNING = 2e3;
|
|
109
|
+
var REFETCH_INTERVAL_RUNNING_FAST = 1e3;
|
|
110
|
+
|
|
111
|
+
// src/utils/constants/reconnection.ts
|
|
112
|
+
var SSE_TOKEN_REFRESH_DELAY = 2e3;
|
|
113
|
+
var SSE_CLOSE_GRACE_PERIOD = 5e3;
|
|
114
|
+
var WS_RECONNECT_BASE_DELAY = 1e3;
|
|
115
|
+
var WS_RECONNECT_MAX_DELAY = 3e4;
|
|
116
|
+
var WS_MAX_RETRIES_BEFORE_ERROR = 3;
|
|
117
|
+
|
|
118
|
+
export { REFETCH_INTERVAL_DASHBOARD, REFETCH_INTERVAL_REALTIME, REFETCH_INTERVAL_RUNNING, REFETCH_INTERVAL_RUNNING_FAST, SSE_CLOSE_GRACE_PERIOD, SSE_TOKEN_REFRESH_DELAY, TOKEN_LIMITS, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, debounce, formatBucketTime, getTimeRangeDates, getTimeRangeLabel, validateTokenLimit };
|