jules e4294fe896 feat: starter_suggestions on AgentRef → "Try saying…" empty state
Lets the host app feed a small list of click-to-send prompts that the
dock shows above the empty composer on first chat. Solves the
"users don't know what to ask it" problem without baking the curation
into the lib — the app picks what to suggest (e.g. derived from the
agent's focus areas).

Changes:
- AgentRef gains optional starter_suggestions?: string[].
- Empty-bubbles render: when present, shows a "Try saying" header +
  bulleted list of clickable rows (capped at 4 — more makes the
  panel feel heavy). Click sends the prompt verbatim via the same
  sendMessage path as the composer.
- Falls back to the existing "Ask anything." line when none provided.
- Subtle hint "Click any to send — or write your own." nudges
  toward custom prompts.

Suggestions disappear naturally after the first message — the panel
only renders when bubbles is empty.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-07 20:15:40 +10:00
2026-05-20 16:05:12 +10:00

lib-agent-dock-ui

@crema/agent-dock-ui — the global assistant dock: a floating Sparkles FAB that opens a right-side slide-over chat with an agents-platform agent.

The dock runs in-process in the host app (it needs DOM access for rich-block rendering and the action bus), so it ships as a lib, not an iframe or a CDN widget. The shell, threading, compose box, and rich-block rendering live here; the app injects:

  • identityresolveAgents() returns the agent(s) the user can talk to. One → no picker; many → a dropdown.
  • contextgetPageContext() returns a structured PageContext ({route, resource?, label?}). It travels to the platform as its own field, never concatenated into the message, so page content can't masquerade as a user instruction.
  • transportAgentDockTransport.chat(). Auth is closed over inside the transport (the app builds it from its @crema/arcadia-agents-client instance); the dock never sees a token.

Usage

import { AgentDock } from "@crema/agent-dock-ui"
import { chat, listAgents } from "~/lib/api/arcadia"

<AgentDock
  transport={{ chat }}
  resolveAgents={() => listAgents(tenantId, { archived: "false" })}
  defaultAgentId={profile.defaultAgentId}
  getPageContext={() => ({ route: location.pathname })}
  onExpand={({ agentId }) => navigate(`/agents/${agentId}/chat`)}
  hidden={isChatRoute}
/>

Mount once, near the app root. hidden is app-computed per-route suppression. onExpand is optional — omit it to hide the ⤢ button.

Dependencies

  • @crema/agent-uiMessageBody (rich-block rendering)
  • react, lucide-react

Theme contract: consumes the --chat-user-bg/-fg and --chat-assistant-bg/-fg/-border tokens (every Crema theme defines them).

Description
@crema/agent-dock-ui — global assistant dock (floating FAB + slide-over chat)
Readme 74 KiB
Languages
TypeScript 100%