@aintela/chat 0.2.59 → 0.3.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/README.md +77 -0
- package/dist/{ClientMessage-EKgfuTp8.js → ClientMessage-DUby3KyC.js} +16 -22
- package/dist/{ClientMessage-EKgfuTp8.js.map → ClientMessage-DUby3KyC.js.map} +1 -1
- package/dist/Memory-CjrYSkzB.js +47 -0
- package/dist/Memory-CjrYSkzB.js.map +1 -0
- package/dist/atMentions-CnHuJKhX.js +959 -0
- package/dist/atMentions-CnHuJKhX.js.map +1 -0
- package/dist/components.js +10161 -11344
- package/dist/components.js.map +1 -1
- package/dist/environmentUtils-VZNTCzEE.js +88 -0
- package/dist/environmentUtils-VZNTCzEE.js.map +1 -0
- package/dist/hooks.js +4 -5
- package/dist/{httpArtifactService-CpbRpTHb.js → httpArtifactService-Ba9xFy1E.js} +537 -646
- package/dist/httpArtifactService-Ba9xFy1E.js.map +1 -0
- package/dist/{httpSessionService-BEQMIKfv.js → httpSessionService-DXlT2vxT.js} +34 -24
- package/dist/httpSessionService-DXlT2vxT.js.map +1 -0
- package/dist/index.js +242 -243
- package/dist/models.js +48 -51
- package/dist/models.js.map +1 -1
- package/dist/serializer-D2W42bdT.js +1730 -0
- package/dist/serializer-D2W42bdT.js.map +1 -0
- package/dist/services.js +2 -2
- package/dist/src/components/AiChat/AiChatContext.d.ts +0 -3
- package/dist/src/components/AiChat/AiChatProvider.agent.test.d.ts +1 -0
- package/dist/src/components/AiChat/AiChatProvider.d.ts +2 -2
- package/dist/src/components/AiChat/AiChatTypes.d.ts +45 -27
- package/dist/src/components/AiChat/ChatPane/ChatPane.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/MessageAgent.d.ts +0 -1
- package/dist/src/components/AiChat/ChatPane/MessagePart.d.ts +5 -3
- package/dist/src/components/AiChat/ChatPane/MessagePart.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/friendlyToolConfig.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/messageAgentThoughts.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/parts/ThoughtRun.d.ts +28 -0
- package/dist/src/components/AiChat/ChatPane/parts/ThoughtRunContext.d.ts +18 -0
- package/dist/src/components/AiChat/ChatPane/parts/index.d.ts +5 -1
- package/dist/src/components/AiChat/ChatPane/parts/thoughtRun.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/parts/uiToolDispatcher.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/parts/uiToolRegistry.test.d.ts +1 -0
- package/dist/src/components/AiChat/aiChatEngine.d.ts +24 -5
- package/dist/src/components/AiChat/index.d.ts +1 -3
- package/dist/src/components/AiChat/sessionStateManagerService.bind.test.d.ts +1 -0
- package/dist/src/components/AiChat/sessionStateManagerService.d.ts +22 -10
- package/dist/src/components/AiChat/useAgentEngine.d.ts +69 -0
- package/dist/src/components/AiChat/useAgentEngine.test.d.ts +1 -0
- package/dist/src/components/index.d.ts +4 -7
- package/dist/src/components/v2/AiChatFloating.d.ts +3 -0
- package/dist/src/components/v2/PromptV2.d.ts +21 -6
- package/dist/src/components/v2/PromptV2.test.d.ts +1 -0
- package/dist/src/components/v2/icons.d.ts +1 -0
- package/dist/src/components/v2/index.d.ts +25 -25
- package/dist/src/hooks/index.d.ts +1 -1
- package/dist/src/hooks/useContainerWidth.d.ts +0 -1
- package/dist/src/models/ArtifactData.d.ts +0 -7
- package/dist/src/models/ChatSession.d.ts +0 -32
- package/dist/src/models/ClientMessage.d.ts +0 -4
- package/dist/src/models/ServerEvent.d.ts +0 -36
- package/dist/src/models/enums.d.ts +0 -1
- package/dist/src/models/index.d.ts +1 -2
- package/dist/src/models/interactionPartUtils.test.d.ts +1 -0
- package/dist/src/models/semanticKernelModel/sanitizeJsonString.test.d.ts +0 -0
- package/dist/src/models/serverEventDecode.test.d.ts +0 -0
- package/dist/src/services/WebSocketConnection/webSocketConnectionV2.reconnect.test.d.ts +0 -0
- package/dist/src/services/interactionService.d.ts +11 -0
- package/dist/src/services/interactionServiceGrouping.test.d.ts +1 -0
- package/dist/src/services/servers/AgentGatewayService.d.ts +25 -18
- package/dist/src/services/servers/AgentGatewayWSAsync.d.ts +0 -1
- package/dist/src/services/servers/agentGatewayAgentContext.test.d.ts +1 -0
- package/dist/src/services/storageService.d.ts +34 -59
- package/dist/src/services/storageService.test.d.ts +1 -0
- package/dist/src/utils/index.d.ts +2 -6
- package/dist/src/utils/urlParser.d.ts +0 -1
- package/dist/src/utils/urlParser.test.d.ts +1 -0
- package/dist/tests/fakes/fakeChatServices.d.ts +42 -0
- package/dist/tests/fakes/fakeRawWebSocket.d.ts +51 -0
- package/dist/tests/fakes/fakeStorage.d.ts +7 -0
- package/dist/tests/fakes/makeGateway.d.ts +24 -1
- package/dist/{useChatSessions-BQP7DhY1.js → useChatSessions-1AAvAdPW.js} +2 -2
- package/dist/{useChatSessions-BQP7DhY1.js.map → useChatSessions-1AAvAdPW.js.map} +1 -1
- package/dist/useContainerWidth-B40_i-NW.js +295 -0
- package/dist/{useContainerWidth-B3t1ZTlo.js.map → useContainerWidth-B40_i-NW.js.map} +1 -1
- package/dist/utils.js +340 -57
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/Memory-DjLZqgbF.js +0 -84
- package/dist/Memory-DjLZqgbF.js.map +0 -1
- package/dist/atMentions-C0dza8DD.js +0 -1000
- package/dist/atMentions-C0dza8DD.js.map +0 -1
- package/dist/auth-lluJZyQO.js +0 -524
- package/dist/auth-lluJZyQO.js.map +0 -1
- package/dist/environmentUtils-CUVZ6Dq1.js +0 -478
- package/dist/environmentUtils-CUVZ6Dq1.js.map +0 -1
- package/dist/httpArtifactService-CpbRpTHb.js.map +0 -1
- package/dist/httpSessionService-BEQMIKfv.js.map +0 -1
- package/dist/serializer-BXSH9aYQ.js +0 -1360
- package/dist/serializer-BXSH9aYQ.js.map +0 -1
- package/dist/src/components/AiChat/AiChatFloating.d.ts +0 -3
- package/dist/src/components/AiChat/ChatPane/LastPrompts.d.ts +0 -9
- package/dist/src/components/AiChat/ChatPane/Prompt.d.ts +0 -9
- package/dist/src/components/AiChat/ChatPane/SubAgentBox.d.ts +0 -9
- package/dist/src/components/AiChat/ChatPane/TaskList.d.ts +0 -6
- package/dist/src/components/AiChat/useLiveSession.d.ts +0 -52
- package/dist/src/components/v2/AiChatFloatingV2.d.ts +0 -3
- package/dist/src/utils/jsonDetector.d.ts +0 -50
- package/dist/src/utils/jsonUtils.d.ts +0 -1
- package/dist/src/utils/materialIconsSvg.d.ts +0 -51
- package/dist/src/utils/objectUtils.d.ts +0 -31
- package/dist/src/utils/parseArtifact.d.ts +0 -3
- package/dist/src/utils/uriUtils.d.ts +0 -39
- package/dist/useContainerWidth-B3t1ZTlo.js +0 -309
package/dist/utils.js
CHANGED
|
@@ -1,60 +1,343 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var a = (e, t) => u(e, "name", { value: t, configurable: !0 });
|
|
3
|
+
import { a as c, b as s } from "./environmentUtils-VZNTCzEE.js";
|
|
4
|
+
import { A as U, D as k, g as x, c as M, d as V, e as G, f as R, i as H, r as W } from "./environmentUtils-VZNTCzEE.js";
|
|
5
|
+
import { S as Y, a as Z, b as j, c as z, d as Q, e as $, f as q, g as J, h as X, i as ee, j as te, k as oe, l as ae, p as re, m as ne, s as ie, o as se, t as le } from "./atMentions-CnHuJKhX.js";
|
|
6
|
+
const m = "https://agent.tripapi.com.br", p = "http://localagent:8000", S = /* @__PURE__ */ a((e) => new URLSearchParams(e.location.search).get("local") === "true" ? p : c() ?? m, "getAgentBaseUrl"), f = "https://storage.googleapis.com/aibi_artifacts_bucket", I = /* @__PURE__ */ a(() => f, "getArtifactsBaseUrl"), i = {}, h = (i == null ? void 0 : i.VITE_CADDY) == "true";
|
|
7
|
+
function F() {
|
|
8
|
+
const e = h ? "http://wsserver.localhost" : "http://localhost:8000";
|
|
9
|
+
if (typeof window < "u" && (window != null && window.location)) {
|
|
10
|
+
const t = window.location.host.toLowerCase();
|
|
11
|
+
return t.indexOf("docker.internal") > -1 ? "http://host.docker.internal:8000" : t.indexOf("localhost") > -1 ? e : c() ?? "https://agent.tripapi.com.br";
|
|
12
|
+
}
|
|
13
|
+
return typeof process < "u" && process.env && (process.env.AGENT_BASE_URL || process.env.DOTNET_API_URL) || e;
|
|
14
|
+
}
|
|
15
|
+
a(F, "getDotNetBaseUrl");
|
|
16
|
+
const v = /* @__PURE__ */ a((e, t, r = null, d = null) => {
|
|
17
|
+
const n = e.customElements.get("ebi-context-data");
|
|
18
|
+
n && (n.user = t, n.context = r || null, n.sessionId = d);
|
|
19
|
+
}, "setEbiContextData"), w = /* @__PURE__ */ a((e) => {
|
|
20
|
+
const t = window.customElements.get("ebi-context-data");
|
|
21
|
+
t && (t.sessionId = e);
|
|
22
|
+
}, "setEbiContextSessionId");
|
|
23
|
+
function g(e) {
|
|
24
|
+
return e.replace(/([A-Z])/g, "_$1").toLowerCase().replace(/^_/, "");
|
|
25
|
+
}
|
|
26
|
+
a(g, "pascalToSnakeCase");
|
|
27
|
+
function A(e) {
|
|
28
|
+
return e.replace(/([A-Z])/g, " $1").trim();
|
|
29
|
+
}
|
|
30
|
+
a(A, "pascalToFriendlyName");
|
|
31
|
+
const C = [
|
|
32
|
+
// === ACTION ICONS ===
|
|
33
|
+
"Add",
|
|
34
|
+
"Remove",
|
|
35
|
+
"Delete",
|
|
36
|
+
"Edit",
|
|
37
|
+
"Save",
|
|
38
|
+
"Cancel",
|
|
39
|
+
"Check",
|
|
40
|
+
"Close",
|
|
41
|
+
"Done",
|
|
42
|
+
"Clear",
|
|
43
|
+
"Search",
|
|
44
|
+
"Refresh",
|
|
45
|
+
"Undo",
|
|
46
|
+
"Redo",
|
|
47
|
+
"Print",
|
|
48
|
+
"Download",
|
|
49
|
+
"Upload",
|
|
50
|
+
"Share",
|
|
51
|
+
"Copy",
|
|
52
|
+
"ContentCopy",
|
|
53
|
+
"ContentPaste",
|
|
54
|
+
"ContentCut",
|
|
55
|
+
"SelectAll",
|
|
56
|
+
"Sync",
|
|
57
|
+
"Settings",
|
|
58
|
+
"MoreVert",
|
|
59
|
+
"MoreHoriz",
|
|
60
|
+
"FilterList",
|
|
61
|
+
"Sort",
|
|
62
|
+
"ZoomIn",
|
|
63
|
+
"ZoomOut",
|
|
64
|
+
"Fullscreen",
|
|
65
|
+
"FullscreenExit",
|
|
66
|
+
"OpenInNew",
|
|
67
|
+
"Launch",
|
|
68
|
+
"Send",
|
|
69
|
+
"Reply",
|
|
70
|
+
"Forward",
|
|
71
|
+
"Archive",
|
|
72
|
+
"Unarchive",
|
|
73
|
+
// === NAVIGATION ICONS ===
|
|
74
|
+
"Home",
|
|
75
|
+
"Menu",
|
|
76
|
+
"ArrowBack",
|
|
77
|
+
"ArrowForward",
|
|
78
|
+
"ArrowUpward",
|
|
79
|
+
"ArrowDownward",
|
|
80
|
+
"ChevronLeft",
|
|
81
|
+
"ChevronRight",
|
|
82
|
+
"ExpandMore",
|
|
83
|
+
"ExpandLess",
|
|
84
|
+
"FirstPage",
|
|
85
|
+
"LastPage",
|
|
86
|
+
"NavigateBefore",
|
|
87
|
+
"NavigateNext",
|
|
88
|
+
"Apps",
|
|
89
|
+
"Dashboard",
|
|
90
|
+
"Inbox",
|
|
91
|
+
"Explore",
|
|
92
|
+
"History",
|
|
93
|
+
"Bookmark",
|
|
94
|
+
"BookmarkBorder",
|
|
95
|
+
// === COMMUNICATION ICONS ===
|
|
96
|
+
"Email",
|
|
97
|
+
"Phone",
|
|
98
|
+
"Message",
|
|
99
|
+
"Chat",
|
|
100
|
+
"Forum",
|
|
101
|
+
"Comment",
|
|
102
|
+
"Notifications",
|
|
103
|
+
"NotificationsActive",
|
|
104
|
+
"NotificationsOff",
|
|
105
|
+
"Call",
|
|
106
|
+
"CallEnd",
|
|
107
|
+
"Contacts",
|
|
108
|
+
"ContactMail",
|
|
109
|
+
"ContactPhone",
|
|
110
|
+
"Person",
|
|
111
|
+
"PersonAdd",
|
|
112
|
+
"PersonRemove",
|
|
113
|
+
"People",
|
|
114
|
+
"Group",
|
|
115
|
+
"Groups",
|
|
116
|
+
// === CONTENT ICONS ===
|
|
117
|
+
"Folder",
|
|
118
|
+
"FolderOpen",
|
|
119
|
+
"CreateNewFolder",
|
|
120
|
+
"Description",
|
|
121
|
+
"InsertDriveFile",
|
|
122
|
+
"AttachFile",
|
|
123
|
+
"Link",
|
|
124
|
+
"LinkOff",
|
|
125
|
+
"Image",
|
|
126
|
+
"Photo",
|
|
127
|
+
"PhotoLibrary",
|
|
128
|
+
"VideoLibrary",
|
|
129
|
+
"Movie",
|
|
130
|
+
"MusicNote",
|
|
131
|
+
"Audiotrack",
|
|
132
|
+
"Article",
|
|
133
|
+
"Feed",
|
|
134
|
+
"List",
|
|
135
|
+
"ViewList",
|
|
136
|
+
"GridView",
|
|
137
|
+
"TableChart",
|
|
138
|
+
"BarChart",
|
|
139
|
+
"PieChart",
|
|
140
|
+
"ShowChart",
|
|
141
|
+
"Timeline",
|
|
142
|
+
"Assessment",
|
|
143
|
+
"Analytics",
|
|
144
|
+
// === STATUS & INFO ICONS ===
|
|
145
|
+
"Info",
|
|
146
|
+
"Warning",
|
|
147
|
+
"Error",
|
|
148
|
+
"Help",
|
|
149
|
+
"HelpOutline",
|
|
150
|
+
"CheckCircle",
|
|
151
|
+
"Cancel",
|
|
152
|
+
"Block",
|
|
153
|
+
"Report",
|
|
154
|
+
"ReportProblem",
|
|
155
|
+
"Verified",
|
|
156
|
+
"VerifiedUser",
|
|
157
|
+
"Security",
|
|
158
|
+
"Lock",
|
|
159
|
+
"LockOpen",
|
|
160
|
+
"Visibility",
|
|
161
|
+
"VisibilityOff",
|
|
162
|
+
"Public",
|
|
163
|
+
"PrivacyTip",
|
|
164
|
+
// === DEVICE & HARDWARE ICONS ===
|
|
165
|
+
"Computer",
|
|
166
|
+
"DesktopWindows",
|
|
167
|
+
"Laptop",
|
|
168
|
+
"Smartphone",
|
|
169
|
+
"Tablet",
|
|
170
|
+
"Watch",
|
|
171
|
+
"Tv",
|
|
172
|
+
"Router",
|
|
173
|
+
"Wifi",
|
|
174
|
+
"WifiOff",
|
|
175
|
+
"Bluetooth",
|
|
176
|
+
"BluetoothDisabled",
|
|
177
|
+
"Battery",
|
|
178
|
+
"BatteryFull",
|
|
179
|
+
"BatteryAlert",
|
|
180
|
+
"SignalCellularAlt",
|
|
181
|
+
"Storage",
|
|
182
|
+
"Memory",
|
|
183
|
+
"Usb",
|
|
184
|
+
"Keyboard",
|
|
185
|
+
"Mouse",
|
|
186
|
+
"Print",
|
|
187
|
+
"Scanner",
|
|
188
|
+
"Camera",
|
|
189
|
+
"Mic",
|
|
190
|
+
"MicOff",
|
|
191
|
+
"Videocam",
|
|
192
|
+
"VideocamOff",
|
|
193
|
+
"Speaker",
|
|
194
|
+
"VolumeUp",
|
|
195
|
+
"VolumeDown",
|
|
196
|
+
"VolumeMute",
|
|
197
|
+
"VolumeOff",
|
|
198
|
+
// === TIME & DATE ICONS ===
|
|
199
|
+
"Schedule",
|
|
200
|
+
"AccessTime",
|
|
201
|
+
"Timer",
|
|
202
|
+
"Timelapse",
|
|
203
|
+
"Today",
|
|
204
|
+
"Event",
|
|
205
|
+
"EventAvailable",
|
|
206
|
+
"EventBusy",
|
|
207
|
+
"CalendarToday",
|
|
208
|
+
"CalendarMonth",
|
|
209
|
+
"DateRange",
|
|
210
|
+
"Alarm",
|
|
211
|
+
"AlarmOn",
|
|
212
|
+
"AlarmOff",
|
|
213
|
+
// === LOCATION & MAP ICONS ===
|
|
214
|
+
"Place",
|
|
215
|
+
"LocationOn",
|
|
216
|
+
"LocationOff",
|
|
217
|
+
"MyLocation",
|
|
218
|
+
"GpsFixed",
|
|
219
|
+
"Map",
|
|
220
|
+
"Directions",
|
|
221
|
+
"DirectionsCar",
|
|
222
|
+
"DirectionsBus",
|
|
223
|
+
"DirectionsWalk",
|
|
224
|
+
"Flight",
|
|
225
|
+
"LocalShipping",
|
|
226
|
+
"Store",
|
|
227
|
+
"Business",
|
|
228
|
+
// === SOCIAL & RATING ICONS ===
|
|
229
|
+
"ThumbUp",
|
|
230
|
+
"ThumbDown",
|
|
231
|
+
"Favorite",
|
|
232
|
+
"FavoriteBorder",
|
|
233
|
+
"Star",
|
|
234
|
+
"StarBorder",
|
|
235
|
+
"StarHalf",
|
|
236
|
+
"Grade",
|
|
237
|
+
"Flag",
|
|
238
|
+
"EmojiEmotions",
|
|
239
|
+
"SentimentSatisfied",
|
|
240
|
+
"SentimentDissatisfied",
|
|
241
|
+
// === EDITOR & FORMAT ICONS ===
|
|
242
|
+
"FormatBold",
|
|
243
|
+
"FormatItalic",
|
|
244
|
+
"FormatUnderlined",
|
|
245
|
+
"FormatAlignLeft",
|
|
246
|
+
"FormatAlignCenter",
|
|
247
|
+
"FormatAlignRight",
|
|
248
|
+
"FormatAlignJustify",
|
|
249
|
+
"FormatListBulleted",
|
|
250
|
+
"FormatListNumbered",
|
|
251
|
+
"FormatIndentIncrease",
|
|
252
|
+
"FormatIndentDecrease",
|
|
253
|
+
"FormatQuote",
|
|
254
|
+
"Title",
|
|
255
|
+
"TextFields",
|
|
256
|
+
"Code",
|
|
257
|
+
"Functions",
|
|
258
|
+
"Highlight",
|
|
259
|
+
"ColorLens",
|
|
260
|
+
"Palette",
|
|
261
|
+
"Brush",
|
|
262
|
+
"Create"
|
|
263
|
+
], o = C.map((e) => ({
|
|
264
|
+
iconName: g(e),
|
|
265
|
+
friendlyName: A(e)
|
|
266
|
+
}));
|
|
267
|
+
function O(e) {
|
|
268
|
+
return o.find((t) => t.iconName === e);
|
|
269
|
+
}
|
|
270
|
+
a(O, "getIconByName");
|
|
271
|
+
function b(e) {
|
|
272
|
+
const t = e.toLowerCase();
|
|
273
|
+
return o.filter(
|
|
274
|
+
(r) => r.friendlyName.toLowerCase().includes(t) || r.iconName.includes(t)
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
a(b, "searchIcons");
|
|
278
|
+
const D = {
|
|
279
|
+
action: o.slice(0, 40),
|
|
280
|
+
navigation: o.slice(40, 61),
|
|
281
|
+
communication: o.slice(61, 81),
|
|
282
|
+
content: o.slice(81, 107),
|
|
283
|
+
status: o.slice(107, 126),
|
|
284
|
+
device: o.slice(126, 159),
|
|
285
|
+
time: o.slice(159, 173),
|
|
286
|
+
location: o.slice(173, 187),
|
|
287
|
+
social: o.slice(187, 199),
|
|
288
|
+
editor: o.slice(199)
|
|
289
|
+
}, y = s("VITE_GOOGLE_CLIENT_ID"), T = [
|
|
290
|
+
"envisiontecnologia.com.br"
|
|
291
|
+
];
|
|
292
|
+
var l;
|
|
293
|
+
const B = ((l = s("ALLOWED_EMAILS")) == null ? void 0 : l.split(",")) ?? [], N = {
|
|
294
|
+
requireAuthentication: !0,
|
|
295
|
+
allowAnonymousAccess: !1,
|
|
296
|
+
sessionTimeout: 1440 * 60 * 1e3,
|
|
297
|
+
// 24 hours in milliseconds
|
|
298
|
+
GOOGLE_API_KEY: s("GOOGLE_API_KEY")
|
|
299
|
+
};
|
|
4
300
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
X as parseAndValidateArtifactUrl,
|
|
47
|
-
G as parseArtifactFromJson,
|
|
48
|
-
Z as parseKnownNumbers,
|
|
49
|
-
V as parseUriParams,
|
|
50
|
-
$ as placeCaret,
|
|
51
|
-
aa as placeholderAt,
|
|
52
|
-
g as resolveApiUrl,
|
|
53
|
-
k as searchIcons,
|
|
54
|
-
u as setEbiContextData,
|
|
55
|
-
F as setEbiContextSessionId,
|
|
56
|
-
ea as splitBigLinesWithSpaces,
|
|
57
|
-
sa as startsWithInteractionId,
|
|
58
|
-
ta as tokenizeForHighlight
|
|
301
|
+
T as ALLOWED_DOMAINS,
|
|
302
|
+
B as ALLOWED_EMAILS,
|
|
303
|
+
U as ANALYTICS_AGENT_NAME,
|
|
304
|
+
N as AUTH_CONFIG,
|
|
305
|
+
k as DEV_SERVER_CONFIG,
|
|
306
|
+
y as GOOGLE_CLIENT_ID,
|
|
307
|
+
Y as SortableTable,
|
|
308
|
+
Z as activatePlaceholder,
|
|
309
|
+
j as advanceToPlaceholder,
|
|
310
|
+
z as applyTriggerInsertion,
|
|
311
|
+
Q as chipLocations,
|
|
312
|
+
$ as chunkArray,
|
|
313
|
+
q as detectTrigger,
|
|
314
|
+
J as extractInteractionId,
|
|
315
|
+
X as extractLinkAction,
|
|
316
|
+
ee as fetchAtMentions,
|
|
317
|
+
te as findPlaceholder,
|
|
318
|
+
S as getAgentBaseUrl,
|
|
319
|
+
x as getAgentServerBaseUrl,
|
|
320
|
+
I as getArtifactsBaseUrl,
|
|
321
|
+
F as getDotNetBaseUrl,
|
|
322
|
+
s as getEnvVar,
|
|
323
|
+
M as getEnvironmentInfo,
|
|
324
|
+
O as getIconByName,
|
|
325
|
+
V as getRandomUUID,
|
|
326
|
+
G as getServerBaseUrl,
|
|
327
|
+
R as getServerClientBaseUrl,
|
|
328
|
+
D as iconCategories,
|
|
329
|
+
oe as isSectionStart,
|
|
330
|
+
H as isServer,
|
|
331
|
+
ae as isValidInteractionId,
|
|
332
|
+
o as materialIcons,
|
|
333
|
+
re as placeCaret,
|
|
334
|
+
ne as placeholderAt,
|
|
335
|
+
W as resolveApiUrl,
|
|
336
|
+
b as searchIcons,
|
|
337
|
+
v as setEbiContextData,
|
|
338
|
+
w as setEbiContextSessionId,
|
|
339
|
+
ie as splitBigLinesWithSpaces,
|
|
340
|
+
se as startsWithInteractionId,
|
|
341
|
+
le as tokenizeForHighlight
|
|
59
342
|
};
|
|
60
343
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../src/utils/getAgentBaseUrl.ts","../src/utils/getAgentArtifactsBaseUrl.ts","../src/utils/getDotNetBaseUrl.ts","../src/utils/sessionWindowParameters.ts","../src/utils/materialIconsList.ts","../src/utils/auth.ts"],"sourcesContent":["import { agentBaseUrlOverride } from './envOverrides';\n\nconst base_production_url = \"https://agent.tripapi.com.br\";\nconst base_url_local = \"http://localagent:8000\";\n\nexport const getAgentBaseUrl = (window: any): string => {\n const urlParams = new URLSearchParams(window.location.search);\n const isLocal = urlParams.get('local') === 'true';\n\n return isLocal ? base_url_local : (agentBaseUrlOverride() ?? base_production_url);\n}","//const GCS_BUCKET_IMAGE_PATH = \"https://storage.googleapis.com/ebi_artifacts_public\"\nconst GCS_BUCKET_IMAGE_PATH = \"https://storage.googleapis.com/aibi_artifacts_bucket\"\n\n\nexport const getArtifactsBaseUrl = (): string => {\n return GCS_BUCKET_IMAGE_PATH;\n}","import { agentBaseUrlOverride } from './envOverrides';\n\nconst runningOnCaddy = ((import.meta as any).env?.VITE_CADDY as string) == \"true\";\n\n\n/**\n * Gets the base URL for the .NET backend API\n * Used for Agent and Plugin services that communicate directly with the .NET server\n */\nexport function getDotNetBaseUrl(): string {\n const localHostUrl = runningOnCaddy ? \"http://wsserver.localhost\" : \"http://localhost:8000\"\n\n\n // Check if we're in a browser environment\n if (typeof window !== 'undefined' && window?.location) {\n const location = window.location.host.toLowerCase();\n\n // When loaded from inside a Docker container (e.g. Puppeteer in ai-worker)\n // the page is served from host.docker.internal. The .NET API is also on the\n // host machine, so we must route through host.docker.internal as well.\n if (location.indexOf('docker.internal') > -1) {\n return 'http://host.docker.internal:8000';\n }\n\n if (location.indexOf('localhost') > -1) {\n\n return localHostUrl;\n }\n\n // Production - the deploy-time override (e.g. staging) or the prod default\n return agentBaseUrlOverride() ?? 'https://agent.tripapi.com.br';\n }\n\n // Server-side rendering or Node.js environment\n if (typeof process !== 'undefined' && process.env) {\n\n return process.env.AGENT_BASE_URL || process.env.DOTNET_API_URL || localHostUrl;\n }\n\n return localHostUrl;\n}\n","import type { IEbiContextData } from '../models/IAbiContext';\nimport type { AgentContext, User } from '../models/contexts';\n\nexport const setEbiContextData = (window: any, user: User, context: AgentContext | null = null, sessionId: string | null = null) => {\n const ebiContextData = window.customElements.get('ebi-context-data') as unknown as IEbiContextData;\n if (ebiContextData) {\n ebiContextData.user = user;\n ebiContextData.context = context || null;\n ebiContextData.sessionId = sessionId\n }\n}\n\nexport const setEbiContextSessionId = (sessionId: string) => {\n const ebiContextData = window.customElements.get('ebi-context-data') as unknown as IEbiContextData;\n if (ebiContextData) {\n ebiContextData.sessionId = sessionId\n }\n}","/**\n * Material Icons List\n * \n * This file contains a curated list of 200 Material Icons for use with\n * the Material Icons font: <i className=\"material-icons\">icon_name</i>\n * \n * Each icon has:\n * - iconName: lowercase snake_case name for use in the material-icons class\n * - friendlyName: Human-readable display name\n */\n\nexport interface MaterialIcon {\n iconName: string;\n friendlyName: string;\n}\n\n/**\n * Converts PascalCase to snake_case lowercase\n * Example: AccessAlarm -> access_alarm\n */\nfunction pascalToSnakeCase(str: string): string {\n return str\n .replace(/([A-Z])/g, '_$1')\n .toLowerCase()\n .replace(/^_/, '');\n}\n\n/**\n * Converts PascalCase to friendly name with spaces\n * Example: AccessAlarm -> Access Alarm\n */\nfunction pascalToFriendlyName(str: string): string {\n return str\n .replace(/([A-Z])/g, ' $1')\n .trim();\n}\n\n// Raw icon names in PascalCase (MUI format)\nconst rawIconNames = [\n // === ACTION ICONS ===\n 'Add',\n 'Remove',\n 'Delete',\n 'Edit',\n 'Save',\n 'Cancel',\n 'Check',\n 'Close',\n 'Done',\n 'Clear',\n 'Search',\n 'Refresh',\n 'Undo',\n 'Redo',\n 'Print',\n 'Download',\n 'Upload',\n 'Share',\n 'Copy',\n 'ContentCopy',\n 'ContentPaste',\n 'ContentCut',\n 'SelectAll',\n 'Sync',\n 'Settings',\n 'MoreVert',\n 'MoreHoriz',\n 'FilterList',\n 'Sort',\n 'ZoomIn',\n 'ZoomOut',\n 'Fullscreen',\n 'FullscreenExit',\n 'OpenInNew',\n 'Launch',\n 'Send',\n 'Reply',\n 'Forward',\n 'Archive',\n 'Unarchive',\n\n // === NAVIGATION ICONS ===\n 'Home',\n 'Menu',\n 'ArrowBack',\n 'ArrowForward',\n 'ArrowUpward',\n 'ArrowDownward',\n 'ChevronLeft',\n 'ChevronRight',\n 'ExpandMore',\n 'ExpandLess',\n 'FirstPage',\n 'LastPage',\n 'NavigateBefore',\n 'NavigateNext',\n 'Apps',\n 'Dashboard',\n 'Inbox',\n 'Explore',\n 'History',\n 'Bookmark',\n 'BookmarkBorder',\n\n // === COMMUNICATION ICONS ===\n 'Email',\n 'Phone',\n 'Message',\n 'Chat',\n 'Forum',\n 'Comment',\n 'Notifications',\n 'NotificationsActive',\n 'NotificationsOff',\n 'Call',\n 'CallEnd',\n 'Contacts',\n 'ContactMail',\n 'ContactPhone',\n 'Person',\n 'PersonAdd',\n 'PersonRemove',\n 'People',\n 'Group',\n 'Groups',\n\n // === CONTENT ICONS ===\n 'Folder',\n 'FolderOpen',\n 'CreateNewFolder',\n 'Description',\n 'InsertDriveFile',\n 'AttachFile',\n 'Link',\n 'LinkOff',\n 'Image',\n 'Photo',\n 'PhotoLibrary',\n 'VideoLibrary',\n 'Movie',\n 'MusicNote',\n 'Audiotrack',\n 'Article',\n 'Feed',\n 'List',\n 'ViewList',\n 'GridView',\n 'TableChart',\n 'BarChart',\n 'PieChart',\n 'ShowChart',\n 'Timeline',\n 'Assessment',\n 'Analytics',\n\n // === STATUS & INFO ICONS ===\n 'Info',\n 'Warning',\n 'Error',\n 'Help',\n 'HelpOutline',\n 'CheckCircle',\n 'Cancel',\n 'Block',\n 'Report',\n 'ReportProblem',\n 'Verified',\n 'VerifiedUser',\n 'Security',\n 'Lock',\n 'LockOpen',\n 'Visibility',\n 'VisibilityOff',\n 'Public',\n 'PrivacyTip',\n\n // === DEVICE & HARDWARE ICONS ===\n 'Computer',\n 'DesktopWindows',\n 'Laptop',\n 'Smartphone',\n 'Tablet',\n 'Watch',\n 'Tv',\n 'Router',\n 'Wifi',\n 'WifiOff',\n 'Bluetooth',\n 'BluetoothDisabled',\n 'Battery',\n 'BatteryFull',\n 'BatteryAlert',\n 'SignalCellularAlt',\n 'Storage',\n 'Memory',\n 'Usb',\n 'Keyboard',\n 'Mouse',\n 'Print',\n 'Scanner',\n 'Camera',\n 'Mic',\n 'MicOff',\n 'Videocam',\n 'VideocamOff',\n 'Speaker',\n 'VolumeUp',\n 'VolumeDown',\n 'VolumeMute',\n 'VolumeOff',\n\n // === TIME & DATE ICONS ===\n 'Schedule',\n 'AccessTime',\n 'Timer',\n 'Timelapse',\n 'Today',\n 'Event',\n 'EventAvailable',\n 'EventBusy',\n 'CalendarToday',\n 'CalendarMonth',\n 'DateRange',\n 'Alarm',\n 'AlarmOn',\n 'AlarmOff',\n\n // === LOCATION & MAP ICONS ===\n 'Place',\n 'LocationOn',\n 'LocationOff',\n 'MyLocation',\n 'GpsFixed',\n 'Map',\n 'Directions',\n 'DirectionsCar',\n 'DirectionsBus',\n 'DirectionsWalk',\n 'Flight',\n 'LocalShipping',\n 'Store',\n 'Business',\n\n // === SOCIAL & RATING ICONS ===\n 'ThumbUp',\n 'ThumbDown',\n 'Favorite',\n 'FavoriteBorder',\n 'Star',\n 'StarBorder',\n 'StarHalf',\n 'Grade',\n 'Flag',\n 'EmojiEmotions',\n 'SentimentSatisfied',\n 'SentimentDissatisfied',\n\n // === EDITOR & FORMAT ICONS ===\n 'FormatBold',\n 'FormatItalic',\n 'FormatUnderlined',\n 'FormatAlignLeft',\n 'FormatAlignCenter',\n 'FormatAlignRight',\n 'FormatAlignJustify',\n 'FormatListBulleted',\n 'FormatListNumbered',\n 'FormatIndentIncrease',\n 'FormatIndentDecrease',\n 'FormatQuote',\n 'Title',\n 'TextFields',\n 'Code',\n 'Functions',\n 'Highlight',\n 'ColorLens',\n 'Palette',\n 'Brush',\n 'Create',\n];\n\n/**\n * Curated list of 200 Material Icons\n */\nexport const materialIcons: MaterialIcon[] = rawIconNames.map(name => ({\n iconName: pascalToSnakeCase(name),\n friendlyName: pascalToFriendlyName(name),\n}));\n\n/**\n * Get an icon by its snake_case name\n */\nexport function getIconByName(iconName: string): MaterialIcon | undefined {\n return materialIcons.find(icon => icon.iconName === iconName);\n}\n\n/**\n * Search icons by friendly name (case-insensitive partial match)\n */\nexport function searchIcons(query: string): MaterialIcon[] {\n const lowerQuery = query.toLowerCase();\n return materialIcons.filter(icon =>\n icon.friendlyName.toLowerCase().includes(lowerQuery) ||\n icon.iconName.includes(lowerQuery)\n );\n}\n\n/**\n * Icons grouped by category for easier browsing\n */\nexport const iconCategories = {\n action: materialIcons.slice(0, 40),\n navigation: materialIcons.slice(40, 61),\n communication: materialIcons.slice(61, 81),\n content: materialIcons.slice(81, 107),\n status: materialIcons.slice(107, 126),\n device: materialIcons.slice(126, 159),\n time: materialIcons.slice(159, 173),\n location: materialIcons.slice(173, 187),\n social: materialIcons.slice(187, 199),\n editor: materialIcons.slice(199),\n};\n\nexport default materialIcons;\n","// Google OAuth Configuration\n// Replace this with your actual Google OAuth client ID\n// You can get this from the Google Cloud Console: https://console.cloud.google.com/\n\nimport { getEnvVar } from '../utils/envUtils.js';\n\nexport const GOOGLE_CLIENT_ID = getEnvVar('VITE_GOOGLE_CLIENT_ID');\n\n// Optional: Configure allowed domains for authentication\nexport const ALLOWED_DOMAINS = [\n \"envisiontecnologia.com.br\"\n];\n\nexport const ALLOWED_EMAILS = getEnvVar('ALLOWED_EMAILS')?.split(',') ?? [];\n\n// Optional: Configure authentication requirements\nexport const AUTH_CONFIG = {\n requireAuthentication: true,\n allowAnonymousAccess: false,\n sessionTimeout: 24 * 60 * 60 * 1000, // 24 hours in milliseconds\n GOOGLE_API_KEY: getEnvVar('GOOGLE_API_KEY')\n}; "],"names":["base_production_url","base_url_local","getAgentBaseUrl","__name","window","agentBaseUrlOverride","GCS_BUCKET_IMAGE_PATH","getArtifactsBaseUrl","runningOnCaddy","__vite_import_meta_env__","getDotNetBaseUrl","localHostUrl","location","setEbiContextData","user","context","sessionId","ebiContextData","setEbiContextSessionId","pascalToSnakeCase","str","pascalToFriendlyName","rawIconNames","materialIcons","name","getIconByName","iconName","icon","searchIcons","query","lowerQuery","iconCategories","GOOGLE_CLIENT_ID","getEnvVar","ALLOWED_DOMAINS","ALLOWED_EMAILS","_a","AUTH_CONFIG"],"mappings":";;;;;AAEA,MAAMA,IAAsB,gCACtBC,IAAiB,0BAEVC,IAAkB,gBAAAC,EAAA,CAACC,MACV,IAAI,gBAAgBA,EAAO,SAAS,MAAM,EAClC,IAAI,OAAO,MAAM,SAE1BH,IAAkBI,EAAA,KAA0BL,GAJlC,oBCJzBM,IAAwB,wDAGjBC,IAAsB,gBAAAJ,EAAA,MACxBG,GADwB,gCCF7BE,KAAmBC,KAAA,gBAAAA,EAAyB,eAAyB;AAOpE,SAASC,IAA2B;AACvC,QAAMC,IAAeH,IAAiB,8BAA8B;AAIpE,MAAI,OAAO,SAAW,QAAe,yBAAQ,WAAU;AACnD,UAAMI,IAAW,OAAO,SAAS,KAAK,YAAA;AAKtC,WAAIA,EAAS,QAAQ,iBAAiB,IAAI,KAC/B,qCAGPA,EAAS,QAAQ,WAAW,IAAI,KAEzBD,IAIJN,OAA0B;AAAA,EACrC;AAGA,SAAI,OAA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AA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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,EAAE;AAAA,EACjC,YAAYA,EAAc,MAAM,IAAI,EAAE;AAAA,EACtC,eAAeA,EAAc,MAAM,IAAI,EAAE;AAAA,EACzC,SAASA,EAAc,MAAM,IAAI,GAAG;AAAA,EACpC,QAAQA,EAAc,MAAM,KAAK,GAAG;AAAA,EACpC,QAAQA,EAAc,MAAM,KAAK,GAAG;AAAA,EACpC,MAAMA,EAAc,MAAM,KAAK,GAAG;AAAA,EAClC,UAAUA,EAAc,MAAM,KAAK,GAAG;AAAA,EACtC,QAAQA,EAAc,MAAM,KAAK,GAAG;AAAA,EACpC,QAAQA,EAAc,MAAM,GAAG;AACjC,GC3TaS,IAAmBC,EAAU,uBAAuB,GAGpDC,IAAkB;AAAA,EAC3B;AACJ;;AAEO,MAAMC,MAAiBC,IAAAH,EAAU,gBAAgB,MAA1B,gBAAAG,EAA6B,MAAM,SAAQ,CAAA,GAG5DC,IAAc;AAAA,EACvB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,gBAAgB,OAAU,KAAK;AAAA;AAAA,EAC/B,gBAAgBJ,EAAU,gBAAgB;AAC9C;"}
|
package/package.json
CHANGED
package/dist/Memory-DjLZqgbF.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
var l = Object.defineProperty;
|
|
2
|
-
var b = (n, e, r) => e in n ? l(n, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[e] = r;
|
|
3
|
-
var t = (n, e) => l(n, "name", { value: e, configurable: !0 });
|
|
4
|
-
var o = (n, e, r) => b(n, typeof e != "symbol" ? e + "" : e, r);
|
|
5
|
-
function p(n) {
|
|
6
|
-
const e = /* @__PURE__ */ new WeakSet();
|
|
7
|
-
return JSON.stringify(n, /* @__PURE__ */ t((s, i) => {
|
|
8
|
-
if (typeof i == "object" && i !== null) {
|
|
9
|
-
if (e.has(i))
|
|
10
|
-
return console.warn(`Got circular reference here, key: ${s}, value ${i.toString()}`, s, i), null;
|
|
11
|
-
e.add(i);
|
|
12
|
-
}
|
|
13
|
-
return i;
|
|
14
|
-
}, "replacerFunction"));
|
|
15
|
-
}
|
|
16
|
-
t(p, "safeStringify");
|
|
17
|
-
const a = class a {
|
|
18
|
-
// Helper function to truncate text for Firebase size constraints
|
|
19
|
-
static truncateText(e, r) {
|
|
20
|
-
return !e || e.length <= r ? e : e.substring(0, r) + " [... truncated due to size constraints]";
|
|
21
|
-
}
|
|
22
|
-
static truncateSessionForStorage(e) {
|
|
23
|
-
const r = { ...e };
|
|
24
|
-
return r.interactions = a.truncateInteractionsForStorage(e.interactions), r;
|
|
25
|
-
}
|
|
26
|
-
static truncateInteractionsForStorage(e) {
|
|
27
|
-
const r = JSON.parse(JSON.stringify(e));
|
|
28
|
-
return r.map((s) => {
|
|
29
|
-
s.functionMap = void 0, s.parts && s.parts.map((i) => {
|
|
30
|
-
if (i || console.error(e, r), i.functionDetails && i.functionDetails.args) {
|
|
31
|
-
for (const [f, u] of Object.entries(i.functionDetails.args))
|
|
32
|
-
typeof u == "string" ? i.functionDetails.args[f] = this.truncateText(u, 500) : i.functionDetails.args[f] = null;
|
|
33
|
-
i.functionDetails.response = this.truncateText(p(i.functionDetails.response), 500);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}), r;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
t(a, "ChatSessionUtils");
|
|
40
|
-
let g = a;
|
|
41
|
-
const c = class c {
|
|
42
|
-
constructor(e, r) {
|
|
43
|
-
o(this, "id");
|
|
44
|
-
o(this, "biName");
|
|
45
|
-
this.id = e, this.biName = r;
|
|
46
|
-
}
|
|
47
|
-
getBiName() {
|
|
48
|
-
return `BI_${this.biName}`;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
t(c, "Account");
|
|
52
|
-
let S = c;
|
|
53
|
-
const d = {
|
|
54
|
-
ExplorerAgent: "ExplorerAgent",
|
|
55
|
-
DashboardAgent: "DashboardAgent",
|
|
56
|
-
Unknown: "Unknown"
|
|
57
|
-
}, h = [
|
|
58
|
-
"Completed",
|
|
59
|
-
"Failed",
|
|
60
|
-
"Cancelled"
|
|
61
|
-
];
|
|
62
|
-
function N(n) {
|
|
63
|
-
return n ? h.includes(n) : !1;
|
|
64
|
-
}
|
|
65
|
-
t(N, "isSubAgentTerminalStatus");
|
|
66
|
-
var D = /* @__PURE__ */ ((n) => (n[n.Table = 0] = "Table", n[n.Metric = 1] = "Metric", n[n.Chart = 2] = "Chart", n[n.Dashboards = 3] = "Dashboards", n[n.Suggestions = 4] = "Suggestions", n[n.Memory = 5] = "Memory", n))(D || {});
|
|
67
|
-
const A = {
|
|
68
|
-
0: "Table",
|
|
69
|
-
1: "Metric",
|
|
70
|
-
2: "Chart",
|
|
71
|
-
3: "Dashboards",
|
|
72
|
-
4: "Suggestions",
|
|
73
|
-
5: "Memory"
|
|
74
|
-
};
|
|
75
|
-
export {
|
|
76
|
-
S as A,
|
|
77
|
-
g as C,
|
|
78
|
-
A as M,
|
|
79
|
-
h as S,
|
|
80
|
-
d as a,
|
|
81
|
-
D as b,
|
|
82
|
-
N as i
|
|
83
|
-
};
|
|
84
|
-
//# sourceMappingURL=Memory-DjLZqgbF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Memory-DjLZqgbF.js","sources":["../src/utils/jsonUtils.ts","../src/models/ChatSession.ts","../src/models/contexts.ts","../src/models/Agent.ts","../src/models/subAgentModel.ts","../src/models/Memory.ts"],"sourcesContent":["//const jsonString = JSON.stringify(obj: any, \n\nexport function safeStringify(obj: any) {\n const seen = new WeakSet();\n\n const replacerFunction = (key: string, value: any) => {\n if (typeof value === 'object' && value !== null) {\n if (seen.has(value)) {\n console.warn(`Got circular reference here, key: ${key}, value ${value.toString()}`, key, value)\n return null; // Omit circular reference\n }\n seen.add(value);\n }\n return value;\n };\n\n return JSON.stringify(obj, replacerFunction);\n}","import type { Interaction } from \"./Interaction\";\nimport type { AgentType, RunMode, SkillLevel } from \"./enums\";\nimport type { Customer } from \"./Customer\";\nimport type { User } from \"../models/contexts\";\nimport { type InteractionPart } from \"./InteractionPart\";\nimport { safeStringify } from '../utils/jsonUtils';\nimport _ from \"lodash\";\nimport { type IDBStorable } from \"./IDBStorable\";\n\nexport interface SharedUser {\n email: string;\n permission: 'view' | 'interact';\n}\n\nexport interface ChatSession extends IDBStorable {\n toolSessionId?: string,\n fullyLoaded: boolean; //Starts as false either when it is new, or when it is retrieved without the binding flag\n loadError?: string;\n artifacts: string[],\n browserScopeId: string; //To help with rendering. As for new session we don't have an ID, this is locally a Unique ID for an object.\n interactions: Interaction[];\n userDescription?: string;\n overview: string;\n lastQuestion?: string | null;\n agentType: AgentType;\n customer?: Customer | null;\n activityCount: number;\n interactionsCount?: number;\n allPartsCount?: number;\n user: User;\n lastGeneratedOverview?: Date | null;\n skillLevel?: SkillLevel;\n sessionRunMode: RunMode\n}\n\n// Note: ChatSession interface now extends IDBStorable\n// No need for a separate model class - just use the interface directly\n\nexport class ChatSessionUtils {\n\n // Helper function to truncate text for Firebase size constraints\n static truncateText(text: string, maxLength: number): string {\n if (!text)\n return text;\n\n if (text.length <= maxLength) {\n return text;\n }\n return text.substring(0, maxLength) + ' [... truncated due to size constraints]';\n }\n\n static truncateSessionForStorage(chatSession: ChatSession) {\n const newSession = { ...chatSession }\n newSession.interactions = ChatSessionUtils.truncateInteractionsForStorage(chatSession.interactions);\n\n return newSession;\n }\n\n static truncateInteractionsForStorage(originalInteractions: Interaction[]): Interaction[] {\n const interactions: Interaction[] = JSON.parse(JSON.stringify(originalInteractions));\n // Truncate interaction parts\n interactions.map((interaction: Interaction) => {\n interaction.functionMap = undefined;\n if (interaction.parts) {\n interaction.parts.map((truncatedPart: InteractionPart) => {\n // Truncate FunctionDetails properties\n if (!truncatedPart)\n console.error(originalInteractions, interactions);\n\n if (truncatedPart.functionDetails) {\n // Truncate args values to max 500 characters\n if (truncatedPart.functionDetails.args) {\n for (const [key, value] of Object.entries(truncatedPart.functionDetails.args)) {\n if (typeof value === 'string') {\n truncatedPart.functionDetails.args[key] = this.truncateText(value, 500);\n }\n else {\n truncatedPart.functionDetails.args[key] = null;\n }\n }\n\n truncatedPart.functionDetails.response = this.truncateText(safeStringify(truncatedPart.functionDetails.response), 500)\n }\n }\n });\n }\n });\n\n return interactions;\n\n }\n\n}","import type { Customer } from \"./Customer\";\nimport type { Agent } from \"./Agent\";\nimport { type IDBStorable } from \"./IDBStorable\";\n\nexport class Account {\n id: string;\n biName: string;\n\n constructor(id: string, biName: string) {\n this.id = id;\n this.biName = biName;\n }\n\n getBiName() {\n return `BI_${this.biName}`;\n }\n}\n\nexport interface User extends IDBStorable {\n email: string;\n family_name: string;\n given_name: string;\n name: string;\n hd: string;\n picture: string;\n access_token: string;\n previous_access_token?: string;\n refresh_token?: string;\n account?: Account;\n}\n\nexport interface AuthState {\n isAuthenticated: boolean;\n isLoading: boolean;\n login: (userData: User) => void;\n logout: () => void;\n errorMessage: string | null;\n}\n\nexport interface AgentContext {\n agentConfig: Partial<Agent>;\n customer?: Customer;\n model?: string;\n}\n","export type AgentKind = 'ExplorerAgent' | 'DashboardAgent' | 'Unknown';\nexport const AgentKind = {\n ExplorerAgent: 'ExplorerAgent' as AgentKind,\n DashboardAgent: 'DashboardAgent' as AgentKind,\n Unknown: 'Unknown' as AgentKind,\n} as const;\n\n/**\n * Agent model - represents an AI agent configuration\n * Mirrors the .NET Agent entity in Envision.SemanticKernel.Models.Agent\n */\nexport interface Agent {\n id: string;\n name: string;\n type?: AgentKind;\n defaultModelId?: string;\n defaultQuickModelId?: string;\n description?: string;\n muiIconName?: string;\n embeddingConfigurationId: string;\n agentImplementation?: string;\n agentBootStrapImplementation?: string;\n parameters?: Record<string, string>;\n plugins: string[];\n /** List of additional main instruction IDs (Category: Main or Generic) for this agent */\n mainInstructionIds?: string[];\n lastUpdated?: Date;\n created?: Date;\n}\n\n/**\n * Partial agent for listing purposes (only essential fields)\n */\nexport type AgentSummary = Pick<Agent, 'id' | 'name' | 'description' | 'muiIconName' | 'type'>;\n","import type { TodoList } from './todoListModel';\n\n/**\n * Mirrors `Envision.SemanticKernel.Core.SubAgent.SubAgentStatus` enum on the\n * server. Values come back as plain strings (the controller uses `Status.ToString()`).\n */\nexport type SubAgentStatus =\n | 'Pending'\n | 'Running'\n | 'Completed'\n | 'Failed'\n | 'Cancelled'\n | 'Unknown';\n\n/**\n * Lightweight representation of a chat message embedded in the SubAgentDto.\n * The server-side `Message` type carries more fields, but only the basics are\n * needed for status polling on the client.\n */\nexport interface SubAgentMessage {\n id?: string;\n role?: string;\n content?: string;\n [key: string]: unknown;\n}\n\n/**\n * TypeScript counterpart of `Envision.SemanticKernel.Core.SubAgent.SubAgentDto`.\n *\n * This is the payload returned by `GET /SubAgent/{sessionId}/{id}`.\n *\n * `TodoList.percentComplete` is serialized by the server as a fraction in the\n * range `[0, 1]` (i.e. `completedItems / totalItems`). It can be `NaN` when the\n * todo list is empty, so consumers should guard against non-finite values.\n */\nexport interface SubAgentDto {\n id?: string;\n subAgentId: string;\n name: string;\n sessionId?: string;\n dashboardId?: string | null;\n todoList?: TodoList | null;\n generalInstructions?: string | null;\n dashboardInstructions?: string | null;\n detailedStatus?: string | null;\n status: SubAgentStatus | string;\n error?: string | null;\n hasResult?: boolean | null;\n finalSummary?: string | null;\n parameters?: Record<string, string> | null;\n updatedAt?: string | Date | null;\n created?: string | Date | null;\n message?: SubAgentMessage | null;\n}\n\n/** Status values that indicate the sub-agent is no longer making progress. */\nexport const SUB_AGENT_TERMINAL_STATUSES: ReadonlyArray<SubAgentStatus> = [\n 'Completed',\n 'Failed',\n 'Cancelled',\n];\n\nexport function isSubAgentTerminalStatus(status: string | undefined | null): boolean {\n if (!status) return false;\n return (SUB_AGENT_TERMINAL_STATUSES as readonly string[]).includes(status);\n}\n","/**\n * Memory model - represents a semantic memory stored in MongoDB and Qdrant\n * Mirrors the .NET Memory entity in Envision.SemanticKernel.Core/Memory/Memory.cs\n */\n\n/**\n * Context types for memories - determines how they're filtered in semantic search\n */\nexport enum MemoryContexts {\n Table = 0, // Table schema information\n Metric = 1, // Business metrics and KPIs\n Chart = 2, // Chart/visualization descriptions\n Dashboards = 3, // Dashboard information\n Suggestions = 4, // Business recommendations\n Memory = 5 // General memories (no filter applied in search)\n}\n\n/**\n * Human-readable labels for each context type\n */\nexport const MemoryContextLabels: Record<MemoryContexts, string> = {\n [MemoryContexts.Table]: 'Table',\n [MemoryContexts.Metric]: 'Metric',\n [MemoryContexts.Chart]: 'Chart',\n [MemoryContexts.Dashboards]: 'Dashboards',\n [MemoryContexts.Suggestions]: 'Suggestions',\n [MemoryContexts.Memory]: 'Memory',\n};\n\n/**\n * Full Memory entity as stored in the database\n */\nexport interface SemanticMemory {\n id: string;\n memoryText: string;\n relatedTags?: string;\n created?: string;\n updatedAt?: string;\n // Runtime properties (populated by search results only)\n runtimeScore?: number;\n runtimeRank?: number;\n}\n\n/**\n * Input model for creating/updating memories\n * Does not include id, created, or runtime properties\n */\nexport interface SemanticMemoryInput {\n memoryText: string;\n relatedTags?: string;\n}\n\n/**\n * Options for semantic search\n */\nexport interface SemanticMemorySearchOptions {\n relatedTable?: string;\n relatedContext?: MemoryContexts;\n relatedTags?: string;\n limit?: number;\n}\n"],"names":["safeStringify","obj","seen","__name","key","value","_ChatSessionUtils","text","maxLength","chatSession","newSession","originalInteractions","interactions","interaction","truncatedPart","ChatSessionUtils","_Account","id","biName","__publicField","Account","AgentKind","SUB_AGENT_TERMINAL_STATUSES","isSubAgentTerminalStatus","status","MemoryContexts","MemoryContextLabels"],"mappings":";;;;AAEO,SAASA,EAAcC,GAAU;AACpC,QAAMC,wBAAW,QAAA;AAajB,SAAO,KAAK,UAAUD,GAXG,gBAAAE,EAAA,CAACC,GAAaC,MAAe;AAClD,QAAI,OAAOA,KAAU,YAAYA,MAAU,MAAM;AAC7C,UAAIH,EAAK,IAAIG,CAAK;AACd,uBAAQ,KAAK,qCAAqCD,CAAG,WAAWC,EAAM,SAAA,CAAU,IAAID,GAAKC,CAAK,GACv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