@shivnandan/connector-react 0.0.0-stage → 1.0.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/index.js ADDED
@@ -0,0 +1,491 @@
1
+ "use client";
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ TracePulseContext: () => TracePulseContext,
25
+ TracePulseProvider: () => TracePulseProvider,
26
+ default: () => TracePulseProvider_default,
27
+ useTracePulse: () => useTracePulse
28
+ });
29
+ module.exports = __toCommonJS(src_exports);
30
+
31
+ // src/TracePulseProvider.tsx
32
+ var import_react2 = require("react");
33
+
34
+ // src/TracePulseContext.tsx
35
+ var import_react = require("react");
36
+ var TracePulseContext = (0, import_react.createContext)(null);
37
+
38
+ // src/TracePulseProvider.tsx
39
+ var import_jsx_runtime = require("react/jsx-runtime");
40
+ function TracePulseProvider({
41
+ apiKey,
42
+ projectId = "default-project",
43
+ endpoint = "http://127.0.0.1:8000",
44
+ targetTransactionId,
45
+ position = "bottom-right",
46
+ theme = "light",
47
+ floatingButton = true,
48
+ children
49
+ }) {
50
+ const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
51
+ const [activeTransactionId, setActiveTransactionId] = (0, import_react2.useState)(
52
+ targetTransactionId || null
53
+ );
54
+ const [isLoading, setIsLoading] = (0, import_react2.useState)(false);
55
+ const [input, setInput] = (0, import_react2.useState)("");
56
+ const [messages, setMessages] = (0, import_react2.useState)([
57
+ {
58
+ id: "welcome",
59
+ sender: "copilot",
60
+ text: "\u{1F44B} Hi! I am **TracePulse AI Copilot**. Ask me anything about any transaction, why a payment failed, or mention a transaction ID to see deep-dive diagnostics.",
61
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
62
+ }
63
+ ]);
64
+ const messagesEndRef = (0, import_react2.useRef)(null);
65
+ (0, import_react2.useEffect)(() => {
66
+ if (targetTransactionId) {
67
+ setActiveTransactionId(targetTransactionId);
68
+ }
69
+ }, [targetTransactionId]);
70
+ (0, import_react2.useEffect)(() => {
71
+ if (isOpen) {
72
+ messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
73
+ }
74
+ }, [messages, isOpen]);
75
+ const openCopilot = (0, import_react2.useCallback)((transactionId) => {
76
+ if (transactionId) {
77
+ setActiveTransactionId(transactionId);
78
+ }
79
+ setIsOpen(true);
80
+ }, []);
81
+ const closeCopilot = (0, import_react2.useCallback)(() => {
82
+ setIsOpen(false);
83
+ }, []);
84
+ const toggleCopilot = (0, import_react2.useCallback)(() => {
85
+ setIsOpen((prev) => !prev);
86
+ }, []);
87
+ const sendMessage = (0, import_react2.useCallback)(
88
+ async (text, transactionId) => {
89
+ if (!text.trim() || isLoading) return "";
90
+ const effectiveTxnId = transactionId || (() => {
91
+ const match = text.match(/\b(?:45\d{13}|\d{10,20})\b/);
92
+ return match ? match[0] : activeTransactionId || void 0;
93
+ })();
94
+ const userMsg = {
95
+ id: `user-${Date.now()}`,
96
+ sender: "user",
97
+ text,
98
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
99
+ transactionId: effectiveTxnId
100
+ };
101
+ setMessages((prev) => [...prev, userMsg]);
102
+ setIsLoading(true);
103
+ try {
104
+ const cleanEndpoint = endpoint.replace(/\/+$/, "");
105
+ const res = await fetch(`${cleanEndpoint}/api/v1/widget/chat`, {
106
+ method: "POST",
107
+ headers: {
108
+ "Content-Type": "application/json",
109
+ "X-TracePulse-Key": apiKey,
110
+ "X-TracePulse-Project": projectId
111
+ },
112
+ body: JSON.stringify({
113
+ query: text,
114
+ transaction_id: effectiveTxnId,
115
+ app_context: projectId
116
+ })
117
+ });
118
+ if (!res.ok) {
119
+ throw new Error(`Server returned ${res.status}`);
120
+ }
121
+ const data = await res.json();
122
+ const reply = data.reply || data.answer || "No response received.";
123
+ const copilotMsg = {
124
+ id: `copilot-${Date.now()}`,
125
+ sender: "copilot",
126
+ text: reply,
127
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
128
+ transactionId: data.transactionId || effectiveTxnId
129
+ };
130
+ setMessages((prev) => [...prev, copilotMsg]);
131
+ return reply;
132
+ } catch (err) {
133
+ const errorMsg = {
134
+ id: `copilot-err-${Date.now()}`,
135
+ sender: "copilot",
136
+ text: `\u26A0\uFE0F **Failed to reach AI Copilot**: ${err.message || "Network error"}. Check backend connection at \`${endpoint}\`.`,
137
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
138
+ };
139
+ setMessages((prev) => [...prev, errorMsg]);
140
+ return errorMsg.text;
141
+ } finally {
142
+ setIsLoading(false);
143
+ }
144
+ },
145
+ [apiKey, projectId, endpoint, activeTransactionId, isLoading]
146
+ );
147
+ const contextValue = {
148
+ isOpen,
149
+ openCopilot,
150
+ closeCopilot,
151
+ toggleCopilot,
152
+ activeTransactionId,
153
+ setActiveTransactionId,
154
+ sendMessage,
155
+ messages,
156
+ isLoading,
157
+ endpoint,
158
+ apiKey
159
+ };
160
+ const quickPrompts = [
161
+ "Why did transaction 450000015526099 fail?",
162
+ "What happened in Loki logs for 450000015526099?",
163
+ "Check payment status for 450000015526099",
164
+ "Show Kafka consumer errors in Loki"
165
+ ];
166
+ const handleFormSubmit = (e) => {
167
+ e.preventDefault();
168
+ if (!input.trim()) return;
169
+ const text = input;
170
+ setInput("");
171
+ sendMessage(text);
172
+ };
173
+ const isRight = position === "bottom-right";
174
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TracePulseContext.Provider, { value: contextValue, children: [
175
+ children,
176
+ floatingButton && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
177
+ "div",
178
+ {
179
+ style: {
180
+ position: "fixed",
181
+ bottom: "24px",
182
+ right: isRight ? "24px" : "auto",
183
+ left: !isRight ? "24px" : "auto",
184
+ zIndex: 999999,
185
+ fontFamily: "system-ui, -apple-system, sans-serif"
186
+ },
187
+ children: [
188
+ !isOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
189
+ "button",
190
+ {
191
+ onClick: () => setIsOpen(true),
192
+ style: {
193
+ display: "flex",
194
+ alignItems: "center",
195
+ gap: "10px",
196
+ padding: "10px 18px",
197
+ borderRadius: "9999px",
198
+ backgroundColor: "#ffffff",
199
+ color: "#0f172a",
200
+ border: "1px solid #e2e8f0",
201
+ boxShadow: "0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)",
202
+ cursor: "pointer",
203
+ transition: "all 0.2s ease"
204
+ },
205
+ children: [
206
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
207
+ "div",
208
+ {
209
+ style: {
210
+ width: "32px",
211
+ height: "32px",
212
+ borderRadius: "50%",
213
+ background: "linear-gradient(135deg, #0284c7, #4f46e5)",
214
+ display: "flex",
215
+ alignItems: "center",
216
+ justifyContent: "center",
217
+ color: "#ffffff"
218
+ },
219
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
220
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 8V4H8" }),
221
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { width: "16", height: "12", x: "4", y: "8", rx: "2" }),
222
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2 14h2" }),
223
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M20 14h2" }),
224
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M15 13v2" }),
225
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 13v2" })
226
+ ] })
227
+ }
228
+ ),
229
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { textAlign: "left" }, children: [
230
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { display: "block", fontSize: "12px", fontWeight: "700", lineHeight: "1.2" }, children: "Ask AI Copilot" }),
231
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { display: "block", fontSize: "10px", color: "#64748b" }, children: "AI Diagnostics" })
232
+ ] }),
233
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
234
+ "span",
235
+ {
236
+ style: {
237
+ width: "8px",
238
+ height: "8px",
239
+ borderRadius: "50%",
240
+ backgroundColor: "#10b981",
241
+ marginLeft: "4px"
242
+ }
243
+ }
244
+ )
245
+ ]
246
+ }
247
+ ),
248
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
249
+ "div",
250
+ {
251
+ style: {
252
+ width: "min(420px, 92vw)",
253
+ height: "min(580px, 85vh)",
254
+ borderRadius: "16px",
255
+ backgroundColor: "#ffffff",
256
+ border: "1px solid #e2e8f0",
257
+ boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
258
+ display: "flex",
259
+ flexDirection: "column",
260
+ overflow: "hidden"
261
+ },
262
+ children: [
263
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
264
+ "div",
265
+ {
266
+ style: {
267
+ padding: "14px 16px",
268
+ backgroundColor: "#f8fafc",
269
+ borderBottom: "1px solid #e2e8f0",
270
+ display: "flex",
271
+ alignItems: "center",
272
+ justifyContent: "space-between"
273
+ },
274
+ children: [
275
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
276
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
277
+ "div",
278
+ {
279
+ style: {
280
+ width: "32px",
281
+ height: "32px",
282
+ borderRadius: "8px",
283
+ backgroundColor: "#e0f2fe",
284
+ border: "1px solid #bae6fd",
285
+ display: "flex",
286
+ alignItems: "center",
287
+ justifyContent: "center",
288
+ color: "#0369a1"
289
+ },
290
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
291
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { width: "16", height: "12", x: "4", y: "8", rx: "2" }),
292
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 8V4H8" })
293
+ ] })
294
+ }
295
+ ),
296
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
297
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
298
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { fontWeight: "700", fontSize: "13px", color: "#0f172a" }, children: "TracePulse Copilot" }),
299
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { fontSize: "9px", fontWeight: "700", textTransform: "uppercase", padding: "2px 6px", borderRadius: "4px", backgroundColor: "#e0f2fe", color: "#0369a1" }, children: "AI Active" })
300
+ ] }),
301
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { fontSize: "11px", color: "#64748b" }, children: "Autonomous Transaction Diagnosis" })
302
+ ] })
303
+ ] }),
304
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
305
+ "button",
306
+ {
307
+ onClick: () => setIsOpen(false),
308
+ style: {
309
+ padding: "6px",
310
+ borderRadius: "6px",
311
+ backgroundColor: "transparent",
312
+ border: "none",
313
+ color: "#94a3b8",
314
+ cursor: "pointer"
315
+ },
316
+ title: "Close",
317
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
318
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
319
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
320
+ ] })
321
+ }
322
+ )
323
+ ]
324
+ }
325
+ ),
326
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
327
+ "div",
328
+ {
329
+ style: {
330
+ flex: 1,
331
+ padding: "16px",
332
+ overflowY: "auto",
333
+ display: "flex",
334
+ flexDirection: "column",
335
+ gap: "12px",
336
+ backgroundColor: "#f8fafc"
337
+ },
338
+ children: [
339
+ messages.map((msg) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
340
+ "div",
341
+ {
342
+ style: {
343
+ display: "flex",
344
+ flexDirection: "column",
345
+ alignItems: msg.sender === "user" ? "flex-end" : "flex-start"
346
+ },
347
+ children: [
348
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
349
+ "div",
350
+ {
351
+ style: {
352
+ maxWidth: "85%",
353
+ borderRadius: "14px",
354
+ padding: "10px 14px",
355
+ fontSize: "12px",
356
+ lineHeight: "1.5",
357
+ backgroundColor: msg.sender === "user" ? "#0284c7" : "#ffffff",
358
+ color: msg.sender === "user" ? "#ffffff" : "#1e293b",
359
+ border: msg.sender === "user" ? "none" : "1px solid #e2e8f0",
360
+ boxShadow: "0 1px 2px rgba(0, 0, 0, 0.05)",
361
+ whiteSpace: "pre-wrap"
362
+ },
363
+ children: msg.text
364
+ }
365
+ ),
366
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { fontSize: "10px", color: "#94a3b8", marginTop: "4px", padding: "0 4px" }, children: new Date(msg.timestamp).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) })
367
+ ]
368
+ },
369
+ msg.id
370
+ )),
371
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px", color: "#64748b", fontSize: "12px", padding: "4px" }, children: [
372
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { display: "inline-block", width: "12px", height: "12px", border: "2px solid #0284c7", borderTopColor: "transparent", borderRadius: "50%", animation: "spin 1s linear infinite" } }),
373
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Analyzing transaction traces & logs..." })
374
+ ] }),
375
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: messagesEndRef })
376
+ ]
377
+ }
378
+ ),
379
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
380
+ "div",
381
+ {
382
+ style: {
383
+ padding: "6px 12px",
384
+ backgroundColor: "#ffffff",
385
+ borderTop: "1px solid #f1f5f9",
386
+ display: "flex",
387
+ gap: "6px",
388
+ overflowX: "auto",
389
+ whiteSpace: "nowrap"
390
+ },
391
+ children: quickPrompts.map((q, idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
392
+ "button",
393
+ {
394
+ onClick: () => sendMessage(q),
395
+ disabled: isLoading,
396
+ style: {
397
+ fontSize: "11px",
398
+ padding: "4px 10px",
399
+ borderRadius: "9999px",
400
+ backgroundColor: "#f1f5f9",
401
+ color: "#334155",
402
+ border: "1px solid #e2e8f0",
403
+ cursor: "pointer"
404
+ },
405
+ children: q
406
+ },
407
+ idx
408
+ ))
409
+ }
410
+ ),
411
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
412
+ "form",
413
+ {
414
+ onSubmit: handleFormSubmit,
415
+ style: {
416
+ padding: "12px",
417
+ backgroundColor: "#ffffff",
418
+ borderTop: "1px solid #e2e8f0",
419
+ display: "flex",
420
+ gap: "8px"
421
+ },
422
+ children: [
423
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
424
+ "input",
425
+ {
426
+ type: "text",
427
+ value: input,
428
+ onChange: (e) => setInput(e.target.value),
429
+ placeholder: "Ask about any transaction (e.g. Why did 450000015526099 fail?)...",
430
+ style: {
431
+ flex: 1,
432
+ backgroundColor: "#f8fafc",
433
+ border: "1px solid #cbd5e1",
434
+ borderRadius: "10px",
435
+ padding: "8px 12px",
436
+ fontSize: "12px",
437
+ color: "#0f172a",
438
+ outline: "none"
439
+ }
440
+ }
441
+ ),
442
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
443
+ "button",
444
+ {
445
+ type: "submit",
446
+ disabled: isLoading || !input.trim(),
447
+ style: {
448
+ padding: "8px 14px",
449
+ borderRadius: "10px",
450
+ backgroundColor: "#0284c7",
451
+ color: "#ffffff",
452
+ border: "none",
453
+ cursor: "pointer",
454
+ fontWeight: "600",
455
+ fontSize: "12px",
456
+ opacity: isLoading || !input.trim() ? 0.5 : 1
457
+ },
458
+ children: "Send"
459
+ }
460
+ )
461
+ ]
462
+ }
463
+ )
464
+ ]
465
+ }
466
+ )
467
+ ]
468
+ }
469
+ )
470
+ ] });
471
+ }
472
+ var TracePulseProvider_default = TracePulseProvider;
473
+
474
+ // src/useTracePulse.ts
475
+ var import_react3 = require("react");
476
+ function useTracePulse() {
477
+ const ctx = (0, import_react3.useContext)(TracePulseContext);
478
+ if (!ctx) {
479
+ throw new Error(
480
+ '[TracePulse] useTracePulse() must be used within a <TracePulseProvider />. Ensure your application root is wrapped with <TracePulseProvider apiKey="...">.'
481
+ );
482
+ }
483
+ return ctx;
484
+ }
485
+ // Annotate the CommonJS export names for ESM import in node:
486
+ 0 && (module.exports = {
487
+ TracePulseContext,
488
+ TracePulseProvider,
489
+ useTracePulse
490
+ });
491
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/TracePulseProvider.tsx","../src/TracePulseContext.tsx","../src/useTracePulse.ts"],"sourcesContent":["export { TracePulseProvider, default } from \"./TracePulseProvider\";\nexport { TracePulseContext } from \"./TracePulseContext\";\nexport { useTracePulse } from \"./useTracePulse\";\nexport type {\n TracePulseProviderProps,\n TracePulseContextValue,\n ChatMessage,\n} from \"./types\";\n","import React, { useState, useRef, useEffect, useCallback } from \"react\";\nimport { TracePulseContext } from \"./TracePulseContext\";\nimport { TracePulseProviderProps, ChatMessage, TracePulseContextValue } from \"./types\";\n\nexport function TracePulseProvider({\n apiKey,\n projectId = \"default-project\",\n endpoint = \"http://127.0.0.1:8000\",\n targetTransactionId,\n position = \"bottom-right\",\n theme = \"light\",\n floatingButton = true,\n children,\n}: TracePulseProviderProps) {\n const [isOpen, setIsOpen] = useState(false);\n const [activeTransactionId, setActiveTransactionId] = useState<string | null>(\n targetTransactionId || null\n );\n const [isLoading, setIsLoading] = useState(false);\n const [input, setInput] = useState(\"\");\n const [messages, setMessages] = useState<ChatMessage[]>([\n {\n id: \"welcome\",\n sender: \"copilot\",\n text: \"👋 Hi! I am **TracePulse AI Copilot**. Ask me anything about any transaction, why a payment failed, or mention a transaction ID to see deep-dive diagnostics.\",\n timestamp: new Date().toISOString(),\n },\n ]);\n\n const messagesEndRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (targetTransactionId) {\n setActiveTransactionId(targetTransactionId);\n }\n }, [targetTransactionId]);\n\n useEffect(() => {\n if (isOpen) {\n messagesEndRef.current?.scrollIntoView({ behavior: \"smooth\" });\n }\n }, [messages, isOpen]);\n\n const openCopilot = useCallback((transactionId?: string) => {\n if (transactionId) {\n setActiveTransactionId(transactionId);\n }\n setIsOpen(true);\n }, []);\n\n const closeCopilot = useCallback(() => {\n setIsOpen(false);\n }, []);\n\n const toggleCopilot = useCallback(() => {\n setIsOpen((prev) => !prev);\n }, []);\n\n const sendMessage = useCallback(\n async (text: string, transactionId?: string): Promise<string> => {\n if (!text.trim() || isLoading) return \"\";\n\n const effectiveTxnId =\n transactionId ||\n (() => {\n const match = text.match(/\\b(?:45\\d{13}|\\d{10,20})\\b/);\n return match ? match[0] : activeTransactionId || undefined;\n })();\n\n const userMsg: ChatMessage = {\n id: `user-${Date.now()}`,\n sender: \"user\",\n text,\n timestamp: new Date().toISOString(),\n transactionId: effectiveTxnId,\n };\n\n setMessages((prev) => [...prev, userMsg]);\n setIsLoading(true);\n\n try {\n const cleanEndpoint = endpoint.replace(/\\/+$/, \"\");\n const res = await fetch(`${cleanEndpoint}/api/v1/widget/chat`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-TracePulse-Key\": apiKey,\n \"X-TracePulse-Project\": projectId,\n },\n body: JSON.stringify({\n query: text,\n transaction_id: effectiveTxnId,\n app_context: projectId,\n }),\n });\n\n if (!res.ok) {\n throw new Error(`Server returned ${res.status}`);\n }\n\n const data = await res.json();\n const reply = data.reply || data.answer || \"No response received.\";\n\n const copilotMsg: ChatMessage = {\n id: `copilot-${Date.now()}`,\n sender: \"copilot\",\n text: reply,\n timestamp: new Date().toISOString(),\n transactionId: data.transactionId || effectiveTxnId,\n };\n\n setMessages((prev) => [...prev, copilotMsg]);\n return reply;\n } catch (err: any) {\n const errorMsg: ChatMessage = {\n id: `copilot-err-${Date.now()}`,\n sender: \"copilot\",\n text: `⚠️ **Failed to reach AI Copilot**: ${err.message || \"Network error\"}. Check backend connection at \\`${endpoint}\\`.`,\n timestamp: new Date().toISOString(),\n };\n setMessages((prev) => [...prev, errorMsg]);\n return errorMsg.text;\n } finally {\n setIsLoading(false);\n }\n },\n [apiKey, projectId, endpoint, activeTransactionId, isLoading]\n );\n\n const contextValue: TracePulseContextValue = {\n isOpen,\n openCopilot,\n closeCopilot,\n toggleCopilot,\n activeTransactionId,\n setActiveTransactionId,\n sendMessage,\n messages,\n isLoading,\n endpoint,\n apiKey,\n };\n\n const quickPrompts = [\n \"Why did transaction 450000015526099 fail?\",\n \"What happened in Loki logs for 450000015526099?\",\n \"Check payment status for 450000015526099\",\n \"Show Kafka consumer errors in Loki\",\n ];\n\n const handleFormSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n if (!input.trim()) return;\n const text = input;\n setInput(\"\");\n sendMessage(text);\n };\n\n const isRight = position === \"bottom-right\";\n\n return (\n <TracePulseContext.Provider value={contextValue}>\n {children}\n\n {/* Floating Action Button & Modal (Self-Contained Light UI) */}\n {floatingButton && (\n <div\n style={{\n position: \"fixed\",\n bottom: \"24px\",\n right: isRight ? \"24px\" : \"auto\",\n left: !isRight ? \"24px\" : \"auto\",\n zIndex: 999999,\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n }}\n >\n {/* Floating Launcher Button */}\n {!isOpen && (\n <button\n onClick={() => setIsOpen(true)}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"10px\",\n padding: \"10px 18px\",\n borderRadius: \"9999px\",\n backgroundColor: \"#ffffff\",\n color: \"#0f172a\",\n border: \"1px solid #e2e8f0\",\n boxShadow: \"0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)\",\n cursor: \"pointer\",\n transition: \"all 0.2s ease\",\n }}\n >\n <div\n style={{\n width: \"32px\",\n height: \"32px\",\n borderRadius: \"50%\",\n background: \"linear-gradient(135deg, #0284c7, #4f46e5)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"#ffffff\",\n }}\n >\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M12 8V4H8\"></path>\n <rect width=\"16\" height=\"12\" x=\"4\" y=\"8\" rx=\"2\"></rect>\n <path d=\"M2 14h2\"></path>\n <path d=\"M20 14h2\"></path>\n <path d=\"M15 13v2\"></path>\n <path d=\"M9 13v2\"></path>\n </svg>\n </div>\n <div style={{ textAlign: \"left\" }}>\n <span style={{ display: \"block\", fontSize: \"12px\", fontWeight: \"700\", lineHeight: \"1.2\" }}>Ask AI Copilot</span>\n <span style={{ display: \"block\", fontSize: \"10px\", color: \"#64748b\" }}>AI Diagnostics</span>\n </div>\n <span\n style={{\n width: \"8px\",\n height: \"8px\",\n borderRadius: \"50%\",\n backgroundColor: \"#10b981\",\n marginLeft: \"4px\",\n }}\n />\n </button>\n )}\n\n {/* Floating Drawer Modal */}\n {isOpen && (\n <div\n style={{\n width: \"min(420px, 92vw)\",\n height: \"min(580px, 85vh)\",\n borderRadius: \"16px\",\n backgroundColor: \"#ffffff\",\n border: \"1px solid #e2e8f0\",\n boxShadow: \"0 25px 50px -12px rgba(0, 0, 0, 0.25)\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n }}\n >\n {/* Header */}\n <div\n style={{\n padding: \"14px 16px\",\n backgroundColor: \"#f8fafc\",\n borderBottom: \"1px solid #e2e8f0\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: \"10px\" }}>\n <div\n style={{\n width: \"32px\",\n height: \"32px\",\n borderRadius: \"8px\",\n backgroundColor: \"#e0f2fe\",\n border: \"1px solid #bae6fd\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"#0369a1\",\n }}\n >\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect width=\"16\" height=\"12\" x=\"4\" y=\"8\" rx=\"2\"></rect>\n <path d=\"M12 8V4H8\"></path>\n </svg>\n </div>\n <div>\n <div style={{ display: \"flex\", alignItems: \"center\", gap: \"6px\" }}>\n <span style={{ fontWeight: \"700\", fontSize: \"13px\", color: \"#0f172a\" }}>TracePulse Copilot</span>\n <span style={{ fontSize: \"9px\", fontWeight: \"700\", textTransform: \"uppercase\", padding: \"2px 6px\", borderRadius: \"4px\", backgroundColor: \"#e0f2fe\", color: \"#0369a1\" }}>AI Active</span>\n </div>\n <span style={{ fontSize: \"11px\", color: \"#64748b\" }}>Autonomous Transaction Diagnosis</span>\n </div>\n </div>\n\n <button\n onClick={() => setIsOpen(false)}\n style={{\n padding: \"6px\",\n borderRadius: \"6px\",\n backgroundColor: \"transparent\",\n border: \"none\",\n color: \"#94a3b8\",\n cursor: \"pointer\",\n }}\n title=\"Close\"\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n </div>\n\n {/* Messages Body */}\n <div\n style={{\n flex: 1,\n padding: \"16px\",\n overflowY: \"auto\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"12px\",\n backgroundColor: \"#f8fafc\",\n }}\n >\n {messages.map((msg) => (\n <div\n key={msg.id}\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: msg.sender === \"user\" ? \"flex-end\" : \"flex-start\",\n }}\n >\n <div\n style={{\n maxWidth: \"85%\",\n borderRadius: \"14px\",\n padding: \"10px 14px\",\n fontSize: \"12px\",\n lineHeight: \"1.5\",\n backgroundColor: msg.sender === \"user\" ? \"#0284c7\" : \"#ffffff\",\n color: msg.sender === \"user\" ? \"#ffffff\" : \"#1e293b\",\n border: msg.sender === \"user\" ? \"none\" : \"1px solid #e2e8f0\",\n boxShadow: \"0 1px 2px rgba(0, 0, 0, 0.05)\",\n whiteSpace: \"pre-wrap\",\n }}\n >\n {msg.text}\n </div>\n <span style={{ fontSize: \"10px\", color: \"#94a3b8\", marginTop: \"4px\", padding: \"0 4px\" }}>\n {new Date(msg.timestamp).toLocaleTimeString([], { hour: \"2-digit\", minute: \"2-digit\" })}\n </span>\n </div>\n ))}\n\n {isLoading && (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: \"8px\", color: \"#64748b\", fontSize: \"12px\", padding: \"4px\" }}>\n <span style={{ display: \"inline-block\", width: \"12px\", height: \"12px\", border: \"2px solid #0284c7\", borderTopColor: \"transparent\", borderRadius: \"50%\", animation: \"spin 1s linear infinite\" }}></span>\n <span>Analyzing transaction traces & logs...</span>\n </div>\n )}\n <div ref={messagesEndRef} />\n </div>\n\n {/* Quick Prompts */}\n <div\n style={{\n padding: \"6px 12px\",\n backgroundColor: \"#ffffff\",\n borderTop: \"1px solid #f1f5f9\",\n display: \"flex\",\n gap: \"6px\",\n overflowX: \"auto\",\n whiteSpace: \"nowrap\",\n }}\n >\n {quickPrompts.map((q, idx) => (\n <button\n key={idx}\n onClick={() => sendMessage(q)}\n disabled={isLoading}\n style={{\n fontSize: \"11px\",\n padding: \"4px 10px\",\n borderRadius: \"9999px\",\n backgroundColor: \"#f1f5f9\",\n color: \"#334155\",\n border: \"1px solid #e2e8f0\",\n cursor: \"pointer\",\n }}\n >\n {q}\n </button>\n ))}\n </div>\n\n {/* Chat Input */}\n <form\n onSubmit={handleFormSubmit}\n style={{\n padding: \"12px\",\n backgroundColor: \"#ffffff\",\n borderTop: \"1px solid #e2e8f0\",\n display: \"flex\",\n gap: \"8px\",\n }}\n >\n <input\n type=\"text\"\n value={input}\n onChange={(e) => setInput(e.target.value)}\n placeholder=\"Ask about any transaction (e.g. Why did 450000015526099 fail?)...\"\n style={{\n flex: 1,\n backgroundColor: \"#f8fafc\",\n border: \"1px solid #cbd5e1\",\n borderRadius: \"10px\",\n padding: \"8px 12px\",\n fontSize: \"12px\",\n color: \"#0f172a\",\n outline: \"none\",\n }}\n />\n <button\n type=\"submit\"\n disabled={isLoading || !input.trim()}\n style={{\n padding: \"8px 14px\",\n borderRadius: \"10px\",\n backgroundColor: \"#0284c7\",\n color: \"#ffffff\",\n border: \"none\",\n cursor: \"pointer\",\n fontWeight: \"600\",\n fontSize: \"12px\",\n opacity: isLoading || !input.trim() ? 0.5 : 1,\n }}\n >\n Send\n </button>\n </form>\n </div>\n )}\n </div>\n )}\n </TracePulseContext.Provider>\n );\n}\n\nexport default TracePulseProvider;\n","import React, { createContext } from \"react\";\nimport { TracePulseContextValue } from \"./types\";\n\nexport const TracePulseContext = createContext<TracePulseContextValue | null>(null);\n","import { useContext } from \"react\";\nimport { TracePulseContext } from \"./TracePulseContext\";\nimport { TracePulseContextValue } from \"./types\";\n\n/**\n * React hook to access TracePulse AI Copilot controls from any child component.\n *\n * Example:\n * ```tsx\n * import { useTracePulse } from \"@tracepulse/connector-react\";\n *\n * function OrderCard({ leadId }) {\n * const { openCopilot } = useTracePulse();\n * return <button onClick={() => openCopilot(leadId)}>Investigate with AI</button>;\n * }\n * ```\n */\nexport function useTracePulse(): TracePulseContextValue {\n const ctx = useContext(TracePulseContext);\n if (!ctx) {\n throw new Error(\n \"[TracePulse] useTracePulse() must be used within a <TracePulseProvider />. Ensure your application root is wrapped with <TracePulseProvider apiKey=\\\"...\\\">.\"\n );\n }\n return ctx;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAgE;;;ACAhE,mBAAqC;AAG9B,IAAM,wBAAoB,4BAA6C,IAAI;;;AD2MlE;AA1MT,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA,YAAY;AAAA,EACZ,WAAW;AAAA,EACX;AAAA,EACA,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB;AACF,GAA4B;AAC1B,QAAM,CAAC,QAAQ,SAAS,QAAI,wBAAS,KAAK;AAC1C,QAAM,CAAC,qBAAqB,sBAAsB,QAAI;AAAA,IACpD,uBAAuB;AAAA,EACzB;AACA,QAAM,CAAC,WAAW,YAAY,Q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