@trops/dash-core 0.1.685 → 0.1.687
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 +322 -134
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +322 -134
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -75853,6 +75853,30 @@ function hasLeadSession(messages, botId) {
|
|
|
75853
75853
|
});
|
|
75854
75854
|
}
|
|
75855
75855
|
|
|
75856
|
+
/** The "Assistant" entry in the @ list (the default recipient). */
|
|
75857
|
+
var ASSISTANT_RECIPIENT = Object.freeze({
|
|
75858
|
+
botId: null,
|
|
75859
|
+
leadName: "Assistant",
|
|
75860
|
+
dashboardName: "",
|
|
75861
|
+
dashboardLabel: "",
|
|
75862
|
+
isAssistant: true
|
|
75863
|
+
});
|
|
75864
|
+
|
|
75865
|
+
/**
|
|
75866
|
+
* Recipients for the @ shortcut (AC6): the Assistant and each lead whose
|
|
75867
|
+
* lead or dashboard name contains `query` (any case), in list order.
|
|
75868
|
+
*/
|
|
75869
|
+
function filterRecipients(leads, query) {
|
|
75870
|
+
var q = String(query || "").trim().toLowerCase();
|
|
75871
|
+
var all = [ASSISTANT_RECIPIENT].concat(_toConsumableArray(leads || []));
|
|
75872
|
+
if (!q) return all;
|
|
75873
|
+
return all.filter(function (r) {
|
|
75874
|
+
return [r.leadName, r.dashboardLabel || r.dashboardName].filter(Boolean).some(function (s) {
|
|
75875
|
+
return s.toLowerCase().includes(q);
|
|
75876
|
+
});
|
|
75877
|
+
});
|
|
75878
|
+
}
|
|
75879
|
+
|
|
75856
75880
|
/**
|
|
75857
75881
|
* StreamingText
|
|
75858
75882
|
*
|
|
@@ -75862,24 +75886,29 @@ function hasLeadSession(messages, botId) {
|
|
|
75862
75886
|
var StreamingText = function StreamingText(_ref) {
|
|
75863
75887
|
var text = _ref.text,
|
|
75864
75888
|
isStreaming = _ref.isStreaming;
|
|
75889
|
+
var _ref2 = React.useContext(DashReact.ThemeContext) || {},
|
|
75890
|
+
currentTheme = _ref2.currentTheme;
|
|
75891
|
+
var t = function t(key) {
|
|
75892
|
+
return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
|
|
75893
|
+
};
|
|
75865
75894
|
if (!text && !isStreaming) return null;
|
|
75866
75895
|
if (isStreaming && !text) {
|
|
75867
75896
|
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
75868
|
-
className: "flex items-center gap-2 text-
|
|
75897
|
+
className: "flex items-center gap-2 text-sm opacity-70 ".concat(t("text-primary-medium")),
|
|
75869
75898
|
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
75870
75899
|
className: "inline-flex gap-1",
|
|
75871
75900
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
75872
|
-
className: "w-1.5 h-1.5 rounded-full
|
|
75901
|
+
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-secondary-medium")),
|
|
75873
75902
|
style: {
|
|
75874
75903
|
animationDelay: "0ms"
|
|
75875
75904
|
}
|
|
75876
75905
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
75877
|
-
className: "w-1.5 h-1.5 rounded-full
|
|
75906
|
+
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-secondary-medium")),
|
|
75878
75907
|
style: {
|
|
75879
75908
|
animationDelay: "150ms"
|
|
75880
75909
|
}
|
|
75881
75910
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
75882
|
-
className: "w-1.5 h-1.5 rounded-full
|
|
75911
|
+
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-secondary-medium")),
|
|
75883
75912
|
style: {
|
|
75884
75913
|
animationDelay: "300ms"
|
|
75885
75914
|
}
|
|
@@ -75890,7 +75919,7 @@ var StreamingText = function StreamingText(_ref) {
|
|
|
75890
75919
|
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
75891
75920
|
className: "whitespace-pre-wrap break-words",
|
|
75892
75921
|
children: [text, isStreaming && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
75893
|
-
className: "inline-block w-2 h-4 ml-0.5
|
|
75922
|
+
className: "inline-block w-2 h-4 ml-0.5 animate-pulse align-text-bottom ".concat(t("bg-secondary-medium"))
|
|
75894
75923
|
})]
|
|
75895
75924
|
});
|
|
75896
75925
|
};
|
|
@@ -75906,49 +75935,55 @@ var ToolCallBlock = function ToolCallBlock(_ref) {
|
|
|
75906
75935
|
_useState2 = _slicedToArray(_useState, 2),
|
|
75907
75936
|
expanded = _useState2[0],
|
|
75908
75937
|
setExpanded = _useState2[1];
|
|
75938
|
+
var _ref2 = React.useContext(DashReact.ThemeContext) || {},
|
|
75939
|
+
currentTheme = _ref2.currentTheme;
|
|
75940
|
+
var statusTokens = DashReact.useStatusTokens();
|
|
75941
|
+
var t = function t(key) {
|
|
75942
|
+
return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
|
|
75943
|
+
};
|
|
75944
|
+
var dotColor = isLoading ? "".concat(statusTokens.warning.solidBg, " animate-pulse") : isError ? statusTokens.error.solidBg : statusTokens.success.solidBg;
|
|
75945
|
+
var preBase = "p-1.5 rounded overflow-x-auto overflow-y-auto font-mono";
|
|
75946
|
+
var preNeutral = "".concat(t("bg-primary-very-dark"), " ").concat(t("text-primary-medium"));
|
|
75909
75947
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
75910
|
-
className: "my-1.5 border
|
|
75948
|
+
className: "my-1.5 border rounded-md overflow-hidden text-xs ".concat(t("border-primary-dark")),
|
|
75911
75949
|
children: [/*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
75912
75950
|
onClick: function onClick() {
|
|
75913
75951
|
return setExpanded(!expanded);
|
|
75914
75952
|
},
|
|
75915
|
-
className: "w-full flex items-center gap-2 px-2.5 py-1.5
|
|
75916
|
-
children: [
|
|
75917
|
-
className: "inline-block w-2 h-2 rounded-full
|
|
75918
|
-
}) : isError ? /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
75919
|
-
className: "inline-block w-2 h-2 rounded-full bg-red-500"
|
|
75920
|
-
}) : /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
75921
|
-
className: "inline-block w-2 h-2 rounded-full bg-green-500"
|
|
75953
|
+
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")),
|
|
75954
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
75955
|
+
className: "inline-block w-2 h-2 rounded-full ".concat(dotColor)
|
|
75922
75956
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
75923
|
-
className: "font-mono text-
|
|
75957
|
+
className: "font-mono ".concat(t("text-secondary-medium")),
|
|
75924
75958
|
children: toolName
|
|
75925
|
-
}), serverName && /*#__PURE__*/jsxRuntime.jsxs(
|
|
75926
|
-
className: "text-gray-600",
|
|
75959
|
+
}), serverName && /*#__PURE__*/jsxRuntime.jsxs(DashReact.Caption2, {
|
|
75927
75960
|
children: ["via ", serverName]
|
|
75928
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
75929
|
-
className: "ml-auto
|
|
75930
|
-
children: expanded ? "
|
|
75961
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
75962
|
+
className: "ml-auto",
|
|
75963
|
+
children: expanded ? "▲" : "▼"
|
|
75931
75964
|
})]
|
|
75932
75965
|
}), expanded && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
75933
|
-
className: "px-2.5 py-2 space-y-2 bg-
|
|
75966
|
+
className: "px-2.5 py-2 space-y-2 ".concat(t("bg-primary-dark")),
|
|
75934
75967
|
children: [input && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
75935
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
75936
|
-
|
|
75968
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
75969
|
+
block: true,
|
|
75970
|
+
className: "mb-0.5",
|
|
75937
75971
|
children: "Input:"
|
|
75938
75972
|
}), /*#__PURE__*/jsxRuntime.jsx("pre", {
|
|
75939
|
-
className: "
|
|
75973
|
+
className: "".concat(preBase, " max-h-32 ").concat(preNeutral),
|
|
75940
75974
|
children: typeof input === "string" ? input : JSON.stringify(input, null, 2)
|
|
75941
75975
|
})]
|
|
75942
75976
|
}), result !== undefined && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
75943
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
75944
|
-
|
|
75977
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
75978
|
+
block: true,
|
|
75979
|
+
className: "mb-0.5",
|
|
75945
75980
|
children: "Result:"
|
|
75946
75981
|
}), /*#__PURE__*/jsxRuntime.jsx("pre", {
|
|
75947
|
-
className: "
|
|
75982
|
+
className: "".concat(preBase, " max-h-48 ").concat(isError ? "".concat(statusTokens.error.bg, " ").concat(statusTokens.error.text) : preNeutral),
|
|
75948
75983
|
children: typeof result === "string" ? result : JSON.stringify(result, null, 2)
|
|
75949
75984
|
})]
|
|
75950
75985
|
}), isLoading && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
75951
|
-
className: "
|
|
75986
|
+
className: "italic ".concat(statusTokens.warning.icon),
|
|
75952
75987
|
children: "Running..."
|
|
75953
75988
|
})]
|
|
75954
75989
|
})]
|
|
@@ -76020,7 +76055,7 @@ function AssistantTextContent(_ref) {
|
|
|
76020
76055
|
// this HTML is inserted into the app window.
|
|
76021
76056
|
var html = renderSafeMarkdown(text);
|
|
76022
76057
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
76023
|
-
className: "prose prose-
|
|
76058
|
+
className: "prose prose-sm max-w-none prose-p:my-2 prose-headings:my-3 prose-ul:my-2 prose-ol:my-2 prose-li:my-0.5 leading-relaxed",
|
|
76024
76059
|
dangerouslySetInnerHTML: {
|
|
76025
76060
|
__html: html
|
|
76026
76061
|
}
|
|
@@ -76039,11 +76074,11 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
76039
76074
|
var _ref3 = React.useContext(DashReact.ThemeContext) || {},
|
|
76040
76075
|
currentTheme = _ref3.currentTheme;
|
|
76041
76076
|
var statusTokens = DashReact.useStatusTokens();
|
|
76042
|
-
//
|
|
76043
|
-
//
|
|
76044
|
-
|
|
76045
|
-
var
|
|
76046
|
-
var
|
|
76077
|
+
// Theme-provided colors so the chat follows the active light/dark
|
|
76078
|
+
// theme. No hardcoded fallbacks — they only read correctly on dark.
|
|
76079
|
+
var bubbleBg = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-secondary-dark"]) || (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-dark"]) || "";
|
|
76080
|
+
var userBubbleBg = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-bright"]) || (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary"]) || "";
|
|
76081
|
+
var bubbleText = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["text-primary-medium"]) || "";
|
|
76047
76082
|
|
|
76048
76083
|
// App-injected priming messages (e.g. widget-builder "Hello…" seed)
|
|
76049
76084
|
// are kept in state for conversation continuity but suppressed from
|
|
@@ -76058,12 +76093,13 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
76058
76093
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
76059
76094
|
className: "flex justify-end mb-4",
|
|
76060
76095
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
76061
|
-
className: "max-w-
|
|
76062
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
76063
|
-
|
|
76096
|
+
className: "max-w-md",
|
|
76097
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
76098
|
+
block: true,
|
|
76099
|
+
className: "font-semibold uppercase tracking-wider mb-1 text-right",
|
|
76064
76100
|
children: message.to ? "You \u2192 ".concat(leadLabel(message.to)) : "You"
|
|
76065
76101
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
76066
|
-
className: "px-3 py-2 rounded-lg text-sm
|
|
76102
|
+
className: "px-3 py-2 rounded-lg text-sm whitespace-pre-wrap break-words leading-relaxed ".concat(userBubbleBg, " ").concat(bubbleText),
|
|
76067
76103
|
children: text
|
|
76068
76104
|
})]
|
|
76069
76105
|
})
|
|
@@ -76139,12 +76175,16 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
76139
76175
|
if (isLast) {
|
|
76140
76176
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
76141
76177
|
className: "mb-4",
|
|
76142
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
76143
|
-
|
|
76178
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
76179
|
+
block: true,
|
|
76180
|
+
className: "font-semibold uppercase tracking-wider mb-1",
|
|
76144
76181
|
children: "Assistant"
|
|
76145
76182
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
76146
|
-
className: "text-sm leading-relaxed px-3 py-2 rounded-lg
|
|
76147
|
-
children:
|
|
76183
|
+
className: "text-sm leading-relaxed px-3 py-2 rounded-lg ".concat(bubbleBg),
|
|
76184
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
76185
|
+
className: "italic",
|
|
76186
|
+
children: "Thinking..."
|
|
76187
|
+
})
|
|
76148
76188
|
})]
|
|
76149
76189
|
});
|
|
76150
76190
|
}
|
|
@@ -76152,13 +76192,13 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
76152
76192
|
}
|
|
76153
76193
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
76154
76194
|
className: "mb-4",
|
|
76155
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
76156
|
-
|
|
76195
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
76196
|
+
block: true,
|
|
76197
|
+
className: "font-semibold uppercase tracking-wider mb-1",
|
|
76157
76198
|
children: "Assistant"
|
|
76158
76199
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
76159
|
-
className: "text-sm leading-relaxed px-3 py-2 rounded-lg ".concat(bubbleBg),
|
|
76200
|
+
className: "text-sm leading-relaxed px-3 py-2 rounded-lg ".concat(bubbleBg, " ").concat(bubbleText),
|
|
76160
76201
|
children: [isStreaming && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
76161
|
-
className: "text-gray-200",
|
|
76162
76202
|
children: /*#__PURE__*/jsxRuntime.jsx(StreamingText, {
|
|
76163
76203
|
text: streamingText,
|
|
76164
76204
|
isStreaming: true
|
|
@@ -76191,7 +76231,7 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
76191
76231
|
className: "font-semibold uppercase tracking-wider mb-1",
|
|
76192
76232
|
children: leadLabel(message.from)
|
|
76193
76233
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
76194
|
-
className: "text-sm leading-relaxed px-3 py-2 rounded-lg ".concat(bubbleBg, " ").concat(
|
|
76234
|
+
className: "text-sm leading-relaxed px-3 py-2 rounded-lg ".concat(bubbleBg, " ").concat(bubbleText),
|
|
76195
76235
|
children: message.error ? /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
76196
76236
|
className: statusTokens.error.icon,
|
|
76197
76237
|
children: message.error
|
|
@@ -76227,6 +76267,11 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
76227
76267
|
_ref$isLoading = _ref.isLoading,
|
|
76228
76268
|
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
|
|
76229
76269
|
var scrollRef = React.useRef(null);
|
|
76270
|
+
var _ref2 = React.useContext(DashReact.ThemeContext) || {},
|
|
76271
|
+
currentTheme = _ref2.currentTheme;
|
|
76272
|
+
var t = function t(key) {
|
|
76273
|
+
return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
|
|
76274
|
+
};
|
|
76230
76275
|
React.useEffect(function () {
|
|
76231
76276
|
if (scrollRef.current) {
|
|
76232
76277
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
@@ -76234,13 +76279,15 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
76234
76279
|
}, [messages, streamingText]);
|
|
76235
76280
|
if (messages.length === 0) {
|
|
76236
76281
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
76237
|
-
className: "flex-1 flex items-center justify-center
|
|
76282
|
+
className: "flex-1 flex items-center justify-center",
|
|
76238
76283
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
76239
76284
|
className: "text-center space-y-1",
|
|
76240
76285
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
76241
76286
|
className: "text-2xl",
|
|
76242
76287
|
children: "\uD83D\uDCAC"
|
|
76243
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
76288
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
76289
|
+
block: true,
|
|
76290
|
+
className: "text-sm",
|
|
76244
76291
|
children: "Send a message to start chatting"
|
|
76245
76292
|
})]
|
|
76246
76293
|
})
|
|
@@ -76260,25 +76307,26 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
76260
76307
|
}, message.id || index);
|
|
76261
76308
|
}), isLoading && !streamingRequestId && ((_messages = messages[messages.length - 1]) === null || _messages === void 0 ? void 0 : _messages.role) === "user" && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
76262
76309
|
className: "mb-4",
|
|
76263
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
76264
|
-
|
|
76310
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
76311
|
+
block: true,
|
|
76312
|
+
className: "font-semibold uppercase tracking-wider mb-1",
|
|
76265
76313
|
children: "Assistant"
|
|
76266
76314
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
76267
|
-
className: "text-sm leading-relaxed px-3 py-2 rounded-lg
|
|
76315
|
+
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")),
|
|
76268
76316
|
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
76269
76317
|
className: "inline-flex gap-0.5",
|
|
76270
76318
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
76271
|
-
className: "w-1.5 h-1.5
|
|
76319
|
+
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
|
|
76272
76320
|
style: {
|
|
76273
76321
|
animationDelay: "0ms"
|
|
76274
76322
|
}
|
|
76275
76323
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
76276
|
-
className: "w-1.5 h-1.5
|
|
76324
|
+
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
|
|
76277
76325
|
style: {
|
|
76278
76326
|
animationDelay: "150ms"
|
|
76279
76327
|
}
|
|
76280
76328
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
76281
|
-
className: "w-1.5 h-1.5
|
|
76329
|
+
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
|
|
76282
76330
|
style: {
|
|
76283
76331
|
animationDelay: "300ms"
|
|
76284
76332
|
}
|
|
@@ -76289,6 +76337,47 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
76289
76337
|
});
|
|
76290
76338
|
};
|
|
76291
76339
|
|
|
76340
|
+
/**
|
|
76341
|
+
* LeadMentionMenu — the list the @ shortcut opens above the Assistant's
|
|
76342
|
+
* message box (bot-teams TEAM-013 AC6). Keyboard focus stays in the
|
|
76343
|
+
* textarea (ChatInput moves `activeIndex`), so this is a listbox, not a
|
|
76344
|
+
* focus-taking menu.
|
|
76345
|
+
*/
|
|
76346
|
+
var LeadMentionMenu = function LeadMentionMenu(_ref) {
|
|
76347
|
+
var options = _ref.options,
|
|
76348
|
+
activeIndex = _ref.activeIndex,
|
|
76349
|
+
onPick = _ref.onPick;
|
|
76350
|
+
var _ref2 = React.useContext(DashReact.ThemeContext) || {},
|
|
76351
|
+
currentTheme = _ref2.currentTheme;
|
|
76352
|
+
var t = function t(key) {
|
|
76353
|
+
return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
|
|
76354
|
+
};
|
|
76355
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
76356
|
+
role: "listbox",
|
|
76357
|
+
"aria-label": "Send to",
|
|
76358
|
+
className: "mb-1 max-h-48 overflow-y-auto rounded-lg border shadow ".concat(t("bg-primary-dark"), " ").concat(t("border-primary-dark")),
|
|
76359
|
+
children: options.length === 0 ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
76360
|
+
block: true,
|
|
76361
|
+
className: "px-3 py-2 italic",
|
|
76362
|
+
children: "No team lead matches."
|
|
76363
|
+
}) : options.map(function (option, index) {
|
|
76364
|
+
var active = index === activeIndex;
|
|
76365
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
76366
|
+
role: "option",
|
|
76367
|
+
"aria-selected": active
|
|
76368
|
+
// mousedown so the textarea keeps focus.
|
|
76369
|
+
,
|
|
76370
|
+
onMouseDown: function onMouseDown(e) {
|
|
76371
|
+
e.preventDefault();
|
|
76372
|
+
onPick(option);
|
|
76373
|
+
},
|
|
76374
|
+
className: "px-3 py-1.5 text-xs cursor-pointer ".concat(active ? "".concat(t("bg-secondary-dark"), " ").concat(t("text-secondary-light")) : "".concat(t("text-primary-medium"), " ").concat(t("hover-bg-primary-dark"))),
|
|
76375
|
+
children: option.isAssistant ? "Assistant" : leadLabel(option)
|
|
76376
|
+
}, option.botId || "assistant");
|
|
76377
|
+
})
|
|
76378
|
+
});
|
|
76379
|
+
};
|
|
76380
|
+
|
|
76292
76381
|
var autoResize = function autoResize(el) {
|
|
76293
76382
|
if (!el) return;
|
|
76294
76383
|
el.style.height = "auto";
|
|
@@ -76302,13 +76391,42 @@ var ChatInput = function ChatInput(_ref) {
|
|
|
76302
76391
|
var onSend = _ref.onSend,
|
|
76303
76392
|
onStop = _ref.onStop,
|
|
76304
76393
|
isLoading = _ref.isLoading,
|
|
76305
|
-
disabled = _ref.disabled
|
|
76394
|
+
disabled = _ref.disabled,
|
|
76395
|
+
_ref$leads = _ref.leads,
|
|
76396
|
+
leads = _ref$leads === void 0 ? null : _ref$leads,
|
|
76397
|
+
_ref$onPickRecipient = _ref.onPickRecipient,
|
|
76398
|
+
onPickRecipient = _ref$onPickRecipient === void 0 ? null : _ref$onPickRecipient;
|
|
76399
|
+
var _ref2 = React.useContext(DashReact.ThemeContext) || {},
|
|
76400
|
+
currentTheme = _ref2.currentTheme;
|
|
76401
|
+
var t = function t(key) {
|
|
76402
|
+
return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
|
|
76403
|
+
};
|
|
76306
76404
|
var _useState = React.useState(""),
|
|
76307
76405
|
_useState2 = _slicedToArray(_useState, 2),
|
|
76308
76406
|
input = _useState2[0],
|
|
76309
76407
|
setInput = _useState2[1];
|
|
76310
76408
|
var textareaRef = React.useRef(null);
|
|
76311
76409
|
|
|
76410
|
+
// The @ list is open while the box starts with "@" (and wasn't dismissed
|
|
76411
|
+
// with Esc); the text after "@" filters it.
|
|
76412
|
+
var _useState3 = React.useState(false),
|
|
76413
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
76414
|
+
mentionDismissed = _useState4[0],
|
|
76415
|
+
setMentionDismissed = _useState4[1];
|
|
76416
|
+
var _useState5 = React.useState(0),
|
|
76417
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
76418
|
+
mentionIndex = _useState6[0],
|
|
76419
|
+
setMentionIndex = _useState6[1];
|
|
76420
|
+
var mentionOn = !!onPickRecipient && Array.isArray(leads);
|
|
76421
|
+
var mentionOpen = mentionOn && input.startsWith("@") && !mentionDismissed;
|
|
76422
|
+
var mentionOptions = mentionOpen ? filterRecipients(leads, input.slice(1)) : [];
|
|
76423
|
+
var pickMention = function pickMention(option) {
|
|
76424
|
+
onPickRecipient(option && !option.isAssistant ? option : null);
|
|
76425
|
+
setInput("");
|
|
76426
|
+
setMentionIndex(0);
|
|
76427
|
+
setMentionDismissed(false);
|
|
76428
|
+
};
|
|
76429
|
+
|
|
76312
76430
|
// Auto-resize; re-measure once the input's container actually gets laid
|
|
76313
76431
|
// out (e.g. the panel is expanded).
|
|
76314
76432
|
React.useEffect(function () {
|
|
@@ -76330,10 +76448,10 @@ var ChatInput = function ChatInput(_ref) {
|
|
|
76330
76448
|
// Enter/Send while a reply is still coming in (e.g. the panel's hidden
|
|
76331
76449
|
// greeting right after it opens) queues the message instead of dropping
|
|
76332
76450
|
// it; it goes out — with any edits made meanwhile — once the reply ends.
|
|
76333
|
-
var
|
|
76334
|
-
|
|
76335
|
-
queued =
|
|
76336
|
-
setQueued =
|
|
76451
|
+
var _useState7 = React.useState(false),
|
|
76452
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
76453
|
+
queued = _useState8[0],
|
|
76454
|
+
setQueued = _useState8[1];
|
|
76337
76455
|
var handleSend = function handleSend() {
|
|
76338
76456
|
var trimmed = input.trim();
|
|
76339
76457
|
if (!trimmed) return;
|
|
@@ -76356,19 +76474,54 @@ var ChatInput = function ChatInput(_ref) {
|
|
|
76356
76474
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
76357
76475
|
}, [isLoading, queued]);
|
|
76358
76476
|
var handleChange = function handleChange(e) {
|
|
76359
|
-
|
|
76477
|
+
var value = e.target.value;
|
|
76478
|
+
setInput(value);
|
|
76360
76479
|
// Clearing the box cancels a queued message.
|
|
76361
|
-
if (!
|
|
76480
|
+
if (!value.trim()) setQueued(false);
|
|
76481
|
+
// A fresh "@" (or a changed filter) re-opens the list from the top.
|
|
76482
|
+
if (!value.startsWith("@")) setMentionDismissed(false);
|
|
76483
|
+
setMentionIndex(0);
|
|
76362
76484
|
};
|
|
76363
76485
|
var handleKeyDown = function handleKeyDown(e) {
|
|
76486
|
+
if (mentionOpen) {
|
|
76487
|
+
var count = mentionOptions.length;
|
|
76488
|
+
if (e.key === "ArrowDown" && count) {
|
|
76489
|
+
e.preventDefault();
|
|
76490
|
+
setMentionIndex(function (i) {
|
|
76491
|
+
return (i + 1) % count;
|
|
76492
|
+
});
|
|
76493
|
+
return;
|
|
76494
|
+
}
|
|
76495
|
+
if (e.key === "ArrowUp" && count) {
|
|
76496
|
+
e.preventDefault();
|
|
76497
|
+
setMentionIndex(function (i) {
|
|
76498
|
+
return (i - 1 + count) % count;
|
|
76499
|
+
});
|
|
76500
|
+
return;
|
|
76501
|
+
}
|
|
76502
|
+
if (e.key === "Escape") {
|
|
76503
|
+
e.preventDefault();
|
|
76504
|
+
setMentionDismissed(true);
|
|
76505
|
+
return;
|
|
76506
|
+
}
|
|
76507
|
+
if (e.key === "Enter" && !e.shiftKey || e.key === "Tab") {
|
|
76508
|
+
e.preventDefault();
|
|
76509
|
+
if (count) pickMention(mentionOptions[mentionIndex] || null);
|
|
76510
|
+
return;
|
|
76511
|
+
}
|
|
76512
|
+
}
|
|
76364
76513
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
76365
76514
|
e.preventDefault();
|
|
76366
76515
|
handleSend();
|
|
76367
76516
|
}
|
|
76368
76517
|
};
|
|
76369
76518
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
76370
|
-
className: "flex flex-col gap-1 px-3 py-2 border-t border-
|
|
76371
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
76519
|
+
className: "flex flex-col gap-1 px-3 py-2 border-t ".concat(t("border-primary-dark")),
|
|
76520
|
+
children: [mentionOpen && /*#__PURE__*/jsxRuntime.jsx(LeadMentionMenu, {
|
|
76521
|
+
options: mentionOptions,
|
|
76522
|
+
activeIndex: mentionIndex,
|
|
76523
|
+
onPick: pickMention
|
|
76524
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
76372
76525
|
className: "flex items-end gap-2",
|
|
76373
76526
|
children: [/*#__PURE__*/jsxRuntime.jsx("textarea", {
|
|
76374
76527
|
ref: textareaRef,
|
|
@@ -76378,19 +76531,19 @@ var ChatInput = function ChatInput(_ref) {
|
|
|
76378
76531
|
placeholder: "Type a message...",
|
|
76379
76532
|
disabled: disabled,
|
|
76380
76533
|
rows: 1,
|
|
76381
|
-
className: "flex-1 px-3 py-2
|
|
76382
|
-
}), isLoading ? /*#__PURE__*/jsxRuntime.jsx(
|
|
76534
|
+
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"))
|
|
76535
|
+
}), isLoading ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
76536
|
+
title: "Stop",
|
|
76537
|
+
danger: true,
|
|
76383
76538
|
onClick: onStop,
|
|
76384
|
-
className: "
|
|
76385
|
-
|
|
76386
|
-
|
|
76539
|
+
className: "shrink-0"
|
|
76540
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
76541
|
+
title: "Send",
|
|
76387
76542
|
onClick: handleSend,
|
|
76388
76543
|
disabled: !input.trim() || disabled,
|
|
76389
|
-
className: "
|
|
76390
|
-
children: "Send"
|
|
76544
|
+
className: "shrink-0"
|
|
76391
76545
|
})]
|
|
76392
|
-
}), queued && /*#__PURE__*/jsxRuntime.jsx(
|
|
76393
|
-
className: "text-xs text-gray-500",
|
|
76546
|
+
}), queued && /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
76394
76547
|
children: "Sends when the current reply finishes"
|
|
76395
76548
|
})]
|
|
76396
76549
|
});
|
|
@@ -76404,6 +76557,11 @@ var ToolSelector = function ToolSelector(_ref) {
|
|
|
76404
76557
|
_useState2 = _slicedToArray(_useState, 2),
|
|
76405
76558
|
expanded = _useState2[0],
|
|
76406
76559
|
setExpanded = _useState2[1];
|
|
76560
|
+
var _ref2 = React.useContext(DashReact.ThemeContext) || {},
|
|
76561
|
+
currentTheme = _ref2.currentTheme;
|
|
76562
|
+
var t = function t(key) {
|
|
76563
|
+
return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
|
|
76564
|
+
};
|
|
76407
76565
|
var totalTools = servers.reduce(function (sum, s) {
|
|
76408
76566
|
var _s$tools;
|
|
76409
76567
|
return sum + (((_s$tools = s.tools) === null || _s$tools === void 0 ? void 0 : _s$tools.length) || 0);
|
|
@@ -76416,7 +76574,7 @@ var ToolSelector = function ToolSelector(_ref) {
|
|
|
76416
76574
|
onClick: function onClick() {
|
|
76417
76575
|
return setExpanded(!expanded);
|
|
76418
76576
|
},
|
|
76419
|
-
className: "flex items-center gap-1.5 px-2 py-1 rounded hover
|
|
76577
|
+
className: "flex items-center gap-1.5 px-2 py-1 rounded transition-colors ".concat(t("hover-bg-primary-dark"), " ").concat(t("text-primary-medium")),
|
|
76420
76578
|
children: [/*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
76421
76579
|
xmlns: "http://www.w3.org/2000/svg",
|
|
76422
76580
|
viewBox: "0 0 20 20",
|
|
@@ -76429,31 +76587,31 @@ var ToolSelector = function ToolSelector(_ref) {
|
|
|
76429
76587
|
})
|
|
76430
76588
|
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
76431
76589
|
children: ["Tools (", enabledCount, "/", totalTools, ")"]
|
|
76432
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
76433
|
-
className: "text-gray-600",
|
|
76590
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
76434
76591
|
children: expanded ? "\u25B2" : "\u25BC"
|
|
76435
76592
|
})]
|
|
76436
76593
|
}), expanded && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
76437
|
-
className: "mt-1 p-2
|
|
76594
|
+
className: "mt-1 p-2 rounded-md border max-h-48 overflow-y-auto space-y-2 ".concat(t("bg-primary-dark"), " ").concat(t("border-primary-dark")),
|
|
76438
76595
|
children: servers.map(function (server) {
|
|
76439
76596
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
76440
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
76441
|
-
|
|
76597
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
76598
|
+
block: true,
|
|
76599
|
+
className: "font-medium mb-1",
|
|
76442
76600
|
children: server.serverName
|
|
76443
76601
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
76444
76602
|
className: "space-y-0.5 ml-2",
|
|
76445
76603
|
children: server.tools.map(function (tool) {
|
|
76446
76604
|
return /*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
76447
|
-
className: "flex items-center gap-2 py-0.5 cursor-pointer
|
|
76605
|
+
className: "flex items-center gap-2 py-0.5 cursor-pointer rounded px-1 ".concat(t("hover-bg-primary-dark")),
|
|
76448
76606
|
children: [/*#__PURE__*/jsxRuntime.jsx("input", {
|
|
76449
76607
|
type: "checkbox",
|
|
76450
76608
|
checked: enabledTools[tool.name] !== false,
|
|
76451
76609
|
onChange: function onChange() {
|
|
76452
76610
|
return onToggle(tool.name);
|
|
76453
76611
|
},
|
|
76454
|
-
className: "rounded
|
|
76612
|
+
className: "rounded w-3 h-3"
|
|
76455
76613
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
76456
|
-
className: "
|
|
76614
|
+
className: "font-mono ".concat(t("text-primary-medium")),
|
|
76457
76615
|
children: tool.name
|
|
76458
76616
|
})]
|
|
76459
76617
|
}, tool.name);
|
|
@@ -76607,6 +76765,12 @@ function ChatCore(_ref) {
|
|
|
76607
76765
|
_ref$enableLeadRecipi = _ref.enableLeadRecipients,
|
|
76608
76766
|
enableLeadRecipients = _ref$enableLeadRecipi === void 0 ? false : _ref$enableLeadRecipi;
|
|
76609
76767
|
var mainApi = window.mainApi;
|
|
76768
|
+
var _ref2 = React.useContext(DashReact.ThemeContext) || {},
|
|
76769
|
+
currentTheme = _ref2.currentTheme;
|
|
76770
|
+
var t = function t(key) {
|
|
76771
|
+
return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
|
|
76772
|
+
};
|
|
76773
|
+
var statusTokens = DashReact.useStatusTokens();
|
|
76610
76774
|
|
|
76611
76775
|
// Direct-to-lead state (TEAM-013). recipient null = the Assistant.
|
|
76612
76776
|
var _useState = React.useState(null),
|
|
@@ -76900,9 +77064,9 @@ function ChatCore(_ref) {
|
|
|
76900
77064
|
// ---- Direct-to-lead messages (bot-teams TEAM-013) ----------------------
|
|
76901
77065
|
|
|
76902
77066
|
// Replace the lead's streaming placeholder with its final answer/error.
|
|
76903
|
-
var finishLeadRun = React.useCallback(function (placeholderId,
|
|
76904
|
-
var content =
|
|
76905
|
-
leadError =
|
|
77067
|
+
var finishLeadRun = React.useCallback(function (placeholderId, _ref3) {
|
|
77068
|
+
var content = _ref3.content,
|
|
77069
|
+
leadError = _ref3.error;
|
|
76906
77070
|
var run = leadRunRef.current;
|
|
76907
77071
|
if (run && run.listenerId != null) {
|
|
76908
77072
|
var _mainApi$bots, _mainApi$bots$removeL;
|
|
@@ -77285,82 +77449,101 @@ function ChatCore(_ref) {
|
|
|
77285
77449
|
return ((_s$tools = s.tools) === null || _s$tools === void 0 ? void 0 : _s$tools.length) > 0;
|
|
77286
77450
|
});
|
|
77287
77451
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
77288
|
-
className: "flex flex-col flex-1 overflow-hidden bg-
|
|
77452
|
+
className: "flex flex-col flex-1 overflow-hidden ".concat(t("bg-primary-very-dark"), " ").concat(t("text-primary-medium")),
|
|
77289
77453
|
children: [title ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
77290
|
-
className: "flex items-center justify-between px-3 py-2 border-b
|
|
77454
|
+
className: "flex items-center justify-between px-3 py-2 border-b shrink-0 ".concat(t("border-primary-dark")),
|
|
77291
77455
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
77292
77456
|
className: "flex items-center gap-2",
|
|
77293
77457
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading2, {
|
|
77294
77458
|
title: title
|
|
77295
77459
|
}), isCliBackend && sessionActive && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
77296
|
-
className: "inline-block w-2 h-2 rounded-full
|
|
77460
|
+
className: "inline-block w-2 h-2 rounded-full ".concat(statusTokens.success.solidBg),
|
|
77297
77461
|
title: "CLI session active"
|
|
77298
77462
|
})]
|
|
77299
77463
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
77300
77464
|
className: "flex items-center gap-1",
|
|
77301
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
77465
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
|
|
77466
|
+
size: "sm",
|
|
77302
77467
|
onClick: handleNewChat,
|
|
77303
|
-
className: "px-2 py-1 text-xs rounded bg-gray-700 hover:bg-gray-600 text-gray-300 transition-colors",
|
|
77304
77468
|
children: "New Chat"
|
|
77305
77469
|
})
|
|
77306
77470
|
})]
|
|
77307
77471
|
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
77308
77472
|
className: "flex items-center justify-end px-3 py-1 shrink-0",
|
|
77309
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
77473
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
|
|
77474
|
+
size: "sm",
|
|
77310
77475
|
onClick: handleNewChat,
|
|
77311
|
-
className: "px-2 py-1 text-xs rounded bg-gray-700 hover:bg-gray-600 text-gray-300 transition-colors",
|
|
77312
77476
|
children: "New Chat"
|
|
77313
77477
|
})
|
|
77314
|
-
}), error && /*#__PURE__*/jsxRuntime.
|
|
77315
|
-
className: "mx-3 mt-2
|
|
77316
|
-
children:
|
|
77317
|
-
|
|
77478
|
+
}), error && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
77479
|
+
className: "mx-3 mt-2",
|
|
77480
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.AlertBanner, {
|
|
77481
|
+
variant: "error",
|
|
77482
|
+
size: "compact",
|
|
77483
|
+
message: error,
|
|
77484
|
+
onClose: function onClose() {
|
|
77318
77485
|
return setError(null);
|
|
77319
|
-
}
|
|
77320
|
-
|
|
77321
|
-
children: "Dismiss"
|
|
77322
|
-
})]
|
|
77486
|
+
}
|
|
77487
|
+
})
|
|
77323
77488
|
}), isAnthropicBackend && !apiKey && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
77324
|
-
className: "mx-3 mt-2
|
|
77325
|
-
children:
|
|
77489
|
+
className: "mx-3 mt-2",
|
|
77490
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.AlertBanner, {
|
|
77491
|
+
variant: "warning",
|
|
77492
|
+
size: "compact",
|
|
77493
|
+
message: "Add an Anthropic API key in Settings > AI Assistant to start chatting."
|
|
77494
|
+
})
|
|
77326
77495
|
}), isCliBackend && cliAvailable === null && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
77327
|
-
className: "mx-3 mt-2
|
|
77328
|
-
children:
|
|
77329
|
-
|
|
77330
|
-
|
|
77331
|
-
|
|
77332
|
-
|
|
77333
|
-
|
|
77334
|
-
|
|
77335
|
-
|
|
77336
|
-
|
|
77337
|
-
|
|
77338
|
-
|
|
77339
|
-
|
|
77340
|
-
|
|
77341
|
-
|
|
77342
|
-
|
|
77343
|
-
|
|
77344
|
-
|
|
77345
|
-
|
|
77346
|
-
|
|
77347
|
-
|
|
77348
|
-
|
|
77496
|
+
className: "mx-3 mt-2",
|
|
77497
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.AlertBanner, {
|
|
77498
|
+
variant: "info",
|
|
77499
|
+
size: "compact",
|
|
77500
|
+
message: "Checking for Claude Code CLI..."
|
|
77501
|
+
})
|
|
77502
|
+
}), isCliBackend && cliAvailable === false && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
77503
|
+
className: "mx-3 mt-2",
|
|
77504
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(DashReact.AlertBanner, {
|
|
77505
|
+
variant: "warning",
|
|
77506
|
+
size: "compact",
|
|
77507
|
+
title: "Claude Code CLI not found",
|
|
77508
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("ol", {
|
|
77509
|
+
className: "list-decimal list-inside space-y-1 mb-2",
|
|
77510
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("li", {
|
|
77511
|
+
children: ["Download Claude Code from", " ", /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
77512
|
+
onClick: function onClick() {
|
|
77513
|
+
var _mainApi$shell, _mainApi$shell$openEx;
|
|
77514
|
+
return mainApi === null || mainApi === void 0 || (_mainApi$shell = mainApi.shell) === null || _mainApi$shell === void 0 || (_mainApi$shell$openEx = _mainApi$shell.openExternal) === null || _mainApi$shell$openEx === void 0 ? void 0 : _mainApi$shell$openEx.call(_mainApi$shell, "https://claude.ai/download");
|
|
77515
|
+
},
|
|
77516
|
+
className: "underline font-mono hover:opacity-80",
|
|
77517
|
+
children: "claude.ai/download"
|
|
77518
|
+
})]
|
|
77519
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("li", {
|
|
77520
|
+
children: ["Open your terminal and run", " ", /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
77521
|
+
className: "font-mono",
|
|
77522
|
+
children: "claude auth login"
|
|
77523
|
+
})]
|
|
77524
|
+
}), /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
77525
|
+
children: "Complete authentication in your browser"
|
|
77349
77526
|
})]
|
|
77350
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
77351
|
-
|
|
77527
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
|
|
77528
|
+
size: "sm",
|
|
77529
|
+
onClick: handleCheckCliAgain,
|
|
77530
|
+
children: "Check Again"
|
|
77352
77531
|
})]
|
|
77353
|
-
})
|
|
77354
|
-
onClick: handleCheckCliAgain,
|
|
77355
|
-
className: "px-3 py-1 text-xs rounded bg-yellow-800/60 hover:bg-yellow-700/60 text-yellow-200 border border-yellow-600/50 transition-colors",
|
|
77356
|
-
children: "Check Again"
|
|
77357
|
-
})]
|
|
77532
|
+
})
|
|
77358
77533
|
}), !hideToolsBanner && isAnthropicBackend && !hasTools && apiKey && messages.length === 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
77359
|
-
className: "mx-3 mt-2
|
|
77360
|
-
children:
|
|
77534
|
+
className: "mx-3 mt-2",
|
|
77535
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.AlertBanner, {
|
|
77536
|
+
variant: "info",
|
|
77537
|
+
size: "compact",
|
|
77538
|
+
message: "No MCP tools connected. Connect providers (GitHub, Slack, etc.) to enable tool-use."
|
|
77539
|
+
})
|
|
77361
77540
|
}), isCliBackend && cliAvailable && messages.length === 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
77362
|
-
className: "mx-3 mt-2
|
|
77363
|
-
children:
|
|
77541
|
+
className: "mx-3 mt-2",
|
|
77542
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.AlertBanner, {
|
|
77543
|
+
variant: "info",
|
|
77544
|
+
size: "compact",
|
|
77545
|
+
message: "Using Claude Code CLI. Your configured MCP tools pass through automatically."
|
|
77546
|
+
})
|
|
77364
77547
|
}), hasTools && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
77365
77548
|
className: "px-1 pt-1",
|
|
77366
77549
|
children: /*#__PURE__*/jsxRuntime.jsx(ToolSelector, {
|
|
@@ -77393,6 +77576,11 @@ function ChatCore(_ref) {
|
|
|
77393
77576
|
onStop: handleStop,
|
|
77394
77577
|
isLoading: isLoading,
|
|
77395
77578
|
disabled: !isReady
|
|
77579
|
+
// @ shortcut only where lead recipients are on (the AI Assistant);
|
|
77580
|
+
// elsewhere "@" stays plain text (TEAM-013 AC6).
|
|
77581
|
+
,
|
|
77582
|
+
leads: enableLeadRecipients ? leads : null,
|
|
77583
|
+
onPickRecipient: enableLeadRecipients ? handleRecipientChange : null
|
|
77396
77584
|
})]
|
|
77397
77585
|
});
|
|
77398
77586
|
}
|