@kite-copilot/chat-panel 0.2.40 → 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-XMA5S556.js → chunk-XZM4VX5Y.js} +25 -1
- package/dist/embed.global.js +27 -33
- package/dist/index.cjs +25 -1
- package/dist/index.js +1 -1
- package/package.json +3 -2
package/dist/auto.cjs
CHANGED
|
@@ -349,9 +349,13 @@ function useUserAuth({
|
|
|
349
349
|
const lastSessionIdRef = React4.useRef(null);
|
|
350
350
|
const fetchUser = React4.useCallback(async () => {
|
|
351
351
|
if (!productBackendUrl || !enabled) {
|
|
352
|
+
console.log("[useUserAuth] Skipping auth - productBackendUrl:", productBackendUrl, "enabled:", enabled);
|
|
352
353
|
setAuthState({ status: "idle" });
|
|
353
354
|
return;
|
|
354
355
|
}
|
|
356
|
+
console.log("[useUserAuth] Starting auth request to product backend...");
|
|
357
|
+
console.log("[useUserAuth] Product backend URL:", productBackendUrl);
|
|
358
|
+
console.log("[useUserAuth] Full request URL:", `${productBackendUrl}/users/me`);
|
|
355
359
|
setAuthState({ status: "loading" });
|
|
356
360
|
try {
|
|
357
361
|
const response = await fetch(`${productBackendUrl}/users/me`, {
|
|
@@ -362,7 +366,9 @@ function useUserAuth({
|
|
|
362
366
|
"Accept": "application/json"
|
|
363
367
|
}
|
|
364
368
|
});
|
|
369
|
+
console.log("[useUserAuth] Response received - status:", response.status, "ok:", response.ok);
|
|
365
370
|
if (!response.ok) {
|
|
371
|
+
console.log("[useUserAuth] Auth request failed with status:", response.status);
|
|
366
372
|
if (response.status === 401) {
|
|
367
373
|
throw new Error("Please log in to use the chat assistant.");
|
|
368
374
|
}
|
|
@@ -372,8 +378,17 @@ function useUserAuth({
|
|
|
372
378
|
throw new Error(`Authentication failed (${response.status})`);
|
|
373
379
|
}
|
|
374
380
|
const user = await response.json();
|
|
381
|
+
console.log("[useUserAuth] Auth SUCCESS - parsed user data:");
|
|
382
|
+
console.log("[useUserAuth] id:", user.id);
|
|
383
|
+
console.log("[useUserAuth] email:", user.email);
|
|
384
|
+
console.log("[useUserAuth] name:", user.name);
|
|
385
|
+
console.log("[useUserAuth] role:", user.role);
|
|
386
|
+
console.log("[useUserAuth] isInternal:", user.isInternal);
|
|
387
|
+
console.log("[useUserAuth] agreementsSigned:", user.agreementsSigned);
|
|
388
|
+
console.log("[useUserAuth] lastLoginTime:", user.lastLoginTime);
|
|
375
389
|
setAuthState({ status: "authenticated", user });
|
|
376
390
|
} catch (error) {
|
|
391
|
+
console.log("[useUserAuth] Auth ERROR:", error);
|
|
377
392
|
const message = error instanceof Error ? error.message : "Unable to verify your identity. Please try again.";
|
|
378
393
|
setAuthState({ status: "error", error: message });
|
|
379
394
|
}
|
|
@@ -967,7 +982,7 @@ function TypingIndicator({ className = "" }) {
|
|
|
967
982
|
|
|
968
983
|
// src/ChatPanel.tsx
|
|
969
984
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
970
|
-
var CHAT_PANEL_VERSION = true ? "0.2.
|
|
985
|
+
var CHAT_PANEL_VERSION = true ? "0.2.43" : "dev";
|
|
971
986
|
var DEFAULT_AGENT_URL = "http://localhost:5002";
|
|
972
987
|
var PANEL_WIDTH = 340;
|
|
973
988
|
function unescapeJsonString(str) {
|
|
@@ -2181,6 +2196,15 @@ function ChatPanel({
|
|
|
2181
2196
|
try {
|
|
2182
2197
|
const controller = new AbortController();
|
|
2183
2198
|
const timeoutId = setTimeout(() => controller.abort(), 6e4);
|
|
2199
|
+
console.log("[ChatPanel] Sending chat request to agent backend...");
|
|
2200
|
+
console.log("[ChatPanel] Agent URL:", agentUrl);
|
|
2201
|
+
console.log("[ChatPanel] User data being sent:");
|
|
2202
|
+
console.log("[ChatPanel] user_id:", effectiveUser.userId);
|
|
2203
|
+
console.log("[ChatPanel] user_name:", effectiveUser.userName);
|
|
2204
|
+
console.log("[ChatPanel] user_email:", effectiveUser.userEmail);
|
|
2205
|
+
console.log("[ChatPanel] user_organization:", userOrganization);
|
|
2206
|
+
console.log("[ChatPanel] org_id:", orgId);
|
|
2207
|
+
console.log("[ChatPanel] authState.status:", authState.status);
|
|
2184
2208
|
const response = await fetch(`${agentUrl}/chat/stream`, {
|
|
2185
2209
|
method: "POST",
|
|
2186
2210
|
headers: {
|
package/dist/auto.js
CHANGED
|
@@ -897,9 +897,13 @@ function useUserAuth({
|
|
|
897
897
|
const lastSessionIdRef = React4.useRef(null);
|
|
898
898
|
const fetchUser = React4.useCallback(async () => {
|
|
899
899
|
if (!productBackendUrl || !enabled) {
|
|
900
|
+
console.log("[useUserAuth] Skipping auth - productBackendUrl:", productBackendUrl, "enabled:", enabled);
|
|
900
901
|
setAuthState({ status: "idle" });
|
|
901
902
|
return;
|
|
902
903
|
}
|
|
904
|
+
console.log("[useUserAuth] Starting auth request to product backend...");
|
|
905
|
+
console.log("[useUserAuth] Product backend URL:", productBackendUrl);
|
|
906
|
+
console.log("[useUserAuth] Full request URL:", `${productBackendUrl}/users/me`);
|
|
903
907
|
setAuthState({ status: "loading" });
|
|
904
908
|
try {
|
|
905
909
|
const response = await fetch(`${productBackendUrl}/users/me`, {
|
|
@@ -910,7 +914,9 @@ function useUserAuth({
|
|
|
910
914
|
"Accept": "application/json"
|
|
911
915
|
}
|
|
912
916
|
});
|
|
917
|
+
console.log("[useUserAuth] Response received - status:", response.status, "ok:", response.ok);
|
|
913
918
|
if (!response.ok) {
|
|
919
|
+
console.log("[useUserAuth] Auth request failed with status:", response.status);
|
|
914
920
|
if (response.status === 401) {
|
|
915
921
|
throw new Error("Please log in to use the chat assistant.");
|
|
916
922
|
}
|
|
@@ -920,8 +926,17 @@ function useUserAuth({
|
|
|
920
926
|
throw new Error(`Authentication failed (${response.status})`);
|
|
921
927
|
}
|
|
922
928
|
const user = await response.json();
|
|
929
|
+
console.log("[useUserAuth] Auth SUCCESS - parsed user data:");
|
|
930
|
+
console.log("[useUserAuth] id:", user.id);
|
|
931
|
+
console.log("[useUserAuth] email:", user.email);
|
|
932
|
+
console.log("[useUserAuth] name:", user.name);
|
|
933
|
+
console.log("[useUserAuth] role:", user.role);
|
|
934
|
+
console.log("[useUserAuth] isInternal:", user.isInternal);
|
|
935
|
+
console.log("[useUserAuth] agreementsSigned:", user.agreementsSigned);
|
|
936
|
+
console.log("[useUserAuth] lastLoginTime:", user.lastLoginTime);
|
|
923
937
|
setAuthState({ status: "authenticated", user });
|
|
924
938
|
} catch (error) {
|
|
939
|
+
console.log("[useUserAuth] Auth ERROR:", error);
|
|
925
940
|
const message = error instanceof Error ? error.message : "Unable to verify your identity. Please try again.";
|
|
926
941
|
setAuthState({ status: "error", error: message });
|
|
927
942
|
}
|
|
@@ -968,7 +983,7 @@ function TypingIndicator({ className = "" }) {
|
|
|
968
983
|
|
|
969
984
|
// src/ChatPanel.tsx
|
|
970
985
|
import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
971
|
-
var CHAT_PANEL_VERSION = true ? "0.2.
|
|
986
|
+
var CHAT_PANEL_VERSION = true ? "0.2.43" : "dev";
|
|
972
987
|
var DEFAULT_AGENT_URL = "http://localhost:5002";
|
|
973
988
|
var PANEL_WIDTH = 340;
|
|
974
989
|
function unescapeJsonString(str) {
|
|
@@ -2182,6 +2197,15 @@ function ChatPanel({
|
|
|
2182
2197
|
try {
|
|
2183
2198
|
const controller = new AbortController();
|
|
2184
2199
|
const timeoutId = setTimeout(() => controller.abort(), 6e4);
|
|
2200
|
+
console.log("[ChatPanel] Sending chat request to agent backend...");
|
|
2201
|
+
console.log("[ChatPanel] Agent URL:", agentUrl);
|
|
2202
|
+
console.log("[ChatPanel] User data being sent:");
|
|
2203
|
+
console.log("[ChatPanel] user_id:", effectiveUser.userId);
|
|
2204
|
+
console.log("[ChatPanel] user_name:", effectiveUser.userName);
|
|
2205
|
+
console.log("[ChatPanel] user_email:", effectiveUser.userEmail);
|
|
2206
|
+
console.log("[ChatPanel] user_organization:", userOrganization);
|
|
2207
|
+
console.log("[ChatPanel] org_id:", orgId);
|
|
2208
|
+
console.log("[ChatPanel] authState.status:", authState.status);
|
|
2185
2209
|
const response = await fetch(`${agentUrl}/chat/stream`, {
|
|
2186
2210
|
method: "POST",
|
|
2187
2211
|
headers: {
|