@optilogic/chat 1.3.4 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +59 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +90 -1
- package/dist/index.d.ts +90 -1
- package/dist/index.js +59 -15
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/agent-response/AgentResponse.tsx +63 -1
- package/src/components/agent-response/components/ActionBar.tsx +18 -3
- package/src/components/agent-response/components/ActivityIndicators.tsx +27 -1
- package/src/components/agent-response/components/HITLSection.tsx +1 -1
- package/src/components/agent-response/components/MetadataRow.tsx +21 -1
- package/src/components/agent-response/components/ThinkingSection.tsx +1 -1
- package/src/components/agent-response/index.ts +5 -1
- package/src/components/agent-timeline/AgentTimeline.tsx +3 -3
- package/src/components/agent-timeline/TimelineAgentBlock.tsx +1 -1
- package/src/components/user-prompt-input/UserPromptInput.tsx +3 -0
- package/src/components/user-prompt-input/types.ts +13 -0
- package/src/index.ts +2 -0
package/dist/index.cjs
CHANGED
|
@@ -28,7 +28,18 @@ var React11__namespace = /*#__PURE__*/_interopNamespace(React11);
|
|
|
28
28
|
|
|
29
29
|
// src/components/agent-response/AgentResponse.tsx
|
|
30
30
|
var ActivityIndicators = React11__namespace.forwardRef(
|
|
31
|
-
({
|
|
31
|
+
({
|
|
32
|
+
toolCalls,
|
|
33
|
+
knowledge,
|
|
34
|
+
memory,
|
|
35
|
+
statusUpdates = [],
|
|
36
|
+
statusUpdateAnchor,
|
|
37
|
+
toolCallsAnchor,
|
|
38
|
+
knowledgeAnchor,
|
|
39
|
+
memoryAnchor,
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
}, ref) => {
|
|
32
43
|
const hasAnyActivity = toolCalls.length > 0 || knowledge.length > 0 || memory.length > 0 || statusUpdates.length > 0;
|
|
33
44
|
if (!hasAnyActivity) return null;
|
|
34
45
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: core.cn("flex items-center gap-2", className), ...props, children: [
|
|
@@ -36,6 +47,7 @@ var ActivityIndicators = React11__namespace.forwardRef(
|
|
|
36
47
|
/* @__PURE__ */ jsxRuntime.jsx(core.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
37
48
|
"button",
|
|
38
49
|
{
|
|
50
|
+
"data-tour": statusUpdateAnchor,
|
|
39
51
|
className: "flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors",
|
|
40
52
|
onClick: (e) => e.stopPropagation(),
|
|
41
53
|
children: [
|
|
@@ -56,6 +68,7 @@ var ActivityIndicators = React11__namespace.forwardRef(
|
|
|
56
68
|
/* @__PURE__ */ jsxRuntime.jsx(core.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
57
69
|
"button",
|
|
58
70
|
{
|
|
71
|
+
"data-tour": toolCallsAnchor,
|
|
59
72
|
className: "flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors",
|
|
60
73
|
onClick: (e) => e.stopPropagation(),
|
|
61
74
|
children: [
|
|
@@ -76,6 +89,7 @@ var ActivityIndicators = React11__namespace.forwardRef(
|
|
|
76
89
|
/* @__PURE__ */ jsxRuntime.jsx(core.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
77
90
|
"button",
|
|
78
91
|
{
|
|
92
|
+
"data-tour": knowledgeAnchor,
|
|
79
93
|
className: "flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors",
|
|
80
94
|
onClick: (e) => e.stopPropagation(),
|
|
81
95
|
children: [
|
|
@@ -96,6 +110,7 @@ var ActivityIndicators = React11__namespace.forwardRef(
|
|
|
96
110
|
/* @__PURE__ */ jsxRuntime.jsx(core.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
97
111
|
"button",
|
|
98
112
|
{
|
|
113
|
+
"data-tour": memoryAnchor,
|
|
99
114
|
className: "flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors",
|
|
100
115
|
onClick: (e) => e.stopPropagation(),
|
|
101
116
|
children: [
|
|
@@ -158,6 +173,11 @@ var MetadataRow = React11__namespace.forwardRef(
|
|
|
158
173
|
statusContent,
|
|
159
174
|
status,
|
|
160
175
|
elapsedTime,
|
|
176
|
+
thinkingToggleAnchor,
|
|
177
|
+
statusUpdateAnchor,
|
|
178
|
+
toolCallsAnchor,
|
|
179
|
+
knowledgeAnchor,
|
|
180
|
+
memoryAnchor,
|
|
161
181
|
className,
|
|
162
182
|
...props
|
|
163
183
|
}, ref) => {
|
|
@@ -193,8 +213,9 @@ var MetadataRow = React11__namespace.forwardRef(
|
|
|
193
213
|
hasThinking ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
194
214
|
"button",
|
|
195
215
|
{
|
|
216
|
+
"data-tour": thinkingToggleAnchor,
|
|
196
217
|
onClick: onToggle,
|
|
197
|
-
className: "flex items-center gap-1.5 hover:bg-
|
|
218
|
+
className: "flex items-center gap-1.5 hover:bg-hover -ml-1.5 pl-1.5 pr-2 py-0.5 rounded transition-colors shrink-0",
|
|
198
219
|
children: leftContent
|
|
199
220
|
}
|
|
200
221
|
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 shrink-0", children: leftContent }),
|
|
@@ -205,7 +226,11 @@ var MetadataRow = React11__namespace.forwardRef(
|
|
|
205
226
|
toolCalls,
|
|
206
227
|
knowledge,
|
|
207
228
|
memory,
|
|
208
|
-
statusUpdates
|
|
229
|
+
statusUpdates,
|
|
230
|
+
statusUpdateAnchor,
|
|
231
|
+
toolCallsAnchor,
|
|
232
|
+
knowledgeAnchor,
|
|
233
|
+
memoryAnchor
|
|
209
234
|
}
|
|
210
235
|
)
|
|
211
236
|
]
|
|
@@ -225,7 +250,7 @@ var ThinkingStepItem = ({ step, renderMarkdown }) => {
|
|
|
225
250
|
"button",
|
|
226
251
|
{
|
|
227
252
|
onClick: toggleCollapse,
|
|
228
|
-
className: "w-full flex items-center gap-1.5 py-1.5 px-2 hover:bg-
|
|
253
|
+
className: "w-full flex items-center gap-1.5 py-1.5 px-2 hover:bg-hover transition-colors text-left",
|
|
229
254
|
style: { paddingLeft: `${indentPadding + 8}px` },
|
|
230
255
|
children: [
|
|
231
256
|
isCollapsed ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "w-3 h-3 text-muted-foreground flex-shrink-0" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-3 h-3 text-muted-foreground flex-shrink-0" }),
|
|
@@ -276,6 +301,9 @@ var ActionBar = React11__namespace.forwardRef(
|
|
|
276
301
|
feedback,
|
|
277
302
|
onFeedbackChange,
|
|
278
303
|
onResponseCopy,
|
|
304
|
+
copyAnchor,
|
|
305
|
+
thumbsUpAnchor,
|
|
306
|
+
thumbsDownAnchor,
|
|
279
307
|
className,
|
|
280
308
|
...props
|
|
281
309
|
}, ref) => {
|
|
@@ -316,8 +344,9 @@ var ActionBar = React11__namespace.forwardRef(
|
|
|
316
344
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
317
345
|
"button",
|
|
318
346
|
{
|
|
347
|
+
"data-tour": copyAnchor,
|
|
319
348
|
onClick: handleCopy,
|
|
320
|
-
className: "p-1.5 rounded hover:bg-
|
|
349
|
+
className: "p-1.5 rounded hover:bg-hover transition-colors text-muted-foreground hover:text-foreground",
|
|
321
350
|
title: copied ? "Copied!" : "Copy response",
|
|
322
351
|
children: copied ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "w-4 h-4 text-green-500" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "w-4 h-4" })
|
|
323
352
|
}
|
|
@@ -325,9 +354,10 @@ var ActionBar = React11__namespace.forwardRef(
|
|
|
325
354
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
326
355
|
"button",
|
|
327
356
|
{
|
|
357
|
+
"data-tour": thumbsUpAnchor,
|
|
328
358
|
onClick: handleThumbsUp,
|
|
329
359
|
className: core.cn(
|
|
330
|
-
"p-1.5 rounded hover:bg-
|
|
360
|
+
"p-1.5 rounded hover:bg-hover transition-colors",
|
|
331
361
|
isThumbsUp ? "text-green-500" : "text-muted-foreground hover:text-foreground"
|
|
332
362
|
),
|
|
333
363
|
title: "Good response",
|
|
@@ -337,9 +367,10 @@ var ActionBar = React11__namespace.forwardRef(
|
|
|
337
367
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
338
368
|
"button",
|
|
339
369
|
{
|
|
370
|
+
"data-tour": thumbsDownAnchor,
|
|
340
371
|
onClick: handleThumbsDown,
|
|
341
372
|
className: core.cn(
|
|
342
|
-
"p-1.5 rounded hover:bg-
|
|
373
|
+
"p-1.5 rounded hover:bg-hover transition-colors",
|
|
343
374
|
isThumbsDown ? "text-red-500" : "text-muted-foreground hover:text-foreground"
|
|
344
375
|
),
|
|
345
376
|
title: "Poor response",
|
|
@@ -627,7 +658,7 @@ var HITLSection = React11__namespace.forwardRef(
|
|
|
627
658
|
"button",
|
|
628
659
|
{
|
|
629
660
|
onClick: toggleExpanded,
|
|
630
|
-
className: "w-full flex items-center gap-2 py-2 px-3 hover:bg-
|
|
661
|
+
className: "w-full flex items-center gap-2 py-2 px-3 hover:bg-hover transition-colors text-left",
|
|
631
662
|
children: [
|
|
632
663
|
isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-3.5 h-3.5 text-muted-foreground flex-shrink-0" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "w-3.5 h-3.5 text-muted-foreground flex-shrink-0" }),
|
|
633
664
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircleQuestion, { className: "w-3.5 h-3.5 text-muted-foreground flex-shrink-0" }),
|
|
@@ -1144,7 +1175,7 @@ function TimelineAgentBlock({
|
|
|
1144
1175
|
"button",
|
|
1145
1176
|
{
|
|
1146
1177
|
onClick: onToggleCollapsed,
|
|
1147
|
-
className: "w-full flex items-center gap-1.5 py-1 hover:bg-
|
|
1178
|
+
className: "w-full flex items-center gap-1.5 py-1 hover:bg-hover -ml-1 pl-1 pr-2 rounded transition-colors text-left",
|
|
1148
1179
|
children: [
|
|
1149
1180
|
isCollapsed ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "w-3 h-3 text-muted-foreground flex-shrink-0" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-3 h-3 text-muted-foreground flex-shrink-0" }),
|
|
1150
1181
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-foreground/80", children: block.agentName }),
|
|
@@ -1260,7 +1291,7 @@ function AgentTimeline({ entries, renderMarkdown, uiState, maxHeight = "300px" }
|
|
|
1260
1291
|
"button",
|
|
1261
1292
|
{
|
|
1262
1293
|
onClick: () => toggleFilter(tc.type),
|
|
1263
|
-
className: `inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] transition-colors ${isActive ? "bg-accent text-accent-foreground ring-1 ring-accent-foreground/20" : "text-muted-foreground/60 hover:text-muted-foreground hover:bg-
|
|
1294
|
+
className: `inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] transition-colors ${isActive ? "bg-accent text-accent-foreground ring-1 ring-accent-foreground/20" : "text-muted-foreground/60 hover:text-muted-foreground hover:bg-hover"}`,
|
|
1264
1295
|
title: `${isActive ? "Hide" : "Show only"} ${tc.label}`,
|
|
1265
1296
|
children: [
|
|
1266
1297
|
/* @__PURE__ */ jsxRuntime.jsx(tc.icon, { className: "w-3 h-3" }),
|
|
@@ -1284,7 +1315,7 @@ function AgentTimeline({ entries, renderMarkdown, uiState, maxHeight = "300px" }
|
|
|
1284
1315
|
"button",
|
|
1285
1316
|
{
|
|
1286
1317
|
onClick: collapseAll,
|
|
1287
|
-
className: "inline-flex items-center gap-0.5 text-[10px] text-muted-foreground/60 hover:text-muted-foreground px-1 py-0.5 rounded hover:bg-
|
|
1318
|
+
className: "inline-flex items-center gap-0.5 text-[10px] text-muted-foreground/60 hover:text-muted-foreground px-1 py-0.5 rounded hover:bg-hover transition-colors",
|
|
1288
1319
|
title: "Collapse all",
|
|
1289
1320
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsDownUp, { className: "w-3 h-3" })
|
|
1290
1321
|
}
|
|
@@ -1293,7 +1324,7 @@ function AgentTimeline({ entries, renderMarkdown, uiState, maxHeight = "300px" }
|
|
|
1293
1324
|
"button",
|
|
1294
1325
|
{
|
|
1295
1326
|
onClick: expandAll,
|
|
1296
|
-
className: "inline-flex items-center gap-0.5 text-[10px] text-muted-foreground/60 hover:text-muted-foreground px-1 py-0.5 rounded hover:bg-
|
|
1327
|
+
className: "inline-flex items-center gap-0.5 text-[10px] text-muted-foreground/60 hover:text-muted-foreground px-1 py-0.5 rounded hover:bg-hover transition-colors",
|
|
1297
1328
|
title: "Expand all",
|
|
1298
1329
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDown, { className: "w-3 h-3" })
|
|
1299
1330
|
}
|
|
@@ -1350,6 +1381,7 @@ var AgentResponse = React11__namespace.forwardRef(
|
|
|
1350
1381
|
renderThinkingMarkdown,
|
|
1351
1382
|
timelineMaxHeight,
|
|
1352
1383
|
classNames,
|
|
1384
|
+
anchors,
|
|
1353
1385
|
className,
|
|
1354
1386
|
...props
|
|
1355
1387
|
}, ref) => {
|
|
@@ -1408,10 +1440,15 @@ var AgentResponse = React11__namespace.forwardRef(
|
|
|
1408
1440
|
statusUpdates: state.statusUpdates,
|
|
1409
1441
|
statusContent,
|
|
1410
1442
|
status: state.status,
|
|
1411
|
-
elapsedTime
|
|
1443
|
+
elapsedTime,
|
|
1444
|
+
thinkingToggleAnchor: anchors?.thinkingToggle,
|
|
1445
|
+
statusUpdateAnchor: anchors?.statusUpdate,
|
|
1446
|
+
toolCallsAnchor: anchors?.toolCalls,
|
|
1447
|
+
knowledgeAnchor: anchors?.knowledge,
|
|
1448
|
+
memoryAnchor: anchors?.memory
|
|
1412
1449
|
}
|
|
1413
1450
|
),
|
|
1414
|
-
hasTimelineEntries ? thinkingExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-3 border-t border-border", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1451
|
+
hasTimelineEntries ? thinkingExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-3 border-t border-border", "data-tour": anchors?.thinkingSection, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1415
1452
|
AgentTimeline,
|
|
1416
1453
|
{
|
|
1417
1454
|
entries: state.timelineEntries,
|
|
@@ -1422,6 +1459,7 @@ var AgentResponse = React11__namespace.forwardRef(
|
|
|
1422
1459
|
) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1423
1460
|
ThinkingSection,
|
|
1424
1461
|
{
|
|
1462
|
+
"data-tour": anchors?.thinkingSection,
|
|
1425
1463
|
content: state.thinkingSteps && state.thinkingSteps.length > 0 ? state.thinkingSteps : state.thinking,
|
|
1426
1464
|
isExpanded: thinkingExpanded,
|
|
1427
1465
|
renderMarkdown: renderThinkingMarkdown
|
|
@@ -1455,7 +1493,10 @@ var AgentResponse = React11__namespace.forwardRef(
|
|
|
1455
1493
|
totalTimeSeconds,
|
|
1456
1494
|
feedback,
|
|
1457
1495
|
onFeedbackChange,
|
|
1458
|
-
onResponseCopy
|
|
1496
|
+
onResponseCopy,
|
|
1497
|
+
copyAnchor: anchors?.copyAction,
|
|
1498
|
+
thumbsUpAnchor: anchors?.thumbsUp,
|
|
1499
|
+
thumbsDownAnchor: anchors?.thumbsDown
|
|
1459
1500
|
}
|
|
1460
1501
|
)
|
|
1461
1502
|
]
|
|
@@ -1585,6 +1626,7 @@ var UserPromptInput = React11__namespace.forwardRef(
|
|
|
1585
1626
|
enableTags = false,
|
|
1586
1627
|
onTagCreate,
|
|
1587
1628
|
onTagDelete,
|
|
1629
|
+
anchors,
|
|
1588
1630
|
className,
|
|
1589
1631
|
...props
|
|
1590
1632
|
}, ref) => {
|
|
@@ -1704,6 +1746,7 @@ var UserPromptInput = React11__namespace.forwardRef(
|
|
|
1704
1746
|
isSubmitting && onStop ? /* @__PURE__ */ jsxRuntime.jsx(core.Tooltip, { content: stopTooltip, disabled: !stopTooltip, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1705
1747
|
core.IconButton,
|
|
1706
1748
|
{
|
|
1749
|
+
"data-tour": anchors?.stopButton,
|
|
1707
1750
|
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Square, {}),
|
|
1708
1751
|
variant: "filled",
|
|
1709
1752
|
size: "sm",
|
|
@@ -1714,6 +1757,7 @@ var UserPromptInput = React11__namespace.forwardRef(
|
|
|
1714
1757
|
) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1715
1758
|
core.IconButton,
|
|
1716
1759
|
{
|
|
1760
|
+
"data-tour": anchors?.sendButton,
|
|
1717
1761
|
icon: isSubmitting ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Send, {}),
|
|
1718
1762
|
variant: "filled",
|
|
1719
1763
|
size: "sm",
|