@devalok/shilp-sutra-karm 0.21.1 → 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.
- package/dist/_chunks/chat-panel.js +210 -169
- package/dist/_chunks/kanban-board.js +958 -862
- package/dist/_chunks/registry.js +131 -0
- package/dist/ai-blocks/announcement-preview.d.ts +15 -0
- package/dist/ai-blocks/announcement-preview.d.ts.map +1 -0
- package/dist/ai-blocks/index.d.ts +7 -0
- package/dist/ai-blocks/index.d.ts.map +1 -0
- package/dist/ai-blocks/index.js +9 -0
- package/dist/ai-blocks/member-diff.d.ts +17 -0
- package/dist/ai-blocks/member-diff.d.ts.map +1 -0
- package/dist/ai-blocks/member-list.d.ts +17 -0
- package/dist/ai-blocks/member-list.d.ts.map +1 -0
- package/dist/ai-blocks/project-list.d.ts +17 -0
- package/dist/ai-blocks/project-list.d.ts.map +1 -0
- package/dist/ai-blocks/registry.d.ts +12 -0
- package/dist/ai-blocks/registry.d.ts.map +1 -0
- package/dist/board/board-column.d.ts.map +1 -1
- package/dist/board/board-context.d.ts +17 -1
- package/dist/board/board-context.d.ts.map +1 -1
- package/dist/board/column-header.d.ts.map +1 -1
- package/dist/board/kanban-board.d.ts.map +1 -1
- package/dist/chat/chat-panel.d.ts +6 -0
- package/dist/chat/chat-panel.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -36
- package/package.json +87 -82
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as s, jsx as e, Fragment as
|
|
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
|
|
5
|
-
import { Sheet as
|
|
6
|
-
import { AnimatePresence as
|
|
7
|
-
import { cn as
|
|
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
|
|
10
|
-
import { m as
|
|
11
|
-
import { M as
|
|
12
|
-
import { IconRobot as C, IconAlertCircle as
|
|
13
|
-
import { Button as
|
|
14
|
-
import { formatRelativeTime as
|
|
15
|
-
import { DropdownMenu as
|
|
16
|
-
const
|
|
17
|
-
function({ text:
|
|
18
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
19
|
-
/* @__PURE__ */ e(
|
|
20
|
-
!
|
|
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:
|
|
27
|
+
children: n ? c : ""
|
|
28
28
|
}
|
|
29
29
|
)
|
|
30
30
|
] });
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
|
-
|
|
34
|
-
const
|
|
33
|
+
A.displayName = "StreamingText";
|
|
34
|
+
const U = w.forwardRef(
|
|
35
35
|
function({
|
|
36
|
-
messages:
|
|
37
|
-
isStreaming:
|
|
38
|
-
streamingText:
|
|
39
|
-
isLoadingMessages:
|
|
40
|
-
emptyTitle:
|
|
41
|
-
emptyDescription:
|
|
42
|
-
className:
|
|
43
|
-
...
|
|
44
|
-
},
|
|
45
|
-
const
|
|
46
|
-
return
|
|
47
|
-
const a =
|
|
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
|
-
}, [
|
|
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
|
-
] }) }) :
|
|
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:
|
|
55
|
-
/* @__PURE__ */ e("p", { className: "text-ds-sm max-w-[280px] text-surface-fg-subtle", children:
|
|
56
|
-
] }) }) : /* @__PURE__ */ e("div", { ref:
|
|
57
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
137
|
-
const
|
|
136
|
+
U.displayName = "MessageList";
|
|
137
|
+
const z = w.forwardRef(
|
|
138
138
|
function({
|
|
139
|
-
onSubmit:
|
|
140
|
-
onCancel:
|
|
141
|
-
isStreaming:
|
|
142
|
-
placeholder:
|
|
143
|
-
disclaimer:
|
|
144
|
-
className:
|
|
145
|
-
...
|
|
146
|
-
},
|
|
147
|
-
const [
|
|
148
|
-
const r =
|
|
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
|
-
}, []),
|
|
151
|
-
const r =
|
|
152
|
-
!r ||
|
|
153
|
-
}, [
|
|
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(),
|
|
155
|
+
r.key === "Enter" && !r.shiftKey && (r.preventDefault(), N());
|
|
156
156
|
},
|
|
157
|
-
[
|
|
157
|
+
[N]
|
|
158
158
|
);
|
|
159
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
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:
|
|
165
|
-
value:
|
|
164
|
+
ref: l,
|
|
165
|
+
value: m,
|
|
166
166
|
onChange: (r) => {
|
|
167
|
-
|
|
167
|
+
b(r.target.value), a();
|
|
168
168
|
},
|
|
169
|
-
onKeyDown:
|
|
170
|
-
placeholder:
|
|
169
|
+
onKeyDown: y,
|
|
170
|
+
placeholder: x,
|
|
171
171
|
"aria-label": "Type a message",
|
|
172
|
-
disabled:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
184
|
-
const
|
|
183
|
+
z.displayName = "ChatInput";
|
|
184
|
+
const F = w.forwardRef(
|
|
185
185
|
function({
|
|
186
|
-
conversations:
|
|
187
|
-
activeConversationId:
|
|
188
|
-
isLoading:
|
|
189
|
-
onSelect:
|
|
190
|
-
onNewChat:
|
|
191
|
-
onArchive:
|
|
192
|
-
onDelete:
|
|
193
|
-
className:
|
|
194
|
-
...
|
|
195
|
-
},
|
|
196
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
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:
|
|
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(
|
|
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:
|
|
212
|
-
/* @__PURE__ */ e(
|
|
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:
|
|
214
|
+
] }) : /* @__PURE__ */ e("div", { className: "flex flex-col", children: c.map((l) => /* @__PURE__ */ s(
|
|
215
215
|
"div",
|
|
216
216
|
{
|
|
217
|
-
className:
|
|
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
|
-
|
|
219
|
+
n === l.id && "bg-surface-raised-hover"
|
|
220
220
|
),
|
|
221
221
|
children: [
|
|
222
222
|
/* @__PURE__ */ s(
|
|
223
223
|
"button",
|
|
224
224
|
{
|
|
225
|
-
onClick: () =>
|
|
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:
|
|
229
|
-
/* @__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: 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
|
-
|
|
234
|
+
p && /* @__PURE__ */ e(
|
|
235
235
|
"button",
|
|
236
236
|
{
|
|
237
237
|
onClick: (a) => {
|
|
238
|
-
a.stopPropagation(),
|
|
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(
|
|
242
|
+
children: /* @__PURE__ */ e(re, { className: "h-ico-sm w-ico-sm" })
|
|
243
243
|
}
|
|
244
244
|
),
|
|
245
|
-
|
|
245
|
+
u && /* @__PURE__ */ e(
|
|
246
246
|
"button",
|
|
247
247
|
{
|
|
248
248
|
onClick: (a) => {
|
|
249
|
-
a.stopPropagation(),
|
|
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(
|
|
253
|
+
children: /* @__PURE__ */ e(te, { className: "h-ico-sm w-ico-sm" })
|
|
254
254
|
}
|
|
255
255
|
)
|
|
256
256
|
] })
|
|
257
257
|
]
|
|
258
258
|
},
|
|
259
|
-
|
|
259
|
+
l.id
|
|
260
260
|
)) }) })
|
|
261
261
|
] });
|
|
262
262
|
}
|
|
263
263
|
);
|
|
264
|
-
|
|
265
|
-
const
|
|
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
|
-
],
|
|
273
|
+
], he = w.forwardRef(
|
|
274
274
|
function({
|
|
275
|
-
isOpen:
|
|
276
|
-
onOpenChange:
|
|
277
|
-
messages:
|
|
278
|
-
conversations:
|
|
279
|
-
agents:
|
|
280
|
-
selectedAgentId:
|
|
281
|
-
activeConversationId:
|
|
282
|
-
isStreaming:
|
|
283
|
-
streamingText:
|
|
284
|
-
isLoadingMessages:
|
|
285
|
-
isLoadingConversations:
|
|
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:
|
|
288
|
-
onSelectAgent:
|
|
287
|
+
onCancelStream: N,
|
|
288
|
+
onSelectAgent: y,
|
|
289
289
|
onStartNewChat: r,
|
|
290
290
|
onSelectConversation: I,
|
|
291
|
-
onArchiveConversation:
|
|
292
|
-
onDeleteConversation:
|
|
293
|
-
className:
|
|
294
|
-
...
|
|
295
|
-
},
|
|
296
|
-
const [M, j] =
|
|
297
|
-
return /* @__PURE__ */ e(
|
|
298
|
-
|
|
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:
|
|
300
|
+
ref: X,
|
|
301
301
|
side: "right",
|
|
302
|
-
className:
|
|
303
|
-
...
|
|
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(
|
|
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(
|
|
308
|
-
/* @__PURE__ */ e(
|
|
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-
|
|
314
|
-
|
|
315
|
-
|
|
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(
|
|
320
|
-
|
|
332
|
+
/* @__PURE__ */ e(me, { align: "start", className: "w-72", children: o.map((i) => /* @__PURE__ */ e(
|
|
333
|
+
fe,
|
|
321
334
|
{
|
|
322
|
-
onClick: () =>
|
|
323
|
-
className:
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
-
|
|
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(
|
|
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:
|
|
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(
|
|
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: () =>
|
|
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
|
-
|
|
407
|
+
F,
|
|
367
408
|
{
|
|
368
|
-
conversations:
|
|
369
|
-
activeConversationId:
|
|
370
|
-
isLoading:
|
|
371
|
-
onSelect: (
|
|
372
|
-
I == null || I(
|
|
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:
|
|
378
|
-
onDelete:
|
|
418
|
+
onArchive: G,
|
|
419
|
+
onDelete: V
|
|
379
420
|
}
|
|
380
|
-
) : /* @__PURE__ */ s(
|
|
421
|
+
) : /* @__PURE__ */ s(Y, { children: [
|
|
381
422
|
/* @__PURE__ */ e(
|
|
382
|
-
|
|
423
|
+
U,
|
|
383
424
|
{
|
|
384
|
-
messages:
|
|
385
|
-
isStreaming:
|
|
386
|
-
streamingText:
|
|
387
|
-
isLoadingMessages:
|
|
425
|
+
messages: d,
|
|
426
|
+
isStreaming: h,
|
|
427
|
+
streamingText: m,
|
|
428
|
+
isLoadingMessages: b
|
|
388
429
|
}
|
|
389
430
|
),
|
|
390
431
|
/* @__PURE__ */ e(
|
|
391
|
-
|
|
432
|
+
z,
|
|
392
433
|
{
|
|
393
434
|
onSubmit: a,
|
|
394
|
-
onCancel:
|
|
395
|
-
isStreaming:
|
|
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
|
-
|
|
445
|
+
he.displayName = "ChatPanel";
|
|
405
446
|
export {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
447
|
+
z as C,
|
|
448
|
+
U as M,
|
|
449
|
+
A as S,
|
|
450
|
+
he as a,
|
|
451
|
+
F as b
|
|
411
452
|
};
|