@djangocfg/ext-knowbase 1.0.20 → 1.0.22

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/config.cjs CHANGED
@@ -27,7 +27,7 @@ var import_ext_base = require("@djangocfg/ext-base");
27
27
  // package.json
28
28
  var package_default = {
29
29
  name: "@djangocfg/ext-knowbase",
30
- version: "1.0.20",
30
+ version: "1.0.22",
31
31
  description: "Knowledge base and chat extension for DjangoCFG",
32
32
  keywords: [
33
33
  "django",
@@ -73,6 +73,11 @@ var package_default = {
73
73
  types: "./dist/config.d.ts",
74
74
  import: "./dist/config.js",
75
75
  require: "./dist/config.cjs"
76
+ },
77
+ "./i18n": {
78
+ types: "./dist/i18n.d.ts",
79
+ import: "./dist/i18n.js",
80
+ require: "./dist/i18n.cjs"
76
81
  }
77
82
  },
78
83
  files: [
@@ -88,6 +93,7 @@ var package_default = {
88
93
  peerDependencies: {
89
94
  "@djangocfg/api": "workspace:*",
90
95
  "@djangocfg/ext-base": "workspace:*",
96
+ "@djangocfg/i18n": "workspace:*",
91
97
  "@djangocfg/ui-core": "workspace:*",
92
98
  "@djangocfg/ui-nextjs": "workspace:*",
93
99
  consola: "^3.4.2",
@@ -104,6 +110,7 @@ var package_default = {
104
110
  devDependencies: {
105
111
  "@djangocfg/api": "workspace:*",
106
112
  "@djangocfg/ext-base": "workspace:*",
113
+ "@djangocfg/i18n": "workspace:*",
107
114
  "@djangocfg/ui-core": "workspace:*",
108
115
  "@djangocfg/typescript-config": "workspace:*",
109
116
  "@types/node": "^24.7.2",
package/dist/config.js CHANGED
@@ -4,7 +4,7 @@ import { createExtensionConfig } from "@djangocfg/ext-base";
4
4
  // package.json
5
5
  var package_default = {
6
6
  name: "@djangocfg/ext-knowbase",
7
- version: "1.0.20",
7
+ version: "1.0.22",
8
8
  description: "Knowledge base and chat extension for DjangoCFG",
9
9
  keywords: [
10
10
  "django",
@@ -50,6 +50,11 @@ var package_default = {
50
50
  types: "./dist/config.d.ts",
51
51
  import: "./dist/config.js",
52
52
  require: "./dist/config.cjs"
53
+ },
54
+ "./i18n": {
55
+ types: "./dist/i18n.d.ts",
56
+ import: "./dist/i18n.js",
57
+ require: "./dist/i18n.cjs"
53
58
  }
54
59
  },
55
60
  files: [
@@ -65,6 +70,7 @@ var package_default = {
65
70
  peerDependencies: {
66
71
  "@djangocfg/api": "workspace:*",
67
72
  "@djangocfg/ext-base": "workspace:*",
73
+ "@djangocfg/i18n": "workspace:*",
68
74
  "@djangocfg/ui-core": "workspace:*",
69
75
  "@djangocfg/ui-nextjs": "workspace:*",
70
76
  consola: "^3.4.2",
@@ -81,6 +87,7 @@ var package_default = {
81
87
  devDependencies: {
82
88
  "@djangocfg/api": "workspace:*",
83
89
  "@djangocfg/ext-base": "workspace:*",
90
+ "@djangocfg/i18n": "workspace:*",
84
91
  "@djangocfg/ui-core": "workspace:*",
85
92
  "@djangocfg/typescript-config": "workspace:*",
86
93
  "@types/node": "^24.7.2",
package/dist/hooks.cjs CHANGED
@@ -12,6 +12,8 @@ var jsxRuntime = require('react/jsx-runtime');
12
12
  var lucideReact = require('lucide-react');
13
13
  var navigation = require('next/navigation');
14
14
  var reactDom = require('react-dom');
15
+ var i18n = require('@djangocfg/ext-base/i18n');
16
+ var i18n$1 = require('@djangocfg/i18n');
15
17
  var uiNextjs = require('@djangocfg/ui-nextjs');
16
18
  var hooks = require('@djangocfg/ui-core/hooks');
17
19
  var moment = require('moment');
@@ -4797,7 +4799,7 @@ var apiKnowbase = api.createExtensionAPI(API);
4797
4799
  // package.json
4798
4800
  var package_default = {
4799
4801
  name: "@djangocfg/ext-knowbase",
4800
- version: "1.0.20",
4802
+ version: "1.0.22",
4801
4803
  description: "Knowledge base and chat extension for DjangoCFG",
4802
4804
  keywords: [
4803
4805
  "django",
@@ -4843,6 +4845,11 @@ var package_default = {
4843
4845
  types: "./dist/config.d.ts",
4844
4846
  import: "./dist/config.js",
4845
4847
  require: "./dist/config.cjs"
4848
+ },
4849
+ "./i18n": {
4850
+ types: "./dist/i18n.d.ts",
4851
+ import: "./dist/i18n.js",
4852
+ require: "./dist/i18n.cjs"
4846
4853
  }
4847
4854
  },
4848
4855
  files: [
@@ -4858,6 +4865,7 @@ var package_default = {
4858
4865
  peerDependencies: {
4859
4866
  "@djangocfg/api": "workspace:*",
4860
4867
  "@djangocfg/ext-base": "workspace:*",
4868
+ "@djangocfg/i18n": "workspace:*",
4861
4869
  "@djangocfg/ui-core": "workspace:*",
4862
4870
  "@djangocfg/ui-nextjs": "workspace:*",
4863
4871
  consola: "^3.4.2",
@@ -4874,6 +4882,7 @@ var package_default = {
4874
4882
  devDependencies: {
4875
4883
  "@djangocfg/api": "workspace:*",
4876
4884
  "@djangocfg/ext-base": "workspace:*",
4885
+ "@djangocfg/i18n": "workspace:*",
4877
4886
  "@djangocfg/ui-core": "workspace:*",
4878
4887
  "@djangocfg/typescript-config": "workspace:*",
4879
4888
  "@types/node": "^24.7.2",
@@ -5245,6 +5254,117 @@ function useChatUI() {
5245
5254
  }
5246
5255
  return context;
5247
5256
  }
5257
+
5258
+ // src/i18n/locales/en.ts
5259
+ var en = {
5260
+ chat: {
5261
+ title: "Knowledge Assistant",
5262
+ titleShort: "Support",
5263
+ placeholder: "Ask me anything...",
5264
+ enterToSend: "Press Enter to send, Shift+Enter for new line",
5265
+ thinking: "Thinking...",
5266
+ source: "Source {index}",
5267
+ startConversation: "Start a Conversation",
5268
+ startConversationDescription: "Ask me anything about the documentation, features, or get help with your project.",
5269
+ openChat: "Open Support Chat"
5270
+ },
5271
+ sessions: {
5272
+ title: "Chat Sessions",
5273
+ description: "View and manage your chat history",
5274
+ noSessions: "No Sessions Yet",
5275
+ noSessionsDescription: "Start a new conversation to create your first session.",
5276
+ untitled: "Untitled Session",
5277
+ active: "Active",
5278
+ archive: "Archive",
5279
+ delete: "Delete",
5280
+ loadingMore: "Loading more...",
5281
+ noMore: "No more sessions",
5282
+ newChat: "New Chat"
5283
+ },
5284
+ actions: {
5285
+ sessions: "Sessions",
5286
+ collapse: "Collapse",
5287
+ expand: "Expand",
5288
+ close: "Close"
5289
+ }
5290
+ };
5291
+
5292
+ // src/i18n/locales/ru.ts
5293
+ var ru = {
5294
+ chat: {
5295
+ title: "\u0411\u0430\u0437\u0430 \u0437\u043D\u0430\u043D\u0438\u0439",
5296
+ titleShort: "\u041F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0430",
5297
+ placeholder: "\u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u0432\u043E\u043F\u0440\u043E\u0441...",
5298
+ enterToSend: "Enter \u0434\u043B\u044F \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0438, Shift+Enter \u0434\u043B\u044F \u043D\u043E\u0432\u043E\u0439 \u0441\u0442\u0440\u043E\u043A\u0438",
5299
+ thinking: "\u0414\u0443\u043C\u0430\u044E...",
5300
+ source: "\u0418\u0441\u0442\u043E\u0447\u043D\u0438\u043A {index}",
5301
+ startConversation: "\u041D\u0430\u0447\u0430\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440",
5302
+ startConversationDescription: "\u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u043B\u044E\u0431\u043E\u0439 \u0432\u043E\u043F\u0440\u043E\u0441 \u043E \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u0438, \u0444\u0443\u043D\u043A\u0446\u0438\u044F\u0445 \u0438\u043B\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u0435 \u043F\u043E\u043C\u043E\u0449\u044C \u0441 \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u043C.",
5303
+ openChat: "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0447\u0430\u0442 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0438"
5304
+ },
5305
+ sessions: {
5306
+ title: "\u0421\u0435\u0441\u0441\u0438\u0438 \u0447\u0430\u0442\u0430",
5307
+ description: "\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0438 \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0438\u0441\u0442\u043E\u0440\u0438\u0435\u0439 \u0447\u0430\u0442\u0430",
5308
+ noSessions: "\u041D\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0439",
5309
+ noSessionsDescription: "\u041D\u0430\u0447\u043D\u0438\u0442\u0435 \u043D\u043E\u0432\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u0443\u044E \u0441\u0435\u0441\u0441\u0438\u044E.",
5310
+ untitled: "\u0411\u0435\u0437 \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F",
5311
+ active: "\u0410\u043A\u0442\u0438\u0432\u043D\u0430\u044F",
5312
+ archive: "\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C",
5313
+ delete: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C",
5314
+ loadingMore: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430...",
5315
+ noMore: "\u0411\u043E\u043B\u044C\u0448\u0435 \u043D\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0439",
5316
+ newChat: "\u041D\u043E\u0432\u044B\u0439 \u0447\u0430\u0442"
5317
+ },
5318
+ actions: {
5319
+ sessions: "\u0421\u0435\u0441\u0441\u0438\u0438",
5320
+ collapse: "\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",
5321
+ expand: "\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C",
5322
+ close: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C"
5323
+ }
5324
+ };
5325
+
5326
+ // src/i18n/locales/ko.ts
5327
+ var ko = {
5328
+ chat: {
5329
+ title: "\uC9C0\uC2DD \uB3C4\uC6B0\uBBF8",
5330
+ titleShort: "\uC9C0\uC6D0",
5331
+ placeholder: "\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...",
5332
+ enterToSend: "Enter\uB85C \uC804\uC1A1, Shift+Enter\uB85C \uC904\uBC14\uAFC8",
5333
+ thinking: "\uC0DD\uAC01 \uC911...",
5334
+ source: "\uCD9C\uCC98 {index}",
5335
+ startConversation: "\uB300\uD654 \uC2DC\uC791\uD558\uAE30",
5336
+ startConversationDescription: "\uBB38\uC11C, \uAE30\uB2A5\uC5D0 \uB300\uD574 \uC9C8\uBB38\uD558\uAC70\uB098 \uD504\uB85C\uC81D\uD2B8 \uB3C4\uC6C0\uC744 \uBC1B\uC73C\uC138\uC694.",
5337
+ openChat: "\uC9C0\uC6D0 \uCC44\uD305 \uC5F4\uAE30"
5338
+ },
5339
+ sessions: {
5340
+ title: "\uCC44\uD305 \uC138\uC158",
5341
+ description: "\uCC44\uD305 \uAE30\uB85D \uBCF4\uAE30 \uBC0F \uAD00\uB9AC",
5342
+ noSessions: "\uC138\uC158 \uC5C6\uC74C",
5343
+ noSessionsDescription: "\uC0C8 \uB300\uD654\uB97C \uC2DC\uC791\uD558\uC5EC \uCCAB \uBC88\uC9F8 \uC138\uC158\uC744 \uB9CC\uB4DC\uC138\uC694.",
5344
+ untitled: "\uC81C\uBAA9 \uC5C6\uC74C",
5345
+ active: "\uD65C\uC131",
5346
+ archive: "\uBCF4\uAD00",
5347
+ delete: "\uC0AD\uC81C",
5348
+ loadingMore: "\uBD88\uB7EC\uC624\uB294 \uC911...",
5349
+ noMore: "\uB354 \uC774\uC0C1 \uC138\uC158 \uC5C6\uC74C",
5350
+ newChat: "\uC0C8 \uCC44\uD305"
5351
+ },
5352
+ actions: {
5353
+ sessions: "\uC138\uC158",
5354
+ collapse: "\uCD95\uC18C",
5355
+ expand: "\uD655\uC7A5",
5356
+ close: "\uB2EB\uAE30"
5357
+ }
5358
+ };
5359
+
5360
+ // src/i18n/index.ts
5361
+ var KNOWBASE_NAMESPACE = "knowbase";
5362
+ var knowbaseI18n = i18n.createExtensionI18n({
5363
+ namespace: KNOWBASE_NAMESPACE,
5364
+ defaultLocale: "en",
5365
+ locales: { en, ru, ko }
5366
+ });
5367
+ knowbaseI18n.getAllTranslations();
5248
5368
  var isDevelopment = process.env.NODE_ENV === "development";
5249
5369
  var logger = consola.createConsola({
5250
5370
  level: isDevelopment ? 4 : 1
@@ -5261,8 +5381,16 @@ var MessageList = ({
5261
5381
  autoScroll = true,
5262
5382
  className = ""
5263
5383
  }) => {
5384
+ const baseT = i18n$1.useT();
5385
+ const kt = i18n.createTypedExtensionT(baseT, KNOWBASE_NAMESPACE);
5264
5386
  const scrollRef = react.useRef(null);
5265
5387
  const { user } = auth.useAuth();
5388
+ const labels = react.useMemo(() => ({
5389
+ startConversation: kt("chat.startConversation"),
5390
+ startConversationDescription: kt("chat.startConversationDescription"),
5391
+ source: kt("chat.source"),
5392
+ thinking: kt("chat.thinking")
5393
+ }), [kt]);
5266
5394
  react.useEffect(() => {
5267
5395
  if (autoScroll && scrollRef.current) {
5268
5396
  const scrollContainer = scrollRef.current.querySelector("[data-radix-scroll-area-viewport]");
@@ -5278,8 +5406,8 @@ var MessageList = ({
5278
5406
  return /* @__PURE__ */ jsxRuntime.jsx(uiNextjs.ScrollArea, { className: `h-full bg-muted/50 ${className}`, viewportRef: scrollRef, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 p-4", children: [
5279
5407
  messages.length === 0 && !isLoading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center h-full text-center py-12", children: [
5280
5408
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { className: "h-12 w-12 text-muted-foreground mb-4" }),
5281
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-foreground mb-2", children: "Start a Conversation" }),
5282
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground max-w-md", children: "Ask me anything about the documentation, features, or get help with your project." })
5409
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-foreground mb-2", children: labels.startConversation }),
5410
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground max-w-md", children: labels.startConversationDescription })
5283
5411
  ] }) : messages.map((message, index) => {
5284
5412
  const isUser = message.role === Enums.ChatMessageRole.USER;
5285
5413
  const isAssistant = message.role === Enums.ChatMessageRole.ASSISTANT;
@@ -5308,10 +5436,10 @@ var MessageList = ({
5308
5436
  uiNextjs.Badge,
5309
5437
  {
5310
5438
  variant: "secondary",
5311
- className: "text-xs flex items-center gap-1 cursor-pointer \n hover:bg-secondary/80 hover:scale-105 active:scale-95 \n transition-all duration-200 animate-in fade-in zoom-in-95",
5439
+ className: "text-xs flex items-center gap-1 cursor-pointer\n hover:bg-secondary/80 hover:scale-105 active:scale-95\n transition-all duration-200 animate-in fade-in zoom-in-95",
5312
5440
  style: { animationDelay: `${(idx + 1) * 100}ms` },
5313
5441
  children: [
5314
- source.document_title || `Source ${idx + 1}`,
5442
+ source.document_title || labels.source.replace("{index}", String(idx + 1)),
5315
5443
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "h-3 w-3" })
5316
5444
  ]
5317
5445
  }
@@ -5332,7 +5460,7 @@ var MessageList = ({
5332
5460
  /* @__PURE__ */ jsxRuntime.jsx(uiNextjs.Avatar, { className: "h-8 w-8 shrink-0 animate-pulse", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full w-full items-center justify-center bg-primary text-primary-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { className: "h-5 w-5 animate-bounce" }) }) }),
5333
5461
  /* @__PURE__ */ jsxRuntime.jsx(uiNextjs.Card, { className: "bg-muted animate-pulse", children: /* @__PURE__ */ jsxRuntime.jsx(uiNextjs.CardContent, { className: "p-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
5334
5462
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin" }),
5335
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-pulse", children: "Thinking..." })
5463
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-pulse", children: labels.thinking })
5336
5464
  ] }) }) })
5337
5465
  ] })
5338
5466
  ] }) });
@@ -5341,12 +5469,18 @@ var MessageInput = ({
5341
5469
  onSend,
5342
5470
  isLoading = false,
5343
5471
  disabled = false,
5344
- placeholder = "Ask me anything...",
5472
+ placeholder,
5345
5473
  className = ""
5346
5474
  }) => {
5475
+ const baseT = i18n$1.useT();
5476
+ const kt = i18n.createTypedExtensionT(baseT, KNOWBASE_NAMESPACE);
5347
5477
  const [message, setMessage] = react.useState("");
5348
5478
  const [rows, setRows] = react.useState(1);
5349
5479
  const textareaRef = react.useRef(null);
5480
+ const labels = react.useMemo(() => ({
5481
+ placeholder: placeholder || kt("chat.placeholder"),
5482
+ enterToSend: kt("chat.enterToSend")
5483
+ }), [kt, placeholder]);
5350
5484
  react.useEffect(() => {
5351
5485
  if (textareaRef.current) {
5352
5486
  const lineHeight = 24;
@@ -5401,10 +5535,10 @@ var MessageInput = ({
5401
5535
  value: message,
5402
5536
  onChange: (e) => setMessage(e.target.value),
5403
5537
  onKeyDown: handleKeyDown,
5404
- placeholder,
5538
+ placeholder: labels.placeholder,
5405
5539
  disabled: isDisabled,
5406
5540
  rows,
5407
- className: "resize-none min-h-[40px] max-h-[120px] transition-all duration-200 \n focus:ring-2 focus:ring-primary/20",
5541
+ className: "resize-none min-h-[40px] max-h-[120px] transition-all duration-200\n focus:ring-2 focus:ring-primary/20",
5408
5542
  style: { resize: "none" }
5409
5543
  }
5410
5544
  ),
@@ -5414,12 +5548,12 @@ var MessageInput = ({
5414
5548
  type: "submit",
5415
5549
  size: "icon",
5416
5550
  disabled: !canSend,
5417
- className: "shrink-0 h-10 w-10 transition-all duration-200 \n hover:scale-110 active:scale-95 disabled:scale-100",
5551
+ className: "shrink-0 h-10 w-10 transition-all duration-200\n hover:scale-110 active:scale-95 disabled:scale-100",
5418
5552
  children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Send, { className: "h-4 w-4" })
5419
5553
  }
5420
5554
  )
5421
5555
  ] }),
5422
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-2", children: "Press Enter to send, Shift+Enter for new line" })
5556
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-2", children: labels.enterToSend })
5423
5557
  ] });
5424
5558
  };
5425
5559
  var PAGE_SIZE = 20;
@@ -5476,6 +5610,8 @@ var SessionList = ({
5476
5610
  onSelectSession,
5477
5611
  className = ""
5478
5612
  }) => {
5613
+ const baseT = i18n$1.useT();
5614
+ const kt = i18n.createTypedExtensionT(baseT, KNOWBASE_NAMESPACE);
5479
5615
  const { deleteSession, archiveSession } = useKnowbaseSessionsContext();
5480
5616
  const {
5481
5617
  sessions,
@@ -5484,6 +5620,18 @@ var SessionList = ({
5484
5620
  hasMore,
5485
5621
  loadMore
5486
5622
  } = useInfiniteSessions();
5623
+ const labels = react.useMemo(() => ({
5624
+ title: kt("sessions.title"),
5625
+ description: kt("sessions.description"),
5626
+ noSessions: kt("sessions.noSessions"),
5627
+ noSessionsDescription: kt("sessions.noSessionsDescription"),
5628
+ untitled: kt("sessions.untitled"),
5629
+ active: kt("sessions.active"),
5630
+ archive: kt("sessions.archive"),
5631
+ delete: kt("sessions.delete"),
5632
+ loadingMore: kt("sessions.loadingMore"),
5633
+ noMore: kt("sessions.noMore")
5634
+ }), [kt]);
5487
5635
  const scrollRef = react.useRef(null);
5488
5636
  const handleScroll = react.useCallback(() => {
5489
5637
  if (!scrollRef.current || isLoadingMore || !hasMore) return;
@@ -5506,13 +5654,13 @@ var SessionList = ({
5506
5654
  };
5507
5655
  return /* @__PURE__ */ jsxRuntime.jsx(uiNextjs.Sheet, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(uiNextjs.SheetContent, { side: "left", className: `w-[400px] sm:w-[540px] ${className}`, children: [
5508
5656
  /* @__PURE__ */ jsxRuntime.jsxs(uiNextjs.SheetHeader, { children: [
5509
- /* @__PURE__ */ jsxRuntime.jsx(uiNextjs.SheetTitle, { children: "Chat Sessions" }),
5510
- /* @__PURE__ */ jsxRuntime.jsx(uiNextjs.SheetDescription, { children: "View and manage your chat history" })
5657
+ /* @__PURE__ */ jsxRuntime.jsx(uiNextjs.SheetTitle, { children: labels.title }),
5658
+ /* @__PURE__ */ jsxRuntime.jsx(uiNextjs.SheetDescription, { children: labels.description })
5511
5659
  ] }),
5512
5660
  /* @__PURE__ */ jsxRuntime.jsx(uiNextjs.ScrollArea, { className: "h-[calc(100vh-120px)] mt-6", viewportRef: scrollRef, children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-6 w-6 animate-spin text-muted-foreground" }) }) : !sessions || sessions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
5513
5661
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "h-12 w-12 text-muted-foreground mb-4" }),
5514
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-foreground mb-2", children: "No Sessions Yet" }),
5515
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground max-w-md", children: "Start a new conversation to create your first session." })
5662
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-foreground mb-2", children: labels.noSessions }),
5663
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground max-w-md", children: labels.noSessionsDescription })
5516
5664
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
5517
5665
  sessions.map((session, index) => /* @__PURE__ */ jsxRuntime.jsxs(
5518
5666
  "div",
@@ -5527,8 +5675,8 @@ var SessionList = ({
5527
5675
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 mt-1", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "h-5 w-5 text-muted-foreground" }) }),
5528
5676
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
5529
5677
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-2 mb-1", children: [
5530
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-medium text-sm truncate", children: session.title || "Untitled Session" }),
5531
- session.is_active && /* @__PURE__ */ jsxRuntime.jsx(uiNextjs.Badge, { variant: "default", className: "shrink-0 text-xs", children: "Active" })
5678
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-medium text-sm truncate", children: session.title || labels.untitled }),
5679
+ session.is_active && /* @__PURE__ */ jsxRuntime.jsx(uiNextjs.Badge, { variant: "default", className: "shrink-0 text-xs", children: labels.active })
5532
5680
  ] }),
5533
5681
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
5534
5682
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "h-3 w-3" }),
@@ -5546,7 +5694,7 @@ var SessionList = ({
5546
5694
  e.stopPropagation();
5547
5695
  archiveSession(session.id, {});
5548
5696
  },
5549
- title: "Archive",
5697
+ title: labels.archive,
5550
5698
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Archive, { className: "h-4 w-4" })
5551
5699
  }
5552
5700
  ),
@@ -5555,12 +5703,12 @@ var SessionList = ({
5555
5703
  {
5556
5704
  variant: "ghost",
5557
5705
  size: "sm",
5558
- className: "h-8 w-8 p-0 text-destructive hover:text-destructive \n hover:scale-110 active:scale-95 transition-transform duration-200",
5706
+ className: "h-8 w-8 p-0 text-destructive hover:text-destructive\n hover:scale-110 active:scale-95 transition-transform duration-200",
5559
5707
  onClick: (e) => {
5560
5708
  e.stopPropagation();
5561
5709
  deleteSession(session.id);
5562
5710
  },
5563
- title: "Delete",
5711
+ title: labels.delete,
5564
5712
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4" })
5565
5713
  }
5566
5714
  )
@@ -5571,9 +5719,9 @@ var SessionList = ({
5571
5719
  )),
5572
5720
  isLoadingMore && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center py-6", children: [
5573
5721
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-5 w-5 animate-spin text-muted-foreground mr-2" }),
5574
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "Loading more..." })
5722
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: labels.loadingMore })
5575
5723
  ] }),
5576
- !hasMore && sessions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-4", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "No more sessions" }) })
5724
+ !hasMore && sessions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-4", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: labels.noMore }) })
5577
5725
  ] }) })
5578
5726
  ] }) });
5579
5727
  };
@@ -5586,6 +5734,8 @@ var ChatWidget = ({
5586
5734
  onToggle,
5587
5735
  onMessage
5588
5736
  }) => {
5737
+ const baseT = i18n$1.useT();
5738
+ const kt = i18n.createTypedExtensionT(baseT, KNOWBASE_NAMESPACE);
5589
5739
  const { sendQuery, getChatHistory } = useKnowbaseChatContext();
5590
5740
  const { createSession, getSession } = useKnowbaseSessionsContext();
5591
5741
  const {
@@ -5596,6 +5746,17 @@ var ChatWidget = ({
5596
5746
  toggleSources,
5597
5747
  toggleTimestamps
5598
5748
  } = useChatUI();
5749
+ const labels = react.useMemo(() => ({
5750
+ title: kt("chat.title"),
5751
+ titleShort: kt("chat.titleShort"),
5752
+ placeholder: kt("chat.placeholder"),
5753
+ openChat: kt("chat.openChat"),
5754
+ sessions: kt("actions.sessions"),
5755
+ newChat: kt("sessions.newChat"),
5756
+ collapse: kt("actions.collapse"),
5757
+ expand: kt("actions.expand"),
5758
+ close: kt("actions.close")
5759
+ }), [kt]);
5599
5760
  const pathname = navigation.usePathname();
5600
5761
  const isMobile = hooks.useIsMobile();
5601
5762
  const [isLoading, setIsLoading] = react.useState(false);
@@ -5736,7 +5897,7 @@ var ChatWidget = ({
5736
5897
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-4 border-b bg-background shadow-sm", children: [
5737
5898
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
5738
5899
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "h-5 w-5 text-primary" }),
5739
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-semibold text-foreground", children: "Knowledge Assistant" })
5900
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-semibold text-foreground", children: labels.title })
5740
5901
  ] }),
5741
5902
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
5742
5903
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -5746,7 +5907,7 @@ var ChatWidget = ({
5746
5907
  size: "sm",
5747
5908
  onClick: () => setShowSessions(true),
5748
5909
  className: "text-muted-foreground hover:text-foreground",
5749
- title: "Sessions",
5910
+ title: labels.sessions,
5750
5911
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.List, { className: "h-5 w-5" })
5751
5912
  }
5752
5913
  ),
@@ -5757,7 +5918,7 @@ var ChatWidget = ({
5757
5918
  size: "sm",
5758
5919
  onClick: handleNewChat,
5759
5920
  className: "text-muted-foreground hover:text-foreground",
5760
- title: "New Chat",
5921
+ title: labels.newChat,
5761
5922
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-5 w-5" })
5762
5923
  }
5763
5924
  ),
@@ -5790,7 +5951,7 @@ var ChatWidget = ({
5790
5951
  {
5791
5952
  onSend: handleSendMessage,
5792
5953
  isLoading,
5793
- placeholder: "Ask me anything..."
5954
+ placeholder: labels.placeholder
5794
5955
  }
5795
5956
  )
5796
5957
  ] })
@@ -5839,7 +6000,7 @@ var ChatWidget = ({
5839
6000
  /* @__PURE__ */ jsxRuntime.jsxs(uiNextjs.CardHeader, { className: "flex-row items-center justify-between space-y-0 pb-3 border-b", children: [
5840
6001
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
5841
6002
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "h-5 w-5 text-primary" }),
5842
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-foreground", children: "Support" })
6003
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-foreground", children: labels.titleShort })
5843
6004
  ] }),
5844
6005
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
5845
6006
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -5849,7 +6010,7 @@ var ChatWidget = ({
5849
6010
  size: "sm",
5850
6011
  onClick: () => setShowSessions(true),
5851
6012
  className: "h-8 w-8 p-0",
5852
- title: "Sessions",
6013
+ title: labels.sessions,
5853
6014
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.List, { className: "h-4 w-4" })
5854
6015
  }
5855
6016
  ),
@@ -5860,7 +6021,7 @@ var ChatWidget = ({
5860
6021
  size: "sm",
5861
6022
  onClick: handleNewChat,
5862
6023
  className: "h-8 w-8 p-0",
5863
- title: "New Chat",
6024
+ title: labels.newChat,
5864
6025
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4" })
5865
6026
  }
5866
6027
  ),
@@ -5871,7 +6032,7 @@ var ChatWidget = ({
5871
6032
  size: "sm",
5872
6033
  onClick: uiState.isExpanded ? collapseChat : expandChat,
5873
6034
  className: "h-8 w-8 p-0",
5874
- title: uiState.isExpanded ? "Collapse" : "Expand",
6035
+ title: uiState.isExpanded ? labels.collapse : labels.expand,
5875
6036
  children: uiState.isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minimize2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize2, { className: "h-4 w-4" })
5876
6037
  }
5877
6038
  ),
@@ -5882,7 +6043,7 @@ var ChatWidget = ({
5882
6043
  size: "sm",
5883
6044
  onClick: toggleChat,
5884
6045
  className: "h-8 w-8 p-0",
5885
- title: "Close",
6046
+ title: labels.close,
5886
6047
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
5887
6048
  }
5888
6049
  )
@@ -5905,7 +6066,7 @@ var ChatWidget = ({
5905
6066
  {
5906
6067
  onSend: handleSendMessage,
5907
6068
  isLoading,
5908
- placeholder: "Ask me anything..."
6069
+ placeholder: labels.placeholder
5909
6070
  }
5910
6071
  )
5911
6072
  ] })
@@ -5940,14 +6101,14 @@ var ChatWidget = ({
5940
6101
  uiNextjs.Button,
5941
6102
  {
5942
6103
  onClick: toggleChat,
5943
- className: "w-full h-full rounded-full shadow-2xl \n hover:scale-110 hover:rotate-12 active:scale-95 \n transition-all duration-300 ease-out\n flex items-center justify-center\n group",
6104
+ className: "w-full h-full rounded-full shadow-2xl\n hover:scale-110 hover:rotate-12 active:scale-95\n transition-all duration-300 ease-out\n flex items-center justify-center\n group",
5944
6105
  style: {
5945
6106
  backgroundColor: "hsl(var(--primary))",
5946
6107
  borderRadius: "50%",
5947
6108
  padding: 0
5948
6109
  },
5949
- title: "Open Support Chat",
5950
- "aria-label": "Open Support Chat",
6110
+ title: labels.openChat,
6111
+ "aria-label": labels.openChat,
5951
6112
  children: /* @__PURE__ */ jsxRuntime.jsx(
5952
6113
  lucideReact.MessageSquare,
5953
6114
  {