@frankieai/react 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs
CHANGED
|
@@ -1060,6 +1060,20 @@ function AgentContext() {
|
|
|
1060
1060
|
// src/components/chat/ChatEmptyState.tsx
|
|
1061
1061
|
var import_lucide_react2 = require("lucide-react");
|
|
1062
1062
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1063
|
+
var NAMED_ICONS = {
|
|
1064
|
+
sparkles: import_lucide_react2.Sparkles,
|
|
1065
|
+
wand: import_lucide_react2.Wand2,
|
|
1066
|
+
book: import_lucide_react2.BookOpen,
|
|
1067
|
+
chat: import_lucide_react2.MessageSquare,
|
|
1068
|
+
chart: import_lucide_react2.BarChart3,
|
|
1069
|
+
bolt: import_lucide_react2.Zap,
|
|
1070
|
+
music: import_lucide_react2.Music,
|
|
1071
|
+
mic: import_lucide_react2.Mic,
|
|
1072
|
+
image: import_lucide_react2.Image,
|
|
1073
|
+
compass: import_lucide_react2.Compass,
|
|
1074
|
+
lightbulb: import_lucide_react2.Lightbulb,
|
|
1075
|
+
file: import_lucide_react2.FileText
|
|
1076
|
+
};
|
|
1063
1077
|
var PROMPT_ICONS = [import_lucide_react2.Sparkles, import_lucide_react2.Wand2, import_lucide_react2.BarChart3, import_lucide_react2.Zap, import_lucide_react2.MessageSquare, import_lucide_react2.LayoutGrid];
|
|
1064
1078
|
function splitPrompt(prompt) {
|
|
1065
1079
|
const match = prompt.match(/^(.+?)\s+[—–]\s+(.+)$/) ?? prompt.match(/^(.+?)\s+-\s+(.+)$/);
|
|
@@ -1070,9 +1084,9 @@ function ChatEmptyState() {
|
|
|
1070
1084
|
const { config } = useFrankie();
|
|
1071
1085
|
const { send, busy, restoring } = useFrankieChat();
|
|
1072
1086
|
const name = config?.branding.name ?? "Frankie";
|
|
1073
|
-
const starters = config?.starterPrompts?.length ? config.starterPrompts.slice(0, 6).map((card) => ({ title: card.title, description: card.description, message: card.message })) : (config?.suggestedPrompts ?? []).slice(0, 6).map((prompt) => {
|
|
1087
|
+
const starters = config?.starterPrompts?.length ? config.starterPrompts.slice(0, 6).map((card) => ({ title: card.title, description: card.description, message: card.message, icon: card.icon })) : (config?.suggestedPrompts ?? []).slice(0, 6).map((prompt) => {
|
|
1074
1088
|
const { title, description } = splitPrompt(prompt);
|
|
1075
|
-
return { title, description, message: title };
|
|
1089
|
+
return { title, description, message: title, icon: void 0 };
|
|
1076
1090
|
});
|
|
1077
1091
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "frankie-page-empty", "aria-label": "Start a conversation", children: [
|
|
1078
1092
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "frankie-page-welcome", children: [
|
|
@@ -1085,7 +1099,7 @@ function ChatEmptyState() {
|
|
|
1085
1099
|
starters.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "frankie-page-suggest", children: [
|
|
1086
1100
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "frankie-page-suggest-label", children: "Try asking me to" }),
|
|
1087
1101
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "frankie-page-prompts", children: starters.map((card, index) => {
|
|
1088
|
-
const Icon = PROMPT_ICONS[index % PROMPT_ICONS.length];
|
|
1102
|
+
const Icon = card.icon && NAMED_ICONS[card.icon] || PROMPT_ICONS[index % PROMPT_ICONS.length];
|
|
1089
1103
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", disabled: busy || restoring, onClick: () => void send(card.message), children: [
|
|
1090
1104
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "frankie-prompt-icon", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: 18 }) }),
|
|
1091
1105
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "frankie-prompt-text", children: [
|
|
@@ -1485,6 +1499,7 @@ function renderToken(token) {
|
|
|
1485
1499
|
|
|
1486
1500
|
// src/components/chat/ToolActivityList.tsx
|
|
1487
1501
|
var import_lucide_react5 = require("lucide-react");
|
|
1502
|
+
var import_core = require("@frankieai/core");
|
|
1488
1503
|
|
|
1489
1504
|
// src/components/ui/badge.tsx
|
|
1490
1505
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
@@ -1532,8 +1547,9 @@ function ToolActivityList({ tools, renderTool }) {
|
|
|
1532
1547
|
] });
|
|
1533
1548
|
}
|
|
1534
1549
|
function ToolActivityRow({ tool }) {
|
|
1550
|
+
const isSkill = tool.name === import_core.SKILL_TOOL_NAME;
|
|
1535
1551
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Badge, { variant: badgeVariant(tool.status), title: tool.detail ?? tool.name, children: [
|
|
1536
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToolIcon, { status: tool.status }),
|
|
1552
|
+
isSkill && tool.status !== "running" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react5.Sparkles, { className: "size-3", "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToolIcon, { status: tool.status }),
|
|
1537
1553
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "truncate", children: tool.label })
|
|
1538
1554
|
] });
|
|
1539
1555
|
}
|