@devalok/shilp-sutra-karm 0.22.0 → 0.23.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.
@@ -1,60 +1,60 @@
1
1
  "use client";
2
- import { jsxs as s, jsx as e, Fragment as X } from "react/jsx-runtime";
2
+ import { jsxs as s, jsx as e, Fragment as Y } from "react/jsx-runtime";
3
3
  import * as w from "react";
4
- import { useRef as R, useEffect as Y, useState as P, useCallback as T } from "react";
5
- import { Sheet as _, SheetContent as J, SheetTitle as Q } from "@devalok/shilp-sutra/ui/sheet";
6
- import { AnimatePresence as W, motion as g } from "framer-motion";
7
- import { cn as x } from "@devalok/shilp-sutra/ui/lib/utils";
4
+ import { useRef as P, useEffect as _, useState as L, useCallback as T } from "react";
5
+ import { Sheet as J, SheetContent as Q, SheetTitle as W } from "@devalok/shilp-sutra/ui/sheet";
6
+ import { AnimatePresence as Z, motion as g } from "framer-motion";
7
+ import { cn as f } from "@devalok/shilp-sutra/ui/lib/utils";
8
8
  import { springs as v } from "@devalok/shilp-sutra/ui/lib/motion";
9
- import { u as Z } from "./use-composed-ref.js";
10
- import { m as A } from "./markdown-components.js";
11
- import { M as L } from "./vendor-markdown.js";
12
- import { IconRobot as C, IconAlertCircle as $, IconUser as O, IconSquare as S, IconSend as ee, IconMessagePlus as E, IconMessage as se, IconArchive as ae, IconTrash as re, IconChevronDown as te, IconHistory as ie, IconX as de } from "@tabler/icons-react";
13
- import { Button as D } from "@devalok/shilp-sutra/ui/button";
14
- import { formatRelativeTime as le } from "@devalok/shilp-sutra/ui/lib/date-utils";
15
- import { DropdownMenu as ce, DropdownMenuTrigger as ne, DropdownMenuContent as oe, DropdownMenuItem as me } from "@devalok/shilp-sutra/ui";
16
- const H = w.forwardRef(
17
- function({ text: d, isComplete: l = !1, className: i, ...f }, c) {
18
- return /* @__PURE__ */ s("div", { ref: c, className: x(i), ...f, "aria-live": "off", children: [
19
- /* @__PURE__ */ e(L, { components: A, children: d }),
20
- !l && /* @__PURE__ */ e("span", { className: "inline-block h-4 w-2 animate-pulse bg-surface-fg-muted ml-ds-01" }),
9
+ import { u as $ } from "./use-composed-ref.js";
10
+ import { m as E } from "./markdown-components.js";
11
+ import { M as H } from "./vendor-markdown.js";
12
+ import { IconRobot as C, IconAlertCircle as O, IconUser as S, IconSquare as ee, IconSend as se, IconMessagePlus as K, IconMessage as ae, IconArchive as re, IconTrash as te, IconChevronDown as ie, IconHistory as le, IconX as de } from "@tabler/icons-react";
13
+ import { Button as R } from "@devalok/shilp-sutra/ui/button";
14
+ import { formatRelativeTime as ce } from "@devalok/shilp-sutra/ui/lib/date-utils";
15
+ import { DropdownMenu as ne, DropdownMenuTrigger as oe, DropdownMenuContent as me, DropdownMenuItem as fe } from "@devalok/shilp-sutra/ui";
16
+ const A = w.forwardRef(
17
+ function({ text: c, isComplete: n = !1, className: d, ...x }, o) {
18
+ return /* @__PURE__ */ s("div", { ref: o, className: f(d), ...x, "aria-live": "off", children: [
19
+ /* @__PURE__ */ e(H, { components: E, children: c }),
20
+ !n && /* @__PURE__ */ e("span", { className: "inline-block h-4 w-2 animate-pulse bg-surface-fg-muted ml-ds-01" }),
21
21
  /* @__PURE__ */ e(
22
22
  "span",
23
23
  {
24
24
  className: "sr-only",
25
25
  "aria-live": "polite",
26
26
  "aria-atomic": "true",
27
- children: l ? d : ""
27
+ children: n ? c : ""
28
28
  }
29
29
  )
30
30
  ] });
31
31
  }
32
32
  );
33
- H.displayName = "StreamingText";
34
- const K = w.forwardRef(
33
+ A.displayName = "StreamingText";
34
+ const U = w.forwardRef(
35
35
  function({
36
- messages: d,
37
- isStreaming: l = !1,
38
- streamingText: i = "",
39
- isLoadingMessages: f = !1,
40
- emptyTitle: c = "Karm AI",
41
- emptyDescription: u = "Ask me about tasks, projects, attendance, or anything else.",
42
- className: o,
43
- ...m
44
- }, n) {
45
- const h = R(null), t = Z(h, n);
46
- return Y(() => {
47
- const a = h.current;
36
+ messages: c,
37
+ isStreaming: n = !1,
38
+ streamingText: d = "",
39
+ isLoadingMessages: x = !1,
40
+ emptyTitle: o = "Karm AI",
41
+ emptyDescription: p = "Ask me about tasks, projects, attendance, or anything else.",
42
+ className: u,
43
+ ...h
44
+ }, m) {
45
+ const b = P(null), l = $(b, m);
46
+ return _(() => {
47
+ const a = b.current;
48
48
  a && (a.scrollTop = a.scrollHeight);
49
- }, [d, i]), f ? /* @__PURE__ */ e("div", { ref: n, className: x("flex flex-1 items-center justify-center", o), ...m, children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-ds-03", children: [
49
+ }, [c, d]), x ? /* @__PURE__ */ e("div", { ref: m, className: f("flex flex-1 items-center justify-center", u), ...h, children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-ds-03", children: [
50
50
  /* @__PURE__ */ e("div", { className: "h-ds-xs w-ds-xs animate-spin rounded-ds-full border-2 border-surface-border border-t-transparent" }),
51
51
  /* @__PURE__ */ e("p", { className: "text-ds-sm text-surface-fg-subtle", children: "Loading messages..." })
52
- ] }) }) : d.length === 0 && !l ? /* @__PURE__ */ e("div", { ref: n, className: x("flex flex-1 items-center justify-center p-ds-06", o), ...m, children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-ds-04 text-center", children: [
52
+ ] }) }) : c.length === 0 && !n ? /* @__PURE__ */ e("div", { ref: m, className: f("flex flex-1 items-center justify-center p-ds-06", u), ...h, children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-ds-04 text-center", children: [
53
53
  /* @__PURE__ */ e("div", { className: "flex h-ds-lg w-ds-lg items-center justify-center rounded-ds-full bg-surface-raised-hover", children: /* @__PURE__ */ e(C, { className: "h-ico-lg w-ico-lg text-surface-fg-muted" }) }),
54
- /* @__PURE__ */ e("h3", { className: "text-ds-base text-surface-fg", children: c }),
55
- /* @__PURE__ */ e("p", { className: "text-ds-sm max-w-[280px] text-surface-fg-subtle", children: u })
56
- ] }) }) : /* @__PURE__ */ e("div", { ref: t, className: x("no-scrollbar flex-1 overflow-y-auto p-ds-05", o), ...m, children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-ds-05", role: "log", "aria-label": "Chat messages", children: /* @__PURE__ */ s(W, { initial: !1, children: [
57
- d.map((a) => a.role === "SYSTEM" ? /* @__PURE__ */ e(
54
+ /* @__PURE__ */ e("h3", { className: "text-ds-base text-surface-fg", children: o }),
55
+ /* @__PURE__ */ e("p", { className: "text-ds-sm max-w-[280px] text-surface-fg-subtle", children: p })
56
+ ] }) }) : /* @__PURE__ */ e("div", { ref: l, className: f("no-scrollbar flex-1 overflow-y-auto p-ds-05", u), ...h, children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-ds-05", role: "log", "aria-label": "Chat messages", children: /* @__PURE__ */ s(Z, { initial: !1, children: [
57
+ c.map((a) => a.role === "SYSTEM" ? /* @__PURE__ */ e(
58
58
  g.div,
59
59
  {
60
60
  initial: { opacity: 0, y: 10 },
@@ -62,7 +62,7 @@ const K = w.forwardRef(
62
62
  transition: v.snappy,
63
63
  className: "flex justify-center",
64
64
  children: /* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03 rounded-ds-lg bg-error-3 px-ds-04 py-ds-03", children: [
65
- /* @__PURE__ */ e($, { className: "h-ico-sm w-ico-sm shrink-0 text-error-11" }),
65
+ /* @__PURE__ */ e(O, { className: "h-ico-sm w-ico-sm shrink-0 text-error-11" }),
66
66
  /* @__PURE__ */ e("p", { className: "text-ds-sm text-error-11", children: a.content })
67
67
  ] })
68
68
  },
@@ -76,7 +76,7 @@ const K = w.forwardRef(
76
76
  className: "flex justify-end",
77
77
  children: /* @__PURE__ */ s("div", { className: "flex max-w-[85%] items-start gap-ds-03", children: [
78
78
  /* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-br-ds-sm bg-accent-9 px-ds-04 py-ds-03 text-accent-fg", children: /* @__PURE__ */ e("p", { className: "text-ds-md whitespace-pre-wrap", children: a.content }) }),
79
- /* @__PURE__ */ e("div", { className: "flex h-ds-xs-plus w-ds-xs-plus shrink-0 items-center justify-center rounded-ds-full bg-surface-raised-hover", children: /* @__PURE__ */ e(O, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }) })
79
+ /* @__PURE__ */ e("div", { className: "flex h-ds-xs-plus w-ds-xs-plus shrink-0 items-center justify-center rounded-ds-full bg-surface-raised-hover", children: /* @__PURE__ */ e(S, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }) })
80
80
  ] })
81
81
  },
82
82
  a.id
@@ -89,12 +89,12 @@ const K = w.forwardRef(
89
89
  className: "flex justify-start",
90
90
  children: /* @__PURE__ */ s("div", { className: "flex max-w-[85%] items-start gap-ds-03", children: [
91
91
  /* @__PURE__ */ e("div", { className: "flex h-ds-xs-plus w-ds-xs-plus shrink-0 items-center justify-center rounded-ds-full bg-surface-raised-hover", children: /* @__PURE__ */ e(C, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }) }),
92
- /* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-bl-ds-sm bg-surface-raised-hover px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-md text-surface-fg", children: /* @__PURE__ */ e(L, { components: A, children: a.content }) }) })
92
+ /* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-bl-ds-sm bg-surface-raised-hover px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-md text-surface-fg", children: /* @__PURE__ */ e(H, { components: E, children: a.content }) }) })
93
93
  ] })
94
94
  },
95
95
  a.id
96
96
  )),
97
- l && i && /* @__PURE__ */ e(
97
+ n && d && /* @__PURE__ */ e(
98
98
  g.div,
99
99
  {
100
100
  initial: { opacity: 0, y: 10 },
@@ -103,12 +103,12 @@ const K = w.forwardRef(
103
103
  className: "flex justify-start",
104
104
  children: /* @__PURE__ */ s("div", { className: "flex max-w-[85%] items-start gap-ds-03", children: [
105
105
  /* @__PURE__ */ e("div", { className: "flex h-ds-xs-plus w-ds-xs-plus shrink-0 items-center justify-center rounded-ds-full bg-surface-raised-hover", children: /* @__PURE__ */ e(C, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }) }),
106
- /* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-bl-ds-sm bg-surface-raised-hover px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-md text-surface-fg", children: /* @__PURE__ */ e(H, { text: i }) }) })
106
+ /* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-bl-ds-sm bg-surface-raised-hover px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-md text-surface-fg", children: /* @__PURE__ */ e(A, { text: d }) }) })
107
107
  ] })
108
108
  },
109
109
  "streaming-text"
110
110
  ),
111
- l && !i && /* @__PURE__ */ e(
111
+ n && !d && /* @__PURE__ */ e(
112
112
  g.div,
113
113
  {
114
114
  initial: { opacity: 0, y: 10 },
@@ -133,136 +133,136 @@ const K = w.forwardRef(
133
133
  ] }) }) });
134
134
  }
135
135
  );
136
- K.displayName = "MessageList";
137
- const U = w.forwardRef(
136
+ U.displayName = "MessageList";
137
+ const z = w.forwardRef(
138
138
  function({
139
- onSubmit: d,
140
- onCancel: l,
141
- isStreaming: i = !1,
142
- placeholder: f = "Ask Karm AI...",
143
- disclaimer: c = "AI responses may be inaccurate. Verify important information.",
144
- className: u,
145
- ...o
146
- }, m) {
147
- const [n, h] = P(""), t = R(null), a = T(() => {
148
- const r = t.current;
139
+ onSubmit: c,
140
+ onCancel: n,
141
+ isStreaming: d = !1,
142
+ placeholder: x = "Ask Karm AI...",
143
+ disclaimer: o = "AI responses may be inaccurate. Verify important information.",
144
+ className: p,
145
+ ...u
146
+ }, h) {
147
+ const [m, b] = L(""), l = P(null), a = T(() => {
148
+ const r = l.current;
149
149
  r && (r.style.height = "auto", r.style.height = Math.min(r.scrollHeight, 160) + "px");
150
- }, []), y = T(() => {
151
- const r = n.trim();
152
- !r || i || (h(""), t.current && (t.current.style.height = "auto"), d(r));
153
- }, [n, i, d]), N = T(
150
+ }, []), N = T(() => {
151
+ const r = m.trim();
152
+ !r || d || (b(""), l.current && (l.current.style.height = "auto"), c(r));
153
+ }, [m, d, c]), y = T(
154
154
  (r) => {
155
- r.key === "Enter" && !r.shiftKey && (r.preventDefault(), y());
155
+ r.key === "Enter" && !r.shiftKey && (r.preventDefault(), N());
156
156
  },
157
- [y]
157
+ [N]
158
158
  );
159
- return /* @__PURE__ */ s("div", { ref: m, className: x("border-t border-surface-border-strong bg-surface-raised p-ds-04", u), ...o, children: [
159
+ return /* @__PURE__ */ s("div", { ref: h, className: f("border-t border-surface-border-strong bg-surface-raised p-ds-04", p), ...u, children: [
160
160
  /* @__PURE__ */ s("div", { className: "flex items-end gap-ds-03 rounded-ds-xl border border-surface-border-strong bg-surface-raised-hover px-ds-04 py-ds-03", children: [
161
161
  /* @__PURE__ */ e(
162
162
  "textarea",
163
163
  {
164
- ref: t,
165
- value: n,
164
+ ref: l,
165
+ value: m,
166
166
  onChange: (r) => {
167
- h(r.target.value), a();
167
+ b(r.target.value), a();
168
168
  },
169
- onKeyDown: N,
170
- placeholder: f,
169
+ onKeyDown: y,
170
+ placeholder: x,
171
171
  "aria-label": "Type a message",
172
- disabled: i,
172
+ disabled: d,
173
173
  rows: 1,
174
174
  className: "text-ds-md no-scrollbar max-h-[160px] min-h-ds-xs flex-1 resize-none bg-transparent text-surface-fg placeholder:text-surface-fg-subtle focus:outline-none disabled:opacity-action-disabled"
175
175
  }
176
176
  ),
177
- i ? /* @__PURE__ */ e(D, { variant: "solid", color: "error", size: "icon-sm", className: "h-ds-sm w-ds-sm shrink-0 rounded-ds-lg", onClick: l, "aria-label": "Stop generating", children: /* @__PURE__ */ e(S, { className: "h-ico-sm w-ico-sm" }) }) : /* @__PURE__ */ e(D, { size: "icon-sm", className: "h-ds-sm w-ds-sm shrink-0 rounded-ds-lg", onClick: y, disabled: !n.trim(), "aria-label": "Send message", children: /* @__PURE__ */ e(ee, { className: "h-ico-sm w-ico-sm" }) })
177
+ d ? /* @__PURE__ */ e(R, { variant: "solid", color: "error", size: "icon-sm", className: "h-ds-sm w-ds-sm shrink-0 rounded-ds-lg", onClick: n, "aria-label": "Stop generating", children: /* @__PURE__ */ e(ee, { className: "h-ico-sm w-ico-sm" }) }) : /* @__PURE__ */ e(R, { size: "icon-sm", className: "h-ds-sm w-ds-sm shrink-0 rounded-ds-lg", onClick: N, disabled: !m.trim(), "aria-label": "Send message", children: /* @__PURE__ */ e(se, { className: "h-ico-sm w-ico-sm" }) })
178
178
  ] }),
179
- c && /* @__PURE__ */ e("p", { className: "text-ds-sm mt-ds-02b text-center text-surface-fg-subtle", children: c })
179
+ o && /* @__PURE__ */ e("p", { className: "text-ds-sm mt-ds-02b text-center text-surface-fg-subtle", children: o })
180
180
  ] });
181
181
  }
182
182
  );
183
- U.displayName = "ChatInput";
184
- const z = w.forwardRef(
183
+ z.displayName = "ChatInput";
184
+ const F = w.forwardRef(
185
185
  function({
186
- conversations: d,
187
- activeConversationId: l,
188
- isLoading: i = !1,
189
- onSelect: f,
190
- onNewChat: c,
191
- onArchive: u,
192
- onDelete: o,
193
- className: m,
194
- ...n
195
- }, h) {
196
- return /* @__PURE__ */ s("div", { ref: h, className: x("flex flex-1 flex-col overflow-hidden", m), ...n, children: [
186
+ conversations: c,
187
+ activeConversationId: n,
188
+ isLoading: d = !1,
189
+ onSelect: x,
190
+ onNewChat: o,
191
+ onArchive: p,
192
+ onDelete: u,
193
+ className: h,
194
+ ...m
195
+ }, b) {
196
+ return /* @__PURE__ */ s("div", { ref: b, className: f("flex flex-1 flex-col overflow-hidden", h), ...m, children: [
197
197
  /* @__PURE__ */ s("div", { className: "flex items-center justify-between border-b border-surface-border-strong px-ds-05 py-ds-04", children: [
198
198
  /* @__PURE__ */ e("h3", { className: "text-ds-md font-semibold text-surface-fg", children: "Conversations" }),
199
199
  /* @__PURE__ */ s(
200
200
  "button",
201
201
  {
202
- onClick: c,
202
+ onClick: o,
203
203
  className: "flex items-center gap-ds-02b rounded-ds-lg px-ds-03 py-ds-02b text-surface-fg-muted transition-colors hover:bg-surface-raised-hover",
204
204
  children: [
205
- /* @__PURE__ */ e(E, { className: "h-ico-sm w-ico-sm" }),
205
+ /* @__PURE__ */ e(K, { className: "h-ico-sm w-ico-sm" }),
206
206
  /* @__PURE__ */ e("span", { className: "text-ds-sm", children: "New Chat" })
207
207
  ]
208
208
  }
209
209
  )
210
210
  ] }),
211
- /* @__PURE__ */ e("div", { className: "no-scrollbar flex-1 overflow-y-auto", children: i ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ e("div", { className: "h-ico-md w-ico-md animate-spin rounded-ds-full border-2 border-surface-border border-t-transparent" }) }) : d.length === 0 ? /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center gap-ds-03 py-12", children: [
212
- /* @__PURE__ */ e(se, { className: "h-ds-sm w-ds-sm text-surface-fg-subtle" }),
211
+ /* @__PURE__ */ e("div", { className: "no-scrollbar flex-1 overflow-y-auto", children: d ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ e("div", { className: "h-ico-md w-ico-md animate-spin rounded-ds-full border-2 border-surface-border border-t-transparent" }) }) : c.length === 0 ? /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center gap-ds-03 py-12", children: [
212
+ /* @__PURE__ */ e(ae, { className: "h-ds-sm w-ds-sm text-surface-fg-subtle" }),
213
213
  /* @__PURE__ */ e("p", { className: "text-ds-md text-surface-fg-subtle", children: "No conversations yet" })
214
- ] }) : /* @__PURE__ */ e("div", { className: "flex flex-col", children: d.map((t) => /* @__PURE__ */ s(
214
+ ] }) : /* @__PURE__ */ e("div", { className: "flex flex-col", children: c.map((l) => /* @__PURE__ */ s(
215
215
  "div",
216
216
  {
217
- className: x(
217
+ className: f(
218
218
  "group flex items-center gap-ds-04 border-b border-surface-border px-ds-05 py-ds-04 transition-colors hover:bg-surface-raised-hover",
219
- l === t.id && "bg-surface-raised-hover"
219
+ n === l.id && "bg-surface-raised-hover"
220
220
  ),
221
221
  children: [
222
222
  /* @__PURE__ */ s(
223
223
  "button",
224
224
  {
225
- onClick: () => f(t.id),
225
+ onClick: () => x(l.id),
226
226
  className: "flex min-w-0 flex-1 flex-col gap-ds-01 text-left",
227
227
  children: [
228
- /* @__PURE__ */ e("p", { className: "text-ds-md truncate text-surface-fg", children: t.title || "Untitled conversation" }),
229
- /* @__PURE__ */ e("p", { className: "text-ds-sm text-surface-fg-subtle", children: le(t.updatedAt) })
228
+ /* @__PURE__ */ e("p", { className: "text-ds-md truncate text-surface-fg", children: l.title || "Untitled conversation" }),
229
+ /* @__PURE__ */ e("p", { className: "text-ds-sm text-surface-fg-subtle", children: ce(l.updatedAt) })
230
230
  ]
231
231
  }
232
232
  ),
233
233
  /* @__PURE__ */ s("div", { className: "flex shrink-0 items-center gap-ds-02 opacity-0 transition-opacity duration-fast-01 group-hover:opacity-100", children: [
234
- u && /* @__PURE__ */ e(
234
+ p && /* @__PURE__ */ e(
235
235
  "button",
236
236
  {
237
237
  onClick: (a) => {
238
- a.stopPropagation(), u(t.id);
238
+ a.stopPropagation(), p(l.id);
239
239
  },
240
240
  className: "flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md text-surface-fg-subtle transition-colors hover:bg-surface-raised-hover hover:text-surface-fg-muted",
241
241
  "aria-label": "Archive conversation",
242
- children: /* @__PURE__ */ e(ae, { className: "h-ico-sm w-ico-sm" })
242
+ children: /* @__PURE__ */ e(re, { className: "h-ico-sm w-ico-sm" })
243
243
  }
244
244
  ),
245
- o && /* @__PURE__ */ e(
245
+ u && /* @__PURE__ */ e(
246
246
  "button",
247
247
  {
248
248
  onClick: (a) => {
249
- a.stopPropagation(), o(t.id);
249
+ a.stopPropagation(), u(l.id);
250
250
  },
251
251
  className: "flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md text-surface-fg-subtle transition-colors hover:bg-error-3 hover:text-error-11",
252
252
  "aria-label": "Delete conversation",
253
- children: /* @__PURE__ */ e(re, { className: "h-ico-sm w-ico-sm" })
253
+ children: /* @__PURE__ */ e(te, { className: "h-ico-sm w-ico-sm" })
254
254
  }
255
255
  )
256
256
  ] })
257
257
  ]
258
258
  },
259
- t.id
259
+ l.id
260
260
  )) }) })
261
261
  ] });
262
262
  }
263
263
  );
264
- z.displayName = "ConversationList";
265
- const fe = [
264
+ F.displayName = "ConversationList";
265
+ const ue = [
266
266
  { id: "devadoot", name: "Devadoot", desc: "General Assistant" },
267
267
  { id: "prahari", name: "Prahari", desc: "Attendance & Time" },
268
268
  { id: "sutradhar", name: "Sutradhar", desc: "Tasks & Projects" },
@@ -270,63 +270,104 @@ const fe = [
270
270
  { id: "vidwan", name: "Vidwan", desc: "Knowledge Expert" },
271
271
  { id: "sanchalak", name: "Sanchalak", desc: "Manager Advisor" },
272
272
  { id: "dwar-palak", name: "Dwar-Palak", desc: "Access Control" }
273
- ], ue = w.forwardRef(
273
+ ], he = w.forwardRef(
274
274
  function({
275
- isOpen: d,
276
- onOpenChange: l,
277
- messages: i,
278
- conversations: f,
279
- agents: c = fe,
280
- selectedAgentId: u = "devadoot",
281
- activeConversationId: o,
282
- isStreaming: m = !1,
283
- streamingText: n = "",
284
- isLoadingMessages: h = !1,
285
- isLoadingConversations: t = !1,
275
+ isOpen: c,
276
+ onOpenChange: n,
277
+ messages: d,
278
+ conversations: x,
279
+ agents: o = ue,
280
+ selectedAgentId: p = "devadoot",
281
+ activeConversationId: u,
282
+ isStreaming: h = !1,
283
+ streamingText: m = "",
284
+ isLoadingMessages: b = !1,
285
+ isLoadingConversations: l = !1,
286
286
  onSendMessage: a,
287
- onCancelStream: y,
288
- onSelectAgent: N,
287
+ onCancelStream: N,
288
+ onSelectAgent: y,
289
289
  onStartNewChat: r,
290
290
  onSelectConversation: I,
291
- onArchiveConversation: F,
292
- onDeleteConversation: G,
293
- className: V,
294
- ...q
295
- }, B) {
296
- const [M, j] = P(!1), b = c.find((p) => p.id === u) ?? c[0];
297
- return /* @__PURE__ */ e(_, { open: d, onOpenChange: l, children: /* @__PURE__ */ s(
298
- J,
291
+ onArchiveConversation: G,
292
+ onDeleteConversation: V,
293
+ className: q,
294
+ ...B
295
+ }, X) {
296
+ const [M, j] = L(!1), t = o.find((i) => i.id === p) ?? o[0];
297
+ return /* @__PURE__ */ e(J, { open: c, onOpenChange: n, children: /* @__PURE__ */ s(
298
+ Q,
299
299
  {
300
- ref: B,
300
+ ref: X,
301
301
  side: "right",
302
- className: x("flex w-full flex-col gap-0 border-l border-surface-border-strong bg-surface-raised p-0 sm:max-w-[480px] [&>button]:hidden", V),
303
- ...q,
302
+ className: f("flex w-full flex-col gap-0 border-l border-surface-border-strong bg-surface-raised p-0 sm:max-w-[480px] [&>button]:hidden", q),
303
+ ...B,
304
304
  children: [
305
- /* @__PURE__ */ e(Q, { className: "sr-only", children: "AI Chat" }),
305
+ /* @__PURE__ */ e(W, { className: "sr-only", children: "AI Chat" }),
306
306
  /* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03 border-b border-surface-border-strong px-ds-05 py-ds-04", children: [
307
- /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ s(ce, { children: [
308
- /* @__PURE__ */ e(ne, { asChild: !0, children: /* @__PURE__ */ s(
307
+ /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ s(ne, { children: [
308
+ /* @__PURE__ */ e(oe, { asChild: !0, children: /* @__PURE__ */ s(
309
309
  "button",
310
310
  {
311
311
  className: "flex items-center gap-ds-02b rounded-ds-lg px-ds-03 py-ds-02b transition-colors hover:bg-surface-raised-hover",
312
312
  children: [
313
- /* @__PURE__ */ e("span", { className: "text-ds-base text-surface-fg", children: b == null ? void 0 : b.name }),
314
- /* @__PURE__ */ e("span", { className: "text-ds-sm text-surface-fg-subtle", children: b == null ? void 0 : b.desc }),
315
- /* @__PURE__ */ e(te, { className: "h-ico-sm w-ico-sm text-surface-fg-subtle" })
313
+ t != null && t.icon ? /* @__PURE__ */ e("span", { className: "flex h-5 w-5 flex-shrink-0 items-center justify-center", children: t.icon }) : /* @__PURE__ */ e("span", { className: "flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full bg-accent-3 text-ds-xs font-semibold text-accent-11", children: t == null ? void 0 : t.name.charAt(0) }),
314
+ (t == null ? void 0 : t.status) && /* @__PURE__ */ e(
315
+ "span",
316
+ {
317
+ className: f(
318
+ "h-2 w-2 flex-shrink-0 rounded-full",
319
+ t.status === "online" && "bg-success-9",
320
+ t.status === "busy" && "bg-warning-9",
321
+ t.status === "offline" && "bg-surface-fg-subtle"
322
+ ),
323
+ "aria-label": t.status
324
+ }
325
+ ),
326
+ /* @__PURE__ */ e("span", { className: "text-ds-base text-surface-fg", children: t == null ? void 0 : t.name }),
327
+ /* @__PURE__ */ e("span", { className: "text-ds-sm text-surface-fg-subtle", children: t == null ? void 0 : t.desc }),
328
+ /* @__PURE__ */ e(ie, { className: "h-ico-sm w-ico-sm text-surface-fg-subtle" })
316
329
  ]
317
330
  }
318
331
  ) }),
319
- /* @__PURE__ */ e(oe, { align: "start", className: "w-64", children: c.map((p) => /* @__PURE__ */ e(
320
- me,
332
+ /* @__PURE__ */ e(me, { align: "start", className: "w-72", children: o.map((i) => /* @__PURE__ */ e(
333
+ fe,
321
334
  {
322
- onClick: () => N == null ? void 0 : N(p.id),
323
- className: u === p.id ? "bg-surface-raised-hover" : "",
324
- children: /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
325
- /* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg", children: p.name }),
326
- /* @__PURE__ */ e("span", { className: "text-ds-sm text-surface-fg-subtle", children: p.desc })
335
+ onClick: () => y == null ? void 0 : y(i.id),
336
+ className: f(
337
+ "items-start",
338
+ p === i.id && "bg-surface-raised-hover"
339
+ ),
340
+ children: /* @__PURE__ */ s("div", { className: "flex gap-ds-02b", children: [
341
+ i.icon ? /* @__PURE__ */ e("span", { className: "mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center", children: i.icon }) : /* @__PURE__ */ e("span", { className: "mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-accent-3 text-ds-xs font-semibold text-accent-11", children: i.name.charAt(0) }),
342
+ /* @__PURE__ */ s("div", { className: "flex flex-col gap-ds-01", children: [
343
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-ds-02", children: [
344
+ /* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg", children: i.name }),
345
+ i.status && /* @__PURE__ */ e(
346
+ "span",
347
+ {
348
+ className: f(
349
+ "h-2 w-2 flex-shrink-0 rounded-full",
350
+ i.status === "online" && "bg-success-9",
351
+ i.status === "busy" && "bg-warning-9",
352
+ i.status === "offline" && "bg-surface-fg-subtle"
353
+ ),
354
+ "aria-label": i.status
355
+ }
356
+ )
357
+ ] }),
358
+ /* @__PURE__ */ e("span", { className: "text-ds-sm text-surface-fg-subtle", children: i.desc }),
359
+ i.capabilities && i.capabilities.length > 0 && /* @__PURE__ */ e("div", { className: "mt-ds-01 flex flex-wrap gap-ds-01", children: i.capabilities.map((D) => /* @__PURE__ */ e(
360
+ "span",
361
+ {
362
+ className: "inline-block rounded-ds-md bg-surface-raised-hover px-ds-02 py-px text-ds-xs text-surface-fg-subtle",
363
+ children: D
364
+ },
365
+ D
366
+ )) })
367
+ ] })
327
368
  ] })
328
369
  },
329
- p.id
370
+ i.id
330
371
  )) })
331
372
  ] }) }),
332
373
  /* @__PURE__ */ e(
@@ -337,25 +378,25 @@ const fe = [
337
378
  },
338
379
  className: "flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-lg text-surface-fg-muted transition-colors hover:bg-surface-raised-hover",
339
380
  "aria-label": "New chat",
340
- children: /* @__PURE__ */ e(E, { className: "h-ico-sm w-ico-sm" })
381
+ children: /* @__PURE__ */ e(K, { className: "h-ico-sm w-ico-sm" })
341
382
  }
342
383
  ),
343
384
  /* @__PURE__ */ e(
344
385
  "button",
345
386
  {
346
387
  onClick: () => j(!M),
347
- className: x(
388
+ className: f(
348
389
  "flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-lg transition-colors hover:bg-surface-raised-hover",
349
390
  M ? "bg-surface-raised-hover text-surface-fg" : "text-surface-fg-muted"
350
391
  ),
351
392
  "aria-label": "Conversation history",
352
- children: /* @__PURE__ */ e(ie, { className: "h-ico-sm w-ico-sm" })
393
+ children: /* @__PURE__ */ e(le, { className: "h-ico-sm w-ico-sm" })
353
394
  }
354
395
  ),
355
396
  /* @__PURE__ */ e(
356
397
  "button",
357
398
  {
358
- onClick: () => l(!1),
399
+ onClick: () => n(!1),
359
400
  className: "flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-lg text-surface-fg-muted transition-colors hover:bg-surface-raised-hover",
360
401
  "aria-label": "Close chat",
361
402
  children: /* @__PURE__ */ e(de, { className: "h-ico-sm w-ico-sm" })
@@ -363,36 +404,36 @@ const fe = [
363
404
  )
364
405
  ] }),
365
406
  M ? /* @__PURE__ */ e(
366
- z,
407
+ F,
367
408
  {
368
- conversations: f,
369
- activeConversationId: o,
370
- isLoading: t,
371
- onSelect: (p) => {
372
- I == null || I(p), j(!1);
409
+ conversations: x,
410
+ activeConversationId: u,
411
+ isLoading: l,
412
+ onSelect: (i) => {
413
+ I == null || I(i), j(!1);
373
414
  },
374
415
  onNewChat: () => {
375
416
  r == null || r(), j(!1);
376
417
  },
377
- onArchive: F,
378
- onDelete: G
418
+ onArchive: G,
419
+ onDelete: V
379
420
  }
380
- ) : /* @__PURE__ */ s(X, { children: [
421
+ ) : /* @__PURE__ */ s(Y, { children: [
381
422
  /* @__PURE__ */ e(
382
- K,
423
+ U,
383
424
  {
384
- messages: i,
385
- isStreaming: m,
386
- streamingText: n,
387
- isLoadingMessages: h
425
+ messages: d,
426
+ isStreaming: h,
427
+ streamingText: m,
428
+ isLoadingMessages: b
388
429
  }
389
430
  ),
390
431
  /* @__PURE__ */ e(
391
- U,
432
+ z,
392
433
  {
393
434
  onSubmit: a,
394
- onCancel: y,
395
- isStreaming: m
435
+ onCancel: N,
436
+ isStreaming: h
396
437
  }
397
438
  )
398
439
  ] })
@@ -401,11 +442,11 @@ const fe = [
401
442
  ) });
402
443
  }
403
444
  );
404
- ue.displayName = "ChatPanel";
445
+ he.displayName = "ChatPanel";
405
446
  export {
406
- U as C,
407
- K as M,
408
- H as S,
409
- ue as a,
410
- z as b
447
+ z as C,
448
+ U as M,
449
+ A as S,
450
+ he as a,
451
+ F as b
411
452
  };