💬 v0.23.1 — Command Palette AI Chat & Agents
This release brings conversational AI to the command palette: an opt-in chat mode that streams from any OpenAI-compatible endpoint, a new Midwest::LlmAgent controller concern for keeping keys server-side, and agentic tools that let the model run palette commands. Supporting changes land in TimelineComponent and ButtonComponent.
What's New
CommandPaletteComponent — AI chat mode
The command palette gains an opt-in conversational mode via chat:. Toggle to "Chat" (or press Tab from an empty query) and send a message — the reply streams in token-by-token, rendered with a dependency-free native markdown renderer (no external JS libraries). Two transports are supported: a direct browser fetch for local/dev endpoints, and a server proxy for hosted providers where the API key must stay private.
<%= midwest_command_palette( chat: { endpoint: midwest_llm_agent_assistant_index_path }) %>Midwest::LlmAgent — Rails feature
A new controller concern that powers the palette's chat mode while keeping the provider API key, model, and system prompt server-side. Backed by the optional RubyLLM gem, it relays an OpenAI-compatible SSE stream via ActionController::Live and offers durable conversation history through acts_as_chat (history: :fresh or :resume). A generator scaffolds the initializer and controller, and a routing concern (Midwest::Routing::LLM_AGENT) wires the endpoint.
class AssistantController < ApplicationController include Midwest::LlmAgent llm_agent model: 'gpt-4o-mini', provider: :openai, system: 'You are a helpful assistant for this application.', chat_model: Chat, history: :freshendbin/rails generate midwest:llm_agentSee the new LLM Agent guide for setup, provider configuration, and security notes.
Agentic tools
The model can drive the palette. Server tools are RubyLLM::Tool classes passed to tools: — RubyLLM runs the execute → result → continue loop server-side and persists each call. Command tools (tools: :commands) turn the palette's own commands into tools: the agent streams an inline action row plus a client directive that runs the command in the browser, reusing the palette's existing selection path. Command tools are gated by a server-side allowlist derived only from the commands the client posted, so the model can't reach anything a user couldn't click.
llm_agent model: 'gpt-4o-mini', tools: :commandsNative tool calling requires a tool-capable model; against a small local model the agent degrades gracefully to plain chat.
What Changed
TimelineComponent — chat: conversation variant
TimelineComponent gains a conversation-style variant with per-item left/right placement, giving the palette's chat transcript its threaded look. The same alternating layout is available directly on the component.
ButtonComponent — type-relative sizing
Button sizing is now type-relative: font-size is expressed in rem while box metrics (padding, radius, icon spacing) use em, so buttons scale cleanly with their surrounding text context. This keeps the chat action rows and inline palette controls visually consistent.
What Was Removed
Nothing was removed in this release. All changes are additive or behavior-preserving.
Dev Process
Component screen recordings
A new bin/record tool (with scripts/record-component.mjs) captures short .webm screen recordings of each component's Lookbook preview, driven by per-component scenario files under demo/recordings/. This release publishes recordings for the full elements catalog, with scripts/stamp-scenario-hash.rb keeping scenarios in sync with their source.
Release & publishing tooling
bin/publish-release-notes— new script for publishing release notes.bin/release— updated to fit the new publish flow.AGENTS.mdadded to document agent-facing conventions.
Docs & planning
- New
Midwest::LlmAgentRails feature guide (rails_features/11_llm_agent). COMMAND_PALLETE_CHAT.mddesign plan captured for the chat feature.accessibility.ymlupdated with command palette chat data.
Expanded test coverage
CommandPaletteComponentTestextended for chat mode, plus acommand_palette_chat_system_testend-to-end system test.- New
Midwest::LlmAgentconcern test (llm_agent_test). TimelineComponentTestupdated for the conversation variant.