@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.js
CHANGED
|
@@ -993,8 +993,22 @@ function AgentContext() {
|
|
|
993
993
|
}
|
|
994
994
|
|
|
995
995
|
// src/components/chat/ChatEmptyState.tsx
|
|
996
|
-
import { BarChart3, LayoutGrid, MessageSquare, Sparkles as Sparkles2, Wand2, Zap } from "lucide-react";
|
|
996
|
+
import { BarChart3, BookOpen, Compass, FileText, Image as ImageIcon, LayoutGrid, Lightbulb, MessageSquare, Mic, Music, Sparkles as Sparkles2, Wand2, Zap } from "lucide-react";
|
|
997
997
|
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
998
|
+
var NAMED_ICONS = {
|
|
999
|
+
sparkles: Sparkles2,
|
|
1000
|
+
wand: Wand2,
|
|
1001
|
+
book: BookOpen,
|
|
1002
|
+
chat: MessageSquare,
|
|
1003
|
+
chart: BarChart3,
|
|
1004
|
+
bolt: Zap,
|
|
1005
|
+
music: Music,
|
|
1006
|
+
mic: Mic,
|
|
1007
|
+
image: ImageIcon,
|
|
1008
|
+
compass: Compass,
|
|
1009
|
+
lightbulb: Lightbulb,
|
|
1010
|
+
file: FileText
|
|
1011
|
+
};
|
|
998
1012
|
var PROMPT_ICONS = [Sparkles2, Wand2, BarChart3, Zap, MessageSquare, LayoutGrid];
|
|
999
1013
|
function splitPrompt(prompt) {
|
|
1000
1014
|
const match = prompt.match(/^(.+?)\s+[—–]\s+(.+)$/) ?? prompt.match(/^(.+?)\s+-\s+(.+)$/);
|
|
@@ -1005,9 +1019,9 @@ function ChatEmptyState() {
|
|
|
1005
1019
|
const { config } = useFrankie();
|
|
1006
1020
|
const { send, busy, restoring } = useFrankieChat();
|
|
1007
1021
|
const name = config?.branding.name ?? "Frankie";
|
|
1008
|
-
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) => {
|
|
1022
|
+
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) => {
|
|
1009
1023
|
const { title, description } = splitPrompt(prompt);
|
|
1010
|
-
return { title, description, message: title };
|
|
1024
|
+
return { title, description, message: title, icon: void 0 };
|
|
1011
1025
|
});
|
|
1012
1026
|
return /* @__PURE__ */ jsxs2("section", { className: "frankie-page-empty", "aria-label": "Start a conversation", children: [
|
|
1013
1027
|
/* @__PURE__ */ jsxs2("div", { className: "frankie-page-welcome", children: [
|
|
@@ -1020,7 +1034,7 @@ function ChatEmptyState() {
|
|
|
1020
1034
|
starters.length ? /* @__PURE__ */ jsxs2("div", { className: "frankie-page-suggest", children: [
|
|
1021
1035
|
/* @__PURE__ */ jsx7("p", { className: "frankie-page-suggest-label", children: "Try asking me to" }),
|
|
1022
1036
|
/* @__PURE__ */ jsx7("div", { className: "frankie-page-prompts", children: starters.map((card, index) => {
|
|
1023
|
-
const Icon = PROMPT_ICONS[index % PROMPT_ICONS.length];
|
|
1037
|
+
const Icon = card.icon && NAMED_ICONS[card.icon] || PROMPT_ICONS[index % PROMPT_ICONS.length];
|
|
1024
1038
|
return /* @__PURE__ */ jsxs2("button", { type: "button", disabled: busy || restoring, onClick: () => void send(card.message), children: [
|
|
1025
1039
|
/* @__PURE__ */ jsx7("span", { className: "frankie-prompt-icon", "aria-hidden": true, children: /* @__PURE__ */ jsx7(Icon, { size: 18 }) }),
|
|
1026
1040
|
/* @__PURE__ */ jsxs2("span", { className: "frankie-prompt-text", children: [
|
|
@@ -1419,7 +1433,8 @@ function renderToken(token) {
|
|
|
1419
1433
|
}
|
|
1420
1434
|
|
|
1421
1435
|
// src/components/chat/ToolActivityList.tsx
|
|
1422
|
-
import { Check, ChevronDown, Loader2, ShieldAlert, Wrench, X as X2 } from "lucide-react";
|
|
1436
|
+
import { Check, ChevronDown, Loader2, ShieldAlert, Sparkles as Sparkles3, Wrench, X as X2 } from "lucide-react";
|
|
1437
|
+
import { SKILL_TOOL_NAME } from "@frankieai/core";
|
|
1423
1438
|
|
|
1424
1439
|
// src/components/ui/badge.tsx
|
|
1425
1440
|
import { cva as cva2 } from "class-variance-authority";
|
|
@@ -1467,8 +1482,9 @@ function ToolActivityList({ tools, renderTool }) {
|
|
|
1467
1482
|
] });
|
|
1468
1483
|
}
|
|
1469
1484
|
function ToolActivityRow({ tool }) {
|
|
1485
|
+
const isSkill = tool.name === SKILL_TOOL_NAME;
|
|
1470
1486
|
return /* @__PURE__ */ jsxs5(Badge, { variant: badgeVariant(tool.status), title: tool.detail ?? tool.name, children: [
|
|
1471
|
-
/* @__PURE__ */ jsx13(ToolIcon, { status: tool.status }),
|
|
1487
|
+
isSkill && tool.status !== "running" ? /* @__PURE__ */ jsx13(Sparkles3, { className: "size-3", "aria-hidden": "true" }) : /* @__PURE__ */ jsx13(ToolIcon, { status: tool.status }),
|
|
1472
1488
|
/* @__PURE__ */ jsx13("span", { className: "truncate", children: tool.label })
|
|
1473
1489
|
] });
|
|
1474
1490
|
}
|