@trops/dash-core 0.1.757 → 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 +172 -346
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +171 -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
|
};
|
|
@@ -87805,6 +87733,15 @@ var StreamingText = function StreamingText(_ref) {
|
|
|
87805
87733
|
});
|
|
87806
87734
|
};
|
|
87807
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
|
+
};
|
|
87808
87745
|
var ToolCallBlock = function ToolCallBlock(_ref) {
|
|
87809
87746
|
var toolName = _ref.toolName,
|
|
87810
87747
|
serverName = _ref.serverName,
|
|
@@ -87812,62 +87749,36 @@ var ToolCallBlock = function ToolCallBlock(_ref) {
|
|
|
87812
87749
|
result = _ref.result,
|
|
87813
87750
|
isError = _ref.isError,
|
|
87814
87751
|
isLoading = _ref.isLoading;
|
|
87815
|
-
var _useState = useState(false),
|
|
87816
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
87817
|
-
expanded = _useState2[0],
|
|
87818
|
-
setExpanded = _useState2[1];
|
|
87819
|
-
var _ref2 = useContext(ThemeContext) || {},
|
|
87820
|
-
currentTheme = _ref2.currentTheme;
|
|
87821
87752
|
var statusTokens = useStatusTokens();
|
|
87822
|
-
var
|
|
87823
|
-
|
|
87824
|
-
|
|
87825
|
-
|
|
87826
|
-
|
|
87827
|
-
|
|
87828
|
-
|
|
87829
|
-
|
|
87830
|
-
|
|
87831
|
-
|
|
87832
|
-
return setExpanded(!expanded);
|
|
87833
|
-
},
|
|
87834
|
-
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")),
|
|
87835
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
87836
|
-
className: "inline-block w-2 h-2 rounded-full ".concat(dotColor)
|
|
87837
|
-
}), /*#__PURE__*/jsx("span", {
|
|
87838
|
-
className: "font-mono ".concat(t("text-secondary-medium")),
|
|
87839
|
-
children: toolName
|
|
87840
|
-
}), serverName && /*#__PURE__*/jsxs(Caption2, {
|
|
87841
|
-
children: ["via ", serverName]
|
|
87842
|
-
}), /*#__PURE__*/jsx(Caption2, {
|
|
87843
|
-
className: "ml-auto",
|
|
87844
|
-
children: expanded ? "▲" : "▼"
|
|
87845
|
-
})]
|
|
87846
|
-
}), expanded && /*#__PURE__*/jsxs("div", {
|
|
87847
|
-
className: "px-2.5 py-2 space-y-2 ".concat(t("bg-primary-dark")),
|
|
87848
|
-
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", {
|
|
87849
87763
|
children: [/*#__PURE__*/jsx(Caption2, {
|
|
87850
87764
|
block: true,
|
|
87851
87765
|
className: "mb-0.5",
|
|
87852
87766
|
children: "Input:"
|
|
87853
87767
|
}), /*#__PURE__*/jsx("pre", {
|
|
87854
|
-
className: "".concat(
|
|
87855
|
-
children:
|
|
87768
|
+
className: "".concat(pre, " max-h-32"),
|
|
87769
|
+
children: pretty(input)
|
|
87856
87770
|
})]
|
|
87857
|
-
}), result !== undefined
|
|
87771
|
+
}) : null, result !== undefined ? /*#__PURE__*/jsxs("div", {
|
|
87858
87772
|
children: [/*#__PURE__*/jsx(Caption2, {
|
|
87859
87773
|
block: true,
|
|
87860
87774
|
className: "mb-0.5",
|
|
87861
87775
|
children: "Result:"
|
|
87862
87776
|
}), /*#__PURE__*/jsx("pre", {
|
|
87863
|
-
className: "".concat(
|
|
87864
|
-
children:
|
|
87777
|
+
className: "".concat(pre, " max-h-48 ").concat(isError ? "".concat(statusTokens.error.bg, " ").concat(statusTokens.error.text) : ""),
|
|
87778
|
+
children: pretty(result)
|
|
87865
87779
|
})]
|
|
87866
|
-
})
|
|
87867
|
-
|
|
87868
|
-
children: "Running..."
|
|
87869
|
-
})]
|
|
87870
|
-
})]
|
|
87780
|
+
}) : null]
|
|
87781
|
+
}) : null
|
|
87871
87782
|
});
|
|
87872
87783
|
};
|
|
87873
87784
|
|
|
@@ -87989,18 +87900,7 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
87989
87900
|
content = message.content,
|
|
87990
87901
|
toolCalls = message.toolCalls,
|
|
87991
87902
|
hidden = message.hidden;
|
|
87992
|
-
var _ref3 = useContext(ThemeContext) || {},
|
|
87993
|
-
currentTheme = _ref3.currentTheme;
|
|
87994
87903
|
var statusTokens = useStatusTokens();
|
|
87995
|
-
// Theme-provided colors so the chat follows the active light/dark
|
|
87996
|
-
// theme. No hardcoded fallbacks — they only read correctly on dark.
|
|
87997
|
-
var bubbleBg = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-secondary-dark"]) || (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-dark"]) || "";
|
|
87998
|
-
// The user's bubble uses the primary surface so it stands apart from the
|
|
87999
|
-
// Assistant/lead bubbles (secondary). "bg-primary-medium" is a real
|
|
88000
|
-
// ThemeModel key; the old "bg-primary-bright"/"bg-primary" don't exist,
|
|
88001
|
-
// which left the user's text with no bubble at all.
|
|
88002
|
-
var userBubbleBg = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-medium"]) || "";
|
|
88003
|
-
var bubbleText = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["text-primary-medium"]) || "";
|
|
88004
87904
|
|
|
88005
87905
|
// App-injected priming messages (e.g. widget-builder "Hello…" seed)
|
|
88006
87906
|
// are kept in state for conversation continuity but suppressed from
|
|
@@ -88012,19 +87912,13 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
88012
87912
|
}).map(function (c) {
|
|
88013
87913
|
return c.text;
|
|
88014
87914
|
}).join("") : "";
|
|
88015
|
-
return /*#__PURE__*/
|
|
88016
|
-
|
|
88017
|
-
|
|
88018
|
-
|
|
88019
|
-
|
|
88020
|
-
|
|
88021
|
-
|
|
88022
|
-
children: message.to ? "You \u2192 ".concat(leadLabel(message.to)) : "You"
|
|
88023
|
-
}), /*#__PURE__*/jsx("div", {
|
|
88024
|
-
className: "px-3 py-2 rounded-lg text-sm whitespace-pre-wrap break-words leading-relaxed ".concat(userBubbleBg, " ").concat(bubbleText),
|
|
88025
|
-
children: text
|
|
88026
|
-
})]
|
|
88027
|
-
})
|
|
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]
|
|
88028
87922
|
});
|
|
88029
87923
|
}
|
|
88030
87924
|
if (role === "assistant") {
|
|
@@ -88095,51 +87989,39 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
88095
87989
|
// indicator so the user knows the AI is working.
|
|
88096
87990
|
if (!isStreaming && !_text && toolBlocks.length === 0) {
|
|
88097
87991
|
if (isLast) {
|
|
88098
|
-
return /*#__PURE__*/
|
|
88099
|
-
|
|
88100
|
-
|
|
88101
|
-
|
|
88102
|
-
|
|
88103
|
-
children: "Assistant"
|
|
88104
|
-
}), /*#__PURE__*/jsx("div", {
|
|
88105
|
-
className: "text-sm leading-relaxed px-3 py-2 rounded-lg ".concat(bubbleBg),
|
|
88106
|
-
children: /*#__PURE__*/jsx(Caption2, {
|
|
88107
|
-
className: "italic",
|
|
88108
|
-
children: "Thinking..."
|
|
88109
|
-
})
|
|
88110
|
-
})]
|
|
87992
|
+
return /*#__PURE__*/jsx(ChatMessage, {
|
|
87993
|
+
role: "reply",
|
|
87994
|
+
label: "Assistant",
|
|
87995
|
+
streaming: true,
|
|
87996
|
+
children: "Thinking..."
|
|
88111
87997
|
});
|
|
88112
87998
|
}
|
|
88113
87999
|
return null;
|
|
88114
88000
|
}
|
|
88115
88001
|
return /*#__PURE__*/jsxs("div", {
|
|
88116
|
-
className: "
|
|
88117
|
-
children: [
|
|
88118
|
-
|
|
88119
|
-
|
|
88120
|
-
|
|
88121
|
-
|
|
88122
|
-
|
|
88123
|
-
|
|
88124
|
-
|
|
88125
|
-
|
|
88126
|
-
|
|
88127
|
-
|
|
88128
|
-
|
|
88129
|
-
|
|
88130
|
-
|
|
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, {
|
|
88131
88022
|
text: codeNote ? collapseCodeBlocks(_text, codeNote) : _text
|
|
88132
|
-
})
|
|
88133
|
-
|
|
88134
|
-
toolName: block.name,
|
|
88135
|
-
serverName: block.serverName,
|
|
88136
|
-
input: block.input,
|
|
88137
|
-
result: block.result,
|
|
88138
|
-
isError: block.isError,
|
|
88139
|
-
isLoading: block.isLoading
|
|
88140
|
-
}, block.id);
|
|
88141
|
-
})]
|
|
88142
|
-
})]
|
|
88023
|
+
})
|
|
88024
|
+
}) : null]
|
|
88143
88025
|
});
|
|
88144
88026
|
}
|
|
88145
88027
|
|
|
@@ -88147,25 +88029,20 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
88147
88029
|
// lead and its dashboard.
|
|
88148
88030
|
if (role === "lead") {
|
|
88149
88031
|
var _text2 = typeof content === "string" ? content : textOfContent(content);
|
|
88150
|
-
return /*#__PURE__*/
|
|
88151
|
-
|
|
88152
|
-
|
|
88153
|
-
|
|
88154
|
-
|
|
88155
|
-
|
|
88156
|
-
|
|
88157
|
-
|
|
88158
|
-
|
|
88159
|
-
|
|
88160
|
-
|
|
88161
|
-
|
|
88162
|
-
|
|
88163
|
-
|
|
88164
|
-
}) : /*#__PURE__*/jsx(Caption2, {
|
|
88165
|
-
className: "italic",
|
|
88166
|
-
children: message.streaming ? "Working…" : "No answer."
|
|
88167
|
-
})
|
|
88168
|
-
})]
|
|
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
|
+
})
|
|
88169
88046
|
});
|
|
88170
88047
|
}
|
|
88171
88048
|
return null;
|
|
@@ -88193,11 +88070,6 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
88193
88070
|
_ref$codeNote = _ref.codeNote,
|
|
88194
88071
|
codeNote = _ref$codeNote === void 0 ? null : _ref$codeNote;
|
|
88195
88072
|
var scrollRef = useRef(null);
|
|
88196
|
-
var _ref2 = useContext(ThemeContext) || {},
|
|
88197
|
-
currentTheme = _ref2.currentTheme;
|
|
88198
|
-
var t = function t(key) {
|
|
88199
|
-
return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
|
|
88200
|
-
};
|
|
88201
88073
|
useEffect(function () {
|
|
88202
88074
|
if (scrollRef.current) {
|
|
88203
88075
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
@@ -88205,23 +88077,17 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
88205
88077
|
}, [messages, streamingText]);
|
|
88206
88078
|
if (messages.length === 0) {
|
|
88207
88079
|
return /*#__PURE__*/jsx("div", {
|
|
88208
|
-
className: "flex-1 flex items-center justify-center",
|
|
88209
|
-
children: /*#__PURE__*/
|
|
88210
|
-
|
|
88211
|
-
|
|
88212
|
-
|
|
88213
|
-
children: "\uD83D\uDCAC"
|
|
88214
|
-
}), /*#__PURE__*/jsx(Caption2, {
|
|
88215
|
-
block: true,
|
|
88216
|
-
className: "text-sm",
|
|
88217
|
-
children: "Send a message to start chatting"
|
|
88218
|
-
})]
|
|
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"
|
|
88219
88085
|
})
|
|
88220
88086
|
});
|
|
88221
88087
|
}
|
|
88222
88088
|
return /*#__PURE__*/jsxs("div", {
|
|
88223
88089
|
ref: scrollRef,
|
|
88224
|
-
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",
|
|
88225
88091
|
children: [messages.map(function (message, index) {
|
|
88226
88092
|
var isLastAssistant = message.role === "assistant" && index === messages.length - 1;
|
|
88227
88093
|
var isStreaming = isLastAssistant && streamingRequestId !== null;
|
|
@@ -88232,34 +88098,11 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
88232
88098
|
isLast: index === messages.length - 1,
|
|
88233
88099
|
codeNote: codeNote
|
|
88234
88100
|
}, message.id || index);
|
|
88235
|
-
}), isLoading && !streamingRequestId && ((_messages = messages[messages.length - 1]) === null || _messages === void 0 ? void 0 : _messages.role) === "user" && /*#__PURE__*/
|
|
88236
|
-
|
|
88237
|
-
|
|
88238
|
-
|
|
88239
|
-
|
|
88240
|
-
children: "Assistant"
|
|
88241
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
88242
|
-
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")),
|
|
88243
|
-
children: [/*#__PURE__*/jsxs("span", {
|
|
88244
|
-
className: "inline-flex gap-0.5",
|
|
88245
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
88246
|
-
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
|
|
88247
|
-
style: {
|
|
88248
|
-
animationDelay: "0ms"
|
|
88249
|
-
}
|
|
88250
|
-
}), /*#__PURE__*/jsx("span", {
|
|
88251
|
-
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
|
|
88252
|
-
style: {
|
|
88253
|
-
animationDelay: "150ms"
|
|
88254
|
-
}
|
|
88255
|
-
}), /*#__PURE__*/jsx("span", {
|
|
88256
|
-
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
|
|
88257
|
-
style: {
|
|
88258
|
-
animationDelay: "300ms"
|
|
88259
|
-
}
|
|
88260
|
-
})]
|
|
88261
|
-
}), "Thinking..."]
|
|
88262
|
-
})]
|
|
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..."
|
|
88263
88106
|
})]
|
|
88264
88107
|
});
|
|
88265
88108
|
};
|
|
@@ -88323,11 +88166,6 @@ var ChatInput = function ChatInput(_ref) {
|
|
|
88323
88166
|
leads = _ref$leads === void 0 ? null : _ref$leads,
|
|
88324
88167
|
_ref$onPickRecipient = _ref.onPickRecipient,
|
|
88325
88168
|
onPickRecipient = _ref$onPickRecipient === void 0 ? null : _ref$onPickRecipient;
|
|
88326
|
-
var _ref2 = useContext(ThemeContext) || {},
|
|
88327
|
-
currentTheme = _ref2.currentTheme;
|
|
88328
|
-
var t = function t(key) {
|
|
88329
|
-
return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
|
|
88330
|
-
};
|
|
88331
88169
|
var _useState = useState(""),
|
|
88332
88170
|
_useState2 = _slicedToArray(_useState, 2),
|
|
88333
88171
|
input = _useState2[0],
|
|
@@ -88442,37 +88280,25 @@ var ChatInput = function ChatInput(_ref) {
|
|
|
88442
88280
|
handleSend();
|
|
88443
88281
|
}
|
|
88444
88282
|
};
|
|
88445
|
-
return /*#__PURE__*/
|
|
88446
|
-
|
|
88447
|
-
|
|
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, {
|
|
88448
88298
|
options: mentionOptions,
|
|
88449
88299
|
activeIndex: mentionIndex,
|
|
88450
88300
|
onPick: pickMention
|
|
88451
|
-
})
|
|
88452
|
-
className: "flex items-end gap-2",
|
|
88453
|
-
children: [/*#__PURE__*/jsx("textarea", {
|
|
88454
|
-
ref: textareaRef,
|
|
88455
|
-
value: input,
|
|
88456
|
-
onChange: handleChange,
|
|
88457
|
-
onKeyDown: handleKeyDown,
|
|
88458
|
-
placeholder: "Type a message...",
|
|
88459
|
-
disabled: disabled,
|
|
88460
|
-
rows: 1,
|
|
88461
|
-
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"))
|
|
88462
|
-
}), isLoading ? /*#__PURE__*/jsx(Button, {
|
|
88463
|
-
title: "Stop",
|
|
88464
|
-
danger: true,
|
|
88465
|
-
onClick: onStop,
|
|
88466
|
-
className: "shrink-0"
|
|
88467
|
-
}) : /*#__PURE__*/jsx(Button, {
|
|
88468
|
-
title: "Send",
|
|
88469
|
-
onClick: handleSend,
|
|
88470
|
-
disabled: !input.trim() || disabled,
|
|
88471
|
-
className: "shrink-0"
|
|
88472
|
-
})]
|
|
88473
|
-
}), queued && /*#__PURE__*/jsx(Caption2, {
|
|
88474
|
-
children: "Sends when the current reply finishes"
|
|
88475
|
-
})]
|
|
88301
|
+
}) : null
|
|
88476
88302
|
});
|
|
88477
88303
|
};
|
|
88478
88304
|
|