@trops/dash-core 0.1.756 → 0.1.758
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.esm.js +173 -346
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +172 -345
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
2
2
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import * as DashReact from '@trops/dash-react';
|
|
5
|
-
import { isObject, ThemeContext, FontAwesomeIcon, Modal, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, Tag, Button3, Button2, Paragraph, Sidebar, Panel, Stepper, Tag3, Card2, Card3, Heading3, MenuItem3, FormLabel, SelectMenu, Switch, SelectInput, CodeEditorVS, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, ButtonIcon2, DropdownPanel, MenuItem2, useStatusTokens, Caption2, ConfirmationModal, DropComponent, DragComponent, getStyleName, capitalizeFirstLetter, isHexColor as isHexColor$1, deriveShades, colorTypes, TAILWIND_PALETTE, Toggle, normalizeHex as normalizeHex$1, contrastRatio, Caption, getColorFamilies, getCuratedColorGrid, DashPanel, hexToRgb as hexToRgb$1, themeVariants, SubHeading, Heading2, Paragraph2, Paragraph3, ButtonIcon3, Tag2, Alert, Alert2, Alert3, Toast, Toast2, Toast3, ProgressBar, ProgressBar2, ProgressBar3, MenuItem, Breadcrumbs, Breadcrumbs2, Breadcrumbs3, Caption3, Code, Code2, Code3, Divider, Divider2, Divider3, DashPanel2, DashPanel3, Tabs, Tabs2, Tabs3, Accordion, Accordion2, Accordion3, Toggle2, Toggle3, TextArea, Checkbox, Slider, RadioGroup, AlertBanner, StatusBadge as StatusBadge$1, Skeleton, StatCard, DataList, EmptyState, Card, Panel2, ThemeFromUrlPane, AlgoliaSearchBox, CodeEditorInline, Icon2, SectionLabel, SegmentedControl, useResizableWidth, ResizeHandle, ChoiceMenu, CommandPalette, useSidebar, FilterMenu, Navbar, withRouter, Menu as Menu$1 } from '@trops/dash-react';
|
|
5
|
+
import { isObject, ThemeContext, FontAwesomeIcon, Modal, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, Tag, Button3, Button2, Paragraph, Sidebar, Panel, Stepper, Tag3, Card2, Card3, Heading3, MenuItem3, FormLabel, SelectMenu, Switch, SelectInput, CodeEditorVS, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, ButtonIcon2, DropdownPanel, MenuItem2, useStatusTokens, Caption2, ConfirmationModal, DropComponent, DragComponent, getStyleName, capitalizeFirstLetter, isHexColor as isHexColor$1, deriveShades, colorTypes, TAILWIND_PALETTE, Toggle, normalizeHex as normalizeHex$1, contrastRatio, Caption, getColorFamilies, getCuratedColorGrid, DashPanel, hexToRgb as hexToRgb$1, themeVariants, SubHeading, Heading2, Paragraph2, Paragraph3, ButtonIcon3, Tag2, Alert, Alert2, Alert3, Toast, Toast2, Toast3, ProgressBar, ProgressBar2, ProgressBar3, MenuItem, Breadcrumbs, Breadcrumbs2, Breadcrumbs3, Caption3, Code, Code2, Code3, Divider, Divider2, Divider3, DashPanel2, DashPanel3, Tabs, Tabs2, Tabs3, Accordion, Accordion2, Accordion3, Toggle2, Toggle3, TextArea, Checkbox, Slider, RadioGroup, AlertBanner, StatusBadge as StatusBadge$1, Skeleton, StatCard, DataList, EmptyState, Card, Panel2, ThemeFromUrlPane, AlgoliaSearchBox, CodeEditorInline, Icon2, SectionLabel, SegmentedControl, ChatMessage, ChatComposer, useResizableWidth, ResizeHandle, ChoiceMenu, CommandPalette, useSidebar, FilterMenu, Navbar, withRouter, Menu as Menu$1, ChatToolCall } from '@trops/dash-react';
|
|
6
6
|
export * from '@trops/dash-react';
|
|
7
7
|
export { FontAwesomeIcon, ThemeContext } from '@trops/dash-react';
|
|
8
8
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
@@ -56751,70 +56751,6 @@ var PlanSketch = function PlanSketch(_ref) {
|
|
|
56751
56751
|
});
|
|
56752
56752
|
};
|
|
56753
56753
|
|
|
56754
|
-
function useBubbleTokens() {
|
|
56755
|
-
var _ref = useContext(ThemeContext) || {},
|
|
56756
|
-
currentTheme = _ref.currentTheme;
|
|
56757
|
-
return {
|
|
56758
|
-
reply: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-secondary-dark"]) || (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-dark"]) || "",
|
|
56759
|
-
you: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-medium"]) || "",
|
|
56760
|
-
text: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["text-primary-medium"]) || ""
|
|
56761
|
-
};
|
|
56762
|
-
}
|
|
56763
|
-
|
|
56764
|
-
/** What the user said, right-aligned. */
|
|
56765
|
-
var YouBubble = function YouBubble(_ref2) {
|
|
56766
|
-
var children = _ref2.children;
|
|
56767
|
-
var t = useBubbleTokens();
|
|
56768
|
-
return /*#__PURE__*/jsx("div", {
|
|
56769
|
-
className: "flex justify-end",
|
|
56770
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
56771
|
-
className: "max-w-xl",
|
|
56772
|
-
children: [/*#__PURE__*/jsx(Caption2, {
|
|
56773
|
-
block: true,
|
|
56774
|
-
className: "font-semibold uppercase tracking-wider mb-1 text-right",
|
|
56775
|
-
children: "You"
|
|
56776
|
-
}), /*#__PURE__*/jsx("div", {
|
|
56777
|
-
className: "px-3 py-2 rounded-lg text-sm whitespace-pre-wrap break-words leading-relaxed ".concat(t.you, " ").concat(t.text),
|
|
56778
|
-
children: children
|
|
56779
|
-
})]
|
|
56780
|
-
})
|
|
56781
|
-
});
|
|
56782
|
-
};
|
|
56783
|
-
|
|
56784
|
-
/**
|
|
56785
|
-
* A team member's reply: its label ("Planner"), an optional meta line
|
|
56786
|
-
* (model · tokens), the text, and anything below it (a button).
|
|
56787
|
-
*/
|
|
56788
|
-
var TeamBubble = function TeamBubble(_ref3) {
|
|
56789
|
-
var _ref3$label = _ref3.label,
|
|
56790
|
-
label = _ref3$label === void 0 ? "Planner" : _ref3$label,
|
|
56791
|
-
_ref3$meta = _ref3.meta,
|
|
56792
|
-
meta = _ref3$meta === void 0 ? null : _ref3$meta,
|
|
56793
|
-
_ref3$muted = _ref3.muted,
|
|
56794
|
-
muted = _ref3$muted === void 0 ? false : _ref3$muted,
|
|
56795
|
-
testId = _ref3.testId,
|
|
56796
|
-
children = _ref3.children,
|
|
56797
|
-
_ref3$footer = _ref3.footer,
|
|
56798
|
-
footer = _ref3$footer === void 0 ? null : _ref3$footer;
|
|
56799
|
-
var t = useBubbleTokens();
|
|
56800
|
-
return /*#__PURE__*/jsxs("div", {
|
|
56801
|
-
className: "flex flex-col gap-1",
|
|
56802
|
-
"data-testid": testId,
|
|
56803
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
56804
|
-
className: "flex flex-row items-center gap-2",
|
|
56805
|
-
children: [/*#__PURE__*/jsx(Caption2, {
|
|
56806
|
-
className: "font-semibold uppercase tracking-wider",
|
|
56807
|
-
children: label
|
|
56808
|
-
}), meta ? /*#__PURE__*/jsx(Caption2, {
|
|
56809
|
-
children: meta
|
|
56810
|
-
}) : null]
|
|
56811
|
-
}), /*#__PURE__*/jsx("div", {
|
|
56812
|
-
className: "px-3 py-2 rounded-lg text-sm whitespace-pre-wrap break-words leading-relaxed ".concat(t.reply, " ").concat(t.text, " ").concat(muted ? "opacity-70 italic" : ""),
|
|
56813
|
-
children: children
|
|
56814
|
-
}), footer]
|
|
56815
|
-
});
|
|
56816
|
-
};
|
|
56817
|
-
|
|
56818
56754
|
function ownKeys$J(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
56819
56755
|
function _objectSpread$J(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$J(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$J(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
56820
56756
|
function reopenedRequest(original, plan, text) {
|
|
@@ -57388,19 +57324,30 @@ var CreatePlanStep = function CreatePlanStep(_ref2) {
|
|
|
57388
57324
|
children: /*#__PURE__*/jsxs("div", {
|
|
57389
57325
|
className: "mx-auto w-full max-w-3xl flex flex-col ".concat(compact ? "gap-3 px-3 py-3" : "gap-4 px-6 py-8"),
|
|
57390
57326
|
children: [messages.map(function (m, i) {
|
|
57391
|
-
return m.who === "you" ? /*#__PURE__*/jsx(
|
|
57327
|
+
return m.who === "you" ? /*#__PURE__*/jsx(ChatMessage, {
|
|
57328
|
+
role: "you",
|
|
57392
57329
|
children: m.text
|
|
57393
|
-
}, i) : m.who === "note" ? /*#__PURE__*/jsx(
|
|
57394
|
-
|
|
57330
|
+
}, i) : m.who === "note" ? /*#__PURE__*/jsx(ChatMessage, {
|
|
57331
|
+
role: "note",
|
|
57395
57332
|
children: m.text
|
|
57396
|
-
}, i) : /*#__PURE__*/jsx(
|
|
57333
|
+
}, i) : /*#__PURE__*/jsx(ChatMessage, {
|
|
57334
|
+
role: "reply",
|
|
57335
|
+
label: "Planner",
|
|
57397
57336
|
meta: m.meta,
|
|
57398
57337
|
testId: "planner-message",
|
|
57399
|
-
children:
|
|
57338
|
+
children: /*#__PURE__*/jsx("span", {
|
|
57339
|
+
className: "whitespace-pre-wrap",
|
|
57340
|
+
children: m.text
|
|
57341
|
+
})
|
|
57400
57342
|
}, i);
|
|
57401
|
-
}), busy ? /*#__PURE__*/jsx(
|
|
57402
|
-
|
|
57403
|
-
|
|
57343
|
+
}), busy ? /*#__PURE__*/jsx(ChatMessage, {
|
|
57344
|
+
role: "reply",
|
|
57345
|
+
label: "Planner",
|
|
57346
|
+
streaming: true,
|
|
57347
|
+
children: /*#__PURE__*/jsx("span", {
|
|
57348
|
+
className: "whitespace-pre-wrap",
|
|
57349
|
+
children: withoutPlan(soFar) || "Thinking…"
|
|
57350
|
+
})
|
|
57404
57351
|
}) : null, !busy && questions.length ? /*#__PURE__*/jsxs("div", {
|
|
57405
57352
|
className: "flex flex-col gap-3",
|
|
57406
57353
|
"data-testid": "plan-questions",
|
|
@@ -57664,33 +57611,22 @@ var CreatePlanStep = function CreatePlanStep(_ref2) {
|
|
|
57664
57611
|
setWalking(false);
|
|
57665
57612
|
}
|
|
57666
57613
|
}) : null, /*#__PURE__*/jsx("div", {
|
|
57667
|
-
className: "flex-shrink-0
|
|
57668
|
-
children: /*#__PURE__*/
|
|
57669
|
-
className: "mx-auto w-full max-w-3xl
|
|
57670
|
-
children:
|
|
57671
|
-
|
|
57672
|
-
|
|
57673
|
-
|
|
57674
|
-
|
|
57675
|
-
|
|
57676
|
-
|
|
57677
|
-
},
|
|
57678
|
-
placeholder: busy ? "The Planner is working…" : "Answer, or ask for changes…",
|
|
57679
|
-
rows: 2,
|
|
57680
|
-
onKeyDown: function onKeyDown(e) {
|
|
57681
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
57682
|
-
e.preventDefault();
|
|
57683
|
-
answer(reply);
|
|
57684
|
-
}
|
|
57685
|
-
}
|
|
57686
|
-
})
|
|
57687
|
-
}), /*#__PURE__*/jsx(Button, {
|
|
57688
|
-
title: "Send",
|
|
57689
|
-
onClick: function onClick() {
|
|
57614
|
+
className: "flex-shrink-0",
|
|
57615
|
+
children: /*#__PURE__*/jsx("div", {
|
|
57616
|
+
className: "mx-auto w-full max-w-3xl",
|
|
57617
|
+
children: /*#__PURE__*/jsx(ChatComposer, {
|
|
57618
|
+
ariaLabel: "Reply to the Planner",
|
|
57619
|
+
value: reply,
|
|
57620
|
+
onChange: function onChange(v) {
|
|
57621
|
+
return setReply(v);
|
|
57622
|
+
},
|
|
57623
|
+
onSend: function onSend() {
|
|
57690
57624
|
return answer(reply);
|
|
57691
57625
|
},
|
|
57692
|
-
|
|
57693
|
-
|
|
57626
|
+
busy: busy,
|
|
57627
|
+
placeholder: busy ? "The Planner is working…" : "Answer, or ask for changes…",
|
|
57628
|
+
className: compact ? "" : "px-6 py-3"
|
|
57629
|
+
})
|
|
57694
57630
|
})
|
|
57695
57631
|
})]
|
|
57696
57632
|
});
|
|
@@ -58572,9 +58508,6 @@ var AskStep = function AskStep(_ref) {
|
|
|
58572
58508
|
recentId = _ref$recentId === void 0 ? null : _ref$recentId,
|
|
58573
58509
|
_ref$onOpenPlan = _ref.onOpenPlan,
|
|
58574
58510
|
onOpenPlan = _ref$onOpenPlan === void 0 ? null : _ref$onOpenPlan;
|
|
58575
|
-
var _useConfigTokens = useConfigTokens(),
|
|
58576
|
-
muted = _useConfigTokens.muted,
|
|
58577
|
-
hairline = _useConfigTokens.hairline;
|
|
58578
58511
|
// [{ who: "you" | "planner" | "note", text, meta?, plan? }]
|
|
58579
58512
|
var _useState = useState(recentId ? [] : [{
|
|
58580
58513
|
who: "you",
|
|
@@ -58758,56 +58691,51 @@ var AskStep = function AskStep(_ref) {
|
|
|
58758
58691
|
children: /*#__PURE__*/jsxs("div", {
|
|
58759
58692
|
className: "flex flex-col gap-3 px-3 py-3",
|
|
58760
58693
|
children: [messages.map(function (m, i) {
|
|
58761
|
-
return m.who === "you" ? /*#__PURE__*/jsx(
|
|
58694
|
+
return m.who === "you" ? /*#__PURE__*/jsx(ChatMessage, {
|
|
58695
|
+
role: "you",
|
|
58762
58696
|
children: m.text
|
|
58763
|
-
}, i) : m.who === "note" ? /*#__PURE__*/jsx(
|
|
58764
|
-
|
|
58697
|
+
}, i) : m.who === "note" ? /*#__PURE__*/jsx(ChatMessage, {
|
|
58698
|
+
role: "note",
|
|
58765
58699
|
children: m.text
|
|
58766
|
-
}, i) : /*#__PURE__*/jsx(
|
|
58700
|
+
}, i) : /*#__PURE__*/jsx(ChatMessage, {
|
|
58701
|
+
role: "reply",
|
|
58702
|
+
label: "Planner",
|
|
58767
58703
|
meta: m.meta,
|
|
58768
58704
|
testId: "ask-answer",
|
|
58769
|
-
footer: m.plan && onOpenPlan ? /*#__PURE__*/jsx(
|
|
58770
|
-
|
|
58771
|
-
|
|
58772
|
-
|
|
58773
|
-
|
|
58774
|
-
|
|
58775
|
-
}
|
|
58776
|
-
})
|
|
58705
|
+
footer: m.plan && onOpenPlan ? /*#__PURE__*/jsx(Button3, {
|
|
58706
|
+
size: "sm",
|
|
58707
|
+
title: "Open as a plan",
|
|
58708
|
+
onClick: function onClick() {
|
|
58709
|
+
return onOpenPlan(planSeed(m.asked, m.plan));
|
|
58710
|
+
}
|
|
58777
58711
|
}) : null,
|
|
58778
|
-
children:
|
|
58712
|
+
children: /*#__PURE__*/jsx("span", {
|
|
58713
|
+
className: "whitespace-pre-wrap",
|
|
58714
|
+
children: m.text
|
|
58715
|
+
})
|
|
58779
58716
|
}, i);
|
|
58780
|
-
}), busy ? /*#__PURE__*/jsx(
|
|
58781
|
-
|
|
58782
|
-
|
|
58717
|
+
}), busy ? /*#__PURE__*/jsx(ChatMessage, {
|
|
58718
|
+
role: "reply",
|
|
58719
|
+
label: "Planner",
|
|
58720
|
+
streaming: true,
|
|
58721
|
+
children: /*#__PURE__*/jsx("span", {
|
|
58722
|
+
className: "whitespace-pre-wrap",
|
|
58723
|
+
children: withoutPlan(soFar) || "Looking…"
|
|
58724
|
+
})
|
|
58783
58725
|
}) : null]
|
|
58784
58726
|
})
|
|
58785
|
-
}), /*#__PURE__*/
|
|
58786
|
-
|
|
58787
|
-
|
|
58788
|
-
|
|
58789
|
-
|
|
58790
|
-
|
|
58791
|
-
|
|
58792
|
-
|
|
58793
|
-
|
|
58794
|
-
|
|
58795
|
-
|
|
58796
|
-
|
|
58797
|
-
onKeyDown: function onKeyDown(e) {
|
|
58798
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
58799
|
-
e.preventDefault();
|
|
58800
|
-
send(reply);
|
|
58801
|
-
}
|
|
58802
|
-
}
|
|
58803
|
-
})
|
|
58804
|
-
}), /*#__PURE__*/jsx(Button, {
|
|
58805
|
-
title: "Send",
|
|
58806
|
-
onClick: function onClick() {
|
|
58807
|
-
return send(reply);
|
|
58808
|
-
},
|
|
58809
|
-
disabled: busy || !reply.trim()
|
|
58810
|
-
})]
|
|
58727
|
+
}), /*#__PURE__*/jsx(ChatComposer, {
|
|
58728
|
+
ariaLabel: "Ask a follow-up",
|
|
58729
|
+
value: reply,
|
|
58730
|
+
onChange: function onChange(v) {
|
|
58731
|
+
return setReply(v);
|
|
58732
|
+
},
|
|
58733
|
+
onSend: function onSend() {
|
|
58734
|
+
return send(reply);
|
|
58735
|
+
},
|
|
58736
|
+
busy: busy,
|
|
58737
|
+
placeholder: busy ? "The Planner is looking…" : "Ask a follow-up…",
|
|
58738
|
+
className: "flex-shrink-0"
|
|
58811
58739
|
})]
|
|
58812
58740
|
});
|
|
58813
58741
|
};
|
|
@@ -81531,6 +81459,7 @@ var ThemesPage = function ThemesPage(_ref2) {
|
|
|
81531
81459
|
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
81532
81460
|
icon: "sun"
|
|
81533
81461
|
}), /*#__PURE__*/jsx(Switch, {
|
|
81462
|
+
ariaLabel: "Dark mode",
|
|
81534
81463
|
checked: themeVariant === "dark",
|
|
81535
81464
|
onChange: function onChange(isDark) {
|
|
81536
81465
|
return changeThemeVariant && changeThemeVariant(isDark ? "dark" : "light");
|
|
@@ -87804,6 +87733,15 @@ var StreamingText = function StreamingText(_ref) {
|
|
|
87804
87733
|
});
|
|
87805
87734
|
};
|
|
87806
87735
|
|
|
87736
|
+
/**
|
|
87737
|
+
* ToolCallBlock
|
|
87738
|
+
*
|
|
87739
|
+
* One MCP tool call in a chat, drawn with dash-react's ChatToolCall: status
|
|
87740
|
+
* dot, tool name, where it ran, and a disclosure with the input and result.
|
|
87741
|
+
*/
|
|
87742
|
+
var pretty = function pretty(v) {
|
|
87743
|
+
return typeof v === "string" ? v : JSON.stringify(v, null, 2);
|
|
87744
|
+
};
|
|
87807
87745
|
var ToolCallBlock = function ToolCallBlock(_ref) {
|
|
87808
87746
|
var toolName = _ref.toolName,
|
|
87809
87747
|
serverName = _ref.serverName,
|
|
@@ -87811,62 +87749,36 @@ var ToolCallBlock = function ToolCallBlock(_ref) {
|
|
|
87811
87749
|
result = _ref.result,
|
|
87812
87750
|
isError = _ref.isError,
|
|
87813
87751
|
isLoading = _ref.isLoading;
|
|
87814
|
-
var _useState = useState(false),
|
|
87815
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
87816
|
-
expanded = _useState2[0],
|
|
87817
|
-
setExpanded = _useState2[1];
|
|
87818
|
-
var _ref2 = useContext(ThemeContext) || {},
|
|
87819
|
-
currentTheme = _ref2.currentTheme;
|
|
87820
87752
|
var statusTokens = useStatusTokens();
|
|
87821
|
-
var
|
|
87822
|
-
|
|
87823
|
-
|
|
87824
|
-
|
|
87825
|
-
|
|
87826
|
-
|
|
87827
|
-
|
|
87828
|
-
|
|
87829
|
-
|
|
87830
|
-
|
|
87831
|
-
return setExpanded(!expanded);
|
|
87832
|
-
},
|
|
87833
|
-
className: "w-full flex items-center gap-2 px-2.5 py-1.5 transition-colors text-left ".concat(t("bg-primary-dark"), " ").concat(t("hover-bg-primary-dark")),
|
|
87834
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
87835
|
-
className: "inline-block w-2 h-2 rounded-full ".concat(dotColor)
|
|
87836
|
-
}), /*#__PURE__*/jsx("span", {
|
|
87837
|
-
className: "font-mono ".concat(t("text-secondary-medium")),
|
|
87838
|
-
children: toolName
|
|
87839
|
-
}), serverName && /*#__PURE__*/jsxs(Caption2, {
|
|
87840
|
-
children: ["via ", serverName]
|
|
87841
|
-
}), /*#__PURE__*/jsx(Caption2, {
|
|
87842
|
-
className: "ml-auto",
|
|
87843
|
-
children: expanded ? "▲" : "▼"
|
|
87844
|
-
})]
|
|
87845
|
-
}), expanded && /*#__PURE__*/jsxs("div", {
|
|
87846
|
-
className: "px-2.5 py-2 space-y-2 ".concat(t("bg-primary-dark")),
|
|
87847
|
-
children: [input && /*#__PURE__*/jsxs("div", {
|
|
87753
|
+
var status = isLoading ? "running" : isError ? "error" : "done";
|
|
87754
|
+
var hasDetails = input !== undefined || result !== undefined;
|
|
87755
|
+
var pre = "p-1.5 rounded overflow-auto font-mono text-xs";
|
|
87756
|
+
return /*#__PURE__*/jsx(ChatToolCall, {
|
|
87757
|
+
name: toolName,
|
|
87758
|
+
source: serverName ? "via ".concat(serverName) : null,
|
|
87759
|
+
status: status,
|
|
87760
|
+
children: hasDetails ? /*#__PURE__*/jsxs("div", {
|
|
87761
|
+
className: "space-y-2",
|
|
87762
|
+
children: [input !== undefined && input !== null && input !== "" ? /*#__PURE__*/jsxs("div", {
|
|
87848
87763
|
children: [/*#__PURE__*/jsx(Caption2, {
|
|
87849
87764
|
block: true,
|
|
87850
87765
|
className: "mb-0.5",
|
|
87851
87766
|
children: "Input:"
|
|
87852
87767
|
}), /*#__PURE__*/jsx("pre", {
|
|
87853
|
-
className: "".concat(
|
|
87854
|
-
children:
|
|
87768
|
+
className: "".concat(pre, " max-h-32"),
|
|
87769
|
+
children: pretty(input)
|
|
87855
87770
|
})]
|
|
87856
|
-
}), result !== undefined
|
|
87771
|
+
}) : null, result !== undefined ? /*#__PURE__*/jsxs("div", {
|
|
87857
87772
|
children: [/*#__PURE__*/jsx(Caption2, {
|
|
87858
87773
|
block: true,
|
|
87859
87774
|
className: "mb-0.5",
|
|
87860
87775
|
children: "Result:"
|
|
87861
87776
|
}), /*#__PURE__*/jsx("pre", {
|
|
87862
|
-
className: "".concat(
|
|
87863
|
-
children:
|
|
87777
|
+
className: "".concat(pre, " max-h-48 ").concat(isError ? "".concat(statusTokens.error.bg, " ").concat(statusTokens.error.text) : ""),
|
|
87778
|
+
children: pretty(result)
|
|
87864
87779
|
})]
|
|
87865
|
-
})
|
|
87866
|
-
|
|
87867
|
-
children: "Running..."
|
|
87868
|
-
})]
|
|
87869
|
-
})]
|
|
87780
|
+
}) : null]
|
|
87781
|
+
}) : null
|
|
87870
87782
|
});
|
|
87871
87783
|
};
|
|
87872
87784
|
|
|
@@ -87988,18 +87900,7 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
87988
87900
|
content = message.content,
|
|
87989
87901
|
toolCalls = message.toolCalls,
|
|
87990
87902
|
hidden = message.hidden;
|
|
87991
|
-
var _ref3 = useContext(ThemeContext) || {},
|
|
87992
|
-
currentTheme = _ref3.currentTheme;
|
|
87993
87903
|
var statusTokens = useStatusTokens();
|
|
87994
|
-
// Theme-provided colors so the chat follows the active light/dark
|
|
87995
|
-
// theme. No hardcoded fallbacks — they only read correctly on dark.
|
|
87996
|
-
var bubbleBg = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-secondary-dark"]) || (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-dark"]) || "";
|
|
87997
|
-
// The user's bubble uses the primary surface so it stands apart from the
|
|
87998
|
-
// Assistant/lead bubbles (secondary). "bg-primary-medium" is a real
|
|
87999
|
-
// ThemeModel key; the old "bg-primary-bright"/"bg-primary" don't exist,
|
|
88000
|
-
// which left the user's text with no bubble at all.
|
|
88001
|
-
var userBubbleBg = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-medium"]) || "";
|
|
88002
|
-
var bubbleText = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["text-primary-medium"]) || "";
|
|
88003
87904
|
|
|
88004
87905
|
// App-injected priming messages (e.g. widget-builder "Hello…" seed)
|
|
88005
87906
|
// are kept in state for conversation continuity but suppressed from
|
|
@@ -88011,19 +87912,13 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
88011
87912
|
}).map(function (c) {
|
|
88012
87913
|
return c.text;
|
|
88013
87914
|
}).join("") : "";
|
|
88014
|
-
return /*#__PURE__*/
|
|
88015
|
-
|
|
88016
|
-
|
|
88017
|
-
|
|
88018
|
-
|
|
88019
|
-
|
|
88020
|
-
|
|
88021
|
-
children: message.to ? "You \u2192 ".concat(leadLabel(message.to)) : "You"
|
|
88022
|
-
}), /*#__PURE__*/jsx("div", {
|
|
88023
|
-
className: "px-3 py-2 rounded-lg text-sm whitespace-pre-wrap break-words leading-relaxed ".concat(userBubbleBg, " ").concat(bubbleText),
|
|
88024
|
-
children: text
|
|
88025
|
-
})]
|
|
88026
|
-
})
|
|
87915
|
+
return /*#__PURE__*/jsxs(ChatMessage, {
|
|
87916
|
+
role: "you",
|
|
87917
|
+
testId: "user-bubble",
|
|
87918
|
+
children: [message.to ? /*#__PURE__*/jsxs("span", {
|
|
87919
|
+
className: "block text-xs opacity-70 mb-0.5",
|
|
87920
|
+
children: ["To ", leadLabel(message.to)]
|
|
87921
|
+
}) : null, text]
|
|
88027
87922
|
});
|
|
88028
87923
|
}
|
|
88029
87924
|
if (role === "assistant") {
|
|
@@ -88094,51 +87989,39 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
88094
87989
|
// indicator so the user knows the AI is working.
|
|
88095
87990
|
if (!isStreaming && !_text && toolBlocks.length === 0) {
|
|
88096
87991
|
if (isLast) {
|
|
88097
|
-
return /*#__PURE__*/
|
|
88098
|
-
|
|
88099
|
-
|
|
88100
|
-
|
|
88101
|
-
|
|
88102
|
-
children: "Assistant"
|
|
88103
|
-
}), /*#__PURE__*/jsx("div", {
|
|
88104
|
-
className: "text-sm leading-relaxed px-3 py-2 rounded-lg ".concat(bubbleBg),
|
|
88105
|
-
children: /*#__PURE__*/jsx(Caption2, {
|
|
88106
|
-
className: "italic",
|
|
88107
|
-
children: "Thinking..."
|
|
88108
|
-
})
|
|
88109
|
-
})]
|
|
87992
|
+
return /*#__PURE__*/jsx(ChatMessage, {
|
|
87993
|
+
role: "reply",
|
|
87994
|
+
label: "Assistant",
|
|
87995
|
+
streaming: true,
|
|
87996
|
+
children: "Thinking..."
|
|
88110
87997
|
});
|
|
88111
87998
|
}
|
|
88112
87999
|
return null;
|
|
88113
88000
|
}
|
|
88114
88001
|
return /*#__PURE__*/jsxs("div", {
|
|
88115
|
-
className: "
|
|
88116
|
-
children: [
|
|
88117
|
-
|
|
88118
|
-
|
|
88119
|
-
|
|
88120
|
-
|
|
88121
|
-
|
|
88122
|
-
|
|
88123
|
-
|
|
88124
|
-
|
|
88125
|
-
|
|
88126
|
-
|
|
88127
|
-
|
|
88128
|
-
|
|
88129
|
-
|
|
88002
|
+
className: "flex flex-col gap-2",
|
|
88003
|
+
children: [toolBlocks.map(function (block) {
|
|
88004
|
+
return /*#__PURE__*/jsx(ToolCallBlock, {
|
|
88005
|
+
toolName: block.name,
|
|
88006
|
+
serverName: block.serverName,
|
|
88007
|
+
input: block.input,
|
|
88008
|
+
result: block.result,
|
|
88009
|
+
isError: block.isError,
|
|
88010
|
+
isLoading: block.isLoading
|
|
88011
|
+
}, block.id);
|
|
88012
|
+
}), isStreaming || _text ? /*#__PURE__*/jsx(ChatMessage, {
|
|
88013
|
+
role: "reply",
|
|
88014
|
+
label: "Assistant",
|
|
88015
|
+
streaming: isStreaming && !streamingText,
|
|
88016
|
+
children: isStreaming ? /*#__PURE__*/jsx(StreamingText, {
|
|
88017
|
+
text: codeNote ? collapseCodeBlocks(streamingText, codeNote, {
|
|
88018
|
+
plain: true
|
|
88019
|
+
}) : streamingText,
|
|
88020
|
+
isStreaming: true
|
|
88021
|
+
}) : /*#__PURE__*/jsx(AssistantTextContent, {
|
|
88130
88022
|
text: codeNote ? collapseCodeBlocks(_text, codeNote) : _text
|
|
88131
|
-
})
|
|
88132
|
-
|
|
88133
|
-
toolName: block.name,
|
|
88134
|
-
serverName: block.serverName,
|
|
88135
|
-
input: block.input,
|
|
88136
|
-
result: block.result,
|
|
88137
|
-
isError: block.isError,
|
|
88138
|
-
isLoading: block.isLoading
|
|
88139
|
-
}, block.id);
|
|
88140
|
-
})]
|
|
88141
|
-
})]
|
|
88023
|
+
})
|
|
88024
|
+
}) : null]
|
|
88142
88025
|
});
|
|
88143
88026
|
}
|
|
88144
88027
|
|
|
@@ -88146,25 +88029,20 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
88146
88029
|
// lead and its dashboard.
|
|
88147
88030
|
if (role === "lead") {
|
|
88148
88031
|
var _text2 = typeof content === "string" ? content : textOfContent(content);
|
|
88149
|
-
return /*#__PURE__*/
|
|
88150
|
-
|
|
88151
|
-
|
|
88152
|
-
|
|
88153
|
-
|
|
88154
|
-
|
|
88155
|
-
|
|
88156
|
-
|
|
88157
|
-
|
|
88158
|
-
|
|
88159
|
-
|
|
88160
|
-
|
|
88161
|
-
|
|
88162
|
-
|
|
88163
|
-
}) : /*#__PURE__*/jsx(Caption2, {
|
|
88164
|
-
className: "italic",
|
|
88165
|
-
children: message.streaming ? "Working…" : "No answer."
|
|
88166
|
-
})
|
|
88167
|
-
})]
|
|
88032
|
+
return /*#__PURE__*/jsx(ChatMessage, {
|
|
88033
|
+
role: "reply",
|
|
88034
|
+
label: leadLabel(message.from),
|
|
88035
|
+
streaming: !!message.streaming && !_text2,
|
|
88036
|
+
testId: "lead-bubble",
|
|
88037
|
+
children: message.error ? /*#__PURE__*/jsx("span", {
|
|
88038
|
+
className: statusTokens.error.icon,
|
|
88039
|
+
children: message.error
|
|
88040
|
+
}) : _text2 ? /*#__PURE__*/jsx(AssistantTextContent, {
|
|
88041
|
+
text: _text2
|
|
88042
|
+
}) : /*#__PURE__*/jsx("span", {
|
|
88043
|
+
className: "italic",
|
|
88044
|
+
children: message.streaming ? "Working…" : "No answer."
|
|
88045
|
+
})
|
|
88168
88046
|
});
|
|
88169
88047
|
}
|
|
88170
88048
|
return null;
|
|
@@ -88192,11 +88070,6 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
88192
88070
|
_ref$codeNote = _ref.codeNote,
|
|
88193
88071
|
codeNote = _ref$codeNote === void 0 ? null : _ref$codeNote;
|
|
88194
88072
|
var scrollRef = useRef(null);
|
|
88195
|
-
var _ref2 = useContext(ThemeContext) || {},
|
|
88196
|
-
currentTheme = _ref2.currentTheme;
|
|
88197
|
-
var t = function t(key) {
|
|
88198
|
-
return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
|
|
88199
|
-
};
|
|
88200
88073
|
useEffect(function () {
|
|
88201
88074
|
if (scrollRef.current) {
|
|
88202
88075
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
@@ -88204,23 +88077,17 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
88204
88077
|
}, [messages, streamingText]);
|
|
88205
88078
|
if (messages.length === 0) {
|
|
88206
88079
|
return /*#__PURE__*/jsx("div", {
|
|
88207
|
-
className: "flex-1 flex items-center justify-center",
|
|
88208
|
-
children: /*#__PURE__*/
|
|
88209
|
-
|
|
88210
|
-
|
|
88211
|
-
|
|
88212
|
-
children: "\uD83D\uDCAC"
|
|
88213
|
-
}), /*#__PURE__*/jsx(Caption2, {
|
|
88214
|
-
block: true,
|
|
88215
|
-
className: "text-sm",
|
|
88216
|
-
children: "Send a message to start chatting"
|
|
88217
|
-
})]
|
|
88080
|
+
className: "flex-1 flex items-center justify-center px-4",
|
|
88081
|
+
children: /*#__PURE__*/jsx(Caption2, {
|
|
88082
|
+
block: true,
|
|
88083
|
+
className: "text-sm text-center",
|
|
88084
|
+
children: "Send a message to start chatting"
|
|
88218
88085
|
})
|
|
88219
88086
|
});
|
|
88220
88087
|
}
|
|
88221
88088
|
return /*#__PURE__*/jsxs("div", {
|
|
88222
88089
|
ref: scrollRef,
|
|
88223
|
-
className: "flex-1 overflow-y-auto px-4 py-3 scroll-smooth",
|
|
88090
|
+
className: "flex-1 overflow-y-auto px-4 py-3 scroll-smooth flex flex-col gap-3",
|
|
88224
88091
|
children: [messages.map(function (message, index) {
|
|
88225
88092
|
var isLastAssistant = message.role === "assistant" && index === messages.length - 1;
|
|
88226
88093
|
var isStreaming = isLastAssistant && streamingRequestId !== null;
|
|
@@ -88231,34 +88098,11 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
88231
88098
|
isLast: index === messages.length - 1,
|
|
88232
88099
|
codeNote: codeNote
|
|
88233
88100
|
}, message.id || index);
|
|
88234
|
-
}), isLoading && !streamingRequestId && ((_messages = messages[messages.length - 1]) === null || _messages === void 0 ? void 0 : _messages.role) === "user" && /*#__PURE__*/
|
|
88235
|
-
|
|
88236
|
-
|
|
88237
|
-
|
|
88238
|
-
|
|
88239
|
-
children: "Assistant"
|
|
88240
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
88241
|
-
className: "text-sm leading-relaxed px-3 py-2 rounded-lg italic flex items-center gap-2 opacity-70 ".concat(t("bg-primary-dark"), " ").concat(t("text-primary-medium")),
|
|
88242
|
-
children: [/*#__PURE__*/jsxs("span", {
|
|
88243
|
-
className: "inline-flex gap-0.5",
|
|
88244
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
88245
|
-
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
|
|
88246
|
-
style: {
|
|
88247
|
-
animationDelay: "0ms"
|
|
88248
|
-
}
|
|
88249
|
-
}), /*#__PURE__*/jsx("span", {
|
|
88250
|
-
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
|
|
88251
|
-
style: {
|
|
88252
|
-
animationDelay: "150ms"
|
|
88253
|
-
}
|
|
88254
|
-
}), /*#__PURE__*/jsx("span", {
|
|
88255
|
-
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
|
|
88256
|
-
style: {
|
|
88257
|
-
animationDelay: "300ms"
|
|
88258
|
-
}
|
|
88259
|
-
})]
|
|
88260
|
-
}), "Thinking..."]
|
|
88261
|
-
})]
|
|
88101
|
+
}), isLoading && !streamingRequestId && ((_messages = messages[messages.length - 1]) === null || _messages === void 0 ? void 0 : _messages.role) === "user" && /*#__PURE__*/jsx(ChatMessage, {
|
|
88102
|
+
role: "reply",
|
|
88103
|
+
label: "Assistant",
|
|
88104
|
+
streaming: true,
|
|
88105
|
+
children: "Thinking..."
|
|
88262
88106
|
})]
|
|
88263
88107
|
});
|
|
88264
88108
|
};
|
|
@@ -88322,11 +88166,6 @@ var ChatInput = function ChatInput(_ref) {
|
|
|
88322
88166
|
leads = _ref$leads === void 0 ? null : _ref$leads,
|
|
88323
88167
|
_ref$onPickRecipient = _ref.onPickRecipient,
|
|
88324
88168
|
onPickRecipient = _ref$onPickRecipient === void 0 ? null : _ref$onPickRecipient;
|
|
88325
|
-
var _ref2 = useContext(ThemeContext) || {},
|
|
88326
|
-
currentTheme = _ref2.currentTheme;
|
|
88327
|
-
var t = function t(key) {
|
|
88328
|
-
return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
|
|
88329
|
-
};
|
|
88330
88169
|
var _useState = useState(""),
|
|
88331
88170
|
_useState2 = _slicedToArray(_useState, 2),
|
|
88332
88171
|
input = _useState2[0],
|
|
@@ -88441,37 +88280,25 @@ var ChatInput = function ChatInput(_ref) {
|
|
|
88441
88280
|
handleSend();
|
|
88442
88281
|
}
|
|
88443
88282
|
};
|
|
88444
|
-
return /*#__PURE__*/
|
|
88445
|
-
|
|
88446
|
-
|
|
88283
|
+
return /*#__PURE__*/jsx(ChatComposer, {
|
|
88284
|
+
ref: textareaRef,
|
|
88285
|
+
value: input,
|
|
88286
|
+
onChange: function onChange(_value, e) {
|
|
88287
|
+
return handleChange(e);
|
|
88288
|
+
},
|
|
88289
|
+
onKeyDown: handleKeyDown,
|
|
88290
|
+
onSend: handleSend,
|
|
88291
|
+
onStop: onStop,
|
|
88292
|
+
busy: !!isLoading,
|
|
88293
|
+
disabled: disabled,
|
|
88294
|
+
rows: 1,
|
|
88295
|
+
placeholder: "Type a message...",
|
|
88296
|
+
hint: queued ? "Sends when the current reply finishes" : "Enter to send · Shift+Enter for a new line",
|
|
88297
|
+
above: mentionOpen ? /*#__PURE__*/jsx(LeadMentionMenu, {
|
|
88447
88298
|
options: mentionOptions,
|
|
88448
88299
|
activeIndex: mentionIndex,
|
|
88449
88300
|
onPick: pickMention
|
|
88450
|
-
})
|
|
88451
|
-
className: "flex items-end gap-2",
|
|
88452
|
-
children: [/*#__PURE__*/jsx("textarea", {
|
|
88453
|
-
ref: textareaRef,
|
|
88454
|
-
value: input,
|
|
88455
|
-
onChange: handleChange,
|
|
88456
|
-
onKeyDown: handleKeyDown,
|
|
88457
|
-
placeholder: "Type a message...",
|
|
88458
|
-
disabled: disabled,
|
|
88459
|
-
rows: 1,
|
|
88460
|
-
className: "flex-1 px-3 py-2 border rounded-lg text-sm focus:outline-none resize-none disabled:opacity-50 ".concat(t("bg-primary-dark"), " ").concat(t("border-primary-dark"), " ").concat(t("text-primary-medium"))
|
|
88461
|
-
}), isLoading ? /*#__PURE__*/jsx(Button, {
|
|
88462
|
-
title: "Stop",
|
|
88463
|
-
danger: true,
|
|
88464
|
-
onClick: onStop,
|
|
88465
|
-
className: "shrink-0"
|
|
88466
|
-
}) : /*#__PURE__*/jsx(Button, {
|
|
88467
|
-
title: "Send",
|
|
88468
|
-
onClick: handleSend,
|
|
88469
|
-
disabled: !input.trim() || disabled,
|
|
88470
|
-
className: "shrink-0"
|
|
88471
|
-
})]
|
|
88472
|
-
}), queued && /*#__PURE__*/jsx(Caption2, {
|
|
88473
|
-
children: "Sends when the current reply finishes"
|
|
88474
|
-
})]
|
|
88301
|
+
}) : null
|
|
88475
88302
|
});
|
|
88476
88303
|
};
|
|
88477
88304
|
|