Skip to main content
The Chat Console Panel is the primary operator interface for interacting with the Palyra daemon. Unlike a standard chat UI, it is designed as a multi-column workspace that separates the conversational flow from technical signals, tool payloads, and session lineage. It manages complex state including bidirectional streaming, human-in-the-loop approvals, and context budget estimation.

Component Architecture

The system is centered around ChatConsolePanel.tsx, which orchestrates several specialized hooks and sub-components to provide a unified “Operator Surface”.

Core Layout & Data Flow

The UI is divided into three primary functional areas:
  1. Sessions Sidebar (ChatSessionsSidebar): Handles session lifecycle, branching, and switching apps/web/src/chat/ChatConsoleWorkspaceView.tsx#143-154.
  2. Conversation Column (ChatTranscript & ChatComposer): The main interaction area for message history and input apps/web/src/chat/ChatConsoleWorkspaceView.tsx#156-187.
  3. Inspector Column (ChatInspectorColumn): A technical sidebar that surfaces tool payloads, A2UI documents, background tasks, and lineage metadata apps/web/src/chat/ChatInspectorColumn.tsx#160-182.

Natural Language to Code Entity Mapping

This diagram illustrates how user-facing UI components map to the underlying React hooks and API services. UI to Code Entity Bridge Sources: apps/web/src/chat/ChatConsolePanel.tsx#125-168, apps/web/src/chat/ChatConsoleWorkspaceView.tsx#142-190, apps/web/src/chat/chatCommandRegistry.ts#33-36

Run Streaming & Transcript Management

The useChatRunStream hook is the heart of the interaction logic. It manages the NDJSON stream from the daemon’s RunStream endpoint and updates the local transcript state in real-time.

Transcript Logic

Approval Workflow UI

When an agent proposes a sensitive tool, the daemon emits an approval_request. The UI renders ApprovalRequestControls which allows the operator to:
  1. Set Scope: Choose between once, session, or timeboxed apps/web/src/chat/chatShared.tsx#163-169.
  2. Define TTL: Set a time-to-live for the approval in milliseconds apps/web/src/chat/chatShared.tsx#177-188.
  3. Provide Reason: Add context for the decision apps/web/src/chat/chatShared.tsx#189-199.
Sources: apps/web/src/chat/ChatConsolePanel.tsx#159-162, apps/web/src/chat/chatShared.tsx#141-221

Chat Composer & Slash Commands

The ChatComposer provides a rich input experience with real-time feedback on context and commands.

Slash Command System

The useChatSlashPalette hook provides a “palette” of available commands (e.g., /branch, /undo, /delegate) based on the chatCommandRegistry apps/web/src/chat/useChatSlashPalette.ts#62-72.

Context Budget & Recall Preview

The composer includes a ContextBudgetSummary to prevent context overflow before sending a message. Sources: apps/web/src/chat/ChatComposer.tsx#152-169, apps/web/src/chat/useChatSlashPalette.ts#101-122, apps/web/src/chat/chatShared.tsx#29-30

Implementation Detail: Interaction Flow

The following diagram maps the sequence of a chat run from the user input to the gRPC-backed streaming response. Chat Execution Sequence Sources: apps/web/src/chat/chatSessionActions.ts#153-194, apps/web/src/chat/useChatRunStream.ts#151-168, apps/web/src/chat/ChatConsolePanel.tsx#132-168

Canvas Sandboxing

The system supports a “Canvas” feature for rendering interactive or visual content. Sources: apps/web/src/chat/chatShared.tsx#31-34