Skip to main content
The Chat Interface is the primary operational surface of the Palyra Web Console. It provides a real-time, bidirectional communication channel between the operator and the Core Daemon, integrating streaming execution updates, tool approval workflows, and long-term memory management.

Architecture Overview

The interface is built around the ChatConsolePanel apps/web/src/chat/ChatConsolePanel.tsx#71-77, which orchestrates several specialized sub-components and hooks to manage the lifecycle of a chat session.

Key Components

ComponentRole
ChatConsolePanelTop-level coordinator for state, sessions, and streams.
ChatComposerInput area with slash commands, attachments, and budget estimation.
ChatTranscriptLive-updating feed of messages, tool calls, and A2UI surfaces.
ChatSessionsSidebarNavigation and management for historical and active sessions.
ChatInspectorColumnSide panel for deep-dive into payloads, compactions, and background tasks.

Data Flow and Stream Integration

The interface utilizes the useChatRunStream hook apps/web/src/chat/ChatConsolePanel.tsx#150-156 to manage the bidirectional communication with the daemon. This hook handles the RunStream lifecycle, processing incoming events and updating the local visibleTranscript apps/web/src/chat/ChatConsolePanel.tsx#138.

Chat Interface Communication

Sources: apps/web/src/chat/ChatConsolePanel.tsx#139-156, apps/web/src/chat/useChatRunStream.ts#1-50, apps/web/src/chat/ChatTranscript.tsx#17-19.

ChatComposer and Input Processing

The ChatComposer apps/web/src/chat/ChatComposer.tsx#53-84 handles complex input scenarios beyond simple text, including:

Recall and Context Preview

Before sending a message, the composer integrates two preview systems:
  1. Context References: Resolves symbols (e.g., @file) via useContextReferencePreview apps/web/src/chat/ChatConsolePanel.tsx#57.
  2. Memory Recall: Previews what the agent might “remember” from the JournalStore using useRecallPreview apps/web/src/chat/ChatConsolePanel.tsx#58.
Sources: apps/web/src/chat/ChatComposer.tsx#131-142, apps/web/src/chat/chatShared.tsx#76-163, apps/web/src/chat/chatConsoleUtils.ts#173-195.

Transcript and Tool Approval

The ChatTranscript apps/web/src/chat/ChatTranscript.tsx#27-42 renders a sequence of TranscriptEntry objects. It is optimized for technical clarity by moving heavy JSON payloads out of the main feed.

Inline Approval Workflow

When a tool requires explicit operator consent (e.g., file system modifications), an approval_request entry is rendered apps/web/src/chat/chatShared.tsx#177.

Payload Inspection

To prevent “debug dump” clutter, tool payloads and results are hidden by default. Clicking “Inspect payload” apps/web/src/chat/ChatConsolePanel.test.tsx#115 triggers a callback that populates the ChatInspectorColumn with a PrettyJsonBlock apps/web/src/chat/chatShared.tsx#217-221. Sources: apps/web/src/chat/ChatTranscript.tsx#150-175, apps/web/src/chat/ChatConsolePanel.test.tsx#93-117, apps/web/src/chat/chatShared.tsx#186-203.

Continuity and Compaction (Phase 4)

Long-running sessions utilize the “Phase 4” continuity system to maintain performance.

Session Continuity Entities

Sources: apps/web/src/chat/ChatConsolePanel.tsx#89-106, apps/web/src/chat/chatPhase4Actions.ts#1-21, apps/web/src/console/sections/SessionsSection.tsx#37-42.

Utility and Shared Logic

The chatShared.tsx and chatConsoleUtils.ts files provide the functional backbone for the interface: Sources: apps/web/src/chat/chatShared.tsx#1-30, apps/web/src/chat/chatConsoleUtils.ts#1-30.