@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/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.40" : "dev";
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
@@ -31,7 +31,7 @@ import {
31
31
  cn,
32
32
  createKiteChat,
33
33
  useGuideCursor
34
- } from "./chunk-XMA5S556.js";
34
+ } from "./chunk-XZM4VX5Y.js";
35
35
  export {
36
36
  ApiKeyList,
37
37
  AssistantActivity,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kite-copilot/chat-panel",
3
- "version": "0.2.40",
3
+ "version": "0.2.43",
4
4
  "description": "AI-powered chat panel SDK with programmatic lifecycle control",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -45,7 +45,8 @@
45
45
  "dev": "tsup --watch",
46
46
  "clean": "rm -rf dist",
47
47
  "typecheck": "tsc --noEmit",
48
- "prepublishOnly": "npm run build"
48
+ "prepublishOnly": "npm run build",
49
+ "release": "./scripts/publish.sh"
49
50
  },
50
51
  "peerDependencies": {
51
52
  "react": ">=18.0.0",