@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frankieai/react",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "Embeddable, themeable chat widget for the Frankie onboarding agent — shadcn/ui components, works with or without Tailwind in the host app.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -31,7 +31,7 @@
31
31
  "clsx": "^2.1.1",
32
32
  "lucide-react": "^0.460.0",
33
33
  "tailwind-merge": "^2.5.0",
34
- "@frankieai/core": "0.2.4"
34
+ "@frankieai/core": "0.2.5"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@tailwindcss/cli": "^4.0.0",
@@ -1,10 +1,16 @@
1
1
  "use client";
2
2
 
3
- import { BarChart3, LayoutGrid, MessageSquare, Sparkles, Wand2, Zap } from "lucide-react";
3
+ import { BarChart3, BookOpen, Compass, FileText, Image as ImageIcon, LayoutGrid, Lightbulb, MessageSquare, Mic, Music, Sparkles, Wand2, Zap, type LucideIcon } from "lucide-react";
4
4
  import { useFrankie } from "../../hooks/FrankieProvider.jsx";
5
5
  import { useFrankieChat } from "../../hooks/useFrankieChat.js";
6
6
 
7
- /** Rotating icon set for the suggestion cards, so each reads distinctly even when prompts come from config. */
7
+ /** Named icons a starter card may choose (mirrors core's STARTER_PROMPT_ICONS). */
8
+ const NAMED_ICONS: Record<string, LucideIcon> = {
9
+ sparkles: Sparkles, wand: Wand2, book: BookOpen, chat: MessageSquare, chart: BarChart3, bolt: Zap,
10
+ music: Music, mic: Mic, image: ImageIcon, compass: Compass, lightbulb: Lightbulb, file: FileText,
11
+ };
12
+
13
+ /** Rotating icon set for cards without an explicit icon, so each reads distinctly. */
8
14
  const PROMPT_ICONS = [Sparkles, Wand2, BarChart3, Zap, MessageSquare, LayoutGrid];
9
15
 
10
16
  /** A prompt may pack a short description after an em/en dash or a hyphen ("Do X — the details"); split it so the card can show a title and subtitle. Falls back to title-only. */
@@ -31,10 +37,10 @@ export function ChatEmptyState() {
31
37
  // message on click. Otherwise fall back to the string suggestions (authored or
32
38
  // skill-derived), where the card title is also the message that's sent.
33
39
  const starters = config?.starterPrompts?.length
34
- ? config.starterPrompts.slice(0, 6).map(card => ({ title: card.title, description: card.description, message: card.message }))
40
+ ? config.starterPrompts.slice(0, 6).map(card => ({ title: card.title, description: card.description, message: card.message, icon: card.icon }))
35
41
  : (config?.suggestedPrompts ?? []).slice(0, 6).map(prompt => {
36
42
  const { title, description } = splitPrompt(prompt);
37
- return { title, description, message: title };
43
+ return { title, description, message: title, icon: undefined as string | undefined };
38
44
  });
39
45
  return <section className="frankie-page-empty" aria-label="Start a conversation">
40
46
  <div className="frankie-page-welcome">
@@ -44,7 +50,7 @@ export function ChatEmptyState() {
44
50
  {starters.length ? <div className="frankie-page-suggest">
45
51
  <p className="frankie-page-suggest-label">Try asking me to</p>
46
52
  <div className="frankie-page-prompts">{starters.map((card, index) => {
47
- const Icon = PROMPT_ICONS[index % PROMPT_ICONS.length]!;
53
+ const Icon = (card.icon && NAMED_ICONS[card.icon]) || PROMPT_ICONS[index % PROMPT_ICONS.length]!;
48
54
  return <button key={card.title + index} type="button" disabled={busy || restoring} onClick={() => void send(card.message)}>
49
55
  <span className="frankie-prompt-icon" aria-hidden><Icon size={18} /></span>
50
56
  <span className="frankie-prompt-text"><strong>{card.title}</strong>{card.description ? <small>{card.description}</small> : null}</span>
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
 
3
- import { Check, ChevronDown, Loader2, ShieldAlert, Wrench, X } from "lucide-react";
3
+ import { Check, ChevronDown, Loader2, ShieldAlert, Sparkles, Wrench, X } from "lucide-react";
4
+ import { SKILL_TOOL_NAME } from "@frankieai/core";
4
5
  import { Badge } from "../ui/badge.js";
5
6
  import type { ToolActivity } from "../../lib/messages.js";
6
7
 
@@ -28,9 +29,13 @@ export function ToolActivityList({ tools, renderTool }: ToolActivityListProps) {
28
29
  }
29
30
 
30
31
  export function ToolActivityRow({ tool }: { tool: ToolActivity }) {
32
+ // A skill-activation call carries its own icon so "Using skill: X" reads as a
33
+ // skill being applied, not just another tool; the spinner still wins while it
34
+ // runs so its status stays legible.
35
+ const isSkill = tool.name === SKILL_TOOL_NAME;
31
36
  return (
32
37
  <Badge variant={badgeVariant(tool.status)} title={tool.detail ?? tool.name}>
33
- <ToolIcon status={tool.status} />
38
+ {isSkill && tool.status !== "running" ? <Sparkles className="size-3" aria-hidden="true" /> : <ToolIcon status={tool.status} />}
34
39
  <span className="truncate">{tool.label}</span>
35
40
  </Badge>
36
41
  );