feat: add terminal panel components and Zustand store for state management

- Created a barrel export file for terminal panel components.
- Implemented Zustand store for managing terminal panel UI state, including visibility, active terminal, view mode, and terminal ordering.
- Added actions for opening/closing the terminal panel, setting the active terminal, changing view modes, and managing terminal order.
- Introduced selectors for accessing terminal panel state properties.
This commit is contained in:
catlog22
2026-02-12 23:53:11 +08:00
parent e44a97e812
commit ddbe12b7af
72 changed files with 1055 additions and 254 deletions

View File

@@ -15,7 +15,7 @@ import {
type ExecutionLog,
} from '../types/execution';
import { SurfaceUpdateSchema } from '../packages/a2ui-runtime/core/A2UITypes';
import type { ToolCallKind } from '../types/toolCall';
import type { ToolCallKind, ToolCallExecution } from '../types/toolCall';
// Constants
const RECONNECT_DELAY_BASE = 1000; // 1 second
@@ -242,7 +242,7 @@ export function useWebSocket(options: UseWebSocketOptions = {}): UseWebSocketRet
const currentNodeId = stores.currentExecution?.currentNodeId;
if (currentNodeId && (unitType === 'stdout' || unitType === 'stderr')) {
const toolCalls = stores.getToolCallsForNode?.(currentNodeId);
const activeCall = toolCalls?.find(c => c.status === 'executing');
const activeCall = toolCalls?.find((c: ToolCallExecution) => c.status === 'executing');
if (activeCall) {
stores.updateToolCall(currentNodeId, activeCall.callId, {