@devalok/shilp-sutra-karm 0.17.0 → 0.18.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.
- package/dist/_chunks/chat-panel.js +175 -202
- package/dist/_chunks/kanban-board.js +4 -3
- package/dist/_chunks/markdown-components.js +35 -0
- package/dist/_chunks/render-adjustment-type.js +1 -1
- package/dist/_chunks/sidebar-scratchpad.js +39 -37
- package/dist/_chunks/task-detail-panel.js +68 -68
- package/dist/_chunks/vendor.js +5197 -10406
- package/dist/dashboard/daily-brief.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,157 +1,130 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
4
|
-
import { useRef as R, useEffect as
|
|
5
|
-
import { Sheet as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { jsxs as s, jsx as e, Fragment as X } from "react/jsx-runtime";
|
|
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";
|
|
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.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 le } from "@tabler/icons-react";
|
|
11
13
|
import { Button as D } from "@devalok/shilp-sutra/ui/button";
|
|
12
|
-
import { formatRelativeTime as
|
|
13
|
-
import { DropdownMenu as
|
|
14
|
-
const H =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}) => (t == null ? void 0 : t.includes("language-")) ? /* @__PURE__ */ e("code", { className: t, children: a }) : /* @__PURE__ */ e("code", { className: "rounded bg-surface-3 px-ds-02 py-ds-01 text-ds-md", children: a }),
|
|
20
|
-
pre: ({ children: a }) => /* @__PURE__ */ e("pre", { className: "mb-ds-03 overflow-x-auto rounded-ds-lg bg-surface-3 p-ds-04 text-ds-md", children: a }),
|
|
21
|
-
ul: ({ children: a }) => /* @__PURE__ */ e("ul", { className: "mb-ds-03 list-disc pl-ds-05", children: a }),
|
|
22
|
-
ol: ({ children: a }) => /* @__PURE__ */ e("ol", { className: "mb-ds-03 list-decimal pl-ds-05", children: a }),
|
|
23
|
-
li: ({ children: a }) => /* @__PURE__ */ e("li", { className: "mb-ds-02", children: a }),
|
|
24
|
-
strong: ({ children: a }) => /* @__PURE__ */ e("strong", { className: "font-semibold", children: a }),
|
|
25
|
-
a: ({
|
|
26
|
-
href: a,
|
|
27
|
-
children: t,
|
|
28
|
-
...c
|
|
29
|
-
}) => {
|
|
30
|
-
const d = a && /^(https?:\/\/|mailto:)/i.test(a) ? a : "#";
|
|
31
|
-
return /* @__PURE__ */ e(
|
|
32
|
-
"a",
|
|
33
|
-
{
|
|
34
|
-
href: d,
|
|
35
|
-
target: "_blank",
|
|
36
|
-
rel: "noopener noreferrer",
|
|
37
|
-
className: "text-accent-11 underline hover:text-accent-12",
|
|
38
|
-
...c,
|
|
39
|
-
children: t
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
}, E = k.forwardRef(
|
|
44
|
-
function({ text: t, isComplete: c = !1, className: d, ...u }, n) {
|
|
45
|
-
return /* @__PURE__ */ s("div", { ref: n, className: b(d), ...u, "aria-live": "off", children: [
|
|
46
|
-
/* @__PURE__ */ e(P, { components: H, children: t }),
|
|
47
|
-
!c && /* @__PURE__ */ e("span", { className: "inline-block h-4 w-2 animate-pulse bg-surface-fg-muted ml-ds-01" }),
|
|
14
|
+
import { formatRelativeTime as de } 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: l, isComplete: d = !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: l }),
|
|
20
|
+
!d && /* @__PURE__ */ e("span", { className: "inline-block h-4 w-2 animate-pulse bg-surface-fg-muted ml-ds-01" }),
|
|
48
21
|
/* @__PURE__ */ e(
|
|
49
22
|
"span",
|
|
50
23
|
{
|
|
51
24
|
className: "sr-only",
|
|
52
25
|
"aria-live": "polite",
|
|
53
26
|
"aria-atomic": "true",
|
|
54
|
-
children:
|
|
27
|
+
children: d ? l : ""
|
|
55
28
|
}
|
|
56
29
|
)
|
|
57
30
|
] });
|
|
58
31
|
}
|
|
59
32
|
);
|
|
60
|
-
|
|
61
|
-
const K =
|
|
33
|
+
H.displayName = "StreamingText";
|
|
34
|
+
const K = w.forwardRef(
|
|
62
35
|
function({
|
|
63
|
-
messages:
|
|
64
|
-
isStreaming:
|
|
65
|
-
streamingText:
|
|
66
|
-
isLoadingMessages:
|
|
67
|
-
emptyTitle:
|
|
68
|
-
emptyDescription:
|
|
69
|
-
className:
|
|
70
|
-
...
|
|
71
|
-
},
|
|
72
|
-
const
|
|
73
|
-
return
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
}, [
|
|
36
|
+
messages: l,
|
|
37
|
+
isStreaming: d = !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;
|
|
48
|
+
a && (a.scrollTop = a.scrollHeight);
|
|
49
|
+
}, [l, 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: [
|
|
77
50
|
/* @__PURE__ */ e("div", { className: "h-ds-xs w-ds-xs animate-spin rounded-ds-full border-2 border-surface-border border-t-transparent" }),
|
|
78
51
|
/* @__PURE__ */ e("p", { className: "text-ds-sm text-surface-fg-subtle", children: "Loading messages..." })
|
|
79
|
-
] }) }) :
|
|
52
|
+
] }) }) : l.length === 0 && !d ? /* @__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: [
|
|
80
53
|
/* @__PURE__ */ e("div", { className: "flex h-ds-lg w-ds-lg items-center justify-center rounded-ds-full bg-surface-3", children: /* @__PURE__ */ e(C, { className: "h-ico-lg w-ico-lg text-surface-fg-muted" }) }),
|
|
81
|
-
/* @__PURE__ */ e("h3", { className: "text-ds-base text-surface-fg", children:
|
|
82
|
-
/* @__PURE__ */ e("p", { className: "text-ds-sm max-w-[280px] text-surface-fg-subtle", children:
|
|
83
|
-
] }) }) : /* @__PURE__ */ e("div", { ref:
|
|
84
|
-
|
|
85
|
-
|
|
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
|
+
l.map((a) => a.role === "SYSTEM" ? /* @__PURE__ */ e(
|
|
58
|
+
g.div,
|
|
86
59
|
{
|
|
87
60
|
initial: { opacity: 0, y: 10 },
|
|
88
61
|
animate: { opacity: 1, y: 0 },
|
|
89
|
-
transition:
|
|
62
|
+
transition: v.snappy,
|
|
90
63
|
className: "flex justify-center",
|
|
91
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: [
|
|
92
65
|
/* @__PURE__ */ e($, { className: "h-ico-sm w-ico-sm shrink-0 text-error-11" }),
|
|
93
|
-
/* @__PURE__ */ e("p", { className: "text-ds-sm text-error-11", children:
|
|
66
|
+
/* @__PURE__ */ e("p", { className: "text-ds-sm text-error-11", children: a.content })
|
|
94
67
|
] })
|
|
95
68
|
},
|
|
96
|
-
|
|
97
|
-
) :
|
|
98
|
-
|
|
69
|
+
a.id
|
|
70
|
+
) : a.role === "USER" ? /* @__PURE__ */ e(
|
|
71
|
+
g.div,
|
|
99
72
|
{
|
|
100
73
|
initial: { opacity: 0, y: 10 },
|
|
101
74
|
animate: { opacity: 1, y: 0 },
|
|
102
|
-
transition:
|
|
75
|
+
transition: v.snappy,
|
|
103
76
|
className: "flex justify-end",
|
|
104
77
|
children: /* @__PURE__ */ s("div", { className: "flex max-w-[85%] items-start gap-ds-03", children: [
|
|
105
|
-
/* @__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:
|
|
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 }) }),
|
|
106
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-3", children: /* @__PURE__ */ e(O, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }) })
|
|
107
80
|
] })
|
|
108
81
|
},
|
|
109
|
-
|
|
82
|
+
a.id
|
|
110
83
|
) : /* @__PURE__ */ e(
|
|
111
|
-
|
|
84
|
+
g.div,
|
|
112
85
|
{
|
|
113
86
|
initial: { opacity: 0, y: 10 },
|
|
114
87
|
animate: { opacity: 1, y: 0 },
|
|
115
|
-
transition:
|
|
88
|
+
transition: v.snappy,
|
|
116
89
|
className: "flex justify-start",
|
|
117
90
|
children: /* @__PURE__ */ s("div", { className: "flex max-w-[85%] items-start gap-ds-03", children: [
|
|
118
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-3", children: /* @__PURE__ */ e(C, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }) }),
|
|
119
|
-
/* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-bl-ds-sm bg-surface-3 px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-md text-surface-fg", children: /* @__PURE__ */ e(
|
|
92
|
+
/* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-bl-ds-sm bg-surface-3 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 }) }) })
|
|
120
93
|
] })
|
|
121
94
|
},
|
|
122
|
-
|
|
95
|
+
a.id
|
|
123
96
|
)),
|
|
124
|
-
|
|
125
|
-
|
|
97
|
+
d && i && /* @__PURE__ */ e(
|
|
98
|
+
g.div,
|
|
126
99
|
{
|
|
127
100
|
initial: { opacity: 0, y: 10 },
|
|
128
101
|
animate: { opacity: 1, y: 0 },
|
|
129
|
-
transition:
|
|
102
|
+
transition: v.snappy,
|
|
130
103
|
className: "flex justify-start",
|
|
131
104
|
children: /* @__PURE__ */ s("div", { className: "flex max-w-[85%] items-start gap-ds-03", children: [
|
|
132
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-3", children: /* @__PURE__ */ e(C, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }) }),
|
|
133
|
-
/* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-bl-ds-sm bg-surface-3 px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-md text-surface-fg", children: /* @__PURE__ */ e(
|
|
106
|
+
/* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-bl-ds-sm bg-surface-3 px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-md text-surface-fg", children: /* @__PURE__ */ e(H, { text: i }) }) })
|
|
134
107
|
] })
|
|
135
108
|
},
|
|
136
109
|
"streaming-text"
|
|
137
110
|
),
|
|
138
|
-
|
|
139
|
-
|
|
111
|
+
d && !i && /* @__PURE__ */ e(
|
|
112
|
+
g.div,
|
|
140
113
|
{
|
|
141
114
|
initial: { opacity: 0, y: 10 },
|
|
142
115
|
animate: { opacity: 1, y: 0 },
|
|
143
|
-
transition:
|
|
116
|
+
transition: v.snappy,
|
|
144
117
|
className: "flex justify-start",
|
|
145
118
|
children: /* @__PURE__ */ s("div", { className: "flex max-w-[85%] items-start gap-ds-03", children: [
|
|
146
119
|
/* @__PURE__ */ e("div", { className: "flex h-ds-xs-plus w-ds-xs-plus shrink-0 items-center justify-center rounded-ds-full bg-surface-3", children: /* @__PURE__ */ e(C, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }) }),
|
|
147
|
-
/* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-bl-ds-sm bg-surface-3 px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-ds-02b py-ds-02", children: [0, 1, 2].map((
|
|
148
|
-
|
|
120
|
+
/* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-bl-ds-sm bg-surface-3 px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-ds-02b py-ds-02", children: [0, 1, 2].map((a) => /* @__PURE__ */ e(
|
|
121
|
+
g.span,
|
|
149
122
|
{
|
|
150
123
|
className: "h-2 w-2 rounded-ds-full bg-surface-fg-subtle",
|
|
151
124
|
animate: { y: [0, -4, 0] },
|
|
152
|
-
transition: { duration: 0.6, repeat: 1 / 0, delay:
|
|
125
|
+
transition: { duration: 0.6, repeat: 1 / 0, delay: a * 0.15 }
|
|
153
126
|
},
|
|
154
|
-
|
|
127
|
+
a
|
|
155
128
|
)) }) })
|
|
156
129
|
] })
|
|
157
130
|
},
|
|
@@ -161,119 +134,119 @@ const K = k.forwardRef(
|
|
|
161
134
|
}
|
|
162
135
|
);
|
|
163
136
|
K.displayName = "MessageList";
|
|
164
|
-
const U =
|
|
137
|
+
const U = w.forwardRef(
|
|
165
138
|
function({
|
|
166
|
-
onSubmit:
|
|
167
|
-
onCancel:
|
|
168
|
-
isStreaming:
|
|
169
|
-
placeholder:
|
|
170
|
-
disclaimer:
|
|
171
|
-
className:
|
|
172
|
-
...
|
|
173
|
-
},
|
|
174
|
-
const [
|
|
175
|
-
const
|
|
176
|
-
|
|
139
|
+
onSubmit: l,
|
|
140
|
+
onCancel: d,
|
|
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;
|
|
149
|
+
r && (r.style.height = "auto", r.style.height = Math.min(r.scrollHeight, 160) + "px");
|
|
177
150
|
}, []), y = T(() => {
|
|
178
|
-
const
|
|
179
|
-
!
|
|
180
|
-
}, [
|
|
181
|
-
(
|
|
182
|
-
|
|
151
|
+
const r = n.trim();
|
|
152
|
+
!r || i || (h(""), t.current && (t.current.style.height = "auto"), l(r));
|
|
153
|
+
}, [n, i, l]), N = T(
|
|
154
|
+
(r) => {
|
|
155
|
+
r.key === "Enter" && !r.shiftKey && (r.preventDefault(), y());
|
|
183
156
|
},
|
|
184
157
|
[y]
|
|
185
158
|
);
|
|
186
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
159
|
+
return /* @__PURE__ */ s("div", { ref: m, className: x("border-t border-surface-border-strong bg-surface-1 p-ds-04", u), ...o, children: [
|
|
187
160
|
/* @__PURE__ */ s("div", { className: "flex items-end gap-ds-03 rounded-ds-xl border border-surface-border-strong bg-surface-3 px-ds-04 py-ds-03", children: [
|
|
188
161
|
/* @__PURE__ */ e(
|
|
189
162
|
"textarea",
|
|
190
163
|
{
|
|
191
|
-
ref:
|
|
192
|
-
value:
|
|
193
|
-
onChange: (
|
|
194
|
-
|
|
164
|
+
ref: t,
|
|
165
|
+
value: n,
|
|
166
|
+
onChange: (r) => {
|
|
167
|
+
h(r.target.value), a();
|
|
195
168
|
},
|
|
196
|
-
onKeyDown:
|
|
197
|
-
placeholder:
|
|
169
|
+
onKeyDown: N,
|
|
170
|
+
placeholder: f,
|
|
198
171
|
"aria-label": "Type a message",
|
|
199
|
-
disabled:
|
|
172
|
+
disabled: i,
|
|
200
173
|
rows: 1,
|
|
201
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"
|
|
202
175
|
}
|
|
203
176
|
),
|
|
204
|
-
|
|
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: d, "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" }) })
|
|
205
178
|
] }),
|
|
206
|
-
|
|
179
|
+
c && /* @__PURE__ */ e("p", { className: "text-ds-sm mt-ds-02b text-center text-surface-fg-subtle", children: c })
|
|
207
180
|
] });
|
|
208
181
|
}
|
|
209
182
|
);
|
|
210
183
|
U.displayName = "ChatInput";
|
|
211
|
-
const z =
|
|
184
|
+
const z = w.forwardRef(
|
|
212
185
|
function({
|
|
213
|
-
conversations:
|
|
214
|
-
activeConversationId:
|
|
215
|
-
isLoading:
|
|
216
|
-
onSelect:
|
|
217
|
-
onNewChat:
|
|
218
|
-
onArchive:
|
|
219
|
-
onDelete:
|
|
220
|
-
className:
|
|
221
|
-
...
|
|
222
|
-
},
|
|
223
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
186
|
+
conversations: l,
|
|
187
|
+
activeConversationId: d,
|
|
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: [
|
|
224
197
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between border-b border-surface-border-strong px-ds-05 py-ds-04", children: [
|
|
225
198
|
/* @__PURE__ */ e("h3", { className: "text-ds-md font-semibold text-surface-fg", children: "Conversations" }),
|
|
226
199
|
/* @__PURE__ */ s(
|
|
227
200
|
"button",
|
|
228
201
|
{
|
|
229
|
-
onClick:
|
|
202
|
+
onClick: c,
|
|
230
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-2",
|
|
231
204
|
children: [
|
|
232
|
-
/* @__PURE__ */ e(
|
|
205
|
+
/* @__PURE__ */ e(E, { className: "h-ico-sm w-ico-sm" }),
|
|
233
206
|
/* @__PURE__ */ e("span", { className: "text-ds-sm", children: "New Chat" })
|
|
234
207
|
]
|
|
235
208
|
}
|
|
236
209
|
)
|
|
237
210
|
] }),
|
|
238
|
-
/* @__PURE__ */ e("div", { className: "no-scrollbar flex-1 overflow-y-auto", children:
|
|
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" }) }) : l.length === 0 ? /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center gap-ds-03 py-12", children: [
|
|
239
212
|
/* @__PURE__ */ e(se, { className: "h-ds-sm w-ds-sm text-surface-fg-subtle" }),
|
|
240
213
|
/* @__PURE__ */ e("p", { className: "text-ds-md text-surface-fg-subtle", children: "No conversations yet" })
|
|
241
|
-
] }) : /* @__PURE__ */ e("div", { className: "flex flex-col", children:
|
|
214
|
+
] }) : /* @__PURE__ */ e("div", { className: "flex flex-col", children: l.map((t) => /* @__PURE__ */ s(
|
|
242
215
|
"div",
|
|
243
216
|
{
|
|
244
|
-
className:
|
|
217
|
+
className: x(
|
|
245
218
|
"group flex items-center gap-ds-04 border-b border-surface-border px-ds-05 py-ds-04 transition-colors hover:bg-surface-2",
|
|
246
|
-
|
|
219
|
+
d === t.id && "bg-surface-2"
|
|
247
220
|
),
|
|
248
221
|
children: [
|
|
249
222
|
/* @__PURE__ */ s(
|
|
250
223
|
"button",
|
|
251
224
|
{
|
|
252
|
-
onClick: () =>
|
|
225
|
+
onClick: () => f(t.id),
|
|
253
226
|
className: "flex min-w-0 flex-1 flex-col gap-ds-01 text-left",
|
|
254
227
|
children: [
|
|
255
|
-
/* @__PURE__ */ e("p", { className: "text-ds-md truncate text-surface-fg", children:
|
|
256
|
-
/* @__PURE__ */ e("p", { className: "text-ds-sm text-surface-fg-subtle", 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: de(t.updatedAt) })
|
|
257
230
|
]
|
|
258
231
|
}
|
|
259
232
|
),
|
|
260
233
|
/* @__PURE__ */ s("div", { className: "flex shrink-0 items-center gap-ds-02 opacity-0 transition-opacity group-hover:opacity-100", children: [
|
|
261
|
-
|
|
234
|
+
u && /* @__PURE__ */ e(
|
|
262
235
|
"button",
|
|
263
236
|
{
|
|
264
|
-
onClick: (
|
|
265
|
-
|
|
237
|
+
onClick: (a) => {
|
|
238
|
+
a.stopPropagation(), u(t.id);
|
|
266
239
|
},
|
|
267
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-3 hover:text-surface-fg-muted",
|
|
268
241
|
"aria-label": "Archive conversation",
|
|
269
242
|
children: /* @__PURE__ */ e(ae, { className: "h-ico-sm w-ico-sm" })
|
|
270
243
|
}
|
|
271
244
|
),
|
|
272
|
-
|
|
245
|
+
o && /* @__PURE__ */ e(
|
|
273
246
|
"button",
|
|
274
247
|
{
|
|
275
|
-
onClick: (
|
|
276
|
-
|
|
248
|
+
onClick: (a) => {
|
|
249
|
+
a.stopPropagation(), o(t.id);
|
|
277
250
|
},
|
|
278
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",
|
|
279
252
|
"aria-label": "Delete conversation",
|
|
@@ -283,7 +256,7 @@ const z = k.forwardRef(
|
|
|
283
256
|
] })
|
|
284
257
|
]
|
|
285
258
|
},
|
|
286
|
-
|
|
259
|
+
t.id
|
|
287
260
|
)) }) })
|
|
288
261
|
] });
|
|
289
262
|
}
|
|
@@ -297,129 +270,129 @@ const fe = [
|
|
|
297
270
|
{ id: "vidwan", name: "Vidwan", desc: "Knowledge Expert" },
|
|
298
271
|
{ id: "sanchalak", name: "Sanchalak", desc: "Manager Advisor" },
|
|
299
272
|
{ id: "dwar-palak", name: "Dwar-Palak", desc: "Access Control" }
|
|
300
|
-
], ue =
|
|
273
|
+
], ue = w.forwardRef(
|
|
301
274
|
function({
|
|
302
|
-
isOpen:
|
|
303
|
-
onOpenChange:
|
|
304
|
-
messages:
|
|
305
|
-
conversations:
|
|
306
|
-
agents:
|
|
307
|
-
selectedAgentId:
|
|
308
|
-
activeConversationId:
|
|
309
|
-
isStreaming:
|
|
310
|
-
streamingText:
|
|
311
|
-
isLoadingMessages:
|
|
312
|
-
isLoadingConversations:
|
|
313
|
-
onSendMessage:
|
|
275
|
+
isOpen: l,
|
|
276
|
+
onOpenChange: d,
|
|
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,
|
|
286
|
+
onSendMessage: a,
|
|
314
287
|
onCancelStream: y,
|
|
315
|
-
onSelectAgent:
|
|
316
|
-
onStartNewChat:
|
|
288
|
+
onSelectAgent: N,
|
|
289
|
+
onStartNewChat: r,
|
|
317
290
|
onSelectConversation: I,
|
|
318
|
-
onArchiveConversation:
|
|
319
|
-
onDeleteConversation:
|
|
320
|
-
className:
|
|
321
|
-
...
|
|
322
|
-
},
|
|
323
|
-
const [M, j] =
|
|
324
|
-
return /* @__PURE__ */ e(
|
|
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: l, onOpenChange: d, children: /* @__PURE__ */ s(
|
|
325
298
|
J,
|
|
326
299
|
{
|
|
327
|
-
ref:
|
|
300
|
+
ref: B,
|
|
328
301
|
side: "right",
|
|
329
|
-
className:
|
|
330
|
-
...
|
|
302
|
+
className: x("flex w-full flex-col gap-0 border-l border-surface-border-strong bg-surface-1 p-0 sm:max-w-[480px] [&>button]:hidden", V),
|
|
303
|
+
...q,
|
|
331
304
|
children: [
|
|
332
305
|
/* @__PURE__ */ e(Q, { className: "sr-only", children: "AI Chat" }),
|
|
333
306
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03 border-b border-surface-border-strong px-ds-05 py-ds-04", children: [
|
|
334
|
-
/* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ s(
|
|
307
|
+
/* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ s(ce, { children: [
|
|
335
308
|
/* @__PURE__ */ e(ne, { asChild: !0, children: /* @__PURE__ */ s(
|
|
336
309
|
"button",
|
|
337
310
|
{
|
|
338
311
|
className: "flex items-center gap-ds-02b rounded-ds-lg px-ds-03 py-ds-02b transition-colors hover:bg-surface-2",
|
|
339
312
|
children: [
|
|
340
|
-
/* @__PURE__ */ e("span", { className: "text-ds-base text-surface-fg", children:
|
|
341
|
-
/* @__PURE__ */ e("span", { className: "text-ds-sm text-surface-fg-subtle", 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 }),
|
|
342
315
|
/* @__PURE__ */ e(te, { className: "h-ico-sm w-ico-sm text-surface-fg-subtle" })
|
|
343
316
|
]
|
|
344
317
|
}
|
|
345
318
|
) }),
|
|
346
|
-
/* @__PURE__ */ e(oe, { align: "start", className: "w-64", children:
|
|
319
|
+
/* @__PURE__ */ e(oe, { align: "start", className: "w-64", children: c.map((p) => /* @__PURE__ */ e(
|
|
347
320
|
me,
|
|
348
321
|
{
|
|
349
|
-
onClick: () =>
|
|
350
|
-
className:
|
|
322
|
+
onClick: () => N == null ? void 0 : N(p.id),
|
|
323
|
+
className: u === p.id ? "bg-surface-2" : "",
|
|
351
324
|
children: /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
|
|
352
|
-
/* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg", children:
|
|
353
|
-
/* @__PURE__ */ e("span", { className: "text-ds-sm text-surface-fg-subtle", 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 })
|
|
354
327
|
] })
|
|
355
328
|
},
|
|
356
|
-
|
|
329
|
+
p.id
|
|
357
330
|
)) })
|
|
358
331
|
] }) }),
|
|
359
332
|
/* @__PURE__ */ e(
|
|
360
333
|
"button",
|
|
361
334
|
{
|
|
362
335
|
onClick: () => {
|
|
363
|
-
|
|
336
|
+
r == null || r(), j(!1);
|
|
364
337
|
},
|
|
365
338
|
className: "flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-lg text-surface-fg-muted transition-colors hover:bg-surface-2",
|
|
366
339
|
"aria-label": "New chat",
|
|
367
|
-
children: /* @__PURE__ */ e(
|
|
340
|
+
children: /* @__PURE__ */ e(E, { className: "h-ico-sm w-ico-sm" })
|
|
368
341
|
}
|
|
369
342
|
),
|
|
370
343
|
/* @__PURE__ */ e(
|
|
371
344
|
"button",
|
|
372
345
|
{
|
|
373
346
|
onClick: () => j(!M),
|
|
374
|
-
className:
|
|
347
|
+
className: x(
|
|
375
348
|
"flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-lg transition-colors hover:bg-surface-2",
|
|
376
349
|
M ? "bg-surface-2 text-surface-fg" : "text-surface-fg-muted"
|
|
377
350
|
),
|
|
378
351
|
"aria-label": "Conversation history",
|
|
379
|
-
children: /* @__PURE__ */ e(
|
|
352
|
+
children: /* @__PURE__ */ e(ie, { className: "h-ico-sm w-ico-sm" })
|
|
380
353
|
}
|
|
381
354
|
),
|
|
382
355
|
/* @__PURE__ */ e(
|
|
383
356
|
"button",
|
|
384
357
|
{
|
|
385
|
-
onClick: () =>
|
|
358
|
+
onClick: () => d(!1),
|
|
386
359
|
className: "flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-lg text-surface-fg-muted transition-colors hover:bg-surface-2",
|
|
387
360
|
"aria-label": "Close chat",
|
|
388
|
-
children: /* @__PURE__ */ e(
|
|
361
|
+
children: /* @__PURE__ */ e(le, { className: "h-ico-sm w-ico-sm" })
|
|
389
362
|
}
|
|
390
363
|
)
|
|
391
364
|
] }),
|
|
392
365
|
M ? /* @__PURE__ */ e(
|
|
393
366
|
z,
|
|
394
367
|
{
|
|
395
|
-
conversations:
|
|
396
|
-
activeConversationId:
|
|
397
|
-
isLoading:
|
|
398
|
-
onSelect: (
|
|
399
|
-
I == null || I(
|
|
368
|
+
conversations: f,
|
|
369
|
+
activeConversationId: o,
|
|
370
|
+
isLoading: t,
|
|
371
|
+
onSelect: (p) => {
|
|
372
|
+
I == null || I(p), j(!1);
|
|
400
373
|
},
|
|
401
374
|
onNewChat: () => {
|
|
402
|
-
|
|
375
|
+
r == null || r(), j(!1);
|
|
403
376
|
},
|
|
404
|
-
onArchive:
|
|
405
|
-
onDelete:
|
|
377
|
+
onArchive: F,
|
|
378
|
+
onDelete: G
|
|
406
379
|
}
|
|
407
|
-
) : /* @__PURE__ */ s(
|
|
380
|
+
) : /* @__PURE__ */ s(X, { children: [
|
|
408
381
|
/* @__PURE__ */ e(
|
|
409
382
|
K,
|
|
410
383
|
{
|
|
411
|
-
messages:
|
|
412
|
-
isStreaming:
|
|
413
|
-
streamingText:
|
|
414
|
-
isLoadingMessages:
|
|
384
|
+
messages: i,
|
|
385
|
+
isStreaming: m,
|
|
386
|
+
streamingText: n,
|
|
387
|
+
isLoadingMessages: h
|
|
415
388
|
}
|
|
416
389
|
),
|
|
417
390
|
/* @__PURE__ */ e(
|
|
418
391
|
U,
|
|
419
392
|
{
|
|
420
|
-
onSubmit:
|
|
393
|
+
onSubmit: a,
|
|
421
394
|
onCancel: y,
|
|
422
|
-
isStreaming:
|
|
395
|
+
isStreaming: m
|
|
423
396
|
}
|
|
424
397
|
)
|
|
425
398
|
] })
|
|
@@ -432,7 +405,7 @@ ue.displayName = "ChatPanel";
|
|
|
432
405
|
export {
|
|
433
406
|
U as C,
|
|
434
407
|
K as M,
|
|
435
|
-
|
|
408
|
+
H as S,
|
|
436
409
|
ue as a,
|
|
437
410
|
z as b
|
|
438
411
|
};
|