@kite-copilot/chat-panel 0.2.42 → 0.2.43
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/auto.cjs +25 -1
- package/dist/auto.js +1 -1
- package/dist/{chunk-XP6Y7EP7.js → chunk-XZM4VX5Y.js} +25 -1
- package/dist/embed.global.js +5 -5
- package/dist/index.cjs +25 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -380,9 +380,13 @@ function useUserAuth({
|
|
|
380
380
|
const lastSessionIdRef = React4.useRef(null);
|
|
381
381
|
const fetchUser = React4.useCallback(async () => {
|
|
382
382
|
if (!productBackendUrl || !enabled) {
|
|
383
|
+
console.log("[useUserAuth] Skipping auth - productBackendUrl:", productBackendUrl, "enabled:", enabled);
|
|
383
384
|
setAuthState({ status: "idle" });
|
|
384
385
|
return;
|
|
385
386
|
}
|
|
387
|
+
console.log("[useUserAuth] Starting auth request to product backend...");
|
|
388
|
+
console.log("[useUserAuth] Product backend URL:", productBackendUrl);
|
|
389
|
+
console.log("[useUserAuth] Full request URL:", `${productBackendUrl}/users/me`);
|
|
386
390
|
setAuthState({ status: "loading" });
|
|
387
391
|
try {
|
|
388
392
|
const response = await fetch(`${productBackendUrl}/users/me`, {
|
|
@@ -393,7 +397,9 @@ function useUserAuth({
|
|
|
393
397
|
"Accept": "application/json"
|
|
394
398
|
}
|
|
395
399
|
});
|
|
400
|
+
console.log("[useUserAuth] Response received - status:", response.status, "ok:", response.ok);
|
|
396
401
|
if (!response.ok) {
|
|
402
|
+
console.log("[useUserAuth] Auth request failed with status:", response.status);
|
|
397
403
|
if (response.status === 401) {
|
|
398
404
|
throw new Error("Please log in to use the chat assistant.");
|
|
399
405
|
}
|
|
@@ -403,8 +409,17 @@ function useUserAuth({
|
|
|
403
409
|
throw new Error(`Authentication failed (${response.status})`);
|
|
404
410
|
}
|
|
405
411
|
const user = await response.json();
|
|
412
|
+
console.log("[useUserAuth] Auth SUCCESS - parsed user data:");
|
|
413
|
+
console.log("[useUserAuth] id:", user.id);
|
|
414
|
+
console.log("[useUserAuth] email:", user.email);
|
|
415
|
+
console.log("[useUserAuth] name:", user.name);
|
|
416
|
+
console.log("[useUserAuth] role:", user.role);
|
|
417
|
+
console.log("[useUserAuth] isInternal:", user.isInternal);
|
|
418
|
+
console.log("[useUserAuth] agreementsSigned:", user.agreementsSigned);
|
|
419
|
+
console.log("[useUserAuth] lastLoginTime:", user.lastLoginTime);
|
|
406
420
|
setAuthState({ status: "authenticated", user });
|
|
407
421
|
} catch (error) {
|
|
422
|
+
console.log("[useUserAuth] Auth ERROR:", error);
|
|
408
423
|
const message = error instanceof Error ? error.message : "Unable to verify your identity. Please try again.";
|
|
409
424
|
setAuthState({ status: "error", error: message });
|
|
410
425
|
}
|
|
@@ -1021,7 +1036,7 @@ function TypingIndicator({ className = "" }) {
|
|
|
1021
1036
|
|
|
1022
1037
|
// src/ChatPanel.tsx
|
|
1023
1038
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1024
|
-
var CHAT_PANEL_VERSION = true ? "0.2.
|
|
1039
|
+
var CHAT_PANEL_VERSION = true ? "0.2.43" : "dev";
|
|
1025
1040
|
var DEFAULT_AGENT_URL = "http://localhost:5002";
|
|
1026
1041
|
var PANEL_WIDTH = 340;
|
|
1027
1042
|
function unescapeJsonString(str) {
|
|
@@ -2235,6 +2250,15 @@ function ChatPanel({
|
|
|
2235
2250
|
try {
|
|
2236
2251
|
const controller = new AbortController();
|
|
2237
2252
|
const timeoutId = setTimeout(() => controller.abort(), 6e4);
|
|
2253
|
+
console.log("[ChatPanel] Sending chat request to agent backend...");
|
|
2254
|
+
console.log("[ChatPanel] Agent URL:", agentUrl);
|
|
2255
|
+
console.log("[ChatPanel] User data being sent:");
|
|
2256
|
+
console.log("[ChatPanel] user_id:", effectiveUser.userId);
|
|
2257
|
+
console.log("[ChatPanel] user_name:", effectiveUser.userName);
|
|
2258
|
+
console.log("[ChatPanel] user_email:", effectiveUser.userEmail);
|
|
2259
|
+
console.log("[ChatPanel] user_organization:", userOrganization);
|
|
2260
|
+
console.log("[ChatPanel] org_id:", orgId);
|
|
2261
|
+
console.log("[ChatPanel] authState.status:", authState.status);
|
|
2238
2262
|
const response = await fetch(`${agentUrl}/chat/stream`, {
|
|
2239
2263
|
method: "POST",
|
|
2240
2264
|
headers: {
|
package/dist/index.js
CHANGED